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

valibot

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valibot - npm Package Compare versions

Comparing version 0.31.0-rc.10 to 0.31.0-rc.11

2

dist/index.min.js

@@ -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{Extended_Pictographic}\p{Emoji_Component}]+$/u,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 Ks(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 Ls(){k=void 0}var O;function $s(s,n){O||(O=new Map),O.set(n,s)}function se(s){return O?.get(s)}function zs(s){O?.delete(s)}var b;function Fs(s,n){b||(b=new Map),b.set(n,s)}function te(s){return b?.get(s)}function Gs(s){b?.delete(s)}var g;function Hs(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 Js(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,p=r?.received??T(o),a={kind:s.kind,type:s.type,input:o,expected:i,received:p,message:`Invalid ${n}: ${i?`Expected ${i} but r`:"R"}eceived ${p}`,requirement:s.requirement,path:r?.path,issues:r?.issues,lang:t.lang,abortEarly:t.abortEarly,abortPipeEarly:t.abortPipeEarly,skipPipe:t.skipPipe},c=s.kind==="schema",I=s.message??re(s.reference,a.lang)??(c?te(a.lang):null)??t.message??se(a.lang);I&&(a.message=typeof I=="function"?I(a):I),c&&(e.typed=!1),e.issues?e.issues.push(a):e.issues=[a]}function l(s){return s!=="__proto__"&&s!=="prototype"&&s!=="constructor"}var de=/\D/gu;function E(s){let n=s.replace(de,""),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 rt(s,n){let e={};for(let t of s)e[t]=n;return e}function at(s,n){return n.kind===s}function it(s,n){return n.type===s}function It(s){return s instanceof h}var h=class extends Error{issues;constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};function Te(s){return{kind:"validation",type:"bic",reference:Te,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 fe(s,n){return{kind:"validation",type:"bytes",reference:fe,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 le(s){return{kind:"transformation",type:"brand",reference:le,async:!1,name:s,_run(n){return n}}}function ye(s,n){return{kind:"validation",type:"check",reference:ye,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 he(s,n){return{kind:"validation",type:"check",reference:he,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 xe=/^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,ge=/[- ]/gu,ke=[/^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 Se(s){return{kind:"validation",type:"credit_card",reference:Se,async:!1,expects:null,requirement(n){let e;return xe.test(n)&&(e=n.replace(ge,""))&&ke.some(t=>t.test(e))&&E(e)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"credit card",n,e),n}}}function we(s){return{kind:"validation",type:"cuid2",reference:we,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 Oe(s){return{kind:"validation",type:"decimal",reference:Oe,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 be(s){return{kind:"validation",type:"email",reference:be,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 Be(s){return{kind:"validation",type:"emoji",reference:Be,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 Ee(s){return{kind:"validation",type:"empty",reference:Ee,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 Me(s,n){return{kind:"validation",type:"ends_with",reference:Me,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 Ae(s,n){return{kind:"validation",type:"every",reference:Ae,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 je(s,n){let e=T(s);return{kind:"validation",type:"excludes",reference:je,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 Re(s){return{kind:"validation",type:"finite",reference:Re,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 ve={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 _e(s,n){return{kind:"validation",type:"hash",reference:_e,expects:null,async:!1,requirement:RegExp(s.map(e=>`^[a-f0-9]{${ve[e]}}$`).join("|"),"iu"),message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"hash",e,t),e}}}function qe(s){return{kind:"validation",type:"hexadecimal",reference:qe,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 Pe(s){return{kind:"validation",type:"hex_color",reference:Pe,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 De(s){return{kind:"validation",type:"imei",reference:De,async:!1,expects:null,requirement(n){return K.test(n)&&E(n)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"IMEI",n,e),n}}}function Ne(s,n){let e=T(s);return{kind:"validation",type:"includes",reference:Ne,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 We(s){return{kind:"validation",type:"integer",reference:We,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 Ve(s){return{kind:"validation",type:"ip",reference:Ve,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 Ke(s){return{kind:"validation",type:"ipv4",reference:Ke,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 Le(s){return{kind:"validation",type:"ipv6",reference:Le,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 Ce(s){return{kind:"validation",type:"iso_date",reference:Ce,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 $e(s){return{kind:"validation",type:"iso_date_time",reference:$e,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 ze(s){return{kind:"validation",type:"iso_time",reference:ze,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 Ue(s){return{kind:"validation",type:"iso_time_second",reference:Ue,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 Fe(s){return{kind:"validation",type:"iso_timestamp",reference:Fe,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 Ge(s){return{kind:"validation",type:"iso_week",reference:Ge,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 Xe(s,n){return{kind:"validation",type:"length",reference:Xe,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 He(s){return{kind:"validation",type:"mac",reference:He,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 Je(s){return{kind:"validation",type:"mac48",reference:Je,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 Ze(s){return{kind:"validation",type:"mac64",reference:Ze,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 Qe(s,n){return{kind:"validation",type:"max_bytes",reference:Qe,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 Ye(s,n){return{kind:"validation",type:"max_length",reference:Ye,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 en(s,n){return{kind:"validation",type:"max_size",reference:en,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 nn(s,n){return{kind:"validation",type:"max_value",reference:nn,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 sn(s,n){return{kind:"validation",type:"mime_type",reference:sn,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 tn(s,n){return{kind:"validation",type:"min_bytes",reference:tn,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 rn(s,n){return{kind:"validation",type:"min_length",reference:rn,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 un(s,n){return{kind:"validation",type:"min_size",reference:un,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 an(s,n){return{kind:"validation",type:"min_value",reference:an,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 on(s,n){return{kind:"validation",type:"multiple_of",reference:on,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 pn(s){return{kind:"validation",type:"non_empty",reference:pn,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 cn(s,n){return{kind:"validation",type:"not_bytes",reference:cn,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 In(s,n){return{kind:"validation",type:"not_length",reference:In,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 mn(s,n){return{kind:"validation",type:"not_size",reference:mn,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 dn(s,n){return{kind:"validation",type:"not_value",reference:dn,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 Tn(s){return{kind:"validation",type:"octal",reference:Tn,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 fn(){return{kind:"transformation",type:"readonly",reference:fn,async:!1,_run(s){return s}}}function ln(s,n){return{kind:"validation",type:"regex",reference:ln,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 yn(s){return{kind:"validation",type:"safe_integer",reference:yn,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 hn(s,n){return{kind:"validation",type:"size",reference:hn,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 xn(s,n){return{kind:"validation",type:"some",reference:xn,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 gn(s,n){return{kind:"validation",type:"starts_with",reference:gn,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 kn(){return{kind:"transformation",type:"to_lower_case",reference:kn,async:!1,_run(s){return s.value=s.value.toLowerCase(),s}}}function Sn(s){return{kind:"transformation",type:"to_max_value",reference:Sn,async:!1,requirement:s,_run(n){return n.value=n.value>this.requirement?this.requirement:n.value,n}}}function wn(s){return{kind:"transformation",type:"to_min_value",reference:wn,async:!1,requirement:s,_run(n){return n.value=n.value<this.requirement?this.requirement:n.value,n}}}function On(){return{kind:"transformation",type:"to_upper_case",reference:On,async:!1,_run(s){return s.value=s.value.toUpperCase(),s}}}function bn(s){return{kind:"transformation",type:"transform",reference:bn,async:!1,action:s,_run(n){return n.value=s(n.value),n}}}function Bn(s){return{kind:"transformation",type:"transform",reference:Bn,async:!0,action:s,async _run(n){return n.value=await s(n.value),n}}}function En(){return{kind:"transformation",type:"trim",reference:En,async:!1,_run(s){return s.value=s.value.trim(),s}}}function Mn(){return{kind:"transformation",type:"trim_end",reference:Mn,async:!1,_run(s){return s.value=s.value.trimEnd(),s}}}function An(){return{kind:"transformation",type:"trim_start",reference:An,async:!1,_run(s){return s.value=s.value.trimStart(),s}}}function jn(s){return{kind:"validation",type:"ulid",reference:jn,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 Rn(s){return{kind:"validation",type:"url",reference:Rn,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 vn(s){return{kind:"validation",type:"uuid",reference:vn,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 _n(s,n){return{kind:"validation",type:"value",reference:_n,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 sa(s,n){return{...s,_run(e,t){return s._run(e,{...t,...n})}}}function x(s,n,e){return typeof s.fallback=="function"?s.fallback(n,e):s.fallback}function aa(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 pa(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 Ia(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 da(s,n){return{...s,_run(e,t){let r=e.issues&&[...e.issues];if(s._run(e,t),e.issues){for(let o of e.issues)if(!r?.includes(o)){let i=e.value;for(let p of n){let a=i[p],c={type:"unknown",origin:"value",input:i,key:p,value:a};if(o.path?o.path.push(c):o.path=[c],!a)break;i=a}}}return e}}}function fa(s,n){return{...s,async:!0,async _run(e,t){let r=e.issues&&[...e.issues];if(await s._run(e,t),e.issues){for(let o of e.issues)if(!r?.includes(o)){let i=e.value;for(let p of n){let a=i[p],c={type:"unknown",origin:"value",input:i,key:p,value:a};if(o.path?o.path.push(c):o.path=[c],!a)break;i=a}}}return e}}}function f(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):f(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)):f(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 Ba(s,n){return!s._run({typed:!1,value:n},{abortEarly:!0}).issues}function qn(){return{kind:"schema",type:"any",reference:qn,expects:"any",async:!1,_run(s){return s.typed=!0,s}}}function Pn(s,n){return{kind:"schema",type:"array",reference:Pn,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],p=this.item._run({typed:!1,value:i},t);if(p.issues){let a={type:"array",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.push(p.value)}}else u(this,"type",e,t);return e}}}function Dn(s,n){return{kind:"schema",type:"array",reference:Dn,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 p=o[i];if(p.issues){let a={type:"array",origin:"value",input:r,key:i,value:r[i]};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.push(p.value)}}else u(this,"type",e,t);return e}}}function Nn(s){return{kind:"schema",type:"bigint",reference:Nn,expects:"bigint",async:!1,message:s,_run(n,e){return typeof n.value=="bigint"?n.typed=!0:u(this,"type",n,e),n}}}function Wn(s){return{kind:"schema",type:"blob",reference:Wn,expects:"Blob",async:!1,message:s,_run(n,e){return n.value instanceof Blob?n.typed=!0:u(this,"type",n,e),n}}}function Vn(s){return{kind:"schema",type:"boolean",reference:Vn,expects:"boolean",async:!1,message:s,_run(n,e){return typeof n.value=="boolean"?n.typed=!0:u(this,"type",n,e),n}}}function Kn(s,n){return{kind:"schema",type:"custom",reference:Kn,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 Ln(s,n){return{kind:"schema",type:"custom",reference:Ln,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 Cn(s){return{kind:"schema",type:"date",reference:Cn,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 $n(s,n){let e=Object.entries(s).filter(([t])=>isNaN(+t)).map(([,t])=>t);return{kind:"schema",type:"enum",reference:$n,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 zn(s,n){return{kind:"schema",type:"instance",reference:zn,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 Un(s,n){return{kind:"schema",type:"intersect",reference:Un,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 p=i._run({typed:!1,value:r},t);if(p.issues&&(e.issues?e.issues.push(...p.issues):e.issues=p.issues,t.abortEarly)){e.typed=!1;break}p.typed||(e.typed=!1),e.typed&&(o?o.push(p.value):o=[p.value])}if(e.typed){e.value=o[0];for(let i=1;i<o.length;i++){let p=S(e.value,o[i]);if(p.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=p.value}}}else u(this,"type",e,t);return e}}}function Fn(s,n){return{kind:"schema",type:"intersect",reference:Fn,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(p=>p._run({typed:!1,value:r},t)));for(let p of i){if(p.issues&&(e.issues?e.issues.push(...p.issues):e.issues=p.issues,t.abortEarly)){e.typed=!1;break}p.typed||(e.typed=!1),e.typed&&(o?o.push(p.value):o=[p.value])}if(e.typed){e.value=o[0];for(let p=1;p<o.length;p++){let a=S(e.value,o[p]);if(a.issue){u(this,"type",e,t,{received:"unknown"});break}e.value=a.value}}}else u(this,"type",e,t);return e}}}function Gn(s){return{kind:"schema",type:"lazy",reference:Gn,expects:"unknown",async:!1,getter:s,_run(n,e){return this.getter(n.value)._run(n,e)}}}function Xn(s){return{kind:"schema",type:"lazy",reference:Xn,expects:"unknown",async:!0,getter:s,async _run(n,e){return(await this.getter(n.value))._run(n,e)}}}function Hn(s,n){return{kind:"schema",type:"literal",reference:Hn,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 Jn(s,n){return{kind:"schema",type:"loose_object",reference:Jn,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],p=this.entries[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),(p.value!==void 0||o in r)&&(e.value[o]=p.value)}if(!e.issues||!t.abortEarly)for(let o in r)l(o)&&!(o in this.entries)&&(e.value[o]=r[o])}else u(this,"type",e,t);return e}}}function Zn(s,n){return{kind:"schema",type:"loose_object",reference:Zn,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,p])=>{let a=r[i];return[i,a,await p._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"object",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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)l(i)&&!(i in this.entries)&&(e.value[i]=r[i])}else u(this,"type",e,t);return e}}}function Qn(s,n){return{kind:"schema",type:"loose_tuple",reference:Qn,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],p=this.items[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.push(p.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 Yn(s,n){return{kind:"schema",type:"loose_tuple",reference:Yn,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,p)=>{let a=r[p];return[p,a,await i._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"tuple",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 es(s,n,e){return{kind:"schema",type:"map",reference:es,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,p]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:p};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 c=this.value._run({typed:!1,value:p},r);if(c.issues){let I={type:"map",origin:"value",input:o,key:i,value:p};for(let m of c.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=c.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!c.typed)&&(t.typed=!1),t.value.set(a.value,c.value)}}else u(this,"type",t,r);return t}}}function ns(s,n,e){return{kind:"schema",type:"map",reference:ns,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(([p,a])=>Promise.all([p,a,this.key._run({typed:!1,value:p},r),this.value._run({typed:!1,value:a},r)])));for(let[p,a,c,I]of i){if(c.issues){let m={type:"map",origin:"key",input:o,key:p,value:a};for(let d of c.issues)d.path?d.path.unshift(m):d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=c.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"map",origin:"value",input:o,key:p,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}}(!c.typed||!I.typed)&&(t.typed=!1),t.value.set(c.value,I.value)}}else u(this,"type",t,r);return t}}}function ss(s){return{kind:"schema",type:"nan",reference:ss,expects:"NaN",async:!1,message:s,_run(n,e){return Number.isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function ts(s){return{kind:"schema",type:"never",reference:ts,expects:"never",async:!1,message:s,_run(n,e){return u(this,"type",n,e),n}}}function rs(s,n){return{kind:"schema",type:"non_nullable",reference:rs,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 us(s,n){return{kind:"schema",type:"non_nullable",reference:us,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 as(s,n){return{kind:"schema",type:"non_nullish",reference:as,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 os(s,n){return{kind:"schema",type:"non_nullish",reference:os,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 is(s){return{kind:"schema",type:"null",reference:is,expects:"null",async:!1,message:s,_run(n,e){return n.value===null?n.typed=!0:u(this,"type",n,e),n}}}function ps(s,...n){let e={kind:"schema",type:"nullable",reference:ps,expects:`${s.expects} | null`,async:!1,wrapped:s,_run(t,r){return t.value===null&&("default"in this&&(t.value=f(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 cs(s,...n){let e={kind:"schema",type:"nullable",reference:cs,expects:`${s.expects} | null`,async:!0,wrapped:s,async _run(t,r){return t.value===null&&("default"in this&&(t.value=await f(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 Is(s,...n){let e={kind:"schema",type:"nullish",reference:Is,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=f(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 ms(s,...n){let e={kind:"schema",type:"nullish",reference:ms,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 f(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 ds(s){return{kind:"schema",type:"number",reference:ds,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 Ts(s,n){return{kind:"schema",type:"object",reference:Ts,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],p=this.entries[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),(p.value!==void 0||o in r)&&(e.value[o]=p.value)}}else u(this,"type",e,t);return e}}}function fs(s,n){return{kind:"schema",type:"object",reference:fs,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,p])=>{let a=r[i];return[i,a,await p._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"object",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 ls(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ls,expects:"Object",async:!1,entries:s,rest:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};for(let i in this.entries){let p=o[i],a=this.entries[i]._run({typed:!1,value:p},r);if(a.issues){let c={type:"object",origin:"value",input:o,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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(l(i)&&!(i in this.entries)){let p=o[i],a=this.rest._run({typed:!1,value:p},r);if(a.issues){let c={type:"object",origin:"value",input:o,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 ys(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ys,expects:"Object",async:!0,entries:s,rest:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};let[i,p]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([a,c])=>{let I=o[a];return[a,I,await c._run({typed:!1,value:I},r)]})),Promise.all(Object.entries(o).filter(([a])=>l(a)&&!(a in this.entries)).map(async([a,c])=>[a,c,await this.rest._run({typed:!1,value:c},r)]))]);for(let[a,c,I]of i){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:c};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,c,I]of p){if(I.issues){let m={type:"object",origin:"value",input:o,key:a,value:c};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=f(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 f(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 hs(s,n,e){return{kind:"schema",type:"record",reference:hs,expects:"Object",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};for(let i in o)if(l(i)){let p=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:p};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 c=this.value._run({typed:!1,value:p},r);if(c.issues){let I={type:"record",origin:"value",input:o,key:i,value:p};for(let m of c.issues)m.path?m.path.unshift(I):m.path=[I],t.issues?.push(m);if(t.issues||(t.issues=c.issues),r.abortEarly){t.typed=!1;break}}(!a.typed||!c.typed)&&(t.typed=!1),a.typed&&(t.value[a.value]=c.value)}}else u(this,"type",t,r);return t}}}function xs(s,n,e){return{kind:"schema",type:"record",reference:xs,expects:"Object",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};let i=await Promise.all(Object.entries(o).filter(([p])=>l(p)).map(([p,a])=>Promise.all([p,a,this.key._run({typed:!1,value:p},r),this.value._run({typed:!1,value:a},r)])));for(let[p,a,c,I]of i){if(c.issues){let m={type:"record",origin:"key",input:o,key:p,value:a};for(let d of c.issues)d.path=[m],t.issues?.push(d);if(t.issues||(t.issues=c.issues),r.abortEarly){t.typed=!1;break}}if(I.issues){let m={type:"record",origin:"value",input:o,key:p,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}}(!c.typed||!I.typed)&&(t.typed=!1),c.typed&&(t.value[c.value]=I.value)}}else u(this,"type",t,r);return t}}}function gs(s,n){return{kind:"schema",type:"set",reference:gs,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 p={type:"set",origin:"value",input:r,value:o};for(let a of i.issues)a.path?a.path.unshift(p):a.path=[p],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 ks(s,n){return{kind:"schema",type:"set",reference:ks,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,p]of o){if(p.issues){let a={type:"set",origin:"value",input:r,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.add(p.value)}}else u(this,"type",e,t);return e}}}function Ss(s,n){return{kind:"schema",type:"strict_object",reference:Ss,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};for(let o in this.entries){let i=r[o],p=this.entries[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"object",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),(p.value!==void 0||o in r)&&(e.value[o]=p.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 ws(s,n){return{kind:"schema",type:"strict_object",reference:ws,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="object"){e.typed=!0,e.value={};let o=await Promise.all(Object.entries(this.entries).map(async([i,p])=>{let a=r[i];return[i,a,await p._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"object",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 p=r[i];u(this,"type",e,t,{input:p,expected:"never",path:[{type:"object",origin:"value",input:r,key:i,value:p}]});break}}}else u(this,"type",e,t);return e}}}function Os(s,n){return{kind:"schema",type:"strict_tuple",reference:Os,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],p=this.items[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.push(p.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 bs(s,n){return{kind:"schema",type:"strict_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,p)=>{let a=r[p];return[p,a,await i._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"tuple",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 Bs(s){return{kind:"schema",type:"string",reference:Bs,expects:"string",async:!1,message:s,_run(n,e){return typeof n.value=="string"?n.typed=!0:u(this,"type",n,e),n}}}function Es(s){return{kind:"schema",type:"symbol",reference:Es,expects:"symbol",async:!1,message:s,_run(n,e){return typeof n.value=="symbol"?n.typed=!0:u(this,"type",n,e),n}}}function Ms(s,n){return{kind:"schema",type:"tuple",reference:Ms,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],p=this.items[o]._run({typed:!1,value:i},t);if(p.issues){let a={type:"tuple",origin:"value",input:r,key:o,value:i};for(let c of p.issues)c.path?c.path.unshift(a):c.path=[a],e.issues?.push(c);if(e.issues||(e.issues=p.issues),t.abortEarly){e.typed=!1;break}}p.typed||(e.typed=!1),e.value.push(p.value)}}else u(this,"type",e,t);return e}}}function As(s,n){return{kind:"schema",type:"tuple",reference:As,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,p)=>{let a=r[p];return[p,a,await i._run({typed:!1,value:a},t)]}));for(let[i,p,a]of o){if(a.issues){let c={type:"tuple",origin:"value",input:r,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 js(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:js,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 p=o[i],a=this.items[i]._run({typed:!1,value:p},r);if(a.issues){let c={type:"tuple",origin:"value",input:o,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 p=o[i],a=this.rest._run({typed:!1,value:p},r);if(a.issues){let c={type:"tuple",origin:"value",input:o,key:i,value:p};for(let I of a.issues)I.path?I.path.unshift(c):I.path=[c],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 Rs(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Rs,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,p]=await Promise.all([Promise.all(s.map(async(a,c)=>{let I=o[c];return[c,I,await a._run({typed:!1,value:I},r)]})),Promise.all(o.slice(s.length).map(async(a,c)=>[c+s.length,a,await n._run({typed:!1,value:a},r)]))]);for(let[a,c,I]of i){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:c};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,c,I]of p){if(I.issues){let m={type:"tuple",origin:"value",input:o,key:a,value:c};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 vs(s){return{kind:"schema",type:"undefined",reference:vs,expects:"undefined",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function w(s){let n;if(s)for(let e of s)n?n.push(...e.issues):n=e.issues;return n}function _s(s,n){return{kind:"schema",type:"union",reference:_s,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 p of this.options){let a=p._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:w(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:w(i)})}return e}}}function qs(s,n){return{kind:"schema",type:"union",reference:qs,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 p of this.options){let a=await p._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:w(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:w(i)})}return e}}}function Ps(){return{kind:"schema",type:"unknown",reference:Ps,expects:"unknown",async:!1,_run(s){return s.typed=!0,s}}}function B(s,n,e=new Set){for(let t of n)t.type==="variant"?B(s,t.options,e):e.add(t.entries[s].expects);return e}function Ds(s,n,e){let t;return{kind:"schema",type:"variant",reference:Ds,expects:"Object",async:!1,key:s,options:n,message:e,_run(r,o){let i=r.value;if(i&&typeof i=="object"){let p=i[this.key];if(this.key in i){let a;for(let c of this.options)if(c.type==="variant"||!c.entries[this.key]._run({typed:!1,value:p},o).issues){let I=c._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...B(this.key,this.options)].join(" | ")||"never"),u(this,"type",r,o,{input:p,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:p}]})}else u(this,"type",r,o);return r}}}function Ns(s,n,e){let t;return{kind:"schema",type:"variant",reference:Ns,expects:"Object",async:!0,key:s,options:n,message:e,async _run(r,o){let i=r.value;if(i&&typeof i=="object"){let p=i[this.key];if(this.key in i){let a;for(let c of this.options)if(c.type==="variant"||!(await c.entries[this.key]._run({typed:!1,value:p},o)).issues){let I=await c._run({typed:!1,value:i},o);if(!I.issues)return I;(!a||!a.typed&&I.typed)&&(a=I)}if(a)return a}t||(t=[...B(this.key,this.options)].join(" | ")||"never"),u(this,"type",r,o,{input:p,expected:t,path:[{type:"object",origin:"value",input:i,key:this.key,value:p}]})}else u(this,"type",r,o);return r}}}function Ws(s){return{kind:"schema",type:"void",reference:Ws,expects:"void",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function np(s,n){return v(Object.keys(s.entries),n)}function tp(s,n){let e={...s.entries};for(let t of n)delete e[t];return{...s,entries:e}}function pe(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 ce(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 mp(s,n){return e=>pe(s,e,n)}function fp(s,n){return e=>ce(s,e,n)}function hp(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 kp(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 wp(s,n){let e={};for(let t of n)e[t]=s.entries[t];return{...s,entries:e}}function bp(...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 Ep(...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 jp(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 _p(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 Ie(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 me(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 Kp(s,n){return e=>Ie(s,e,n)}function $p(s,n){return e=>me(s,e,n)}function Up(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,l as _isAllowedObjectKey,E as _isLuhnAlgo,T as _stringify,qn as any,Pn as array,Dn as arrayAsync,Te as bic,Nn as bigint,Wn as blob,Vn as boolean,le as brand,fe as bytes,ye as check,he as checkAsync,sa as config,Se as creditCard,we as cuid2,Kn as custom,Ln as customAsync,Cn as date,Oe as decimal,Ls as deleteGlobalConfig,zs as deleteGlobalMessage,Gs as deleteSchemaMessage,Js as deleteSpecificMessage,be as email,Be as emoji,Ee as empty,Me as endsWith,rt as entriesFromList,$n as enum_,Ae as every,je as excludes,aa as fallback,pa as fallbackAsync,Re as finite,Ia as flatten,da as forward,fa as forwardAsync,f 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,_e as hash,Pe as hexColor,qe as hexadecimal,De as imei,Ne as includes,zn as instance,We as integer,Un as intersect,Fn as intersectAsync,Ve as ip,Ke as ipv4,Le as ipv6,Ba as is,at as isOfKind,it as isOfType,It as isValiError,Ce as isoDate,$e as isoDateTime,ze as isoTime,Ue as isoTimeSecond,Fe as isoTimestamp,Ge as isoWeek,np as keyof,Gn as lazy,Xn as lazyAsync,Xe as length,Hn as literal,Jn as looseObject,Zn as looseObjectAsync,Qn as looseTuple,Yn as looseTupleAsync,He as mac,Je as mac48,Ze as mac64,es as map,ns as mapAsync,Qe as maxBytes,Ye as maxLength,en as maxSize,nn as maxValue,sn as mimeType,tn as minBytes,rn as minLength,un as minSize,an as minValue,on as multipleOf,ss as nan,ts as never,pn as nonEmpty,rs as nonNullable,us as nonNullableAsync,as as nonNullish,os as nonNullishAsync,M as nonOptional,A as nonOptionalAsync,cn as notBytes,In as notLength,mn as notSize,dn as notValue,is as null_,ps as nullable,cs as nullableAsync,Is as nullish,ms as nullishAsync,ds as number,Ts as object,fs as objectAsync,ls as objectWithRest,ys as objectWithRestAsync,Tn as octal,tp as omit,j as optional,R as optionalAsync,pe as parse,ce as parseAsync,mp as parser,fp as parserAsync,hp as partial,kp as partialAsync,wp as pick,v as picklist,bp as pipe,Ep as pipeAsync,fn as readonly,hs as record,xs as recordAsync,ln as regex,jp as required,_p as requiredAsync,yn as safeInteger,Ie as safeParse,me as safeParseAsync,Kp as safeParser,$p as safeParserAsync,gs as set,ks as setAsync,Ks as setGlobalConfig,$s as setGlobalMessage,Fs as setSchemaMessage,Hs as setSpecificMessage,hn as size,xn as some,gn as startsWith,Ss as strictObject,ws as strictObjectAsync,Os as strictTuple,bs as strictTupleAsync,Bs as string,Es as symbol,kn as toLowerCase,Sn as toMaxValue,wn as toMinValue,On as toUpperCase,bn as transform,Bn as transformAsync,En as trim,Mn as trimEnd,An as trimStart,Ms as tuple,As as tupleAsync,js as tupleWithRest,Rs as tupleWithRestAsync,jn as ulid,vs as undefined_,_s as union,qs as unionAsync,Ps as unknown,Up as unwrap,Rn as url,vn as uuid,_n as value,Ds as variant,Ns as variantAsync,Ws as void_};
var _=/^[A-Z]{6}(?!00)[A-Z\d]{2}(?:[A-Z\d]{3})?$/u,P=/^[a-z][\da-z]*$/u,q=/^\d+$/u,D=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,N=/^[\p{Extended_Pictographic}\p{Emoji_Component}]+$/u,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 Ks(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 Ls(){k=void 0}var O;function $s(s,n){O||(O=new Map),O.set(n,s)}function se(s){return O?.get(s)}function zs(s){O?.delete(s)}var B;function Fs(s,n){B||(B=new Map),B.set(n,s)}function te(s){return B?.get(s)}function Gs(s){B?.delete(s)}var g;function Hs(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 Js(s,n){g?.get(s)?.delete(n)}function f(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??f(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 l(s){return s!=="__proto__"&&s!=="prototype"&&s!=="constructor"}var de=/\D/gu;function E(s){let n=s.replace(de,""),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 rt(s,n){let e={};for(let t of s)e[t]=n;return e}function at(s,n){return n.kind===s}function it(s,n){return n.type===s}function It(s){return s instanceof h}var h=class extends Error{issues;constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};function fe(s){return{kind:"validation",type:"bic",reference:fe,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 Te(s,n){return{kind:"validation",type:"bytes",reference:Te,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 le(s){return{kind:"transformation",type:"brand",reference:le,async:!1,name:s,_run(n){return n}}}function ye(s,n){return{kind:"validation",type:"check",reference:ye,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 he(s,n){return{kind:"validation",type:"check",reference:he,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 xe=/^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u,ge=/[- ]/gu,ke=[/^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 Se(s){return{kind:"validation",type:"credit_card",reference:Se,async:!1,expects:null,requirement(n){let e;return xe.test(n)&&(e=n.replace(ge,""))&&ke.some(t=>t.test(e))&&E(e)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"credit card",n,e),n}}}function we(s){return{kind:"validation",type:"cuid2",reference:we,async:!1,expects:null,requirement:P,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"Cuid2",n,e),n}}}function Oe(s){return{kind:"validation",type:"decimal",reference:Oe,async:!1,expects:null,requirement:q,message:s,_run(n,e){return n.typed&&!this.requirement.test(n.value)&&u(this,"decimal",n,e),n}}}function Be(s){return{kind:"validation",type:"email",reference:Be,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 be(s){return{kind:"validation",type:"emoji",reference:be,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 Ee(s){return{kind:"validation",type:"empty",reference:Ee,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 Me(s,n){return{kind:"validation",type:"ends_with",reference:Me,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 Ae(s,n){return{kind:"validation",type:"every",reference:Ae,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 je(s,n){let e=f(s);return{kind:"validation",type:"excludes",reference:je,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 Re(s){return{kind:"validation",type:"finite",reference:Re,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 ve={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 _e(s,n){return{kind:"validation",type:"hash",reference:_e,expects:null,async:!1,requirement:RegExp(s.map(e=>`^[a-f0-9]{${ve[e]}}$`).join("|"),"iu"),message:n,_run(e,t){return e.typed&&!this.requirement.test(e.value)&&u(this,"hash",e,t),e}}}function Pe(s){return{kind:"validation",type:"hexadecimal",reference:Pe,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 qe(s){return{kind:"validation",type:"hex_color",reference:qe,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 De(s){return{kind:"validation",type:"imei",reference:De,async:!1,expects:null,requirement(n){return K.test(n)&&E(n)},message:s,_run(n,e){return n.typed&&!this.requirement(n.value)&&u(this,"IMEI",n,e),n}}}function Ne(s,n){let e=f(s);return{kind:"validation",type:"includes",reference:Ne,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 We(s){return{kind:"validation",type:"integer",reference:We,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 Ve(s){return{kind:"validation",type:"ip",reference:Ve,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 Ke(s){return{kind:"validation",type:"ipv4",reference:Ke,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 Le(s){return{kind:"validation",type:"ipv6",reference:Le,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 Ce(s){return{kind:"validation",type:"iso_date",reference:Ce,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 $e(s){return{kind:"validation",type:"iso_date_time",reference:$e,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 ze(s){return{kind:"validation",type:"iso_time",reference:ze,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 Ue(s){return{kind:"validation",type:"iso_time_second",reference:Ue,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 Fe(s){return{kind:"validation",type:"iso_timestamp",reference:Fe,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 Ge(s){return{kind:"validation",type:"iso_week",reference:Ge,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 Xe(s,n){return{kind:"validation",type:"length",reference:Xe,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 He(s){return{kind:"validation",type:"mac",reference:He,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 Je(s){return{kind:"validation",type:"mac48",reference:Je,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 Ze(s){return{kind:"validation",type:"mac64",reference:Ze,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 Qe(s,n){return{kind:"validation",type:"max_bytes",reference:Qe,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 Ye(s,n){return{kind:"validation",type:"max_length",reference:Ye,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 en(s,n){return{kind:"validation",type:"max_size",reference:en,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 nn(s,n){return{kind:"validation",type:"max_value",reference:nn,async:!1,expects:`<=${s instanceof Date?s.toJSON():f(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():f(e.value)}),e}}}function sn(s,n){return{kind:"validation",type:"mime_type",reference:sn,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 tn(s,n){return{kind:"validation",type:"min_bytes",reference:tn,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 rn(s,n){return{kind:"validation",type:"min_length",reference:rn,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 un(s,n){return{kind:"validation",type:"min_size",reference:un,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 an(s,n){return{kind:"validation",type:"min_value",reference:an,async:!1,expects:`>=${s instanceof Date?s.toJSON():f(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():f(e.value)}),e}}}function on(s,n){return{kind:"validation",type:"multiple_of",reference:on,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 cn(s){return{kind:"validation",type:"non_empty",reference:cn,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 pn(s,n){return{kind:"validation",type:"not_bytes",reference:pn,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 In(s,n){return{kind:"validation",type:"not_length",reference:In,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 mn(s,n){return{kind:"validation",type:"not_size",reference:mn,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 dn(s,n){return{kind:"validation",type:"not_value",reference:dn,async:!1,expects:s instanceof Date?`!${s.toJSON()}`:`!${f(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():f(e.value)}),e}}}function fn(s){return{kind:"validation",type:"octal",reference:fn,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 Tn(){return{kind:"transformation",type:"readonly",reference:Tn,async:!1,_run(s){return s}}}function ln(s,n){return{kind:"validation",type:"regex",reference:ln,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 yn(s){return{kind:"validation",type:"safe_integer",reference:yn,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 hn(s,n){return{kind:"validation",type:"size",reference:hn,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 xn(s,n){return{kind:"validation",type:"some",reference:xn,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 gn(s,n){return{kind:"validation",type:"starts_with",reference:gn,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 kn(){return{kind:"transformation",type:"to_lower_case",reference:kn,async:!1,_run(s){return s.value=s.value.toLowerCase(),s}}}function Sn(s){return{kind:"transformation",type:"to_max_value",reference:Sn,async:!1,requirement:s,_run(n){return n.value=n.value>this.requirement?this.requirement:n.value,n}}}function wn(s){return{kind:"transformation",type:"to_min_value",reference:wn,async:!1,requirement:s,_run(n){return n.value=n.value<this.requirement?this.requirement:n.value,n}}}function On(){return{kind:"transformation",type:"to_upper_case",reference:On,async:!1,_run(s){return s.value=s.value.toUpperCase(),s}}}function Bn(s){return{kind:"transformation",type:"transform",reference:Bn,async:!1,action:s,_run(n){return n.value=s(n.value),n}}}function bn(s){return{kind:"transformation",type:"transform",reference:bn,async:!0,action:s,async _run(n){return n.value=await s(n.value),n}}}function En(){return{kind:"transformation",type:"trim",reference:En,async:!1,_run(s){return s.value=s.value.trim(),s}}}function Mn(){return{kind:"transformation",type:"trim_end",reference:Mn,async:!1,_run(s){return s.value=s.value.trimEnd(),s}}}function An(){return{kind:"transformation",type:"trim_start",reference:An,async:!1,_run(s){return s.value=s.value.trimStart(),s}}}function jn(s){return{kind:"validation",type:"ulid",reference:jn,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 Rn(s){return{kind:"validation",type:"url",reference:Rn,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 vn(s){return{kind:"validation",type:"uuid",reference:vn,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 _n(s,n){return{kind:"validation",type:"value",reference:_n,async:!1,expects:s instanceof Date?s.toJSON():f(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():f(e.value)}),e}}}function sa(s,n){return{...s,_run(e,t){return s._run(e,{...t,...n})}}}function x(s,n,e){return typeof s.fallback=="function"?s.fallback(n,e):s.fallback}function aa(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 ca(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 Ia(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 da(s,n){return{...s,_run(e,t){let r=e.issues&&[...e.issues];if(s._run(e,t),e.issues){for(let o of e.issues)if(!r?.includes(o)){let i=e.value;for(let c of n){let a=i[c],p={type:"unknown",origin:"value",input:i,key:c,value:a};if(o.path?o.path.push(p):o.path=[p],!a)break;i=a}}}return e}}}function Ta(s,n){return{...s,async:!0,async _run(e,t){let r=e.issues&&[...e.issues];if(await s._run(e,t),e.issues){for(let o of e.issues)if(!r?.includes(o)){let i=e.value;for(let c of n){let a=i[c],p={type:"unknown",origin:"value",input:i,key:c,value:a};if(o.path?o.path.push(p):o.path=[p],!a)break;i=a}}}return e}}}function T(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):T(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)):T(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 ba(s,n){return!s._run({typed:!1,value:n},{abortEarly:!0}).issues}function Pn(){return{kind:"schema",type:"any",reference:Pn,expects:"any",async:!1,_run(s){return s.typed=!0,s}}}function qn(s,n){return{kind:"schema",type:"array",reference:qn,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 Dn(s,n){return{kind:"schema",type:"array",reference:Dn,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 Nn(s){return{kind:"schema",type:"bigint",reference:Nn,expects:"bigint",async:!1,message:s,_run(n,e){return typeof n.value=="bigint"?n.typed=!0:u(this,"type",n,e),n}}}function Wn(s){return{kind:"schema",type:"blob",reference:Wn,expects:"Blob",async:!1,message:s,_run(n,e){return n.value instanceof Blob?n.typed=!0:u(this,"type",n,e),n}}}function Vn(s){return{kind:"schema",type:"boolean",reference:Vn,expects:"boolean",async:!1,message:s,_run(n,e){return typeof n.value=="boolean"?n.typed=!0:u(this,"type",n,e),n}}}function Kn(s,n){return{kind:"schema",type:"custom",reference:Kn,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 Ln(s,n){return{kind:"schema",type:"custom",reference:Ln,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 Cn(s){return{kind:"schema",type:"date",reference:Cn,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 $n(s,n){let e=Object.entries(s).filter(([t])=>isNaN(+t)).map(([,t])=>t);return{kind:"schema",type:"enum",reference:$n,expects:e.map(f).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 zn(s,n){return{kind:"schema",type:"instance",reference:zn,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 Un(s,n){return{kind:"schema",type:"intersect",reference:Un,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 Fn(s,n){return{kind:"schema",type:"intersect",reference:Fn,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 Gn(s){return{kind:"schema",type:"lazy",reference:Gn,expects:"unknown",async:!1,getter:s,_run(n,e){return this.getter(n.value)._run(n,e)}}}function Xn(s){return{kind:"schema",type:"lazy",reference:Xn,expects:"unknown",async:!0,getter:s,async _run(n,e){return(await this.getter(n.value))._run(n,e)}}}function Hn(s,n){return{kind:"schema",type:"literal",reference:Hn,expects:f(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 Jn(s,n){return{kind:"schema",type:"loose_object",reference:Jn,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="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)l(o)&&!(o in this.entries)&&(e.value[o]=r[o])}else u(this,"type",e,t);return e}}}function Zn(s,n){return{kind:"schema",type:"loose_object",reference:Zn,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="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)l(i)&&!(i in this.entries)&&(e.value[i]=r[i])}else u(this,"type",e,t);return e}}}function Qn(s,n){return{kind:"schema",type:"loose_tuple",reference:Qn,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 Yn(s,n){return{kind:"schema",type:"loose_tuple",reference:Yn,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 es(s,n,e){return{kind:"schema",type:"map",reference:es,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 ns(s,n,e){return{kind:"schema",type:"map",reference:ns,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 ss(s){return{kind:"schema",type:"nan",reference:ss,expects:"NaN",async:!1,message:s,_run(n,e){return Number.isNaN(n.value)?n.typed=!0:u(this,"type",n,e),n}}}function ts(s){return{kind:"schema",type:"never",reference:ts,expects:"never",async:!1,message:s,_run(n,e){return u(this,"type",n,e),n}}}function rs(s,n){return{kind:"schema",type:"non_nullable",reference:rs,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 us(s,n){return{kind:"schema",type:"non_nullable",reference:us,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 as(s,n){return{kind:"schema",type:"non_nullish",reference:as,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 os(s,n){return{kind:"schema",type:"non_nullish",reference:os,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 is(s){return{kind:"schema",type:"null",reference:is,expects:"null",async:!1,message:s,_run(n,e){return n.value===null?n.typed=!0:u(this,"type",n,e),n}}}function cs(s,...n){let e={kind:"schema",type:"nullable",reference:cs,expects:`${s.expects} | null`,async:!1,wrapped:s,_run(t,r){return t.value===null&&("default"in this&&(t.value=T(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 ps(s,...n){let e={kind:"schema",type:"nullable",reference:ps,expects:`${s.expects} | null`,async:!0,wrapped:s,async _run(t,r){return t.value===null&&("default"in this&&(t.value=await T(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 Is(s,...n){let e={kind:"schema",type:"nullish",reference:Is,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=T(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 ms(s,...n){let e={kind:"schema",type:"nullish",reference:ms,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 T(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 ds(s){return{kind:"schema",type:"number",reference:ds,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 fs(s,n){return{kind:"schema",type:"object",reference:fs,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="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 Ts(s,n){return{kind:"schema",type:"object",reference:Ts,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="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 ls(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ls,expects:"Object",async:!1,entries:s,rest:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="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(l(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 ys(s,n,e){return{kind:"schema",type:"object_with_rest",reference:ys,expects:"Object",async:!0,entries:s,rest:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="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])=>l(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=T(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 T(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(f).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 hs(s,n,e){return{kind:"schema",type:"record",reference:hs,expects:"Object",async:!1,key:s,value:n,message:e,_run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};for(let i in o)if(l(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 xs(s,n,e){return{kind:"schema",type:"record",reference:xs,expects:"Object",async:!0,key:s,value:n,message:e,async _run(t,r){let o=t.value;if(o&&typeof o=="object"){t.typed=!0,t.value={};let i=await Promise.all(Object.entries(o).filter(([c])=>l(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 gs(s,n){return{kind:"schema",type:"set",reference:gs,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 ks(s,n){return{kind:"schema",type:"set",reference:ks,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 Ss(s,n){return{kind:"schema",type:"strict_object",reference:Ss,expects:"Object",async:!1,entries:s,message:n,_run(e,t){let r=e.value;if(r&&typeof r=="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 ws(s,n){return{kind:"schema",type:"strict_object",reference:ws,expects:"Object",async:!0,entries:s,message:n,async _run(e,t){let r=e.value;if(r&&typeof r=="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 Os(s,n){return{kind:"schema",type:"strict_tuple",reference:Os,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 Bs(s,n){return{kind:"schema",type:"strict_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)}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 bs(s){return{kind:"schema",type:"string",reference:bs,expects:"string",async:!1,message:s,_run(n,e){return typeof n.value=="string"?n.typed=!0:u(this,"type",n,e),n}}}function Es(s){return{kind:"schema",type:"symbol",reference:Es,expects:"symbol",async:!1,message:s,_run(n,e){return typeof n.value=="symbol"?n.typed=!0:u(this,"type",n,e),n}}}function Ms(s,n){return{kind:"schema",type:"tuple",reference:Ms,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 As(s,n){return{kind:"schema",type:"tuple",reference:As,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 js(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:js,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 Rs(s,n,e){return{kind:"schema",type:"tuple_with_rest",reference:Rs,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 vs(s){return{kind:"schema",type:"undefined",reference:vs,expects:"undefined",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function w(s){let n;if(s)for(let e of s)n?n.push(...e.issues):n=e.issues;return n}function _s(s,n){return{kind:"schema",type:"union",reference:_s,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:w(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:w(i)})}return e}}}function Ps(s,n){return{kind:"schema",type:"union",reference:Ps,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:w(o)}),e.typed=!0}else{if(i?.length===1)return i[0];u(this,"type",e,t,{issues:w(i)})}return e}}}function qs(){return{kind:"schema",type:"unknown",reference:qs,expects:"unknown",async:!1,_run(s){return s.typed=!0,s}}}function b(s,n,e=new Set){for(let t of n)t.type==="variant"?b(s,t.options,e):e.add(t.entries[s].expects);return e}function Ds(s,n,e){let t;return{kind:"schema",type:"variant",reference:Ds,expects:"Object",async:!1,key:s,options:n,message:e,_run(r,o){let i=r.value;if(i&&typeof i=="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=[...b(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 Ns(s,n,e){let t;return{kind:"schema",type:"variant",reference:Ns,expects:"Object",async:!0,key:s,options:n,message:e,async _run(r,o){let i=r.value;if(i&&typeof i=="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=[...b(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 Ws(s){return{kind:"schema",type:"void",reference:Ws,expects:"void",async:!1,message:s,_run(n,e){return n.value===void 0?n.typed=!0:u(this,"type",n,e),n}}}function nc(s,n){return v(Object.keys(s.entries),n)}function tc(s,n){let e={...s.entries};for(let t of n)delete e[t];return{...s,entries:e}}function ce(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 pe(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 mc(s,n){let e=t=>ce(s,t,n);return e.schema=s,e.config=n,e}function Tc(s,n){let e=t=>pe(s,t,n);return e.schema=s,e.config=n,e}function hc(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 kc(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 wc(s,n){let e={};for(let t of n)e[t]=s.entries[t];return{...s,entries:e}}function Bc(...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 Ec(...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 jc(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 _c(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 Ie(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 me(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 Kc(s,n){let e=t=>Ie(s,t,n);return e.schema=s,e.config=n,e}function $c(s,n){let e=t=>me(s,t,n);return e.schema=s,e.config=n,e}function Uc(s){return s.wrapped}export{_ as BIC_REGEX,P as CUID2_REGEX,q 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,l as _isAllowedObjectKey,E as _isLuhnAlgo,f as _stringify,Pn as any,qn as array,Dn as arrayAsync,fe as bic,Nn as bigint,Wn as blob,Vn as boolean,le as brand,Te as bytes,ye as check,he as checkAsync,sa as config,Se as creditCard,we as cuid2,Kn as custom,Ln as customAsync,Cn as date,Oe as decimal,Ls as deleteGlobalConfig,zs as deleteGlobalMessage,Gs as deleteSchemaMessage,Js as deleteSpecificMessage,Be as email,be as emoji,Ee as empty,Me as endsWith,rt as entriesFromList,$n as enum_,Ae as every,je as excludes,aa as fallback,ca as fallbackAsync,Re as finite,Ia as flatten,da as forward,Ta as forwardAsync,T 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,_e as hash,qe as hexColor,Pe as hexadecimal,De as imei,Ne as includes,zn as instance,We as integer,Un as intersect,Fn as intersectAsync,Ve as ip,Ke as ipv4,Le as ipv6,ba as is,at as isOfKind,it as isOfType,It as isValiError,Ce as isoDate,$e as isoDateTime,ze as isoTime,Ue as isoTimeSecond,Fe as isoTimestamp,Ge as isoWeek,nc as keyof,Gn as lazy,Xn as lazyAsync,Xe as length,Hn as literal,Jn as looseObject,Zn as looseObjectAsync,Qn as looseTuple,Yn as looseTupleAsync,He as mac,Je as mac48,Ze as mac64,es as map,ns as mapAsync,Qe as maxBytes,Ye as maxLength,en as maxSize,nn as maxValue,sn as mimeType,tn as minBytes,rn as minLength,un as minSize,an as minValue,on as multipleOf,ss as nan,ts as never,cn as nonEmpty,rs as nonNullable,us as nonNullableAsync,as as nonNullish,os as nonNullishAsync,M as nonOptional,A as nonOptionalAsync,pn as notBytes,In as notLength,mn as notSize,dn as notValue,is as null_,cs as nullable,ps as nullableAsync,Is as nullish,ms as nullishAsync,ds as number,fs as object,Ts as objectAsync,ls as objectWithRest,ys as objectWithRestAsync,fn as octal,tc as omit,j as optional,R as optionalAsync,ce as parse,pe as parseAsync,mc as parser,Tc as parserAsync,hc as partial,kc as partialAsync,wc as pick,v as picklist,Bc as pipe,Ec as pipeAsync,Tn as readonly,hs as record,xs as recordAsync,ln as regex,jc as required,_c as requiredAsync,yn as safeInteger,Ie as safeParse,me as safeParseAsync,Kc as safeParser,$c as safeParserAsync,gs as set,ks as setAsync,Ks as setGlobalConfig,$s as setGlobalMessage,Fs as setSchemaMessage,Hs as setSpecificMessage,hn as size,xn as some,gn as startsWith,Ss as strictObject,ws as strictObjectAsync,Os as strictTuple,Bs as strictTupleAsync,bs as string,Es as symbol,kn as toLowerCase,Sn as toMaxValue,wn as toMinValue,On as toUpperCase,Bn as transform,bn as transformAsync,En as trim,Mn as trimEnd,An as trimStart,Ms as tuple,As as tupleAsync,js as tupleWithRest,Rs as tupleWithRestAsync,jn as ulid,vs as undefined_,_s as union,Ps as unionAsync,qs as unknown,Uc as unwrap,Rn as url,vn as uuid,_n as value,Ds as variant,Ns as variantAsync,Ws as void_};
{
"name": "valibot",
"description": "The modular and type safe schema library for validating structural data",
"version": "0.31.0-rc.10",
"version": "0.31.0-rc.11",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": "Fabian Hiller",

Sorry, the diff of this file is not supported yet

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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc