Comparing version 0.31.0-rc.2 to 0.31.0-rc.3
@@ -1,1 +0,1 @@ | ||
var _=/^[A-Z]{6}(?!00)[A-Z\d]{2}(?:[A-Z\d]{3})?$/u,q=/^[a-z][\da-z]*$/u,P=/^\d+$/u,D=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,N=/^\p{RGI_Emoji}+$/v,W=/^(?:0h|0x)?[\da-f]+$/iu,V=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/iu,K=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,L=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,C=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,$=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,z=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,U=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])T(?:0\d|1\d|2[0-3]):[0-5]\d$/u,F=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,G=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,X=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])T(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,H=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,J=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$/iu,Z=/^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,Q=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$|^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,Y=/^(?:0o)?[0-7]+$/iu,ee=/^[\da-hjkmnp-tv-z]{26}$/iu,ne=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;var k;function Ds(s){k={...k,...s}}function y(s){return{lang:s?.lang??k?.lang,message:s?.message,abortEarly:s?.abortEarly??k?.abortEarly,abortPipeEarly:s?.abortPipeEarly??k?.abortPipeEarly,skipPipe:s?.skipPipe}}function Ns(){k=void 0}var w;function Vs(s,n){w||(w=new Map),w.set(n,s)}function se(s){return w?.get(s)}function Ks(s){w?.delete(s)}var b;function Cs(s,n){b||(b=new Map),b.set(n,s)}function te(s){return b?.get(s)}function $s(s){b?.delete(s)}var g;function Us(s,n,e){g||(g=new Map),g.get(s)||g.set(s,new Map),g.get(s).set(e,n)}function re(s,n){return g?.get(s)?.get(n)}function Fs(s,n){g?.get(s)?.delete(n)}function T(s){let n=typeof s;return n==="object"&&(n=s?Object.getPrototypeOf(s).constructor.name:"null"),n==="string"?`"${s}"`:n==="number"||n==="bigint"||n==="boolean"?`${s}`:n}function u(s,n,e,t,r){let o=r&&"input"in r?r.input:e.value,i=r?.expected??s.expects,c=r?.received??T(o),a={kind:s.kind,type:s.type,input:o,expected:i,received:c,message:`Invalid ${n}: ${i?`Expected ${i} but r`:"R"}eceived ${c}`,requirement:s.requirement,path:r?.path,issues:r?.issues,lang:t.lang,abortEarly:t.abortEarly,abortPipeEarly:t.abortPipeEarly,skipPipe:t.skipPipe},p=s.kind==="schema",I=s.message??re(s.reference,a.lang)??(p?te(a.lang):null)??t.message??se(a.lang);I&&(a.message=typeof I=="function"?I(a):I),p&&(e.typed=!1),e.issues?e.issues.push(a):e.issues=[a]}function f(s){return s!=="__proto__"&&s!=="prototype"&&s!=="constructor"}var ce=/\D/gu;function B(s){let n=s.replace(ce,""),e=n.length,t=1,r=0;for(;e;){let o=+n[--e];t^=1,r+=t?[0,2,4,6,8,1,3,5,7,9][o]:o}return r%10===0}function et(s,n){let e={};for(let t of s)e[t]=n;return e}function st(s,n){return n.kind===s}function rt(s,n){return n.type===s}function ot(s){return s instanceof h}var h=class extends Error{issues;constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};function pe(s){return{kind:"validation",type:"bic",reference:pe,async:!1,expects:null,requirement:_,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"BIC",n,e),n}}}function Ie(s,n){return{kind:"validation",type:"bytes",reference:Ie,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r!==this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function me(s){return{kind:"transformation",type:"brand",reference:me,async:!1,name:s,_run(n){return n}}}function de(s,n){return{kind:"validation",type:"check",reference:de,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement(e.value)&&u(this,"input",e,t),e}}}function Te(s,n){return{kind:"validation",type:"check",reference:Te,async:!0,expects:null,requirement:s,message:n,async _run(e,t){return e.typed&&!await this.requirement(e.value)&&u(this,"input",e,t),e}}}var le=/^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,fe=/[- ]/gu,ye=[/^3[47]\d{13}$/u,/^3(?:0[0-5]|[68]\d)\d{11,13}$/u,/^6(?:011|5\d{2})\d{12,15}$/u,/^(?:2131|1800|35\d{3})\d{11}$/u,/^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u,/^(?:6[27]\d{14,17}|81\d{14,17})$/u,/^4\d{12}(?:\d{3,6})?$/u];function he(s){return{kind:"validation",type:"credit_card",reference:he,async:!1,expects:null,requirement(n){let e;return le.test(n)&&(e=n.replace(fe,""))&&ye.some(t=>t.test(e))&&B(e)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"credit card",n,e),n}}}function xe(s){return{kind:"validation",type:"cuid2",reference:xe,async:!1,expects:null,requirement:q,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"Cuid2",n,e),n}}}function ge(s){return{kind:"validation",type:"decimal",reference:ge,async:!1,expects:null,requirement:P,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"decimal",n,e),n}}}function ke(s){return{kind:"validation",type:"email",reference:ke,expects:null,async:!1,requirement:D,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"email",n,e),n}}}function Se(s){return{kind:"validation",type:"emoji",reference:Se,async:!1,expects:null,requirement:N,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"emoji",n,e),n}}}function Oe(s){return{kind:"validation",type:"empty",reference:Oe,async:!1,expects:"0",message:s,_run(n,e){return n.typed&&n.value.length>0&&u(this,"length",n,e,{received:`${n.value.length}`}),n}}}function we(s,n){return{kind:"validation",type:"ends_with",reference:we,async:!1,expects:`"${s}"`,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.endsWith(this.requirement)&&u(this,"end",e,t,{received:`"${e.value.slice(-this.requirement.length)}"`}),e}}}function be(s,n){return{kind:"validation",type:"every",reference:be,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.every(this.requirement)&&u(this,"content",e,t),e}}}function Ee(s,n){let e=T(s);return{kind:"validation",type:"excludes",reference:Ee,async:!1,expects:`!${e}`,requirement:s,message:n,_run(t,r){return t.typed&&t.value.includes(this.requirement)&&u(this,"content",t,r,{received:e}),t}}}function Be(s){return{kind:"validation",type:"finite",reference:Be,async:!1,expects:null,requirement:Number.isFinite,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"finite",n,e),n}}}var Me={md4:32,md5:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8,adler32:8};function Ae(s,n){return{kind:"validation",type:"hash",reference:Ae,expects:null,async:!1,requirement:RegExp(s.map(e=>`^[a-f0-9]{${Me[e]}}$`).join("|"),"iu"),message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"hash",e,t),e}}}function je(s){return{kind:"validation",type:"hexadecimal",reference:je,async:!1,expects:null,requirement:W,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"hexadecimal",n,e),n}}}function Re(s){return{kind:"validation",type:"hex_color",reference:Re,async:!1,expects:null,requirement:V,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"hex color",n,e),n}}}function ve(s){return{kind:"validation",type:"imei",reference:ve,async:!1,expects:null,requirement(n){return K.test(n)&&B(n)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"IMEI",n,e),n}}}function _e(s,n){let e=T(s);return{kind:"validation",type:"includes",reference:_e,async:!1,expects:e,requirement:s,message:n,_run(t,r){return t.typed&&!t.value.includes(this.requirement)&&u(this,"content",t,r,{received:`!${e}`}),t}}}function qe(s){return{kind:"validation",type:"integer",reference:qe,async:!1,expects:null,requirement:Number.isInteger,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"integer",n,e),n}}}function Pe(s){return{kind:"validation",type:"ip",reference:Pe,async:!1,expects:null,requirement:$,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IP",n,e),n}}}function De(s){return{kind:"validation",type:"ipv4",reference:De,async:!1,expects:null,requirement:L,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IPv4",n,e),n}}}function Ne(s){return{kind:"validation",type:"ipv6",reference:Ne,async:!1,expects:null,requirement:C,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IPv6",n,e),n}}}function We(s){return{kind:"validation",type:"iso_date",reference:We,async:!1,expects:null,requirement:z,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"date",n,e),n}}}function Ve(s){return{kind:"validation",type:"iso_date_time",reference:Ve,async:!1,expects:null,requirement:U,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"date-time",n,e),n}}}function Ke(s){return{kind:"validation",type:"iso_time",reference:Ke,async:!1,expects:null,requirement:F,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"time",n,e),n}}}function Le(s){return{kind:"validation",type:"iso_time_second",reference:Le,async:!1,expects:null,requirement:G,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"time-second",n,e),n}}}function Ce(s){return{kind:"validation",type:"iso_timestamp",reference:Ce,async:!1,expects:null,requirement:X,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"timestamp",n,e),n}}}function $e(s){return{kind:"validation",type:"iso_week",reference:$e,async:!1,expects:null,requirement:H,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"week",n,e),n}}}function ze(s,n){return{kind:"validation",type:"length",reference:ze,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length!==this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function Ue(s){return{kind:"validation",type:"mac",reference:Ue,async:!1,expects:null,requirement:Q,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"MAC",n,e),n}}}function Fe(s){return{kind:"validation",type:"mac48",reference:Fe,async:!1,expects:null,requirement:J,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"48-bit MAC",n,e),n}}}function Ge(s){return{kind:"validation",type:"mac64",reference:Ge,async:!1,expects:null,requirement:Z,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"64-bit MAC",n,e),n}}}function Xe(s,n){return{kind:"validation",type:"max_bytes",reference:Xe,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r>this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function He(s,n){return{kind:"validation",type:"max_length",reference:He,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length>this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function Je(s,n){return{kind:"validation",type:"max_size",reference:Je,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size>this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function Ze(s,n){return{kind:"validation",type:"max_value",reference:Ze,async:!1,expects:`<=${s instanceof Date?s.toJSON():T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value>this.requirement&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function Qe(s,n){return{kind:"validation",type:"mime_type",reference:Qe,async:!1,expects:s.map(e=>`"${e}"`).join(" | ")||"never",requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement.includes(e.value.type)&&u(this,"MIME type",e,t,{received:`"${e.value.type}"`}),e}}}function Ye(s,n){return{kind:"validation",type:"min_bytes",reference:Ye,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r<this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function en(s,n){return{kind:"validation",type:"min_length",reference:en,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length<this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function nn(s,n){return{kind:"validation",type:"min_size",reference:nn,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size<this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function sn(s,n){return{kind:"validation",type:"min_value",reference:sn,async:!1,expects:`>=${s instanceof Date?s.toJSON():T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value<this.requirement&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function tn(s,n){return{kind:"validation",type:"multiple_of",reference:tn,async:!1,expects:`%${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value%this.requirement!==0&&u(this,"multiple",e,t),e}}}function rn(s){return{kind:"validation",type:"non_empty",reference:rn,async:!1,expects:"!0",message:s,_run(n,e){return n.typed&&n.value.length===0&&u(this,"length",n,e,{received:"0"}),n}}}function un(s,n){return{kind:"validation",type:"not_bytes",reference:un,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r===this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function an(s,n){return{kind:"validation",type:"not_length",reference:an,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length===this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function on(s,n){return{kind:"validation",type:"not_size",reference:on,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size===this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function cn(s,n){return{kind:"validation",type:"not_value",reference:cn,async:!1,expects:s instanceof Date?`!${s.toJSON()}`:`!${T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&this.requirement<=e.value&&this.requirement>=e.value&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function pn(s){return{kind:"validation",type:"octal",reference:pn,async:!1,expects:null,requirement:Y,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"octal",n,e),n}}}function In(){return{kind:"transformation",type:"readonly",reference:In,async:!1,_run(s){return s}}}function mn(s,n){return{kind:"validation",type:"regex",reference:mn,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"format",e,t),e}}}function dn(s){return{kind:"validation",type:"safe_integer",reference:dn,async:!1,expects:null,requirement:Number.isSafeInteger,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"safe integer",n,e),n}}}function Tn(s,n){return{kind:"validation",type:"size",reference:Tn,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size!==this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function ln(s,n){return{kind:"validation",type:"some",reference:ln,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.some(this.requirement)&&u(this,"content",e,t),e}}}function fn(s,n){return{kind:"validation",type:"starts_with",reference:fn,async:!1,expects:`"${s}"`,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.startsWith(this.requirement)&&u(this,"start",e,t,{received:`"${e.value.slice(0,this.requirement.length)}"`}),e}}}function yn(){return{kind:"transformation",type:"to_lower_case",reference:yn,async:!1,_run(s){return s.value=s.value.toLowerCase(),s}}}function hn(s){return{kind:"transformation",type:"to_max_value",reference:hn,async:!1,requirement:s,_run(n){return n.value=n.value>this.requirement?this.requirement:n.value,n}}}function xn(s){return{kind:"transformation",type:"to_min_value",reference:xn,async:!1,requirement:s,_run(n){return n.value=n.value<this.requirement?this.requirement:n.value,n}}}function gn(){return{kind:"transformation",type:"to_upper_case",reference:gn,async:!1,_run(s){return s.value=s.value.toUpperCase(),s}}}function kn(s){return{kind:"transformation",type:"transform",reference:kn,async:!1,action:s,_run(n){return n.value=s(n.value),n}}}function Sn(s){return{kind:"transformation",type:"transform",reference:Sn,async:!0,action:s,async _run(n){return n.value=await s(n.value),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,_run(s){return s.value=s.value.trim(),s}}}function wn(){return{kind:"transformation",type:"trim_end",reference:wn,async:!1,_run(s){return s.value=s.value.trimEnd(),s}}}function bn(){return{kind:"transformation",type:"trim_start",reference:bn,async:!1,_run(s){return s.value=s.value.trimStart(),s}}}function En(s){return{kind:"validation",type:"ulid",reference:En,async:!1,expects:null,requirement:ee,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"ULID",n,e),n}}}function Bn(s){return{kind:"validation",type:"url",reference:Bn,async:!1,expects:null,requirement(n){try{return new URL(n),!0}catch{return!1}},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"URL",n,e),n}}}function Mn(s){return{kind:"validation",type:"uuid",reference:Mn,async:!1,expects:null,requirement:ne,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"UUID",n,e),n}}}function An(s,n){return{kind:"validation",type:"value",reference:An,async:!1,expects:s instanceof Date?s.toJSON():T(s),requirement:s,message:n,_run(e,t){return e.typed&&!(this.requirement<=e.value&&this.requirement>=e.value)&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function x(s,n,e){return typeof s.fallback=="function"?s.fallback(n,e):s.fallback}function ea(s,n){return{...s,fallback:n,_run(e,t){return s._run(e,t),e.issues?{typed:!0,value:x(this,e,t)}:e}}}function ta(s,n){return{...s,fallback:n,async:!0,async _run(e,t){return s._run(e,t),e.issues?{typed:!0,value:await x(this,e,t)}:e}}}function ua(s){let n={};for(let e of s)if(e.path)if(e.path.every(t=>"key"in t&&(typeof t.key=="string"||typeof t.key=="number"))){let t=e.path.map(({key:r})=>r).join(".");n.nested||(n.nested={}),n.nested[t]?n.nested[t].push(e.message):n.nested[t]=[e.message]}else n.unknown?n.unknown.push(e.message):n.unknown=[e.message];else n.root?n.root.push(e.message):n.root=[e.message];return n}function oa(s,n){return{...s,_run(e,t){if(s._run(e,t),e.issues)for(let r of e.issues){let o=e.value;for(let i of n){let c=o[i],a={type:"unknown",origin:"value",input:o,key:i,value:c};if(r.path?r.path.push(a):r.path=[a],!c)break;o=c}}return e}}}function ca(s,n){return{...s,async:!0,async _run(e,t){if(await s._run(e,t),e.issues)for(let r of e.issues){let o=e.value;for(let i of n){let c=o[i],a={type:"unknown",origin:"value",input:o,key:i,value:c};if(r.path?r.path.push(a):r.path=[a],!c)break;o=c}}return e}}}function l(s,n,e){return typeof s.default=="function"?s.default(n,e):s.default}function ue(s){if("entries"in s){let n={};for(let e in s.entries)n[e]=ue(s.entries[e]);return n}return"items"in s?s.items.map(ue):l(s)}async function ae(s){return"entries"in s?Object.fromEntries(await Promise.all(Object.entries(s.entries).map(async([n,e])=>[n,await ae(e)]))):"items"in s?Promise.all(s.items.map(ae)):l(s)}function oe(s){if("entries"in s){let n={};for(let e in s.entries)n[e]=oe(s.entries[e]);return n}return"items"in s?s.items.map(oe):x(s)}async function ie(s){return"entries"in s?Object.fromEntries(await Promise.all(Object.entries(s.entries).map(async([n,e])=>[n,await ie(e)]))):"items"in s?Promise.all(s.items.map(ie)):x(s)}function ga(s,n){return!s._run({typed:!1,value:n},{abortEarly:!0}).issues}function jn(){return{kind:"schema",type:"any",reference:jn,expects:"any",async:!1,_run(s){return s.typed=!0,s}}}function Rn(s,n){return{kind:"schema",type:"array",reference:Rn,expects:"Array",async:!1,item:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<r.length;o++){let i=r[o],c=this.item._run({typed:!1,value:i},t);if(c.issues){let a={type:"array",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function vn(s,n){return{kind:"schema",type:"array",reference:vn,expects:"Array",async:!0,item:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(r.map(i=>this.item._run({typed:!1,value:i},t)));for(let i=0;i<o.length;i++){let c=o[i];if(c.issues){let a={type:"array",origin:"value",input:r,key:i,value:r[i]};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function _n(s){return{kind:"schema",type:"bigint",reference:_n,expects:"bigint",async:!1,message:s,_run(n,e){return typeof n.value=="bigint"?n.typed=!0:u(this,"type",n,e),n}}}function qn(s){return{kind:"schema",type:"blob",reference:qn,expects:"Blob",async:!1,message:s,_run(n,e){return n.value instanceof Blob?n.typed=!0:u(this,"type",n,e),n}}}function Pn(s){return{kind:"schema",type:"boolean",reference:Pn,expects:"boolean",async:!1,message:s,_run(n,e){return typeof n.value=="boolean"?n.typed=!0:u(this,"type",n,e),n}}}function Dn(s,n){return{kind:"schema",type:"custom",reference:Dn,expects:"unknown",async:!1,check:s,message:n,_run(e,t){return this.check(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Nn(s,n){return{kind:"schema",type:"custom",reference:Nn,expects:"unknown",async:!0,check:s,message:n,async _run(e,t){return await this.check(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Wn(s){return{kind:"schema",type:"date",reference:Wn,expects:"Date",async:!1,message:s,_run(n,e){return n.value instanceof Date&&!isNaN(n.value.getTime())?n.typed=!0:u(this,"type",n,e),n}}}function Vn(s,n){let e=Object.entries(s).filter(([t])=>isNaN(+t)).map(([,t])=>t);return{kind:"schema",type:"enum",reference:Vn,expects:e.map(T).join(" | ")||"never",async:!1,enum:s,options:e,message:n,_run(t,r){return this.options.includes(t.value)?t.typed=!0:u(this,"type",t,r),t}}}function Kn(s,n){return{kind:"schema",type:"instance",reference:Kn,expects:s.name,async:!1,class:s,message:n,_run(e,t){return e.value instanceof this.class?e.typed=!0:u(this,"type",e,t),e}}}function S(s,n){if(typeof s==typeof n){if(s===n||s instanceof Date&&n instanceof Date&&+s==+n)return{value:s};if(s&&n&&s.constructor===Object&&n.constructor===Object){for(let e in n)if(e in s){let t=S(s[e],n[e]);if(t.issue)return t;s[e]=t.value}else s[e]=n[e];return{value:s}}if(Array.isArray(s)&&Array.isArray(n)&&s.length===n.length){for(let e=0;e<s.length;e++){let t=S(s[e],n[e]);if(t.issue)return t;s[e]=t.value}return{value:s}}}return{issue:!0}}function Ln(s,n){return{kind:"schema",type:"intersect",reference:Ln,expects:[...new Set(s.map(e=>e.expects))].join(" & ")||"never",async:!1,options:s,message:n,_run(e,t){if(this.options.length){let r=e.value,o;e.typed=!0;for(let i of this.options){let c=i._run({typed:!1,value:r},t);if(c.issues&&(e.issues?e.issues.push(...c.issues):e.issues=c.issues,t.abortEarly)){e.typed=!1;break}c.typed||(e.typed=!1),e.typed&&(o?o.push(c.value):o=[c.value])}if(e.typed){e.value=o[0];for(let i=1;i<o.length;i++){let c=S(e.value,o[i]);if(c.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=c.value}}}else u(this,"type",e,t);return e}}}function Cn(s,n){return{kind:"schema",type:"intersect",reference:Cn,expects:[...new Set(s.map(e=>e.expects))].join(" & ")||"never",async:!0,options:s,message:n,async _run(e,t){if(this.options.length){let r=e.value,o;e.typed=!0;let i=await Promise.all(this.options.map(c=>c._run({typed:!1,value:r},t)));for(let c of i){if(c.issues&&(e.issues?e.issues.push(...c.issues):e.issues=c.issues,t.abortEarly)){e.typed=!1;break}c.typed||(e.typed=!1),e.typed&&(o?o.push(c.value):o=[c.value])}if(e.typed){e.value=o[0];for(let c=1;c<o.length;c++){let a=S(e.value,o[c]);if(a.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=a.value}}}else u(this,"type",e,t);return e}}}function $n(s){return{kind:"schema",type:"lazy",reference:$n,expects:"unknown",async:!1,getter:s,_run(n,e){return this.getter(n.value)._run(n,e)}}}function zn(s){return{kind:"schema",type:"lazy",reference:zn,expects:"unknown",async:!0,getter:s,async _run(n,e){return(await this.getter(n.value))._run(n,e)}}}function Un(s,n){return{kind:"schema",type:"literal",reference:Un,expects:T(s),async:!1,literal:s,message:n,_run(e,t){return e.value===this.literal?e.typed=!0:u(this,"type",e,t),e}}}function Fn(s,n){return{kind:"schema",type:"loose_object",reference:Fn,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}if(!e.issues||!t.abortEarly)for(let o in r)f(o)&&!(o in this.entries)&&(e.value[o]=r[o])}else u(this,"type",e,t);return e}}}function Gn(s,n){return{kind:"schema",type:"loose_object",reference:Gn,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}if(!e.issues||!t.abortEarly)for(let i in r)f(i)&&!(i in this.entries)&&(e.value[i]=r[i])}else u(this,"type",e,t);return e}}}function Xn(s,n){return{kind:"schema",type:"loose_tuple",reference:Xn,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}if(!e.issues||!t.abortEarly)for(let o=s.length;o<r.length;o++)e.value.push(r[o])}else u(this,"type",e,t);return e}}}function Hn(s,n){return{kind:"schema",type:"loose_tuple",reference:Hn,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}if(!e.issues||!t.abortEarly)for(let i=s.length;i<r.length;i++)e.value.push(r[i])}else u(this,"type",e,t);return e}}}function Jn(s,n,e){return{kind:"schema",type:"map",reference:Jn,expects:"Map",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o instanceof Map){t.typed=!0,t.value=new Map;for(let[i,c]of o){let a=this.key._run({typed:!1,value:i},r);if(a.issues){let I={type:"map",origin:"key",input:o,key:i,value:c};for(let m of a.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}let p=this.value._run({typed:!1,value:c},r);if(p.issues){let I={type:"map",origin:"value",input:o,key:i,value:c};for(let m of p.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!p.typed)&&(t.typed=!1),t.value.set(a.value,p.value)}}else u(this,"type",t,r);return t}}}function Zn(s,n,e){return{kind:"schema",type:"map",reference:Zn,expects:"Map",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o instanceof Map){t.typed=!0,t.value=new Map;let i=await Promise.all([...o].map(([c,a])=>Promise.all([c,a,this.key._run({typed:!1,value:c},r),this.value._run({typed:!1,value:a},r)])));for(let[c,a,p,I]of i){if(p.issues){let m={type:"map",origin:"key",input:o,key:c,value:a};for(let d of p.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"map",origin:"value",input:o,key:c,value:a};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}(!p.typed||!I.typed)&&(t.typed=!1),t.value.set(p.value,I.value)}}else u(this,"type",t,r);return t}}}function Qn(s){return{kind:"schema",type:"nan",reference:Qn,expects:"NaN",async:!1,message:s,_run(n,e){return Number.isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function Yn(s){return{kind:"schema",type:"never",reference:Yn,expects:"never",async:!1,message:s,_run(n,e){return u(this,"type",n,e),n}}}function es(s,n){return{kind:"schema",type:"non_nullable",reference:es,expects:"!null",async:!1,wrapped:s,message:n,_run(e,t){return e.value===null?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ns(s,n){return{kind:"schema",type:"non_nullable",reference:ns,expects:"!null",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===null?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ss(s,n){return{kind:"schema",type:"non_nullish",reference:ss,expects:"!null & !undefined",async:!1,wrapped:s,message:n,_run(e,t){return e.value===null||e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ts(s,n){return{kind:"schema",type:"non_nullish",reference:ts,expects:"!null & !undefined",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===null||e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function M(s,n){return{kind:"schema",type:"non_optional",reference:M,expects:"!undefined",async:!1,wrapped:s,message:n,_run(e,t){return e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function A(s,n){return{kind:"schema",type:"non_optional",reference:A,expects:"!undefined",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function rs(s){return{kind:"schema",type:"null",reference:rs,expects:"null",async:!1,message:s,_run(n,e){return n.value===null?n.typed=!0:u(this,"type",n,e),n}}}function us(s,...n){let e={kind:"schema",type:"nullable",reference:us,expects:`${s.expects} | null`,async:!1,wrapped:s,_run(t,r){return t.value===null&&("default"in this&&(t.value=l(this,t,r)),t.value===null)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function as(s,...n){let e={kind:"schema",type:"nullable",reference:as,expects:`${s.expects} | null`,async:!0,wrapped:s,async _run(t,r){return t.value===null&&("default"in this&&(t.value=await l(this,t,r)),t.value===null)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function os(s,...n){let e={kind:"schema",type:"nullish",reference:os,expects:`${s.expects} | null | undefined`,async:!1,wrapped:s,_run(t,r){return(t.value===null||t.value===void 0)&&("default"in this&&(t.value=l(this,t,r)),t.value===null||t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function is(s,...n){let e={kind:"schema",type:"nullish",reference:is,expects:`${s.expects} | null | undefined`,async:!0,wrapped:s,async _run(t,r){return(t.value===null||t.value===void 0)&&("default"in this&&(t.value=await l(this,t,r)),t.value===null||t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function cs(s){return{kind:"schema",type:"number",reference:cs,expects:"number",async:!1,message:s,_run(n,e){return typeof n.value=="number"&&!isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function ps(s,n){return{kind:"schema",type:"object",reference:ps,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}}else u(this,"type",e,t);return e}}}function Is(s,n){return{kind:"schema",type:"object",reference:Is,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}}else u(this,"type",e,t);return e}}}function ms(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ms,expects:"Object",async:!1,entries:s,rest:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};for(let i in this.entries){let c=o[i],a=this.entries[i]._run({typed:!1,value:c},r);if(a.issues){let p={type:"object",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||i in o)&&(t.value[i]=a.value)}if(!t.issues||!r.abortEarly){for(let i in o)if(f(i)&&!(i in this.entries)){let c=o[i],a=this.rest._run({typed:!1,value:c},r);if(a.issues){let p={type:"object",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value[i]=a.value}}}else u(this,"type",t,r);return t}}}function ds(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ds,expects:"Object",async:!0,entries:s,rest:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};let[i,c]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([a,p])=>{let I=o[a];return[a,I,await p._run({typed:!1,value:I},r)]})),Promise.all(Object.entries(o).filter(([a])=>f(a)&&!(a in this.entries)).map(async([a,p])=>[a,p,await this.rest._run({typed:!1,value:p},r)]))]);for(let[a,p,I]of i){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),(I.value!==void 0||a in o)&&(t.value[a]=I.value)}if(!t.issues||!r.abortEarly)for(let[a,p,I]of c){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value[a]=I.value}}else u(this,"type",t,r);return t}}}function j(s,...n){let e={kind:"schema",type:"optional",reference:j,expects:`${s.expects} | undefined`,async:!1,wrapped:s,_run(t,r){return t.value===void 0&&("default"in this&&(t.value=l(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function R(s,...n){let e={kind:"schema",type:"optional",reference:R,expects:`${s.expects} | undefined`,async:!0,wrapped:s,async _run(t,r){return t.value===void 0&&("default"in this&&(t.value=await l(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function v(s,n){return{kind:"schema",type:"picklist",reference:v,expects:s.map(T).join(" | ")||"never",async:!1,options:s,message:n,_run(e,t){return this.options.includes(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Ts(s,n,e){return{kind:"schema",type:"record",reference:Ts,expects:"Object",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};for(let i in o)if(f(i)){let c=o[i],a=this.key._run({typed:!1,value:i},r);if(a.issues){let I={type:"record",origin:"key",input:o,key:i,value:c};for(let m of a.issues)m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}let p=this.value._run({typed:!1,value:c},r);if(p.issues){let I={type:"record",origin:"value",input:o,key:i,value:c};for(let m of p.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!p.typed)&&(t.typed=!1),a.typed&&(t.value[a.value]=p.value)}}else u(this,"type",t,r);return t}}}function ls(s,n,e){return{kind:"schema",type:"record",reference:ls,expects:"Object",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};let i=await Promise.all(Object.entries(o).filter(([c])=>f(c)).map(([c,a])=>Promise.all([c,a,this.key._run({typed:!1,value:c},r),this.value._run({typed:!1,value:a},r)])));for(let[c,a,p,I]of i){if(p.issues){let m={type:"record",origin:"key",input:o,key:c,value:a};for(let d of p.issues)d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"record",origin:"value",input:o,key:c,value:a};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}(!p.typed||!I.typed)&&(t.typed=!1),p.typed&&(t.value[p.value]=I.value)}}else u(this,"type",t,r);return t}}}function fs(s,n){return{kind:"schema",type:"set",reference:fs,expects:"Set",async:!1,value:s,message:n,_run(e,t){let r=e.value;if(r instanceof Set){e.typed=!0,e.value=new Set;for(let o of r){let i=this.value._run({typed:!1,value:o},t);if(i.issues){let c={type:"set",origin:"value",input:r,value:o};for(let a of i.issues)a.path?a.path.unshift(c):a.path=[c],e.issues?.push(a);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value.add(i.value)}}else u(this,"type",e,t);return e}}}function ys(s,n){return{kind:"schema",type:"set",reference:ys,expects:"Set",async:!0,value:s,message:n,async _run(e,t){let r=e.value;if(r instanceof Set){e.typed=!0,e.value=new Set;let o=await Promise.all([...r].map(async i=>[i,await this.value._run({typed:!1,value:i},t)]));for(let[i,c]of o){if(c.issues){let a={type:"set",origin:"value",input:r,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.add(c.value)}}else u(this,"type",e,t);return e}}}function hs(s,n){return{kind:"schema",type:"strict_object",reference:hs,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}if(!e.issues||!t.abortEarly){for(let o in r)if(!(o in this.entries)){let i=r[o];u(this,"type",e,t,{input:i,expected:"never",path:[{type:"object",origin:"value",input:r,key:o,value:i}]});break}}}else u(this,"type",e,t);return e}}}function xs(s,n){return{kind:"schema",type:"strict_object",reference:xs,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}if(!e.issues||!t.abortEarly){for(let i in r)if(!(i in this.entries)){let c=r[i];u(this,"type",e,t,{input:c,expected:"never",path:[{type:"object",origin:"value",input:r,key:i,value:c}]});break}}}else u(this,"type",e,t);return e}}}function gs(s,n){return{kind:"schema",type:"strict_tuple",reference:gs,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}if(!(e.issues&&t.abortEarly)&&s.length<r.length){let o=r[s.length];u(this,"type",e,t,{input:o,expected:"never",path:[{type:"tuple",origin:"value",input:r,key:s.length,value:o}]})}}else u(this,"type",e,t);return e}}}function ks(s,n){return{kind:"schema",type:"strict_tuple",reference:ks,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}if(!(e.issues&&t.abortEarly)&&s.length<r.length){let i=r[s.length];u(this,"type",e,t,{input:i,expected:"never",path:[{type:"tuple",origin:"value",input:r,key:s.length,value:i}]})}}else u(this,"type",e,t);return e}}}function Ss(s){return{kind:"schema",type:"string",reference:Ss,expects:"string",async:!1,message:s,_run(n,e){return typeof n.value=="string"?n.typed=!0:u(this,"type",n,e),n}}}function Os(s){return{kind:"schema",type:"symbol",reference:Os,expects:"symbol",async:!1,message:s,_run(n,e){return typeof n.value=="symbol"?n.typed=!0:u(this,"type",n,e),n}}}function ws(s,n){return{kind:"schema",type:"tuple",reference:ws,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function bs(s,n){return{kind:"schema",type:"tuple",reference:bs,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else u(this,"type",e,t);return e}}}function Es(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Es,expects:"Array",async:!1,items:s,rest:n,message:e,_run(t,r){let o=t.value;if(Array.isArray(o)){t.typed=!0,t.value=[];for(let i=0;i<s.length;i++){let c=o[i],a=this.items[i]._run({typed:!1,value:c},r);if(a.issues){let p={type:"tuple",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}if(!t.issues||!r.abortEarly)for(let i=s.length;i<o.length;i++){let c=o[i],a=this.rest._run({typed:!1,value:c},r);if(a.issues){let p={type:"tuple",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else u(this,"type",t,r);return t}}}function Bs(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Bs,expects:"Array",async:!0,items:s,rest:n,message:e,async _run(t,r){let o=t.value;if(Array.isArray(o)){t.typed=!0,t.value=[];let[i,c]=await Promise.all([Promise.all(s.map(async(a,p)=>{let I=o[p];return[p,I,await a._run({typed:!1,value:I},r)]})),Promise.all(o.slice(s.length).map(async(a,p)=>[p+s.length,a,await n._run({typed:!1,value:a},r)]))]);for(let[a,p,I]of i){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value.push(I.value)}if(!t.issues||!r.abortEarly)for(let[a,p,I]of c){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value.push(I.value)}}else u(this,"type",t,r);return t}}}function Ms(s){return{kind:"schema",type:"undefined",reference:Ms,expects:"undefined",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function O(s){let n;if(s)for(let e of s)n?n.push(...e.issues):n=e.issues;return n}function As(s,n){return{kind:"schema",type:"union",reference:As,expects:[...new Set(s.map(e=>e.expects))].join(" | ")||"never",async:!1,options:s,message:n,_run(e,t){let r,o,i;for(let c of this.options){let a=c._run({typed:!1,value:e.value},t);if(a.typed)if(a.issues)o?o.push(a):o=[a];else{r=a;break}else i?i.push(a):i=[a]}if(r)return r;if(o){if(o.length===1)return o[0];u(this,"type",e,t,{issues:O(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:O(i)})}return e}}}function js(s,n){return{kind:"schema",type:"union",reference:js,expects:[...new Set(s.map(e=>e.expects))].join(" | ")||"never",async:!0,options:s,message:n,async _run(e,t){let r,o,i;for(let c of this.options){let a=await c._run({typed:!1,value:e.value},t);if(a.typed)if(a.issues)o?o.push(a):o=[a];else{r=a;break}else i?i.push(a):i=[a]}if(r)return r;if(o){if(o.length===1)return o[0];u(this,"type",e,t,{issues:O(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:O(i)})}return e}}}function Rs(){return{kind:"schema",type:"unknown",reference:Rs,expects:"unknown",async:!1,_run(s){return s.typed=!0,s}}}function E(s,n,e=new Set){for(let t of n)t.type==="variant"?E(s,t.options,e):e.add(t.entries[s].expects);return e}function vs(s,n,e){let t;return{kind:"schema",type:"variant",reference:vs,expects:"Object",async:!1,key:s,options:n,message:e,_run(r,o){let i=r.value;if(i&&typeof i=="object"&&i.constructor===Object){let c=i[this.key];if(this.key in i){let a;for(let p of n)if(p.type==="variant"||!p.entries[this.key]._run({typed:!1,value:c},o).issues){let I=p._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...E(this.key,n)].join(" | ")||"never"),u(this,"type",r,o,{input:c,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:c}]})}else u(this,"type",r,o);return r}}}function _s(s,n,e){let t;return{kind:"schema",type:"variant",reference:_s,expects:"Object",async:!0,key:s,options:n,message:e,async _run(r,o){let i=r.value;if(i&&typeof i=="object"&&i.constructor===Object){let c=i[this.key];if(this.key in i){let a;for(let p of n)if(p.type==="variant"||!(await p.entries[this.key]._run({typed:!1,value:c},o)).issues){let I=await p._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...E(this.key,n)].join(" | ")||"never"),u(this,"type",r,o,{input:c,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:c}]})}else u(this,"type",r,o);return r}}}function qs(s){return{kind:"schema",type:"void",reference:qs,expects:"void",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function Hi(s,n){return v(Object.keys(s.entries),n)}function Zi(s,n){let e={...s.entries};for(let t of n)delete e[t];return{...s,entries:e}}function nc(s,n,e){let t=s._run({typed:!1,value:n},y(e));if(t.issues)throw new h(t.issues);return t.value}async function uc(s,n,e){let t=await s._run({typed:!1,value:n},y(e));if(t.issues)throw new h(t.issues);return t.value}function ic(s,n){let e={};for(let t in s.entries)e[t]=!n||n.includes(t)?j(s.entries[t]):s.entries[t];return{...s,entries:e}}function Ic(s,n){let e={};for(let t in s.entries)e[t]=!n||n.includes(t)?R(s.entries[t]):s.entries[t];return{...s,entries:e}}function dc(s,n){let e={};for(let t of n)e[t]=s.entries[t];return{...s,entries:e}}function lc(...s){return{...s[0],pipe:s,_run(n,e){for(let t=0;t<s.length;t++){n=s[t]._run(n,e);let r=s[t+1];if(e.skipPipe||n.issues&&(e.abortEarly||e.abortPipeEarly||r?.kind==="schema"||r?.kind==="transformation")){n.typed=!1;break}}return n}}}function yc(...s){return{...s[0],pipe:s,async:!0,async _run(n,e){for(let t=0;t<s.length;t++){n=await s[t]._run(n,e);let r=s[t+1];if(e.skipPipe||n.issues&&(e.abortEarly||e.abortPipeEarly||r?.kind==="schema"||r?.kind==="transformation")){n.typed=!1;break}}return n}}}function gc(s,n,e){let t=Array.isArray(n)?n:void 0,r=Array.isArray(n)?e:n,o={};for(let i in s.entries)o[i]=!t||t.includes(i)?M(s.entries[i],r):s.entries[i];return{...s,entries:o}}function Oc(s,n,e){let t=Array.isArray(n)?n:void 0,r=Array.isArray(n)?e:n,o={};for(let i in s.entries)o[i]=!t||t.includes(i)?A(s.entries[i],r):s.entries[i];return{...s,entries:o}}function Ec(s,n,e){let t=s._run({typed:!1,value:n},y(e));return{typed:t.typed,success:!t.issues,output:t.value,issues:t.issues}}async function Ac(s,n,e){let t=await s._run({typed:!1,value:n},y(e));return{typed:t.typed,success:!t.issues,output:t.value,issues:t.issues}}function Rc(s){return s.wrapped}export{_ as BIC_REGEX,q as CUID2_REGEX,P as DECIMAL_REGEX,D as EMAIL_REGEX,N as EMOJI_REGEX,W as HEXADECIMAL_REGEX,V as HEX_COLOR_REGEX,K as IMEI_REGEX,L as IPV4_REGEX,C as IPV6_REGEX,$ as IP_REGEX,z as ISO_DATE_REGEX,U as ISO_DATE_TIME_REGEX,X as ISO_TIMESTAMP_REGEX,F as ISO_TIME_REGEX,G as ISO_TIME_SECOND_REGEX,H as ISO_WEEK_REGEX,J as MAC48_REGEX,Z as MAC64_REGEX,Q as MAC_REGEX,Y as OCTAL_REGEX,ee as ULID_REGEX,ne as UUID_REGEX,h as ValiError,u as _addIssue,f as _isAllowedObjectKey,B as _isLuhnAlgo,T as _stringify,jn as any,Rn as array,vn as arrayAsync,pe as bic,_n as bigint,qn as blob,Pn as boolean,me as brand,Ie as bytes,de as check,Te as checkAsync,he as creditCard,xe as cuid2,Dn as custom,Nn as customAsync,Wn as date,ge as decimal,Ns as deleteGlobalConfig,Ks as deleteGlobalMessage,$s as deleteSchemaMessage,Fs as deleteSpecificMessage,ke as email,Se as emoji,Oe as empty,we as endsWith,et as entriesFromList,Vn as enum_,be as every,Ee as excludes,ea as fallback,ta as fallbackAsync,Be as finite,ua as flatten,oa as forward,ca as forwardAsync,l as getDefault,ue as getDefaults,ae as getDefaultsAsync,x as getFallback,oe as getFallbacks,ie as getFallbacksAsync,y as getGlobalConfig,se as getGlobalMessage,te as getSchemaMessage,re as getSpecificMessage,Ae as hash,Re as hexColor,je as hexadecimal,ve as imei,_e as includes,Kn as instance,qe as integer,Ln as intersect,Cn as intersectAsync,Pe as ip,De as ipv4,Ne as ipv6,ga as is,st as isOfKind,rt as isOfType,ot as isValiError,We as isoDate,Ve as isoDateTime,Ke as isoTime,Le as isoTimeSecond,Ce as isoTimestamp,$e as isoWeek,Hi as keyof,$n as lazy,zn as lazyAsync,ze as length,Un as literal,Fn as looseObject,Gn as looseObjectAsync,Xn as looseTuple,Hn as looseTupleAsync,Ue as mac,Fe as mac48,Ge as mac64,Jn as map,Zn as mapAsync,Xe as maxBytes,He as maxLength,Je as maxSize,Ze as maxValue,Qe as mimeType,Ye as minBytes,en as minLength,nn as minSize,sn as minValue,tn as multipleOf,Qn as nan,Yn as never,rn as nonEmpty,es as nonNullable,ns as nonNullableAsync,ss as nonNullish,ts as nonNullishAsync,M as nonOptional,A as nonOptionalAsync,un as notBytes,an as notLength,on as notSize,cn as notValue,rs as null_,us as nullable,as as nullableAsync,os as nullish,is as nullishAsync,cs as number,ps as object,Is as objectAsync,ms as objectWithRest,ds as objectWithRestAsync,pn as octal,Zi as omit,j as optional,R as optionalAsync,nc as parse,uc as parseAsync,ic as partial,Ic as partialAsync,dc as pick,v as picklist,lc as pipe,yc as pipeAsync,In as readonly,Ts as record,ls as recordAsync,mn as regex,gc as required,Oc as requiredAsync,dn as safeInteger,Ec as safeParse,Ac as safeParseAsync,fs as set,ys as setAsync,Ds as setGlobalConfig,Vs as setGlobalMessage,Cs as setSchemaMessage,Us as setSpecificMessage,Tn as size,ln as some,fn as startsWith,hs as strictObject,xs as strictObjectAsync,gs as strictTuple,ks as strictTupleAsync,Ss as string,Os as symbol,yn as toLowerCase,hn as toMaxValue,xn as toMinValue,gn as toUpperCase,kn as transform,Sn as transformAsync,On as trim,wn as trimEnd,bn as trimStart,ws as tuple,bs as tupleAsync,Es as tupleWithRest,Bs as tupleWithRestAsync,En as ulid,Ms as undefined_,As as union,js as unionAsync,Rs as unknown,Rc as unwrap,Bn as url,Mn as uuid,An as value,vs as variant,_s as variantAsync,qs as void_}; | ||
var _=/^[A-Z]{6}(?!00)[A-Z\d]{2}(?:[A-Z\d]{3})?$/u,q=/^[a-z][\da-z]*$/u,P=/^\d+$/u,D=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,N=/^\p{RGI_Emoji}+$/v,W=/^(?:0h|0x)?[\da-f]+$/iu,V=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/iu,K=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,L=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,C=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,$=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,z=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,U=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])T(?:0\d|1\d|2[0-3]):[0-5]\d$/u,F=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,G=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,X=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])T(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,H=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,J=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$/iu,Z=/^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,Q=/^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$|^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu,Y=/^(?:0o)?[0-7]+$/iu,ee=/^[\da-hjkmnp-tv-z]{26}$/iu,ne=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;var k;function Ds(s){k={...k,...s}}function y(s){return{lang:s?.lang??k?.lang,message:s?.message,abortEarly:s?.abortEarly??k?.abortEarly,abortPipeEarly:s?.abortPipeEarly??k?.abortPipeEarly,skipPipe:s?.skipPipe}}function Ns(){k=void 0}var w;function Vs(s,n){w||(w=new Map),w.set(n,s)}function se(s){return w?.get(s)}function Ks(s){w?.delete(s)}var b;function Cs(s,n){b||(b=new Map),b.set(n,s)}function te(s){return b?.get(s)}function $s(s){b?.delete(s)}var g;function Us(s,n,e){g||(g=new Map),g.get(s)||g.set(s,new Map),g.get(s).set(e,n)}function re(s,n){return g?.get(s)?.get(n)}function Fs(s,n){g?.get(s)?.delete(n)}function T(s){let n=typeof s;return n==="object"&&(n=s?Object.getPrototypeOf(s).constructor.name:"null"),n==="string"?`"${s}"`:n==="number"||n==="bigint"||n==="boolean"?`${s}`:n}function u(s,n,e,t,r){let o=r&&"input"in r?r.input:e.value,i=r?.expected??s.expects,c=r?.received??T(o),a={kind:s.kind,type:s.type,input:o,expected:i,received:c,message:`Invalid ${n}: ${i?`Expected ${i} but r`:"R"}eceived ${c}`,requirement:s.requirement,path:r?.path,issues:r?.issues,lang:t.lang,abortEarly:t.abortEarly,abortPipeEarly:t.abortPipeEarly,skipPipe:t.skipPipe},p=s.kind==="schema",I=s.message??re(s.reference,a.lang)??(p?te(a.lang):null)??t.message??se(a.lang);I&&(a.message=typeof I=="function"?I(a):I),p&&(e.typed=!1),e.issues?e.issues.push(a):e.issues=[a]}function f(s){return s!=="__proto__"&&s!=="prototype"&&s!=="constructor"}var ce=/\D/gu;function B(s){let n=s.replace(ce,""),e=n.length,t=1,r=0;for(;e;){let o=+n[--e];t^=1,r+=t?[0,2,4,6,8,1,3,5,7,9][o]:o}return r%10===0}function et(s,n){let e={};for(let t of s)e[t]=n;return e}function st(s,n){return n.kind===s}function rt(s,n){return n.type===s}function ot(s){return s instanceof h}var h=class extends Error{issues;constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};function pe(s){return{kind:"validation",type:"bic",reference:pe,async:!1,expects:null,requirement:_,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"BIC",n,e),n}}}function Ie(s,n){return{kind:"validation",type:"bytes",reference:Ie,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r!==this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function me(s){return{kind:"transformation",type:"brand",reference:me,async:!1,name:s,_run(n){return n}}}function de(s,n){return{kind:"validation",type:"check",reference:de,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement(e.value)&&u(this,"input",e,t),e}}}function Te(s,n){return{kind:"validation",type:"check",reference:Te,async:!0,expects:null,requirement:s,message:n,async _run(e,t){return e.typed&&!await this.requirement(e.value)&&u(this,"input",e,t),e}}}var le=/^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,fe=/[- ]/gu,ye=[/^3[47]\d{13}$/u,/^3(?:0[0-5]|[68]\d)\d{11,13}$/u,/^6(?:011|5\d{2})\d{12,15}$/u,/^(?:2131|1800|35\d{3})\d{11}$/u,/^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u,/^(?:6[27]\d{14,17}|81\d{14,17})$/u,/^4\d{12}(?:\d{3,6})?$/u];function he(s){return{kind:"validation",type:"credit_card",reference:he,async:!1,expects:null,requirement(n){let e;return le.test(n)&&(e=n.replace(fe,""))&&ye.some(t=>t.test(e))&&B(e)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"credit card",n,e),n}}}function xe(s){return{kind:"validation",type:"cuid2",reference:xe,async:!1,expects:null,requirement:q,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"Cuid2",n,e),n}}}function ge(s){return{kind:"validation",type:"decimal",reference:ge,async:!1,expects:null,requirement:P,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"decimal",n,e),n}}}function ke(s){return{kind:"validation",type:"email",reference:ke,expects:null,async:!1,requirement:D,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"email",n,e),n}}}function Se(s){return{kind:"validation",type:"emoji",reference:Se,async:!1,expects:null,requirement:N,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"emoji",n,e),n}}}function Oe(s){return{kind:"validation",type:"empty",reference:Oe,async:!1,expects:"0",message:s,_run(n,e){return n.typed&&n.value.length>0&&u(this,"length",n,e,{received:`${n.value.length}`}),n}}}function we(s,n){return{kind:"validation",type:"ends_with",reference:we,async:!1,expects:`"${s}"`,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.endsWith(this.requirement)&&u(this,"end",e,t,{received:`"${e.value.slice(-this.requirement.length)}"`}),e}}}function be(s,n){return{kind:"validation",type:"every",reference:be,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.every(this.requirement)&&u(this,"content",e,t),e}}}function Ee(s,n){let e=T(s);return{kind:"validation",type:"excludes",reference:Ee,async:!1,expects:`!${e}`,requirement:s,message:n,_run(t,r){return t.typed&&t.value.includes(this.requirement)&&u(this,"content",t,r,{received:e}),t}}}function Be(s){return{kind:"validation",type:"finite",reference:Be,async:!1,expects:null,requirement:Number.isFinite,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"finite",n,e),n}}}var Me={md4:32,md5:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8,adler32:8};function Ae(s,n){return{kind:"validation",type:"hash",reference:Ae,expects:null,async:!1,requirement:RegExp(s.map(e=>`^[a-f0-9]{${Me[e]}}$`).join("|"),"iu"),message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"hash",e,t),e}}}function je(s){return{kind:"validation",type:"hexadecimal",reference:je,async:!1,expects:null,requirement:W,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"hexadecimal",n,e),n}}}function Re(s){return{kind:"validation",type:"hex_color",reference:Re,async:!1,expects:null,requirement:V,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"hex color",n,e),n}}}function ve(s){return{kind:"validation",type:"imei",reference:ve,async:!1,expects:null,requirement(n){return K.test(n)&&B(n)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"IMEI",n,e),n}}}function _e(s,n){let e=T(s);return{kind:"validation",type:"includes",reference:_e,async:!1,expects:e,requirement:s,message:n,_run(t,r){return t.typed&&!t.value.includes(this.requirement)&&u(this,"content",t,r,{received:`!${e}`}),t}}}function qe(s){return{kind:"validation",type:"integer",reference:qe,async:!1,expects:null,requirement:Number.isInteger,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"integer",n,e),n}}}function Pe(s){return{kind:"validation",type:"ip",reference:Pe,async:!1,expects:null,requirement:$,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IP",n,e),n}}}function De(s){return{kind:"validation",type:"ipv4",reference:De,async:!1,expects:null,requirement:L,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IPv4",n,e),n}}}function Ne(s){return{kind:"validation",type:"ipv6",reference:Ne,async:!1,expects:null,requirement:C,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"IPv6",n,e),n}}}function We(s){return{kind:"validation",type:"iso_date",reference:We,async:!1,expects:null,requirement:z,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"date",n,e),n}}}function Ve(s){return{kind:"validation",type:"iso_date_time",reference:Ve,async:!1,expects:null,requirement:U,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"date-time",n,e),n}}}function Ke(s){return{kind:"validation",type:"iso_time",reference:Ke,async:!1,expects:null,requirement:F,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"time",n,e),n}}}function Le(s){return{kind:"validation",type:"iso_time_second",reference:Le,async:!1,expects:null,requirement:G,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"time-second",n,e),n}}}function Ce(s){return{kind:"validation",type:"iso_timestamp",reference:Ce,async:!1,expects:null,requirement:X,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"timestamp",n,e),n}}}function $e(s){return{kind:"validation",type:"iso_week",reference:$e,async:!1,expects:null,requirement:H,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"week",n,e),n}}}function ze(s,n){return{kind:"validation",type:"length",reference:ze,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length!==this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function Ue(s){return{kind:"validation",type:"mac",reference:Ue,async:!1,expects:null,requirement:Q,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"MAC",n,e),n}}}function Fe(s){return{kind:"validation",type:"mac48",reference:Fe,async:!1,expects:null,requirement:J,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"48-bit MAC",n,e),n}}}function Ge(s){return{kind:"validation",type:"mac64",reference:Ge,async:!1,expects:null,requirement:Z,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"64-bit MAC",n,e),n}}}function Xe(s,n){return{kind:"validation",type:"max_bytes",reference:Xe,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r>this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function He(s,n){return{kind:"validation",type:"max_length",reference:He,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length>this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function Je(s,n){return{kind:"validation",type:"max_size",reference:Je,async:!1,expects:`<=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size>this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function Ze(s,n){return{kind:"validation",type:"max_value",reference:Ze,async:!1,expects:`<=${s instanceof Date?s.toJSON():T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value>this.requirement&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function Qe(s,n){return{kind:"validation",type:"mime_type",reference:Qe,async:!1,expects:s.map(e=>`"${e}"`).join(" | ")||"never",requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement.includes(e.value.type)&&u(this,"MIME type",e,t,{received:`"${e.value.type}"`}),e}}}function Ye(s,n){return{kind:"validation",type:"min_bytes",reference:Ye,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r<this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function en(s,n){return{kind:"validation",type:"min_length",reference:en,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length<this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function nn(s,n){return{kind:"validation",type:"min_size",reference:nn,async:!1,expects:`>=${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size<this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function sn(s,n){return{kind:"validation",type:"min_value",reference:sn,async:!1,expects:`>=${s instanceof Date?s.toJSON():T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value<this.requirement&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function tn(s,n){return{kind:"validation",type:"multiple_of",reference:tn,async:!1,expects:`%${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value%this.requirement!==0&&u(this,"multiple",e,t),e}}}function rn(s){return{kind:"validation",type:"non_empty",reference:rn,async:!1,expects:"!0",message:s,_run(n,e){return n.typed&&n.value.length===0&&u(this,"length",n,e,{received:"0"}),n}}}function un(s,n){return{kind:"validation",type:"not_bytes",reference:un,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){if(e.typed){let r=new TextEncoder().encode(e.value).length;r===this.requirement&&u(this,"bytes",e,t,{received:`${r}`})}return e}}}function an(s,n){return{kind:"validation",type:"not_length",reference:an,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.length===this.requirement&&u(this,"length",e,t,{received:`${e.value.length}`}),e}}}function on(s,n){return{kind:"validation",type:"not_size",reference:on,async:!1,expects:`!${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size===this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function cn(s,n){return{kind:"validation",type:"not_value",reference:cn,async:!1,expects:s instanceof Date?`!${s.toJSON()}`:`!${T(s)}`,requirement:s,message:n,_run(e,t){return e.typed&&this.requirement<=e.value&&this.requirement>=e.value&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function pn(s){return{kind:"validation",type:"octal",reference:pn,async:!1,expects:null,requirement:Y,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"octal",n,e),n}}}function In(){return{kind:"transformation",type:"readonly",reference:In,async:!1,_run(s){return s}}}function mn(s,n){return{kind:"validation",type:"regex",reference:mn,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"format",e,t),e}}}function dn(s){return{kind:"validation",type:"safe_integer",reference:dn,async:!1,expects:null,requirement:Number.isSafeInteger,message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"safe integer",n,e),n}}}function Tn(s,n){return{kind:"validation",type:"size",reference:Tn,async:!1,expects:`${s}`,requirement:s,message:n,_run(e,t){return e.typed&&e.value.size!==this.requirement&&u(this,"size",e,t,{received:`${e.value.size}`}),e}}}function ln(s,n){return{kind:"validation",type:"some",reference:ln,async:!1,expects:null,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.some(this.requirement)&&u(this,"content",e,t),e}}}function fn(s,n){return{kind:"validation",type:"starts_with",reference:fn,async:!1,expects:`"${s}"`,requirement:s,message:n,_run(e,t){return e.typed&&!e.value.startsWith(this.requirement)&&u(this,"start",e,t,{received:`"${e.value.slice(0,this.requirement.length)}"`}),e}}}function yn(){return{kind:"transformation",type:"to_lower_case",reference:yn,async:!1,_run(s){return s.value=s.value.toLowerCase(),s}}}function hn(s){return{kind:"transformation",type:"to_max_value",reference:hn,async:!1,requirement:s,_run(n){return n.value=n.value>this.requirement?this.requirement:n.value,n}}}function xn(s){return{kind:"transformation",type:"to_min_value",reference:xn,async:!1,requirement:s,_run(n){return n.value=n.value<this.requirement?this.requirement:n.value,n}}}function gn(){return{kind:"transformation",type:"to_upper_case",reference:gn,async:!1,_run(s){return s.value=s.value.toUpperCase(),s}}}function kn(s){return{kind:"transformation",type:"transform",reference:kn,async:!1,action:s,_run(n){return n.value=s(n.value),n}}}function Sn(s){return{kind:"transformation",type:"transform",reference:Sn,async:!0,action:s,async _run(n){return n.value=await s(n.value),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,_run(s){return s.value=s.value.trim(),s}}}function wn(){return{kind:"transformation",type:"trim_end",reference:wn,async:!1,_run(s){return s.value=s.value.trimEnd(),s}}}function bn(){return{kind:"transformation",type:"trim_start",reference:bn,async:!1,_run(s){return s.value=s.value.trimStart(),s}}}function En(s){return{kind:"validation",type:"ulid",reference:En,async:!1,expects:null,requirement:ee,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"ULID",n,e),n}}}function Bn(s){return{kind:"validation",type:"url",reference:Bn,async:!1,expects:null,requirement(n){try{return new URL(n),!0}catch{return!1}},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"URL",n,e),n}}}function Mn(s){return{kind:"validation",type:"uuid",reference:Mn,async:!1,expects:null,requirement:ne,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"UUID",n,e),n}}}function An(s,n){return{kind:"validation",type:"value",reference:An,async:!1,expects:s instanceof Date?s.toJSON():T(s),requirement:s,message:n,_run(e,t){return e.typed&&!(this.requirement<=e.value&&this.requirement>=e.value)&&u(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():T(e.value)}),e}}}function x(s,n,e){return typeof s.fallback=="function"?s.fallback(n,e):s.fallback}function ea(s,n){return{...s,fallback:n,_run(e,t){return s._run(e,t),e.issues?{typed:!0,value:x(this,e,t)}:e}}}function ta(s,n){return{...s,fallback:n,async:!0,async _run(e,t){return s._run(e,t),e.issues?{typed:!0,value:await x(this,e,t)}:e}}}function ua(s){let n={};for(let e of s)if(e.path)if(e.path.every(t=>"key"in t&&(typeof t.key=="string"||typeof t.key=="number"))){let t=e.path.map(({key:r})=>r).join(".");n.nested||(n.nested={}),n.nested[t]?n.nested[t].push(e.message):n.nested[t]=[e.message]}else n.unknown?n.unknown.push(e.message):n.unknown=[e.message];else n.root?n.root.push(e.message):n.root=[e.message];return n}function oa(s,n){return{...s,_run(e,t){if(s._run(e,t),e.issues)for(let r of e.issues){let o=e.value;for(let i of n){let c=o[i],a={type:"unknown",origin:"value",input:o,key:i,value:c};if(r.path?r.path.push(a):r.path=[a],!c)break;o=c}}return e}}}function ca(s,n){return{...s,async:!0,async _run(e,t){if(await s._run(e,t),e.issues)for(let r of e.issues){let o=e.value;for(let i of n){let c=o[i],a={type:"unknown",origin:"value",input:o,key:i,value:c};if(r.path?r.path.push(a):r.path=[a],!c)break;o=c}}return e}}}function l(s,n,e){return typeof s.default=="function"?s.default(n,e):s.default}function ue(s){if("entries"in s){let n={};for(let e in s.entries)n[e]=ue(s.entries[e]);return n}return"items"in s?s.items.map(ue):l(s)}async function ae(s){return"entries"in s?Object.fromEntries(await Promise.all(Object.entries(s.entries).map(async([n,e])=>[n,await ae(e)]))):"items"in s?Promise.all(s.items.map(ae)):l(s)}function oe(s){if("entries"in s){let n={};for(let e in s.entries)n[e]=oe(s.entries[e]);return n}return"items"in s?s.items.map(oe):x(s)}async function ie(s){return"entries"in s?Object.fromEntries(await Promise.all(Object.entries(s.entries).map(async([n,e])=>[n,await ie(e)]))):"items"in s?Promise.all(s.items.map(ie)):x(s)}function ga(s,n){return!s._run({typed:!1,value:n},{abortEarly:!0}).issues}function jn(){return{kind:"schema",type:"any",reference:jn,expects:"any",async:!1,_run(s){return s.typed=!0,s}}}function Rn(s,n){return{kind:"schema",type:"array",reference:Rn,expects:"Array",async:!1,item:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<r.length;o++){let i=r[o],c=this.item._run({typed:!1,value:i},t);if(c.issues){let a={type:"array",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function vn(s,n){return{kind:"schema",type:"array",reference:vn,expects:"Array",async:!0,item:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(r.map(i=>this.item._run({typed:!1,value:i},t)));for(let i=0;i<o.length;i++){let c=o[i];if(c.issues){let a={type:"array",origin:"value",input:r,key:i,value:r[i]};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function _n(s){return{kind:"schema",type:"bigint",reference:_n,expects:"bigint",async:!1,message:s,_run(n,e){return typeof n.value=="bigint"?n.typed=!0:u(this,"type",n,e),n}}}function qn(s){return{kind:"schema",type:"blob",reference:qn,expects:"Blob",async:!1,message:s,_run(n,e){return n.value instanceof Blob?n.typed=!0:u(this,"type",n,e),n}}}function Pn(s){return{kind:"schema",type:"boolean",reference:Pn,expects:"boolean",async:!1,message:s,_run(n,e){return typeof n.value=="boolean"?n.typed=!0:u(this,"type",n,e),n}}}function Dn(s,n){return{kind:"schema",type:"custom",reference:Dn,expects:"unknown",async:!1,check:s,message:n,_run(e,t){return this.check(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Nn(s,n){return{kind:"schema",type:"custom",reference:Nn,expects:"unknown",async:!0,check:s,message:n,async _run(e,t){return await this.check(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Wn(s){return{kind:"schema",type:"date",reference:Wn,expects:"Date",async:!1,message:s,_run(n,e){return n.value instanceof Date&&!isNaN(n.value.getTime())?n.typed=!0:u(this,"type",n,e),n}}}function Vn(s,n){let e=Object.entries(s).filter(([t])=>isNaN(+t)).map(([,t])=>t);return{kind:"schema",type:"enum",reference:Vn,expects:e.map(T).join(" | ")||"never",async:!1,enum:s,options:e,message:n,_run(t,r){return this.options.includes(t.value)?t.typed=!0:u(this,"type",t,r),t}}}function Kn(s,n){return{kind:"schema",type:"instance",reference:Kn,expects:s.name,async:!1,class:s,message:n,_run(e,t){return e.value instanceof this.class?e.typed=!0:u(this,"type",e,t),e}}}function S(s,n){if(typeof s==typeof n){if(s===n||s instanceof Date&&n instanceof Date&&+s==+n)return{value:s};if(s&&n&&s.constructor===Object&&n.constructor===Object){for(let e in n)if(e in s){let t=S(s[e],n[e]);if(t.issue)return t;s[e]=t.value}else s[e]=n[e];return{value:s}}if(Array.isArray(s)&&Array.isArray(n)&&s.length===n.length){for(let e=0;e<s.length;e++){let t=S(s[e],n[e]);if(t.issue)return t;s[e]=t.value}return{value:s}}}return{issue:!0}}function Ln(s,n){return{kind:"schema",type:"intersect",reference:Ln,expects:[...new Set(s.map(e=>e.expects))].join(" & ")||"never",async:!1,options:s,message:n,_run(e,t){if(this.options.length){let r=e.value,o;e.typed=!0;for(let i of this.options){let c=i._run({typed:!1,value:r},t);if(c.issues&&(e.issues?e.issues.push(...c.issues):e.issues=c.issues,t.abortEarly)){e.typed=!1;break}c.typed||(e.typed=!1),e.typed&&(o?o.push(c.value):o=[c.value])}if(e.typed){e.value=o[0];for(let i=1;i<o.length;i++){let c=S(e.value,o[i]);if(c.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=c.value}}}else u(this,"type",e,t);return e}}}function Cn(s,n){return{kind:"schema",type:"intersect",reference:Cn,expects:[...new Set(s.map(e=>e.expects))].join(" & ")||"never",async:!0,options:s,message:n,async _run(e,t){if(this.options.length){let r=e.value,o;e.typed=!0;let i=await Promise.all(this.options.map(c=>c._run({typed:!1,value:r},t)));for(let c of i){if(c.issues&&(e.issues?e.issues.push(...c.issues):e.issues=c.issues,t.abortEarly)){e.typed=!1;break}c.typed||(e.typed=!1),e.typed&&(o?o.push(c.value):o=[c.value])}if(e.typed){e.value=o[0];for(let c=1;c<o.length;c++){let a=S(e.value,o[c]);if(a.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=a.value}}}else u(this,"type",e,t);return e}}}function $n(s){return{kind:"schema",type:"lazy",reference:$n,expects:"unknown",async:!1,getter:s,_run(n,e){return this.getter(n.value)._run(n,e)}}}function zn(s){return{kind:"schema",type:"lazy",reference:zn,expects:"unknown",async:!0,getter:s,async _run(n,e){return(await this.getter(n.value))._run(n,e)}}}function Un(s,n){return{kind:"schema",type:"literal",reference:Un,expects:T(s),async:!1,literal:s,message:n,_run(e,t){return e.value===this.literal?e.typed=!0:u(this,"type",e,t),e}}}function Fn(s,n){return{kind:"schema",type:"loose_object",reference:Fn,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}if(!e.issues||!t.abortEarly)for(let o in r)f(o)&&!(o in this.entries)&&(e.value[o]=r[o])}else u(this,"type",e,t);return e}}}function Gn(s,n){return{kind:"schema",type:"loose_object",reference:Gn,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}if(!e.issues||!t.abortEarly)for(let i in r)f(i)&&!(i in this.entries)&&(e.value[i]=r[i])}else u(this,"type",e,t);return e}}}function Xn(s,n){return{kind:"schema",type:"loose_tuple",reference:Xn,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}if(!e.issues||!t.abortEarly)for(let o=s.length;o<r.length;o++)e.value.push(r[o])}else u(this,"type",e,t);return e}}}function Hn(s,n){return{kind:"schema",type:"loose_tuple",reference:Hn,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}if(!e.issues||!t.abortEarly)for(let i=s.length;i<r.length;i++)e.value.push(r[i])}else u(this,"type",e,t);return e}}}function Jn(s,n,e){return{kind:"schema",type:"map",reference:Jn,expects:"Map",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o instanceof Map){t.typed=!0,t.value=new Map;for(let[i,c]of o){let a=this.key._run({typed:!1,value:i},r);if(a.issues){let I={type:"map",origin:"key",input:o,key:i,value:c};for(let m of a.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}let p=this.value._run({typed:!1,value:c},r);if(p.issues){let I={type:"map",origin:"value",input:o,key:i,value:c};for(let m of p.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!p.typed)&&(t.typed=!1),t.value.set(a.value,p.value)}}else u(this,"type",t,r);return t}}}function Zn(s,n,e){return{kind:"schema",type:"map",reference:Zn,expects:"Map",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o instanceof Map){t.typed=!0,t.value=new Map;let i=await Promise.all([...o].map(([c,a])=>Promise.all([c,a,this.key._run({typed:!1,value:c},r),this.value._run({typed:!1,value:a},r)])));for(let[c,a,p,I]of i){if(p.issues){let m={type:"map",origin:"key",input:o,key:c,value:a};for(let d of p.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"map",origin:"value",input:o,key:c,value:a};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}(!p.typed||!I.typed)&&(t.typed=!1),t.value.set(p.value,I.value)}}else u(this,"type",t,r);return t}}}function Qn(s){return{kind:"schema",type:"nan",reference:Qn,expects:"NaN",async:!1,message:s,_run(n,e){return Number.isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function Yn(s){return{kind:"schema",type:"never",reference:Yn,expects:"never",async:!1,message:s,_run(n,e){return u(this,"type",n,e),n}}}function es(s,n){return{kind:"schema",type:"non_nullable",reference:es,expects:"!null",async:!1,wrapped:s,message:n,_run(e,t){return e.value===null?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ns(s,n){return{kind:"schema",type:"non_nullable",reference:ns,expects:"!null",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===null?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ss(s,n){return{kind:"schema",type:"non_nullish",reference:ss,expects:"!null & !undefined",async:!1,wrapped:s,message:n,_run(e,t){return e.value===null||e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function ts(s,n){return{kind:"schema",type:"non_nullish",reference:ts,expects:"!null & !undefined",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===null||e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function M(s,n){return{kind:"schema",type:"non_optional",reference:M,expects:"!undefined",async:!1,wrapped:s,message:n,_run(e,t){return e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function A(s,n){return{kind:"schema",type:"non_optional",reference:A,expects:"!undefined",async:!0,wrapped:s,message:n,async _run(e,t){return e.value===void 0?(u(this,"type",e,t),e):this.wrapped._run(e,t)}}}function rs(s){return{kind:"schema",type:"null",reference:rs,expects:"null",async:!1,message:s,_run(n,e){return n.value===null?n.typed=!0:u(this,"type",n,e),n}}}function us(s,...n){let e={kind:"schema",type:"nullable",reference:us,expects:`${s.expects} | null`,async:!1,wrapped:s,_run(t,r){return t.value===null&&("default"in this&&(t.value=l(this,t,r)),t.value===null)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function as(s,...n){let e={kind:"schema",type:"nullable",reference:as,expects:`${s.expects} | null`,async:!0,wrapped:s,async _run(t,r){return t.value===null&&("default"in this&&(t.value=await l(this,t,r)),t.value===null)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function os(s,...n){let e={kind:"schema",type:"nullish",reference:os,expects:`${s.expects} | null | undefined`,async:!1,wrapped:s,_run(t,r){return(t.value===null||t.value===void 0)&&("default"in this&&(t.value=l(this,t,r)),t.value===null||t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function is(s,...n){let e={kind:"schema",type:"nullish",reference:is,expects:`${s.expects} | null | undefined`,async:!0,wrapped:s,async _run(t,r){return(t.value===null||t.value===void 0)&&("default"in this&&(t.value=await l(this,t,r)),t.value===null||t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function cs(s){return{kind:"schema",type:"number",reference:cs,expects:"number",async:!1,message:s,_run(n,e){return typeof n.value=="number"&&!isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function ps(s,n){return{kind:"schema",type:"object",reference:ps,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}}else u(this,"type",e,t);return e}}}function Is(s,n){return{kind:"schema",type:"object",reference:Is,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}}else u(this,"type",e,t);return e}}}function ms(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ms,expects:"Object",async:!1,entries:s,rest:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};for(let i in this.entries){let c=o[i],a=this.entries[i]._run({typed:!1,value:c},r);if(a.issues){let p={type:"object",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||i in o)&&(t.value[i]=a.value)}if(!t.issues||!r.abortEarly){for(let i in o)if(f(i)&&!(i in this.entries)){let c=o[i],a=this.rest._run({typed:!1,value:c},r);if(a.issues){let p={type:"object",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value[i]=a.value}}}else u(this,"type",t,r);return t}}}function ds(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ds,expects:"Object",async:!0,entries:s,rest:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};let[i,c]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([a,p])=>{let I=o[a];return[a,I,await p._run({typed:!1,value:I},r)]})),Promise.all(Object.entries(o).filter(([a])=>f(a)&&!(a in this.entries)).map(async([a,p])=>[a,p,await this.rest._run({typed:!1,value:p},r)]))]);for(let[a,p,I]of i){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),(I.value!==void 0||a in o)&&(t.value[a]=I.value)}if(!t.issues||!r.abortEarly)for(let[a,p,I]of c){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value[a]=I.value}}else u(this,"type",t,r);return t}}}function j(s,...n){let e={kind:"schema",type:"optional",reference:j,expects:`${s.expects} | undefined`,async:!1,wrapped:s,_run(t,r){return t.value===void 0&&("default"in this&&(t.value=l(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function R(s,...n){let e={kind:"schema",type:"optional",reference:R,expects:`${s.expects} | undefined`,async:!0,wrapped:s,async _run(t,r){return t.value===void 0&&("default"in this&&(t.value=await l(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped._run(t,r)}};return 0 in n&&(e.default=n[0]),e}function v(s,n){return{kind:"schema",type:"picklist",reference:v,expects:s.map(T).join(" | ")||"never",async:!1,options:s,message:n,_run(e,t){return this.options.includes(e.value)?e.typed=!0:u(this,"type",e,t),e}}}function Ts(s,n,e){return{kind:"schema",type:"record",reference:Ts,expects:"Object",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};for(let i in o)if(f(i)){let c=o[i],a=this.key._run({typed:!1,value:i},r);if(a.issues){let I={type:"record",origin:"key",input:o,key:i,value:c};for(let m of a.issues)m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}let p=this.value._run({typed:!1,value:c},r);if(p.issues){let I={type:"record",origin:"value",input:o,key:i,value:c};for(let m of p.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!p.typed)&&(t.typed=!1),a.typed&&(t.value[a.value]=p.value)}}else u(this,"type",t,r);return t}}}function ls(s,n,e){return{kind:"schema",type:"record",reference:ls,expects:"Object",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"&&o.constructor===Object){t.typed=!0,t.value={};let i=await Promise.all(Object.entries(o).filter(([c])=>f(c)).map(([c,a])=>Promise.all([c,a,this.key._run({typed:!1,value:c},r),this.value._run({typed:!1,value:a},r)])));for(let[c,a,p,I]of i){if(p.issues){let m={type:"record",origin:"key",input:o,key:c,value:a};for(let d of p.issues)d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=p.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"record",origin:"value",input:o,key:c,value:a};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}(!p.typed||!I.typed)&&(t.typed=!1),p.typed&&(t.value[p.value]=I.value)}}else u(this,"type",t,r);return t}}}function fs(s,n){return{kind:"schema",type:"set",reference:fs,expects:"Set",async:!1,value:s,message:n,_run(e,t){let r=e.value;if(r instanceof Set){e.typed=!0,e.value=new Set;for(let o of r){let i=this.value._run({typed:!1,value:o},t);if(i.issues){let c={type:"set",origin:"value",input:r,value:o};for(let a of i.issues)a.path?a.path.unshift(c):a.path=[c],e.issues?.push(a);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value.add(i.value)}}else u(this,"type",e,t);return e}}}function ys(s,n){return{kind:"schema",type:"set",reference:ys,expects:"Set",async:!0,value:s,message:n,async _run(e,t){let r=e.value;if(r instanceof Set){e.typed=!0,e.value=new Set;let o=await Promise.all([...r].map(async i=>[i,await this.value._run({typed:!1,value:i},t)]));for(let[i,c]of o){if(c.issues){let a={type:"set",origin:"value",input:r,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.add(c.value)}}else u(this,"type",e,t);return e}}}function hs(s,n){return{kind:"schema",type:"strict_object",reference:hs,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],c=this.entries[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),(c.value!==void 0||o in r)&&(e.value[o]=c.value)}if(!e.issues||!t.abortEarly){for(let o in r)if(!(o in this.entries)){let i=r[o];u(this,"type",e,t,{input:i,expected:"never",path:[{type:"object",origin:"value",input:r,key:o,value:i}]});break}}}else u(this,"type",e,t);return e}}}function xs(s,n){return{kind:"schema",type:"strict_object",reference:xs,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"&&r.constructor===Object){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,c])=>{let a=r[i];return[i,a,await c._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"object",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(a.value!==void 0||i in r)&&(e.value[i]=a.value)}if(!e.issues||!t.abortEarly){for(let i in r)if(!(i in this.entries)){let c=r[i];u(this,"type",e,t,{input:c,expected:"never",path:[{type:"object",origin:"value",input:r,key:i,value:c}]});break}}}else u(this,"type",e,t);return e}}}function gs(s,n){return{kind:"schema",type:"strict_tuple",reference:gs,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}if(!(e.issues&&t.abortEarly)&&s.length<r.length){let o=r[s.length];u(this,"type",e,t,{input:o,expected:"never",path:[{type:"tuple",origin:"value",input:r,key:s.length,value:o}]})}}else u(this,"type",e,t);return e}}}function ks(s,n){return{kind:"schema",type:"strict_tuple",reference:ks,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}if(!(e.issues&&t.abortEarly)&&s.length<r.length){let i=r[s.length];u(this,"type",e,t,{input:i,expected:"never",path:[{type:"tuple",origin:"value",input:r,key:s.length,value:i}]})}}else u(this,"type",e,t);return e}}}function Ss(s){return{kind:"schema",type:"string",reference:Ss,expects:"string",async:!1,message:s,_run(n,e){return typeof n.value=="string"?n.typed=!0:u(this,"type",n,e),n}}}function Os(s){return{kind:"schema",type:"symbol",reference:Os,expects:"symbol",async:!1,message:s,_run(n,e){return typeof n.value=="symbol"?n.typed=!0:u(this,"type",n,e),n}}}function ws(s,n){return{kind:"schema",type:"tuple",reference:ws,expects:"Array",async:!1,items:s,message:n,_run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let o=0;o<s.length;o++){let i=r[o],c=this.items[o]._run({typed:!1,value:i},t);if(c.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let p of c.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=c.issues),t.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else u(this,"type",e,t);return e}}}function bs(s,n){return{kind:"schema",type:"tuple",reference:bs,expects:"Array",async:!0,items:s,message:n,async _run(e,t){let r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];let o=await Promise.all(s.map(async(i,c)=>{let a=r[c];return[c,a,await i._run({typed:!1,value:a},t)]}));for(let[i,c,a]of o){if(a.issues){let p={type:"tuple",origin:"value",input:r,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],e.issues?.push(I);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else u(this,"type",e,t);return e}}}function Es(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Es,expects:"Array",async:!1,items:s,rest:n,message:e,_run(t,r){let o=t.value;if(Array.isArray(o)){t.typed=!0,t.value=[];for(let i=0;i<s.length;i++){let c=o[i],a=this.items[i]._run({typed:!1,value:c},r);if(a.issues){let p={type:"tuple",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}if(!t.issues||!r.abortEarly)for(let i=s.length;i<o.length;i++){let c=o[i],a=this.rest._run({typed:!1,value:c},r);if(a.issues){let p={type:"tuple",origin:"value",input:o,key:i,value:c};for(let I of a.issues)I.path?I.path.unshift(p):I.path=[p],t.issues?.push(I);if(t.issues||(t.issues=a.issues),r.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else u(this,"type",t,r);return t}}}function Bs(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Bs,expects:"Array",async:!0,items:s,rest:n,message:e,async _run(t,r){let o=t.value;if(Array.isArray(o)){t.typed=!0,t.value=[];let[i,c]=await Promise.all([Promise.all(s.map(async(a,p)=>{let I=o[p];return[p,I,await a._run({typed:!1,value:I},r)]})),Promise.all(o.slice(s.length).map(async(a,p)=>[p+s.length,a,await n._run({typed:!1,value:a},r)]))]);for(let[a,p,I]of i){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value.push(I.value)}if(!t.issues||!r.abortEarly)for(let[a,p,I]of c){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:p};for(let d of I.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=I.issues),r.abortEarly){t.typed=!1;break}}I.typed||(t.typed=!1),t.value.push(I.value)}}else u(this,"type",t,r);return t}}}function Ms(s){return{kind:"schema",type:"undefined",reference:Ms,expects:"undefined",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function O(s){let n;if(s)for(let e of s)n?n.push(...e.issues):n=e.issues;return n}function As(s,n){return{kind:"schema",type:"union",reference:As,expects:[...new Set(s.map(e=>e.expects))].join(" | ")||"never",async:!1,options:s,message:n,_run(e,t){let r,o,i;for(let c of this.options){let a=c._run({typed:!1,value:e.value},t);if(a.typed)if(a.issues)o?o.push(a):o=[a];else{r=a;break}else i?i.push(a):i=[a]}if(r)return r;if(o){if(o.length===1)return o[0];u(this,"type",e,t,{issues:O(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:O(i)})}return e}}}function js(s,n){return{kind:"schema",type:"union",reference:js,expects:[...new Set(s.map(e=>e.expects))].join(" | ")||"never",async:!0,options:s,message:n,async _run(e,t){let r,o,i;for(let c of this.options){let a=await c._run({typed:!1,value:e.value},t);if(a.typed)if(a.issues)o?o.push(a):o=[a];else{r=a;break}else i?i.push(a):i=[a]}if(r)return r;if(o){if(o.length===1)return o[0];u(this,"type",e,t,{issues:O(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:O(i)})}return e}}}function Rs(){return{kind:"schema",type:"unknown",reference:Rs,expects:"unknown",async:!1,_run(s){return s.typed=!0,s}}}function E(s,n,e=new Set){for(let t of n)t.type==="variant"?E(s,t.options,e):e.add(t.entries[s].expects);return e}function vs(s,n,e){let t;return{kind:"schema",type:"variant",reference:vs,expects:"Object",async:!1,key:s,options:n,message:e,_run(r,o){let i=r.value;if(i&&typeof i=="object"&&i.constructor===Object){let c=i[this.key];if(this.key in i){let a;for(let p of this.options)if(p.type==="variant"||!p.entries[this.key]._run({typed:!1,value:c},o).issues){let I=p._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...E(this.key,this.options)].join(" | ")||"never"),u(this,"type",r,o,{input:c,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:c}]})}else u(this,"type",r,o);return r}}}function _s(s,n,e){let t;return{kind:"schema",type:"variant",reference:_s,expects:"Object",async:!0,key:s,options:n,message:e,async _run(r,o){let i=r.value;if(i&&typeof i=="object"&&i.constructor===Object){let c=i[this.key];if(this.key in i){let a;for(let p of this.options)if(p.type==="variant"||!(await p.entries[this.key]._run({typed:!1,value:c},o)).issues){let I=await p._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...E(this.key,this.options)].join(" | ")||"never"),u(this,"type",r,o,{input:c,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:c}]})}else u(this,"type",r,o);return r}}}function qs(s){return{kind:"schema",type:"void",reference:qs,expects:"void",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function Hi(s,n){return v(Object.keys(s.entries),n)}function Zi(s,n){let e={...s.entries};for(let t of n)delete e[t];return{...s,entries:e}}function nc(s,n,e){let t=s._run({typed:!1,value:n},y(e));if(t.issues)throw new h(t.issues);return t.value}async function uc(s,n,e){let t=await s._run({typed:!1,value:n},y(e));if(t.issues)throw new h(t.issues);return t.value}function ic(s,n){let e={};for(let t in s.entries)e[t]=!n||n.includes(t)?j(s.entries[t]):s.entries[t];return{...s,entries:e}}function Ic(s,n){let e={};for(let t in s.entries)e[t]=!n||n.includes(t)?R(s.entries[t]):s.entries[t];return{...s,entries:e}}function dc(s,n){let e={};for(let t of n)e[t]=s.entries[t];return{...s,entries:e}}function lc(...s){return{...s[0],pipe:s,_run(n,e){for(let t=0;t<s.length;t++){n=s[t]._run(n,e);let r=s[t+1];if(e.skipPipe||n.issues&&(e.abortEarly||e.abortPipeEarly||r?.kind==="schema"||r?.kind==="transformation")){n.typed=!1;break}}return n}}}function yc(...s){return{...s[0],pipe:s,async:!0,async _run(n,e){for(let t=0;t<s.length;t++){n=await s[t]._run(n,e);let r=s[t+1];if(e.skipPipe||n.issues&&(e.abortEarly||e.abortPipeEarly||r?.kind==="schema"||r?.kind==="transformation")){n.typed=!1;break}}return n}}}function gc(s,n,e){let t=Array.isArray(n)?n:void 0,r=Array.isArray(n)?e:n,o={};for(let i in s.entries)o[i]=!t||t.includes(i)?M(s.entries[i],r):s.entries[i];return{...s,entries:o}}function Oc(s,n,e){let t=Array.isArray(n)?n:void 0,r=Array.isArray(n)?e:n,o={};for(let i in s.entries)o[i]=!t||t.includes(i)?A(s.entries[i],r):s.entries[i];return{...s,entries:o}}function Ec(s,n,e){let t=s._run({typed:!1,value:n},y(e));return{typed:t.typed,success:!t.issues,output:t.value,issues:t.issues}}async function Ac(s,n,e){let t=await s._run({typed:!1,value:n},y(e));return{typed:t.typed,success:!t.issues,output:t.value,issues:t.issues}}function Rc(s){return s.wrapped}export{_ as BIC_REGEX,q as CUID2_REGEX,P as DECIMAL_REGEX,D as EMAIL_REGEX,N as EMOJI_REGEX,W as HEXADECIMAL_REGEX,V as HEX_COLOR_REGEX,K as IMEI_REGEX,L as IPV4_REGEX,C as IPV6_REGEX,$ as IP_REGEX,z as ISO_DATE_REGEX,U as ISO_DATE_TIME_REGEX,X as ISO_TIMESTAMP_REGEX,F as ISO_TIME_REGEX,G as ISO_TIME_SECOND_REGEX,H as ISO_WEEK_REGEX,J as MAC48_REGEX,Z as MAC64_REGEX,Q as MAC_REGEX,Y as OCTAL_REGEX,ee as ULID_REGEX,ne as UUID_REGEX,h as ValiError,u as _addIssue,f as _isAllowedObjectKey,B as _isLuhnAlgo,T as _stringify,jn as any,Rn as array,vn as arrayAsync,pe as bic,_n as bigint,qn as blob,Pn as boolean,me as brand,Ie as bytes,de as check,Te as checkAsync,he as creditCard,xe as cuid2,Dn as custom,Nn as customAsync,Wn as date,ge as decimal,Ns as deleteGlobalConfig,Ks as deleteGlobalMessage,$s as deleteSchemaMessage,Fs as deleteSpecificMessage,ke as email,Se as emoji,Oe as empty,we as endsWith,et as entriesFromList,Vn as enum_,be as every,Ee as excludes,ea as fallback,ta as fallbackAsync,Be as finite,ua as flatten,oa as forward,ca as forwardAsync,l as getDefault,ue as getDefaults,ae as getDefaultsAsync,x as getFallback,oe as getFallbacks,ie as getFallbacksAsync,y as getGlobalConfig,se as getGlobalMessage,te as getSchemaMessage,re as getSpecificMessage,Ae as hash,Re as hexColor,je as hexadecimal,ve as imei,_e as includes,Kn as instance,qe as integer,Ln as intersect,Cn as intersectAsync,Pe as ip,De as ipv4,Ne as ipv6,ga as is,st as isOfKind,rt as isOfType,ot as isValiError,We as isoDate,Ve as isoDateTime,Ke as isoTime,Le as isoTimeSecond,Ce as isoTimestamp,$e as isoWeek,Hi as keyof,$n as lazy,zn as lazyAsync,ze as length,Un as literal,Fn as looseObject,Gn as looseObjectAsync,Xn as looseTuple,Hn as looseTupleAsync,Ue as mac,Fe as mac48,Ge as mac64,Jn as map,Zn as mapAsync,Xe as maxBytes,He as maxLength,Je as maxSize,Ze as maxValue,Qe as mimeType,Ye as minBytes,en as minLength,nn as minSize,sn as minValue,tn as multipleOf,Qn as nan,Yn as never,rn as nonEmpty,es as nonNullable,ns as nonNullableAsync,ss as nonNullish,ts as nonNullishAsync,M as nonOptional,A as nonOptionalAsync,un as notBytes,an as notLength,on as notSize,cn as notValue,rs as null_,us as nullable,as as nullableAsync,os as nullish,is as nullishAsync,cs as number,ps as object,Is as objectAsync,ms as objectWithRest,ds as objectWithRestAsync,pn as octal,Zi as omit,j as optional,R as optionalAsync,nc as parse,uc as parseAsync,ic as partial,Ic as partialAsync,dc as pick,v as picklist,lc as pipe,yc as pipeAsync,In as readonly,Ts as record,ls as recordAsync,mn as regex,gc as required,Oc as requiredAsync,dn as safeInteger,Ec as safeParse,Ac as safeParseAsync,fs as set,ys as setAsync,Ds as setGlobalConfig,Vs as setGlobalMessage,Cs as setSchemaMessage,Us as setSpecificMessage,Tn as size,ln as some,fn as startsWith,hs as strictObject,xs as strictObjectAsync,gs as strictTuple,ks as strictTupleAsync,Ss as string,Os as symbol,yn as toLowerCase,hn as toMaxValue,xn as toMinValue,gn as toUpperCase,kn as transform,Sn as transformAsync,On as trim,wn as trimEnd,bn as trimStart,ws as tuple,bs as tupleAsync,Es as tupleWithRest,Bs as tupleWithRestAsync,En as ulid,Ms as undefined_,As as union,js as unionAsync,Rs as unknown,Rc as unwrap,Bn as url,Mn as uuid,An as value,vs as variant,_s as variantAsync,qs as void_}; |
{ | ||
"name": "valibot", | ||
"description": "The modular and type safe schema library for validating structural data", | ||
"version": "0.31.0-rc.2", | ||
"version": "0.31.0-rc.3", | ||
"license": "MIT", | ||
@@ -44,2 +44,13 @@ "author": "Fabian Hiller", | ||
}, | ||
"scripts": { | ||
"play": "tsm ./playground.ts", | ||
"test": "vitest --typecheck", | ||
"coverage": "vitest run --coverage --isolate", | ||
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit", | ||
"eslint.fix": "eslint \"src/**/*.ts*\" --fix", | ||
"format": "prettier --write ./src", | ||
"format.check": "prettier --check ./src", | ||
"build": "tsup", | ||
"publish": "npm publish && npx jsr publish" | ||
}, | ||
"devDependencies": { | ||
@@ -62,13 +73,3 @@ "@types/eslint": "^8.56.7", | ||
"vitest": "1.4.0" | ||
}, | ||
"scripts": { | ||
"play": "tsm ./playground.ts", | ||
"test": "vitest --typecheck", | ||
"coverage": "vitest run --coverage --isolate", | ||
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit", | ||
"eslint.fix": "eslint \"src/**/*.ts*\" --fix", | ||
"format": "prettier --write ./src", | ||
"format.check": "prettier --check ./src", | ||
"build": "tsup" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1121232
8