function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}var _slice=Array.prototype.slice,_slicedToArray=function(){function n(n,t){var r=[],u=!0,f=!1,e=void 0,o,i;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done)&&(r.push(o.value),!t||r.length!==t);u=!0);}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),_extends=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n};!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):n.parsley=t(n.jQuery)}(this,function(n){"use strict";function tt(n,t){return n.parsleyAdaptedCallback||(n.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this);n.apply(t||pt,i)}),n.parsleyAdaptedCallback}function u(n){return 0===n.lastIndexOf(ot,0)?n.substr(ot.length):n}function ht(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(n){return n.originalEvent&&n.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&n(i.target).trigger("input")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),n(document).on("change.inputevent",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&n(document).off("input.inputevent",i.data.selector,t.behavesOk).off("change.inputevent",i.data.selector,t.misbehaves)},install:function(){var f,u,r;if(!i.inputEventPatched)for(i.inputEventPatched="0.0.3",f=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],u=0;u<f.length;u++){r=f[u];n(document).on("input.inputevent",r,{selector:r},t.behavesOk).on("change.inputevent",r,{selector:r},t.misbehaves)}},uninstall:function(){delete i.inputEventPatched;n(document).off(".inputevent")}})}var ct=1,a={},t={attr:function(n,t,i){var r,u,f,e=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(r in i)i.hasOwnProperty(r)&&delete i[r];if(!n)return i;for(f=n.attributes,r=f.length;r--;)u=f[r],u&&u.specified&&e.test(u.name)&&(i[this.camelize(u.name.slice(t.length))]=this.deserializeValue(u.value));return i},checkAttr:function(n,t,i){return n.hasAttribute(t+i)},setAttr:function(n,t,i,r){n.setAttribute(this.dasherize(t+i),String(r))},getType:function(n){return n.getAttribute("type")||"text"},generateID:function(){return""+ct++},deserializeValue:function(n){var t;try{return n?"true"==n||"false"!=n&&("null"==n?null:isNaN(t=Number(n))?/^[\[\{]/.test(n)?JSON.parse(n):n:t):n}catch(i){return n}},camelize:function(n){return n.replace(/-+(.)?/g,function(n,t){return t?t.toUpperCase():""})},dasherize:function(n){return n.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var n;window.console&&"function"==typeof window.console.warn&&(n=window.console).warn.apply(n,arguments)},warnOnce:function(n){a[n]||(a[n]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){a={}},trimString:function(n){return n.replace(/^\s+|\s+$/g,"")},parse:{date:function(n){var r=n.match(/^(\d{4,})-(\d\d)-(\d\d)$/);if(!r)return null;var o=r.map(function(n){return parseInt(n,10)}),t=_slicedToArray(o,4),u=(t[0],t[1]),f=t[2],e=t[3],i=new Date(u,f-1,e);return i.getFullYear()!==u||i.getMonth()+1!==f||i.getDate()!==e?null:i},string:function(n){return n},integer:function(n){return isNaN(n)?null:parseInt(n,10)},number:function(n){if(isNaN(n))throw null;return parseFloat(n)},boolean:function(n){return!/^\s*false\s*$/i.test(n)},object:function(n){return t.deserializeValue(n)},regexp:function(n){var t="";return/^\/.*\/(?:[gimy]*)$/.test(n)?(t=n.replace(/.*\/([gimy]*)$/,"$1"),n=n.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):n="^"+n+"$",new RegExp(n,t)}},parseRequirement:function(n,t){var r=this.parse[n||"string"],i;if(!r)throw'Unknown requirement specification: "'+n+'"';if(i=r(t),null===i)throw"Requirement is not a "+n+': "'+t+'"';return i},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?n.map(t,function(n){return n+"."+i}).join(" "):""},difference:function(t,i){var r=[];return n.each(t,function(n,t){i.indexOf(t)==-1&&r.push(t)}),r},all:function(t){return n.when.apply(n,_toConsumableArray(t).concat([42,42]))},objectCreate:Object.create||function(){var n=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");n.prototype=t;var i=new n;return n.prototype=null,i}}(),_SubmitSelector:'input[type="submit"], button:submit'},it={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(){},errorsContainer:function(){},errorsWrapper:'<ul class="parsley-errors-list"><\/ul>',errorTemplate:"<li><\/li>"},r=function(){this.__id__=t.generateID()},y,c,o,ut,f,b,k,ft,d,et,e,g,h,l,i,nt,st;r.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var i=this,t=function(){var t=n.Deferred();return!0!==i.validationResult&&t.reject(),t.resolve().promise()};return[t,t]},actualizeOptions:function(){return t.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(n){this.domOptions=t.objectCreate(this.parent.options);this.options=t.objectCreate(this.domOptions);for(var i in n)n.hasOwnProperty(i)&&(this.options[i]=n[i]);this.actualizeOptions()},_listeners:null,on:function(n,t){this._listeners=this._listeners||{};var i=this._listeners[n]=this._listeners[n]||[];return i.push(t),this},subscribe:function(t,i){n.listenTo(this,t.toLowerCase(),i)},off:function(n,t){var i=this._listeners&&this._listeners[n],r;if(i)if(t)for(r=i.length;r--;)i[r]===t&&i.splice(r,1);else delete this._listeners[n];return this},unsubscribe:function(t){n.unsubscribeTo(this,t.toLowerCase())},trigger:function(n,t,i){var u,r,f;if(t=t||this,r=this._listeners&&this._listeners[n],r)for(f=r.length;f--;)if(u=r[f].call(t,t,i),u===!1)return u;return!this.parent||this.parent.trigger(n,t,i)},asyncIsValid:function(n,i){return t.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:n,force:i})},_findRelated:function(){return this.options.multiple?n(this.parent.element.querySelectorAll("["+this.options.namespace+'multiple="'+this.options.multiple+'"]')):this.$element}};var lt=function(n,i){var u=n.match(/^\s*\[(.*)\]\s*$/),r;if(!u)throw'Requirement is not an array: "'+n+'"';if(r=u[1].split(",").map(t.trimString),r.length!==i)throw"Requirement has "+r.length+" values when "+i+" are needed";return r},at=function(n,i,r){var e=null,o={},u,f;for(u in n)u?(f=r(u),"string"==typeof f&&(f=t.parseRequirement(n[u],f)),o[u]=f):e=t.parseRequirement(n[u],i);return[e,o]},v=function(t){n.extend(!0,this,t)};v.prototype={validate:function(n,i){if(this.fn)return arguments.length>3&&(i=[].slice.call(arguments,1,-1)),this.fn(n,i);if(Array.isArray(n)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var r=arguments[arguments.length-1];if(this.validateDate&&r._isDateInput())return arguments[0]=t.parse.date(arguments[0]),null!==arguments[0]&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!isNaN(n)&&(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values";},parseRequirements:function(i,r){var u,e,f;if("string"!=typeof i)return Array.isArray(i)?i:[i];if(u=this.requirementType,Array.isArray(u)){for(e=lt(i,u.length),f=0;f<e.length;f++)e[f]=t.parseRequirement(u[f],e[f]);return e}return n.isPlainObject(u)?at(u,i,r):[t.parseRequirement(u,i)]},requirementType:"string",priority:2};y=function(n,t){this.__class__="ValidatorRegistry";this.locale="en";this.init(n||{},t||{})};c={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,date:{test:function(n){return null!==t.parse.date(n)}},url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};c.range=c.number;var p=function(n){var t=(""+n).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},vt=function(n,i){return i.map(t.parse[n])},rt=function(n,t){return function(i){for(var u=arguments.length,f=Array(u>1?u-1:0),r=1;r<u;r++)f[r-1]=arguments[r];return f.pop(),t.apply(void 0,[i].concat(_toConsumableArray(vt(n,f))))}},w=function(n){return{validateDate:rt("date",n),validateNumber:rt("number",n),requirementType:n.length<=2?"string":["string","string"],priority:30}};if(y.prototype={init:function(n,t){this.catalog=t;this.validators=_extends({},this.validators);for(var i in n)this.addValidator(i,n[i].fn,n[i].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(n){if("undefined"==typeof this.catalog[n])throw new Error(n+" is not available in the catalog");return this.locale=n,this},addCatalog:function(n,t,i){return"object"==typeof t&&(this.catalog[n]=t),!0===i?this.setLocale(n):this},addMessage:function(n,t,i){return"undefined"==typeof this.catalog[n]&&(this.catalog[n]={}),this.catalog[n][t]=i,this},addMessages:function(n,t){for(var i in t)this.addMessage(n,i,t[i]);return this},addValidator:function(n){if(this.validators[n])t.warn('Validator "'+n+'" is already defined.');else if(it.hasOwnProperty(n))return void t.warn('"'+n+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},hasValidator:function(n){return!!this.validators[n]},updateValidator:function(n){return this.validators[n]?this._setValidator.apply(this,arguments):(t.warn('Validator "'+n+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(n){return this.validators[n]||t.warn('Validator "'+n+'" is not defined.'),delete this.validators[n],this},_setValidator:function(n,t,i){"object"!=typeof t&&(t={fn:t,priority:i});t.validate||(t=new v(t));this.validators[n]=t;for(var r in t.messages||{})this.addMessage(r,n,t.messages[r]);return this},getErrorMessage:function(n){var t,i;return"type"===n.name?(i=this.catalog[this.locale][n.name]||{},t=i[n.requirements]):t=this.formatMessage(this.catalog[this.locale][n.name],n.requirements),t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(n,t){if("object"==typeof t){for(var i in t)n=this.formatMessage(n,t[i]);return n}return"string"==typeof n?n.replace(/%s/i,t):""},validators:{notblank:{validateString:function(n){return/\S/.test(n)},priority:2},required:{validateMultiple:function(n){return n.length>0},validateString:function(n){return/\S/.test(n)},priority:512},type:{validateString:function(n,t){var e=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=e.step,r=void 0===o?"any":o,s=e.base,h=void 0===s?0:s,l=c[t],u,f,i;if(!l)throw new Error("validator type `"+t+"` is not supported");return l.test(n)?"number"===t&&!/^any$/i.test(r||"")&&((u=Number(n),f=Math.max(p(r),p(h)),p(u)>f)||(i=function(n){return Math.round(n*Math.pow(10,f))},(i(u)-i(h))%i(r)!=0))?!1:!0:!1},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(n,t){return t.test(n)},requirementType:"regexp",priority:64},minlength:{validateString:function(n,t){return n.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(n,t){return n.length<=t},requirementType:"integer",priority:30},length:{validateString:function(n,t,i){return n.length>=t&&n.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(n,t){return n.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(n,t){return n.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(n,t,i){return n.length>=t&&n.length<=i},requirementType:["integer","integer"],priority:30},min:w(function(n,t){return n>=t}),max:w(function(n,t){return n<=t}),range:w(function(n,t,i){return n>=t&&n<=i}),equalto:{validateString:function(t,i){var r=n(i);return r.length?t===r.val():t===i},priority:256}}},o={},ut=function yt(n,t,i){for(var f,u,e=[],o=[],r=0;r<n.length;r++){for(f=!1,u=0;u<t.length;u++)if(n[r].assert.name===t[u].assert.name){f=!0;break}f?o.push(n[r]):e.push(n[r])}return{kept:o,added:e,removed:i?[]:yt(t,n,!0).added}},o.Form={_actualizeTriggers:function(){var n=this;this.$element.on("submit.Parsley",function(t){n.onSubmitValidate(t)});this.$element.on("click.Parsley",t._SubmitSelector,function(t){n.onSubmitButton(t)});!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){var t,n;if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(t=0;t<this.fields.length;t++)if(n=this.fields[t],!0!==n.validationResult&&n.validationResult.length>0&&"undefined"==typeof n.options.noFocus&&(this._focusedField=n.$element,"first"===this.options.focus))break;return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},o.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var n=ut(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult;this._manageStatusClass();this._manageErrorsMessages(n);this._actualizeTriggers();!n.kept.length&&!n.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var t=[],n=0;n<this.validationResult.length;n++)t.push(this.validationResult[n].errorMessage||this._getErrorMessage(this.validationResult[n].assert));return t},addError:function(n){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=t.message,u=t.assert,i=t.updateClass,f=void 0===i||i;this._buildUI();this._addError(n,{message:r,assert:u});f&&this._errorClass()},updateError:function(n){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=t.message,u=t.assert,i=t.updateClass,f=void 0===i||i;this._buildUI();this._updateError(n,{message:r,assert:u});f&&this._errorClass()},removeError:function(n){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],t=i.updateClass,r=void 0===t||t;this._buildUI();this._removeError(n);r&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(n(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var r=i.message,u=i.assert;this._insertErrorWrapper();this._ui.$errorsWrapper.addClass("filled").append(n(this.options.errorTemplate).addClass("parsley-"+t).html(r||this._getErrorMessage(u)))},_updateError:function(n,t){var i=t.message,r=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+n).html(i||this._getErrorMessage(r))},_removeError:function(n){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+n).remove()},_getErrorMessage:function(n){var t=n.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],n.requirements):window.Parsley.getErrorMessage(n)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.element.setAttribute(this.options.namespace+"id",this.__id__);t.$errorClassHandler=this._manageClassHandler();t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__);t.$errorsWrapper=n(this.options.errorsWrapper).attr("id",t.errorsWrapperId);t.lastValidationResult=[];t.validationInformationVisible=!1;this._ui=t}},_manageClassHandler:function(){var i,r;if("string"==typeof this.options.classHandler&&n(this.options.classHandler).length)return n(this.options.classHandler);if(i=this.options.classHandler,"string"==typeof this.options.classHandler&&"function"==typeof window[this.options.classHandler]&&(i=window[this.options.classHandler]),"function"==typeof i){if(r=i.call(this,this),"undefined"!=typeof r&&r.length)return r}else{if("object"==typeof i&&i instanceof jQuery&&i.length)return i;i&&t.warn("The class handler `"+i+"` does not exist in DOM nor as a global JS function")}return this._inputHolder()},_inputHolder:function(){return this.options.multiple&&"SELECT"!==this.element.nodeName?this.$element.parent():this.$element},_insertErrorWrapper:function(){var i=this.options.errorsContainer;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof i){if(n(i).length)return n(i).append(this._ui.$errorsWrapper);"function"==typeof window[i]?i=window[i]:t.warn("The errors container `"+i+"` does not exist in DOM nor as a global JS function")}return"function"==typeof i&&(i=i.call(this,this)),"object"==typeof i&&i.length?i.append(this._ui.$errorsWrapper):this._inputHolder().after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var i,r=this,n=this._findRelated();n.off(".Parsley");this._failedOnce?n.on(t.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){r._validateIfNeeded()}):(i=t.namespaceEvents(this.options.trigger,"Parsley"))&&n.on(i,function(n){r._validateIfNeeded(n)})},_validateIfNeeded:function(n){var t=this;n&&/key|input/.test(n.type)&&(!this._ui||!this._ui.validationInformationVisible)&&this.getValue().length<=this.options.validationThreshold||(this.options.debounce?(window.clearTimeout(this._debounced),this._debounced=window.setTimeout(function(){return t.validate()},this.options.debounce)):this.validate())},_resetUI:function(){this._failedOnce=!1;this._actualizeTriggers();"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI();"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove();delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0;this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0;this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}},f=function(t,i,r){this.__class__="Form";this.element=t;this.$element=n(t);this.domOptions=i;this.options=r;this.parent=window.Parsley;this.fields=[];this.validationResult=null},b={pending:null,resolved:!0,rejected:!1},f.prototype={onSubmitValidate:function(n){var u=this,i,r;!0!==n.parsley&&(i=this._submitSource||this.$element.find(t._SubmitSelector)[0],(this._submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),i&&null!==i.getAttribute("formnovalidate"))||(window.Parsley._remoteCache={},r=this.whenValidate({event:n}),"resolved"===r.state()&&!1!==this._trigger("submit")||(n.stopImmediatePropagation(),n.preventDefault(),"pending"===r.state()&&r.done(function(){u._submit(i)}))))},onSubmitButton:function(n){this._submitSource=n.currentTarget},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=n('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element));i.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(_extends(n.Event("submit"),{parsley:!0}))}},validate:function(i){if(arguments.length>=1&&!n.isPlainObject(i)){t.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var r=_slice.call(arguments),u=r[0],f=r[1],e=r[2];i={group:u,force:f,event:e}}return b[this.whenValidate(i).state()]},whenValidate:function(){var f,i=this,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],o=r.group,s=r.force,u=r.event,e;return this.submitEvent=u,u&&(this.submitEvent=_extends({},u,{preventDefault:function(){t.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`");i.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields(),e=this._withoutReactualizingFormOptions(function(){return n.map(i.fields,function(n){return n.whenValidate({force:s,group:o})})}),(f=t.all(e).done(function(){i._trigger("success")}).fail(function(){i.validationResult=!1;i.focus();i._trigger("error")}).always(function(){i._trigger("validated")})).pipe.apply(f,_toConsumableArray(this._pipeAccordingToValidationResult()))},isValid:function(i){if(arguments.length>=1&&!n.isPlainObject(i)){t.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var r=_slice.call(arguments),u=r[0],f=r[1];i={group:u,force:f}}return b[this.whenValid(i).state()]},whenValid:function(){var u=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],f=i.group,e=i.force,r;return this._refreshFields(),r=this._withoutReactualizingFormOptions(function(){return n.map(u.fields,function(n){return n.whenValid({group:f,force:e})})}),t.all(r)},refresh:function(){return this._refreshFields(),this},reset:function(){for(var n=0;n<this.fields.length;n++)this.fields[n].reset();this._trigger("reset")},destroy:function(){this._destroyUI();for(var n=0;n<this.fields.length;n++)this.fields[n].destroy();this.$element.removeData("Parsley");this._trigger("destroy")},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var i=this,r=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){i.$element.find(i.options.inputs).not(i.options.excluded).each(function(n,t){var r=new window.Parsley.Factory(t,{},i),u;("Field"===r.__class__||"FieldMultiple"===r.__class__)&&!0!==r.options.excluded&&(u=r.__class__+"-"+r.__id__,"undefined"==typeof i.fieldsMappedById[u]&&(i.fieldsMappedById[u]=r,i.fields.push(r)))});n.each(t.difference(r,i.fields),function(n,t){t.reset()})}),this},_withoutReactualizingFormOptions:function(n){var i=this.actualizeOptions,t;return this.actualizeOptions=function(){return this},t=n(),this.actualizeOptions=i,t},_trigger:function(n){return this.trigger("form:"+n)}},k=function(n,t,i,r,u){var e=window.Parsley._validatorRegistry.validators[t],f=new v(e);r=r||n.options[t+"Priority"]||f.priority;u=!0===u;_extends(this,{validator:f,name:t,requirements:i,priority:r,isDomConstraint:u});this._parseRequirements(n.options)},ft=function(n){var t=n[0].toUpperCase();return t+n.slice(1)},k.prototype={validate:function(n,t){var i;return(i=this.validator).validate.apply(i,[n].concat(_toConsumableArray(this.requirementList),[t]))},_parseRequirements:function(n){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return n[t.name+ft(i)]})}},d=function(t,i,r,u){this.__class__="Field";this.element=t;this.$element=n(t);"undefined"!=typeof u&&(this.parent=u);this.options=r;this.domOptions=i;this.constraints=[];this.constraintsByName={};this.validationResult=!0;this._bindConstraints()},et={pending:null,resolved:!0,rejected:!1},d.prototype={validate:function(i){arguments.length>=1&&!n.isPlainObject(i)&&(t.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),i={options:i});var r=this.whenValidate(i);if(!r)return!0;switch(r.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var t,n=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],u=i.force,r=i.group;if(this.refresh(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(t=this.whenValid({force:u,value:this.value,_refreshed:!0}).always(function(){n._reflowUI()}).done(function(){n._trigger("success")}).fail(function(){n._trigger("error")}).always(function(){n._trigger("validated")})).pipe.apply(t,_toConsumableArray(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(n){return"undefined"==typeof n&&(n=this.getValue()),!(!n.length&&!this._isRequired()&&"undefined"==typeof this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==n.inArray(t,this.options.group):this.options.group===t},isValid:function(i){var r;if(arguments.length>=1&&!n.isPlainObject(i)){t.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var u=_slice.call(arguments),f=u[0],e=u[1];i={force:f,value:e}}return r=this.whenValid(i),!r||et[r.state()]},whenValid:function(){var s=this,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],f=r.force,h=void 0!==f&&f,i=r.value,e=r.group,c=r._refreshed,o,u;if(c||this.refresh(),!e||this._isInGroup(e))return(this.validationResult=!0,!this.hasConstraints())?n.when():("undefined"!=typeof i&&null!==i||(i=this.getValue()),!this.needsValidation(i)&&!0!==h)?n.when():(o=this._getGroupedConstraints(),u=[],n.each(o,function(r,f){var e=t.all(n.map(f,function(n){return s._validateConstraint(i,n)}));if(u.push(e),"rejected"===e.state())return!1}),t.all(u))},_validateConstraint:function(i,r){var u=this,f=r.validate(i,this);return!1===f&&(f=n.Deferred().reject()),t.all([f]).fail(function(n){u.validationResult instanceof Array||(u.validationResult=[]);u.validationResult.push({assert:r,errorMessage:"string"==typeof n&&n})})},getValue:function(){var n;return n="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof n||null===n?"":this._handleWhitespace(n)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI();this.$element.removeData("Parsley");this.$element.removeData("FieldMultiple");this._trigger("destroy")},refresh:function(){return this._refreshConstraints(),this},_refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},refreshConstraints:function(){return t.warnOnce("Parsley's refreshConstraints is deprecated. Please use refresh"),this.refresh()},addConstraint:function(n,t,i,r){if(window.Parsley._validatorRegistry.validators[n]){var u=new k(this,n,t,i,r);"undefined"!==this.constraintsByName[u.name]&&this.removeConstraint(u.name);this.constraints.push(u);this.constraintsByName[u.name]=u}return this},removeConstraint:function(n){for(var t=0;t<this.constraints.length;t++)if(n===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[n],this},updateConstraint:function(n,t,i){return this.removeConstraint(n).addConstraint(n,t,i)},_bindConstraints:function(){for(var t,i=[],r={},n=0;n<this.constraints.length;n++)!1===this.constraints[n].isDomConstraint&&(i.push(this.constraints[n]),r[this.constraints[n].name]=this.constraints[n]);this.constraints=i;this.constraintsByName=r;for(t in this.options)this.addConstraint(t,this.options[t],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){var n,i,r;return null!==this.element.getAttribute("required")&&this.addConstraint("required",!0,void 0,!0),null!==this.element.getAttribute("pattern")&&this.addConstraint("pattern",this.element.getAttribute("pattern"),void 0,!0),n=this.element.getAttribute("min"),i=this.element.getAttribute("max"),null!==n&&null!==i?this.addConstraint("range",[n,i],void 0,!0):null!==n?this.addConstraint("min",n,void 0,!0):null!==i&&this.addConstraint("max",i,void 0,!0),null!==this.element.getAttribute("minlength")&&null!==this.element.getAttribute("maxlength")?this.addConstraint("length",[this.element.getAttribute("minlength"),this.element.getAttribute("maxlength")],void 0,!0):null!==this.element.getAttribute("minlength")?this.addConstraint("minlength",this.element.getAttribute("minlength"),void 0,!0):null!==this.element.getAttribute("maxlength")&&this.addConstraint("maxlength",this.element.getAttribute("maxlength"),void 0,!0),r=t.getType(this.element),"number"===r?this.addConstraint("type",["number",{step:this.element.getAttribute("step")||"1",base:n||this.element.getAttribute("value")}],void 0,!0):/^(email|url|range|date)$/i.test(r)?this.addConstraint("type",r,void 0,!0):this},_isRequired:function(){return"undefined"!=typeof this.constraintsByName.required&&!1!==this.constraintsByName.required.requirements},_trigger:function(n){return this.trigger("field:"+n)},_handleWhitespace:function(n){return!0===this.options.trimValue&&t.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(n=n.replace(/\s{2,}/g," ")),"trim"!==this.options.whitespace&&"squish"!==this.options.whitespace&&!0!==this.options.trimValue||(n=t.trimString(n)),n},_isDateInput:function(){var n=this.constraintsByName.type;return n&&"date"===n.requirements},_getGroupedConstraints:function(){var t;if(!1===this.options.priorityEnabled)return[this.constraints];for(var i=[],r={},n=0;n<this.constraints.length;n++)t=this.constraints[n].priority,r[t]||i.push(r[t]=[]),r[t].push(this.constraints[n]);return i.sort(function(n,t){return t[0].priority-n[0].priority}),i}},e=d,g=function(){this.__class__="FieldMultiple"},g.prototype={addElement:function(n){return this.$elements.push(n),this},_refreshConstraints:function(){var i,r,t;if(this.constraints=[],"SELECT"===this.element.nodeName)return this.actualizeOptions()._bindConstraints(),this;for(r=0;r<this.$elements.length;r++)if(n("html").has(this.$elements[r]).length)for(i=this.$elements[r].data("FieldMultiple")._refreshConstraints().constraints,t=0;t<i.length;t++)this.addConstraint(i[t].name,i[t].requirements,i[t].priority,i[t].isDomConstraint);else this.$elements.splice(r,1);return this},getValue:function(){var i,r;if("function"==typeof this.options.value)return this.options.value(this);if("undefined"!=typeof this.options.value)return this.options.value;if("INPUT"===this.element.nodeName){if(i=t.getType(this.element),"radio"===i)return this._findRelated().filter(":checked").val()||"";if("checkbox"===i)return r=[],this._findRelated().filter(":checked").each(function(){r.push(n(this).val())}),r}return"SELECT"===this.element.nodeName&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}},h=function(t,i,r){this.element=t;this.$element=n(t);var u=this.$element.data("Parsley");if(u)return"undefined"!=typeof r&&u.parent===window.Parsley&&(u.parent=r,u._resetOptions(u.options)),"object"==typeof i&&_extends(u.options,i),u;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof r&&"Form"!==r.__class__)throw new Error("Parent instance must be a Form instance");return this.parent=r||window.Parsley,this.init(i)},h.prototype={init:function(n){return this.__class__="Parsley",this.__version__="2.8.0",this.__id__=t.generateID(),this._resetOptions(n),"FORM"===this.element.nodeName||t.checkAttr(this.element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){var n=t.getType(this.element);return"radio"===n||"checkbox"===n||"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple")},handleMultiple:function(){var u,i,e=this,f,r;if(this.options.multiple=this.options.multiple||(u=this.element.getAttribute("name"))||this.element.getAttribute("id"),"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return t.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;for(this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),u&&n('input[name="'+u+'"]').each(function(n,i){var r=t.getType(i);"radio"!==r&&"checkbox"!==r||i.setAttribute(e.options.namespace+"multiple",e.options.multiple)}),f=this._findRelated(),r=0;r<f.length;r++)if(i=n(f.get(r)).data("Parsley"),"undefined"!=typeof i){this.$element.data("FieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(i,u){var o;switch(i){case"parsleyForm":o=n.extend(new f(this.element,this.domOptions,this.options),new r,window.ParsleyExtend)._bindFields();break;case"parsleyField":o=n.extend(new e(this.element,this.domOptions,this.options,this.parent),new r,window.ParsleyExtend);break;case"parsleyFieldMultiple":o=n.extend(new e(this.element,this.domOptions,this.options,this.parent),new g,new r,window.ParsleyExtend)._init();break;default:throw new Error(i+"is not a supported Parsley type");}return this.options.multiple&&t.setAttr(this.element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof u?(this.$element.data("FieldMultiple",o),o):(this.$element.data("Parsley",o),o._actualizeTriggers(),o._trigger("init"),o)}},l=n.fn.jquery.split("."),parseInt(l[0])<=1&&parseInt(l[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";l.forEach||t.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");i=_extends(new r,{element:document,$element:n(document),actualizeOptions:null,_resetOptions:null,Factory:h,version:"2.8.0"});_extends(e.prototype,o.Field,r.prototype);_extends(f.prototype,o.Form,r.prototype);_extends(h.prototype,r.prototype);n.fn.parsley=n.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(n(this).parsley(t))}),i}if(0!=this.length)return new h(this[0],t)};"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={});i.options=_extends(t.objectCreate(it),window.ParsleyConfig);window.ParsleyConfig=i.options;window.Parsley=window.psly=i;i.Utils=t;window.ParsleyUtils={};n.each(t,function(n,i){"function"==typeof i&&(window.ParsleyUtils[n]=function(){return t.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),t[n].apply(t,arguments)})});nt=window.Parsley._validatorRegistry=new y(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={};n.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator".split(" "),function(n,i){window.Parsley[i]=function(){return nt[i].apply(nt,arguments)};window.ParsleyValidator[i]=function(){var n;return t.warnOnce("Accessing the method '"+i+"' through Validator is deprecated. Simply call 'window.Parsley."+i+"(...)'"),(n=window.Parsley)[i].apply(n,arguments)}});window.Parsley.UI=o;window.ParsleyUI={removeError:function(n,i,r){var u=!0!==r;return t.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),n.removeError(i,{updateClass:u})},getErrorsMessages:function(n){return t.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),n.getErrorsMessages()}};n.each("addError updateError".split(" "),function(n,i){window.ParsleyUI[i]=function(n,r,u,f,e){var o=!0!==e;return t.warnOnce("Accessing UI is deprecated. Call '"+i+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),n[i](r,{message:u,assert:f,updateClass:o})}});!1!==window.ParsleyConfig.autoBind&&n(function(){n("[data-parsley-validate]").length&&n("[data-parsley-validate]").parsley()});var pt=n({}),s=function(){t.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},ot="parsley:";return n.listen=function(n,t){var i;if(s(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(i=arguments[1],t=arguments[2]),"function"!=typeof t)throw new Error("Wrong parameters");window.Parsley.on(u(n),tt(t,i))},n.listenTo=function(n,t,i){if(s(),!(n instanceof e||n instanceof f))throw new Error("Must give Parsley instance");if("string"!=typeof t||"function"!=typeof i)throw new Error("Wrong parameters");n.on(u(t),tt(i))},n.unsubscribe=function(n,t){if(s(),"string"!=typeof n||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(u(n),t.parsleyAdaptedCallback)},n.unsubscribeTo=function(n,t){if(s(),!(n instanceof e||n instanceof f))throw new Error("Must give Parsley instance");n.off(u(t))},n.unsubscribeAll=function(t){s();window.Parsley.off(u(t));n("form,input,textarea,select").each(function(){var i=n(this).data("Parsley");i&&i.off(u(t))})},n.emit=function(n,t){var o,i,r;s();i=t instanceof e||t instanceof f;r=Array.prototype.slice.call(arguments,i?2:1);r.unshift(u(n));i||(t=window.Parsley);(o=t).trigger.apply(o,_toConsumableArray(r))},n.extend(!0,i,{asyncValidators:{"default":{fn:function(n){return n.status>=200&&n.status<300},url:!1},reverse:{fn:function(n){return n.status<200||n.status>=300},url:!1}},addAsyncValidator:function(n,t,r,u){return i.asyncValidators[n]={fn:t,url:r||!1,options:u||{}},this}}),i.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,r,u,f){var o,s,l={},e=u.validator||(!0===u.reverse?"reverse":"default"),a,h,c;if("undefined"==typeof i.asyncValidators[e])throw new Error("Calling an undefined async validator: `"+e+"`");return r=i.asyncValidators[e].url||r,r.indexOf("{value}")>-1?r=r.replace("{value}",encodeURIComponent(t)):l[f.element.getAttribute("name")||f.element.getAttribute("id")]=t,a=n.extend(!0,u.options||{},i.asyncValidators[e].options),o=n.extend(!0,{},{url:r,data:l,type:"GET"},a),f.trigger("field:ajaxoptions",f,o),s=n.param(o),"undefined"==typeof i._remoteCache&&(i._remoteCache={}),h=i._remoteCache[s]=i._remoteCache[s]||n.ajax(o),c=function(){var t=i.asyncValidators[e].fn.call(f,h,r,u);return t||(t=n.Deferred().reject()),n.when(t)},h.then(c,c)},priority:-1}),i.on("form:submit",function(){i._remoteCache={}}),r.prototype.addAsyncValidator=function(){return t.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),i.addAsyncValidator.apply(i,arguments)},i.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),i.setLocale("en"),st=new ht,st.install(),i})