broods 0.43.2 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,66 +1,66 @@
1
- var at,Ce=Object.freeze({status:"aborted"});function k(i,f,m){function h(v,b){if(!v._zod)Object.defineProperty(v,"_zod",{value:{def:b,constr:z,traits:new Set},enumerable:!1});if(v._zod.traits.has(i))return;v._zod.traits.add(i),f(v,b);let w=z.prototype,Z=Object.keys(w);for(let S=0;S<Z.length;S++){let E=Z[S];if(!(E in v))v[E]=w[E].bind(v)}}let _=m?.Parent??Object;class g extends _{}Object.defineProperty(g,"name",{value:i});function z(v){var b;let w=m?.Parent?new g:this;h(w,v),(b=w._zod).deferred??(b.deferred=[]);for(let Z of w._zod.deferred)Z();return w}return Object.defineProperty(z,"init",{value:h}),Object.defineProperty(z,Symbol.hasInstance,{value:(v)=>{if(m?.Parent&&v instanceof m.Parent)return!0;return v?._zod?.traits?.has(i)}}),Object.defineProperty(z,"name",{value:i}),z}var yc=Symbol("zod_brand");class X extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ye extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`);this.name="ZodEncodeError"}}(at=globalThis).__zod_globalConfig??(at.__zod_globalConfig={});var _e=globalThis.__zod_globalConfig;function y(i){if(i)Object.assign(_e,i);return _e}function Fe(i){let f=Object.values(i).filter((h)=>typeof h==="number");return Object.entries(i).filter(([h,_])=>f.indexOf(+h)===-1).map(([h,_])=>_)}function de(i,f="|"){return i.map((m)=>pe(m)).join(f)}function $e(i,f){if(typeof f==="bigint")return f.toString();return f}function be(i){return{get value(){{let m=i();return Object.defineProperty(this,"value",{value:m}),m}throw Error("cached value already set")}}}function Ue(i){return i===null||i===void 0}function Me(i){let f=i.startsWith("^")?1:0,m=i.endsWith("$")?i.length-1:i.length;return i.slice(f,m)}function lt(i,f){let m=i/f,h=Math.round(m),_=Number.EPSILON*Math.max(Math.abs(m),1);if(Math.abs(m-h)<_)return 0;return m-h}var pt=Symbol("evaluating");function T(i,f,m){let h=void 0;Object.defineProperty(i,f,{get(){if(h===pt)return;if(h===void 0)h=pt,h=m();return h},set(_){Object.defineProperty(i,f,{value:_})},configurable:!0})}function ce(i,f,m){Object.defineProperty(i,f,{value:m,writable:!0,enumerable:!0,configurable:!0})}function Q(...i){let f={};for(let m of i){let h=Object.getOwnPropertyDescriptors(m);Object.assign(f,h)}return Object.defineProperties({},f)}function cr(i){return JSON.stringify(i)}function ft(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ur="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function ge(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)}var dt=be(()=>{if(_e.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(i){return!1}});function ue(i){if(ge(i)===!1)return!1;let f=i.constructor;if(f===void 0)return!0;if(typeof f!=="function")return!0;let m=f.prototype;if(ge(m)===!1)return!1;if(Object.prototype.hasOwnProperty.call(m,"isPrototypeOf")===!1)return!1;return!0}function ar(i){if(ue(i))return{...i};if(Array.isArray(i))return[...i];if(i instanceof Map)return new Map(i);if(i instanceof Set)return new Set(i);return i}var mt=new Set(["string","number","symbol"]);function ee(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(i,f,m){let h=new i._zod.constr(f??i._zod.def);if(!f||m?.parent)h._zod.parent=i;return h}function P(i){let f=i;if(!f)return{};if(typeof f==="string")return{error:()=>f};if(f?.message!==void 0){if(f?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");f.error=f.message}if(delete f.message,typeof f.error==="string")return{...f,error:()=>f.error};return f}function pe(i){if(typeof i==="bigint")return i.toString()+"n";if(typeof i==="string")return`"${i}"`;return`${i}`}function ht(i){return Object.keys(i).filter((f)=>i[f]._zod.optin==="optional"&&i[f]._zod.optout==="optional")}var _t={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 ei(i,f){let m=i._zod.def,h=m.checks;if(h&&h.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let g=Q(i._zod.def,{get shape(){let z={};for(let v in f){if(!(v in m.shape))throw Error(`Unrecognized key: "${v}"`);if(!f[v])continue;z[v]=m.shape[v]}return ce(this,"shape",z),z},checks:[]});return Y(i,g)}function ri(i,f){let m=i._zod.def,h=m.checks;if(h&&h.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let g=Q(i._zod.def,{get shape(){let z={...i._zod.def.shape};for(let v in f){if(!(v in m.shape))throw Error(`Unrecognized key: "${v}"`);if(!f[v])continue;delete z[v]}return ce(this,"shape",z),z},checks:[]});return Y(i,g)}function ti(i,f){if(!ue(f))throw Error("Invalid input to extend: expected a plain object");let m=i._zod.def.checks;if(m&&m.length>0){let g=i._zod.def.shape;for(let z in f)if(Object.getOwnPropertyDescriptor(g,z)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let _=Q(i._zod.def,{get shape(){let g={...i._zod.def.shape,...f};return ce(this,"shape",g),g}});return Y(i,_)}function oi(i,f){if(!ue(f))throw Error("Invalid input to safeExtend: expected a plain object");let m=Q(i._zod.def,{get shape(){let h={...i._zod.def.shape,...f};return ce(this,"shape",h),h}});return Y(i,m)}function ni(i,f){if(i._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let m=Q(i._zod.def,{get shape(){let h={...i._zod.def.shape,...f._zod.def.shape};return ce(this,"shape",h),h},get catchall(){return f._zod.def.catchall},checks:f._zod.def.checks??[]});return Y(i,m)}function si(i,f,m){let _=f._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let z=Q(f._zod.def,{get shape(){let v=f._zod.def.shape,b={...v};if(m)for(let w in m){if(!(w in v))throw Error(`Unrecognized key: "${w}"`);if(!m[w])continue;b[w]=i?new i({type:"optional",innerType:v[w]}):v[w]}else for(let w in v)b[w]=i?new i({type:"optional",innerType:v[w]}):v[w];return ce(this,"shape",b),b},checks:[]});return Y(f,z)}function ii(i,f,m){let h=Q(f._zod.def,{get shape(){let _=f._zod.def.shape,g={..._};if(m)for(let z in m){if(!(z in g))throw Error(`Unrecognized key: "${z}"`);if(!m[z])continue;g[z]=new i({type:"nonoptional",innerType:_[z]})}else for(let z in _)g[z]=new i({type:"nonoptional",innerType:_[z]});return ce(this,"shape",g),g}});return Y(f,h)}function ae(i,f=0){if(i.aborted===!0)return!0;for(let m=f;m<i.issues.length;m++)if(i.issues[m]?.continue!==!0)return!0;return!1}function gt(i,f=0){if(i.aborted===!0)return!0;for(let m=f;m<i.issues.length;m++)if(i.issues[m]?.continue===!1)return!0;return!1}function te(i,f){return f.map((m)=>{var h;return(h=m).path??(h.path=[]),m.path.unshift(i),m})}function Le(i){return typeof i==="string"?i:i?.message}function G(i,f,m){let h=i.message?i.message:Le(i.inst?._zod.def?.error?.(i))??Le(f?.error?.(i))??Le(m.customError?.(i))??Le(m.localeError?.(i))??"Invalid input",{inst:_,continue:g,input:z,...v}=i;if(v.path??(v.path=[]),v.message=h,f?.reportInput)v.input=z;return v}function Je(i){if(Array.isArray(i))return"array";if(typeof i==="string")return"string";return"unknown"}function ke(i){let f=typeof i;switch(f){case"number":return Number.isNaN(i)?"nan":"number";case"object":{if(i===null)return"null";if(Array.isArray(i))return"array";let m=i;if(m&&Object.getPrototypeOf(m)!==Object.prototype&&"constructor"in m&&m.constructor)return m.constructor.name}}return f}function le(...i){let[f,m,h]=i;if(typeof f==="string")return{message:f,code:"custom",input:m,inst:h};return{...f}}var xt=(i,f)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:f,enumerable:!1}),i.message=JSON.stringify(f,$e,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Be=k("$ZodError",xt),pr=k("$ZodError",xt,{Parent:Error});function zt(i,f=(m)=>m.message){let m={},h=[];for(let _ of i.issues)if(_.path.length>0)m[_.path[0]]=m[_.path[0]]||[],m[_.path[0]].push(f(_));else h.push(f(_));return{formErrors:h,fieldErrors:m}}function vt(i,f=(m)=>m.message){let m={_errors:[]},h=(_,g=[])=>{for(let z of _.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((v)=>h({issues:v},[...g,...z.path]));else if(z.code==="invalid_key")h({issues:z.issues},[...g,...z.path]);else if(z.code==="invalid_element")h({issues:z.issues},[...g,...z.path]);else{let v=[...g,...z.path];if(v.length===0)m._errors.push(f(z));else{let b=m,w=0;while(w<v.length){let Z=v[w];if(w!==v.length-1)b[Z]=b[Z]||{_errors:[]};else b[Z]=b[Z]||{_errors:[]},b[Z]._errors.push(f(z));b=b[Z],w++}}}};return h(i),m}function ci(i){let f=[],m=i.map((h)=>typeof h==="object"?h.key:h);for(let h of m)if(typeof h==="number")f.push(`[${h}]`);else if(typeof h==="symbol")f.push(`[${JSON.stringify(String(h))}]`);else if(/[^\w$]/.test(h))f.push(`[${JSON.stringify(h)}]`);else{if(f.length)f.push(".");f.push(h)}return f.join("")}function Oe(i){let f=[],m=[...i.issues].sort((h,_)=>(h.path??[]).length-(_.path??[]).length);for(let h of m)if(f.push(`✖ ${h.message}`),h.path?.length)f.push(` → at ${ci(h.path)}`);return f.join(`
2
- `)}var Ve=(i)=>(f,m,h,_)=>{let g=h?{...h,async:!1}:{async:!1},z=f._zod.run({value:m,issues:[]},g);if(z instanceof Promise)throw new X;if(z.issues.length){let v=new(_?.Err??i)(z.issues.map((b)=>G(b,g,y())));throw ur(v,_?.callee),v}return z.value};var We=(i)=>async(f,m,h,_)=>{let g=h?{...h,async:!0}:{async:!0},z=f._zod.run({value:m,issues:[]},g);if(z instanceof Promise)z=await z;if(z.issues.length){let v=new(_?.Err??i)(z.issues.map((b)=>G(b,g,y())));throw ur(v,_?.callee),v}return z.value};var we=(i)=>(f,m,h)=>{let _=h?{...h,async:!1}:{async:!1},g=f._zod.run({value:m,issues:[]},_);if(g instanceof Promise)throw new X;return g.issues.length?{success:!1,error:new(i??Be)(g.issues.map((z)=>G(z,_,y())))}:{success:!0,data:g.value}},yt=we(pr),Ze=(i)=>async(f,m,h)=>{let _=h?{...h,async:!0}:{async:!0},g=f._zod.run({value:m,issues:[]},_);if(g instanceof Promise)g=await g;return g.issues.length?{success:!1,error:new i(g.issues.map((z)=>G(z,_,y())))}:{success:!0,data:g.value}},$t=Ze(pr),bt=(i)=>(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return Ve(i)(f,m,_)};var wt=(i)=>(f,m,h)=>Ve(i)(f,m,h);var kt=(i)=>async(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return We(i)(f,m,_)};var Zt=(i)=>async(f,m,h)=>We(i)(f,m,h);var Pt=(i)=>(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return we(i)(f,m,_)};var St=(i)=>(f,m,h)=>we(i)(f,m,h);var Ot=(i)=>async(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return Ze(i)(f,m,_)};var Et=(i)=>async(f,m,h)=>Ze(i)(f,m,h);var It=/^[cC][0-9a-z]{6,}$/,Tt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,At=/^[0-9a-vA-V]{20}$/,jt=/^[A-Za-z0-9]{27}$/,Ct=/^[a-zA-Z0-9_-]{21}$/,Rt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Dt=/^([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})$/,lr=(i)=>{if(!i)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}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Lt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ai="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ft(){return new RegExp(ai,"u")}var Ut=/^(?:(?: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])$/,Mt=/^(([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 Jt=/^((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])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fr=/^[A-Za-z0-9_-]*$/;var Wt=/^https?$/,Kt=/^\+[1-9]\d{6,14}$/,Gt="(?:(?:\\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])))",qt=new RegExp(`^${Gt}$`);function Yt(i){return typeof i.precision==="number"?i.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":i.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{${i.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xt(i){return new RegExp(`^${Yt(i)}$`)}function Ht(i){let f=Yt({precision:i.precision}),m=["Z"];if(i.local)m.push("");if(i.offset)m.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let h=`${f}(?:${m.join("|")})`;return new RegExp(`^${Gt}T(?:${h})$`)}var Qt=(i)=>{let f=i?`[\\s\\S]{${i?.minimum??0},${i?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${f}$`)};var eo=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,ro=/^(?:true|false)$/i,to=/^null$/i;var oo=/^[^A-Z]*$/,no=/^[^a-z]*$/;var V=k("$ZodCheck",(i,f)=>{var m;i._zod??(i._zod={}),i._zod.def=f,(m=i._zod).onattach??(m.onattach=[])}),so={number:"number",bigint:"bigint",object:"date"},mr=k("$ZodCheckLessThan",(i,f)=>{V.init(i,f);let m=so[typeof f.value];i._zod.onattach.push((h)=>{let _=h._zod.bag,g=(f.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(f.value<g)if(f.inclusive)_.maximum=f.value;else _.exclusiveMaximum=f.value}),i._zod.check=(h)=>{if(f.inclusive?h.value<=f.value:h.value<f.value)return;h.issues.push({origin:m,code:"too_big",maximum:typeof f.value==="object"?f.value.getTime():f.value,input:h.value,inclusive:f.inclusive,inst:i,continue:!f.abort})}}),hr=k("$ZodCheckGreaterThan",(i,f)=>{V.init(i,f);let m=so[typeof f.value];i._zod.onattach.push((h)=>{let _=h._zod.bag,g=(f.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(f.value>g)if(f.inclusive)_.minimum=f.value;else _.exclusiveMinimum=f.value}),i._zod.check=(h)=>{if(f.inclusive?h.value>=f.value:h.value>f.value)return;h.issues.push({origin:m,code:"too_small",minimum:typeof f.value==="object"?f.value.getTime():f.value,input:h.value,inclusive:f.inclusive,inst:i,continue:!f.abort})}}),io=k("$ZodCheckMultipleOf",(i,f)=>{V.init(i,f),i._zod.onattach.push((m)=>{var h;(h=m._zod.bag).multipleOf??(h.multipleOf=f.value)}),i._zod.check=(m)=>{if(typeof m.value!==typeof f.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof m.value==="bigint"?m.value%f.value===BigInt(0):lt(m.value,f.value)===0)return;m.issues.push({origin:typeof m.value,code:"not_multiple_of",divisor:f.value,input:m.value,inst:i,continue:!f.abort})}}),co=k("$ZodCheckNumberFormat",(i,f)=>{V.init(i,f),f.format=f.format||"float64";let m=f.format?.includes("int"),h=m?"int":"number",[_,g]=_t[f.format];i._zod.onattach.push((z)=>{let v=z._zod.bag;if(v.format=f.format,v.minimum=_,v.maximum=g,m)v.pattern=eo}),i._zod.check=(z)=>{let v=z.value;if(m){if(!Number.isInteger(v)){z.issues.push({expected:h,format:f.format,code:"invalid_type",continue:!1,input:v,inst:i});return}if(!Number.isSafeInteger(v)){if(v>0)z.issues.push({input:v,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:h,inclusive:!0,continue:!f.abort});else z.issues.push({input:v,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:h,inclusive:!0,continue:!f.abort});return}}if(v<_)z.issues.push({origin:"number",input:v,code:"too_small",minimum:_,inclusive:!0,inst:i,continue:!f.abort});if(v>g)z.issues.push({origin:"number",input:v,code:"too_big",maximum:g,inclusive:!0,inst:i,continue:!f.abort})}});var uo=k("$ZodCheckMaxLength",(i,f)=>{var m;V.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag.maximum??Number.POSITIVE_INFINITY;if(f.maximum<_)h._zod.bag.maximum=f.maximum}),i._zod.check=(h)=>{let _=h.value;if(_.length<=f.maximum)return;let z=Je(_);h.issues.push({origin:z,code:"too_big",maximum:f.maximum,inclusive:!0,input:_,inst:i,continue:!f.abort})}}),ao=k("$ZodCheckMinLength",(i,f)=>{var m;V.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(f.minimum>_)h._zod.bag.minimum=f.minimum}),i._zod.check=(h)=>{let _=h.value;if(_.length>=f.minimum)return;let z=Je(_);h.issues.push({origin:z,code:"too_small",minimum:f.minimum,inclusive:!0,input:_,inst:i,continue:!f.abort})}}),po=k("$ZodCheckLengthEquals",(i,f)=>{var m;V.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.minimum=f.length,_.maximum=f.length,_.length=f.length}),i._zod.check=(h)=>{let _=h.value,g=_.length;if(g===f.length)return;let z=Je(_),v=g>f.length;h.issues.push({origin:z,...v?{code:"too_big",maximum:f.length}:{code:"too_small",minimum:f.length},inclusive:!0,exact:!0,input:h.value,inst:i,continue:!f.abort})}}),Pe=k("$ZodCheckStringFormat",(i,f)=>{var m,h;if(V.init(i,f),i._zod.onattach.push((_)=>{let g=_._zod.bag;if(g.format=f.format,f.pattern)g.patterns??(g.patterns=new Set),g.patterns.add(f.pattern)}),f.pattern)(m=i._zod).check??(m.check=(_)=>{if(f.pattern.lastIndex=0,f.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:f.format,input:_.value,...f.pattern?{pattern:f.pattern.toString()}:{},inst:i,continue:!f.abort})});else(h=i._zod).check??(h.check=()=>{})}),lo=k("$ZodCheckRegex",(i,f)=>{Pe.init(i,f),i._zod.check=(m)=>{if(f.pattern.lastIndex=0,f.pattern.test(m.value))return;m.issues.push({origin:"string",code:"invalid_format",format:"regex",input:m.value,pattern:f.pattern.toString(),inst:i,continue:!f.abort})}}),fo=k("$ZodCheckLowerCase",(i,f)=>{f.pattern??(f.pattern=oo),Pe.init(i,f)}),mo=k("$ZodCheckUpperCase",(i,f)=>{f.pattern??(f.pattern=no),Pe.init(i,f)}),ho=k("$ZodCheckIncludes",(i,f)=>{V.init(i,f);let m=ee(f.includes),h=new RegExp(typeof f.position==="number"?`^.{${f.position}}${m}`:m);f.pattern=h,i._zod.onattach.push((_)=>{let g=_._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(h)}),i._zod.check=(_)=>{if(_.value.includes(f.includes,f.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:f.includes,input:_.value,inst:i,continue:!f.abort})}}),_o=k("$ZodCheckStartsWith",(i,f)=>{V.init(i,f);let m=new RegExp(`^${ee(f.prefix)}.*`);f.pattern??(f.pattern=m),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(m)}),i._zod.check=(h)=>{if(h.value.startsWith(f.prefix))return;h.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:f.prefix,input:h.value,inst:i,continue:!f.abort})}}),go=k("$ZodCheckEndsWith",(i,f)=>{V.init(i,f);let m=new RegExp(`.*${ee(f.suffix)}$`);f.pattern??(f.pattern=m),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(m)}),i._zod.check=(h)=>{if(h.value.endsWith(f.suffix))return;h.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:f.suffix,input:h.value,inst:i,continue:!f.abort})}});var xo=k("$ZodCheckOverwrite",(i,f)=>{V.init(i,f),i._zod.check=(m)=>{m.value=f.tx(m.value)}});class _r{constructor(i=[]){if(this.content=[],this.indent=0,this)this.args=i}indented(i){this.indent+=1,i(this),this.indent-=1}write(i){if(typeof i==="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}let m=i.split(`
1
+ var at,Ce=Object.freeze({status:"aborted"});function w(i,f,m){function h(v,y){if(!v._zod)Object.defineProperty(v,"_zod",{value:{def:y,constr:z,traits:new Set},enumerable:!1});if(v._zod.traits.has(i))return;v._zod.traits.add(i),f(v,y);let b=z.prototype,Z=Object.keys(b);for(let O=0;O<Z.length;O++){let I=Z[O];if(!(I in v))v[I]=b[I].bind(v)}}let _=m?.Parent??Object;class g extends _{}Object.defineProperty(g,"name",{value:i});function z(v){var y;let b=m?.Parent?new g:this;h(b,v),(y=b._zod).deferred??(y.deferred=[]);for(let Z of b._zod.deferred)Z();return b}return Object.defineProperty(z,"init",{value:h}),Object.defineProperty(z,Symbol.hasInstance,{value:(v)=>{if(m?.Parent&&v instanceof m.Parent)return!0;return v?._zod?.traits?.has(i)}}),Object.defineProperty(z,"name",{value:i}),z}var yc=Symbol("zod_brand");class X extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ye extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`);this.name="ZodEncodeError"}}(at=globalThis).__zod_globalConfig??(at.__zod_globalConfig={});var _e=globalThis.__zod_globalConfig;function S(i){if(i)Object.assign(_e,i);return _e}function Fe(i){let f=Object.values(i).filter((h)=>typeof h==="number");return Object.entries(i).filter(([h,_])=>f.indexOf(+h)===-1).map(([h,_])=>_)}function de(i,f="|"){return i.map((m)=>pe(m)).join(f)}function $e(i,f){if(typeof f==="bigint")return f.toString();return f}function be(i){return{get value(){{let m=i();return Object.defineProperty(this,"value",{value:m}),m}throw Error("cached value already set")}}}function Ue(i){return i===null||i===void 0}function Me(i){let f=i.startsWith("^")?1:0,m=i.endsWith("$")?i.length-1:i.length;return i.slice(f,m)}function lt(i,f){let m=i/f,h=Math.round(m),_=Number.EPSILON*Math.max(Math.abs(m),1);if(Math.abs(m-h)<_)return 0;return m-h}var pt=Symbol("evaluating");function T(i,f,m){let h=void 0;Object.defineProperty(i,f,{get(){if(h===pt)return;if(h===void 0)h=pt,h=m();return h},set(_){Object.defineProperty(i,f,{value:_})},configurable:!0})}function ce(i,f,m){Object.defineProperty(i,f,{value:m,writable:!0,enumerable:!0,configurable:!0})}function Q(...i){let f={};for(let m of i){let h=Object.getOwnPropertyDescriptors(m);Object.assign(f,h)}return Object.defineProperties({},f)}function cr(i){return JSON.stringify(i)}function ft(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ur="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function ge(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)}var dt=be(()=>{if(_e.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(i){return!1}});function ue(i){if(ge(i)===!1)return!1;let f=i.constructor;if(f===void 0)return!0;if(typeof f!=="function")return!0;let m=f.prototype;if(ge(m)===!1)return!1;if(Object.prototype.hasOwnProperty.call(m,"isPrototypeOf")===!1)return!1;return!0}function ar(i){if(ue(i))return{...i};if(Array.isArray(i))return[...i];if(i instanceof Map)return new Map(i);if(i instanceof Set)return new Set(i);return i}var mt=new Set(["string","number","symbol"]);function ee(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(i,f,m){let h=new i._zod.constr(f??i._zod.def);if(!f||m?.parent)h._zod.parent=i;return h}function P(i){let f=i;if(!f)return{};if(typeof f==="string")return{error:()=>f};if(f?.message!==void 0){if(f?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");f.error=f.message}if(delete f.message,typeof f.error==="string")return{...f,error:()=>f.error};return f}function pe(i){if(typeof i==="bigint")return i.toString()+"n";if(typeof i==="string")return`"${i}"`;return`${i}`}function ht(i){return Object.keys(i).filter((f)=>i[f]._zod.optin==="optional"&&i[f]._zod.optout==="optional")}var _t={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 ei(i,f){let m=i._zod.def,h=m.checks;if(h&&h.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let g=Q(i._zod.def,{get shape(){let z={};for(let v in f){if(!(v in m.shape))throw Error(`Unrecognized key: "${v}"`);if(!f[v])continue;z[v]=m.shape[v]}return ce(this,"shape",z),z},checks:[]});return Y(i,g)}function ri(i,f){let m=i._zod.def,h=m.checks;if(h&&h.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let g=Q(i._zod.def,{get shape(){let z={...i._zod.def.shape};for(let v in f){if(!(v in m.shape))throw Error(`Unrecognized key: "${v}"`);if(!f[v])continue;delete z[v]}return ce(this,"shape",z),z},checks:[]});return Y(i,g)}function ti(i,f){if(!ue(f))throw Error("Invalid input to extend: expected a plain object");let m=i._zod.def.checks;if(m&&m.length>0){let g=i._zod.def.shape;for(let z in f)if(Object.getOwnPropertyDescriptor(g,z)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let _=Q(i._zod.def,{get shape(){let g={...i._zod.def.shape,...f};return ce(this,"shape",g),g}});return Y(i,_)}function oi(i,f){if(!ue(f))throw Error("Invalid input to safeExtend: expected a plain object");let m=Q(i._zod.def,{get shape(){let h={...i._zod.def.shape,...f};return ce(this,"shape",h),h}});return Y(i,m)}function ni(i,f){if(i._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let m=Q(i._zod.def,{get shape(){let h={...i._zod.def.shape,...f._zod.def.shape};return ce(this,"shape",h),h},get catchall(){return f._zod.def.catchall},checks:f._zod.def.checks??[]});return Y(i,m)}function si(i,f,m){let _=f._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let z=Q(f._zod.def,{get shape(){let v=f._zod.def.shape,y={...v};if(m)for(let b in m){if(!(b in v))throw Error(`Unrecognized key: "${b}"`);if(!m[b])continue;y[b]=i?new i({type:"optional",innerType:v[b]}):v[b]}else for(let b in v)y[b]=i?new i({type:"optional",innerType:v[b]}):v[b];return ce(this,"shape",y),y},checks:[]});return Y(f,z)}function ii(i,f,m){let h=Q(f._zod.def,{get shape(){let _=f._zod.def.shape,g={..._};if(m)for(let z in m){if(!(z in g))throw Error(`Unrecognized key: "${z}"`);if(!m[z])continue;g[z]=new i({type:"nonoptional",innerType:_[z]})}else for(let z in _)g[z]=new i({type:"nonoptional",innerType:_[z]});return ce(this,"shape",g),g}});return Y(f,h)}function ae(i,f=0){if(i.aborted===!0)return!0;for(let m=f;m<i.issues.length;m++)if(i.issues[m]?.continue!==!0)return!0;return!1}function gt(i,f=0){if(i.aborted===!0)return!0;for(let m=f;m<i.issues.length;m++)if(i.issues[m]?.continue===!1)return!0;return!1}function te(i,f){return f.map((m)=>{var h;return(h=m).path??(h.path=[]),m.path.unshift(i),m})}function Le(i){return typeof i==="string"?i:i?.message}function K(i,f,m){let h=i.message?i.message:Le(i.inst?._zod.def?.error?.(i))??Le(f?.error?.(i))??Le(m.customError?.(i))??Le(m.localeError?.(i))??"Invalid input",{inst:_,continue:g,input:z,...v}=i;if(v.path??(v.path=[]),v.message=h,f?.reportInput)v.input=z;return v}function Je(i){if(Array.isArray(i))return"array";if(typeof i==="string")return"string";return"unknown"}function ke(i){let f=typeof i;switch(f){case"number":return Number.isNaN(i)?"nan":"number";case"object":{if(i===null)return"null";if(Array.isArray(i))return"array";let m=i;if(m&&Object.getPrototypeOf(m)!==Object.prototype&&"constructor"in m&&m.constructor)return m.constructor.name}}return f}function le(...i){let[f,m,h]=i;if(typeof f==="string")return{message:f,code:"custom",input:m,inst:h};return{...f}}var xt=(i,f)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:f,enumerable:!1}),i.message=JSON.stringify(f,$e,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Be=w("$ZodError",xt),pr=w("$ZodError",xt,{Parent:Error});function zt(i,f=(m)=>m.message){let m={},h=[];for(let _ of i.issues)if(_.path.length>0)m[_.path[0]]=m[_.path[0]]||[],m[_.path[0]].push(f(_));else h.push(f(_));return{formErrors:h,fieldErrors:m}}function vt(i,f=(m)=>m.message){let m={_errors:[]},h=(_,g=[])=>{for(let z of _.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((v)=>h({issues:v},[...g,...z.path]));else if(z.code==="invalid_key")h({issues:z.issues},[...g,...z.path]);else if(z.code==="invalid_element")h({issues:z.issues},[...g,...z.path]);else{let v=[...g,...z.path];if(v.length===0)m._errors.push(f(z));else{let y=m,b=0;while(b<v.length){let Z=v[b];if(b!==v.length-1)y[Z]=y[Z]||{_errors:[]};else y[Z]=y[Z]||{_errors:[]},y[Z]._errors.push(f(z));y=y[Z],b++}}}};return h(i),m}function ci(i){let f=[],m=i.map((h)=>typeof h==="object"?h.key:h);for(let h of m)if(typeof h==="number")f.push(`[${h}]`);else if(typeof h==="symbol")f.push(`[${JSON.stringify(String(h))}]`);else if(/[^\w$]/.test(h))f.push(`[${JSON.stringify(h)}]`);else{if(f.length)f.push(".");f.push(h)}return f.join("")}function Oe(i){let f=[],m=[...i.issues].sort((h,_)=>(h.path??[]).length-(_.path??[]).length);for(let h of m)if(f.push(`✖ ${h.message}`),h.path?.length)f.push(` → at ${ci(h.path)}`);return f.join(`
2
+ `)}var Ve=(i)=>(f,m,h,_)=>{let g=h?{...h,async:!1}:{async:!1},z=f._zod.run({value:m,issues:[]},g);if(z instanceof Promise)throw new X;if(z.issues.length){let v=new(_?.Err??i)(z.issues.map((y)=>K(y,g,S())));throw ur(v,_?.callee),v}return z.value};var We=(i)=>async(f,m,h,_)=>{let g=h?{...h,async:!0}:{async:!0},z=f._zod.run({value:m,issues:[]},g);if(z instanceof Promise)z=await z;if(z.issues.length){let v=new(_?.Err??i)(z.issues.map((y)=>K(y,g,S())));throw ur(v,_?.callee),v}return z.value};var we=(i)=>(f,m,h)=>{let _=h?{...h,async:!1}:{async:!1},g=f._zod.run({value:m,issues:[]},_);if(g instanceof Promise)throw new X;return g.issues.length?{success:!1,error:new(i??Be)(g.issues.map((z)=>K(z,_,S())))}:{success:!0,data:g.value}},yt=we(pr),Ze=(i)=>async(f,m,h)=>{let _=h?{...h,async:!0}:{async:!0},g=f._zod.run({value:m,issues:[]},_);if(g instanceof Promise)g=await g;return g.issues.length?{success:!1,error:new i(g.issues.map((z)=>K(z,_,S())))}:{success:!0,data:g.value}},$t=Ze(pr),bt=(i)=>(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return Ve(i)(f,m,_)};var wt=(i)=>(f,m,h)=>Ve(i)(f,m,h);var kt=(i)=>async(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return We(i)(f,m,_)};var Zt=(i)=>async(f,m,h)=>We(i)(f,m,h);var Pt=(i)=>(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return we(i)(f,m,_)};var St=(i)=>(f,m,h)=>we(i)(f,m,h);var Ot=(i)=>async(f,m,h)=>{let _=h?{...h,direction:"backward"}:{direction:"backward"};return Ze(i)(f,m,_)};var Et=(i)=>async(f,m,h)=>Ze(i)(f,m,h);var It=/^[cC][0-9a-z]{6,}$/,Tt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,At=/^[0-9a-vA-V]{20}$/,jt=/^[A-Za-z0-9]{27}$/,Ct=/^[a-zA-Z0-9_-]{21}$/,Rt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Dt=/^([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})$/,lr=(i)=>{if(!i)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}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Lt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ai="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ft(){return new RegExp(ai,"u")}var Ut=/^(?:(?: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])$/,Mt=/^(([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 Jt=/^((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])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fr=/^[A-Za-z0-9_-]*$/;var Wt=/^https?$/,Kt=/^\+[1-9]\d{6,14}$/,Gt="(?:(?:\\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])))",qt=new RegExp(`^${Gt}$`);function Yt(i){return typeof i.precision==="number"?i.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":i.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{${i.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xt(i){return new RegExp(`^${Yt(i)}$`)}function Ht(i){let f=Yt({precision:i.precision}),m=["Z"];if(i.local)m.push("");if(i.offset)m.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let h=`${f}(?:${m.join("|")})`;return new RegExp(`^${Gt}T(?:${h})$`)}var Qt=(i)=>{let f=i?`[\\s\\S]{${i?.minimum??0},${i?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${f}$`)};var eo=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,ro=/^(?:true|false)$/i,to=/^null$/i;var oo=/^[^A-Z]*$/,no=/^[^a-z]*$/;var B=w("$ZodCheck",(i,f)=>{var m;i._zod??(i._zod={}),i._zod.def=f,(m=i._zod).onattach??(m.onattach=[])}),so={number:"number",bigint:"bigint",object:"date"},mr=w("$ZodCheckLessThan",(i,f)=>{B.init(i,f);let m=so[typeof f.value];i._zod.onattach.push((h)=>{let _=h._zod.bag,g=(f.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(f.value<g)if(f.inclusive)_.maximum=f.value;else _.exclusiveMaximum=f.value}),i._zod.check=(h)=>{if(f.inclusive?h.value<=f.value:h.value<f.value)return;h.issues.push({origin:m,code:"too_big",maximum:typeof f.value==="object"?f.value.getTime():f.value,input:h.value,inclusive:f.inclusive,inst:i,continue:!f.abort})}}),hr=w("$ZodCheckGreaterThan",(i,f)=>{B.init(i,f);let m=so[typeof f.value];i._zod.onattach.push((h)=>{let _=h._zod.bag,g=(f.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(f.value>g)if(f.inclusive)_.minimum=f.value;else _.exclusiveMinimum=f.value}),i._zod.check=(h)=>{if(f.inclusive?h.value>=f.value:h.value>f.value)return;h.issues.push({origin:m,code:"too_small",minimum:typeof f.value==="object"?f.value.getTime():f.value,input:h.value,inclusive:f.inclusive,inst:i,continue:!f.abort})}}),io=w("$ZodCheckMultipleOf",(i,f)=>{B.init(i,f),i._zod.onattach.push((m)=>{var h;(h=m._zod.bag).multipleOf??(h.multipleOf=f.value)}),i._zod.check=(m)=>{if(typeof m.value!==typeof f.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof m.value==="bigint"?m.value%f.value===BigInt(0):lt(m.value,f.value)===0)return;m.issues.push({origin:typeof m.value,code:"not_multiple_of",divisor:f.value,input:m.value,inst:i,continue:!f.abort})}}),co=w("$ZodCheckNumberFormat",(i,f)=>{B.init(i,f),f.format=f.format||"float64";let m=f.format?.includes("int"),h=m?"int":"number",[_,g]=_t[f.format];i._zod.onattach.push((z)=>{let v=z._zod.bag;if(v.format=f.format,v.minimum=_,v.maximum=g,m)v.pattern=eo}),i._zod.check=(z)=>{let v=z.value;if(m){if(!Number.isInteger(v)){z.issues.push({expected:h,format:f.format,code:"invalid_type",continue:!1,input:v,inst:i});return}if(!Number.isSafeInteger(v)){if(v>0)z.issues.push({input:v,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:h,inclusive:!0,continue:!f.abort});else z.issues.push({input:v,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:h,inclusive:!0,continue:!f.abort});return}}if(v<_)z.issues.push({origin:"number",input:v,code:"too_small",minimum:_,inclusive:!0,inst:i,continue:!f.abort});if(v>g)z.issues.push({origin:"number",input:v,code:"too_big",maximum:g,inclusive:!0,inst:i,continue:!f.abort})}});var uo=w("$ZodCheckMaxLength",(i,f)=>{var m;B.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag.maximum??Number.POSITIVE_INFINITY;if(f.maximum<_)h._zod.bag.maximum=f.maximum}),i._zod.check=(h)=>{let _=h.value;if(_.length<=f.maximum)return;let z=Je(_);h.issues.push({origin:z,code:"too_big",maximum:f.maximum,inclusive:!0,input:_,inst:i,continue:!f.abort})}}),ao=w("$ZodCheckMinLength",(i,f)=>{var m;B.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(f.minimum>_)h._zod.bag.minimum=f.minimum}),i._zod.check=(h)=>{let _=h.value;if(_.length>=f.minimum)return;let z=Je(_);h.issues.push({origin:z,code:"too_small",minimum:f.minimum,inclusive:!0,input:_,inst:i,continue:!f.abort})}}),po=w("$ZodCheckLengthEquals",(i,f)=>{var m;B.init(i,f),(m=i._zod.def).when??(m.when=(h)=>{let _=h.value;return!Ue(_)&&_.length!==void 0}),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.minimum=f.length,_.maximum=f.length,_.length=f.length}),i._zod.check=(h)=>{let _=h.value,g=_.length;if(g===f.length)return;let z=Je(_),v=g>f.length;h.issues.push({origin:z,...v?{code:"too_big",maximum:f.length}:{code:"too_small",minimum:f.length},inclusive:!0,exact:!0,input:h.value,inst:i,continue:!f.abort})}}),Pe=w("$ZodCheckStringFormat",(i,f)=>{var m,h;if(B.init(i,f),i._zod.onattach.push((_)=>{let g=_._zod.bag;if(g.format=f.format,f.pattern)g.patterns??(g.patterns=new Set),g.patterns.add(f.pattern)}),f.pattern)(m=i._zod).check??(m.check=(_)=>{if(f.pattern.lastIndex=0,f.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:f.format,input:_.value,...f.pattern?{pattern:f.pattern.toString()}:{},inst:i,continue:!f.abort})});else(h=i._zod).check??(h.check=()=>{})}),lo=w("$ZodCheckRegex",(i,f)=>{Pe.init(i,f),i._zod.check=(m)=>{if(f.pattern.lastIndex=0,f.pattern.test(m.value))return;m.issues.push({origin:"string",code:"invalid_format",format:"regex",input:m.value,pattern:f.pattern.toString(),inst:i,continue:!f.abort})}}),fo=w("$ZodCheckLowerCase",(i,f)=>{f.pattern??(f.pattern=oo),Pe.init(i,f)}),mo=w("$ZodCheckUpperCase",(i,f)=>{f.pattern??(f.pattern=no),Pe.init(i,f)}),ho=w("$ZodCheckIncludes",(i,f)=>{B.init(i,f);let m=ee(f.includes),h=new RegExp(typeof f.position==="number"?`^.{${f.position}}${m}`:m);f.pattern=h,i._zod.onattach.push((_)=>{let g=_._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(h)}),i._zod.check=(_)=>{if(_.value.includes(f.includes,f.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:f.includes,input:_.value,inst:i,continue:!f.abort})}}),_o=w("$ZodCheckStartsWith",(i,f)=>{B.init(i,f);let m=new RegExp(`^${ee(f.prefix)}.*`);f.pattern??(f.pattern=m),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(m)}),i._zod.check=(h)=>{if(h.value.startsWith(f.prefix))return;h.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:f.prefix,input:h.value,inst:i,continue:!f.abort})}}),go=w("$ZodCheckEndsWith",(i,f)=>{B.init(i,f);let m=new RegExp(`.*${ee(f.suffix)}$`);f.pattern??(f.pattern=m),i._zod.onattach.push((h)=>{let _=h._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(m)}),i._zod.check=(h)=>{if(h.value.endsWith(f.suffix))return;h.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:f.suffix,input:h.value,inst:i,continue:!f.abort})}});var xo=w("$ZodCheckOverwrite",(i,f)=>{B.init(i,f),i._zod.check=(m)=>{m.value=f.tx(m.value)}});class _r{constructor(i=[]){if(this.content=[],this.indent=0,this)this.args=i}indented(i){this.indent+=1,i(this),this.indent-=1}write(i){if(typeof i==="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}let m=i.split(`
3
3
  `).filter((g)=>g),h=Math.min(...m.map((g)=>g.length-g.trimStart().length)),_=m.map((g)=>g.slice(h)).map((g)=>" ".repeat(this.indent*2)+g);for(let g of _)this.content.push(g)}compile(){let i=Function,f=this?.args,h=[...(this?.content??[""]).map((_)=>` ${_}`)];return new i(...f,h.join(`
4
- `))}}var vo={major:4,minor:4,patch:3};var A=k("$ZodType",(i,f)=>{var m;i??(i={}),i._zod.def=f,i._zod.bag=i._zod.bag||{},i._zod.version=vo;let h=[...i._zod.def.checks??[]];if(i._zod.traits.has("$ZodCheck"))h.unshift(i);for(let _ of h)for(let g of _._zod.onattach)g(i);if(h.length===0)(m=i._zod).deferred??(m.deferred=[]),i._zod.deferred?.push(()=>{i._zod.run=i._zod.parse});else{let _=(z,v,b)=>{let w=ae(z),Z;for(let S of v){if(S._zod.def.when){if(gt(z))continue;if(!S._zod.def.when(z))continue}else if(w)continue;let E=z.issues.length,O=S._zod.check(z);if(O instanceof Promise&&b?.async===!1)throw new X;if(Z||O instanceof Promise)Z=(Z??Promise.resolve()).then(async()=>{if(await O,z.issues.length===E)return;if(!w)w=ae(z,E)});else{if(z.issues.length===E)continue;if(!w)w=ae(z,E)}}if(Z)return Z.then(()=>z);return z},g=(z,v,b)=>{if(ae(z))return z.aborted=!0,z;let w=_(v,h,b);if(w instanceof Promise){if(b.async===!1)throw new X;return w.then((Z)=>i._zod.parse(Z,b))}return i._zod.parse(w,b)};i._zod.run=(z,v)=>{if(v.skipChecks)return i._zod.parse(z,v);if(v.direction==="backward"){let w=i._zod.parse({value:z.value,issues:[]},{...v,skipChecks:!0});if(w instanceof Promise)return w.then((Z)=>g(Z,z,v));return g(w,z,v)}let b=i._zod.parse(z,v);if(b instanceof Promise){if(v.async===!1)throw new X;return b.then((w)=>_(w,h,v))}return _(b,h,v)}}T(i,"~standard",()=>({validate:(_)=>{try{let g=yt(i,_);return g.success?{value:g.data}:{issues:g.error?.issues}}catch(g){return $t(i,_).then((z)=>z.success?{value:z.data}:{issues:z.error?.issues})}},vendor:"zod",version:1}))}),Ye=k("$ZodString",(i,f)=>{A.init(i,f),i._zod.pattern=[...i?._zod.bag?.patterns??[]].pop()??Qt(i._zod.bag),i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=String(m.value)}catch(_){}if(typeof m.value==="string")return m;return m.issues.push({expected:"string",code:"invalid_type",input:m.value,inst:i}),m}}),F=k("$ZodStringFormat",(i,f)=>{Pe.init(i,f),Ye.init(i,f)}),Oo=k("$ZodGUID",(i,f)=>{f.pattern??(f.pattern=Dt),F.init(i,f)}),Eo=k("$ZodUUID",(i,f)=>{if(f.version){let h={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[f.version];if(h===void 0)throw Error(`Invalid UUID version: "${f.version}"`);f.pattern??(f.pattern=lr(h))}else f.pattern??(f.pattern=lr());F.init(i,f)}),Io=k("$ZodEmail",(i,f)=>{f.pattern??(f.pattern=Lt),F.init(i,f)}),To=k("$ZodURL",(i,f)=>{F.init(i,f),i._zod.check=(m)=>{try{let h=m.value.trim();if(!f.normalize&&f.protocol?.source===Wt.source){if(!/^https?:\/\//i.test(h)){m.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:m.value,inst:i,continue:!f.abort});return}}let _=new URL(h);if(f.hostname){if(f.hostname.lastIndex=0,!f.hostname.test(_.hostname))m.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:f.hostname.source,input:m.value,inst:i,continue:!f.abort})}if(f.protocol){if(f.protocol.lastIndex=0,!f.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))m.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:f.protocol.source,input:m.value,inst:i,continue:!f.abort})}if(f.normalize)m.value=_.href;else m.value=h;return}catch(h){m.issues.push({code:"invalid_format",format:"url",input:m.value,inst:i,continue:!f.abort})}}}),No=k("$ZodEmoji",(i,f)=>{f.pattern??(f.pattern=Ft()),F.init(i,f)}),Ao=k("$ZodNanoID",(i,f)=>{f.pattern??(f.pattern=Ct),F.init(i,f)}),jo=k("$ZodCUID",(i,f)=>{f.pattern??(f.pattern=It),F.init(i,f)}),Co=k("$ZodCUID2",(i,f)=>{f.pattern??(f.pattern=Tt),F.init(i,f)}),Ro=k("$ZodULID",(i,f)=>{f.pattern??(f.pattern=Nt),F.init(i,f)}),Do=k("$ZodXID",(i,f)=>{f.pattern??(f.pattern=At),F.init(i,f)}),Lo=k("$ZodKSUID",(i,f)=>{f.pattern??(f.pattern=jt),F.init(i,f)}),Fo=k("$ZodISODateTime",(i,f)=>{f.pattern??(f.pattern=Ht(f)),F.init(i,f)}),Uo=k("$ZodISODate",(i,f)=>{f.pattern??(f.pattern=qt),F.init(i,f)}),Mo=k("$ZodISOTime",(i,f)=>{f.pattern??(f.pattern=Xt(f)),F.init(i,f)}),Jo=k("$ZodISODuration",(i,f)=>{f.pattern??(f.pattern=Rt),F.init(i,f)}),Bo=k("$ZodIPv4",(i,f)=>{f.pattern??(f.pattern=Ut),F.init(i,f),i._zod.bag.format="ipv4"}),Vo=k("$ZodIPv6",(i,f)=>{f.pattern??(f.pattern=Mt),F.init(i,f),i._zod.bag.format="ipv6",i._zod.check=(m)=>{try{new URL(`http://[${m.value}]`)}catch{m.issues.push({code:"invalid_format",format:"ipv6",input:m.value,inst:i,continue:!f.abort})}}});var Wo=k("$ZodCIDRv4",(i,f)=>{f.pattern??(f.pattern=Jt),F.init(i,f)}),Ko=k("$ZodCIDRv6",(i,f)=>{f.pattern??(f.pattern=Bt),F.init(i,f),i._zod.check=(m)=>{let h=m.value.split("/");try{if(h.length!==2)throw Error();let[_,g]=h;if(!g)throw Error();let z=Number(g);if(`${z}`!==g)throw Error();if(z<0||z>128)throw Error();new URL(`http://[${_}]`)}catch{m.issues.push({code:"invalid_format",format:"cidrv6",input:m.value,inst:i,continue:!f.abort})}}});function Go(i){if(i==="")return!0;if(/\s/.test(i))return!1;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}var qo=k("$ZodBase64",(i,f)=>{f.pattern??(f.pattern=Vt),F.init(i,f),i._zod.bag.contentEncoding="base64",i._zod.check=(m)=>{if(Go(m.value))return;m.issues.push({code:"invalid_format",format:"base64",input:m.value,inst:i,continue:!f.abort})}});function pi(i){if(!fr.test(i))return!1;let f=i.replace(/[-_]/g,(h)=>h==="-"?"+":"/"),m=f.padEnd(Math.ceil(f.length/4)*4,"=");return Go(m)}var Yo=k("$ZodBase64URL",(i,f)=>{f.pattern??(f.pattern=fr),F.init(i,f),i._zod.bag.contentEncoding="base64url",i._zod.check=(m)=>{if(pi(m.value))return;m.issues.push({code:"invalid_format",format:"base64url",input:m.value,inst:i,continue:!f.abort})}}),Xo=k("$ZodE164",(i,f)=>{f.pattern??(f.pattern=Kt),F.init(i,f)});function li(i,f=null){try{let m=i.split(".");if(m.length!==3)return!1;let[h]=m;if(!h)return!1;let _=JSON.parse(atob(h));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(f&&(!("alg"in _)||_.alg!==f))return!1;return!0}catch{return!1}}var Ho=k("$ZodJWT",(i,f)=>{F.init(i,f),i._zod.check=(m)=>{if(li(m.value,f.alg))return;m.issues.push({code:"invalid_format",format:"jwt",input:m.value,inst:i,continue:!f.abort})}});var xr=k("$ZodNumber",(i,f)=>{A.init(i,f),i._zod.pattern=i._zod.bag.pattern??dr,i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=Number(m.value)}catch(z){}let _=m.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return m;let g=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return m.issues.push({expected:"number",code:"invalid_type",input:_,inst:i,...g?{received:g}:{}}),m}}),Qo=k("$ZodNumberFormat",(i,f)=>{co.init(i,f),xr.init(i,f)}),en=k("$ZodBoolean",(i,f)=>{A.init(i,f),i._zod.pattern=ro,i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=Boolean(m.value)}catch(g){}let _=m.value;if(typeof _==="boolean")return m;return m.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:i}),m}});var rn=k("$ZodNull",(i,f)=>{A.init(i,f),i._zod.pattern=to,i._zod.values=new Set([null]),i._zod.parse=(m,h)=>{let _=m.value;if(_===null)return m;return m.issues.push({expected:"null",code:"invalid_type",input:_,inst:i}),m}}),tn=k("$ZodAny",(i,f)=>{A.init(i,f),i._zod.parse=(m)=>m}),on=k("$ZodUnknown",(i,f)=>{A.init(i,f),i._zod.parse=(m)=>m}),nn=k("$ZodNever",(i,f)=>{A.init(i,f),i._zod.parse=(m,h)=>(m.issues.push({expected:"never",code:"invalid_type",input:m.value,inst:i}),m)});function yo(i,f,m){if(i.issues.length)f.issues.push(...te(m,i.issues));f.value[m]=i.value}var sn=k("$ZodArray",(i,f)=>{A.init(i,f),i._zod.parse=(m,h)=>{let _=m.value;if(!Array.isArray(_))return m.issues.push({expected:"array",code:"invalid_type",input:_,inst:i}),m;m.value=Array(_.length);let g=[];for(let z=0;z<_.length;z++){let v=_[z],b=f.element._zod.run({value:v,issues:[]},h);if(b instanceof Promise)g.push(b.then((w)=>yo(w,m,z)));else yo(b,m,z)}if(g.length)return Promise.all(g).then(()=>m);return m}});function qe(i,f,m,h,_,g){let z=m in h;if(i.issues.length){if(_&&g&&!z)return;f.issues.push(...te(m,i.issues))}if(!z&&!_){if(!i.issues.length)f.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[m]});return}if(i.value===void 0){if(z)f.value[m]=void 0}else f.value[m]=i.value}function cn(i){let f=Object.keys(i.shape);for(let h of f)if(!i.shape?.[h]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${h}": expected a Zod schema`);let m=ht(i.shape);return{...i,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(m)}}function un(i,f,m,h,_,g){let z=[],v=_.keySet,b=_.catchall._zod,w=b.def.type,Z=b.optin==="optional",S=b.optout==="optional";for(let E in f){if(E==="__proto__")continue;if(v.has(E))continue;if(w==="never"){z.push(E);continue}let O=b.run({value:f[E],issues:[]},h);if(O instanceof Promise)i.push(O.then((N)=>qe(N,m,E,f,Z,S)));else qe(O,m,E,f,Z,S)}if(z.length)m.issues.push({code:"unrecognized_keys",keys:z,input:f,inst:g});if(!i.length)return m;return Promise.all(i).then(()=>m)}var fi=k("$ZodObject",(i,f)=>{if(A.init(i,f),!Object.getOwnPropertyDescriptor(f,"shape")?.get){let v=f.shape;Object.defineProperty(f,"shape",{get:()=>{let b={...v};return Object.defineProperty(f,"shape",{value:b}),b}})}let h=be(()=>cn(f));T(i._zod,"propValues",()=>{let v=f.shape,b={};for(let w in v){let Z=v[w]._zod;if(Z.values){b[w]??(b[w]=new Set);for(let S of Z.values)b[w].add(S)}}return b});let _=ge,g=f.catchall,z;i._zod.parse=(v,b)=>{z??(z=h.value);let w=v.value;if(!_(w))return v.issues.push({expected:"object",code:"invalid_type",input:w,inst:i}),v;v.value={};let Z=[],S=z.shape;for(let E of z.keys){let O=S[E],N=O._zod.optin==="optional",ve=O._zod.optout==="optional",J=O._zod.run({value:w[E],issues:[]},b);if(J instanceof Promise)Z.push(J.then((sr)=>qe(sr,v,E,w,N,ve)));else qe(J,v,E,w,N,ve)}if(!g)return Z.length?Promise.all(Z).then(()=>v):v;return un(Z,w,v,b,h.value,i)}}),an=k("$ZodObjectJIT",(i,f)=>{fi.init(i,f);let m=i._zod.parse,h=be(()=>cn(f)),_=(E)=>{let O=new _r(["shape","payload","ctx"]),N=h.value,ve=(q)=>{let M=cr(q);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};O.write("const input = payload.value;");let J=Object.create(null),sr=0;for(let q of N.keys)J[q]=`key_${sr++}`;O.write("const newResult = {};");for(let q of N.keys){let M=J[q],B=cr(q),ct=E[q],ut=ct?._zod?.optin==="optional",Qs=ct?._zod?.optout==="optional";if(O.write(`const ${M} = ${ve(q)};`),ut&&Qs)O.write(`
5
- if (${M}.issues.length) {
6
- if (${B} in input) {
7
- payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
4
+ `))}}var vo={major:4,minor:4,patch:3};var j=w("$ZodType",(i,f)=>{var m;i??(i={}),i._zod.def=f,i._zod.bag=i._zod.bag||{},i._zod.version=vo;let h=[...i._zod.def.checks??[]];if(i._zod.traits.has("$ZodCheck"))h.unshift(i);for(let _ of h)for(let g of _._zod.onattach)g(i);if(h.length===0)(m=i._zod).deferred??(m.deferred=[]),i._zod.deferred?.push(()=>{i._zod.run=i._zod.parse});else{let _=(z,v,y)=>{let b=ae(z),Z;for(let O of v){if(O._zod.def.when){if(gt(z))continue;if(!O._zod.def.when(z))continue}else if(b)continue;let I=z.issues.length,E=O._zod.check(z);if(E instanceof Promise&&y?.async===!1)throw new X;if(Z||E instanceof Promise)Z=(Z??Promise.resolve()).then(async()=>{if(await E,z.issues.length===I)return;if(!b)b=ae(z,I)});else{if(z.issues.length===I)continue;if(!b)b=ae(z,I)}}if(Z)return Z.then(()=>z);return z},g=(z,v,y)=>{if(ae(z))return z.aborted=!0,z;let b=_(v,h,y);if(b instanceof Promise){if(y.async===!1)throw new X;return b.then((Z)=>i._zod.parse(Z,y))}return i._zod.parse(b,y)};i._zod.run=(z,v)=>{if(v.skipChecks)return i._zod.parse(z,v);if(v.direction==="backward"){let b=i._zod.parse({value:z.value,issues:[]},{...v,skipChecks:!0});if(b instanceof Promise)return b.then((Z)=>g(Z,z,v));return g(b,z,v)}let y=i._zod.parse(z,v);if(y instanceof Promise){if(v.async===!1)throw new X;return y.then((b)=>_(b,h,v))}return _(y,h,v)}}T(i,"~standard",()=>({validate:(_)=>{try{let g=yt(i,_);return g.success?{value:g.data}:{issues:g.error?.issues}}catch(g){return $t(i,_).then((z)=>z.success?{value:z.data}:{issues:z.error?.issues})}},vendor:"zod",version:1}))}),Ye=w("$ZodString",(i,f)=>{j.init(i,f),i._zod.pattern=[...i?._zod.bag?.patterns??[]].pop()??Qt(i._zod.bag),i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=String(m.value)}catch(_){}if(typeof m.value==="string")return m;return m.issues.push({expected:"string",code:"invalid_type",input:m.value,inst:i}),m}}),L=w("$ZodStringFormat",(i,f)=>{Pe.init(i,f),Ye.init(i,f)}),Oo=w("$ZodGUID",(i,f)=>{f.pattern??(f.pattern=Dt),L.init(i,f)}),Eo=w("$ZodUUID",(i,f)=>{if(f.version){let h={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[f.version];if(h===void 0)throw Error(`Invalid UUID version: "${f.version}"`);f.pattern??(f.pattern=lr(h))}else f.pattern??(f.pattern=lr());L.init(i,f)}),Io=w("$ZodEmail",(i,f)=>{f.pattern??(f.pattern=Lt),L.init(i,f)}),To=w("$ZodURL",(i,f)=>{L.init(i,f),i._zod.check=(m)=>{try{let h=m.value.trim();if(!f.normalize&&f.protocol?.source===Wt.source){if(!/^https?:\/\//i.test(h)){m.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:m.value,inst:i,continue:!f.abort});return}}let _=new URL(h);if(f.hostname){if(f.hostname.lastIndex=0,!f.hostname.test(_.hostname))m.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:f.hostname.source,input:m.value,inst:i,continue:!f.abort})}if(f.protocol){if(f.protocol.lastIndex=0,!f.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))m.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:f.protocol.source,input:m.value,inst:i,continue:!f.abort})}if(f.normalize)m.value=_.href;else m.value=h;return}catch(h){m.issues.push({code:"invalid_format",format:"url",input:m.value,inst:i,continue:!f.abort})}}}),No=w("$ZodEmoji",(i,f)=>{f.pattern??(f.pattern=Ft()),L.init(i,f)}),Ao=w("$ZodNanoID",(i,f)=>{f.pattern??(f.pattern=Ct),L.init(i,f)}),jo=w("$ZodCUID",(i,f)=>{f.pattern??(f.pattern=It),L.init(i,f)}),Co=w("$ZodCUID2",(i,f)=>{f.pattern??(f.pattern=Tt),L.init(i,f)}),Ro=w("$ZodULID",(i,f)=>{f.pattern??(f.pattern=Nt),L.init(i,f)}),Do=w("$ZodXID",(i,f)=>{f.pattern??(f.pattern=At),L.init(i,f)}),Lo=w("$ZodKSUID",(i,f)=>{f.pattern??(f.pattern=jt),L.init(i,f)}),Fo=w("$ZodISODateTime",(i,f)=>{f.pattern??(f.pattern=Ht(f)),L.init(i,f)}),Uo=w("$ZodISODate",(i,f)=>{f.pattern??(f.pattern=qt),L.init(i,f)}),Mo=w("$ZodISOTime",(i,f)=>{f.pattern??(f.pattern=Xt(f)),L.init(i,f)}),Jo=w("$ZodISODuration",(i,f)=>{f.pattern??(f.pattern=Rt),L.init(i,f)}),Bo=w("$ZodIPv4",(i,f)=>{f.pattern??(f.pattern=Ut),L.init(i,f),i._zod.bag.format="ipv4"}),Vo=w("$ZodIPv6",(i,f)=>{f.pattern??(f.pattern=Mt),L.init(i,f),i._zod.bag.format="ipv6",i._zod.check=(m)=>{try{new URL(`http://[${m.value}]`)}catch{m.issues.push({code:"invalid_format",format:"ipv6",input:m.value,inst:i,continue:!f.abort})}}});var Wo=w("$ZodCIDRv4",(i,f)=>{f.pattern??(f.pattern=Jt),L.init(i,f)}),Ko=w("$ZodCIDRv6",(i,f)=>{f.pattern??(f.pattern=Bt),L.init(i,f),i._zod.check=(m)=>{let h=m.value.split("/");try{if(h.length!==2)throw Error();let[_,g]=h;if(!g)throw Error();let z=Number(g);if(`${z}`!==g)throw Error();if(z<0||z>128)throw Error();new URL(`http://[${_}]`)}catch{m.issues.push({code:"invalid_format",format:"cidrv6",input:m.value,inst:i,continue:!f.abort})}}});function Go(i){if(i==="")return!0;if(/\s/.test(i))return!1;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}var qo=w("$ZodBase64",(i,f)=>{f.pattern??(f.pattern=Vt),L.init(i,f),i._zod.bag.contentEncoding="base64",i._zod.check=(m)=>{if(Go(m.value))return;m.issues.push({code:"invalid_format",format:"base64",input:m.value,inst:i,continue:!f.abort})}});function pi(i){if(!fr.test(i))return!1;let f=i.replace(/[-_]/g,(h)=>h==="-"?"+":"/"),m=f.padEnd(Math.ceil(f.length/4)*4,"=");return Go(m)}var Yo=w("$ZodBase64URL",(i,f)=>{f.pattern??(f.pattern=fr),L.init(i,f),i._zod.bag.contentEncoding="base64url",i._zod.check=(m)=>{if(pi(m.value))return;m.issues.push({code:"invalid_format",format:"base64url",input:m.value,inst:i,continue:!f.abort})}}),Xo=w("$ZodE164",(i,f)=>{f.pattern??(f.pattern=Kt),L.init(i,f)});function li(i,f=null){try{let m=i.split(".");if(m.length!==3)return!1;let[h]=m;if(!h)return!1;let _=JSON.parse(atob(h));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(f&&(!("alg"in _)||_.alg!==f))return!1;return!0}catch{return!1}}var Ho=w("$ZodJWT",(i,f)=>{L.init(i,f),i._zod.check=(m)=>{if(li(m.value,f.alg))return;m.issues.push({code:"invalid_format",format:"jwt",input:m.value,inst:i,continue:!f.abort})}});var xr=w("$ZodNumber",(i,f)=>{j.init(i,f),i._zod.pattern=i._zod.bag.pattern??dr,i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=Number(m.value)}catch(z){}let _=m.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return m;let g=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return m.issues.push({expected:"number",code:"invalid_type",input:_,inst:i,...g?{received:g}:{}}),m}}),Qo=w("$ZodNumberFormat",(i,f)=>{co.init(i,f),xr.init(i,f)}),en=w("$ZodBoolean",(i,f)=>{j.init(i,f),i._zod.pattern=ro,i._zod.parse=(m,h)=>{if(f.coerce)try{m.value=Boolean(m.value)}catch(g){}let _=m.value;if(typeof _==="boolean")return m;return m.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:i}),m}});var rn=w("$ZodNull",(i,f)=>{j.init(i,f),i._zod.pattern=to,i._zod.values=new Set([null]),i._zod.parse=(m,h)=>{let _=m.value;if(_===null)return m;return m.issues.push({expected:"null",code:"invalid_type",input:_,inst:i}),m}}),tn=w("$ZodAny",(i,f)=>{j.init(i,f),i._zod.parse=(m)=>m}),on=w("$ZodUnknown",(i,f)=>{j.init(i,f),i._zod.parse=(m)=>m}),nn=w("$ZodNever",(i,f)=>{j.init(i,f),i._zod.parse=(m,h)=>(m.issues.push({expected:"never",code:"invalid_type",input:m.value,inst:i}),m)});function yo(i,f,m){if(i.issues.length)f.issues.push(...te(m,i.issues));f.value[m]=i.value}var sn=w("$ZodArray",(i,f)=>{j.init(i,f),i._zod.parse=(m,h)=>{let _=m.value;if(!Array.isArray(_))return m.issues.push({expected:"array",code:"invalid_type",input:_,inst:i}),m;m.value=Array(_.length);let g=[];for(let z=0;z<_.length;z++){let v=_[z],y=f.element._zod.run({value:v,issues:[]},h);if(y instanceof Promise)g.push(y.then((b)=>yo(b,m,z)));else yo(y,m,z)}if(g.length)return Promise.all(g).then(()=>m);return m}});function qe(i,f,m,h,_,g){let z=m in h;if(i.issues.length){if(_&&g&&!z)return;f.issues.push(...te(m,i.issues))}if(!z&&!_){if(!i.issues.length)f.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[m]});return}if(i.value===void 0){if(z)f.value[m]=void 0}else f.value[m]=i.value}function cn(i){let f=Object.keys(i.shape);for(let h of f)if(!i.shape?.[h]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${h}": expected a Zod schema`);let m=ht(i.shape);return{...i,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(m)}}function un(i,f,m,h,_,g){let z=[],v=_.keySet,y=_.catchall._zod,b=y.def.type,Z=y.optin==="optional",O=y.optout==="optional";for(let I in f){if(I==="__proto__")continue;if(v.has(I))continue;if(b==="never"){z.push(I);continue}let E=y.run({value:f[I],issues:[]},h);if(E instanceof Promise)i.push(E.then((N)=>qe(N,m,I,f,Z,O)));else qe(E,m,I,f,Z,O)}if(z.length)m.issues.push({code:"unrecognized_keys",keys:z,input:f,inst:g});if(!i.length)return m;return Promise.all(i).then(()=>m)}var fi=w("$ZodObject",(i,f)=>{if(j.init(i,f),!Object.getOwnPropertyDescriptor(f,"shape")?.get){let v=f.shape;Object.defineProperty(f,"shape",{get:()=>{let y={...v};return Object.defineProperty(f,"shape",{value:y}),y}})}let h=be(()=>cn(f));T(i._zod,"propValues",()=>{let v=f.shape,y={};for(let b in v){let Z=v[b]._zod;if(Z.values){y[b]??(y[b]=new Set);for(let O of Z.values)y[b].add(O)}}return y});let _=ge,g=f.catchall,z;i._zod.parse=(v,y)=>{z??(z=h.value);let b=v.value;if(!_(b))return v.issues.push({expected:"object",code:"invalid_type",input:b,inst:i}),v;v.value={};let Z=[],O=z.shape;for(let I of z.keys){let E=O[I],N=E._zod.optin==="optional",ve=E._zod.optout==="optional",M=E._zod.run({value:b[I],issues:[]},y);if(M instanceof Promise)Z.push(M.then((sr)=>qe(sr,v,I,b,N,ve)));else qe(M,v,I,b,N,ve)}if(!g)return Z.length?Promise.all(Z).then(()=>v):v;return un(Z,b,v,y,h.value,i)}}),an=w("$ZodObjectJIT",(i,f)=>{fi.init(i,f);let m=i._zod.parse,h=be(()=>cn(f)),_=(I)=>{let E=new _r(["shape","payload","ctx"]),N=h.value,ve=(G)=>{let U=cr(G);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};E.write("const input = payload.value;");let M=Object.create(null),sr=0;for(let G of N.keys)M[G]=`key_${sr++}`;E.write("const newResult = {};");for(let G of N.keys){let U=M[G],J=cr(G),ct=I[G],ut=ct?._zod?.optin==="optional",Qs=ct?._zod?.optout==="optional";if(E.write(`const ${U} = ${ve(G)};`),ut&&Qs)E.write(`
5
+ if (${U}.issues.length) {
6
+ if (${J} in input) {
7
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
8
8
  ...iss,
9
- path: iss.path ? [${B}, ...iss.path] : [${B}]
9
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
10
10
  })));
11
11
  }
12
12
  }
13
13
 
14
- if (${M}.value === undefined) {
15
- if (${B} in input) {
16
- newResult[${B}] = undefined;
14
+ if (${U}.value === undefined) {
15
+ if (${J} in input) {
16
+ newResult[${J}] = undefined;
17
17
  }
18
18
  } else {
19
- newResult[${B}] = ${M}.value;
19
+ newResult[${J}] = ${U}.value;
20
20
  }
21
21
 
22
- `);else if(!ut)O.write(`
23
- const ${M}_present = ${B} in input;
24
- if (${M}.issues.length) {
25
- payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
22
+ `);else if(!ut)E.write(`
23
+ const ${U}_present = ${J} in input;
24
+ if (${U}.issues.length) {
25
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
26
26
  ...iss,
27
- path: iss.path ? [${B}, ...iss.path] : [${B}]
27
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
28
28
  })));
29
29
  }
30
- if (!${M}_present && !${M}.issues.length) {
30
+ if (!${U}_present && !${U}.issues.length) {
31
31
  payload.issues.push({
32
32
  code: "invalid_type",
33
33
  expected: "nonoptional",
34
34
  input: undefined,
35
- path: [${B}]
35
+ path: [${J}]
36
36
  });
37
37
  }
38
38
 
39
- if (${M}_present) {
40
- if (${M}.value === undefined) {
41
- newResult[${B}] = undefined;
39
+ if (${U}_present) {
40
+ if (${U}.value === undefined) {
41
+ newResult[${J}] = undefined;
42
42
  } else {
43
- newResult[${B}] = ${M}.value;
43
+ newResult[${J}] = ${U}.value;
44
44
  }
45
45
  }
46
46
 
47
- `);else O.write(`
48
- if (${M}.issues.length) {
49
- payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
47
+ `);else E.write(`
48
+ if (${U}.issues.length) {
49
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
50
50
  ...iss,
51
- path: iss.path ? [${B}, ...iss.path] : [${B}]
51
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
52
52
  })));
53
53
  }
54
54
 
55
- if (${M}.value === undefined) {
56
- if (${B} in input) {
57
- newResult[${B}] = undefined;
55
+ if (${U}.value === undefined) {
56
+ if (${J} in input) {
57
+ newResult[${J}] = undefined;
58
58
  }
59
59
  } else {
60
- newResult[${B}] = ${M}.value;
60
+ newResult[${J}] = ${U}.value;
61
61
  }
62
62
 
63
- `)}O.write("payload.value = newResult;"),O.write("return payload;");let Hs=O.compile();return(q,M)=>Hs(E,q,M)},g,z=ge,v=!_e.jitless,w=v&&dt.value,Z=f.catchall,S;i._zod.parse=(E,O)=>{S??(S=h.value);let N=E.value;if(!z(N))return E.issues.push({expected:"object",code:"invalid_type",input:N,inst:i}),E;if(v&&w&&O?.async===!1&&O.jitless!==!0){if(!g)g=_(f.shape);if(E=g(E,O),!Z)return E;return un([],N,E,O,S,i)}return m(E,O)}});function $o(i,f,m,h){for(let g of i)if(g.issues.length===0)return f.value=g.value,f;let _=i.filter((g)=>!ae(g));if(_.length===1)return f.value=_[0].value,_[0];return f.issues.push({code:"invalid_union",input:f.value,inst:m,errors:i.map((g)=>g.issues.map((z)=>G(z,h,y())))}),f}var zr=k("$ZodUnion",(i,f)=>{A.init(i,f),T(i._zod,"optin",()=>f.options.some((h)=>h._zod.optin==="optional")?"optional":void 0),T(i._zod,"optout",()=>f.options.some((h)=>h._zod.optout==="optional")?"optional":void 0),T(i._zod,"values",()=>{if(f.options.every((h)=>h._zod.values))return new Set(f.options.flatMap((h)=>Array.from(h._zod.values)));return}),T(i._zod,"pattern",()=>{if(f.options.every((h)=>h._zod.pattern)){let h=f.options.map((_)=>_._zod.pattern);return new RegExp(`^(${h.map((_)=>Me(_.source)).join("|")})$`)}return});let m=f.options.length===1?f.options[0]._zod.run:null;i._zod.parse=(h,_)=>{if(m)return m(h,_);let g=!1,z=[];for(let v of f.options){let b=v._zod.run({value:h.value,issues:[]},_);if(b instanceof Promise)z.push(b),g=!0;else{if(b.issues.length===0)return b;z.push(b)}}if(!g)return $o(z,h,i,_);return Promise.all(z).then((v)=>$o(v,h,i,_))}});var pn=k("$ZodDiscriminatedUnion",(i,f)=>{f.inclusive=!1,zr.init(i,f);let m=i._zod.parse;T(i._zod,"propValues",()=>{let _={};for(let g of f.options){let z=g._zod.propValues;if(!z||Object.keys(z).length===0)throw Error(`Invalid discriminated union option at index "${f.options.indexOf(g)}"`);for(let[v,b]of Object.entries(z)){if(!_[v])_[v]=new Set;for(let w of b)_[v].add(w)}}return _});let h=be(()=>{let _=f.options,g=new Map;for(let z of _){let v=z._zod.propValues?.[f.discriminator];if(!v||v.size===0)throw Error(`Invalid discriminated union option at index "${f.options.indexOf(z)}"`);for(let b of v){if(g.has(b))throw Error(`Duplicate discriminator value "${String(b)}"`);g.set(b,z)}}return g});i._zod.parse=(_,g)=>{let z=_.value;if(!ge(z))return _.issues.push({code:"invalid_type",expected:"object",input:z,inst:i}),_;let v=h.value.get(z?.[f.discriminator]);if(v)return v._zod.run(_,g);if(f.unionFallback||g.direction==="backward")return m(_,g);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:f.discriminator,options:Array.from(h.value.keys()),input:z,path:[f.discriminator],inst:i}),_}}),ln=k("$ZodIntersection",(i,f)=>{A.init(i,f),i._zod.parse=(m,h)=>{let _=m.value,g=f.left._zod.run({value:_,issues:[]},h),z=f.right._zod.run({value:_,issues:[]},h);if(g instanceof Promise||z instanceof Promise)return Promise.all([g,z]).then(([b,w])=>bo(m,b,w));return bo(m,g,z)}});function gr(i,f){if(i===f)return{valid:!0,data:i};if(i instanceof Date&&f instanceof Date&&+i===+f)return{valid:!0,data:i};if(ue(i)&&ue(f)){let m=Object.keys(f),h=Object.keys(i).filter((g)=>m.indexOf(g)!==-1),_={...i,...f};for(let g of h){let z=gr(i[g],f[g]);if(!z.valid)return{valid:!1,mergeErrorPath:[g,...z.mergeErrorPath]};_[g]=z.data}return{valid:!0,data:_}}if(Array.isArray(i)&&Array.isArray(f)){if(i.length!==f.length)return{valid:!1,mergeErrorPath:[]};let m=[];for(let h=0;h<i.length;h++){let _=i[h],g=f[h],z=gr(_,g);if(!z.valid)return{valid:!1,mergeErrorPath:[h,...z.mergeErrorPath]};m.push(z.data)}return{valid:!0,data:m}}return{valid:!1,mergeErrorPath:[]}}function bo(i,f,m){let h=new Map,_;for(let v of f.issues)if(v.code==="unrecognized_keys"){_??(_=v);for(let b of v.keys){if(!h.has(b))h.set(b,{});h.get(b).l=!0}}else i.issues.push(v);for(let v of m.issues)if(v.code==="unrecognized_keys")for(let b of v.keys){if(!h.has(b))h.set(b,{});h.get(b).r=!0}else i.issues.push(v);let g=[...h].filter(([,v])=>v.l&&v.r).map(([v])=>v);if(g.length&&_)i.issues.push({..._,keys:g});if(ae(i))return i;let z=gr(f.value,m.value);if(!z.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(z.mergeErrorPath)}`);return i.value=z.data,i}var fn=k("$ZodRecord",(i,f)=>{A.init(i,f),i._zod.parse=(m,h)=>{let _=m.value;if(!ue(_))return m.issues.push({expected:"record",code:"invalid_type",input:_,inst:i}),m;let g=[],z=f.keyType._zod.values;if(z){m.value={};let v=new Set;for(let w of z)if(typeof w==="string"||typeof w==="number"||typeof w==="symbol"){v.add(typeof w==="number"?w.toString():w);let Z=f.keyType._zod.run({value:w,issues:[]},h);if(Z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Z.issues.length){m.issues.push({code:"invalid_key",origin:"record",issues:Z.issues.map((O)=>G(O,h,y())),input:w,path:[w],inst:i});continue}let S=Z.value,E=f.valueType._zod.run({value:_[w],issues:[]},h);if(E instanceof Promise)g.push(E.then((O)=>{if(O.issues.length)m.issues.push(...te(w,O.issues));m.value[S]=O.value}));else{if(E.issues.length)m.issues.push(...te(w,E.issues));m.value[S]=E.value}}let b;for(let w in _)if(!v.has(w))b=b??[],b.push(w);if(b&&b.length>0)m.issues.push({code:"unrecognized_keys",input:_,inst:i,keys:b})}else{m.value={};for(let v of Reflect.ownKeys(_)){if(v==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(_,v))continue;let b=f.keyType._zod.run({value:v,issues:[]},h);if(b instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof v==="string"&&dr.test(v)&&b.issues.length){let S=f.keyType._zod.run({value:Number(v),issues:[]},h);if(S instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(S.issues.length===0)b=S}if(b.issues.length){if(f.mode==="loose")m.value[v]=_[v];else m.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map((S)=>G(S,h,y())),input:v,path:[v],inst:i});continue}let Z=f.valueType._zod.run({value:_[v],issues:[]},h);if(Z instanceof Promise)g.push(Z.then((S)=>{if(S.issues.length)m.issues.push(...te(v,S.issues));m.value[b.value]=S.value}));else{if(Z.issues.length)m.issues.push(...te(v,Z.issues));m.value[b.value]=Z.value}}}if(g.length)return Promise.all(g).then(()=>m);return m}});var dn=k("$ZodEnum",(i,f)=>{A.init(i,f);let m=Fe(f.entries),h=new Set(m);i._zod.values=h,i._zod.pattern=new RegExp(`^(${m.filter((_)=>mt.has(typeof _)).map((_)=>typeof _==="string"?ee(_):_.toString()).join("|")})$`),i._zod.parse=(_,g)=>{let z=_.value;if(h.has(z))return _;return _.issues.push({code:"invalid_value",values:m,input:z,inst:i}),_}}),mn=k("$ZodLiteral",(i,f)=>{if(A.init(i,f),f.values.length===0)throw Error("Cannot create literal schema with no valid values");let m=new Set(f.values);i._zod.values=m,i._zod.pattern=new RegExp(`^(${f.values.map((h)=>typeof h==="string"?ee(h):h?ee(h.toString()):String(h)).join("|")})$`),i._zod.parse=(h,_)=>{let g=h.value;if(m.has(g))return h;return h.issues.push({code:"invalid_value",values:f.values,input:g,inst:i}),h}});var hn=k("$ZodTransform",(i,f)=>{A.init(i,f),i._zod.optin="optional",i._zod.parse=(m,h)=>{if(h.direction==="backward")throw new ye(i.constructor.name);let _=f.transform(m.value,m);if(h.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((z)=>(m.value=z,m.fallback=!0,m));if(_ instanceof Promise)throw new X;return m.value=_,m.fallback=!0,m}});function wo(i,f){if(f===void 0&&(i.issues.length||i.fallback))return{issues:[],value:void 0};return i}var vr=k("$ZodOptional",(i,f)=>{A.init(i,f),i._zod.optin="optional",i._zod.optout="optional",T(i._zod,"values",()=>f.innerType._zod.values?new Set([...f.innerType._zod.values,void 0]):void 0),T(i._zod,"pattern",()=>{let m=f.innerType._zod.pattern;return m?new RegExp(`^(${Me(m.source)})?$`):void 0}),i._zod.parse=(m,h)=>{if(f.innerType._zod.optin==="optional"){let _=m.value,g=f.innerType._zod.run(m,h);if(g instanceof Promise)return g.then((z)=>wo(z,_));return wo(g,_)}if(m.value===void 0)return m;return f.innerType._zod.run(m,h)}}),_n=k("$ZodExactOptional",(i,f)=>{vr.init(i,f),T(i._zod,"values",()=>f.innerType._zod.values),T(i._zod,"pattern",()=>f.innerType._zod.pattern),i._zod.parse=(m,h)=>f.innerType._zod.run(m,h)}),gn=k("$ZodNullable",(i,f)=>{A.init(i,f),T(i._zod,"optin",()=>f.innerType._zod.optin),T(i._zod,"optout",()=>f.innerType._zod.optout),T(i._zod,"pattern",()=>{let m=f.innerType._zod.pattern;return m?new RegExp(`^(${Me(m.source)}|null)$`):void 0}),T(i._zod,"values",()=>f.innerType._zod.values?new Set([...f.innerType._zod.values,null]):void 0),i._zod.parse=(m,h)=>{if(m.value===null)return m;return f.innerType._zod.run(m,h)}}),xn=k("$ZodDefault",(i,f)=>{A.init(i,f),i._zod.optin="optional",T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);if(m.value===void 0)return m.value=f.defaultValue,m;let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>ko(g,f));return ko(_,f)}});function ko(i,f){if(i.value===void 0)i.value=f.defaultValue;return i}var zn=k("$ZodPrefault",(i,f)=>{A.init(i,f),i._zod.optin="optional",T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);if(m.value===void 0)m.value=f.defaultValue;return f.innerType._zod.run(m,h)}}),vn=k("$ZodNonOptional",(i,f)=>{A.init(i,f),T(i._zod,"values",()=>{let m=f.innerType._zod.values;return m?new Set([...m].filter((h)=>h!==void 0)):void 0}),i._zod.parse=(m,h)=>{let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>Zo(g,i));return Zo(_,i)}});function Zo(i,f){if(!i.issues.length&&i.value===void 0)i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:f});return i}var yn=k("$ZodCatch",(i,f)=>{A.init(i,f),i._zod.optin="optional",T(i._zod,"optout",()=>f.innerType._zod.optout),T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>{if(m.value=g.value,g.issues.length)m.value=f.catchValue({...m,error:{issues:g.issues.map((z)=>G(z,h,y()))},input:m.value}),m.issues=[],m.fallback=!0;return m});if(m.value=_.value,_.issues.length)m.value=f.catchValue({...m,error:{issues:_.issues.map((g)=>G(g,h,y()))},input:m.value}),m.issues=[],m.fallback=!0;return m}});var yr=k("$ZodPipe",(i,f)=>{A.init(i,f),T(i._zod,"values",()=>f.in._zod.values),T(i._zod,"optin",()=>f.in._zod.optin),T(i._zod,"optout",()=>f.out._zod.optout),T(i._zod,"propValues",()=>f.in._zod.propValues),i._zod.parse=(m,h)=>{if(h.direction==="backward"){let g=f.out._zod.run(m,h);if(g instanceof Promise)return g.then((z)=>Ge(z,f.in,h));return Ge(g,f.in,h)}let _=f.in._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>Ge(g,f.out,h));return Ge(_,f.out,h)}});function Ge(i,f,m){if(i.issues.length)return i.aborted=!0,i;return f._zod.run({value:i.value,issues:i.issues,fallback:i.fallback},m)}var $n=k("$ZodPreprocess",(i,f)=>{yr.init(i,f)}),bn=k("$ZodReadonly",(i,f)=>{A.init(i,f),T(i._zod,"propValues",()=>f.innerType._zod.propValues),T(i._zod,"values",()=>f.innerType._zod.values),T(i._zod,"optin",()=>f.innerType?._zod?.optin),T(i._zod,"optout",()=>f.innerType?._zod?.optout),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then(Po);return Po(_)}});function Po(i){return i.value=Object.freeze(i.value),i}var wn=k("$ZodLazy",(i,f)=>{A.init(i,f),T(i._zod,"innerType",()=>{let m=f;if(!m._cachedInner)m._cachedInner=f.getter();return m._cachedInner}),T(i._zod,"pattern",()=>i._zod.innerType?._zod?.pattern),T(i._zod,"propValues",()=>i._zod.innerType?._zod?.propValues),T(i._zod,"optin",()=>i._zod.innerType?._zod?.optin??void 0),T(i._zod,"optout",()=>i._zod.innerType?._zod?.optout??void 0),i._zod.parse=(m,h)=>i._zod.innerType._zod.run(m,h)}),kn=k("$ZodCustom",(i,f)=>{V.init(i,f),A.init(i,f),i._zod.parse=(m,h)=>m,i._zod.check=(m)=>{let h=m.value,_=f.fn(h);if(_ instanceof Promise)return _.then((g)=>So(g,m,h,i));So(_,m,h,i);return}});function So(i,f,m,h){if(!i){let _={code:"custom",input:m,inst:h,path:[...h._zod.def.path??[]],continue:!h._zod.def.abort};if(h._zod.def.params)_.params=h._zod.def.params;f.issues.push(le(_))}}var Zn,Uc=Symbol("ZodOutput"),Mc=Symbol("ZodInput");class Pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...f){let m=f[0];if(this._map.set(i,m),m&&typeof m==="object"&&"id"in m)this._idmap.set(m.id,i);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){let f=this._map.get(i);if(f&&typeof f==="object"&&"id"in f)this._idmap.delete(f.id);return this._map.delete(i),this}get(i){let f=i._zod.parent;if(f){let m={...this.get(f)??{}};delete m.id;let h={...m,...this._map.get(i)};return Object.keys(h).length?h:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function di(){return new Pn}(Zn=globalThis).__zod_globalRegistry??(Zn.__zod_globalRegistry=di());var fe=globalThis.__zod_globalRegistry;function Sn(i,f){return new i({type:"string",...P(f)})}function $r(i,f){return new i({type:"string",format:"email",check:"string_format",abort:!1,...P(f)})}function br(i,f){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...P(f)})}function On(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...P(f)})}function En(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(f)})}function In(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(f)})}function Tn(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(f)})}function wr(i,f){return new i({type:"string",format:"url",check:"string_format",abort:!1,...P(f)})}function Nn(i,f){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...P(f)})}function An(i,f){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(f)})}function jn(i,f){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...P(f)})}function Cn(i,f){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(f)})}function Rn(i,f){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...P(f)})}function Dn(i,f){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...P(f)})}function Ln(i,f){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(f)})}function Fn(i,f){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(f)})}function Un(i,f){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(f)})}function Mn(i,f){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(f)})}function Jn(i,f){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(f)})}function Bn(i,f){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...P(f)})}function Vn(i,f){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...P(f)})}function Wn(i,f){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...P(f)})}function Kn(i,f){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...P(f)})}function Gn(i,f){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(f)})}function qn(i,f){return new i({type:"string",format:"date",check:"string_format",...P(f)})}function Yn(i,f){return new i({type:"string",format:"time",check:"string_format",precision:null,...P(f)})}function Xn(i,f){return new i({type:"string",format:"duration",check:"string_format",...P(f)})}function Hn(i,f){return new i({type:"number",checks:[],...P(f)})}function Ee(i,f){return new i({type:"number",coerce:!0,checks:[],...P(f)})}function Qn(i,f){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...P(f)})}function es(i,f){return new i({type:"boolean",...P(f)})}function rs(i,f){return new i({type:"null",...P(f)})}function ts(i){return new i({type:"any"})}function os(i){return new i({type:"unknown"})}function ns(i,f){return new i({type:"never",...P(f)})}function Xe(i,f){return new mr({check:"less_than",...P(f),value:i,inclusive:!1})}function Se(i,f){return new mr({check:"less_than",...P(f),value:i,inclusive:!0})}function He(i,f){return new hr({check:"greater_than",...P(f),value:i,inclusive:!1})}function Ie(i,f){return new hr({check:"greater_than",...P(f),value:i,inclusive:!0})}function Qe(i,f){return new io({check:"multiple_of",...P(f),value:i})}function er(i,f){return new uo({check:"max_length",...P(f),maximum:i})}function xe(i,f){return new ao({check:"min_length",...P(f),minimum:i})}function rr(i,f){return new po({check:"length_equals",...P(f),length:i})}function kr(i,f){return new lo({check:"string_format",format:"regex",...P(f),pattern:i})}function Zr(i){return new fo({check:"string_format",format:"lowercase",...P(i)})}function Pr(i){return new mo({check:"string_format",format:"uppercase",...P(i)})}function Sr(i,f){return new ho({check:"string_format",format:"includes",...P(f),includes:i})}function Or(i,f){return new _o({check:"string_format",format:"starts_with",...P(f),prefix:i})}function Er(i,f){return new go({check:"string_format",format:"ends_with",...P(f),suffix:i})}function ie(i){return new xo({check:"overwrite",tx:i})}function Ir(i){return ie((f)=>f.normalize(i))}function Tr(){return ie((i)=>i.trim())}function Nr(){return ie((i)=>i.toLowerCase())}function Ar(){return ie((i)=>i.toUpperCase())}function jr(){return ie((i)=>ft(i))}function ss(i,f,m){return new i({type:"array",element:f,...P(m)})}function is(i,f,m){return new i({type:"custom",check:"custom",fn:f,...P(m)})}function cs(i,f){let m=mi((h)=>(h.addIssue=(_)=>{if(typeof _==="string")h.issues.push(le(_,h.value,m._zod.def));else{let g=_;if(g.fatal)g.continue=!1;g.code??(g.code="custom"),g.input??(g.input=h.value),g.inst??(g.inst=m),g.continue??(g.continue=!m._zod.def.abort),h.issues.push(le(g))}},i(h.value,h)),f);return m}function mi(i,f){let m=new V({check:"custom",...P(f)});return m._zod.check=i,m}function Ae(i){let f=i?.target??"draft-2020-12";if(f==="draft-4")f="draft-04";if(f==="draft-7")f="draft-07";return{processors:i.processors??{},metadataRegistry:i?.metadata??fe,target:f,unrepresentable:i?.unrepresentable??"throw",override:i?.override??(()=>{}),io:i?.io??"output",counter:0,seen:new Map,cycles:i?.cycles??"ref",reused:i?.reused??"inline",external:i?.external??void 0}}function D(i,f,m={path:[],schemaPath:[]}){var h;let _=i._zod.def,g=f.seen.get(i);if(g){if(g.count++,m.schemaPath.includes(i))g.cycle=m.path;return g.schema}let z={schema:{},count:1,cycle:void 0,path:m.path};f.seen.set(i,z);let v=i._zod.toJSONSchema?.();if(v)z.schema=v;else{let Z={...m,schemaPath:[...m.schemaPath,i],path:m.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(f,z.schema,Z);else{let E=z.schema,O=f.processors[_.type];if(!O)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);O(i,f,E,Z)}let S=i._zod.parent;if(S){if(!z.ref)z.ref=S;D(S,f,Z),f.seen.get(S).isParent=!0}}let b=f.metadataRegistry.get(i);if(b)Object.assign(z.schema,b);if(f.io==="input"&&W(i))delete z.schema.examples,delete z.schema.default;if(f.io==="input"&&"_prefault"in z.schema)(h=z.schema).default??(h.default=z.schema._prefault);return delete z.schema._prefault,f.seen.get(i).schema}function je(i,f){let m=i.seen.get(f);if(!m)throw Error("Unprocessed schema. This is a bug in Zod.");let h=new Map;for(let z of i.seen.entries()){let v=i.metadataRegistry.get(z[0])?.id;if(v){let b=h.get(v);if(b&&b!==z[0])throw Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);h.set(v,z[0])}}let _=(z)=>{let v=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let S=i.external.registry.get(z[0])?.id,E=i.external.uri??((N)=>N);if(S)return{ref:E(S)};let O=z[1].defId??z[1].schema.id??`schema${i.counter++}`;return z[1].defId=O,{defId:O,ref:`${E("__shared")}#/${v}/${O}`}}if(z[1]===m)return{ref:"#"};let w=`${"#"}/${v}/`,Z=z[1].schema.id??`__schema${i.counter++}`;return{defId:Z,ref:w+Z}},g=(z)=>{if(z[1].schema.$ref)return;let v=z[1],{ref:b,defId:w}=_(z);if(v.def={...v.schema},w)v.defId=w;let Z=v.schema;for(let S in Z)delete Z[S];Z.$ref=b};if(i.cycles==="throw")for(let z of i.seen.entries()){let v=z[1];if(v.cycle)throw Error(`Cycle detected: #/${v.cycle?.join("/")}/<root>
63
+ `)}E.write("payload.value = newResult;"),E.write("return payload;");let Hs=E.compile();return(G,U)=>Hs(I,G,U)},g,z=ge,v=!_e.jitless,b=v&&dt.value,Z=f.catchall,O;i._zod.parse=(I,E)=>{O??(O=h.value);let N=I.value;if(!z(N))return I.issues.push({expected:"object",code:"invalid_type",input:N,inst:i}),I;if(v&&b&&E?.async===!1&&E.jitless!==!0){if(!g)g=_(f.shape);if(I=g(I,E),!Z)return I;return un([],N,I,E,O,i)}return m(I,E)}});function $o(i,f,m,h){for(let g of i)if(g.issues.length===0)return f.value=g.value,f;let _=i.filter((g)=>!ae(g));if(_.length===1)return f.value=_[0].value,_[0];return f.issues.push({code:"invalid_union",input:f.value,inst:m,errors:i.map((g)=>g.issues.map((z)=>K(z,h,S())))}),f}var zr=w("$ZodUnion",(i,f)=>{j.init(i,f),T(i._zod,"optin",()=>f.options.some((h)=>h._zod.optin==="optional")?"optional":void 0),T(i._zod,"optout",()=>f.options.some((h)=>h._zod.optout==="optional")?"optional":void 0),T(i._zod,"values",()=>{if(f.options.every((h)=>h._zod.values))return new Set(f.options.flatMap((h)=>Array.from(h._zod.values)));return}),T(i._zod,"pattern",()=>{if(f.options.every((h)=>h._zod.pattern)){let h=f.options.map((_)=>_._zod.pattern);return new RegExp(`^(${h.map((_)=>Me(_.source)).join("|")})$`)}return});let m=f.options.length===1?f.options[0]._zod.run:null;i._zod.parse=(h,_)=>{if(m)return m(h,_);let g=!1,z=[];for(let v of f.options){let y=v._zod.run({value:h.value,issues:[]},_);if(y instanceof Promise)z.push(y),g=!0;else{if(y.issues.length===0)return y;z.push(y)}}if(!g)return $o(z,h,i,_);return Promise.all(z).then((v)=>$o(v,h,i,_))}});var pn=w("$ZodDiscriminatedUnion",(i,f)=>{f.inclusive=!1,zr.init(i,f);let m=i._zod.parse;T(i._zod,"propValues",()=>{let _={};for(let g of f.options){let z=g._zod.propValues;if(!z||Object.keys(z).length===0)throw Error(`Invalid discriminated union option at index "${f.options.indexOf(g)}"`);for(let[v,y]of Object.entries(z)){if(!_[v])_[v]=new Set;for(let b of y)_[v].add(b)}}return _});let h=be(()=>{let _=f.options,g=new Map;for(let z of _){let v=z._zod.propValues?.[f.discriminator];if(!v||v.size===0)throw Error(`Invalid discriminated union option at index "${f.options.indexOf(z)}"`);for(let y of v){if(g.has(y))throw Error(`Duplicate discriminator value "${String(y)}"`);g.set(y,z)}}return g});i._zod.parse=(_,g)=>{let z=_.value;if(!ge(z))return _.issues.push({code:"invalid_type",expected:"object",input:z,inst:i}),_;let v=h.value.get(z?.[f.discriminator]);if(v)return v._zod.run(_,g);if(f.unionFallback||g.direction==="backward")return m(_,g);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:f.discriminator,options:Array.from(h.value.keys()),input:z,path:[f.discriminator],inst:i}),_}}),ln=w("$ZodIntersection",(i,f)=>{j.init(i,f),i._zod.parse=(m,h)=>{let _=m.value,g=f.left._zod.run({value:_,issues:[]},h),z=f.right._zod.run({value:_,issues:[]},h);if(g instanceof Promise||z instanceof Promise)return Promise.all([g,z]).then(([y,b])=>bo(m,y,b));return bo(m,g,z)}});function gr(i,f){if(i===f)return{valid:!0,data:i};if(i instanceof Date&&f instanceof Date&&+i===+f)return{valid:!0,data:i};if(ue(i)&&ue(f)){let m=Object.keys(f),h=Object.keys(i).filter((g)=>m.indexOf(g)!==-1),_={...i,...f};for(let g of h){let z=gr(i[g],f[g]);if(!z.valid)return{valid:!1,mergeErrorPath:[g,...z.mergeErrorPath]};_[g]=z.data}return{valid:!0,data:_}}if(Array.isArray(i)&&Array.isArray(f)){if(i.length!==f.length)return{valid:!1,mergeErrorPath:[]};let m=[];for(let h=0;h<i.length;h++){let _=i[h],g=f[h],z=gr(_,g);if(!z.valid)return{valid:!1,mergeErrorPath:[h,...z.mergeErrorPath]};m.push(z.data)}return{valid:!0,data:m}}return{valid:!1,mergeErrorPath:[]}}function bo(i,f,m){let h=new Map,_;for(let v of f.issues)if(v.code==="unrecognized_keys"){_??(_=v);for(let y of v.keys){if(!h.has(y))h.set(y,{});h.get(y).l=!0}}else i.issues.push(v);for(let v of m.issues)if(v.code==="unrecognized_keys")for(let y of v.keys){if(!h.has(y))h.set(y,{});h.get(y).r=!0}else i.issues.push(v);let g=[...h].filter(([,v])=>v.l&&v.r).map(([v])=>v);if(g.length&&_)i.issues.push({..._,keys:g});if(ae(i))return i;let z=gr(f.value,m.value);if(!z.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(z.mergeErrorPath)}`);return i.value=z.data,i}var fn=w("$ZodRecord",(i,f)=>{j.init(i,f),i._zod.parse=(m,h)=>{let _=m.value;if(!ue(_))return m.issues.push({expected:"record",code:"invalid_type",input:_,inst:i}),m;let g=[],z=f.keyType._zod.values;if(z){m.value={};let v=new Set;for(let b of z)if(typeof b==="string"||typeof b==="number"||typeof b==="symbol"){v.add(typeof b==="number"?b.toString():b);let Z=f.keyType._zod.run({value:b,issues:[]},h);if(Z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Z.issues.length){m.issues.push({code:"invalid_key",origin:"record",issues:Z.issues.map((E)=>K(E,h,S())),input:b,path:[b],inst:i});continue}let O=Z.value,I=f.valueType._zod.run({value:_[b],issues:[]},h);if(I instanceof Promise)g.push(I.then((E)=>{if(E.issues.length)m.issues.push(...te(b,E.issues));m.value[O]=E.value}));else{if(I.issues.length)m.issues.push(...te(b,I.issues));m.value[O]=I.value}}let y;for(let b in _)if(!v.has(b))y=y??[],y.push(b);if(y&&y.length>0)m.issues.push({code:"unrecognized_keys",input:_,inst:i,keys:y})}else{m.value={};for(let v of Reflect.ownKeys(_)){if(v==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(_,v))continue;let y=f.keyType._zod.run({value:v,issues:[]},h);if(y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof v==="string"&&dr.test(v)&&y.issues.length){let O=f.keyType._zod.run({value:Number(v),issues:[]},h);if(O instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(O.issues.length===0)y=O}if(y.issues.length){if(f.mode==="loose")m.value[v]=_[v];else m.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map((O)=>K(O,h,S())),input:v,path:[v],inst:i});continue}let Z=f.valueType._zod.run({value:_[v],issues:[]},h);if(Z instanceof Promise)g.push(Z.then((O)=>{if(O.issues.length)m.issues.push(...te(v,O.issues));m.value[y.value]=O.value}));else{if(Z.issues.length)m.issues.push(...te(v,Z.issues));m.value[y.value]=Z.value}}}if(g.length)return Promise.all(g).then(()=>m);return m}});var dn=w("$ZodEnum",(i,f)=>{j.init(i,f);let m=Fe(f.entries),h=new Set(m);i._zod.values=h,i._zod.pattern=new RegExp(`^(${m.filter((_)=>mt.has(typeof _)).map((_)=>typeof _==="string"?ee(_):_.toString()).join("|")})$`),i._zod.parse=(_,g)=>{let z=_.value;if(h.has(z))return _;return _.issues.push({code:"invalid_value",values:m,input:z,inst:i}),_}}),mn=w("$ZodLiteral",(i,f)=>{if(j.init(i,f),f.values.length===0)throw Error("Cannot create literal schema with no valid values");let m=new Set(f.values);i._zod.values=m,i._zod.pattern=new RegExp(`^(${f.values.map((h)=>typeof h==="string"?ee(h):h?ee(h.toString()):String(h)).join("|")})$`),i._zod.parse=(h,_)=>{let g=h.value;if(m.has(g))return h;return h.issues.push({code:"invalid_value",values:f.values,input:g,inst:i}),h}});var hn=w("$ZodTransform",(i,f)=>{j.init(i,f),i._zod.optin="optional",i._zod.parse=(m,h)=>{if(h.direction==="backward")throw new ye(i.constructor.name);let _=f.transform(m.value,m);if(h.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((z)=>(m.value=z,m.fallback=!0,m));if(_ instanceof Promise)throw new X;return m.value=_,m.fallback=!0,m}});function wo(i,f){if(f===void 0&&(i.issues.length||i.fallback))return{issues:[],value:void 0};return i}var vr=w("$ZodOptional",(i,f)=>{j.init(i,f),i._zod.optin="optional",i._zod.optout="optional",T(i._zod,"values",()=>f.innerType._zod.values?new Set([...f.innerType._zod.values,void 0]):void 0),T(i._zod,"pattern",()=>{let m=f.innerType._zod.pattern;return m?new RegExp(`^(${Me(m.source)})?$`):void 0}),i._zod.parse=(m,h)=>{if(f.innerType._zod.optin==="optional"){let _=m.value,g=f.innerType._zod.run(m,h);if(g instanceof Promise)return g.then((z)=>wo(z,_));return wo(g,_)}if(m.value===void 0)return m;return f.innerType._zod.run(m,h)}}),_n=w("$ZodExactOptional",(i,f)=>{vr.init(i,f),T(i._zod,"values",()=>f.innerType._zod.values),T(i._zod,"pattern",()=>f.innerType._zod.pattern),i._zod.parse=(m,h)=>f.innerType._zod.run(m,h)}),gn=w("$ZodNullable",(i,f)=>{j.init(i,f),T(i._zod,"optin",()=>f.innerType._zod.optin),T(i._zod,"optout",()=>f.innerType._zod.optout),T(i._zod,"pattern",()=>{let m=f.innerType._zod.pattern;return m?new RegExp(`^(${Me(m.source)}|null)$`):void 0}),T(i._zod,"values",()=>f.innerType._zod.values?new Set([...f.innerType._zod.values,null]):void 0),i._zod.parse=(m,h)=>{if(m.value===null)return m;return f.innerType._zod.run(m,h)}}),xn=w("$ZodDefault",(i,f)=>{j.init(i,f),i._zod.optin="optional",T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);if(m.value===void 0)return m.value=f.defaultValue,m;let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>ko(g,f));return ko(_,f)}});function ko(i,f){if(i.value===void 0)i.value=f.defaultValue;return i}var zn=w("$ZodPrefault",(i,f)=>{j.init(i,f),i._zod.optin="optional",T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);if(m.value===void 0)m.value=f.defaultValue;return f.innerType._zod.run(m,h)}}),vn=w("$ZodNonOptional",(i,f)=>{j.init(i,f),T(i._zod,"values",()=>{let m=f.innerType._zod.values;return m?new Set([...m].filter((h)=>h!==void 0)):void 0}),i._zod.parse=(m,h)=>{let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>Zo(g,i));return Zo(_,i)}});function Zo(i,f){if(!i.issues.length&&i.value===void 0)i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:f});return i}var yn=w("$ZodCatch",(i,f)=>{j.init(i,f),i._zod.optin="optional",T(i._zod,"optout",()=>f.innerType._zod.optout),T(i._zod,"values",()=>f.innerType._zod.values),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>{if(m.value=g.value,g.issues.length)m.value=f.catchValue({...m,error:{issues:g.issues.map((z)=>K(z,h,S()))},input:m.value}),m.issues=[],m.fallback=!0;return m});if(m.value=_.value,_.issues.length)m.value=f.catchValue({...m,error:{issues:_.issues.map((g)=>K(g,h,S()))},input:m.value}),m.issues=[],m.fallback=!0;return m}});var yr=w("$ZodPipe",(i,f)=>{j.init(i,f),T(i._zod,"values",()=>f.in._zod.values),T(i._zod,"optin",()=>f.in._zod.optin),T(i._zod,"optout",()=>f.out._zod.optout),T(i._zod,"propValues",()=>f.in._zod.propValues),i._zod.parse=(m,h)=>{if(h.direction==="backward"){let g=f.out._zod.run(m,h);if(g instanceof Promise)return g.then((z)=>Ge(z,f.in,h));return Ge(g,f.in,h)}let _=f.in._zod.run(m,h);if(_ instanceof Promise)return _.then((g)=>Ge(g,f.out,h));return Ge(_,f.out,h)}});function Ge(i,f,m){if(i.issues.length)return i.aborted=!0,i;return f._zod.run({value:i.value,issues:i.issues,fallback:i.fallback},m)}var $n=w("$ZodPreprocess",(i,f)=>{yr.init(i,f)}),bn=w("$ZodReadonly",(i,f)=>{j.init(i,f),T(i._zod,"propValues",()=>f.innerType._zod.propValues),T(i._zod,"values",()=>f.innerType._zod.values),T(i._zod,"optin",()=>f.innerType?._zod?.optin),T(i._zod,"optout",()=>f.innerType?._zod?.optout),i._zod.parse=(m,h)=>{if(h.direction==="backward")return f.innerType._zod.run(m,h);let _=f.innerType._zod.run(m,h);if(_ instanceof Promise)return _.then(Po);return Po(_)}});function Po(i){return i.value=Object.freeze(i.value),i}var wn=w("$ZodLazy",(i,f)=>{j.init(i,f),T(i._zod,"innerType",()=>{let m=f;if(!m._cachedInner)m._cachedInner=f.getter();return m._cachedInner}),T(i._zod,"pattern",()=>i._zod.innerType?._zod?.pattern),T(i._zod,"propValues",()=>i._zod.innerType?._zod?.propValues),T(i._zod,"optin",()=>i._zod.innerType?._zod?.optin??void 0),T(i._zod,"optout",()=>i._zod.innerType?._zod?.optout??void 0),i._zod.parse=(m,h)=>i._zod.innerType._zod.run(m,h)}),kn=w("$ZodCustom",(i,f)=>{B.init(i,f),j.init(i,f),i._zod.parse=(m,h)=>m,i._zod.check=(m)=>{let h=m.value,_=f.fn(h);if(_ instanceof Promise)return _.then((g)=>So(g,m,h,i));So(_,m,h,i);return}});function So(i,f,m,h){if(!i){let _={code:"custom",input:m,inst:h,path:[...h._zod.def.path??[]],continue:!h._zod.def.abort};if(h._zod.def.params)_.params=h._zod.def.params;f.issues.push(le(_))}}var Zn,Uc=Symbol("ZodOutput"),Mc=Symbol("ZodInput");class Pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...f){let m=f[0];if(this._map.set(i,m),m&&typeof m==="object"&&"id"in m)this._idmap.set(m.id,i);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){let f=this._map.get(i);if(f&&typeof f==="object"&&"id"in f)this._idmap.delete(f.id);return this._map.delete(i),this}get(i){let f=i._zod.parent;if(f){let m={...this.get(f)??{}};delete m.id;let h={...m,...this._map.get(i)};return Object.keys(h).length?h:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function di(){return new Pn}(Zn=globalThis).__zod_globalRegistry??(Zn.__zod_globalRegistry=di());var fe=globalThis.__zod_globalRegistry;function Sn(i,f){return new i({type:"string",...P(f)})}function $r(i,f){return new i({type:"string",format:"email",check:"string_format",abort:!1,...P(f)})}function br(i,f){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...P(f)})}function On(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...P(f)})}function En(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(f)})}function In(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(f)})}function Tn(i,f){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(f)})}function wr(i,f){return new i({type:"string",format:"url",check:"string_format",abort:!1,...P(f)})}function Nn(i,f){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...P(f)})}function An(i,f){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(f)})}function jn(i,f){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...P(f)})}function Cn(i,f){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(f)})}function Rn(i,f){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...P(f)})}function Dn(i,f){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...P(f)})}function Ln(i,f){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(f)})}function Fn(i,f){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(f)})}function Un(i,f){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(f)})}function Mn(i,f){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(f)})}function Jn(i,f){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(f)})}function Bn(i,f){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...P(f)})}function Vn(i,f){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...P(f)})}function Wn(i,f){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...P(f)})}function Kn(i,f){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...P(f)})}function Gn(i,f){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(f)})}function qn(i,f){return new i({type:"string",format:"date",check:"string_format",...P(f)})}function Yn(i,f){return new i({type:"string",format:"time",check:"string_format",precision:null,...P(f)})}function Xn(i,f){return new i({type:"string",format:"duration",check:"string_format",...P(f)})}function Hn(i,f){return new i({type:"number",checks:[],...P(f)})}function Ee(i,f){return new i({type:"number",coerce:!0,checks:[],...P(f)})}function Qn(i,f){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...P(f)})}function es(i,f){return new i({type:"boolean",...P(f)})}function rs(i,f){return new i({type:"null",...P(f)})}function ts(i){return new i({type:"any"})}function os(i){return new i({type:"unknown"})}function ns(i,f){return new i({type:"never",...P(f)})}function Xe(i,f){return new mr({check:"less_than",...P(f),value:i,inclusive:!1})}function Se(i,f){return new mr({check:"less_than",...P(f),value:i,inclusive:!0})}function He(i,f){return new hr({check:"greater_than",...P(f),value:i,inclusive:!1})}function Ie(i,f){return new hr({check:"greater_than",...P(f),value:i,inclusive:!0})}function Qe(i,f){return new io({check:"multiple_of",...P(f),value:i})}function er(i,f){return new uo({check:"max_length",...P(f),maximum:i})}function xe(i,f){return new ao({check:"min_length",...P(f),minimum:i})}function rr(i,f){return new po({check:"length_equals",...P(f),length:i})}function kr(i,f){return new lo({check:"string_format",format:"regex",...P(f),pattern:i})}function Zr(i){return new fo({check:"string_format",format:"lowercase",...P(i)})}function Pr(i){return new mo({check:"string_format",format:"uppercase",...P(i)})}function Sr(i,f){return new ho({check:"string_format",format:"includes",...P(f),includes:i})}function Or(i,f){return new _o({check:"string_format",format:"starts_with",...P(f),prefix:i})}function Er(i,f){return new go({check:"string_format",format:"ends_with",...P(f),suffix:i})}function ie(i){return new xo({check:"overwrite",tx:i})}function Ir(i){return ie((f)=>f.normalize(i))}function Tr(){return ie((i)=>i.trim())}function Nr(){return ie((i)=>i.toLowerCase())}function Ar(){return ie((i)=>i.toUpperCase())}function jr(){return ie((i)=>ft(i))}function ss(i,f,m){return new i({type:"array",element:f,...P(m)})}function is(i,f,m){return new i({type:"custom",check:"custom",fn:f,...P(m)})}function cs(i,f){let m=mi((h)=>(h.addIssue=(_)=>{if(typeof _==="string")h.issues.push(le(_,h.value,m._zod.def));else{let g=_;if(g.fatal)g.continue=!1;g.code??(g.code="custom"),g.input??(g.input=h.value),g.inst??(g.inst=m),g.continue??(g.continue=!m._zod.def.abort),h.issues.push(le(g))}},i(h.value,h)),f);return m}function mi(i,f){let m=new B({check:"custom",...P(f)});return m._zod.check=i,m}function Ae(i){let f=i?.target??"draft-2020-12";if(f==="draft-4")f="draft-04";if(f==="draft-7")f="draft-07";return{processors:i.processors??{},metadataRegistry:i?.metadata??fe,target:f,unrepresentable:i?.unrepresentable??"throw",override:i?.override??(()=>{}),io:i?.io??"output",counter:0,seen:new Map,cycles:i?.cycles??"ref",reused:i?.reused??"inline",external:i?.external??void 0}}function R(i,f,m={path:[],schemaPath:[]}){var h;let _=i._zod.def,g=f.seen.get(i);if(g){if(g.count++,m.schemaPath.includes(i))g.cycle=m.path;return g.schema}let z={schema:{},count:1,cycle:void 0,path:m.path};f.seen.set(i,z);let v=i._zod.toJSONSchema?.();if(v)z.schema=v;else{let Z={...m,schemaPath:[...m.schemaPath,i],path:m.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(f,z.schema,Z);else{let I=z.schema,E=f.processors[_.type];if(!E)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);E(i,f,I,Z)}let O=i._zod.parent;if(O){if(!z.ref)z.ref=O;R(O,f,Z),f.seen.get(O).isParent=!0}}let y=f.metadataRegistry.get(i);if(y)Object.assign(z.schema,y);if(f.io==="input"&&V(i))delete z.schema.examples,delete z.schema.default;if(f.io==="input"&&"_prefault"in z.schema)(h=z.schema).default??(h.default=z.schema._prefault);return delete z.schema._prefault,f.seen.get(i).schema}function je(i,f){let m=i.seen.get(f);if(!m)throw Error("Unprocessed schema. This is a bug in Zod.");let h=new Map;for(let z of i.seen.entries()){let v=i.metadataRegistry.get(z[0])?.id;if(v){let y=h.get(v);if(y&&y!==z[0])throw Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);h.set(v,z[0])}}let _=(z)=>{let v=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let O=i.external.registry.get(z[0])?.id,I=i.external.uri??((N)=>N);if(O)return{ref:I(O)};let E=z[1].defId??z[1].schema.id??`schema${i.counter++}`;return z[1].defId=E,{defId:E,ref:`${I("__shared")}#/${v}/${E}`}}if(z[1]===m)return{ref:"#"};let b=`${"#"}/${v}/`,Z=z[1].schema.id??`__schema${i.counter++}`;return{defId:Z,ref:b+Z}},g=(z)=>{if(z[1].schema.$ref)return;let v=z[1],{ref:y,defId:b}=_(z);if(v.def={...v.schema},b)v.defId=b;let Z=v.schema;for(let O in Z)delete Z[O];Z.$ref=y};if(i.cycles==="throw")for(let z of i.seen.entries()){let v=z[1];if(v.cycle)throw Error(`Cycle detected: #/${v.cycle?.join("/")}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let z of i.seen.entries()){let v=z[1];if(f===z[0]){g(z);continue}if(i.external){let w=i.external.registry.get(z[0])?.id;if(f!==z[0]&&w){g(z);continue}}if(i.metadataRegistry.get(z[0])?.id){g(z);continue}if(v.cycle){g(z);continue}if(v.count>1){if(i.reused==="ref"){g(z);continue}}}}function Re(i,f){let m=i.seen.get(f);if(!m)throw Error("Unprocessed schema. This is a bug in Zod.");let h=(v)=>{let b=i.seen.get(v);if(b.ref===null)return;let w=b.def??b.schema,Z={...w},S=b.ref;if(b.ref=null,S){h(S);let O=i.seen.get(S),N=O.schema;if(N.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"))w.allOf=w.allOf??[],w.allOf.push(N);else Object.assign(w,N);if(Object.assign(w,Z),v._zod.parent===S)for(let J in w){if(J==="$ref"||J==="allOf")continue;if(!(J in Z))delete w[J]}if(N.$ref&&O.def)for(let J in w){if(J==="$ref"||J==="allOf")continue;if(J in O.def&&JSON.stringify(w[J])===JSON.stringify(O.def[J]))delete w[J]}}let E=v._zod.parent;if(E&&E!==S){h(E);let O=i.seen.get(E);if(O?.schema.$ref){if(w.$ref=O.schema.$ref,O.def)for(let N in w){if(N==="$ref"||N==="allOf")continue;if(N in O.def&&JSON.stringify(w[N])===JSON.stringify(O.def[N]))delete w[N]}}}i.override({zodSchema:v,jsonSchema:w,path:b.path??[]})};for(let v of[...i.seen.entries()].reverse())h(v[0]);let _={};if(i.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if(i.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if(i.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if(i.target==="openapi-3.0");if(i.external?.uri){let v=i.external.registry.get(f)?.id;if(!v)throw Error("Schema is missing an `id` property");_.$id=i.external.uri(v)}Object.assign(_,m.def??m.schema);let g=i.metadataRegistry.get(f)?.id;if(g!==void 0&&_.id===g)delete _.id;let z=i.external?.defs??{};for(let v of i.seen.entries()){let b=v[1];if(b.def&&b.defId){if(b.def.id===b.defId)delete b.def.id;z[b.defId]=b.def}}if(i.external);else if(Object.keys(z).length>0)if(i.target==="draft-2020-12")_.$defs=z;else _.definitions=z;try{let v=JSON.parse(JSON.stringify(_));return Object.defineProperty(v,"~standard",{value:{...f["~standard"],jsonSchema:{input:Ne(f,"input",i.processors),output:Ne(f,"output",i.processors)}},enumerable:!1,writable:!1}),v}catch(v){throw Error("Error converting schema to JSON.")}}function W(i,f){let m=f??{seen:new Set};if(m.seen.has(i))return!1;m.seen.add(i);let h=i._zod.def;if(h.type==="transform")return!0;if(h.type==="array")return W(h.element,m);if(h.type==="set")return W(h.valueType,m);if(h.type==="lazy")return W(h.getter(),m);if(h.type==="promise"||h.type==="optional"||h.type==="nonoptional"||h.type==="nullable"||h.type==="readonly"||h.type==="default"||h.type==="prefault")return W(h.innerType,m);if(h.type==="intersection")return W(h.left,m)||W(h.right,m);if(h.type==="record"||h.type==="map")return W(h.keyType,m)||W(h.valueType,m);if(h.type==="pipe"){if(i._zod.traits.has("$ZodCodec"))return!0;return W(h.in,m)||W(h.out,m)}if(h.type==="object"){for(let _ in h.shape)if(W(h.shape[_],m))return!0;return!1}if(h.type==="union"){for(let _ of h.options)if(W(_,m))return!0;return!1}if(h.type==="tuple"){for(let _ of h.items)if(W(_,m))return!0;if(h.rest&&W(h.rest,m))return!0;return!1}return!1}var us=(i,f={})=>(m)=>{let h=Ae({...m,processors:f});return D(i,h),je(h,i),Re(h,i)},Ne=(i,f,m={})=>(h)=>{let{libraryOptions:_,target:g}=h??{},z=Ae({..._??{},target:g,io:f,processors:m});return D(i,z),je(z,i),Re(z,i)};var hi={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cr=(i,f,m,h)=>{let _=m;_.type="string";let{minimum:g,maximum:z,format:v,patterns:b,contentEncoding:w}=i._zod.bag;if(typeof g==="number")_.minLength=g;if(typeof z==="number")_.maxLength=z;if(v){if(_.format=hi[v]??v,_.format==="")delete _.format;if(v==="time")delete _.format}if(w)_.contentEncoding=w;if(b&&b.size>0){let Z=[...b];if(Z.length===1)_.pattern=Z[0].source;else if(Z.length>1)_.allOf=[...Z.map((S)=>({...f.target==="draft-07"||f.target==="draft-04"||f.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))]}},Rr=(i,f,m,h)=>{let _=m,{minimum:g,maximum:z,format:v,multipleOf:b,exclusiveMaximum:w,exclusiveMinimum:Z}=i._zod.bag;if(typeof v==="string"&&v.includes("int"))_.type="integer";else _.type="number";let S=typeof Z==="number"&&Z>=(g??Number.NEGATIVE_INFINITY),E=typeof w==="number"&&w<=(z??Number.POSITIVE_INFINITY),O=f.target==="draft-04"||f.target==="openapi-3.0";if(S)if(O)_.minimum=Z,_.exclusiveMinimum=!0;else _.exclusiveMinimum=Z;else if(typeof g==="number")_.minimum=g;if(E)if(O)_.maximum=w,_.exclusiveMaximum=!0;else _.exclusiveMaximum=w;else if(typeof z==="number")_.maximum=z;if(typeof b==="number")_.multipleOf=b},Dr=(i,f,m,h)=>{m.type="boolean"},ps=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},ls=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Lr=(i,f,m,h)=>{if(f.target==="openapi-3.0")m.type="string",m.nullable=!0,m.enum=[null];else m.type="null"},fs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ds=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Fr=(i,f,m,h)=>{m.not={}},Ur=(i,f,m,h)=>{},Mr=(i,f,m,h)=>{},ms=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Jr=(i,f,m,h)=>{let _=i._zod.def,g=Fe(_.entries);if(g.every((z)=>typeof z==="number"))m.type="number";if(g.every((z)=>typeof z==="string"))m.type="string";m.enum=g},Br=(i,f,m,h)=>{let _=i._zod.def,g=[];for(let z of _.values)if(z===void 0){if(f.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof z==="bigint")if(f.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else g.push(Number(z));else g.push(z);if(g.length===0);else if(g.length===1){let z=g[0];if(m.type=z===null?"null":typeof z,f.target==="draft-04"||f.target==="openapi-3.0")m.enum=[z];else m.const=z}else{if(g.every((z)=>typeof z==="number"))m.type="number";if(g.every((z)=>typeof z==="string"))m.type="string";if(g.every((z)=>typeof z==="boolean"))m.type="boolean";if(g.every((z)=>z===null))m.type="null";m.enum=g}},hs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},_s=(i,f,m,h)=>{let _=m,g=i._zod.pattern;if(!g)throw Error("Pattern not found in template literal");_.type="string",_.pattern=g.source},gs=(i,f,m,h)=>{let _=m,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:z,maximum:v,mime:b}=i._zod.bag;if(z!==void 0)g.minLength=z;if(v!==void 0)g.maxLength=v;if(b)if(b.length===1)g.contentMediaType=b[0],Object.assign(_,g);else Object.assign(_,g),_.anyOf=b.map((w)=>({contentMediaType:w}));else Object.assign(_,g)},xs=(i,f,m,h)=>{m.type="boolean"},Vr=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},zs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Wr=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},vs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ys=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Kr=(i,f,m,h)=>{let _=m,g=i._zod.def,{minimum:z,maximum:v}=i._zod.bag;if(typeof z==="number")_.minItems=z;if(typeof v==="number")_.maxItems=v;_.type="array",_.items=D(g.element,f,{...h,path:[...h.path,"items"]})},Gr=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="object",_.properties={};let z=g.shape;for(let w in z)_.properties[w]=D(z[w],f,{...h,path:[...h.path,"properties",w]});let v=new Set(Object.keys(z)),b=new Set([...v].filter((w)=>{let Z=g.shape[w]._zod;if(f.io==="input")return Z.optin===void 0;else return Z.optout===void 0}));if(b.size>0)_.required=Array.from(b);if(g.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!g.catchall){if(f.io==="output")_.additionalProperties=!1}else if(g.catchall)_.additionalProperties=D(g.catchall,f,{...h,path:[...h.path,"additionalProperties"]})},qr=(i,f,m,h)=>{let _=i._zod.def,g=_.inclusive===!1,z=_.options.map((v,b)=>D(v,f,{...h,path:[...h.path,g?"oneOf":"anyOf",b]}));if(g)m.oneOf=z;else m.anyOf=z},Yr=(i,f,m,h)=>{let _=i._zod.def,g=D(_.left,f,{...h,path:[...h.path,"allOf",0]}),z=D(_.right,f,{...h,path:[...h.path,"allOf",1]}),v=(w)=>("allOf"in w)&&Object.keys(w).length===1,b=[...v(g)?g.allOf:[g],...v(z)?z.allOf:[z]];m.allOf=b},$s=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="array";let z=f.target==="draft-2020-12"?"prefixItems":"items",v=f.target==="draft-2020-12"?"items":f.target==="openapi-3.0"?"items":"additionalItems",b=g.items.map((E,O)=>D(E,f,{...h,path:[...h.path,z,O]})),w=g.rest?D(g.rest,f,{...h,path:[...h.path,v,...f.target==="openapi-3.0"?[g.items.length]:[]]}):null;if(f.target==="draft-2020-12"){if(_.prefixItems=b,w)_.items=w}else if(f.target==="openapi-3.0"){if(_.items={anyOf:b},w)_.items.anyOf.push(w);if(_.minItems=b.length,!w)_.maxItems=b.length}else if(_.items=b,w)_.additionalItems=w;let{minimum:Z,maximum:S}=i._zod.bag;if(typeof Z==="number")_.minItems=Z;if(typeof S==="number")_.maxItems=S},Xr=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="object";let z=g.keyType,b=z._zod.bag?.patterns;if(g.mode==="loose"&&b&&b.size>0){let Z=D(g.valueType,f,{...h,path:[...h.path,"patternProperties","*"]});_.patternProperties={};for(let S of b)_.patternProperties[S.source]=Z}else{if(f.target==="draft-07"||f.target==="draft-2020-12")_.propertyNames=D(g.keyType,f,{...h,path:[...h.path,"propertyNames"]});_.additionalProperties=D(g.valueType,f,{...h,path:[...h.path,"additionalProperties"]})}let w=z._zod.values;if(w){let Z=[...w].filter((S)=>typeof S==="string"||typeof S==="number");if(Z.length>0)_.required=Z}},Hr=(i,f,m,h)=>{let _=i._zod.def,g=D(_.innerType,f,h),z=f.seen.get(i);if(f.target==="openapi-3.0")z.ref=_.innerType,m.nullable=!0;else m.anyOf=[g,{type:"null"}]},Qr=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},et=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType,m.default=JSON.parse(JSON.stringify(_.defaultValue))},rt=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);if(g.ref=_.innerType,f.io==="input")m._prefault=JSON.parse(JSON.stringify(_.defaultValue))},tt=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType;let z;try{z=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=z},ot=(i,f,m,h)=>{let _=i._zod.def,g=_.in._zod.traits.has("$ZodTransform"),z=f.io==="input"?g?_.out:_.in:_.out;D(z,f,h);let v=f.seen.get(i);v.ref=z},nt=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType,m.readOnly=!0},bs=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},tr=(i,f,m,h)=>{let _=i._zod.def;D(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},st=(i,f,m,h)=>{let _=i._zod.innerType;D(_,f,h);let g=f.seen.get(i);g.ref=_},as={string:Cr,number:Rr,boolean:Dr,bigint:ps,symbol:ls,null:Lr,undefined:fs,void:ds,never:Fr,any:Ur,unknown:Mr,date:ms,enum:Jr,literal:Br,nan:hs,template_literal:_s,file:gs,success:xs,custom:Vr,function:zs,transform:Wr,map:vs,set:ys,array:Kr,object:Gr,union:qr,intersection:Yr,tuple:$s,record:Xr,nullable:Hr,nonoptional:Qr,default:et,prefault:rt,catch:tt,pipe:ot,readonly:nt,promise:bs,optional:tr,lazy:st};function me(i,f){if("_idmap"in i){let h=i,_=Ae({...f,processors:as}),g={};for(let b of h._idmap.entries()){let[w,Z]=b;D(Z,_)}let z={},v={registry:h,uri:f?.uri,defs:g};_.external=v;for(let b of h._idmap.entries()){let[w,Z]=b;je(_,Z),z[w]=Re(_,Z)}if(Object.keys(g).length>0){let b=_.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[b]:g}}return{schemas:z}}let m=Ae({...f,processors:as});return D(i,m),je(m,i),Re(m,i)}var $i=k("ZodISODateTime",(i,f)=>{Fo.init(i,f),U.init(i,f)});function j(i){return Gn($i,i)}var bi=k("ZodISODate",(i,f)=>{Uo.init(i,f),U.init(i,f)});function he(i){return qn(bi,i)}var wi=k("ZodISOTime",(i,f)=>{Mo.init(i,f),U.init(i,f)});function ws(i){return Yn(wi,i)}var ki=k("ZodISODuration",(i,f)=>{Jo.init(i,f),U.init(i,f)});function ks(i){return Xn(ki,i)}var Si=(i,f)=>{Be.init(i,f),i.name="ZodError",Object.defineProperties(i,{format:{value:(m)=>vt(i,m)},flatten:{value:(m)=>zt(i,m)},addIssue:{value:(m)=>{i.issues.push(m),i.message=JSON.stringify(i.issues,$e,2)}},addIssues:{value:(m)=>{i.issues.push(...m),i.message=JSON.stringify(i.issues,$e,2)}},isEmpty:{get(){return i.issues.length===0}}})};var K=k("ZodError",Si,{Parent:Error});var Zs=Ve(K),Ps=We(K),ne=we(K),Ss=Ze(K),Os=bt(K),Es=wt(K),Is=kt(K),Ts=Zt(K),Ns=Pt(K),As=St(K),js=Ot(K),Cs=Et(K);var Rs=new WeakMap;function De(i,f,m){let h=Object.getPrototypeOf(i),_=Rs.get(h);if(!_)_=new Set,Rs.set(h,_);if(_.has(f))return;_.add(f);for(let g in m){let z=m[g];Object.defineProperty(h,g,{configurable:!0,enumerable:!1,get(){let v=z.bind(this);return Object.defineProperty(this,g,{configurable:!0,writable:!0,enumerable:!0,value:v}),v},set(v){Object.defineProperty(this,g,{configurable:!0,writable:!0,enumerable:!0,value:v})}})}}var L=k("ZodType",(i,f)=>(A.init(i,f),Object.assign(i["~standard"],{jsonSchema:{input:Ne(i,"input"),output:Ne(i,"output")}}),i.toJSONSchema=us(i,{}),i.def=f,i.type=f.type,Object.defineProperty(i,"_def",{value:f}),i.parse=(m,h)=>Zs(i,m,h,{callee:i.parse}),i.safeParse=(m,h)=>ne(i,m,h),i.parseAsync=async(m,h)=>Ps(i,m,h,{callee:i.parseAsync}),i.safeParseAsync=async(m,h)=>Ss(i,m,h),i.spa=i.safeParseAsync,i.encode=(m,h)=>Os(i,m,h),i.decode=(m,h)=>Es(i,m,h),i.encodeAsync=async(m,h)=>Is(i,m,h),i.decodeAsync=async(m,h)=>Ts(i,m,h),i.safeEncode=(m,h)=>Ns(i,m,h),i.safeDecode=(m,h)=>As(i,m,h),i.safeEncodeAsync=async(m,h)=>js(i,m,h),i.safeDecodeAsync=async(m,h)=>Cs(i,m,h),De(i,"ZodType",{check(...m){let h=this.def;return this.clone(Q(h,{checks:[...h.checks??[],...m.map((_)=>typeof _==="function"?{_zod:{check:_,def:{check:"custom"},onattach:[]}}:_)]}),{parent:!0})},with(...m){return this.check(...m)},clone(m,h){return Y(this,m,h)},brand(){return this},register(m,h){return m.add(this,h),this},refine(m,h){return this.check(zc(m,h))},superRefine(m,h){return this.check(vc(m,h))},overwrite(m){return this.check(ie(m))},optional(){return u(this)},exactOptional(){return sc(this)},nullable(){return Us(this)},nullish(){return u(Us(this))},nonoptional(m){return lc(this,m)},array(){return n(this)},or(m){return c([this,m])},and(m){return C(this,m)},transform(m){return Ms(this,Gs(m))},default(m){return uc(this,m)},prefault(m){return pc(this,m)},catch(m){return dc(this,m)},pipe(m){return Ms(this,m)},readonly(){return _c(this)},describe(m){let h=this.clone();return fe.add(h,{description:m}),h},meta(...m){if(m.length===0)return fe.get(this);let h=this.clone();return fe.add(h,m[0]),h},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(m){return m(this)}}),Object.defineProperty(i,"description",{get(){return fe.get(i)?.description},configurable:!0}),i)),Js=k("_ZodString",(i,f)=>{Ye.init(i,f),L.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Cr(i,h,_,g);let m=i._zod.bag;i.format=m.format??null,i.minLength=m.minimum??null,i.maxLength=m.maximum??null,De(i,"_ZodString",{regex(...h){return this.check(kr(...h))},includes(...h){return this.check(Sr(...h))},startsWith(...h){return this.check(Or(...h))},endsWith(...h){return this.check(Er(...h))},min(...h){return this.check(xe(...h))},max(...h){return this.check(er(...h))},length(...h){return this.check(rr(...h))},nonempty(...h){return this.check(xe(1,...h))},lowercase(h){return this.check(Zr(h))},uppercase(h){return this.check(Pr(h))},trim(){return this.check(Tr())},normalize(...h){return this.check(Ir(...h))},toLowerCase(){return this.check(Nr())},toUpperCase(){return this.check(Ar())},slugify(){return this.check(jr())}})}),Ei=k("ZodString",(i,f)=>{Ye.init(i,f),Js.init(i,f),i.email=(m)=>i.check($r(Bs,m)),i.url=(m)=>i.check(wr(Vs,m)),i.jwt=(m)=>i.check(Kn(Vi,m)),i.emoji=(m)=>i.check(Nn(Ii,m)),i.guid=(m)=>i.check(br(Ds,m)),i.uuid=(m)=>i.check(On(nr,m)),i.uuidv4=(m)=>i.check(En(nr,m)),i.uuidv6=(m)=>i.check(In(nr,m)),i.uuidv7=(m)=>i.check(Tn(nr,m)),i.nanoid=(m)=>i.check(An(Ti,m)),i.guid=(m)=>i.check(br(Ds,m)),i.cuid=(m)=>i.check(jn(Ni,m)),i.cuid2=(m)=>i.check(Cn(Ai,m)),i.ulid=(m)=>i.check(Rn(ji,m)),i.base64=(m)=>i.check(Bn(Mi,m)),i.base64url=(m)=>i.check(Vn(Ji,m)),i.xid=(m)=>i.check(Dn(Ci,m)),i.ksuid=(m)=>i.check(Ln(Ri,m)),i.ipv4=(m)=>i.check(Fn(Di,m)),i.ipv6=(m)=>i.check(Un(Li,m)),i.cidrv4=(m)=>i.check(Mn(Fi,m)),i.cidrv6=(m)=>i.check(Jn(Ui,m)),i.e164=(m)=>i.check(Wn(Bi,m)),i.datetime=(m)=>i.check(j(m)),i.date=(m)=>i.check(he(m)),i.time=(m)=>i.check(ws(m)),i.duration=(m)=>i.check(ks(m))});function e(i){return Sn(Ei,i)}var U=k("ZodStringFormat",(i,f)=>{F.init(i,f),Js.init(i,f)}),Bs=k("ZodEmail",(i,f)=>{Io.init(i,f),U.init(i,f)});function ze(i){return $r(Bs,i)}var Ds=k("ZodGUID",(i,f)=>{Oo.init(i,f),U.init(i,f)});var nr=k("ZodUUID",(i,f)=>{Eo.init(i,f),U.init(i,f)});var Vs=k("ZodURL",(i,f)=>{To.init(i,f),U.init(i,f)});function re(i){return wr(Vs,i)}var Ii=k("ZodEmoji",(i,f)=>{No.init(i,f),U.init(i,f)});var Ti=k("ZodNanoID",(i,f)=>{Ao.init(i,f),U.init(i,f)});var Ni=k("ZodCUID",(i,f)=>{jo.init(i,f),U.init(i,f)});var Ai=k("ZodCUID2",(i,f)=>{Co.init(i,f),U.init(i,f)});var ji=k("ZodULID",(i,f)=>{Ro.init(i,f),U.init(i,f)});var Ci=k("ZodXID",(i,f)=>{Do.init(i,f),U.init(i,f)});var Ri=k("ZodKSUID",(i,f)=>{Lo.init(i,f),U.init(i,f)});var Di=k("ZodIPv4",(i,f)=>{Bo.init(i,f),U.init(i,f)});var Li=k("ZodIPv6",(i,f)=>{Vo.init(i,f),U.init(i,f)});var Fi=k("ZodCIDRv4",(i,f)=>{Wo.init(i,f),U.init(i,f)});var Ui=k("ZodCIDRv6",(i,f)=>{Ko.init(i,f),U.init(i,f)});var Mi=k("ZodBase64",(i,f)=>{qo.init(i,f),U.init(i,f)});var Ji=k("ZodBase64URL",(i,f)=>{Yo.init(i,f),U.init(i,f)});var Bi=k("ZodE164",(i,f)=>{Xo.init(i,f),U.init(i,f)});var Vi=k("ZodJWT",(i,f)=>{Ho.init(i,f),U.init(i,f)});var oe=k("ZodNumber",(i,f)=>{xr.init(i,f),L.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Rr(i,h,_,g),De(i,"ZodNumber",{gt(h,_){return this.check(He(h,_))},gte(h,_){return this.check(Ie(h,_))},min(h,_){return this.check(Ie(h,_))},lt(h,_){return this.check(Xe(h,_))},lte(h,_){return this.check(Se(h,_))},max(h,_){return this.check(Se(h,_))},int(h){return this.check(Ls(h))},safe(h){return this.check(Ls(h))},positive(h){return this.check(He(0,h))},nonnegative(h){return this.check(Ie(0,h))},negative(h){return this.check(Xe(0,h))},nonpositive(h){return this.check(Se(0,h))},multipleOf(h,_){return this.check(Qe(h,_))},step(h,_){return this.check(Qe(h,_))},finite(){return this}});let m=i._zod.bag;i.minValue=Math.max(m.minimum??Number.NEGATIVE_INFINITY,m.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(m.maximum??Number.POSITIVE_INFINITY,m.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(m.format??"").includes("int")||Number.isSafeInteger(m.multipleOf??0.5),i.isFinite=!0,i.format=m.format??null});function o(i){return Hn(oe,i)}var Wi=k("ZodNumberFormat",(i,f)=>{Qo.init(i,f),oe.init(i,f)});function Ls(i){return Qn(Wi,i)}var Ki=k("ZodBoolean",(i,f)=>{en.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Dr(i,m,h,_)});function a(i){return es(Ki,i)}var Gi=k("ZodNull",(i,f)=>{rn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Lr(i,m,h,_)});function I(i){return rs(Gi,i)}var qi=k("ZodAny",(i,f)=>{tn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Ur(i,m,h,_)});function Te(){return ts(qi)}var Yi=k("ZodUnknown",(i,f)=>{on.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Mr(i,m,h,_)});function l(){return os(Yi)}var Xi=k("ZodNever",(i,f)=>{nn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Fr(i,m,h,_)});function Hi(i){return ns(Xi,i)}var Qi=k("ZodArray",(i,f)=>{sn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Kr(i,m,h,_),i.element=f.element,De(i,"ZodArray",{min(m,h){return this.check(xe(m,h))},nonempty(m){return this.check(xe(1,m))},max(m,h){return this.check(er(m,h))},length(m,h){return this.check(rr(m,h))},unwrap(){return this.element}})});function n(i,f){return ss(Qi,i,f)}var Ws=k("ZodObject",(i,f)=>{an.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Gr(i,m,h,_),T(i,"shape",()=>f.shape),De(i,"ZodObject",{keyof(){return p(Object.keys(this._zod.def.shape))},catchall(m){return this.clone({...this._zod.def,catchall:m})},passthrough(){return this.clone({...this._zod.def,catchall:l()})},loose(){return this.clone({...this._zod.def,catchall:l()})},strict(){return this.clone({...this._zod.def,catchall:Hi()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(m){return ti(this,m)},safeExtend(m){return oi(this,m)},merge(m){return ni(this,m)},pick(m){return ei(this,m)},omit(m){return ri(this,m)},partial(...m){return si(qs,this,m[0])},required(...m){return ii(Ys,this,m[0])}})});function t(i,f){let m={type:"object",shape:i??{},...P(f)};return new Ws(m)}function d(i,f){return new Ws({type:"object",shape:i,catchall:l(),...P(f)})}var Ks=k("ZodUnion",(i,f)=>{zr.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>qr(i,m,h,_),i.options=f.options});function c(i,f){return new Ks({type:"union",options:i,...P(f)})}var ec=k("ZodDiscriminatedUnion",(i,f)=>{Ks.init(i,f),pn.init(i,f)});function R(i,f,m){return new ec({type:"union",options:f,discriminator:i,...P(m)})}var rc=k("ZodIntersection",(i,f)=>{ln.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Yr(i,m,h,_)});function C(i,f){return new rc({type:"intersection",left:i,right:f})}var Fs=k("ZodRecord",(i,f)=>{fn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Xr(i,m,h,_),i.keyType=f.keyType,i.valueType=f.valueType});function s(i,f,m){if(!f||!f._zod)return new Fs({type:"record",keyType:e(),valueType:i,...P(f)});return new Fs({type:"record",keyType:i,valueType:f,...P(m)})}var it=k("ZodEnum",(i,f)=>{dn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Jr(i,h,_,g),i.enum=f.entries,i.options=Object.values(f.entries);let m=new Set(Object.keys(f.entries));i.extract=(h,_)=>{let g={};for(let z of h)if(m.has(z))g[z]=f.entries[z];else throw Error(`Key ${z} not found in enum`);return new it({...f,checks:[],...P(_),entries:g})},i.exclude=(h,_)=>{let g={...f.entries};for(let z of h)if(m.has(z))delete g[z];else throw Error(`Key ${z} not found in enum`);return new it({...f,checks:[],...P(_),entries:g})}});function p(i,f){let m=Array.isArray(i)?Object.fromEntries(i.map((h)=>[h,h])):i;return new it({type:"enum",entries:m,...P(f)})}var tc=k("ZodLiteral",(i,f)=>{mn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Br(i,m,h,_),i.values=new Set(f.values),Object.defineProperty(i,"value",{get(){if(f.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return f.values[0]}})});function r(i,f){return new tc({type:"literal",values:Array.isArray(i)?i:[i],...P(f)})}var oc=k("ZodTransform",(i,f)=>{hn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Wr(i,m,h,_),i._zod.parse=(m,h)=>{if(h.direction==="backward")throw new ye(i.constructor.name);m.addIssue=(g)=>{if(typeof g==="string")m.issues.push(le(g,m.value,f));else{let z=g;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=m.value),z.inst??(z.inst=i),m.issues.push(le(z))}};let _=f.transform(m.value,m);if(_ instanceof Promise)return _.then((g)=>(m.value=g,m.fallback=!0,m));return m.value=_,m.fallback=!0,m}});function Gs(i){return new oc({type:"transform",transform:i})}var qs=k("ZodOptional",(i,f)=>{vr.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function u(i){return new qs({type:"optional",innerType:i})}var nc=k("ZodExactOptional",(i,f)=>{_n.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function sc(i){return new nc({type:"optional",innerType:i})}var ic=k("ZodNullable",(i,f)=>{gn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Hr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function Us(i){return new ic({type:"nullable",innerType:i})}var cc=k("ZodDefault",(i,f)=>{xn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>et(i,m,h,_),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function uc(i,f){return new cc({type:"default",innerType:i,get defaultValue(){return typeof f==="function"?f():ar(f)}})}var ac=k("ZodPrefault",(i,f)=>{zn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>rt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function pc(i,f){return new ac({type:"prefault",innerType:i,get defaultValue(){return typeof f==="function"?f():ar(f)}})}var Ys=k("ZodNonOptional",(i,f)=>{vn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Qr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function lc(i,f){return new Ys({type:"nonoptional",innerType:i,...P(f)})}var fc=k("ZodCatch",(i,f)=>{yn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function dc(i,f){return new fc({type:"catch",innerType:i,catchValue:typeof f==="function"?f:()=>f})}var Xs=k("ZodPipe",(i,f)=>{yr.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>ot(i,m,h,_),i.in=f.in,i.out=f.out});function Ms(i,f){return new Xs({type:"pipe",in:i,out:f})}var mc=k("ZodPreprocess",(i,f)=>{Xs.init(i,f),$n.init(i,f)}),hc=k("ZodReadonly",(i,f)=>{bn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>nt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function _c(i){return new hc({type:"readonly",innerType:i})}var gc=k("ZodLazy",(i,f)=>{wn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>st(i,m,h,_),i.unwrap=()=>i._zod.def.getter()});function H(i){return new gc({type:"lazy",getter:i})}var xc=k("ZodCustom",(i,f)=>{kn.init(i,f),L.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Vr(i,m,h,_)});function zc(i,f={}){return is(xc,i,f)}function vc(i,f){return cs(i,f)}function x(i,f){return new mc({type:"pipe",in:Gs(i),out:f})}
66
- export{Ce,y,de,pe,ke,Oe,Ee,me,j,he,ne,e,ze,re,oe,o,a,I,Te,l,n,t,d,c,R,C,s,p,r,u,H,x};
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let z of i.seen.entries()){let v=z[1];if(f===z[0]){g(z);continue}if(i.external){let b=i.external.registry.get(z[0])?.id;if(f!==z[0]&&b){g(z);continue}}if(i.metadataRegistry.get(z[0])?.id){g(z);continue}if(v.cycle){g(z);continue}if(v.count>1){if(i.reused==="ref"){g(z);continue}}}}function Re(i,f){let m=i.seen.get(f);if(!m)throw Error("Unprocessed schema. This is a bug in Zod.");let h=(v)=>{let y=i.seen.get(v);if(y.ref===null)return;let b=y.def??y.schema,Z={...b},O=y.ref;if(y.ref=null,O){h(O);let E=i.seen.get(O),N=E.schema;if(N.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"))b.allOf=b.allOf??[],b.allOf.push(N);else Object.assign(b,N);if(Object.assign(b,Z),v._zod.parent===O)for(let M in b){if(M==="$ref"||M==="allOf")continue;if(!(M in Z))delete b[M]}if(N.$ref&&E.def)for(let M in b){if(M==="$ref"||M==="allOf")continue;if(M in E.def&&JSON.stringify(b[M])===JSON.stringify(E.def[M]))delete b[M]}}let I=v._zod.parent;if(I&&I!==O){h(I);let E=i.seen.get(I);if(E?.schema.$ref){if(b.$ref=E.schema.$ref,E.def)for(let N in b){if(N==="$ref"||N==="allOf")continue;if(N in E.def&&JSON.stringify(b[N])===JSON.stringify(E.def[N]))delete b[N]}}}i.override({zodSchema:v,jsonSchema:b,path:y.path??[]})};for(let v of[...i.seen.entries()].reverse())h(v[0]);let _={};if(i.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if(i.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if(i.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if(i.target==="openapi-3.0");if(i.external?.uri){let v=i.external.registry.get(f)?.id;if(!v)throw Error("Schema is missing an `id` property");_.$id=i.external.uri(v)}Object.assign(_,m.def??m.schema);let g=i.metadataRegistry.get(f)?.id;if(g!==void 0&&_.id===g)delete _.id;let z=i.external?.defs??{};for(let v of i.seen.entries()){let y=v[1];if(y.def&&y.defId){if(y.def.id===y.defId)delete y.def.id;z[y.defId]=y.def}}if(i.external);else if(Object.keys(z).length>0)if(i.target==="draft-2020-12")_.$defs=z;else _.definitions=z;try{let v=JSON.parse(JSON.stringify(_));return Object.defineProperty(v,"~standard",{value:{...f["~standard"],jsonSchema:{input:Ne(f,"input",i.processors),output:Ne(f,"output",i.processors)}},enumerable:!1,writable:!1}),v}catch(v){throw Error("Error converting schema to JSON.")}}function V(i,f){let m=f??{seen:new Set};if(m.seen.has(i))return!1;m.seen.add(i);let h=i._zod.def;if(h.type==="transform")return!0;if(h.type==="array")return V(h.element,m);if(h.type==="set")return V(h.valueType,m);if(h.type==="lazy")return V(h.getter(),m);if(h.type==="promise"||h.type==="optional"||h.type==="nonoptional"||h.type==="nullable"||h.type==="readonly"||h.type==="default"||h.type==="prefault")return V(h.innerType,m);if(h.type==="intersection")return V(h.left,m)||V(h.right,m);if(h.type==="record"||h.type==="map")return V(h.keyType,m)||V(h.valueType,m);if(h.type==="pipe"){if(i._zod.traits.has("$ZodCodec"))return!0;return V(h.in,m)||V(h.out,m)}if(h.type==="object"){for(let _ in h.shape)if(V(h.shape[_],m))return!0;return!1}if(h.type==="union"){for(let _ of h.options)if(V(_,m))return!0;return!1}if(h.type==="tuple"){for(let _ of h.items)if(V(_,m))return!0;if(h.rest&&V(h.rest,m))return!0;return!1}return!1}var us=(i,f={})=>(m)=>{let h=Ae({...m,processors:f});return R(i,h),je(h,i),Re(h,i)},Ne=(i,f,m={})=>(h)=>{let{libraryOptions:_,target:g}=h??{},z=Ae({..._??{},target:g,io:f,processors:m});return R(i,z),je(z,i),Re(z,i)};var hi={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cr=(i,f,m,h)=>{let _=m;_.type="string";let{minimum:g,maximum:z,format:v,patterns:y,contentEncoding:b}=i._zod.bag;if(typeof g==="number")_.minLength=g;if(typeof z==="number")_.maxLength=z;if(v){if(_.format=hi[v]??v,_.format==="")delete _.format;if(v==="time")delete _.format}if(b)_.contentEncoding=b;if(y&&y.size>0){let Z=[...y];if(Z.length===1)_.pattern=Z[0].source;else if(Z.length>1)_.allOf=[...Z.map((O)=>({...f.target==="draft-07"||f.target==="draft-04"||f.target==="openapi-3.0"?{type:"string"}:{},pattern:O.source}))]}},Rr=(i,f,m,h)=>{let _=m,{minimum:g,maximum:z,format:v,multipleOf:y,exclusiveMaximum:b,exclusiveMinimum:Z}=i._zod.bag;if(typeof v==="string"&&v.includes("int"))_.type="integer";else _.type="number";let O=typeof Z==="number"&&Z>=(g??Number.NEGATIVE_INFINITY),I=typeof b==="number"&&b<=(z??Number.POSITIVE_INFINITY),E=f.target==="draft-04"||f.target==="openapi-3.0";if(O)if(E)_.minimum=Z,_.exclusiveMinimum=!0;else _.exclusiveMinimum=Z;else if(typeof g==="number")_.minimum=g;if(I)if(E)_.maximum=b,_.exclusiveMaximum=!0;else _.exclusiveMaximum=b;else if(typeof z==="number")_.maximum=z;if(typeof y==="number")_.multipleOf=y},Dr=(i,f,m,h)=>{m.type="boolean"},ps=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},ls=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Lr=(i,f,m,h)=>{if(f.target==="openapi-3.0")m.type="string",m.nullable=!0,m.enum=[null];else m.type="null"},fs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ds=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Fr=(i,f,m,h)=>{m.not={}},Ur=(i,f,m,h)=>{},Mr=(i,f,m,h)=>{},ms=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Jr=(i,f,m,h)=>{let _=i._zod.def,g=Fe(_.entries);if(g.every((z)=>typeof z==="number"))m.type="number";if(g.every((z)=>typeof z==="string"))m.type="string";m.enum=g},Br=(i,f,m,h)=>{let _=i._zod.def,g=[];for(let z of _.values)if(z===void 0){if(f.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof z==="bigint")if(f.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else g.push(Number(z));else g.push(z);if(g.length===0);else if(g.length===1){let z=g[0];if(m.type=z===null?"null":typeof z,f.target==="draft-04"||f.target==="openapi-3.0")m.enum=[z];else m.const=z}else{if(g.every((z)=>typeof z==="number"))m.type="number";if(g.every((z)=>typeof z==="string"))m.type="string";if(g.every((z)=>typeof z==="boolean"))m.type="boolean";if(g.every((z)=>z===null))m.type="null";m.enum=g}},hs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},_s=(i,f,m,h)=>{let _=m,g=i._zod.pattern;if(!g)throw Error("Pattern not found in template literal");_.type="string",_.pattern=g.source},gs=(i,f,m,h)=>{let _=m,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:z,maximum:v,mime:y}=i._zod.bag;if(z!==void 0)g.minLength=z;if(v!==void 0)g.maxLength=v;if(y)if(y.length===1)g.contentMediaType=y[0],Object.assign(_,g);else Object.assign(_,g),_.anyOf=y.map((b)=>({contentMediaType:b}));else Object.assign(_,g)},xs=(i,f,m,h)=>{m.type="boolean"},Vr=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},zs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Wr=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},vs=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ys=(i,f,m,h)=>{if(f.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Kr=(i,f,m,h)=>{let _=m,g=i._zod.def,{minimum:z,maximum:v}=i._zod.bag;if(typeof z==="number")_.minItems=z;if(typeof v==="number")_.maxItems=v;_.type="array",_.items=R(g.element,f,{...h,path:[...h.path,"items"]})},Gr=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="object",_.properties={};let z=g.shape;for(let b in z)_.properties[b]=R(z[b],f,{...h,path:[...h.path,"properties",b]});let v=new Set(Object.keys(z)),y=new Set([...v].filter((b)=>{let Z=g.shape[b]._zod;if(f.io==="input")return Z.optin===void 0;else return Z.optout===void 0}));if(y.size>0)_.required=Array.from(y);if(g.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!g.catchall){if(f.io==="output")_.additionalProperties=!1}else if(g.catchall)_.additionalProperties=R(g.catchall,f,{...h,path:[...h.path,"additionalProperties"]})},qr=(i,f,m,h)=>{let _=i._zod.def,g=_.inclusive===!1,z=_.options.map((v,y)=>R(v,f,{...h,path:[...h.path,g?"oneOf":"anyOf",y]}));if(g)m.oneOf=z;else m.anyOf=z},Yr=(i,f,m,h)=>{let _=i._zod.def,g=R(_.left,f,{...h,path:[...h.path,"allOf",0]}),z=R(_.right,f,{...h,path:[...h.path,"allOf",1]}),v=(b)=>("allOf"in b)&&Object.keys(b).length===1,y=[...v(g)?g.allOf:[g],...v(z)?z.allOf:[z]];m.allOf=y},$s=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="array";let z=f.target==="draft-2020-12"?"prefixItems":"items",v=f.target==="draft-2020-12"?"items":f.target==="openapi-3.0"?"items":"additionalItems",y=g.items.map((I,E)=>R(I,f,{...h,path:[...h.path,z,E]})),b=g.rest?R(g.rest,f,{...h,path:[...h.path,v,...f.target==="openapi-3.0"?[g.items.length]:[]]}):null;if(f.target==="draft-2020-12"){if(_.prefixItems=y,b)_.items=b}else if(f.target==="openapi-3.0"){if(_.items={anyOf:y},b)_.items.anyOf.push(b);if(_.minItems=y.length,!b)_.maxItems=y.length}else if(_.items=y,b)_.additionalItems=b;let{minimum:Z,maximum:O}=i._zod.bag;if(typeof Z==="number")_.minItems=Z;if(typeof O==="number")_.maxItems=O},Xr=(i,f,m,h)=>{let _=m,g=i._zod.def;_.type="object";let z=g.keyType,y=z._zod.bag?.patterns;if(g.mode==="loose"&&y&&y.size>0){let Z=R(g.valueType,f,{...h,path:[...h.path,"patternProperties","*"]});_.patternProperties={};for(let O of y)_.patternProperties[O.source]=Z}else{if(f.target==="draft-07"||f.target==="draft-2020-12")_.propertyNames=R(g.keyType,f,{...h,path:[...h.path,"propertyNames"]});_.additionalProperties=R(g.valueType,f,{...h,path:[...h.path,"additionalProperties"]})}let b=z._zod.values;if(b){let Z=[...b].filter((O)=>typeof O==="string"||typeof O==="number");if(Z.length>0)_.required=Z}},Hr=(i,f,m,h)=>{let _=i._zod.def,g=R(_.innerType,f,h),z=f.seen.get(i);if(f.target==="openapi-3.0")z.ref=_.innerType,m.nullable=!0;else m.anyOf=[g,{type:"null"}]},Qr=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},et=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType,m.default=JSON.parse(JSON.stringify(_.defaultValue))},rt=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);if(g.ref=_.innerType,f.io==="input")m._prefault=JSON.parse(JSON.stringify(_.defaultValue))},tt=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType;let z;try{z=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=z},ot=(i,f,m,h)=>{let _=i._zod.def,g=_.in._zod.traits.has("$ZodTransform"),z=f.io==="input"?g?_.out:_.in:_.out;R(z,f,h);let v=f.seen.get(i);v.ref=z},nt=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType,m.readOnly=!0},bs=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},tr=(i,f,m,h)=>{let _=i._zod.def;R(_.innerType,f,h);let g=f.seen.get(i);g.ref=_.innerType},st=(i,f,m,h)=>{let _=i._zod.innerType;R(_,f,h);let g=f.seen.get(i);g.ref=_},as={string:Cr,number:Rr,boolean:Dr,bigint:ps,symbol:ls,null:Lr,undefined:fs,void:ds,never:Fr,any:Ur,unknown:Mr,date:ms,enum:Jr,literal:Br,nan:hs,template_literal:_s,file:gs,success:xs,custom:Vr,function:zs,transform:Wr,map:vs,set:ys,array:Kr,object:Gr,union:qr,intersection:Yr,tuple:$s,record:Xr,nullable:Hr,nonoptional:Qr,default:et,prefault:rt,catch:tt,pipe:ot,readonly:nt,promise:bs,optional:tr,lazy:st};function me(i,f){if("_idmap"in i){let h=i,_=Ae({...f,processors:as}),g={};for(let y of h._idmap.entries()){let[b,Z]=y;R(Z,_)}let z={},v={registry:h,uri:f?.uri,defs:g};_.external=v;for(let y of h._idmap.entries()){let[b,Z]=y;je(_,Z),z[b]=Re(_,Z)}if(Object.keys(g).length>0){let y=_.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[y]:g}}return{schemas:z}}let m=Ae({...f,processors:as});return R(i,m),je(m,i),Re(m,i)}var $i=w("ZodISODateTime",(i,f)=>{Fo.init(i,f),F.init(i,f)});function q(i){return Gn($i,i)}var bi=w("ZodISODate",(i,f)=>{Uo.init(i,f),F.init(i,f)});function he(i){return qn(bi,i)}var wi=w("ZodISOTime",(i,f)=>{Mo.init(i,f),F.init(i,f)});function ws(i){return Yn(wi,i)}var ki=w("ZodISODuration",(i,f)=>{Jo.init(i,f),F.init(i,f)});function ks(i){return Xn(ki,i)}var Si=(i,f)=>{Be.init(i,f),i.name="ZodError",Object.defineProperties(i,{format:{value:(m)=>vt(i,m)},flatten:{value:(m)=>zt(i,m)},addIssue:{value:(m)=>{i.issues.push(m),i.message=JSON.stringify(i.issues,$e,2)}},addIssues:{value:(m)=>{i.issues.push(...m),i.message=JSON.stringify(i.issues,$e,2)}},isEmpty:{get(){return i.issues.length===0}}})};var W=w("ZodError",Si,{Parent:Error});var Zs=Ve(W),Ps=We(W),ne=we(W),Ss=Ze(W),Os=bt(W),Es=wt(W),Is=kt(W),Ts=Zt(W),Ns=Pt(W),As=St(W),js=Ot(W),Cs=Et(W);var Rs=new WeakMap;function De(i,f,m){let h=Object.getPrototypeOf(i),_=Rs.get(h);if(!_)_=new Set,Rs.set(h,_);if(_.has(f))return;_.add(f);for(let g in m){let z=m[g];Object.defineProperty(h,g,{configurable:!0,enumerable:!1,get(){let v=z.bind(this);return Object.defineProperty(this,g,{configurable:!0,writable:!0,enumerable:!0,value:v}),v},set(v){Object.defineProperty(this,g,{configurable:!0,writable:!0,enumerable:!0,value:v})}})}}var D=w("ZodType",(i,f)=>(j.init(i,f),Object.assign(i["~standard"],{jsonSchema:{input:Ne(i,"input"),output:Ne(i,"output")}}),i.toJSONSchema=us(i,{}),i.def=f,i.type=f.type,Object.defineProperty(i,"_def",{value:f}),i.parse=(m,h)=>Zs(i,m,h,{callee:i.parse}),i.safeParse=(m,h)=>ne(i,m,h),i.parseAsync=async(m,h)=>Ps(i,m,h,{callee:i.parseAsync}),i.safeParseAsync=async(m,h)=>Ss(i,m,h),i.spa=i.safeParseAsync,i.encode=(m,h)=>Os(i,m,h),i.decode=(m,h)=>Es(i,m,h),i.encodeAsync=async(m,h)=>Is(i,m,h),i.decodeAsync=async(m,h)=>Ts(i,m,h),i.safeEncode=(m,h)=>Ns(i,m,h),i.safeDecode=(m,h)=>As(i,m,h),i.safeEncodeAsync=async(m,h)=>js(i,m,h),i.safeDecodeAsync=async(m,h)=>Cs(i,m,h),De(i,"ZodType",{check(...m){let h=this.def;return this.clone(Q(h,{checks:[...h.checks??[],...m.map((_)=>typeof _==="function"?{_zod:{check:_,def:{check:"custom"},onattach:[]}}:_)]}),{parent:!0})},with(...m){return this.check(...m)},clone(m,h){return Y(this,m,h)},brand(){return this},register(m,h){return m.add(this,h),this},refine(m,h){return this.check(zc(m,h))},superRefine(m,h){return this.check(vc(m,h))},overwrite(m){return this.check(ie(m))},optional(){return u(this)},exactOptional(){return sc(this)},nullable(){return Us(this)},nullish(){return u(Us(this))},nonoptional(m){return lc(this,m)},array(){return n(this)},or(m){return c([this,m])},and(m){return k(this,m)},transform(m){return Ms(this,Gs(m))},default(m){return uc(this,m)},prefault(m){return pc(this,m)},catch(m){return dc(this,m)},pipe(m){return Ms(this,m)},readonly(){return _c(this)},describe(m){let h=this.clone();return fe.add(h,{description:m}),h},meta(...m){if(m.length===0)return fe.get(this);let h=this.clone();return fe.add(h,m[0]),h},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(m){return m(this)}}),Object.defineProperty(i,"description",{get(){return fe.get(i)?.description},configurable:!0}),i)),Js=w("_ZodString",(i,f)=>{Ye.init(i,f),D.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Cr(i,h,_,g);let m=i._zod.bag;i.format=m.format??null,i.minLength=m.minimum??null,i.maxLength=m.maximum??null,De(i,"_ZodString",{regex(...h){return this.check(kr(...h))},includes(...h){return this.check(Sr(...h))},startsWith(...h){return this.check(Or(...h))},endsWith(...h){return this.check(Er(...h))},min(...h){return this.check(xe(...h))},max(...h){return this.check(er(...h))},length(...h){return this.check(rr(...h))},nonempty(...h){return this.check(xe(1,...h))},lowercase(h){return this.check(Zr(h))},uppercase(h){return this.check(Pr(h))},trim(){return this.check(Tr())},normalize(...h){return this.check(Ir(...h))},toLowerCase(){return this.check(Nr())},toUpperCase(){return this.check(Ar())},slugify(){return this.check(jr())}})}),Ei=w("ZodString",(i,f)=>{Ye.init(i,f),Js.init(i,f),i.email=(m)=>i.check($r(Bs,m)),i.url=(m)=>i.check(wr(Vs,m)),i.jwt=(m)=>i.check(Kn(Vi,m)),i.emoji=(m)=>i.check(Nn(Ii,m)),i.guid=(m)=>i.check(br(Ds,m)),i.uuid=(m)=>i.check(On(nr,m)),i.uuidv4=(m)=>i.check(En(nr,m)),i.uuidv6=(m)=>i.check(In(nr,m)),i.uuidv7=(m)=>i.check(Tn(nr,m)),i.nanoid=(m)=>i.check(An(Ti,m)),i.guid=(m)=>i.check(br(Ds,m)),i.cuid=(m)=>i.check(jn(Ni,m)),i.cuid2=(m)=>i.check(Cn(Ai,m)),i.ulid=(m)=>i.check(Rn(ji,m)),i.base64=(m)=>i.check(Bn(Mi,m)),i.base64url=(m)=>i.check(Vn(Ji,m)),i.xid=(m)=>i.check(Dn(Ci,m)),i.ksuid=(m)=>i.check(Ln(Ri,m)),i.ipv4=(m)=>i.check(Fn(Di,m)),i.ipv6=(m)=>i.check(Un(Li,m)),i.cidrv4=(m)=>i.check(Mn(Fi,m)),i.cidrv6=(m)=>i.check(Jn(Ui,m)),i.e164=(m)=>i.check(Wn(Bi,m)),i.datetime=(m)=>i.check(q(m)),i.date=(m)=>i.check(he(m)),i.time=(m)=>i.check(ws(m)),i.duration=(m)=>i.check(ks(m))});function e(i){return Sn(Ei,i)}var F=w("ZodStringFormat",(i,f)=>{L.init(i,f),Js.init(i,f)}),Bs=w("ZodEmail",(i,f)=>{Io.init(i,f),F.init(i,f)});function ze(i){return $r(Bs,i)}var Ds=w("ZodGUID",(i,f)=>{Oo.init(i,f),F.init(i,f)});var nr=w("ZodUUID",(i,f)=>{Eo.init(i,f),F.init(i,f)});var Vs=w("ZodURL",(i,f)=>{To.init(i,f),F.init(i,f)});function re(i){return wr(Vs,i)}var Ii=w("ZodEmoji",(i,f)=>{No.init(i,f),F.init(i,f)});var Ti=w("ZodNanoID",(i,f)=>{Ao.init(i,f),F.init(i,f)});var Ni=w("ZodCUID",(i,f)=>{jo.init(i,f),F.init(i,f)});var Ai=w("ZodCUID2",(i,f)=>{Co.init(i,f),F.init(i,f)});var ji=w("ZodULID",(i,f)=>{Ro.init(i,f),F.init(i,f)});var Ci=w("ZodXID",(i,f)=>{Do.init(i,f),F.init(i,f)});var Ri=w("ZodKSUID",(i,f)=>{Lo.init(i,f),F.init(i,f)});var Di=w("ZodIPv4",(i,f)=>{Bo.init(i,f),F.init(i,f)});var Li=w("ZodIPv6",(i,f)=>{Vo.init(i,f),F.init(i,f)});var Fi=w("ZodCIDRv4",(i,f)=>{Wo.init(i,f),F.init(i,f)});var Ui=w("ZodCIDRv6",(i,f)=>{Ko.init(i,f),F.init(i,f)});var Mi=w("ZodBase64",(i,f)=>{qo.init(i,f),F.init(i,f)});var Ji=w("ZodBase64URL",(i,f)=>{Yo.init(i,f),F.init(i,f)});var Bi=w("ZodE164",(i,f)=>{Xo.init(i,f),F.init(i,f)});var Vi=w("ZodJWT",(i,f)=>{Ho.init(i,f),F.init(i,f)});var oe=w("ZodNumber",(i,f)=>{xr.init(i,f),D.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Rr(i,h,_,g),De(i,"ZodNumber",{gt(h,_){return this.check(He(h,_))},gte(h,_){return this.check(Ie(h,_))},min(h,_){return this.check(Ie(h,_))},lt(h,_){return this.check(Xe(h,_))},lte(h,_){return this.check(Se(h,_))},max(h,_){return this.check(Se(h,_))},int(h){return this.check(Ls(h))},safe(h){return this.check(Ls(h))},positive(h){return this.check(He(0,h))},nonnegative(h){return this.check(Ie(0,h))},negative(h){return this.check(Xe(0,h))},nonpositive(h){return this.check(Se(0,h))},multipleOf(h,_){return this.check(Qe(h,_))},step(h,_){return this.check(Qe(h,_))},finite(){return this}});let m=i._zod.bag;i.minValue=Math.max(m.minimum??Number.NEGATIVE_INFINITY,m.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(m.maximum??Number.POSITIVE_INFINITY,m.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(m.format??"").includes("int")||Number.isSafeInteger(m.multipleOf??0.5),i.isFinite=!0,i.format=m.format??null});function o(i){return Hn(oe,i)}var Wi=w("ZodNumberFormat",(i,f)=>{Qo.init(i,f),oe.init(i,f)});function Ls(i){return Qn(Wi,i)}var Ki=w("ZodBoolean",(i,f)=>{en.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Dr(i,m,h,_)});function a(i){return es(Ki,i)}var Gi=w("ZodNull",(i,f)=>{rn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Lr(i,m,h,_)});function x(i){return rs(Gi,i)}var qi=w("ZodAny",(i,f)=>{tn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Ur(i,m,h,_)});function Te(){return ts(qi)}var Yi=w("ZodUnknown",(i,f)=>{on.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Mr(i,m,h,_)});function l(){return os(Yi)}var Xi=w("ZodNever",(i,f)=>{nn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Fr(i,m,h,_)});function Hi(i){return ns(Xi,i)}var Qi=w("ZodArray",(i,f)=>{sn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Kr(i,m,h,_),i.element=f.element,De(i,"ZodArray",{min(m,h){return this.check(xe(m,h))},nonempty(m){return this.check(xe(1,m))},max(m,h){return this.check(er(m,h))},length(m,h){return this.check(rr(m,h))},unwrap(){return this.element}})});function n(i,f){return ss(Qi,i,f)}var Ws=w("ZodObject",(i,f)=>{an.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Gr(i,m,h,_),T(i,"shape",()=>f.shape),De(i,"ZodObject",{keyof(){return p(Object.keys(this._zod.def.shape))},catchall(m){return this.clone({...this._zod.def,catchall:m})},passthrough(){return this.clone({...this._zod.def,catchall:l()})},loose(){return this.clone({...this._zod.def,catchall:l()})},strict(){return this.clone({...this._zod.def,catchall:Hi()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(m){return ti(this,m)},safeExtend(m){return oi(this,m)},merge(m){return ni(this,m)},pick(m){return ei(this,m)},omit(m){return ri(this,m)},partial(...m){return si(qs,this,m[0])},required(...m){return ii(Ys,this,m[0])}})});function t(i,f){let m={type:"object",shape:i??{},...P(f)};return new Ws(m)}function d(i,f){return new Ws({type:"object",shape:i,catchall:l(),...P(f)})}var Ks=w("ZodUnion",(i,f)=>{zr.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>qr(i,m,h,_),i.options=f.options});function c(i,f){return new Ks({type:"union",options:i,...P(f)})}var ec=w("ZodDiscriminatedUnion",(i,f)=>{Ks.init(i,f),pn.init(i,f)});function C(i,f,m){return new ec({type:"union",options:f,discriminator:i,...P(m)})}var rc=w("ZodIntersection",(i,f)=>{ln.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Yr(i,m,h,_)});function k(i,f){return new rc({type:"intersection",left:i,right:f})}var Fs=w("ZodRecord",(i,f)=>{fn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Xr(i,m,h,_),i.keyType=f.keyType,i.valueType=f.valueType});function s(i,f,m){if(!f||!f._zod)return new Fs({type:"record",keyType:e(),valueType:i,...P(f)});return new Fs({type:"record",keyType:i,valueType:f,...P(m)})}var it=w("ZodEnum",(i,f)=>{dn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(h,_,g)=>Jr(i,h,_,g),i.enum=f.entries,i.options=Object.values(f.entries);let m=new Set(Object.keys(f.entries));i.extract=(h,_)=>{let g={};for(let z of h)if(m.has(z))g[z]=f.entries[z];else throw Error(`Key ${z} not found in enum`);return new it({...f,checks:[],...P(_),entries:g})},i.exclude=(h,_)=>{let g={...f.entries};for(let z of h)if(m.has(z))delete g[z];else throw Error(`Key ${z} not found in enum`);return new it({...f,checks:[],...P(_),entries:g})}});function p(i,f){let m=Array.isArray(i)?Object.fromEntries(i.map((h)=>[h,h])):i;return new it({type:"enum",entries:m,...P(f)})}var tc=w("ZodLiteral",(i,f)=>{mn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Br(i,m,h,_),i.values=new Set(f.values),Object.defineProperty(i,"value",{get(){if(f.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return f.values[0]}})});function r(i,f){return new tc({type:"literal",values:Array.isArray(i)?i:[i],...P(f)})}var oc=w("ZodTransform",(i,f)=>{hn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Wr(i,m,h,_),i._zod.parse=(m,h)=>{if(h.direction==="backward")throw new ye(i.constructor.name);m.addIssue=(g)=>{if(typeof g==="string")m.issues.push(le(g,m.value,f));else{let z=g;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=m.value),z.inst??(z.inst=i),m.issues.push(le(z))}};let _=f.transform(m.value,m);if(_ instanceof Promise)return _.then((g)=>(m.value=g,m.fallback=!0,m));return m.value=_,m.fallback=!0,m}});function Gs(i){return new oc({type:"transform",transform:i})}var qs=w("ZodOptional",(i,f)=>{vr.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function u(i){return new qs({type:"optional",innerType:i})}var nc=w("ZodExactOptional",(i,f)=>{_n.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function sc(i){return new nc({type:"optional",innerType:i})}var ic=w("ZodNullable",(i,f)=>{gn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Hr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function Us(i){return new ic({type:"nullable",innerType:i})}var cc=w("ZodDefault",(i,f)=>{xn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>et(i,m,h,_),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function uc(i,f){return new cc({type:"default",innerType:i,get defaultValue(){return typeof f==="function"?f():ar(f)}})}var ac=w("ZodPrefault",(i,f)=>{zn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>rt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function pc(i,f){return new ac({type:"prefault",innerType:i,get defaultValue(){return typeof f==="function"?f():ar(f)}})}var Ys=w("ZodNonOptional",(i,f)=>{vn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Qr(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function lc(i,f){return new Ys({type:"nonoptional",innerType:i,...P(f)})}var fc=w("ZodCatch",(i,f)=>{yn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>tt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function dc(i,f){return new fc({type:"catch",innerType:i,catchValue:typeof f==="function"?f:()=>f})}var Xs=w("ZodPipe",(i,f)=>{yr.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>ot(i,m,h,_),i.in=f.in,i.out=f.out});function Ms(i,f){return new Xs({type:"pipe",in:i,out:f})}var mc=w("ZodPreprocess",(i,f)=>{Xs.init(i,f),$n.init(i,f)}),hc=w("ZodReadonly",(i,f)=>{bn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>nt(i,m,h,_),i.unwrap=()=>i._zod.def.innerType});function _c(i){return new hc({type:"readonly",innerType:i})}var gc=w("ZodLazy",(i,f)=>{wn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>st(i,m,h,_),i.unwrap=()=>i._zod.def.getter()});function H(i){return new gc({type:"lazy",getter:i})}var xc=w("ZodCustom",(i,f)=>{kn.init(i,f),D.init(i,f),i._zod.processJSONSchema=(m,h,_)=>Vr(i,m,h,_)});function zc(i,f={}){return is(xc,i,f)}function vc(i,f){return cs(i,f)}function A(i,f){return new mc({type:"pipe",in:Gs(i),out:f})}
66
+ export{Ce,S,de,pe,ke,Oe,Ee,me,q,he,ne,e,ze,re,oe,o,a,x,Te,l,n,t,d,c,C,k,s,p,r,u,H,A};