text: /*! validatorjs - v3.7.0 -  - 2016-10-27 */!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Validator=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b){this.onResolvedAll=b,this.onFailedOne=a,this.resolvers={},this.resolversCount=0,this.passed=[],this.failed=[],this.firing=!1}d.prototype={add:function(a){var b=this.resolversCount;return this.resolvers[b]=a,this.resolversCount++,b},resolve:function(a){var b=this.resolvers[a];b.passes===!0?this.passed.push(b):b.passes===!1&&(this.failed.push(b),this.onFailedOne(b)),this.fire()},isAllResolved:function(){return this.passed.length+this.failed.length===this.resolversCount},fire:function(){this.firing&&this.isAllResolved()&&this.onResolvedAll(0===this.failed.length)},enableFiring:function(){this.firing=!0}},b.exports=d},{}],2:[function(a,b,c){function d(a){return a.replace(/[_\[]/g," ").replace(/]/g,"")}var e={between:function(a,b){var c=b.getParameters();return this._replacePlaceholders(b,a,{min:c[0],max:c[1]})},required_if:function(a,b){var c=b.getParameters(),d=c.shift(),e=c.length>1?c.join(", "):c[0];return this._replacePlaceholders(b,a,{other:d,value:e})}};b.exports={replacements:e,formatter:d}},{}],3:[function(a,b,c){var d=function(){this.errors={}};d.prototype={constructor:d,add:function(a,b){this.has(a)||(this.errors[a]=[]),this.errors[a].indexOf(b)===-1&&this.errors[a].push(b)},get:function(a){return this.has(a)?this.errors[a]:[]},first:function(a){return!!this.has(a)&&this.errors[a][0]},all:function(){return this.errors},has:function(a){return!!this.errors.hasOwnProperty(a)}},b.exports=d},{}],4:[function(a,b,c){var d=a("./messages");a("./lang/en");var e={messages:{},_set:function(a,b){this.messages[a]=b},_setRuleMessage:function(a,b,c){this._load(a),void 0===c&&(c=this.messages[a].def),this.messages[a][b]=c},_load:function(b){if(!this.messages[b]){var c=a("./lang/"+b);this._set(b,c)}},_get:function(a){return this._load(a),this.messages[a]},_make:function(a){return this._load(a),new d(a,this.messages[a])}};b.exports=e},{"./lang/en":5,"./messages":6}],5:[function(a,b,c){b.exports={accepted:"The :attribute must be accepted.",alpha:"The :attribute field must contain only alphabetic characters.",alpha_dash:"The :attribute field may only contain alpha-numeric characters, as well as dashes and underscores.",alpha_num:"The :attribute field must be alphanumeric.",between:"The :attribute field must be between :min and :max.",confirmed:"The :attribute confirmation does not match.",email:"The :attribute format is invalid.",date:"The :attribute is not a valid date format",def:"The :attribute attribute has errors.",digits:"The :attribute must be :digits digits.",different:"The :attribute and :different must be different.","in":"The selected :attribute is invalid.",integer:"The :attribute must be an integer.",min:{numeric:"The :attribute must be at least :min.",string:"The :attribute must be at least :min characters."},max:{numeric:"The :attribute may not be greater than :max.",string:"The :attribute may not be greater than :max characters."},not_in:"The selected :attribute is invalid.",numeric:"The :attribute must be a number.",required:"The :attribute field is required.",required_if:"The :attribute field is required when :other is :value.",same:"The :attribute and :same fields must match.",size:{numeric:"The :attribute must be :size.",string:"The :attribute must be :size characters."},string:"The :attribute must be a string.",url:"The :attribute format is invalid.",regex:"The :attribute format is invalid",attributes:{}}},{}],6:[function(a,b,c){var d=a("./attributes"),e=function(a,b){this.lang=a,this.messages=b,this.customMessages={},this.attributeNames={}};e.prototype={constructor:e,_setCustom:function(a){this.customMessages=a||{}},_setAttributeNames:function(a){this.attributeNames=a},_setAttributeFormatter:function(a){this.attributeFormatter=a},_getAttributeName:function(a){var b=a;return this.attributeNames.hasOwnProperty(a)?this.attributeNames[a]:(this.messages.attributes.hasOwnProperty(a)&&(b=this.messages.attributes[a]),this.attributeFormatter&&(b=this.attributeFormatter(b)),b)},all:function(){return this.messages},render:function(a){if(a.customMessage)return a.customMessage;var b,c=this._getTemplate(a);return b=d.replacements[a.name]?d.replacements[a.name].apply(this,[c,a]):this._replacePlaceholders(a,c,{})},_getTemplate:function(a){for(var b,c=this.messages,d=c.def,e=this.customMessages,f=[a.name+"."+a.attribute,a.name],g=0;g<f.length;g++){if(b=f[g],e.hasOwnProperty(b)){d=e[b];break}if(c.hasOwnProperty(b)){d=c[b];break}}return"object"==typeof d&&(d=d[a._getValueType()]),d},_replacePlaceholders:function(a,b,c){var d,e;if(c.attribute=this._getAttributeName(a.attribute),c[a.name]=a.getParameters().join(","),"string"==typeof b&&"object"==typeof c){d=b;for(e in c)d=d.replace(new RegExp(":"+e,"g"),c[e])}return d}},b.exports=e},{"./attributes":2}],7:[function(a,b,c){function d(a,b,c){this.name=a,this.fn=b,this.passes=null,this.customMessage=void 0,this.async=c}var e={required:function(a){var b;return void 0!==a&&null!==a&&(b=String(a).replace(/\s/g,""),b.length>0)},required_if:function(a,b,c){b=this.getParameters();var d=this.validator.input[b[0]],e=b.slice(1);if("boolean"==typeof d)for(var f in e)"true"===e[f]?e[f]=!0:"false"===e[f]&&(e[f]=!1);else if("number"==typeof d)for(var g in e)isNaN(e[g])||(e[g]=Number(e[g]));return e.indexOf(d)===-1||this.validator.getRule("required").validate(a)},"boolean":function(a){return a===!0||a===!1||0===a||1===a||"0"===a||"1"===a||"true"===a||"false"===a},size:function(a,b,c){if(a){b=parseFloat(b);var d=this.getSize();return d===b}return!0},string:function(a,b,c){return"string"==typeof a},sometimes:function(a){return!0},min:function(a,b,c){var d=this.getSize();return d>=b},max:function(a,b,c){var d=this.getSize();return d<=b},between:function(a,b,c){b=this.getParameters();var d=this.getSize(),e=parseFloat(b[0],10),f=parseFloat(b[1],10);return d>=e&&d<=f},email:function(a){var b=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return b.test(a)},numeric:function(a){var b;return b=Number(a),"number"==typeof b&&!isNaN(b)&&"boolean"!=typeof a},array:function(a){return a instanceof Array},url:function(a){return/^https?:\/\/\S+/.test(a)},alpha:function(a){return/^[a-zA-Z]+$/.test(a)},alpha_dash:function(a){return/^[a-zA-Z0-9_\-]+$/.test(a)},alpha_num:function(a){return/^[a-zA-Z0-9]+$/.test(a)},same:function(a,b){var c=this.validator.input[b],d=a;return c===d},different:function(a,b){var c=this.validator.input[b],d=a;return c!==d},"in":function(a,b){var c,d;if(a&&(c=b.split(",")),a&&!(a instanceof Array)){for(a=String(a),d=0;d<c.length;d++)if(a===c[d])return!0;return!1}if(a&&a instanceof Array)for(d=0;d<a.length;d++)if(c.indexOf(a[d])<0)return!1;return!0},not_in:function(a,b){var c=b.split(","),d=c.length,e=!0;a=String(a);for(var f=0;f<d;f++)if(a===c[f]){e=!1;break}return e},accepted:function(a){return"on"===a||"yes"===a||1===a||"1"===a||a===!0},confirmed:function(a,b,c){var d=c+"_confirmation";return this.validator.input[d]===a},integer:function(a){return String(parseInt(a,10))===String(a)},digits:function(a,b){var c=this.validator.getRule("numeric");return!(!c.validate(a)||String(a).length!==parseInt(b))},regex:function(a,b){var c=/[g|i|m]{1,3}$/,d=b.match(c);return d=d?d[0]:"",b=b.replace(c,"").slice(1,-1),b=new RegExp(b,d),!!a.match(b)},date:function(a){var b="Invalid Date"!==new Date(a).toString();return"number"==typeof a?12===a.toString().length&&b:b}};d.prototype={validate:function(a,b,c,d){var e=this;if(this._setValidatingData(c,a,b),"function"==typeof d){this.callback=d;var f=function(a,b){e.response(a,b)};return this.async?this.fn.apply(this,[a,b,c,f]):f(this.fn.apply(this,[a,b,c]))}return this.fn.apply(this,[a,b,c])},_setValidatingData:function(a,b,c){this.attribute=a,this.inputValue=b,this.ruleValue=c},getParameters:function(){return this.ruleValue?this.ruleValue.split(","):[]},getSize:function(){var a=this.inputValue;return a instanceof Array?a.length:"number"==typeof a?a:this.validator._hasNumericRule(this.attribute)?parseFloat(a,10):a.length},_getValueType:function(){return"number"==typeof this.inputValue||this.validator._hasNumericRule(this.attribute)?"numeric":"string"},response:function(a,b){this.passes=void 0===a||a===!0,this.customMessage=b,this.callback(this.passes,b)},setValidator:function(a){this.validator=a}};var f={asyncRules:[],implicitRules:["required","required_if","accepted"],make:function(a,b){var c=this.isAsync(a),f=new d(a,e[a],c);return f.setValidator(b),f},isAsync:function(a){for(var b=0,c=this.asyncRules.length;b<c;b++)if(this.asyncRules[b]===a)return!0;return!1},isImplicit:function(a){return this.implicitRules.indexOf(a)>-1},register:function(a,b){e[a]=b},registerAsync:function(a,b){this.register(a,b),this.asyncRules.push(a)}};b.exports=f},{}],8:[function(a,b,c){var d=a("./rules"),e=a("./lang"),f=a("./errors"),g=a("./attributes"),h=a("./async"),i=function(a,b,c){var d=i.getDefaultLang();this.input=a,this.messages=e._make(d),this.messages._setCustom(c),this.setAttributeFormatter(i.prototype.attributeFormatter),this.errors=new f,this.errorCount=0,this.hasAsync=!1,this.rules=this._parseRules(b)};i.prototype={constructor:i,lang:"en",numericRules:["integer","numeric"],attributeFormatter:g.formatter,check:function(){for(var a in this.rules){var b=this.rules[a],c=this._objectPath(this.input,a);if(!this._hasRule(a,["sometimes"])||this._suppliedWithData(a))for(var d,e,f,g=0,h=b.length;g<h&&(e=b[g],d=this.getRule(e.name),!this._isValidatable(d,c)||(f=d.validate(c,e.value,a),f||this._addFailure(d),!this._shouldStopValidating(a,f)));g++);}return 0===this.errorCount},checkAsync:function(a,b){var c=this;a=a||function(){},b=b||function(){};var d=function(a,b){c._addFailure(a,b)},e=function(c){c?a():b()},f=new h(d,e),g=function(a,b,c,d){return function(){var e=f.add(d);d.validate(a,b.value,c,function(){f.resolve(e)})}};for(var i in this.rules){var j=this.rules[i],k=this._objectPath(this.input,i);if(!this._hasRule(i,["sometimes"])||this._suppliedWithData(i))for(var l,m,n=0,o=j.length;n<o;n++)m=j[n],l=this.getRule(m.name),this._isValidatable(l,k)&&g(k,m,i,l)()}f.enableFiring(),f.fire()},_addFailure:function(a){var b=this.messages.render(a);this.errors.add(a.attribute,b),this.errorCount++},_flattenObject:function(a){function b(a,d){if(d||0!==Object.getOwnPropertyNames(a).length)if(Object(a)!==a||Array.isArray(a))c[d]=a;else{var e=!0;for(var f in a)e=!1,b(a[f],d?d+"."+f:f);e&&(c[d]={})}}var c={};return a&&b(a),c},_objectPath:function(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b];var c=b.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),d={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(d[e]=a[e]);for(var f=0,g=c.length;f<g;f++){if(!Object.hasOwnProperty.call(d,c[f]))return;d=d[c[f]]}return d},_parseRules:function(a){var b={};a=this._flattenObject(a);for(var c in a){var e=a[c],f=[];"string"==typeof e&&(e=e.split("|"));for(var g,h=0,i=e.length;h<i;h++)g=this._extractRuleAndRuleValue(e[h]),d.isAsync(g.name)&&(this.hasAsync=!0),f.push(g);b[c]=f}return b},_suppliedWithData:function(a){return this.input.hasOwnProperty(a)},_extractRuleAndRuleValue:function(a){var b,c={};return c.name=a,a.indexOf(":")>=0&&(b=a.split(":"),c.name=b[0],c.value=b.slice(1).join(":")),c},_hasRule:function(a,b){for(var c=this.rules[a]||[],d=0,e=c.length;d<e;d++)if(b.indexOf(c[d].name)>-1)return!0;return!1},_hasNumericRule:function(a){return this._hasRule(a,this.numericRules)},_isValidatable:function(a,b){return!!d.isImplicit(a.name)||this.getRule("required").validate(b)},_shouldStopValidating:function(a,b){var c=this.stopOnAttributes;return c!==!1&&b!==!0&&(!(c instanceof Array)||c.indexOf(a)>-1)},setAttributeNames:function(a){this.messages._setAttributeNames(a)},setAttributeFormatter:function(a){this.messages._setAttributeFormatter(a)},getRule:function(a){return d.make(a,this)},stopOnError:function(a){this.stopOnAttributes=a},passes:function(a){var b=this._checkAsync("passes",a);return b?this.checkAsync(a):this.check()},fails:function(a){var b=this._checkAsync("fails",a);return b?this.checkAsync(function(){},a):!this.check()},_checkAsync:function(a,b){var c="function"==typeof b;if(this.hasAsync&&!c)throw a+" expects a callback when async rules are being tested.";return this.hasAsync||c}},i.setMessages=function(a,b){return e._set(a,b),this},i.getMessages=function(a){return e._get(a)},i.useLang=function(a){this.prototype.lang=a},i.getDefaultLang=function(){return this.prototype.lang},i.setAttributeFormatter=function(a){this.prototype.attributeFormatter=a},i.stopOnError=function(a){this.prototype.stopOnAttributes=a},i.register=function(a,b,c){var f=i.getDefaultLang();d.register(a,b),e._setRuleMessage(f,a,c)},i.registerAsync=function(a,b,c){var f=i.getDefaultLang();d.registerAsync(a,b),e._setRuleMessage(f,a,c)},b.exports=i},{"./async":1,"./attributes":2,"./errors":3,"./lang":4,"./rules":7}]},{},[8])(8)});