@shumai-one/shumai 0.5.2 → 0.6.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.
- package/bin/{chunk-qxscgcn9.js → chunk-01ym2agz.js} +1 -1
- package/bin/{chunk-ae6zgjhd.js → chunk-047n9gfs.js} +2 -2
- package/bin/chunk-0a4ahz7r.js +2 -0
- package/bin/{chunk-v5hz09a1.js → chunk-0awcpx0a.js} +2 -2
- package/bin/{chunk-19q13a80.js → chunk-0fbgfgxv.js} +5 -5
- package/bin/{chunk-jt6v15wx.js → chunk-0nnqha4f.js} +1 -1
- package/bin/chunk-0tvggyy4.js +1 -0
- package/bin/{chunk-zckxc8m6.js → chunk-113baw0m.js} +2 -2
- package/bin/{chunk-mneeg71d.js → chunk-1dbjyarc.js} +2 -2
- package/bin/{chunk-951r2rx1.js → chunk-1qre79kf.js} +1 -1
- package/bin/chunk-27v3yepb.js +1 -0
- package/bin/{chunk-5vqbzsjv.js → chunk-2rq3w8sg.js} +1 -1
- package/bin/{chunk-v034sfw8.js → chunk-3020am4q.js} +2 -2
- package/bin/{chunk-zdzkjp4q.js → chunk-3fjgf7eb.js} +2 -2
- package/bin/chunk-3pwwg1xm.js +1 -0
- package/bin/{chunk-19jpn3r6.js → chunk-3sfb63fp.js} +1 -1
- package/bin/{chunk-wwkhskce.js → chunk-3tg10kwz.js} +2 -2
- package/bin/{chunk-0y4zq3y4.js → chunk-4g4pxmef.js} +1 -1
- package/bin/{chunk-2pw7xcrn.js → chunk-4jj92zwa.js} +1 -1
- package/bin/{chunk-bpxw19ez.js → chunk-4yhvexzk.js} +1 -1
- package/bin/chunk-58cbk6e8.js +1 -0
- package/bin/{chunk-eqr0znmc.js → chunk-59t9s2jh.js} +1 -1
- package/bin/{chunk-n76w2wcr.js → chunk-5e7r7a9d.js} +1 -1
- package/bin/{chunk-8tzfcqtb.js → chunk-5m51b7af.js} +1 -1
- package/bin/{chunk-m6v8vt2b.js → chunk-65t6rm5d.js} +2 -2
- package/bin/chunk-6bed0rz4.js +1 -0
- package/bin/{chunk-1nvj833s.js → chunk-6smn0q1n.js} +5 -5
- package/bin/{chunk-r249n1xe.js → chunk-6zerk0em.js} +2 -2
- package/bin/{chunk-gvas3xkp.js → chunk-7bbsv8g0.js} +1 -1
- package/bin/chunk-83bdgs2c.js +1 -0
- package/bin/{chunk-93p27bbm.js → chunk-86qtjd30.js} +5 -5
- package/bin/{chunk-b5r0be06.js → chunk-8rekh4h9.js} +1 -1
- package/bin/{chunk-d2dgazjj.js → chunk-8s9fehda.js} +1 -1
- package/bin/{chunk-r776bhsg.js → chunk-8sf2hf31.js} +1 -1
- package/bin/{chunk-mn108p93.js → chunk-9d3w678j.js} +1 -1
- package/bin/{chunk-xr2v0d6y.js → chunk-9gftd4f7.js} +4 -4
- package/bin/{chunk-n9vp9nbg.js → chunk-9rcg8zgs.js} +32 -32
- package/bin/{chunk-6jkjx0n2.js → chunk-a23q1kc4.js} +3 -3
- package/bin/{chunk-81dawvn4.js → chunk-a6cdt85k.js} +2 -2
- package/bin/chunk-a76h3ehe.js +1 -0
- package/bin/{chunk-rmvhyqyb.js → chunk-b1bkd2p4.js} +8 -8
- package/bin/{chunk-wnqxyqrg.js → chunk-bf5m8f6t.js} +2 -2
- package/bin/chunk-cf57fk11.js +2 -0
- package/bin/{chunk-0v9srsdz.js → chunk-cv5xx81e.js} +1 -1
- package/bin/{chunk-3q5qkfkc.js → chunk-czybv3vy.js} +1 -1
- package/bin/{chunk-ggfx2b0f.js → chunk-d4sbcvpa.js} +1 -1
- package/bin/{chunk-9ggwc289.js → chunk-d6xezgrg.js} +1 -1
- package/bin/{chunk-bbcmhcvc.js → chunk-da86fpjt.js} +2 -2
- package/bin/chunk-dzjmwat0.js +14 -0
- package/bin/{chunk-rza95y4z.js → chunk-eex8sjfs.js} +2 -2
- package/bin/{chunk-9zgqjdx1.js → chunk-emgyjhmx.js} +2 -2
- package/bin/{chunk-k3prp6c6.js → chunk-exmwerag.js} +5 -5
- package/bin/{chunk-kzr6ecke.js → chunk-f38xyahm.js} +1 -1
- package/bin/{chunk-ffj9cq9y.js → chunk-fb1bes2h.js} +1 -1
- package/bin/chunk-fbvak7q2.js +1 -0
- package/bin/{chunk-15w79661.js → chunk-fg9sr6r9.js} +1 -1
- package/bin/{chunk-dppfek34.js → chunk-fyb6t7ct.js} +2 -2
- package/bin/chunk-g2ptqqm3.js +3 -0
- package/bin/{chunk-t1yamxgk.js → chunk-ggwqxn95.js} +1 -1
- package/bin/chunk-ghk54h71.js +13 -0
- package/bin/{chunk-kvwec0p3.js → chunk-h1fbev9c.js} +2 -2
- package/bin/{chunk-f5z3096k.js → chunk-h9akn41s.js} +2 -2
- package/bin/{chunk-asy868kq.js → chunk-hdansxny.js} +1 -1
- package/bin/{chunk-grjek810.js → chunk-hjwpd09v.js} +2 -2
- package/bin/{chunk-zf5cyxnt.js → chunk-hjzbw975.js} +1 -1
- package/bin/{chunk-jgfye6nf.js → chunk-j4p3eqtd.js} +1 -1
- package/bin/chunk-jtkxeat4.js +2 -0
- package/bin/{chunk-8zgq5sav.js → chunk-jw4g9628.js} +3 -3
- package/bin/{chunk-0ge2mm8j.js → chunk-jxebakyq.js} +1 -1
- package/bin/{chunk-0asthrjf.js → chunk-kfewyax2.js} +2 -2
- package/bin/chunk-kk3m4za5.js +1 -0
- package/bin/{chunk-vzdgsfkf.js → chunk-m7tnj47b.js} +1 -1
- package/bin/{chunk-w73v578p.js → chunk-maw5ah8t.js} +2 -2
- package/bin/{chunk-8ny7wvzb.js → chunk-n0wwtjwv.js} +1 -1
- package/bin/{chunk-e439kt05.js → chunk-nahdd2t9.js} +1 -1
- package/bin/{chunk-04avc4fn.js → chunk-nv7tztvh.js} +32 -32
- package/bin/{chunk-mn208vrv.js → chunk-nyjwdxyj.js} +2 -2
- package/bin/{chunk-qmrg2jhs.js → chunk-p0yfxt5e.js} +5 -5
- package/bin/{chunk-p0j4wpa5.js → chunk-q27qn367.js} +2 -2
- package/bin/{chunk-j53sjkxt.js → chunk-q36sdt2w.js} +1 -1
- package/bin/{chunk-vm2pz2hm.js → chunk-q7t5zs7n.js} +2 -2
- package/bin/{chunk-cpj562n6.js → chunk-qbj5pe8t.js} +1 -1
- package/bin/chunk-qj0bxb1m.js +2 -0
- package/bin/{chunk-9bakwac0.js → chunk-qk5hsn6e.js} +4 -4
- package/bin/{chunk-6rn094yj.js → chunk-qnyqtaf0.js} +1 -1
- package/bin/{chunk-ypkkfwfb.js → chunk-qqkr6h07.js} +2 -2
- package/bin/chunk-qyqc5j3a.css +1 -0
- package/bin/chunk-qzaf6bre.js +2 -0
- package/bin/{chunk-cx32wsa1.js → chunk-r1e59gf0.js} +1 -1
- package/bin/chunk-ra5csbkr.js +2 -0
- package/bin/{chunk-rtaya5wc.js → chunk-rh8dy99a.js} +2 -2
- package/bin/{chunk-ryepy5er.js → chunk-rx9g95wk.js} +4 -4
- package/bin/{chunk-2w6gve12.js → chunk-rxyy37wa.js} +3 -3
- package/bin/{chunk-7qvvf0yd.js → chunk-scez7ppq.js} +2 -2
- package/bin/{chunk-twpc640e.js → chunk-t2a1vq34.js} +1 -1
- package/bin/chunk-t879v3b7.js +1 -0
- package/bin/{chunk-a8bymrv1.js → chunk-tjavzarz.js} +2 -2
- package/bin/{chunk-ce0bhc72.js → chunk-treyx8em.js} +1 -1
- package/bin/{chunk-dche0gy0.js → chunk-v3z4z04s.js} +1 -1
- package/bin/{chunk-5bk16qdp.js → chunk-v3z63tpw.js} +2 -2
- package/bin/{chunk-5rzxekn4.js → chunk-v9bes1fv.js} +1 -1
- package/bin/{chunk-d5hbzp7t.js → chunk-vjyget8s.js} +1 -1
- package/bin/{chunk-4zksqvwj.js → chunk-vmm9m3nv.js} +2 -2
- package/bin/chunk-vvr8tnse.js +211 -0
- package/bin/{chunk-tvkekn4z.js → chunk-w3stry4v.js} +1 -1
- package/bin/{chunk-3pm6q6kg.js → chunk-w89czwjj.js} +1 -1
- package/bin/{chunk-rw5h0n0s.js → chunk-wk0hk00z.js} +1 -1
- package/bin/{chunk-15vsw36h.js → chunk-ww9qq8yq.js} +5 -5
- package/bin/chunk-x4q082e6.js +2 -0
- package/bin/{chunk-98mg3dpd.js → chunk-x6rf77jm.js} +4 -4
- package/bin/chunk-x7dyj53k.js +2 -0
- package/bin/{chunk-y2dhf3p0.js → chunk-xbw7ffrz.js} +2 -2
- package/bin/{chunk-5nqvqvqp.js → chunk-xcrd0y8v.js} +3 -3
- package/bin/{chunk-0j22699g.js → chunk-z0z0jn5h.js} +2 -2
- package/bin/{chunk-w9z27p0m.js → chunk-zasjhrwc.js} +1 -1
- package/bin/chunk-zefds5gg.js +1 -0
- package/bin/{chunk-8ayz61rc.js → chunk-zzzgk1d5.js} +3 -3
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +390 -373
- package/package.json +8 -11
- package/prisma/migrations/20261014054332_add_embedding_768/migration.sql +8 -0
- package/prisma/schema.prisma +10 -8
- package/bin/chunk-2gf95tj0.js +0 -1
- package/bin/chunk-2tk5w3jc.js +0 -1
- package/bin/chunk-301e7g3z.js +0 -2
- package/bin/chunk-3kmjbc3m.js +0 -2
- package/bin/chunk-3td60k1m.js +0 -2
- package/bin/chunk-42hrvk6k.js +0 -211
- package/bin/chunk-8abhmarc.js +0 -2
- package/bin/chunk-965102pf.js +0 -3
- package/bin/chunk-acn3r2m2.js +0 -1
- package/bin/chunk-ce75dw3k.css +0 -1
- package/bin/chunk-d9qpgkek.js +0 -2
- package/bin/chunk-dv6p6n5e.js +0 -1
- package/bin/chunk-gnt9gewm.js +0 -2
- package/bin/chunk-k97axrc4.js +0 -13
- package/bin/chunk-qb178ntp.js +0 -2
- package/bin/chunk-s4r6e6ms.js +0 -1
- package/bin/chunk-syjjke3f.js +0 -1
- package/bin/chunk-tgfxe0sb.js +0 -1
- package/bin/chunk-tjretpx8.js +0 -1
- package/bin/chunk-w4yjgez6.js +0 -14
- package/bin/chunk-wjcebkpb.js +0 -1
- package/bin/chunk-ws71fg50.js +0 -2
- package/bin/chunk-yfp3q4da.js +0 -1
- package/bin/chunk-z8e4wc59.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ke}from"./chunk-a8bymrv1.js";function Ue(t){let o=Object.values(t).filter((c)=>typeof c==="number");return Object.entries(t).filter(([c,u])=>o.indexOf(+c)===-1).map(([c,u])=>u)}function ft(t,o="|"){return t.map((n)=>ht(n)).join(o)}function we(t,o){if(typeof o==="bigint")return o.toString();return o}function Ze(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function eo(t){return t===null||t===void 0}function Me(t){let o=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(o,n)}function to(t,o){let n=t/o,c=Math.round(n),u=4*Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-c)<u)return 0;return n-c}var Qr=Symbol("evaluating");function ro(t,o,n){let c=void 0;Object.defineProperty(t,o,{get(){if(c===Qr)return;if(c===void 0)c=Qr,c=n();return c},set(u){Object.defineProperty(t,o,{value:u})},configurable:!0})}function L(t,o,n){Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ae(...t){let o={};for(let n of t){let c=Object.getOwnPropertyDescriptors(n);Object.assign(o,c)}return Object.defineProperties({},o)}function oo(t){return JSON.stringify(t)}function no(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var dt="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var io=Ze(()=>{if(B.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(t){return!1}});function me(t){if(ge(t)===!1)return!1;let o=t.constructor;if(o===void 0)return!0;if(typeof o!=="function")return!0;let n=o.prototype;if(ge(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function mt(t){if(me(t))return{...t};if(Array.isArray(t))return[...t];if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);return t}var so=new Set(["string","number","symbol"]);function le(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(t,o,n){let c=new t._zod.constr(o??t._zod.def);if(!o||n?.parent)c._zod.parent=t;return c}function S(t){let o=t;if(!o)return{};if(typeof o==="string")return{error:()=>o};if(o?.message!==void 0){if(o?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");o.error=o.message}if(delete o.message,typeof o.error==="string")return{...o,error:()=>o.error};return o}function ht(t){if(typeof t==="bigint")return t.toString()+"n";if(typeof t==="string")return`"${t}"`;return`${t}`}function co(t){return Object.keys(t).filter((o)=>t[o]._zod.optin!==void 0&&t[o]._zod.optout==="optional")}var uo=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function Sc(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={};for(let m of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,m))throw Error(`Unrecognized key: "${String(m)}"`);if(!o[m])continue;L(f,m,n.shape[m])}return L(this,"shape",f),f},checks:[]});return Y(t,p)}function Oc(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={...t._zod.def.shape};for(let m of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,m))throw Error(`Unrecognized key: "${String(m)}"`);if(!o[m])continue;delete f[m]}return L(this,"shape",f),f},checks:[]});return Y(t,p)}function Ic(t,o){if(!me(o))throw Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let p=t._zod.def.shape;for(let f of Reflect.ownKeys(o))if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let u=ae(t._zod.def,{get shape(){let p={...t._zod.def.shape,...o};return L(this,"shape",p),p}});return Y(t,u)}function Ec(t,o){if(!me(o))throw Error("Invalid input to safeExtend: expected a plain object");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o};return L(this,"shape",c),c}});return Y(t,n)}function Tc(t,o){if(!o?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o._zod.def.shape};return L(this,"shape",c),c},get catchall(){return o._zod.def.catchall},checks:o._zod.def.checks??[]});return Y(t,n)}function ao(t,o,n,c="partial"){let p=o._zod.def.checks;if(p&&p.length>0)throw Error(`.${c}() cannot be used on object schemas containing refinements`);let m=ae(o._zod.def,{get shape(){let _=o._zod.def.shape,b={..._};if(n)for(let z of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(_,z))throw Error(`Unrecognized key: "${String(z)}"`);if(!n[z])continue;b[z]=t?new t({type:"optional",innerType:_[z]}):_[z]}else for(let z of Reflect.ownKeys(_))b[z]=t?new t({type:"optional",innerType:_[z]}):_[z];return L(this,"shape",b),b},checks:[]});return Y(o,m)}function Ac(t,o,n){let c=ae(o._zod.def,{get shape(){let u=o._zod.def.shape,p={...u};if(n)for(let f of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(p,f))throw Error(`Unrecognized key: "${String(f)}"`);if(!n[f])continue;p[f]=new t({type:"nonoptional",innerType:u[f]})}else for(let f of Reflect.ownKeys(u))p[f]=new t({type:"nonoptional",innerType:u[f]});return L(this,"shape",p),p}});return Y(o,c)}function he(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function lo(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function te(t,o){return o.map((n)=>{var c;return(c=n).path??(c.path=[]),n.path.unshift(t),n})}function $e(t){return typeof t==="string"?t:t?.message}function _t(t,o,n){var c;for(let u=o;u<t.length;u++)(c=t[u]).schema??(c.schema=n)}function ne(t,o,n){var c;let u=t.inst?._zod?.traits;if(u?.has("$ZodType"))if(u.has("$ZodCheck"))(c=t).schema??(c.schema=t.inst);else t.schema=t.inst;let p=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,f=t.message?t.message:$e(t.inst?._zod.def?.error?.(t))??$e(p?.(t))??$e(o?.error?.(t))??$e(n.customError?.(t))??$e(n.localeError?.(t))??"Invalid input",{inst:m,schema:_,continue:b,input:z,...w}=t;if(w.path??(w.path=[]),w.message=f,o?.reportInput)w.input=z;return w}var Nc=/[\uD800-\uDBFF]/;function Je(t){let o=t.length;if(!Nc.test(t))return o;let n=o;for(let c=0;c<o-1;c++)if((t.charCodeAt(c)&64512)===55296&&(t.charCodeAt(c+1)&64512)===56320)n--,c++;return n}function Be(t){if(Array.isArray(t))return"array";if(typeof t==="string")return"string";return"unknown"}function po(t){let o=typeof t;switch(o){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return o}function _e(...t){let[o,n,c]=t;if(typeof o==="string")return{message:o,code:"custom",input:n,inst:c};return{...o}}function fo(t,o){for(let n in o){let c=Object.getOwnPropertyDescriptor(o,n);if(c.get)Object.defineProperty(t,n,{...c,enumerable:!1});else Cc(t,n,c.value)}}function de(t,o,n,c=!0){return Object.defineProperty(t,o,{configurable:!0,writable:!0,enumerable:c,value:n}),n}function gt(t,o,n){return de(t,o,n,!1)}function Cc(t,o,n){Object.defineProperty(t,o,{configurable:!0,get(){return this==null?n:de(this,o,n.bind(this))},set(c){de(this,o,c)}})}function jc(t,o){let n=Object.getPrototypeOf(t);return o in n?void 0:n}var pt,ue=!1,Rc={configurable:!0,get(){ue=!0;return}};function E(t,o,n){let c=Object.getPrototypeOf(t._zod);if(o in c&&pt!==t._zod){pt=void 0;return}pt=t._zod,Object.defineProperty(c,o,{configurable:!0,get(){Object.defineProperty(this,o,Rc);let u=ue;ue=!1;try{let p=n(this);if(ue)delete this[o];else Object.defineProperty(this,o,{configurable:!0,writable:!0,value:p});return ue=ue||u,p}catch(p){throw delete this[o],ue=ue||u,p}},set(u){Object.defineProperty(this,o,{configurable:!0,writable:!0,value:u})}})}function Dc(t,o,n,c){let u=jc(t,o);if(!u)return;Object.defineProperty(u,o,{configurable:!0,get(){let p={configurable:!0,writable:!0,enumerable:c,value:void 0};return Object.defineProperty(this,o,p),p.value=n(this),Object.defineProperty(this,o,p),p.value},set(p){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:c,value:p})}})}var Lc="~constantCatch";function mo(t){let o=()=>t;return o[Lc]=!0,o}var _o,Zr=Object.freeze({status:"aborted"}),xt={value:void 0,enumerable:!1},xo="captureStackTrace"in Error?Error:null;function Fc(t){let o=xo;if(o){let n=o.stackTraceLimit;if(typeof n==="number"){try{o.stackTraceLimit=0}catch{return xo=null,new t}try{return new t}finally{o.stackTraceLimit=n}}}return new t}function v(t,o,n,c){let u={};function p(k){this.def=k,this.constr=w,this.traits=new Set}p.prototype=u;let f=n,m=f&&new WeakSet;function _(k,Z){if(!k._zod){xt.value=new p(Z);try{Object.defineProperty(k,"_zod",xt)}finally{xt.value=void 0}}if(k._zod.traits.has(t))return;if(k._zod.traits.add(t),o(k,Z),m){let O=Object.getPrototypeOf(k),I=k._zod.constr.prototype,J=O;while(J&&J!==I)J=Object.getPrototypeOf(J);let q=J??O;if(!m.has(q))m.add(q),fo(q,f)}let P=w.prototype;for(let O in P){if(!Object.prototype.hasOwnProperty.call(P,O))continue;if(!(O in k))k[O]=P[O].bind(k)}}let b=c?.Parent??Object;class z extends b{}Object.defineProperty(z,"name",{value:t});function w(k){let Z=c?.Parent?Fc(z):this;_(Z,k);let P=Z._zod.deferred;if(P){for(let I of P)I();Z._zod.deferred=void 0}let O=globalThis.__zod_globalConfig?.postProcessor;if(O)O(Z);return Z}return Object.defineProperty(w,"init",{value:_}),Object.defineProperty(w,Symbol.hasInstance,{value:(k)=>{if(c?.Parent&&k instanceof c.Parent)return!0;return k?._zod?.traits?.has(t)}}),Object.defineProperty(w,"name",{value:t}),w}class ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pe extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`);this.name="ZodEncodeError"}}(_o=globalThis).__zod_globalConfig??(_o.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function W(t){if(t)Object.assign(B,t);return B}function Uc(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,we,2)),t.message}function Mc(t){this._zod.message=t}var Jc={get:Uc,set:Mc,enumerable:!0,configurable:!0},zt={value:void 0,enumerable:!1},vt={value:void 0,enumerable:!1},yo=new WeakSet([Object.prototype,Error.prototype]),bo=(t,o)=>{t.name="$ZodError",zt.value=t._zod,Object.defineProperty(t,"_zod",zt),vt.value=o,Object.defineProperty(t,"issues",vt),zt.value=void 0,vt.value=void 0,Object.defineProperty(t,"message",Jc);let n=Object.getPrototypeOf(t);if(!yo.has(n))yo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let c=()=>this.message;return Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0})}})},oi=v("$ZodError",bo),$t=v("$ZodError",bo,void 0,{Parent:Error});function Bc(t,o,n){if(!Object.prototype.hasOwnProperty.call(t,o))if(o==="__proto__")Object.defineProperty(t,o,{value:n(),writable:!0,enumerable:!0,configurable:!0});else t[o]=n();return t[o]}function wt(t,o=(n)=>n.message){let n={},c=[];for(let u of t.issues)if(u.path.length>0)Bc(n,u.path[0],()=>[]).push(o(u));else c.push(o(u));return{formErrors:c,fieldErrors:n}}function kt(t,o=(n)=>n.message){let n={_errors:[]},c=(u,p=[])=>{for(let f of u.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map((m)=>c({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")c({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")c({issues:f.issues},[...p,...f.path]);else{let m=[...p,...f.path];if(m.length===0)n._errors.push(o(f));else{let _=n,b=0;while(b<m.length){let z=m[b],w=b===m.length-1;if(z==="_errors"){if(w)_._errors.push(o(f));b++;continue}if(!Object.prototype.hasOwnProperty.call(_,z))Object.defineProperty(_,z,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let k=_[z];if(w)k._errors.push(o(f));_=k,b++}}}};return c(t),n}function Vc(t){let o=[],n=t.map((c)=>typeof c==="object"?c.key:c);for(let c of n)if(typeof c==="number")o.push(`[${c}]`);else if(typeof c==="symbol")o.push(`[${JSON.stringify(String(c))}]`);else if(/[^\w$]/.test(c))o.push(`[${JSON.stringify(c)}]`);else{if(o.length)o.push(".");o.push(c)}return o.join("")}function hf(t){let o=[],n=[...t.issues].sort((c,u)=>(c.path??[]).length-(u.path??[]).length);for(let c of n)if(o.push(`\u2716 ${c.message}`),c.path?.length)o.push(` \u2192 at ${Vc(c.path)}`);return o.join(`
|
|
3
|
-
`)}function Ve(t,o){return{callee:o?.callee??t,Err:o?.Err}}var Ke=(t)=>{let o=(n,c,u,p)=>{let f=u?{...u,async:!1}:{async:!1},m=n._zod.run({value:c,issues:[]},f);if(m instanceof Promise)throw new ie;if(m.issues.length){let _=new(p?.Err??t)(m.issues.map((b)=>ne(b,f,W())));throw dt(_,p?.callee??o),_}return m.value};return o};var We=(t)=>{let o=async(n,c,u,p)=>{let f=u?{...u,async:!0}:{async:!0},m=n._zod.run({value:c,issues:[]},f);if(m instanceof Promise)m=await m;if(m.issues.length){let _=new(p?.Err??t)(m.issues.map((b)=>ne(b,f,W())));throw dt(_,p?.callee??o),_}return m.value};return o};var Oe=(t)=>(o,n,c)=>{let u=c?{...c,async:!1}:{async:!1},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)throw new ie;return p.issues.length?{success:!1,error:new(t??oi)(p.issues.map((f)=>ne(f,u,W())))}:{success:!0,data:p.value}},zo=Oe($t),Ie=(t)=>async(o,n,c)=>{let u=c?{...c,async:!0}:{async:!0},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)p=await p;return p.issues.length?{success:!1,error:new t(p.issues.map((f)=>ne(f,u,W())))}:{success:!0,data:p.value}},vo=Ie($t);var $o=(t)=>{let o=Ke(t),n=(c,u,p,f)=>{let m=p?{...p,direction:"backward"}:{direction:"backward"};return o(c,u,m,Ve(n,f))};return n};var wo=(t)=>{let o=Ke(t),n=(c,u,p,f)=>o(c,u,p,Ve(n,f));return n};var ko=(t)=>{let o=We(t),n=async(c,u,p,f)=>{let m=p?{...p,direction:"backward"}:{direction:"backward"};return await o(c,u,m,Ve(n,f))};return n};var Zo=(t)=>{let o=We(t),n=async(c,u,p,f)=>await o(c,u,p,Ve(n,f));return n};var Po=(t)=>(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Oe(t)(o,n,u)};var So=(t)=>(o,n,c)=>Oe(t)(o,n,c);var Oo=(t)=>async(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Ie(t)(o,n,u)};var Io=(t)=>async(o,n,c)=>Ie(t)(o,n,c);var Eo=/^[cC][0-9a-z]{6,}$/,To=/^[0-9a-z]+$/,Ao=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,No=/^[0-9a-vA-V]{20}$/,Co=/^[A-Za-z0-9]{27}$/,jo=/^[a-zA-Z0-9_-]{21}$/;function Ro(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}var Do=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Lo=/^([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})$/,Pt=(t)=>{if(!t)return/^([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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wc="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Uo(){return new RegExp(Wc,"u")}var Mo=/^(?:(?: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])$/,Jo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Bo=/^((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])$/,Vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ko=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ot=/^[A-Za-z0-9_-]*$/;var Wo=/^https?$/,Go=/^\+[1-9]\d{6,14}$/;var 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])))";function Gc(t){return new RegExp(`^${t}$`)}var Yo=Gc(qo);function Zt(t){return typeof t.precision==="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xo(t){return new RegExp(`^${Zt(t)}$`)}function Ho(t){let o=["Z"];if(t.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Zt({precision:t.precision,seconds:!0})}(?:${o.join("|")})`,c=t.local?`${n}|${Zt({precision:t.precision})}`:n;return new RegExp(`^${qo}T(?:${c})$`)}var Qo=(t)=>{let o=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${o}$`)},en=/^-?\d+n?$/,Ge=/^-?\d+$/,Ee=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,rn=/^null$/i;var on=/^[^A-Z]*$/,nn=/^[^a-z]*$/;var M=v("$ZodCheck",(t,o)=>{var n;t._zod??(t._zod={}),t._zod.def=o,(n=t._zod).onattach??(n.onattach=[])});var It=(t)=>{let o=t.value;return!eo(o)&&o.length!==void 0},qe={number:"number",bigint:"bigint",object:"date"},Et=v("$ZodCheckLessThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(o.value<p)if(o.inclusive)u.maximum=o.value;else u.exclusiveMaximum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value<=o.value:c.value<o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_big",maximum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),Tt=v("$ZodCheckGreaterThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(o.value>p)if(o.inclusive)u.minimum=o.value;else u.exclusiveMinimum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value>=o.value:c.value>o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_small",minimum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),sn=v("$ZodCheckMultipleOf",(t,o)=>{M.init(t,o),t._zod.onattach.push((n)=>{var c;(c=n._zod.bag).multipleOf??(c.multipleOf=o.value)}),t._zod.check=(n)=>{if(typeof n.value!==typeof o.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?o.value!==BigInt(0)&&n.value%o.value===BigInt(0):to(n.value,o.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:o.value,input:n.value,inst:t,continue:!o.abort})}}),cn=v("$ZodCheckNumberFormat",(t,o)=>{M.init(t,o),o.format=o.format||"float64";let n=o.format?.includes("int"),c=n?"int":"number",[u,p]=uo[o.format];t._zod.onattach.push((f)=>{let m=f._zod.bag;if(m.format=o.format,m.minimum=u,m.maximum=p,n)m.pattern=Ge}),t._zod.check=(f)=>{let m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:c,format:o.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){if(m>0)f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});else f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});return}}if(m<u)f.issues.push({origin:"number",input:m,code:"too_small",minimum:u,inclusive:!0,inst:t,continue:!o.abort});if(m>p)f.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:t,continue:!o.abort})}});var un=v("$ZodCheckMaxLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.maximum??Number.POSITIVE_INFINITY;if(o.maximum<u)c._zod.bag.maximum=o.maximum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>o.maximum?Je(u):p)<=o.maximum)return;let m=Be(u);c.issues.push({origin:m,code:"too_big",maximum:o.maximum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),an=v("$ZodCheckMinLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(o.minimum>u)c._zod.bag.minimum=o.minimum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>=o.minimum&&p<o.minimum*2?Je(u):p)>=o.minimum)return;let m=Be(u);c.issues.push({origin:m,code:"too_small",minimum:o.minimum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),ln=v("$ZodCheckLengthEquals",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.minimum=o.length,u.maximum=o.length,u.length=o.length}),t._zod.check=(c)=>{let u=c.value,p=u.length,f=typeof u==="string"&&p>=o.length&&p<=o.length*2?Je(u):p;if(f===o.length)return;let m=Be(u),_=f>o.length;c.issues.push({origin:m,..._?{code:"too_big",maximum:o.length}:{code:"too_small",minimum:o.length},inclusive:!0,exact:!0,input:c.value,inst:t,continue:!o.abort})}}),Te=v("$ZodCheckStringFormat",(t,o)=>{var n,c;if(M.init(t,o),t._zod.onattach.push((u)=>{let p=u._zod.bag;if(p.format=o.format,o.pattern)p.patterns??(p.patterns=new Set),p.patterns.add(o.pattern)}),o.pattern)(n=t._zod).check??(n.check=(u)=>{if(o.pattern.lastIndex=0,o.pattern.test(u.value))return;u.issues.push({origin:"string",code:"invalid_format",format:o.format,input:u.value,...o.pattern?{pattern:o.pattern.toString()}:{},inst:t,continue:!o.abort})});else(c=t._zod).check??(c.check=()=>{})}),pn=v("$ZodCheckRegex",(t,o)=>{Te.init(t,o),t._zod.check=(n)=>{if(o.pattern.lastIndex=0,o.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:o.pattern.toString(),inst:t,continue:!o.abort})}}),fn=v("$ZodCheckLowerCase",(t,o)=>{o.pattern??(o.pattern=on),Te.init(t,o)}),dn=v("$ZodCheckUpperCase",(t,o)=>{o.pattern??(o.pattern=nn),Te.init(t,o)}),mn=v("$ZodCheckIncludes",(t,o)=>{M.init(t,o);let n=le(o.includes),c=new RegExp(typeof o.position==="number"?`^.{${o.position},}${n}`:n);o.pattern=c,t._zod.onattach.push((u)=>{let p=u._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(c)}),t._zod.check=(u)=>{if(u.value.includes(o.includes,o.position))return;u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:o.includes,input:u.value,inst:t,continue:!o.abort})}}),hn=v("$ZodCheckStartsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`^${le(o.prefix)}.*`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.startsWith(o.prefix))return;c.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:o.prefix,input:c.value,inst:t,continue:!o.abort})}}),_n=v("$ZodCheckEndsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`.*${le(o.suffix)}$`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.endsWith(o.suffix))return;c.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:o.suffix,input:c.value,inst:t,continue:!o.abort})}});var gn=v("$ZodCheckOverwrite",(t,o)=>{M.init(t,o),t._zod.check=(n)=>{n.value=o.tx(n.value)}});class At{constructor(t=[],o={}){this.content=[],this.indent=0,this.args=t,this.closed=o}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}let n=t.split(`
|
|
2
|
+
import{je}from"./chunk-tjavzarz.js";function Ue(t){let o=Object.values(t).filter((c)=>typeof c==="number");return Object.entries(t).filter(([c,u])=>o.indexOf(+c)===-1).map(([c,u])=>u)}function ft(t,o="|"){return t.map((n)=>ht(n)).join(o)}function we(t,o){if(typeof o==="bigint")return o.toString();return o}function ke(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function eo(t){return t===null||t===void 0}function Me(t){let o=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(o,n)}function to(t,o){let n=t/o,c=Math.round(n),u=4*Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-c)<u)return 0;return n-c}var Qr=Symbol("evaluating");function ro(t,o,n){let c=void 0;Object.defineProperty(t,o,{get(){if(c===Qr)return;if(c===void 0)c=Qr,c=n();return c},set(u){Object.defineProperty(t,o,{value:u})},configurable:!0})}function L(t,o,n){Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ae(...t){let o={};for(let n of t){let c=Object.getOwnPropertyDescriptors(n);Object.assign(o,c)}return Object.defineProperties({},o)}function oo(t){return JSON.stringify(t)}function no(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var dt="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var io=ke(()=>{if(B.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(t){return!1}});function me(t){if(ge(t)===!1)return!1;let o=t.constructor;if(o===void 0)return!0;if(typeof o!=="function")return!0;let n=o.prototype;if(ge(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function mt(t){if(me(t))return{...t};if(Array.isArray(t))return[...t];if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);return t}var so=new Set(["string","number","symbol"]);function le(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(t,o,n){let c=new t._zod.constr(o??t._zod.def);if(!o||n?.parent)c._zod.parent=t;return c}function S(t){let o=t;if(!o)return{};if(typeof o==="string")return{error:()=>o};if(o?.message!==void 0){if(o?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");o.error=o.message}if(delete o.message,typeof o.error==="string")return{...o,error:()=>o.error};return o}function ht(t){if(typeof t==="bigint")return t.toString()+"n";if(typeof t==="string")return`"${t}"`;return`${t}`}function co(t){return Object.keys(t).filter((o)=>t[o]._zod.optin!==void 0&&t[o]._zod.optout==="optional")}var uo=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function Sc(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={};for(let m of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,m))throw Error(`Unrecognized key: "${String(m)}"`);if(!o[m])continue;L(f,m,n.shape[m])}return L(this,"shape",f),f},checks:[]});return Y(t,p)}function Oc(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={...t._zod.def.shape};for(let m of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,m))throw Error(`Unrecognized key: "${String(m)}"`);if(!o[m])continue;delete f[m]}return L(this,"shape",f),f},checks:[]});return Y(t,p)}function Ic(t,o){if(!me(o))throw Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let p=t._zod.def.shape;for(let f of Reflect.ownKeys(o))if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let u=ae(t._zod.def,{get shape(){let p={...t._zod.def.shape,...o};return L(this,"shape",p),p}});return Y(t,u)}function Ec(t,o){if(!me(o))throw Error("Invalid input to safeExtend: expected a plain object");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o};return L(this,"shape",c),c}});return Y(t,n)}function Tc(t,o){if(!o?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o._zod.def.shape};return L(this,"shape",c),c},get catchall(){return o._zod.def.catchall},checks:o._zod.def.checks??[]});return Y(t,n)}function ao(t,o,n,c="partial"){let p=o._zod.def.checks;if(p&&p.length>0)throw Error(`.${c}() cannot be used on object schemas containing refinements`);let m=ae(o._zod.def,{get shape(){let _=o._zod.def.shape,b={..._};if(n)for(let z of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(_,z))throw Error(`Unrecognized key: "${String(z)}"`);if(!n[z])continue;b[z]=t?new t({type:"optional",innerType:_[z]}):_[z]}else for(let z of Reflect.ownKeys(_))b[z]=t?new t({type:"optional",innerType:_[z]}):_[z];return L(this,"shape",b),b},checks:[]});return Y(o,m)}function Ac(t,o,n){let c=ae(o._zod.def,{get shape(){let u=o._zod.def.shape,p={...u};if(n)for(let f of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(p,f))throw Error(`Unrecognized key: "${String(f)}"`);if(!n[f])continue;p[f]=new t({type:"nonoptional",innerType:u[f]})}else for(let f of Reflect.ownKeys(u))p[f]=new t({type:"nonoptional",innerType:u[f]});return L(this,"shape",p),p}});return Y(o,c)}function he(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function lo(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function te(t,o){return o.map((n)=>{var c;return(c=n).path??(c.path=[]),n.path.unshift(t),n})}function $e(t){return typeof t==="string"?t:t?.message}function _t(t,o,n){var c;for(let u=o;u<t.length;u++)(c=t[u]).schema??(c.schema=n)}function ne(t,o,n){var c;let u=t.inst?._zod?.traits;if(u?.has("$ZodType"))if(u.has("$ZodCheck"))(c=t).schema??(c.schema=t.inst);else t.schema=t.inst;let p=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,f=t.message?t.message:$e(t.inst?._zod.def?.error?.(t))??$e(p?.(t))??$e(o?.error?.(t))??$e(n.customError?.(t))??$e(n.localeError?.(t))??"Invalid input",{inst:m,schema:_,continue:b,input:z,...w}=t;if(w.path??(w.path=[]),w.message=f,o?.reportInput)w.input=z;return w}var Nc=/[\uD800-\uDBFF]/;function Je(t){let o=t.length;if(!Nc.test(t))return o;let n=o;for(let c=0;c<o-1;c++)if((t.charCodeAt(c)&64512)===55296&&(t.charCodeAt(c+1)&64512)===56320)n--,c++;return n}function Be(t){if(Array.isArray(t))return"array";if(typeof t==="string")return"string";return"unknown"}function po(t){let o=typeof t;switch(o){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return o}function _e(...t){let[o,n,c]=t;if(typeof o==="string")return{message:o,code:"custom",input:n,inst:c};return{...o}}function fo(t,o){for(let n in o){let c=Object.getOwnPropertyDescriptor(o,n);if(c.get)Object.defineProperty(t,n,{...c,enumerable:!1});else Cc(t,n,c.value)}}function de(t,o,n,c=!0){return Object.defineProperty(t,o,{configurable:!0,writable:!0,enumerable:c,value:n}),n}function gt(t,o,n){return de(t,o,n,!1)}function Cc(t,o,n){Object.defineProperty(t,o,{configurable:!0,get(){return this==null?n:de(this,o,n.bind(this))},set(c){de(this,o,c)}})}function jc(t,o){let n=Object.getPrototypeOf(t);return o in n?void 0:n}var pt,ue=!1,Rc={configurable:!0,get(){ue=!0;return}};function E(t,o,n){let c=Object.getPrototypeOf(t._zod);if(o in c&&pt!==t._zod){pt=void 0;return}pt=t._zod,Object.defineProperty(c,o,{configurable:!0,get(){Object.defineProperty(this,o,Rc);let u=ue;ue=!1;try{let p=n(this);if(ue)delete this[o];else Object.defineProperty(this,o,{configurable:!0,writable:!0,value:p});return ue=ue||u,p}catch(p){throw delete this[o],ue=ue||u,p}},set(u){Object.defineProperty(this,o,{configurable:!0,writable:!0,value:u})}})}function Dc(t,o,n,c){let u=jc(t,o);if(!u)return;Object.defineProperty(u,o,{configurable:!0,get(){let p={configurable:!0,writable:!0,enumerable:c,value:void 0};return Object.defineProperty(this,o,p),p.value=n(this),Object.defineProperty(this,o,p),p.value},set(p){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:c,value:p})}})}var Lc="~constantCatch";function mo(t){let o=()=>t;return o[Lc]=!0,o}var _o,Zr=Object.freeze({status:"aborted"}),xt={value:void 0,enumerable:!1},xo="captureStackTrace"in Error?Error:null;function Fc(t){let o=xo;if(o){let n=o.stackTraceLimit;if(typeof n==="number"){try{o.stackTraceLimit=0}catch{return xo=null,new t}try{return new t}finally{o.stackTraceLimit=n}}}return new t}function v(t,o,n,c){let u={};function p(k){this.def=k,this.constr=w,this.traits=new Set}p.prototype=u;let f=n,m=f&&new WeakSet;function _(k,Z){if(!k._zod){xt.value=new p(Z);try{Object.defineProperty(k,"_zod",xt)}finally{xt.value=void 0}}if(k._zod.traits.has(t))return;if(k._zod.traits.add(t),o(k,Z),m){let O=Object.getPrototypeOf(k),I=k._zod.constr.prototype,J=O;while(J&&J!==I)J=Object.getPrototypeOf(J);let q=J??O;if(!m.has(q))m.add(q),fo(q,f)}let P=w.prototype;for(let O in P){if(!Object.prototype.hasOwnProperty.call(P,O))continue;if(!(O in k))k[O]=P[O].bind(k)}}let b=c?.Parent??Object;class z extends b{}Object.defineProperty(z,"name",{value:t});function w(k){let Z=c?.Parent?Fc(z):this;_(Z,k);let P=Z._zod.deferred;if(P){for(let I of P)I();Z._zod.deferred=void 0}let O=globalThis.__zod_globalConfig?.postProcessor;if(O)O(Z);return Z}return Object.defineProperty(w,"init",{value:_}),Object.defineProperty(w,Symbol.hasInstance,{value:(k)=>{if(c?.Parent&&k instanceof c.Parent)return!0;return k?._zod?.traits?.has(t)}}),Object.defineProperty(w,"name",{value:t}),w}class ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ze extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`);this.name="ZodEncodeError"}}(_o=globalThis).__zod_globalConfig??(_o.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function W(t){if(t)Object.assign(B,t);return B}function Uc(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,we,2)),t.message}function Mc(t){this._zod.message=t}var Jc={get:Uc,set:Mc,enumerable:!0,configurable:!0},zt={value:void 0,enumerable:!1},vt={value:void 0,enumerable:!1},yo=new WeakSet([Object.prototype,Error.prototype]),bo=(t,o)=>{t.name="$ZodError",zt.value=t._zod,Object.defineProperty(t,"_zod",zt),vt.value=o,Object.defineProperty(t,"issues",vt),zt.value=void 0,vt.value=void 0,Object.defineProperty(t,"message",Jc);let n=Object.getPrototypeOf(t);if(!yo.has(n))yo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let c=()=>this.message;return Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0})}})},si=v("$ZodError",bo),$t=v("$ZodError",bo,void 0,{Parent:Error});function Bc(t,o,n){if(!Object.prototype.hasOwnProperty.call(t,o))if(o==="__proto__")Object.defineProperty(t,o,{value:n(),writable:!0,enumerable:!0,configurable:!0});else t[o]=n();return t[o]}function wt(t,o=(n)=>n.message){let n={},c=[];for(let u of t.issues)if(u.path.length>0)Bc(n,u.path[0],()=>[]).push(o(u));else c.push(o(u));return{formErrors:c,fieldErrors:n}}function kt(t,o=(n)=>n.message){let n={_errors:[]},c=(u,p=[])=>{for(let f of u.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map((m)=>c({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")c({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")c({issues:f.issues},[...p,...f.path]);else{let m=[...p,...f.path];if(m.length===0)n._errors.push(o(f));else{let _=n,b=0;while(b<m.length){let z=m[b],w=b===m.length-1;if(z==="_errors"){if(w)_._errors.push(o(f));b++;continue}if(!Object.prototype.hasOwnProperty.call(_,z))Object.defineProperty(_,z,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let k=_[z];if(w)k._errors.push(o(f));_=k,b++}}}};return c(t),n}function Vc(t){let o=[],n=t.map((c)=>typeof c==="object"?c.key:c);for(let c of n)if(typeof c==="number")o.push(`[${c}]`);else if(typeof c==="symbol")o.push(`[${JSON.stringify(String(c))}]`);else if(/[^\w$]/.test(c))o.push(`[${JSON.stringify(c)}]`);else{if(o.length)o.push(".");o.push(c)}return o.join("")}function gf(t){let o=[],n=[...t.issues].sort((c,u)=>(c.path??[]).length-(u.path??[]).length);for(let c of n)if(o.push(`\u2716 ${c.message}`),c.path?.length)o.push(` \u2192 at ${Vc(c.path)}`);return o.join(`
|
|
3
|
+
`)}function Ve(t,o){return{callee:o?.callee??t,Err:o?.Err}}var Ke=(t)=>{let o=(n,c,u,p)=>{let f=u?{...u,async:!1}:{async:!1},m=n._zod.run({value:c,issues:[]},f);if(m instanceof Promise)throw new ie;if(m.issues.length){let _=new(p?.Err??t)(m.issues.map((b)=>ne(b,f,W())));throw dt(_,p?.callee??o),_}return m.value};return o};var We=(t)=>{let o=async(n,c,u,p)=>{let f=u?{...u,async:!0}:{async:!0},m=n._zod.run({value:c,issues:[]},f);if(m instanceof Promise)m=await m;if(m.issues.length){let _=new(p?.Err??t)(m.issues.map((b)=>ne(b,f,W())));throw dt(_,p?.callee??o),_}return m.value};return o};var Pe=(t)=>(o,n,c)=>{let u=c?{...c,async:!1}:{async:!1},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)throw new ie;return p.issues.length?{success:!1,error:new(t??si)(p.issues.map((f)=>ne(f,u,W())))}:{success:!0,data:p.value}},zo=Pe($t),Oe=(t)=>async(o,n,c)=>{let u=c?{...c,async:!0}:{async:!0},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)p=await p;return p.issues.length?{success:!1,error:new t(p.issues.map((f)=>ne(f,u,W())))}:{success:!0,data:p.value}},vo=Oe($t);var $o=(t)=>{let o=Ke(t),n=(c,u,p,f)=>{let m=p?{...p,direction:"backward"}:{direction:"backward"};return o(c,u,m,Ve(n,f))};return n};var wo=(t)=>{let o=Ke(t),n=(c,u,p,f)=>o(c,u,p,Ve(n,f));return n};var ko=(t)=>{let o=We(t),n=async(c,u,p,f)=>{let m=p?{...p,direction:"backward"}:{direction:"backward"};return await o(c,u,m,Ve(n,f))};return n};var Zo=(t)=>{let o=We(t),n=async(c,u,p,f)=>await o(c,u,p,Ve(n,f));return n};var Po=(t)=>(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Pe(t)(o,n,u)};var So=(t)=>(o,n,c)=>Pe(t)(o,n,c);var Oo=(t)=>async(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Oe(t)(o,n,u)};var Io=(t)=>async(o,n,c)=>Oe(t)(o,n,c);var Eo=/^[cC][0-9a-z]{6,}$/,To=/^[0-9a-z]+$/,Ao=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,No=/^[0-9a-vA-V]{20}$/,Co=/^[A-Za-z0-9]{27}$/,jo=/^[a-zA-Z0-9_-]{21}$/;function Ro(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}var Do=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Lo=/^([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})$/,Pt=(t)=>{if(!t)return/^([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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wc="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Uo(){return new RegExp(Wc,"u")}var Mo=/^(?:(?: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])$/,Jo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Bo=/^((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])$/,Vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ko=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ot=/^[A-Za-z0-9_-]*$/;var Wo=/^https?$/,Go=/^\+[1-9]\d{6,14}$/;var 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])))";function Gc(t){return new RegExp(`^${t}$`)}var Yo=Gc(qo);function Zt(t){return typeof t.precision==="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xo(t){return new RegExp(`^${Zt(t)}$`)}function Ho(t){let o=["Z"];if(t.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Zt({precision:t.precision,seconds:!0})}(?:${o.join("|")})`,c=t.local?`${n}|${Zt({precision:t.precision})}`:n;return new RegExp(`^${qo}T(?:${c})$`)}var Qo=(t)=>{let o=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${o}$`)},en=/^-?\d+n?$/,Ge=/^-?\d+$/,Ie=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,rn=/^null$/i;var on=/^[^A-Z]*$/,nn=/^[^a-z]*$/;var M=v("$ZodCheck",(t,o)=>{var n;t._zod??(t._zod={}),t._zod.def=o,(n=t._zod).onattach??(n.onattach=[])});var It=(t)=>{let o=t.value;return!eo(o)&&o.length!==void 0},qe={number:"number",bigint:"bigint",object:"date"},Et=v("$ZodCheckLessThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(o.value<p)if(o.inclusive)u.maximum=o.value;else u.exclusiveMaximum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value<=o.value:c.value<o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_big",maximum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),Tt=v("$ZodCheckGreaterThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(o.value>p)if(o.inclusive)u.minimum=o.value;else u.exclusiveMinimum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value>=o.value:c.value>o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_small",minimum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),sn=v("$ZodCheckMultipleOf",(t,o)=>{M.init(t,o),t._zod.onattach.push((n)=>{var c;(c=n._zod.bag).multipleOf??(c.multipleOf=o.value)}),t._zod.check=(n)=>{if(typeof n.value!==typeof o.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?o.value!==BigInt(0)&&n.value%o.value===BigInt(0):to(n.value,o.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:o.value,input:n.value,inst:t,continue:!o.abort})}}),cn=v("$ZodCheckNumberFormat",(t,o)=>{M.init(t,o),o.format=o.format||"float64";let n=o.format?.includes("int"),c=n?"int":"number",[u,p]=uo[o.format];t._zod.onattach.push((f)=>{let m=f._zod.bag;if(m.format=o.format,m.minimum=u,m.maximum=p,n)m.pattern=Ge}),t._zod.check=(f)=>{let m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:c,format:o.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){if(m>0)f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});else f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});return}}if(m<u)f.issues.push({origin:"number",input:m,code:"too_small",minimum:u,inclusive:!0,inst:t,continue:!o.abort});if(m>p)f.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:t,continue:!o.abort})}});var un=v("$ZodCheckMaxLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.maximum??Number.POSITIVE_INFINITY;if(o.maximum<u)c._zod.bag.maximum=o.maximum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>o.maximum?Je(u):p)<=o.maximum)return;let m=Be(u);c.issues.push({origin:m,code:"too_big",maximum:o.maximum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),an=v("$ZodCheckMinLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(o.minimum>u)c._zod.bag.minimum=o.minimum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>=o.minimum&&p<o.minimum*2?Je(u):p)>=o.minimum)return;let m=Be(u);c.issues.push({origin:m,code:"too_small",minimum:o.minimum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),ln=v("$ZodCheckLengthEquals",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.minimum=o.length,u.maximum=o.length,u.length=o.length}),t._zod.check=(c)=>{let u=c.value,p=u.length,f=typeof u==="string"&&p>=o.length&&p<=o.length*2?Je(u):p;if(f===o.length)return;let m=Be(u),_=f>o.length;c.issues.push({origin:m,..._?{code:"too_big",maximum:o.length}:{code:"too_small",minimum:o.length},inclusive:!0,exact:!0,input:c.value,inst:t,continue:!o.abort})}}),Ee=v("$ZodCheckStringFormat",(t,o)=>{var n,c;if(M.init(t,o),t._zod.onattach.push((u)=>{let p=u._zod.bag;if(p.format=o.format,o.pattern)p.patterns??(p.patterns=new Set),p.patterns.add(o.pattern)}),o.pattern)(n=t._zod).check??(n.check=(u)=>{if(o.pattern.lastIndex=0,o.pattern.test(u.value))return;u.issues.push({origin:"string",code:"invalid_format",format:o.format,input:u.value,...o.pattern?{pattern:o.pattern.toString()}:{},inst:t,continue:!o.abort})});else(c=t._zod).check??(c.check=()=>{})}),pn=v("$ZodCheckRegex",(t,o)=>{Ee.init(t,o),t._zod.check=(n)=>{if(o.pattern.lastIndex=0,o.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:o.pattern.toString(),inst:t,continue:!o.abort})}}),fn=v("$ZodCheckLowerCase",(t,o)=>{o.pattern??(o.pattern=on),Ee.init(t,o)}),dn=v("$ZodCheckUpperCase",(t,o)=>{o.pattern??(o.pattern=nn),Ee.init(t,o)}),mn=v("$ZodCheckIncludes",(t,o)=>{M.init(t,o);let n=le(o.includes),c=new RegExp(typeof o.position==="number"?`^.{${o.position},}${n}`:n);o.pattern=c,t._zod.onattach.push((u)=>{let p=u._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(c)}),t._zod.check=(u)=>{if(u.value.includes(o.includes,o.position))return;u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:o.includes,input:u.value,inst:t,continue:!o.abort})}}),hn=v("$ZodCheckStartsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`^${le(o.prefix)}.*`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.startsWith(o.prefix))return;c.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:o.prefix,input:c.value,inst:t,continue:!o.abort})}}),_n=v("$ZodCheckEndsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`.*${le(o.suffix)}$`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.endsWith(o.suffix))return;c.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:o.suffix,input:c.value,inst:t,continue:!o.abort})}});var gn=v("$ZodCheckOverwrite",(t,o)=>{M.init(t,o),t._zod.check=(n)=>{n.value=o.tx(n.value)}});class At{constructor(t=[],o={}){this.content=[],this.indent=0,this.args=t,this.closed=o}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}let n=t.split(`
|
|
4
4
|
`).filter((p)=>p),c=Math.min(...n.map((p)=>p.length-p.trimStart().length)),u=n.map((p)=>p.slice(c)).map((p)=>" ".repeat(this.indent*2)+p);for(let p of u)this.content.push(p)}compile(){let t=Function,o=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${o.join(`
|
|
6
6
|
`)}
|
|
7
|
-
};`)(...Object.values(this.closed))}}var yn={major:4,minor:5,patch:4};var A=v("$ZodType",(t,o)=>{var n;t??(t={}),t._zod.def=o,t._zod.bag=t._zod.bag||{},t._zod.version=yn;let c=t._zod.def.checks,u=t._zod.traits.has("$ZodCheck")?[t,...c??[]]:c?.length?[...c]:[];for(let p of u)for(let f of p._zod.onattach)f(t);if(u.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let p=(m,_,b)=>{if(m.memo)return m;let z=he(m),w;for(let k of _){if(k._zod.def.when){if(lo(m))continue;if(!k._zod.def.when(m))continue}else if(z)continue;let Z=m.issues.length,P=k._zod.check(m);if(P instanceof Promise&&b?.async===!1)throw new ie;if(w||P instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await P,m.issues.length===Z)return;if(_t(m.issues,Z,t),!z)z=he(m,Z)});else{if(m.issues.length===Z)continue;if(_t(m.issues,Z,t),!z)z=he(m,Z)}}if(w)return w.then(()=>m);return m},f=(m,_,b)=>{if(he(m))return m.aborted=!0,m;let z=p(_,u,b);if(z instanceof Promise){if(b.async===!1)throw new ie;return z.then((w)=>t._zod.parse(w,b))}return t._zod.parse(z,b)};t._zod.run=(m,_)=>{if(_.skipChecks)return t._zod.parse(m,_);if(_.direction==="backward"){let z=t._zod.parse({value:m.value,issues:[]},{..._,skipChecks:!0});if(z instanceof Promise)return z.then((w)=>f(w,m,_));return f(z,m,_)}let b=t._zod.parse(m,_);if(b instanceof Promise){if(_.async===!1)throw new ie;return b.then((z)=>p(z,u,_))}return p(b,u,_)}}},{get "~standard"(){return gt(this,"~standard",jt(this))},set "~standard"(t){de(this,"~standard",t)}}),bn=(t)=>t.success?{value:t.data}:{issues:t.error?.issues};function jt(t){return{validate:(o)=>{try{return bn(zo(t,o))}catch(n){return vo(t,o).then(bn)}},vendor:"zod",version:1}}var He=v("$ZodString",(t,o)=>{A.init(t,o),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qo(t._zod.bag),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=String(n.value)}catch(u){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),j=v("$ZodStringFormat",(t,o)=>{Te.init(t,o),He.init(t,o)}),An=v("$ZodGUID",(t,o)=>{o.pattern??(o.pattern=Lo),j.init(t,o)}),Nn=v("$ZodUUID",(t,o)=>{if(o.version){let c={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[o.version];if(c===void 0)throw Error(`Invalid UUID version: "${o.version}"`);o.pattern??(o.pattern=Pt(c))}else o.pattern??(o.pattern=Pt());j.init(t,o)}),Cn=v("$ZodEmail",(t,o)=>{o.pattern??(o.pattern=Fo),j.init(t,o)}),jn=1,Rn=2;function qc(t,o){if(!o.normalize&&o.protocol?.source===Wo.source&&!/^https?:\/\//i.test(t))return jn;try{return new URL(t)}catch{return Rn}}var Yc=/[\t\n\r]/g;function Xc(t){return t.replace(Yc,"")}function Hc(t,o){return o.lastIndex=0,o.test(t.hostname)}function Qc(t,o){return o.lastIndex=0,o.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}var Dn=v("$ZodURL",(t,o)=>{j.init(t,o),t._zod.check=(n)=>{try{let c=n.value.trim(),u=qc(c,o);if(u===jn){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!o.abort});return}if(u===Rn){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort});return}if(o.hostname&&!Hc(u,o.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.hostname.source,input:n.value,inst:t,continue:!o.abort});if(o.protocol&&!Qc(u,o.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:o.protocol.source,input:n.value,inst:t,continue:!o.abort});n.value=o.normalize?u.href:Xc(c);return}catch(c){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort})}}}),Ln=v("$ZodEmoji",(t,o)=>{o.pattern??(o.pattern=Uo()),j.init(t,o)}),Fn=v("$ZodNanoID",(t,o)=>{if(o.length!==void 0&&(!Number.isInteger(o.length)||o.length<1))throw Error(`Invalid nanoid length: ${o.length}`);o.pattern??(o.pattern=o.length===void 0?jo:Ro(o.length)),j.init(t,o)}),Un=v("$ZodCUID",(t,o)=>{o.pattern??(o.pattern=Eo),j.init(t,o)}),Mn=v("$ZodCUID2",(t,o)=>{o.pattern??(o.pattern=To),j.init(t,o)}),Jn=v("$ZodULID",(t,o)=>{o.pattern??(o.pattern=Ao),j.init(t,o)}),Bn=v("$ZodXID",(t,o)=>{o.pattern??(o.pattern=No),j.init(t,o)}),Vn=v("$ZodKSUID",(t,o)=>{o.pattern??(o.pattern=Co),j.init(t,o)}),Kn=v("$ZodISODateTime",(t,o)=>{if(o.pattern??(o.pattern=Ho(o)),j.init(t,o),o.local||o.precision===-1)t._zod.bag.laxFormat=!0,t._zod.onattach.push((n)=>{n._zod.bag.laxFormat=!0})}),Wn=v("$ZodISODate",(t,o)=>{o.pattern??(o.pattern=Yo),j.init(t,o)}),Gn=v("$ZodISOTime",(t,o)=>{o.pattern??(o.pattern=Xo(o)),j.init(t,o)}),qn=v("$ZodISODuration",(t,o)=>{o.pattern??(o.pattern=Do),j.init(t,o)}),Yn=v("$ZodIPv4",(t,o)=>{o.pattern??(o.pattern=Mo),j.init(t,o),t._zod.bag.format="ipv4"}),eu=/^[0-9a-fA-F:.]+$/;function Xn(t){if(!eu.test(t))return!1;try{return new URL(`http://[${t}]`),!0}catch{return!1}}var Hn=v("$ZodIPv6",(t,o)=>{o.pattern??(o.pattern=Jo),j.init(t,o),t._zod.bag.format="ipv6",t._zod.check=(n)=>{if(!Xn(n.value))n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!o.abort})}});var Qn=v("$ZodCIDRv4",(t,o)=>{o.pattern??(o.pattern=Bo),j.init(t,o)});function tu(t){let o=t.split("/");if(o.length!==2)return!1;let[n,c]=o;if(!c)return!1;let u=Number(c);if(`${u}`!==c)return!1;if(u<0||u>128)return!1;return Xn(n)}var ei=v("$ZodCIDRv6",(t,o)=>{o.pattern??(o.pattern=Vo),j.init(t,o),t._zod.check=(n)=>{if(!tu(n.value))n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!o.abort})}});function ti(t){if(t==="")return!0;if(/\s/.test(t))return!1;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var ri=v("$ZodBase64",(t,o)=>{o.pattern??(o.pattern=Ko),j.init(t,o),t._zod.bag.contentEncoding="base64",t._zod.check=(n)=>{if(ti(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!o.abort})}});function ru(t){if(!Ot.test(t))return!1;let o=t.replace(/[-_]/g,(c)=>c==="-"?"+":"/"),n=o.padEnd(Math.ceil(o.length/4)*4,"=");return ti(n)}var ni=v("$ZodBase64URL",(t,o)=>{o.pattern??(o.pattern=Ot),j.init(t,o),t._zod.bag.contentEncoding="base64url",t._zod.check=(n)=>{if(ru(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!o.abort})}}),ci=v("$ZodE164",(t,o)=>{o.pattern??(o.pattern=Go),j.init(t,o)});function ou(t,o=null){try{let n=t.split(".");if(n.length!==3)return!1;let[c]=n;if(!c)return!1;let u=JSON.parse(atob(c));if("typ"in u&&u?.typ!=="JWT")return!1;if(!u.alg)return!1;if(o&&(!("alg"in u)||u.alg!==o))return!1;return!0}catch{return!1}}var ui=v("$ZodJWT",(t,o)=>{j.init(t,o),t._zod.check=(n)=>{if(ou(n.value,o.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!o.abort})}});var Dt=v("$ZodNumber",(t,o)=>{A.init(t,o),t._zod.pattern=t._zod.bag.pattern??Ee,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Number(n.value)}catch(f){}let u=n.value;if(typeof u==="number"&&!Number.isNaN(u)&&Number.isFinite(u))return n;let p=typeof u==="number"?Number.isNaN(u)?"NaN":!Number.isFinite(u)?String(u):void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:u,inst:t,...p?{received:p}:{}}),n}}),li=v("$ZodNumberFormat",(t,o)=>{cn.init(t,o),Dt.init(t,o)}),pi=v("$ZodBoolean",(t,o)=>{A.init(t,o),t._zod.pattern=tn,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Boolean(n.value)}catch(p){}let u=n.value;if(typeof u==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:t}),n}}),fi=v("$ZodBigInt",(t,o)=>{A.init(t,o),t._zod.pattern=en,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=BigInt(n.value)}catch(u){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}});var di=v("$ZodNull",(t,o)=>{A.init(t,o),t._zod.pattern=rn,t._zod.values=new Set([null]),t._zod.parse=(n,c)=>{let u=n.value;if(u===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:u,inst:t}),n}}),mi=v("$ZodAny",(t,o)=>{A.init(t,o),t._zod.parse=(n)=>n}),hi=v("$ZodUnknown",(t,o)=>{A.init(t,o),t._zod.parse=(n)=>n}),_i=v("$ZodNever",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),gi=v("$ZodVoid",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{let u=n.value;if(typeof u>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:u,inst:t}),n}}),xi=v("$ZodDate",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=new Date(n.value)}catch(m){}let u=n.value,p=u instanceof Date;if(p&&!Number.isNaN(u.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:u,...p?{received:"Invalid Date"}:{},inst:t}),n}});function zn(t,o,n){if(t.issues.length)o.issues.push(...te(n,t.issues));o.value[n]=t.value}var yi=v("$ZodArray",(t,o)=>{A.init(t,o);let n=B.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!Array.isArray(p))return c.issues.push({expected:"array",code:"invalid_type",input:p,inst:t}),c;c.value=n?n.alloc(t,c,Array(p.length),u):Array(p.length);let f=[];for(let m=0;m<p.length;m++){let _=p[m],b=o.element._zod.run({value:_,issues:[]},u);if(b instanceof Promise)f.push(b.then((z)=>zn(z,c,m)));else zn(b,c,m)}if(f.length)return Promise.all(f).then(()=>c);return c}});function Xe(t,o,n,c,u,p){let f=n in c,m=p==="optional";if(!f&&m&&u==="optional")return;if(t.issues.length){if(u!==void 0&&m&&!f)return;o.issues.push(...te(n,t.issues))}if(!f&&u===void 0){if(!t.issues.length)o.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(t.value===void 0){if(f)o.value[n]=void 0}else o.value[n]=t.value}var nu=[];function bi(t){let o=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),c=n.length?n:nu,u=c.length?[...o,...c]:o;for(let f of u)if(!t.shape?.[f]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(f)}": expected a Zod schema`);let p=co(t.shape);return{...t,allKeys:u,symbolKeys:c,keySet:new Set(o),numKeys:o.length,optionalKeys:new Set(p)}}function zi(t,o,n,c,u,p){let f=[],m=u.keySet,_=u.catchall._zod,b=_.def.type,{optin:z,optout:w}=_;for(let k in o){if(m.has(k))continue;if(k==="__proto__"){if(b==="never")f.push(k);continue}if(b==="never"){f.push(k);continue}let Z=_.run({value:o[k],issues:[]},c);if(Z instanceof Promise)t.push(Z.then((P)=>Xe(P,n,k,o,z,w)));else Xe(Z,n,k,o,z,w)}if(f.length)n.issues.push({code:"unrecognized_keys",keys:f,input:o,inst:p,continue:!0});if(!t.length)return n;return Promise.all(t).then(()=>n)}var Nt=new WeakMap,iu=v("$ZodObject",(t,o)=>{if(A.init(t,o),!Object.getOwnPropertyDescriptor(o,"shape")?.get){let _=o.shape;Nt.set(o,_),Object.defineProperty(o,"shape",{get:()=>{let b={..._};return Object.defineProperty(o,"shape",{value:b}),Nt.set(o,b),b}})}let c=Ze(()=>bi(o));E(t,"propValues",(_)=>{let b=_.def.shape,z={};for(let w in b){let k=b[w]._zod;if(k.values){if(!Object.prototype.hasOwnProperty.call(z,w))L(z,w,new Set);for(let Z of k.values)z[w].add(Z);if(k.optin!==void 0)z[w].add(void 0)}}return z});let u=ge,p=o.catchall,f,m=B.memoizer;m?.attach(t),t._zod.parse=(_,b)=>{f??(f=c.value);let z=_.value;if(!u(z))return _.issues.push({expected:"object",code:"invalid_type",input:z,inst:t}),_;_.value=m?m.alloc(t,_,{},b):{};let w=[],k=f.shape;for(let Z of f.allKeys){if(Z==="__proto__")continue;let P=k[Z],O=P._zod.optin,I=P._zod.optout,J=P._zod.run({value:z[Z],issues:[]},b);if(J instanceof Promise)w.push(J.then((q)=>Xe(q,_,Z,z,O,I)));else Xe(J,_,Z,z,O,I)}if(!p)return w.length?Promise.all(w).then(()=>_):_;return zi(w,z,_,b,c.value,t)}}),vi=v("$ZodObjectJIT",(t,o)=>{iu.init(t,o);let n=t._zod.parse,c=Ze(()=>bi(o)),u=B.memoizer,p=(Z)=>{let P=c.value,O=P.symbolKeys,I=new At(["payload","ctx"],{shape:Z,inst:t,memo:u,syms:O}),J=(K)=>`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`,q=(K,R)=>`
|
|
7
|
+
};`)(...Object.values(this.closed))}}var yn={major:4,minor:5,patch:4};var A=v("$ZodType",(t,o)=>{var n;t??(t={}),t._zod.def=o,t._zod.bag=t._zod.bag||{},t._zod.version=yn;let c=t._zod.def.checks,u=t._zod.traits.has("$ZodCheck")?[t,...c??[]]:c?.length?[...c]:[];for(let p of u)for(let f of p._zod.onattach)f(t);if(u.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let p=(m,_,b)=>{if(m.memo)return m;let z=he(m),w;for(let k of _){if(k._zod.def.when){if(lo(m))continue;if(!k._zod.def.when(m))continue}else if(z)continue;let Z=m.issues.length,P=k._zod.check(m);if(P instanceof Promise&&b?.async===!1)throw new ie;if(w||P instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await P,m.issues.length===Z)return;if(_t(m.issues,Z,t),!z)z=he(m,Z)});else{if(m.issues.length===Z)continue;if(_t(m.issues,Z,t),!z)z=he(m,Z)}}if(w)return w.then(()=>m);return m},f=(m,_,b)=>{if(he(m))return m.aborted=!0,m;let z=p(_,u,b);if(z instanceof Promise){if(b.async===!1)throw new ie;return z.then((w)=>t._zod.parse(w,b))}return t._zod.parse(z,b)};t._zod.run=(m,_)=>{if(_.skipChecks)return t._zod.parse(m,_);if(_.direction==="backward"){let z=t._zod.parse({value:m.value,issues:[]},{..._,skipChecks:!0});if(z instanceof Promise)return z.then((w)=>f(w,m,_));return f(z,m,_)}let b=t._zod.parse(m,_);if(b instanceof Promise){if(_.async===!1)throw new ie;return b.then((z)=>p(z,u,_))}return p(b,u,_)}}},{get "~standard"(){return gt(this,"~standard",jt(this))},set "~standard"(t){de(this,"~standard",t)}}),bn=(t)=>t.success?{value:t.data}:{issues:t.error?.issues};function jt(t){return{validate:(o)=>{try{return bn(zo(t,o))}catch(n){return vo(t,o).then(bn)}},vendor:"zod",version:1}}var He=v("$ZodString",(t,o)=>{A.init(t,o),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qo(t._zod.bag),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=String(n.value)}catch(u){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),j=v("$ZodStringFormat",(t,o)=>{Ee.init(t,o),He.init(t,o)}),An=v("$ZodGUID",(t,o)=>{o.pattern??(o.pattern=Lo),j.init(t,o)}),Nn=v("$ZodUUID",(t,o)=>{if(o.version){let c={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[o.version];if(c===void 0)throw Error(`Invalid UUID version: "${o.version}"`);o.pattern??(o.pattern=Pt(c))}else o.pattern??(o.pattern=Pt());j.init(t,o)}),Cn=v("$ZodEmail",(t,o)=>{o.pattern??(o.pattern=Fo),j.init(t,o)}),jn=1,Rn=2;function qc(t,o){if(!o.normalize&&o.protocol?.source===Wo.source&&!/^https?:\/\//i.test(t))return jn;try{return new URL(t)}catch{return Rn}}var Yc=/[\t\n\r]/g;function Xc(t){return t.replace(Yc,"")}function Hc(t,o){return o.lastIndex=0,o.test(t.hostname)}function Qc(t,o){return o.lastIndex=0,o.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}var Dn=v("$ZodURL",(t,o)=>{j.init(t,o),t._zod.check=(n)=>{try{let c=n.value.trim(),u=qc(c,o);if(u===jn){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!o.abort});return}if(u===Rn){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort});return}if(o.hostname&&!Hc(u,o.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.hostname.source,input:n.value,inst:t,continue:!o.abort});if(o.protocol&&!Qc(u,o.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:o.protocol.source,input:n.value,inst:t,continue:!o.abort});n.value=o.normalize?u.href:Xc(c);return}catch(c){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort})}}}),Ln=v("$ZodEmoji",(t,o)=>{o.pattern??(o.pattern=Uo()),j.init(t,o)}),Fn=v("$ZodNanoID",(t,o)=>{if(o.length!==void 0&&(!Number.isInteger(o.length)||o.length<1))throw Error(`Invalid nanoid length: ${o.length}`);o.pattern??(o.pattern=o.length===void 0?jo:Ro(o.length)),j.init(t,o)}),Un=v("$ZodCUID",(t,o)=>{o.pattern??(o.pattern=Eo),j.init(t,o)}),Mn=v("$ZodCUID2",(t,o)=>{o.pattern??(o.pattern=To),j.init(t,o)}),Jn=v("$ZodULID",(t,o)=>{o.pattern??(o.pattern=Ao),j.init(t,o)}),Bn=v("$ZodXID",(t,o)=>{o.pattern??(o.pattern=No),j.init(t,o)}),Vn=v("$ZodKSUID",(t,o)=>{o.pattern??(o.pattern=Co),j.init(t,o)}),Kn=v("$ZodISODateTime",(t,o)=>{if(o.pattern??(o.pattern=Ho(o)),j.init(t,o),o.local||o.precision===-1)t._zod.bag.laxFormat=!0,t._zod.onattach.push((n)=>{n._zod.bag.laxFormat=!0})}),Wn=v("$ZodISODate",(t,o)=>{o.pattern??(o.pattern=Yo),j.init(t,o)}),Gn=v("$ZodISOTime",(t,o)=>{o.pattern??(o.pattern=Xo(o)),j.init(t,o)}),qn=v("$ZodISODuration",(t,o)=>{o.pattern??(o.pattern=Do),j.init(t,o)}),Yn=v("$ZodIPv4",(t,o)=>{o.pattern??(o.pattern=Mo),j.init(t,o),t._zod.bag.format="ipv4"}),eu=/^[0-9a-fA-F:.]+$/;function Xn(t){if(!eu.test(t))return!1;try{return new URL(`http://[${t}]`),!0}catch{return!1}}var Hn=v("$ZodIPv6",(t,o)=>{o.pattern??(o.pattern=Jo),j.init(t,o),t._zod.bag.format="ipv6",t._zod.check=(n)=>{if(!Xn(n.value))n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!o.abort})}});var Qn=v("$ZodCIDRv4",(t,o)=>{o.pattern??(o.pattern=Bo),j.init(t,o)});function tu(t){let o=t.split("/");if(o.length!==2)return!1;let[n,c]=o;if(!c)return!1;let u=Number(c);if(`${u}`!==c)return!1;if(u<0||u>128)return!1;return Xn(n)}var ei=v("$ZodCIDRv6",(t,o)=>{o.pattern??(o.pattern=Vo),j.init(t,o),t._zod.check=(n)=>{if(!tu(n.value))n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!o.abort})}});function ti(t){if(t==="")return!0;if(/\s/.test(t))return!1;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var ri=v("$ZodBase64",(t,o)=>{o.pattern??(o.pattern=Ko),j.init(t,o),t._zod.bag.contentEncoding="base64",t._zod.check=(n)=>{if(ti(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!o.abort})}});function ru(t){if(!Ot.test(t))return!1;let o=t.replace(/[-_]/g,(c)=>c==="-"?"+":"/"),n=o.padEnd(Math.ceil(o.length/4)*4,"=");return ti(n)}var oi=v("$ZodBase64URL",(t,o)=>{o.pattern??(o.pattern=Ot),j.init(t,o),t._zod.bag.contentEncoding="base64url",t._zod.check=(n)=>{if(ru(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!o.abort})}}),ni=v("$ZodE164",(t,o)=>{o.pattern??(o.pattern=Go),j.init(t,o)});function ou(t,o=null){try{let n=t.split(".");if(n.length!==3)return!1;let[c]=n;if(!c)return!1;let u=JSON.parse(atob(c));if("typ"in u&&u?.typ!=="JWT")return!1;if(!u.alg)return!1;if(o&&(!("alg"in u)||u.alg!==o))return!1;return!0}catch{return!1}}var ci=v("$ZodJWT",(t,o)=>{j.init(t,o),t._zod.check=(n)=>{if(ou(n.value,o.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!o.abort})}});var Dt=v("$ZodNumber",(t,o)=>{A.init(t,o),t._zod.pattern=t._zod.bag.pattern??Ie,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Number(n.value)}catch(f){}let u=n.value;if(typeof u==="number"&&!Number.isNaN(u)&&Number.isFinite(u))return n;let p=typeof u==="number"?Number.isNaN(u)?"NaN":!Number.isFinite(u)?String(u):void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:u,inst:t,...p?{received:p}:{}}),n}}),ui=v("$ZodNumberFormat",(t,o)=>{cn.init(t,o),Dt.init(t,o)}),pi=v("$ZodBoolean",(t,o)=>{A.init(t,o),t._zod.pattern=tn,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Boolean(n.value)}catch(p){}let u=n.value;if(typeof u==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:t}),n}}),fi=v("$ZodBigInt",(t,o)=>{A.init(t,o),t._zod.pattern=en,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=BigInt(n.value)}catch(u){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}});var di=v("$ZodNull",(t,o)=>{A.init(t,o),t._zod.pattern=rn,t._zod.values=new Set([null]),t._zod.parse=(n,c)=>{let u=n.value;if(u===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:u,inst:t}),n}}),mi=v("$ZodAny",(t,o)=>{A.init(t,o),t._zod.parse=(n)=>n}),hi=v("$ZodUnknown",(t,o)=>{A.init(t,o),t._zod.parse=(n)=>n}),_i=v("$ZodNever",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),gi=v("$ZodVoid",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{let u=n.value;if(typeof u>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:u,inst:t}),n}}),xi=v("$ZodDate",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=new Date(n.value)}catch(m){}let u=n.value,p=u instanceof Date;if(p&&!Number.isNaN(u.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:u,...p?{received:"Invalid Date"}:{},inst:t}),n}});function zn(t,o,n){if(t.issues.length)o.issues.push(...te(n,t.issues));o.value[n]=t.value}var yi=v("$ZodArray",(t,o)=>{A.init(t,o);let n=B.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!Array.isArray(p))return c.issues.push({expected:"array",code:"invalid_type",input:p,inst:t}),c;c.value=n?n.alloc(t,c,Array(p.length),u):Array(p.length);let f=[];for(let m=0;m<p.length;m++){let _=p[m],b=o.element._zod.run({value:_,issues:[]},u);if(b instanceof Promise)f.push(b.then((z)=>zn(z,c,m)));else zn(b,c,m)}if(f.length)return Promise.all(f).then(()=>c);return c}});function Xe(t,o,n,c,u,p){let f=n in c,m=p==="optional";if(!f&&m&&u==="optional")return;if(t.issues.length){if(u!==void 0&&m&&!f)return;o.issues.push(...te(n,t.issues))}if(!f&&u===void 0){if(!t.issues.length)o.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(t.value===void 0){if(f)o.value[n]=void 0}else o.value[n]=t.value}var nu=[];function bi(t){let o=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),c=n.length?n:nu,u=c.length?[...o,...c]:o;for(let f of u)if(!t.shape?.[f]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(f)}": expected a Zod schema`);let p=co(t.shape);return{...t,allKeys:u,symbolKeys:c,keySet:new Set(o),numKeys:o.length,optionalKeys:new Set(p)}}function zi(t,o,n,c,u,p){let f=[],m=u.keySet,_=u.catchall._zod,b=_.def.type,{optin:z,optout:w}=_;for(let k in o){if(m.has(k))continue;if(k==="__proto__"){if(b==="never")f.push(k);continue}if(b==="never"){f.push(k);continue}let Z=_.run({value:o[k],issues:[]},c);if(Z instanceof Promise)t.push(Z.then((P)=>Xe(P,n,k,o,z,w)));else Xe(Z,n,k,o,z,w)}if(f.length)n.issues.push({code:"unrecognized_keys",keys:f,input:o,inst:p,continue:!0});if(!t.length)return n;return Promise.all(t).then(()=>n)}var Nt=new WeakMap,iu=v("$ZodObject",(t,o)=>{if(A.init(t,o),!Object.getOwnPropertyDescriptor(o,"shape")?.get){let _=o.shape;Nt.set(o,_),Object.defineProperty(o,"shape",{get:()=>{let b={..._};return Object.defineProperty(o,"shape",{value:b}),Nt.set(o,b),b}})}let c=ke(()=>bi(o));E(t,"propValues",(_)=>{let b=_.def.shape,z={};for(let w in b){let k=b[w]._zod;if(k.values){if(!Object.prototype.hasOwnProperty.call(z,w))L(z,w,new Set);for(let Z of k.values)z[w].add(Z);if(k.optin!==void 0)z[w].add(void 0)}}return z});let u=ge,p=o.catchall,f,m=B.memoizer;m?.attach(t),t._zod.parse=(_,b)=>{f??(f=c.value);let z=_.value;if(!u(z))return _.issues.push({expected:"object",code:"invalid_type",input:z,inst:t}),_;_.value=m?m.alloc(t,_,{},b):{};let w=[],k=f.shape;for(let Z of f.allKeys){if(Z==="__proto__")continue;let P=k[Z],O=P._zod.optin,I=P._zod.optout,J=P._zod.run({value:z[Z],issues:[]},b);if(J instanceof Promise)w.push(J.then((q)=>Xe(q,_,Z,z,O,I)));else Xe(J,_,Z,z,O,I)}if(!p)return w.length?Promise.all(w).then(()=>_):_;return zi(w,z,_,b,c.value,t)}}),vi=v("$ZodObjectJIT",(t,o)=>{iu.init(t,o);let n=t._zod.parse,c=ke(()=>bi(o)),u=B.memoizer,p=(Z)=>{let P=c.value,O=P.symbolKeys,I=new At(["payload","ctx"],{shape:Z,inst:t,memo:u,syms:O}),J=(K)=>`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`,q=(K,R)=>`
|
|
8
8
|
for (let i = 0; i < ${K}.issues.length; i++) {
|
|
9
9
|
const iss = ${K}.issues[i];
|
|
10
10
|
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
@@ -49,6 +49,6 @@ ${o.join(`
|
|
|
49
49
|
newResult[${Q}] = ${R}.value;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
`)}return I.write("payload.value = newResult;"),I.write("return payload;"),I.compile()},f,m=ge,_=!B.jitless,z=_&&io.value,w=o.catchall,k;t._zod.parse=(Z,P)=>{k??(k=c.value);let O=Z.value;if(!m(O))return Z.issues.push({expected:"object",code:"invalid_type",input:O,inst:t}),Z;if(_&&z&&P?.async===!1&&P.jitless!==!0){if(!f)f=p(o.shape);if(Z=f(Z,P),!w)return Z;return zi([],O,Z,P,k,t)}return n(Z,P)}});function vn(t,o,n,c){for(let p of t)if(p.issues.length===0)return o.value=p.value,o;let u=t.filter((p)=>!he(p));if(u.length===1)return o.value=u[0].value,u[0];return o.issues.push({code:"invalid_union",input:o.value,inst:n,errors:t.map((p)=>p.issues.map((f)=>ne(f,c,W())))}),o}var Lt=v("$ZodUnion",(t,o)=>{A.init(t,o),E(t,"optin",(c)=>c.def.options.some((u)=>u._zod.optin==="defaulted")?"defaulted":c.def.options.some((u)=>u._zod.optin!==void 0)?"optional":void 0),E(t,"optout",(c)=>c.def.options.some((u)=>u._zod.optout==="optional")?"optional":void 0),E(t,"values",(c)=>{if(c.def.options.every((u)=>u._zod.values))return new Set(c.def.options.flatMap((u)=>Array.from(u._zod.values)));return}),E(t,"pattern",(c)=>{if(c.def.options.every((u)=>u._zod.pattern)){let u=c.def.options.map((p)=>p._zod.pattern);return new RegExp(`^(${u.map((p)=>Me(p.source)).join("|")})$`)}return});let n=o.options.length===1?o.options[0]._zod.run:null;t._zod.parse=(c,u)=>{if(n)return n(c,u);let p=!1,f=[];for(let m of o.options){let _=m._zod.run({value:c.value,issues:[]},u);if(_ instanceof Promise)f.push(_),p=!0;else{if(_.issues.length===0)return _;f.push(_)}}if(!p)return vn(f,c,t,u);return Promise.all(f).then((m)=>vn(m,c,t,u))}});var $i=v("$ZodDiscriminatedUnion",(t,o)=>{o.inclusive=!1,Lt.init(t,o);let n=t._zod.parse;E(t,"propValues",(u)=>{let p={};for(let f of u.def.options){let m=f._zod.propValues;if(!m||Object.keys(m).length===0)throw Error(`Invalid discriminated union option at index "${u.def.options.indexOf(f)}"`);for(let[_,b]of Object.entries(m)){if(!Object.prototype.hasOwnProperty.call(p,_))L(p,_,new Set);for(let z of b)p[_].add(z)}}return p}),o.options.forEach((u,p)=>{let f=Nt.get(u._zod.def);if(f&&!Object.prototype.hasOwnProperty.call(f,o.discriminator))throw Error(`Invalid discriminated union option at index "${p}"`)});let c=Ze(()=>{let u=o.options,p=new Map;for(let f of u){let m=f._zod.propValues?.[o.discriminator];if(!m||m.size===0)throw Error(`Invalid discriminated union option at index "${o.options.indexOf(f)}"`);for(let _ of m){if(p.has(_))throw Error(`Duplicate discriminator value "${String(_)}"`);p.set(_,f)}}return p});t._zod.parse=(u,p)=>{let f=u.value;if(!ge(f))return u.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),u;let m=c.value.get(f?.[o.discriminator]);if(m)return m._zod.run(u,p);if(o.unionFallback||p.direction==="backward")return n(u,p);return u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:o.discriminator,options:Array.from(c.value.keys()),input:f,path:[o.discriminator],inst:t}),u}}),wi=v("$ZodIntersection",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{let u=n.value,p=o.left._zod.run({value:u,issues:[]},c),f=o.right._zod.run({value:u,issues:[]},c);if(p instanceof Promise||f instanceof Promise)return Promise.all([p,f]).then(([_,b])=>$n(n,_,b));return $n(n,p,f)}});function Ct(t,o){if(t===o)return{valid:!0,data:t};if(t instanceof Date&&o instanceof Date&&+t===+o)return{valid:!0,data:t};if(me(t)&&me(o)){let n=Object.keys(o),c=Object.keys(t).filter((p)=>n.indexOf(p)!==-1),u={...t,...o};if(Object.prototype.hasOwnProperty.call(u,"__proto__"))delete u.__proto__;for(let p of c){if(p==="__proto__")continue;let f=Ct(t[p],o[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};u[p]=f.data}return{valid:!0,data:u}}if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let c=0;c<t.length;c++){let u=t[c],p=o[c],f=Ct(u,p);if(!f.valid)return{valid:!1,mergeErrorPath:[c,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $n(t,o,n){let c=new Map,u,p=new Map,f=(b,z)=>{let w;if(b.code==="unrecognized_keys"&&!b.path?.length)u??(u=b),w=b.keys;else if(b.code==="invalid_key"&&b.origin==="record"&&b.path?.length===1){let k=String(b.path[0]);if(!p.has(k))p.set(k,b);w=[k]}else return!1;for(let k of w){if(!c.has(k))c.set(k,{});c.get(k)[z]=!0}return!0};for(let b of o.issues)if(!f(b,"l"))t.issues.push(b);for(let b of n.issues)if(!f(b,"r"))t.issues.push(b);let m=[...c].filter(([,b])=>b.l&&b.r).map(([b])=>b);if(m.length){let b=u?m.filter((z)=>u.keys.includes(z)):[];if(b.length)t.issues.push({...u,keys:b});for(let z of m)if(!b.includes(z)&&p.has(z))t.issues.push(p.get(z))}let _=Ct(o.value,n.value);if(!_.valid){if(he(t))return t;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(_.mergeErrorPath)}`)}return t.value=_.data,t}var ki=v("$ZodTuple",(t,o)=>{A.init(t,o);let n=o.items,c=B.memoizer;c?.attach(t),t._zod.parse=(u,p)=>{let f=u.value;if(!Array.isArray(f))return u.issues.push({input:f,inst:t,expected:"tuple",code:"invalid_type"}),u;u.value=c?c.alloc(t,u,[],p):[];let m=[],_=wn(n,"optin"),b=wn(n,"optout");if(!o.rest){if(f.length<_)return u.issues.push({code:"too_small",minimum:_,inclusive:!0,input:f,inst:t,origin:"array"}),u;if(f.length>n.length)u.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:f,inst:t,origin:"array"})}let z=Array(n.length);for(let w=0;w<n.length;w++){let k=n[w]._zod.run({value:f[w],issues:[]},p);if(k instanceof Promise)m.push(k.then((Z)=>{z[w]=Z}));else z[w]=k}if(o.rest){let w=n.length-1,k=f.slice(n.length);for(let Z of k){w++;let P=o.rest._zod.run({value:Z,issues:[]},p);if(P instanceof Promise)m.push(P.then((O)=>kn(O,u,w)));else kn(P,u,w)}}if(m.length)return Promise.all(m).then(()=>Zn(z,u,n,f,b));return Zn(z,u,n,f,b)}});function wn(t,o){for(let n=t.length-1;n>=0;n--)if(!(o==="optin"?t[n]._zod.optin!==void 0:t[n]._zod.optout==="optional"))return n+1;return 0}function kn(t,o,n){if(t.issues.length)o.issues.push(...te(n,t.issues));o.value[n]=t.value}function Zn(t,o,n,c,u){for(let p=0;p<n.length;p++){let f=t[p],m=p<c.length;if(!m&&p>=u&&n[p]._zod.optin==="optional"){o.value.length=p;break}if(f.issues.length){if(!m&&p>=u){o.value.length=p;break}o.issues.push(...te(p,f.issues))}o.value[p]=f.value}for(let p=o.value.length-1;p>=c.length;p--)if(n[p]._zod.optout==="optional"&&o.value[p]===void 0)o.value.length=p;else break;return o}var Zi=v("$ZodRecord",(t,o)=>{A.init(t,o);let n=B.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!me(p))return c.issues.push({expected:"record",code:"invalid_type",input:p,inst:t}),c;let f=[],m=o.keyType._zod.values;if(m&&!o.partial){c.value=n?n.alloc(t,c,{},u):{};let _=new Set;for(let z of m)if(typeof z==="string"||typeof z==="number"||typeof z==="symbol"){if(_.add(typeof z==="number"?z.toString():z),z==="__proto__")continue;let w=o.keyType._zod.run({value:z,issues:[]},u);if(w instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(w.issues.length){c.issues.push({code:"invalid_key",origin:"record",issues:w.issues.map((P)=>ne(P,u,W())),input:z,path:[z],inst:t});continue}let k=w.value;if(k==="__proto__")continue;let Z=o.valueType._zod.run({value:p[z],issues:[]},u);if(Z instanceof Promise)f.push(Z.then((P)=>{if(P.issues.length)c.issues.push(...te(z,P.issues));c.value[k]=P.value}));else{if(Z.issues.length)c.issues.push(...te(z,Z.issues));c.value[k]=Z.value}}let b;for(let z in p)if(!_.has(z))if(o.mode==="loose"){if(z==="__proto__")continue;c.value[z]=p[z]}else b=b??[],b.push(z);if(b&&b.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:b,continue:!0})}else{c.value=n?n.alloc(t,c,{},u):{};let _;for(let b of Reflect.ownKeys(p)){if(b==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(p,b))continue;let z=o.keyType._zod.run({value:b,issues:[]},u);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof b==="string"&&Ee.test(b)&&z.issues.length){let P=o.keyType._zod.run({value:Number(b),issues:[]},u);if(P instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(P.issues.length===0)z=P}if(z.issues.length){if(o.mode==="loose")c.value[b]=p[b];else if(m)_=_??[],_.push(b);else c.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((P)=>ne(P,u,W())),input:b,path:[b],inst:t});continue}let k=z.value;if(k==="__proto__")continue;let Z=o.valueType._zod.run({value:p[b],issues:[]},u);if(Z instanceof Promise)f.push(Z.then((P)=>{if(P.issues.length)c.issues.push(...te(b,P.issues));c.value[k]=P.value}));else{if(Z.issues.length)c.issues.push(...te(b,Z.issues));c.value[k]=Z.value}}if(_&&_.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:_,continue:!0})}if(f.length)return Promise.all(f).then(()=>c);return c}});var Pi=v("$ZodEnum",(t,o)=>{A.init(t,o);let n=Ue(o.entries),c=new Set(n);t._zod.values=c;let u=n.filter((p)=>so.has(typeof p));t._zod.pattern=new RegExp(u.length?`^(${u.map((p)=>le(p.toString())).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(p,f)=>{let m=p.value;if(c.has(m))return p;return p.issues.push({code:"invalid_value",values:n,input:m,inst:t}),p}}),Si=v("$ZodLiteral",(t,o)=>{A.init(t,o);let n=new Set(o.values);t._zod.values=n,t._zod.pattern=new RegExp(o.values.length?`^(${o.values.map((c)=>typeof c==="string"?le(c):c?le(c.toString()):String(c)).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(c,u)=>{let p=c.value;if(n.has(p))return c;return c.issues.push({code:"invalid_value",values:o.values,input:p,inst:t}),c}});var Oi=v("$ZodTransform",(t,o)=>{A.init(t,o),t._zod.optin="optional",B.memoizer?.guard(t),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Pe(t.constructor.name);let u=o.transform(n.value,n);if(c.async)return(u instanceof Promise?u:Promise.resolve(u)).then((f)=>(n.value=f,n));if(u instanceof Promise)throw new ie;return n.value=u,n}});function Pn(t,o){return t.value=o.issues.length?void 0:o.value,t}var Ft=v("$ZodOptional",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",E(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c,void 0]):void 0}),E(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)})?$`):void 0}),t._zod.parse=(n,c)=>{if(n.value===void 0){if(o.innerType._zod.optin!=="defaulted")return n;let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>Pn(n,p));return Pn(n,u)}return o.innerType._zod.run(n,c)}}),Ii=v("$ZodExactOptional",(t,o)=>{Ft.init(t,o),E(t,"values",(n)=>n.def.innerType._zod.values),E(t,"pattern",(n)=>n.def.innerType._zod.pattern),t._zod.parse=(n,c)=>o.innerType._zod.run(n,c)}),Ei=v("$ZodNullable",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin),E(t,"optout",(n)=>n.def.innerType._zod.optout),E(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)}|null)$`):void 0}),E(t,"values",(n)=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,c)=>{if(n.value===null)return n;return o.innerType._zod.run(n,c)}}),Ti=v("$ZodDefault",(t,o)=>{A.init(t,o),t._zod.optin="defaulted",E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)return n.value=o.defaultValue,n;let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Sn(p,o));return Sn(u,o)}});function Sn(t,o){if(t.value===void 0)t.value=o.defaultValue;return t}var Ai=v("$ZodPrefault",(t,o)=>{A.init(t,o),t._zod.optin="defaulted",E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)n.value=o.defaultValue;return o.innerType._zod.run(n,c)}}),Ni=v("$ZodNonOptional",(t,o)=>{A.init(t,o),E(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c].filter((u)=>u!==void 0)):void 0}),t._zod.parse=(n,c)=>{let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>On(p,t));return On(u,t)}});function On(t,o){if(!t.issues.length&&t.value===void 0)t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:o});return t}function In(t,o,n,c){if(!o.issues.length){if(t.value=o.value,o.memo)t.memo=!0;return t}return t.value=n.catchValue({...o,value:t.value,error:{issues:o.issues.map((u)=>ne(u,c,W()))},input:t.value}),t}var Ci=v("$ZodCatch",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),E(t,"optout",(n)=>n.def.innerType._zod.optout),E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>In(n,p,o,c));return In(n,u,o,c)}});var Ut=v("$ZodPipe",(t,o)=>{A.init(t,o),E(t,"values",(n)=>n.def.in._zod.values),E(t,"optin",(n)=>n.def.in._zod.optin),E(t,"optout",(n)=>n.def.out._zod.optout),E(t,"propValues",(n)=>n.def.in._zod.propValues),t._zod.parse=(n,c)=>{if(c.direction==="backward"){let p=o.out._zod.run(n,c);if(p instanceof Promise)return p.then((f)=>Ye(f,o.in,c));return Ye(p,o.in,c)}let u=o.in._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Ye(p,o.out,c));return Ye(u,o.out,c)}});function Ye(t,o,n){if(t.issues.some((c)=>c.code!=="unrecognized_keys"))return t.aborted=!0,t;return o._zod.run({value:t.value,issues:t.issues},n)}var ji=v("$ZodPreprocess",(t,o)=>{Ut.init(t,o)}),Ri=v("$ZodReadonly",(t,o)=>{A.init(t,o),E(t,"propValues",(n)=>n.def.innerType._zod.propValues),E(t,"values",(n)=>n.def.innerType._zod.values),E(t,"optin",(n)=>n.def.innerType?._zod?.optin),E(t,"optout",(n)=>n.def.innerType?._zod?.optout),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then(En);return En(u)}});function En(t){if(!t.memo)t.value=Object.freeze(t.value);return t}var Di=v("$ZodLazy",(t,o)=>{A.init(t,o),ro(t._zod,"innerType",()=>{let n=o;if(!n._cachedInner)n._cachedInner=o.getter();return n._cachedInner}),E(t,"pattern",(n)=>n.innerType?._zod?.pattern),E(t,"propValues",(n)=>n.innerType?._zod?.propValues),E(t,"optin",(n)=>n.innerType?._zod?.optin??void 0),E(t,"optout",(n)=>n.innerType?._zod?.optout??void 0),t._zod.parse=(n,c)=>t._zod.innerType._zod.run(n,c)}),Li=v("$ZodCustom",(t,o)=>{M.init(t,o),A.init(t,o),t._zod.parse=(n,c)=>n,t._zod.check=(n)=>{let c=n.value,u=o.fn(c);if(u instanceof Promise)return u.then((p)=>Tn(p,n,c,t));Tn(u,n,c,t);return}});function Tn(t,o,n,c){if(!t){let u={code:"custom",input:n,inst:c,path:[...c._zod.def.path??[]],continue:!c._zod.def.abort};if(c._zod.def.params)u.params=c._zod.def.params;o.issues.push(_e(u))}}class Mi extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Jt="~memo",Fi=[];function Mt(t){return t.map((o)=>o.path?{...o,path:o.path.slice()}:{...o})}var Ui=new WeakMap;function Ji(t,o){let n=Ui.get(t);if(n!==void 0)return n;if(o.has(t))return!0;o.add(t);let c=!1,u=(m)=>{if(!c&&m?._zod&&Ji(m,o))c=!0},p=t._zod.def,f=p.type;switch(f){case"object":{for(let m of Reflect.ownKeys(p.shape))u(p.shape[m]);u(p.catchall);break}case"array":u(p.element);break;case"tuple":for(let m of p.items)u(m);u(p.rest);break;case"record":case"map":u(p.keyType),u(p.valueType);break;case"set":u(p.valueType);break;case"union":for(let m of p.options)u(m);break;case"intersection":u(p.left),u(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":u(p.innerType);break;case"pipe":u(p.in),u(p.out);break;case"function":u(p.input),u(p.output);break;case"lazy":u(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let m in p){let _=Object.getOwnPropertyDescriptor(p,m);if(!_||_.get)continue;let b=_.value;if(!b||typeof b!=="object")continue;if(b._zod)u(b);else if(Array.isArray(b))for(let z of b)u(z)}}return o.delete(t),Ui.set(t,c),c}function su(t,o){let n=t.buckets.get(o);if(!n)n=new Map,t.buckets.set(o,n);return n}var Qe,et=[],cu={alloc(t,o,n){let c=Qe;if(!c)return n;Qe=void 0;let u={value:n,issues:null};return c.set(o.value,u),et.push(u),n},guard(t){var o;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let n=t._zod.parse,c=(u,p)=>{if(p.direction!=="backward"&&uu(p,u.value))throw new Mi;return n(u,p)};if(t._zod.parse=c,t._zod.run===n)t._zod.run=c})},attach(t){var o;let n,c,u;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let p=t._zod.parse,f=(m,_)=>{if(n===void 0){if(n=Ji(t,new Set),!n){if(t._zod.parse=p,t._zod.run===f)t._zod.run=p;return p(m,_)}}let b=m.value;if(b===null||typeof b!=="object")return p(m,_);let z=_[Jt];if(!z)z={buckets:new Map,backEdges:void 0},_[Jt]=z;let w;if(c===_)w=u;else w=su(z,t),c=_,u=w;let k=w.get(b);if(k){if(m.value=k.value,k.issues){if(k.issues.length)m.issues.push(...Mt(k.issues))}else m.memo=!0,z.backEdges??(z.backEdges=new Set),z.backEdges.add(k.value);return m}Qe=w;let Z=et.length,P=p(m,_);Qe=void 0;let O=et.length>Z?et.pop():void 0;if(P instanceof Promise)return P.then((I)=>{if(O)O.issues=I.issues.length?Mt(I.issues):Fi;return I});if(O)O.issues=P.issues.length?Mt(P.issues):Fi;return P};if(t._zod.parse=f,t._zod.run===p)t._zod.run=f})}};function Bt(){return cu}function uu(t,o){let n=t[Jt]?.backEdges;return n!==void 0&&o!==null&&typeof o==="object"&&n.has(o)}var au=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function o(p){return t[p]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},c={nan:"NaN"};function u(p,f){if(p==="number"&&typeof f==="number"&&!Number.isFinite(f))return String(f);return c[p]??p}return(p)=>{switch(p.code){case"invalid_type":{let f=u(p.expected),m=po(p.input),_=u(m,p.input);return`Invalid input: expected ${f}, received ${_}`}case"invalid_value":if(p.values.length===1)return`Invalid input: expected ${ht(p.values[0])}`;return`Invalid option: expected one of ${ft(p.values,"|")}`;case"too_big":{let f=p.exact?"exactly ":p.inclusive?"<=":"<",m=o(p.origin);if(m)return`Too big: expected ${p.origin??"value"} to have ${f}${p.maximum.toString()} ${m.unit??"elements"}`;return`Too big: expected ${p.origin??"value"} to be ${f}${p.maximum.toString()}`}case"too_small":{let f=p.exact?"exactly ":p.inclusive?">=":">",m=o(p.origin);if(m)return`Too small: expected ${p.origin} to have ${f}${p.minimum.toString()} ${m.unit}`;return`Too small: expected ${p.origin} to be ${f}${p.minimum.toString()}`}case"invalid_format":{let f=p;if(f.format==="starts_with")return`Invalid string: must start with "${f.prefix}"`;if(f.format==="ends_with")return`Invalid string: must end with "${f.suffix}"`;if(f.format==="includes")return`Invalid string: must include "${f.includes}"`;if(f.format==="regex")return`Invalid string: must match pattern ${f.pattern}`;return`Invalid ${n[f.format]??p.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${p.divisor}`;case"unrecognized_keys":return`Unrecognized key${p.keys.length>1?"s":""}: ${ft(p.keys,", ")}`;case"invalid_key":return`Invalid key in ${p.origin}`;case"invalid_union":if(p.options&&Array.isArray(p.options)&&p.options.length>0)return`Invalid discriminator value. Expected ${p.options.map((m)=>`'${m}'`).join(" | ")}`;if(p.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${p.origin}`;default:return"Invalid input"}}};function Vt(){return{localeError:au()}}var Bi;class Vi{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let n=o[0];if(this._map.set(t,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,t);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);if(o&&typeof o==="object"&&"id"in o)this._idmap.delete(o.id);return this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let n={...this.get(o)??{}};delete n.id;let c={...n,...this._map.get(t)};return Object.keys(c).length?c:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ki(){return new Vi}(Bi=globalThis).__zod_globalRegistry??(Bi.__zod_globalRegistry=Ki());var pe=globalThis.__zod_globalRegistry;function Wi(t,o){return new t({type:"string",...S(o)})}function Gi(t,o){return new t({type:"string",coerce:!0,...S(o)})}function Kt(t,o){return new t({type:"string",format:"email",check:"string_format",abort:!1,...S(o)})}function qi(t,o){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...S(o)})}function Yi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...S(o)})}function Xi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(o)})}function Qi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(o)})}function es(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(o)})}function Wt(t,o){return new t({type:"string",format:"url",check:"string_format",abort:!1,...S(o)})}function ts(t,o){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...S(o)})}function rs(t,o){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(o)})}function os(t,o){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...S(o)})}function ns(t,o){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(o)})}function is(t,o){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...S(o)})}function ss(t,o){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...S(o)})}function cs(t,o){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(o)})}function Gt(t,o){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(o)})}function qt(t,o){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(o)})}function us(t,o){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(o)})}function as(t,o){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(o)})}function ls(t,o){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...S(o)})}function ps(t,o){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...S(o)})}function fs(t,o){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...S(o)})}function ds(t,o){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...S(o)})}function tt(t,o){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(o)})}function rt(t,o){return new t({type:"string",format:"date",check:"string_format",...S(o)})}function Xt(t,o){return new t({type:"string",format:"time",check:"string_format",precision:null,...S(o)})}function Ht(t,o){return new t({type:"string",format:"duration",check:"string_format",...S(o)})}function ms(t,o){return new t({type:"number",checks:[],...S(o)})}function hs(t,o){return new t({type:"number",coerce:!0,checks:[],...S(o)})}function _s(t,o){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...S(o)})}function gs(t,o){return new t({type:"boolean",...S(o)})}function xs(t,o){return new t({type:"boolean",coerce:!0,...S(o)})}function ys(t,o){return new t({type:"bigint",coerce:!0,...S(o)})}function bs(t,o){return new t({type:"null",...S(o)})}function zs(t){return new t({type:"any"})}function vs(t){return new t({type:"unknown"})}function $s(t,o){return new t({type:"never",...S(o)})}function ws(t,o){return new t({type:"void",...S(o)})}function Zs(t,o){return new t({type:"date",...S(o)})}function Ps(t,o){return new t({type:"date",coerce:!0,...S(o)})}function ye(t,o){return new Et({check:"less_than",...S(o),value:t,inclusive:!1})}function se(t,o){return new Et({check:"less_than",...S(o),value:t,inclusive:!0})}function be(t,o){return new Tt({check:"greater_than",...S(o),value:t,inclusive:!1})}function ce(t,o){return new Tt({check:"greater_than",...S(o),value:t,inclusive:!0})}function Ae(t,o){return new sn({check:"multiple_of",...S(o),value:t})}function ot(t,o){return new un({check:"max_length",...S(o),maximum:t})}function ze(t,o){return new an({check:"min_length",...S(o),minimum:t})}function nt(t,o){return new ln({check:"length_equals",...S(o),length:t})}function Qt(t,o){return new pn({check:"string_format",format:"regex",...S(o),pattern:t})}function er(t){return new fn({check:"string_format",format:"lowercase",...S(t)})}function tr(t){return new dn({check:"string_format",format:"uppercase",...S(t)})}function rr(t,o){return new mn({check:"string_format",format:"includes",...S(o),includes:t})}function or(t,o){return new hn({check:"string_format",format:"starts_with",...S(o),prefix:t})}function nr(t,o){return new _n({check:"string_format",format:"ends_with",...S(o),suffix:t})}function fe(t){return new gn({check:"overwrite",tx:t})}function ir(t){return fe((o)=>o.normalize(t))}function sr(){return fe((t)=>t.trim())}function cr(){return fe((t)=>t.toLowerCase())}function ur(){return fe((t)=>t.toUpperCase())}function ar(){return fe((t)=>no(t))}function Ss(t,o,n){return new t({type:"array",element:o,...S(n)})}function Os(t,o,n){let c=S(n);return c.abort??(c.abort=!0),new t({type:"custom",check:"custom",fn:o,...c})}function Is(t,o,n){return new t({type:"custom",check:"custom",fn:o,...S(n)})}function Es(t,o){let n=lu((c)=>(c.addIssue=(u)=>{if(typeof u==="string")c.issues.push(_e(u,c.value,n._zod.def));else{let p=u;if(p.fatal)p.continue=!1;if(p.code??(p.code="custom"),!("input"in p))p.input=c.value;p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),c.issues.push(_e(p))}},t(c.value,c)),o);return n}function lu(t,o){let n=new M({check:"custom",...S(o)});return n._zod.check=t,n}function Ne(t,...o){for(let n of o)for(let c of Reflect.ownKeys(n))if(Object.prototype.propertyIsEnumerable.call(n,c))L(t,c,n[c]);return t}function je(t){let o=t?.target??"draft-2020-12";if(o==="draft-4")o="draft-04";if(o==="draft-7")o="draft-07";return{processors:t.processors??{},metadataRegistry:t?.metadata??pe,target:o,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function F(t,o,n,c,u){let p=typeof o.unrepresentable==="function"?o.unrepresentable({zodSchema:t,path:c.path,message:u}):o.unrepresentable;if(p==="any")return!1;if(p===void 0||p==="throw")throw Error(u);return Object.assign(n,p),!0}function C(t,o,n={path:[],schemaPath:[]}){var c;let u=t._zod.def,p=o.seen.get(t);if(p){if(p.count++,n.schemaPath.includes(t))p.cycle=n.path;return p.schema}let f={schema:{},count:1,cycle:void 0,path:n.path};o.seen.set(t,f),o.sharedDefsExtractedFor=void 0,o.sharedEmitDoneFor=void 0;let m=t._zod.toJSONSchema?.();if(m)f.schema=m;else{let z={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(o,f.schema,z);else{let k=f.schema,Z=o.processors[u.type];if(!Z)throw Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);Z(t,o,k,z)}let w=t._zod.parent;if(w){if(!f.ref)f.ref=w;C(w,o,z),o.seen.get(w).isParent=!0}}let _=o.metadataRegistry.get(t);if(_)Ne(f.schema,_);if(o.io==="input"&&V(t))delete f.schema.examples,delete f.schema.default;if(o.io==="input"&&"_prefault"in f.schema)(c=f.schema).default??(c.default=f.schema._prefault);return delete f.schema._prefault,o.seen.get(t).schema}function Ts(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Re(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let c=new Map;for(let f of t.seen.entries()){let m=t.metadataRegistry.get(f[0])?.id;if(m){let _=c.get(m);if(_&&_!==f[0])throw Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);c.set(m,f[0])}}let u=(f)=>{let m=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let w=t.external.registry.get(f[0])?.id,k=t.external.uri??((P)=>P);if(w)return{ref:k(w)};let Z=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=Z,{defId:Z,ref:`${k("__shared")}#/${m}/${Ts(Z)}`}}let _="#",b=`${_}/${m}/`;if(f[1]===n&&!f[1].schema.id)return{ref:_};let z=f[1].schema.id??`__schema${t.counter++}`;return{defId:z,ref:b+Ts(z)}},p=(f)=>{if(f[1].schema.$ref)return;let m=f[1],{ref:_,defId:b}=u(f);if(m.def={...m.schema},b)m.defId=b;let z=m.schema;for(let w in z)delete z[w];z.$ref=_};if(t.cycles==="throw")for(let f of t.seen.entries()){let m=f[1];if(m.cycle)throw Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
|
|
52
|
+
`)}return I.write("payload.value = newResult;"),I.write("return payload;"),I.compile()},f,m=ge,_=!B.jitless,z=_&&io.value,w=o.catchall,k;t._zod.parse=(Z,P)=>{k??(k=c.value);let O=Z.value;if(!m(O))return Z.issues.push({expected:"object",code:"invalid_type",input:O,inst:t}),Z;if(_&&z&&P?.async===!1&&P.jitless!==!0){if(!f)f=p(o.shape);if(Z=f(Z,P),!w)return Z;return zi([],O,Z,P,k,t)}return n(Z,P)}});function vn(t,o,n,c){for(let p of t)if(p.issues.length===0)return o.value=p.value,o;let u=t.filter((p)=>!he(p));if(u.length===1)return o.value=u[0].value,u[0];return o.issues.push({code:"invalid_union",input:o.value,inst:n,errors:t.map((p)=>p.issues.map((f)=>ne(f,c,W())))}),o}var Lt=v("$ZodUnion",(t,o)=>{A.init(t,o),E(t,"optin",(c)=>c.def.options.some((u)=>u._zod.optin==="defaulted")?"defaulted":c.def.options.some((u)=>u._zod.optin!==void 0)?"optional":void 0),E(t,"optout",(c)=>c.def.options.some((u)=>u._zod.optout==="optional")?"optional":void 0),E(t,"values",(c)=>{if(c.def.options.every((u)=>u._zod.values))return new Set(c.def.options.flatMap((u)=>Array.from(u._zod.values)));return}),E(t,"pattern",(c)=>{if(c.def.options.every((u)=>u._zod.pattern)){let u=c.def.options.map((p)=>p._zod.pattern);return new RegExp(`^(${u.map((p)=>Me(p.source)).join("|")})$`)}return});let n=o.options.length===1?o.options[0]._zod.run:null;t._zod.parse=(c,u)=>{if(n)return n(c,u);let p=!1,f=[];for(let m of o.options){let _=m._zod.run({value:c.value,issues:[]},u);if(_ instanceof Promise)f.push(_),p=!0;else{if(_.issues.length===0)return _;f.push(_)}}if(!p)return vn(f,c,t,u);return Promise.all(f).then((m)=>vn(m,c,t,u))}});var $i=v("$ZodDiscriminatedUnion",(t,o)=>{o.inclusive=!1,Lt.init(t,o);let n=t._zod.parse;E(t,"propValues",(u)=>{let p={};for(let f of u.def.options){let m=f._zod.propValues;if(!m||Object.keys(m).length===0)throw Error(`Invalid discriminated union option at index "${u.def.options.indexOf(f)}"`);for(let[_,b]of Object.entries(m)){if(!Object.prototype.hasOwnProperty.call(p,_))L(p,_,new Set);for(let z of b)p[_].add(z)}}return p}),o.options.forEach((u,p)=>{let f=Nt.get(u._zod.def);if(f&&!Object.prototype.hasOwnProperty.call(f,o.discriminator))throw Error(`Invalid discriminated union option at index "${p}"`)});let c=ke(()=>{let u=o.options,p=new Map;for(let f of u){let m=f._zod.propValues?.[o.discriminator];if(!m||m.size===0)throw Error(`Invalid discriminated union option at index "${o.options.indexOf(f)}"`);for(let _ of m){if(p.has(_))throw Error(`Duplicate discriminator value "${String(_)}"`);p.set(_,f)}}return p});t._zod.parse=(u,p)=>{let f=u.value;if(!ge(f))return u.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),u;let m=c.value.get(f?.[o.discriminator]);if(m)return m._zod.run(u,p);if(o.unionFallback||p.direction==="backward")return n(u,p);return u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:o.discriminator,options:Array.from(c.value.keys()),input:f,path:[o.discriminator],inst:t}),u}}),wi=v("$ZodIntersection",(t,o)=>{A.init(t,o),t._zod.parse=(n,c)=>{let u=n.value,p=o.left._zod.run({value:u,issues:[]},c),f=o.right._zod.run({value:u,issues:[]},c);if(p instanceof Promise||f instanceof Promise)return Promise.all([p,f]).then(([_,b])=>$n(n,_,b));return $n(n,p,f)}});function Ct(t,o){if(t===o)return{valid:!0,data:t};if(t instanceof Date&&o instanceof Date&&+t===+o)return{valid:!0,data:t};if(me(t)&&me(o)){let n=Object.keys(o),c=Object.keys(t).filter((p)=>n.indexOf(p)!==-1),u={...t,...o};if(Object.prototype.hasOwnProperty.call(u,"__proto__"))delete u.__proto__;for(let p of c){if(p==="__proto__")continue;let f=Ct(t[p],o[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};u[p]=f.data}return{valid:!0,data:u}}if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let c=0;c<t.length;c++){let u=t[c],p=o[c],f=Ct(u,p);if(!f.valid)return{valid:!1,mergeErrorPath:[c,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $n(t,o,n){let c=new Map,u,p=new Map,f=(b,z)=>{let w;if(b.code==="unrecognized_keys"&&!b.path?.length)u??(u=b),w=b.keys;else if(b.code==="invalid_key"&&b.origin==="record"&&b.path?.length===1){let k=String(b.path[0]);if(!p.has(k))p.set(k,b);w=[k]}else return!1;for(let k of w){if(!c.has(k))c.set(k,{});c.get(k)[z]=!0}return!0};for(let b of o.issues)if(!f(b,"l"))t.issues.push(b);for(let b of n.issues)if(!f(b,"r"))t.issues.push(b);let m=[...c].filter(([,b])=>b.l&&b.r).map(([b])=>b);if(m.length){let b=u?m.filter((z)=>u.keys.includes(z)):[];if(b.length)t.issues.push({...u,keys:b});for(let z of m)if(!b.includes(z)&&p.has(z))t.issues.push(p.get(z))}let _=Ct(o.value,n.value);if(!_.valid){if(he(t))return t;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(_.mergeErrorPath)}`)}return t.value=_.data,t}var ki=v("$ZodTuple",(t,o)=>{A.init(t,o);let n=o.items,c=B.memoizer;c?.attach(t),t._zod.parse=(u,p)=>{let f=u.value;if(!Array.isArray(f))return u.issues.push({input:f,inst:t,expected:"tuple",code:"invalid_type"}),u;u.value=c?c.alloc(t,u,[],p):[];let m=[],_=wn(n,"optin"),b=wn(n,"optout");if(!o.rest){if(f.length<_)return u.issues.push({code:"too_small",minimum:_,inclusive:!0,input:f,inst:t,origin:"array"}),u;if(f.length>n.length)u.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:f,inst:t,origin:"array"})}let z=Array(n.length);for(let w=0;w<n.length;w++){let k=n[w]._zod.run({value:f[w],issues:[]},p);if(k instanceof Promise)m.push(k.then((Z)=>{z[w]=Z}));else z[w]=k}if(o.rest){let w=n.length-1,k=f.slice(n.length);for(let Z of k){w++;let P=o.rest._zod.run({value:Z,issues:[]},p);if(P instanceof Promise)m.push(P.then((O)=>kn(O,u,w)));else kn(P,u,w)}}if(m.length)return Promise.all(m).then(()=>Zn(z,u,n,f,b));return Zn(z,u,n,f,b)}});function wn(t,o){for(let n=t.length-1;n>=0;n--)if(!(o==="optin"?t[n]._zod.optin!==void 0:t[n]._zod.optout==="optional"))return n+1;return 0}function kn(t,o,n){if(t.issues.length)o.issues.push(...te(n,t.issues));o.value[n]=t.value}function Zn(t,o,n,c,u){for(let p=0;p<n.length;p++){let f=t[p],m=p<c.length;if(!m&&p>=u&&n[p]._zod.optin==="optional"){o.value.length=p;break}if(f.issues.length){if(!m&&p>=u){o.value.length=p;break}o.issues.push(...te(p,f.issues))}o.value[p]=f.value}for(let p=o.value.length-1;p>=c.length;p--)if(n[p]._zod.optout==="optional"&&o.value[p]===void 0)o.value.length=p;else break;return o}var Zi=v("$ZodRecord",(t,o)=>{A.init(t,o);let n=B.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!me(p))return c.issues.push({expected:"record",code:"invalid_type",input:p,inst:t}),c;let f=[],m=o.keyType._zod.values;if(m&&!o.partial){c.value=n?n.alloc(t,c,{},u):{};let _=new Set;for(let z of m)if(typeof z==="string"||typeof z==="number"||typeof z==="symbol"){if(_.add(typeof z==="number"?z.toString():z),z==="__proto__")continue;let w=o.keyType._zod.run({value:z,issues:[]},u);if(w instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(w.issues.length){c.issues.push({code:"invalid_key",origin:"record",issues:w.issues.map((P)=>ne(P,u,W())),input:z,path:[z],inst:t});continue}let k=w.value;if(k==="__proto__")continue;let Z=o.valueType._zod.run({value:p[z],issues:[]},u);if(Z instanceof Promise)f.push(Z.then((P)=>{if(P.issues.length)c.issues.push(...te(z,P.issues));c.value[k]=P.value}));else{if(Z.issues.length)c.issues.push(...te(z,Z.issues));c.value[k]=Z.value}}let b;for(let z in p)if(!_.has(z))if(o.mode==="loose"){if(z==="__proto__")continue;c.value[z]=p[z]}else b=b??[],b.push(z);if(b&&b.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:b,continue:!0})}else{c.value=n?n.alloc(t,c,{},u):{};let _;for(let b of Reflect.ownKeys(p)){if(b==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(p,b))continue;let z=o.keyType._zod.run({value:b,issues:[]},u);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof b==="string"&&Ie.test(b)&&z.issues.length){let P=o.keyType._zod.run({value:Number(b),issues:[]},u);if(P instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(P.issues.length===0)z=P}if(z.issues.length){if(o.mode==="loose")c.value[b]=p[b];else if(m)_=_??[],_.push(b);else c.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((P)=>ne(P,u,W())),input:b,path:[b],inst:t});continue}let k=z.value;if(k==="__proto__")continue;let Z=o.valueType._zod.run({value:p[b],issues:[]},u);if(Z instanceof Promise)f.push(Z.then((P)=>{if(P.issues.length)c.issues.push(...te(b,P.issues));c.value[k]=P.value}));else{if(Z.issues.length)c.issues.push(...te(b,Z.issues));c.value[k]=Z.value}}if(_&&_.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:_,continue:!0})}if(f.length)return Promise.all(f).then(()=>c);return c}});var Pi=v("$ZodEnum",(t,o)=>{A.init(t,o);let n=Ue(o.entries),c=new Set(n);t._zod.values=c;let u=n.filter((p)=>so.has(typeof p));t._zod.pattern=new RegExp(u.length?`^(${u.map((p)=>le(p.toString())).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(p,f)=>{let m=p.value;if(c.has(m))return p;return p.issues.push({code:"invalid_value",values:n,input:m,inst:t}),p}}),Si=v("$ZodLiteral",(t,o)=>{A.init(t,o);let n=new Set(o.values);t._zod.values=n,t._zod.pattern=new RegExp(o.values.length?`^(${o.values.map((c)=>typeof c==="string"?le(c):c?le(c.toString()):String(c)).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(c,u)=>{let p=c.value;if(n.has(p))return c;return c.issues.push({code:"invalid_value",values:o.values,input:p,inst:t}),c}});var Oi=v("$ZodTransform",(t,o)=>{A.init(t,o),t._zod.optin="optional",B.memoizer?.guard(t),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Ze(t.constructor.name);let u=o.transform(n.value,n);if(c.async)return(u instanceof Promise?u:Promise.resolve(u)).then((f)=>(n.value=f,n));if(u instanceof Promise)throw new ie;return n.value=u,n}});function Pn(t,o){return t.value=o.issues.length?void 0:o.value,t}var Ft=v("$ZodOptional",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",E(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c,void 0]):void 0}),E(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)})?$`):void 0}),t._zod.parse=(n,c)=>{if(n.value===void 0){if(o.innerType._zod.optin!=="defaulted")return n;let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>Pn(n,p));return Pn(n,u)}return o.innerType._zod.run(n,c)}}),Ii=v("$ZodExactOptional",(t,o)=>{Ft.init(t,o),E(t,"values",(n)=>n.def.innerType._zod.values),E(t,"pattern",(n)=>n.def.innerType._zod.pattern),t._zod.parse=(n,c)=>o.innerType._zod.run(n,c)}),Ei=v("$ZodNullable",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin),E(t,"optout",(n)=>n.def.innerType._zod.optout),E(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)}|null)$`):void 0}),E(t,"values",(n)=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,c)=>{if(n.value===null)return n;return o.innerType._zod.run(n,c)}}),Ti=v("$ZodDefault",(t,o)=>{A.init(t,o),t._zod.optin="defaulted",E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)return n.value=o.defaultValue,n;let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Sn(p,o));return Sn(u,o)}});function Sn(t,o){if(t.value===void 0)t.value=o.defaultValue;return t}var Ai=v("$ZodPrefault",(t,o)=>{A.init(t,o),t._zod.optin="defaulted",E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)n.value=o.defaultValue;return o.innerType._zod.run(n,c)}}),Ni=v("$ZodNonOptional",(t,o)=>{A.init(t,o),E(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c].filter((u)=>u!==void 0)):void 0}),t._zod.parse=(n,c)=>{let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>On(p,t));return On(u,t)}});function On(t,o){if(!t.issues.length&&t.value===void 0)t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:o});return t}function In(t,o,n,c){if(!o.issues.length){if(t.value=o.value,o.memo)t.memo=!0;return t}return t.value=n.catchValue({...o,value:t.value,error:{issues:o.issues.map((u)=>ne(u,c,W()))},input:t.value}),t}var Ci=v("$ZodCatch",(t,o)=>{A.init(t,o),E(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),E(t,"optout",(n)=>n.def.innerType._zod.optout),E(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>In(n,p,o,c));return In(n,u,o,c)}});var Ut=v("$ZodPipe",(t,o)=>{A.init(t,o),E(t,"values",(n)=>n.def.in._zod.values),E(t,"optin",(n)=>n.def.in._zod.optin),E(t,"optout",(n)=>n.def.out._zod.optout),E(t,"propValues",(n)=>n.def.in._zod.propValues),t._zod.parse=(n,c)=>{if(c.direction==="backward"){let p=o.out._zod.run(n,c);if(p instanceof Promise)return p.then((f)=>Ye(f,o.in,c));return Ye(p,o.in,c)}let u=o.in._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Ye(p,o.out,c));return Ye(u,o.out,c)}});function Ye(t,o,n){if(t.issues.some((c)=>c.code!=="unrecognized_keys"))return t.aborted=!0,t;return o._zod.run({value:t.value,issues:t.issues},n)}var ji=v("$ZodPreprocess",(t,o)=>{Ut.init(t,o)}),Ri=v("$ZodReadonly",(t,o)=>{A.init(t,o),E(t,"propValues",(n)=>n.def.innerType._zod.propValues),E(t,"values",(n)=>n.def.innerType._zod.values),E(t,"optin",(n)=>n.def.innerType?._zod?.optin),E(t,"optout",(n)=>n.def.innerType?._zod?.optout),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then(En);return En(u)}});function En(t){if(!t.memo)t.value=Object.freeze(t.value);return t}var Di=v("$ZodLazy",(t,o)=>{A.init(t,o),ro(t._zod,"innerType",()=>{let n=o;if(!n._cachedInner)n._cachedInner=o.getter();return n._cachedInner}),E(t,"pattern",(n)=>n.innerType?._zod?.pattern),E(t,"propValues",(n)=>n.innerType?._zod?.propValues),E(t,"optin",(n)=>n.innerType?._zod?.optin??void 0),E(t,"optout",(n)=>n.innerType?._zod?.optout??void 0),t._zod.parse=(n,c)=>t._zod.innerType._zod.run(n,c)}),Li=v("$ZodCustom",(t,o)=>{M.init(t,o),A.init(t,o),t._zod.parse=(n,c)=>n,t._zod.check=(n)=>{let c=n.value,u=o.fn(c);if(u instanceof Promise)return u.then((p)=>Tn(p,n,c,t));Tn(u,n,c,t);return}});function Tn(t,o,n,c){if(!t){let u={code:"custom",input:n,inst:c,path:[...c._zod.def.path??[]],continue:!c._zod.def.abort};if(c._zod.def.params)u.params=c._zod.def.params;o.issues.push(_e(u))}}class Mi extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Jt="~memo",Fi=[];function Mt(t){return t.map((o)=>o.path?{...o,path:o.path.slice()}:{...o})}var Ui=new WeakMap;function Ji(t,o){let n=Ui.get(t);if(n!==void 0)return n;if(o.has(t))return!0;o.add(t);let c=!1,u=(m)=>{if(!c&&m?._zod&&Ji(m,o))c=!0},p=t._zod.def,f=p.type;switch(f){case"object":{for(let m of Reflect.ownKeys(p.shape))u(p.shape[m]);u(p.catchall);break}case"array":u(p.element);break;case"tuple":for(let m of p.items)u(m);u(p.rest);break;case"record":case"map":u(p.keyType),u(p.valueType);break;case"set":u(p.valueType);break;case"union":for(let m of p.options)u(m);break;case"intersection":u(p.left),u(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":u(p.innerType);break;case"pipe":u(p.in),u(p.out);break;case"function":u(p.input),u(p.output);break;case"lazy":u(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let m in p){let _=Object.getOwnPropertyDescriptor(p,m);if(!_||_.get)continue;let b=_.value;if(!b||typeof b!=="object")continue;if(b._zod)u(b);else if(Array.isArray(b))for(let z of b)u(z)}}return o.delete(t),Ui.set(t,c),c}function su(t,o){let n=t.buckets.get(o);if(!n)n=new Map,t.buckets.set(o,n);return n}var Qe,et=[],cu={alloc(t,o,n){let c=Qe;if(!c)return n;Qe=void 0;let u={value:n,issues:null};return c.set(o.value,u),et.push(u),n},guard(t){var o;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let n=t._zod.parse,c=(u,p)=>{if(p.direction!=="backward"&&uu(p,u.value))throw new Mi;return n(u,p)};if(t._zod.parse=c,t._zod.run===n)t._zod.run=c})},attach(t){var o;let n,c,u;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let p=t._zod.parse,f=(m,_)=>{if(n===void 0){if(n=Ji(t,new Set),!n){if(t._zod.parse=p,t._zod.run===f)t._zod.run=p;return p(m,_)}}let b=m.value;if(b===null||typeof b!=="object")return p(m,_);let z=_[Jt];if(!z)z={buckets:new Map,backEdges:void 0},_[Jt]=z;let w;if(c===_)w=u;else w=su(z,t),c=_,u=w;let k=w.get(b);if(k){if(m.value=k.value,k.issues){if(k.issues.length)m.issues.push(...Mt(k.issues))}else m.memo=!0,z.backEdges??(z.backEdges=new Set),z.backEdges.add(k.value);return m}Qe=w;let Z=et.length,P=p(m,_);Qe=void 0;let O=et.length>Z?et.pop():void 0;if(P instanceof Promise)return P.then((I)=>{if(O)O.issues=I.issues.length?Mt(I.issues):Fi;return I});if(O)O.issues=P.issues.length?Mt(P.issues):Fi;return P};if(t._zod.parse=f,t._zod.run===p)t._zod.run=f})}};function Bt(){return cu}function uu(t,o){let n=t[Jt]?.backEdges;return n!==void 0&&o!==null&&typeof o==="object"&&n.has(o)}var au=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function o(p){return t[p]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},c={nan:"NaN"};function u(p,f){if(p==="number"&&typeof f==="number"&&!Number.isFinite(f))return String(f);return c[p]??p}return(p)=>{switch(p.code){case"invalid_type":{let f=u(p.expected),m=po(p.input),_=u(m,p.input);return`Invalid input: expected ${f}, received ${_}`}case"invalid_value":if(p.values.length===1)return`Invalid input: expected ${ht(p.values[0])}`;return`Invalid option: expected one of ${ft(p.values,"|")}`;case"too_big":{let f=p.exact?"exactly ":p.inclusive?"<=":"<",m=o(p.origin);if(m)return`Too big: expected ${p.origin??"value"} to have ${f}${p.maximum.toString()} ${m.unit??"elements"}`;return`Too big: expected ${p.origin??"value"} to be ${f}${p.maximum.toString()}`}case"too_small":{let f=p.exact?"exactly ":p.inclusive?">=":">",m=o(p.origin);if(m)return`Too small: expected ${p.origin} to have ${f}${p.minimum.toString()} ${m.unit}`;return`Too small: expected ${p.origin} to be ${f}${p.minimum.toString()}`}case"invalid_format":{let f=p;if(f.format==="starts_with")return`Invalid string: must start with "${f.prefix}"`;if(f.format==="ends_with")return`Invalid string: must end with "${f.suffix}"`;if(f.format==="includes")return`Invalid string: must include "${f.includes}"`;if(f.format==="regex")return`Invalid string: must match pattern ${f.pattern}`;return`Invalid ${n[f.format]??p.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${p.divisor}`;case"unrecognized_keys":return`Unrecognized key${p.keys.length>1?"s":""}: ${ft(p.keys,", ")}`;case"invalid_key":return`Invalid key in ${p.origin}`;case"invalid_union":if(p.options&&Array.isArray(p.options)&&p.options.length>0)return`Invalid discriminator value. Expected ${p.options.map((m)=>`'${m}'`).join(" | ")}`;if(p.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${p.origin}`;default:return"Invalid input"}}};function Vt(){return{localeError:au()}}var Bi;class Vi{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let n=o[0];if(this._map.set(t,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,t);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);if(o&&typeof o==="object"&&"id"in o)this._idmap.delete(o.id);return this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let n={...this.get(o)??{}};delete n.id;let c={...n,...this._map.get(t)};return Object.keys(c).length?c:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ki(){return new Vi}(Bi=globalThis).__zod_globalRegistry??(Bi.__zod_globalRegistry=Ki());var pe=globalThis.__zod_globalRegistry;function Wi(t,o){return new t({type:"string",...S(o)})}function Gi(t,o){return new t({type:"string",coerce:!0,...S(o)})}function Kt(t,o){return new t({type:"string",format:"email",check:"string_format",abort:!1,...S(o)})}function qi(t,o){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...S(o)})}function Yi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...S(o)})}function Xi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(o)})}function Qi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(o)})}function es(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(o)})}function Wt(t,o){return new t({type:"string",format:"url",check:"string_format",abort:!1,...S(o)})}function ts(t,o){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...S(o)})}function rs(t,o){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(o)})}function os(t,o){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...S(o)})}function ns(t,o){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(o)})}function is(t,o){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...S(o)})}function ss(t,o){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...S(o)})}function cs(t,o){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(o)})}function Gt(t,o){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(o)})}function qt(t,o){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(o)})}function us(t,o){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(o)})}function as(t,o){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(o)})}function ls(t,o){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...S(o)})}function ps(t,o){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...S(o)})}function fs(t,o){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...S(o)})}function ds(t,o){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...S(o)})}function tt(t,o){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(o)})}function rt(t,o){return new t({type:"string",format:"date",check:"string_format",...S(o)})}function Xt(t,o){return new t({type:"string",format:"time",check:"string_format",precision:null,...S(o)})}function Ht(t,o){return new t({type:"string",format:"duration",check:"string_format",...S(o)})}function ms(t,o){return new t({type:"number",checks:[],...S(o)})}function hs(t,o){return new t({type:"number",coerce:!0,checks:[],...S(o)})}function _s(t,o){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...S(o)})}function gs(t,o){return new t({type:"boolean",...S(o)})}function xs(t,o){return new t({type:"boolean",coerce:!0,...S(o)})}function ys(t,o){return new t({type:"bigint",coerce:!0,...S(o)})}function bs(t,o){return new t({type:"null",...S(o)})}function zs(t){return new t({type:"any"})}function vs(t){return new t({type:"unknown"})}function $s(t,o){return new t({type:"never",...S(o)})}function ws(t,o){return new t({type:"void",...S(o)})}function ks(t,o){return new t({type:"date",...S(o)})}function Zs(t,o){return new t({type:"date",coerce:!0,...S(o)})}function ye(t,o){return new Et({check:"less_than",...S(o),value:t,inclusive:!1})}function se(t,o){return new Et({check:"less_than",...S(o),value:t,inclusive:!0})}function be(t,o){return new Tt({check:"greater_than",...S(o),value:t,inclusive:!1})}function ce(t,o){return new Tt({check:"greater_than",...S(o),value:t,inclusive:!0})}function Te(t,o){return new sn({check:"multiple_of",...S(o),value:t})}function ot(t,o){return new un({check:"max_length",...S(o),maximum:t})}function ze(t,o){return new an({check:"min_length",...S(o),minimum:t})}function nt(t,o){return new ln({check:"length_equals",...S(o),length:t})}function Qt(t,o){return new pn({check:"string_format",format:"regex",...S(o),pattern:t})}function er(t){return new fn({check:"string_format",format:"lowercase",...S(t)})}function tr(t){return new dn({check:"string_format",format:"uppercase",...S(t)})}function rr(t,o){return new mn({check:"string_format",format:"includes",...S(o),includes:t})}function or(t,o){return new hn({check:"string_format",format:"starts_with",...S(o),prefix:t})}function nr(t,o){return new _n({check:"string_format",format:"ends_with",...S(o),suffix:t})}function fe(t){return new gn({check:"overwrite",tx:t})}function ir(t){return fe((o)=>o.normalize(t))}function sr(){return fe((t)=>t.trim())}function cr(){return fe((t)=>t.toLowerCase())}function ur(){return fe((t)=>t.toUpperCase())}function ar(){return fe((t)=>no(t))}function Ss(t,o,n){return new t({type:"array",element:o,...S(n)})}function Os(t,o,n){let c=S(n);return c.abort??(c.abort=!0),new t({type:"custom",check:"custom",fn:o,...c})}function Is(t,o,n){return new t({type:"custom",check:"custom",fn:o,...S(n)})}function Es(t,o){let n=lu((c)=>(c.addIssue=(u)=>{if(typeof u==="string")c.issues.push(_e(u,c.value,n._zod.def));else{let p=u;if(p.fatal)p.continue=!1;if(p.code??(p.code="custom"),!("input"in p))p.input=c.value;p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),c.issues.push(_e(p))}},t(c.value,c)),o);return n}function lu(t,o){let n=new M({check:"custom",...S(o)});return n._zod.check=t,n}function Ae(t,...o){for(let n of o)for(let c of Reflect.ownKeys(n))if(Object.prototype.propertyIsEnumerable.call(n,c))L(t,c,n[c]);return t}function Ce(t){let o=t?.target??"draft-2020-12";if(o==="draft-4")o="draft-04";if(o==="draft-7")o="draft-07";return{processors:t.processors??{},metadataRegistry:t?.metadata??pe,target:o,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function F(t,o,n,c,u){let p=typeof o.unrepresentable==="function"?o.unrepresentable({zodSchema:t,path:c.path,message:u}):o.unrepresentable;if(p==="any")return!1;if(p===void 0||p==="throw")throw Error(u);return Object.assign(n,p),!0}function C(t,o,n={path:[],schemaPath:[]}){var c;let u=t._zod.def,p=o.seen.get(t);if(p){if(p.count++,n.schemaPath.includes(t))p.cycle=n.path;return p.schema}let f={schema:{},count:1,cycle:void 0,path:n.path};o.seen.set(t,f),o.sharedDefsExtractedFor=void 0,o.sharedEmitDoneFor=void 0;let m=t._zod.toJSONSchema?.();if(m)f.schema=m;else{let z={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(o,f.schema,z);else{let k=f.schema,Z=o.processors[u.type];if(!Z)throw Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);Z(t,o,k,z)}let w=t._zod.parent;if(w){if(!f.ref)f.ref=w;C(w,o,z),o.seen.get(w).isParent=!0}}let _=o.metadataRegistry.get(t);if(_)Ae(f.schema,_);if(o.io==="input"&&V(t))delete f.schema.examples,delete f.schema.default;if(o.io==="input"&&"_prefault"in f.schema)(c=f.schema).default??(c.default=f.schema._prefault);return delete f.schema._prefault,o.seen.get(t).schema}function Ts(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Re(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let c=new Map;for(let f of t.seen.entries()){let m=t.metadataRegistry.get(f[0])?.id;if(m){let _=c.get(m);if(_&&_!==f[0])throw Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);c.set(m,f[0])}}let u=(f)=>{let m=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let w=t.external.registry.get(f[0])?.id,k=t.external.uri??((P)=>P);if(w)return{ref:k(w)};let Z=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=Z,{defId:Z,ref:`${k("__shared")}#/${m}/${Ts(Z)}`}}let _="#",b=`${_}/${m}/`;if(f[1]===n&&!f[1].schema.id)return{ref:_};let z=f[1].schema.id??`__schema${t.counter++}`;return{defId:z,ref:b+Ts(z)}},p=(f)=>{if(f[1].schema.$ref)return;let m=f[1],{ref:_,defId:b}=u(f);if(m.def={...m.schema},b)m.defId=b;let z=m.schema;for(let w in z)delete z[w];z.$ref=_};if(t.cycles==="throw")for(let f of t.seen.entries()){let m=f[1];if(m.cycle)throw Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
|
|
53
53
|
|
|
54
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of t.seen.entries()){let m=f[1];if(o===f[0]){p(f);continue}if(t.external){let b=t.external.registry.get(f[0])?.id;if(o!==f[0]&&b){p(f);continue}}if(t.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1){if(t.reused==="ref"){p(f);continue}}}if(t.external)t.sharedDefsExtractedFor=t.external}function Cs(t){let o=t.anyOf;if(!Array.isArray(o)||o.length===0||t.type!==void 0)return;let n=[];for(let c of o){if(!c||typeof c!=="object")return;Cs(c);let u=Object.keys(c);if(u.length!==1||u[0]!=="type")return;let p=c.type;for(let f of Array.isArray(p)?p:[p]){if(typeof f!=="string")return;if(!n.includes(f))n.push(f)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var js=new Set(["type","properties","required","additionalProperties"]),As=["oneOf","anyOf"];function Ns(t){let o=t.additionalProperties;if(o===void 0||o===!1||typeof o!=="object"||o===null)return null;return Object.keys(o).length?o:null}function lr(t){let o=[];for(let p of t){if(typeof p!=="object"||p.type!=="object")return null;for(let f in p)if(!js.has(f))return null;o.push(p)}let n={},c=new Set;for(let p of o){for(let f in p.properties){if(Object.prototype.hasOwnProperty.call(n,f))continue;let m=[];for(let b of o){let z=b.properties?.[f]??Ns(b);if(z===null||z===void 0)continue;if(!m.some((w)=>JSON.stringify(w)===JSON.stringify(z)))m.push(z)}let _=m.length===1?m[0]:lr(m)??{allOf:m};L(n,f,_)}for(let f of p.required??[])c.add(f)}let u={type:"object",properties:n};if(c.size)u.required=[...c];if(o.every((p)=>p.additionalProperties===!1))u.additionalProperties=!1;else{let p=[];for(let f of o){let m=Ns(f);if(m&&!p.some((_)=>JSON.stringify(_)===JSON.stringify(m)))p.push(m)}if(p.length===1)u.additionalProperties=p[0];else if(p.length>1)u.additionalProperties={allOf:p}}return u}function pu(t){let o=t.allOf;if(!Array.isArray(o)||o.length<2)return;for(let u of js)if(u in t)return;let n=o.filter((u)=>As.some((p)=>Array.isArray(u[p]))),c=null;if(!n.length)c=lr(o);else{let u=n[0],p=As.find((_)=>Array.isArray(u[_]));if(Object.keys(u).length!==1)return;let f=o.filter((_)=>_!==u),m=u[p].map((_)=>lr([...f,_]));if(m.some((_)=>!_))return;c={[p]:m}}if(!c)return;delete t.allOf,Ne(t,c)}function De(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let c=(m)=>{let _=t.seen.get(m);if(_.ref===null)return;let b=_.def??_.schema,z={...b},w=_.ref;if(_.ref=null,w){c(w);let Z=t.seen.get(w),P=Z.schema;if(P.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"))b.allOf=b.allOf??[],b.allOf.push(P);else Ne(b,P);if(Ne(b,z),m._zod.parent===w)for(let I in b){if(I==="$ref"||I==="allOf")continue;if(!(I in z))delete b[I]}if(P.$ref&&Z.def)for(let I in b){if(I==="$ref"||I==="allOf")continue;if(I in Z.def&&JSON.stringify(b[I])===JSON.stringify(Z.def[I]))delete b[I]}}let k=m._zod.parent;if(k&&k!==w){c(k);let Z=t.seen.get(k);if(Z?.schema.$ref){if(b.$ref=Z.schema.$ref,Z.def)for(let P in b){if(P==="$ref"||P==="allOf")continue;if(P in Z.def&&JSON.stringify(b[P])===JSON.stringify(Z.def[P]))delete b[P]}}}t.override({zodSchema:m,jsonSchema:b,path:_.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let m of[...t.seen.entries()].reverse())c(m[0]);if(t.target!=="openapi-3.0")for(let m of t.seen.entries())Cs(m[1].def??m[1].schema);for(let m of t.deferred)m();if(t.intersections.length){let m=new Map;for(let _ of t.seen.values())for(let b of[_.schema,_.def]){let z=b?.allOf;if(!Array.isArray(z))continue;let w=m.get(z);if(w)w.push(b);else m.set(z,[b])}for(let _ of t.intersections)for(let b of m.get(_)??[])pu(b)}}let u={};if(t.target==="draft-2020-12")u.$schema="https://json-schema.org/draft/2020-12/schema";else if(t.target==="draft-07")u.$schema="http://json-schema.org/draft-07/schema#";else if(t.target==="draft-04")u.$schema="http://json-schema.org/draft-04/schema#";else if(t.target==="openapi-3.0");if(t.external?.uri){let m=t.external.registry.get(o)?.id;if(!m)throw Error("Schema is missing an `id` property");u.$id=t.external.uri(m)}Ne(u,n.defId?n.schema:n.def??n.schema);let p=t.metadataRegistry.get(o)?.id;if(p!==void 0&&u.id===p)delete u.id;let f=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let m of t.seen.entries()){let _=m[1];if(_.def&&_.defId){if(_.def.id===_.defId)delete _.def.id;L(f,_.defId,_.def)}}if(t.external)t.sharedEmitDoneFor=t.external;if(t.external);else if(Object.keys(f).length>0)if(t.target==="draft-2020-12")u.$defs=f;else u.definitions=f;try{let m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...o["~standard"],jsonSchema:{input:Ce(o,"input",t.processors),output:Ce(o,"output",t.processors)}},enumerable:!1,writable:!1}),m}catch(m){throw Error("Error converting schema to JSON.")}}function V(t,o){let n=o??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let c=t._zod.def;if(c.type==="transform")return!0;if(c.type==="array")return V(c.element,n);if(c.type==="set")return V(c.valueType,n);if(c.type==="lazy")return V(c.getter(),n);if(c.type==="promise"||c.type==="optional"||c.type==="nonoptional"||c.type==="nullable"||c.type==="readonly"||c.type==="default"||c.type==="prefault"||c.type==="catch")return V(c.innerType,n);if(c.type==="intersection")return V(c.left,n)||V(c.right,n);if(c.type==="record"||c.type==="map")return V(c.keyType,n)||V(c.valueType,n);if(c.type==="pipe"){if(t._zod.traits.has("$ZodCodec"))return!0;return V(c.in,n)||V(c.out,n)}if(c.type==="object"){for(let u in c.shape)if(V(c.shape[u],n))return!0;return!1}if(c.type==="union"){for(let u of c.options)if(V(u,n))return!0;return!1}if(c.type==="tuple"){for(let u of c.items)if(V(u,n))return!0;if(c.rest&&V(c.rest,n))return!0;return!1}return!1}var Ds=(t,o={})=>(n)=>{let c=je({...n,processors:o});return C(t,c),Re(c,t),De(c,t)},Ce=(t,o,n={})=>(c)=>{let{libraryOptions:u,target:p}=c??{},f=je({...u??{},target:p,io:o,processors:n});return C(t,f),Re(f,t),De(f,t)};var fu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dr=(t,o,n,c)=>{let u=n;u.type="string";let{minimum:p,maximum:f,format:m,patterns:_,contentEncoding:b,laxFormat:z}=t._zod.bag;if(typeof p==="number")u.minLength=p;if(typeof f==="number")u.maxLength=f;if(m){if(u.format=fu[m]??m,u.format==="")delete u.format;if(m==="time"||z)delete u.format}if(b)u.contentEncoding=b;if(_&&_.size>0){let w=[..._];if(w.length===1)u.pattern=w[0].source;else if(w.length>1)u.allOf=[...w.map((k)=>({...o.target==="draft-07"||o.target==="draft-04"||o.target==="openapi-3.0"?{type:"string"}:{},pattern:k.source}))]}},mr=(t,o,n,c)=>{let u=n,{minimum:p,maximum:f,format:m,multipleOf:_,exclusiveMaximum:b,exclusiveMinimum:z}=t._zod.bag;if(typeof m==="string"&&m.includes("int"))u.type="integer";else u.type="number";let w=typeof z==="number"&&z>=(p??Number.NEGATIVE_INFINITY),k=typeof b==="number"&&b<=(f??Number.POSITIVE_INFINITY),Z=o.target==="draft-04"||o.target==="openapi-3.0";if(w)if(Z)u.minimum=z,u.exclusiveMinimum=!0;else u.exclusiveMinimum=z;else if(typeof p==="number")u.minimum=p;if(k)if(Z)u.maximum=b,u.exclusiveMaximum=!0;else u.exclusiveMaximum=b;else if(typeof f==="number")u.maximum=f;if(typeof _==="number")if(Number.isFinite(_)&&_!==0)u.multipleOf=Math.abs(_);else F(t,o,u,c,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`)},hr=(t,o,n,c)=>{n.type="boolean"},_r=(t,o,n,c)=>{F(t,o,n,c,"BigInt cannot be represented in JSON Schema")},Fs=(t,o,n,c)=>{F(t,o,n,c,"Symbols cannot be represented in JSON Schema")},gr=(t,o,n,c)=>{if(o.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},Us=(t,o,n,c)=>{F(t,o,n,c,"Undefined cannot be represented in JSON Schema")},xr=(t,o,n,c)=>{F(t,o,n,c,"Void cannot be represented in JSON Schema")},yr=(t,o,n,c)=>{n.not={}},br=(t,o,n,c)=>{},zr=(t,o,n,c)=>{},vr=(t,o,n,c)=>{F(t,o,n,c,"Date cannot be represented in JSON Schema")},$r=(t,o,n,c)=>{let u=t._zod.def,p=Ue(u.entries);if(p.length===0){n.not={};return}if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";n.enum=p},wr=(t,o,n,c)=>{let u=t._zod.def;if(u.values.length===0){n.not={};return}let p=[];for(let f of u.values)if(f===void 0){if(F(t,o,n,c,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof f==="bigint"){if(F(t,o,n,c,"BigInt literals cannot be represented in JSON Schema"))return;p.push(Number(f))}else p.push(f);if(p.length===0);else if(p.length===1){let f=p[0];if(n.type=f===null?"null":typeof f,o.target==="draft-04"||o.target==="openapi-3.0")n.enum=[f];else n.const=f}else{if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";if(p.every((f)=>typeof f==="boolean"))n.type="boolean";if(p.every((f)=>f===null))n.type="null";n.enum=p}},Ms=(t,o,n,c)=>{F(t,o,n,c,"NaN cannot be represented in JSON Schema")},Js=(t,o,n,c)=>{let u=n,p=t._zod.pattern;if(!p)throw Error("Pattern not found in template literal");u.type="string",u.pattern=p.source},Bs=(t,o,n,c)=>{let u=n,p={type:"string",format:"binary",contentEncoding:"binary"},{minimum:f,maximum:m,mime:_}=t._zod.bag;if(f!==void 0)p.minLength=f;if(m!==void 0)p.maxLength=m;if(_)if(_.length===1)p.contentMediaType=_[0],Object.assign(u,p);else Object.assign(u,p),u.anyOf=_.map((b)=>({contentMediaType:b}));else Object.assign(u,p)},Vs=(t,o,n,c)=>{n.type="boolean"},kr=(t,o,n,c)=>{F(t,o,n,c,"Custom types cannot be represented in JSON Schema")},Ks=(t,o,n,c)=>{F(t,o,n,c,"Function types cannot be represented in JSON Schema")},Pr=(t,o,n,c)=>{F(t,o,n,c,"Transforms cannot be represented in JSON Schema")},Ws=(t,o,n,c)=>{F(t,o,n,c,"Map cannot be represented in JSON Schema")},Gs=(t,o,n,c)=>{F(t,o,n,c,"Set cannot be represented in JSON Schema")},Sr=(t,o,n,c)=>{let u=n,p=t._zod.def,{minimum:f,maximum:m}=t._zod.bag;if(typeof f==="number")u.minItems=f;if(typeof m==="number")u.maxItems=m;u.type="array",u.items=C(p.element,o,{...c,path:[...c.path,"items"]})};function Le(t){let o=t._zod.def;if(o.type==="pipe"&&o.in._zod.traits.has("$ZodTransform"))return Le(o.out);if(o.type==="catch")return Le(o.innerType);return t._zod.optin}var Or=(t,o,n,c)=>{let u=n,p=t._zod.def,f=p.shape;if(Object.getOwnPropertySymbols(f).length&&F(t,o,u,c,"Symbol keys cannot be represented in JSON Schema"))return;u.type="object",u.properties={};for(let z in f)L(u.properties,z,C(f[z],o,{...c,path:[...c.path,"properties",z]}));let _=new Set(Object.keys(f)),b=new Set([..._].filter((z)=>{let w=p.shape[z];if(o.io==="input")return Le(w)===void 0;else return w._zod.optout===void 0}));if(b.size>0)u.required=Array.from(b);if(p.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!p.catchall){if(o.io==="output")u.additionalProperties=!1}else if(p.catchall)u.additionalProperties=C(p.catchall,o,{...c,path:[...c.path,"additionalProperties"]})},Ir=(t,o,n,c)=>{let u=t._zod.def,p=u.inclusive===!1,f=u.options.map((m,_)=>C(m,o,{...c,path:[...c.path,p?"oneOf":"anyOf",_]}));if(p)n.oneOf=f;else n.anyOf=f},Er=(t,o,n,c)=>{let u=t._zod.def,p=C(u.left,o,{...c,path:[...c.path,"allOf",0]}),f=C(u.right,o,{...c,path:[...c.path,"allOf",1]}),m=(b)=>("allOf"in b)&&Object.keys(b).length===1,_=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=_,o.intersections.push(_)},Tr=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="array";let f=o.target==="draft-2020-12"?"prefixItems":"items",m=o.target==="draft-2020-12"?"items":o.target==="openapi-3.0"?"items":"additionalItems",_=p.items.map((O,I)=>C(O,o,{...c,path:[...c.path,f,I]})),b=p.rest?C(p.rest,o,{...c,path:[...c.path,m,...o.target==="openapi-3.0"?[p.items.length]:[]]}):null,z=p.items.length;while(z>0){let O=p.items[z-1];if(!(o.io==="input"?Le(O)!==void 0:O._zod.optout==="optional"))break;z--}let w=p.items.length,k=!p.rest;if(o.target==="draft-2020-12"){if(u.prefixItems=_,k)u.items=!1;else if(b)u.items=b;if(z>0)u.minItems=z;if(k)u.maxItems=w}else if(o.target==="openapi-3.0"){if(u.items={anyOf:_},b)u.items.anyOf.push(b);if(z>0)u.minItems=z;if(k)u.maxItems=w}else{if(u.items=_,k)u.additionalItems=!1;else if(b)u.additionalItems=b;if(z>0)u.minItems=z;if(k)u.maxItems=w}let{minimum:Z,maximum:P}=t._zod.bag;if(typeof Z==="number")u.minItems=Z;if(typeof P==="number")u.maxItems=P};function pr(t,o,n){if(o.$ref){if(n.has(o))return o;n.add(o);let P=t.get(o)?.def;if(!P)return o;let O=pr(t,P,n);return O===P?o:O}for(let P of["anyOf","oneOf"]){let O=o[P];if(!Array.isArray(O))continue;let I=O.map((J)=>pr(t,J,n));if(I.some((J,q)=>J!==O[q]))o={...o,[P]:I}}let c=Array.isArray(o.type)?o.type:[o.type],u=!c.includes("string")&&c.some((P)=>P==="number"||P==="integer"),p=o.enum??(o.const!==void 0?[o.const]:void 0);if(!u&&!p?.some((P)=>typeof P==="number"))return o;let{minimum:f,maximum:m,exclusiveMinimum:_,exclusiveMaximum:b,multipleOf:z,format:w,id:k,...Z}=o;if(Z.enum)Z.enum=Z.enum.map((P)=>typeof P==="number"?String(P):P);else if(typeof Z.const==="number")Z.const=String(Z.const);if(!u)return Z;if(Z.type="string",!p)Z.pattern=(c.includes("number")?Ee:Ge).source;return Z}var fr=new WeakMap;function du(t){let o=new Map;for(let c of t.seen.values())if(c.def&&!o.has(c.schema))o.set(c.schema,c);let n=new Map;for(let c of fr.get(t)??[]){let u=t.seen.get(c),p=(u?.def??u?.schema)?.propertyNames;if(!p||p===!0||n.has(p))continue;let f=pr(o,p,new Set);if(f!==p)n.set(p,f)}if(!n.size)return;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let p=u&&n.get(u.propertyNames);if(p)u.propertyNames=p}}var Ar=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="object";let f=p.keyType,_=f._zod.bag?.patterns;if(p.mode==="loose"&&_&&_.size>0){let w=C(p.valueType,o,{...c,path:[...c.path,"patternProperties","*"]});u.patternProperties={};for(let k of _)L(u.patternProperties,k.source,w)}else{if(o.target==="draft-07"||o.target==="draft-2020-12"){u.propertyNames=C(p.keyType,o,{...c,path:[...c.path,"propertyNames"]});let w=fr.get(o);if(!w)w=[],fr.set(o,w),o.deferred.push(()=>du(o));w.push(t)}u.additionalProperties=C(p.valueType,o,{...c,path:[...c.path,"additionalProperties"]})}let b=f._zod.values,z=o.io==="input"&&Le(p.valueType)!==void 0;if(b&&!p.partial&&!z){let w=[...b].filter((k)=>typeof k==="string"||typeof k==="number");if(w.length>0)u.required=w.map(String)}},Nr=(t,o,n,c)=>{let u=t._zod.def,p=C(u.innerType,o,c),f=o.seen.get(t);if(o.target==="openapi-3.0")f.ref=u.innerType,n.nullable=!0;else n.anyOf=[p,{type:"null"}]},Cr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},jr=Symbol();function qs(t,o,n,c,u){let p=!1,f=JSON.stringify(t,(m,_)=>{if(typeof _!=="bigint")return _;return p=!0,null});if(!p)return JSON.parse(f);return F(o,n,c,u,"BigInt defaults cannot be represented in JSON Schema"),jr}var Rr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f=qs(u.defaultValue,t,o,n,c);if(f!==jr)n.default=f},Dr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);if(p.ref=u.innerType,o.io!=="input")return;let f=qs(u.defaultValue,t,o,n,c);if(f!==jr)n._prefault=f},Lr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f;try{f=u.catchValue(void 0)}catch{F(t,o,n,c,"Dynamic catch values are not supported in JSON Schema");return}n.default=f},Fr=(t,o,n,c)=>{let u=t._zod.def,p=u.in._zod.traits.has("$ZodTransform"),f=o.io==="input"?p?u.out:u.in:u.out;C(f,o,c);let m=o.seen.get(t);m.ref=f},Ur=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType,n.readOnly=!0},Ys=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},it=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},Mr=(t,o,n,c)=>{let u=t._zod.innerType;C(u,o,c);let p=o.seen.get(t);p.ref=u},Ls={string:dr,number:mr,boolean:hr,bigint:_r,symbol:Fs,null:gr,undefined:Us,void:xr,never:yr,any:br,unknown:zr,date:vr,enum:$r,literal:wr,nan:Ms,template_literal:Js,file:Bs,success:Vs,custom:kr,function:Ks,transform:Pr,map:Ws,set:Gs,array:Sr,object:Or,union:Ir,intersection:Er,tuple:Tr,record:Ar,nullable:Nr,nonoptional:Cr,default:Rr,prefault:Dr,catch:Lr,pipe:Fr,readonly:Ur,promise:Ys,optional:it,lazy:Mr};function si(t,o){if("_idmap"in t){let c=t,u=je({...o,processors:Ls}),p={};for(let _ of c._idmap.entries()){let[b,z]=_;C(z,u)}let f={},m={registry:c,uri:o?.uri,defs:p};u.external=m;for(let _ of c._idmap.entries()){let[b,z]=_;Re(u,z),L(f,b,De(u,z))}if(Object.keys(p).length>0){let _=u.target==="draft-2020-12"?"$defs":"definitions";f.__shared={[_]:p}}return{schemas:f}}let n=je({...o,processors:Ls});return C(t,n),Re(n,t),De(n,t)}var Xs=new WeakSet([Object.prototype,Error.prototype]);function st(t,o,n){Object.defineProperty(t,o,{configurable:!0,enumerable:!1,get(){let c=n(this);return Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0})}})}var zu=(t,o)=>{oi.init(t,o),t.name="ZodError";let n=Object.getPrototypeOf(t);if(Xs.has(n))return;Xs.add(n),st(n,"format",(c)=>(u)=>kt(c,u)),st(n,"flatten",(c)=>(u)=>wt(c,u)),st(n,"addIssue",(c)=>(u)=>{c.issues.push(u),c.message=JSON.stringify(c.issues,we,2)}),st(n,"addIssues",(c)=>(u)=>{c.issues.push(...u),c.message=JSON.stringify(c.issues,we,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var G=v("ZodError",zu,void 0,{Parent:Error});var Hs=Ke(G),Qs=We(G),Iu=Oe(G),Tu=Ie(G),ec=$o(G),tc=wo(G),rc=ko(G),oc=Zo(G),nc=Po(G),ic=So(G),sc=Oo(G),cc=Io(G);function $u(){if(!B.localeError)W(Vt())}function Fe(){if(!B.memoizer)W({memoizer:Bt()})}var N=v("ZodType",(t,o)=>($u(),A.init(t,o),t.def=o,t.type=o.type,t),{check(...t){let o=this.def;return this.clone(ae(o,{checks:[...o.checks??[],...t.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,o){return Y(this,t,o)},brand(){return this},register(t,o){return t.add(this,o),this},refine(t,o){return this.check(fa(t,o))},superRefine(t,o){return this.check(da(t,o))},overwrite(t){return this.check(fe(t))},optional(){return Se(this)},exactOptional(){return Qu(this)},nullable(){return s(this)},nullish(){return Se(s(this))},nonoptional(t){return ia(this,t)},array(){return i(this)},or(t){return T([this,t])},and(t){return ks(this,t)},transform(t){return ac(this,zc(t))},default(t){return ra(this,t)},prefault(t){return na(this,t)},catch(t){return ca(this,t)},pipe(t){return ac(this,t)},readonly(){return la(this)},describe(t){let o=this.clone();return pe.add(o,{description:t}),o},meta(...t){if(t.length===0)return pe.get(this);let o=this.clone();return pe.add(o,t[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...o){return o.length===0?t(this):t(this,...o)},get "~standard"(){return gt(this,"~standard",{...jt(this),jsonSchema:{input:Ce(this,"input"),output:Ce(this,"output")}})},set "~standard"(t){de(this,"~standard",t)},parse:function t(o,n){return Hs(this,o,n,{callee:t})},parseAsync:async function t(o,n){return await Qs(this,o,n,{callee:t})},safeParse(t,o){return Iu(this,t,o)},async safeParseAsync(t,o){return Tu(this,t,o)},get spa(){return this?.safeParseAsync},set spa(t){de(this,"spa",t)},encode:function t(o,n){return ec(this,o,n,{callee:t})},decode:function t(o,n){return tc(this,o,n,{callee:t})},encodeAsync:async function t(o,n){return await rc(this,o,n,{callee:t})},decodeAsync:async function t(o,n){return await oc(this,o,n,{callee:t})},safeEncode(t,o){return nc(this,t,o)},safeDecode(t,o){return ic(this,t,o)},async safeEncodeAsync(t,o){return sc(this,t,o)},async safeDecodeAsync(t,o){return cc(this,t,o)},toJSONSchema(t){return Ds(this,{})(t)},get description(){return pe.get(this)?.description},get _def(){return this._zod.def}}),lc=v("_ZodString",(t,o)=>{He.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>dr(t,c,u,p);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null},{regex(...t){return this.check(Qt(...t))},includes(...t){return this.check(rr(...t))},startsWith(...t){return this.check(or(...t))},endsWith(...t){return this.check(nr(...t))},min(...t){return this.check(ze(...t))},max(...t){return this.check(ot(...t))},length(...t){return this.check(nt(...t))},nonempty(...t){return this.check(ze(1,...t))},lowercase(t){return this.check(er(t))},uppercase(t){return this.check(tr(t))},trim(){return this.check(sr())},normalize(...t){return this.check(ir(...t))},toLowerCase(){return this.check(cr())},toUpperCase(){return this.check(ur())},slugify(){return this.check(ar())}}),Jr=v("ZodString",(t,o)=>{He.init(t,o),lc.init(t,o)},{email(t){return this.check(Kt(dc,t))},url(t){return this.check(Wt(mc,t))},jwt(t){return this.check(ds(Lu,t))},emoji(t){return this.check(ts(ku,t))},guid(t){return this.check(qi(wu,t))},uuid(t){return this.check(Yi(ct,t))},uuidv4(t){return this.check(Xi(ct,t))},uuidv6(t){return this.check(Qi(ct,t))},uuidv7(t){return this.check(es(ct,t))},nanoid(t){return this.check(rs(Zu,t))},cuid(t){return this.check(os(Pu,t))},cuid2(t){return this.check(ns(Su,t))},ulid(t){return this.check(is(Ou,t))},base64(t){return this.check(ls(ju,t))},base64url(t){return this.check(ps(Ru,t))},xid(t){return this.check(ss(Eu,t))},ksuid(t){return this.check(cs(Au,t))},ipv4(t){return this.check(Gt(hc,t))},ipv6(t){return this.check(qt(gc,t))},cidrv4(t){return this.check(us(Nu,t))},cidrv6(t){return this.check(as(Cu,t))},e164(t){return this.check(fs(Du,t))},datetime(t){return this.check(tt(Br,t))},date(t){return this.check(rt(Vr,t))},time(t){return this.check(Xt(pc,t))},duration(t){return this.check(Ht(fc,t))}});function e(t){return Wi(Jr,t)}var D=v("ZodStringFormat",(t,o)=>{j.init(t,o),lc.init(t,o)}),Br=v("ZodISODateTime",(t,o)=>{Kn.init(t,o),D.init(t,o)}),Vr=v("ZodISODate",(t,o)=>{Wn.init(t,o),D.init(t,o)}),pc=v("ZodISOTime",(t,o)=>{Gn.init(t,o),D.init(t,o)}),fc=v("ZodISODuration",(t,o)=>{qn.init(t,o),D.init(t,o)}),dc=v("ZodEmail",(t,o)=>{Cn.init(t,o),D.init(t,o)});function ho(t){return Kt(dc,t)}var wu=v("ZodGUID",(t,o)=>{An.init(t,o),D.init(t,o)});var ct=v("ZodUUID",(t,o)=>{Nn.init(t,o),D.init(t,o)});var mc=v("ZodURL",(t,o)=>{Dn.init(t,o),D.init(t,o)});function ii(t){return Wt(mc,t)}var ku=v("ZodEmoji",(t,o)=>{Ln.init(t,o),D.init(t,o)});var Zu=v("ZodNanoID",(t,o)=>{Fn.init(t,o),D.init(t,o)});var Pu=v("ZodCUID",(t,o)=>{Un.init(t,o),D.init(t,o)});var Su=v("ZodCUID2",(t,o)=>{Mn.init(t,o),D.init(t,o)});var Ou=v("ZodULID",(t,o)=>{Jn.init(t,o),D.init(t,o)});var Eu=v("ZodXID",(t,o)=>{Bn.init(t,o),D.init(t,o)});var Au=v("ZodKSUID",(t,o)=>{Vn.init(t,o),D.init(t,o)});var hc=v("ZodIPv4",(t,o)=>{Yn.init(t,o),D.init(t,o)});function _c(t){return Gt(hc,t)}var gc=v("ZodIPv6",(t,o)=>{Hn.init(t,o),D.init(t,o)});function gf(t){return qt(gc,t)}var Nu=v("ZodCIDRv4",(t,o)=>{Qn.init(t,o),D.init(t,o)});var Cu=v("ZodCIDRv6",(t,o)=>{ei.init(t,o),D.init(t,o)});var ju=v("ZodBase64",(t,o)=>{ri.init(t,o),D.init(t,o)});var Ru=v("ZodBase64URL",(t,o)=>{ni.init(t,o),D.init(t,o)});var Du=v("ZodE164",(t,o)=>{ci.init(t,o),D.init(t,o)});var Lu=v("ZodJWT",(t,o)=>{ui.init(t,o),D.init(t,o)});var at=v("ZodNumber",(t,o)=>{Dt.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>mr(t,c,u,p);let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),t.isFinite=!0,t.format=n.format??null},{gt(t,o){return this.check(be(t,o))},gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},lt(t,o){return this.check(ye(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},int(t){return this.check(h(t))},safe(t){return this.check(h(t))},positive(t){return this.check(be(0,t))},nonnegative(t){return this.check(ce(0,t))},negative(t){return this.check(ye(0,t))},nonpositive(t){return this.check(se(0,t))},multipleOf(t,o){return this.check(Ae(t,o))},step(t,o){return this.check(Ae(t,o))},finite(){return this}});function a(t){return ms(at,t)}var Fu=v("ZodNumberFormat",(t,o)=>{li.init(t,o),at.init(t,o)});function h(t){return _s(Fu,t)}var Kr=v("ZodBoolean",(t,o)=>{pi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>hr(t,n,c,u)});function d(t){return gs(Kr,t)}var xc=v("ZodBigInt",(t,o)=>{fi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>_r(t,c,u,p);let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null},{gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},gt(t,o){return this.check(be(t,o))},lt(t,o){return this.check(ye(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},positive(t){return this.check(be(BigInt(0),t))},negative(t){return this.check(ye(BigInt(0),t))},nonpositive(t){return this.check(se(BigInt(0),t))},nonnegative(t){return this.check(ce(BigInt(0),t))},multipleOf(t,o){return this.check(Ae(t,o))}});var Uu=v("ZodNull",(t,o)=>{di.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>gr(t,n,c,u)});function go(t){return bs(Uu,t)}var Ju=v("ZodAny",(t,o)=>{mi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>br(t,n,c,u)});function x(){return zs(Ju)}var Bu=v("ZodUnknown",(t,o)=>{hi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>zr(t,n,c,u)});function U(){return vs(Bu)}var Vu=v("ZodNever",(t,o)=>{_i.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>yr(t,n,c,u)});function Af(t){return $s(Vu,t)}var Ku=v("ZodVoid",(t,o)=>{gi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>xr(t,n,c,u)});function Rt(t){return ws(Ku,t)}var Wr=v("ZodDate",(t,o)=>{xi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>vr(t,c,u,p),t.min=(c,u)=>t.check(ce(c,u)),t.max=(c,u)=>t.check(se(c,u));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function ee(t){return Zs(Wr,t)}var Wu=v("ZodArray",(t,o)=>{Fe(),yi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Sr(t,n,c,u),t.element=o.element},{min(t,o){return this.check(ze(t,o))},nonempty(t){return this.check(ze(1,t))},max(t,o){return this.check(ot(t,o))},length(t,o){return this.check(nt(t,o))},unwrap(){return this.element}});function i(t,o){return Ss(Wu,t,o)}var va=v("ZodObject",(t,o)=>{Fe(),vi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Or(t,n,c,u),Dc(t,"shape",(n)=>n._zod.def.shape,!1)},{keyof(){return g(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:U()})},loose(){return this.clone({...this._zod.def,catchall:U()})},strict(){return this.clone({...this._zod.def,catchall:Af()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return Ic(this,t)},safeExtend(t){return Ec(this,t)},merge(t){return Tc(this,t)},pick(t){return Sc(this,t)},omit(t){return Oc(this,t)},partial(...t){return ao(wa,this,t[0])},exactPartial(...t){return ao(vc,this,t[0],"exactPartial")},required(...t){return Ac($c,this,t[0])}});function r(t,o){let n={type:"object",shape:t??{},...S(o)};return new va(n)}function oe(t,o){return new va({type:"object",shape:t,catchall:U(),...S(o)})}var bc=v("ZodUnion",(t,o)=>{Lt.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ir(t,n,c,u),t.options=o.options});function T(t,o){return new bc({type:"union",options:t,...S(o)})}var Gu=v("ZodDiscriminatedUnion",(t,o)=>{bc.init(t,o),$i.init(t,o)});function re(t,o,n){return new Gu({type:"union",options:o,discriminator:t,...S(n)})}var qu=v("ZodIntersection",(t,o)=>{wi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Er(t,n,c,u)});function ks(t,o){return new qu({type:"intersection",left:t,right:o})}var Yu=v("ZodTuple",(t,o)=>{Fe(),ki.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Tr(t,n,c,u)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map((o)=>new wa({type:"optional",innerType:o}))})}});function Hi(t,o,n){let c=o instanceof A,u=c?n:o;return new Yu({type:"tuple",items:t,rest:c?o:null,...S(u)})}var uc=v("ZodRecord",(t,o)=>{Fe(),Zi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ar(t,n,c,u),t.keyType=o.keyType,t.valueType=o.valueType});function y(t,o,n){if(!o||!o._zod)return new uc({type:"record",keyType:e(),valueType:t,...S(o)});return new uc({type:"record",keyType:t,valueType:o,...S(n)})}var ut=v("ZodEnum",(t,o)=>{Pi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>$r(t,c,u,p),t.enum=o.entries,t.options=Object.values(o.entries);let n=new Set(Object.keys(o.entries));t.extract=(c,u)=>{let p={};for(let f of c)if(n.has(f))p[f]=o.entries[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...S(u),entries:p})},t.exclude=(c,u)=>{let p={...o.entries};for(let f of c)if(n.has(f))delete p[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...S(u),entries:p})}});function g(t,o){let n=Array.isArray(t)?Object.fromEntries(t.map((c)=>[c,c])):t;return new ut({type:"enum",entries:n,...S(o)})}function Yt(t,o){return new ut({type:"enum",entries:t,...S(o)})}var Xu=v("ZodLiteral",(t,o)=>{Si.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>wr(t,n,c,u),t.values=new Set(o.values),Object.defineProperty(t,"value",{get(){if(o.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return o.values[0]}})});function l(t,o){return new Xu({type:"literal",values:Array.isArray(t)?t:[t],...S(o)})}var Hu=v("ZodTransform",(t,o)=>{Fe(),Oi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Pr(t,n,c,u),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Pe(t.constructor.name);n.addIssue=(p)=>{if(typeof p==="string")n.issues.push(_e(p,n.value,o));else{let f=p;if(f.fatal)f.continue=!1;if(f.code??(f.code="custom"),!("input"in f))f.input=n.value;f.inst??(f.inst=t),n.issues.push(_e(f))}};let u=o.transform(n.value,n);if(u instanceof Promise)return u.then((p)=>(n.value=p,n));return n.value=u,n}});function zc(t){return new Hu({type:"transform",transform:t})}var wa=v("ZodOptional",(t,o)=>{Ft.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Se(t){return new wa({type:"optional",innerType:t})}var vc=v("ZodExactOptional",(t,o)=>{Ii.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Qu(t){return new vc({type:"optional",innerType:t})}var ea=v("ZodNullable",(t,o)=>{Ei.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Nr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function s(t){return new ea({type:"nullable",innerType:t})}var ta=v("ZodDefault",(t,o)=>{Ti.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Rr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function ra(t,o){return new ta({type:"default",innerType:t,get defaultValue(){return typeof o==="function"?o():mt(o)}})}var oa=v("ZodPrefault",(t,o)=>{Ai.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Dr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function na(t,o){return new oa({type:"prefault",innerType:t,get defaultValue(){return typeof o==="function"?o():mt(o)}})}var $c=v("ZodNonOptional",(t,o)=>{Ni.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Cr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function ia(t,o){return new $c({type:"nonoptional",innerType:t,...S(o)})}var sa=v("ZodCatch",(t,o)=>{Ci.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Lr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function ca(t,o){return new sa({type:"catch",innerType:t,catchValue:typeof o==="function"?o:mo(o)})}var wc=v("ZodPipe",(t,o)=>{Ut.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Fr(t,n,c,u),t.in=o.in,t.out=o.out});function ac(t,o){return new wc({type:"pipe",in:t,out:o})}var ua=v("ZodPreprocess",(t,o)=>{wc.init(t,o),ji.init(t,o)}),aa=v("ZodReadonly",(t,o)=>{Ri.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ur(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function la(t){return new aa({type:"readonly",innerType:t})}var pa=v("ZodLazy",(t,o)=>{Di.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Mr(t,n,c,u),t.unwrap=()=>t._zod.def.getter()});function St(t){return new pa({type:"lazy",getter:t})}var Gr=v("ZodCustom",(t,o)=>{Li.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>kr(t,n,c,u)});function bt(t,o){return Os(Gr,t??(()=>!0),o)}function fa(t,o={}){return Is(Gr,t,o)}function da(t,o){return Es(t,o)}function Mu(t,o={}){let n=new Gr({type:"custom",check:"custom",fn:(c)=>c instanceof t,abort:!0,...S(o)});return n._zod.bag.Class=t,n._zod.check=(c)=>{if(!(c.value instanceof t))c.issues.push({code:"invalid_type",expected:t.name,input:c.value,inst:n,path:[...n._zod.def.path??[]]})},n}function ai(t){let o=St(()=>T([e(t),a(),d(),go(),i(o),y(e(),o)]));return o}function xa(t,o){return new ua({type:"pipe",in:zc(t),out:o})}var Rs={};ke(Rs,{bigint:()=>ha,boolean:()=>yc,date:()=>_a,number:()=>ym,string:()=>_m});function _m(t){return Gi(Jr,t)}function ym(t){return hs(at,t)}function yc(t){return xs(Kr,t)}function ha(t){return ys(xc,t)}function _a(t){return Ps(Wr,t)}function X(t){return tt(Br,t)}function qA(t){return rt(Vr,t)}export{Zr,oi,hf,si,Iu,Tu,e,ho,ii,_c,gf,a,h,d,go,x,U,Af,Rt,ee,i,va,r,oe,T,re,ks,Hi,y,g,Yt,l,wa,Se,s,St,bt,Mu,ai,xa,X,qA,_m,ym,yc,Rs};
|
|
54
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of t.seen.entries()){let m=f[1];if(o===f[0]){p(f);continue}if(t.external){let b=t.external.registry.get(f[0])?.id;if(o!==f[0]&&b){p(f);continue}}if(t.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1){if(t.reused==="ref"){p(f);continue}}}if(t.external)t.sharedDefsExtractedFor=t.external}function Cs(t){let o=t.anyOf;if(!Array.isArray(o)||o.length===0||t.type!==void 0)return;let n=[];for(let c of o){if(!c||typeof c!=="object")return;Cs(c);let u=Object.keys(c);if(u.length!==1||u[0]!=="type")return;let p=c.type;for(let f of Array.isArray(p)?p:[p]){if(typeof f!=="string")return;if(!n.includes(f))n.push(f)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var js=new Set(["type","properties","required","additionalProperties"]),As=["oneOf","anyOf"];function Ns(t){let o=t.additionalProperties;if(o===void 0||o===!1||typeof o!=="object"||o===null)return null;return Object.keys(o).length?o:null}function lr(t){let o=[];for(let p of t){if(typeof p!=="object"||p.type!=="object")return null;for(let f in p)if(!js.has(f))return null;o.push(p)}let n={},c=new Set;for(let p of o){for(let f in p.properties){if(Object.prototype.hasOwnProperty.call(n,f))continue;let m=[];for(let b of o){let z=b.properties?.[f]??Ns(b);if(z===null||z===void 0)continue;if(!m.some((w)=>JSON.stringify(w)===JSON.stringify(z)))m.push(z)}let _=m.length===1?m[0]:lr(m)??{allOf:m};L(n,f,_)}for(let f of p.required??[])c.add(f)}let u={type:"object",properties:n};if(c.size)u.required=[...c];if(o.every((p)=>p.additionalProperties===!1))u.additionalProperties=!1;else{let p=[];for(let f of o){let m=Ns(f);if(m&&!p.some((_)=>JSON.stringify(_)===JSON.stringify(m)))p.push(m)}if(p.length===1)u.additionalProperties=p[0];else if(p.length>1)u.additionalProperties={allOf:p}}return u}function pu(t){let o=t.allOf;if(!Array.isArray(o)||o.length<2)return;for(let u of js)if(u in t)return;let n=o.filter((u)=>As.some((p)=>Array.isArray(u[p]))),c=null;if(!n.length)c=lr(o);else{let u=n[0],p=As.find((_)=>Array.isArray(u[_]));if(Object.keys(u).length!==1)return;let f=o.filter((_)=>_!==u),m=u[p].map((_)=>lr([...f,_]));if(m.some((_)=>!_))return;c={[p]:m}}if(!c)return;delete t.allOf,Ae(t,c)}function De(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let c=(m)=>{let _=t.seen.get(m);if(_.ref===null)return;let b=_.def??_.schema,z={...b},w=_.ref;if(_.ref=null,w){c(w);let Z=t.seen.get(w),P=Z.schema;if(P.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"))b.allOf=b.allOf??[],b.allOf.push(P);else Ae(b,P);if(Ae(b,z),m._zod.parent===w)for(let I in b){if(I==="$ref"||I==="allOf")continue;if(!(I in z))delete b[I]}if(P.$ref&&Z.def)for(let I in b){if(I==="$ref"||I==="allOf")continue;if(I in Z.def&&JSON.stringify(b[I])===JSON.stringify(Z.def[I]))delete b[I]}}let k=m._zod.parent;if(k&&k!==w){c(k);let Z=t.seen.get(k);if(Z?.schema.$ref){if(b.$ref=Z.schema.$ref,Z.def)for(let P in b){if(P==="$ref"||P==="allOf")continue;if(P in Z.def&&JSON.stringify(b[P])===JSON.stringify(Z.def[P]))delete b[P]}}}t.override({zodSchema:m,jsonSchema:b,path:_.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let m of[...t.seen.entries()].reverse())c(m[0]);if(t.target!=="openapi-3.0")for(let m of t.seen.entries())Cs(m[1].def??m[1].schema);for(let m of t.deferred)m();if(t.intersections.length){let m=new Map;for(let _ of t.seen.values())for(let b of[_.schema,_.def]){let z=b?.allOf;if(!Array.isArray(z))continue;let w=m.get(z);if(w)w.push(b);else m.set(z,[b])}for(let _ of t.intersections)for(let b of m.get(_)??[])pu(b)}}let u={};if(t.target==="draft-2020-12")u.$schema="https://json-schema.org/draft/2020-12/schema";else if(t.target==="draft-07")u.$schema="http://json-schema.org/draft-07/schema#";else if(t.target==="draft-04")u.$schema="http://json-schema.org/draft-04/schema#";else if(t.target==="openapi-3.0");if(t.external?.uri){let m=t.external.registry.get(o)?.id;if(!m)throw Error("Schema is missing an `id` property");u.$id=t.external.uri(m)}Ae(u,n.defId?n.schema:n.def??n.schema);let p=t.metadataRegistry.get(o)?.id;if(p!==void 0&&u.id===p)delete u.id;let f=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let m of t.seen.entries()){let _=m[1];if(_.def&&_.defId){if(_.def.id===_.defId)delete _.def.id;L(f,_.defId,_.def)}}if(t.external)t.sharedEmitDoneFor=t.external;if(t.external);else if(Object.keys(f).length>0)if(t.target==="draft-2020-12")u.$defs=f;else u.definitions=f;try{let m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...o["~standard"],jsonSchema:{input:Ne(o,"input",t.processors),output:Ne(o,"output",t.processors)}},enumerable:!1,writable:!1}),m}catch(m){throw Error("Error converting schema to JSON.")}}function V(t,o){let n=o??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let c=t._zod.def;if(c.type==="transform")return!0;if(c.type==="array")return V(c.element,n);if(c.type==="set")return V(c.valueType,n);if(c.type==="lazy")return V(c.getter(),n);if(c.type==="promise"||c.type==="optional"||c.type==="nonoptional"||c.type==="nullable"||c.type==="readonly"||c.type==="default"||c.type==="prefault"||c.type==="catch")return V(c.innerType,n);if(c.type==="intersection")return V(c.left,n)||V(c.right,n);if(c.type==="record"||c.type==="map")return V(c.keyType,n)||V(c.valueType,n);if(c.type==="pipe"){if(t._zod.traits.has("$ZodCodec"))return!0;return V(c.in,n)||V(c.out,n)}if(c.type==="object"){for(let u in c.shape)if(V(c.shape[u],n))return!0;return!1}if(c.type==="union"){for(let u of c.options)if(V(u,n))return!0;return!1}if(c.type==="tuple"){for(let u of c.items)if(V(u,n))return!0;if(c.rest&&V(c.rest,n))return!0;return!1}return!1}var Ds=(t,o={})=>(n)=>{let c=Ce({...n,processors:o});return C(t,c),Re(c,t),De(c,t)},Ne=(t,o,n={})=>(c)=>{let{libraryOptions:u,target:p}=c??{},f=Ce({...u??{},target:p,io:o,processors:n});return C(t,f),Re(f,t),De(f,t)};var fu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dr=(t,o,n,c)=>{let u=n;u.type="string";let{minimum:p,maximum:f,format:m,patterns:_,contentEncoding:b,laxFormat:z}=t._zod.bag;if(typeof p==="number")u.minLength=p;if(typeof f==="number")u.maxLength=f;if(m){if(u.format=fu[m]??m,u.format==="")delete u.format;if(m==="time"||z)delete u.format}if(b)u.contentEncoding=b;if(_&&_.size>0){let w=[..._];if(w.length===1)u.pattern=w[0].source;else if(w.length>1)u.allOf=[...w.map((k)=>({...o.target==="draft-07"||o.target==="draft-04"||o.target==="openapi-3.0"?{type:"string"}:{},pattern:k.source}))]}},mr=(t,o,n,c)=>{let u=n,{minimum:p,maximum:f,format:m,multipleOf:_,exclusiveMaximum:b,exclusiveMinimum:z}=t._zod.bag;if(typeof m==="string"&&m.includes("int"))u.type="integer";else u.type="number";let w=typeof z==="number"&&z>=(p??Number.NEGATIVE_INFINITY),k=typeof b==="number"&&b<=(f??Number.POSITIVE_INFINITY),Z=o.target==="draft-04"||o.target==="openapi-3.0";if(w)if(Z)u.minimum=z,u.exclusiveMinimum=!0;else u.exclusiveMinimum=z;else if(typeof p==="number")u.minimum=p;if(k)if(Z)u.maximum=b,u.exclusiveMaximum=!0;else u.exclusiveMaximum=b;else if(typeof f==="number")u.maximum=f;if(typeof _==="number")if(Number.isFinite(_)&&_!==0)u.multipleOf=Math.abs(_);else F(t,o,u,c,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`)},hr=(t,o,n,c)=>{n.type="boolean"},_r=(t,o,n,c)=>{F(t,o,n,c,"BigInt cannot be represented in JSON Schema")},Fs=(t,o,n,c)=>{F(t,o,n,c,"Symbols cannot be represented in JSON Schema")},gr=(t,o,n,c)=>{if(o.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},Us=(t,o,n,c)=>{F(t,o,n,c,"Undefined cannot be represented in JSON Schema")},xr=(t,o,n,c)=>{F(t,o,n,c,"Void cannot be represented in JSON Schema")},yr=(t,o,n,c)=>{n.not={}},br=(t,o,n,c)=>{},zr=(t,o,n,c)=>{},vr=(t,o,n,c)=>{F(t,o,n,c,"Date cannot be represented in JSON Schema")},$r=(t,o,n,c)=>{let u=t._zod.def,p=Ue(u.entries);if(p.length===0){n.not={};return}if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";n.enum=p},wr=(t,o,n,c)=>{let u=t._zod.def;if(u.values.length===0){n.not={};return}let p=[];for(let f of u.values)if(f===void 0){if(F(t,o,n,c,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof f==="bigint"){if(F(t,o,n,c,"BigInt literals cannot be represented in JSON Schema"))return;p.push(Number(f))}else p.push(f);if(p.length===0);else if(p.length===1){let f=p[0];if(n.type=f===null?"null":typeof f,o.target==="draft-04"||o.target==="openapi-3.0")n.enum=[f];else n.const=f}else{if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";if(p.every((f)=>typeof f==="boolean"))n.type="boolean";if(p.every((f)=>f===null))n.type="null";n.enum=p}},Ms=(t,o,n,c)=>{F(t,o,n,c,"NaN cannot be represented in JSON Schema")},Js=(t,o,n,c)=>{let u=n,p=t._zod.pattern;if(!p)throw Error("Pattern not found in template literal");u.type="string",u.pattern=p.source},Bs=(t,o,n,c)=>{let u=n,p={type:"string",format:"binary",contentEncoding:"binary"},{minimum:f,maximum:m,mime:_}=t._zod.bag;if(f!==void 0)p.minLength=f;if(m!==void 0)p.maxLength=m;if(_)if(_.length===1)p.contentMediaType=_[0],Object.assign(u,p);else Object.assign(u,p),u.anyOf=_.map((b)=>({contentMediaType:b}));else Object.assign(u,p)},Vs=(t,o,n,c)=>{n.type="boolean"},kr=(t,o,n,c)=>{F(t,o,n,c,"Custom types cannot be represented in JSON Schema")},Ks=(t,o,n,c)=>{F(t,o,n,c,"Function types cannot be represented in JSON Schema")},Pr=(t,o,n,c)=>{F(t,o,n,c,"Transforms cannot be represented in JSON Schema")},Ws=(t,o,n,c)=>{F(t,o,n,c,"Map cannot be represented in JSON Schema")},Gs=(t,o,n,c)=>{F(t,o,n,c,"Set cannot be represented in JSON Schema")},Sr=(t,o,n,c)=>{let u=n,p=t._zod.def,{minimum:f,maximum:m}=t._zod.bag;if(typeof f==="number")u.minItems=f;if(typeof m==="number")u.maxItems=m;u.type="array",u.items=C(p.element,o,{...c,path:[...c.path,"items"]})};function Le(t){let o=t._zod.def;if(o.type==="pipe"&&o.in._zod.traits.has("$ZodTransform"))return Le(o.out);if(o.type==="catch")return Le(o.innerType);return t._zod.optin}var Or=(t,o,n,c)=>{let u=n,p=t._zod.def,f=p.shape;if(Object.getOwnPropertySymbols(f).length&&F(t,o,u,c,"Symbol keys cannot be represented in JSON Schema"))return;u.type="object",u.properties={};for(let z in f)L(u.properties,z,C(f[z],o,{...c,path:[...c.path,"properties",z]}));let _=new Set(Object.keys(f)),b=new Set([..._].filter((z)=>{let w=p.shape[z];if(o.io==="input")return Le(w)===void 0;else return w._zod.optout===void 0}));if(b.size>0)u.required=Array.from(b);if(p.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!p.catchall){if(o.io==="output")u.additionalProperties=!1}else if(p.catchall)u.additionalProperties=C(p.catchall,o,{...c,path:[...c.path,"additionalProperties"]})},Ir=(t,o,n,c)=>{let u=t._zod.def,p=u.inclusive===!1,f=u.options.map((m,_)=>C(m,o,{...c,path:[...c.path,p?"oneOf":"anyOf",_]}));if(p)n.oneOf=f;else n.anyOf=f},Er=(t,o,n,c)=>{let u=t._zod.def,p=C(u.left,o,{...c,path:[...c.path,"allOf",0]}),f=C(u.right,o,{...c,path:[...c.path,"allOf",1]}),m=(b)=>("allOf"in b)&&Object.keys(b).length===1,_=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=_,o.intersections.push(_)},Tr=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="array";let f=o.target==="draft-2020-12"?"prefixItems":"items",m=o.target==="draft-2020-12"?"items":o.target==="openapi-3.0"?"items":"additionalItems",_=p.items.map((O,I)=>C(O,o,{...c,path:[...c.path,f,I]})),b=p.rest?C(p.rest,o,{...c,path:[...c.path,m,...o.target==="openapi-3.0"?[p.items.length]:[]]}):null,z=p.items.length;while(z>0){let O=p.items[z-1];if(!(o.io==="input"?Le(O)!==void 0:O._zod.optout==="optional"))break;z--}let w=p.items.length,k=!p.rest;if(o.target==="draft-2020-12"){if(u.prefixItems=_,k)u.items=!1;else if(b)u.items=b;if(z>0)u.minItems=z;if(k)u.maxItems=w}else if(o.target==="openapi-3.0"){if(u.items={anyOf:_},b)u.items.anyOf.push(b);if(z>0)u.minItems=z;if(k)u.maxItems=w}else{if(u.items=_,k)u.additionalItems=!1;else if(b)u.additionalItems=b;if(z>0)u.minItems=z;if(k)u.maxItems=w}let{minimum:Z,maximum:P}=t._zod.bag;if(typeof Z==="number")u.minItems=Z;if(typeof P==="number")u.maxItems=P};function pr(t,o,n){if(o.$ref){if(n.has(o))return o;n.add(o);let P=t.get(o)?.def;if(!P)return o;let O=pr(t,P,n);return O===P?o:O}for(let P of["anyOf","oneOf"]){let O=o[P];if(!Array.isArray(O))continue;let I=O.map((J)=>pr(t,J,n));if(I.some((J,q)=>J!==O[q]))o={...o,[P]:I}}let c=Array.isArray(o.type)?o.type:[o.type],u=!c.includes("string")&&c.some((P)=>P==="number"||P==="integer"),p=o.enum??(o.const!==void 0?[o.const]:void 0);if(!u&&!p?.some((P)=>typeof P==="number"))return o;let{minimum:f,maximum:m,exclusiveMinimum:_,exclusiveMaximum:b,multipleOf:z,format:w,id:k,...Z}=o;if(Z.enum)Z.enum=Z.enum.map((P)=>typeof P==="number"?String(P):P);else if(typeof Z.const==="number")Z.const=String(Z.const);if(!u)return Z;if(Z.type="string",!p)Z.pattern=(c.includes("number")?Ie:Ge).source;return Z}var fr=new WeakMap;function du(t){let o=new Map;for(let c of t.seen.values())if(c.def&&!o.has(c.schema))o.set(c.schema,c);let n=new Map;for(let c of fr.get(t)??[]){let u=t.seen.get(c),p=(u?.def??u?.schema)?.propertyNames;if(!p||p===!0||n.has(p))continue;let f=pr(o,p,new Set);if(f!==p)n.set(p,f)}if(!n.size)return;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let p=u&&n.get(u.propertyNames);if(p)u.propertyNames=p}}var Ar=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="object";let f=p.keyType,_=f._zod.bag?.patterns;if(p.mode==="loose"&&_&&_.size>0){let w=C(p.valueType,o,{...c,path:[...c.path,"patternProperties","*"]});u.patternProperties={};for(let k of _)L(u.patternProperties,k.source,w)}else{if(o.target==="draft-07"||o.target==="draft-2020-12"){u.propertyNames=C(p.keyType,o,{...c,path:[...c.path,"propertyNames"]});let w=fr.get(o);if(!w)w=[],fr.set(o,w),o.deferred.push(()=>du(o));w.push(t)}u.additionalProperties=C(p.valueType,o,{...c,path:[...c.path,"additionalProperties"]})}let b=f._zod.values,z=o.io==="input"&&Le(p.valueType)!==void 0;if(b&&!p.partial&&!z){let w=[...b].filter((k)=>typeof k==="string"||typeof k==="number");if(w.length>0)u.required=w.map(String)}},Nr=(t,o,n,c)=>{let u=t._zod.def,p=C(u.innerType,o,c),f=o.seen.get(t);if(o.target==="openapi-3.0")f.ref=u.innerType,n.nullable=!0;else n.anyOf=[p,{type:"null"}]},Cr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},jr=Symbol();function qs(t,o,n,c,u){let p=!1,f=JSON.stringify(t,(m,_)=>{if(typeof _!=="bigint")return _;return p=!0,null});if(!p)return JSON.parse(f);return F(o,n,c,u,"BigInt defaults cannot be represented in JSON Schema"),jr}var Rr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f=qs(u.defaultValue,t,o,n,c);if(f!==jr)n.default=f},Dr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);if(p.ref=u.innerType,o.io!=="input")return;let f=qs(u.defaultValue,t,o,n,c);if(f!==jr)n._prefault=f},Lr=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f;try{f=u.catchValue(void 0)}catch{F(t,o,n,c,"Dynamic catch values are not supported in JSON Schema");return}n.default=f},Fr=(t,o,n,c)=>{let u=t._zod.def,p=u.in._zod.traits.has("$ZodTransform"),f=o.io==="input"?p?u.out:u.in:u.out;C(f,o,c);let m=o.seen.get(t);m.ref=f},Ur=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType,n.readOnly=!0},Ys=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},it=(t,o,n,c)=>{let u=t._zod.def;C(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},Mr=(t,o,n,c)=>{let u=t._zod.innerType;C(u,o,c);let p=o.seen.get(t);p.ref=u},Ls={string:dr,number:mr,boolean:hr,bigint:_r,symbol:Fs,null:gr,undefined:Us,void:xr,never:yr,any:br,unknown:zr,date:vr,enum:$r,literal:wr,nan:Ms,template_literal:Js,file:Bs,success:Vs,custom:kr,function:Ks,transform:Pr,map:Ws,set:Gs,array:Sr,object:Or,union:Ir,intersection:Er,tuple:Tr,record:Ar,nullable:Nr,nonoptional:Cr,default:Rr,prefault:Dr,catch:Lr,pipe:Fr,readonly:Ur,promise:Ys,optional:it,lazy:Mr};function ii(t,o){if("_idmap"in t){let c=t,u=Ce({...o,processors:Ls}),p={};for(let _ of c._idmap.entries()){let[b,z]=_;C(z,u)}let f={},m={registry:c,uri:o?.uri,defs:p};u.external=m;for(let _ of c._idmap.entries()){let[b,z]=_;Re(u,z),L(f,b,De(u,z))}if(Object.keys(p).length>0){let _=u.target==="draft-2020-12"?"$defs":"definitions";f.__shared={[_]:p}}return{schemas:f}}let n=Ce({...o,processors:Ls});return C(t,n),Re(n,t),De(n,t)}var Xs=new WeakSet([Object.prototype,Error.prototype]);function st(t,o,n){Object.defineProperty(t,o,{configurable:!0,enumerable:!1,get(){let c=n(this);return Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0})}})}var zu=(t,o)=>{si.init(t,o),t.name="ZodError";let n=Object.getPrototypeOf(t);if(Xs.has(n))return;Xs.add(n),st(n,"format",(c)=>(u)=>kt(c,u)),st(n,"flatten",(c)=>(u)=>wt(c,u)),st(n,"addIssue",(c)=>(u)=>{c.issues.push(u),c.message=JSON.stringify(c.issues,we,2)}),st(n,"addIssues",(c)=>(u)=>{c.issues.push(...u),c.message=JSON.stringify(c.issues,we,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var G=v("ZodError",zu,void 0,{Parent:Error});var Hs=Ke(G),Qs=We(G),Iu=Pe(G),Tu=Oe(G),ec=$o(G),tc=wo(G),rc=ko(G),oc=Zo(G),nc=Po(G),ic=So(G),sc=Oo(G),cc=Io(G);function $u(){if(!B.localeError)W(Vt())}function Fe(){if(!B.memoizer)W({memoizer:Bt()})}var N=v("ZodType",(t,o)=>($u(),A.init(t,o),t.def=o,t.type=o.type,t),{check(...t){let o=this.def;return this.clone(ae(o,{checks:[...o.checks??[],...t.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,o){return Y(this,t,o)},brand(){return this},register(t,o){return t.add(this,o),this},refine(t,o){return this.check(fa(t,o))},superRefine(t,o){return this.check(da(t,o))},overwrite(t){return this.check(fe(t))},optional(){return Se(this)},exactOptional(){return Qu(this)},nullable(){return s(this)},nullish(){return Se(s(this))},nonoptional(t){return ia(this,t)},array(){return i(this)},or(t){return T([this,t])},and(t){return Rs(this,t)},transform(t){return ac(this,yc(t))},default(t){return ra(this,t)},prefault(t){return na(this,t)},catch(t){return ca(this,t)},pipe(t){return ac(this,t)},readonly(){return la(this)},describe(t){let o=this.clone();return pe.add(o,{description:t}),o},meta(...t){if(t.length===0)return pe.get(this);let o=this.clone();return pe.add(o,t[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...o){return o.length===0?t(this):t(this,...o)},get "~standard"(){return gt(this,"~standard",{...jt(this),jsonSchema:{input:Ne(this,"input"),output:Ne(this,"output")}})},set "~standard"(t){de(this,"~standard",t)},parse:function t(o,n){return Hs(this,o,n,{callee:t})},parseAsync:async function t(o,n){return await Qs(this,o,n,{callee:t})},safeParse(t,o){return Iu(this,t,o)},async safeParseAsync(t,o){return Tu(this,t,o)},get spa(){return this?.safeParseAsync},set spa(t){de(this,"spa",t)},encode:function t(o,n){return ec(this,o,n,{callee:t})},decode:function t(o,n){return tc(this,o,n,{callee:t})},encodeAsync:async function t(o,n){return await rc(this,o,n,{callee:t})},decodeAsync:async function t(o,n){return await oc(this,o,n,{callee:t})},safeEncode(t,o){return nc(this,t,o)},safeDecode(t,o){return ic(this,t,o)},async safeEncodeAsync(t,o){return sc(this,t,o)},async safeDecodeAsync(t,o){return cc(this,t,o)},toJSONSchema(t){return Ds(this,{})(t)},get description(){return pe.get(this)?.description},get _def(){return this._zod.def}}),lc=v("_ZodString",(t,o)=>{He.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>dr(t,c,u,p);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null},{regex(...t){return this.check(Qt(...t))},includes(...t){return this.check(rr(...t))},startsWith(...t){return this.check(or(...t))},endsWith(...t){return this.check(nr(...t))},min(...t){return this.check(ze(...t))},max(...t){return this.check(ot(...t))},length(...t){return this.check(nt(...t))},nonempty(...t){return this.check(ze(1,...t))},lowercase(t){return this.check(er(t))},uppercase(t){return this.check(tr(t))},trim(){return this.check(sr())},normalize(...t){return this.check(ir(...t))},toLowerCase(){return this.check(cr())},toUpperCase(){return this.check(ur())},slugify(){return this.check(ar())}}),Jr=v("ZodString",(t,o)=>{He.init(t,o),lc.init(t,o)},{email(t){return this.check(Kt(dc,t))},url(t){return this.check(Wt(mc,t))},jwt(t){return this.check(ds(Lu,t))},emoji(t){return this.check(ts(ku,t))},guid(t){return this.check(qi(wu,t))},uuid(t){return this.check(Yi(ct,t))},uuidv4(t){return this.check(Xi(ct,t))},uuidv6(t){return this.check(Qi(ct,t))},uuidv7(t){return this.check(es(ct,t))},nanoid(t){return this.check(rs(Zu,t))},cuid(t){return this.check(os(Pu,t))},cuid2(t){return this.check(ns(Su,t))},ulid(t){return this.check(is(Ou,t))},base64(t){return this.check(ls(ju,t))},base64url(t){return this.check(ps(Ru,t))},xid(t){return this.check(ss(Eu,t))},ksuid(t){return this.check(cs(Au,t))},ipv4(t){return this.check(Gt(hc,t))},ipv6(t){return this.check(qt(_c,t))},cidrv4(t){return this.check(us(Nu,t))},cidrv6(t){return this.check(as(Cu,t))},e164(t){return this.check(fs(Du,t))},datetime(t){return this.check(tt(Br,t))},date(t){return this.check(rt(Vr,t))},time(t){return this.check(Xt(pc,t))},duration(t){return this.check(Ht(fc,t))}});function e(t){return Wi(Jr,t)}var D=v("ZodStringFormat",(t,o)=>{j.init(t,o),lc.init(t,o)}),Br=v("ZodISODateTime",(t,o)=>{Kn.init(t,o),D.init(t,o)}),Vr=v("ZodISODate",(t,o)=>{Wn.init(t,o),D.init(t,o)}),pc=v("ZodISOTime",(t,o)=>{Gn.init(t,o),D.init(t,o)}),fc=v("ZodISODuration",(t,o)=>{qn.init(t,o),D.init(t,o)}),dc=v("ZodEmail",(t,o)=>{Cn.init(t,o),D.init(t,o)});function ho(t){return Kt(dc,t)}var wu=v("ZodGUID",(t,o)=>{An.init(t,o),D.init(t,o)});var ct=v("ZodUUID",(t,o)=>{Nn.init(t,o),D.init(t,o)});var mc=v("ZodURL",(t,o)=>{Dn.init(t,o),D.init(t,o)});function ai(t){return Wt(mc,t)}var ku=v("ZodEmoji",(t,o)=>{Ln.init(t,o),D.init(t,o)});var Zu=v("ZodNanoID",(t,o)=>{Fn.init(t,o),D.init(t,o)});var Pu=v("ZodCUID",(t,o)=>{Un.init(t,o),D.init(t,o)});var Su=v("ZodCUID2",(t,o)=>{Mn.init(t,o),D.init(t,o)});var Ou=v("ZodULID",(t,o)=>{Jn.init(t,o),D.init(t,o)});var Eu=v("ZodXID",(t,o)=>{Bn.init(t,o),D.init(t,o)});var Au=v("ZodKSUID",(t,o)=>{Vn.init(t,o),D.init(t,o)});var hc=v("ZodIPv4",(t,o)=>{Yn.init(t,o),D.init(t,o)});function vc(t){return Gt(hc,t)}var _c=v("ZodIPv6",(t,o)=>{Hn.init(t,o),D.init(t,o)});function Af(t){return qt(_c,t)}var Nu=v("ZodCIDRv4",(t,o)=>{Qn.init(t,o),D.init(t,o)});var Cu=v("ZodCIDRv6",(t,o)=>{ei.init(t,o),D.init(t,o)});var ju=v("ZodBase64",(t,o)=>{ri.init(t,o),D.init(t,o)});var Ru=v("ZodBase64URL",(t,o)=>{oi.init(t,o),D.init(t,o)});var Du=v("ZodE164",(t,o)=>{ni.init(t,o),D.init(t,o)});var Lu=v("ZodJWT",(t,o)=>{ci.init(t,o),D.init(t,o)});var at=v("ZodNumber",(t,o)=>{Dt.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>mr(t,c,u,p);let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),t.isFinite=!0,t.format=n.format??null},{gt(t,o){return this.check(be(t,o))},gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},lt(t,o){return this.check(ye(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},int(t){return this.check(h(t))},safe(t){return this.check(h(t))},positive(t){return this.check(be(0,t))},nonnegative(t){return this.check(ce(0,t))},negative(t){return this.check(ye(0,t))},nonpositive(t){return this.check(se(0,t))},multipleOf(t,o){return this.check(Te(t,o))},step(t,o){return this.check(Te(t,o))},finite(){return this}});function a(t){return ms(at,t)}var Fu=v("ZodNumberFormat",(t,o)=>{ui.init(t,o),at.init(t,o)});function h(t){return _s(Fu,t)}var Kr=v("ZodBoolean",(t,o)=>{pi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>hr(t,n,c,u)});function d(t){return gs(Kr,t)}var gc=v("ZodBigInt",(t,o)=>{fi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>_r(t,c,u,p);let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null},{gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},gt(t,o){return this.check(be(t,o))},lt(t,o){return this.check(ye(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},positive(t){return this.check(be(BigInt(0),t))},negative(t){return this.check(ye(BigInt(0),t))},nonpositive(t){return this.check(se(BigInt(0),t))},nonnegative(t){return this.check(ce(BigInt(0),t))},multipleOf(t,o){return this.check(Te(t,o))}});var Uu=v("ZodNull",(t,o)=>{di.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>gr(t,n,c,u)});function go(t){return bs(Uu,t)}var Ju=v("ZodAny",(t,o)=>{mi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>br(t,n,c,u)});function x(){return zs(Ju)}var Bu=v("ZodUnknown",(t,o)=>{hi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>zr(t,n,c,u)});function U(){return vs(Bu)}var Vu=v("ZodNever",(t,o)=>{_i.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>yr(t,n,c,u)});function _f(t){return $s(Vu,t)}var Ku=v("ZodVoid",(t,o)=>{gi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>xr(t,n,c,u)});function Rt(t){return ws(Ku,t)}var Wr=v("ZodDate",(t,o)=>{xi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>vr(t,c,u,p),t.min=(c,u)=>t.check(ce(c,u)),t.max=(c,u)=>t.check(se(c,u));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function ee(t){return ks(Wr,t)}var Wu=v("ZodArray",(t,o)=>{Fe(),yi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Sr(t,n,c,u),t.element=o.element},{min(t,o){return this.check(ze(t,o))},nonempty(t){return this.check(ze(1,t))},max(t,o){return this.check(ot(t,o))},length(t,o){return this.check(nt(t,o))},unwrap(){return this.element}});function i(t,o){return Ss(Wu,t,o)}var va=v("ZodObject",(t,o)=>{Fe(),vi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Or(t,n,c,u),Dc(t,"shape",(n)=>n._zod.def.shape,!1)},{keyof(){return g(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:U()})},loose(){return this.clone({...this._zod.def,catchall:U()})},strict(){return this.clone({...this._zod.def,catchall:_f()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return Ic(this,t)},safeExtend(t){return Ec(this,t)},merge(t){return Tc(this,t)},pick(t){return Sc(this,t)},omit(t){return Oc(this,t)},partial(...t){return ao(wa,this,t[0])},exactPartial(...t){return ao(bc,this,t[0],"exactPartial")},required(...t){return Ac(zc,this,t[0])}});function r(t,o){let n={type:"object",shape:t??{},...S(o)};return new va(n)}function oe(t,o){return new va({type:"object",shape:t,catchall:U(),...S(o)})}var xc=v("ZodUnion",(t,o)=>{Lt.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ir(t,n,c,u),t.options=o.options});function T(t,o){return new xc({type:"union",options:t,...S(o)})}var Gu=v("ZodDiscriminatedUnion",(t,o)=>{xc.init(t,o),$i.init(t,o)});function re(t,o,n){return new Gu({type:"union",options:o,discriminator:t,...S(n)})}var qu=v("ZodIntersection",(t,o)=>{wi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Er(t,n,c,u)});function Rs(t,o){return new qu({type:"intersection",left:t,right:o})}var Yu=v("ZodTuple",(t,o)=>{Fe(),ki.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Tr(t,n,c,u)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map((o)=>new wa({type:"optional",innerType:o}))})}});function Hi(t,o,n){let c=o instanceof A,u=c?n:o;return new Yu({type:"tuple",items:t,rest:c?o:null,...S(u)})}var uc=v("ZodRecord",(t,o)=>{Fe(),Zi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ar(t,n,c,u),t.keyType=o.keyType,t.valueType=o.valueType});function y(t,o,n){if(!o||!o._zod)return new uc({type:"record",keyType:e(),valueType:t,...S(o)});return new uc({type:"record",keyType:t,valueType:o,...S(n)})}var ut=v("ZodEnum",(t,o)=>{Pi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(c,u,p)=>$r(t,c,u,p),t.enum=o.entries,t.options=Object.values(o.entries);let n=new Set(Object.keys(o.entries));t.extract=(c,u)=>{let p={};for(let f of c)if(n.has(f))p[f]=o.entries[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...S(u),entries:p})},t.exclude=(c,u)=>{let p={...o.entries};for(let f of c)if(n.has(f))delete p[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...S(u),entries:p})}});function g(t,o){let n=Array.isArray(t)?Object.fromEntries(t.map((c)=>[c,c])):t;return new ut({type:"enum",entries:n,...S(o)})}function Yt(t,o){return new ut({type:"enum",entries:t,...S(o)})}var Xu=v("ZodLiteral",(t,o)=>{Si.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>wr(t,n,c,u),t.values=new Set(o.values),Object.defineProperty(t,"value",{get(){if(o.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return o.values[0]}})});function l(t,o){return new Xu({type:"literal",values:Array.isArray(t)?t:[t],...S(o)})}var Hu=v("ZodTransform",(t,o)=>{Fe(),Oi.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Pr(t,n,c,u),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Ze(t.constructor.name);n.addIssue=(p)=>{if(typeof p==="string")n.issues.push(_e(p,n.value,o));else{let f=p;if(f.fatal)f.continue=!1;if(f.code??(f.code="custom"),!("input"in f))f.input=n.value;f.inst??(f.inst=t),n.issues.push(_e(f))}};let u=o.transform(n.value,n);if(u instanceof Promise)return u.then((p)=>(n.value=p,n));return n.value=u,n}});function yc(t){return new Hu({type:"transform",transform:t})}var wa=v("ZodOptional",(t,o)=>{Ft.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Se(t){return new wa({type:"optional",innerType:t})}var bc=v("ZodExactOptional",(t,o)=>{Ii.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Qu(t){return new bc({type:"optional",innerType:t})}var ea=v("ZodNullable",(t,o)=>{Ei.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Nr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function s(t){return new ea({type:"nullable",innerType:t})}var ta=v("ZodDefault",(t,o)=>{Ti.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Rr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function ra(t,o){return new ta({type:"default",innerType:t,get defaultValue(){return typeof o==="function"?o():mt(o)}})}var oa=v("ZodPrefault",(t,o)=>{Ai.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Dr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function na(t,o){return new oa({type:"prefault",innerType:t,get defaultValue(){return typeof o==="function"?o():mt(o)}})}var zc=v("ZodNonOptional",(t,o)=>{Ni.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Cr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function ia(t,o){return new zc({type:"nonoptional",innerType:t,...S(o)})}var sa=v("ZodCatch",(t,o)=>{Ci.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Lr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function ca(t,o){return new sa({type:"catch",innerType:t,catchValue:typeof o==="function"?o:mo(o)})}var $c=v("ZodPipe",(t,o)=>{Ut.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Fr(t,n,c,u),t.in=o.in,t.out=o.out});function ac(t,o){return new $c({type:"pipe",in:t,out:o})}var ua=v("ZodPreprocess",(t,o)=>{$c.init(t,o),ji.init(t,o)}),aa=v("ZodReadonly",(t,o)=>{Ri.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ur(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function la(t){return new aa({type:"readonly",innerType:t})}var pa=v("ZodLazy",(t,o)=>{Di.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Mr(t,n,c,u),t.unwrap=()=>t._zod.def.getter()});function St(t){return new pa({type:"lazy",getter:t})}var Gr=v("ZodCustom",(t,o)=>{Li.init(t,o),N.init(t,o),t._zod.processJSONSchema=(n,c,u)=>kr(t,n,c,u)});function bt(t,o){return Os(Gr,t??(()=>!0),o)}function fa(t,o={}){return Is(Gr,t,o)}function da(t,o){return Es(t,o)}function Mu(t,o={}){let n=new Gr({type:"custom",check:"custom",fn:(c)=>c instanceof t,abort:!0,...S(o)});return n._zod.bag.Class=t,n._zod.check=(c)=>{if(!(c.value instanceof t))c.issues.push({code:"invalid_type",expected:t.name,input:c.value,inst:n,path:[...n._zod.def.path??[]]})},n}function li(t){let o=St(()=>T([e(t),a(),d(),go(),i(o),y(e(),o)]));return o}function xa(t,o){return new ua({type:"pipe",in:yc(t),out:o})}var Ps={};je(Ps,{bigint:()=>ha,boolean:()=>wc,date:()=>_a,number:()=>wm,string:()=>vm});function vm(t){return Gi(Jr,t)}function wm(t){return hs(at,t)}function wc(t){return xs(Kr,t)}function ha(t){return ys(gc,t)}function _a(t){return Zs(Wr,t)}function X(t){return tt(Br,t)}function jA(t){return rt(Vr,t)}export{Zr,si,gf,ii,Iu,Tu,e,ho,ai,vc,Af,a,h,d,go,x,U,_f,Rt,ee,i,va,r,oe,T,re,Rs,Hi,y,g,Yt,l,wa,Se,s,St,bt,Mu,li,xa,X,jA,vm,wm,wc,Ps};
|