Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-livr

Package Overview
Dependencies
Maintainers
49
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-livr - npm Package Compare versions

Comparing version 0.2.5 to 1.0.0

2

dist/cjs/index.js

@@ -1,1 +0,1 @@

"use strict";const r=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),t=(t,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[t]:s};return Array.isArray(i)||r(i)?i:{code:i,rule:e}}return""}},e=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var i={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const n={};let s=0;class o{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:s,this.registerRules(n)}static getDefaultRules(){return n}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";n[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)n[t]=r[t]}static defaultAutoTrim(r){s=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new o(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!i.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return i.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return i.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&i.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var u=o;const a={required:function(){return r=>{if(i.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!i.isNoValue(r))return i.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";n.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void n.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";n.push(t)}}},min_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";n.push(t)}}},length_equal:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void n.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),n=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(n))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t<+r?"TOO_LOW":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?i.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(i.isNoValue(r))return;if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!i.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void n.push(s):e.getErrors()}},variable_object:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!i.isObject(t)||!t[r]||!n[t[r]])return"FORMAT_ERROR";const o=n[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},n=new u(e).registerRules(t).prepare();return(r,t,e)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=n.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(n.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void n.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new u({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!n[e[r]]){u.push("FORMAT_ERROR");continue}const t=n[e[r]],i=t.validate(e);i?(o.push(i),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,n)=>{i.isNoValue(t)&&n.push(r)},trim:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=i.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}},leave_only:function(r){r=i.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}}};u.registerDefaultRules(a);var l={Validator:u,rules:a,util:i},c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,h=c||f||Function("return this")(),p=h.Symbol,v=Object.prototype,d=v.hasOwnProperty,_=v.toString,R=p?p.toStringTag:void 0;var O=function(r){var t=d.call(r,R),e=r[R];try{r[R]=void 0;var i=!0}catch(r){}var n=_.call(r);return i&&(t?r[R]=e:delete r[R]),n},g=Object.prototype.toString;var y=function(r){return g.call(r)},E=p?p.toStringTag:void 0;var m=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":E&&E in Object(r)?O(r):y(r)};var b=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var A,T=function(r){if(!b(r))return!1;var t=m(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},N=h["__core-js_shared__"],V=(A=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var j=function(r){return!!V&&V in r},$=Function.prototype.toString;var P=function(r){if(null!=r){try{return $.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,M=Function.prototype,F=Object.prototype,L=M.toString,I=F.hasOwnProperty,x=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(r){return!(!b(r)||j(r))&&(T(r)?x:w).test(P(r))};var D=function(r,t){return null==r?void 0:r[t]};var z=function(r,t){var e=D(r,t);return k(e)?e:void 0},S=function(){try{var r=z(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var B=function(r,t,e){"__proto__"==t&&S?S(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var G=function(r,t){return r===t||r!=r&&t!=t},C=Object.prototype.hasOwnProperty;var H=function(r,t,e){var i=r[t];C.call(r,t)&&G(i,e)&&(void 0!==e||t in r)||B(r,t,e)},U=Array.isArray;var W=function(r){return null!=r&&"object"==typeof r};var q=function(r){return"symbol"==typeof r||W(r)&&"[object Symbol]"==m(r)},Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/;var Z=function(r,t){if(U(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!q(r))||(Q.test(r)||!Y.test(r)||null!=t&&r in Object(t))},J=z(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var X=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var tr=function(r){var t=this.__data__;if(J){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return rr.call(t,r)?t[r]:void 0},er=Object.prototype.hasOwnProperty;var ir=function(r){var t=this.__data__;return J?void 0!==t[r]:er.call(t,r)};var nr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=J&&void 0===t?"__lodash_hash_undefined__":t,this};function sr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}sr.prototype.clear=K,sr.prototype.delete=X,sr.prototype.get=tr,sr.prototype.has=ir,sr.prototype.set=nr;var or=sr;var ur=function(){this.__data__=[],this.size=0};var ar=function(r,t){for(var e=r.length;e--;)if(G(r[e][0],t))return e;return-1},lr=Array.prototype.splice;var cr=function(r){var t=this.__data__,e=ar(t,r);return!(e<0)&&(e==t.length-1?t.pop():lr.call(t,e,1),--this.size,!0)};var fr=function(r){var t=this.__data__,e=ar(t,r);return e<0?void 0:t[e][1]};var hr=function(r){return ar(this.__data__,r)>-1};var pr=function(r,t){var e=this.__data__,i=ar(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function vr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}vr.prototype.clear=ur,vr.prototype.delete=cr,vr.prototype.get=fr,vr.prototype.has=hr,vr.prototype.set=pr;var dr=vr,_r=z(h,"Map");var Rr=function(){this.size=0,this.__data__={hash:new or,map:new(_r||dr),string:new or}};var Or=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var gr=function(r,t){var e=r.__data__;return Or(t)?e["string"==typeof t?"string":"hash"]:e.map};var yr=function(r){var t=gr(this,r).delete(r);return this.size-=t?1:0,t};var Er=function(r){return gr(this,r).get(r)};var mr=function(r){return gr(this,r).has(r)};var br=function(r,t){var e=gr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Ar(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Ar.prototype.clear=Rr,Ar.prototype.delete=yr,Ar.prototype.get=Er,Ar.prototype.has=mr,Ar.prototype.set=br;var Tr=Ar;function Nr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Nr.Cache||Tr),e}Nr.Cache=Tr;var Vr=Nr;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$r=/\\(\\)?/g,Pr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace(jr,(function(r,e,i,n){t.push(i?n.replace($r,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Mr=p?p.prototype:void 0,Fr=Mr?Mr.toString:void 0;var Lr=function r(t){if("string"==typeof t)return t;if(U(t))return wr(t,r)+"";if(q(t))return Fr?Fr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Ir=function(r){return null==r?"":Lr(r)};var xr=function(r,t){return U(r)?r:Z(r,t)?[r]:Pr(Ir(r))},kr=/^(?:0|[1-9]\d*)$/;var Dr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&kr.test(r))&&r>-1&&r%1==0&&r<t};var zr=function(r){if("string"==typeof r||q(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Sr=function(r,t,e,i){if(!b(r))return r;for(var n=-1,s=(t=xr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=zr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=b(c)?c:Dr(t[n+1])?[]:{})}H(u,a,l),u=u[a]}return r};var Br=function(r,t,e){return null==r?r:Sr(r,t,e)};var Gr=function(r,t){for(var e=0,i=(t=xr(t,r)).length;null!=r&&e<i;)r=r[zr(t[e++])];return e&&e==i?r:void 0};var Cr=function(r,t,e){var i=null==r?void 0:Gr(r,t);return void 0===i?e:i};const Hr=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Ur=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Hr(t,o.join("."),s.code,r)}),o=[]}else s&&Ur(s,t,o);return Object.assign(r,{[n]:s})},{})};class Wr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof Wr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Br(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Ur(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Cr(e,t,!1)||Br(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Cr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Cr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class qr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new Wr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new l.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new l.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Yr=null;const Qr=()=>Yr;let Zr={errorBagName:"errors",fieldsBagName:"fields",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Jr=()=>Zr,Kr=r=>{Zr={...Zr,...r}};var Xr={provide(){return this.$livr&&!e(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(e(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Kr(this.$options.$_livr||{});const t=(r=>{const t=Cr(r,"$options.$_livr",{});return{...Zr,...t}})(this);(!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new qr(Qr(),t));const i=(n=this.$options.inject,!(!r(n)||!n.$livr));var n;if(this.$livr||!t.inject||i||(this.$livr=new qr(Qr(),t)),i||this.$livr){if(!i&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[t.errorBagName||"errors"]=function(){return this.$livr.errors},this.$options.computed[t.fieldsBagName||"fields"]=function(){return this.$livr.fields.items.reduce((r,t)=>t.scope?(r["$"+t.scope]||(r["$"+t.scope]={}),r["$"+t.scope][t.name]=t.flags,r):(r[t.name]=t.flags,r),{})}}}};function rt(r){const{extraRules:e,extendedErrors:i,aliasedRules:n=[]}=r;if(l.Validator.registerDefaultRules(e),n.forEach(r=>l.Validator.registerAliasedDefaultRule(r)),i){const r=(s=l.Validator.getDefaultRules(),Object.entries(s).reduce((r,[e,i])=>Object.assign(r,{[e]:t(e,i)}),{}));l.Validator.registerDefaultRules(r)}var s}let tt,et;class it{constructor(r,t){var e;this.configure(r),et=this,t&&(tt=t),this.livrInstance=(e=new qr(null,this.config),Yr=e,e),this.initVM(this.config)}initVM({errorBagName:r,fieldsBagName:t}){this._vm=new tt({data:()=>({[r]:this.livrInstance.errors,[t]:this.livrInstance.fields})})}configure(r){Kr(r)}get config(){return Jr()}static get config(){return Jr()}static get instance(){return et}}var nt={install:function(r,t={}){tt&&r===tt?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(tt=r,rt(t),et=new it(t),qr.$livr=et,tt.mixin(Xr))}};module.exports=nt;
"use strict";const r=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),t=(t,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[t]:s};return Array.isArray(i)||r(i)?i:{code:i,rule:e}}return""}},e=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var i={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const n={};let s=0;class o{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:s,this.registerRules(n)}static getDefaultRules(){return n}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";n[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)n[t]=r[t]}static defaultAutoTrim(r){s=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new o(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!i.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return i.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return i.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&i.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var u=o;const a={required:function(){return r=>{if(i.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!i.isNoValue(r))return i.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";n.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void n.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";n.push(t)}}},min_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";n.push(t)}}},length_equal:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void n.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),n=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(n))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t<+r?"TOO_LOW":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?i.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(i.isNoValue(r))return;if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!i.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void n.push(s):e.getErrors()}},variable_object:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!i.isObject(t)||!t[r]||!n[t[r]])return"FORMAT_ERROR";const o=n[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},n=new u(e).registerRules(t).prepare();return(r,t,e)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=n.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(n.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void n.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new u({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!n[e[r]]){u.push("FORMAT_ERROR");continue}const t=n[e[r]],i=t.validate(e);i?(o.push(i),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,n)=>{i.isNoValue(t)&&n.push(r)},trim:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=i.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}},leave_only:function(r){r=i.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}}};u.registerDefaultRules(a);var l={Validator:u,rules:a,util:i},c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,h=c||f||Function("return this")(),p=h.Symbol,v=Object.prototype,d=v.hasOwnProperty,_=v.toString,R=p?p.toStringTag:void 0;var O=function(r){var t=d.call(r,R),e=r[R];try{r[R]=void 0;var i=!0}catch(r){}var n=_.call(r);return i&&(t?r[R]=e:delete r[R]),n},g=Object.prototype.toString;var y=function(r){return g.call(r)},E=p?p.toStringTag:void 0;var b=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":E&&E in Object(r)?O(r):y(r)};var m=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var A,T=function(r){if(!m(r))return!1;var t=b(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},N=h["__core-js_shared__"],V=(A=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var j=function(r){return!!V&&V in r},$=Function.prototype.toString;var P=function(r){if(null!=r){try{return $.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,M=Function.prototype,F=Object.prototype,L=M.toString,I=F.hasOwnProperty,x=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(r){return!(!m(r)||j(r))&&(T(r)?x:w).test(P(r))};var D=function(r,t){return null==r?void 0:r[t]};var z=function(r,t){var e=D(r,t);return k(e)?e:void 0},S=function(){try{var r=z(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var B=function(r,t,e){"__proto__"==t&&S?S(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var G=function(r,t){return r===t||r!=r&&t!=t},C=Object.prototype.hasOwnProperty;var H=function(r,t,e){var i=r[t];C.call(r,t)&&G(i,e)&&(void 0!==e||t in r)||B(r,t,e)},U=Array.isArray;var W=function(r){return null!=r&&"object"==typeof r};var q=function(r){return"symbol"==typeof r||W(r)&&"[object Symbol]"==b(r)},Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/;var Z=function(r,t){if(U(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!q(r))||(Q.test(r)||!Y.test(r)||null!=t&&r in Object(t))},J=z(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var X=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var tr=function(r){var t=this.__data__;if(J){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return rr.call(t,r)?t[r]:void 0},er=Object.prototype.hasOwnProperty;var ir=function(r){var t=this.__data__;return J?void 0!==t[r]:er.call(t,r)};var nr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=J&&void 0===t?"__lodash_hash_undefined__":t,this};function sr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}sr.prototype.clear=K,sr.prototype.delete=X,sr.prototype.get=tr,sr.prototype.has=ir,sr.prototype.set=nr;var or=sr;var ur=function(){this.__data__=[],this.size=0};var ar=function(r,t){for(var e=r.length;e--;)if(G(r[e][0],t))return e;return-1},lr=Array.prototype.splice;var cr=function(r){var t=this.__data__,e=ar(t,r);return!(e<0)&&(e==t.length-1?t.pop():lr.call(t,e,1),--this.size,!0)};var fr=function(r){var t=this.__data__,e=ar(t,r);return e<0?void 0:t[e][1]};var hr=function(r){return ar(this.__data__,r)>-1};var pr=function(r,t){var e=this.__data__,i=ar(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function vr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}vr.prototype.clear=ur,vr.prototype.delete=cr,vr.prototype.get=fr,vr.prototype.has=hr,vr.prototype.set=pr;var dr=vr,_r=z(h,"Map");var Rr=function(){this.size=0,this.__data__={hash:new or,map:new(_r||dr),string:new or}};var Or=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var gr=function(r,t){var e=r.__data__;return Or(t)?e["string"==typeof t?"string":"hash"]:e.map};var yr=function(r){var t=gr(this,r).delete(r);return this.size-=t?1:0,t};var Er=function(r){return gr(this,r).get(r)};var br=function(r){return gr(this,r).has(r)};var mr=function(r,t){var e=gr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Ar(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Ar.prototype.clear=Rr,Ar.prototype.delete=yr,Ar.prototype.get=Er,Ar.prototype.has=br,Ar.prototype.set=mr;var Tr=Ar;function Nr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Nr.Cache||Tr),e}Nr.Cache=Tr;var Vr=Nr;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$r=/\\(\\)?/g,Pr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace(jr,(function(r,e,i,n){t.push(i?n.replace($r,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Mr=p?p.prototype:void 0,Fr=Mr?Mr.toString:void 0;var Lr=function r(t){if("string"==typeof t)return t;if(U(t))return wr(t,r)+"";if(q(t))return Fr?Fr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Ir=function(r){return null==r?"":Lr(r)};var xr=function(r,t){return U(r)?r:Z(r,t)?[r]:Pr(Ir(r))},kr=/^(?:0|[1-9]\d*)$/;var Dr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&kr.test(r))&&r>-1&&r%1==0&&r<t};var zr=function(r){if("string"==typeof r||q(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Sr=function(r,t,e,i){if(!m(r))return r;for(var n=-1,s=(t=xr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=zr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=m(c)?c:Dr(t[n+1])?[]:{})}H(u,a,l),u=u[a]}return r};var Br=function(r,t,e){return null==r?r:Sr(r,t,e)};var Gr=function(r,t){for(var e=0,i=(t=xr(t,r)).length;null!=r&&e<i;)r=r[zr(t[e++])];return e&&e==i?r:void 0};var Cr=function(r,t,e){var i=null==r?void 0:Gr(r,t);return void 0===i?e:i};const Hr=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Ur=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Hr(t,o.join("."),s.code,r)}),o=[]}else s&&Ur(s,t,o);return Object.assign(r,{[n]:s})},{})};class Wr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof Wr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Br(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Ur(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Cr(e,t,!1)||Br(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Cr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Cr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class qr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new Wr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new l.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new l.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Yr=null;const Qr=()=>Yr;let Zr={errorBagName:"errors",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Jr=()=>Zr,Kr=r=>{Zr={...Zr,...r}};var Xr={provide(){return this.$livr&&!e(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(e(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Kr(this.$options.$_livr||{});const t=(r=>{const t=Cr(r,"$options.$_livr",{});return{...Zr,...t}})(this),i=(n=this.$options.inject,!(!r(n)||!n.$livr));var n;if((!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new qr(Qr(),t)),this.$livr||!t.inject||i||(this.$livr=new qr(Qr(),t)),i||this.$livr){if(!i&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[t.errorBagName||"errors"]=function(){return this.$livr.errors}}}};function rt(r){const{extraRules:e,extendedErrors:i,aliasedRules:n=[]}=r;if(l.Validator.registerDefaultRules(e),n.forEach(r=>l.Validator.registerAliasedDefaultRule(r)),i){const r=(s=l.Validator.getDefaultRules(),Object.entries(s).reduce((r,[e,i])=>Object.assign(r,{[e]:t(e,i)}),{}));l.Validator.registerDefaultRules(r)}var s}let tt,et;class it{constructor(r,t){var e;this.configure(r),et=this,t&&(tt=t),this.livrInstance=(e=new qr(null,this.config),Yr=e,e),this.initVM(this.config)}initVM({errorBagName:r}){this._vm=new tt({data:()=>({[r]:this.livrInstance.errors})})}configure(r){Kr(r)}get config(){return Jr()}static get config(){return Jr()}static get instance(){return et}}var nt={install:function(r,t={}){tt&&r===tt?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(tt=r,rt(t),et=new it(t),qr.$livr=et,tt.mixin(Xr))}};module.exports=nt;

@@ -1,1 +0,1 @@

const r=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),t=(t,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[t]:s};return Array.isArray(i)||r(i)?i:{code:i,rule:e}}return""}},e=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var i={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const n={};let s=0;class o{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:s,this.registerRules(n)}static getDefaultRules(){return n}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";n[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)n[t]=r[t]}static defaultAutoTrim(r){s=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new o(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!i.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return i.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return i.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&i.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var u=o;const a={required:function(){return r=>{if(i.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!i.isNoValue(r))return i.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";n.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void n.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";n.push(t)}}},min_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";n.push(t)}}},length_equal:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void n.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),n=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(n))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t<+r?"TOO_LOW":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?i.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(i.isNoValue(r))return;if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!i.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void n.push(s):e.getErrors()}},variable_object:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!i.isObject(t)||!t[r]||!n[t[r]])return"FORMAT_ERROR";const o=n[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},n=new u(e).registerRules(t).prepare();return(r,t,e)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=n.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(n.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void n.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new u({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!n[e[r]]){u.push("FORMAT_ERROR");continue}const t=n[e[r]],i=t.validate(e);i?(o.push(i),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,n)=>{i.isNoValue(t)&&n.push(r)},trim:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=i.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}},leave_only:function(r){r=i.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}}};u.registerDefaultRules(a);var l={Validator:u,rules:a,util:i},c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,h=c||f||Function("return this")(),p=h.Symbol,v=Object.prototype,d=v.hasOwnProperty,_=v.toString,R=p?p.toStringTag:void 0;var O=function(r){var t=d.call(r,R),e=r[R];try{r[R]=void 0;var i=!0}catch(r){}var n=_.call(r);return i&&(t?r[R]=e:delete r[R]),n},g=Object.prototype.toString;var y=function(r){return g.call(r)},E=p?p.toStringTag:void 0;var m=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":E&&E in Object(r)?O(r):y(r)};var b=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var A,T=function(r){if(!b(r))return!1;var t=m(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},N=h["__core-js_shared__"],V=(A=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var j=function(r){return!!V&&V in r},$=Function.prototype.toString;var P=function(r){if(null!=r){try{return $.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,M=Function.prototype,F=Object.prototype,L=M.toString,I=F.hasOwnProperty,x=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(r){return!(!b(r)||j(r))&&(T(r)?x:w).test(P(r))};var D=function(r,t){return null==r?void 0:r[t]};var z=function(r,t){var e=D(r,t);return k(e)?e:void 0},S=function(){try{var r=z(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var B=function(r,t,e){"__proto__"==t&&S?S(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var G=function(r,t){return r===t||r!=r&&t!=t},C=Object.prototype.hasOwnProperty;var H=function(r,t,e){var i=r[t];C.call(r,t)&&G(i,e)&&(void 0!==e||t in r)||B(r,t,e)},U=Array.isArray;var W=function(r){return null!=r&&"object"==typeof r};var q=function(r){return"symbol"==typeof r||W(r)&&"[object Symbol]"==m(r)},Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/;var Z=function(r,t){if(U(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!q(r))||(Q.test(r)||!Y.test(r)||null!=t&&r in Object(t))},J=z(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var X=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var tr=function(r){var t=this.__data__;if(J){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return rr.call(t,r)?t[r]:void 0},er=Object.prototype.hasOwnProperty;var ir=function(r){var t=this.__data__;return J?void 0!==t[r]:er.call(t,r)};var nr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=J&&void 0===t?"__lodash_hash_undefined__":t,this};function sr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}sr.prototype.clear=K,sr.prototype.delete=X,sr.prototype.get=tr,sr.prototype.has=ir,sr.prototype.set=nr;var or=sr;var ur=function(){this.__data__=[],this.size=0};var ar=function(r,t){for(var e=r.length;e--;)if(G(r[e][0],t))return e;return-1},lr=Array.prototype.splice;var cr=function(r){var t=this.__data__,e=ar(t,r);return!(e<0)&&(e==t.length-1?t.pop():lr.call(t,e,1),--this.size,!0)};var fr=function(r){var t=this.__data__,e=ar(t,r);return e<0?void 0:t[e][1]};var hr=function(r){return ar(this.__data__,r)>-1};var pr=function(r,t){var e=this.__data__,i=ar(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function vr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}vr.prototype.clear=ur,vr.prototype.delete=cr,vr.prototype.get=fr,vr.prototype.has=hr,vr.prototype.set=pr;var dr=vr,_r=z(h,"Map");var Rr=function(){this.size=0,this.__data__={hash:new or,map:new(_r||dr),string:new or}};var Or=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var gr=function(r,t){var e=r.__data__;return Or(t)?e["string"==typeof t?"string":"hash"]:e.map};var yr=function(r){var t=gr(this,r).delete(r);return this.size-=t?1:0,t};var Er=function(r){return gr(this,r).get(r)};var mr=function(r){return gr(this,r).has(r)};var br=function(r,t){var e=gr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Ar(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Ar.prototype.clear=Rr,Ar.prototype.delete=yr,Ar.prototype.get=Er,Ar.prototype.has=mr,Ar.prototype.set=br;var Tr=Ar;function Nr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Nr.Cache||Tr),e}Nr.Cache=Tr;var Vr=Nr;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$r=/\\(\\)?/g,Pr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace(jr,(function(r,e,i,n){t.push(i?n.replace($r,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Mr=p?p.prototype:void 0,Fr=Mr?Mr.toString:void 0;var Lr=function r(t){if("string"==typeof t)return t;if(U(t))return wr(t,r)+"";if(q(t))return Fr?Fr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Ir=function(r){return null==r?"":Lr(r)};var xr=function(r,t){return U(r)?r:Z(r,t)?[r]:Pr(Ir(r))},kr=/^(?:0|[1-9]\d*)$/;var Dr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&kr.test(r))&&r>-1&&r%1==0&&r<t};var zr=function(r){if("string"==typeof r||q(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Sr=function(r,t,e,i){if(!b(r))return r;for(var n=-1,s=(t=xr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=zr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=b(c)?c:Dr(t[n+1])?[]:{})}H(u,a,l),u=u[a]}return r};var Br=function(r,t,e){return null==r?r:Sr(r,t,e)};var Gr=function(r,t){for(var e=0,i=(t=xr(t,r)).length;null!=r&&e<i;)r=r[zr(t[e++])];return e&&e==i?r:void 0};var Cr=function(r,t,e){var i=null==r?void 0:Gr(r,t);return void 0===i?e:i};const Hr=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Ur=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Hr(t,o.join("."),s.code,r)}),o=[]}else s&&Ur(s,t,o);return Object.assign(r,{[n]:s})},{})};class Wr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof Wr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Br(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Ur(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Cr(e,t,!1)||Br(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Cr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Cr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class qr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new Wr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new l.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new l.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Yr=null;const Qr=()=>Yr;let Zr={errorBagName:"errors",fieldsBagName:"fields",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Jr=()=>Zr,Kr=r=>{Zr={...Zr,...r}};var Xr={provide(){return this.$livr&&!e(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(e(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Kr(this.$options.$_livr||{});const t=(r=>{const t=Cr(r,"$options.$_livr",{});return{...Zr,...t}})(this);(!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new qr(Qr(),t));const i=(n=this.$options.inject,!(!r(n)||!n.$livr));var n;if(this.$livr||!t.inject||i||(this.$livr=new qr(Qr(),t)),i||this.$livr){if(!i&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[t.errorBagName||"errors"]=function(){return this.$livr.errors},this.$options.computed[t.fieldsBagName||"fields"]=function(){return this.$livr.fields.items.reduce((r,t)=>t.scope?(r["$"+t.scope]||(r["$"+t.scope]={}),r["$"+t.scope][t.name]=t.flags,r):(r[t.name]=t.flags,r),{})}}}};function rt(r){const{extraRules:e,extendedErrors:i,aliasedRules:n=[]}=r;if(l.Validator.registerDefaultRules(e),n.forEach(r=>l.Validator.registerAliasedDefaultRule(r)),i){const r=(s=l.Validator.getDefaultRules(),Object.entries(s).reduce((r,[e,i])=>Object.assign(r,{[e]:t(e,i)}),{}));l.Validator.registerDefaultRules(r)}var s}let tt,et;class it{constructor(r,t){var e;this.configure(r),et=this,t&&(tt=t),this.livrInstance=(e=new qr(null,this.config),Yr=e,e),this.initVM(this.config)}initVM({errorBagName:r,fieldsBagName:t}){this._vm=new tt({data:()=>({[r]:this.livrInstance.errors,[t]:this.livrInstance.fields})})}configure(r){Kr(r)}get config(){return Jr()}static get config(){return Jr()}static get instance(){return et}}var nt={install:function(r,t={}){tt&&r===tt?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(tt=r,rt(t),et=new it(t),qr.$livr=et,tt.mixin(Xr))}};export default nt;
const r=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),t=(t,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[t]:s};return Array.isArray(i)||r(i)?i:{code:i,rule:e}}return""}},e=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var i={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const n={};let s=0;class o{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:s,this.registerRules(n)}static getDefaultRules(){return n}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";n[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)n[t]=r[t]}static defaultAutoTrim(r){s=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new o(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!i.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return i.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return i.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&i.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var u=o;const a={required:function(){return r=>{if(i.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!i.isNoValue(r))return i.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";n.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void n.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";n.push(t)}}},min_length:function(r){return(t,e,n)=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";n.push(t)}}},length_equal:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void n.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),n=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(n))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!i.isNoValue(r))return i.isPrimitiveValue(r)?i.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!i.isNoValue(r)){if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";if(!i.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,n)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?i.looksLikeNumber(t)?+t<+r?"TOO_LOW":void n.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,n,s)=>{if(!i.isNoValue(e))return i.isPrimitiveValue(e)?i.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!i.isNoValue(t))return i.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!i.isNoValue(t)){if(!i.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(i.isNoValue(r))return;if(!i.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!i.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void n.push(s):e.getErrors()}},variable_object:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!i.isObject(t)||!t[r]||!n[t[r]])return"FORMAT_ERROR";const o=n[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},n=new u(e).registerRules(t).prepare();return(r,t,e)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=n.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(n.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new u(r).registerRules(t).prepare();return(r,t,n)=>{if(i.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void n.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new u({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const n={};for(const r in t){const i=new u(t[r]).registerRules(e).prepare();n[r]=i}return(t,e,s)=>{if(i.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!n[e[r]]){u.push("FORMAT_ERROR");continue}const t=n[e[r]],i=t.validate(e);i?(o.push(i),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,n)=>{i.isNoValue(t)&&n.push(r)},trim:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{i.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=i.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}},leave_only:function(r){r=i.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,n)=>{i.isNoValue(r)||"object"==typeof r||(r+="",n.push(r.replace(t,"")))}}};u.registerDefaultRules(a);var l={Validator:u,rules:a,util:i},c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,h=c||f||Function("return this")(),p=h.Symbol,v=Object.prototype,d=v.hasOwnProperty,_=v.toString,R=p?p.toStringTag:void 0;var O=function(r){var t=d.call(r,R),e=r[R];try{r[R]=void 0;var i=!0}catch(r){}var n=_.call(r);return i&&(t?r[R]=e:delete r[R]),n},g=Object.prototype.toString;var y=function(r){return g.call(r)},E=p?p.toStringTag:void 0;var b=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":E&&E in Object(r)?O(r):y(r)};var m=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var A,T=function(r){if(!m(r))return!1;var t=b(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},N=h["__core-js_shared__"],V=(A=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var j=function(r){return!!V&&V in r},$=Function.prototype.toString;var P=function(r){if(null!=r){try{return $.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,M=Function.prototype,F=Object.prototype,L=M.toString,I=F.hasOwnProperty,x=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(r){return!(!m(r)||j(r))&&(T(r)?x:w).test(P(r))};var D=function(r,t){return null==r?void 0:r[t]};var z=function(r,t){var e=D(r,t);return k(e)?e:void 0},S=function(){try{var r=z(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var B=function(r,t,e){"__proto__"==t&&S?S(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var G=function(r,t){return r===t||r!=r&&t!=t},C=Object.prototype.hasOwnProperty;var H=function(r,t,e){var i=r[t];C.call(r,t)&&G(i,e)&&(void 0!==e||t in r)||B(r,t,e)},U=Array.isArray;var W=function(r){return null!=r&&"object"==typeof r};var q=function(r){return"symbol"==typeof r||W(r)&&"[object Symbol]"==b(r)},Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/;var Z=function(r,t){if(U(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!q(r))||(Q.test(r)||!Y.test(r)||null!=t&&r in Object(t))},J=z(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var X=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var tr=function(r){var t=this.__data__;if(J){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return rr.call(t,r)?t[r]:void 0},er=Object.prototype.hasOwnProperty;var ir=function(r){var t=this.__data__;return J?void 0!==t[r]:er.call(t,r)};var nr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=J&&void 0===t?"__lodash_hash_undefined__":t,this};function sr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}sr.prototype.clear=K,sr.prototype.delete=X,sr.prototype.get=tr,sr.prototype.has=ir,sr.prototype.set=nr;var or=sr;var ur=function(){this.__data__=[],this.size=0};var ar=function(r,t){for(var e=r.length;e--;)if(G(r[e][0],t))return e;return-1},lr=Array.prototype.splice;var cr=function(r){var t=this.__data__,e=ar(t,r);return!(e<0)&&(e==t.length-1?t.pop():lr.call(t,e,1),--this.size,!0)};var fr=function(r){var t=this.__data__,e=ar(t,r);return e<0?void 0:t[e][1]};var hr=function(r){return ar(this.__data__,r)>-1};var pr=function(r,t){var e=this.__data__,i=ar(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function vr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}vr.prototype.clear=ur,vr.prototype.delete=cr,vr.prototype.get=fr,vr.prototype.has=hr,vr.prototype.set=pr;var dr=vr,_r=z(h,"Map");var Rr=function(){this.size=0,this.__data__={hash:new or,map:new(_r||dr),string:new or}};var Or=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var gr=function(r,t){var e=r.__data__;return Or(t)?e["string"==typeof t?"string":"hash"]:e.map};var yr=function(r){var t=gr(this,r).delete(r);return this.size-=t?1:0,t};var Er=function(r){return gr(this,r).get(r)};var br=function(r){return gr(this,r).has(r)};var mr=function(r,t){var e=gr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Ar(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Ar.prototype.clear=Rr,Ar.prototype.delete=yr,Ar.prototype.get=Er,Ar.prototype.has=br,Ar.prototype.set=mr;var Tr=Ar;function Nr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Nr.Cache||Tr),e}Nr.Cache=Tr;var Vr=Nr;var jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$r=/\\(\\)?/g,Pr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace(jr,(function(r,e,i,n){t.push(i?n.replace($r,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Mr=p?p.prototype:void 0,Fr=Mr?Mr.toString:void 0;var Lr=function r(t){if("string"==typeof t)return t;if(U(t))return wr(t,r)+"";if(q(t))return Fr?Fr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Ir=function(r){return null==r?"":Lr(r)};var xr=function(r,t){return U(r)?r:Z(r,t)?[r]:Pr(Ir(r))},kr=/^(?:0|[1-9]\d*)$/;var Dr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&kr.test(r))&&r>-1&&r%1==0&&r<t};var zr=function(r){if("string"==typeof r||q(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Sr=function(r,t,e,i){if(!m(r))return r;for(var n=-1,s=(t=xr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=zr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=m(c)?c:Dr(t[n+1])?[]:{})}H(u,a,l),u=u[a]}return r};var Br=function(r,t,e){return null==r?r:Sr(r,t,e)};var Gr=function(r,t){for(var e=0,i=(t=xr(t,r)).length;null!=r&&e<i;)r=r[zr(t[e++])];return e&&e==i?r:void 0};var Cr=function(r,t,e){var i=null==r?void 0:Gr(r,t);return void 0===i?e:i};const Hr=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Ur=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Hr(t,o.join("."),s.code,r)}),o=[]}else s&&Ur(s,t,o);return Object.assign(r,{[n]:s})},{})};class Wr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof Wr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Br(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Ur(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Cr(e,t,!1)||Br(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Cr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Cr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class qr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new Wr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new l.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new l.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Yr=null;const Qr=()=>Yr;let Zr={errorBagName:"errors",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Jr=()=>Zr,Kr=r=>{Zr={...Zr,...r}};var Xr={provide(){return this.$livr&&!e(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(e(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Kr(this.$options.$_livr||{});const t=(r=>{const t=Cr(r,"$options.$_livr",{});return{...Zr,...t}})(this),i=(n=this.$options.inject,!(!r(n)||!n.$livr));var n;if((!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new qr(Qr(),t)),this.$livr||!t.inject||i||(this.$livr=new qr(Qr(),t)),i||this.$livr){if(!i&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[t.errorBagName||"errors"]=function(){return this.$livr.errors}}}};function rt(r){const{extraRules:e,extendedErrors:i,aliasedRules:n=[]}=r;if(l.Validator.registerDefaultRules(e),n.forEach(r=>l.Validator.registerAliasedDefaultRule(r)),i){const r=(s=l.Validator.getDefaultRules(),Object.entries(s).reduce((r,[e,i])=>Object.assign(r,{[e]:t(e,i)}),{}));l.Validator.registerDefaultRules(r)}var s}let tt,et;class it{constructor(r,t){var e;this.configure(r),et=this,t&&(tt=t),this.livrInstance=(e=new qr(null,this.config),Yr=e,e),this.initVM(this.config)}initVM({errorBagName:r}){this._vm=new tt({data:()=>({[r]:this.livrInstance.errors})})}configure(r){Kr(r)}get config(){return Jr()}static get config(){return Jr()}static get instance(){return et}}var nt={install:function(r,t={}){tt&&r===tt?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(tt=r,rt(t),et=new it(t),qr.$livr=et,tt.mixin(Xr))}};export default nt;

@@ -1,1 +0,1 @@

var VueLIVR=function(r){"use strict";const t=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),e=(r,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[r]:s};return Array.isArray(i)||t(i)?i:{code:i,rule:e}}return""}},i=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var n={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const s={};let o=0;class u{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:o,this.registerRules(s)}static getDefaultRules(){return s}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";s[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)s[t]=r[t]}static defaultAutoTrim(r){o=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new u(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!n.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return n.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return n.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&n.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var a=u;const l={required:function(){return r=>{if(n.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!n.isNoValue(r))return n.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";i.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void i.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";i.push(t)}}},min_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";i.push(t)}}},length_equal:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void i.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),i=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(i))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t<+r?"TOO_LOW":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?n.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(n.isNoValue(r))return;if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!n.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void i.push(s):e.getErrors()}},variable_object:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!n.isObject(t)||!t[r]||!i[t[r]])return"FORMAT_ERROR";const o=i[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},i=new a(e).registerRules(t).prepare();return(r,t,e)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=i.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(i.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void i.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new a({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!i[e[r]]){u.push("FORMAT_ERROR");continue}const t=i[e[r]],n=t.validate(e);n?(o.push(n),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,i)=>{n.isNoValue(t)&&i.push(r)},trim:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=n.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}},leave_only:function(r){r=n.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}}};a.registerDefaultRules(l);var c={Validator:a,rules:l,util:n},f="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),v=p.Symbol,d=Object.prototype,_=d.hasOwnProperty,R=d.toString,O=v?v.toStringTag:void 0;var g=function(r){var t=_.call(r,O),e=r[O];try{r[O]=void 0;var i=!0}catch(r){}var n=R.call(r);return i&&(t?r[O]=e:delete r[O]),n},y=Object.prototype.toString;var E=function(r){return y.call(r)},m=v?v.toStringTag:void 0;var b=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":m&&m in Object(r)?g(r):E(r)};var A=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var T,N=function(r){if(!A(r))return!1;var t=b(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},V=p["__core-js_shared__"],j=(T=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var $=function(r){return!!j&&j in r},P=Function.prototype.toString;var w=function(r){if(null!=r){try{return P.call(r)}catch(r){}try{return r+""}catch(r){}}return""},M=/^\[object .+?Constructor\]$/,F=Function.prototype,L=Object.prototype,I=F.toString,x=L.hasOwnProperty,k=RegExp("^"+I.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var D=function(r){return!(!A(r)||$(r))&&(N(r)?k:M).test(w(r))};var z=function(r,t){return null==r?void 0:r[t]};var S=function(r,t){var e=z(r,t);return D(e)?e:void 0},B=function(){try{var r=S(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var G=function(r,t,e){"__proto__"==t&&B?B(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var C=function(r,t){return r===t||r!=r&&t!=t},H=Object.prototype.hasOwnProperty;var U=function(r,t,e){var i=r[t];H.call(r,t)&&C(i,e)&&(void 0!==e||t in r)||G(r,t,e)},W=Array.isArray;var q=function(r){return null!=r&&"object"==typeof r};var Y=function(r){return"symbol"==typeof r||q(r)&&"[object Symbol]"==b(r)},Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/;var J=function(r,t){if(W(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!Y(r))||(Z.test(r)||!Q.test(r)||null!=t&&r in Object(t))},K=S(Object,"create");var X=function(){this.__data__=K?K(null):{},this.size=0};var rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},tr=Object.prototype.hasOwnProperty;var er=function(r){var t=this.__data__;if(K){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return tr.call(t,r)?t[r]:void 0},ir=Object.prototype.hasOwnProperty;var nr=function(r){var t=this.__data__;return K?void 0!==t[r]:ir.call(t,r)};var sr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=K&&void 0===t?"__lodash_hash_undefined__":t,this};function or(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}or.prototype.clear=X,or.prototype.delete=rr,or.prototype.get=er,or.prototype.has=nr,or.prototype.set=sr;var ur=or;var ar=function(){this.__data__=[],this.size=0};var lr=function(r,t){for(var e=r.length;e--;)if(C(r[e][0],t))return e;return-1},cr=Array.prototype.splice;var fr=function(r){var t=this.__data__,e=lr(t,r);return!(e<0)&&(e==t.length-1?t.pop():cr.call(t,e,1),--this.size,!0)};var hr=function(r){var t=this.__data__,e=lr(t,r);return e<0?void 0:t[e][1]};var pr=function(r){return lr(this.__data__,r)>-1};var vr=function(r,t){var e=this.__data__,i=lr(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function dr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}dr.prototype.clear=ar,dr.prototype.delete=fr,dr.prototype.get=hr,dr.prototype.has=pr,dr.prototype.set=vr;var _r=dr,Rr=S(p,"Map");var Or=function(){this.size=0,this.__data__={hash:new ur,map:new(Rr||_r),string:new ur}};var gr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var yr=function(r,t){var e=r.__data__;return gr(t)?e["string"==typeof t?"string":"hash"]:e.map};var Er=function(r){var t=yr(this,r).delete(r);return this.size-=t?1:0,t};var mr=function(r){return yr(this,r).get(r)};var br=function(r){return yr(this,r).has(r)};var Ar=function(r,t){var e=yr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Tr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Tr.prototype.clear=Or,Tr.prototype.delete=Er,Tr.prototype.get=mr,Tr.prototype.has=br,Tr.prototype.set=Ar;var Nr=Tr;function Vr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Vr.Cache||Nr),e}Vr.Cache=Nr;var jr=Vr;var $r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,wr=function(r){var t=jr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace($r,(function(r,e,i,n){t.push(i?n.replace(Pr,"$1"):e||r)})),t}));var Mr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Fr=v?v.prototype:void 0,Lr=Fr?Fr.toString:void 0;var Ir=function r(t){if("string"==typeof t)return t;if(W(t))return Mr(t,r)+"";if(Y(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var xr=function(r){return null==r?"":Ir(r)};var kr=function(r,t){return W(r)?r:J(r,t)?[r]:wr(xr(r))},Dr=/^(?:0|[1-9]\d*)$/;var zr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&Dr.test(r))&&r>-1&&r%1==0&&r<t};var Sr=function(r){if("string"==typeof r||Y(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Br=function(r,t,e,i){if(!A(r))return r;for(var n=-1,s=(t=kr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=Sr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=A(c)?c:zr(t[n+1])?[]:{})}U(u,a,l),u=u[a]}return r};var Gr=function(r,t,e){return null==r?r:Br(r,t,e)};var Cr=function(r,t){for(var e=0,i=(t=kr(t,r)).length;null!=r&&e<i;)r=r[Sr(t[e++])];return e&&e==i?r:void 0};var Hr=function(r,t,e){var i=null==r?void 0:Cr(r,t);return void 0===i?e:i};const Ur=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Wr=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Ur(t,o.join("."),s.code,r)}),o=[]}else s&&Wr(s,t,o);return Object.assign(r,{[n]:s})},{})};class qr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof qr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Gr(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Wr(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Hr(e,t,!1)||Gr(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Hr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Hr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class Yr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new qr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new c.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new c.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Qr=null;const Zr=()=>Qr;let Jr={errorBagName:"errors",fieldsBagName:"fields",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Kr=()=>Jr,Xr=r=>{Jr={...Jr,...r}};var rt={provide(){return this.$livr&&!i(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(i(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Xr(this.$options.$_livr||{});const r=(r=>{const t=Hr(r,"$options.$_livr",{});return{...Jr,...t}})(this);(!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new Yr(Zr(),r));const e=(n=this.$options.inject,!(!t(n)||!n.$livr));var n;if(this.$livr||!r.inject||e||(this.$livr=new Yr(Zr(),r)),e||this.$livr){if(!e&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[r.errorBagName||"errors"]=function(){return this.$livr.errors},this.$options.computed[r.fieldsBagName||"fields"]=function(){return this.$livr.fields.items.reduce((r,t)=>t.scope?(r["$"+t.scope]||(r["$"+t.scope]={}),r["$"+t.scope][t.name]=t.flags,r):(r[t.name]=t.flags,r),{})}}}};function tt(r){const{extraRules:t,extendedErrors:i,aliasedRules:n=[]}=r;if(c.Validator.registerDefaultRules(t),n.forEach(r=>c.Validator.registerAliasedDefaultRule(r)),i){const r=(s=c.Validator.getDefaultRules(),Object.entries(s).reduce((r,[t,i])=>Object.assign(r,{[t]:e(t,i)}),{}));c.Validator.registerDefaultRules(r)}var s}let et,it;class nt{constructor(r,t){var e;this.configure(r),it=this,t&&(et=t),this.livrInstance=(e=new Yr(null,this.config),Qr=e,e),this.initVM(this.config)}initVM({errorBagName:r,fieldsBagName:t}){this._vm=new et({data:()=>({[r]:this.livrInstance.errors,[t]:this.livrInstance.fields})})}configure(r){Xr(r)}get config(){return Kr()}static get config(){return Kr()}static get instance(){return it}}var st={install:function(r,t={}){et&&r===et?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(et=r,tt(t),it=new nt(t),Yr.$livr=it,et.mixin(rt))}};return r.default=st,r}({});
var VueLIVR=function(r){"use strict";const t=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),e=(r,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[r]:s};return Array.isArray(i)||t(i)?i:{code:i,rule:e}}return""}},i=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var n={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const s={};let o=0;class u{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:o,this.registerRules(s)}static getDefaultRules(){return s}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";s[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)s[t]=r[t]}static defaultAutoTrim(r){o=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new u(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!n.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return n.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return n.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&n.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var a=u;const l={required:function(){return r=>{if(n.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!n.isNoValue(r))return n.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";i.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void i.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";i.push(t)}}},min_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";i.push(t)}}},length_equal:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void i.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),i=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(i))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t<+r?"TOO_LOW":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?n.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(n.isNoValue(r))return;if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!n.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void i.push(s):e.getErrors()}},variable_object:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!n.isObject(t)||!t[r]||!i[t[r]])return"FORMAT_ERROR";const o=i[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},i=new a(e).registerRules(t).prepare();return(r,t,e)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=i.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(i.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void i.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new a({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!i[e[r]]){u.push("FORMAT_ERROR");continue}const t=i[e[r]],n=t.validate(e);n?(o.push(n),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,i)=>{n.isNoValue(t)&&i.push(r)},trim:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=n.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}},leave_only:function(r){r=n.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}}};a.registerDefaultRules(l);var c={Validator:a,rules:l,util:n},f="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),v=p.Symbol,d=Object.prototype,_=d.hasOwnProperty,R=d.toString,O=v?v.toStringTag:void 0;var g=function(r){var t=_.call(r,O),e=r[O];try{r[O]=void 0;var i=!0}catch(r){}var n=R.call(r);return i&&(t?r[O]=e:delete r[O]),n},y=Object.prototype.toString;var E=function(r){return y.call(r)},b=v?v.toStringTag:void 0;var m=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":b&&b in Object(r)?g(r):E(r)};var A=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var T,N=function(r){if(!A(r))return!1;var t=m(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},V=p["__core-js_shared__"],j=(T=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var $=function(r){return!!j&&j in r},P=Function.prototype.toString;var w=function(r){if(null!=r){try{return P.call(r)}catch(r){}try{return r+""}catch(r){}}return""},M=/^\[object .+?Constructor\]$/,F=Function.prototype,L=Object.prototype,I=F.toString,x=L.hasOwnProperty,k=RegExp("^"+I.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var D=function(r){return!(!A(r)||$(r))&&(N(r)?k:M).test(w(r))};var z=function(r,t){return null==r?void 0:r[t]};var S=function(r,t){var e=z(r,t);return D(e)?e:void 0},B=function(){try{var r=S(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var G=function(r,t,e){"__proto__"==t&&B?B(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var C=function(r,t){return r===t||r!=r&&t!=t},H=Object.prototype.hasOwnProperty;var U=function(r,t,e){var i=r[t];H.call(r,t)&&C(i,e)&&(void 0!==e||t in r)||G(r,t,e)},W=Array.isArray;var q=function(r){return null!=r&&"object"==typeof r};var Y=function(r){return"symbol"==typeof r||q(r)&&"[object Symbol]"==m(r)},Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/;var J=function(r,t){if(W(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!Y(r))||(Z.test(r)||!Q.test(r)||null!=t&&r in Object(t))},K=S(Object,"create");var X=function(){this.__data__=K?K(null):{},this.size=0};var rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},tr=Object.prototype.hasOwnProperty;var er=function(r){var t=this.__data__;if(K){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return tr.call(t,r)?t[r]:void 0},ir=Object.prototype.hasOwnProperty;var nr=function(r){var t=this.__data__;return K?void 0!==t[r]:ir.call(t,r)};var sr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=K&&void 0===t?"__lodash_hash_undefined__":t,this};function or(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}or.prototype.clear=X,or.prototype.delete=rr,or.prototype.get=er,or.prototype.has=nr,or.prototype.set=sr;var ur=or;var ar=function(){this.__data__=[],this.size=0};var lr=function(r,t){for(var e=r.length;e--;)if(C(r[e][0],t))return e;return-1},cr=Array.prototype.splice;var fr=function(r){var t=this.__data__,e=lr(t,r);return!(e<0)&&(e==t.length-1?t.pop():cr.call(t,e,1),--this.size,!0)};var hr=function(r){var t=this.__data__,e=lr(t,r);return e<0?void 0:t[e][1]};var pr=function(r){return lr(this.__data__,r)>-1};var vr=function(r,t){var e=this.__data__,i=lr(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function dr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}dr.prototype.clear=ar,dr.prototype.delete=fr,dr.prototype.get=hr,dr.prototype.has=pr,dr.prototype.set=vr;var _r=dr,Rr=S(p,"Map");var Or=function(){this.size=0,this.__data__={hash:new ur,map:new(Rr||_r),string:new ur}};var gr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var yr=function(r,t){var e=r.__data__;return gr(t)?e["string"==typeof t?"string":"hash"]:e.map};var Er=function(r){var t=yr(this,r).delete(r);return this.size-=t?1:0,t};var br=function(r){return yr(this,r).get(r)};var mr=function(r){return yr(this,r).has(r)};var Ar=function(r,t){var e=yr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Tr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Tr.prototype.clear=Or,Tr.prototype.delete=Er,Tr.prototype.get=br,Tr.prototype.has=mr,Tr.prototype.set=Ar;var Nr=Tr;function Vr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(Vr.Cache||Nr),e}Vr.Cache=Nr;var jr=Vr;var $r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,wr=function(r){var t=jr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace($r,(function(r,e,i,n){t.push(i?n.replace(Pr,"$1"):e||r)})),t}));var Mr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Fr=v?v.prototype:void 0,Lr=Fr?Fr.toString:void 0;var Ir=function r(t){if("string"==typeof t)return t;if(W(t))return Mr(t,r)+"";if(Y(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var xr=function(r){return null==r?"":Ir(r)};var kr=function(r,t){return W(r)?r:J(r,t)?[r]:wr(xr(r))},Dr=/^(?:0|[1-9]\d*)$/;var zr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&Dr.test(r))&&r>-1&&r%1==0&&r<t};var Sr=function(r){if("string"==typeof r||Y(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Br=function(r,t,e,i){if(!A(r))return r;for(var n=-1,s=(t=kr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=Sr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=A(c)?c:zr(t[n+1])?[]:{})}U(u,a,l),u=u[a]}return r};var Gr=function(r,t,e){return null==r?r:Br(r,t,e)};var Cr=function(r,t){for(var e=0,i=(t=kr(t,r)).length;null!=r&&e<i;)r=r[Sr(t[e++])];return e&&e==i?r:void 0};var Hr=function(r,t,e){var i=null==r?void 0:Cr(r,t);return void 0===i?e:i};const Ur=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Wr=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Ur(t,o.join("."),s.code,r)}),o=[]}else s&&Wr(s,t,o);return Object.assign(r,{[n]:s})},{})};class qr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof qr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Gr(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Wr(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Hr(e,t,!1)||Gr(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Hr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Hr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class Yr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new qr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new c.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new c.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Qr=null;const Zr=()=>Qr;let Jr={errorBagName:"errors",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Kr=()=>Jr,Xr=r=>{Jr={...Jr,...r}};var rt={provide(){return this.$livr&&!i(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(i(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Xr(this.$options.$_livr||{});const r=(r=>{const t=Hr(r,"$options.$_livr",{});return{...Jr,...t}})(this),e=(n=this.$options.inject,!(!t(n)||!n.$livr));var n;if((!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new Yr(Zr(),r)),this.$livr||!r.inject||e||(this.$livr=new Yr(Zr(),r)),e||this.$livr){if(!e&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[r.errorBagName||"errors"]=function(){return this.$livr.errors}}}};function tt(r){const{extraRules:t,extendedErrors:i,aliasedRules:n=[]}=r;if(c.Validator.registerDefaultRules(t),n.forEach(r=>c.Validator.registerAliasedDefaultRule(r)),i){const r=(s=c.Validator.getDefaultRules(),Object.entries(s).reduce((r,[t,i])=>Object.assign(r,{[t]:e(t,i)}),{}));c.Validator.registerDefaultRules(r)}var s}let et,it;class nt{constructor(r,t){var e;this.configure(r),it=this,t&&(et=t),this.livrInstance=(e=new Yr(null,this.config),Qr=e,e),this.initVM(this.config)}initVM({errorBagName:r}){this._vm=new et({data:()=>({[r]:this.livrInstance.errors})})}configure(r){Xr(r)}get config(){return Kr()}static get config(){return Kr()}static get instance(){return it}}var st={install:function(r,t={}){et&&r===et?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(et=r,tt(t),it=new nt(t),Yr.$livr=it,et.mixin(rt))}};return r.default=st,r}({});

@@ -1,1 +0,1 @@

!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r=r||self)["vue-livr"]={})}(this,(function(r){"use strict";const t=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),e=(r,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[r]:s};return Array.isArray(i)||t(i)?i:{code:i,rule:e}}return""}},i=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var n={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const s={};let o=0;class u{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:o,this.registerRules(s)}static getDefaultRules(){return s}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";s[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)s[t]=r[t]}static defaultAutoTrim(r){o=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new u(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!n.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return n.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return n.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&n.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var a=u;const l={required:function(){return r=>{if(n.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!n.isNoValue(r))return n.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";i.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void i.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";i.push(t)}}},min_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";i.push(t)}}},length_equal:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void i.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),i=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(i))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t<+r?"TOO_LOW":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?n.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(n.isNoValue(r))return;if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!n.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void i.push(s):e.getErrors()}},variable_object:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!n.isObject(t)||!t[r]||!i[t[r]])return"FORMAT_ERROR";const o=i[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},i=new a(e).registerRules(t).prepare();return(r,t,e)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=i.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(i.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void i.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new a({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!i[e[r]]){u.push("FORMAT_ERROR");continue}const t=i[e[r]],n=t.validate(e);n?(o.push(n),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,i)=>{n.isNoValue(t)&&i.push(r)},trim:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=n.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}},leave_only:function(r){r=n.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}}};a.registerDefaultRules(l);var c={Validator:a,rules:l,util:n},f="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=p.Symbol,v=Object.prototype,_=v.hasOwnProperty,R=v.toString,O=d?d.toStringTag:void 0;var g=function(r){var t=_.call(r,O),e=r[O];try{r[O]=void 0;var i=!0}catch(r){}var n=R.call(r);return i&&(t?r[O]=e:delete r[O]),n},y=Object.prototype.toString;var m=function(r){return y.call(r)},E=d?d.toStringTag:void 0;var b=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":E&&E in Object(r)?g(r):m(r)};var A=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var T,N=function(r){if(!A(r))return!1;var t=b(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},j=p["__core-js_shared__"],V=(T=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var $=function(r){return!!V&&V in r},P=Function.prototype.toString;var M=function(r){if(null!=r){try{return P.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,F=Function.prototype,L=Object.prototype,I=F.toString,x=L.hasOwnProperty,k=RegExp("^"+I.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var D=function(r){return!(!A(r)||$(r))&&(N(r)?k:w).test(M(r))};var z=function(r,t){return null==r?void 0:r[t]};var S=function(r,t){var e=z(r,t);return D(e)?e:void 0},B=function(){try{var r=S(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var G=function(r,t,e){"__proto__"==t&&B?B(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var C=function(r,t){return r===t||r!=r&&t!=t},H=Object.prototype.hasOwnProperty;var U=function(r,t,e){var i=r[t];H.call(r,t)&&C(i,e)&&(void 0!==e||t in r)||G(r,t,e)},W=Array.isArray;var q=function(r){return null!=r&&"object"==typeof r};var Y=function(r){return"symbol"==typeof r||q(r)&&"[object Symbol]"==b(r)},Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/;var J=function(r,t){if(W(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!Y(r))||(Z.test(r)||!Q.test(r)||null!=t&&r in Object(t))},K=S(Object,"create");var X=function(){this.__data__=K?K(null):{},this.size=0};var rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},tr=Object.prototype.hasOwnProperty;var er=function(r){var t=this.__data__;if(K){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return tr.call(t,r)?t[r]:void 0},ir=Object.prototype.hasOwnProperty;var nr=function(r){var t=this.__data__;return K?void 0!==t[r]:ir.call(t,r)};var sr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=K&&void 0===t?"__lodash_hash_undefined__":t,this};function or(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}or.prototype.clear=X,or.prototype.delete=rr,or.prototype.get=er,or.prototype.has=nr,or.prototype.set=sr;var ur=or;var ar=function(){this.__data__=[],this.size=0};var lr=function(r,t){for(var e=r.length;e--;)if(C(r[e][0],t))return e;return-1},cr=Array.prototype.splice;var fr=function(r){var t=this.__data__,e=lr(t,r);return!(e<0)&&(e==t.length-1?t.pop():cr.call(t,e,1),--this.size,!0)};var hr=function(r){var t=this.__data__,e=lr(t,r);return e<0?void 0:t[e][1]};var pr=function(r){return lr(this.__data__,r)>-1};var dr=function(r,t){var e=this.__data__,i=lr(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function vr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}vr.prototype.clear=ar,vr.prototype.delete=fr,vr.prototype.get=hr,vr.prototype.has=pr,vr.prototype.set=dr;var _r=vr,Rr=S(p,"Map");var Or=function(){this.size=0,this.__data__={hash:new ur,map:new(Rr||_r),string:new ur}};var gr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var yr=function(r,t){var e=r.__data__;return gr(t)?e["string"==typeof t?"string":"hash"]:e.map};var mr=function(r){var t=yr(this,r).delete(r);return this.size-=t?1:0,t};var Er=function(r){return yr(this,r).get(r)};var br=function(r){return yr(this,r).has(r)};var Ar=function(r,t){var e=yr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Tr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Tr.prototype.clear=Or,Tr.prototype.delete=mr,Tr.prototype.get=Er,Tr.prototype.has=br,Tr.prototype.set=Ar;var Nr=Tr;function jr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(jr.Cache||Nr),e}jr.Cache=Nr;var Vr=jr;var $r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,Mr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace($r,(function(r,e,i,n){t.push(i?n.replace(Pr,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Fr=d?d.prototype:void 0,Lr=Fr?Fr.toString:void 0;var Ir=function r(t){if("string"==typeof t)return t;if(W(t))return wr(t,r)+"";if(Y(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var xr=function(r){return null==r?"":Ir(r)};var kr=function(r,t){return W(r)?r:J(r,t)?[r]:Mr(xr(r))},Dr=/^(?:0|[1-9]\d*)$/;var zr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&Dr.test(r))&&r>-1&&r%1==0&&r<t};var Sr=function(r){if("string"==typeof r||Y(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Br=function(r,t,e,i){if(!A(r))return r;for(var n=-1,s=(t=kr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=Sr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=A(c)?c:zr(t[n+1])?[]:{})}U(u,a,l),u=u[a]}return r};var Gr=function(r,t,e){return null==r?r:Br(r,t,e)};var Cr=function(r,t){for(var e=0,i=(t=kr(t,r)).length;null!=r&&e<i;)r=r[Sr(t[e++])];return e&&e==i?r:void 0};var Hr=function(r,t,e){var i=null==r?void 0:Cr(r,t);return void 0===i?e:i};const Ur=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Wr=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Ur(t,o.join("."),s.code,r)}),o=[]}else s&&Wr(s,t,o);return Object.assign(r,{[n]:s})},{})};class qr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof qr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Gr(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Wr(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Hr(e,t,!1)||Gr(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Hr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Hr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class Yr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new qr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new c.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new c.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Qr=null;const Zr=()=>Qr;let Jr={errorBagName:"errors",fieldsBagName:"fields",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Kr=()=>Jr,Xr=r=>{Jr={...Jr,...r}};var rt={provide(){return this.$livr&&!i(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(i(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Xr(this.$options.$_livr||{});const r=(r=>{const t=Hr(r,"$options.$_livr",{});return{...Jr,...t}})(this);(!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new Yr(Zr(),r));const e=(n=this.$options.inject,!(!t(n)||!n.$livr));var n;if(this.$livr||!r.inject||e||(this.$livr=new Yr(Zr(),r)),e||this.$livr){if(!e&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[r.errorBagName||"errors"]=function(){return this.$livr.errors},this.$options.computed[r.fieldsBagName||"fields"]=function(){return this.$livr.fields.items.reduce((r,t)=>t.scope?(r["$"+t.scope]||(r["$"+t.scope]={}),r["$"+t.scope][t.name]=t.flags,r):(r[t.name]=t.flags,r),{})}}}};function tt(r){const{extraRules:t,extendedErrors:i,aliasedRules:n=[]}=r;if(c.Validator.registerDefaultRules(t),n.forEach(r=>c.Validator.registerAliasedDefaultRule(r)),i){const r=(s=c.Validator.getDefaultRules(),Object.entries(s).reduce((r,[t,i])=>Object.assign(r,{[t]:e(t,i)}),{}));c.Validator.registerDefaultRules(r)}var s}let et,it;class nt{constructor(r,t){var e;this.configure(r),it=this,t&&(et=t),this.livrInstance=(e=new Yr(null,this.config),Qr=e,e),this.initVM(this.config)}initVM({errorBagName:r,fieldsBagName:t}){this._vm=new et({data:()=>({[r]:this.livrInstance.errors,[t]:this.livrInstance.fields})})}configure(r){Xr(r)}get config(){return Kr()}static get config(){return Kr()}static get instance(){return it}}var st={install:function(r,t={}){et&&r===et?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(et=r,tt(t),it=new nt(t),Yr.$livr=it,et.mixin(rt))}};r.default=st,Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r=r||self)["vue-livr"]={})}(this,(function(r){"use strict";const t=r=>null!==r&&r&&"object"==typeof r&&!Array.isArray(r),e=(r,e)=>(...i)=>{const n=e(...i),s=i.splice(0,i.length-1);return(...e)=>{const i=n(...e);if(i){const e={[r]:s};return Array.isArray(i)||t(i)?i:{code:i,rule:e}}return""}},i=r=>{if(!r)return!1;const{tag:t}=r.componentOptions;return/^(keep-alive|transition|transition-group)$/.test(t)};var n={isPrimitiveValue:r=>"string"==typeof r||(!("number"!=typeof r||!isFinite(r))||"boolean"==typeof r),looksLikeNumber:r=>!isNaN(+r),isObject:r=>Object(r)===r&&Object.getPrototypeOf(r)===Object.prototype,isEmptyObject(r){for(const t in r)if(r.hasOwnProperty(t))return!1;return!0},escapeRegExp:r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),isNoValue:r=>null==r||""===r};const s={};let o=0;class u{constructor(r,t){this.isPrepared=!1,this.livrRules=r,this.validators={},this.validatorBuilders={},this.errors=null,this.isAutoTrim=null!=t?t:o,this.registerRules(s)}static getDefaultRules(){return s}static registerAliasedDefaultRule(r){if(!r.name)throw"Alias name required";s[r.name]=this._buildAliasedRule(r.rules,r.error)}static registerDefaultRules(r){for(const t in r)s[t]=r[t]}static defaultAutoTrim(r){o=!!r}static _buildAliasedRule(r,t){if(!r)throw"Alias rules required";const e={value:r};return r=>{const i=new u(e).registerRules(r).prepare();return(r,e,n)=>{const s=i.validate({value:r});return s?void n.push(s.value):t||i.getErrors().value}}}prepare(){const r=this.livrRules;for(const t in r){let e=r[t];Array.isArray(e)||(e=[e]);const i=[];for(const r of e){const t=this._parseRule(r);i.push(this._buildValidator(t.name,t.args))}this.validators[t]=i}return this.isPrepared=!0,this}validate(r){if(this.isPrepared||this.prepare(),!n.isObject(r))return void(this.errors="FORMAT_ERROR");this.isAutoTrim&&(r=this._autoTrim(r));const t={},e={};for(const i in this.validators){const n=this.validators[i];if(!n||!n.length)continue;const s=r[i];for(const o of n){const n=[],u=o(e.hasOwnProperty(i)?e[i]:s,r,n);if(u){t[i]=u;break}n.length?e[i]=n[0]:r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=s)}}return n.isEmptyObject(t)?(this.errors=null,e):(this.errors=t,!1)}getErrors(){return this.errors}registerRules(r){for(const t in r)this.validatorBuilders[t]=r[t];return this}registerAliasedRule(r){if(!r.name)throw"Alias name required";return this.validatorBuilders[r.name]=this.constructor._buildAliasedRule(r.rules,r.error),this}getRules(){return this.validatorBuilders}_parseRule(r){let t,e;return n.isObject(r)?(t=Object.keys(r)[0],e=r[t],Array.isArray(e)||(e=[e])):(t=r,e=[]),{name:t,args:e}}_buildValidator(r,t){if(!this.validatorBuilders[r])throw"Rule ["+r+"] not registered";const e=[];return e.push.apply(e,t),e.push(this.getRules()),this.validatorBuilders[r].apply(null,e)}_autoTrim(r){const t=typeof r;if("object"!==t&&r)return r.replace?r.replace(/^\s*/,"").replace(/\s*$/,""):r;if("object"==t&&Array.isArray(r)){const t=[];for(const e of r)t.push(this._autoTrim(e));return t}if("object"==t&&n.isObject(r)){const t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=this._autoTrim(r[e]));return t}return r}}var a=u;const l={required:function(){return r=>{if(n.isNoValue(r))return"REQUIRED"}},not_empty:function(){return r=>{if(null!=r&&""===r)return"CANNOT_BE_EMPTY"}},not_empty_list:function(){return r=>void 0===r||""===r?"CANNOT_BE_EMPTY":Array.isArray(r)?r.length<1?"CANNOT_BE_EMPTY":void 0:"FORMAT_ERROR"},any_object:function(){return r=>{if(!n.isNoValue(r))return n.isObject(r)?void 0:"FORMAT_ERROR"}},string:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?void e.push(r+""):"FORMAT_ERROR"}},eq:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(t+""!=r+"")return"NOT_ALLOWED_VALUE";i.push(r)}}},one_of:function(r){return Array.isArray(r)||(r=Array.prototype.slice.call(arguments)).pop(),(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";for(const e of r)if(t+""==e+"")return void i.push(e);return"NOT_ALLOWED_VALUE"}}},max_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length>r)return"TOO_LONG";i.push(t)}}},min_length:function(r){return(t,e,i)=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if((t+="").length<r)return"TOO_SHORT";i.push(t)}}},length_equal:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="").length<r?"TOO_SHORT":t.length>r?"TOO_LONG":void i.push(t):"FORMAT_ERROR"}},length_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?(e+="").length<r?"TOO_SHORT":e.length>t?"TOO_LONG":void s.push(e):"FORMAT_ERROR"}},like:function(r,t){const e=3===arguments.length&&t.match("i"),i=new RegExp(r,e?"i":"");return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!(r+="").match(i))return"WRONG_FORMAT";e.push(r)}}},integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)&&Number.isInteger(+r)?void e.push(+r):"NOT_INTEGER":"FORMAT_ERROR"}},positive_integer:function(){return(r,t,e)=>{if(!n.isNoValue(r))return n.isPrimitiveValue(r)?n.looksLikeNumber(r)?!Number.isInteger(+r)||+r<1?"NOT_POSITIVE_INTEGER":void e.push(+r):"NOT_POSITIVE_INTEGER":"FORMAT_ERROR"}},decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_DECIMAL";if(!/^(?:\-?(?:(?:[0-9]+\.[0-9]+)|(?:[0-9]+)))$/.test(r+=""))return"NOT_DECIMAL";e.push(+r)}}},positive_decimal:function(){return(r,t,e)=>{if(!n.isNoValue(r)){if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";if(!n.looksLikeNumber(r))return"NOT_POSITIVE_DECIMAL";if(!/^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(r+=""))return"NOT_POSITIVE_DECIMAL";e.push(+r)}}},max_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t>+r?"TOO_HIGH":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},min_number:function(r){return(t,e,i)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?n.looksLikeNumber(t)?+t<+r?"TOO_LOW":void i.push(+t):"NOT_NUMBER":"FORMAT_ERROR"}},number_between:function(r,t){return(e,i,s)=>{if(!n.isNoValue(e))return n.isPrimitiveValue(e)?n.looksLikeNumber(e)?+e<+r?"TOO_LOW":+e>+t?"TOO_HIGH":void s.push(+e):"NOT_NUMBER":"FORMAT_ERROR"}},email:function(){var r=/^(([^<>()\[\]\\.,;:\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 t=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?(t+="",r.test(t)?/\@.*\@/.test(t)||/\@.*_/.test(t)?"WRONG_EMAIL":void 0:"WRONG_EMAIL"):"FORMAT_ERROR"}},equal_to_field:function(r){return(t,e)=>{if(!n.isNoValue(t))return n.isPrimitiveValue(t)?t!=e[r]?"FIELDS_NOT_EQUAL":void 0:"FORMAT_ERROR"}},url:function(){const r=new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[0-1]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))\\.?|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t=>{if(!n.isNoValue(t)){if(!n.isPrimitiveValue(t))return"FORMAT_ERROR";if(!(t.length<2083&&r.test(t)))return"WRONG_URL"}}},iso_date:function(){return r=>{if(n.isNoValue(r))return;if(!n.isPrimitiveValue(r))return"FORMAT_ERROR";const t=r.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);if(t){const e=Date.parse(r);if(!e&&0!==e)return"WRONG_DATE";const i=new Date(e);if(i.setTime(i.getTime()+60*i.getTimezoneOffset()*1e3),i.getFullYear()==t[1]&&i.getMonth()+1==+t[2]&&i.getDate()==+t[3])return}return"WRONG_DATE"}},nested_object:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!n.isObject(r))return"FORMAT_ERROR";const s=e.validate(r);return s?void i.push(s):e.getErrors()}},variable_object:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!n.isObject(t)||!t[r]||!i[t[r]])return"FORMAT_ERROR";const o=i[t[r]],u=o.validate(t);return u?void s.push(u):o.getErrors()}},list_of:function(r,t){Array.isArray(r)||(t=(r=Array.prototype.slice.call(arguments)).pop());const e={field:r},i=new a(e).registerRules(t).prepare();return(r,t,e)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=i.validate({field:t});r?(s.push(r.field),o.push(null)):(u=!0,o.push(i.getErrors().field),s.push(null))}return u?o:void e.push(s)}},list_of_objects:function(r,t){const e=new a(r).registerRules(t).prepare();return(r,t,i)=>{if(n.isNoValue(r))return;if(!Array.isArray(r))return"FORMAT_ERROR";const s=[],o=[];let u=!1;for(const t of r){const r=e.validate(t);r?(s.push(r),o.push(null)):(u=!0,o.push(e.getErrors()),s.push(null))}return u?o:void i.push(s)}},or:function(){const r=Array.prototype.slice.call(arguments),t=r.pop(),e=r.map(r=>new a({field:r}).registerRules(t).prepare());return(r,t,i)=>{let n;for(const t of e){const e=t.validate({field:r});if(e)return void i.push(e.field);n=t.getErrors().field}return n}},list_of_different_objects:function(r,t,e){const i={};for(const r in t){const n=new a(t[r]).registerRules(e).prepare();i[r]=n}return(t,e,s)=>{if(n.isNoValue(t))return;if(!Array.isArray(t))return"FORMAT_ERROR";const o=[],u=[];let a=!1;for(const e of t){if("object"!=typeof e||!e[r]||!i[e[r]]){u.push("FORMAT_ERROR");continue}const t=i[e[r]],n=t.validate(e);n?(o.push(n),u.push(null)):(a=!0,u.push(t.getErrors()),o.push(null))}return a?u:void s.push(o)}},default:r=>(t,e,i)=>{n.isNoValue(t)&&i.push(r)},trim:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.replace(/^\s*/,"").replace(/\s*$/,"")))}},to_lc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toLowerCase()))}},to_uc:function(){return(r,t,e)=>{n.isNoValue(r)||"object"==typeof r||(r+="",e.push(r.toUpperCase()))}},remove:function(r){r=n.escapeRegExp(r);const t=new RegExp("["+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}},leave_only:function(r){r=n.escapeRegExp(r);const t=new RegExp("[^"+r+"]","g");return(r,e,i)=>{n.isNoValue(r)||"object"==typeof r||(r+="",i.push(r.replace(t,"")))}}};a.registerDefaultRules(l);var c={Validator:a,rules:l,util:n},f="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),v=p.Symbol,d=Object.prototype,_=d.hasOwnProperty,R=d.toString,O=v?v.toStringTag:void 0;var g=function(r){var t=_.call(r,O),e=r[O];try{r[O]=void 0;var i=!0}catch(r){}var n=R.call(r);return i&&(t?r[O]=e:delete r[O]),n},y=Object.prototype.toString;var E=function(r){return y.call(r)},b=v?v.toStringTag:void 0;var m=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":b&&b in Object(r)?g(r):E(r)};var A=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var T,N=function(r){if(!A(r))return!1;var t=m(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},j=p["__core-js_shared__"],V=(T=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var $=function(r){return!!V&&V in r},P=Function.prototype.toString;var M=function(r){if(null!=r){try{return P.call(r)}catch(r){}try{return r+""}catch(r){}}return""},w=/^\[object .+?Constructor\]$/,F=Function.prototype,L=Object.prototype,x=F.toString,I=L.hasOwnProperty,k=RegExp("^"+x.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var D=function(r){return!(!A(r)||$(r))&&(N(r)?k:w).test(M(r))};var z=function(r,t){return null==r?void 0:r[t]};var S=function(r,t){var e=z(r,t);return D(e)?e:void 0},B=function(){try{var r=S(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();var G=function(r,t,e){"__proto__"==t&&B?B(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e};var C=function(r,t){return r===t||r!=r&&t!=t},H=Object.prototype.hasOwnProperty;var U=function(r,t,e){var i=r[t];H.call(r,t)&&C(i,e)&&(void 0!==e||t in r)||G(r,t,e)},W=Array.isArray;var q=function(r){return null!=r&&"object"==typeof r};var Y=function(r){return"symbol"==typeof r||q(r)&&"[object Symbol]"==m(r)},Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/;var J=function(r,t){if(W(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!Y(r))||(Z.test(r)||!Q.test(r)||null!=t&&r in Object(t))},K=S(Object,"create");var X=function(){this.__data__=K?K(null):{},this.size=0};var rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},tr=Object.prototype.hasOwnProperty;var er=function(r){var t=this.__data__;if(K){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return tr.call(t,r)?t[r]:void 0},ir=Object.prototype.hasOwnProperty;var nr=function(r){var t=this.__data__;return K?void 0!==t[r]:ir.call(t,r)};var sr=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=K&&void 0===t?"__lodash_hash_undefined__":t,this};function or(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}or.prototype.clear=X,or.prototype.delete=rr,or.prototype.get=er,or.prototype.has=nr,or.prototype.set=sr;var ur=or;var ar=function(){this.__data__=[],this.size=0};var lr=function(r,t){for(var e=r.length;e--;)if(C(r[e][0],t))return e;return-1},cr=Array.prototype.splice;var fr=function(r){var t=this.__data__,e=lr(t,r);return!(e<0)&&(e==t.length-1?t.pop():cr.call(t,e,1),--this.size,!0)};var hr=function(r){var t=this.__data__,e=lr(t,r);return e<0?void 0:t[e][1]};var pr=function(r){return lr(this.__data__,r)>-1};var vr=function(r,t){var e=this.__data__,i=lr(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this};function dr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}dr.prototype.clear=ar,dr.prototype.delete=fr,dr.prototype.get=hr,dr.prototype.has=pr,dr.prototype.set=vr;var _r=dr,Rr=S(p,"Map");var Or=function(){this.size=0,this.__data__={hash:new ur,map:new(Rr||_r),string:new ur}};var gr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r};var yr=function(r,t){var e=r.__data__;return gr(t)?e["string"==typeof t?"string":"hash"]:e.map};var Er=function(r){var t=yr(this,r).delete(r);return this.size-=t?1:0,t};var br=function(r){return yr(this,r).get(r)};var mr=function(r){return yr(this,r).has(r)};var Ar=function(r,t){var e=yr(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this};function Tr(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}Tr.prototype.clear=Or,Tr.prototype.delete=Er,Tr.prototype.get=br,Tr.prototype.has=mr,Tr.prototype.set=Ar;var Nr=Tr;function jr(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=e.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return e.cache=s.set(n,o)||s,o};return e.cache=new(jr.Cache||Nr),e}jr.Cache=Nr;var Vr=jr;var $r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,Mr=function(r){var t=Vr(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace($r,(function(r,e,i,n){t.push(i?n.replace(Pr,"$1"):e||r)})),t}));var wr=function(r,t){for(var e=-1,i=null==r?0:r.length,n=Array(i);++e<i;)n[e]=t(r[e],e,r);return n},Fr=v?v.prototype:void 0,Lr=Fr?Fr.toString:void 0;var xr=function r(t){if("string"==typeof t)return t;if(W(t))return wr(t,r)+"";if(Y(t))return Lr?Lr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Ir=function(r){return null==r?"":xr(r)};var kr=function(r,t){return W(r)?r:J(r,t)?[r]:Mr(Ir(r))},Dr=/^(?:0|[1-9]\d*)$/;var zr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&Dr.test(r))&&r>-1&&r%1==0&&r<t};var Sr=function(r){if("string"==typeof r||Y(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var Br=function(r,t,e,i){if(!A(r))return r;for(var n=-1,s=(t=kr(t,r)).length,o=s-1,u=r;null!=u&&++n<s;){var a=Sr(t[n]),l=e;if("__proto__"===a||"constructor"===a||"prototype"===a)return r;if(n!=o){var c=u[a];void 0===(l=i?i(c,a,u):void 0)&&(l=A(c)?c:zr(t[n+1])?[]:{})}U(u,a,l),u=u[a]}return r};var Gr=function(r,t,e){return null==r?r:Br(r,t,e)};var Cr=function(r,t){for(var e=0,i=(t=kr(t,r)).length;null!=r&&e<i;)r=r[Sr(t[e++])];return e&&e==i?r:void 0};var Hr=function(r,t,e){var i=null==r?void 0:Cr(r,t);return void 0===i?e:i};const Ur=(r={},t,e,i)=>{const n=r[e];return n?n(t,i):""},Wr=(r,t,e=[])=>{const i=Array.isArray(r);return Object.entries(r).reduce((r,[n,s])=>{let o=[].concat(e);if(i||o.push(n),s&&s.code){const[[,r]]=Object.entries(s.rule);Object.assign(s,{msg:Ur(t,o.join("."),s.code,r)}),o=[]}else s&&Wr(s,t,o);return Object.assign(r,{[n]:s})},{})};class qr{constructor(r,t={}){this.errorHandlers=t.errorHandlers,this.extendedErrors=t.extendedErrors,this.msgPath=this.extendedErrors?"msg":"",this.allTouched=!1,r&&r instanceof qr?(this.items=r.items,this.touchedFields=r.touchedFields):(this.items={},this.touchedFields={})}setTouched(r){Gr(this.touchedFields,r,!0)}setAllTouched(r=!1){this.allTouched=r}setError(r,t){const e=this.extendedErrors?Wr(r,this.errorHandlers):r,i=t?this.items:{};if(this.items=Object.assign({},i,e),t){Hr(e,t,!1)||Gr(this.items,t,"")}}clearErrors(r=this.items){r&&Object.entries(r).forEach(([r,t])=>"object"==typeof t?this.clearErrors(t):this.clearError(r))}clearError(r){this.setError({},r)}getError(r,t=0){if(!this.hasError(r,t))return"";const e=this.getErrors(r);return this.getMessage(e[t])}getMessage(r){return this.msgPath&&r?r[this.msgPath]:r}getErrors(r){return[].concat(Hr(this.items,r,[]))}hasError(r,t=0){const e=this.allTouched||Hr(this.touchedFields,r,!1),i=this.getErrors(r);return e&&!(r=>null==r||""===r)(this.getMessage(i[t]))}}class Yr{constructor(r,t){this.fields={items:[]},this.extendedErrors=t.extendedErrors,this.errors=new qr(null,t),this.$gzLivr=r||{_vm:{$emit:()=>{},$off:()=>{}}}}validate(r,t,e){const i=new c.Validator(r),n=i.validate(t),s=n||i.getErrors();return n?(this.errors.clearError(e),s):(this.errors.setError(Object.assign({},s),e),this.errors.setTouched(e),{errors:this.errors.items})}validateAll(r,t){this.validator=new c.Validator(r);const e=this.validator.validate(t),i=e||this.validator.getErrors();return e?(this.errors.clearErrors(),i):(this.errors.setError(i),this.errors.setAllTouched(!0),{errors:this.errors.items})}clearErrors(){this.errors.clearErrors()}clearError(r){this.errors.clearError(r)}}let Qr=null;const Zr=()=>Qr;let Jr={errorBagName:"errors",inject:!0,extendedErrors:!1,extraRules:{},aliasedRules:[]};const Kr=()=>Jr,Xr=r=>{Jr={...Jr,...r}};var rt={provide(){return this.$livr&&!i(this.$vnode)?{$livr:this.$livr}:{}},beforeCreate(){if(i(this.$vnode)||!1===this.$options.$__livrInject)return;this.$parent||Xr(this.$options.$_livr||{});const r=(r=>{const t=Hr(r,"$options.$_livr",{});return{...Jr,...t}})(this),e=(n=this.$options.inject,!(!t(n)||!n.$livr));var n;if((!this.$parent||this.$options.$_livr&&/new/.test(this.$options.$_livr.validator))&&(this.$livr=new Yr(Zr(),r)),this.$livr||!r.inject||e||(this.$livr=new Yr(Zr(),r)),e||this.$livr){if(!e&&this.$livr){this.$options._base.util.defineReactive(this.$livr,"errors",this.$livr.errors)}this.$options.computed||(this.$options.computed={}),this.$options.computed[r.errorBagName||"errors"]=function(){return this.$livr.errors}}}};function tt(r){const{extraRules:t,extendedErrors:i,aliasedRules:n=[]}=r;if(c.Validator.registerDefaultRules(t),n.forEach(r=>c.Validator.registerAliasedDefaultRule(r)),i){const r=(s=c.Validator.getDefaultRules(),Object.entries(s).reduce((r,[t,i])=>Object.assign(r,{[t]:e(t,i)}),{}));c.Validator.registerDefaultRules(r)}var s}let et,it;class nt{constructor(r,t){var e;this.configure(r),it=this,t&&(et=t),this.livrInstance=(e=new Yr(null,this.config),Qr=e,e),this.initVM(this.config)}initVM({errorBagName:r}){this._vm=new et({data:()=>({[r]:this.livrInstance.errors})})}configure(r){Xr(r)}get config(){return Kr()}static get config(){return Kr()}static get instance(){return it}}var st={install:function(r,t={}){et&&r===et?"production"!==process.env.NODE_ENV&&console.warn("already installed, Vue.use(LivrPlugin) should only be called once."):(et=r,tt(t),it=new nt(t),Yr.$livr=it,et.mixin(rt))}};r.default=st,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "vue-livr",
"version": "0.2.5",
"version": "1.0.0",
"description": "Vue LIVR plugin",

@@ -5,0 +5,0 @@ "author": "Jonatas Gusmão <js.gusmao@hotmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc