@synnaxlabs/freighter 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +1,6 @@
1
- "use strict";var el=Object.defineProperty;var tl=(e,t,r)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var K=(e,t,r)=>tl(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nl=e=>{const t=e.replace(/_[a-z]/g,r=>r[1].toUpperCase());return t.length>1&&t[0]===t[0].toUpperCase()&&t[1]===t[1].toUpperCase()||t.length===0?t:t[0].toLowerCase()+t.slice(1)},ao=e=>{const t=(r,i=dn)=>{if(typeof r=="string")return e(r);if(Array.isArray(r))return r.map(s=>t(s,i));if(!an(r))return r;i=ol(i);const n={},o=r;return"toJSON"in o&&typeof o.toJSON=="function"?t(o.toJSON(),i):(Object.keys(o).forEach(s=>{let a=o[s];const u=e(s);i.recursive&&(an(a)?Ii(a,i.keepTypesOnRecursion)||(a=t(a,i)):i.recursiveInArray&&wi(a)&&(a=[...a].map(c=>{let f=c;return an(c)?Ii(f,i.keepTypesOnRecursion)||(f=t(c,i)):wi(c)&&(f=t({key:c},i).key),f}))),n[u]=a}),n)};return t},uo=ao(nl),rl=e=>e.replace(/([a-z0-9])([A-Z])/g,(t,r,i)=>`${r}_${i.toLowerCase()}`),il=ao(rl),dn={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},ol=(e=dn)=>(e.recursive==null?e=dn:e.recursiveInArray??(e.recursiveInArray=!1),e),wi=e=>e!=null&&Array.isArray(e),an=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),Ii=(e,t)=>(t||[]).some(r=>e instanceof r),sl=e=>e!=null&&typeof e=="object"&&!Array.isArray(e);var al=Object.defineProperty,ul=(e,t,r)=>t in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ot=(e,t,r)=>ul(e,typeof t!="symbol"?t+"":t,r);let cl=class{constructor(){ot(this,"contentType","application/json"),ot(this,"decoder"),ot(this,"encoder"),this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(t){return this.encoder.encode(this.encodeString(t))}decode(t,r){return this.decodeString(this.decoder.decode(t),r)}decodeString(t,r){const i=JSON.parse(t),n=uo(i);return r!=null?r.parse(n):n}encodeString(t){const r=il(t);return JSON.stringify(r,(i,n)=>ArrayBuffer.isView(n)?Array.from(n):typeof n=="bigint"?n.toString():n)}},ll=class{constructor(){ot(this,"contentType","text/csv")}encode(t){const r=this.encodeString(t);return new TextEncoder().encode(r)}decode(t,r){const i=new TextDecoder().decode(t);return this.decodeString(i,r)}encodeString(t){if(!Array.isArray(t)||t.length===0||!sl(t[0]))throw new Error("Payload must be an array of objects");const r=Object.keys(t[0]),i=[r.join(",")];return t.forEach(n=>{const o=r.map(s=>JSON.stringify(n[s]??""));i.push(o.join(","))}),i.join(`
2
- `)}decodeString(t,r){const[i,...n]=t.trim().split(`
3
- `).map(a=>a.trim());if(i.length===0)return r!=null?r.parse({}):{};const o=i.split(",").map(a=>a.trim()),s={};return o.forEach(a=>{s[a]=[]}),n.forEach(a=>{const u=a.split(",").map(c=>c.trim());o.forEach((c,f)=>{const d=this.parseValue(u[f]);d!=null&&s[c].push(d)})}),r!=null?r.parse(s):s}parseValue(t){if(t==null||t.length===0)return null;const r=Number(t);return isNaN(r)?t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t:r}},dl=class{constructor(){ot(this,"contentType","text/plain")}encode(t){if(typeof t!="string")throw new Error("TextCodec.encode payload must be a string");return new TextEncoder().encode(t)}decode(t,r){const i=new TextDecoder().decode(t);return r!=null?r.parse(i):i}};const fn=new cl;new ll;new dl;var fl=Object.defineProperty,ml=(e,t,r)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pl=(e,t,r)=>ml(e,t+"",r);let Ge=class{constructor(t){pl(this,"value"),this.value=t}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const hl=e=>e!=null&&typeof e=="object"&&"toString"in e,vl=(e,t=!1)=>{const r=hl(e)?"stringer":typeof e;let i;switch(r){case"string":i=(n,o)=>n.localeCompare(o);break;case"stringer":i=(n,o)=>n.toString().localeCompare(o.toString());break;case"number":i=(n,o)=>Number(n)-Number(o);break;case"bigint":i=(n,o)=>BigInt(n)-BigInt(o)>0n?1:-1;break;case"boolean":i=(n,o)=>Number(n)-Number(o);break;case"undefined":i=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return t?gl(i):i},gl=e=>(t,r)=>e(r,t);function l(e,t,r){function i(a,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var u;const c=r!=null&&r.Parent?new o:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const f of c._zod.deferred)f();return c}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var u,c;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(c=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}const co=Symbol("zod_brand");class Be extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Tt={};function ae(e){return e&&Object.assign(Tt,e),Tt}function yl(e){return e}function $l(e){return e}function bl(e){}function _l(e){throw new Error}function wl(e){}function Un(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function _(e,t="|"){return e.map(r=>T(r)).join(t)}function lo(e,t){return typeof t=="bigint"?t.toString():t}function Lt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function je(e){return e==null}function Bt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function fo(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}function E(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function qe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Il(e,t){return t?t.reduce((r,i)=>r==null?void 0:r[i],e):e}function kl(e){const t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{const n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function jn(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ae(e){return JSON.stringify(e)}function ct(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mo=Lt(()=>{if(typeof navigator<"u"&&navigator!=null&&navigator.userAgent.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ut(e){if(ct(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(ct(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ol(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const Sl=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},jt=new Set(["string","number","symbol"]),po=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function p(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function zl(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function T(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ho(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const vo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},go={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yo(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return he(e,{...e._zod.def,shape:r,checks:[]})}function $o(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return he(e,{...e._zod.def,shape:r,checks:[]})}function bo(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return qe(this,"shape",i),i},checks:[]};return he(e,r)}function _o(e,t){return he(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return qe(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function wo(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(const o in i)n[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return he(t,{...t._zod.def,shape:n,checks:[]})}function Io(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const o in r){if(!(o in n))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)n[o]=new e({type:"nonoptional",innerType:i[o]});return he(t,{...t._zod.def,shape:n,checks:[]})}function Me(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function le(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Qe(e){return typeof e=="string"?e:e==null?void 0:e.message}function fe(e,t,r){var i,n,o,s,a,u;const c={...e,path:e.path??[]};if(!e.message){const f=Qe((o=(n=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:n.error)==null?void 0:o.call(n,e))??Qe((s=t==null?void 0:t.error)==null?void 0:s.call(t,e))??Qe((a=r.customError)==null?void 0:a.call(r,e))??Qe((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";c.message=f}return delete c.inst,delete c.continue,t!=null&&t.reportInput||delete c.input,c}function Ft(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Jt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fe(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function xl(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}class Nl{constructor(...t){}}const Tl=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:go,Class:Nl,NUMBER_FORMAT_RANGES:vo,aborted:Me,allowsEval:mo,assert:wl,assertEqual:yl,assertIs:bl,assertNever:_l,assertNotEqual:$l,assignProp:qe,cached:Lt,cleanEnum:xl,cleanRegex:Bt,clone:he,createTransparentProxy:zl,defineLazy:E,esc:Ae,escapeRegex:Ee,extend:bo,finalizeIssue:fe,floatSafeRemainder:fo,getElementAtPath:Il,getEnumValues:Un,getLengthableOrigin:Jt,getParsedType:Sl,getSizableOrigin:Ft,isObject:ct,isPlainObject:Ut,issue:Fe,joinValues:_,jsonStringifyReplacer:lo,merge:_o,normalizeParams:p,nullish:je,numKeys:Ol,omit:$o,optionalKeys:ho,partial:wo,pick:yo,prefixIssues:le,primitiveTypes:po,promiseAllObject:kl,propertyKeyTypes:jt,randomString:jn,required:Io,stringifyPrimitive:T,unwrapMessage:Qe},Symbol.toStringTag,{value:"Module"})),ko=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,lo,2)},enumerable:!0})},En=l("$ZodError",ko),ht=l("$ZodError",ko,{Parent:Error});function Pn(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Zn(e,t){const r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let a=i,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return n(e),i}function Oo(e,t){const r=t||function(o){return o.message},i={errors:[]},n=(o,s=[])=>{var a,u;for(const c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(f=>n({issues:f},c.path));else if(c.code==="invalid_key")n({issues:c.issues},c.path);else if(c.code==="invalid_element")n({issues:c.issues},c.path);else{const f=[...s,...c.path];if(f.length===0){i.errors.push(r(c));continue}let d=i,y=0;for(;y<f.length;){const h=f[y],I=y===f.length-1;typeof h=="string"?(d.properties??(d.properties={}),(a=d.properties)[h]??(a[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(u=d.items)[h]??(u[h]={errors:[]}),d=d.items[h]),I&&d.errors.push(r(c)),y++}}};return n(e),i}function So(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function zo(e){var t;const r=[],i=[...e.issues].sort((n,o)=>n.path.length-o.path.length);for(const n of i)r.push(`✖ ${n.message}`),(t=n.path)!=null&&t.length&&r.push(` → at ${So(n.path)}`);return r.join(`
4
- `)}const Dn=e=>(t,r,i,n)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Be;if(s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(u=>fe(u,o,ae())));throw Error.captureStackTrace(a,n==null?void 0:n.callee),a}return s.value},mn=Dn(ht),An=e=>async(t,r,i,n)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(u=>fe(u,o,ae())));throw Error.captureStackTrace(a,n==null?void 0:n.callee),a}return s.value},pn=An(ht),Cn=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Be;return o.issues.length?{success:!1,error:new(e??En)(o.issues.map(s=>fe(s,n,ae())))}:{success:!0,data:o.value}},xo=Cn(ht),Rn=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>fe(s,n,ae())))}:{success:!0,data:o.value}},No=Rn(ht),To=/^[cC][^\s-]{8,}$/,Uo=/^[0-9a-z]+$/,jo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Eo=/^[0-9a-vA-V]{20}$/,Po=/^[A-Za-z0-9]{27}$/,Zo=/^[a-zA-Z0-9_-]{21}$/,Do=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ul=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ao=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Je=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,jl=Je(4),El=Je(6),Pl=Je(7),Co=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Dl=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Al=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Cl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ro="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Mo(){return new RegExp(Ro,"u")}const Lo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Fo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Jo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mn=/^[A-Za-z0-9_-]*$/,Wo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Rl=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Go=/^\+(?:[0-9]){6,14}[0-9]$/,qo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Yo=new RegExp(`^${qo}$`);function Ko(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xo(e){return new RegExp(`^${Ko(e)}$`)}function Ho(e){const t=Ko({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${qo}T(?:${i})$`)}const Qo=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},es=/^\d+n?$/,ts=/^\d+$/,ns=/^-?\d+(?:\.\d+)?/i,rs=/true|false/i,is=/null/i,os=/undefined/i,ss=/^[^A-Z]*$/,as=/^[^a-z]*$/,us=Object.freeze(Object.defineProperty({__proto__:null,_emoji:Ro,base64:Vo,base64url:Mn,bigint:es,boolean:rs,browserEmail:Cl,cidrv4:Fo,cidrv6:Jo,cuid:To,cuid2:Uo,date:Yo,datetime:Ho,domain:Rl,duration:Do,e164:Go,email:Co,emoji:Mo,extendedDuration:Ul,guid:Ao,hostname:Wo,html5Email:Zl,integer:ts,ipv4:Lo,ipv6:Bo,ksuid:Po,lowercase:ss,nanoid:Zo,null:is,number:ns,rfc5322Email:Dl,string:Qo,time:Xo,ulid:jo,undefined:os,unicodeEmail:Al,uppercase:as,uuid:Je,uuid4:jl,uuid6:El,uuid7:Pl,xid:Eo},Symbol.toStringTag,{value:"Module"})),Y=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),cs={number:"number",bigint:"bigint",object:"date"},Ln=l("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);const r=cs[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bn=l("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);const r=cs[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ls=l("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):fo(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ds=l("$ZodCheckNumberFormat",(e,t)=>{var r;Y.init(e,t),t.format=t.format||"float64";const i=(r=t.format)==null?void 0:r.includes("int"),n=i?"int":"number",[o,s]=vo[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=o,u.maximum=s,i&&(u.pattern=ts)}),e._zod.check=a=>{const u=a.value;if(i){if(!Number.isInteger(u)){a.issues.push({expected:n,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}u<o&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>s&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inst:e})}}),fs=l("$ZodCheckBigIntFormat",(e,t)=>{Y.init(e,t);const[r,i]=go[t.format];e._zod.onattach.push(n=>{const o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{const o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:e})}}),ms=l("$ZodCheckMaxSize",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:Ft(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),ps=l("$ZodCheckMinSize",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:Ft(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),hs=l("$ZodCheckSizeEquals",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,n=i.size;if(n===t.size)return;const o=n>t.size;r.issues.push({origin:Ft(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},input:r.value,inst:e,continue:!t.abort})}}),vs=l("$ZodCheckMaxLength",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const n=Jt(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),gs=l("$ZodCheckMinLength",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const n=Jt(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ys=l("$ZodCheckLengthEquals",(e,t)=>{Y.init(e,t),e._zod.when=r=>{const i=r.value;return!je(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const o=Jt(i),s=n>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),vt=l("$ZodCheckStringFormat",(e,t)=>{var r;Y.init(e,t),e._zod.onattach.push(i=>{const n=i._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),(r=e._zod).check??(r.check=i=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),$s=l("$ZodCheckRegex",(e,t)=>{vt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),bs=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ss),vt.init(e,t)}),_s=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=as),vt.init(e,t)}),ws=l("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);const r=Ee(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Is=l("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);const r=new RegExp(`^${Ee(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),ks=l("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);const r=new RegExp(`.*${Ee(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function ki(e,t,r){e.issues.length&&t.issues.push(...le(r,e.issues))}const Os=l("$ZodCheckProperty",(e,t)=>{Y.init(e,t),e._zod.check=r=>{const i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>ki(n,r,t.property));ki(i,r,t.property)}}),Ss=l("$ZodCheckMimeType",(e,t)=>{Y.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,path:["type"],inst:e})}}),zs=l("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class xs{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
5
- `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),n=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of n)this.content.push(o)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(n=>` ${n}`)];return new t(...r,i.join(`
6
- `))}}const Ns={major:4,minor:0,patch:0},z=l("$ZodType",(e,t)=>{var r,i;e??(e={}),E(e._zod,"id",()=>t.type+"_"+jn(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ns;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,u)=>{let c=Me(s),f;for(const d of a){if(d._zod.when){if(!d._zod.when(s))continue}else if(c)continue;const y=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Be;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==y&&(c||(c=Me(s,y)))});else{if(s.issues.length===y)continue;c||(c=Me(s,y))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new Be;return u.then(c=>o(c,n,a))}return o(u,n,a)}}e["~standard"]={validate:o=>{var s;try{const a=xo(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return No(e,o).then(a=>{var u;return a.success?{value:a.data}:{issues:(u=a.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),gt=l("$ZodString",(e,t)=>{var r;z.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Qo(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),L=l("$ZodStringFormat",(e,t)=>{vt.init(e,t),gt.init(e,t)}),Ts=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ao),L.init(e,t)}),Us=l("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Je(r))}else t.pattern??(t.pattern=Je());L.init(e,t)}),js=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Co),L.init(e,t)}),Es=l("$ZodURL",(e,t)=>{L.init(e,t),e._zod.check=r=>{try{const i=new URL(r.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Wo.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}));return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ps=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mo()),L.init(e,t)}),Zs=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Zo),L.init(e,t)}),Ds=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=To),L.init(e,t)}),As=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Uo),L.init(e,t)}),Cs=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jo),L.init(e,t)}),Rs=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Eo),L.init(e,t)}),Ms=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Po),L.init(e,t)}),Ls=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ho(t)),L.init(e,t),e._zod.check}),Bs=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yo),L.init(e,t)}),Fs=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Xo(t)),L.init(e,t),e._zod.check}),Js=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Do),L.init(e,t)}),Vs=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Lo),L.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv4"})}),Ws=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bo),L.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Gs=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fo),L.init(e,t)}),qs=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Jo),L.init(e,t),e._zod.check=r=>{const[i,n]=r.value.split("/");try{if(!n)throw new Error;const o=Number(n);if(`${o}`!==n)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Fn(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ys=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vo),L.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Fn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ks(e){if(!Mn.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fn(r)}const Xs=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mn),L.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{Ks(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Hs=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Go),L.init(e,t)});function Qs(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r,n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const ea=l("$ZodJWT",(e,t)=>{L.init(e,t),e._zod.check=r=>{Qs(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Jn=l("$ZodNumber",(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??ns,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),ta=l("$ZodNumber",(e,t)=>{ds.init(e,t),Jn.init(e,t)}),Vn=l("$ZodBoolean",(e,t)=>{z.init(e,t),e._zod.pattern=rs,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Wn=l("$ZodBigInt",(e,t)=>{z.init(e,t),e._zod.pattern=es,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}const{value:n}=r;return typeof n=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:n,inst:e}),r}}),na=l("$ZodBigInt",(e,t)=>{fs.init(e,t),Wn.init(e,t)}),ra=l("$ZodSymbol",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),ia=l("$ZodUndefined",(e,t)=>{z.init(e,t),e._zod.pattern=os,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),oa=l("$ZodNull",(e,t)=>{z.init(e,t),e._zod.pattern=is,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const{value:n}=r;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),sa=l("$ZodAny",(e,t)=>{z.init(e,t),e._zod.parse=r=>r}),Et=l("$ZodUnknown",(e,t)=>{z.init(e,t),e._zod.parse=r=>r}),aa=l("$ZodNever",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),ua=l("$ZodVoid",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ca=l("$ZodDate",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function Oi(e,t,r){e.issues.length&&t.issues.push(...le(r,e.issues)),t.value[r]=e.value}const Gn=l("$ZodArray",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const o=[];for(let s=0;s<n.length;s++){const a=n[s],u=t.element._zod.run({value:a,issues:[]},i);u instanceof Promise?o.push(u.then(c=>Oi(c,r,s))):Oi(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function _t(e,t,r){e.issues.length&&t.issues.push(...le(r,e.issues)),t.value[r]=e.value}function Si(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...le(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const la=l("$ZodObject",(e,t)=>{z.init(e,t);const r=Lt(()=>{const f=Object.keys(t.shape);for(const y of f)if(!(t.shape[y]instanceof z))throw new Error(`Invalid element at key "${y}": expected a Zod schema`);const d=ho(t.shape);return{shape:t.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(d)}});E(e._zod,"propValues",()=>{const f=t.shape,d={};for(const y in f){const h=f[y]._zod;if(h.values){d[y]??(d[y]=new Set);for(const I of h.values)d[y].add(I)}}return d});const i=f=>{const d=new xs(["shape","payload","ctx"]),{keys:y,optionalKeys:h}=r.value,I=b=>{const v=Ae(b);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};d.write("const input = payload.value;");const w=Object.create(null);for(const b of y)w[b]=jn(15);d.write("const newResult = {}");for(const b of y)if(h.has(b)){const v=w[b];d.write(`const ${v} = ${I(b)};`);const k=Ae(b);d.write(`
7
- if (${v}.issues.length) {
8
- if (input[${k}] === undefined) {
9
- if (${k} in input) {
10
- newResult[${k}] = undefined;
11
- }
12
- } else {
13
- payload.issues = payload.issues.concat(
14
- ${v}.issues.map((iss) => ({
15
- ...iss,
16
- path: iss.path ? [${k}, ...iss.path] : [${k}],
17
- }))
18
- );
19
- }
20
- } else if (${v}.value === undefined) {
21
- if (${k} in input) newResult[${k}] = undefined;
22
- } else {
23
- newResult[${k}] = ${v}.value;
24
- }
25
- `)}else{const v=w[b];d.write(`const ${v} = ${I(b)};`),d.write(`
26
- if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
27
- ...iss,
28
- path: iss.path ? [${Ae(b)}, ...iss.path] : [${Ae(b)}]
29
- })));`),d.write(`newResult[${Ae(b)}] = ${v}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");const m=d.compile();return(b,v)=>m(f,b,v)};let n;const o=ct,s=!Tt.jitless,a=s&&mo.value,{catchall:u}=t;let c;e._zod.parse=(f,d)=>{c??(c=r.value);const y=f.value;if(!o(y))return f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f;const h=[];if(s&&a&&(d==null?void 0:d.async)===!1&&d.jitless!==!0)n||(n=i(t.shape)),f=n(f,d);else{f.value={};const v=c.shape;for(const k of c.keys){const O=v[k],Z=O._zod.run({value:y[k],issues:[]},d),te=O._zod.optin==="optional"&&O._zod.optout==="optional";Z instanceof Promise?h.push(Z.then(_e=>te?Si(_e,f,k,y):_t(_e,f,k))):te?Si(Z,f,k,y):_t(Z,f,k)}}if(!u)return h.length?Promise.all(h).then(()=>f):f;const I=[],w=c.keySet,m=u._zod,b=m.def.type;for(const v of Object.keys(y)){if(w.has(v))continue;if(b==="never"){I.push(v);continue}const k=m.run({value:y[v],issues:[]},d);k instanceof Promise?h.push(k.then(O=>_t(O,f,v))):_t(k,f,v)}return I.length&&f.issues.push({code:"unrecognized_keys",keys:I,input:y,inst:e}),h.length?Promise.all(h).then(()=>f):f}});function zi(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(o=>fe(o,i,ae())))}),t}const qn=l("$ZodUnion",(e,t)=>{z.init(e,t),E(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),E(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>Bt(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const o=[];for(const s of t.options){const a=s._zod.run({value:r.value,issues:[]},i);if(a instanceof Promise)o.push(a),n=!0;else{if(a.issues.length===0)return a;o.push(a)}}return n?Promise.all(o).then(s=>zi(s,r,e,i)):zi(o,r,e,i)}}),da=l("$ZodDiscriminatedUnion",(e,t)=>{qn.init(e,t);const r=e._zod.parse;E(e._zod,"propValues",()=>{const n={};for(const o of t.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[a,u]of Object.entries(s)){n[a]||(n[a]=new Set);for(const c of u)n[a].add(c)}}return n});const i=Lt(()=>{const n=t.options,o=new Map;for(const s of n){const a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(n,o)=>{const s=n.value;if(!ct(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;const a=i.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),n)}}),fa=l("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([a,u])=>xi(r,a,u)):xi(r,o,s)}});function hn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ut(e)&&Ut(t)){const r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(const o of i){const s=hn(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],o=t[i],s=hn(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function xi(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Me(e))return e;const i=hn(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Vt=l("$ZodTuple",(e,t)=>{z.init(e,t);const r=t.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];const a=[];if(!t.rest){const c=s.length>r.length,f=s.length<i-1;if(c||f)return n.issues.push({input:s,inst:e,origin:"array",...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let u=-1;for(const c of r){if(u++,u>=s.length&&u>=i)continue;const f=c._zod.run({value:s[u],issues:[]},o);f instanceof Promise?a.push(f.then(d=>wt(d,n,u))):wt(f,n,u)}if(t.rest){const c=s.slice(r.length);for(const f of c){u++;const d=t.rest._zod.run({value:f,issues:[]},o);d instanceof Promise?a.push(d.then(y=>wt(y,n,u))):wt(d,n,u)}}return a.length?Promise.all(a).then(()=>n):n}});function wt(e,t,r){e.issues.length&&t.issues.push(...le(r,e.issues)),t.value[r]=e.value}const ma=l("$ZodRecord",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Ut(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const o=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;r.value={};for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:n[u],issues:[]},i);c instanceof Promise?o.push(c.then(f=>{f.issues.length&&r.issues.push(...le(u,f.issues)),r.value[u]=f.value})):(c.issues.length&&r.issues.push(...le(u,c.issues)),r.value[u]=c.value)}let a;for(const u in n)s.has(u)||(a=a??[],a.push(u));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:a})}else{r.value={};for(const s of Reflect.ownKeys(n)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(c=>fe(c,i,ae())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:n[s],issues:[]},i);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&r.issues.push(...le(s,c.issues)),r.value[a.value]=c.value})):(u.issues.length&&r.issues.push(...le(s,u.issues)),r.value[a.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),pa=l("$ZodMap",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const o=[];r.value=new Map;for(const[s,a]of n){const u=t.keyType._zod.run({value:s,issues:[]},i),c=t.valueType._zod.run({value:a,issues:[]},i);u instanceof Promise||c instanceof Promise?o.push(Promise.all([u,c]).then(([f,d])=>{Ni(f,d,r,s,n,e,i)})):Ni(u,c,r,s,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Ni(e,t,r,i,n,o,s){e.issues.length&&(jt.has(typeof i)?r.issues.push(...le(i,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:e.issues.map(a=>fe(a,s,ae()))})),t.issues.length&&(jt.has(typeof i)?r.issues.push(...le(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(a=>fe(a,s,ae()))})),r.value.set(e.value,t.value)}const ha=l("$ZodSet",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const o=[];r.value=new Set;for(const s of n){const a=t.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(u=>Ti(u,r))):Ti(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function Ti(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const va=l("$ZodEnum",(e,t)=>{z.init(e,t);const r=Un(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>jt.has(typeof i)).map(i=>typeof i=="string"?Ee(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const o=i.value;return e._zod.values.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:e}),i}}),ga=l("$ZodLiteral",(e,t)=>{z.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ee(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const n=r.value;return e._zod.values.has(n)||r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),ya=l("$ZodFile",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Yn=l("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(o=>(r.value=o,r));if(n instanceof Promise)throw new Be;return r.value=n,r}}),$a=l("$ZodOptional",(e,t)=>{z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",E(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),E(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Bt(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),ba=l("$ZodNullable",(e,t)=>{z.init(e,t),E(e._zod,"optin",()=>t.innerType._zod.optin),E(e._zod,"optout",()=>t.innerType._zod.optout),E(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Bt(r.source)}|null)$`):void 0}),E(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),_a=l("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Ui(o,t)):Ui(n,t)}});function Ui(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wa=l("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),Ia=l("$ZodNonOptional",(e,t)=>{z.init(e,t),E(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ji(o,e)):ji(n,e)}});function ji(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ka=l("$ZodSuccess",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Oa=l("$ZodCatch",(e,t)=>{z.init(e,t),E(e._zod,"optin",()=>t.innerType._zod.optin),E(e._zod,"optout",()=>t.innerType._zod.optout),E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>fe(s,i,ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>fe(o,i,ae()))},input:r.value}),r.issues=[]),r)}}),Sa=l("$ZodNaN",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Kn=l("$ZodPipe",(e,t)=>{z.init(e,t),E(e._zod,"values",()=>t.in._zod.values),E(e._zod,"optin",()=>t.in._zod.optin),E(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Ei(o,t,i)):Ei(n,t,i)}});function Ei(e,t,r){return Me(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const za=l("$ZodReadonly",(e,t)=>{z.init(e,t),E(e._zod,"propValues",()=>t.innerType._zod.propValues),E(e._zod,"optin",()=>t.innerType._zod.optin),E(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(Pi):Pi(n)}});function Pi(e){return e.value=Object.freeze(e.value),e}const xa=l("$ZodTemplateLiteral",(e,t)=>{z.init(e,t);const r=[];for(const i of t.parts)if(i instanceof z){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||po.has(typeof i))r.push(Ee(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i)}),Na=l("$ZodPromise",(e,t)=>{z.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),Ta=l("$ZodLazy",(e,t)=>{z.init(e,t),E(e._zod,"innerType",()=>t.getter()),E(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),E(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),E(e._zod,"optin",()=>e._zod.innerType._zod.optin),E(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),Ua=l("$ZodCustom",(e,t)=>{Y.init(e,t),z.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>Zi(o,r,i,e));Zi(n,r,i,e)}});function Zi(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(Fe(n))}}const ja=Symbol("ZodOutput"),Ea=Symbol("ZodInput");class Xn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function Hn(){return new Xn}const we=Hn();function Pa(e,t){return new e({type:"string",...p(t)})}function Za(e,t){return new e({type:"string",coerce:!0,...p(t)})}function Qn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...p(t)})}function Pt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...p(t)})}function er(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...p(t)})}function tr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...p(t)})}function nr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...p(t)})}function rr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...p(t)})}function ir(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...p(t)})}function or(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...p(t)})}function sr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...p(t)})}function ar(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...p(t)})}function ur(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...p(t)})}function cr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...p(t)})}function lr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...p(t)})}function dr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...p(t)})}function fr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...p(t)})}function mr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...p(t)})}function pr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...p(t)})}function hr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...p(t)})}function vr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...p(t)})}function gr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...p(t)})}function yr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...p(t)})}function $r(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...p(t)})}const Da={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Aa(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...p(t)})}function Ca(e,t){return new e({type:"string",format:"date",check:"string_format",...p(t)})}function Ra(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...p(t)})}function Ma(e,t){return new e({type:"string",format:"duration",check:"string_format",...p(t)})}function La(e,t){return new e({type:"number",checks:[],...p(t)})}function Ba(e,t){return new e({type:"number",coerce:!0,checks:[],...p(t)})}function Fa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...p(t)})}function Ja(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...p(t)})}function Va(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...p(t)})}function Wa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...p(t)})}function Ga(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...p(t)})}function qa(e,t){return new e({type:"boolean",...p(t)})}function Ya(e,t){return new e({type:"boolean",coerce:!0,...p(t)})}function Ka(e,t){return new e({type:"bigint",...p(t)})}function Xa(e,t){return new e({type:"bigint",coerce:!0,...p(t)})}function Ha(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...p(t)})}function Qa(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...p(t)})}function eu(e,t){return new e({type:"symbol",...p(t)})}function tu(e,t){return new e({type:"undefined",...p(t)})}function nu(e,t){return new e({type:"null",...p(t)})}function ru(e){return new e({type:"any"})}function Zt(e){return new e({type:"unknown"})}function iu(e,t){return new e({type:"never",...p(t)})}function ou(e,t){return new e({type:"void",...p(t)})}function su(e,t){return new e({type:"date",...p(t)})}function au(e,t){return new e({type:"date",coerce:!0,...p(t)})}function uu(e,t){return new e({type:"nan",...p(t)})}function ke(e,t){return new Ln({check:"less_than",...p(t),value:e,inclusive:!1})}function de(e,t){return new Ln({check:"less_than",...p(t),value:e,inclusive:!0})}function Oe(e,t){return new Bn({check:"greater_than",...p(t),value:e,inclusive:!1})}function ue(e,t){return new Bn({check:"greater_than",...p(t),value:e,inclusive:!0})}function cu(e){return Oe(0,e)}function lu(e){return ke(0,e)}function du(e){return de(0,e)}function fu(e){return ue(0,e)}function lt(e,t){return new ls({check:"multiple_of",...p(t),value:e})}function Wt(e,t){return new ms({check:"max_size",...p(t),maximum:e})}function dt(e,t){return new ps({check:"min_size",...p(t),minimum:e})}function br(e,t){return new hs({check:"size_equals",...p(t),size:e})}function Gt(e,t){return new vs({check:"max_length",...p(t),maximum:e})}function Ve(e,t){return new gs({check:"min_length",...p(t),minimum:e})}function qt(e,t){return new ys({check:"length_equals",...p(t),length:e})}function _r(e,t){return new $s({check:"string_format",format:"regex",...p(t),pattern:e})}function wr(e){return new bs({check:"string_format",format:"lowercase",...p(e)})}function Ir(e){return new _s({check:"string_format",format:"uppercase",...p(e)})}function kr(e,t){return new ws({check:"string_format",format:"includes",...p(t),includes:e})}function Or(e,t){return new Is({check:"string_format",format:"starts_with",...p(t),prefix:e})}function Sr(e,t){return new ks({check:"string_format",format:"ends_with",...p(t),suffix:e})}function mu(e,t,r){return new Os({check:"property",property:e,schema:t,...p(r)})}function zr(e,t){return new Ss({check:"mime_type",mime:e,...p(t)})}function Pe(e){return new zs({check:"overwrite",tx:e})}function xr(e){return Pe(t=>t.normalize(e))}function Nr(){return Pe(e=>e.trim())}function Tr(){return Pe(e=>e.toLowerCase())}function Ur(){return Pe(e=>e.toUpperCase())}function jr(e,t,r){return new e({type:"array",element:t,...p(r)})}function Ml(e,t,r){return new e({type:"union",options:t,...p(r)})}function Ll(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...p(i)})}function Bl(e,t,r){return new e({type:"intersection",left:t,right:r})}function pu(e,t,r,i){const n=r instanceof z,o=n?i:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...p(o)})}function Fl(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...p(i)})}function Jl(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...p(i)})}function Vl(e,t,r){return new e({type:"set",valueType:t,...p(r)})}function Wl(e,t,r){const i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...p(r)})}function Gl(e,t,r){return new e({type:"enum",entries:t,...p(r)})}function ql(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...p(r)})}function hu(e,t){return new e({type:"file",...p(t)})}function Yl(e,t){return new e({type:"transform",transform:t})}function Kl(e,t){return new e({type:"optional",innerType:t})}function Xl(e,t){return new e({type:"nullable",innerType:t})}function Hl(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function Ql(e,t,r){return new e({type:"nonoptional",innerType:t,...p(r)})}function ed(e,t){return new e({type:"success",innerType:t})}function td(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function nd(e,t,r){return new e({type:"pipe",in:t,out:r})}function rd(e,t){return new e({type:"readonly",innerType:t})}function id(e,t,r){return new e({type:"template_literal",parts:t,...p(r)})}function od(e,t){return new e({type:"lazy",getter:t})}function sd(e,t){return new e({type:"promise",innerType:t})}function vu(e,t,r){const i=p(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function gu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...p(r)})}function yu(e,t){const{case:r,error:i,truthy:n,falsy:o}=p(t);let s=n??["true","1","yes","on","y","enabled"],a=o??["false","0","no","off","n","disabled"];r!=="sensitive"&&(s=s.map(m=>typeof m=="string"?m.toLowerCase():m),a=a.map(m=>typeof m=="string"?m.toLowerCase():m));const u=new Set(s),c=new Set(a),f=e.Pipe??Kn,d=e.Boolean??Vn,y=e.String??gt,h=e.Transform??Yn,I=new h({type:"transform",transform:(m,b)=>{let v=m;return r!=="sensitive"&&(v=v.toLowerCase()),u.has(v)?!0:c.has(v)?!1:(b.issues.push({code:"invalid_value",expected:"stringbool",values:[...u,...c],input:b.value,inst:I}),{})},error:i}),w=new f({type:"pipe",in:new y({type:"string",error:i}),out:I,error:i});return new f({type:"pipe",in:w,out:new d({type:"boolean",error:i}),error:i})}const Er=l("ZodISODateTime",(e,t)=>{Ls.init(e,t),B.init(e,t)});function $u(e){return Aa(Er,e)}const Pr=l("ZodISODate",(e,t)=>{Bs.init(e,t),B.init(e,t)});function bu(e){return Ca(Pr,e)}const Zr=l("ZodISOTime",(e,t)=>{Fs.init(e,t),B.init(e,t)});function _u(e){return Ra(Zr,e)}const Dr=l("ZodISODuration",(e,t)=>{Js.init(e,t),B.init(e,t)});function wu(e){return Ma(Dr,e)}const ad=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Pr,ZodISODateTime:Er,ZodISODuration:Dr,ZodISOTime:Zr,date:bu,datetime:$u,duration:wu,time:_u},Symbol.toStringTag,{value:"Module"})),Iu=(e,t)=>{En.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Zn(e,r)},flatten:{value:r=>Pn(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},ud=l("ZodError",Iu),yt=l("ZodError",Iu,{Parent:Error}),ku=Dn(yt),Ou=An(yt),Su=Cn(yt),zu=Rn(yt),j=l("ZodType",(e,t)=>(z.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>he(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>ku(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Su(e,r,i),e.parseAsync=async(r,i)=>Ou(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>zu(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(lc(r,i)),e.superRefine=r=>e.check(dc(r)),e.overwrite=r=>e.check(Pe(r)),e.optional=()=>At(e),e.nullable=()=>Ct(e),e.nullish=()=>At(Ct(e)),e.nonoptional=r=>Hu(e,r),e.array=()=>$t(e),e.or=r=>V([e,r]),e.and=r=>Mu(e,r),e.transform=r=>Rt(e,ui(r)),e.default=r=>Yu(e,r),e.prefault=r=>Xu(e,r),e.catch=r=>tc(e,r),e.pipe=r=>Rt(e,r),e.readonly=()=>ic(e),e.describe=r=>{const i=e.clone();return we.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=we.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return we.get(e);const i=e.clone();return we.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ar=l("_ZodString",(e,t)=>{gt.init(e,t),j.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(_r(...i)),e.includes=(...i)=>e.check(kr(...i)),e.startsWith=(...i)=>e.check(Or(...i)),e.endsWith=(...i)=>e.check(Sr(...i)),e.min=(...i)=>e.check(Ve(...i)),e.max=(...i)=>e.check(Gt(...i)),e.length=(...i)=>e.check(qt(...i)),e.nonempty=(...i)=>e.check(Ve(1,...i)),e.lowercase=i=>e.check(wr(i)),e.uppercase=i=>e.check(Ir(i)),e.trim=()=>e.check(Nr()),e.normalize=(...i)=>e.check(xr(...i)),e.toLowerCase=()=>e.check(Tr()),e.toUpperCase=()=>e.check(Ur())}),Yt=l("ZodString",(e,t)=>{gt.init(e,t),Ar.init(e,t),e.email=r=>e.check(Qn(Cr,r)),e.url=r=>e.check(ir(Rr,r)),e.jwt=r=>e.check($r(ei,r)),e.emoji=r=>e.check(or(Mr,r)),e.guid=r=>e.check(Pt(Dt,r)),e.uuid=r=>e.check(er(ge,r)),e.uuidv4=r=>e.check(tr(ge,r)),e.uuidv6=r=>e.check(nr(ge,r)),e.uuidv7=r=>e.check(rr(ge,r)),e.nanoid=r=>e.check(sr(Lr,r)),e.guid=r=>e.check(Pt(Dt,r)),e.cuid=r=>e.check(ar(Br,r)),e.cuid2=r=>e.check(ur(Fr,r)),e.ulid=r=>e.check(cr(Jr,r)),e.base64=r=>e.check(vr(Xr,r)),e.base64url=r=>e.check(gr(Hr,r)),e.xid=r=>e.check(lr(Vr,r)),e.ksuid=r=>e.check(dr(Wr,r)),e.ipv4=r=>e.check(fr(Gr,r)),e.ipv6=r=>e.check(mr(qr,r)),e.cidrv4=r=>e.check(pr(Yr,r)),e.cidrv6=r=>e.check(hr(Kr,r)),e.e164=r=>e.check(yr(Qr,r)),e.datetime=r=>e.check($u(r)),e.date=r=>e.check(bu(r)),e.time=r=>e.check(_u(r)),e.duration=r=>e.check(wu(r))});function J(e){return Pa(Yt,e)}const B=l("ZodStringFormat",(e,t)=>{L.init(e,t),Ar.init(e,t)}),Cr=l("ZodEmail",(e,t)=>{js.init(e,t),B.init(e,t)});function cd(e){return Qn(Cr,e)}const Dt=l("ZodGUID",(e,t)=>{Ts.init(e,t),B.init(e,t)});function ld(e){return Pt(Dt,e)}const ge=l("ZodUUID",(e,t)=>{Us.init(e,t),B.init(e,t)});function dd(e){return er(ge,e)}function fd(e){return tr(ge,e)}function md(e){return nr(ge,e)}function pd(e){return rr(ge,e)}const Rr=l("ZodURL",(e,t)=>{Es.init(e,t),B.init(e,t)});function hd(e){return ir(Rr,e)}const Mr=l("ZodEmoji",(e,t)=>{Ps.init(e,t),B.init(e,t)});function vd(e){return or(Mr,e)}const Lr=l("ZodNanoID",(e,t)=>{Zs.init(e,t),B.init(e,t)});function gd(e){return sr(Lr,e)}const Br=l("ZodCUID",(e,t)=>{Ds.init(e,t),B.init(e,t)});function yd(e){return ar(Br,e)}const Fr=l("ZodCUID2",(e,t)=>{As.init(e,t),B.init(e,t)});function $d(e){return ur(Fr,e)}const Jr=l("ZodULID",(e,t)=>{Cs.init(e,t),B.init(e,t)});function bd(e){return cr(Jr,e)}const Vr=l("ZodXID",(e,t)=>{Rs.init(e,t),B.init(e,t)});function _d(e){return lr(Vr,e)}const Wr=l("ZodKSUID",(e,t)=>{Ms.init(e,t),B.init(e,t)});function wd(e){return dr(Wr,e)}const Gr=l("ZodIPv4",(e,t)=>{Vs.init(e,t),B.init(e,t)});function Id(e){return fr(Gr,e)}const qr=l("ZodIPv6",(e,t)=>{Ws.init(e,t),B.init(e,t)});function kd(e){return mr(qr,e)}const Yr=l("ZodCIDRv4",(e,t)=>{Gs.init(e,t),B.init(e,t)});function Od(e){return pr(Yr,e)}const Kr=l("ZodCIDRv6",(e,t)=>{qs.init(e,t),B.init(e,t)});function Sd(e){return hr(Kr,e)}const Xr=l("ZodBase64",(e,t)=>{Ys.init(e,t),B.init(e,t)});function zd(e){return vr(Xr,e)}const Hr=l("ZodBase64URL",(e,t)=>{Xs.init(e,t),B.init(e,t)});function xd(e){return gr(Hr,e)}const Qr=l("ZodE164",(e,t)=>{Hs.init(e,t),B.init(e,t)});function Nd(e){return yr(Qr,e)}const ei=l("ZodJWT",(e,t)=>{ea.init(e,t),B.init(e,t)});function Td(e){return $r(ei,e)}const Kt=l("ZodNumber",(e,t)=>{Jn.init(e,t),j.init(e,t),e.gt=(i,n)=>e.check(Oe(i,n)),e.gte=(i,n)=>e.check(ue(i,n)),e.min=(i,n)=>e.check(ue(i,n)),e.lt=(i,n)=>e.check(ke(i,n)),e.lte=(i,n)=>e.check(de(i,n)),e.max=(i,n)=>e.check(de(i,n)),e.int=i=>e.check(vn(i)),e.safe=i=>e.check(vn(i)),e.positive=i=>e.check(Oe(0,i)),e.nonnegative=i=>e.check(ue(0,i)),e.negative=i=>e.check(ke(0,i)),e.nonpositive=i=>e.check(de(0,i)),e.multipleOf=(i,n)=>e.check(lt(i,n)),e.step=(i,n)=>e.check(lt(i,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function U(e){return La(Kt,e)}const Ye=l("ZodNumberFormat",(e,t)=>{ta.init(e,t),Kt.init(e,t)});function vn(e){return Fa(Ye,e)}function Ud(e){return Ja(Ye,e)}function jd(e){return Va(Ye,e)}function Ed(e){return Wa(Ye,e)}function Pd(e){return Ga(Ye,e)}const Xt=l("ZodBoolean",(e,t)=>{Vn.init(e,t),j.init(e,t)});function ti(e){return qa(Xt,e)}const Ht=l("ZodBigInt",(e,t)=>{Wn.init(e,t),j.init(e,t),e.gte=(i,n)=>e.check(ue(i,n)),e.min=(i,n)=>e.check(ue(i,n)),e.gt=(i,n)=>e.check(Oe(i,n)),e.gte=(i,n)=>e.check(ue(i,n)),e.min=(i,n)=>e.check(ue(i,n)),e.lt=(i,n)=>e.check(ke(i,n)),e.lte=(i,n)=>e.check(de(i,n)),e.max=(i,n)=>e.check(de(i,n)),e.positive=i=>e.check(Oe(BigInt(0),i)),e.negative=i=>e.check(ke(BigInt(0),i)),e.nonpositive=i=>e.check(de(BigInt(0),i)),e.nonnegative=i=>e.check(ue(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(lt(i,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Se(e){return Ka(Ht,e)}const ni=l("ZodBigIntFormat",(e,t)=>{na.init(e,t),Ht.init(e,t)});function Zd(e){return Ha(ni,e)}function Dd(e){return Qa(ni,e)}const xu=l("ZodSymbol",(e,t)=>{ra.init(e,t),j.init(e,t)});function Nu(e){return eu(xu,e)}const Tu=l("ZodUndefined",(e,t)=>{ia.init(e,t),j.init(e,t)});function Uu(e){return tu(Tu,e)}const ju=l("ZodNull",(e,t)=>{oa.init(e,t),j.init(e,t)});function ri(e){return nu(ju,e)}const Eu=l("ZodAny",(e,t)=>{sa.init(e,t),j.init(e,t)});function Ad(){return ru(Eu)}const Pu=l("ZodUnknown",(e,t)=>{Et.init(e,t),j.init(e,t)});function We(){return Zt(Pu)}const Zu=l("ZodNever",(e,t)=>{aa.init(e,t),j.init(e,t)});function Qt(e){return iu(Zu,e)}const Du=l("ZodVoid",(e,t)=>{ua.init(e,t),j.init(e,t)});function Cd(e){return ou(Du,e)}const ii=l("ZodDate",(e,t)=>{ca.init(e,t),j.init(e,t),e.min=(i,n)=>e.check(ue(i,n)),e.max=(i,n)=>e.check(de(i,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Rd(e){return su(ii,e)}const Au=l("ZodArray",(e,t)=>{Gn.init(e,t),j.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Ve(r,i)),e.nonempty=r=>e.check(Ve(1,r)),e.max=(r,i)=>e.check(Gt(r,i)),e.length=(r,i)=>e.check(qt(r,i)),e.unwrap=()=>e.element});function $t(e,t){return jr(Au,e,t)}function Md(e){const t=e._zod.def.shape;return Vu(Object.keys(t))}const en=l("ZodObject",(e,t)=>{la.init(e,t),j.init(e,t),E(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>ee(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:We()}),e.loose=()=>e.clone({...e._zod.def,catchall:We()}),e.strict=()=>e.clone({...e._zod.def,catchall:Qt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>bo(e,r),e.merge=r=>_o(e,r),e.pick=r=>yo(e,r),e.omit=r=>$o(e,r),e.partial=(...r)=>wo(ci,e,r[0]),e.required=(...r)=>Io(li,e,r[0])});function C(e,t){const r={type:"object",get shape(){return qe(this,"shape",{...e}),this.shape},...p(t)};return new en(r)}function Ld(e,t){return new en({type:"object",get shape(){return qe(this,"shape",{...e}),this.shape},catchall:Qt(),...p(t)})}function Bd(e,t){return new en({type:"object",get shape(){return qe(this,"shape",{...e}),this.shape},catchall:We(),...p(t)})}const oi=l("ZodUnion",(e,t)=>{qn.init(e,t),j.init(e,t),e.options=t.options});function V(e,t){return new oi({type:"union",options:e,...p(t)})}const Cu=l("ZodDiscriminatedUnion",(e,t)=>{oi.init(e,t),da.init(e,t)});function Fd(e,t,r){return new Cu({type:"union",options:t,discriminator:e,...p(r)})}const Ru=l("ZodIntersection",(e,t)=>{fa.init(e,t),j.init(e,t)});function Mu(e,t){return new Ru({type:"intersection",left:e,right:t})}const Lu=l("ZodTuple",(e,t)=>{Vt.init(e,t),j.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Ke(e,t,r){const i=t instanceof z,n=i?r:t,o=i?t:null;return new Lu({type:"tuple",items:e,rest:o,...p(n)})}const si=l("ZodRecord",(e,t)=>{ma.init(e,t),j.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function tn(e,t,r){return new si({type:"record",keyType:e,valueType:t,...p(r)})}function Jd(e,t,r){return new si({type:"record",keyType:V([e,Qt()]),valueType:t,...p(r)})}const Bu=l("ZodMap",(e,t)=>{pa.init(e,t),j.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Vd(e,t,r){return new Bu({type:"map",keyType:e,valueType:t,...p(r)})}const Fu=l("ZodSet",(e,t)=>{ha.init(e,t),j.init(e,t),e.min=(...r)=>e.check(dt(...r)),e.nonempty=r=>e.check(dt(1,r)),e.max=(...r)=>e.check(Wt(...r)),e.size=(...r)=>e.check(br(...r))});function Wd(e,t){return new Fu({type:"set",valueType:e,...p(t)})}const ft=l("ZodEnum",(e,t)=>{va.init(e,t),j.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const o={};for(const s of i)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ft({...t,checks:[],...p(n),entries:o})},e.exclude=(i,n)=>{const o={...t.entries};for(const s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ft({...t,checks:[],...p(n),entries:o})}});function ee(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ft({type:"enum",entries:r,...p(t)})}function Gd(e,t){return new ft({type:"enum",entries:e,...p(t)})}const Ju=l("ZodLiteral",(e,t)=>{ga.init(e,t),j.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Vu(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...p(t)})}const Wu=l("ZodFile",(e,t)=>{ya.init(e,t),j.init(e,t),e.min=(r,i)=>e.check(dt(r,i)),e.max=(r,i)=>e.check(Wt(r,i)),e.mime=(r,i)=>e.check(zr(Array.isArray(r)?r:[r],i))});function qd(e){return hu(Wu,e)}const ai=l("ZodTransform",(e,t)=>{Yn.init(e,t),j.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=o=>{if(typeof o=="string")r.issues.push(Fe(o,r.value,t));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(Fe(s))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function ui(e){return new ai({type:"transform",transform:e})}const ci=l("ZodOptional",(e,t)=>{$a.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function At(e){return new ci({type:"optional",innerType:e})}const Gu=l("ZodNullable",(e,t)=>{ba.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ct(e){return new Gu({type:"nullable",innerType:e})}function Yd(e){return At(Ct(e))}const qu=l("ZodDefault",(e,t)=>{_a.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yu(e,t){return new qu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Ku=l("ZodPrefault",(e,t)=>{wa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xu(e,t){return new Ku({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const li=l("ZodNonOptional",(e,t)=>{Ia.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hu(e,t){return new li({type:"nonoptional",innerType:e,...p(t)})}const Qu=l("ZodSuccess",(e,t)=>{ka.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Kd(e){return new Qu({type:"success",innerType:e})}const ec=l("ZodCatch",(e,t)=>{Oa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tc(e,t){return new ec({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const nc=l("ZodNaN",(e,t)=>{Sa.init(e,t),j.init(e,t)});function Xd(e){return uu(nc,e)}const di=l("ZodPipe",(e,t)=>{Kn.init(e,t),j.init(e,t),e.in=t.in,e.out=t.out});function Rt(e,t){return new di({type:"pipe",in:e,out:t})}const rc=l("ZodReadonly",(e,t)=>{za.init(e,t),j.init(e,t)});function ic(e){return new rc({type:"readonly",innerType:e})}const oc=l("ZodTemplateLiteral",(e,t)=>{xa.init(e,t),j.init(e,t)});function Hd(e,t){return new oc({type:"template_literal",parts:e,...p(t)})}const sc=l("ZodLazy",(e,t)=>{Ta.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.getter()});function ac(e){return new sc({type:"lazy",getter:e})}const uc=l("ZodPromise",(e,t)=>{Na.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qd(e){return new uc({type:"promise",innerType:e})}const nn=l("ZodCustom",(e,t)=>{Ua.init(e,t),j.init(e,t)});function cc(e,t){const r=new Y({check:"custom",...p(t)});return r._zod.check=e,r}function ef(e,t){return vu(nn,e??(()=>!0),t)}function lc(e,t={}){return gu(nn,e,t)}function dc(e,t){const r=cc(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Fe(n,i.value,r._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Fe(o))}},e(i.value,i)),t);return r}function M(e,t={error:`Input not instance of ${e.name}`}){const r=new nn({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...p(t)});return r._zod.bag.Class=e,r}const tf=(...e)=>yu({Pipe:di,Boolean:Xt,String:Yt,Transform:ai},...e);function nf(e){const t=ac(()=>V([J(e),U(),ti(),ri(),$t(t),tn(J(),t)]));return t}function rf(e,t){return Rt(ui(e),t)}const rn=Ke([U(),U()]);Ke([Se(),Se()]);const fc=C({width:U(),height:U()}),of=C({signedWidth:U(),signedHeight:U()}),sf=["width","height"];ee(sf);const af=["start","center","end"],uf=["signedWidth","signedHeight"];ee(uf);const Mt=C({x:U(),y:U()}),cf=C({clientX:U(),clientY:U()}),lf=["x","y"],mc=ee(lf),pc=["top","right","bottom","left"];ee(pc);const df=["left","right"],hc=ee(df),ff=["top","bottom"],vc=ee(ff),gc=["center"],Di=ee(gc),mf=[...pc,...gc],yc=ee(mf);ee(af);const pf=["first","last"];ee(pf);const hf=C({lower:U(),upper:U()}),vf=C({lower:Se(),upper:Se()});V([hf,rn]);V([vf,rn]);ee([...mc.options,...yc.options]);V([mc,yc,M(String)]);const gf=e=>typeof e=="bigint"||e instanceof BigInt,De=(e,t)=>gf(e)?e.valueOf()*BigInt(t.valueOf()):e.valueOf()*Number(t.valueOf()),Ie=(e,t,r)=>{const i={};if(typeof t=="object"&&(r=t,t=void 0),r={makeValid:!0,...r},typeof e=="number"||typeof e=="bigint")t!=null?(i.lower=e,i.upper=t):(i.lower=typeof e=="bigint"?0n:0,i.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[i.lower,i.upper]=e}else i.lower=e.lower,i.upper=e.upper;return r!=null&&r.makeValid?yf(i):i},yf=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,Ai=(e,t)=>{const r=Ie(e);return t<r.lower?r.lower:t>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):t};C({x:hc.or(Di),y:vc.or(Di)});const $f=C({x:hc,y:vc}),bf=Object.freeze({x:"left",y:"top"}),_f=(e,t)=>e.x===t.x&&e.y===t.y,Ci=V([U(),Mt,rn,fc,of,cf]),wf=(e,t)=>{if(typeof e=="string"){if(t===void 0)throw new Error("The y coordinate must be given.");return e==="x"?{x:t,y:0}:{x:0,y:t}}return typeof e=="number"?{x:e,y:t??e}:Array.isArray(e)?{x:e[0],y:e[1]}:"signedWidth"in e?{x:e.signedWidth,y:e.signedHeight}:"clientX"in e?{x:e.clientX,y:e.clientY}:"width"in e?{x:e.width,y:e.height}:{x:e.x,y:e.y}},Ri=Object.freeze({x:0,y:0}),It=V([U(),J()]);C({top:It,left:It,width:It,height:It});C({left:U(),top:U(),right:U(),bottom:U()});C({one:Mt,two:Mt,root:$f});const fi=(e,t,r=0,i=0,n)=>{const o={one:{...Ri},two:{...Ri},root:n??bf};if(typeof e=="number"){if(typeof t!="number")throw new Error("Box constructor called with invalid arguments");return o.one={x:e,y:t},o.two={x:o.one.x+r,y:o.one.y+i},o}return"one"in e&&"two"in e&&"root"in e?{...e,root:n??e.root}:("getBoundingClientRect"in e&&(e=e.getBoundingClientRect()),"left"in e?(o.one={x:e.left,y:e.top},o.two={x:e.right,y:e.bottom},o):(o.one=e,t==null?o.two={x:o.one.x+r,y:o.one.y+i}:typeof t=="number"?o.two={x:o.one.x+t,y:o.one.y+r}:"width"in t?o.two={x:o.one.x+t.width,y:o.one.y+t.height}:"signedWidth"in t?o.two={x:o.one.x+t.signedWidth,y:o.one.y+t.signedHeight}:o.two=t,o))},un=e=>{const t=fi(e);return{lower:t.one.x,upper:t.two.x}},cn=e=>{const t=fi(e);return{lower:t.one.y,upper:t.two.y}},If=e=>typeof e!="object"||e==null?!1:"one"in e&&"two"in e&&"root"in e,kf=C({signedWidth:U(),signedHeight:U()});V([fc,kf,Mt,rn]);var Of=Object.defineProperty,Sf=(e,t,r)=>t in e?Of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ye=(e,t,r)=>Sf(e,typeof t!="symbol"?t+"":t,r);const zf=(e,t,r)=>t!==void 0&&e<t?t:r!==void 0&&e>r?r:e;C({offset:Ci,scale:Ci});C({offset:U(),scale:U()});const xf=e=>(t,r,i,n)=>r==="dimension"?[t,i]:[t,n?i-e:i+e],Nf=e=>(t,r,i,n)=>[t,n?i/e:i*e],Tf=e=>(t,r,i)=>{if(t===null)return[e,i];const{lower:n,upper:o}=t,{lower:s,upper:a}=e,u=o-n,c=a-s;if(r==="dimension")return[e,i*(c/u)];const f=(i-n)*(c/u)+s;return[e,f]},Uf=e=>(t,r,i)=>[e,i],jf=()=>(e,t,r)=>{if(e===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[e,r];const{lower:i,upper:n}=e;return[e,n-(r-i)]},Ef=e=>(t,r,i)=>{const{lower:n,upper:o}=e;return i=zf(i,n,o),[t,i]},gn=class et{constructor(){ye(this,"ops",[]),ye(this,"currBounds",null),ye(this,"currType",null),ye(this,"reversed",!1),this.ops=[]}static translate(t){return new et().translate(t)}static magnify(t){return new et().magnify(t)}static scale(t,r){return new et().scale(t,r)}translate(t){const r=this.new(),i=xf(t);return i.type="translate",r.ops.push(i),r}magnify(t){const r=this.new(),i=Nf(t);return i.type="magnify",r.ops.push(i),r}scale(t,r){const i=Ie(t,r),n=this.new(),o=Tf(i);return o.type="scale",n.ops.push(o),n}clamp(t,r){const i=Ie(t,r),n=this.new(),o=Ef(i);return o.type="clamp",n.ops.push(o),n}reBound(t,r){const i=Ie(t,r),n=this.new(),o=Uf(i);return o.type="re-bound",n.ops.push(o),n}invert(){const t=jf();t.type="invert";const r=this.new();return r.ops.push(t),r}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new et;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,r){return this.currBounds=null,this.ops.reduce(([i,n],o)=>o(i,t,n,this.reversed),[null,r])[1]}reverse(){const t=this.new();t.ops.reverse();const r=[];return t.ops.forEach((i,n)=>{if(i.type==="scale"||r.some(([s,a])=>n>=s&&n<=a))return;const o=t.ops.findIndex((s,a)=>s.type==="scale"&&a>n);o!==-1&&r.push([n,o])}),r.forEach(([i,n])=>{const o=t.ops.slice(i,n);o.unshift(t.ops[n]),t.ops.splice(i,n-i+1,...o)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};ye(gn,"IDENTITY",new gn);let Mi=gn;const Li=class ve{constructor(t=new Mi,r=new Mi,i=null){ye(this,"x"),ye(this,"y"),ye(this,"currRoot"),this.x=t,this.y=r,this.currRoot=i}static translate(t,r){return new ve().translate(t,r)}static translateX(t){return new ve().translateX(t)}static translateY(t){return new ve().translateY(t)}static clamp(t){return new ve().clamp(t)}static magnify(t){return new ve().magnify(t)}static scale(t){return new ve().scale(t)}static reBound(t){return new ve().reBound(t)}translate(t,r){const i=wf(t,r),n=this.copy();return n.x=this.x.translate(i.x),n.y=this.y.translate(i.y),n}translateX(t){const r=this.copy();return r.x=this.x.translate(t),r}translateY(t){const r=this.copy();return r.y=this.y.translate(t),r}magnify(t){const r=this.copy();return r.x=this.x.magnify(t.x),r.y=this.y.magnify(t.y),r}scale(t){const r=this.copy();if(If(t)){const i=this.currRoot;return r.currRoot=t.root,i!=null&&!_f(i,t.root)&&(i.x!==t.root.x&&(r.x=r.x.invert()),i.y!==t.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(un(t)),r.y=r.y.scale(cn(t)),r}return r.x=r.x.scale(t.width),r.y=r.y.scale(t.height),r}reBound(t){const r=this.copy();return r.x=this.x.reBound(un(t)),r.y=this.y.reBound(cn(t)),r}clamp(t){const r=this.copy();return r.x=this.x.clamp(un(t)),r.y=this.y.clamp(cn(t)),r}copy(){const t=new ve;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return fi(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};ye(Li,"IDENTITY",new Li);var Pf=Object.defineProperty,Zf=(e,t,r)=>t in e?Pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t,r)=>Zf(e,typeof t!="symbol"?t+"":t,r);function Df(e){return Za(Yt,e)}function Af(e){return Ba(Kt,e)}function Cf(e){return Ya(Xt,e)}function $c(e){return Xa(Ht,e)}function Rf(e){return au(ii,e)}const Mf=Object.freeze(Object.defineProperty({__proto__:null,bigint:$c,boolean:Cf,date:Rf,number:Af,string:Df},Symbol.toStringTag,{value:"Module"}));let Lf=(e,t=21)=>(r=t)=>{let i="",n=r|0;for(;n--;)i+=e[Math.random()*e.length|0];return i};const Bf="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ff=Lf(Bf,11),Jf=()=>Ff(),Vf=(e,t)=>r=>r instanceof t||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===e,Wf=ee(["static","dynamic"]),bc=(e,t)=>{const r=new R(t);if(![P.DAY,P.HOUR,P.MINUTE,P.SECOND,P.MILLISECOND,P.MICROSECOND,P.NANOSECOND].some(n=>n.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const i=e.valueOf()%r.valueOf();return e instanceof R?new R(i):new P(i)},D=class S extends Ge{constructor(t,r="UTC"){if(t==null)super(S.now().valueOf());else if(t instanceof Date)super(BigInt(t.getTime())*S.MILLISECOND.valueOf());else if(typeof t=="string")super(S.parseDateTimeString(t,r).valueOf());else if(Array.isArray(t))super(S.parseDate(t));else{let i=BigInt(0);t instanceof Number&&(t=t.valueOf()),r==="local"&&(i=S.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=S.MAX:t=S.MIN)),super(BigInt(t.valueOf())+i)}}static parseDate([t=1970,r=1,i=1]){const n=new Date(t,r-1,i,0,0,0,0);return new S(BigInt(n.getTime())*S.MILLISECOND.valueOf()).truncate(S.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,r="UTC"){const[i,n,o]=t.split(":");let s="00",a="00";o!=null&&([s,a]=o.split("."));let u=S.hours(parseInt(i??"00")).add(S.minutes(parseInt(n??"00"))).add(S.seconds(parseInt(s??"00"))).add(S.milliseconds(parseInt(a??"00")));return r==="local"&&(u=u.add(S.utcOffset)),u.valueOf()}static parseDateTimeString(t,r="UTC"){if(!t.includes("/")&&!t.includes("-"))return S.parseTimeString(t,r);const i=new Date(t);return t.includes(":")||i.setUTCHours(0,0,0,0),new S(BigInt(i.getTime())*S.MILLISECOND.valueOf(),r).valueOf()}fString(t="ISO",r="UTC"){switch(t){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(S.utcOffset).date().toISOString()}timeString(t=!1,r="UTC"){const i=this.toISOString(r);return t?i.slice(11,23):i.slice(11,19)}dateString(){const t=this.date(),r=t.toLocaleString("default",{month:"short"}),i=t.toLocaleString("default",{day:"numeric"});return`${r} ${i}`}static get utcOffset(){return new P(BigInt(new Date().getTimezoneOffset())*S.MINUTE.valueOf())}static since(t){return new S().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new S(t).valueOf()}span(t){return this.range(t).span}range(t){return new st(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new S(t).valueOf()}afterEq(t){return this.valueOf()>=new S(t).valueOf()}before(t){return this.valueOf()<new S(t).valueOf()}beforeEq(t){return this.valueOf()<=new S(t).valueOf()}add(t){return new S(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new S(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(P.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(P.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(P.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(P.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(S.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(S.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(t){const r=this.date();return r.setUTCFullYear(t),new S(r)}get month(){return this.date().getUTCMonth()}setMonth(t){const r=this.date();return r.setUTCMonth(t),new S(r)}get day(){return this.date().getUTCDate()}setDay(t){const r=this.date();return r.setUTCDate(t),new S(r)}get hour(){return this.date().getUTCHours()}setHour(t){const r=this.date();return r.setUTCHours(t),new S(r,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(t){const r=this.date();return r.setUTCMinutes(t),new S(r)}get second(){return this.date().getUTCSeconds()}setSecond(t){const r=this.date();return r.setUTCSeconds(t),new S(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(t){const r=this.date();return r.setUTCMilliseconds(t),new S(r)}toString(){return this.date().toISOString()}remainder(t){return bc(this,t)}get isToday(){return this.truncate(P.DAY).equals(S.now().truncate(P.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new S(new Date)}static max(...t){let r=S.MIN;for(const i of t){const n=new S(i);n.after(r)&&(r=n)}return r}static min(...t){let r=S.MAX;for(const i of t){const n=new S(i);n.before(r)&&(r=n)}return r}static nanoseconds(t,r="UTC"){return new S(t,r)}static microseconds(t,r="UTC"){return S.nanoseconds(t*1e3,r)}static milliseconds(t,r="UTC"){return S.microseconds(t*1e3,r)}static seconds(t,r="UTC"){return S.milliseconds(t*1e3,r)}static minutes(t,r="UTC"){return S.seconds(t*60,r)}static hours(t,r="UTC"){return S.minutes(t*60,r)}static days(t,r="UTC"){return S.hours(t*24,r)}};$(D,"NANOSECOND",D.nanoseconds(1)),$(D,"MICROSECOND",D.microseconds(1)),$(D,"MILLISECOND",D.milliseconds(1)),$(D,"SECOND",D.seconds(1)),$(D,"MINUTE",D.minutes(1)),$(D,"HOUR",D.hours(1)),$(D,"DAY",D.days(1)),$(D,"MAX",new D((1n<<63n)-1n)),$(D,"MIN",new D(0)),$(D,"ZERO",new D(0)),$(D,"z",V([C({value:Se()}).transform(e=>new D(e.value)),J().transform(e=>new D(BigInt(e))),M(Number).transform(e=>new D(e)),U().transform(e=>new D(e)),M(D)]));let R=D;const A=class N extends Ge{constructor(t){typeof t=="number"&&(t=Math.trunc(t.valueOf())),super(BigInt(t.valueOf()))}static fromSeconds(t){return t instanceof N?t:t instanceof Bi?t.period:t instanceof R?new N(t):["number","bigint"].includes(typeof t)?N.seconds(t):new N(t)}static fromMilliseconds(t){return t instanceof N?t:t instanceof Bi?t.period:t instanceof R?new N(t):["number","bigint"].includes(typeof t)?N.milliseconds(t):new N(t)}valueOf(){return this.value}lessThan(t){return this.valueOf()<new N(t).valueOf()}greaterThan(t){return this.valueOf()>new N(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new N(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new N(t).valueOf()}remainder(t){return bc(this,t)}truncate(t){return new N(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(N.DAY),r=this.truncate(N.HOUR),i=this.truncate(N.MINUTE),n=this.truncate(N.SECOND),o=this.truncate(N.MILLISECOND),s=this.truncate(N.MICROSECOND),a=this.truncate(N.NANOSECOND),u=t,c=r.sub(t),f=i.sub(r),d=n.sub(i),y=o.sub(n),h=s.sub(o),I=a.sub(s);let w="";return u.isZero||(w+=`${u.days}d `),c.isZero||(w+=`${c.hours}h `),f.isZero||(w+=`${f.minutes}m `),d.isZero||(w+=`${d.seconds}s `),y.isZero||(w+=`${y.milliseconds}ms `),h.isZero||(w+=`${h.microseconds}µs `),I.isZero||(w+=`${I.nanoseconds}ns`),w.trim()}mult(t){return new N(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(N.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(N.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(N.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(N.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(N.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(N.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new N(t).valueOf()}add(t){return new N(this.valueOf()+new N(t).valueOf())}sub(t){return new N(this.valueOf()-new N(t).valueOf())}static nanoseconds(t=1){return new N(t)}static microseconds(t=1){return N.nanoseconds(De(t,1e3))}static milliseconds(t=1){return N.microseconds(De(t,1e3))}static seconds(t=1){return N.milliseconds(De(t,1e3))}static minutes(t=1){return N.seconds(De(t,60))}static hours(t){return N.minutes(De(t,60))}static days(t){return N.hours(De(t,24))}};$(A,"NANOSECOND",A.nanoseconds(1)),$(A,"MICROSECOND",A.microseconds(1)),$(A,"MILLISECOND",A.milliseconds(1)),$(A,"SECOND",A.seconds(1)),$(A,"MINUTE",A.minutes(1)),$(A,"HOUR",A.hours(1)),$(A,"DAY",A.days(1)),$(A,"MAX",new A((1n<<63n)-1n)),$(A,"MIN",new A(0)),$(A,"ZERO",new A(0)),$(A,"z",V([C({value:Se()}).transform(e=>new A(e.value)),J().transform(e=>new A(BigInt(e))),M(Number).transform(e=>new A(e)),U().transform(e=>new A(e)),M(A)]));let P=A;const tt=class xt extends Ge{constructor(t){super(t.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new xt(t).valueOf()}get period(){return P.seconds(1/this.valueOf())}sampleCount(t){return new P(t).seconds*this.valueOf()}byteCount(t,r){return this.sampleCount(t)*new se(r).valueOf()}span(t){return P.seconds(t/this.valueOf())}byteSpan(t,r){return this.span(t.valueOf()/r.valueOf())}static hz(t){return new xt(t)}static khz(t){return xt.hz(t*1e3)}};$(tt,"z",V([U().transform(e=>new tt(e)),M(Number).transform(e=>new tt(e)),M(tt)]));let Bi=tt;const ne=class extends Ge{constructor(t){super(t.valueOf())}length(t){return t.valueOf()/this.valueOf()}size(t){return new yn(t*this.valueOf())}};$(ne,"UNKNOWN",new ne(0)),$(ne,"BIT128",new ne(16)),$(ne,"BIT64",new ne(8)),$(ne,"BIT32",new ne(4)),$(ne,"BIT16",new ne(2)),$(ne,"BIT8",new ne(1)),$(ne,"z",V([U().transform(e=>new ne(e)),M(Number).transform(e=>new ne(e)),M(ne)]));let se=ne;const me=class nt{constructor(t,r){$(this,"start"),$(this,"end"),typeof t=="object"&&"start"in t?(this.start=new R(t.start),this.end=new R(t.end)):(this.start=new R(t),this.end=new R(r))}get span(){return new P(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new nt(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,r=P.ZERO){if(r.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let i=this.start.sub(t.start).valueOf(),n=this.end.sub(t.end).valueOf();return i<0&&(i=-i),n<0&&(n=-n),i<=r.valueOf()&&n<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,r=P.ZERO){t=t.makeValid();const i=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(i.start)||i.end.equals(t.start))return!1;const n=R.max(i.start,t.start),o=R.min(i.end,t.end);return o.before(n)?!1:new P(o.sub(n)).greaterThanOrEqual(r)}contains(t){return t instanceof nt?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const r=new nt(this.start,this.end);return t.start.after(this.start)&&(r.start=t.start),t.start.after(this.end)&&(r.end=t.start),t.end.before(this.end)&&(r.end=t.end),t.end.before(this.start)&&(r.start=t.end),r}static max(...t){return new nt(R.min(...t.map(r=>r.start)),R.max(...t.map(r=>r.end)))}};$(me,"MAX",new me(R.MIN,R.MAX)),$(me,"MIN",new me(R.MAX,R.MIN)),$(me,"ZERO",new me(R.ZERO,R.ZERO)),$(me,"z",V([C({start:R.z,end:R.z}).transform(e=>new me(e.start,e.end)),M(me)]));let st=me;const g=class W extends Ge{constructor(t){if(t instanceof W||typeof t=="string"||typeof t.valueOf()=="string")super(t.valueOf());else{const r=W.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(r==null)throw new Error(`unable to find data type for ${t.toString()}`);super(r.valueOf())}}get Array(){const t=W.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(r=>this.equals(r))}toString(){return this.valueOf()}get isVariable(){return this.equals(W.JSON)||this.equals(W.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(W.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=W.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsignedInteger(){return this.equals(W.UINT8)||this.equals(W.UINT16)||this.equals(W.UINT32)||this.equals(W.UINT64)}get isSignedInteger(){return this.equals(W.INT8)||this.equals(W.INT16)||this.equals(W.INT32)||this.equals(W.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsignedInteger&&t.isSignedInteger?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(W.INT32)&&t.equals(W.FLOAT64)||this.equals(W.INT8)&&t.equals(W.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsignedInteger===t.isUnsignedInteger:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}get usesBigInt(){return W.BIG_INT_TYPES.some(t=>t.equals(this))}};$(g,"UNKNOWN",new g("unknown")),$(g,"FLOAT64",new g("float64")),$(g,"FLOAT32",new g("float32")),$(g,"INT64",new g("int64")),$(g,"INT32",new g("int32")),$(g,"INT16",new g("int16")),$(g,"INT8",new g("int8")),$(g,"UINT64",new g("uint64")),$(g,"UINT32",new g("uint32")),$(g,"UINT16",new g("uint16")),$(g,"UINT8",new g("uint8")),$(g,"BOOLEAN",g.UINT8),$(g,"TIMESTAMP",new g("timestamp")),$(g,"UUID",new g("uuid")),$(g,"STRING",new g("string")),$(g,"JSON",new g("json")),$(g,"ARRAY_CONSTRUCTORS",new Map([[g.UINT8.toString(),Uint8Array],[g.UINT16.toString(),Uint16Array],[g.UINT32.toString(),Uint32Array],[g.UINT64.toString(),BigUint64Array],[g.FLOAT32.toString(),Float32Array],[g.FLOAT64.toString(),Float64Array],[g.INT8.toString(),Int8Array],[g.INT16.toString(),Int16Array],[g.INT32.toString(),Int32Array],[g.INT64.toString(),BigInt64Array],[g.TIMESTAMP.toString(),BigInt64Array],[g.STRING.toString(),Uint8Array],[g.JSON.toString(),Uint8Array],[g.UUID.toString(),Uint8Array]])),$(g,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,g.UINT8],[Uint16Array.name,g.UINT16],[Uint32Array.name,g.UINT32],[BigUint64Array.name,g.UINT64],[Float32Array.name,g.FLOAT32],[Float64Array.name,g.FLOAT64],[Int8Array.name,g.INT8],[Int16Array.name,g.INT16],[Int32Array.name,g.INT32],[BigInt64Array.name,g.INT64]])),$(g,"DENSITIES",new Map([[g.UINT8.toString(),se.BIT8],[g.UINT16.toString(),se.BIT16],[g.UINT32.toString(),se.BIT32],[g.UINT64.toString(),se.BIT64],[g.FLOAT32.toString(),se.BIT32],[g.FLOAT64.toString(),se.BIT64],[g.INT8.toString(),se.BIT8],[g.INT16.toString(),se.BIT16],[g.INT32.toString(),se.BIT32],[g.INT64.toString(),se.BIT64],[g.TIMESTAMP.toString(),se.BIT64],[g.STRING.toString(),se.UNKNOWN],[g.JSON.toString(),se.UNKNOWN],[g.UUID.toString(),se.BIT128]])),$(g,"ALL",[g.UNKNOWN,g.FLOAT64,g.FLOAT32,g.INT64,g.INT32,g.INT16,g.INT8,g.UINT64,g.UINT32,g.UINT16,g.UINT8,g.TIMESTAMP,g.UUID,g.STRING,g.JSON]),$(g,"BIG_INT_TYPES",[g.INT64,g.UINT64,g.TIMESTAMP]),$(g,"z",V([J().transform(e=>new g(e)),M(g)]));let G=g;const oe=class X extends Ge{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return X.bytes(this.valueOf()+t.valueOf())}sub(t){return X.bytes(this.valueOf()-t.valueOf())}truncate(t){return new X(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return X.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/X.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/X.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/X.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/X.TERABYTE.valueOf()}toString(){const t=this.truncate(X.TERABYTE),r=this.truncate(X.GIGABYTE),i=this.truncate(X.MEGABYTE),n=this.truncate(X.KILOBYTE),o=this.truncate(X.BYTE),s=t,a=r.sub(t),u=i.sub(r),c=n.sub(i),f=o.sub(n);let d="";return s.isZero||(d+=`${s.terabytes}TB `),a.isZero||(d+=`${a.gigabytes}GB `),u.isZero||(d+=`${u.megabytes}MB `),c.isZero||(d+=`${c.kilobytes}KB `),(!f.isZero||d==="")&&(d+=`${f.valueOf()}B`),d.trim()}static bytes(t=1){return new X(t)}static kilobytes(t=1){return X.bytes(t.valueOf()*1e3)}static megabytes(t=1){return X.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return X.megabytes(t.valueOf()*1e3)}static terabytes(t){return X.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};$(oe,"BYTE",new oe(1)),$(oe,"KILOBYTE",oe.kilobytes(1)),$(oe,"MEGABYTE",oe.megabytes(1)),$(oe,"GIGABYTE",oe.gigabytes(1)),$(oe,"TERABYTE",oe.terabytes(1)),$(oe,"ZERO",new oe(0)),$(oe,"z",V([U().transform(e=>new oe(e)),M(oe)]));let yn=oe;V([M(Uint8Array),M(Uint16Array),M(Uint32Array),M(BigUint64Array),M(Float32Array),M(Float64Array),M(Int8Array),M(Int16Array),M(Int32Array),M(BigInt64Array)]);const _c=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||e instanceof R||e instanceof P||e instanceof Date},Gf=(e,t,r,i=0)=>e.usesBigInt&&!t.usesBigInt?Number(r)-Number(i):!e.usesBigInt&&t.usesBigInt?BigInt(r.valueOf())-BigInt(i.valueOf()):Nt(r,-i).valueOf(),Nt=(e,t)=>t==0?e:e==0?t:typeof e=="bigint"&&typeof t=="bigint"||typeof e=="number"&&typeof t=="number"?e+t:Number(e)+Number(t),qf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Yf(e){return typeof e=="string"&&qf.test(e)}const re=[];for(let e=0;e<256;++e)re.push((e+256).toString(16).slice(1));function Kf(e,t=0){return(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase()}function Xf(e,t=0){const r=Kf(e,t);if(!Yf(r))throw TypeError("Stringified UUID is invalid");return r}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf=(e,t)=>Xf(e,t),$e=-1,Qf=J().transform(e=>new Uint8Array(atob(e).split("").map(t=>t.charCodeAt(0))).buffer),em=V([ri(),Uu()]).transform(()=>new Uint8Array().buffer),$n=10,tm=(e,t)=>{if(e==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(e==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(e==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},wc="sy_x_telem_series",rt=class Ce{constructor(t){$(this,"key"),$(this,"discriminator",wc),$(this,"dataType"),$(this,"sampleOffset"),$(this,"gl"),$(this,"_data"),$(this,"timeRange",st.ZERO),$(this,"alignment",0n),$(this,"cachedMin"),$(this,"cachedMax"),$(this,"writePos",$e),$(this,"_refCount",0),$(this,"cachedLength"),$(this,"_cachedIndexes"),nm(t)&&(t={data:t}),t.data??(t.data=[]);const{dataType:r,timeRange:i,sampleOffset:n=0,glBufferUsage:o="static",alignment:s=0n,key:a=Jf(),data:u}=t;if(rm(u)){const d=u;this.key=d.key,this.dataType=d.dataType,this.sampleOffset=d.sampleOffset,this.gl=d.gl,this._data=d._data,this.timeRange=d.timeRange,this.alignment=d.alignment,this.cachedMin=d.cachedMin,this.cachedMax=d.cachedMax,this.writePos=d.writePos,this._refCount=d._refCount,this.cachedLength=d.cachedLength;return}const c=_c(u),f=Array.isArray(u);if(r!=null)this.dataType=new G(r);else{if(u instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(f||c){let d=u;if(!c){if(u.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");d=u[0]}if(typeof d=="string")this.dataType=G.STRING;else if(typeof d=="number")this.dataType=G.FLOAT64;else if(typeof d=="bigint")this.dataType=G.INT64;else if(typeof d=="boolean")this.dataType=G.BOOLEAN;else if(d instanceof R||d instanceof Date||d instanceof R)this.dataType=G.TIMESTAMP;else if(typeof d=="object")this.dataType=G.JSON;else throw new Error(`cannot infer data type of ${typeof d} when constructing a Series from a JS array`)}else this.dataType=new G(u)}if(!f&&!c)this._data=u;else{let d=c?[u]:u;const y=d[0];(y instanceof R||y instanceof Date||y instanceof P)&&(d=d.map(h=>new R(h).valueOf())),this.dataType.equals(G.STRING)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("zod"),Ye=n=>{const e=n.replace(/_[a-z]/g,t=>t[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},be=n=>{const e=(t,r=_)=>{if(typeof t=="string")return n(t);if(Array.isArray(t))return t.map(l=>e(l,r));if(!X(t))return t;r=Ze(r);const i={},o=t;return"toJSON"in o&&typeof o.toJSON=="function"?e(o.toJSON(),r):(Object.keys(o).forEach(l=>{let d=o[l];const f=n(l);r.recursive&&(X(d)?le(d)||(d=e(d,r)):r.recursiveInArray&&ce(d)&&(d=[...d].map(g=>{let m=g;return X(g)?le(m)||(m=e(g,r)):ce(g)&&(m=e({key:g},r).key),m}))),i[f]=d}),i)};return e},Te=be(Ye),qe=n=>n.replace(/([a-z0-9])([A-Z])/g,(e,t,r)=>`${t}_${r.toLowerCase()}`),Fe=be(qe),We=[Number,String,Uint8Array],_={recursive:!0,recursiveInArray:!0},Ze=(n=_)=>(n.recursive==null?n=_:n.recursiveInArray??=!1,n),ce=n=>n!=null&&Array.isArray(n),X=n=>n!=null&&typeof n=="object"&&!Array.isArray(n),le=n=>We.some(e=>n instanceof e);let Ve=class{contentType="application/json";decoder;encoder;constructor(){this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),i=Te(r);return t!=null?t.parse(i):i}encodeString(e){const t=Fe(e);return JSON.stringify(t,(r,i)=>ArrayBuffer.isView(i)?Array.from(i):typeof i=="bigint"?i.toString():i)}};const ee=new Ve;let P=class{value;constructor(e){this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const Ge=n=>n!=null&&typeof n=="object"&&"toString"in n,Je=(n,e=!1)=>{const t=Ge(n)?"stringer":typeof n;let r;switch(t){case"string":r=(i,o)=>i.localeCompare(o);break;case"stringer":r=(i,o)=>i.toString().localeCompare(o.toString());break;case"number":r=(i,o)=>Number(i)-Number(o);break;case"bigint":r=(i,o)=>BigInt(i)-BigInt(o)>0n?1:-1;break;case"boolean":r=(i,o)=>Number(i)-Number(o);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${t}`),()=>-1}return e?He(r):r},He=n=>(e,t)=>n(t,e),H=s.z.tuple([s.z.number(),s.z.number()]);s.z.tuple([s.z.bigint(),s.z.bigint()]);const Oe=s.z.object({width:s.z.number(),height:s.z.number()}),Xe=s.z.object({signedWidth:s.z.number(),signedHeight:s.z.number()}),Ke=["width","height"];s.z.enum(Ke);const Qe=["start","center","end"],_e=["signedWidth","signedHeight"];s.z.enum(_e);const G=s.z.object({x:s.z.number(),y:s.z.number()}),et=s.z.object({clientX:s.z.number(),clientY:s.z.number()}),tt=["x","y"],ve=s.z.enum(tt),Ie=["top","right","bottom","left"];s.z.enum(Ie);const nt=["left","right"],Se=s.z.enum(nt),rt=["top","bottom"],Ne=s.z.enum(rt),ze=["center"],he=s.z.enum(ze),st=[...Ie,...ze],xe=s.z.enum(st);s.z.enum(Qe);const it=["first","last"];s.z.enum(it);const at=s.z.object({lower:s.z.number(),upper:s.z.number()}),ot=s.z.object({lower:s.z.bigint(),upper:s.z.bigint()});s.z.union([at,H]);s.z.union([ot,H]);s.z.enum([...ve.options,...xe.options]);s.z.union([ve,xe,s.z.instanceof(String)]);const B=(n,e)=>typeof n=="bigint"?n*BigInt(e):n*Number(e),A=(n,e,t)=>{const r={};if(typeof e=="object"&&(t=e,e=void 0),t={makeValid:!0,...t},typeof n=="number"||typeof n=="bigint")e!=null?(r.lower=n,r.upper=e):(r.lower=typeof n=="bigint"?0n:0,r.upper=n);else if(Array.isArray(n)){if(n.length!==2)throw new Error("bounds: expected array of length 2");[r.lower,r.upper]=n}else r.lower=n.lower,r.upper=n.upper;return t?.makeValid?ut(r):r},ut=n=>n.lower>n.upper?{lower:n.upper,upper:n.lower}:n,fe=(n,e)=>{const t=A(n);return e<t.lower?t.lower:e>=t.upper?t.upper-(typeof t.upper=="number"?1:1n):e};s.z.object({x:Se.or(he),y:Ne.or(he)});const ct=s.z.object({x:Se,y:Ne}),lt=Object.freeze({x:"left",y:"top"}),ht=(n,e)=>n.x===e.x&&n.y===e.y,de=s.z.union([s.z.number(),G,H,Oe,Xe,et]),ft=(n,e)=>{if(typeof n=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return n==="x"?{x:e,y:0}:{x:0,y:e}}return typeof n=="number"?{x:n,y:e??n}:Array.isArray(n)?{x:n[0],y:n[1]}:"signedWidth"in n?{x:n.signedWidth,y:n.signedHeight}:"clientX"in n?{x:n.clientX,y:n.clientY}:"width"in n?{x:n.width,y:n.height}:{x:n.x,y:n.y}},ge=Object.freeze({x:0,y:0}),W=s.z.union([s.z.number(),s.z.string()]);s.z.object({top:W,left:W,width:W,height:W});s.z.object({left:s.z.number(),top:s.z.number(),right:s.z.number(),bottom:s.z.number()});s.z.object({one:G,two:G,root:ct});const se=(n,e,t=0,r=0,i)=>{const o={one:{...ge},two:{...ge},root:i??lt};if(typeof n=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return o.one={x:n,y:e},o.two={x:o.one.x+t,y:o.one.y+r},o}return"one"in n&&"two"in n&&"root"in n?{...n,root:i??n.root}:("getBoundingClientRect"in n&&(n=n.getBoundingClientRect()),"left"in n?(o.one={x:n.left,y:n.top},o.two={x:n.right,y:n.bottom},o):(o.one=n,e==null?o.two={x:o.one.x+t,y:o.one.y+r}:typeof e=="number"?o.two={x:o.one.x+e,y:o.one.y+t}:"width"in e?o.two={x:o.one.x+e.width,y:o.one.y+e.height}:"signedWidth"in e?o.two={x:o.one.x+e.signedWidth,y:o.one.y+e.signedHeight}:o.two=e,o))},K=n=>{const e=se(n);return{lower:e.one.x,upper:e.two.x}},Q=n=>{const e=se(n);return{lower:e.one.y,upper:e.two.y}},dt=n=>typeof n!="object"||n==null?!1:"one"in n&&"two"in n&&"root"in n,gt=s.z.object({signedWidth:s.z.number(),signedHeight:s.z.number()});s.z.union([Oe,gt,G,H]);const pt=(n,e,t)=>e!==void 0&&n<e?e:t!==void 0&&n>t?t:n;s.z.object({offset:de,scale:de});s.z.object({offset:s.z.number(),scale:s.z.number()});const yt=n=>(e,t,r,i)=>t==="dimension"?[e,r]:[e,i?r-n:r+n],mt=n=>(e,t,r,i)=>[e,i?r/n:r*n],wt=n=>(e,t,r)=>{if(e===null)return[n,r];const{lower:i,upper:o}=e,{lower:l,upper:d}=n,f=o-i,g=d-l;if(t==="dimension")return[n,r*(g/f)];const m=(r-i)*(g/f)+l;return[n,m]},bt=n=>(e,t,r)=>[n,r],Tt=()=>(n,e,t)=>{if(n===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[n,t];const{lower:r,upper:i}=n;return[n,i-(t-r)]},Ot=n=>(e,t,r)=>{const{lower:i,upper:o}=n;return r=pt(r,i,o),[e,r]};let pe=class ${ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(e){return new $().translate(e)}static magnify(e){return new $().magnify(e)}static scale(e,t){return new $().scale(e,t)}translate(e){const t=this.new(),r=yt(e);return r.type="translate",t.ops.push(r),t}magnify(e){const t=this.new(),r=mt(e);return r.type="magnify",t.ops.push(r),t}scale(e,t){const r=A(e,t),i=this.new(),o=wt(r);return o.type="scale",i.ops.push(o),i}clamp(e,t){const r=A(e,t),i=this.new(),o=Ot(r);return o.type="clamp",i.ops.push(o),i}reBound(e,t){const r=A(e,t),i=this.new(),o=bt(r);return o.type="re-bound",i.ops.push(o),i}invert(){const e=Tt();e.type="invert";const t=this.new();return t.ops.push(e),t}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new $;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,t){return this.currBounds=null,this.ops.reduce(([r,i],o)=>o(r,e,i,this.reversed),[null,t])[1]}reverse(){const e=this.new();e.ops.reverse();const t=[];return e.ops.forEach((r,i)=>{if(r.type==="scale"||t.some(([l,d])=>i>=l&&i<=d))return;const o=e.ops.findIndex((l,d)=>l.type==="scale"&&d>i);o!==-1&&t.push([i,o])}),t.forEach(([r,i])=>{const o=e.ops.slice(r,i);o.unshift(e.ops[i]),e.ops.splice(r,i-r+1,...o)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new $},Yn=class I{x;y;currRoot;constructor(e=new pe,t=new pe,r=null){this.x=e,this.y=t,this.currRoot=r}static translate(e,t){return new I().translate(e,t)}static translateX(e){return new I().translateX(e)}static translateY(e){return new I().translateY(e)}static clamp(e){return new I().clamp(e)}static magnify(e){return new I().magnify(e)}static scale(e){return new I().scale(e)}static reBound(e){return new I().reBound(e)}translate(e,t){const r=ft(e,t),i=this.copy();return i.x=this.x.translate(r.x),i.y=this.y.translate(r.y),i}translateX(e){const t=this.copy();return t.x=this.x.translate(e),t}translateY(e){const t=this.copy();return t.y=this.y.translate(e),t}magnify(e){const t=this.copy();return t.x=this.x.magnify(e.x),t.y=this.y.magnify(e.y),t}scale(e){const t=this.copy();if(dt(e)){const r=this.currRoot;return t.currRoot=e.root,r!=null&&!ht(r,e.root)&&(r.x!==e.root.x&&(t.x=t.x.invert()),r.y!==e.root.y&&(t.y=t.y.invert())),t.x=t.x.scale(K(e)),t.y=t.y.scale(Q(e)),t}return t.x=t.x.scale(e.width),t.y=t.y.scale(e.height),t}reBound(e){const t=this.copy();return t.x=this.x.reBound(K(e)),t.y=this.y.reBound(Q(e)),t}clamp(e){const t=this.copy();return t.x=this.x.clamp(K(e)),t.y=this.y.clamp(Q(e)),t}copy(){const e=new I;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return se(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new I},vt=(n,e=21)=>(t=e)=>{let r="",i=t|0;for(;i--;)r+=n[Math.random()*n.length|0];return r};const It="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",St=11,Nt=vt(It,St),zt=()=>Nt(),xt=(n,e)=>t=>t instanceof e||typeof t=="object"&&t!==null&&"discriminator"in t&&t.discriminator===n,Et=s.z.enum(["static","dynamic"]),At=s.z.union([s.z.tuple([s.z.int()]),s.z.tuple([s.z.int(),s.z.int().min(1).max(12)]),s.z.tuple([s.z.int(),s.z.int().min(1).max(12),s.z.int().min(1).max(31)])]),Ee=(n,e)=>{const t=new y(e);if(![u.DAY,u.HOUR,u.MINUTE,u.SECOND,u.MILLISECOND,u.MICROSECOND,u.NANOSECOND].some(i=>i.equals(t)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const r=n.valueOf()%t.valueOf();return n instanceof y?new y(r):new u(r)};let y=class c extends P{constructor(e,t="UTC"){if(e==null)super(c.now().valueOf());else if(e instanceof Date)super(BigInt(e.getTime())*c.MILLISECOND.valueOf());else if(typeof e=="string")super(c.parseDateTimeString(e,t).valueOf());else if(Array.isArray(e))super(c.parseDate(e));else{let r=0n;e instanceof Number&&(e=e.valueOf()),t==="local"&&(r=c.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=c.MAX:e=c.MIN)),super(BigInt(e.valueOf())+r)}}static parseDate([e=1970,t=1,r=1]){const i=new Date(e,t-1,r,0,0,0,0);return new c(BigInt(i.getTime())*c.MILLISECOND.valueOf()).truncate(c.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,t="UTC"){const[r,i,o]=e.split(":");let l="00",d="00";o!=null&&([l,d]=o.split("."));let f=c.hours(parseInt(r??"00")).add(c.minutes(parseInt(i??"00"))).add(c.seconds(parseInt(l??"00"))).add(c.milliseconds(parseInt(d??"00")));return t==="local"&&(f=f.add(c.utcOffset)),f.valueOf()}static parseDateTimeString(e,t="UTC"){if(!e.includes("/")&&!e.includes("-"))return c.parseTimeString(e,t);const r=new Date(e);return e.includes(":")||r.setUTCHours(0,0,0,0),new c(BigInt(r.getTime())*c.MILLISECOND.valueOf(),t).valueOf()}fString(e="ISO",t="UTC"){switch(e){case"ISODate":return this.toISOString(t).slice(0,10);case"ISOTime":return this.toISOString(t).slice(11,23);case"time":return this.timeString(!1,t);case"preciseTime":return this.timeString(!0,t);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,t)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,t)}`;default:return this.toISOString(t)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(c.utcOffset).date().toISOString()}timeString(e=!1,t="UTC"){const r=this.toISOString(t);return e?r.slice(11,23):r.slice(11,19)}dateString(){const e=this.date(),t=e.toLocaleString("default",{month:"short"}),r=e.toLocaleString("default",{day:"numeric"});return`${t} ${r}`}static get utcOffset(){return new u(BigInt(new Date().getTimezoneOffset())*c.MINUTE.valueOf())}static since(e){return new c().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new c(e).valueOf()}span(e){return this.range(e).span}range(e){return new O(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0n}after(e){return this.valueOf()>new c(e).valueOf()}afterEq(e){return this.valueOf()>=new c(e).valueOf()}before(e){return this.valueOf()<new c(e).valueOf()}beforeEq(e){return this.valueOf()<=new c(e).valueOf()}add(e){return new c(this.valueOf()+BigInt(e.valueOf()))}sub(e){return new c(this.valueOf()-BigInt(e.valueOf()))}get hours(){return Number(this.valueOf())/Number(u.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(u.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(u.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(u.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(c.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(c.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(e){const t=this.date();return t.setUTCFullYear(e),new c(t)}get month(){return this.date().getUTCMonth()}setMonth(e){const t=this.date();return t.setUTCMonth(e),new c(t)}get day(){return this.date().getUTCDate()}setDay(e){const t=this.date();return t.setUTCDate(e),new c(t)}get hour(){return this.date().getUTCHours()}setHour(e){const t=this.date();return t.setUTCHours(e),new c(t,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(e){const t=this.date();return t.setUTCMinutes(e),new c(t)}get second(){return this.date().getUTCSeconds()}setSecond(e){const t=this.date();return t.setUTCSeconds(e),new c(t)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(e){const t=this.date();return t.setUTCMilliseconds(e),new c(t)}toString(){return this.date().toISOString()}remainder(e){return Ee(this,e)}get isToday(){return this.truncate(u.DAY).equals(c.now().truncate(u.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new c(new Date)}static max(...e){let t=c.MIN;for(const r of e){const i=new c(r);i.after(t)&&(t=i)}return t}static min(...e){let t=c.MAX;for(const r of e){const i=new c(r);i.before(t)&&(t=i)}return t}static nanoseconds(e,t="UTC"){return new c(e,t)}static NANOSECOND=c.nanoseconds(1);static microseconds(e,t="UTC"){return c.nanoseconds(e*1e3,t)}static MICROSECOND=c.microseconds(1);static milliseconds(e,t="UTC"){return c.microseconds(e*1e3,t)}static MILLISECOND=c.milliseconds(1);static seconds(e,t="UTC"){return c.milliseconds(e*1e3,t)}static SECOND=c.seconds(1);static minutes(e,t="UTC"){return c.seconds(e*60,t)}static MINUTE=c.minutes(1);static hours(e,t="UTC"){return c.minutes(e*60,t)}static HOUR=c.hours(1);static days(e,t="UTC"){return c.hours(e*24,t)}static DAY=c.days(1);static MAX=new c((1n<<63n)-1n);static MIN=new c(0);static ZERO=new c(0);static z=s.z.union([s.z.instanceof(c),s.z.object({value:s.z.bigint()}).transform(e=>new c(e.value)),s.z.string().transform(e=>new c(BigInt(e))),s.z.number().transform(e=>new c(e)),s.z.bigint().transform(e=>new c(e)),s.z.date().transform(e=>new c(e)),s.z.custom(e=>e instanceof u).transform(e=>new c(e)),At.transform(e=>new c(e))]);static sort(e,t){return Number(e.valueOf()-t.valueOf())}};class u extends P{constructor(e){typeof e=="number"&&(e=Math.trunc(e.valueOf())),super(BigInt(e.valueOf()))}static fromSeconds(e){return e instanceof u?e:e instanceof ye?e.period:e instanceof y?new u(e):["number","bigint"].includes(typeof e)?u.seconds(e):new u(e)}static fromMilliseconds(e){return e instanceof u?e:e instanceof ye?e.period:e instanceof y?new u(e):["number","bigint"].includes(typeof e)?u.milliseconds(e):new u(e)}valueOf(){return this.value}lessThan(e){return this.valueOf()<new u(e).valueOf()}greaterThan(e){return this.valueOf()>new u(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new u(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new u(e).valueOf()}remainder(e){return Ee(this,e)}truncate(e){return new u(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(u.DAY),t=this.truncate(u.HOUR),r=this.truncate(u.MINUTE),i=this.truncate(u.SECOND),o=this.truncate(u.MILLISECOND),l=this.truncate(u.MICROSECOND),d=this.truncate(u.NANOSECOND),f=e,g=t.sub(e),m=r.sub(t),h=i.sub(r),v=o.sub(i),w=l.sub(o),F=d.sub(l);let z="";return f.isZero||(z+=`${f.days}d `),g.isZero||(z+=`${g.hours}h `),m.isZero||(z+=`${m.minutes}m `),h.isZero||(z+=`${h.seconds}s `),v.isZero||(z+=`${v.milliseconds}ms `),w.isZero||(z+=`${w.microseconds}µs `),F.isZero||(z+=`${F.nanoseconds}ns`),z.trim()}mult(e){return new u(this.valueOf()*BigInt(e))}get days(){return Number(this.valueOf())/Number(u.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(u.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(u.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(u.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(u.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(u.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===0n}equals(e){return this.valueOf()===new u(e).valueOf()}add(e){return new u(this.valueOf()+new u(e).valueOf())}sub(e){return new u(this.valueOf()-new u(e).valueOf())}static nanoseconds(e=1){return new u(e)}static NANOSECOND=u.nanoseconds(1);static microseconds(e=1){return u.nanoseconds(B(e,1e3))}static MICROSECOND=u.microseconds(1);static milliseconds(e=1){return u.microseconds(B(e,1e3))}static MILLISECOND=u.milliseconds(1);static seconds(e=1){return u.milliseconds(B(e,1e3))}static SECOND=u.seconds(1);static minutes(e=1){return u.seconds(B(e,60))}static MINUTE=u.minutes(1);static hours(e){return u.minutes(B(e,60))}static HOUR=u.hours(1);static days(e){return u.hours(B(e,24))}static DAY=u.days(1);static MAX=new u((1n<<63n)-1n);static MIN=new u(0);static ZERO=new u(0);static z=s.z.union([s.z.object({value:s.z.bigint()}).transform(e=>new u(e.value)),s.z.string().transform(e=>new u(BigInt(e))),s.z.number().transform(e=>new u(e)),s.z.instanceof(u)])}let ye=class R extends P{constructor(e){super(e.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new R(e).valueOf()}get period(){return u.seconds(1/this.valueOf())}sampleCount(e){return new u(e).seconds*this.valueOf()}byteCount(e,t){return this.sampleCount(e)*new T(t).valueOf()}span(e){return u.seconds(e/this.valueOf())}byteSpan(e,t){return this.span(e.valueOf()/t.valueOf())}static hz(e){return new R(e)}static khz(e){return R.hz(e*1e3)}static z=s.z.union([s.z.number().transform(e=>new R(e)),s.z.instanceof(R)])},T=class N extends P{constructor(e){super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new p(e*this.valueOf())}static UNKNOWN=new N(0);static BIT128=new N(16);static BIT64=new N(8);static BIT32=new N(4);static BIT16=new N(2);static BIT8=new N(1);static z=s.z.union([s.z.number().transform(e=>new N(e)),s.z.instanceof(N)])};class O{start;end;constructor(e,t){typeof e=="object"&&"start"in e?(this.start=new y(e.start),this.end=new y(e.end)):(this.start=new y(e),this.end=new y(t))}get span(){return new u(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new O(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,t=u.ZERO){if(t.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let r=this.start.sub(e.start).valueOf(),i=this.end.sub(e.end).valueOf();return r<0&&(r=-r),i<0&&(i=-i),r<=t.valueOf()&&i<=t.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,t=u.ZERO){e=e.makeValid();const r=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(r.start)||r.end.equals(e.start))return!1;const i=y.max(r.start,e.start),o=y.min(r.end,e.end);return o.before(i)?!1:new u(o.sub(i)).greaterThanOrEqual(t)}contains(e){return e instanceof O?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const t=new O(this.start,this.end);return e.start.after(this.start)&&(t.start=e.start),e.start.after(this.end)&&(t.end=e.start),e.end.before(this.end)&&(t.end=e.end),e.end.before(this.start)&&(t.start=e.end),t}static max(...e){return new O(y.min(...e.map(t=>t.start)),y.max(...e.map(t=>t.end)))}static MAX=new O(y.MIN,y.MAX);static MIN=new O(y.MAX,y.MIN);static ZERO=new O(y.ZERO,y.ZERO);static z=s.z.union([s.z.object({start:y.z,end:y.z}).transform(e=>new O(e.start,e.end)),s.z.instanceof(O)]);static sort(e,t){return y.sort(e.start,t.start)||y.sort(e.end,t.end)}}class a extends P{constructor(e){if(e instanceof a||typeof e=="string"||typeof e.valueOf()=="string")super(e.valueOf());else{const t=a.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(t==null)throw new Error(`unable to find data type for ${e.toString()}`);super(t.valueOf())}}get Array(){const e=a.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(t=>this.equals(t))}toString(){return this.valueOf()}get isVariable(){return this.equals(a.JSON)||this.equals(a.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(a.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=a.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsignedInteger(){return this.equals(a.UINT8)||this.equals(a.UINT16)||this.equals(a.UINT32)||this.equals(a.UINT64)}get isSignedInteger(){return this.equals(a.INT8)||this.equals(a.INT16)||this.equals(a.INT32)||this.equals(a.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsignedInteger&&e.isSignedInteger?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(a.INT32)&&e.equals(a.FLOAT64)||this.equals(a.INT8)&&e.equals(a.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsignedInteger===e.isUnsignedInteger:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}get usesBigInt(){return a.BIG_INT_TYPES.some(e=>e.equals(this))}static UNKNOWN=new a("unknown");static FLOAT64=new a("float64");static FLOAT32=new a("float32");static INT64=new a("int64");static INT32=new a("int32");static INT16=new a("int16");static INT8=new a("int8");static UINT64=new a("uint64");static UINT32=new a("uint32");static UINT16=new a("uint16");static UINT8=new a("uint8");static BOOLEAN=this.UINT8;static TIMESTAMP=new a("timestamp");static UUID=new a("uuid");static STRING=new a("string");static JSON=new a("json");static ARRAY_CONSTRUCTORS=new Map([[a.UINT8.toString(),Uint8Array],[a.UINT16.toString(),Uint16Array],[a.UINT32.toString(),Uint32Array],[a.UINT64.toString(),BigUint64Array],[a.FLOAT32.toString(),Float32Array],[a.FLOAT64.toString(),Float64Array],[a.INT8.toString(),Int8Array],[a.INT16.toString(),Int16Array],[a.INT32.toString(),Int32Array],[a.INT64.toString(),BigInt64Array],[a.TIMESTAMP.toString(),BigInt64Array],[a.STRING.toString(),Uint8Array],[a.JSON.toString(),Uint8Array],[a.UUID.toString(),Uint8Array]]);static ARRAY_CONSTRUCTOR_DATA_TYPES=new Map([[Uint8Array.name,a.UINT8],[Uint16Array.name,a.UINT16],[Uint32Array.name,a.UINT32],[BigUint64Array.name,a.UINT64],[Float32Array.name,a.FLOAT32],[Float64Array.name,a.FLOAT64],[Int8Array.name,a.INT8],[Int16Array.name,a.INT16],[Int32Array.name,a.INT32],[BigInt64Array.name,a.INT64]]);static DENSITIES=new Map([[a.UINT8.toString(),T.BIT8],[a.UINT16.toString(),T.BIT16],[a.UINT32.toString(),T.BIT32],[a.UINT64.toString(),T.BIT64],[a.FLOAT32.toString(),T.BIT32],[a.FLOAT64.toString(),T.BIT64],[a.INT8.toString(),T.BIT8],[a.INT16.toString(),T.BIT16],[a.INT32.toString(),T.BIT32],[a.INT64.toString(),T.BIT64],[a.TIMESTAMP.toString(),T.BIT64],[a.STRING.toString(),T.UNKNOWN],[a.JSON.toString(),T.UNKNOWN],[a.UUID.toString(),T.BIT128]]);static ALL=[a.UNKNOWN,a.FLOAT64,a.FLOAT32,a.INT64,a.INT32,a.INT16,a.INT8,a.UINT64,a.UINT32,a.UINT16,a.UINT8,a.TIMESTAMP,a.UUID,a.STRING,a.JSON];static BIG_INT_TYPES=[a.INT64,a.UINT64,a.TIMESTAMP];static z=s.z.union([s.z.string().transform(e=>new a(e)),s.z.instanceof(a)])}class p extends P{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return p.bytes(this.valueOf()+e.valueOf())}sub(e){return p.bytes(this.valueOf()-e.valueOf())}truncate(e){return new p(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return p.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/p.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/p.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/p.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/p.TERABYTE.valueOf()}toString(){const e=this.truncate(p.TERABYTE),t=this.truncate(p.GIGABYTE),r=this.truncate(p.MEGABYTE),i=this.truncate(p.KILOBYTE),o=this.truncate(p.BYTE),l=e,d=t.sub(e),f=r.sub(t),g=i.sub(r),m=o.sub(i);let h="";return l.isZero||(h+=`${l.terabytes}TB `),d.isZero||(h+=`${d.gigabytes}GB `),f.isZero||(h+=`${f.megabytes}MB `),g.isZero||(h+=`${g.kilobytes}KB `),(!m.isZero||h==="")&&(h+=`${m.valueOf()}B`),h.trim()}static bytes(e=1){return new p(e)}static BYTE=new p(1);static kilobytes(e=1){return p.bytes(e.valueOf()*1e3)}static KILOBYTE=p.kilobytes(1);static megabytes(e=1){return p.kilobytes(e.valueOf()*1e3)}static MEGABYTE=p.megabytes(1);static gigabytes(e=1){return p.megabytes(e.valueOf()*1e3)}static GIGABYTE=p.gigabytes(1);static terabytes(e){return p.gigabytes(e.valueOf()*1e3)}static TERABYTE=p.terabytes(1);static ZERO=new p(0);static z=s.z.union([s.z.number().transform(e=>new p(e)),s.z.instanceof(p)]);get isZero(){return this.valueOf()===0}}s.z.union([s.z.instanceof(Uint8Array),s.z.instanceof(Uint16Array),s.z.instanceof(Uint32Array),s.z.instanceof(BigUint64Array),s.z.instanceof(Float32Array),s.z.instanceof(Float64Array),s.z.instanceof(Int8Array),s.z.instanceof(Int16Array),s.z.instanceof(Int32Array),s.z.instanceof(BigInt64Array)]);const Ae=n=>{const e=typeof n;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||n instanceof y||n instanceof u||n instanceof Date},Ut=(n,e,t,r=0)=>n.usesBigInt&&!e.usesBigInt?Number(t)-Number(r):!n.usesBigInt&&e.usesBigInt?BigInt(t.valueOf())-BigInt(r.valueOf()):V(t,-r),V=(n,e)=>e==0?n:n==0?e:typeof n=="bigint"&&typeof e=="bigint"||typeof n=="number"&&typeof e=="number"?n+e:Number(n)+Number(e),Ct=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Mt(n){return typeof n=="string"&&Ct.test(n)}const b=[];for(let n=0;n<256;++n)b.push((n+256).toString(16).slice(1));function Bt(n,e=0){return(b[n[e+0]]+b[n[e+1]]+b[n[e+2]]+b[n[e+3]]+"-"+b[n[e+4]]+b[n[e+5]]+"-"+b[n[e+6]]+b[n[e+7]]+"-"+b[n[e+8]]+b[n[e+9]]+"-"+b[n[e+10]]+b[n[e+11]]+b[n[e+12]]+b[n[e+13]]+b[n[e+14]]+b[n[e+15]]).toLowerCase()}function $t(n,e=0){const t=Bt(n,e);if(!Mt(t))throw TypeError("Stringified UUID is invalid");return t}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Ue=(n,e)=>$t(n,e),x=-1,Rt=s.z.string().transform(n=>new Uint8Array(atob(n).split("").map(e=>e.charCodeAt(0))).buffer),Dt=s.z.union([s.z.null(),s.z.undefined()]).transform(()=>new Uint8Array().buffer),te=10,Lt=(n,e)=>{if(n==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(n==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},Ce="sy_x_telem_series";class S{key;discriminator=Ce;dataType;sampleOffset;gl;_data;timeRange=O.ZERO;alignment=0n;cachedMin;cachedMax;writePos=x;_refCount=0;cachedLength;_cachedIndexes;static crudeZ=s.z.object({timeRange:O.z.optional(),dataType:a.z,alignment:s.z.coerce.bigint().optional(),data:s.z.union([Rt,Dt,s.z.instanceof(ArrayBuffer),s.z.instanceof(Uint8Array)]),glBufferUsage:Et.optional().default("static").optional()});static z=S.crudeZ.transform(e=>new S(e));constructor(e){Pt(e)&&(e={data:e}),e.data??=[];const{dataType:t,timeRange:r,sampleOffset:i=0,glBufferUsage:o="static",alignment:l=0n,key:d=zt(),data:f}=e;if(kt(f)){const h=f;this.key=h.key,this.dataType=h.dataType,this.sampleOffset=h.sampleOffset,this.gl=h.gl,this._data=h._data,this.timeRange=h.timeRange,this.alignment=h.alignment,this.cachedMin=h.cachedMin,this.cachedMax=h.cachedMax,this.writePos=h.writePos,this._refCount=h._refCount,this.cachedLength=h.cachedLength;return}const g=Ae(f),m=Array.isArray(f);if(t!=null)this.dataType=new a(t);else{if(f instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(m||g){let h=f;if(!g){if(f.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");h=f[0]}if(typeof h=="string")this.dataType=a.STRING;else if(typeof h=="number")this.dataType=a.FLOAT64;else if(typeof h=="bigint")this.dataType=a.INT64;else if(typeof h=="boolean")this.dataType=a.BOOLEAN;else if(h instanceof y||h instanceof Date||h instanceof y)this.dataType=a.TIMESTAMP;else if(typeof h=="object")this.dataType=a.JSON;else throw new Error(`cannot infer data type of ${typeof h} when constructing a Series from a JS array`)}else this.dataType=new a(f)}if(!m&&!g)this._data=f;else if(m&&f.length===0)this._data=new this.dataType.Array([]).buffer;else{let h=g?[f]:f;const v=h[0];(v instanceof y||v instanceof Date||v instanceof u)&&(h=h.map(w=>new y(w).valueOf())),this.dataType.equals(a.STRING)?(this.cachedLength=h.length,this._data=new TextEncoder().encode(`${h.join(`
30
2
  `)}
31
- `).buffer):this.dataType.equals(G.JSON)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.map(h=>fn.encodeString(h)).join(`
3
+ `).buffer):this.dataType.equals(a.JSON)?(this.cachedLength=h.length,this._data=new TextEncoder().encode(`${h.map(w=>ee.encodeString(w)).join(`
32
4
  `)}
33
- `).buffer):this.dataType.usesBigInt&&typeof y=="number"?this._data=new this.dataType.Array(d.map(h=>BigInt(Math.round(h)))).buffer:!this.dataType.usesBigInt&&typeof y=="bigint"?this._data=new this.dataType.Array(d.map(h=>Number(h))).buffer:this._data=new this.dataType.Array(d).buffer}this.key=a,this.alignment=s,this.sampleOffset=n??0,this.timeRange=i??st.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:o}}static alloc({capacity:t,dataType:r,...i}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const n=new new G(r).Array(t),o=new Ce({data:n.buffer,dataType:r,...i});return o.writePos=0,o}get refCount(){return this._refCount}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===$e)return 0;const r=this.byteCapacity.valueOf()-this.writePos,i=t.subBytes(0,r);return this.writeToUnderlyingData(i),this.writePos+=i.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=i.length,this.calculateCachedLength()),i.length}writeFixed(t){if(this.writePos===$e)return 0;const r=this.capacity-this.writePos,i=t.sub(0,r);return this.writeToUnderlyingData(i),this.cachedLength=void 0,this.maybeRecomputeMinMax(i),this.writePos+=i.length,i.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===$e?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
34
- `).slice(0,-1):Array.from(this).map(t=>t.toString())}toUUIDs(){if(!this.dataType.equals(G.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=G.UUID.density.valueOf(),r=new Uint8Array(this.underlyingData.buffer);return Array.from({length:this.length},(i,n)=>Hf(r,n*t))}parseJSON(t){if(!this.dataType.equals(G.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>t.parse(fn.decodeString(r)))}get byteCapacity(){return new yn(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===$e?this.byteCapacity:this.dataType.isVariable?new yn(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===$e?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const r=[0];return this.data.forEach((i,n)=>{i===$n&&(t++,r.push(n+1))}),this._cachedIndexes=r,this.cachedLength=t,t}convert(t,r=0){if(this.dataType.equals(t))return this;const i=new t.Array(this.length);for(let n=0;n<this.length;n++)i[n]=Gf(this.dataType,t,this.data[n],r);return new Ce({data:i.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(G.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}else{const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??(this.cachedMax=this.calcRawMax()),Nt(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(G.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}else{const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??(this.cachedMin=this.calcRawMin()),Nt(this.cachedMin,this.sampleOffset))}get bounds(){return Ie(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(t){if(this.cachedMin!=null){const r=t.cachedMin??t.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=t.cachedMax??t.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(t,r){const i=Number(t-this.alignment);if(i<0||i>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${i}`);return}return this.at(i,r)}at(t,r){if(this.dataType.isVariable)return this.atVariable(t,r??!1);t<0&&(t=this.length+t);const i=this.data[t];if(i==null){if(r===!0)throw new Error(`[series] - no value at index ${t}`);return}return Nt(i,this.sampleOffset)}atVariable(t,r){let i=0,n=0;if(this._cachedIndexes!=null)i=this._cachedIndexes[t],n=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let s=0;s<this.data.length;s++)if(this.data[s]===$n){if(t===0){n=s;break}i=s+1,t--}if(n===0&&(n=this.data.length),i>=n||t>0){if(r)throw new Error(`[series] - no value at index ${t}`);return}}const o=this.data.slice(i,n);return this.dataType.equals(G.STRING)?new TextDecoder().decode(o):uo(JSON.parse(new TextDecoder().decode(o)))}binarySearch(t){let r=0,i=this.length-1;const n=vl(t);for(;r<=i;){const o=Math.floor((r+i)/2),s=n(this.at(o,!0),t);if(s===0)return o;s<0?r=o+1:i=o-1}return r}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(G.FLOAT32)&&!this.dataType.equals(G.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:i,prevBuffer:n}=this.gl;if(r==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==n)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==$e){n===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const o=this.dataType.density.size(n).valueOf(),s=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,o,s.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,i==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=$e}as(t){return tm(t,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:Ji(this.alignmentBounds.lower),upper:Ji(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return Ie(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new im(this);return this.dataType.equals(G.JSON)?new om(t):t}return new sm(this)}slice(t,r){return this.sliceSub(!1,t,r)}sub(t,r){return this.sliceSub(!0,t,r)}subIterator(t,r){return new Fi(this,t,r??this.length)}subAlignmentIterator(t,r){return new Fi(this,Number(t-this.alignment),Number(r-this.alignment))}subBytes(t,r){if(t>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const i=this.data.subarray(t,r);return new Ce({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,r,i){if(r<=0&&(i==null||i>=this.length))return this;let n;return t?n=this.data.subarray(r,i):n=this.data.slice(r,i),new Ce({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(t){return new Ce({data:this.buffer,dataType:this.dataType,timeRange:st.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var t,r;let i=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)i+=Array.from(this).map(n=>n.toString());else{for(let n=0;n<5;n++)i+=`${(t=this.at(n))==null?void 0:t.toString()}`,i+=",";i+="...,";for(let n=-5;n<0;n++)i+=(r=this.at(n))==null?void 0:r.toString(),n<-1&&(i+=",")}return i+="])",i}};$(rt,"crudeZ",C({timeRange:st.z.optional(),dataType:G.z,alignment:$c().optional(),data:V([Qf,em,M(ArrayBuffer),M(Uint8Array)]),glBufferUsage:Wf.optional().default("static").optional()})),$(rt,"z",rt.crudeZ.transform(e=>new rt(e)));let Ic=rt;const nm=e=>e==null?!1:Array.isArray(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)||e instanceof Ic?!0:_c(e),rm=Vf(wc,Ic);class Fi{constructor(t,r,i){$(this,"series"),$(this,"end"),$(this,"index"),this.series=t;const n=Ie(0,t.length);this.end=Ai(n,i),this.index=Ai(n,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class im{constructor(t){if($(this,"series"),$(this,"index"),$(this,"decoder"),!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==$n;)this.index++;const i=this.index;return t===i?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,i))})}}const kc=class Oc{constructor(t){$(this,"wrapped"),this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:fn.decodeString(t.value,Oc.schema)}}};$(kc,"schema",tn(J(),We()));let om=kc;class sm{constructor(t){$(this,"series"),$(this,"index"),this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}const Ji=e=>{const t=e>>32n,r=e&0xffffffffn;return{domain:t,sample:r}};C({key:J(),value:J()});tn(V([U(),J(),Nu()]),We());const Sc=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",am=Sc(),zc=["macOS","Windows","Linux"],um=["macos","windows","linux"],cm={macos:"macOS",windows:"Windows",linux:"Linux"},lm=ee(zc).or(ee(um).transform(e=>cm[e])),dm=()=>{if(typeof window>"u")return;const e=window.navigator.userAgent.toLowerCase();if(e.includes("mac"))return"macOS";if(e.includes("win"))return"Windows";if(e.includes("linux"))return"Linux"};let ln;const fm=(e={})=>{const{force:t,default:r}=e;return t??ln??(ln=dm(),ln??r)},xc=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:zc,RUNTIME:am,detect:Sc,getOS:fm,osZ:lm},Symbol.toStringTag,{value:"Module"}));var mm=Object.defineProperty,pm=(e,t,r)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,it=(e,t,r)=>pm(e,typeof t!="symbol"?t+"":t,r);const hm=(...e)=>e.map(Nc).join(""),Nc=e=>(e.endsWith("/")||(e+="/"),e.startsWith("/")&&(e=e.slice(1)),e),vm=e=>e.endsWith("/")?e.slice(0,-1):e,gm=(e,t="")=>e===null?"":`?${Object.entries(e).filter(([,r])=>r==null?!1:Array.isArray(r)?r.length>0:!0).map(([r,i])=>`${t}${r}=${i}`).join("&")}`,bn=class _n{constructor({host:t,port:r,protocol:i="",pathPrefix:n=""}){it(this,"protocol"),it(this,"host"),it(this,"port"),it(this,"path"),this.protocol=i,this.host=t,this.port=r,this.path=Nc(n)}replace(t){return new _n({host:t.host??this.host,port:t.port??this.port,protocol:t.protocol??this.protocol,pathPrefix:t.pathPrefix??this.path})}child(t){return new _n({...this,pathPrefix:hm(this.path,t)})}toString(){return vm(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};it(bn,"UNKNOWN",new bn({host:"unknown",port:0}));let ym=bn;var $m=Object.defineProperty,bm=(e,t,r)=>t in e?$m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pe=(e,t,r)=>bm(e,typeof t!="symbol"?t+"":t,r);const _m=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return n=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${T(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${_(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function wm(){return{localeError:_m()}}const Im=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${T(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function km(){return{localeError:Im()}}function Vi(e,t,r,i){const n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}const Om=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return n=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${T(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);if(s){const a=Number(n.maximum),u=Vi(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);if(s){const a=Number(n.minimum),u=Vi(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${_(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function Sm(){return{localeError:Om()}}const zm=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${T(n.values[0])}`:`Opció invàlida: s'esperava una de ${_(n.values," o ")}`;case"too_big":{const o=n.inclusive?"com a màxim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"com a mínim":"més de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function xm(){return{localeError:zm()}}const Nm=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${T(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${_(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function Tm(){return{localeError:Nm()}}const Um=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${T(n.values[0])}`:`Ungültige Option: erwartet eine von ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function jm(){return{localeError:Um()}}const Em=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Pm=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${Em(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${T(i.values[0])}`:`Invalid option: expected one of ${_(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",o=t(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",o=t(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${_(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Tc(){return{localeError:Pm()}}const Zm=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${T(n.values[0])}`:`Opción inválida: se esperaba una de ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado pequeño: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function Dm(){return{localeError:Zm()}}const Am=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return n=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${n.expected} می‌بود، ${r(n.input)} دریافت شد`;case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${T(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${_(n.values,"|")} می‌بود`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{const o=n;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${_(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function Cm(){return{localeError:Am()}}const Rm=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${T(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Mm(){return{localeError:Rm()}}const Lm=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":return n.values.length===1?`Entrée invalide : ${T(n.values[0])} attendu`:`Option invalide : une valeur parmi ${_(n.values,"|")} attendue`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Bm(){return{localeError:Lm()}}const Fm=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${T(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"≤":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"≥":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Jm(){return{localeError:Fm()}}const Vm=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return n=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":return n.values.length===1?`קלט לא תקין: צריך ${T(n.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()} ${s.unit}`:`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`:o.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`:o.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`:o.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`:`${i[o.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${_(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function Wm(){return{localeError:Vm()}}const Gm=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${T(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function qm(){return{localeError:Gm()}}const Ym=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${T(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Km(){return{localeError:Ym()}}const Xm=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${T(n.values[0])}`:`Opzione non valida: atteso uno tra ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${_(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Hm(){return{localeError:Xm()}}const Qm=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return n=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":return n.values.length===1?`無効な入力: ${T(n.values[0])}が期待されました`:`無効な選択: ${_(n.values,"、")}のいずれかである必要があります`;case"too_big":{const o=n.inclusive?"以下である":"より小さい",s=t(n.origin);return s?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{const o=n.inclusive?"以上である":"より大きい",s=t(n.origin);return s?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${_(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function ep(){return{localeError:Qm()}}const tp=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return n=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${T(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${_(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function np(){return{localeError:tp()}}const rp=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return n=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${T(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${_(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",a=t(n.origin),u=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${u} ${o}${s}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{const o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",a=t(n.origin),u=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${u} ${o}${s}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${_(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function ip(){return{localeError:rp()}}const op=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return n=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${T(n.values[0])}`:`Грешана опција: се очекува една ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${_(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function sp(){return{localeError:op()}}const ap=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${T(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function up(){return{localeError:ap()}}const cp=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${T(n.values[0])}`:`Ongeldige optie: verwacht één van ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function lp(){return{localeError:cp()}}const dp=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${T(n.values[0])}`:`Ugyldig valg: forventet en av ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function fp(){return{localeError:dp()}}const mp=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${T(n.values[0])}`:`Fâsit tercih: mûteberler ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function pp(){return{localeError:mp()}}const hp=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return n=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${T(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${_(n.values,"|")} څخه وای`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${_(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function vp(){return{localeError:hp()}}const gp=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return n=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${T(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function yp(){return{localeError:gp()}}const $p=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${T(n.values[0])}`:`Opção inválida: esperada uma das ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function bp(){return{localeError:$p()}}function Wi(e,t,r,i){const n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}const _p=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return n=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${T(n.values[0])}`:`Неверный вариант: ожидалось одно из ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);if(s){const a=Number(n.maximum),u=Wi(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);if(s){const a=Number(n.minimum),u=Wi(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function wp(){return{localeError:_p()}}const Ip=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${T(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function kp(){return{localeError:Ip()}}const Op=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${T(n.values[0])}`:`Ogiltigt val: förväntade en av ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Sp(){return{localeError:Op()}}const zp=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${T(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${_(n.values,"|")} இல் ஒன்று`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=n;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function xp(){return{localeError:zp()}}const Np=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return n=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${T(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(n.origin);return s?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"อย่างน้อย":"มากกว่า",s=t(n.origin);return s?`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${_(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Tp(){return{localeError:Np()}}const Up=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},jp=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${Up(i.input)}`;case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${T(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${_(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",o=t(i.origin);return o?`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${o.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",o=t(i.origin);return o?`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Geçersiz metin: "${n.prefix}" ile başlamalı`:n.format==="ends_with"?`Geçersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Geçersiz metin: "${n.includes}" içermeli`:n.format==="regex"?`Geçersiz metin: ${n.pattern} desenine uymalı`:`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${_(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Ep(){return{localeError:jp()}}const Pp=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return n=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${T(n.values[0])}`:`Неправильна опція: очікується одне з ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function Zp(){return{localeError:Pp()}}const Dp=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return n=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${T(n.values[0])} متوقع تھا`:`غلط آپشن: ${_(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=n;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${_(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Ap(){return{localeError:Dp()}}const Cp=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return n=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${T(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${_(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Rp(){return{localeError:Cp()}}const Mp=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return n=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`无效输入:期望 ${T(n.values[0])}`:`无效选项:期望以下之一 ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Lp(){return{localeError:Mp()}}const Bp=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}const r=n=>{const o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return n=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${T(n.values[0])}`:`無效的選項:預期為以下其中之一 ${_(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=t(n.origin);return s?`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=t(n.origin);return s?`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`:`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${_(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Fp(){return{localeError:Bp()}}const Uc=Object.freeze(Object.defineProperty({__proto__:null,ar:wm,az:km,be:Sm,ca:xm,cs:Tm,de:jm,en:Tc,es:Dm,fa:Cm,fi:Mm,fr:Bm,frCA:Jm,he:Wm,hu:qm,id:Km,it:Hm,ja:ep,kh:np,ko:ip,mk:sp,ms:up,nl:lp,no:fp,ota:pp,pl:yp,ps:vp,pt:bp,ru:wp,sl:kp,sv:Sp,ta:xp,th:Tp,tr:Ep,ua:Zp,ur:Ap,vi:Rp,zhCN:Lp,zhTW:Fp},Symbol.toStringTag,{value:"Module"}));class jc{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");const r=(...i)=>{const n=this._def.input?mn(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const o=t(...n);return this._def.output?mn(this._def.output,o,void 0,{callee:r}):o};return r}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");const r=async(...i)=>{const n=this._def.input?await pn(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const o=await t(...n);return this._def.output?pn(this._def.output,o,void 0,{callee:r}):o};return r}input(...t){const r=this.constructor;return Array.isArray(t[0])?new r({type:"function",input:new Vt({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new r({type:"function",input:t[0],output:this._def.output})}output(t){const r=this.constructor;return new r({type:"function",input:this._def.input,output:t})}}function Ec(e){return new jc({type:"function",input:Array.isArray(e==null?void 0:e.input)?pu(Vt,e==null?void 0:e.input):(e==null?void 0:e.input)??jr(Gn,Zt(Et)),output:(e==null?void 0:e.output)??Zt(Et)})}class wn{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??we,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var i,n,o,s;const a=t._zod.def,u={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(t);if(c)return c.count++,r.schemaPath.includes(t)&&(c.cycle=r.path),c.schema;const f={schema:{},count:1,cycle:void 0};this.seen.set(t,f);const d=(n=(i=t._zod).toJSONSchema)==null?void 0:n.call(i);if(d)f.schema=d;else{const h={...r,schemaPath:[...r.schemaPath,t],path:r.path},I=t._zod.parent;if(I)f.ref=I,this.process(I,h),this.seen.get(I).isParent=!0;else{const w=f.schema;switch(a.type){case"string":{const m=w;m.type="string";const{minimum:b,maximum:v,format:k,patterns:O,contentEncoding:Z}=t._zod.bag;if(typeof b=="number"&&(m.minLength=b),typeof v=="number"&&(m.maxLength=v),k&&(m.format=u[k]??k,m.format===""&&delete m.format),Z&&(m.contentEncoding=Z),O&&O.size>0){const te=[...O];te.length===1?m.pattern=te[0].source:te.length>1&&(f.schema.allOf=[...te.map(_e=>({...this.target==="draft-7"?{type:"string"}:{},pattern:_e.source}))])}break}case"number":{const m=w,{minimum:b,maximum:v,format:k,multipleOf:O,exclusiveMaximum:Z,exclusiveMinimum:te}=t._zod.bag;typeof k=="string"&&k.includes("int")?m.type="integer":m.type="number",typeof te=="number"&&(m.exclusiveMinimum=te),typeof b=="number"&&(m.minimum=b,typeof te=="number"&&(te>=b?delete m.minimum:delete m.exclusiveMinimum)),typeof Z=="number"&&(m.exclusiveMaximum=Z),typeof v=="number"&&(m.maximum=v,typeof Z=="number"&&(Z<=v?delete m.maximum:delete m.exclusiveMaximum)),typeof O=="number"&&(m.multipleOf=O);break}case"boolean":{const m=w;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const m=w;m.type="null";break}case"null":{w.type="null";break}case"any":break;case"unknown":break;case"never":{w.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const m=w,{minimum:b,maximum:v}=t._zod.bag;typeof b=="number"&&(m.minItems=b),typeof v=="number"&&(m.maxItems=v),m.type="array",m.items=this.process(a.element,{...h,path:[...h.path,"items"]});break}case"object":{const m=w;m.type="object",m.properties={};const b=a.shape;for(const O in b)m.properties[O]=this.process(b[O],{...h,path:[...h.path,"properties",O]});const v=new Set(Object.keys(b)),k=new Set([...v].filter(O=>{const Z=a.shape[O]._zod;return this.io==="input"?Z.optin===void 0:Z.optout===void 0}));k.size>0&&(m.required=Array.from(k)),((o=a.catchall)==null?void 0:o._zod.def.type)==="never"?m.additionalProperties=!1:a.catchall?a.catchall&&(m.additionalProperties=this.process(a.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{const m=w;m.anyOf=a.options.map((b,v)=>this.process(b,{...h,path:[...h.path,"anyOf",v]}));break}case"intersection":{const m=w,b=this.process(a.left,{...h,path:[...h.path,"allOf",0]}),v=this.process(a.right,{...h,path:[...h.path,"allOf",1]}),k=Z=>"allOf"in Z&&Object.keys(Z).length===1,O=[...k(b)?b.allOf:[b],...k(v)?v.allOf:[v]];m.allOf=O;break}case"tuple":{const m=w;m.type="array";const b=a.items.map((O,Z)=>this.process(O,{...h,path:[...h.path,"prefixItems",Z]}));if(this.target==="draft-2020-12"?m.prefixItems=b:m.items=b,a.rest){const O=this.process(a.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?m.items=O:m.additionalItems=O}a.rest&&(m.items=this.process(a.rest,{...h,path:[...h.path,"items"]}));const{minimum:v,maximum:k}=t._zod.bag;typeof v=="number"&&(m.minItems=v),typeof k=="number"&&(m.maxItems=k);break}case"record":{const m=w;m.type="object",m.propertyNames=this.process(a.keyType,{...h,path:[...h.path,"propertyNames"]}),m.additionalProperties=this.process(a.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const m=w,b=Un(a.entries);b.every(v=>typeof v=="number")&&(m.type="number"),b.every(v=>typeof v=="string")&&(m.type="string"),m.enum=b;break}case"literal":{const m=w,b=[];for(const v of a.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");b.push(Number(v))}else b.push(v);if(b.length!==0)if(b.length===1){const v=b[0];m.type=v===null?"null":typeof v,m.const=v}else b.every(v=>typeof v=="number")&&(m.type="number"),b.every(v=>typeof v=="string")&&(m.type="string"),b.every(v=>typeof v=="boolean")&&(m.type="string"),b.every(v=>v===null)&&(m.type="null"),m.enum=b;break}case"file":{const m=w,b={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:k,mime:O}=t._zod.bag;v!==void 0&&(b.minLength=v),k!==void 0&&(b.maxLength=k),O?O.length===1?(b.contentMediaType=O[0],Object.assign(m,b)):m.anyOf=O.map(Z=>({...b,contentMediaType:Z})):Object.assign(m,b);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const m=this.process(a.innerType,h);w.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(a.innerType,h),f.ref=a.innerType;break}case"success":{const m=w;m.type="boolean";break}case"default":{this.process(a.innerType,h),f.ref=a.innerType,w.default=JSON.parse(JSON.stringify(a.defaultValue));break}case"prefault":{this.process(a.innerType,h),f.ref=a.innerType,this.io==="input"&&(w._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break}case"catch":{this.process(a.innerType,h),f.ref=a.innerType;let m;try{m=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}w.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const m=w,b=t._zod.pattern;if(!b)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=b.source;break}case"pipe":{const m=this.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;this.process(m,h),f.ref=m;break}case"readonly":{this.process(a.innerType,h),f.ref=a.innerType,w.readOnly=!0;break}case"promise":{this.process(a.innerType,h),f.ref=a.innerType;break}case"optional":{this.process(a.innerType,h),f.ref=a.innerType;break}case"lazy":{const m=t._zod.innerType;this.process(m,h),f.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const y=this.metadataRegistry.get(t);return y&&Object.assign(f.schema,y),this.io==="input"&&H(t)&&(delete f.schema.examples,delete f.schema.default),this.io==="input"&&f.schema._prefault&&((s=f.schema).default??(s.default=f.schema._prefault)),delete f.schema._prefault,this.seen.get(t).schema}emit(t,r){var i,n,o,s;const a={cycles:(r==null?void 0:r.cycles)??"ref",reused:(r==null?void 0:r.reused)??"inline",external:(r==null?void 0:r.external)??void 0},u=this.seen.get(t);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const c=I=>{var w;const m=this.target==="draft-2020-12"?"$defs":"definitions";if(a.external){const k=(w=a.external.registry.get(I[0]))==null?void 0:w.id;if(k)return{ref:a.external.uri(k)};const O=I[1].defId??I[1].schema.id??`schema${this.counter++}`;return I[1].defId=O,{defId:O,ref:`${a.external.uri("__shared")}#/${m}/${O}`}}if(I[1]===u)return{ref:"#"};const b=`#/${m}/`,v=I[1].schema.id??`__schema${this.counter++}`;return{defId:v,ref:b+v}},f=I=>{if(I[1].schema.$ref)return;const w=I[1],{ref:m,defId:b}=c(I);w.def={...w.schema},b&&(w.defId=b);const v=w.schema;for(const k in v)delete v[k];v.$ref=m};for(const I of this.seen.entries()){const w=I[1];if(t===I[0]){f(I);continue}if(a.external){const m=(i=a.external.registry.get(I[0]))==null?void 0:i.id;if(t!==I[0]&&m){f(I);continue}}if((n=this.metadataRegistry.get(I[0]))!=null&&n.id){f(I);continue}if(w.cycle){if(a.cycles==="throw")throw new Error(`Cycle detected: #/${(o=w.cycle)==null?void 0:o.join("/")}/<root>
35
-
36
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);a.cycles==="ref"&&f(I);continue}if(w.count>1&&a.reused==="ref"){f(I);continue}}const d=(I,w)=>{const m=this.seen.get(I),b=m.def??m.schema,v={...b};if(m.ref===null)return;const k=m.ref;if(m.ref=null,k){d(k,w);const O=this.seen.get(k).schema;O.$ref&&w.target==="draft-7"?(b.allOf=b.allOf??[],b.allOf.push(O)):(Object.assign(b,O),Object.assign(b,v))}m.isParent||this.override({zodSchema:I,jsonSchema:b})};for(const I of[...this.seen.entries()].reverse())d(I[0],{target:this.target});const y={};this.target==="draft-2020-12"?y.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?y.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(y,u.def);const h=((s=a.external)==null?void 0:s.defs)??{};for(const I of this.seen.entries()){const w=I[1];w.def&&w.defId&&(h[w.defId]=w.def)}!a.external&&Object.keys(h).length>0&&(this.target==="draft-2020-12"?y.$defs=h:y.definitions=h);try{return JSON.parse(JSON.stringify(y))}catch{throw new Error("Error converting schema to JSON.")}}}function Pc(e,t){if(e instanceof Xn){const i=new wn(t),n={};for(const a of e._idmap.entries()){const[u,c]=a;i.process(c)}const o={},s={registry:e,uri:(t==null?void 0:t.uri)||(a=>a),defs:n};for(const a of e._idmap.entries()){const[u,c]=a;o[u]=i.emit(c,{...t,external:s})}if(Object.keys(n).length>0){const a=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[a]:n}}return{schemas:o}}const r=new wn(t);return r.process(e),r.emit(e,t)}function H(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return H(i.element,r);case"object":{for(const n in i.shape)if(H(i.shape[n],r))return!0;return!1}case"union":{for(const n of i.options)if(H(n,r))return!0;return!1}case"intersection":return H(i.left,r)||H(i.right,r);case"tuple":{for(const n of i.items)if(H(n,r))return!0;return!!(i.rest&&H(i.rest,r))}case"record":return H(i.keyType,r)||H(i.valueType,r);case"map":return H(i.keyType,r)||H(i.valueType,r);case"set":return H(i.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return H(i.innerType,r);case"lazy":return H(i.getter(),r);case"default":return H(i.innerType,r);case"prefault":return H(i.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return H(i.in,r)||H(i.out,r);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const Jp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Vp=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:sa,$ZodArray:Gn,$ZodAsyncError:Be,$ZodBase64:Ys,$ZodBase64URL:Xs,$ZodBigInt:Wn,$ZodBigIntFormat:na,$ZodBoolean:Vn,$ZodCIDRv4:Gs,$ZodCIDRv6:qs,$ZodCUID:Ds,$ZodCUID2:As,$ZodCatch:Oa,$ZodCheck:Y,$ZodCheckBigIntFormat:fs,$ZodCheckEndsWith:ks,$ZodCheckGreaterThan:Bn,$ZodCheckIncludes:ws,$ZodCheckLengthEquals:ys,$ZodCheckLessThan:Ln,$ZodCheckLowerCase:bs,$ZodCheckMaxLength:vs,$ZodCheckMaxSize:ms,$ZodCheckMimeType:Ss,$ZodCheckMinLength:gs,$ZodCheckMinSize:ps,$ZodCheckMultipleOf:ls,$ZodCheckNumberFormat:ds,$ZodCheckOverwrite:zs,$ZodCheckProperty:Os,$ZodCheckRegex:$s,$ZodCheckSizeEquals:hs,$ZodCheckStartsWith:Is,$ZodCheckStringFormat:vt,$ZodCheckUpperCase:_s,$ZodCustom:Ua,$ZodDate:ca,$ZodDefault:_a,$ZodDiscriminatedUnion:da,$ZodE164:Hs,$ZodEmail:js,$ZodEmoji:Ps,$ZodEnum:va,$ZodError:En,$ZodFile:ya,$ZodFunction:jc,$ZodGUID:Ts,$ZodIPv4:Vs,$ZodIPv6:Ws,$ZodISODate:Bs,$ZodISODateTime:Ls,$ZodISODuration:Js,$ZodISOTime:Fs,$ZodIntersection:fa,$ZodJWT:ea,$ZodKSUID:Ms,$ZodLazy:Ta,$ZodLiteral:ga,$ZodMap:pa,$ZodNaN:Sa,$ZodNanoID:Zs,$ZodNever:aa,$ZodNonOptional:Ia,$ZodNull:oa,$ZodNullable:ba,$ZodNumber:Jn,$ZodNumberFormat:ta,$ZodObject:la,$ZodOptional:$a,$ZodPipe:Kn,$ZodPrefault:wa,$ZodPromise:Na,$ZodReadonly:za,$ZodRealError:ht,$ZodRecord:ma,$ZodRegistry:Xn,$ZodSet:ha,$ZodString:gt,$ZodStringFormat:L,$ZodSuccess:ka,$ZodSymbol:ra,$ZodTemplateLiteral:xa,$ZodTransform:Yn,$ZodTuple:Vt,$ZodType:z,$ZodULID:Cs,$ZodURL:Es,$ZodUUID:Us,$ZodUndefined:ia,$ZodUnion:qn,$ZodUnknown:Et,$ZodVoid:ua,$ZodXID:Rs,$brand:co,$constructor:l,$input:Ea,$output:ja,Doc:xs,JSONSchema:Jp,JSONSchemaGenerator:wn,TimePrecision:Da,_any:ru,_array:jr,_base64:vr,_base64url:gr,_bigint:Ka,_boolean:qa,_catch:td,_cidrv4:pr,_cidrv6:hr,_coercedBigint:Xa,_coercedBoolean:Ya,_coercedDate:au,_coercedNumber:Ba,_coercedString:Za,_cuid:ar,_cuid2:ur,_custom:vu,_date:su,_default:Hl,_discriminatedUnion:Ll,_e164:yr,_email:Qn,_emoji:or,_endsWith:Sr,_enum:Wl,_file:hu,_float32:Ja,_float64:Va,_gt:Oe,_gte:ue,_guid:Pt,_includes:kr,_int:Fa,_int32:Wa,_int64:Ha,_intersection:Bl,_ipv4:fr,_ipv6:mr,_isoDate:Ca,_isoDateTime:Aa,_isoDuration:Ma,_isoTime:Ra,_jwt:$r,_ksuid:dr,_lazy:od,_length:qt,_literal:ql,_lowercase:wr,_lt:ke,_lte:de,_map:Jl,_max:de,_maxLength:Gt,_maxSize:Wt,_mime:zr,_min:ue,_minLength:Ve,_minSize:dt,_multipleOf:lt,_nan:uu,_nanoid:sr,_nativeEnum:Gl,_negative:lu,_never:iu,_nonnegative:fu,_nonoptional:Ql,_nonpositive:du,_normalize:xr,_null:nu,_nullable:Xl,_number:La,_optional:Kl,_overwrite:Pe,_parse:Dn,_parseAsync:An,_pipe:nd,_positive:cu,_promise:sd,_property:mu,_readonly:rd,_record:Fl,_refine:gu,_regex:_r,_safeParse:Cn,_safeParseAsync:Rn,_set:Vl,_size:br,_startsWith:Or,_string:Pa,_stringbool:yu,_success:ed,_symbol:eu,_templateLiteral:id,_toLowerCase:Tr,_toUpperCase:Ur,_transform:Yl,_trim:Nr,_tuple:pu,_uint32:Ga,_uint64:Qa,_ulid:cr,_undefined:tu,_union:Ml,_unknown:Zt,_uppercase:Ir,_url:ir,_uuid:er,_uuidv4:tr,_uuidv6:nr,_uuidv7:rr,_void:ou,_xid:lr,clone:he,config:ae,flattenError:Pn,formatError:Zn,function:Ec,globalConfig:Tt,globalRegistry:we,isValidBase64:Fn,isValidBase64URL:Ks,isValidJWT:Qs,locales:Uc,parse:mn,parseAsync:pn,prettifyError:zo,regexes:us,registry:Hn,safeParse:xo,safeParseAsync:No,toDotPath:So,toJSONSchema:Pc,treeifyError:Oo,util:Tl,version:Ns},Symbol.toStringTag,{value:"Module"})),Wp={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},Gp=Object.freeze({status:"aborted"}),qp=Gp;function Yp(e){ae({customError:e})}function Kp(){return ae().customError}ae(Tc());const q=Object.freeze(Object.defineProperty({__proto__:null,$brand:co,$input:Ea,$output:ja,NEVER:qp,TimePrecision:Da,ZodAny:Eu,ZodArray:Au,ZodBase64:Xr,ZodBase64URL:Hr,ZodBigInt:Ht,ZodBigIntFormat:ni,ZodBoolean:Xt,ZodCIDRv4:Yr,ZodCIDRv6:Kr,ZodCUID:Br,ZodCUID2:Fr,ZodCatch:ec,ZodCustom:nn,ZodDate:ii,ZodDefault:qu,ZodDiscriminatedUnion:Cu,ZodE164:Qr,ZodEmail:Cr,ZodEmoji:Mr,ZodEnum:ft,ZodError:ud,ZodFile:Wu,ZodGUID:Dt,ZodIPv4:Gr,ZodIPv6:qr,ZodISODate:Pr,ZodISODateTime:Er,ZodISODuration:Dr,ZodISOTime:Zr,ZodIntersection:Ru,ZodIssueCode:Wp,ZodJWT:ei,ZodKSUID:Wr,ZodLazy:sc,ZodLiteral:Ju,ZodMap:Bu,ZodNaN:nc,ZodNanoID:Lr,ZodNever:Zu,ZodNonOptional:li,ZodNull:ju,ZodNullable:Gu,ZodNumber:Kt,ZodNumberFormat:Ye,ZodObject:en,ZodOptional:ci,ZodPipe:di,ZodPrefault:Ku,ZodPromise:uc,ZodReadonly:rc,ZodRealError:yt,ZodRecord:si,ZodSet:Fu,ZodString:Yt,ZodStringFormat:B,ZodSuccess:Qu,ZodSymbol:xu,ZodTemplateLiteral:oc,ZodTransform:ai,ZodTuple:Lu,ZodType:j,ZodULID:Jr,ZodURL:Rr,ZodUUID:ge,ZodUndefined:Tu,ZodUnion:oi,ZodUnknown:Pu,ZodVoid:Du,ZodXID:Vr,_ZodString:Ar,_default:Yu,any:Ad,array:$t,base64:zd,base64url:xd,bigint:Se,boolean:ti,catch:tc,check:cc,cidrv4:Od,cidrv6:Sd,clone:he,coerce:Mf,config:ae,core:Vp,cuid:yd,cuid2:$d,custom:ef,date:Rd,discriminatedUnion:Fd,e164:Nd,email:cd,emoji:vd,endsWith:Sr,enum:ee,file:qd,flattenError:Pn,float32:Ud,float64:jd,formatError:Zn,function:Ec,getErrorMap:Kp,globalRegistry:we,gt:Oe,gte:ue,guid:ld,includes:kr,instanceof:M,int:vn,int32:Ed,int64:Zd,intersection:Mu,ipv4:Id,ipv6:kd,iso:ad,json:nf,jwt:Td,keyof:Md,ksuid:wd,lazy:ac,length:qt,literal:Vu,locales:Uc,looseObject:Bd,lowercase:wr,lt:ke,lte:de,map:Vd,maxLength:Gt,maxSize:Wt,mime:zr,minLength:Ve,minSize:dt,multipleOf:lt,nan:Xd,nanoid:gd,nativeEnum:Gd,negative:lu,never:Qt,nonnegative:fu,nonoptional:Hu,nonpositive:du,normalize:xr,null:ri,nullable:Ct,nullish:Yd,number:U,object:C,optional:At,overwrite:Pe,parse:ku,parseAsync:Ou,partialRecord:Jd,pipe:Rt,positive:cu,prefault:Xu,preprocess:rf,prettifyError:zo,promise:Qd,property:mu,readonly:ic,record:tn,refine:lc,regex:_r,regexes:us,registry:Hn,safeParse:Su,safeParseAsync:zu,set:Wd,setErrorMap:Yp,size:br,startsWith:Or,strictObject:Ld,string:J,stringbool:tf,success:Kd,superRefine:dc,symbol:Nu,templateLiteral:Hd,toJSONSchema:Pc,toLowerCase:Tr,toUpperCase:Ur,transform:ui,treeifyError:Oo,trim:Nr,tuple:Ke,uint32:Pd,uint64:Dd,ulid:bd,undefined:Uu,union:V,unknown:We,uppercase:Ir,url:hd,uuid:dd,uuidv4:fd,uuidv6:md,uuidv7:pd,void:Cd,xid:_d},Symbol.toStringTag,{value:"Module"})),Xp=async e=>await new Promise(t=>setTimeout(t,P.fromMilliseconds(e).milliseconds));class Hp{constructor(t){pe(this,"config"),pe(this,"retries"),pe(this,"interval"),this.config={baseInterval:new P((t==null?void 0:t.baseInterval)??P.seconds(1)),maxRetries:(t==null?void 0:t.maxRetries)??5,scale:(t==null?void 0:t.scale)??1,sleepFn:(t==null?void 0:t.sleepFn)??Xp},this.retries=0,this.interval=new P(this.config.baseInterval)}async wait(){const{maxRetries:t,scale:r,sleepFn:i}=this.config;return this.retries>=t?!1:(await i(this.interval),this.interval=this.interval.mult(r),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}}const Qp=C({baseInterval:P.z.optional(),maxRetries:U().optional(),scale:U().optional()}),eh=Object.freeze(Object.defineProperty({__proto__:null,Breaker:Hp,breakerConfigZ:Qp},Symbol.toStringTag,{value:"Module"})),th=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Zc=J().regex(th),Le=U().min(0).max(255),Dc=U().min(0).max(1),Ac=Ke([Le,Le,Le,Dc]),nh=Ke([Le,Le,Le]),rh=C({rgba255:Ac}),ih=U().min(0).max(360),oh=U().min(0).max(100),sh=U().min(0).max(100),ah=Ke([ih,oh,sh,Dc]),mi=V([Zc,nh,Ac,ah,rh]),uh=mi.transform(e=>pi(e)),pi=(e,t=1)=>{if(e=mi.parse(e),typeof e=="string")return ch(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}return e.rgba255},ch=(e,t=1)=>(e=Zc.parse(e),e=lh(e),[kt(e,0),kt(e,2),kt(e,4),e.length===8?kt(e,6)/255:t]),kt=(e,t)=>parseInt(e.slice(t,t+2),16),lh=e=>e.startsWith("#")?e.slice(1):e;pi("#000000");pi("#ffffff");const dh=C({key:J(),color:mi,position:U(),switched:ti().optional()});$t(dh);const fh=C({key:J(),name:J(),color:uh});C({key:J(),name:J(),swatches:$t(fh)});U().int().min(0).max(255);C({name:J(),key:J()});const mh=e=>Object.getOwnPropertySymbols(globalThis).includes(e),ph=(e,t)=>{const r=Symbol.for(e);if(!mh(r)){const i=t();Object.defineProperty(globalThis,r,{value:i})}return()=>globalThis[r]},Cc="sy_x_error",hh=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),on=e=>{var t;return t=class extends Error{constructor(r,i){super(r,i),pe(this,"discriminator",t.discriminator),pe(this,"type",t.TYPE),pe(this,"matches",t.matches),this.name=t.TYPE}static sub(r){return on(`${e}.${r}`)}},pe(t,"discriminator",Cc),pe(t,"TYPE",e),pe(t,"matches",hh(e)),t},Rc=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==Cc)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},Re="unknown",In="nil";class vh{constructor(){pe(this,"providers",[])}register(t){this.providers.push(t)}encode(t){if(t==null)return{type:In,data:""};if(Rc(t))for(const r of this.providers){const i=r.encode(t);if(i!=null)return i}if(t instanceof Error)return{type:Re,data:t.message};if(typeof t=="string")return{type:Re,data:t};try{return{type:Re,data:JSON.stringify(t)}}catch{return{type:Re,data:"unable to encode error information"}}}decode(t){if(t==null||t.type===In)return null;if(t.type===Re)return new kn(t.data);for(const r of this.providers){const i=r.decode(t);if(i!=null)return i}return new kn(t.data)}}const hi=ph("synnax-error-registry",()=>new vh),gh=({encode:e,decode:t})=>hi().register({encode:e,decode:t}),yh=e=>hi().encode(e),$h=e=>e==null?null:hi().decode(e);class kn extends on("unknown"){}const bh=C({type:J(),data:J()});class _h extends on("canceled"){}const be=Object.freeze(Object.defineProperty({__proto__:null,Canceled:_h,NONE:In,UNKNOWN:Re,Unknown:kn,createTyped:on,decode:$h,encode:yh,isTyped:Rc,payloadZ:bh,register:gh},Symbol.toStringTag,{value:"Module"})),wh=q.object({jsonrpc:q.literal("2.0"),method:q.string(),params:q.any().optional(),id:q.union([q.string(),q.number(),q.null()]).optional()}),Mc=q.object({jsonrpc:q.literal("2.0"),id:q.union([q.string(),q.number(),q.null()])}),Ih=Mc.extend({result:q.json()}),kh=Mc.extend({error:q.object({code:q.number().int(),message:q.string().optional(),data:q.json().optional()})}),Oh=q.union([Ih,kh]);q.union([wh,Oh]);J().regex(/^\d+\.\d+\.\d+$/);const Sh=["standard","scientific","engineering"];ee(Sh);ee(["success","info","warning","error","loading","disabled"]);class bt extends be.createTyped("freighter"){}class ze extends bt.sub("eof"){constructor(){super("EOF")}}class xe extends bt.sub("stream_closed"){constructor(){super("StreamClosed")}}class Ne extends bt.sub("unreachable"){constructor(r={}){const{message:i="Unreachable",url:n=ym.UNKNOWN}=r;super(i);K(this,"url");this.url=n}}const zh=e=>{if(!e.type.startsWith(bt.TYPE))return null;if(ze.matches(e))return{type:ze.TYPE,data:"EOF"};if(xe.matches(e))return{type:xe.TYPE,data:"StreamClosed"};if(Ne.matches(e))return{type:Ne.TYPE,data:"Unreachable"};throw new Error(`Unknown error type: ${e.type}: ${e.message}`)},xh=e=>{if(!e.type.startsWith(bt.TYPE))return null;switch(e.type){case ze.TYPE:return new ze;case xe.TYPE:return new xe;case Ne.TYPE:return new Ne;default:throw new be.Unknown(`Unknown error type: ${e.data}`)}};be.register({encode:zh,decode:xh});class Lc{constructor(){K(this,"middleware",[])}use(...t){this.middleware.push(...t)}async executeMiddleware(t,r){let i=0;const n=async o=>{if(i===this.middleware.length)return await r(o);const s=this.middleware[i];return i++,await s(o,n)};return await n(t)}}const Bc="Content-Type",Gi=e=>{if(xc.RUNTIME!=="node")return fetch;const t=require("node-fetch");if(e==="http")return t;const r=require("https"),i=new r.Agent({rejectUnauthorized:!1});return async(n,o)=>await t(n,{...o,agent:i})},Nh=e=>"code"in e&&e.code==="ECONNREFUSED"||e.message.toLowerCase().includes("load failed"),Th=400;class Uh extends Lc{constructor(r,i,n=!1){super();K(this,"endpoint");K(this,"encoder");K(this,"fetch");return this.endpoint=r.replace({protocol:n?"https":"http"}),this.encoder=i,this.fetch=Gi(this.endpoint.protocol),new Proxy(this,{get:(o,s,a)=>s==="endpoint"?this.endpoint:Reflect.get(o,s,a)})}get headers(){return{[Bc]:this.encoder.contentType}}async send(r,i,n,o){i=n==null?void 0:n.parse(i);let s=null;const a=this.endpoint.child(r),u={};u.method="POST",u.body=this.encoder.encode(i??{});const[,c]=await this.executeMiddleware({target:a.toString(),protocol:this.endpoint.protocol,params:{},role:"client"},async f=>{const d={...f,params:{}};u.headers={...this.headers,...f.params};let y;try{y=await Gi(f.protocol)(f.target,u)}catch(I){let w=I;return Nh(w)&&(w=new Ne({url:a})),[d,w]}const h=await y.arrayBuffer();if(y!=null&&y.ok)return o!=null&&(s=this.encoder.decode(h,o)),[d,null];try{if(y.status!==Th)return[d,new Error(y.statusText)];const I=this.encoder.decode(h,be.payloadZ),w=be.decode(I);return[d,w]}catch(I){return[d,new Error(`[freighter] - failed to decode error: ${y.statusText}: ${I.message}`)]}});if(c!=null)return[null,c];if(s==null)throw new Error("Response must be defined");return[s,null]}}const jh=(e,t)=>{class r{constructor(n){K(this,"wrapped");this.wrapped=n}use(...n){this.wrapped.use(...n)}async send(n,o,s,a){const u=new eh.Breaker(t);do{const[c,f]=await this.wrapped.send(n,o,s,a);if(f==null)return[c,null];if(!Ne.matches(f))return[null,f];if(!await u.wait())return[c,f]}while(!0)}}return new r(e)},Eh=async(e,t,r,i,n)=>{const[o,s]=await e.send(t,r,i,n);if(s!=null)throw s;return o};function x(e,t,r){function i(a,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var u;const c=r!=null&&r.Parent?new o:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const f of c._zod.deferred)f();return c}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var u,c;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(c=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class mt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Fc={};function Te(e){return Fc}function Ph(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function Zh(e,t){return typeof t=="bigint"?t.toString():t}function Jc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vi(e){return e==null}function gi(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function F(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function yi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vc(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function He(e){return JSON.stringify(e)}function On(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dh=Jc(()=>{if(typeof navigator<"u"&&(navigator!=null&&navigator.userAgent.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qi(e){if(On(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(On(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}const Ah=new Set(["string","number","symbol"]);function Ch(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Rh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Mh(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return Ze(e,{...e._zod.def,shape:r,checks:[]})}function Lh(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return Ze(e,{...e._zod.def,shape:r,checks:[]})}function Bh(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return yi(this,"shape",i),i},checks:[]};return Ze(e,r)}function Fh(e,t){return Ze(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yi(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function Jh(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(const o in i)n[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Ze(t,{...t._zod.def,shape:n,checks:[]})}function Vh(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const o in r){if(!(o in n))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)n[o]=new e({type:"nonoptional",innerType:i[o]});return Ze(t,{...t._zod.def,shape:n,checks:[]})}function at(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function $i(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Ot(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ue(e,t,r){var n,o,s,a,u,c;const i={...e,path:e.path??[]};if(!e.message){const f=Ot((s=(o=(n=e.inst)==null?void 0:n._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??Ot((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Ot((u=r.customError)==null?void 0:u.call(r,e))??Ot((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";i.message=f}return delete i.inst,delete i.continue,t!=null&&t.reportInput||delete i.input,i}function bi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function pt(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const Wc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Zh,2)},enumerable:!0})},Gc=x("$ZodError",Wc),qc=x("$ZodError",Wc,{Parent:Error});function Wh(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Gh(e,t){const r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let a=i,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return n(e),i}const qh=e=>(t,r,i,n)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new mt;if(s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(u=>Ue(u,o,Te())));throw Error.captureStackTrace(a,n==null?void 0:n.callee),a}return s.value},Yh=e=>async(t,r,i,n)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(u=>Ue(u,o,Te())));throw Error.captureStackTrace(a,n==null?void 0:n.callee),a}return s.value},Yc=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new mt;return o.issues.length?{success:!1,error:new(e??Gc)(o.issues.map(s=>Ue(s,n,Te())))}:{success:!0,data:o.value}},Kh=Yc(qc),Kc=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>Ue(s,n,Te())))}:{success:!0,data:o.value}},Xh=Kc(qc),Xe=x("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Hh=x("$ZodCheckMaxLength",(e,t)=>{Xe.init(e,t),e._zod.when=r=>{const i=r.value;return!vi(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=bi(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Qh=x("$ZodCheckMinLength",(e,t)=>{Xe.init(e,t),e._zod.when=r=>{const i=r.value;return!vi(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=bi(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ev=x("$ZodCheckLengthEquals",(e,t)=>{Xe.init(e,t),e._zod.when=r=>{const i=r.value;return!vi(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const o=bi(i),s=n>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),tv=x("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class nv{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
37
- `).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
38
- `))}}const rv={major:4,minor:0,patch:0},Q=x("$ZodType",(e,t)=>{var n;var r;e??(e={}),F(e._zod,"id",()=>t.type+"_"+Vc(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rv;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),(n=e._zod.deferred)==null||n.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,u)=>{let c=at(s),f;for(const d of a){if(d._zod.when){if(!d._zod.when(s))continue}else if(c)continue;const y=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&(u==null?void 0:u.async)===!1)throw new mt;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==y&&(c||(c=at(s,y)))});else{if(s.issues.length===y)continue;c||(c=at(s,y))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new mt;return u.then(c=>o(c,i,a))}return o(u,i,a)}}e["~standard"]={validate:o=>{var s;try{const a=Kh(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return Xh(e,o).then(u=>{var c;return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}}),iv=x("$ZodUnknown",(e,t)=>{Q.init(e,t),e._zod.parse=r=>r}),ov=x("$ZodNever",(e,t)=>{Q.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Yi(e,t,r){e.issues.length&&t.issues.push(...$i(r,e.issues)),t.value[r]=e.value}const sv=x("$ZodArray",(e,t)=>{Q.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const o=[];for(let s=0;s<n.length;s++){const a=n[s],u=t.element._zod.run({value:a,issues:[]},i);u instanceof Promise?o.push(u.then(c=>Yi(c,r,s))):Yi(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function St(e,t,r){e.issues.length&&t.issues.push(...$i(r,e.issues)),t.value[r]=e.value}function Ki(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...$i(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const av=x("$ZodObject",(e,t)=>{Q.init(e,t);const r=Jc(()=>{const d=Object.keys(t.shape);for(const h of d)if(!(t.shape[h]instanceof Q))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const y=Rh(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(y)}});F(e._zod,"propValues",()=>{const d=t.shape,y={};for(const h in d){const I=d[h]._zod;if(I.values){y[h]??(y[h]=new Set);for(const w of I.values)y[h].add(w)}}return y});const i=d=>{const y=new nv(["shape","payload","ctx"]),{keys:h,optionalKeys:I}=r.value,w=v=>{const k=He(v);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};y.write("const input = payload.value;");const m=Object.create(null);for(const v of h)m[v]=Vc(15);y.write("const newResult = {}");for(const v of h)if(I.has(v)){const k=m[v];y.write(`const ${k} = ${w(v)};`);const O=He(v);y.write(`
39
- if (${k}.issues.length) {
40
- if (input[${O}] === undefined) {
41
- if (${O} in input) {
42
- newResult[${O}] = undefined;
43
- }
44
- } else {
45
- payload.issues = payload.issues.concat(
46
- ${k}.issues.map((iss) => ({
47
- ...iss,
48
- path: iss.path ? [${O}, ...iss.path] : [${O}],
49
- }))
50
- );
51
- }
52
- } else if (${k}.value === undefined) {
53
- if (${O} in input) newResult[${O}] = undefined;
54
- } else {
55
- newResult[${O}] = ${k}.value;
56
- }
57
- `)}else{const k=m[v];y.write(`const ${k} = ${w(v)};`),y.write(`
58
- if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
59
- ...iss,
60
- path: iss.path ? [${He(v)}, ...iss.path] : [${He(v)}]
61
- })));`),y.write(`newResult[${He(v)}] = ${k}.value`)}y.write("payload.value = newResult;"),y.write("return payload;");const b=y.compile();return(v,k)=>b(d,v,k)};let n;const o=On,s=!Fc.jitless,u=s&&Dh.value,{catchall:c}=t;let f;e._zod.parse=(d,y)=>{f??(f=r.value);const h=d.value;if(!o(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;const I=[];if(s&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0)n||(n=i(t.shape)),d=n(d,y);else{d.value={};const k=f.shape;for(const O of f.keys){const Z=k[O],te=Z._zod.run({value:h[O],issues:[]},y),_e=Z._zod.optin==="optional"&&Z._zod.optout==="optional";te instanceof Promise?I.push(te.then(_i=>_e?Ki(_i,d,O,h):St(_i,d,O))):_e?Ki(te,d,O,h):St(te,d,O)}}if(!c)return I.length?Promise.all(I).then(()=>d):d;const w=[],m=f.keySet,b=c._zod,v=b.def.type;for(const k of Object.keys(h)){if(m.has(k))continue;if(v==="never"){w.push(k);continue}const O=b.run({value:h[k],issues:[]},y);O instanceof Promise?I.push(O.then(Z=>St(Z,d,k))):St(O,d,k)}return w.length&&d.issues.push({code:"unrecognized_keys",keys:w,input:h,inst:e}),I.length?Promise.all(I).then(()=>d):d}});function Xi(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(o=>Ue(o,i,Te())))}),t}const uv=x("$ZodUnion",(e,t)=>{Q.init(e,t),F(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>gi(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const o=[];for(const s of t.options){const a=s._zod.run({value:r.value,issues:[]},i);if(a instanceof Promise)o.push(a),n=!0;else{if(a.issues.length===0)return a;o.push(a)}}return n?Promise.all(o).then(s=>Xi(s,r,e,i)):Xi(o,r,e,i)}}),cv=x("$ZodIntersection",(e,t)=>{Q.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,c])=>Hi(r,u,c)):Hi(r,o,s)}});function Sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qi(e)&&qi(t)){const r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(const o of i){const s=Sn(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],o=t[i],s=Sn(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Hi(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),at(e))return e;const i=Sn(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const lv=x("$ZodEnum",(e,t)=>{Q.init(e,t);const r=Ph(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>Ah.has(typeof i)).map(i=>typeof i=="string"?Ch(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const o=i.value;return e._zod.values.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:e}),i}}),dv=x("$ZodTransform",(e,t)=>{Q.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new mt;return r.value=n,r}}),fv=x("$ZodOptional",(e,t)=>{Q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${gi(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),mv=x("$ZodNullable",(e,t)=>{Q.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${gi(r.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),pv=x("$ZodDefault",(e,t)=>{Q.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Qi(o,t)):Qi(n,t)}});function Qi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const hv=x("$ZodPrefault",(e,t)=>{Q.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),vv=x("$ZodNonOptional",(e,t)=>{Q.init(e,t),F(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>eo(o,e)):eo(n,e)}});function eo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const gv=x("$ZodCatch",(e,t)=>{Q.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Ue(s,i,Te()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>Ue(o,i,Te()))},input:r.value}),r.issues=[]),r)}}),yv=x("$ZodPipe",(e,t)=>{Q.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>to(o,t,i)):to(n,t,i)}});function to(e,t,r){return at(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const $v=x("$ZodReadonly",(e,t)=>{Q.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(no):no(n)}});function no(e){return e.value=Object.freeze(e.value),e}const bv=x("$ZodCustom",(e,t)=>{Xe.init(e,t),Q.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>ro(o,r,i,e));ro(n,r,i,e)}});function ro(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(pt(n))}}class _v{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function wv(){return new _v}const zt=wv();function Iv(e){return new e({type:"unknown"})}function kv(e,t){return new e({type:"never",...ce(t)})}function Ov(e,t){return new Hh({check:"max_length",...ce(t),maximum:e})}function io(e,t){return new Qh({check:"min_length",...ce(t),minimum:e})}function Sv(e,t){return new ev({check:"length_equals",...ce(t),length:e})}function zv(e){return new tv({check:"overwrite",tx:e})}function xv(e,t,r){return new e({type:"array",element:t,...ce(r)})}function Nv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}const Tv=(e,t)=>{Gc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Gh(e,r)},flatten:{value:r=>Wh(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},sn=x("ZodError",Tv,{Parent:Error}),Uv=qh(sn),jv=Yh(sn),Ev=Yc(sn),Pv=Kc(sn),ie=x("ZodType",(e,t)=>(Q.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Ze(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>Uv(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Ev(e,r,i),e.parseAsync=async(r,i)=>jv(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Pv(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(ag(r,i)),e.superRefine=r=>e.check(ug(r)),e.overwrite=r=>e.check(zv(r)),e.optional=()=>Nn(e),e.nullable=()=>oo(e),e.nullish=()=>Nn(oo(e)),e.nonoptional=r=>Qv(e,r),e.array=()=>Rv(e),e.or=r=>Fv([e,r]),e.and=r=>Vv(e,r),e.transform=r=>so(e,Gv(r)),e.default=r=>Kv(e,r),e.prefault=r=>Hv(e,r),e.catch=r=>tg(e,r),e.pipe=r=>so(e,r),e.readonly=()=>ig(e),e.describe=r=>{const i=e.clone();return zt.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=zt.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return zt.get(e);const i=e.clone();return zt.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zv=x("ZodUnknown",(e,t)=>{iv.init(e,t),ie.init(e,t)});function zn(){return Iv(Zv)}const Dv=x("ZodNever",(e,t)=>{ov.init(e,t),ie.init(e,t)});function Av(e){return kv(Dv,e)}const Cv=x("ZodArray",(e,t)=>{sv.init(e,t),ie.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(io(r,i)),e.nonempty=r=>e.check(io(1,r)),e.max=(r,i)=>e.check(Ov(r,i)),e.length=(r,i)=>e.check(Sv(r,i)),e.unwrap=()=>e.element});function Rv(e,t){return xv(Cv,e,t)}const Mv=x("ZodObject",(e,t)=>{av.init(e,t),ie.init(e,t),F(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>Xc(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:zn()}),e.loose=()=>e.clone({...e._zod.def,catchall:zn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Av()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Bh(e,r),e.merge=r=>Fh(e,r),e.pick=r=>Mh(e,r),e.omit=r=>Lh(e,r),e.partial=(...r)=>Jh(Hc,e,r[0]),e.required=(...r)=>Vh(Qc,e,r[0])});function Lv(e,t){const r={type:"object",get shape(){return yi(this,"shape",{...e}),this.shape},...ce(t)};return new Mv(r)}const Bv=x("ZodUnion",(e,t)=>{uv.init(e,t),ie.init(e,t),e.options=t.options});function Fv(e,t){return new Bv({type:"union",options:e,...ce(t)})}const Jv=x("ZodIntersection",(e,t)=>{cv.init(e,t),ie.init(e,t)});function Vv(e,t){return new Jv({type:"intersection",left:e,right:t})}const xn=x("ZodEnum",(e,t)=>{lv.init(e,t),ie.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const o={};for(const s of i)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...ce(n),entries:o})},e.exclude=(i,n)=>{const o={...t.entries};for(const s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...ce(n),entries:o})}});function Xc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new xn({type:"enum",entries:r,...ce(t)})}const Wv=x("ZodTransform",(e,t)=>{dv.init(e,t),ie.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=o=>{if(typeof o=="string")r.issues.push(pt(o,r.value,t));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pt(s))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function Gv(e){return new Wv({type:"transform",transform:e})}const Hc=x("ZodOptional",(e,t)=>{fv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nn(e){return new Hc({type:"optional",innerType:e})}const qv=x("ZodNullable",(e,t)=>{mv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function oo(e){return new qv({type:"nullable",innerType:e})}const Yv=x("ZodDefault",(e,t)=>{pv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Kv(e,t){return new Yv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Xv=x("ZodPrefault",(e,t)=>{hv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hv(e,t){return new Xv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Qc=x("ZodNonOptional",(e,t)=>{vv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qv(e,t){return new Qc({type:"nonoptional",innerType:e,...ce(t)})}const eg=x("ZodCatch",(e,t)=>{gv.init(e,t),ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tg(e,t){return new eg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ng=x("ZodPipe",(e,t)=>{yv.init(e,t),ie.init(e,t),e.in=t.in,e.out=t.out});function so(e,t){return new ng({type:"pipe",in:e,out:t})}const rg=x("ZodReadonly",(e,t)=>{$v.init(e,t),ie.init(e,t)});function ig(e){return new rg({type:"readonly",innerType:e})}const og=x("ZodCustom",(e,t)=>{bv.init(e,t),ie.init(e,t)});function sg(e,t){const r=new Xe({check:"custom",...ce(t)});return r._zod.check=e,r}function ag(e,t={}){return Nv(og,e,t)}function ug(e,t){const r=sg(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(pt(n,i.value,r._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(pt(o))}},e(i.value,i)),t);return r}const cg=()=>xc.RUNTIME!=="node"?e=>new WebSocket(e):e=>new(require("ws")).WebSocket(e,{rejectUnauthorized:!1}),lg=Lv({type:Xc(["data","close","open"]),payload:zn(),error:Nn(be.payloadZ)});class dg{constructor(t,r,i,n){K(this,"codec");K(this,"reqSchema");K(this,"resSchema");K(this,"ws");K(this,"serverClosed");K(this,"sendClosed");K(this,"receiveDataQueue",[]);K(this,"receiveCallbacksQueue",[]);this.codec=r,this.reqSchema=i,this.resSchema=n,this.ws=t,this.sendClosed=!1,this.serverClosed=null,this.listenForMessages()}async receiveOpenAck(){const t=await this.receiveMsg();if(t.type!=="open"){if(t.error==null)throw new Error("Message error must be defined");return be.decode(t.error)}return null}send(t){if(this.serverClosed!=null)return new ze;if(this.sendClosed)throw new xe;return this.ws.send(this.codec.encode({type:"data",payload:t})),null}async receive(){if(this.serverClosed!=null)return[null,this.serverClosed];const t=await this.receiveMsg();if(t.type==="close"){if(t.error==null)throw new Error("Message error must be defined");if(this.serverClosed=be.decode(t.error),this.serverClosed==null)throw new Error("Message error must be defined");return[null,this.serverClosed]}return[this.resSchema.parse(t.payload),null]}received(){return this.receiveDataQueue.length!==0}closeSend(){if(this.sendClosed||this.serverClosed!=null)return;const t={type:"close"};try{this.ws.send(this.codec.encode(t))}finally{this.sendClosed=!0}}async receiveMsg(){const t=this.receiveDataQueue.shift();return t??await new Promise((r,i)=>this.receiveCallbacksQueue.push({resolve:r,reject:i}))}addMessage(t){const r=this.receiveCallbacksQueue.shift();r!=null?r.resolve(t):this.receiveDataQueue.push(t)}listenForMessages(){this.ws.onmessage=this.onMessage.bind(this),this.ws.onclose=this.onClose.bind(this)}onMessage(t){this.addMessage(this.codec.decode(t.data,lg))}onClose(t){this.addMessage({type:"close",error:{type:t.code===mg?ze.TYPE:xe.TYPE,data:""}})}}const fg="freighterctx",mg=1e3,ut=class ut extends Lc{constructor(r,i,n=!1){super();K(this,"baseUrl");K(this,"encoder");K(this,"secure");this.secure=n,this.baseUrl=r.replace({protocol:n?"wss":"ws"}),this.encoder=i}withCodec(r){const i=new ut(this.baseUrl,r,this.secure);return i.use(...this.middleware),i}async stream(r,i,n){const o=cg();let s;const[,a]=await this.executeMiddleware({target:r,protocol:"websocket",params:{},role:"client"},async u=>{const c=o(this.buildURL(r,u)),f={...u,params:{}};c.binaryType=ut.MESSAGE_TYPE;const d=await this.wrapSocket(c,i,n);return d instanceof Error?[f,d]:(s=d,[f,null])});if(a!=null)throw a;return s}buildURL(r,i){const n=gm({[Bc]:this.encoder.contentType,...i.params},fg);return this.baseUrl.child(r).toString()+n}async wrapSocket(r,i,n){return await new Promise(o=>{r.onopen=()=>{const s=new dg(r,this.encoder,i,n);s.receiveOpenAck().then(a=>{a!=null?o(a):o(s)}).catch(a=>o(a))},r.onerror=s=>{const a=s;o(new Error(a.message))}})}};K(ut,"MESSAGE_TYPE","arraybuffer");let Tn=ut;exports.EOF=ze;exports.HTTPClient=Uh;exports.StreamClosed=xe;exports.Unreachable=Ne;exports.WebSocketClient=Tn;exports.sendRequired=Eh;exports.unaryWithBreaker=jh;
5
+ `).buffer):this.dataType.usesBigInt&&typeof v=="number"?this._data=new this.dataType.Array(h.map(w=>BigInt(Math.round(w)))).buffer:!this.dataType.usesBigInt&&typeof v=="bigint"?this._data=new this.dataType.Array(h.map(Number)).buffer:this._data=new this.dataType.Array(h).buffer}this.key=d,this.alignment=l,this.sampleOffset=i??0,this.timeRange=r??O.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:o}}static alloc({capacity:e,dataType:t,...r}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const i=new new a(t).Array(e),o=new S({data:i.buffer,dataType:t,...r});return o.writePos=0,o}get refCount(){return this._refCount}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===x)return 0;const t=this.byteCapacity.valueOf()-this.writePos,r=e.subBytes(0,t);return this.writeToUnderlyingData(r),this.writePos+=r.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=r.length,this.calculateCachedLength()),r.length}writeFixed(e){if(this.writePos===x)return 0;const t=this.capacity-this.writePos,r=e.sub(0,t);return this.writeToUnderlyingData(r),this.cachedLength=void 0,this.maybeRecomputeMinMax(r),this.writePos+=r.length,r.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===x?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
6
+ `).slice(0,-1):Array.from(this).map(e=>e.toString())}parseJSON(e){if(!this.dataType.equals(a.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(t=>e.parse(ee.decodeString(t)))}get byteCapacity(){return new p(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===x?this.byteCapacity:this.dataType.isVariable?new p(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===x?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const t=[0];return this.data.forEach((r,i)=>{r===te&&(e++,t.push(i+1))}),this._cachedIndexes=t,this.cachedLength=e,e}convert(e,t=0){if(this.dataType.equals(e))return this;const r=new e.Array(this.length);for(let i=0;i<this.length;i++)r[i]=Ut(this.dataType,e,this.data[i],t);return new S({data:r.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:t,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(a.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMax=e.reduce((t,r)=>t>r?t:r)}else{const e=this.data;this.cachedMax=e.reduce((t,r)=>t>r?t:r)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??=this.calcRawMax(),V(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(a.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMin=e.reduce((t,r)=>t<r?t:r)}else{const e=this.data;this.cachedMin=e.reduce((t,r)=>t<r?t:r)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??=this.calcRawMin(),V(this.cachedMin,this.sampleOffset))}get bounds(){return A(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(e){if(this.cachedMin!=null){const t=e.cachedMin??e.calcRawMin();t<this.cachedMin&&(this.cachedMin=t)}if(this.cachedMax!=null){const t=e.cachedMax??e.calcRawMax();t>this.cachedMax&&(this.cachedMax=t)}}atAlignment(e,t){const r=Number(e-this.alignment);if(r<0||r>=this.length){if(t===!0)throw new Error(`[series] - no value at index ${r}`);return}return this.at(r,t)}at(e,t=!1){if(this.dataType.isVariable)return this.atVariable(e,t??!1);if(this.dataType.equals(a.UUID))return this.atUUID(e,t);e<0&&(e=this.length+e);const r=this.data[e];if(r==null){if(t===!0)throw new Error(`[series] - no value at index ${e}`);return}return V(r,this.sampleOffset)}atUUID(e,t){e<0&&(e=this.length+e);const r=Ue(new Uint8Array(this.buffer,e*this.dataType.density.valueOf()));if(r==null){if(t)throw new Error(`[series] - no value at index ${e}`);return}return r}atVariable(e,t){let r=0,i=0;if(this._cachedIndexes!=null)r=this._cachedIndexes[e],i=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let l=0;l<this.data.length;l++)if(this.data[l]===te){if(e===0){i=l;break}r=l+1,e--}if(i===0&&(i=this.data.length),r>=i||e>0){if(t)throw new Error(`[series] - no value at index ${e}`);return}}const o=this.data.slice(r,i);return this.dataType.equals(a.STRING)?new TextDecoder().decode(o):Te(JSON.parse(new TextDecoder().decode(o)))}binarySearch(e){let t=0,r=this.length-1;const i=Je(e);for(;t<=r;){const o=Math.floor((t+r)/2),l=i(this.at(o,!0),e);if(l===0)return o;l<0?t=o+1:r=o-1}return t}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(a.FLOAT32)&&!this.dataType.equals(a.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:t,bufferUsage:r,prevBuffer:i}=this.gl;if(t==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==i)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==x){i===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const o=this.dataType.density.size(i).valueOf(),l=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,o,l.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,r==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=x}as(e){return Lt(e,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:we(this.alignmentBounds.lower),upper:we(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return A(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new jt(this);return this.dataType.equals(a.JSON)?new ie(e):e}return this.dataType.equals(a.UUID)?new Yt(this):new qt(this)}slice(e,t){return this.sliceSub(!1,e,t)}sub(e,t){return this.sliceSub(!0,e,t)}subIterator(e,t){return new me(this,e,t??this.length)}subAlignmentIterator(e,t){return new me(this,Number(e-this.alignment),Number(t-this.alignment))}subBytes(e,t){if(e>=0&&(t==null||t>=this.byteLength.valueOf()))return this;const r=this.data.subarray(e,t);return new S({data:r,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,t,r){if(t<=0&&(r==null||r>=this.length))return this;let i;return e?i=this.data.subarray(t,r):i=this.data.slice(t,r),new S({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}reAlign(e){return new S({data:this.buffer,dataType:this.dataType,timeRange:O.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){let e=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)e+=Array.from(this).map(t=>t.toString());else{for(let t=0;t<5;t++)e+=`${this.at(t)?.toString()}`,e+=",";e+="...,";for(let t=-5;t<0;t++)e+=this.at(t)?.toString(),t<-1&&(e+=",")}return e+="])",e}}const Pt=n=>n==null?!1:Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)&&!(n instanceof DataView)||n instanceof S?!0:Ae(n),kt=xt(Ce,S);let me=class{series;end;index;constructor(e,t,r){this.series=e;const i=A(0,e.length);this.end=fe(i,r),this.index=fe(i,t)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}},jt=class{series;index;decoder;constructor(e){if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,t=this.series.data;for(;this.index<t.length&&t[this.index]!==te;)this.index++;const r=this.index;return e===r?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,r))})}};class ie{wrapped;static schema=s.z.record(s.z.string(),s.z.unknown());constructor(e){this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:ee.decodeString(e.value,ie.schema)}}}class Yt{series;index;data;density;constructor(e){if(!e.dataType.equals(a.UUID))throw new Error("cannot create a UUID series iterator for a non-UUID series");this.series=e,this.index=0,this.data=new Uint8Array(e.buffer),this.density=a.UUID.density.valueOf()}next(){if(this.index>=this.series.length)return{done:!0,value:void 0};const e=Ue(this.data,this.index*this.density);return this.index++,{done:!1,value:e}}}class qt{series;index;constructor(e){this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}const we=n=>{const e=n>>32n,t=n&0xffffffffn;return{domain:e,sample:t}};s.z.object({key:s.z.string(),value:s.z.string()});s.z.record(s.z.union([s.z.number(),s.z.string(),s.z.symbol()]),s.z.unknown());const Ft=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser";Ft();const Wt=["macOS","Windows","Linux"],Zt=["macos","windows","linux"],Vt={macos:"macOS",windows:"Windows",linux:"Linux"};s.z.enum(Wt).or(s.z.enum(Zt).transform(n=>Vt[n]));const Gt=(...n)=>n.map(Me).join(""),Me=n=>(n.endsWith("/")||(n+="/"),n.startsWith("/")&&(n=n.slice(1)),n),Jt=n=>n.endsWith("/")?n.slice(0,-1):n,Ht=(n,e="")=>n===null?"":`?${Object.entries(n).filter(([,t])=>t==null?!1:Array.isArray(t)?t.length>0:!0).map(([t,r])=>`${e}${t}=${r}`).join("&")}`;class j{protocol;host;port;path;constructor({host:e,port:t,protocol:r="",pathPrefix:i=""}){this.protocol=r,this.host=e,this.port=t,this.path=Me(i)}replace(e){return new j({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new j({...this,pathPrefix:Gt(this.path,e)})}toString(){return Jt(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}static UNKNOWN=new j({host:"unknown",port:0})}const Xt=async n=>await new Promise(e=>setTimeout(e,u.fromMilliseconds(n).milliseconds));class Kt{config;retries;interval;constructor(e){this.config={baseInterval:new u(e?.baseInterval??u.seconds(1)),maxRetries:e?.maxRetries??5,scale:e?.scale??1,sleepFn:e?.sleepFn??Xt},this.retries=0,this.interval=new u(this.config.baseInterval)}async wait(){const{maxRetries:e,scale:t,sleepFn:r}=this.config;return this.retries>=e?!1:(await r(this.interval),this.interval=this.interval.mult(t),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}}const Qt=s.z.object({baseInterval:u.z.optional(),maxRetries:s.z.number().optional(),scale:s.z.number().optional()}),_t=Object.freeze(Object.defineProperty({__proto__:null,Breaker:Kt,breakerConfigZ:Qt},Symbol.toStringTag,{value:"Module"})),en=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Be=s.z.string().regex(en),L=s.z.number().min(0).max(255),$e=s.z.number().min(0).max(1),Re=s.z.tuple([L,L,L,$e]),tn=s.z.tuple([L,L,L]),nn=s.z.object({rgba255:Re}),rn=s.z.number().min(0).max(360),sn=s.z.number().min(0).max(100),an=s.z.number().min(0).max(100),on=s.z.tuple([rn,sn,an,$e]),ae=s.z.union([Be,tn,Re,on,nn]),un=ae.transform(n=>oe(n)),oe=(n,e=1)=>{if(n=ae.parse(n),typeof n=="string")return cn(n,e);if(Array.isArray(n)){if(n.length<3||n.length>4)throw new Error(`Invalid color: [${n.join(", ")}]`);return n.length===3?[...n,e]:n}return n.rgba255},cn=(n,e=1)=>(n=Be.parse(n),n=ln(n),[Z(n,0),Z(n,2),Z(n,4),n.length===8?Z(n,6)/255:e]),Z=(n,e)=>parseInt(n.slice(e,e+2),16),ln=n=>n.startsWith("#")?n.slice(1):n;oe("#000000");oe("#ffffff");const hn=s.z.object({key:s.z.string(),color:ae,position:s.z.number(),switched:s.z.boolean().optional()});s.z.array(hn);const fn=s.z.object({key:s.z.string(),name:s.z.string(),color:un});s.z.object({key:s.z.string(),name:s.z.string(),swatches:s.z.array(fn)});s.z.int().min(0).max(255);s.z.object({name:s.z.string(),key:s.z.string()});const dn=n=>Object.getOwnPropertySymbols(globalThis).includes(n),gn=(n,e)=>{const t=Symbol.for(n);if(!dn(t)){const r=e();Object.defineProperty(globalThis,t,{value:r})}return()=>globalThis[t]},De="sy_x_error",pn=n=>e=>e!=null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type.startsWith(n):e instanceof Error?e.message.startsWith(n):typeof e!="string"?!1:e.startsWith(n),Y=n=>class k extends Error{static discriminator=De;discriminator=k.discriminator;static TYPE=n;type=k.TYPE;static matches=pn(n);matches=k.matches;constructor(t,r){super(t,r),this.name=k.TYPE}static sub(t){return Y(`${n}.${t}`)}},Le=n=>{if(n==null||typeof n!="object")return!1;const e=n;if(e.discriminator!==De)return!1;if(!("type"in e))throw new Error(`X Error is missing its type property: ${JSON.stringify(e)}`);return!0},D="unknown",ne="nil";class yn{providers=[];register(e){this.providers.push(e)}encode(e){if(e==null)return{type:ne,data:""};if(Le(e))for(const t of this.providers){const r=t.encode(e);if(r!=null)return r}if(e instanceof Error)return{type:D,data:e.message};if(typeof e=="string")return{type:D,data:e};try{return{type:D,data:JSON.stringify(e)}}catch{return{type:D,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===ne)return null;if(e.type===D)return new re(e.data);for(const t of this.providers){const r=t.decode(e);if(r!=null)return r}return new re(e.data)}}const ue=gn("synnax-error-registry",()=>new yn),mn=({encode:n,decode:e})=>ue().register({encode:n,decode:e}),wn=n=>ue().encode(n),bn=n=>n==null?null:ue().decode(n);class re extends Y("unknown"){}const Tn=s.z.object({type:s.z.string(),data:s.z.string()});class On extends Y("canceled"){}class vn extends Y("not_implemented"){}const E=Object.freeze(Object.defineProperty({__proto__:null,Canceled:On,NONE:ne,NotImplemented:vn,UNKNOWN:D,Unknown:re,createTyped:Y,decode:bn,encode:wn,isTyped:Le,payloadZ:Tn,register:mn},Symbol.toStringTag,{value:"Module"})),In=s.object({jsonrpc:s.literal("2.0"),method:s.string(),params:s.any().optional(),id:s.union([s.string(),s.number(),s.null()]).optional()}),Pe=s.object({jsonrpc:s.literal("2.0"),id:s.union([s.string(),s.number(),s.null()])}),Sn=Pe.extend({result:s.json()}),Nn=Pe.extend({error:s.object({code:s.number().int(),message:s.string().optional(),data:s.json().optional()})}),zn=s.union([Sn,Nn]);s.union([In,zn]);s.z.string().regex(/^\d+\.\d+\.\d+$/);const xn=["standard","scientific","engineering"];s.z.enum(xn);s.z.enum(["success","info","warning","error","loading","disabled"]);class q extends E.createTyped("freighter"){}class U extends q.sub("eof"){constructor(){super("EOF")}}class C extends q.sub("stream_closed"){constructor(){super("StreamClosed")}}class M extends q.sub("unreachable"){url;constructor(e={}){const{message:t="Unreachable",url:r=j.UNKNOWN}=e;super(t),this.url=r}}const En=n=>{if(!n.type.startsWith(q.TYPE))return null;if(U.matches(n))return{type:U.TYPE,data:"EOF"};if(C.matches(n))return{type:C.TYPE,data:"StreamClosed"};if(M.matches(n))return{type:M.TYPE,data:"Unreachable"};throw new Error(`Unknown error type: ${n.type}: ${n.message}`)},An=n=>{if(!n.type.startsWith(q.TYPE))return null;switch(n.type){case U.TYPE:return new U;case C.TYPE:return new C;case M.TYPE:return new M;default:throw new E.Unknown(`Unknown error type: ${n.data}`)}};E.register({encode:En,decode:An});class ke{middleware=[];use(...e){this.middleware.push(...e)}async executeMiddleware(e,t){let r=0;const i=async o=>{if(r===this.middleware.length)return await t(o);const l=this.middleware[r];return r++,await l(o,i)};return await i(e)}}const je="Content-Type",Un=n=>typeof n.cause=="object"&&n.cause!==null&&"code"in n.cause&&n.cause.code==="ECONNREFUSED",Cn=400;class Mn extends ke{endpoint;encoder;constructor(e,t,r=!1){return super(),this.endpoint=e.replace({protocol:r?"https":"http"}),this.encoder=t,new Proxy(this,{get:(i,o,l)=>o==="endpoint"?this.endpoint:Reflect.get(i,o,l)})}get headers(){return{[je]:this.encoder.contentType}}async send(e,t,r,i){t=r?.parse(t);let o=null;const l=this.endpoint.child(e),d={};d.method="POST",d.body=this.encoder.encode(t??{});const[,f]=await this.executeMiddleware({target:l.toString(),protocol:this.endpoint.protocol,params:{},role:"client"},async g=>{const m={...g,params:{}};d.headers={...this.headers,...g.params};let h;try{h=await fetch(g.target,d)}catch(w){if(!(w instanceof Error))throw w;return[m,Un(w)?new M({url:l}):w]}const v=await h.arrayBuffer();if(h?.ok)return i!=null&&(o=this.encoder.decode(v,i)),[m,null];try{if(h.status!==Cn)return[m,new Error(h.statusText)];const w=this.encoder.decode(v,E.payloadZ),F=E.decode(w);return[m,F]}catch(w){return[m,new Error(`[freighter] - failed to decode error: ${h.statusText}: ${w.message}`)]}});if(f!=null)return[null,f];if(o==null)throw new Error("Response must be defined");return[o,null]}}const Bn=(n,e)=>{class t{wrapped;constructor(i){this.wrapped=i}use(...i){this.wrapped.use(...i)}async send(i,o,l,d){const f=new _t.Breaker(e);do{const[g,m]=await this.wrapped.send(i,o,l,d);if(m==null)return[g,null];if(!M.matches(m))return[null,m];if(!await f.wait())return[g,m]}while(!0)}}return new t(n)},$n=async(n,e,t,r,i)=>{const[o,l]=await n.send(e,t,r,i);if(l!=null)throw l;return o},Rn=s.z.object({type:s.z.enum(["data","close","open"]),payload:s.z.unknown(),error:s.z.optional(E.payloadZ)});class Dn{codec;reqSchema;resSchema;ws;serverClosed;sendClosed;receiveDataQueue=[];receiveCallbacksQueue=[];constructor(e,t,r,i){this.codec=t,this.reqSchema=r,this.resSchema=i,this.ws=e,this.sendClosed=!1,this.serverClosed=null,this.listenForMessages()}async receiveOpenAck(){const e=await this.receiveMsg();if(e.type!=="open"){if(e.error==null)throw new Error("Message error must be defined");return E.decode(e.error)}return null}send(e){if(this.serverClosed!=null)return new U;if(this.sendClosed)throw new C;return this.ws.send(this.codec.encode({type:"data",payload:e})),null}async receive(){if(this.serverClosed!=null)return[null,this.serverClosed];const e=await this.receiveMsg();if(e.type==="close"){if(e.error==null)throw new Error("Message error must be defined");if(this.serverClosed=E.decode(e.error),this.serverClosed==null)throw new Error("Message error must be defined");return[null,this.serverClosed]}return[this.resSchema.parse(e.payload),null]}received(){return this.receiveDataQueue.length!==0}closeSend(){if(this.sendClosed||this.serverClosed!=null)return;const e={type:"close"};try{this.ws.send(this.codec.encode(e))}finally{this.sendClosed=!0}}async receiveMsg(){const e=this.receiveDataQueue.shift();return e??await new Promise((t,r)=>this.receiveCallbacksQueue.push({resolve:t,reject:r}))}addMessage(e){const t=this.receiveCallbacksQueue.shift();t!=null?t.resolve(e):this.receiveDataQueue.push(e)}listenForMessages(){this.ws.onmessage=this.onMessage.bind(this),this.ws.onclose=this.onClose.bind(this)}onMessage(e){this.addMessage(this.codec.decode(e.data,Rn))}onClose(e){this.addMessage({type:"close",error:{type:e.code===Pn?U.TYPE:C.TYPE,data:""}})}}const Ln="freighterctx",Pn=1e3;class J extends ke{baseUrl;encoder;secure;static MESSAGE_TYPE="arraybuffer";constructor(e,t,r=!1){super(),this.secure=r,this.baseUrl=e.replace({protocol:r?"wss":"ws"}),this.encoder=t}withCodec(e){const t=new J(this.baseUrl,e,this.secure);return t.use(...this.middleware),t}async stream(e,t,r){let i;const[,o]=await this.executeMiddleware({target:e,protocol:"websocket",params:{},role:"client"},async l=>{const d=new WebSocket(this.buildURL(e,l)),f={...l,params:{}};d.binaryType=J.MESSAGE_TYPE;const g=await this.wrapSocket(d,t,r);return g instanceof Error?[f,g]:(i=g,[f,null])});if(o!=null)throw o;return i}buildURL(e,t){const r=Ht({[je]:this.encoder.contentType,...t.params},Ln);return this.baseUrl.child(e).toString()+r}async wrapSocket(e,t,r){return await new Promise(i=>{e.onopen=()=>{const o=new Dn(e,this.encoder,t,r);o.receiveOpenAck().then(l=>{l!=null?i(l):i(o)}).catch(l=>i(l))},e.onerror=o=>{const l=o;i(new Error(l.message))}})}}exports.EOF=U;exports.HTTPClient=Mn;exports.StreamClosed=C;exports.Unreachable=M;exports.WebSocketClient=J;exports.sendRequired=$n;exports.unaryWithBreaker=Bn;