@flowscripter/io-plugin-filesystem 2.0.1 → 2.0.3

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.
Files changed (3) hide show
  1. package/README.md +14 -0
  2. package/dist/bundle.js +11 -11
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -58,6 +58,20 @@
58
58
  found without the consuming CLI needing a direct npm dependency on it -
59
59
  also proven end to end in this repo's tests, not just type-checking.
60
60
 
61
+ ## String and Structured Locations
62
+
63
+ A `file` location can be given in two forms:
64
+
65
+ - A string: a `file:` URL (`file:///foo` or `file:/foo`, no host) or a bare
66
+ path. `parseLocationString` returns only `{ path }`, so a string always
67
+ addresses the whole `path` as a `container` target. Strings are the
68
+ convenient form for code holding a path or URL, and the form other
69
+ providers use when they resolve a `file` location.
70
+ - A structured location object, `{ path, filename?, pattern? }`, validated
71
+ by `filesystemLocationSchema` directly. It is needed to address a single
72
+ file (`filename`, an `entry` target) or the files matching a glob
73
+ (`pattern`, a `pattern` target), which a string cannot express.
74
+
61
75
  ## Bundled Bun Module Usage
62
76
 
63
77
  Loaded as a [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- var pr="@flowscripter/pluggable-io-framework/provider-factory";function fr(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:o,value:n}=await t.read();if(o){r.close();return}r.enqueue({payload:{kind:"js",data:n}})},cancel(r){return t.cancel(r)}})}import{chmod as Qa,cp as Rs,mkdir as rr,rename as eu,rm as Cs,utimes as tu}from"fs/promises";import{join as rt,resolve as ru}from"path";import{resolve as it,sep as dr}from"path";function E(e,t){if(e==="")return it(t);let r=it(e),o=it(r,t),n=r.endsWith(dr)?r:r+dr;if(o!==r&&!o.startsWith(n))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return o}function ue(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ct(e,t="|"){return e.map((r)=>lt(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class mr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Pe(e){return new mr(e)}function hr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yr(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $e(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return $e(e._zod.def)??e._zod.def.shape}function gr(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return j(this,t,o),o},enumerable:!0,configurable:!0})}function _r(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,o){let n=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(n,i);if(!s.enumerable)continue;if(s.get)gr(e,i,()=>{let c=t._zod.def.shape[i];return o?o(c,i):c});else _r(e,i,o?o(s.value,i):s.value)}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)gr(e,r,()=>t[r]);else _r(e,r,o.value)}}function T(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function xr(e){return JSON.stringify(e)}function br(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var at="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vr=Pe(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ae(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ut(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Pr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function y(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function lt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function zr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({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]}))(),pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ls(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,T(r,{shape:i,checks:[]}))}function ke(e,t){let r=J(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function js(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),F(e,T(r,{shape:s,checks:[]}))}function Fs(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,T(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let r={};return G(r,e,Reflect.ownKeys(J(e))),Ks(r,t),r}function Ms(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,T(e._zod.def,{shape:$r(e,t)}))}function Us(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(J(e))),G(r,t,Reflect.ownKeys(J(t)));let o=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,o)}function wr(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(J(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),F(t,T(t._zod.def,{shape:a,checks:[]}))}function Js(e,t,r){let o=r?new Set(ke(t,r)):void 0,n={};return G(n,t,Reflect.ownKeys(J(t)),(i,s)=>o&&!o.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,T(t._zod.def,{shape:n}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function kr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Se(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function ft(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function V(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Bs=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Bs.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Oe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Sr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function X(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function Zr(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Ws(e,r,o.value)}}function B(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ie(e,t,r){return B(e,t,r,!1)}function Or(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,o(this))},set(n){B(this,r,n)}})}return t}function Ws(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(o){B(this,t,o)}})}function Vs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var st,W=!1,Hs={configurable:!0,get(){W=!0;return}};function x(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&st!==e._zod){st=void 0;return}st=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Hs);let n=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||n,i}catch(i){throw delete this[t],W=W||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Gs(e,t,r,o){let n=Vs(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Xs="~constantCatch";function Ir(e){let t=()=>e;return t[Xs]=!0,t}var Er;var dt={value:void 0,enumerable:!1},Tr="captureStackTrace"in Error?Error:null;function Ys(e){let t=Tr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Tr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,o){let n={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=n;let s=r,c=s&&new WeakSet;function a(d,m){if(!d._zod){dt.value=new i(m);try{Object.defineProperty(d,"_zod",dt)}finally{dt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),g=d._zod.constr.prototype,b=_;while(b&&b!==g)b=Object.getPrototypeOf(b);let K=b??_;if(!c.has(K))c.add(K),Zr(K,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let u=o?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=o?.Parent?Ys(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(o?.Parent&&d instanceof o.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Er=globalThis).__zod_globalConfig??(Er.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function Qs(e){this._zod.message=e}var ec={get:qs,set:Qs,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},Ar=new WeakSet([Object.prototype,Error.prototype]),Rr=(e,t)=>{e.name="$ZodError",ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",ec);let r=Object.getPrototypeOf(e);if(!Ar.has(r))Ar.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Cr=l("$ZodError",Rr),dl=l("$ZodError",Rr,void 0,{Parent:Error});function tc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Nr(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)tc(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dr(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;while(u<c.length){let p=c[u],f=u===c.length-1;if(p==="_errors"){if(f)a._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,p))Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];if(f)d._errors.push(t(s));a=d,u++}}}};return o(e),r}function Ee(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Te=(e)=>{let t=(r,o,n,i)=>{let s=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Ae=(e)=>{let t=async(r,o,n,i)=>{let s=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Re=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};function Kr(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>V(n,r,N()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ce=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};var rc=Symbol.for("zod.compile.invalid"),oc=Symbol.for("zod.compile.fallback"),yt=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==rc)return!0;if(o.definite===!0&&r===void 0)return!1}return nc(e,t,r)};function nc(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n)o[oc]=!0,i=n({value:t,issues:[]},o);else i=e._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length===0}var gt=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Lr=(e)=>{let t=Te(e),r=(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,c,Ee(r,s))};return r};var jr=(e)=>{let t=Te(e),r=(o,n,i,s)=>t(o,n,i,Ee(r,s));return r};var Fr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Ee(r,s))};return r};var Mr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>await t(o,n,i,Ee(r,s));return r};var Ur=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,n)};var Jr=(e)=>(t,r,o)=>Re(e)(t,r,o);var Br=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,n)};var Wr=(e)=>async(t,r,o)=>Ce(e)(t,r,o);var Vr=/^[cC][0-9a-z]{6,}$/,Hr=/^[0-9a-z]+$/,Gr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xr=/^[0-9a-vA-V]{20}$/,Yr=/^[A-Za-z0-9]{27}$/,qr=/^[a-zA-Z0-9_-]{21}$/;function Qr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var to=/^([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})$/,xt=(e)=>{if(!e)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}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var ro=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ic="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function oo(){return new RegExp(ic,"u")}var no=/^(?:(?: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])$/,io=/^(([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 so=/^((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])$/,co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ao=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lo=/^https?$/,po=/^\+[1-9]\d{6,14}$/;var fo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function sc(e){return new RegExp(`^${e}$`)}var mo=sc(fo);function _t(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.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{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function ho(e){return new RegExp(`^${_t(e)}$`)}function yo(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${_t({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${_t({precision:e.precision})}`:r;return new RegExp(`^${fo}T(?:${o})$`)}var go=/^[\s\S]{0,}$/;var bt=/^-?\d+(?:\.\d+)?$/;var _o=/^[^A-Z]*$/,xo=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var vt=(e)=>{let t=e.value;return!hr(t)&&t.length!==void 0},Ne={number:"number",bigint:"bigint",object:"date"},Pt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bo=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):yr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vo=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=we[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Po=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>t.maximum?Ze(n):i)<=t.maximum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zo=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(n):i)>=t.minimum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length,s=typeof n==="string"&&i>=t.length&&i<=t.length*2?Ze(n):i;if(s===t.length)return;let c=Oe(n),a=s>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,o;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),wo=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ko=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_o),de.init(e,t)}),So=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xo),de.init(e,t)}),Zo=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Oo=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Eo=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class $t{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
2
+ var fr="@flowscripter/pluggable-io-framework/provider-factory";function dr(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:o,value:n}=await t.read();if(o){r.close();return}r.enqueue({payload:{kind:"js",data:n}})},cancel(r){return t.cancel(r)}})}import{chmod as ru,cp as Cs,mkdir as or,rename as ou,rm as Ns,utimes as nu}from"fs/promises";import{join as ot,resolve as iu}from"path";import{resolve as st,sep as mr}from"path";function E(e,t){if(e==="")return st(t);let r=st(e),o=st(r,t),n=r.endsWith(mr)?r:r+mr;if(o!==r&&!o.startsWith(n))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return o}function ue(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function at(e,t="|"){return e.map((r)=>pt(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class hr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Pe(e){return new hr(e)}function yr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function gr(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $e(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return $e(e._zod.def)??e._zod.def.shape}function _r(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return j(this,t,o),o},enumerable:!0,configurable:!0})}function xr(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,o){let n=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(n,i);if(!s.enumerable)continue;if(s.get)_r(e,i,()=>{let c=t._zod.def.shape[i];return o?o(c,i):c});else xr(e,i,o?o(s.value,i):s.value)}}function Ls(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)_r(e,r,()=>t[r]);else xr(e,r,o.value)}}function T(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function br(e){return JSON.stringify(e)}function vr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ut="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Pr=Pe(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ae(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function lt(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var zr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function y(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function pt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function $r(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({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]}))(),ft={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function js(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,T(r,{shape:i,checks:[]}))}function ke(e,t){let r=J(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function Fs(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),F(e,T(r,{shape:s,checks:[]}))}function Ms(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,T(e._zod.def,{shape:wr(e,t)}))}function wr(e,t){let r={};return G(r,e,Reflect.ownKeys(J(e))),Ls(r,t),r}function Us(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,T(e._zod.def,{shape:wr(e,t)}))}function Js(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(J(e))),G(r,t,Reflect.ownKeys(J(t)));let o=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,o)}function kr(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(J(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),F(t,T(t._zod.def,{shape:a,checks:[]}))}function Bs(e,t,r){let o=r?new Set(ke(t,r)):void 0,n={};return G(n,t,Reflect.ownKeys(J(t)),(i,s)=>o&&!o.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,T(t._zod.def,{shape:n}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Sr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Se(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function dt(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;if(n>=0)t.push([n,r])}return t}function Ze(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function V(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Ws=/[\uD800-\uDBFF]/;function Oe(e){let t=e.length;if(!Ws.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Ie(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Zr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function X(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function Or(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Vs(e,r,o.value)}}function B(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ee(e,t,r){return B(e,t,r,!1)}function Ir(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,o(this))},set(n){B(this,r,n)}})}return t}function Vs(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(o){B(this,t,o)}})}function Hs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var ct,W=!1,Gs={configurable:!0,get(){W=!0;return}};function x(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&ct!==e._zod){ct=void 0;return}ct=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Gs);let n=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||n,i}catch(i){throw delete this[t],W=W||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Xs(e,t,r,o){let n=Hs(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}var Ys="~constantCatch";function Er(e){let t=()=>e;return t[Ys]=!0,t}var Tr;var mt={value:void 0,enumerable:!1},Ar="captureStackTrace"in Error?Error:null;function qs(e){let t=Ar;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Ar=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,o){let n={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=n;let s=r,c=s&&new WeakSet;function a(d,m){if(!d._zod){mt.value=new i(m);try{Object.defineProperty(d,"_zod",mt)}finally{mt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),g=d._zod.constr.prototype,b=_;while(b&&b!==g)b=Object.getPrototypeOf(b);let K=b??_;if(!c.has(K))c.add(K),Or(K,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let u=o?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=o?.Parent?qs(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(o?.Parent&&d instanceof o.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Tr=globalThis).__zod_globalConfig??(Tr.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function Qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function ec(e){this._zod.message=e}var tc={get:Qs,set:ec,enumerable:!0,configurable:!0},yt={value:void 0,enumerable:!1},Rr=new WeakSet([Object.prototype,Error.prototype]),Cr=(e,t)=>{e.name="$ZodError",yt.value=t,Object.defineProperty(e,"issues",yt),yt.value=void 0,Object.defineProperty(e,"message",tc);let r=Object.getPrototypeOf(e);if(!Rr.has(r))Rr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Nr=l("$ZodError",Cr),yl=l("$ZodError",Cr,void 0,{Parent:Error});function rc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Dr(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)rc(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Kr(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;while(u<c.length){let p=c[u],f=u===c.length-1;if(p==="_errors"){if(f)a._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,p))Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];if(f)d._errors.push(t(s));a=d,u++}}}};return o(e),r}function Te(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ae=(e)=>{let t=(r,o,n,i)=>{let s=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw ut(a,i?.callee??t),a}return c.value};return t};var Re=(e)=>{let t=async(r,o,n,i)=>{let s=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw ut(a,i?.callee??t),a}return c.value};return t};var Ce=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length?Lr(e,i.issues,n):{success:!0,data:i.value}};function Lr(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>V(n,r,N()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ne=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?Lr(e,i.issues,n):{success:!0,data:i.value}};var oc=Symbol.for("zod.compile.invalid"),nc=Symbol.for("zod.compile.fallback"),gt=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==oc)return!0;if(o.definite===!0&&r===void 0)return!1}return ic(e,t,r)};function ic(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n)o[nc]=!0,i=n({value:t,issues:[]},o);else i=e._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length===0}var _t=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},jr=(e)=>{let t=Ae(e),r=(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,c,Te(r,s))};return r};var Fr=(e)=>{let t=Ae(e),r=(o,n,i,s)=>t(o,n,i,Te(r,s));return r};var Mr=(e)=>{let t=Re(e),r=async(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Te(r,s))};return r};var Ur=(e)=>{let t=Re(e),r=async(o,n,i,s)=>await t(o,n,i,Te(r,s));return r};var Jr=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,n)};var Br=(e)=>(t,r,o)=>Ce(e)(t,r,o);var Wr=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ne(e)(t,r,n)};var Vr=(e)=>async(t,r,o)=>Ne(e)(t,r,o);var Hr=/^[cC][0-9a-z]{6,}$/,Gr=/^[0-9a-z]+$/,Xr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Yr=/^[0-9a-vA-V]{20}$/,qr=/^[A-Za-z0-9]{27}$/,Qr=/^[a-zA-Z0-9_-]{21}$/;function eo(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var to=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ro=/^([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})$/,bt=(e)=>{if(!e)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}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var oo=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var sc="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function no(){return new RegExp(sc,"u")}var io=/^(?:(?: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])$/,so=/^(([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 co=/^((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])$/,ao=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,uo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var po=/^https?$/,fo=/^\+[1-9]\d{6,14}$/;var mo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function cc(e){return new RegExp(`^${e}$`)}var ho=cc(mo);function xt(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.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{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yo(e){return new RegExp(`^${xt(e)}$`)}function go(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${xt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${xt({precision:e.precision})}`:r;return new RegExp(`^${mo}T(?:${o})$`)}var _o=/^[\s\S]{0,}$/;var vt=/^-?\d+(?:\.\d+)?$/;var xo=/^[^A-Z]*$/,bo=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Pt=(e)=>{let t=e.value;return!yr(t)&&t.length!==void 0},De={number:"number",bigint:"bigint",object:"date"},zt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=De[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:De[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$t=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=De[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:De[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vo=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):gr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Po=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=we[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var zo=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>t.maximum?Oe(n):i)<=t.maximum)return;let c=Ie(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>=t.minimum&&i<t.minimum*2?Oe(n):i)>=t.minimum)return;let c=Ie(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wo=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(o)=>{let n=o.value,i=n.length,s=typeof n==="string"&&i>=t.length&&i<=t.length*2?Oe(n):i;if(s===t.length)return;let c=Ie(n),a=s>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,o;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),ko=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),So=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xo),de.init(e,t)}),Zo=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bo),de.init(e,t)}),Oo=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Eo=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var To=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class wt{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
3
  `).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
4
  ${t.join(`
5
5
  `)}
6
- };`)(...Object.values(this.closed))}}var Ao={major:4,minor:6,patch:5};var w=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ao;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,a,u)=>{if(c.memo)return c;let p=M(c),f;for(let d of a){if(d._zod.def.when){if(kr(c))continue;if(!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&u?.async===!1)throw new U;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(ft(c.issues,m,e),!p)p=M(c,m)});else{if(c.issues.length===m)continue;if(ft(c.issues,m,e),!p)p=M(c,m)}}if(f)return f.then(()=>c);return c},s=(c,a,u)=>{if(M(c))return c.aborted=!0,c;let p=i(a,n,u);if(p instanceof Promise){if(u.async===!1)throw new U;return p.then((f)=>e._zod.parse(f,u))}return e._zod.parse(p,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});if(p instanceof Promise)return p.then((f)=>s(f,c,a));return s(p,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new U;return u.then((p)=>i(p,n,a))}return i(u,n,a)}}},{get "~standard"(){return Ie(this,"~standard",kt(this))},set "~standard"(e){B(this,"~standard",e)}}),Jo=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>V(r,t,N()))}:{value:e.value};async function ac(e,t){let r={async:!0};return Jo(await e._zod.run({value:t,issues:[]},r),r)}function kt(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Jo(o,r)}catch(o){}return ac(e,t)},vendor:"zod",version:1}}var je=l("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??go,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),P=l("$ZodStringFormat",(e,t)=>{de.init(e,t),je.init(e,t)}),Bo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=to),P.init(e,t)}),Wo=l("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xt(o))}else t.pattern??(t.pattern=xt());P.init(e,t)}),Vo=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ro),P.init(e,t)}),Ho=1,Ke=2;function Go(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function uc(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Go(e)||Ke;return lc(e,t)}function lc(e,t){if(!t.normalize&&t.protocol?.source===lo.source&&!/^https?:\/\//i.test(e))return Ho;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Ke}return new URL(e)}catch{return Ke}}var pc=/[\t\n\r]/g;function Ro(e){return e.replace(pc,"")}function fc(e,t){return t.lastIndex=0,t.test(e.hostname)}function dc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Xo=l("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=uc(o,t);if(n===Ho){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Ke){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Ro(o);return}if(t.hostname&&!fc(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!dc(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:Ro(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oo()),P.init(e,t)}),qo=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?qr:Qr(t.length)),P.init(e,t)}),Qo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Vr),P.init(e,t)}),en=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hr),P.init(e,t)}),tn=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gr),P.init(e,t)}),rn=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Xr),P.init(e,t)}),on=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yr),P.init(e,t)}),nn=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),P.init(e,t)}),sn=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mo),P.init(e,t)}),cn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ho(t)),P.init(e,t)}),an=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eo),P.init(e,t)}),un=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=no),P.init(e,t)}),mc=/^[0-9a-fA-F:.]+$/;function ln(e){if(!mc.test(e))return!1;return Go(`http://[${e}]`)}var pn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=io),P.init(e,t),e._zod.check=(r)=>{if(!ln(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var fn=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=so),P.init(e,t)});function hc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return ln(r)}var dn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=co),P.init(e,t),e._zod.check=(r)=>{if(!hc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function mn(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var St=/^[0-9a-zA-Z+/]*={0,2}$/,hn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=St),P.init(e,t),e._zod.check=(r)=>{if(mn(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Fe=/^[A-Za-z0-9_-]*$/;function yc(e){if(!Fe.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return mn(r)}var yn=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fe),P.init(e,t),e._zod.check=(r)=>{if(yc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gn=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=po),P.init(e,t)});function gc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var _n=l("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{if(gc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Zt=l("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=bt,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),xn=l("$ZodNumberFormat",(e,t)=>{vo.init(e,t),Zt.init(e,t)});var bn=l("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),vn=l("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Co(e,t,r){if(e.issues.length)t.issues.push(...Se(r,e.issues));t.value[r]=e.value}var Pn=l("$ZodArray",(e,t)=>{w.init(e,t);let r=A.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),n):Array(i.length);let s=[],c=n?.abortEarly;for(let a=0;a<i.length;a++){let u=i[a],p=t.element._zod.run({value:u,issues:[]},n);if(p instanceof Promise)s.push(p.then((f)=>Co(f,o,a)));else if(Co(p,o,a),c&&p.issues.length!==0&&M(p))break}if(s.length)return Promise.all(s).then(()=>o);return o}});function Le(e,t,r,o,n,i){let s=r in o,c=i==="optional";if(!s&&c&&n==="optional")return;if(e.issues.length){if(n!==void 0&&c&&!s)return;t.issues.push(...Se(r,e.issues))}if(!s&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||n==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var _c=[];function zn(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:_c,n=o.length?[...t,...o]:t;for(let s of n)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=zr(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function $n(e,t,r,o,n,i,s){let c=[],a=n.keySet,u=n.catchall._zod,p=u.def.type,{optin:f,optout:d}=u,m=0;for(let h in t){if(s&&r.issues.length!==m){if(M(r,m))break;m=r.issues.length}if(a.has(h))continue;if(h==="__proto__"){if(p==="never")c.push(h);continue}if(p==="never"){c.push(h);continue}let _=u.run({value:t[h],issues:[]},o);if(_ instanceof Promise)e.push(_.then((g)=>Le(g,r,h,t,f,d)));else Le(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var xc=l("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let p={...o};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Pe(()=>zn(t));x(e,"propValues",(u)=>{let p=u.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))j(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=ae,s=t.catchall,c,a=A.memoizer;a?.attach(e),e._zod.parse=(u,p)=>{c??(c=n.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,_=u.issues.length;for(let g of c.allKeys){if(h&&u.issues.length!==_){if(M(u,_))break;_=u.issues.length}if(g==="__proto__")continue;let b=m[g],K=b._zod.optin,ie=b._zod.optout,se=b._zod.run({value:f[g],issues:[]},p);if(se instanceof Promise)d.push(se.then((S)=>Le(S,u,g,f,K,ie)));else Le(se,u,g,f,K,ie)}if(!s)return d.length?Promise.all(d).then(()=>u):u;return $n(d,f,u,p,n.value,e,h===!0)}}),wn=l("$ZodObjectJIT",(e,t)=>{xc.init(e,t);let r=e._zod.parse,o=Pe(()=>zn(t)),n=A.memoizer,i=(m)=>{let h=o.value,_=h.symbolKeys,g=new $t(["payload","ctx"],{shape:m,inst:e,memo:n,syms:_}),b=(S)=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,K=(S,v)=>`
6
+ };`)(...Object.values(this.closed))}}var Ro={major:4,minor:6,patch:6};var w=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ro;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,a,u)=>{if(c.memo)return c;let p=M(c),f;for(let d of a){if(d._zod.def.when){if(Sr(c))continue;if(!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&u?.async===!1)throw new U;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(Ze(c.issues,m,e),!p)p=M(c,m)});else{if(c.issues.length===m)continue;if(Ze(c.issues,m,e),!p)p=M(c,m)}}if(f)return f.then(()=>c);return c},s=(c,a,u)=>{if(M(c))return c.aborted=!0,c;let p=i(a,n,u);if(p instanceof Promise){if(u.async===!1)throw new U;return p.then((f)=>e._zod.parse(f,u))}return e._zod.parse(p,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});if(p instanceof Promise)return p.then((f)=>s(f,c,a));return s(p,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new U;return u.then((p)=>i(p,n,a))}return i(u,n,a)}}},{get "~standard"(){return Ee(this,"~standard",St(this))},set "~standard"(e){B(this,"~standard",e)}}),Bo=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>V(r,t,N()))}:{value:e.value};async function uc(e,t){let r={async:!0};return Bo(await e._zod.run({value:t,issues:[]},r),r)}function St(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Bo(o,r)}catch(o){}return uc(e,t)},vendor:"zod",version:1}}var Fe=l("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??_o,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),P=l("$ZodStringFormat",(e,t)=>{de.init(e,t),Fe.init(e,t)}),Wo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ro),P.init(e,t)}),Vo=l("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bt(o))}else t.pattern??(t.pattern=bt());P.init(e,t)}),Ho=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=oo),P.init(e,t)}),Go=1,Le=2;function Xo(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function lc(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Xo(e)||Le;return pc(e,t)}function pc(e,t){if(!t.normalize&&t.protocol?.source===po.source&&!/^https?:\/\//i.test(e))return Go;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Le}return new URL(e)}catch{return Le}}var fc=/[\t\n\r]/g;function Co(e){return e.replace(fc,"")}function dc(e,t){return t.lastIndex=0,t.test(e.hostname)}function mc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Yo=l("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=lc(o,t);if(n===Go){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Le){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Co(o);return}if(t.hostname&&!dc(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!mc(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:Co(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),qo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=no()),P.init(e,t)}),Qo=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Qr:eo(t.length)),P.init(e,t)}),en=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Hr),P.init(e,t)}),tn=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gr),P.init(e,t)}),rn=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xr),P.init(e,t)}),on=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Yr),P.init(e,t)}),nn=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=qr),P.init(e,t)}),sn=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=go(t)),P.init(e,t)}),cn=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ho),P.init(e,t)}),an=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),P.init(e,t)}),un=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=to),P.init(e,t)}),ln=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=io),P.init(e,t)}),hc=/^[0-9a-fA-F:.]+$/;function pn(e){if(!hc.test(e))return!1;return Xo(`http://[${e}]`)}var fn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=so),P.init(e,t),e._zod.check=(r)=>{if(!pn(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var dn=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=co),P.init(e,t)});function yc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return pn(r)}var mn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ao),P.init(e,t),e._zod.check=(r)=>{if(!yc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function hn(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Zt=/^[0-9a-zA-Z+/]*={0,2}$/,yn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zt),P.init(e,t),e._zod.check=(r)=>{if(hn(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Me=/^[A-Za-z0-9_-]*$/;function gc(e){if(!Me.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return hn(r)}var gn=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Me),P.init(e,t),e._zod.check=(r)=>{if(gc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),_n=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=fo),P.init(e,t)});function _c(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var xn=l("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{if(_c(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Ot=l("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=vt,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),bn=l("$ZodNumberFormat",(e,t)=>{Po.init(e,t),Ot.init(e,t)});var vn=l("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),Pn=l("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function xc(e,t){let r=dt(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((i)=>i[0])),n=e._zod.parse;e._zod.parse=(i,s)=>{let c=t(i.value);if(c>o&&!s?.skipChecks&&s?.direction!=="backward"){for(let[a,u]of dt(e._zod.def.checks))if(c>a&&u._zod.def.when(i)){let p=i.issues.length;return u._zod.check(i),i.issues[p].continue=!1,Ze(i.issues,p,e),i}}return n(i,s)}}var bc=(e)=>Array.isArray(e)?e.length:-1;function No(e,t,r){if(e.issues.length)t.issues.push(...Se(r,e.issues));t.value[r]=e.value}var zn=l("$ZodArray",(e,t)=>{w.init(e,t);let r=A.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),n):Array(i.length);let s=[],c=n?.abortEarly;for(let a=0;a<i.length;a++){let u=i[a],p=t.element._zod.run({value:u,issues:[]},n);if(p instanceof Promise)s.push(p.then((f)=>No(f,o,a)));else if(No(p,o,a),c&&p.issues.length!==0&&M(p))break}if(s.length)return Promise.all(s).then(()=>o);return o},xc(e,bc)});function je(e,t,r,o,n,i){let s=r in o,c=i==="optional";if(!s&&c&&n==="optional")return;if(e.issues.length){if(n!==void 0&&c&&!s)return;t.issues.push(...Se(r,e.issues))}if(!s&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||n==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var vc=[];function $n(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:vc,n=o.length?[...t,...o]:t;for(let s of n)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=$r(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function wn(e,t,r,o,n,i,s){let c=[],a=n.keySet,u=n.catchall._zod,p=u.def.type,{optin:f,optout:d}=u,m=0;for(let h in t){if(s&&r.issues.length!==m){if(M(r,m))break;m=r.issues.length}if(a.has(h))continue;if(h==="__proto__"){if(p==="never")c.push(h);continue}if(p==="never"){c.push(h);continue}let _=u.run({value:t[h],issues:[]},o);if(_ instanceof Promise)e.push(_.then((g)=>je(g,r,h,t,f,d)));else je(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Pc=l("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let p={...o};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Pe(()=>$n(t));x(e,"propValues",(u)=>{let p=u.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))j(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=ae,s=t.catchall,c,a=A.memoizer;a?.attach(e),e._zod.parse=(u,p)=>{c??(c=n.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,_=u.issues.length;for(let g of c.allKeys){if(h&&u.issues.length!==_){if(M(u,_))break;_=u.issues.length}if(g==="__proto__")continue;let b=m[g],K=b._zod.optin,ie=b._zod.optout,se=b._zod.run({value:f[g],issues:[]},p);if(se instanceof Promise)d.push(se.then((S)=>je(S,u,g,f,K,ie)));else je(se,u,g,f,K,ie)}if(!s)return d.length?Promise.all(d).then(()=>u):u;return wn(d,f,u,p,n.value,e,h===!0)}}),kn=l("$ZodObjectJIT",(e,t)=>{Pc.init(e,t);let r=e._zod.parse,o=Pe(()=>$n(t)),n=A.memoizer,i=(m)=>{let h=o.value,_=h.symbolKeys,g=new wt(["payload","ctx"],{shape:m,inst:e,memo:n,syms:_}),b=(S)=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,K=(S,v)=>`
7
7
  let ${S}_ab = false;
8
8
  for (let i = 0; i < ${S}.issues.length; i++) {
9
9
  const iss = ${S}.issues[i];
@@ -14,19 +14,19 @@ ${t.join(`
14
14
  if (${S}_ab && ctx && ctx.abortEarly) {
15
15
  payload.value = newResult;
16
16
  return payload;
17
- }`;g.write("const input = payload.value;");let ie=Object.create(null),se=0;for(let S of h.allKeys)ie[S]=`key_${se++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let v=ie[S],L=typeof S==="symbol"?`syms[${_.indexOf(S)}]`:xr(S),ot=`${L} in input`,ur=m[S],nt=ur?._zod?.optin,lr=nt!==void 0,Ns=ur?._zod?.optout==="optional";if(g.write(`const ${v} = ${b(L)};`),lr&&Ns){let Ds=nt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;g.write(`
18
- const ${v}_present = ${ot};
17
+ }`;g.write("const input = payload.value;");let ie=Object.create(null),se=0;for(let S of h.allKeys)ie[S]=`key_${se++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let v=ie[S],L=typeof S==="symbol"?`syms[${_.indexOf(S)}]`:br(S),nt=`${L} in input`,lr=m[S],it=lr?._zod?.optin,pr=it!==void 0,Ds=lr?._zod?.optout==="optional";if(g.write(`const ${v} = ${b(L)};`),pr&&Ds){let Ks=it==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;g.write(`
18
+ const ${v}_present = ${nt};
19
19
  if (!${v}.issues.length || ${v}_present) {
20
20
  if (${v}.issues.length) {${K(v,L)}
21
21
  }
22
22
 
23
- if (${Ds}) {
23
+ if (${Ks}) {
24
24
  newResult[${L}] = ${v}.value;
25
25
  }
26
26
  }
27
27
 
28
- `)}else if(!lr)g.write(`
29
- const ${v}_present = ${ot};
28
+ `)}else if(!pr)g.write(`
29
+ const ${v}_present = ${nt};
30
30
  if (${v}.issues.length) {${K(v,L)}
31
31
  }
32
32
  if (!${v}_present && !${v}.issues.length) {
@@ -49,10 +49,10 @@ ${t.join(`
49
49
  `);else if(g.write(`
50
50
  if (${v}.issues.length) {${K(v,L)}
51
51
  }
52
- `),nt==="defaulted")g.write(`newResult[${L}] = ${v}.value;`);else g.write(`
53
- if (${v}.value !== undefined || ${ot}) {
52
+ `),it==="defaulted")g.write(`newResult[${L}] = ${v}.value;`);else g.write(`
53
+ if (${v}.value !== undefined || ${nt}) {
54
54
  newResult[${L}] = ${v}.value;
55
55
  }
56
- `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,c=ae,a=!A.jitless,p=a&&vr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=o.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(a&&p&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return $n([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function No(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!M(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>V(s,o,N())))}),t}var kn=l("$ZodUnion",(e,t)=>{w.init(e,t),x(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),x(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),x(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),x(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${n.map((i)=>ze(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}if(!i)return No(s,o,e,n);return Promise.all(s).then((c)=>No(c,o,e,n))}});var Sn=l("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([a,u])=>Do(r,a,u));return Do(r,i,s)}});function wt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ee(e)&&ee(t)){let r=Object.keys(t),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let i of o){if(i==="__proto__")continue;let s=wt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=wt(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Do(e,t,r){let o=new Map,n,i=new Map,s=(u,p)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let d=String(u.path[0]);if(!i.has(d))i.set(d,u);f=[d]}else return!1;for(let d of f){if(!o.has(d))o.set(d,{});o.get(d)[p]=!0}return!0};for(let u of t.issues)if(!s(u,"l"))e.issues.push(u);for(let u of r.issues)if(!s(u,"r"))e.issues.push(u);let c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter((p)=>n.keys.includes(p)):[];if(u.length)e.issues.push({...n,keys:u});for(let p of c)if(!u.includes(p)&&i.has(p))e.issues.push(i.get(p))}let a=wt(t.value,r.value);if(!a.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Zn=l("$ZodEnum",(e,t)=>{w.init(e,t);let r=ue(t.entries),o=new Set(r);e._zod.values=o,x(e,"pattern",(n)=>{let i=ue(n.def.entries).filter((s)=>Pr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>te(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}});var On=l("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",A.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new U;return r.value=n,r}});function Ko(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ot=l("$ZodOptional",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Ko(r,i));return Ko(r,n)}return t.innerType._zod.run(r,o)}}),In=l("$ZodExactOptional",(e,t)=>{Ot.init(e,t),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),En=l("$ZodNullable",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)}|null)$`):void 0}),x(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Tn=l("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Lo(i,t));return Lo(n,t)}});function Lo(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var An=l("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Rn=l("$ZodNonOptional",(e,t)=>{w.init(e,t),x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>jo(i,e));return jo(n,e)}});function jo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Fo(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>V(n,o,N()))},input:e.value}),e}var Cn=l("$ZodCatch",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Fo(r,i,t,o));return Fo(r,n,t,o)}});var Nn=l("$ZodPipe",(e,t)=>{w.init(e,t),x(e,"values",(r)=>r.def.in._zod.values),x(e,"optin",(r)=>r.def.in._zod.optin),x(e,"optout",(r)=>r.def.out._zod.optout),x(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>De(s,t.in,o));return De(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>De(i,t.out,o));return De(n,t.out,o)}});function De(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Dn=l("$ZodReadonly",(e,t)=>{w.init(e,t),x(e,"propValues",(r)=>r.def.innerType._zod.propValues),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"optin",(r)=>r.def.innerType?._zod?.optin),x(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Mo);return Mo(n)}});function Mo(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Kn=l("$ZodCustom",(e,t)=>{O.init(e,t),w.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((i)=>Uo(i,r,o,e));Uo(n,r,o,e);return}});function Uo(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(X(n))}}class jn extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Et="~memo",Ln=[];function Fn(e){return e!==null&&typeof e==="object"}function It(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Mn=new WeakMap,me=0,Je=1,he=2;function Be(e,t,r){let o=Mn.get(e);if(o!==void 0)return o?he:me;if(t.has(e))return he;t.add(e);let n=me,i=(p)=>{if(n!==he&&p?._zod){let f=Be(p,t,r);if(f>n)n=f}},s=(p,f)=>{let d=me;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let _=h.get?Je:h.value?._zod?Be(h.value,t,r):me;if(_>d)d=_}return d},c=(p)=>{if(p>n)n=p},a=e._zod.def,u=a.type;switch(u){case"object":{let p=$e(a);c(p?s(p,!0):Je),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let p of a.items)i(p);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let p of a.options)i(p);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let p=a._cachedInner??(r?e._zod.innerType:void 0);c(p?Be(p,t,!1):Je);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let p in a){let f=Object.getOwnPropertyDescriptor(a,p);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),bc(e,n)}function bc(e,t){if(t!==Je)Mn.set(e,t===he);return t}function vc(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Me,Ue=[],Pc={alloc(e,t,r){let o=Me;if(!o)return r;Me=void 0;let n={value:r,issues:null};return o.set(t.value,n),Ue.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,i)=>{if(i.direction!=="backward"&&zc(i,n.value))throw new jn;return r(n,i)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(a,u)=>{if(r===void 0){let b=Be(e,new Set,!1);if(b===me){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(a,u)}if(b===he||o)r=!0;else o=!0}let p=a.value;if(!Fn(p))return s(a,u);let f=u[Et];if(!f)f={buckets:new WeakMap,backEdges:void 0},u[Et]=f;let d;if(n===u)d=i;else d=vc(f,e),n=u,i=d;let m=d.get(p);if(m){if(a.value=m.value,m.issues){if(m.issues.length)a.issues.push(...It(m.issues))}else a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return a}Me=d;let h=Ue.length,_=s(a,u);Me=void 0;let g=Ue.length>h?Ue.pop():void 0;if(_ instanceof Promise)return _.then((b)=>{if(g)g.issues=b.issues.length?It(b.issues):Ln;return b});if(g)g.issues=_.issues.length?It(_.issues):Ln;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Un(){return Pc}function zc(e,t){let r=e[Et]?.backEdges;return r!==void 0&&Fn(t)&&r.has(t)}var $c=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return o[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=n(i.expected),c=Sr(i.input),a=n(c,i.input);return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${lt(i.values[0])}`;return`Invalid option: expected one of ${ct(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${ct(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Tt(){return{localeError:$c()}}var Jn;class Bn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function wc(){return new Bn}(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=wc());var Y=globalThis.__zod_globalRegistry;function Wn(e){if(e.checks)e.checks=[...e.checks];return e}function Vn(e,t){return new e(Wn({type:"string",...y(t)}))}function Hn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...y(t)})}function Gn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...y(t)})}function Xn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...y(t)})}function Yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y(t)})}function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y(t)})}function Qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y(t)})}function ei(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...y(t)})}function ti(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...y(t)})}function ri(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...y(t)})}function oi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...y(t)})}function ni(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...y(t)})}function ii(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...y(t)})}function si(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...y(t)})}function ci(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...y(t)})}function ai(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...y(t)})}function ui(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...y(t)})}function li(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y(t)})}function pi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y(t)})}function fi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...y(t)})}function di(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...y(t)})}function mi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...y(t)})}function hi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...y(t)})}function yi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y(t)})}function gi(e,t){return new e({type:"string",format:"date",check:"string_format",...y(t)})}function _i(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...y(t)})}function xi(e,t){return new e({type:"string",format:"duration",check:"string_format",...y(t)})}function bi(e,t){return new e(Wn({type:"number",checks:[],...y(t)}))}function vi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...y(t)})}function Pi(e){return new e({type:"unknown"})}function zi(e,t){return new e({type:"never",...y(t)})}function We(e,t){return new Pt({check:"less_than",...y(t),value:e,inclusive:!1})}function ye(e,t){return new Pt({check:"less_than",...y(t),value:e,inclusive:!0})}function Ve(e,t){return new zt({check:"greater_than",...y(t),value:e,inclusive:!1})}function ge(e,t){return new zt({check:"greater_than",...y(t),value:e,inclusive:!0})}function He(e,t){return new bo({check:"multiple_of",...y(t),value:e})}function Ge(e,t){return new Po({check:"max_length",...y(t),maximum:e})}function re(e,t){return new zo({check:"min_length",...y(t),minimum:e})}function Xe(e,t){return new $o({check:"length_equals",...y(t),length:e})}function At(e,t){return new wo({check:"string_format",format:"regex",...y(t),pattern:e})}function Rt(e){return new ko({check:"string_format",format:"lowercase",...y(e)})}function Ct(e){return new So({check:"string_format",format:"uppercase",...y(e)})}function Nt(e,t){return new Zo({check:"string_format",format:"includes",...y(t),includes:e})}function Dt(e,t){return new Oo({check:"string_format",format:"starts_with",...y(t),prefix:e})}function Kt(e,t){return new Io({check:"string_format",format:"ends_with",...y(t),suffix:e})}function H(e){return new Eo({check:"overwrite",tx:e})}function Lt(e){return H((t)=>t.normalize(e))}function jt(){return H((e)=>e.trim())}function Ft(){return H((e)=>e.toLowerCase())}function Mt(){return H((e)=>e.toUpperCase())}function Ut(){return H((e)=>br(e))}function $i(e,t,r){return new e({type:"array",element:t,...y(r)})}function wi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...y(r)})}function ki(e,t){let r=kc((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(X(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=o.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(X(i))}},e(o.value,o)),t);return r}function kc(e,t){let r=new O({check:"custom",...y(t)});return r._zod.check=e,r}function _e(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))j(e,o,r[o]);return e}function Bt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Y,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function q(e,t,r,o,n){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(n);return Object.assign(r,i),!0}function Z(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[n.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,d,p)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;Z(f,t,p),t.seen.get(f).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)_e(s.schema,a);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Si(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Wt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let a=o.get(c);if(a&&a!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,s[0])}}let n=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Si(m)}`}}let a="#",u=`${a}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:a};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+Si(p)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:a,defId:u}=n(s);if(c.def={...c.schema},u)c.defId=u;let p=c.schema;for(let f in p)delete p[f];p.$ref=a};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
56
+ `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,c=ae,a=!A.jitless,p=a&&Pr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=o.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(a&&p&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return wn([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function Do(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!M(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>V(s,o,N())))}),t}var Sn=l("$ZodUnion",(e,t)=>{w.init(e,t),x(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),x(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),x(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),x(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${n.map((i)=>ze(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}if(!i)return Do(s,o,e,n);return Promise.all(s).then((c)=>Do(c,o,e,n))}});var Zn=l("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([a,u])=>Ko(r,a,u));return Ko(r,i,s)}});function kt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ee(e)&&ee(t)){let r=Object.keys(t),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let i of o){if(i==="__proto__")continue;let s=kt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=kt(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ko(e,t,r){let o=new Map,n,i=new Map,s=(u,p)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let d=String(u.path[0]);if(!i.has(d))i.set(d,u);f=[d]}else return!1;for(let d of f){if(!o.has(d))o.set(d,{});o.get(d)[p]=!0}return!0};for(let u of t.issues)if(!s(u,"l"))e.issues.push(u);for(let u of r.issues)if(!s(u,"r"))e.issues.push(u);let c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter((p)=>n.keys.includes(p)):[];if(u.length)e.issues.push({...n,keys:u});for(let p of c)if(!u.includes(p)&&i.has(p))e.issues.push(i.get(p))}let a=kt(t.value,r.value);if(!a.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var On=l("$ZodEnum",(e,t)=>{w.init(e,t);let r=ue(t.entries),o=new Set(r);e._zod.values=o,x(e,"pattern",(n)=>{let i=ue(n.def.entries).filter((s)=>zr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>te(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}});var In=l("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",A.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new U;return r.value=n,r}});function Lo(e,t){return e.value=t.issues.length?void 0:t.value,e}var It=l("$ZodOptional",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Lo(r,i));return Lo(r,n)}return t.innerType._zod.run(r,o)}}),En=l("$ZodExactOptional",(e,t)=>{It.init(e,t),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Tn=l("$ZodNullable",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)}|null)$`):void 0}),x(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),An=l("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>jo(i,t));return jo(n,t)}});function jo(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Rn=l("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Cn=l("$ZodNonOptional",(e,t)=>{w.init(e,t),x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Fo(i,e));return Fo(n,e)}});function Fo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Mo(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>V(n,o,N()))},input:e.value}),e}var Nn=l("$ZodCatch",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Mo(r,i,t,o));return Mo(r,n,t,o)}});var Dn=l("$ZodPipe",(e,t)=>{w.init(e,t),x(e,"values",(r)=>r.def.in._zod.values),x(e,"optin",(r)=>r.def.in._zod.optin),x(e,"optout",(r)=>r.def.out._zod.optout),x(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>Ke(s,t.in,o));return Ke(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Ke(i,t.out,o));return Ke(n,t.out,o)}});function Ke(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Kn=l("$ZodReadonly",(e,t)=>{w.init(e,t),x(e,"propValues",(r)=>r.def.innerType._zod.propValues),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"optin",(r)=>r.def.innerType?._zod?.optin),x(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Uo);return Uo(n)}});function Uo(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Ln=l("$ZodCustom",(e,t)=>{O.init(e,t),w.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((i)=>Jo(i,r,o,e));Jo(n,r,o,e);return}});function Jo(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(X(n))}}class Fn extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Tt="~memo",jn=[];function Mn(e){return e!==null&&typeof e==="object"}function Et(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Un=new WeakMap,me=0,Be=1,he=2;function We(e,t,r){let o=Un.get(e);if(o!==void 0)return o?he:me;if(t.has(e))return he;t.add(e);let n=me,i=(p)=>{if(n!==he&&p?._zod){let f=We(p,t,r);if(f>n)n=f}},s=(p,f)=>{let d=me;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let _=h.get?Be:h.value?._zod?We(h.value,t,r):me;if(_>d)d=_}return d},c=(p)=>{if(p>n)n=p},a=e._zod.def,u=a.type;switch(u){case"object":{let p=$e(a);c(p?s(p,!0):Be),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let p of a.items)i(p);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let p of a.options)i(p);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let p=a._cachedInner??(r?e._zod.innerType:void 0);c(p?We(p,t,!1):Be);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let p in a){let f=Object.getOwnPropertyDescriptor(a,p);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),zc(e,n)}function zc(e,t){if(t!==Be)Un.set(e,t===he);return t}function $c(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Ue,Je=[],wc={alloc(e,t,r){let o=Ue;if(!o)return r;Ue=void 0;let n={value:r,issues:null};return o.set(t.value,n),Je.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,i)=>{if(i.direction!=="backward"&&kc(i,n.value))throw new Fn;return r(n,i)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(a,u)=>{if(r===void 0){let b=We(e,new Set,!1);if(b===me){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(a,u)}if(b===he||o)r=!0;else o=!0}let p=a.value;if(!Mn(p))return s(a,u);let f=u[Tt];if(!f)f={buckets:new WeakMap,backEdges:void 0},u[Tt]=f;let d;if(n===u)d=i;else d=$c(f,e),n=u,i=d;let m=d.get(p);if(m){if(a.value=m.value,m.issues){if(m.issues.length)a.issues.push(...Et(m.issues))}else a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return a}Ue=d;let h=Je.length,_=s(a,u);Ue=void 0;let g=Je.length>h?Je.pop():void 0;if(_ instanceof Promise)return _.then((b)=>{if(g)g.issues=b.issues.length?Et(b.issues):jn;return b});if(g)g.issues=_.issues.length?Et(_.issues):jn;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Jn(){return wc}function kc(e,t){let r=e[Tt]?.backEdges;return r!==void 0&&Mn(t)&&r.has(t)}var Sc=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return o[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=n(i.expected),c=Zr(i.input),a=n(c,i.input);return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${pt(i.values[0])}`;return`Invalid option: expected one of ${at(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${at(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function At(){return{localeError:Sc()}}var Bn;class Wn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Zc(){return new Wn}(Bn=globalThis).__zod_globalRegistry??(Bn.__zod_globalRegistry=Zc());var Y=globalThis.__zod_globalRegistry;function Vn(e){if(e.checks)e.checks=[...e.checks];return e}function Hn(e,t){return new e(Vn({type:"string",...y(t)}))}function Gn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...y(t)})}function Xn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...y(t)})}function Yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...y(t)})}function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y(t)})}function Qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y(t)})}function ei(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y(t)})}function ti(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...y(t)})}function ri(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...y(t)})}function oi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...y(t)})}function ni(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...y(t)})}function ii(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...y(t)})}function si(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...y(t)})}function ci(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...y(t)})}function ai(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...y(t)})}function ui(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...y(t)})}function li(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...y(t)})}function pi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y(t)})}function fi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y(t)})}function di(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...y(t)})}function mi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...y(t)})}function hi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...y(t)})}function yi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...y(t)})}function gi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y(t)})}function _i(e,t){return new e({type:"string",format:"date",check:"string_format",...y(t)})}function xi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...y(t)})}function bi(e,t){return new e({type:"string",format:"duration",check:"string_format",...y(t)})}function vi(e,t){return new e(Vn({type:"number",checks:[],...y(t)}))}function Pi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...y(t)})}function zi(e){return new e({type:"unknown"})}function $i(e,t){return new e({type:"never",...y(t)})}function Ve(e,t){return new zt({check:"less_than",...y(t),value:e,inclusive:!1})}function ye(e,t){return new zt({check:"less_than",...y(t),value:e,inclusive:!0})}function He(e,t){return new $t({check:"greater_than",...y(t),value:e,inclusive:!1})}function ge(e,t){return new $t({check:"greater_than",...y(t),value:e,inclusive:!0})}function Ge(e,t){return new vo({check:"multiple_of",...y(t),value:e})}function Xe(e,t){return new zo({check:"max_length",...y(t),maximum:e})}function re(e,t){return new $o({check:"min_length",...y(t),minimum:e})}function Ye(e,t){return new wo({check:"length_equals",...y(t),length:e})}function Rt(e,t){return new ko({check:"string_format",format:"regex",...y(t),pattern:e})}function Ct(e){return new So({check:"string_format",format:"lowercase",...y(e)})}function Nt(e){return new Zo({check:"string_format",format:"uppercase",...y(e)})}function Dt(e,t){return new Oo({check:"string_format",format:"includes",...y(t),includes:e})}function Kt(e,t){return new Io({check:"string_format",format:"starts_with",...y(t),prefix:e})}function Lt(e,t){return new Eo({check:"string_format",format:"ends_with",...y(t),suffix:e})}function H(e){return new To({check:"overwrite",tx:e})}function jt(e){return H((t)=>t.normalize(e))}function Ft(){return H((e)=>e.trim())}function Mt(){return H((e)=>e.toLowerCase())}function Ut(){return H((e)=>e.toUpperCase())}function Jt(){return H((e)=>vr(e))}function wi(e,t,r){return new e({type:"array",element:t,...y(r)})}function ki(e,t,r){return new e({type:"custom",check:"custom",fn:t,...y(r)})}function Si(e,t){let r=Oc((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(X(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=o.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(X(i))}},e(o.value,o)),t);return r}function Oc(e,t){let r=new O({check:"custom",...y(t)});return r._zod.check=e,r}function _e(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))j(e,o,r[o]);return e}function Wt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Y,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function q(e,t,r,o,n){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(n);return Object.assign(r,i),!0}function Z(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[n.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,d,p)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;Z(f,t,p),t.seen.get(f).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)_e(s.schema,a);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Zi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Vt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let a=o.get(c);if(a&&a!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,s[0])}}let n=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Zi(m)}`}}let a="#",u=`${a}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:a};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+Zi(p)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:a,defId:u}=n(s);if(c.def={...c.schema},u)c.defId=u;let p=c.schema;for(let f in p)delete p[f];p.$ref=a};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
57
57
 
58
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Ii(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Ii(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let i=o.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Ei=new Set(["type","properties","required","additionalProperties"]),Zi=["oneOf","anyOf"];function Oi(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Jt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Ei.has(s))return null;t.push(i)}let r={},o=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let u of t){let p=u.properties?.[s]??Oi(u);if(p===null||p===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(p)))c.push(p)}let a=c.length===1?c[0]:Jt(c)??{allOf:c};j(r,s,a)}for(let s of i.required??[])o.add(s)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((i)=>i.additionalProperties===!1))n.additionalProperties=!1;else{let i=[];for(let s of t){let c=Oi(s);if(c&&!i.some((a)=>JSON.stringify(a)===JSON.stringify(c)))i.push(c)}if(i.length===1)n.additionalProperties=i[0];else if(i.length>1)n.additionalProperties={allOf:i}}return n}function Sc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Ei)if(n in e)return;let r=t.filter((n)=>Zi.some((i)=>Array.isArray(n[i]))),o=null;if(!r.length)o=Jt(t);else{let n=r[0],i=Zi.find((a)=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let s=t.filter((a)=>a!==n),c=n[i].map((a)=>Jt([...s,a]));if(c.some((a)=>!a))return;o={[i]:c}}if(!o)return;delete e.allOf,_e(e,o)}function Vt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(c)=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,p={...u},f=a.ref;if(a.ref=null,f){o(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(h);else _e(u,h);if(_e(u,p),c._zod.parent===f)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(!(g in p))delete u[g]}if(h.$ref&&m.def)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g]))delete u[g]}}let d=c._zod.parent;if(d&&d!==f){o(d);let m=e.seen.get(d);if(m?.schema.$ref){if(u.$ref=m.schema.$ref,m.def)for(let h in u){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h]))delete u[h]}}}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Ii(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let p=u?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);if(f)f.push(u);else c.set(p,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Sc(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}_e(n,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;j(s,a.defId,a.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:xe(t,"input",e.processors),output:xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return I(o.element,r);if(o.type==="set")return I(o.valueType,r);if(o.type==="lazy")return I(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return I(o.innerType,r);if(o.type==="intersection")return I(o.left,r)||I(o.right,r);if(o.type==="record"||o.type==="map")return I(o.keyType,r)||I(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(o.in,r)||I(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(I(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(I(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(I(n,r))return!0;if(o.rest&&I(o.rest,r))return!0;return!1}return!1}var Ti=(e,t={})=>(r)=>{let o=Bt({...r,processors:t});return Z(e,o),Wt(o,e),Vt(o,e)},xe=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=Bt({...n??{},target:i,io:t,processors:r});return Z(e,s),Wt(s,e),Vt(s,e)};var oe=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},ne=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Ai=(e,t)=>{oe(e,"minimum",t),ne(e,"maximum",t)},Di=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Ki=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Li=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},ji=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ri=(e,t)=>oe(e,"minimum",t.minimum),Ci=(e,t)=>ne(e,"maximum",t.maximum),Ni=(e)=>(t,r)=>{ji(t,r.format);let[o,n]=e[r.format];oe(t,"minimum",o),ne(t,"maximum",n)},Zc={greater_than:(e,t)=>oe(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ne(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Di(e,t.value),number_format:Ni(we),bigint_format:Ni(pt),min_length:Ri,max_length:Ci,length_equals:(e,t)=>Ai(e,t.length),min_size:Ri,max_size:Ci,size_equals:(e,t)=>Ai(e,t.size),string_format:(e,t)=>{if(ji(e,t.format),t.pattern)Ki(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Li(e,t.mime)};function D(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of o)Zc[i._zod.def.check]?.(t,i._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)oe(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)oe(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)ne(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)ne(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Di(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)Li(t,n.mime);for(let i of n.patterns??[])Ki(t,i);return t}var Oc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ic=new Map([[St,ao],[Fe,uo]]),Ec=(e)=>Ic.get(e)??e,Fi=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:c,patterns:a,contentEncoding:u,laxFormat:p}=D(e);if(typeof i==="number")n.minLength=i;if(typeof s==="number")n.maxLength=s;if(c){if(n.format=Oc[c]??c,n.format==="")delete n.format;if(c==="time"||p)delete n.format}if(u)n.contentEncoding=u;if(a&&a.size>0){let f=[...a].map(Ec);if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Mi=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:p}=D(e);n.type=p?"integer":"number";let f=typeof u==="number"&&u>=(i??Number.NEGATIVE_INFINITY),d=typeof a==="number"&&a<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof i==="number")n.minimum=i;if(d)if(m)n.maximum=a,n.exclusiveMaximum=!0;else n.exclusiveMaximum=a;else if(typeof s==="number")n.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else q(e,t,n,o,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[_,...g]=h;if(_!==void 0)n.multipleOf=_;if(g.length)n.allOf=[...n.allOf??[],...g.map((b)=>({multipleOf:b}))]}};var Ui=(e,t,r,o)=>{r.not={}};var Ji=(e,t,r,o)=>{};var Bi=(e,t,r,o)=>{let n=e._zod.def,i=ue(n.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var Wi=(e,t,r,o)=>{q(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Vi=(e,t,r,o)=>{q(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Hi=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:c}=D(e);if(typeof s==="number")n.minItems=s;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=Z(i.element,t,{...o,path:[...o.path,"items"]})};function Ht(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Ht(t.out);if(t.type==="catch")return Ht(t.innerType);return e._zod.optin}var Gi=(e,t,r,o)=>{let n=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&q(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in s)j(n.properties,u,Z(s[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(s)){let p=i.shape[u];if(t.io==="input"?Ht(p)===void 0:p._zod.optout===void 0)a.push(u)}if(a.length>0)n.required=a;if(i.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=Z(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Xi=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((c,a)=>Z(c,t,{...o,path:[...o.path,i?"oneOf":"anyOf",a]}));if(i)r.oneOf=s;else r.anyOf=s},Yi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=Z(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,a=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=a,t.intersections.push(a)};var qi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.innerType,t,o),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Qi=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Gt=Symbol();function es(e,t,r,o,n){let i=!1,s=JSON.stringify(e,(c,a)=>{if(typeof a!=="bigint")return a;return i=!0,null});if(!i)return JSON.parse(s);return q(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Gt}var ts=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s=es(n.defaultValue,e,t,r,o);if(s!==Gt)r.default=s},rs=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io!=="input")return;let s=es(n.defaultValue,e,t,r,o);if(s!==Gt)r._prefault=s},os=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{q(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},ns=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;Z(s,t,o);let c=t.seen.get(e);c.ref=s},is=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var Xt=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType};var ss=new WeakSet([Object.prototype,Error.prototype]);function Ye(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Lc=(e,t)=>{Cr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(ss.has(r))return;ss.add(r),Ye(r,"format",(o)=>(n)=>Dr(o,n)),Ye(r,"flatten",(o)=>(n)=>Nr(o,n)),Ye(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,le,2)}),Ye(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,le,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var R=l("ZodError",Lc,void 0,{Parent:Error});var cs=Te(R),as=Ae(R),us=Re(R),ls=Ce(R),ps=Lr(R),fs=jr(R),ds=Fr(R),ms=Mr(R),hs=Ur(R),ys=Jr(R),gs=Br(R),_s=Wr(R);function Fc(){if(!A.localeError)N(Tt())}function Qt(){if(!A.memoizer)N({memoizer:Un()})}var k=l("ZodType",(e,t)=>(Fc(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ka(e,t))},superRefine(e,t){return this.check(La(e,t))},overwrite(e){return this.check(H(e))},optional(){return vs(this)},exactOptional(){return wa(this)},nullable(){return Ps(this)},nullish(){return vs(Ps(this))},nonoptional(e){return Ea(this,e)},array(){return ya(this)},or(e){return xa([this,e])},and(e){return va(this,e)},transform(e){return zs(this,$a(e))},default(e){return Za(this,e)},prefault(e){return Ia(this,e)},catch(e){return Aa(this,e)},pipe(e){return zs(this,e)},readonly(){return Na(this)},describe(e){let t=this.clone();return Y.add(t,{description:e}),t},meta(...e){if(e.length===0)return Y.get(this);let t=this.clone();return Y.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Ie(this,"~standard",{...kt(this),jsonSchema:{input:xe(this,"input"),output:xe(this,"output")}})},set "~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return cs(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await as(this,t,r,{callee:e})},safeParse(e,t){return us(this,e,t)},async safeParseAsync(e,t){return ls(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return yt(this,e,t)},validateAsync(e,t){return gt(this,e,t)},encode:function e(t,r){return ps(this,t,r,{callee:e})},decode:function e(t,r){return fs(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ds(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ms(this,t,r,{callee:e})},safeEncode(e,t){return hs(this,e,t)},safeDecode(e,t){return ys(this,e,t)},async safeEncodeAsync(e,t){return gs(this,e,t)},async safeDecodeAsync(e,t){return _s(this,e,t)},toJSONSchema(e){return Ti(this,{})(e)},get description(){return Y.get(this)?.description},get _def(){return this._zod.def}}),$s=l("_ZodString",(e,t)=>{je.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fi(e,r,o,n)},Or({format:(e)=>D(e).format??null,minLength:(e)=>D(e).minimum??null,maxLength:(e)=>D(e).maximum??null},{regex(...e){return this.check(At(...e))},includes(...e){return this.check(Nt(...e))},startsWith(...e){return this.check(Dt(...e))},endsWith(...e){return this.check(Kt(...e))},min(...e){return this.check(re(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(Xe(...e))},nonempty(...e){return this.check(re(1,...e))},lowercase(e){return this.check(Rt(e))},uppercase(e){return this.check(Ct(e))},trim(){return this.check(jt())},normalize(...e){return this.check(Lt(...e))},toLowerCase(){return this.check(Ft())},toUpperCase(){return this.check(Mt())},slugify(){return this.check(Ut())}})),Mc=l("ZodString",(e,t)=>{je.init(e,t),$s.init(e,t)},{email(e){return this.check(Hn(Vc,e))},url(e){return this.check(ei(Gc,e))},jwt(e){return this.check(hi(la,e))},emoji(e){return this.check(ti(Xc,e))},guid(e){return this.check(Gn(Hc,e))},uuid(e){return this.check(Xn(qe,e))},uuidv4(e){return this.check(Yn(qe,e))},uuidv6(e){return this.check(qn(qe,e))},uuidv7(e){return this.check(Qn(qe,e))},nanoid(e){return this.check(ri(Yc,e))},cuid(e){return this.check(oi(qc,e))},cuid2(e){return this.check(ni(Qc,e))},ulid(e){return this.check(ii(ea,e))},base64(e){return this.check(fi(ca,e))},base64url(e){return this.check(di(aa,e))},xid(e){return this.check(si(ta,e))},ksuid(e){return this.check(ci(ra,e))},ipv4(e){return this.check(ai(oa,e))},ipv6(e){return this.check(ui(na,e))},cidrv4(e){return this.check(li(ia,e))},cidrv6(e){return this.check(pi(sa,e))},e164(e){return this.check(mi(ua,e))},datetime(e){return this.check(yi(Uc,e))},date(e){return this.check(gi(Jc,e))},time(e){return this.check(_i(Bc,e))},duration(e){return this.check(xi(Wc,e))}});function Qe(e){return Vn(Mc,e)}var z=l("ZodStringFormat",(e,t)=>{P.init(e,t),$s.init(e,t)}),Uc=l("ZodISODateTime",(e,t)=>{nn.init(e,t),z.init(e,t)}),Jc=l("ZodISODate",(e,t)=>{sn.init(e,t),z.init(e,t)}),Bc=l("ZodISOTime",(e,t)=>{cn.init(e,t),z.init(e,t)}),Wc=l("ZodISODuration",(e,t)=>{an.init(e,t),z.init(e,t)}),Vc=l("ZodEmail",(e,t)=>{Vo.init(e,t),z.init(e,t)});var Hc=l("ZodGUID",(e,t)=>{Bo.init(e,t),z.init(e,t)});var qe=l("ZodUUID",(e,t)=>{Wo.init(e,t),z.init(e,t)});var Gc=l("ZodURL",(e,t)=>{Xo.init(e,t),z.init(e,t)});var Xc=l("ZodEmoji",(e,t)=>{Yo.init(e,t),z.init(e,t)});var Yc=l("ZodNanoID",(e,t)=>{qo.init(e,t),z.init(e,t)});var qc=l("ZodCUID",(e,t)=>{Qo.init(e,t),z.init(e,t)});var Qc=l("ZodCUID2",(e,t)=>{en.init(e,t),z.init(e,t)});var ea=l("ZodULID",(e,t)=>{tn.init(e,t),z.init(e,t)});var ta=l("ZodXID",(e,t)=>{rn.init(e,t),z.init(e,t)});var ra=l("ZodKSUID",(e,t)=>{on.init(e,t),z.init(e,t)});var oa=l("ZodIPv4",(e,t)=>{un.init(e,t),z.init(e,t)});var na=l("ZodIPv6",(e,t)=>{pn.init(e,t),z.init(e,t)});var ia=l("ZodCIDRv4",(e,t)=>{fn.init(e,t),z.init(e,t)});var sa=l("ZodCIDRv6",(e,t)=>{dn.init(e,t),z.init(e,t)});var ca=l("ZodBase64",(e,t)=>{hn.init(e,t),z.init(e,t)});var aa=l("ZodBase64URL",(e,t)=>{yn.init(e,t),z.init(e,t)});var ua=l("ZodE164",(e,t)=>{gn.init(e,t),z.init(e,t)});var la=l("ZodJWT",(e,t)=>{_n.init(e,t),z.init(e,t)});var ws=l("ZodNumber",(e,t)=>{Zt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mi(e,r,o,n),e.isFinite=!0},Or({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=D(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=D(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=D(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>D(e).format??null},{gt(e,t){return this.check(Ve(e,t))},gte(e,t){return this.check(ge(e,t))},min(e,t){return this.check(ge(e,t))},lt(e,t){return this.check(We(e,t))},lte(e,t){return this.check(ye(e,t))},max(e,t){return this.check(ye(e,t))},int(e){return this.check(xs(e))},safe(e){return this.check(xs(e))},positive(e){return this.check(Ve(0,e))},nonnegative(e){return this.check(ge(0,e))},negative(e){return this.check(We(0,e))},nonpositive(e){return this.check(ye(0,e))},multipleOf(e,t){return this.check(He(e,t))},step(e,t){return this.check(He(e,t))},finite(){return this}}));function ks(e){return bi(ws,e)}var pa=l("ZodNumberFormat",(e,t)=>{xn.init(e,t),ws.init(e,t)});function xs(e){return vi(pa,e)}var fa=l("ZodUnknown",(e,t)=>{bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ji(e,r,o,n)});function bs(){return Pi(fa)}var da=l("ZodNever",(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ui(e,r,o,n)});function ma(e){return zi(da,e)}var ha=l("ZodArray",(e,t)=>{Qt(),Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hi(e,r,o,n),e.element=t.element},{min(e,t){return this.check(re(e,t))},nonempty(e){return this.check(re(1,e))},max(e,t){return this.check(Ge(e,t))},length(e,t){return this.check(Xe(e,t))},unwrap(){return this.element}});function ya(e,t){return $i(ha,e,t)}var ga=l("ZodObject",(e,t)=>{Qt(),wn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gi(e,r,o,n),Gs(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return Pa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:bs()}))},loose(){return this.clone(T(this._zod.def,{catchall:bs()}))},strict(){return this.clone(T(this._zod.def,{catchall:ma()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return Fs(this,e)},safeExtend(e){return Ms(this,e)},merge(e){return Us(this,e)},pick(e){return Ls(this,e)},omit(e){return js(this,e)},partial(...e){return wr(Ss,this,e[0])},exactPartial(...e){return wr(Zs,this,e[0],"exactPartial")},required(...e){return Js(Os,this,e[0])}});function et(e,t){let r={type:"object",shape:e??{},...y(t)};return new ga(r)}var _a=l("ZodUnion",(e,t)=>{kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xi(e,r,o,n),e.options=t.options});function xa(e,t){return new _a({type:"union",options:e,...y(t)})}var ba=l("ZodIntersection",(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yi(e,r,o,n)});function va(e,t){return new ba({type:"intersection",left:e,right:t})}var qt=l("ZodEnum",(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bi(e,o,n,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new qt({...t,checks:[],...y(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new qt({...t,checks:[],...y(n),entries:i})}});function Pa(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new qt({type:"enum",entries:r,...y(t)})}var za=l("ZodTransform",(e,t)=>{Qt(),On.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vi(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(X(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(X(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r));return r.value=n,r}});function $a(e){return new za({type:"transform",transform:e})}var Ss=l("ZodOptional",(e,t)=>{Ot.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function vs(e){return new Ss({type:"optional",innerType:e})}var Zs=l("ZodExactOptional",(e,t)=>{In.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function wa(e){return new Zs({type:"optional",innerType:e})}var ka=l("ZodNullable",(e,t)=>{En.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ps(e){return new ka({type:"nullable",innerType:e})}var Sa=l("ZodDefault",(e,t)=>{Tn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ts(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Za(e,t){return new Sa({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ut(t)}})}var Oa=l("ZodPrefault",(e,t)=>{An.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ia(e,t){return new Oa({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ut(t)}})}var Os=l("ZodNonOptional",(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ea(e,t){return new Os({type:"nonoptional",innerType:e,...y(t)})}var Ta=l("ZodCatch",(e,t)=>{Cn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>os(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Aa(e,t){return new Ta({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Ir(t)})}var Ra=l("ZodPipe",(e,t)=>{Nn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ns(e,r,o,n),e.in=t.in,e.out=t.out});function zs(e,t){return new Ra({type:"pipe",in:e,out:t})}var Ca=l("ZodReadonly",(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Na(e){return new Ca({type:"readonly",innerType:e})}var Da=l("ZodCustom",(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wi(e,r,o,n)});function Ka(e,t={}){return wi(Da,e,t)}function La(e,t){return ki(e,t)}var be=et({mode:ks().optional()});import{mkdir as ja,open as Fa}from"fs/promises";import{dirname as Ma}from"path";function Is(e){return{async write(t){await ja(Ma(e),{recursive:!0});let r=await Fa(e,"w");try{let o=[];for await(let n of t)o.push((async()=>{let i=n.stream.getReader(),s=n.offset;for(;;){let{done:c,value:a}=await i.read();if(c)break;let u=a.payload.data;await r.write(u,0,u.byteLength,s),s+=u.byteLength}await n.complete()})());await Promise.all(o)}finally{await r.close()}}}}import{createReadStream as Ua}from"fs";import{Readable as Ja}from"stream";function Es(e,t,r){if(r!==void 0&&r<=t)return new ReadableStream({start(n){n.close()}});let o=Ua(e,{start:t,end:r===void 0?void 0:r-1});return fr(Ja.toWeb(o))}function Ts(e){return{kind:"js",stream:Es(e,0),async readRange(t,r){return Es(e,t,r)}}}import{createWriteStream as Ba}from"fs";import{mkdir as Wa,stat as Va}from"fs/promises";import{dirname as Ha}from"path";async function Ga(e){try{return(await Va(e)).size}catch(t){if(t.code==="ENOENT")return 0;throw t}}async function As(e,t){await Wa(Ha(e),{recursive:!0});let r=t?await Ga(e):0,o=Ba(e,{flags:t?"a":"w"});o.on("error",()=>{});let n=r,i=new WritableStream({write(s){return new Promise((c,a)=>{o.write(s.payload.data,(u)=>{if(u){a(u);return}n+=s.payload.data.byteLength,c()})})},close(){return new Promise((s,c)=>{o.end((a)=>a?c(a):s())})},abort(){return new Promise((s)=>{o.once("close",()=>s()),o.destroy()})}});return{kind:"js",stream:i,startOffset:r,resumeToken:()=>({offset:n})}}import{stat as Xa}from"fs/promises";async function er(e){let t=await Xa(e),r=t.isDirectory();return{size:r?void 0:t.size,lastModified:t.mtime,isContainer:r,properties:{mode:t.mode}}}import{readdir as Ya}from"fs/promises";import{join as qa}from"path";async function*tr(e,t,r){let o=await Ya(qa(e,t),{withFileTypes:!0});for(let n of o){let i=t?`${t}/${n.name}`:n.name;if(yield i,n.isDirectory()&&r)yield*tr(e,i,r)}}var ou=8388608;class ve{kind="js";rootPath;constructor(e=""){this.rootPath=e===""?"":ru(e)}async[Symbol.asyncDispose](){}async createContainer(e){await rr(E(this.rootPath,e),{recursive:!0})}joinKey(e,t){return rt(e,t)}list(e,t){let r=this.rootPath,o=E(r,e);async function*n(){for await(let i of tr(o,"",t?.recursive??!1)){if(t?.regex&&!t.regex.test(i))continue;let s=await er(rt(o,i));yield{path:i,properties:s}}}return n()}async getProperties(e){return er(E(this.rootPath,e))}async setProperties(e,t){let r=E(this.rootPath,e),o=be.parse(t.properties??{});if(o.mode!==void 0)await Qa(r,o.mode);if(t.lastModified!==void 0)await tu(r,t.lastModified,t.lastModified)}async delete(e){await Cs(E(this.rootPath,e),{recursive:!0,force:!1})}async getReadableStream(e){return Ts(E(this.rootPath,e))}async getWritableStream(e,t){return As(E(this.rootPath,e),t?.resume)}getPartSizeConstraints(e){return{minPartSize:0,maxPartSize:1/0,maxParts:1/0,defaultPartSize:ou}}getMultipartWriter(e,t){return Is(E(this.rootPath,e))}canDirectTransfer(e){return e instanceof ve&&e.rootPath===this.rootPath}supportsRecursiveDirectTransfer=!0;async directCopy(e,t,r){let o=E(this.rootPath,t);await rr(rt(o,".."),{recursive:!0}),await Rs(E(this.rootPath,e),o,{recursive:!0})}async directMove(e,t,r){let o=E(this.rootPath,e),n=E(this.rootPath,t);await rr(rt(n,".."),{recursive:!0});try{await eu(o,n)}catch(i){if(i.code==="EXDEV"){await Rs(o,n,{recursive:!0}),await Cs(o,{recursive:!0,force:!1});return}throw i}}}import{fileURLToPath as nu}from"url";function or(e){if(/^file:/i.test(e))return{path:nu(new URL(e))};return{path:e}}import{join as iu}from"path";function nr(e){let t={rootPath:""};if(e.filename!==void 0)return{config:t,target:{kind:"entry",key:iu(e.path,e.filename)}};if(e.pattern!==void 0)return{config:t,target:{kind:"pattern",containerKey:e.path,pattern:e.pattern}};return{config:t,target:{kind:"container",key:e.path}}}var ir=et({rootPath:Qe().optional()});var sr=et({path:Qe().default("/"),filename:Qe().optional(),pattern:Qe().optional()}).refine((e)=>e.filename===void 0||e.pattern===void 0,{message:"filename and pattern are mutually exclusive"});var cr=et({mode:ks().optional()});var ar={protocol:"file",kind:"js",configSchema:ir,locationSchema:sr,propertySchema:cr,settablePropertySchema:be,parseLocationString:or,toProviderInputs:nr,async createProvider(e){return new ve(e.rootPath)}};var su={create:()=>Promise.resolve(ar)},cu={extensionPoint:pr,factory:su},au={extensionDescriptors:[cu]},uu=au;export{ve as FilesystemIOProvider,uu as default,ir as filesystemConfigSchema,ar as filesystemIOProviderFactory,sr as filesystemLocationSchema,cr as filesystemPropertySchema,be as filesystemSettablePropertySchema,or as parseFileLocationString,nr as toFileProviderInputs};
58
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Ei(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Ei(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let i=o.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Ti=new Set(["type","properties","required","additionalProperties"]),Oi=["oneOf","anyOf"];function Ii(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Bt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Ti.has(s))return null;t.push(i)}let r={},o=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let u of t){let p=u.properties?.[s]??Ii(u);if(p===null||p===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(p)))c.push(p)}let a=c.length===1?c[0]:Bt(c)??{allOf:c};j(r,s,a)}for(let s of i.required??[])o.add(s)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((i)=>i.additionalProperties===!1))n.additionalProperties=!1;else{let i=[];for(let s of t){let c=Ii(s);if(c&&!i.some((a)=>JSON.stringify(a)===JSON.stringify(c)))i.push(c)}if(i.length===1)n.additionalProperties=i[0];else if(i.length>1)n.additionalProperties={allOf:i}}return n}function Ic(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Ti)if(n in e)return;let r=t.filter((n)=>Oi.some((i)=>Array.isArray(n[i]))),o=null;if(!r.length)o=Bt(t);else{let n=r[0],i=Oi.find((a)=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let s=t.filter((a)=>a!==n),c=n[i].map((a)=>Bt([...s,a]));if(c.some((a)=>!a))return;o={[i]:c}}if(!o)return;delete e.allOf,_e(e,o)}function Ht(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(c)=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,p={...u},f=a.ref;if(a.ref=null,f){o(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(h);else _e(u,h);if(_e(u,p),c._zod.parent===f)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(!(g in p))delete u[g]}if(h.$ref&&m.def)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g]))delete u[g]}}let d=c._zod.parent;if(d&&d!==f){o(d);let m=e.seen.get(d);if(m?.schema.$ref){if(u.$ref=m.schema.$ref,m.def)for(let h in u){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h]))delete u[h]}}}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Ei(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let p=u?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);if(f)f.push(u);else c.set(p,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Ic(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}_e(n,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;j(s,a.defId,a.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:xe(t,"input",e.processors),output:xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return I(o.element,r);if(o.type==="set")return I(o.valueType,r);if(o.type==="lazy")return I(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return I(o.innerType,r);if(o.type==="intersection")return I(o.left,r)||I(o.right,r);if(o.type==="record"||o.type==="map")return I(o.keyType,r)||I(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(o.in,r)||I(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(I(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(I(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(I(n,r))return!0;if(o.rest&&I(o.rest,r))return!0;return!1}return!1}var Ai=(e,t={})=>(r)=>{let o=Wt({...r,processors:t});return Z(e,o),Vt(o,e),Ht(o,e)},xe=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=Wt({...n??{},target:i,io:t,processors:r});return Z(e,s),Vt(s,e),Ht(s,e)};var oe=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},ne=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Ri=(e,t)=>{oe(e,"minimum",t),ne(e,"maximum",t)},Ki=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Li=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},ji=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Fi=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ci=(e,t)=>oe(e,"minimum",t.minimum),Ni=(e,t)=>ne(e,"maximum",t.maximum),Di=(e)=>(t,r)=>{Fi(t,r.format);let[o,n]=e[r.format];oe(t,"minimum",o),ne(t,"maximum",n)},Ec={greater_than:(e,t)=>oe(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ne(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ki(e,t.value),number_format:Di(we),bigint_format:Di(ft),min_length:Ci,max_length:Ni,length_equals:(e,t)=>Ri(e,t.length),min_size:Ci,max_size:Ni,size_equals:(e,t)=>Ri(e,t.size),string_format:(e,t)=>{if(Fi(e,t.format),t.pattern)Li(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>ji(e,t.mime)};function D(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of o)Ec[i._zod.def.check]?.(t,i._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)oe(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)oe(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)ne(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)ne(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Ki(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)ji(t,n.mime);for(let i of n.patterns??[])Li(t,i);return t}var Tc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ac=new Map([[Zt,uo],[Me,lo]]),Rc=(e)=>Ac.get(e)??e,Mi=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:c,patterns:a,contentEncoding:u,laxFormat:p}=D(e);if(typeof i==="number")n.minLength=i;if(typeof s==="number")n.maxLength=s;if(c){if(n.format=Tc[c]??c,n.format==="")delete n.format;if(c==="time"||p)delete n.format}if(u)n.contentEncoding=u;if(a&&a.size>0){let f=[...a].map(Rc);if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Ui=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:p}=D(e);n.type=p?"integer":"number";let f=typeof u==="number"&&u>=(i??Number.NEGATIVE_INFINITY),d=typeof a==="number"&&a<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof i==="number")n.minimum=i;if(d)if(m)n.maximum=a,n.exclusiveMaximum=!0;else n.exclusiveMaximum=a;else if(typeof s==="number")n.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else q(e,t,n,o,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[_,...g]=h;if(_!==void 0)n.multipleOf=_;if(g.length)n.allOf=[...n.allOf??[],...g.map((b)=>({multipleOf:b}))]}};var Ji=(e,t,r,o)=>{r.not={}};var Bi=(e,t,r,o)=>{};var Wi=(e,t,r,o)=>{let n=e._zod.def,i=ue(n.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var Vi=(e,t,r,o)=>{q(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Hi=(e,t,r,o)=>{q(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Gi=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:c}=D(e);if(typeof s==="number")n.minItems=s;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=Z(i.element,t,{...o,path:[...o.path,"items"]})};function Gt(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Gt(t.out);if(t.type==="catch")return Gt(t.innerType);return e._zod.optin}var Xi=(e,t,r,o)=>{let n=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&q(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in s)j(n.properties,u,Z(s[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(s)){let p=i.shape[u];if(t.io==="input"?Gt(p)===void 0:p._zod.optout===void 0)a.push(u)}if(a.length>0)n.required=a;if(i.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=Z(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Yi=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((c,a)=>Z(c,t,{...o,path:[...o.path,i?"oneOf":"anyOf",a]}));if(i)r.oneOf=s;else r.anyOf=s},qi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=Z(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,a=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=a,t.intersections.push(a)};var Qi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.innerType,t,o),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},es=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Xt=Symbol();function ts(e,t,r,o,n){let i=!1,s=JSON.stringify(e,(c,a)=>{if(typeof a!=="bigint")return a;return i=!0,null});if(!i)return JSON.parse(s);return q(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Xt}var rs=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s=ts(n.defaultValue,e,t,r,o);if(s!==Xt)r.default=s},os=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io!=="input")return;let s=ts(n.defaultValue,e,t,r,o);if(s!==Xt)r._prefault=s},ns=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{q(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},is=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;Z(s,t,o);let c=t.seen.get(e);c.ref=s},ss=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var Yt=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType};var cs=new WeakSet([Object.prototype,Error.prototype]);function qe(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Mc=(e,t)=>{Nr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(cs.has(r))return;cs.add(r),qe(r,"format",(o)=>(n)=>Kr(o,n)),qe(r,"flatten",(o)=>(n)=>Dr(o,n)),qe(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,le,2)}),qe(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,le,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var R=l("ZodError",Mc,void 0,{Parent:Error});var as=Ae(R),us=Re(R),ls=Ce(R),ps=Ne(R),fs=jr(R),ds=Fr(R),ms=Mr(R),hs=Ur(R),ys=Jr(R),gs=Br(R),_s=Wr(R),xs=Vr(R);function Jc(){if(!A.localeError)N(At())}function er(){if(!A.memoizer)N({memoizer:Jn()})}var k=l("ZodType",(e,t)=>(Jc(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fa(e,t))},superRefine(e,t){return this.check(Ma(e,t))},overwrite(e){return this.check(H(e))},optional(){return Ps(this)},exactOptional(){return Za(this)},nullable(){return zs(this)},nullish(){return Ps(zs(this))},nonoptional(e){return Ra(this,e)},array(){return xa(this)},or(e){return Pa([this,e])},and(e){return $a(this,e)},transform(e){return $s(this,Sa(e))},default(e){return Ea(this,e)},prefault(e){return Aa(this,e)},catch(e){return Na(this,e)},pipe(e){return $s(this,e)},readonly(){return La(this)},describe(e){let t=this.clone();return Y.add(t,{description:e}),t},meta(...e){if(e.length===0)return Y.get(this);let t=this.clone();return Y.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Ee(this,"~standard",{...St(this),jsonSchema:{input:xe(this,"input"),output:xe(this,"output")}})},set "~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return as(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await us(this,t,r,{callee:e})},safeParse(e,t){return ls(this,e,t)},async safeParseAsync(e,t){return ps(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return gt(this,e,t)},validateAsync(e,t){return _t(this,e,t)},encode:function e(t,r){return fs(this,t,r,{callee:e})},decode:function e(t,r){return ds(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ms(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await hs(this,t,r,{callee:e})},safeEncode(e,t){return ys(this,e,t)},safeDecode(e,t){return gs(this,e,t)},async safeEncodeAsync(e,t){return _s(this,e,t)},async safeDecodeAsync(e,t){return xs(this,e,t)},toJSONSchema(e){return Ai(this,{})(e)},get description(){return Y.get(this)?.description},get _def(){return this._zod.def}}),ws=l("_ZodString",(e,t)=>{Fe.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mi(e,r,o,n)},Ir({format:(e)=>D(e).format??null,minLength:(e)=>D(e).minimum??null,maxLength:(e)=>D(e).maximum??null},{regex(...e){return this.check(Rt(...e))},includes(...e){return this.check(Dt(...e))},startsWith(...e){return this.check(Kt(...e))},endsWith(...e){return this.check(Lt(...e))},min(...e){return this.check(re(...e))},max(...e){return this.check(Xe(...e))},length(...e){return this.check(Ye(...e))},nonempty(...e){return this.check(re(1,...e))},lowercase(e){return this.check(Ct(e))},uppercase(e){return this.check(Nt(e))},trim(){return this.check(Ft())},normalize(...e){return this.check(jt(...e))},toLowerCase(){return this.check(Mt())},toUpperCase(){return this.check(Ut())},slugify(){return this.check(Jt())}})),Bc=l("ZodString",(e,t)=>{Fe.init(e,t),ws.init(e,t)},{email(e){return this.check(Gn(Xc,e))},url(e){return this.check(ti(qc,e))},jwt(e){return this.check(yi(da,e))},emoji(e){return this.check(ri(Qc,e))},guid(e){return this.check(Xn(Yc,e))},uuid(e){return this.check(Yn(Qe,e))},uuidv4(e){return this.check(qn(Qe,e))},uuidv6(e){return this.check(Qn(Qe,e))},uuidv7(e){return this.check(ei(Qe,e))},nanoid(e){return this.check(oi(ea,e))},cuid(e){return this.check(ni(ta,e))},cuid2(e){return this.check(ii(ra,e))},ulid(e){return this.check(si(oa,e))},base64(e){return this.check(di(la,e))},base64url(e){return this.check(mi(pa,e))},xid(e){return this.check(ci(na,e))},ksuid(e){return this.check(ai(ia,e))},ipv4(e){return this.check(ui(sa,e))},ipv6(e){return this.check(li(ca,e))},cidrv4(e){return this.check(pi(aa,e))},cidrv6(e){return this.check(fi(ua,e))},e164(e){return this.check(hi(fa,e))},datetime(e){return this.check(gi(Wc,e))},date(e){return this.check(_i(Vc,e))},time(e){return this.check(xi(Hc,e))},duration(e){return this.check(bi(Gc,e))}});function et(e){return Hn(Bc,e)}var z=l("ZodStringFormat",(e,t)=>{P.init(e,t),ws.init(e,t)}),Wc=l("ZodISODateTime",(e,t)=>{sn.init(e,t),z.init(e,t)}),Vc=l("ZodISODate",(e,t)=>{cn.init(e,t),z.init(e,t)}),Hc=l("ZodISOTime",(e,t)=>{an.init(e,t),z.init(e,t)}),Gc=l("ZodISODuration",(e,t)=>{un.init(e,t),z.init(e,t)}),Xc=l("ZodEmail",(e,t)=>{Ho.init(e,t),z.init(e,t)});var Yc=l("ZodGUID",(e,t)=>{Wo.init(e,t),z.init(e,t)});var Qe=l("ZodUUID",(e,t)=>{Vo.init(e,t),z.init(e,t)});var qc=l("ZodURL",(e,t)=>{Yo.init(e,t),z.init(e,t)});var Qc=l("ZodEmoji",(e,t)=>{qo.init(e,t),z.init(e,t)});var ea=l("ZodNanoID",(e,t)=>{Qo.init(e,t),z.init(e,t)});var ta=l("ZodCUID",(e,t)=>{en.init(e,t),z.init(e,t)});var ra=l("ZodCUID2",(e,t)=>{tn.init(e,t),z.init(e,t)});var oa=l("ZodULID",(e,t)=>{rn.init(e,t),z.init(e,t)});var na=l("ZodXID",(e,t)=>{on.init(e,t),z.init(e,t)});var ia=l("ZodKSUID",(e,t)=>{nn.init(e,t),z.init(e,t)});var sa=l("ZodIPv4",(e,t)=>{ln.init(e,t),z.init(e,t)});var ca=l("ZodIPv6",(e,t)=>{fn.init(e,t),z.init(e,t)});var aa=l("ZodCIDRv4",(e,t)=>{dn.init(e,t),z.init(e,t)});var ua=l("ZodCIDRv6",(e,t)=>{mn.init(e,t),z.init(e,t)});var la=l("ZodBase64",(e,t)=>{yn.init(e,t),z.init(e,t)});var pa=l("ZodBase64URL",(e,t)=>{gn.init(e,t),z.init(e,t)});var fa=l("ZodE164",(e,t)=>{_n.init(e,t),z.init(e,t)});var da=l("ZodJWT",(e,t)=>{xn.init(e,t),z.init(e,t)});var ks=l("ZodNumber",(e,t)=>{Ot.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ui(e,r,o,n),e.isFinite=!0},Ir({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=D(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=D(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=D(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>D(e).format??null},{gt(e,t){return this.check(He(e,t))},gte(e,t){return this.check(ge(e,t))},min(e,t){return this.check(ge(e,t))},lt(e,t){return this.check(Ve(e,t))},lte(e,t){return this.check(ye(e,t))},max(e,t){return this.check(ye(e,t))},int(e){return this.check(bs(e))},safe(e){return this.check(bs(e))},positive(e){return this.check(He(0,e))},nonnegative(e){return this.check(ge(0,e))},negative(e){return this.check(Ve(0,e))},nonpositive(e){return this.check(ye(0,e))},multipleOf(e,t){return this.check(Ge(e,t))},step(e,t){return this.check(Ge(e,t))},finite(){return this}}));function Ss(e){return vi(ks,e)}var ma=l("ZodNumberFormat",(e,t)=>{bn.init(e,t),ks.init(e,t)});function bs(e){return Pi(ma,e)}var ha=l("ZodUnknown",(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bi(e,r,o,n)});function vs(){return zi(ha)}var ya=l("ZodNever",(e,t)=>{Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ji(e,r,o,n)});function ga(e){return $i(ya,e)}var _a=l("ZodArray",(e,t)=>{er(),zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gi(e,r,o,n),e.element=t.element},{min(e,t){return this.check(re(e,t))},nonempty(e){return this.check(re(1,e))},max(e,t){return this.check(Xe(e,t))},length(e,t){return this.check(Ye(e,t))},unwrap(){return this.element}});function xa(e,t){return wi(_a,e,t)}var ba=l("ZodObject",(e,t)=>{er(),kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xi(e,r,o,n),Xs(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return wa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:vs()}))},loose(){return this.clone(T(this._zod.def,{catchall:vs()}))},strict(){return this.clone(T(this._zod.def,{catchall:ga()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return Ms(this,e)},safeExtend(e){return Us(this,e)},merge(e){return Js(this,e)},pick(e){return js(this,e)},omit(e){return Fs(this,e)},partial(...e){return kr(Zs,this,e[0])},exactPartial(...e){return kr(Os,this,e[0],"exactPartial")},required(...e){return Bs(Is,this,e[0])}});function tt(e,t){let r={type:"object",shape:e??{},...y(t)};return new ba(r)}var va=l("ZodUnion",(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yi(e,r,o,n),e.options=t.options});function Pa(e,t){return new va({type:"union",options:e,...y(t)})}var za=l("ZodIntersection",(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qi(e,r,o,n)});function $a(e,t){return new za({type:"intersection",left:e,right:t})}var Qt=l("ZodEnum",(e,t)=>{On.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Wi(e,o,n,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Qt({...t,checks:[],...y(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Qt({...t,checks:[],...y(n),entries:i})}});function wa(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Qt({type:"enum",entries:r,...y(t)})}var ka=l("ZodTransform",(e,t)=>{er(),In.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hi(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(X(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(X(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r));return r.value=n,r}});function Sa(e){return new ka({type:"transform",transform:e})}var Zs=l("ZodOptional",(e,t)=>{It.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ps(e){return new Zs({type:"optional",innerType:e})}var Os=l("ZodExactOptional",(e,t)=>{En.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Os({type:"optional",innerType:e})}var Oa=l("ZodNullable",(e,t)=>{Tn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Oa({type:"nullable",innerType:e})}var Ia=l("ZodDefault",(e,t)=>{An.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ea(e,t){return new Ia({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():lt(t)}})}var Ta=l("ZodPrefault",(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>os(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Aa(e,t){return new Ta({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():lt(t)}})}var Is=l("ZodNonOptional",(e,t)=>{Cn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>es(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ra(e,t){return new Is({type:"nonoptional",innerType:e,...y(t)})}var Ca=l("ZodCatch",(e,t)=>{Nn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ns(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Na(e,t){return new Ca({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Er(t)})}var Da=l("ZodPipe",(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.in=t.in,e.out=t.out});function $s(e,t){return new Da({type:"pipe",in:e,out:t})}var Ka=l("ZodReadonly",(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ss(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function La(e){return new Ka({type:"readonly",innerType:e})}var ja=l("ZodCustom",(e,t)=>{Ln.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vi(e,r,o,n)});function Fa(e,t={}){return ki(ja,e,t)}function Ma(e,t){return Si(e,t)}var be=tt({mode:Ss().optional()});import{mkdir as Ua,open as Ja}from"fs/promises";import{dirname as Ba}from"path";function Es(e){return{async write(t){await Ua(Ba(e),{recursive:!0});let r=await Ja(e,"w");try{let o=[];for await(let n of t)o.push((async()=>{let i=n.stream.getReader(),s=n.offset;for(;;){let{done:c,value:a}=await i.read();if(c)break;let u=a.payload.data;await r.write(u,0,u.byteLength,s),s+=u.byteLength}await n.complete()})());await Promise.all(o)}finally{await r.close()}}}}import{createReadStream as Wa}from"fs";import{Readable as Va}from"stream";function Ts(e,t,r){if(r!==void 0&&r<=t)return new ReadableStream({start(n){n.close()}});let o=Wa(e,{start:t,end:r===void 0?void 0:r-1});return dr(Va.toWeb(o))}function As(e){return{kind:"js",stream:Ts(e,0),async readRange(t,r){return Ts(e,t,r)}}}import{createWriteStream as Ha}from"fs";import{mkdir as Ga,stat as Xa}from"fs/promises";import{dirname as Ya}from"path";async function qa(e){try{return(await Xa(e)).size}catch(t){if(t.code==="ENOENT")return 0;throw t}}async function Rs(e,t){await Ga(Ya(e),{recursive:!0});let r=t?await qa(e):0,o=Ha(e,{flags:t?"a":"w"});o.on("error",()=>{});let n=r,i=new WritableStream({write(s){return new Promise((c,a)=>{o.write(s.payload.data,(u)=>{if(u){a(u);return}n+=s.payload.data.byteLength,c()})})},close(){return new Promise((s,c)=>{o.end((a)=>a?c(a):s())})},abort(){return new Promise((s)=>{o.once("close",()=>s()),o.destroy()})}});return{kind:"js",stream:i,startOffset:r,resumeToken:()=>({offset:n})}}import{stat as Qa}from"fs/promises";async function tr(e){let t=await Qa(e),r=t.isDirectory();return{size:r?void 0:t.size,lastModified:t.mtime,isContainer:r,properties:{mode:t.mode}}}import{readdir as eu}from"fs/promises";import{join as tu}from"path";async function*rr(e,t,r){let o=await eu(tu(e,t),{withFileTypes:!0});for(let n of o){let i=t?`${t}/${n.name}`:n.name;if(yield i,n.isDirectory()&&r)yield*rr(e,i,r)}}var su=8388608;class ve{kind="js";rootPath;constructor(e=""){this.rootPath=e===""?"":iu(e)}async[Symbol.asyncDispose](){}async createContainer(e){await or(E(this.rootPath,e),{recursive:!0})}joinKey(e,t){return ot(e,t)}list(e,t){let r=this.rootPath,o=E(r,e);async function*n(){for await(let i of rr(o,"",t?.recursive??!1)){if(t?.regex&&!t.regex.test(i))continue;let s=await tr(ot(o,i));yield{path:i,properties:s}}}return n()}async getProperties(e){return tr(E(this.rootPath,e))}async setProperties(e,t){let r=E(this.rootPath,e),o=be.parse(t.properties??{});if(o.mode!==void 0)await ru(r,o.mode);if(t.lastModified!==void 0)await nu(r,t.lastModified,t.lastModified)}async delete(e){await Ns(E(this.rootPath,e),{recursive:!0,force:!1})}async getReadableStream(e){return As(E(this.rootPath,e))}async getWritableStream(e,t){return Rs(E(this.rootPath,e),t?.resume)}getPartSizeConstraints(e){return{minPartSize:0,maxPartSize:1/0,maxParts:1/0,defaultPartSize:su}}getMultipartWriter(e,t){return Es(E(this.rootPath,e))}canDirectTransfer(e){return e instanceof ve&&e.rootPath===this.rootPath}supportsRecursiveDirectTransfer=!0;async directCopy(e,t,r){let o=E(this.rootPath,t);await or(ot(o,".."),{recursive:!0}),await Cs(E(this.rootPath,e),o,{recursive:!0})}async directMove(e,t,r){let o=E(this.rootPath,e),n=E(this.rootPath,t);await or(ot(n,".."),{recursive:!0});try{await ou(o,n)}catch(i){if(i.code==="EXDEV"){await Cs(o,n,{recursive:!0}),await Ns(o,{recursive:!0,force:!1});return}throw i}}}import{fileURLToPath as cu}from"url";function nr(e){if(/^file:/i.test(e))return{path:cu(new URL(e))};return{path:e}}import{join as au}from"path";function ir(e){let t={rootPath:""};if(e.filename!==void 0)return{config:t,target:{kind:"entry",key:au(e.path,e.filename)}};if(e.pattern!==void 0)return{config:t,target:{kind:"pattern",containerKey:e.path,pattern:e.pattern}};return{config:t,target:{kind:"container",key:e.path}}}var sr=tt({rootPath:et().optional()});var cr=tt({path:et().default("/"),filename:et().optional(),pattern:et().optional()}).refine((e)=>e.filename===void 0||e.pattern===void 0,{message:"filename and pattern are mutually exclusive"});var ar=tt({mode:Ss().optional()});var ur={protocol:"file",kind:"js",configSchema:sr,locationSchema:cr,propertySchema:ar,settablePropertySchema:be,parseLocationString:nr,toProviderInputs:ir,async createProvider(e){return new ve(e.rootPath)}};var uu={create:()=>Promise.resolve(ur)},lu={extensionPoint:fr,factory:uu},pu={extensionDescriptors:[lu]},fu=pu;export{ve as FilesystemIOProvider,fu as default,sr as filesystemConfigSchema,ur as filesystemIOProviderFactory,cr as filesystemLocationSchema,ar as filesystemPropertySchema,be as filesystemSettablePropertySchema,nr as parseFileLocationString,ir as toFileProviderInputs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/io-plugin-filesystem",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Local filesystem source/sink plugin for https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",
@@ -36,13 +36,13 @@
36
36
  "test": "bun test"
37
37
  },
38
38
  "dependencies": {
39
- "@flowscripter/pluggable-io-framework-api": "^3.1.1",
40
- "zod": "^4.6.5"
39
+ "@flowscripter/pluggable-io-framework-api": "^3.1.2",
40
+ "zod": "^4.6.6"
41
41
  },
42
42
  "devDependencies": {
43
- "@flowscripter/dynamic-plugin-framework": "^2.2.19",
43
+ "@flowscripter/dynamic-plugin-framework": "^2.2.20",
44
44
  "@types/bun": "^1.4.2",
45
- "@types/node": "^26.6.4",
45
+ "@types/node": "^26.6.5",
46
46
  "oxfmt": "0.72.0",
47
47
  "oxlint": "1.87.0"
48
48
  },