"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function tt(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function q(t,r,n){return n&&tt(t,n),t}function T(){return(T=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}function E(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r}function N(t,r){if(t==null)return{};var n,e,u={},o=Object.keys(t);for(e=0;e<o.length;e++)r.indexOf(n=o[e])>=0||(u[n]=t[n]);return u}function A(t){return((r=t)!=null&&typeof r=="object"&&Array.isArray(r)===!1)==1&&Object.prototype.toString.call(t)==="[object Object]";var r}var V=Object.prototype,F=V.toString,et=V.hasOwnProperty,L=/^\s*function (\w+)/;function S(t){var r,n=(r=t?.type)!==null&&r!==void 0?r:t;if(n){var e=n.toString().match(L);return e?e[1]:""}return""}var g=function(t){var r,n;return A(t)!==!1&&typeof(r=t.constructor)=="function"&&A(n=r.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1},rt=function(t){return t},y=rt,j=function(t,r){return et.call(t,r)},nt=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t},O=Array.isArray||function(t){return F.call(t)==="[object Array]"},m=function(t){return F.call(t)==="[object Function]"},w=function(t){return g(t)&&j(t,"_vueTypes_name")},Y=function(t){return g(t)&&(j(t,"type")||["_vueTypes_name","validator","default","required"].some(function(r){return j(t,r)}))};function x(t,r){return Object.defineProperty(t.bind(r),"__original",{value:t})}function b(t,r,n){var e,u=!0,o="";e=g(t)?t:{type:t};var f=w(e)?e._vueTypes_name+" - ":"";if(Y(e)&&e.type!==null){if(e.type===void 0||e.type===!0||!e.required&&r===void 0)return u;O(e.type)?(u=e.type.some(function(a){return b(a,r)===!0}),o=e.type.map(function(a){return S(a)}).join(" or ")):u=(o=S(e))==="Array"?O(r):o==="Object"?g(r):o==="String"||o==="Number"||o==="Boolean"||o==="Function"?(function(a){if(a==null)return"";var v=a.constructor.toString().match(L);return v?v[1]:""})(r)===o:r instanceof e.type}if(!u){var l=f+'value "'+r+'" should be of type "'+o+'"';return l}if(j(e,"validator")&&m(e.validator)){var i=y,c=[];if(y=function(a){c.push(a)},u=e.validator(r),y=i,!u){var p=(c.length>1?"* ":"")+c.join(`
* `);return c.length=0,p}}return u}function s(t,r){var n=Object.defineProperties(r,{_vueTypes_name:{value:t,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(u){return u!==void 0||this.default?m(u)||b(this,u)===!0?(this.default=O(u)?function(){return[].concat(u)}:g(u)?function(){return Object.assign({},u)}:u,this):(y(this._vueTypes_name+' - invalid default value: "'+u+'"'),this):this}}}),e=n.validator;return m(e)&&(n.validator=x(e,n)),n}function d(t,r){var n=s(t,r);return Object.defineProperty(n,"validate",{value:function(e){return m(this.validator)&&y(this._vueTypes_name+` - calling .validate() will overwrite the current custom validator function. Validator info:
`+JSON.stringify(this)),this.validator=x(e,this),this}})}function P(t,r,n){var e,u,o=(e=r,u={},Object.getOwnPropertyNames(e).forEach(function(a){u[a]=Object.getOwnPropertyDescriptor(e,a)}),Object.defineProperties({},u));if(o._vueTypes_name=t,!g(n))return o;var f,l,i=n.validator,c=N(n,["validator"]);if(m(i)){var p=o.validator;p&&(p=(l=(f=p).__original)!==null&&l!==void 0?l:f),o.validator=x(p?function(a){return p.call(this,a)&&i.call(this,a)}:i,o)}return Object.assign(o,c)}function k(t){return t.replace(/^(?!\s*$)/gm,"  ")}var B=function(){return d("any",{})},D=function(){return d("function",{type:Function})},M=function(){return d("boolean",{type:Boolean})},I=function(){return d("string",{type:String})},J=function(){return d("number",{type:Number})},R=function(){return d("array",{type:Array})},$=function(){return d("object",{type:Object})},z=function(){return s("integer",{type:Number,validator:function(t){return nt(t)}})},C=function(){return s("symbol",{validator:function(t){return typeof t=="symbol"}})};function G(t,r){if(r===void 0&&(r="custom validation failed"),typeof t!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return s(t.name||"<<anonymous function>>",{validator:function(n){var e=t(n);return e||y(this._vueTypes_name+" - "+r),e}})}function H(t){if(!O(t))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var r='oneOf - value should be one of "'+t.join('", "')+'".',n=t.reduce(function(e,u){if(u!=null){var o=u.constructor;e.indexOf(o)===-1&&e.push(o)}return e},[]);return s("oneOf",{type:n.length>0?n:void 0,validator:function(e){var u=t.indexOf(e)!==-1;return u||y(r),u}})}function K(t){if(!O(t))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var r=!1,n=[],e=0;e<t.length;e+=1){var u=t[e];if(Y(u)){if(w(u)&&u._vueTypes_name==="oneOf"){n=n.concat(u.type);continue}if(m(u.validator)&&(r=!0),u.type!==!0&&u.type){n=n.concat(u.type);continue}}n.push(u)}return n=n.filter(function(o,f){return n.indexOf(o)===f}),s("oneOfType",r?{type:n,validator:function(o){var f=[],l=t.some(function(i){var c=b(w(i)&&i._vueTypes_name==="oneOf"?i.type||null:i,o);return typeof c=="string"&&f.push(c),c===!0});return l||y("oneOfType - provided value does not match any of the "+f.length+` passed-in validators:
`+k(f.join(`
`))),l}}:{type:n})}function Q(t){return s("arrayOf",{type:Array,validator:function(r){var n,e=r.every(function(u){return(n=b(t,u))===!0});return e||y(`arrayOf - value validation error:
`+k(n)),e}})}function U(t){return s("instanceOf",{type:t})}function W(t){return s("objectOf",{type:Object,validator:function(r){var n,e=Object.keys(r).every(function(u){return(n=b(t,r[u]))===!0});return e||y(`objectOf - value validation error:
`+k(n)),e}})}function X(t){var r=Object.keys(t),n=r.filter(function(u){var o;return!!(!((o=t[u])===null||o===void 0)&&o.required)}),e=s("shape",{type:Object,validator:function(u){var o=this;if(!g(u))return!1;var f=Object.keys(u);if(n.length>0&&n.some(function(i){return f.indexOf(i)===-1})){var l=n.filter(function(i){return f.indexOf(i)===-1});return y(l.length===1?'shape - required property "'+l[0]+'" is not defined.':'shape - required properties "'+l.join('", "')+'" are not defined.'),!1}return f.every(function(i){if(r.indexOf(i)===-1)return o._vueTypes_isLoose===!0||(y('shape - shape definition does not include a "'+i+'" property. Allowed keys: "'+r.join('", "')+'".'),!1);var c=b(t[i],u[i]);return typeof c=="string"&&y('shape - "'+i+`" property validation error:
 `+k(c)),c===!0})}});return Object.defineProperty(e,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(e,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),e}var h=(function(){function t(){}return t.extend=function(r){var n=this;if(O(r))return r.forEach(function(a){return n.extend(a)}),this;var e=r.name,u=r.validate,o=u!==void 0&&u,f=r.getter,l=f!==void 0&&f,i=N(r,["name","validate","getter"]);if(j(this,e))throw new TypeError('[VueTypes error]: Type "'+e+'" already defined');var c,p=i.type;return w(p)?(delete i.type,Object.defineProperty(this,e,l?{get:function(){return P(e,p,i)}}:{value:function(){var a,v=P(e,p,i);return v.validator&&(v.validator=(a=v.validator).bind.apply(a,[v].concat([].slice.call(arguments)))),v}})):(c=l?{get:function(){var a=Object.assign({},i);return o?d(e,a):s(e,a)},enumerable:!0}:{value:function(){var a,v,_=Object.assign({},i);return a=o?d(e,_):s(e,_),_.validator&&(a.validator=(v=_.validator).bind.apply(v,[a].concat([].slice.call(arguments)))),a},enumerable:!0},Object.defineProperty(this,e,c))},q(t,null,[{key:"any",get:function(){return B()}},{key:"func",get:function(){return D().def(this.defaults.func)}},{key:"bool",get:function(){return M().def(this.defaults.bool)}},{key:"string",get:function(){return I().def(this.defaults.string)}},{key:"number",get:function(){return J().def(this.defaults.number)}},{key:"array",get:function(){return R().def(this.defaults.array)}},{key:"object",get:function(){return $().def(this.defaults.object)}},{key:"integer",get:function(){return z().def(this.defaults.integer)}},{key:"symbol",get:function(){return C()}}]),t})();function Z(t){var r;return t===void 0&&(t={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(r=(function(n){function e(){return n.apply(this,arguments)||this}return E(e,n),q(e,null,[{key:"sensibleDefaults",get:function(){return T({},this.defaults)},set:function(u){this.defaults=u!==!1?T({},u!==!0?u:t):{}}}]),e})(h)).defaults=T({},t),r}h.defaults={},h.custom=G,h.oneOf=H,h.instanceOf=U,h.oneOfType=K,h.arrayOf=Q,h.objectOf=W,h.shape=X,h.utils={validate:function(t,r){return b(r,t)===!0},toType:function(t,r,n){return n===void 0&&(n=!1),n?d(t,r):s(t,r)}};(function(t){function r(){return t.apply(this,arguments)||this}return E(r,t),r})(Z());exports.any=B;exports.array=R;exports.arrayOf=Q;exports.bool=M;exports.createTypes=Z;exports.custom=G;exports.fromType=P;exports.func=D;exports.instanceOf=U;exports.integer=z;exports.number=J;exports.object=$;exports.objectOf=W;exports.oneOf=H;exports.oneOfType=K;exports.shape=X;exports.string=I;exports.symbol=C;exports.toType=s;exports.toValidableType=d;exports.validateType=b;
