function T(s){this._maxSize=s,this.clear()}T.prototype.clear=function(){this._size=0,this._values=Object.create(null)};T.prototype.get=function(s){return this._values[s]};T.prototype.set=function(s,e){return this._size>=this._maxSize&&this.clear(),s in this._values||this._size++,this._values[s]=e};var ot=/[^.^\]^[]+|(?=\[\]|\.\.)/g,et=/^\d+$/,ht=/^\d/,ct=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ft=/^\s*(['"]?)(.*?)(\1)\s*$/,V=512,B=new T(V),K=new T(V),W=new T(V),rt={Cache:T,split:P,normalizePath:M,setter:function(s){var e=M(s);return K.get(s)||K.set(s,function(r,n){for(var i=0,a=e.length,u=r;i<a-1;){var l=e[i];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;u=u[e[i++]]}u[e[i]]=n})},getter:function(s,e){var t=M(s);return W.get(s)||W.set(s,function(n){for(var i=0,a=t.length;i<a;)if(n!=null||!e)n=n[t[i++]];else return;return n})},join:function(s){return s.reduce(function(e,t){return e+(U(t)||et.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(s,e,t){dt(Array.isArray(s)?s:P(s),e,t)}};function M(s){return B.get(s)||B.set(s,P(s).map(function(e){return e.replace(ft,"$2")}))}function P(s){return s.match(ot)||[""]}function dt(s,e,t){var r=s.length,n,i,a,u;for(i=0;i<r;i++)n=s[i],n&&(yt(n)&&(n='"'+n+'"'),u=U(n),a=!u&&/^\d+$/.test(n),e.call(t,n,u,a,i,s))}function U(s){return typeof s=="string"&&s&&["'",'"'].indexOf(s.charAt(0))!==-1}function pt(s){return s.match(ht)&&!s.match(et)}function mt(s){return ct.test(s)}function yt(s){return!U(s)&&(pt(s)||mt(s))}var st={exports:{}};st.exports=function(s){return nt(gt(s),s)};st.exports.array=nt;function nt(s,e){var t=s.length,r=new Array(t),n={},i=t,a=bt(e),u=Ft(s);for(e.forEach(function(o){if(!u.has(o[0])||!u.has(o[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)n[i]||l(s[i],i,new Set);return r;function l(o,h,f){if(f.has(o)){var d;try{d=", node was:"+JSON.stringify(o)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!u.has(o))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(o));if(!n[h]){n[h]=!0;var m=a.get(o)||new Set;if(m=Array.from(m),h=m.length){f.add(o);do{var E=m[--h];l(E,u.get(E),f)}while(h);f.delete(o)}r[--t]=o}}}function gt(s){for(var e=new Set,t=0,r=s.length;t<r;t++){var n=s[t];e.add(n[0]),e.add(n[1])}return Array.from(e)}function bt(s){for(var e=new Map,t=0,r=s.length;t<r;t++){var n=s[t];e.has(n[0])||e.set(n[0],new Set),e.has(n[1])||e.set(n[1],new Set),e.get(n[0]).add(n[1])}return e}function Ft(s){for(var e=new Map,t=0,r=s.length;t<r;t++)e.set(s[t],t);return e}const wt=Object.prototype.toString,$t=Error.prototype.toString,Et=RegExp.prototype.toString,vt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",xt=/^Symbol\((.*)\)(.*)$/;function Tt(s){return s!=+s?"NaN":s===0&&1/s<0?"-0":""+s}function tt(s,e=!1){if(s==null||s===!0||s===!1)return""+s;const t=typeof s;if(t==="number")return Tt(s);if(t==="string")return e?`"${s}"`:s;if(t==="function")return"[Function "+(s.name||"anonymous")+"]";if(t==="symbol")return vt.call(s).replace(xt,"Symbol($1)");const r=wt.call(s).slice(8,-1);return r==="Date"?isNaN(s.getTime())?""+s:s.toISOString(s):r==="Error"||s instanceof Error?"["+$t.call(s)+"]":r==="RegExp"?Et.call(s):null}function w(s,e){let t=tt(s,e);return t!==null?t:JSON.stringify(s,function(r,n){let i=tt(this[r],e);return i!==null?i:n},2)}function it(s){return s==null?[]:[].concat(s)}let at,_t=/\$\{\s*(\w+)\s*\}/g;at=Symbol.toStringTag;class p extends Error{static formatError(e,t){const r=t.label||t.path||"this";return r!==t.path&&(t=Object.assign({},t,{path:r})),typeof e=="string"?e.replace(_t,(n,i)=>w(t[i])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,r,n,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[at]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=n,this.errors=[],this.inner=[],it(e).forEach(a=>{if(p.isError(a)){this.errors.push(...a.errors);const u=a.inner.length?a.inner:[a];this.inner.push(...u)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!i&&Error.captureStackTrace&&Error.captureStackTrace(this,p)}}let b={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:s,type:e,value:t,originalValue:r})=>{const n=r!=null&&r!==t?` (cast from the value \`${w(r,!0)}\`).`:".";return e!=="mixed"?`${s} must be a \`${e}\` type, but the final value was: \`${w(t,!0)}\``+n:`${s} must match the configured type. The validated value was: \`${w(t,!0)}\``+n}},y={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},St={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},q={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ot={isValue:"${path} field must be ${value}"},kt={noUnknown:"${path} field has unspecified keys: ${unknown}"},Dt={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},At={notType:s=>{const{path:e,value:t,spec:r}=s,n=r.types.length;if(Array.isArray(t)){if(t.length<n)return`${e} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${w(t,!0)}\``;if(t.length>n)return`${e} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${w(t,!0)}\``}return p.formatError(b.notType,s)}};Object.assign(Object.create(null),{mixed:b,string:y,number:St,date:q,object:kt,array:Dt,boolean:Ot,tuple:At});const ut=s=>s&&s.__isYupSchema__;class C{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:i}=t,a=typeof r=="function"?r:(...u)=>u.every(l=>l===r);return new C(e,(u,l)=>{var o;let h=a(...u)?n:i;return(o=h==null?void 0:h(l))!=null?o:l})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(i=>i.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),n=this.fn(r,e,t);if(n===void 0||n===e)return e;if(!ut(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const A={context:"$",value:"."};class k{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===A.context,this.isValue=this.key[0]===A.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?A.context:this.isValue?A.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&rt.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}k.prototype.__isYupRef=!0;const x=s=>s==null;function S(s){function e({value:t,path:r="",options:n,originalValue:i,schema:a},u,l){const{name:o,test:h,params:f,message:d,skipAbsent:m}=s;let{parent:E,context:g,abortEarly:j=a.spec.abortEarly,disableStackTrace:Z=a.spec.disableStackTrace}=n;function v(c){return k.isRef(c)?c.getValue(t,E,g):c}function G(c={}){var H;const _=Object.assign({value:t,originalValue:i,label:a.spec.label,path:c.path||r,spec:a.spec},f,c.params);for(const Q of Object.keys(_))_[Q]=v(_[Q]);const J=new p(p.formatError(c.message||d,_),t,_.path,c.type||o,(H=c.disableStackTrace)!=null?H:Z);return J.params=_,J}const z=j?u:l;let R={path:r,parent:E,type:o,from:n.from,createError:G,resolve:v,options:n,originalValue:i,schema:a};const I=c=>{p.isError(c)?z(c):c?l(null):z(G())},Y=c=>{p.isError(c)?z(c):u(c)};if(m&&x(t))return I(!0);let D;try{var X;if(D=h.call(R,t,R),typeof((X=D)==null?void 0:X.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${R.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(D).then(I,Y)}}catch(c){Y(c);return}I(D)}return e.OPTIONS=s,e}function Ct(s,e,t,r=t){let n,i,a;return e?(rt.forEach(e,(u,l,o)=>{let h=l?u.slice(1,u.length-1):u;s=s.resolve({context:r,parent:n,value:t});let f=s.type==="tuple",d=o?parseInt(h,10):0;if(s.innerType||f){if(f&&!o)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&d>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[d],s=f?s.spec.types[d]:s.innerType}if(!o){if(!s.fields||!s.fields[h])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${s.type}")`);n=t,t=t&&t[h],s=s.fields[h]}i=h,a=l?"["+u+"]":"."+u}),{schema:s,parent:n,parentPath:i}):{parent:n,parentPath:e,schema:s}}class N extends Set{describe(){const e=[];for(const t of this.values())e.push(k.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new N(this.values())}merge(e,t){const r=this.clone();return e.forEach(n=>r.add(n)),t.forEach(n=>r.delete(n)),r}}function O(s,e=new Map){if(ut(s)||!s||typeof s!="object")return s;if(e.has(s))return e.get(s);let t;if(s instanceof Date)t=new Date(s.getTime()),e.set(s,t);else if(s instanceof RegExp)t=new RegExp(s),e.set(s,t);else if(Array.isArray(s)){t=new Array(s.length),e.set(s,t);for(let r=0;r<s.length;r++)t[r]=O(s[r],e)}else if(s instanceof Map){t=new Map,e.set(s,t);for(const[r,n]of s.entries())t.set(r,O(n,e))}else if(s instanceof Set){t=new Set,e.set(s,t);for(const r of s)t.add(O(r,e))}else if(s instanceof Object){t={},e.set(s,t);for(const[r,n]of Object.entries(s))t[r]=O(n,e)}else throw Error(`Unable to clone ${s}`);return t}class ${constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new N,this._blacklist=new N,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(b.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=O(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const n=Object.assign({},t.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(i=>{e.tests.forEach(a=>{i.test(a.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((n,i)=>i.resolve(n,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,n,i;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(n=e.recursive)!=null?n:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({value:e},t)),n=t.assert==="ignore-optionality",i=r._cast(e,t);if(t.assert!==!1&&!r.isType(i)){if(n&&x(i))return i;let a=w(e),u=w(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". 

attempted value: ${a} 
`+(u!==a?`result of cast: ${u}`:""))}return i}_cast(e,t){let r=e===void 0?e:this.transforms.reduce((n,i)=>i.call(this,n,e,this),e);return r===void 0&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:i,originalValue:a=e,strict:u=this.spec.strict}=t,l=e;u||(l=this._cast(l,Object.assign({assert:!1},t)));let o=[];for(let h of Object.values(this.internalTests))h&&o.push(h);this.runTests({path:i,value:l,originalValue:a,options:t,tests:o},r,h=>{if(h.length)return n(h,l);this.runTests({path:i,value:l,originalValue:a,options:t,tests:this.tests},r,n)})}runTests(e,t,r){let n=!1,{tests:i,value:a,originalValue:u,path:l,options:o}=e,h=g=>{n||(n=!0,t(g,a))},f=g=>{n||(n=!0,r(g,a))},d=i.length,m=[];if(!d)return f([]);let E={value:a,originalValue:u,path:l,options:o,schema:this};for(let g=0;g<i.length;g++){const j=i[g];j(E,h,function(v){v&&(Array.isArray(v)?m.push(...v):m.push(v)),--d<=0&&f(m)})}}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:i,options:a}){const u=e??t;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof u=="number";let o=r[u];const h=Object.assign({},a,{strict:!0,parent:r,value:o,originalValue:i[u],key:void 0,[l?"index":"key"]:u,path:l||u.includes(".")?`${n||""}[${o?u:`"${u}"`}]`:(n?`${n}.`:"")+e});return(f,d,m)=>this.resolve(h)._validate(o,h,d,m)}validate(e,t){var r;let n=this.resolve(Object.assign({},t,{value:e})),i=(r=t==null?void 0:t.disableStackTrace)!=null?r:n.spec.disableStackTrace;return new Promise((a,u)=>n._validate(e,t,(l,o)=>{p.isError(l)&&(l.value=o),u(l)},(l,o)=>{l.length?u(new p(l,o,void 0,void 0,i)):a(o)}))}validateSync(e,t){var r;let n=this.resolve(Object.assign({},t,{value:e})),i,a=(r=t==null?void 0:t.disableStackTrace)!=null?r:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(u,l)=>{throw p.isError(u)&&(u.value=l),u},(u,l)=>{if(u.length)throw new p(u,e,void 0,void 0,a);i=l}),i}isValid(e,t){return this.validate(e,t).then(()=>!0,r=>{if(p.isError(r))return!1;throw r})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(r){if(p.isError(r))return!1;throw r}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):O(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=S({message:t,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=S({message:t,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=b.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=b.notNull){return this.nullability(!1,e)}required(e=b.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=b.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),n=S(t),i=t.exclusive||t.name&&r.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===t.name&&(i||a.OPTIONS.test===n.OPTIONS.test))),r.tests.push(n),r}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let r=this.clone(),n=it(e).map(i=>new k(i));return n.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof t=="function"?new C(n,t):C.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=S({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=b.oneOf){let r=this.clone();return e.forEach(n=>{r._whitelist.add(n),r._blacklist.delete(n)}),r.internalTests.whiteList=S({message:t,name:"oneOf",skipAbsent:!0,test(n){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(n)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(e,t=b.notOneOf){let r=this.clone();return e.forEach(n=>{r._blacklist.add(n),r._whitelist.delete(n)}),r.internalTests.blacklist=S({message:t,name:"notOneOf",test(n){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(n)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:i,nullable:a}=t.spec;return{meta:n,label:r,optional:i,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,o,h)=>h.findIndex(f=>f.name===l.name)===o)}}}$.prototype.__isYupSchema__=!0;for(const s of["validate","validateSync"])$.prototype[`${s}At`]=function(e,t,r={}){const{parent:n,parentPath:i,schema:a}=Ct(this,e,t,r.context);return a[s](n&&n[i],Object.assign({},r,{parent:n,path:e}))};for(const s of["equals","is"])$.prototype[s]=$.prototype.oneOf;for(const s of["not","nope"])$.prototype[s]=$.prototype.notOneOf;let Nt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,zt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Rt=s=>x(s)||s===s.trim(),It={}.toString();function Mt(){return new lt}class lt extends ${constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t,r)=>{if(!r.spec.coerce||r.isType(e)||Array.isArray(e))return e;const n=e!=null&&e.toString?e.toString():e;return n===It?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||b.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=y.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,t=y.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,t=y.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,t){let r=!1,n,i;return t&&(typeof t=="object"?{excludeEmptyString:r=!1,message:n,name:i}=t:n=t),this.test({name:i||"matches",message:n||y.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&r||a.search(e)!==-1})}email(e=y.email){return this.matches(Nt,{name:"email",message:e,excludeEmptyString:!0})}url(e=y.url){return this.matches(jt,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=y.uuid){return this.matches(zt,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=y.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:Rt})}lowercase(e=y.lowercase){return this.transform(t=>x(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>x(t)||t===t.toLowerCase()})}uppercase(e=y.uppercase){return this.transform(t=>x(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>x(t)||t===t.toUpperCase()})}}Mt.prototype=lt.prototype;const Pt=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function F(s,e=0){return Number(s)||e}function qt(s){const e=Pt.exec(s);if(!e)return Date.parse?Date.parse(s):Number.NaN;const t={year:F(e[1]),month:F(e[2],1)-1,day:F(e[3],1),hour:F(e[4]),minute:F(e[5]),second:F(e[6]),millisecond:e[7]?F(e[7].substring(0,3)):0,z:e[8]||void 0,plusMinus:e[9]||void 0,hourOffset:F(e[10]),minuteOffset:F(e[11])};if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}let Vt=new Date(""),Ut=s=>Object.prototype.toString.call(s)==="[object Date]";class L extends ${constructor(){super({type:"date",check(e){return Ut(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=qt(e),isNaN(e)?L.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(k.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=q.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(r)}})}max(e,t=q.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(r)}})}}L.INVALID_DATE=Vt;export{Mt as c};