!function($,I,O,L){"use strict";$.isFunction=$.isFunction||function(e){return"function"==typeofe&&"number"!=typeofe.nodeType},I=void0!==I&&I.Math==Math?I:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),$.fn.form=function(C){varw,V=$(this),A=V.selector||"",D=(newDate).getTime(),F=[],R=C,S=arguments[1],T="string"==typeofR,j=[].slice.call(arguments,1);returnV.each(function(){varn,d,t,e,f,s,m,p,g,r,c,i,a,l,v,u=$(this),b=this,y=[],x=!1,o=!1,k=!1,E=["clean","clean"],h={initialize:function(){h.get.settings(),T?(v===L&&h.instantiate(),h.invoke(R)):(v!==L&&(v.invoke("destroy"),h.refresh()),h.verbose("Initializing form validation",u,f),h.bindEvents(),h.set.defaults(),f.autoCheckRequired&&h.set.autoCheck(),h.instantiate())},instantiate:function(){h.verbose("Storing instance of module",h),v=h,u.data(a,h)},destroy:function(){h.verbose("Destroying previous module",v),h.removeEvents(),u.removeData(a)},refresh:function(){h.verbose("Refreshing selector cache"),n=u.find(p.field),d=u.find(p.group),t=u.find(p.message),u.find(p.prompt),e=u.find(p.submit),u.find(p.clear),u.find(p.reset)},submit:function(){h.verbose("Submitting form",u),o=!0,u.submit()},attachEvents:function(e,t){t=t||"submit",$(e).on("click"+l,function(e){h[t](),e.preventDefault()})},bindEvents:function(){h.verbose("Attaching form events"),u.on("submit"+l,h.validate.form).on("blur"+l,p.field,h.event.field.blur).on("click"+l,p.submit,h.submit).on("click"+l,p.reset,h.reset).on("click"+l,p.clear,h.clear),f.keyboardShortcuts&&u.on("keydown"+l,p.field,h.event.field.keydown),n.each(function(e,t){vart=$(t),n=t.prop("type"),n=h.get.changeEvent(n,t);t.on(n+l,h.event.field.change)}),f.preventLeaving&&$(I).on("beforeunload"+l,h.event.beforeUnload),n.on("change click keyup keydown blur",function(e){h.determine.isDirty()}),u.on("dirty"+l,function(e){f.onDirty.call()}),u.on("clean"+l,function(e){f.onClean.call()})},clear:function(){n.each(function(u,e){vare=$(e),t=e.parent(),n=e.closest(d),r=n.find(p.prompt),i=e.closest(p.uiCalendar),a=e.data(m.defaultValue)||"",o=t.is(p.uiCheckbox),l=t.is(p.uiDropdown)&&h.can.useElement("dropdown"),s=0<i.length&&h.can.useElement("calendar");n.hasClass(g.error)&&(h.verbose("Resetting error on field",n),n.removeClass(g.error),r.remove()),l?(h.verbose("Resetting dropdown value",t,a),t.dropdown("clear",!0)):o?e.prop("checked",!1):s?i.calendar("clear"):(h.verbose("Resetting field value",e,a),e.val(""))}),h.remove.states()},reset:function(){n.each(function(c,e){vare=$(e),t=e.parent(),n=e.closest(d),r=e.closest(p.uiCalendar),i=n.find(p.prompt),a=e.data(m.defaultValue),o=t.is(p.uiCheckbox),l=t.is(p.uiDropdown)&&h.can.useElement("dropdown"),s=0<r.length&&h.can.useElement("calendar"),u=n.hasClass(g.error);a!==L&&(u&&(h.verbose("Resetting error on field",n),n.removeClass(g.error),i.remove()),l?(h.verbose("Resetting dropdown value",t,a),t.dropdown("restore defaults",!0)):o?(h.verbose("Resetting checkbox value",t,a),e.prop("checked",a)):s?r.calendar("set date",a):(h.verbose("Resetting field value",e,a),e.val(a)))}),h.remove.states()},determine:{isValid:function(){varn=!0;return$.each(s,function(e,t){h.validate.field(t,e,!0)||(n=!1)}),n},isDirty:function(e){varr=!1;n.each(function(e,t){vart=$(t),n=0<t.filter(p.checkbox).length?h.is.checkboxDirty(t):h.is.fieldDirty(t);t.data(f.metadata.isDirty,n),r|=n}),r?h.set.dirty():h.set.clean()}},is:{bracketedRule:function(e){returne.type&&e.type.match(f.regExp.bracket)},shorthandRules:function(e){return"string"==typeofe||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(p.checkbox)?!e.is(":checked"):h.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){varr=!0;returne?(h.verbose("Checking if field is valid",e),h.validate.field(s[e],e,!!n)):(h.verbose("Checking if form is valid"),$.each(s,function(e,t){h.is.valid(e,n)||(r=!1)}),r)},dirty:function(){returnk},clean:function(){return!k},fieldDirty:function(e){vart=e.data(m.defaultValue),e=(null==t?t="":Array.isArray(t)&&(t=t.toString()),e.val()),n=(null==e?e="":Array.isArray(e)&&(e=e.toSt