!function(j,z,$){"use strict";functionI(e){return"function"==typeofe&&"number"!=typeofe.nodeType}z=void0!==z&&z.Math===Math?z:globalThis,j.fn.form=function(V){varA,D=j(this),F=j(z),R=Date.now(),S=[],T=V,L="string"==typeofT,O=[].slice.call(arguments,1);returnD.each(function(){vari,f,e,t,m,c,g,p,h,n,u,r,a,l,o,s,d,v=j(this),b=this,y=[],x=!1,k=!1,E=!1,C=["clean","clean"],w={initialize:function(){w.get.settings(),v.addClass(h.initial),L?(void0===d&&w.instantiate(),w.invoke(T)):(void0!==d&&(d.invoke("destroy"),w.refresh()),w.verbose("Initializing form validation",v,m),w.bindEvents(),w.set.defaults(),m.autoCheckRequired&&w.set.autoCheck(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),d=w,v.data(a,w)},destroy:function(){w.verbose("Destroying previous module",d),w.removeEvents(),v.removeData(a)},refresh:function(){w.verbose("Refreshing selector cache"),i=v.find(p.field),f=v.find(p.group),e=v.find(p.message),v.find(p.prompt),t=v.find(p.submit),v.find(p.clear),v.find(p.reset)},refreshEvents:function(){w.removeEvents(),w.bindEvents()},submit:function(e){w.verbose("Submitting form",v),k=!0,v.trigger("submit"),e&&e.preventDefault()},attachEvents:function(e,t){t=t||"submit",j(e).on("click"+l,function(e){w[t](),e.preventDefault()}),o=e,s=t},bindEvents:function(){w.verbose("Attaching form events"),v.on("submit"+l,w.validate.form).on("blur"+l,p.field,w.event.field.blur).on("click"+l,p.submit,w.submit).on("click"+l,p.reset,w.reset).on("click"+l,p.clear,w.clear),i.on("invalid"+l,w.event.field.invalid),m.keyboardShortcuts&&v.on("keydown"+l,p.field,w.event.field.keydown),i.each(function(e,t){vart=j(t),n=t.prop("type"),n=w.get.changeEvent(n,t);t.on(n+l,w.event.field.change)}),m.preventLeaving&&F.on("beforeunload"+l,w.event.beforeUnload),i.on("change"+l+" click"+l+" keyup"+l+" keydown"+l+" blur"+l,function(e){w.determine.isDirty()}),v.on("dirty"+l,function(e){m.onDirty.call()}),v.on("clean"+l,function(e){m.onClean.call()}),o&&w.attachEvents(o,s)},clear:function(){i.each(function(e,t){vart=j(t),n=t.parent(),r=t.closest(f),i=r.find(p.prompt),a=t.closest(p.uiCalendar),o=t.data(g.defaultValue)||"",l=t.is(p.checkbox),s=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),u=0<a.length&&w.can.useElement("calendar");r.hasClass(h.error)&&(w.verbose("Resetting error on field",r),r.removeClass(h.error),i.remove()),s?(w.verbose("Resetting dropdown value",n,o),n.dropdown("clear",!0)):l?t.prop("checked",!1):u?a.calendar("clear"):(w.verbose("Resetting field value",t,o),t.val(""))}),w.remove.states()},reset:function(){i.each(function(e,t){vart=j(t),n=t.parent(),r=t.closest(f),i=t.closest(p.uiCalendar),a=r.find(p.prompt),o=t.data(g.defaultValue),l=t.is(p.checkbox),s=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),u=0<i.length&&w.can.useElement("calendar"),c=t.is(p.file),d=r.hasClass(h.error);void0!==o&&(d&&(w.verbose("Resetting error on field",r),r.removeClass(h.error),a.remove()),s?(w.verbose("Resetting dropdown value",n,o),n.dropdown("restore defaults",!0)):l?(w.verbose("Resetting checkbox value",t,o),t.prop("checked",o)):u?i.calendar("set date",o):(w.verbose("Resetting field value",t,o),t.val(c?"":o)))}),w.remove.states()},determine:{isValid:function(){varr=!0;returni.each(function(e,t){vart=j(t),n=w.get.validation(t)||{},t=w.get.identifier(n,t);w.validate.field(n,t,!0)||(r=!1)}),r},isDirty:function(e){varr=!1;i.each(function(e,t){vart=j(t),n=0<t.filter(p.checkbox).length?w.is.checkboxDirty(t):w.is.fieldDirty(t);t.data(m.metadata.isDirty,n),r=r||n}),r?w.set.dirty():w.set.clean()}},is:{bracketedRule:function(e){returne.type&&e.type.match(m.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"):w.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){varr=!0;returne?(w.verbose("Checking if field is valid",e),w.validate.field(c[e],e,!!n)):(w.verbose("Checking if form is valid"),j.each(c,function(e,t){w.is.valid(e,n)||(r=!1)}),r)},dirty:function(){returnE},clean:fu