@botpress/sdk 4.14.1 → 4.14.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.
@@ -1,20 +1,20 @@
1
1
 
2
- > @botpress/sdk@4.14.1 build /home/runner/work/botpress/botpress/packages/sdk
2
+ > @botpress/sdk@4.14.3 build /home/runner/work/botpress/botpress/packages/sdk
3
3
  > pnpm build:type && pnpm build:node && pnpm build:browser
4
4
 
5
5
 
6
- > @botpress/sdk@4.14.1 build:type /home/runner/work/botpress/botpress/packages/sdk
6
+ > @botpress/sdk@4.14.3 build:type /home/runner/work/botpress/botpress/packages/sdk
7
7
  > tsc --emitDeclarationOnly --declaration
8
8
 
9
9
 
10
- > @botpress/sdk@4.14.1 build:node /home/runner/work/botpress/botpress/packages/sdk
10
+ > @botpress/sdk@4.14.3 build:node /home/runner/work/botpress/botpress/packages/sdk
11
11
  > ts-node -T ./build.ts --node
12
12
 
13
13
  Done
14
14
 
15
- > @botpress/sdk@4.14.1 build:browser /home/runner/work/botpress/botpress/packages/sdk
15
+ > @botpress/sdk@4.14.3 build:browser /home/runner/work/botpress/botpress/packages/sdk
16
16
  > ts-node -T ./build.ts --browser
17
17
 
18
- (node:3758) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
18
+ (node:3814) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
19
19
  (Use `node --trace-deprecation ...` to show where the warning was created)
20
20
  Done
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ ${g.join(" | ")}`;case d.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let m=l.opt
8
8
  ${m.join(" | ")}`;case d.ZodFirstPartyTypeKind.ZodIntersection:return`${B(l.left,i)} & ${B(l.right,i)}`;case d.ZodFirstPartyTypeKind.ZodTuple:return l.items.length===0?"":`[${l.items.map(q=>B(q,i)).join(", ")}]`;case d.ZodFirstPartyTypeKind.ZodRecord:let E=B(l.keyType,i),I=B(l.valueType,i);return`${z(o.description)} { [key: ${E}]: ${I} }`;case d.ZodFirstPartyTypeKind.ZodMap:return`Map<${B(l.keyType,i)}, ${B(l.valueType,i)}>`;case d.ZodFirstPartyTypeKind.ZodSet:return`Set<${B(l.valueType,i)}>`;case d.ZodFirstPartyTypeKind.ZodFunction:let U=B(new Gs(l.args),i),W=B(new Js(l.returns),i);return`${z(o.description)}
9
9
  (${U}) => ${W}`;case d.ZodFirstPartyTypeKind.ZodLazy:return B(l.getter(),i);case d.ZodFirstPartyTypeKind.ZodLiteral:let Q=Ai(l.value);return`${z(o.description)}
10
10
  ${Q}`.trim();case d.ZodFirstPartyTypeKind.ZodEnum:return l.values.map(T).join(" | ");case d.ZodFirstPartyTypeKind.ZodEffects:return B(l.schema,i);case d.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Ji(d.ZodFirstPartyTypeKind.ZodNativeEnum);case d.ZodFirstPartyTypeKind.ZodOptional:return`${B(l.innerType,i)} | undefined`;case d.ZodFirstPartyTypeKind.ZodNullable:return`${B(l.innerType,i)} | null`;case d.ZodFirstPartyTypeKind.ZodDefault:return B(l.innerType,i);case d.ZodFirstPartyTypeKind.ZodCatch:return B(l.innerType,i);case d.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${B(l.type,i)}>`;case d.ZodFirstPartyTypeKind.ZodBranded:return B(l.type,i);case d.ZodFirstPartyTypeKind.ZodPipeline:return B(l.in,i);case d.ZodFirstPartyTypeKind.ZodSymbol:return`${z(o.description)} symbol`.trim();case d.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${B(l.innerType,i)}>`;case d.ZodFirstPartyTypeKind.ZodRef:return Hi(l.uri);default:Z.assertNever(l)}}a(B,"sUnwrapZod");var wd=a((t,e)=>{if(t.props.type==="none")return B(t.props.schema,e);let r=z(t.props.schema.description),n=t.props.schema.describe(""),s=B(n,e);if(t.props.type==="variable")return Vs(`${r}declare const ${t.props.identifier}: ${s};`);let i=t.props.args.length>0?`<${t.props.args.map(Hi).join(", ")}>`:"";return Vs(`${r}type ${t.props.identifier}${i} = ${s};`)},"unwrapDeclaration"),Pd=a(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),xd=a((t,e)=>{let r=Pd(e),n=t.getReferences();if(r==="none"){if(n.length>0)throw new Dn;return new er({type:"none",schema:t})}let s="title"in t.ui?t.ui.title:null;if(!s)throw new Yi;if(r==="variable"){if(n.length>0)throw new Dn;return new er({type:"variable",identifier:s,schema:t})}return new er({type:"type",identifier:s,schema:t,args:n})},"getDeclarationProps"),kd=typeof global=="object"&&global&&global.Object===Object&&global,ia=kd,Sd=typeof self=="object"&&self&&self.Object===Object&&self,Od=ia||Sd||Function("return this")(),he=Od,Ed=he.Symbol,Te=Ed,aa=Object.prototype,Zd=aa.hasOwnProperty,Id=aa.toString,_t=Te?Te.toStringTag:void 0;function oa(t){var e=Zd.call(t,_t),r=t[_t];try{t[_t]=void 0;var n=!0}catch{}var s=Id.call(t);return n&&(e?t[_t]=r:delete t[_t]),s}a(oa,"getRawTag");var Bd=oa,Cd=Object.prototype,Ad=Cd.toString;function la(t){return Ad.call(t)}a(la,"objectToString");var Rd=la,Hd="[object Null]",Dd="[object Undefined]",Xs=Te?Te.toStringTag:void 0;function ca(t){return t==null?t===void 0?Dd:Hd:Xs&&Xs in Object(t)?Bd(t):Rd(t)}a(ca,"baseGetTag");var Ke=ca;function ua(t){return t!=null&&typeof t=="object"}a(ua,"isObjectLike");var Me=ua,Md="[object Symbol]";function da(t){return typeof t=="symbol"||Me(t)&&Ke(t)==Md}a(da,"isSymbol");var Gn=da;function pa(t,e){for(var r=-1,n=t==null?0:t.length,s=Array(n);++r<n;)s[r]=e(t[r],r,t);return s}a(pa,"arrayMap");var fa=pa,Nd=Array.isArray,ge=Nd,$d=1/0,Ys=Te?Te.prototype:void 0,Qs=Ys?Ys.toString:void 0;function Jn(t){if(typeof t=="string")return t;if(ge(t))return fa(t,Jn)+"";if(Gn(t))return Qs?Qs.call(t):"";var e=t+"";return e=="0"&&1/t==-$d?"-0":e}a(Jn,"baseToString");var jd=Jn;function ga(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}a(ga,"isObject");var at=ga;function ha(t){return t}a(ha,"identity");var Kd=ha,Ud="[object AsyncFunction]",zd="[object Function]",Fd="[object GeneratorFunction]",Ld="[object Proxy]";function ma(t){if(!at(t))return!1;var e=Ke(t);return e==zd||e==Fd||e==Ud||e==Ld}a(ma,"isFunction");var ya=ma,Wd=he["__core-js_shared__"],En=Wd,ei=function(){var t=/[^.]+$/.exec(En&&En.keys&&En.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function va(t){return!!ei&&ei in t}a(va,"isMasked");var qd=va,Vd=Function.prototype,Gd=Vd.toString;function _a(t){if(t!=null){try{return Gd.call(t)}catch{}try{return t+""}catch{}}return""}a(_a,"toSource");var Ue=_a,Jd=/[\\^$.*+?()[\]{}|]/g,Xd=/^\[object .+?Constructor\]$/,Yd=Function.prototype,Qd=Object.prototype,ep=Yd.toString,tp=Qd.hasOwnProperty,rp=RegExp("^"+ep.call(tp).replace(Jd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ta(t){if(!at(t)||qd(t))return!1;var e=ya(t)?rp:Xd;return e.test(Ue(t))}a(Ta,"baseIsNative");var np=Ta;function ba(t,e){return t?.[e]}a(ba,"getValue");var sp=ba;function wa(t,e){var r=sp(t,e);return np(r)?r:void 0}a(wa,"getNative");var ze=wa,ip=ze(he,"WeakMap"),Mn=ip,ap=function(){try{var t=ze(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ti=ap,op=9007199254740991,lp=/^(?:0|[1-9]\d*)$/;function Pa(t,e){var r=typeof t;return e=e??op,!!e&&(r=="number"||r!="symbol"&&lp.test(t))&&t>-1&&t%1==0&&t<e}a(Pa,"isIndex");var Xn=Pa;function xa(t,e,r){e=="__proto__"&&ti?ti(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}a(xa,"baseAssignValue");var ka=xa;function Sa(t,e){return t===e||t!==t&&e!==e}a(Sa,"eq");var Yn=Sa,cp=Object.prototype,up=cp.hasOwnProperty;function Oa(t,e,r){var n=t[e];(!(up.call(t,e)&&Yn(n,r))||r===void 0&&!(e in t))&&ka(t,e,r)}a(Oa,"assignValue");var dp=Oa,pp=9007199254740991;function Ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=pp}a(Ea,"isLength");var Qn=Ea;function Za(t){return t!=null&&Qn(t.length)&&!ya(t)}a(Za,"isArrayLike");var Ia=Za,fp=Object.prototype;function Ba(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||fp;return t===r}a(Ba,"isPrototype");var Ca=Ba;function Aa(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}a(Aa,"baseTimes");var gp=Aa,hp="[object Arguments]";function Ra(t){return Me(t)&&Ke(t)==hp}a(Ra,"baseIsArguments");var ri=Ra,Ha=Object.prototype,mp=Ha.hasOwnProperty,yp=Ha.propertyIsEnumerable,vp=ri(function(){return arguments}())?ri:function(t){return Me(t)&&mp.call(t,"callee")&&!yp.call(t,"callee")},Da=vp;function Ma(){return!1}a(Ma,"stubFalse");var _p=Ma,Na=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ni=Na&&typeof module=="object"&&module&&!module.nodeType&&module,Tp=ni&&ni.exports===Na,si=Tp?he.Buffer:void 0,bp=si?si.isBuffer:void 0,wp=bp||_p,Nn=wp,Pp="[object Arguments]",xp="[object Array]",kp="[object Boolean]",Sp="[object Date]",Op="[object Error]",Ep="[object Function]",Zp="[object Map]",Ip="[object Number]",Bp="[object Object]",Cp="[object RegExp]",Ap="[object Set]",Rp="[object String]",Hp="[object WeakMap]",Dp="[object ArrayBuffer]",Mp="[object DataView]",Np="[object Float32Array]",$p="[object Float64Array]",jp="[object Int8Array]",Kp="[object Int16Array]",Up="[object Int32Array]",zp="[object Uint8Array]",Fp="[object Uint8ClampedArray]",Lp="[object Uint16Array]",Wp="[object Uint32Array]",D={};D[Np]=D[$p]=D[jp]=D[Kp]=D[Up]=D[zp]=D[Fp]=D[Lp]=D[Wp]=!0;D[Pp]=D[xp]=D[Dp]=D[kp]=D[Mp]=D[Sp]=D[Op]=D[Ep]=D[Zp]=D[Ip]=D[Bp]=D[Cp]=D[Ap]=D[Rp]=D[Hp]=!1;function $a(t){return Me(t)&&Qn(t.length)&&!!D[Ke(t)]}a($a,"baseIsTypedArray");var qp=$a;function ja(t){return function(e){return t(e)}}a(ja,"baseUnary");var Vp=ja,Ka=typeof exports=="object"&&exports&&!exports.nodeType&&exports,At=Ka&&typeof module=="object"&&module&&!module.nodeType&&module,Gp=At&&At.exports===Ka,Zn=Gp&&ia.process,Jp=function(){try{var t=At&&At.require&&At.require("util").types;return t||Zn&&Zn.binding&&Zn.binding("util")}catch{}}(),ii=Jp,ai=ii&&ii.isTypedArray,Xp=ai?Vp(ai):qp,Ua=Xp,Yp=Object.prototype,Qp=Yp.hasOwnProperty;function za(t,e){var r=ge(t),n=!r&&Da(t),s=!r&&!n&&Nn(t),i=!r&&!n&&!s&&Ua(t),o=r||n||s||i,l=o?gp(t.length,String):[],u=l.length;for(var f in t)(e||Qp.call(t,f))&&!(o&&(f=="length"||s&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Xn(f,u)))&&l.push(f);return l}a(za,"arrayLikeKeys");var Fa=za;function La(t,e){return function(r){return t(e(r))}}a(La,"overArg");var Wa=La,ef=Wa(Object.keys,Object),tf=ef,rf=Object.prototype,nf=rf.hasOwnProperty;function qa(t){if(!Ca(t))return tf(t);var e=[];for(var r in Object(t))nf.call(t,r)&&r!="constructor"&&e.push(r);return e}a(qa,"baseKeys");var sf=qa;function Va(t){return Ia(t)?Fa(t):sf(t)}a(Va,"keys");var es=Va;function Ga(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}a(Ga,"nativeKeysIn");var af=Ga,of=Object.prototype,lf=of.hasOwnProperty;function Ja(t){if(!at(t))return af(t);var e=Ca(t),r=[];for(var n in t)n=="constructor"&&(e||!lf.call(t,n))||r.push(n);return r}a(Ja,"baseKeysIn");var cf=Ja;function Xa(t){return Ia(t)?Fa(t,!0):cf(t)}a(Xa,"keysIn");var uf=Xa,df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pf=/^\w*$/;function Ya(t,e){if(ge(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Gn(t)?!0:pf.test(t)||!df.test(t)||e!=null&&t in Object(e)}a(Ya,"isKey");var ts=Ya,ff=ze(Object,"create"),Ht=ff;function Qa(){this.__data__=Ht?Ht(null):{},this.size=0}a(Qa,"hashClear");var gf=Qa;function eo(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}a(eo,"hashDelete");var hf=eo,mf="__lodash_hash_undefined__",yf=Object.prototype,vf=yf.hasOwnProperty;function to(t){var e=this.__data__;if(Ht){var r=e[t];return r===mf?void 0:r}return vf.call(e,t)?e[t]:void 0}a(to,"hashGet");var _f=to,Tf=Object.prototype,bf=Tf.hasOwnProperty;function ro(t){var e=this.__data__;return Ht?e[t]!==void 0:bf.call(e,t)}a(ro,"hashHas");var wf=ro,Pf="__lodash_hash_undefined__";function no(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&e===void 0?Pf:e,this}a(no,"hashSet");var xf=no;function Fe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a(Fe,"Hash");Fe.prototype.clear=gf;Fe.prototype.delete=hf;Fe.prototype.get=_f;Fe.prototype.has=wf;Fe.prototype.set=xf;var oi=Fe;function so(){this.__data__=[],this.size=0}a(so,"listCacheClear");var kf=so;function io(t,e){for(var r=t.length;r--;)if(Yn(t[r][0],e))return r;return-1}a(io,"assocIndexOf");var Gr=io,Sf=Array.prototype,Of=Sf.splice;function ao(t){var e=this.__data__,r=Gr(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Of.call(e,r,1),--this.size,!0}a(ao,"listCacheDelete");var Ef=ao;function oo(t){var e=this.__data__,r=Gr(e,t);return r<0?void 0:e[r][1]}a(oo,"listCacheGet");var Zf=oo;function lo(t){return Gr(this.__data__,t)>-1}a(lo,"listCacheHas");var If=lo;function co(t,e){var r=this.__data__,n=Gr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}a(co,"listCacheSet");var Bf=co;function Le(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a(Le,"ListCache");Le.prototype.clear=kf;Le.prototype.delete=Ef;Le.prototype.get=Zf;Le.prototype.has=If;Le.prototype.set=Bf;var Jr=Le,Cf=ze(he,"Map"),Dt=Cf;function uo(){this.size=0,this.__data__={hash:new oi,map:new(Dt||Jr),string:new oi}}a(uo,"mapCacheClear");var Af=uo;function po(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}a(po,"isKeyable");var Rf=po;function fo(t,e){var r=t.__data__;return Rf(e)?r[typeof e=="string"?"string":"hash"]:r.map}a(fo,"getMapData");var Xr=fo;function go(t){var e=Xr(this,t).delete(t);return this.size-=e?1:0,e}a(go,"mapCacheDelete");var Hf=go;function ho(t){return Xr(this,t).get(t)}a(ho,"mapCacheGet");var Df=ho;function mo(t){return Xr(this,t).has(t)}a(mo,"mapCacheHas");var Mf=mo;function yo(t,e){var r=Xr(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}a(yo,"mapCacheSet");var Nf=yo;function We(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a(We,"MapCache");We.prototype.clear=Af;We.prototype.delete=Hf;We.prototype.get=Df;We.prototype.has=Mf;We.prototype.set=Nf;var Yr=We,$f="Expected a function";function Qr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError($f);var r=a(function(){var n=arguments,s=e?e.apply(this,n):n[0],i=r.cache;if(i.has(s))return i.get(s);var o=t.apply(this,n);return r.cache=i.set(s,o)||i,o},"memoized");return r.cache=new(Qr.Cache||Yr),r}a(Qr,"memoize");Qr.Cache=Yr;var jf=Qr,Kf=500;function vo(t){var e=jf(t,function(n){return r.size===Kf&&r.clear(),n}),r=e.cache;return e}a(vo,"memoizeCapped");var Uf=vo,zf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ff=/\\(\\)?/g,Lf=Uf(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(zf,function(r,n,s,i){e.push(s?i.replace(Ff,"$1"):n||r)}),e}),Wf=Lf;function _o(t){return t==null?"":jd(t)}a(_o,"toString");var qf=_o;function To(t,e){return ge(t)?t:ts(t,e)?[t]:Wf(qf(t))}a(To,"castPath");var en=To,Vf=1/0;function bo(t){if(typeof t=="string"||Gn(t))return t;var e=t+"";return e=="0"&&1/t==-Vf?"-0":e}a(bo,"toKey");var Kt=bo;function wo(t,e){e=en(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Kt(e[r++])];return r&&r==n?t:void 0}a(wo,"baseGet");var rs=wo;function Po(t,e,r){var n=t==null?void 0:rs(t,e);return n===void 0?r:n}a(Po,"get");var Gf=Po;function xo(t,e){for(var r=-1,n=e.length,s=t.length;++r<n;)t[s+r]=e[r];return t}a(xo,"arrayPush");var ko=xo,Jf=Wa(Object.getPrototypeOf,Object),So=Jf,Xf="[object Object]",Yf=Function.prototype,Qf=Object.prototype,Oo=Yf.toString,eg=Qf.hasOwnProperty,tg=Oo.call(Object);function Eo(t){if(!Me(t)||Ke(t)!=Xf)return!1;var e=So(t);if(e===null)return!0;var r=eg.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Oo.call(r)==tg}a(Eo,"isPlainObject");var li=Eo;function Zo(){this.__data__=new Jr,this.size=0}a(Zo,"stackClear");var rg=Zo;function Io(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}a(Io,"stackDelete");var ng=Io;function Bo(t){return this.__data__.get(t)}a(Bo,"stackGet");var sg=Bo;function Co(t){return this.__data__.has(t)}a(Co,"stackHas");var ig=Co,ag=200;function Ao(t,e){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Dt||n.length<ag-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this}a(Ao,"stackSet");var og=Ao;function qe(t){var e=this.__data__=new Jr(t);this.size=e.size}a(qe,"Stack");qe.prototype.clear=rg;qe.prototype.delete=ng;qe.prototype.get=sg;qe.prototype.has=ig;qe.prototype.set=og;var tr=qe;function Ro(t,e){for(var r=-1,n=t==null?0:t.length,s=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[s++]=o)}return i}a(Ro,"arrayFilter");var lg=Ro;function Ho(){return[]}a(Ho,"stubArray");var Do=Ho,cg=Object.prototype,ug=cg.propertyIsEnumerable,ci=Object.getOwnPropertySymbols,dg=ci?function(t){return t==null?[]:(t=Object(t),lg(ci(t),function(e){return ug.call(t,e)}))}:Do,Mo=dg,pg=Object.getOwnPropertySymbols,fg=pg?function(t){for(var e=[];t;)ko(e,Mo(t)),t=So(t);return e}:Do,gg=fg;function No(t,e,r){var n=e(t);return ge(t)?n:ko(n,r(t))}a(No,"baseGetAllKeys");var $o=No;function jo(t){return $o(t,es,Mo)}a(jo,"getAllKeys");var ui=jo;function Ko(t){return $o(t,uf,gg)}a(Ko,"getAllKeysIn");var hg=Ko,mg=ze(he,"DataView"),$n=mg,yg=ze(he,"Promise"),jn=yg,vg=ze(he,"Set"),Kn=vg,di="[object Map]",_g="[object Object]",pi="[object Promise]",fi="[object Set]",gi="[object WeakMap]",hi="[object DataView]",Tg=Ue($n),bg=Ue(Dt),wg=Ue(jn),Pg=Ue(Kn),xg=Ue(Mn),Be=Ke;($n&&Be(new $n(new ArrayBuffer(1)))!=hi||Dt&&Be(new Dt)!=di||jn&&Be(jn.resolve())!=pi||Kn&&Be(new Kn)!=fi||Mn&&Be(new Mn)!=gi)&&(Be=a(function(t){var e=Ke(t),r=e==_g?t.constructor:void 0,n=r?Ue(r):"";if(n)switch(n){case Tg:return hi;case bg:return di;case wg:return pi;case Pg:return fi;case xg:return gi}return e},"getTag"));var mi=Be,kg=he.Uint8Array,yi=kg,Sg="__lodash_hash_undefined__";function Uo(t){return this.__data__.set(t,Sg),this}a(Uo,"setCacheAdd");var Og=Uo;function zo(t){return this.__data__.has(t)}a(zo,"setCacheHas");var Eg=zo;function Mt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Yr;++e<r;)this.add(t[e])}a(Mt,"SetCache");Mt.prototype.add=Mt.prototype.push=Og;Mt.prototype.has=Eg;var Zg=Mt;function Fo(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}a(Fo,"arraySome");var Ig=Fo;function Lo(t,e){return t.has(e)}a(Lo,"cacheHas");var Bg=Lo,Cg=1,Ag=2;function Wo(t,e,r,n,s,i){var o=r&Cg,l=t.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var f=i.get(t),g=i.get(e);if(f&&g)return f==e&&g==t;var m=-1,P=!0,E=r&Ag?new Zg:void 0;for(i.set(t,e),i.set(e,t);++m<l;){var I=t[m],U=e[m];if(n)var W=o?n(U,I,m,e,t,i):n(I,U,m,t,e,i);if(W!==void 0){if(W)continue;P=!1;break}if(E){if(!Ig(e,function(Q,ie){if(!Bg(E,ie)&&(I===Q||s(I,Q,r,n,i)))return E.push(ie)})){P=!1;break}}else if(!(I===U||s(I,U,r,n,i))){P=!1;break}}return i.delete(t),i.delete(e),P}a(Wo,"equalArrays");var qo=Wo;function Vo(t){var e=-1,r=Array(t.size);return t.forEach(function(n,s){r[++e]=[s,n]}),r}a(Vo,"mapToArray");var Rg=Vo;function Go(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}a(Go,"setToArray");var Hg=Go,Dg=1,Mg=2,Ng="[object Boolean]",$g="[object Date]",jg="[object Error]",Kg="[object Map]",Ug="[object Number]",zg="[object RegExp]",Fg="[object Set]",Lg="[object String]",Wg="[object Symbol]",qg="[object ArrayBuffer]",Vg="[object DataView]",vi=Te?Te.prototype:void 0,In=vi?vi.valueOf:void 0;function Jo(t,e,r,n,s,i,o){switch(r){case Vg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case qg:return!(t.byteLength!=e.byteLength||!i(new yi(t),new yi(e)));case Ng:case $g:case Ug:return Yn(+t,+e);case jg:return t.name==e.name&&t.message==e.message;case zg:case Lg:return t==e+"";case Kg:var l=Rg;case Fg:var u=n&Dg;if(l||(l=Hg),t.size!=e.size&&!u)return!1;var f=o.get(t);if(f)return f==e;n|=Mg,o.set(t,e);var g=qo(l(t),l(e),n,s,i,o);return o.delete(t),g;case Wg:if(In)return In.call(t)==In.call(e)}return!1}a(Jo,"equalByTag");var Gg=Jo,Jg=1,Xg=Object.prototype,Yg=Xg.hasOwnProperty;function Xo(t,e,r,n,s,i){var o=r&Jg,l=ui(t),u=l.length,f=ui(e),g=f.length;if(u!=g&&!o)return!1;for(var m=u;m--;){var P=l[m];if(!(o?P in e:Yg.call(e,P)))return!1}var E=i.get(t),I=i.get(e);if(E&&I)return E==e&&I==t;var U=!0;i.set(t,e),i.set(e,t);for(var W=o;++m<u;){P=l[m];var Q=t[P],ie=e[P];if(n)var q=o?n(ie,Q,P,e,t,i):n(Q,ie,P,t,e,i);if(!(q===void 0?Q===ie||s(Q,ie,r,n,i):q)){U=!1;break}W||(W=P=="constructor")}if(U&&!W){var se=t.constructor,Ye=e.constructor;se!=Ye&&"constructor"in t&&"constructor"in e&&!(typeof se=="function"&&se instanceof se&&typeof Ye=="function"&&Ye instanceof Ye)&&(U=!1)}return i.delete(t),i.delete(e),U}a(Xo,"equalObjects");var Qg=Xo,eh=1,_i="[object Arguments]",Ti="[object Array]",Qt="[object Object]",th=Object.prototype,bi=th.hasOwnProperty;function Yo(t,e,r,n,s,i){var o=ge(t),l=ge(e),u=o?Ti:mi(t),f=l?Ti:mi(e);u=u==_i?Qt:u,f=f==_i?Qt:f;var g=u==Qt,m=f==Qt,P=u==f;if(P&&Nn(t)){if(!Nn(e))return!1;o=!0,g=!1}if(P&&!g)return i||(i=new tr),o||Ua(t)?qo(t,e,r,n,s,i):Gg(t,e,u,r,n,s,i);if(!(r&eh)){var E=g&&bi.call(t,"__wrapped__"),I=m&&bi.call(e,"__wrapped__");if(E||I){var U=E?t.value():t,W=I?e.value():e;return i||(i=new tr),s(U,W,r,n,i)}}return P?(i||(i=new tr),Qg(t,e,r,n,s,i)):!1}a(Yo,"baseIsEqualDeep");var rh=Yo;function ns(t,e,r,n,s){return t===e?!0:t==null||e==null||!Me(t)&&!Me(e)?t!==t&&e!==e:rh(t,e,r,n,ns,s)}a(ns,"baseIsEqual");var tn=ns,nh=1,sh=2;function Qo(t,e,r,n){var s=r.length,i=s,o=!n;if(t==null)return!i;for(t=Object(t);s--;){var l=r[s];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<i;){l=r[s];var u=l[0],f=t[u],g=l[1];if(o&&l[2]){if(f===void 0&&!(u in t))return!1}else{var m=new tr;if(n)var P=n(f,g,u,t,e,m);if(!(P===void 0?tn(g,f,nh|sh,n,m):P))return!1}}return!0}a(Qo,"baseIsMatch");var ih=Qo;function el(t){return t===t&&!at(t)}a(el,"isStrictComparable");var tl=el;function rl(t){for(var e=es(t),r=e.length;r--;){var n=e[r],s=t[n];e[r]=[n,s,tl(s)]}return e}a(rl,"getMatchData");var ah=rl;function nl(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}a(nl,"matchesStrictComparable");var sl=nl;function il(t){var e=ah(t);return e.length==1&&e[0][2]?sl(e[0][0],e[0][1]):function(r){return r===t||ih(r,t,e)}}a(il,"baseMatches");var oh=il;function al(t,e){return t!=null&&e in Object(t)}a(al,"baseHasIn");var lh=al;function ol(t,e,r){e=en(e,t);for(var n=-1,s=e.length,i=!1;++n<s;){var o=Kt(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=s?i:(s=t==null?0:t.length,!!s&&Qn(s)&&Xn(o,s)&&(ge(t)||Da(t)))}a(ol,"hasPath");var ch=ol;function ll(t,e){return t!=null&&ch(t,e,lh)}a(ll,"hasIn");var uh=ll,dh=1,ph=2;function cl(t,e){return ts(t)&&tl(e)?sl(Kt(t),e):function(r){var n=Gf(r,t);return n===void 0&&n===e?uh(r,t):tn(e,n,dh|ph)}}a(cl,"baseMatchesProperty");var fh=cl;function ul(t){return function(e){return e?.[t]}}a(ul,"baseProperty");var gh=ul;function dl(t){return function(e){return rs(e,t)}}a(dl,"basePropertyDeep");var hh=dl;function pl(t){return ts(t)?gh(Kt(t)):hh(t)}a(pl,"property");var mh=pl;function fl(t){return typeof t=="function"?t:t==null?Kd:typeof t=="object"?ge(t)?fh(t[0],t[1]):oh(t):mh(t)}a(fl,"baseIteratee");var ss=fl;function gl(t){return function(e,r,n){for(var s=-1,i=Object(e),o=n(e),l=o.length;l--;){var u=o[t?l:++s];if(r(i[u],u,i)===!1)break}return e}}a(gl,"createBaseFor");var yh=gl,vh=yh(),_h=vh;function hl(t,e){return t&&_h(t,e,es)}a(hl,"baseForOwn");var Th=hl;function ml(t,e){return tn(t,e)}a(ml,"isEqual");var st=ml;function yl(t,e,r){r=typeof r=="function"?r:void 0;var n=r?r(t,e):void 0;return n===void 0?tn(t,e,void 0,r):!!n}a(yl,"isEqualWith");var bh=yl;function vl(t){return t===void 0}a(vl,"isUndefined");var wi=vl;function _l(t,e){var r={};return e=ss(e,3),Th(t,function(n,s,i){ka(r,s,e(n,s,i))}),r}a(_l,"mapValues");var wh=_l,Ph="Expected a function";function Tl(t){if(typeof t!="function")throw new TypeError(Ph);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}a(Tl,"negate");var xh=Tl;function bl(t,e,r,n){if(!at(t))return t;e=en(e,t);for(var s=-1,i=e.length,o=i-1,l=t;l!=null&&++s<i;){var u=Kt(e[s]),f=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(s!=o){var g=l[u];f=n?n(g,u,l):void 0,f===void 0&&(f=at(g)?g:Xn(e[s+1])?[]:{})}dp(l,u,f),l=l[u]}return t}a(bl,"baseSet");var kh=bl;function wl(t,e,r){for(var n=-1,s=e.length,i={};++n<s;){var o=e[n],l=rs(t,o);r(l,o)&&kh(i,en(o,t),l)}return i}a(wl,"basePickBy");var Sh=wl;function Pl(t,e){if(t==null)return{};var r=fa(hg(t),function(n){return[n]});return e=ss(e),Sh(t,r,function(n,s){return e(n,s[0])})}a(Pl,"pickBy");var Oh=Pl;function xl(t,e){return Oh(t,xh(ss(e)))}a(xl,"omitBy");var Pi=xl,Eh=a(t=>{let e=t.checks;return e.length===0?"":e.map(Zh).join("")},"generateStringChecks"),Zh=a(t=>{switch(t.kind){case"min":return`.min(${T(t.value)}, ${T(t.message)})`;case"max":return`.max(${T(t.value)}, ${T(t.message)})`;case"length":return`.length(${T(t.value)}, ${T(t.message)})`;case"email":return`.email(${T(t.message)})`;case"url":return`.url(${T(t.message)})`;case"emoji":return`.emoji(${T(t.message)})`;case"uuid":return`.uuid(${T(t.message)})`;case"cuid":return`.cuid(${T(t.message)})`;case"cuid2":return`.cuid2(${T(t.message)})`;case"ulid":return`.ulid(${T(t.message)})`;case"includes":let e=nt({message:t.message,position:t.position});return`.includes(${T(t.value)}, ${e})`;case"startsWith":return`.startsWith(${T(t.value)}, ${T(t.message)})`;case"endsWith":return`.endsWith(${T(t.value)}, ${T(t.message)})`;case"regex":return`.regex(${String(t.regex)}, ${T(t.message)})`;case"trim":return".trim()";case"toLowerCase":return".toLowerCase()";case"toUpperCase":return".toUpperCase()";case"datetime":let n=t.precision===null?void 0:t.precision;return`.datetime(${nt({message:t.message,precision:n,offset:t.offset})})`;case"ip":return`.ip(${nt({message:t.message,version:t.version})})`;default:return""}},"_generateStringCheck"),Ih=a(t=>{let e=t.checks;return e.length===0?"":e.map(Bh).join("")},"generateNumberChecks"),Bh=a(t=>{switch(t.kind){case"min":return`.min(${T(t.value)}, ${T(t.message)})`;case"max":return`.max(${T(t.value)}, ${T(t.message)})`;case"int":return`.int(${T(t.message)})`;case"multipleOf":return`.multipleOf(${T(t.value)}, ${T(t.message)})`;case"finite":return`.finite(${T(t.message)})`;default:return""}},"_generateNumberCheck"),Ch=a(t=>{let e=t.checks;return e.length===0?"":e.map(Ah).join("")},"generateBigIntChecks"),Ah=a(t=>{switch(t.kind){case"min":return`.min(${T(t.value)}, ${T(t.message)})`;case"max":return`.max(${T(t.value)}, ${T(t.message)})`;case"multipleOf":return`.multipleOf(${T(t.value)}, ${T(t.message)})`;default:return""}},"_generateBigIntCheck"),Rh=a(t=>{let e=t.checks;return e.length===0?"":e.map(Hh).join("")},"generateDateChecks"),Hh=a(t=>{switch(t.kind){case"min":return`.min(${xi(t.value)}, ${T(t.message)})`;case"max":return`.max(${xi(t.value)}, ${T(t.message)})`;default:return""}},"_generateDateCheck"),xi=a(t=>`new Date(${t})`,"dateTs"),Dh=a(t=>{let e=[];if(t.exactLength){let{value:r,message:n}=t.exactLength;e.push(`.length(${T(r)}, ${T(n)})`)}if(t.minLength){let{value:r,message:n}=t.minLength;e.push(`.min(${T(r)}, ${T(n)})`)}if(t.maxLength){let{value:r,message:n}=t.maxLength;e.push(`.max(${T(r)}, ${T(n)})`)}return e.join("")},"generateArrayChecks"),Mh=a(t=>{let e=[];if(t.minSize){let{value:r,message:n}=t.minSize;e.push(`.min(${T(r)}, ${T(n)})`)}if(t.maxSize){let{value:r,message:n}=t.maxSize;e.push(`.max(${T(r)}, ${T(n)})`)}return e.join("")},"generateSetChecks");function is(t){return N(t)}a(is,"toTypescriptSchema");function N(t){let r=t._def;switch(r.typeName){case d.ZodFirstPartyTypeKind.ZodString:return`z.string()${Eh(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNumber:return`z.number()${Ih(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNaN:return`z.nan()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodBigInt:return`z.bigint()${Ch(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodBoolean:return`z.boolean()${R(r)}${A(t._def)}`.trim();case d.ZodFirstPartyTypeKind.ZodDate:return`z.date()${Rh(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodUndefined:return`z.undefined()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNull:return`z.null()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodAny:return`z.any()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodUnknown:return`z.unknown()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNever:return`z.never()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodVoid:return`z.void()${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodArray:return`z.array(${N(r.type)})${Dh(r)}${R(r)}${A(r)}`;case d.ZodFirstPartyTypeKind.ZodObject:let n=wh(r.shape(),N),s=t.additionalProperties(),i=s?`.catchall(${N(s)})`:"";return["z.object({",...Object.entries(n).map(([cd,ud])=>` ${cd}: ${ud},`),`})${i}${R(r)}${A(r)}`].join(`
11
- `).trim();case d.ZodFirstPartyTypeKind.ZodUnion:return`z.union([${r.options.map(N).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let l=r.options.map(N);return`z.discriminatedUnion(${T(r.discriminator)}, [${l.join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodIntersection:let f=N(r.left),g=N(r.right);return`z.intersection(${f}, ${g})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodTuple:return`z.tuple([${r.items.map(N).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodRecord:let P=N(r.keyType),E=N(r.valueType);return`z.record(${P}, ${E})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodMap:let I=N(r.keyType),U=N(r.valueType);return`z.map(${I}, ${U})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodSet:return`z.set(${N(r.valueType)})${Mh(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodFunction:let W=r.args.items.map(N),Q=W.length?`.args(${W.join(", ")})`:"",ie=N(r.returns);return`z.function()${Q}.returns(${ie})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodLazy:return`z.lazy(() => ${N(r.getter())})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodLiteral:return`z.literal(${T(r.value)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodEnum:return`z.enum([${r.values.map(T).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodEffects:throw new Ie(d.ZodFirstPartyTypeKind.ZodEffects);case d.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Ie(d.ZodFirstPartyTypeKind.ZodNativeEnum);case d.ZodFirstPartyTypeKind.ZodOptional:return`z.optional(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNullable:return`z.nullable(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodDefault:let Ye=nt(r.defaultValue());return`z.default(${N(r.innerType)}, ${Ye})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodCatch:throw new Ie(d.ZodFirstPartyTypeKind.ZodCatch);case d.ZodFirstPartyTypeKind.ZodPromise:return`z.promise(${N(r.type)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodBranded:throw new Ie(d.ZodFirstPartyTypeKind.ZodBranded);case d.ZodFirstPartyTypeKind.ZodPipeline:throw new Ie(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodSymbol:throw new Ie(d.ZodFirstPartyTypeKind.ZodSymbol);case d.ZodFirstPartyTypeKind.ZodReadonly:return`z.readonly(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodRef:return`z.ref(${T(r.uri)})${R(r)}${A(r)}`.trim();default:Z.assertNever(r)}}a(N,"sUnwrapZod");var A=a(t=>t.description?`.describe(${T(t.description)})`:"","_maybeDescribe"),R=a(t=>`${Nh(t)}${$h(t)}${jh(t)}${Kh(t)}${Uh(t)}${zh(t)}${Fh(t)}`,"_addZuiExtensions"),Nh=a(t=>{var e;return(e=t[b])!=null&&e.title?`.title(${T(t[b].title)})`:""},"_maybeTitle"),$h=a(t=>{var e;return(e=t[b])!=null&&e.displayAs?`.displayAs(${Ri({id:t[b].displayAs[0],params:t[b].displayAs[1]})})`:""},"_maybeDisplayAs"),jh=a(t=>{var e;return(e=t[b])!=null&&e.disabled?`.disabled(${t[b].disabled})`:""},"_maybeDisabled"),Kh=a(t=>{var e;return(e=t[b])!=null&&e.hidden?`.hidden(${t[b].hidden})`:""},"_maybeHidden"),Uh=a(t=>{var e;return(e=t[b])!=null&&e.placeholder?`.placeholder(${T(t[b].placeholder)})`:""},"_maybePlaceholder"),zh=a(t=>{var e;return(e=t[b])!=null&&e.secret?".secret()":""},"_maybeSecret"),Fh=a(t=>{var e;let r=["title","tooltip","displayAs","disabled","hidden","placeholder","secret","coerce"],n=Object.entries((e=t[b])!=null?e:{}).filter(([s])=>!r.includes(s));return n.length>0?`.metadata(${Ri(Object.fromEntries(n))})`:""},"_maybeSetMetadata"),Lh=a(t=>{let e={type:"number",description:t.description,"x-zui":t._def["x-zui"]};t._def[b]&&(e[b]=t._def[b]);for(let r of t._def.checks)switch(r.kind){case"min":{let n=r.inclusive?"minimum":"exclusiveMinimum",s=r.inclusive?"exclusiveMinimum":"minimum";e[n]=r.value,delete e[s];break}case"max":{let n=r.inclusive?"maximum":"exclusiveMaximum",s=r.inclusive?"exclusiveMaximum":"maximum";e[n]=r.value,delete e[s];break}case"int":e.type="integer";break;case"finite":{e.format="finite";break}case"multipleOf":e.multipleOf=r.value;break;default:}return e},"zodNumberToJsonNumber"),kl="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",Sl="(([+-]\\d{2}(:?\\d{2})?)|Z)",Wh="Z",Ol="(\\.\\d+)?",Un="\\.\\d{",qh="}",El=a(t=>{let e=t.precision?Un+t.precision+qh:t.precision===0?"":Ol,r=t.offset?Sl:Wh;return new RegExp(`^${kl}${e}${r}$`)},"generateDatetimeRegex"),Vh=a(t=>({precision:Gh(t),offset:t.endsWith(`${Sl}$`)}),"extractPrecisionAndOffset"),Gh=a(t=>{let e=t.slice(1+kl.length);return e.startsWith(Ol)?null:e.startsWith(Un)?parseInt(e.slice(Un.length)):0},"_extractPrecision"),Rt={};Lr(Rt,{escapeSpecialChars:()=>Jh});var Jh=a(t=>t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeSpecialChars");function as(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=p(c({},t.errorMessage),{[e]:r}))}a(as,"addErrorMessage");function H(t,e,r,n,s){t[e]=r,as(t,e,n,s)}a(H,"setResponseValueAndErrors");var j={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",ipv4:"^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$",ipv6:"^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$"};function os(t,e){let r=c({type:"string"},t.coerce?{[b]:{coerce:t.coerce||void 0}}:{});function n(s){return e.patternStrategy==="escape"?Rt.escapeSpecialChars(s):s}if(a(n,"processPattern"),t.checks)for(let s of t.checks)switch(s.kind){case"min":H(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,s.value):s.value,s.message,e);break;case"max":H(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,s.value):s.value,s.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Ze(r,"email",s.message,e);break;case"format:idn-email":Ze(r,"idn-email",s.message,e);break;case"pattern:zod":ue(r,j.email,s.message,e);break}break;case"url":Ze(r,"uri",s.message,e);break;case"uuid":Ze(r,"uuid",s.message,e);break;case"regex":ue(r,s.regex.source,s.message,e);break;case"cuid":ue(r,j.cuid,s.message,e);break;case"cuid2":ue(r,j.cuid2,s.message,e);break;case"startsWith":ue(r,"^"+n(s.value),s.message,e);break;case"endsWith":ue(r,n(s.value)+"$",s.message,e);break;case"datetime":Ze(r,"date-time",s.message,e);break;case"length":H(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,s.value):s.value,s.message,e),H(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,s.value):s.value,s.message,e);break;case"includes":{ue(r,n(s.value),s.message,e);break}case"ip":{s.version!=="v6"&&Ze(r,"ipv4",s.message,e),s.version!=="v4"&&Ze(r,"ipv6",s.message,e);break}case"emoji":ue(r,j.emoji,s.message,e);break;case"ulid":{ue(r,j.ulid,s.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}a(os,"parseStringDef");var Ze=a((t,e,r,n)=>{var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(c({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(c({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):H(t,"format",e,r,n)},"addFormat"),ue=a((t,e,r,n)=>{var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(c({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(c({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):H(t,"pattern",e,r,n)},"addPattern"),Xh=a(t=>{let e={type:"string",description:t.description,"x-zui":t._def["x-zui"]};t._def[b]&&(e[b]=t._def[b]);for(let r of t._def.checks)switch(r.kind){case"cuid":e.format="cuid",e.pattern=j.cuid;break;case"cuid2":e.format="cuid2",e.pattern=j.cuid2;break;case"ulid":e.format="ulid",e.pattern=j.ulid;break;case"uuid":e.format="uuid",e.pattern=j.uuid;break;case"emoji":e.format="emoji",e.pattern=j.emoji;break;case"email":e.format="email",e.pattern=j.email;break;case"ip":e.format=r.version==="v6"?"ipv6":"ipv4",e.pattern=r.version==="v6"?j.ipv6:j.ipv4;break;case"datetime":e.format="date-time",e.pattern=El(r).source,e[b]=p(c({},e[b]),{precision:r.precision,offset:r.offset});break;case"url":e.format="uri";break;case"endsWith":e.pattern=`${Rt.escapeSpecialChars(r.value)}$`;break;case"startsWith":e.pattern=`^${Rt.escapeSpecialChars(r.value)}`;break;case"includes":let n=r.position&&r.position>=1?`^(?:.{${r.position}}).*`:"";e.pattern=`${n}${Rt.escapeSpecialChars(r.value)}`;break;case"regex":e.pattern=r.regex.source;break;case"length":e.minLength=e.maxLength=Math.max(0,r.value);break;case"min":e.minLength=Math.max(0,r.value);break;case"max":e.maxLength=Math.max(0,r.value);break;default:throw new zi({zodType:d.ZodFirstPartyTypeKind.ZodString,checkKind:r.kind})}return e},"zodStringToJsonString"),Yh=a((t,e)=>{let r={type:"array",description:t.description,items:e(t._def.type),"x-zui":t._def["x-zui"]};return t._def[b]&&(r[b]=t._def[b]),t._def.minLength&&(r.minItems=t._def.minLength.value),t._def.maxLength&&(r.maxItems=t._def.maxLength.value),t._def.exactLength&&(r.minItems=t._def.exactLength.value,r.maxItems=t._def.exactLength.value),r},"zodArrayToJsonArray"),Qh=a((t,e)=>{let r={type:"array",description:t.description,uniqueItems:!0,items:e(t._def.valueType),"x-zui":t._def["x-zui"]};return t._def[b]&&(r[b]=t._def[b]),t._def.minSize&&(r.minItems=t._def.minSize.value),t._def.maxSize&&(r.maxItems=t._def.maxSize.value),r},"zodSetToJsonSet"),em=a((t,e)=>{let r={type:"array",description:t.description,items:t._def.items.map(n=>e(n))};return t._def[b]&&(r[b]=t._def[b]),t._def.rest&&(r.additionalItems=e(t._def.rest)),r},"zodTupleToJsonTuple");function V(t){let e=t,r=e._def;switch(r.typeName){case d.ZodFirstPartyTypeKind.ZodString:return Xh(e);case d.ZodFirstPartyTypeKind.ZodNumber:return Lh(e);case d.ZodFirstPartyTypeKind.ZodNaN:throw new ee(d.ZodFirstPartyTypeKind.ZodNaN);case d.ZodFirstPartyTypeKind.ZodBigInt:throw new ee(d.ZodFirstPartyTypeKind.ZodBigInt,{suggestedAlternative:"serialize bigint to string"});case d.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean",description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodDate:throw new ee(d.ZodFirstPartyTypeKind.ZodDate,{suggestedAlternative:"use z.string().datetime() instead"});case d.ZodFirstPartyTypeKind.ZodUndefined:return Bn(r);case d.ZodFirstPartyTypeKind.ZodNull:return Cn(r);case d.ZodFirstPartyTypeKind.ZodAny:return{description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodUnknown:return{description:r.description,"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodUnknown}})};case d.ZodFirstPartyTypeKind.ZodNever:return{not:!0,description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodVoid:throw new ee(d.ZodFirstPartyTypeKind.ZodVoid);case d.ZodFirstPartyTypeKind.ZodArray:return Yh(e,V);case d.ZodFirstPartyTypeKind.ZodObject:let n=Object.entries(r.shape()),s=n.filter(([g,m])=>!m.isOptional()),i=s.length?s.map(([g])=>g):void 0,o=n.map(([g,m])=>[g,m.mandatory()]).map(([g,m])=>[g,V(m)]),l=!1;return r.unknownKeys instanceof d.ZodType?l=V(r.unknownKeys):r.unknownKeys==="passthrough"&&(l=!0),{type:"object",description:r.description,properties:Object.fromEntries(o),required:i,additionalProperties:l,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodUnion:return{description:r.description,anyOf:r.options.map(g=>V(g)),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return{description:r.description,anyOf:r.options.map(g=>V(g)),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodIntersection:let u=V(r.left),f=V(r.right);return"additionalProperties"in u&&delete u.additionalProperties,"additionalProperties"in f&&delete f.additionalProperties,{description:r.description,allOf:[u,f],"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodTuple:return em(e,V);case d.ZodFirstPartyTypeKind.ZodRecord:return{type:"object",description:r.description,additionalProperties:V(r.valueType),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodMap:throw new ee(d.ZodFirstPartyTypeKind.ZodMap);case d.ZodFirstPartyTypeKind.ZodSet:return Qh(e,V);case d.ZodFirstPartyTypeKind.ZodFunction:throw new ee(d.ZodFirstPartyTypeKind.ZodFunction);case d.ZodFirstPartyTypeKind.ZodLazy:throw new ee(d.ZodFirstPartyTypeKind.ZodLazy);case d.ZodFirstPartyTypeKind.ZodLiteral:if(typeof r.value=="string")return{type:"string",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(typeof r.value=="number")return{type:"number",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(typeof r.value=="boolean")return{type:"boolean",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(r.value===null)return Cn(r);if(r.value===void 0)return Bn(r);{d.util.assertEqual(!0);let g=typeof r.value;throw new qr(`Unsupported literal type: "${g}"`)}case d.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",description:r.description,enum:r.values,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodEffects:throw new ee(d.ZodFirstPartyTypeKind.ZodEffects);case d.ZodFirstPartyTypeKind.ZodNativeEnum:throw new ee(d.ZodFirstPartyTypeKind.ZodNativeEnum);case d.ZodFirstPartyTypeKind.ZodOptional:return{description:r.description,anyOf:[V(r.innerType),Bn()],"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodOptional}})};case d.ZodFirstPartyTypeKind.ZodNullable:return{anyOf:[V(r.innerType),Cn()],"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodNullable}})};case d.ZodFirstPartyTypeKind.ZodDefault:return p(c({},V(r.innerType)),{default:r.defaultValue()});case d.ZodFirstPartyTypeKind.ZodCatch:throw new ee(d.ZodFirstPartyTypeKind.ZodCatch);case d.ZodFirstPartyTypeKind.ZodPromise:throw new ee(d.ZodFirstPartyTypeKind.ZodPromise);case d.ZodFirstPartyTypeKind.ZodBranded:throw new ee(d.ZodFirstPartyTypeKind.ZodBranded);case d.ZodFirstPartyTypeKind.ZodPipeline:throw new ee(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodSymbol:throw new ee(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodReadonly:return p(c({},V(r.innerType)),{readOnly:!0});case d.ZodFirstPartyTypeKind.ZodRef:return{$ref:r.uri,description:r.description,"x-zui":r["x-zui"]};default:d.util.assertNever(r)}}a(V,"toJSONSchema");var Bn=a(t=>({not:!0,description:t?.description,"x-zui":p(c({},t?.["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodUndefined}})}),"undefinedSchema"),Cn=a(t=>({type:"null",description:t?.description,"x-zui":t?.["x-zui"]}),"nullSchema"),Zl=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(Zl,"ParseInputLazyPath");var ae=Zl,ki=a((t,e)=>{if(lt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new le(t.common.issues);return this._error=r,this._error}}},"handleResult"),Il=class{constructor(e){this.__type__="ZuiType",this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._metadataRoot._def.description}dereference(e){return this}getReferences(){return[]}clone(){let e=this.constructor;return new e(c({},this._def))}_getType(e){return pe(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new te,ctx:{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if($t(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},i=this._parseSync({data:e,path:s.path,parent:s});return ki(s,i)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await($t(s)?s:Promise.resolve(s));return ki(n,i)}refine(e,r){let n=a(s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r,"getIssueProperties");return this._refinement((s,i)=>{let o=e(s),l=a(()=>i.addIssue(c({code:h.custom},n(s))),"setError");return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new we({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return fe.create(this,this._def)}nullable(){return Ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ut.create(this,this._def)}promise(){return Ft.create(this,this._def)}mandatory(){return this}or(e){return hn.create([this,e],this._def)}and(e){return ln.create(this,e,this._def)}transform(e){return new we(p(c({},k(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new Ut(p(c({},k(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new sn(c({typeName:"ZodBranded",type:this},k(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new an(p(c({},k(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.clone();return r._metadataRoot._def.description=e,r}pipe(e){return gn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){var r,n,s;let i=this.clone(),o=i._metadataRoot;(s=(r=o._def)[n=b])!=null||(r[n]={});for(let[l,u]of Object.entries(e))o._def[b]=p(c({},o._def[b]),{[l]:u});return i}getMetadata(){return c({},this._metadataRoot._def[b])}setMetadata(e){this._metadataRoot._def[b]=c({},e)}get ui(){return c({},this._metadataRoot._def[b])}get _metadataRoot(){return this.naked()}displayAs(e){return this.metadata({displayAs:[e.id,e.params]})}title(e){return this.metadata({title:e})}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this.metadata({hidden:r})}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this.metadata({disabled:r})}placeholder(e){return this.metadata({placeholder:e})}toJSONSchema(){return V(this)}toTypescriptType(e){return Vn(this,e)}toTypescriptSchema(){return is(this)}naked(){return this}};a(Il,"ZodType");var O=Il,ls=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(ls||{}),Z;(t=>{t.assertEqual=a(s=>s,"assertEqual");function e(s){}t.assertIs=e,a(e,"assertIs");function r(s){throw new Error("assertNever called")}t.assertNever=r,a(r,"assertNever"),t.arrayToEnum=a(s=>{let i={};for(let o of s)i[o]=o;return i},"arrayToEnum"),t.getValidEnumValues=a(s=>{let i=(0,t.objectKeys)(s).filter(l=>typeof s[s[l]]!="number"),o={};for(let l of i)o[l]=s[l];return(0,t.objectValues)(o)},"getValidEnumValues"),t.objectValues=a(s=>(0,t.objectKeys)(s).map(function(i){return s[i]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=a((s,i)=>{for(let o of s)if(i(o))return o},"find"),t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,a(n,"joinValues"),t.jsonStringifyReplacer=a((s,i)=>typeof i=="bigint"?i.toString():i,"jsonStringifyReplacer"),t.compareFunctions=a((s,i)=>s.toString()===i.toString(),"compareFunctions"),t.mock=a(()=>({}),"mock")})(Z||(Z={}));var ur;(t=>{t.mergeShapes=a((e,r)=>c(c({},e),r),"mergeShapes")})(ur||(ur={}));var _=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pe=a(t=>{switch(typeof t){case"undefined":return _.undefined;case"string":return _.string;case"number":return isNaN(t)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(t)?_.array:t===null?_.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_.promise:typeof Map<"u"&&t instanceof Map?_.map:typeof Set<"u"&&t instanceof Set?_.set:typeof Date<"u"&&t instanceof Date?_.date:_.object;default:return _.unknown}},"getParsedType");function k(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s,[b]:t?.[b]}:{errorMap:a((o,l)=>o.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:n??l.defaultError}:{message:r??l.defaultError},"customMap"),description:s,[b]:t?.[b]}}a(k,"processCreateParams");var cs=a((t,e)=>{let r;switch(t.code){case h.invalid_type:t.received===_.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Z.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:r=`Unrecognized key(s) in object: ${Z.joinValues(t.keys,", ")}`;break;case h.invalid_union:r="Invalid input";break;case h.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Z.joinValues(t.options)}`;break;case h.invalid_enum_value:r=`Invalid enum value. Expected ${Z.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:r="Invalid function arguments";break;case h.invalid_return_type:r="Invalid function return type";break;case h.invalid_date:r="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case h.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case h.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case h.custom:r="Invalid input";break;case h.invalid_intersection_types:r="Intersection results could not be merged";break;case h.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:r="Number must be finite";break;case h.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,Z.assertNever(t)}return{message:r}},"errorMap"),Si=cs,h=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite","unresolved_reference"]),Bl=a(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),dr=class Cl extends Error{constructor(e){super(),this.issues=[],this.addIssue=a(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=a((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=a(i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,u=0;for(;u<o.path.length;){let f=o.path[u];u===o.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(r(o))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}},"processError");return s(this),n}static assert(e){if(!(e instanceof Cl))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};a(dr,"ZodError");dr.create=a(t=>new dr(t),"create");var le=dr,Al=cs;function us(t){Al=t}a(us,"setErrorMap");function ot(){return Al}a(ot,"getErrorMap");var Nt=a(t=>{var e;let{data:r,path:n,errorMaps:s,issueData:i}=t,o=[...n,...i.path||[]],l=p(c({},i),{path:o}),u="",f=s.filter(g=>!!g).slice().reverse();for(let g of f)u=g(l,{data:r,defaultError:u}).message;return p(c({},i),{path:o,message:(e=i.message)!=null?e:u})},"makeIssue"),Rl=[];function v(t,e){let r=Nt({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ot(),cs].filter(n=>!!n)});t.common.issues.push(r)}a(v,"addIssueToContext");var Hl=class Dl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return x;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r)n.push({key:await s.key,value:await s.value});return Dl.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return x;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};a(Hl,"ParseStatus");var te=Hl,x=Object.freeze({status:"aborted"}),De=a(t=>({status:"dirty",value:t}),"DIRTY"),J=a(t=>({status:"valid",value:t}),"OK"),pr=a(t=>t.status==="aborted","isAborted"),fr=a(t=>t.status==="dirty","isDirty"),lt=a(t=>t.status==="valid","isValid"),$t=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),w;(t=>{t.errToObj=a(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=a(e=>typeof e=="string"?e:e?.message,"toString")})(w||(w={}));var gr=class Ml extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}isEqual(e){return e instanceof Ml}};a(gr,"ZodAny");gr.create=a(t=>new gr(c({typeName:"ZodAny"},k(t))),"create");var ct=gr,hr=class Ce extends O{dereference(e){return new Ce(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new Ce(p(c({},this._def),{type:this._def.type.clone()}))}isEqual(e){var r,n,s,i,o,l;return e instanceof Ce?st((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&st((s=this._def.maxLength)==null?void 0:s.value,(i=e._def.maxLength)==null?void 0:i.value)&&st((o=this._def.minLength)==null?void 0:o.value,(l=e._def.minLength)==null?void 0:l.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==_.array)return v(r,{code:h.invalid_type,expected:_.array,received:r.parsedType}),x;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(o||l)&&(v(r,{code:o?h.too_big:h.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(v(r,{code:h.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(v(r,{code:h.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>s.type._parseAsync(new ae(r,o,r.path,l)))).then(o=>te.mergeArray(n,o));let i=[...r.data].map((o,l)=>s.type._parseSync(new ae(r,o,r.path,l)));return te.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Ce(p(c({},this._def),{minLength:{value:e,message:w.toString(r)}}))}max(e,r){return new Ce(p(c({},this._def),{maxLength:{value:e,message:w.toString(r)}}))}length(e,r){return new Ce(p(c({},this._def),{exactLength:{value:e,message:w.toString(r)}}))}nonempty(e){return this.min(1,e)}};a(hr,"ZodArray");hr.create=a((t,e)=>new hr(c({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},k(e))),"create");var ut=hr,tm=a((t,e)=>Nl(t,e,new WeakSet),"isEqual"),Nl=a((t,e,r)=>bh(t,e,rm(r)),"_isEqualWithVisitedTracking"),rm=a(t=>(e,r)=>{if(li(e)&&!t.has(e)&&li(r)&&!t.has(r)){let n=Pi(e,wi),s=Pi(r,wi);return t.add(n).add(s).add(e).add(r),Nl(n,s,t)}},"_customizerWithVisitedTracking"),nm={compare:tm},$l=class{constructor(e=[],r={}){this._options=c(c({},nm),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};a($l,"CustomSet");var K=$l,mr=class rr extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==_.bigint){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.bigint,received:i.parsedType}),x}let n,s=new te;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Z.assertNever(i);return{status:s.value,value:e.data}}isEqual(e){if(!(e instanceof rr)||this._def.coerce!==e._def.coerce)return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new rr(p(c({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]}))}_addCheck(e){return new rr(p(c({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(mr,"ZodBigInt");mr.create=a(t=>{var e;return new mr(c({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},k(t)))},"create");var rn=mr,yr=class jl extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==_.boolean){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.boolean,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof jl?this._def.coerce===e._def.coerce:!1}};a(yr,"ZodBoolean");yr.create=a(t=>new yr(c({typeName:"ZodBoolean",coerce:t?.coerce||!1},k(t))),"create");var nn=yr,Kl=Symbol("zod_brand"),Ul=class bt extends O{dereference(e){return new bt(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new bt(p(c({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof bt?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}mandatory(){return new bt(p(c({},this._def),{type:this._def.type.mandatory()}))}};a(Ul,"ZodBranded");var sn=Ul,vr=class wt extends O{_parse(e){let{ctx:r}=this._processInputParams(e),n=p(c({},r),{common:p(c({},r.common),{issues:[]})}),s=this._def.innerType._parse({data:n.data,path:n.path,parent:c({},n)});return $t(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof wt?this._def.innerType.isEqual(e._def.innerType)&&Z.compareFunctions(this._def.catchValue,e._def.catchValue):!1}dereference(e){return new wt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new wt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}naked(){return this._def.innerType.naked()}mandatory(){return new wt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(vr,"ZodCatch");vr.create=a((t,e)=>new vr(c({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},k(e))),"create");var an=vr,ds=a((t,e={},r)=>t?ct.create().superRefine((n,s)=>{var i,o;if(!t(n)){let l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(i=l.fatal)!=null?i:r)!=null?o:!0,f=typeof l=="string"?{message:l}:l;s.addIssue(p(c({code:"custom"},f),{fatal:u}))}}):ct.create(),"custom"),_r=class zn extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.date,received:i.parsedType}),x}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_date}),x}let n=new te,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Z.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zn(p(c({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof zn))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};a(_r,"ZodDate");_r.create=a(t=>new _r(c({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},k(t))),"create");var on=_r,Tr=class Pt extends O{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new Pt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Pt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}isEqual(e){return e instanceof Pt?this._def.innerType.isEqual(e._def.innerType)&&st(this._def.defaultValue(),e._def.defaultValue()):!1}unwrap(){return this._def.innerType}naked(){return this._def.innerType.naked()}mandatory(){return new Pt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Tr,"ZodDefault");Tr.create=a((t,e,r)=>new Tr(c({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},k(r))),"create");var Ut=Tr,me=a(t=>Array.from(new Set(t)),"unique"),de=a(t=>t instanceof cn?de(t.schema):t instanceof we?de(t.innerType()):t instanceof un?[t.value]:t instanceof Ve?t.options:t instanceof dn?Z.objectValues(t.enum):t instanceof Ut?de(t._def.innerType):t instanceof Wt?[void 0]:t instanceof pn?[null]:t instanceof fe?[void 0,...de(t.unwrap())]:t instanceof Ne?[null,...de(t.unwrap())]:t instanceof sn||t instanceof Lt?de(t.unwrap()):t instanceof an?de(t._def.innerType):[],"getDiscriminator"),zl=class Ae extends O{dereference(e){let r=this.options.map(s=>s.dereference(e)),n=Ae._getOptionsMap(this.discriminator,r);return new Ae(p(c({},this._def),{options:r,optionsMap:n}))}getReferences(){return me(this.options.flatMap(e=>e.getReferences()))}clone(){let e=this.options.map(r=>r.clone());return new Ae(p(c({},this._def),{options:e}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.object)return v(r,{code:h.invalid_type,expected:_.object,received:r.parsedType}),x;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(v(r,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=Ae._getOptionsMap(e,r);return new Ae(c({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:s},k(n)))}static _getOptionsMap(e,r){let n=new Map;for(let s of r){let i=de(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return n}isEqual(e){if(!(e instanceof Ae)||this._def.discriminator!==e._def.discriminator)return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K(this._def.options,{compare:r}),s=new K(e._def.options,{compare:r});return n.isEqual(s)}};a(zl,"ZodDiscriminatedUnion");var ps=zl;function zt(t,e){return new Ve(c({values:t,typeName:"ZodEnum"},k(e)))}a(zt,"createZodEnum");var fs=class nr extends O{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{expected:Z.joinValues(n),received:r.parsedType,code:h.invalid_type}),x}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{received:r.data,code:h.invalid_enum_value,options:n}),x}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return nr.create(e,c(c({},this._def),r))}exclude(e,r=this._def){return nr.create(this.options.filter(n=>!e.includes(n)),c(c({},this._def),r))}isEqual(e){if(!(e instanceof nr))return!1;let r=new K(this._def.values),n=new K(e._def.values);return r.isEqual(n)}};a(fs,"ZodEnum");fs.create=zt;var Ve=fs,Fl=class Re extends O{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new Re(p(c({},this._def),{args:r,returns:n}))}getReferences(){return me([...this._def.args.getReferences(),...this._def.returns.getReferences()])}clone(){return new Re(p(c({},this._def),{args:this._def.args.clone(),returns:this._def.returns.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.function)return v(r,{code:h.invalid_type,expected:_.function,received:r.parsedType}),x;function n(l,u){return Nt({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ot(),Si].filter(f=>!!f),issueData:{code:h.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function s(l,u){return Nt({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ot(),Si].filter(f=>!!f),issueData:{code:h.invalid_return_type,returnTypeError:u}})}a(s,"makeReturnsIssue");let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ft){let l=this;return J(async function(...u){let f=new le([]),g=await l._def.args.parseAsync(u,i).catch(E=>{throw f.addIssue(n(u,E)),f}),m=await Reflect.apply(o,this,g);return await l._def.returns._def.type.parseAsync(m,i).catch(E=>{throw f.addIssue(s(m,E)),f})})}else{let l=this;return J(function(...u){let f=l._def.args.safeParse(u,i);if(!f.success)throw new le([n(u,f.error)]);let g=Reflect.apply(o,this,f.data),m=l._def.returns.safeParse(g,i);if(!m.success)throw new le([s(g,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Re(p(c({},this._def),{args:je.create(e).rest(it.create())}))}returns(e){return new Re(p(c({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Re(c({args:e||je.create([]).rest(it.create()),returns:r||it.create(),typeName:"ZodFunction"},k(n)))}isEqual(e){return e instanceof Re&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};a(Fl,"ZodFunction");var gs=Fl;function br(t,e){let r=pe(t),n=pe(e);if(t===e)return{valid:!0,data:t};if(r===_.object&&n===_.object){let s=Z.objectKeys(e),i=Z.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o=c(c({},t),e);for(let l of i){let u=br(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(r===_.array&&n===_.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],l=e[i],u=br(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===_.date&&n===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(br,"mergeValues");var wr=class sr extends O{dereference(e){return new sr(p(c({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return me([...this._def.left.getReferences(),...this._def.right.getReferences()])}clone(){return new sr(p(c({},this._def),{left:this._def.left.clone(),right:this._def.right.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=a((i,o)=>{if(pr(i)||pr(o))return x;let l=br(i.value,o.value);return l.valid?((fr(i)||fr(o))&&r.dirty(),{status:r.value,value:l.data}):(v(n,{code:h.invalid_intersection_types}),x)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof sr))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K([this._def.left,this._def.right],{compare:r}),s=new K([e._def.left,e._def.right],{compare:r});return n.isEqual(s)}};a(wr,"ZodIntersection");wr.create=a((t,e,r)=>new wr(c({left:t,right:e,typeName:"ZodIntersection"},k(r))),"create");var ln=wr,Pr=class xt extends O{get schema(){return this._def.getter()}dereference(e){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().dereference(e),"getter")}))}getReferences(){return this._def.getter().getReferences()}clone(){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().clone(),"getter")}))}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof xt?this._def.getter().isEqual(e._def.getter()):!1}naked(){return this._def.getter().naked()}mandatory(){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().mandatory(),"getter")}))}};a(Pr,"ZodLazy");Pr.create=a((t,e)=>new Pr(c({getter:t,typeName:"ZodLazy"},k(e))),"create");var cn=Pr,xr=class Ll extends O{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return v(r,{received:r.data,code:h.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Ll?st(this._def.value,e._def.value):!1}};a(xr,"ZodLiteral");xr.create=a((t,e)=>new xr(c({value:t,typeName:"ZodLiteral"},k(e))),"create");var un=xr,kr=class ir extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ir(p(c({},this._def),{keyType:r,valueType:n}))}getReferences(){return me([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new ir(p(c({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return v(n,{code:h.invalid_type,expected:_.map,received:n.parsedType}),x;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,u],f)=>({key:s._parse(new ae(n,l,n.path,[f,"key"])),value:i._parse(new ae(n,u,n.path,[f,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of o){let f=await u.key,g=await u.value;if(f.status==="aborted"||g.status==="aborted")return x;(f.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(f.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of o){let f=u.key,g=u.value;if(f.status==="aborted"||g.status==="aborted")return x;(f.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(f.value,g.value)}return{status:r.value,value:l}}}isEqual(e){return!(!(e instanceof ir)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};a(kr,"ZodMap");kr.create=a((t,e,r)=>new kr(c({valueType:e,keyType:t,typeName:"ZodMap"},k(r))),"create");var hs=kr,Sr=class Wl extends O{_parse(e){if(this._getType(e)!==_.nan){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Wl}};a(Sr,"ZodNaN");Sr.create=a(t=>new Sr(c({typeName:"ZodNaN"},k(t))),"create");var ms=Sr,Or=class ql extends O{_parse(e){let r=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let s=Z.objectValues(r);return v(n,{expected:Z.joinValues(s),received:n.parsedType,code:h.invalid_type}),x}if(r.indexOf(e.data)===-1){let s=Z.objectValues(r);return v(n,{received:n.data,code:h.invalid_enum_value,options:s}),x}return J(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof ql?st(this._def.values,e._def.values):!1}};a(Or,"ZodNativeEnum");Or.create=a((t,e)=>new Or(c({values:t,typeName:"ZodNativeEnum"},k(e))),"create");var dn=Or,Er=class Vl extends O{_parse(e){let r=this._getOrReturnCtx(e);return v(r,{code:h.invalid_type,expected:_.never,received:r.parsedType}),x}isEqual(e){return e instanceof Vl}};a(Er,"ZodNever");Er.create=a(t=>new Er(c({typeName:"ZodNever"},k(t))),"create");var ft=Er,Zr=class Gl extends O{_parse(e){if(this._getType(e)!==_.null){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.null,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof Gl}};a(Zr,"ZodNull");Zr.create=a(t=>new Zr(c({typeName:"ZodNull"},k(t))),"create");var pn=Zr,Ir=class kt extends O{dereference(e){return new kt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new kt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===_.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof kt?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new kt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Ir,"ZodNullable");Ir.create=a((t,e)=>new Ir(c({innerType:t,typeName:"ZodNullable"},k(e))),"create");var Ne=Ir;function Jl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}a(Jl,"floatSafeRemainder");var Br=class ar extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.number,received:i.parsedType}),x}let n,s=new te;for(let i of this._def.checks)i.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Jl(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_finite,message:i.message}),s.dirty()):Z.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new ar(p(c({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]}))}_addCheck(e){return new ar(p(c({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof ar))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}};a(Br,"ZodNumber");Br.create=a(t=>new Br(c({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},k(t))),"create");var fn=Br;function He(t){if(t instanceof $e){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fe.create(He(n))}return new $e(p(c({},t._def),{shape:a(()=>e,"shape")}))}else return t instanceof ut?new ut(p(c({},t._def),{type:He(t.element)})):t instanceof fe?fe.create(He(t.unwrap())):t instanceof Ne?Ne.create(He(t.unwrap())):t instanceof je?je.create(t.items.map(e=>He(e))):t}a(He,"deepPartialify");var be=class ne extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Z.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let s in r)n[s]=r[s].dereference(e);return new ne(p(c({},this._def),{shape:a(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return me(r)}clone(){let e={},r=this._def.shape();for(let[n,s]of Object.entries(r))e[n]=s.clone();return new ne(p(c({},this._def),{shape:a(()=>e,"shape")}))}_parse(e){if(this._getType(e)!==_.object){let g=this._getOrReturnCtx(e);return v(g,{code:h.invalid_type,expected:_.object,received:g.parsedType}),x}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(this._def.unknownKeys!=="strip")for(let g in s.data)o.includes(g)||l.push(g);let u=[];for(let g of o){let m=i[g],P=s.data[g];u.push({key:{status:"valid",value:g},value:m._parse(new ae(s,P,s.path,g)),alwaysSet:g in s.data})}let f=this._def.unknownKeys;if(f==="passthrough")for(let g of l)u.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(f==="strict")l.length>0&&(v(s,{code:h.unrecognized_keys,keys:l}),n.dirty());else if(f!=="strip")for(let g of l){let m=s.data[g];u.push({key:{status:"valid",value:g},value:f._parse(new ae(s,m,s.path,g)),alwaysSet:g in s.data})}return s.common.async?Promise.resolve().then(async()=>{let g=[];for(let m of u){let P=await m.key;g.push({key:P,value:await m.value,alwaysSet:m.alwaysSet})}return g}).then(g=>te.mergeObjectSync(n,g)):te.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new ne(c(p(c({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:a((r,n)=>{var s,i,o,l;let u=(o=(i=(s=this._def).errorMap)==null?void 0:i.call(s,r,n).message)!=null?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=w.errToObj(e).message)!=null?l:u}:{message:u}},"errorMap")}:{}))}strip(){return new ne(p(c({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ne(p(c({},this._def),{unknownKeys:"passthrough"}))}additionalProperties(){if(this._def.unknownKeys instanceof O)return this._def.unknownKeys;if(this._def.unknownKeys==="passthrough")return ct.create();if(this._def.unknownKeys==="strict")return ft.create()}extend(e){return new ne(p(c({},this._def),{shape:a(()=>c(c({},this._def.shape()),e),"shape")}))}merge(e){return new ne({unknownKeys:e._def.unknownKeys,shape:a(()=>c(c({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ne(p(c({},this._def),{unknownKeys:e}))}pick(e){let r={};return Z.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}omit(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}deepPartial(){return He(this)}partial(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s?.optional()}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}required(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof fe;)i=i._def.innerType;r[n]=i}}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}keyof(){return zt(Z.objectKeys(this.shape))}isEqual(e){if(!(e instanceof ne)||!this._unknownKeysEqual(e))return!1;let r=this._def.shape(),n=e._def.shape(),s=a((l,u)=>l[0]===u[0]&&l[1].isEqual(u[1]),"compare"),i=new K(Object.entries(r),{compare:s}),o=new K(Object.entries(n),{compare:s});return i.isEqual(o)}_unknownKeysEqual(e){let r=this.additionalProperties(),n=e.additionalProperties();return r===void 0||n===void 0?r===n:r.isEqual(n)}};a(be,"ZodObject");be.create=a((t,e)=>new be(c({shape:a(()=>t,"shape"),unknownKeys:"strip",typeName:"ZodObject"},k(e))),"create");be.strictCreate=a((t,e)=>new be(c({shape:a(()=>t,"shape"),unknownKeys:"strict",typeName:"ZodObject"},k(e))),"strictCreate");be.lazycreate=a((t,e)=>new be(c({shape:t,unknownKeys:"strip",typeName:"ZodObject"},k(e))),"lazycreate");var $e=be,Cr=class or extends O{dereference(e){return new or(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new or(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===_.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof or?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return this._def.innerType.mandatory()}};a(Cr,"ZodOptional");Cr.create=a((t,e)=>new Cr(c({innerType:t,typeName:"ZodOptional"},k(e))),"create");var fe=Cr,Xl=class St extends O{dereference(e){return new St(p(c({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return me([...this._def.in.getReferences(),...this._def.out.getReferences()])}clone(){return new St(p(c({},this._def),{in:this._def.in.clone(),out:this._def.out.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(r.dirty(),De(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?x:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new St({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof St)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};a(Xl,"ZodPipeline");var gn=Xl,Ar=class lr extends O{unwrap(){return this._def.type}dereference(e){return new lr(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new lr(p(c({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.promise&&r.common.async===!1)return v(r,{code:h.invalid_type,expected:_.promise,received:r.parsedType}),x;let n=r.parsedType===_.promise?r.data:Promise.resolve(r.data);return J(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof lr?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}};a(Ar,"ZodPromise");Ar.create=a((t,e)=>new Ar(c({type:t,typeName:"ZodPromise"},k(e))),"create");var Ft=Ar,Rr=class Ot extends O{dereference(e){return new Ot(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Ot(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){let r=this._def.innerType._parse(e);return lt(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Ot?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Ot(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Rr,"ZodReadonly");Rr.create=a((t,e)=>new Rr(c({innerType:t,typeName:"ZodReadonly"},k(e))),"create");var Lt=Rr,Yl=class et extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new et(p(c({},this._def),{keyType:r,valueType:n}))}getReferences(){return me([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new et(p(c({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return v(n,{code:h.invalid_type,expected:_.object,received:n.parsedType}),x;let s=[],i=this._def.keyType,o=this._def.valueType;for(let l in n.data)s.push({key:i._parse(new ae(n,l,n.path,l)),value:o._parse(new ae(n,n.data[l],n.path,l))});return n.common.async?te.mergeObjectAsync(r,s):te.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof O?new et(c({keyType:e,valueType:r,typeName:"ZodRecord"},k(n))):new et(c({keyType:X.create(),valueType:e,typeName:"ZodRecord"},k(r)))}isEqual(e){return!(!(e instanceof et)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};a(Yl,"ZodRecord");var ys=Yl,Hr=class Ql extends O{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return v(r,{code:h.unresolved_reference}),x}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Ql?this._def.uri===e._def.uri:!1}};a(Hr,"ZodRef");Hr.create=a(t=>new Hr({typeName:"ZodRef",uri:t}),"create");var vs=Hr,Dr=class tt extends O{dereference(e){return new tt(p(c({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}clone(){return new tt(p(c({},this._def),{valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return v(n,{code:h.invalid_type,expected:_.set,received:n.parsedType}),x;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(v(n,{code:h.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(v(n,{code:h.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let f=new Set;for(let g of u){if(g.status==="aborted")return x;g.status==="dirty"&&r.dirty(),f.add(g.value)}return{status:r.value,value:f}}a(o,"finalizeSet");let l=[...n.data.values()].map((u,f)=>i._parse(new ae(n,u,n.path,f)));return n.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,r){return new tt(p(c({},this._def),{minSize:{value:e,message:w.toString(r)}}))}max(e,r){return new tt(p(c({},this._def),{maxSize:{value:e,message:w.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,s,i;if(!(e instanceof tt))return!1;let o=(r=this._def.minSize)==null?void 0:r.value,l=(n=e._def.minSize)==null?void 0:n.value;if(o!==l)return!1;let u=(s=this._def.maxSize)==null?void 0:s.value,f=(i=e._def.maxSize)==null?void 0:i.value;return u!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};a(Dr,"ZodSet");Dr.create=a((t,e)=>new Dr(c({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},k(e))),"create");var _s=Dr,Ts=/^c[^\s-]{8,}$/i,bs=/^[a-z][a-z0-9]*$/,ws=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ps=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xs=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ec="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tc=a(t=>t===ec,"isEmojiRegex"),An,ks=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Ss=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;function rc(t,e){return!!((e==="v4"||!e)&&ks.test(t)||(e==="v6"||!e)&&Ss.test(t))}a(rc,"isValidIP");var Mr=class rt extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.string,received:i.parsedType}),x}let n=new te,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?v(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&v(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")xs.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")An||(An=new RegExp(ec,"u")),An.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ps.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Ts.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")bs.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ws.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),v(s,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?El(i).test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="ip"?rc(e.data,i.version)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):Z.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),c({validation:r,code:h.invalid_string},w.errToObj(n)))}_addCheck(e){return new rt(p(c({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(c({kind:"email"},w.errToObj(e)))}url(e){return this._addCheck(c({kind:"url"},w.errToObj(e)))}emoji(e){return this._addCheck(c({kind:"emoji"},w.errToObj(e)))}uuid(e){return this._addCheck(c({kind:"uuid"},w.errToObj(e)))}cuid(e){return this._addCheck(c({kind:"cuid"},w.errToObj(e)))}cuid2(e){return this._addCheck(c({kind:"cuid2"},w.errToObj(e)))}ulid(e){return this._addCheck(c({kind:"ulid"},w.errToObj(e)))}ip(e){return this._addCheck(c({kind:"ip"},w.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(c({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},w.errToObj(e?.message)))}regex(e,r){return this._addCheck(c({kind:"regex",regex:e},w.errToObj(r)))}includes(e,r){return this._addCheck(c({kind:"includes",value:e,position:r?.position},w.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(c({kind:"startsWith",value:e},w.errToObj(r)))}endsWith(e,r){return this._addCheck(c({kind:"endsWith",value:e},w.errToObj(r)))}min(e,r){return this._addCheck(c({kind:"min",value:e},w.errToObj(r)))}max(e,r){return this._addCheck(c({kind:"max",value:e},w.errToObj(r)))}length(e,r){return this._addCheck(c({kind:"length",value:e},w.errToObj(r)))}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[b]=p(c({},this._def[b]),{secret:!0}),this}toLowerCase(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof rt))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}};a(Mr,"ZodString");Mr.create=a(t=>{var e;return new Mr(c({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},k(t)))},"create");var X=Mr,Nr=class nc extends O{_parse(e){if(this._getType(e)!==_.symbol){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.symbol,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof nc}};a(Nr,"ZodSymbol");Nr.create=a(t=>new Nr(c({typeName:"ZodSymbol"},k(t))),"create");var Os=Nr,dt=class Et extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Et(p(c({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}clone(){return new Et(p(c({},this._def),{schema:this._def.schema.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a(o=>{v(n,o),o.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return x;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?x:u.status==="dirty"||r.value==="dirty"?De(u.value):u});{if(r.value==="aborted")return x;let l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?x:l.status==="dirty"||r.value==="dirty"?De(l.value):l}}if(s.type==="refinement"){let o=a(l=>{let u=s.refinement(l,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?x:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?x:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!lt(o))return o;let l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>lt(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:r.value,value:l})):o);Z.assertNever(s)}isEqual(e){return!(e instanceof Et)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:Z.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:Z.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:Z.compareFunctions(this._def.effect.transform,e._def.effect.transform):!1}naked(){return this._def.schema.naked()}mandatory(){return new Et(p(c({},this._def),{schema:this._def.schema.mandatory()}))}};a(dt,"ZodEffects");dt.create=a((t,e,r)=>new dt(c({schema:t,typeName:"ZodEffects",effect:e},k(r))),"create");dt.createWithPreprocess=a((t,e,r)=>new dt(c({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},k(r))),"createWithPreprocess");var we=dt,$r=class Zt extends O{dereference(e){let r=this._def.items.map(s=>s.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new Zt(p(c({},this._def),{items:r,rest:n}))}getReferences(){return me([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}clone(){let e=this._def.items.map(n=>n.clone()),r=this._def.rest?this._def.rest.clone():null;return new Zt(p(c({},this._def),{items:e,rest:r}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return v(n,{code:h.invalid_type,expected:_.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return v(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new ae(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>te.mergeArray(r,o)):te.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Zt(p(c({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Zt)||!this._restEquals(e))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K(this._def.items,{compare:r}),s=new K(e._def.items,{compare:r});return n.isEqual(s)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};a($r,"ZodTuple");$r.create=a((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $r(c({items:t,typeName:"ZodTuple",rest:null},k(e)))},"create");var je=$r,jr=class sc extends O{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.undefined,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof sc}mandatory(){return ft.create(c({},this._def))}};a(jr,"ZodUndefined");jr.create=a(t=>new jr(c({typeName:"ZodUndefined"},k(t))),"create");var Wt=jr,Kr=class It extends O{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new It(p(c({},this._def),{options:r}))}getReferences(){return me(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}clone(){let e=this._def.options.map(r=>r.clone());return new It(p(c({},this._def),{options:e}))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let o=i.map(l=>new le(l.ctx.common.issues));return v(r,{code:h.invalid_union,unionErrors:o}),x}if(a(s,"handleResults"),r.common.async)return Promise.all(n.map(async i=>{let o=p(c({},r),{common:p(c({},r.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let f=p(c({},r),{common:p(c({},r.common),{issues:[]}),parent:null}),g=u._parseSync({data:r.data,path:r.path,parent:f});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let l=o.map(u=>new le(u));return v(r,{code:h.invalid_union,unionErrors:l}),x}}get options(){return this._def.options}isEqual(e){if(!(e instanceof It))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K([...this._def.options],{compare:r}),s=new K([...e._def.options],{compare:r});return n.isEqual(s)}mandatory(){let e=this._def.options.filter(i=>!(i instanceof Wt)).map(i=>i.mandatory()),[r,n,...s]=e;return r?n?new It(p(c({},this._def),{options:[r,n,...s]})):r:ft.create(c({},this._def))}};a(Kr,"ZodUnion");Kr.create=a((t,e)=>new Kr(c({options:t,typeName:"ZodUnion"},k(e))),"create");var hn=Kr,Ur=class ic extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}isEqual(e){return e instanceof ic}};a(Ur,"ZodUnknown");Ur.create=a(t=>new Ur(c({typeName:"ZodUnknown"},k(t))),"create");var it=Ur,zr=class ac extends O{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.void,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof ac}};a(zr,"ZodVoid");zr.create=a(t=>new zr(c({typeName:"ZodVoid"},k(t))),"create");var Es=zr,sm=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],vv=Ve.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),oc=a(t=>X.create().displayAs({id:"variable",params:c({type:t?.type||"any"},t?.params)}),"variable"),lc=a(t=>X.create().displayAs({id:"conversation",params:c({},t?.params)}),"conversation"),cc=a(t=>X.create().displayAs({id:"user",params:c({},t?.params)}),"user"),uc=a(t=>X.create().displayAs({id:"message",params:c({},t?.params)}),"message"),dc=a(t=>X.create().displayAs({id:"agent",params:c({},t?.params)}),"agent"),pc=a(t=>X.create().displayAs({id:"event",params:c({},t?.params)}),"event"),fc=a(t=>X.create().displayAs({id:"table",params:c({},t?.params)}),"table"),gc=a(t=>X.create().displayAs({id:"tablerow",params:c({},t?.params)}),"tablerow"),hc=a(t=>X.create().displayAs({id:"intent",params:c({},t?.params)}),"intent"),mc=a(()=>Ve.create(sm).displayAs({id:"dropdown",params:{}}),"aimodel"),yc=a(t=>X.create().displayAs({id:"datasource",params:c({},t)}),"datasource"),vc=a(t=>X.create().displayAs({id:"knowledgebase",params:c({},t)}),"knowledgebase"),_c={object:$e.lazycreate},Tc=a((t,e={message:`Input not instance of ${t.name}`})=>ds(r=>r instanceof t,e),"instanceOfType"),Zs=X.create,Is=fn.create,bc=ms.create,wc=rn.create,Bs=nn.create,Pc=on.create,xc=Os.create,kc=Wt.create,Sc=pn.create,Oc=ct.create,Ec=it.create,Zc=ft.create,Ic=Es.create,Bc=ut.create,Cc=$e.create,Ac=$e.strictCreate,Rc=hn.create,Hc=ps.create,Dc=ln.create,Mc=je.create,Nc=ys.create,$c=vs.create,jc=Lt.create,Kc=hs.create,Uc=_s.create,zc=gs.create,Fc=cn.create,Lc=un.create,Wc=Ve.create,qc=dn.create,Vc=Ft.create,Fn=we.create,Gc=fe.create,Jc=Ne.create,im=Ut.create,Xc=we.createWithPreprocess,Yc=gn.create,Qc=a(()=>Zs().optional(),"ostring"),eu=a(()=>Is().optional(),"onumber"),tu=a(()=>Bs().optional(),"oboolean"),ru={string:a(t=>X.create(p(c({},t),{coerce:!0})),"string"),number:a(t=>fn.create(p(c({},t),{coerce:!0})),"number"),boolean:a(t=>nn.create(p(c({},t),{coerce:!0})),"boolean"),bigint:a(t=>rn.create(p(c({},t),{coerce:!0})),"bigint"),date:a(t=>on.create(p(c({},t),{coerce:!0})),"date")},nu=x,d=y,su=a((t,e)=>t.anyOf.length?t.anyOf.length===1?L(t.anyOf[0],p(c({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>L(r,p(c({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),am=a(t=>{var e;return(e=t[b])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),om=a(t=>"z.any()","parseDefault"),lm=a((t,e)=>`z.union([${t.type.map(r=>L(p(c({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),cm=a((t,e)=>`z.any().refine((value) => !${L(t.not,p(c({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),um=a(t=>"z.null()","parseNull"),dm=a(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),pm=a((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function G(t,e,r){var n;let s=t[e],i="";if(s!==void 0){let o=r({value:s,json:JSON.stringify(s)});if(o){let l=o[0],u=o.length===3?o[1]:"",f=o.length===3?o[2]:o[1];i+=l,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(i+=u+JSON.stringify(t.errorMessage[e])),i+=f}}return i}a(G,"withMessage");var Bt=Symbol("Original index"),fm=a(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[Bt]:r}:{[Bt]:r,not:{}});else{if(Bt in n)return t;e.push(p(c({},n),{[Bt]:r}))}}return e},"ensureOriginalIndex");function jt(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return L(r,p(c({},e),{path:[...e.path,"allOf",r[Bt]]}))}else{let[r,n]=dm(fm(t.allOf));return`z.intersection(${jt({allOf:r},e)}, ${jt({allOf:n},e)})`}}a(jt,"parseAllOf");var gm=a((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,s)=>L(n,p(c({},e),{path:[...e.path,"items",s]})))}])`;let r=t.items?`z.array(${L(t.items,p(c({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=G(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=G(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),hm=a(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),mm=a(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),ym=a((t,e)=>{let r=L(t.if,p(c({},e),{path:[...e.path,"if"]})),n=L(t.then,p(c({},e),{path:[...e.path,"then"]})),s=L(t.else,p(c({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${s}]).superRefine((value,ctx) => {
11
+ `).trim();case d.ZodFirstPartyTypeKind.ZodUnion:return`z.union([${r.options.map(N).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let l=r.options.map(N);return`z.discriminatedUnion(${T(r.discriminator)}, [${l.join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodIntersection:let f=N(r.left),g=N(r.right);return`z.intersection(${f}, ${g})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodTuple:return`z.tuple([${r.items.map(N).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodRecord:let P=N(r.keyType),E=N(r.valueType);return`z.record(${P}, ${E})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodMap:let I=N(r.keyType),U=N(r.valueType);return`z.map(${I}, ${U})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodSet:return`z.set(${N(r.valueType)})${Mh(r)}${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodFunction:let W=r.args.items.map(N),Q=W.length?`.args(${W.join(", ")})`:"",ie=N(r.returns);return`z.function()${Q}.returns(${ie})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodLazy:return`z.lazy(() => ${N(r.getter())})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodLiteral:return`z.literal(${T(r.value)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodEnum:return`z.enum([${r.values.map(T).join(", ")}])${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodEffects:throw new Ie(d.ZodFirstPartyTypeKind.ZodEffects);case d.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Ie(d.ZodFirstPartyTypeKind.ZodNativeEnum);case d.ZodFirstPartyTypeKind.ZodOptional:return`z.optional(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodNullable:return`z.nullable(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodDefault:let Ye=nt(r.defaultValue());return`z.default(${N(r.innerType)}, ${Ye})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodCatch:throw new Ie(d.ZodFirstPartyTypeKind.ZodCatch);case d.ZodFirstPartyTypeKind.ZodPromise:return`z.promise(${N(r.type)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodBranded:throw new Ie(d.ZodFirstPartyTypeKind.ZodBranded);case d.ZodFirstPartyTypeKind.ZodPipeline:throw new Ie(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodSymbol:throw new Ie(d.ZodFirstPartyTypeKind.ZodSymbol);case d.ZodFirstPartyTypeKind.ZodReadonly:return`z.readonly(${N(r.innerType)})${R(r)}${A(r)}`.trim();case d.ZodFirstPartyTypeKind.ZodRef:return`z.ref(${T(r.uri)})${R(r)}${A(r)}`.trim();default:Z.assertNever(r)}}a(N,"sUnwrapZod");var A=a(t=>t.description?`.describe(${T(t.description)})`:"","_maybeDescribe"),R=a(t=>`${Nh(t)}${$h(t)}${jh(t)}${Kh(t)}${Uh(t)}${zh(t)}${Fh(t)}`,"_addZuiExtensions"),Nh=a(t=>{var e;return(e=t[b])!=null&&e.title?`.title(${T(t[b].title)})`:""},"_maybeTitle"),$h=a(t=>{var e;return(e=t[b])!=null&&e.displayAs?`.displayAs(${Ri({id:t[b].displayAs[0],params:t[b].displayAs[1]})})`:""},"_maybeDisplayAs"),jh=a(t=>{var e;return(e=t[b])!=null&&e.disabled?`.disabled(${t[b].disabled})`:""},"_maybeDisabled"),Kh=a(t=>{var e;return(e=t[b])!=null&&e.hidden?`.hidden(${t[b].hidden})`:""},"_maybeHidden"),Uh=a(t=>{var e;return(e=t[b])!=null&&e.placeholder?`.placeholder(${T(t[b].placeholder)})`:""},"_maybePlaceholder"),zh=a(t=>{var e;return(e=t[b])!=null&&e.secret?".secret()":""},"_maybeSecret"),Fh=a(t=>{var e;let r=["title","tooltip","displayAs","disabled","hidden","placeholder","secret","coerce"],n=Object.entries((e=t[b])!=null?e:{}).filter(([s])=>!r.includes(s));return n.length>0?`.metadata(${Ri(Object.fromEntries(n))})`:""},"_maybeSetMetadata"),Lh=a(t=>{let e={type:"number",description:t.description,"x-zui":t._def["x-zui"]};t._def[b]&&(e[b]=t._def[b]);for(let r of t._def.checks)switch(r.kind){case"min":{let n=r.inclusive?"minimum":"exclusiveMinimum",s=r.inclusive?"exclusiveMinimum":"minimum";e[n]=r.value,delete e[s];break}case"max":{let n=r.inclusive?"maximum":"exclusiveMaximum",s=r.inclusive?"exclusiveMaximum":"maximum";e[n]=r.value,delete e[s];break}case"int":e.type="integer";break;case"finite":{e.format="finite";break}case"multipleOf":e.multipleOf=r.value;break;default:}return e},"zodNumberToJsonNumber"),kl="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",Sl="(([+-]\\d{2}(:?\\d{2})?)|Z)",Wh="Z",Ol="(\\.\\d+)?",Un="\\.\\d{",qh="}",El=a(t=>{let e=t.precision?Un+t.precision+qh:t.precision===0?"":Ol,r=t.offset?Sl:Wh;return new RegExp(`^${kl}${e}${r}$`)},"generateDatetimeRegex"),Vh=a(t=>({precision:Gh(t),offset:t.endsWith(`${Sl}$`)}),"extractPrecisionAndOffset"),Gh=a(t=>{let e=t.slice(1+kl.length);return e.startsWith(Ol)?null:e.startsWith(Un)?parseInt(e.slice(Un.length)):0},"_extractPrecision"),Rt={};Lr(Rt,{escapeSpecialChars:()=>Jh});var Jh=a(t=>t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeSpecialChars");function as(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=p(c({},t.errorMessage),{[e]:r}))}a(as,"addErrorMessage");function H(t,e,r,n,s){t[e]=r,as(t,e,n,s)}a(H,"setResponseValueAndErrors");var j={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",ipv4:"^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$",ipv6:"^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$"};function os(t,e){let r=c({type:"string"},t.coerce?{[b]:{coerce:t.coerce||void 0}}:{});function n(s){return e.patternStrategy==="escape"?Rt.escapeSpecialChars(s):s}if(a(n,"processPattern"),t.checks)for(let s of t.checks)switch(s.kind){case"min":H(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,s.value):s.value,s.message,e);break;case"max":H(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,s.value):s.value,s.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Ze(r,"email",s.message,e);break;case"format:idn-email":Ze(r,"idn-email",s.message,e);break;case"pattern:zod":ue(r,j.email,s.message,e);break}break;case"url":Ze(r,"uri",s.message,e);break;case"uuid":Ze(r,"uuid",s.message,e);break;case"regex":ue(r,s.regex.source,s.message,e);break;case"cuid":ue(r,j.cuid,s.message,e);break;case"cuid2":ue(r,j.cuid2,s.message,e);break;case"startsWith":ue(r,"^"+n(s.value),s.message,e);break;case"endsWith":ue(r,n(s.value)+"$",s.message,e);break;case"datetime":Ze(r,"date-time",s.message,e);break;case"length":H(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,s.value):s.value,s.message,e),H(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,s.value):s.value,s.message,e);break;case"includes":{ue(r,n(s.value),s.message,e);break}case"ip":{s.version!=="v6"&&Ze(r,"ipv4",s.message,e),s.version!=="v4"&&Ze(r,"ipv6",s.message,e);break}case"emoji":ue(r,j.emoji,s.message,e);break;case"ulid":{ue(r,j.ulid,s.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}a(os,"parseStringDef");var Ze=a((t,e,r,n)=>{var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(c({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(c({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):H(t,"format",e,r,n)},"addFormat"),ue=a((t,e,r,n)=>{var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(c({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(c({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):H(t,"pattern",e,r,n)},"addPattern"),Xh=a(t=>{let e={type:"string",description:t.description,"x-zui":t._def["x-zui"]};t._def[b]&&(e[b]=t._def[b]);for(let r of t._def.checks)switch(r.kind){case"cuid":e.format="cuid",e.pattern=j.cuid;break;case"cuid2":e.format="cuid2",e.pattern=j.cuid2;break;case"ulid":e.format="ulid",e.pattern=j.ulid;break;case"uuid":e.format="uuid",e.pattern=j.uuid;break;case"emoji":e.format="emoji",e.pattern=j.emoji;break;case"email":e.format="email",e.pattern=j.email;break;case"ip":e.format=r.version==="v6"?"ipv6":"ipv4",e.pattern=r.version==="v6"?j.ipv6:j.ipv4;break;case"datetime":e.format="date-time",e.pattern=El(r).source,e[b]=p(c({},e[b]),{precision:r.precision,offset:r.offset});break;case"url":e.format="uri";break;case"endsWith":e.pattern=`${Rt.escapeSpecialChars(r.value)}$`;break;case"startsWith":e.pattern=`^${Rt.escapeSpecialChars(r.value)}`;break;case"includes":let n=r.position&&r.position>=1?`^(?:.{${r.position}}).*`:"";e.pattern=`${n}${Rt.escapeSpecialChars(r.value)}`;break;case"regex":e.pattern=r.regex.source;break;case"length":e.minLength=e.maxLength=Math.max(0,r.value);break;case"min":e.minLength=Math.max(0,r.value);break;case"max":e.maxLength=Math.max(0,r.value);break;default:throw new zi({zodType:d.ZodFirstPartyTypeKind.ZodString,checkKind:r.kind})}return e},"zodStringToJsonString"),Yh=a((t,e)=>{let r={type:"array",description:t.description,items:e(t._def.type),"x-zui":t._def["x-zui"]};return t._def[b]&&(r[b]=t._def[b]),t._def.minLength&&(r.minItems=t._def.minLength.value),t._def.maxLength&&(r.maxItems=t._def.maxLength.value),t._def.exactLength&&(r.minItems=t._def.exactLength.value,r.maxItems=t._def.exactLength.value),r},"zodArrayToJsonArray"),Qh=a((t,e)=>{let r={type:"array",description:t.description,uniqueItems:!0,items:e(t._def.valueType),"x-zui":t._def["x-zui"]};return t._def[b]&&(r[b]=t._def[b]),t._def.minSize&&(r.minItems=t._def.minSize.value),t._def.maxSize&&(r.maxItems=t._def.maxSize.value),r},"zodSetToJsonSet"),em=a((t,e)=>{let r={type:"array",description:t.description,items:t._def.items.map(n=>e(n))};return t._def[b]&&(r[b]=t._def[b]),t._def.rest&&(r.additionalItems=e(t._def.rest)),r},"zodTupleToJsonTuple");function V(t){let e=t,r=e._def;switch(r.typeName){case d.ZodFirstPartyTypeKind.ZodString:return Xh(e);case d.ZodFirstPartyTypeKind.ZodNumber:return Lh(e);case d.ZodFirstPartyTypeKind.ZodNaN:throw new ee(d.ZodFirstPartyTypeKind.ZodNaN);case d.ZodFirstPartyTypeKind.ZodBigInt:throw new ee(d.ZodFirstPartyTypeKind.ZodBigInt,{suggestedAlternative:"serialize bigint to string"});case d.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean",description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodDate:throw new ee(d.ZodFirstPartyTypeKind.ZodDate,{suggestedAlternative:"use z.string().datetime() instead"});case d.ZodFirstPartyTypeKind.ZodUndefined:return Bn(r);case d.ZodFirstPartyTypeKind.ZodNull:return Cn(r);case d.ZodFirstPartyTypeKind.ZodAny:return{description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodUnknown:return{description:r.description,"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodUnknown}})};case d.ZodFirstPartyTypeKind.ZodNever:return{not:!0,description:r.description,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodVoid:throw new ee(d.ZodFirstPartyTypeKind.ZodVoid);case d.ZodFirstPartyTypeKind.ZodArray:return Yh(e,V);case d.ZodFirstPartyTypeKind.ZodObject:let n=Object.entries(r.shape()),s=n.filter(([g,m])=>!m.isOptional()),i=s.length?s.map(([g])=>g):void 0,o=n.map(([g,m])=>[g,m.mandatory()]).map(([g,m])=>[g,V(m)]),l=!1;return r.unknownKeys instanceof d.ZodType?l=V(r.unknownKeys):r.unknownKeys==="passthrough"&&(l=!0),{type:"object",description:r.description,properties:Object.fromEntries(o),required:i,additionalProperties:l,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodUnion:return{description:r.description,anyOf:r.options.map(g=>V(g)),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return{description:r.description,anyOf:r.options.map(g=>V(g)),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodIntersection:let u=V(r.left),f=V(r.right);return"additionalProperties"in u&&delete u.additionalProperties,"additionalProperties"in f&&delete f.additionalProperties,{description:r.description,allOf:[u,f],"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodTuple:return em(e,V);case d.ZodFirstPartyTypeKind.ZodRecord:return{type:"object",description:r.description,additionalProperties:V(r.valueType),"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodMap:throw new ee(d.ZodFirstPartyTypeKind.ZodMap);case d.ZodFirstPartyTypeKind.ZodSet:return Qh(e,V);case d.ZodFirstPartyTypeKind.ZodFunction:throw new ee(d.ZodFirstPartyTypeKind.ZodFunction);case d.ZodFirstPartyTypeKind.ZodLazy:throw new ee(d.ZodFirstPartyTypeKind.ZodLazy);case d.ZodFirstPartyTypeKind.ZodLiteral:if(typeof r.value=="string")return{type:"string",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(typeof r.value=="number")return{type:"number",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(typeof r.value=="boolean")return{type:"boolean",description:r.description,const:r.value,"x-zui":r["x-zui"]};if(r.value===null)return Cn(r);if(r.value===void 0)return Bn(r);{d.util.assertEqual(!0);let g=typeof r.value;throw new qr(`Unsupported literal type: "${g}"`)}case d.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",description:r.description,enum:r.values,"x-zui":r["x-zui"]};case d.ZodFirstPartyTypeKind.ZodEffects:throw new ee(d.ZodFirstPartyTypeKind.ZodEffects);case d.ZodFirstPartyTypeKind.ZodNativeEnum:throw new ee(d.ZodFirstPartyTypeKind.ZodNativeEnum);case d.ZodFirstPartyTypeKind.ZodOptional:return{description:r.description,anyOf:[V(r.innerType),Bn()],"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodOptional}})};case d.ZodFirstPartyTypeKind.ZodNullable:return{anyOf:[V(r.innerType),Cn()],"x-zui":p(c({},r["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodNullable}})};case d.ZodFirstPartyTypeKind.ZodDefault:return p(c({},V(r.innerType)),{default:r.defaultValue()});case d.ZodFirstPartyTypeKind.ZodCatch:throw new ee(d.ZodFirstPartyTypeKind.ZodCatch);case d.ZodFirstPartyTypeKind.ZodPromise:throw new ee(d.ZodFirstPartyTypeKind.ZodPromise);case d.ZodFirstPartyTypeKind.ZodBranded:throw new ee(d.ZodFirstPartyTypeKind.ZodBranded);case d.ZodFirstPartyTypeKind.ZodPipeline:throw new ee(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodSymbol:throw new ee(d.ZodFirstPartyTypeKind.ZodPipeline);case d.ZodFirstPartyTypeKind.ZodReadonly:return p(c({},V(r.innerType)),{readOnly:!0});case d.ZodFirstPartyTypeKind.ZodRef:return{$ref:r.uri,description:r.description,"x-zui":r["x-zui"]};default:d.util.assertNever(r)}}a(V,"toJSONSchema");var Bn=a(t=>({not:!0,description:t?.description,"x-zui":p(c({},t?.["x-zui"]),{def:{typeName:d.ZodFirstPartyTypeKind.ZodUndefined}})}),"undefinedSchema"),Cn=a(t=>({type:"null",description:t?.description,"x-zui":t?.["x-zui"]}),"nullSchema"),Zl=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(Zl,"ParseInputLazyPath");var ae=Zl,ki=a((t,e)=>{if(lt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new le(t.common.issues);return this._error=r,this._error}}},"handleResult"),Il=class{constructor(e){this.__type__="ZuiType",this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._metadataRoot._def.description}dereference(e){return this}getReferences(){return[]}clone(){let e=this.constructor;return new e(c({},this._def))}_getType(e){return pe(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new te,ctx:{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if($t(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},i=this._parseSync({data:e,path:s.path,parent:s});return ki(s,i)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await($t(s)?s:Promise.resolve(s));return ki(n,i)}refine(e,r){let n=a(s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r,"getIssueProperties");return this._refinement((s,i)=>{let o=e(s),l=a(()=>i.addIssue(c({code:h.custom},n(s))),"setError");return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new we({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return fe.create(this,this._def)}nullable(){return Ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ut.create(this,this._def)}promise(){return Ft.create(this,this._def)}mandatory(){return this}or(e){return hn.create([this,e],this._def)}and(e){return ln.create(this,e,this._def)}transform(e){return new we(p(c({},k(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new Ut(p(c({},k(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new sn(c({typeName:"ZodBranded",type:this},k(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new an(p(c({},k(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.clone();return r._metadataRoot._def.description=e,r}pipe(e){return gn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){var r,n,s;let i=this.clone(),o=i._metadataRoot;(s=(r=o._def)[n=b])!=null||(r[n]={});for(let[l,u]of Object.entries(e))o._def[b]=p(c({},o._def[b]),{[l]:u});return i}getMetadata(){return c({},this._metadataRoot._def[b])}setMetadata(e){this._metadataRoot._def[b]=c({},e)}get ui(){return c({},this._metadataRoot._def[b])}get _metadataRoot(){return this.naked()}displayAs(e){return this.metadata({displayAs:[e.id,e.params]})}title(e){return this.metadata({title:e})}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this.metadata({hidden:r})}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this.metadata({disabled:r})}placeholder(e){return this.metadata({placeholder:e})}toJSONSchema(){return V(this)}toTypescriptType(e){return Vn(this,e)}toTypescriptSchema(){return is(this)}naked(){return this}};a(Il,"ZodType");var O=Il,ls=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(ls||{}),Z;(t=>{t.assertEqual=a(s=>s,"assertEqual");function e(s){}t.assertIs=e,a(e,"assertIs");function r(s){throw new Error("assertNever called")}t.assertNever=r,a(r,"assertNever"),t.arrayToEnum=a(s=>{let i={};for(let o of s)i[o]=o;return i},"arrayToEnum"),t.getValidEnumValues=a(s=>{let i=(0,t.objectKeys)(s).filter(l=>typeof s[s[l]]!="number"),o={};for(let l of i)o[l]=s[l];return(0,t.objectValues)(o)},"getValidEnumValues"),t.objectValues=a(s=>(0,t.objectKeys)(s).map(function(i){return s[i]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=a((s,i)=>{for(let o of s)if(i(o))return o},"find"),t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,a(n,"joinValues"),t.jsonStringifyReplacer=a((s,i)=>typeof i=="bigint"?i.toString():i,"jsonStringifyReplacer"),t.compareFunctions=a((s,i)=>s.toString()===i.toString(),"compareFunctions"),t.mock=a(()=>({}),"mock")})(Z||(Z={}));var ur;(t=>{t.mergeShapes=a((e,r)=>c(c({},e),r),"mergeShapes")})(ur||(ur={}));var _=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pe=a(t=>{switch(typeof t){case"undefined":return _.undefined;case"string":return _.string;case"number":return isNaN(t)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(t)?_.array:t===null?_.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_.promise:typeof Map<"u"&&t instanceof Map?_.map:typeof Set<"u"&&t instanceof Set?_.set:typeof Date<"u"&&t instanceof Date?_.date:_.object;default:return _.unknown}},"getParsedType");function k(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s,supportsExtensions:i,[b]:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);let l=o?Object.fromEntries(Object.entries(o).filter(([f])=>f!=="secret"||i?.includes("secret"))):void 0;return e?{errorMap:e,description:s,[b]:l}:{errorMap:a((f,g)=>f.code!=="invalid_type"?{message:g.defaultError}:typeof g.data>"u"?{message:n??g.defaultError}:{message:r??g.defaultError},"customMap"),description:s,[b]:l}}a(k,"processCreateParams");var cs=a((t,e)=>{let r;switch(t.code){case h.invalid_type:t.received===_.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Z.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:r=`Unrecognized key(s) in object: ${Z.joinValues(t.keys,", ")}`;break;case h.invalid_union:r="Invalid input";break;case h.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Z.joinValues(t.options)}`;break;case h.invalid_enum_value:r=`Invalid enum value. Expected ${Z.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:r="Invalid function arguments";break;case h.invalid_return_type:r="Invalid function return type";break;case h.invalid_date:r="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case h.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case h.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case h.custom:r="Invalid input";break;case h.invalid_intersection_types:r="Intersection results could not be merged";break;case h.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:r="Number must be finite";break;case h.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,Z.assertNever(t)}return{message:r}},"errorMap"),Si=cs,h=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite","unresolved_reference"]),Bl=a(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),dr=class Cl extends Error{constructor(e){super(),this.issues=[],this.addIssue=a(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=a((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=a(i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,u=0;for(;u<o.path.length;){let f=o.path[u];u===o.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(r(o))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}},"processError");return s(this),n}static assert(e){if(!(e instanceof Cl))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};a(dr,"ZodError");dr.create=a(t=>new dr(t),"create");var le=dr,Al=cs;function us(t){Al=t}a(us,"setErrorMap");function ot(){return Al}a(ot,"getErrorMap");var Nt=a(t=>{var e;let{data:r,path:n,errorMaps:s,issueData:i}=t,o=[...n,...i.path||[]],l=p(c({},i),{path:o}),u="",f=s.filter(g=>!!g).slice().reverse();for(let g of f)u=g(l,{data:r,defaultError:u}).message;return p(c({},i),{path:o,message:(e=i.message)!=null?e:u})},"makeIssue"),Rl=[];function v(t,e){let r=Nt({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ot(),cs].filter(n=>!!n)});t.common.issues.push(r)}a(v,"addIssueToContext");var Hl=class Dl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return x;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r)n.push({key:await s.key,value:await s.value});return Dl.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return x;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};a(Hl,"ParseStatus");var te=Hl,x=Object.freeze({status:"aborted"}),De=a(t=>({status:"dirty",value:t}),"DIRTY"),J=a(t=>({status:"valid",value:t}),"OK"),pr=a(t=>t.status==="aborted","isAborted"),fr=a(t=>t.status==="dirty","isDirty"),lt=a(t=>t.status==="valid","isValid"),$t=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),w;(t=>{t.errToObj=a(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=a(e=>typeof e=="string"?e:e?.message,"toString")})(w||(w={}));var gr=class Ml extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}isEqual(e){return e instanceof Ml}};a(gr,"ZodAny");gr.create=a(t=>new gr(c({typeName:"ZodAny"},k(t))),"create");var ct=gr,hr=class Ce extends O{dereference(e){return new Ce(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new Ce(p(c({},this._def),{type:this._def.type.clone()}))}isEqual(e){var r,n,s,i,o,l;return e instanceof Ce?st((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&st((s=this._def.maxLength)==null?void 0:s.value,(i=e._def.maxLength)==null?void 0:i.value)&&st((o=this._def.minLength)==null?void 0:o.value,(l=e._def.minLength)==null?void 0:l.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==_.array)return v(r,{code:h.invalid_type,expected:_.array,received:r.parsedType}),x;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(o||l)&&(v(r,{code:o?h.too_big:h.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(v(r,{code:h.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(v(r,{code:h.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>s.type._parseAsync(new ae(r,o,r.path,l)))).then(o=>te.mergeArray(n,o));let i=[...r.data].map((o,l)=>s.type._parseSync(new ae(r,o,r.path,l)));return te.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Ce(p(c({},this._def),{minLength:{value:e,message:w.toString(r)}}))}max(e,r){return new Ce(p(c({},this._def),{maxLength:{value:e,message:w.toString(r)}}))}length(e,r){return new Ce(p(c({},this._def),{exactLength:{value:e,message:w.toString(r)}}))}nonempty(e){return this.min(1,e)}};a(hr,"ZodArray");hr.create=a((t,e)=>new hr(c({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},k(e))),"create");var ut=hr,tm=a((t,e)=>Nl(t,e,new WeakSet),"isEqual"),Nl=a((t,e,r)=>bh(t,e,rm(r)),"_isEqualWithVisitedTracking"),rm=a(t=>(e,r)=>{if(li(e)&&!t.has(e)&&li(r)&&!t.has(r)){let n=Pi(e,wi),s=Pi(r,wi);return t.add(n).add(s).add(e).add(r),Nl(n,s,t)}},"_customizerWithVisitedTracking"),nm={compare:tm},$l=class{constructor(e=[],r={}){this._options=c(c({},nm),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};a($l,"CustomSet");var K=$l,mr=class rr extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==_.bigint){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.bigint,received:i.parsedType}),x}let n,s=new te;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Z.assertNever(i);return{status:s.value,value:e.data}}isEqual(e){if(!(e instanceof rr)||this._def.coerce!==e._def.coerce)return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new rr(p(c({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]}))}_addCheck(e){return new rr(p(c({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(mr,"ZodBigInt");mr.create=a(t=>{var e;return new mr(c({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},k(t)))},"create");var rn=mr,yr=class jl extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==_.boolean){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.boolean,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof jl?this._def.coerce===e._def.coerce:!1}};a(yr,"ZodBoolean");yr.create=a(t=>new yr(c({typeName:"ZodBoolean",coerce:t?.coerce||!1},k(t))),"create");var nn=yr,Kl=Symbol("zod_brand"),Ul=class bt extends O{dereference(e){return new bt(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new bt(p(c({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof bt?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}mandatory(){return new bt(p(c({},this._def),{type:this._def.type.mandatory()}))}};a(Ul,"ZodBranded");var sn=Ul,vr=class wt extends O{_parse(e){let{ctx:r}=this._processInputParams(e),n=p(c({},r),{common:p(c({},r.common),{issues:[]})}),s=this._def.innerType._parse({data:n.data,path:n.path,parent:c({},n)});return $t(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof wt?this._def.innerType.isEqual(e._def.innerType)&&Z.compareFunctions(this._def.catchValue,e._def.catchValue):!1}dereference(e){return new wt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new wt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}naked(){return this._def.innerType.naked()}mandatory(){return new wt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(vr,"ZodCatch");vr.create=a((t,e)=>new vr(c({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},k(e))),"create");var an=vr,ds=a((t,e={},r)=>t?ct.create().superRefine((n,s)=>{var i,o;if(!t(n)){let l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(i=l.fatal)!=null?i:r)!=null?o:!0,f=typeof l=="string"?{message:l}:l;s.addIssue(p(c({code:"custom"},f),{fatal:u}))}}):ct.create(),"custom"),_r=class zn extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.date,received:i.parsedType}),x}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_date}),x}let n=new te,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Z.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zn(p(c({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof zn))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};a(_r,"ZodDate");_r.create=a(t=>new _r(c({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},k(t))),"create");var on=_r,Tr=class Pt extends O{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new Pt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Pt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}isEqual(e){return e instanceof Pt?this._def.innerType.isEqual(e._def.innerType)&&st(this._def.defaultValue(),e._def.defaultValue()):!1}unwrap(){return this._def.innerType}naked(){return this._def.innerType.naked()}mandatory(){return new Pt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Tr,"ZodDefault");Tr.create=a((t,e,r)=>new Tr(c({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},k(r))),"create");var Ut=Tr,me=a(t=>Array.from(new Set(t)),"unique"),de=a(t=>t instanceof cn?de(t.schema):t instanceof we?de(t.innerType()):t instanceof un?[t.value]:t instanceof Ve?t.options:t instanceof dn?Z.objectValues(t.enum):t instanceof Ut?de(t._def.innerType):t instanceof Wt?[void 0]:t instanceof pn?[null]:t instanceof fe?[void 0,...de(t.unwrap())]:t instanceof Ne?[null,...de(t.unwrap())]:t instanceof sn||t instanceof Lt?de(t.unwrap()):t instanceof an?de(t._def.innerType):[],"getDiscriminator"),zl=class Ae extends O{dereference(e){let r=this.options.map(s=>s.dereference(e)),n=Ae._getOptionsMap(this.discriminator,r);return new Ae(p(c({},this._def),{options:r,optionsMap:n}))}getReferences(){return me(this.options.flatMap(e=>e.getReferences()))}clone(){let e=this.options.map(r=>r.clone());return new Ae(p(c({},this._def),{options:e}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.object)return v(r,{code:h.invalid_type,expected:_.object,received:r.parsedType}),x;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(v(r,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=Ae._getOptionsMap(e,r);return new Ae(c({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:s},k(n)))}static _getOptionsMap(e,r){let n=new Map;for(let s of r){let i=de(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return n}isEqual(e){if(!(e instanceof Ae)||this._def.discriminator!==e._def.discriminator)return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K(this._def.options,{compare:r}),s=new K(e._def.options,{compare:r});return n.isEqual(s)}};a(zl,"ZodDiscriminatedUnion");var ps=zl;function zt(t,e){return new Ve(c({values:t,typeName:"ZodEnum"},k(e)))}a(zt,"createZodEnum");var fs=class nr extends O{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{expected:Z.joinValues(n),received:r.parsedType,code:h.invalid_type}),x}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{received:r.data,code:h.invalid_enum_value,options:n}),x}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return nr.create(e,c(c({},this._def),r))}exclude(e,r=this._def){return nr.create(this.options.filter(n=>!e.includes(n)),c(c({},this._def),r))}isEqual(e){if(!(e instanceof nr))return!1;let r=new K(this._def.values),n=new K(e._def.values);return r.isEqual(n)}};a(fs,"ZodEnum");fs.create=zt;var Ve=fs,Fl=class Re extends O{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new Re(p(c({},this._def),{args:r,returns:n}))}getReferences(){return me([...this._def.args.getReferences(),...this._def.returns.getReferences()])}clone(){return new Re(p(c({},this._def),{args:this._def.args.clone(),returns:this._def.returns.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.function)return v(r,{code:h.invalid_type,expected:_.function,received:r.parsedType}),x;function n(l,u){return Nt({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ot(),Si].filter(f=>!!f),issueData:{code:h.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function s(l,u){return Nt({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ot(),Si].filter(f=>!!f),issueData:{code:h.invalid_return_type,returnTypeError:u}})}a(s,"makeReturnsIssue");let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ft){let l=this;return J(async function(...u){let f=new le([]),g=await l._def.args.parseAsync(u,i).catch(E=>{throw f.addIssue(n(u,E)),f}),m=await Reflect.apply(o,this,g);return await l._def.returns._def.type.parseAsync(m,i).catch(E=>{throw f.addIssue(s(m,E)),f})})}else{let l=this;return J(function(...u){let f=l._def.args.safeParse(u,i);if(!f.success)throw new le([n(u,f.error)]);let g=Reflect.apply(o,this,f.data),m=l._def.returns.safeParse(g,i);if(!m.success)throw new le([s(g,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Re(p(c({},this._def),{args:je.create(e).rest(it.create())}))}returns(e){return new Re(p(c({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Re(c({args:e||je.create([]).rest(it.create()),returns:r||it.create(),typeName:"ZodFunction"},k(n)))}isEqual(e){return e instanceof Re&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};a(Fl,"ZodFunction");var gs=Fl;function br(t,e){let r=pe(t),n=pe(e);if(t===e)return{valid:!0,data:t};if(r===_.object&&n===_.object){let s=Z.objectKeys(e),i=Z.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o=c(c({},t),e);for(let l of i){let u=br(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(r===_.array&&n===_.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],l=e[i],u=br(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===_.date&&n===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(br,"mergeValues");var wr=class sr extends O{dereference(e){return new sr(p(c({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return me([...this._def.left.getReferences(),...this._def.right.getReferences()])}clone(){return new sr(p(c({},this._def),{left:this._def.left.clone(),right:this._def.right.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=a((i,o)=>{if(pr(i)||pr(o))return x;let l=br(i.value,o.value);return l.valid?((fr(i)||fr(o))&&r.dirty(),{status:r.value,value:l.data}):(v(n,{code:h.invalid_intersection_types}),x)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof sr))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K([this._def.left,this._def.right],{compare:r}),s=new K([e._def.left,e._def.right],{compare:r});return n.isEqual(s)}};a(wr,"ZodIntersection");wr.create=a((t,e,r)=>new wr(c({left:t,right:e,typeName:"ZodIntersection"},k(r))),"create");var ln=wr,Pr=class xt extends O{get schema(){return this._def.getter()}dereference(e){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().dereference(e),"getter")}))}getReferences(){return this._def.getter().getReferences()}clone(){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().clone(),"getter")}))}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof xt?this._def.getter().isEqual(e._def.getter()):!1}naked(){return this._def.getter().naked()}mandatory(){return new xt(p(c({},this._def),{getter:a(()=>this._def.getter().mandatory(),"getter")}))}};a(Pr,"ZodLazy");Pr.create=a((t,e)=>new Pr(c({getter:t,typeName:"ZodLazy"},k(e))),"create");var cn=Pr,xr=class Ll extends O{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return v(r,{received:r.data,code:h.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Ll?st(this._def.value,e._def.value):!1}};a(xr,"ZodLiteral");xr.create=a((t,e)=>new xr(c({value:t,typeName:"ZodLiteral"},k(e))),"create");var un=xr,kr=class ir extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ir(p(c({},this._def),{keyType:r,valueType:n}))}getReferences(){return me([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new ir(p(c({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return v(n,{code:h.invalid_type,expected:_.map,received:n.parsedType}),x;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,u],f)=>({key:s._parse(new ae(n,l,n.path,[f,"key"])),value:i._parse(new ae(n,u,n.path,[f,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of o){let f=await u.key,g=await u.value;if(f.status==="aborted"||g.status==="aborted")return x;(f.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(f.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of o){let f=u.key,g=u.value;if(f.status==="aborted"||g.status==="aborted")return x;(f.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(f.value,g.value)}return{status:r.value,value:l}}}isEqual(e){return!(!(e instanceof ir)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};a(kr,"ZodMap");kr.create=a((t,e,r)=>new kr(c({valueType:e,keyType:t,typeName:"ZodMap"},k(r))),"create");var hs=kr,Sr=class Wl extends O{_parse(e){if(this._getType(e)!==_.nan){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Wl}};a(Sr,"ZodNaN");Sr.create=a(t=>new Sr(c({typeName:"ZodNaN"},k(t))),"create");var ms=Sr,Or=class ql extends O{_parse(e){let r=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let s=Z.objectValues(r);return v(n,{expected:Z.joinValues(s),received:n.parsedType,code:h.invalid_type}),x}if(r.indexOf(e.data)===-1){let s=Z.objectValues(r);return v(n,{received:n.data,code:h.invalid_enum_value,options:s}),x}return J(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof ql?st(this._def.values,e._def.values):!1}};a(Or,"ZodNativeEnum");Or.create=a((t,e)=>new Or(c({values:t,typeName:"ZodNativeEnum"},k(e))),"create");var dn=Or,Er=class Vl extends O{_parse(e){let r=this._getOrReturnCtx(e);return v(r,{code:h.invalid_type,expected:_.never,received:r.parsedType}),x}isEqual(e){return e instanceof Vl}};a(Er,"ZodNever");Er.create=a(t=>new Er(c({typeName:"ZodNever"},k(t))),"create");var ft=Er,Zr=class Gl extends O{_parse(e){if(this._getType(e)!==_.null){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.null,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof Gl}};a(Zr,"ZodNull");Zr.create=a(t=>new Zr(c({typeName:"ZodNull"},k(t))),"create");var pn=Zr,Ir=class kt extends O{dereference(e){return new kt(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new kt(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===_.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof kt?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new kt(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Ir,"ZodNullable");Ir.create=a((t,e)=>new Ir(c({innerType:t,typeName:"ZodNullable"},k(e))),"create");var Ne=Ir;function Jl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}a(Jl,"floatSafeRemainder");var Br=class ar extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.number,received:i.parsedType}),x}let n,s=new te;for(let i of this._def.checks)i.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Jl(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_finite,message:i.message}),s.dirty()):Z.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new ar(p(c({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]}))}_addCheck(e){return new ar(p(c({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof ar))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}};a(Br,"ZodNumber");Br.create=a(t=>new Br(c({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},k(t))),"create");var fn=Br;function He(t){if(t instanceof $e){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fe.create(He(n))}return new $e(p(c({},t._def),{shape:a(()=>e,"shape")}))}else return t instanceof ut?new ut(p(c({},t._def),{type:He(t.element)})):t instanceof fe?fe.create(He(t.unwrap())):t instanceof Ne?Ne.create(He(t.unwrap())):t instanceof je?je.create(t.items.map(e=>He(e))):t}a(He,"deepPartialify");var be=class ne extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Z.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let s in r)n[s]=r[s].dereference(e);return new ne(p(c({},this._def),{shape:a(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return me(r)}clone(){let e={},r=this._def.shape();for(let[n,s]of Object.entries(r))e[n]=s.clone();return new ne(p(c({},this._def),{shape:a(()=>e,"shape")}))}_parse(e){if(this._getType(e)!==_.object){let g=this._getOrReturnCtx(e);return v(g,{code:h.invalid_type,expected:_.object,received:g.parsedType}),x}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(this._def.unknownKeys!=="strip")for(let g in s.data)o.includes(g)||l.push(g);let u=[];for(let g of o){let m=i[g],P=s.data[g];u.push({key:{status:"valid",value:g},value:m._parse(new ae(s,P,s.path,g)),alwaysSet:g in s.data})}let f=this._def.unknownKeys;if(f==="passthrough")for(let g of l)u.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(f==="strict")l.length>0&&(v(s,{code:h.unrecognized_keys,keys:l}),n.dirty());else if(f!=="strip")for(let g of l){let m=s.data[g];u.push({key:{status:"valid",value:g},value:f._parse(new ae(s,m,s.path,g)),alwaysSet:g in s.data})}return s.common.async?Promise.resolve().then(async()=>{let g=[];for(let m of u){let P=await m.key;g.push({key:P,value:await m.value,alwaysSet:m.alwaysSet})}return g}).then(g=>te.mergeObjectSync(n,g)):te.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new ne(c(p(c({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:a((r,n)=>{var s,i,o,l;let u=(o=(i=(s=this._def).errorMap)==null?void 0:i.call(s,r,n).message)!=null?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=w.errToObj(e).message)!=null?l:u}:{message:u}},"errorMap")}:{}))}strip(){return new ne(p(c({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ne(p(c({},this._def),{unknownKeys:"passthrough"}))}additionalProperties(){if(this._def.unknownKeys instanceof O)return this._def.unknownKeys;if(this._def.unknownKeys==="passthrough")return ct.create();if(this._def.unknownKeys==="strict")return ft.create()}extend(e){return new ne(p(c({},this._def),{shape:a(()=>c(c({},this._def.shape()),e),"shape")}))}merge(e){return new ne({unknownKeys:e._def.unknownKeys,shape:a(()=>c(c({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ne(p(c({},this._def),{unknownKeys:e}))}pick(e){let r={};return Z.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}omit(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}deepPartial(){return He(this)}partial(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s?.optional()}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}required(e){let r={};return Z.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof fe;)i=i._def.innerType;r[n]=i}}),new ne(p(c({},this._def),{shape:a(()=>r,"shape")}))}keyof(){return zt(Z.objectKeys(this.shape))}isEqual(e){if(!(e instanceof ne)||!this._unknownKeysEqual(e))return!1;let r=this._def.shape(),n=e._def.shape(),s=a((l,u)=>l[0]===u[0]&&l[1].isEqual(u[1]),"compare"),i=new K(Object.entries(r),{compare:s}),o=new K(Object.entries(n),{compare:s});return i.isEqual(o)}_unknownKeysEqual(e){let r=this.additionalProperties(),n=e.additionalProperties();return r===void 0||n===void 0?r===n:r.isEqual(n)}};a(be,"ZodObject");be.create=a((t,e)=>new be(c({shape:a(()=>t,"shape"),unknownKeys:"strip",typeName:"ZodObject"},k(e))),"create");be.strictCreate=a((t,e)=>new be(c({shape:a(()=>t,"shape"),unknownKeys:"strict",typeName:"ZodObject"},k(e))),"strictCreate");be.lazycreate=a((t,e)=>new be(c({shape:t,unknownKeys:"strip",typeName:"ZodObject"},k(e))),"lazycreate");var $e=be,Cr=class or extends O{dereference(e){return new or(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new or(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===_.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof or?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return this._def.innerType.mandatory()}};a(Cr,"ZodOptional");Cr.create=a((t,e)=>new Cr(c({innerType:t,typeName:"ZodOptional"},k(e))),"create");var fe=Cr,Xl=class St extends O{dereference(e){return new St(p(c({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return me([...this._def.in.getReferences(),...this._def.out.getReferences()])}clone(){return new St(p(c({},this._def),{in:this._def.in.clone(),out:this._def.out.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(r.dirty(),De(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?x:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new St({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof St)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};a(Xl,"ZodPipeline");var gn=Xl,Ar=class lr extends O{unwrap(){return this._def.type}dereference(e){return new lr(p(c({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new lr(p(c({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.promise&&r.common.async===!1)return v(r,{code:h.invalid_type,expected:_.promise,received:r.parsedType}),x;let n=r.parsedType===_.promise?r.data:Promise.resolve(r.data);return J(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof lr?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}};a(Ar,"ZodPromise");Ar.create=a((t,e)=>new Ar(c({type:t,typeName:"ZodPromise"},k(e))),"create");var Ft=Ar,Rr=class Ot extends O{dereference(e){return new Ot(p(c({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Ot(p(c({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){let r=this._def.innerType._parse(e);return lt(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Ot?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Ot(p(c({},this._def),{innerType:this._def.innerType.mandatory()}))}};a(Rr,"ZodReadonly");Rr.create=a((t,e)=>new Rr(c({innerType:t,typeName:"ZodReadonly"},k(e))),"create");var Lt=Rr,Yl=class et extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new et(p(c({},this._def),{keyType:r,valueType:n}))}getReferences(){return me([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new et(p(c({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return v(n,{code:h.invalid_type,expected:_.object,received:n.parsedType}),x;let s=[],i=this._def.keyType,o=this._def.valueType;for(let l in n.data)s.push({key:i._parse(new ae(n,l,n.path,l)),value:o._parse(new ae(n,n.data[l],n.path,l))});return n.common.async?te.mergeObjectAsync(r,s):te.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof O?new et(c({keyType:e,valueType:r,typeName:"ZodRecord"},k(n))):new et(c({keyType:X.create(),valueType:e,typeName:"ZodRecord"},k(r)))}isEqual(e){return!(!(e instanceof et)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};a(Yl,"ZodRecord");var ys=Yl,Hr=class Ql extends O{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return v(r,{code:h.unresolved_reference}),x}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Ql?this._def.uri===e._def.uri:!1}};a(Hr,"ZodRef");Hr.create=a(t=>new Hr({typeName:"ZodRef",uri:t}),"create");var vs=Hr,Dr=class tt extends O{dereference(e){return new tt(p(c({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}clone(){return new tt(p(c({},this._def),{valueType:this._def.valueType.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return v(n,{code:h.invalid_type,expected:_.set,received:n.parsedType}),x;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(v(n,{code:h.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(v(n,{code:h.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let f=new Set;for(let g of u){if(g.status==="aborted")return x;g.status==="dirty"&&r.dirty(),f.add(g.value)}return{status:r.value,value:f}}a(o,"finalizeSet");let l=[...n.data.values()].map((u,f)=>i._parse(new ae(n,u,n.path,f)));return n.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,r){return new tt(p(c({},this._def),{minSize:{value:e,message:w.toString(r)}}))}max(e,r){return new tt(p(c({},this._def),{maxSize:{value:e,message:w.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,s,i;if(!(e instanceof tt))return!1;let o=(r=this._def.minSize)==null?void 0:r.value,l=(n=e._def.minSize)==null?void 0:n.value;if(o!==l)return!1;let u=(s=this._def.maxSize)==null?void 0:s.value,f=(i=e._def.maxSize)==null?void 0:i.value;return u!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};a(Dr,"ZodSet");Dr.create=a((t,e)=>new Dr(c({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},k(e))),"create");var _s=Dr,Ts=/^c[^\s-]{8,}$/i,bs=/^[a-z][a-z0-9]*$/,ws=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ps=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xs=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ec="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tc=a(t=>t===ec,"isEmojiRegex"),An,ks=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Ss=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;function rc(t,e){return!!((e==="v4"||!e)&&ks.test(t)||(e==="v6"||!e)&&Ss.test(t))}a(rc,"isValidIP");var Mr=class rt extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:_.string,received:i.parsedType}),x}let n=new te,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?v(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&v(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")xs.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")An||(An=new RegExp(ec,"u")),An.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ps.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Ts.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")bs.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ws.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),v(s,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?El(i).test(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="ip"?rc(e.data,i.version)||(s=this._getOrReturnCtx(e,s),v(s,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):Z.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),c({validation:r,code:h.invalid_string},w.errToObj(n)))}_addCheck(e){return new rt(p(c({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(c({kind:"email"},w.errToObj(e)))}url(e){return this._addCheck(c({kind:"url"},w.errToObj(e)))}emoji(e){return this._addCheck(c({kind:"emoji"},w.errToObj(e)))}uuid(e){return this._addCheck(c({kind:"uuid"},w.errToObj(e)))}cuid(e){return this._addCheck(c({kind:"cuid"},w.errToObj(e)))}cuid2(e){return this._addCheck(c({kind:"cuid2"},w.errToObj(e)))}ulid(e){return this._addCheck(c({kind:"ulid"},w.errToObj(e)))}ip(e){return this._addCheck(c({kind:"ip"},w.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(c({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},w.errToObj(e?.message)))}regex(e,r){return this._addCheck(c({kind:"regex",regex:e},w.errToObj(r)))}includes(e,r){return this._addCheck(c({kind:"includes",value:e,position:r?.position},w.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(c({kind:"startsWith",value:e},w.errToObj(r)))}endsWith(e,r){return this._addCheck(c({kind:"endsWith",value:e},w.errToObj(r)))}min(e,r){return this._addCheck(c({kind:"min",value:e},w.errToObj(r)))}max(e,r){return this._addCheck(c({kind:"max",value:e},w.errToObj(r)))}length(e,r){return this._addCheck(c({kind:"length",value:e},w.errToObj(r)))}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[b]=p(c({},this._def[b]),{secret:!0}),this}toLowerCase(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new rt(p(c({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof rt))return!1;let r=new K(this._def.checks),n=new K(e._def.checks);return r.isEqual(n)}};a(Mr,"ZodString");Mr.create=a(t=>{var e;return new Mr(c({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},k(p(c({},t),{supportsExtensions:["secret"]}))))},"create");var X=Mr,Nr=class nc extends O{_parse(e){if(this._getType(e)!==_.symbol){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.symbol,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof nc}};a(Nr,"ZodSymbol");Nr.create=a(t=>new Nr(c({typeName:"ZodSymbol"},k(t))),"create");var Os=Nr,dt=class Et extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Et(p(c({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}clone(){return new Et(p(c({},this._def),{schema:this._def.schema.clone()}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a(o=>{v(n,o),o.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return x;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?x:u.status==="dirty"||r.value==="dirty"?De(u.value):u});{if(r.value==="aborted")return x;let l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?x:l.status==="dirty"||r.value==="dirty"?De(l.value):l}}if(s.type==="refinement"){let o=a(l=>{let u=s.refinement(l,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?x:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?x:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!lt(o))return o;let l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>lt(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:r.value,value:l})):o);Z.assertNever(s)}isEqual(e){return!(e instanceof Et)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:Z.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:Z.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:Z.compareFunctions(this._def.effect.transform,e._def.effect.transform):!1}naked(){return this._def.schema.naked()}mandatory(){return new Et(p(c({},this._def),{schema:this._def.schema.mandatory()}))}};a(dt,"ZodEffects");dt.create=a((t,e,r)=>new dt(c({schema:t,typeName:"ZodEffects",effect:e},k(r))),"create");dt.createWithPreprocess=a((t,e,r)=>new dt(c({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},k(r))),"createWithPreprocess");var we=dt,$r=class Zt extends O{dereference(e){let r=this._def.items.map(s=>s.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new Zt(p(c({},this._def),{items:r,rest:n}))}getReferences(){return me([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}clone(){let e=this._def.items.map(n=>n.clone()),r=this._def.rest?this._def.rest.clone():null;return new Zt(p(c({},this._def),{items:e,rest:r}))}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return v(n,{code:h.invalid_type,expected:_.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return v(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new ae(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>te.mergeArray(r,o)):te.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Zt(p(c({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Zt)||!this._restEquals(e))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K(this._def.items,{compare:r}),s=new K(e._def.items,{compare:r});return n.isEqual(s)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};a($r,"ZodTuple");$r.create=a((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $r(c({items:t,typeName:"ZodTuple",rest:null},k(e)))},"create");var je=$r,jr=class sc extends O{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.undefined,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof sc}mandatory(){return ft.create(c({},this._def))}};a(jr,"ZodUndefined");jr.create=a(t=>new jr(c({typeName:"ZodUndefined"},k(t))),"create");var Wt=jr,Kr=class It extends O{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new It(p(c({},this._def),{options:r}))}getReferences(){return me(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}clone(){let e=this._def.options.map(r=>r.clone());return new It(p(c({},this._def),{options:e}))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let o=i.map(l=>new le(l.ctx.common.issues));return v(r,{code:h.invalid_union,unionErrors:o}),x}if(a(s,"handleResults"),r.common.async)return Promise.all(n.map(async i=>{let o=p(c({},r),{common:p(c({},r.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let f=p(c({},r),{common:p(c({},r.common),{issues:[]}),parent:null}),g=u._parseSync({data:r.data,path:r.path,parent:f});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let l=o.map(u=>new le(u));return v(r,{code:h.invalid_union,unionErrors:l}),x}}get options(){return this._def.options}isEqual(e){if(!(e instanceof It))return!1;let r=a((i,o)=>i.isEqual(o),"compare"),n=new K([...this._def.options],{compare:r}),s=new K([...e._def.options],{compare:r});return n.isEqual(s)}mandatory(){let e=this._def.options.filter(i=>!(i instanceof Wt)).map(i=>i.mandatory()),[r,n,...s]=e;return r?n?new It(p(c({},this._def),{options:[r,n,...s]})):r:ft.create(c({},this._def))}};a(Kr,"ZodUnion");Kr.create=a((t,e)=>new Kr(c({options:t,typeName:"ZodUnion"},k(e))),"create");var hn=Kr,Ur=class ic extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}isEqual(e){return e instanceof ic}};a(Ur,"ZodUnknown");Ur.create=a(t=>new Ur(c({typeName:"ZodUnknown"},k(t))),"create");var it=Ur,zr=class ac extends O{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:_.void,received:n.parsedType}),x}return J(e.data)}isEqual(e){return e instanceof ac}};a(zr,"ZodVoid");zr.create=a(t=>new zr(c({typeName:"ZodVoid"},k(t))),"create");var Es=zr,sm=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],vv=Ve.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),oc=a(t=>X.create().displayAs({id:"variable",params:c({type:t?.type||"any"},t?.params)}),"variable"),lc=a(t=>X.create().displayAs({id:"conversation",params:c({},t?.params)}),"conversation"),cc=a(t=>X.create().displayAs({id:"user",params:c({},t?.params)}),"user"),uc=a(t=>X.create().displayAs({id:"message",params:c({},t?.params)}),"message"),dc=a(t=>X.create().displayAs({id:"agent",params:c({},t?.params)}),"agent"),pc=a(t=>X.create().displayAs({id:"event",params:c({},t?.params)}),"event"),fc=a(t=>X.create().displayAs({id:"table",params:c({},t?.params)}),"table"),gc=a(t=>X.create().displayAs({id:"tablerow",params:c({},t?.params)}),"tablerow"),hc=a(t=>X.create().displayAs({id:"intent",params:c({},t?.params)}),"intent"),mc=a(()=>Ve.create(sm).displayAs({id:"dropdown",params:{}}),"aimodel"),yc=a(t=>X.create().displayAs({id:"datasource",params:c({},t)}),"datasource"),vc=a(t=>X.create().displayAs({id:"knowledgebase",params:c({},t)}),"knowledgebase"),_c={object:$e.lazycreate},Tc=a((t,e={message:`Input not instance of ${t.name}`})=>ds(r=>r instanceof t,e),"instanceOfType"),Zs=X.create,Is=fn.create,bc=ms.create,wc=rn.create,Bs=nn.create,Pc=on.create,xc=Os.create,kc=Wt.create,Sc=pn.create,Oc=ct.create,Ec=it.create,Zc=ft.create,Ic=Es.create,Bc=ut.create,Cc=$e.create,Ac=$e.strictCreate,Rc=hn.create,Hc=ps.create,Dc=ln.create,Mc=je.create,Nc=ys.create,$c=vs.create,jc=Lt.create,Kc=hs.create,Uc=_s.create,zc=gs.create,Fc=cn.create,Lc=un.create,Wc=Ve.create,qc=dn.create,Vc=Ft.create,Fn=we.create,Gc=fe.create,Jc=Ne.create,im=Ut.create,Xc=we.createWithPreprocess,Yc=gn.create,Qc=a(()=>Zs().optional(),"ostring"),eu=a(()=>Is().optional(),"onumber"),tu=a(()=>Bs().optional(),"oboolean"),ru={string:a(t=>X.create(p(c({},t),{coerce:!0})),"string"),number:a(t=>fn.create(p(c({},t),{coerce:!0})),"number"),boolean:a(t=>nn.create(p(c({},t),{coerce:!0})),"boolean"),bigint:a(t=>rn.create(p(c({},t),{coerce:!0})),"bigint"),date:a(t=>on.create(p(c({},t),{coerce:!0})),"date")},nu=x,d=y,su=a((t,e)=>t.anyOf.length?t.anyOf.length===1?L(t.anyOf[0],p(c({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>L(r,p(c({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),am=a(t=>{var e;return(e=t[b])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),om=a(t=>"z.any()","parseDefault"),lm=a((t,e)=>`z.union([${t.type.map(r=>L(p(c({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),cm=a((t,e)=>`z.any().refine((value) => !${L(t.not,p(c({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),um=a(t=>"z.null()","parseNull"),dm=a(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),pm=a((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function G(t,e,r){var n;let s=t[e],i="";if(s!==void 0){let o=r({value:s,json:JSON.stringify(s)});if(o){let l=o[0],u=o.length===3?o[1]:"",f=o.length===3?o[2]:o[1];i+=l,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(i+=u+JSON.stringify(t.errorMessage[e])),i+=f}}return i}a(G,"withMessage");var Bt=Symbol("Original index"),fm=a(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[Bt]:r}:{[Bt]:r,not:{}});else{if(Bt in n)return t;e.push(p(c({},n),{[Bt]:r}))}}return e},"ensureOriginalIndex");function jt(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return L(r,p(c({},e),{path:[...e.path,"allOf",r[Bt]]}))}else{let[r,n]=dm(fm(t.allOf));return`z.intersection(${jt({allOf:r},e)}, ${jt({allOf:n},e)})`}}a(jt,"parseAllOf");var gm=a((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,s)=>L(n,p(c({},e),{path:[...e.path,"items",s]})))}])`;let r=t.items?`z.array(${L(t.items,p(c({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=G(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=G(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),hm=a(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),mm=a(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),ym=a((t,e)=>{let r=L(t.if,p(c({},e),{path:[...e.path,"if"]})),n=L(t.then,p(c({},e),{path:[...e.path,"then"]})),s=L(t.else,p(c({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${s}]).superRefine((value,ctx) => {
12
12
  const result = ${r}.safeParse(value).success
13
13
  ? ${n}.safeParse(value)
14
14
  : ${s}.safeParse(value);