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