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