@learncard/learn-cloud-plugin 2.2.3 → 2.2.4

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.
@@ -21,7 +21,7 @@ function print() { __p += __j.call(arguments, '') }
21
21
  `+new Array(k+1).join(s):"",q=s?": ":":";if(V=Xx(V),V=p.call(N,F,V),V!==void 0){if(!Gx(V)||V===null)return g(V);if(Jx(V)){let A=[];for(let X=0;X<V.length;X++){let Q=S(V,X,V[X],k+1)||g(null);A.push(R+s+Q)}return"["+A.join(",")+R+"]"}else{if(d){if(E.indexOf(V)!==-1)return g("[Circular]");E.push(V)}let A=Qx(V).sort(y&&y(V)),X=[];for(let Q=0;Q<A.length;Q++){let ne=A[Q],Se=S(V,ne,V[ne],k+1);if(!Se)continue;let be=g(ne)+q+Se;X.push(R+s+be)}return E.splice(E.indexOf(V),1),"{"+X.join(",")+R+"}"}}},"_deterministic")({"":n},"",n,0)}o(eE,"stringifyDeterministic");Up.exports=eE});var nE={};L_(nE,{getLearnCloudPlugin:()=>rE});module.exports=M_(nE);var zp=Ef(Tf());function rt(n){let r={subscribe(s){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return o(E,"unsubscribe"),d=n({next(S){p||s.next?.(S)},error(S){p||(p=!0,s.error?.(S),E())},complete(){p||(p=!0,s.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...s){return s.reduce(U_,r)}};return r}o(rt,"observable");function U_(n,r){return r(n)}o(U_,"pipeReducer");function nl(n){let r=new AbortController;return new Promise((d,p)=>{let g=!1;function y(){g||(g=!0,E.unsubscribe())}o(y,"onDone"),r.signal.addEventListener("abort",()=>{p(r.signal.reason)});let E=n.subscribe({next(S){g=!0,d(S),y()},error(S){p(S)},complete(){r.abort(),y()}})})}o(nl,"observableToPromise");function il(n){return r=>{let s=0,d=null,p=[];function g(){d||(d=r.subscribe({next(E){for(let S of p)S.next?.(E)},error(E){for(let S of p)S.error?.(E)},complete(){for(let E of p)E.complete?.()}}))}o(g,"startIfNeeded");function y(){if(s===0&&d){let E=d;d=null,E.unsubscribe()}}return o(y,"resetIfNeeded"),rt(E=>(s++,p.push(E),g(),{unsubscribe(){s--,y();let S=p.findIndex(N=>N===E);S>-1&&p.splice(S,1)}}))}}o(il,"share");var sE=Symbol();function Aa(n){let r=n,s=[],d=o(y=>{r!==void 0&&y.next(r),s.push(y)},"addObserver"),p=o(y=>{s.splice(s.indexOf(y),1)},"removeObserver"),g=rt(y=>(d(y),()=>{p(y)}));return g.next=y=>{if(r!==y){r=y;for(let E of s)E.next(y)}},g.get=()=>r,g}o(Aa,"behaviorSubject");function al(n){return rt(r=>{function s(p=0,g=n.op){let y=n.links[p];if(!y)throw new Error("No more links to execute - did you forget to add an ending link?");return y({op:g,next(S){return s(p+1,S)}})}return o(s,"execute"),s().subscribe(r)})}o(al,"createChain");var Sf=o(()=>{},"noop"),Cf=o(n=>{Object.freeze&&Object.freeze(n)},"freezeIfAvailable");function Rf(n,r,s){var d,p;let g=r.join(".");return(d=s)[p=g]??(d[p]=new Proxy(Sf,{get(y,E){if(!(typeof E!="string"||E==="then"))return Rf(n,[...r,E],s)},apply(y,E,S){let N=r[r.length-1],F={args:S,path:r};return N==="call"?F={args:S.length>=2?[S[1]]:[],path:r.slice(0,-1)}:N==="apply"&&(F={args:S.length>=2?S[1]:[],path:r.slice(0,-1)}),Cf(F.args),Cf(F.path),n(F)}})),s[g]}o(Rf,"createInnerProxy");var ka=o(n=>Rf(n,[],Object.create(null)),"createRecursiveProxy"),cc=o(n=>new Proxy(Sf,{get(r,s){if(s!=="then")return n(s)}}),"createFlatProxy");var Un=o(({shape:n})=>n,"defaultFormatter");var Bn={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var ol=[Bn.BAD_GATEWAY,Bn.SERVICE_UNAVAILABLE,Bn.GATEWAY_TIMEOUT,Bn.INTERNAL_SERVER_ERROR];var Of=Symbol();function ko(n,...r){let s=Object.assign(Object.create(null),n);for(let d of r)for(let p in d){if(p in s&&s[p]!==d[p])throw new Error(`Duplicate key ${p}`);s[p]=d[p]}return s}o(ko,"mergeWithoutOverrides");function qe(n){return!!n&&!Array.isArray(n)&&typeof n=="object"}o(qe,"isObject");function uc(n){return typeof n=="function"}o(uc,"isFunction");function Po(n){return Object.assign(Object.create(null),n)}o(Po,"omitPrototype");function kf(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(kf,"_define_property");var lc=class extends Error{};o(lc,"UnknownCauseError");function Pf(n){if(n instanceof Error)return n;let r=typeof n;if(!(r==="undefined"||r==="function"||n===null)){if(r!=="object")return new Error(String(n));if(qe(n))return Object.assign(new lc,n)}}o(Pf,"getCauseFromUnknown");function un(n){if(n instanceof at||n instanceof Error&&n.name==="TRPCError")return n;let r=new at({code:"INTERNAL_SERVER_ERROR",cause:n});return n instanceof Error&&n.stack&&(r.stack=n.stack),r}o(un,"getTRPCErrorFromUnknown");var at=class extends Error{constructor(r){let s=Pf(r.cause),d=r.message??s?.message??r.code;super(d,{cause:s}),kf(this,"cause",void 0),kf(this,"code",void 0),this.code=r.code,this.name="TRPCError",this.cause??(this.cause=s)}};o(at,"TRPCError");function sl(n){return"input"in n?n:{input:n,output:n}}o(sl,"getDataTransformer");var Zn={input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}};function z_(n,r){if("error"in n){let d=r.deserialize(n.error);return{ok:!1,error:{...n,error:d}}}let s={...n.result,...(!n.result.type||n.result.type==="data")&&{type:"data",data:r.deserialize(n.result.data)}};return{ok:!0,result:s}}o(z_,"transformResultInner");var Pa=class extends Error{constructor(){super("Unable to transform response from server")}};o(Pa,"TransformResultError");function Io(n,r){let s;try{s=z_(n,r)}catch{throw new Pa}if(!s.ok&&(!qe(s.error.error)||typeof s.error.error.code!="number"))throw new Pa;if(s.ok&&!qe(s.result))throw new Pa;return s}o(Io,"transformResult");var $_=Symbol("lazy");function W_(n){let r=Symbol(),s=r;return()=>(s===r&&(s=n()),s)}o(W_,"once");function H_(n){return typeof n=="function"&&$_ in n}o(H_,"isLazy");function G_(n){return qe(n)&&qe(n._def)&&"router"in n._def}o(G_,"isRouter");var J_={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Un,transformer:Zn},Y_=["then","call","apply"];function dc(n){function r(s){let d=new Set(Object.keys(s).filter(V=>Y_.includes(V)));if(d.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(d).join(", "));let p=Po({}),g=Po({});function y(V){return{ref:V.ref,load:W_(async()=>{let k=await V.ref(),R=[...V.path,V.key],q=R.join(".");V.aggregate[V.key]=E(k._def.record,R),delete g[q];for(let[A,X]of Object.entries(k._def.lazy)){let Q=[...R,A].join(".");g[Q]=y({ref:X.ref,path:R,key:A,aggregate:V.aggregate[V.key]})}})}}o(y,"createLazyLoader");function E(V,k=[]){let R=Po({});for(let[q,A]of Object.entries(V??{})){if(H_(A)){g[[...k,q].join(".")]=y({path:k,ref:A,key:q,aggregate:R});continue}if(G_(A)){R[q]=E(A._def.record,[...k,q]);continue}if(!K_(A)){R[q]=E(A,[...k,q]);continue}let X=[...k,q].join(".");if(p[X])throw new Error(`Duplicate key: ${X}`);p[X]=A,R[q]=A}return R}o(E,"step");let S=E(s),N={_config:n,router:!0,procedures:p,lazy:g,...J_,record:S};return{...S,_def:N,createCaller:fc()({_def:N})}}return o(r,"createRouterInner"),r}o(dc,"createRouterFactory");function K_(n){return typeof n=="function"}o(K_,"isProcedure");async function cl(n,r){let{_def:s}=n,d=s.procedures[r];for(;!d;){let p=Object.keys(s.lazy).find(y=>r.startsWith(y));if(!p)return null;await s.lazy[p].load(),d=s.procedures[r]}return d}o(cl,"getProcedureAtPath");function fc(){return o(function(r){let{_def:s}=r;return o(function(p,g){return ka(async({path:y,args:E})=>{let S=y.join(".");if(y.length===1&&y[0]==="_def")return s;let N=await cl(r,S),F;try{if(!N)throw new at({code:"NOT_FOUND",message:`No procedure found on path "${y}"`});return F=uc(p)?await Promise.resolve(p()):p,await N({path:S,getRawInput:async()=>E[0],ctx:F,type:N._def.type,signal:g?.signal})}catch(V){throw g?.onError?.({ctx:F,error:un(V),input:E[0],path:S,type:N?._def.type??"unknown"}),V}})},"createCaller")},"createCallerInner")}o(fc,"createCallerFactory");function ul(...n){let r=ko({},...n.map(g=>g._def.record)),s=n.reduce((g,y)=>{if(y._def._config.errorFormatter&&y._def._config.errorFormatter!==Un){if(g!==Un&&g!==y._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return y._def._config.errorFormatter}return g},Un),d=n.reduce((g,y)=>{if(y._def._config.transformer&&y._def._config.transformer!==Zn){if(g!==Zn&&g!==y._def._config.transformer)throw new Error("You seem to have several transformers");return y._def._config.transformer}return g},Zn);return dc({errorFormatter:s,transformer:d,isDev:n.every(g=>g._def._config.isDev),allowOutsideOfServer:n.every(g=>g._def._config.allowOutsideOfServer),isServer:n.every(g=>g._def._config.isServer),$types:n[0]?._def._config.$types})(r)}o(ul,"mergeRouters");var X_;X_=Symbol.toStringTag;var If,Nf;(If=Symbol).dispose??(If.dispose=Symbol());(Nf=Symbol).asyncDispose??(Nf.asyncDispose=Symbol());var dl=Symbol();var Df=Symbol("ping");var C0=Symbol();var hc="middlewareMarker";function yl(){function n(s){return{_middlewares:s,unstable_pipe(d){let p="_middlewares"in d?d._middlewares:[d];return n([...s,...p])}}}o(n,"createMiddlewareInner");function r(s){return n([s])}return o(r,"createMiddleware"),r}o(yl,"createMiddlewareFactory");function vl(n){let r=o(async function(d){let p,g=await d.getRawInput();try{p=await n(g)}catch(E){throw new at({code:"BAD_REQUEST",cause:E})}let y=qe(d.input)&&qe(p)?{...d.input,...p}:p;return d.next({input:y})},"inputValidatorMiddleware");return r._type="input",r}o(vl,"createInputMiddleware");function _l(n){let r=o(async function({next:d}){let p=await d();if(!p.ok)return p;try{let g=await n(p.data);return{...p,data:g}}catch(g){throw new at({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:g})}},"outputValidatorMiddleware");return r._type="output",r}o(_l,"createOutputMiddleware");function fb(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(fb,"_define_property");var Li=class extends Error{constructor(r){super(r[0]?.message),fb(this,"issues",void 0),this.name="SchemaError",this.issues=r}};o(Li,"StandardSchemaV1Error");function mc(n){let r=n,s="~standard"in r;if(typeof r=="function"&&typeof r.assert=="function")return r.assert.bind(r);if(typeof r=="function"&&!s)return r;if(typeof r.parseAsync=="function")return r.parseAsync.bind(r);if(typeof r.parse=="function")return r.parse.bind(r);if(typeof r.validateSync=="function")return r.validateSync.bind(r);if(typeof r.create=="function")return r.create.bind(r);if(typeof r.assert=="function")return d=>(r.assert(d),d);if(s)return async d=>{let p=await r["~standard"].validate(d);if(p.issues)throw new Li(p.issues);return p.value};throw new Error("Could not find a validator fn")}o(mc,"getParseFn");function qn(n,r){let{middlewares:s=[],inputs:d,meta:p,...g}=r;return gc({...ko(n,g),inputs:[...n.inputs,...d??[]],middlewares:[...n.middlewares,...s],meta:n.meta&&p?{...n.meta,...p}:p??n.meta})}o(qn,"createNewBuilder");function gc(n={}){let r={procedure:!0,inputs:[],middlewares:[],...n};return{_def:r,input(d){let p=mc(d);return qn(r,{inputs:[d],middlewares:[vl(p)]})},output(d){let p=mc(d);return qn(r,{output:d,middlewares:[_l(p)]})},meta(d){return qn(r,{meta:d})},use(d){let p="_middlewares"in d?d._middlewares:[d];return qn(r,{middlewares:p})},unstable_concat(d){return qn(r,d._def)},concat(d){return qn(r,d._def)},query(d){return bl({...r,type:"query"},d)},mutation(d){return bl({...r,type:"mutation"},d)},subscription(d){return bl({...r,type:"subscription"},d)},experimental_caller(d){return qn(r,{caller:d})}}}o(gc,"createBuilder");function bl(n,r){let s=qn(n,{resolver:r,middlewares:[o(async function(S){let N=await r(S);return{marker:hc,ok:!0,data:N,ctx:S.ctx}},"resolveMiddleware")]}),d={...s._def,type:n.type,experimental_caller:Boolean(s._def.caller),meta:s._def.meta,$types:null},p=hb(s._def),g=s._def.caller;if(!g)return p;let y=o(async(...E)=>await g({args:E,invoke:p,_def:d}),"callerWrapper");return y._def=d,y}o(bl,"createResolver");var pb=`
22
22
  This is a client-only function.
23
23
  If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
24
- `.trim();async function Uf(n,r,s){try{let d=r.middlewares[n];return await d({...s,meta:r.meta,input:s.input,next(g){let y=g;return Uf(n+1,r,{...s,ctx:y?.ctx?{...s.ctx,...y.ctx}:s.ctx,input:y&&"input"in y?y.input:s.input,getRawInput:y?.getRawInput??s.getRawInput})}})}catch(d){return{ok:!1,error:un(d),marker:hc}}}o(Uf,"callRecursive");function hb(n){async function r(s){if(!s||!("getRawInput"in s))throw new Error(pb);let d=await Uf(0,n,s);if(!d)throw new at({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!d.ok)throw d.error;return d.data}return o(r,"procedure"),r._def=n,r.procedure=!0,r.meta=n.meta,r}o(hb,"createProcedureCaller");var yc=typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var Mi=class{context(){return new Mi}meta(){return new Mi}create(r){let s={...r,transformer:sl(r?.transformer??Zn),isDev:r?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:r?.allowOutsideOfServer??!1,errorFormatter:r?.errorFormatter??Un,isServer:r?.isServer??yc,$types:null};if(!(r?.isServer??yc)&&r?.allowOutsideOfServer!==!0)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:s,procedure:gc({meta:r?.defaultMeta}),middleware:yl(),router:dc(s),mergeRouters:ul,createCallerFactory:fc()}}};o(Mi,"TRPCBuilder");var Bf=new Mi;function vc(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(vc,"_define_property");function wl(n){return n instanceof Ke}o(wl,"isTRPCClientError");function xb(n){return qe(n)&&qe(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}o(xb,"isTRPCErrorResponse");function Eb(n,r){return typeof n=="string"?n:qe(n)&&typeof n.message=="string"?n.message:r}o(Eb,"getMessageFromUnknownError");var Ke=class extends Error{static from(r,s={}){let d=r;return wl(d)?(s.meta&&(d.meta={...d.meta,...s.meta}),d):xb(d)?new Ke(d.error.message,{...s,result:d}):new Ke(Eb(d,"Unknown error"),{...s,cause:d})}constructor(r,s){let d=s?.cause;super(r,{cause:d}),vc(this,"cause",void 0),vc(this,"shape",void 0),vc(this,"data",void 0),vc(this,"meta",void 0),this.meta=s?.meta,this.cause=d,this.shape=s?.result?.error,this.data=s?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ke.prototype)}};o(Ke,"TRPCClientError");function xl(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(xl,"_define_property");var Ui=class{$request(r){return al({links:this.links,op:{...r,context:r.context??{},id:++this.requestId}}).pipe(il())}async requestAsPromise(r){try{let s=this.$request(r);return(await nl(s)).result.data}catch(s){throw Ke.from(s)}}query(r,s,d){return this.requestAsPromise({type:"query",path:r,input:s,context:d?.context,signal:d?.signal})}mutation(r,s,d){return this.requestAsPromise({type:"mutation",path:r,input:s,context:d?.context,signal:d?.signal})}subscription(r,s,d){return this.$request({type:"subscription",path:r,input:s,context:d.context,signal:d.signal}).subscribe({next(g){switch(g.result.type){case"state":{d.onConnectionStateChange?.(g.result);break}case"started":{d.onStarted?.({context:g.context});break}case"stopped":{d.onStopped?.();break}case"data":case void 0:{d.onData?.(g.result.data);break}}},error(g){d.onError?.(g)},complete(){d.onComplete?.()}})}constructor(r){xl(this,"links",void 0),xl(this,"runtime",void 0),xl(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=r.links.map(s=>s(this.runtime))}};o(Ui,"TRPCUntypedClient");var Tb=Symbol.for("trpc_untypedClient"),Cb={query:"query",mutate:"mutation",subscribe:"subscription"},zf=o(n=>Cb[n],"clientCallTypeToProcedureType");function $f(n){let r=ka(({path:s,args:d})=>{let p=[...s],g=zf(p.pop()),y=p.join(".");return n[g](y,...d)});return cc(s=>s===Tb?n:r[s])}o($f,"createTRPCClientProxy");function No(n){let r=new Ui(n);return $f(r)}o(No,"createTRPCClient");var Wf=o(n=>typeof n=="function","isFunction");function El(n){if(n)return n;if(typeof window<"u"&&Wf(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Wf(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}o(El,"getFetch");var Hf=o(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function _c(n){let r=null,s=null,d=o(()=>{clearTimeout(s),s=null,r=null},"destroyTimerAndPendingItems");function p(E){let S=[[]],N=0;for(;;){let F=E[N];if(!F)break;let V=S[S.length-1];if(F.aborted){F.reject?.(new Error("Aborted")),N++;continue}if(n.validate(V.concat(F).map(R=>R.key))){V.push(F),N++;continue}if(V.length===0){F.reject?.(new Error("Input is too big for a single dispatch")),N++;continue}S.push([])}return S}o(p,"groupItems");function g(){let E=p(r);d();for(let S of E){if(!S.length)continue;let N={items:S};for(let V of S)V.batch=N;n.fetch(N.items.map(V=>V.key)).then(async V=>{await Promise.all(V.map(async(k,R)=>{let q=N.items[R];try{let A=await Promise.resolve(k);q.resolve?.(A)}catch(A){q.reject?.(A)}q.batch=null,q.reject=null,q.resolve=null}));for(let k of N.items)k.reject?.(new Error("Missing result")),k.batch=null}).catch(V=>{for(let k of N.items)k.reject?.(V),k.batch=null})}}o(g,"dispatch");function y(E){let S={aborted:!1,key:E,batch:null,resolve:Hf,reject:Hf},N=new Promise((F,V)=>{S.reject=V,S.resolve=F,r??(r=[]),r.push(S)});return s??(s=setTimeout(g)),N}return o(y,"load"),{load:y}}o(_c,"dataLoader");function Tl(...n){let r=new AbortController,s=n.length,d=0,p=o(()=>{++d===s&&r.abort()},"onAbort");for(let g of n)g?.aborted?p():g?.addEventListener("abort",p,{once:!0});return r.signal}o(Tl,"allAbortSignals");function jo(n){let r=n;return r?"input"in r?r:{input:r,output:r}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}}o(jo,"getTransformer");function wc(n){return{url:n.url.toString(),fetch:n.fetch,transformer:jo(n.transformer),methodOverride:n.methodOverride}}o(wc,"resolveHTTPLinkOptions");function Sb(n){let r={};for(let s=0;s<n.length;s++){let d=n[s];r[s]=d}return r}o(Sb,"arrayToDict");var Rb={query:"GET",mutation:"POST",subscription:"PATCH"};function Gf(n){return"input"in n?n.transformer.input.serialize(n.input):Sb(n.inputs.map(r=>n.transformer.input.serialize(r)))}o(Gf,"getInput");var Na=o(n=>{let r=n.url.split("?"),d=r[0].replace(/\/$/,"")+"/"+n.path,p=[];if(r[1]&&p.push(r[1]),"inputs"in n&&p.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=Gf(n);g!==void 0&&n.methodOverride!=="POST"&&p.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return p.length&&(d+="?"+p.join("&")),d},"getUrl"),Jf=o(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let r=Gf(n);return r!==void 0?JSON.stringify(r):void 0},"getBody"),Cl=o(n=>Kf({...n,contentTypeHeader:"application/json",getUrl:Na,getBody:Jf}),"jsonHttpRequester"),bc=class extends Error{constructor(){let r="AbortError";super(r),this.name=r,this.message=r}};o(bc,"AbortError");var Ob=o(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new bc},"throwIfAborted");async function Yf(n){Ob(n.signal);let r=n.getUrl(n),s=n.getBody(n),{type:d}=n,p=await(async()=>{let y=await n.headers();return Symbol.iterator in y?Object.fromEntries(y):y})(),g={...n.contentTypeHeader?{"content-type":n.contentTypeHeader}:{},...n.trpcAcceptHeader?{"trpc-accept":n.trpcAcceptHeader}:void 0,...p};return El(n.fetch)(r,{method:n.methodOverride??Rb[d],signal:n.signal,body:s,headers:g})}o(Yf,"fetchHTTPResponse");async function Kf(n){let r={},s=await Yf(n);r.response=s;let d=await s.json();return r.responseJSON=d,{json:d,meta:r}}o(Kf,"httpRequest");function xc(n){let r=wc(n),s=n.maxURLLength??1/0,d=n.maxItems??1/0;return()=>{let p=o(S=>({validate(N){if(s===1/0&&d===1/0)return!0;if(N.length>d)return!1;let F=N.map(R=>R.path).join(","),V=N.map(R=>R.input);return Na({...r,type:S,path:F,inputs:V,signal:null}).length<=s},async fetch(N){let F=N.map(X=>X.path).join(","),V=N.map(X=>X.input),k=Tl(...N.map(X=>X.signal)),R=await Cl({...r,path:F,inputs:V,type:S,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:N}):n.headers:{}},signal:k});return(Array.isArray(R.json)?R.json:N.map(()=>R.json)).map(X=>({meta:R.meta,json:X}))}}),"batchLoader"),g=_c(p("query")),y=_c(p("mutation")),E={query:g,mutation:y};return({op:S})=>rt(N=>{if(S.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let V=E[S.type].load(S),k;return V.then(R=>{k=R;let q=Io(R.json,r.transformer.output);if(!q.ok){N.error(Ke.from(q.error,{meta:R.meta}));return}N.next({context:R.meta,result:q.result}),N.complete()}).catch(R=>{N.error(Ke.from(R,{meta:k?.meta}))}),()=>{}})}}o(xc,"httpBatchLink");var Ec=o((n,...r)=>typeof n=="function"?n(...r):n,"resultOf");function Sl(){let n,r;return{promise:new Promise((d,p)=>{n=d,r=p}),resolve:n,reject:r}}o(Sl,"withResolvers");async function Xf(n){let r=await Ec(n.url);if(!n.connectionParams)return r;let d=`${r.includes("?")?"&":"?"}connectionParams=1`;return r+d}o(Xf,"prepareUrl");async function ep(n){let r={method:"connectionParams",data:await Ec(n)};return JSON.stringify(r)}o(ep,"buildConnectionMessage");function Bi(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(Bi,"_define_property");function Pb(n){let{promise:r,resolve:s,reject:d}=Sl();return n.addEventListener("open",()=>{n.removeEventListener("error",d),s()}),n.addEventListener("error",d),r}o(Pb,"asyncWsOpen");function Ib(n,{intervalMs:r,pongTimeoutMs:s}){let d,p;function g(){d=setTimeout(()=>{n.send("PING"),p=setTimeout(()=>{n.close()},s)},r)}o(g,"start");function y(){clearTimeout(d),g()}o(y,"reset");function E(){clearTimeout(p),y()}o(E,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:S})=>{clearTimeout(d),g(),S==="PONG"&&E()}),n.addEventListener("close",()=>{clearTimeout(d),clearTimeout(p)})}o(Ib,"setupPingInterval");var Fn=class{get ws(){return this.wsObservable.get()}set ws(r){this.wsObservable.next(r)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Fn.connectCount;let r=Xf(this.urlOptions).then(s=>new this.WebSocketPonyfill(s));this.openPromise=r.then(async s=>{this.ws=s,s.addEventListener("message",function({data:d}){d==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Ib(s,this.keepAliveOpts),s.addEventListener("close",()=>{this.ws===s&&(this.ws=null)}),await Pb(s),this.urlOptions.connectionParams&&s.send(await ep(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(r){if(Bi(this,"id",++Fn.connectCount),Bi(this,"WebSocketPonyfill",void 0),Bi(this,"urlOptions",void 0),Bi(this,"keepAliveOpts",void 0),Bi(this,"wsObservable",Aa(null)),Bi(this,"openPromise",null),this.WebSocketPonyfill=r.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=r.urlOptions,this.keepAliveOpts=r.keepAlive}};o(Fn,"WsConnection");Bi(Fn,"connectCount",0);function jb(n){return n}o(jb,"identity");function Vb(n){return n.length===0?jb:n.length===1?n[0]:o(function(s){return n.reduce((d,p)=>p(d),s)},"piped")}o(Vb,"pipeFromArray");function Rl(n){let r={subscribe(s){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return o(E,"unsubscribe"),d=n({next(S){p||s.next?.(S)},error(S){p||(p=!0,s.error?.(S),E())},complete(){p||(p=!0,s.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...s){return Vb(s)(r)}};return r}o(Rl,"observable");var Db=Object.defineProperty,Tc=o((n,r)=>Db(n,"name",{value:r,configurable:!0}),"__name"),Lb=Tc(n=>()=>({next:r,op:s})=>Rl(d=>{let p=null,g=0,y=!1,E=Tc(()=>{g+=1,p?.unsubscribe(),p=r(s).subscribe({error:async S=>{if(g>5||S.data?.httpStatus!==401)return d.error(S);await n(),E()},next:S=>d.next(S),complete:()=>{y&&d.complete()}})},"attempt");return E(),()=>{y=!0,p?.unsubscribe()}}),"callbackLink"),rp=Tc(async(n,r)=>{let s=[],d=No({links:[xc({methodOverride:"POST",url:n,maxURLLength:3072,maxItems:50,headers:{Authorization:`Bearer ${await r()}`}})]}),p=Tc(async(y=95+Math.round((Math.random()-.5)*5))=>d.utilities.getChallenges.query({amount:y}),"getChallenges");return p().then(y=>s=y),No({links:[Lb(async()=>{s=await p()}),xc({methodOverride:"POST",url:n,maxItems:50,maxURLLength:3072,headers:async()=>(s.length===0&&s.push(...await p()),{Authorization:`Bearer ${await r(s.pop())}`})})]})},"getClient");var Mb=Object.create,Ol=Object.defineProperty,Ub=Object.getOwnPropertyDescriptor,np=Object.getOwnPropertyNames,Bb=Object.getPrototypeOf,Zb=Object.prototype.hasOwnProperty,K=o((n,r)=>Ol(n,"name",{value:r,configurable:!0}),"__name"),ip=o((n,r)=>o(function(){return r||(0,n[np(n)[0]])((r={exports:{}}).exports,r),r.exports},"__require"),"__commonJS"),qb=o((n,r,s,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of np(r))!Zb.call(n,p)&&p!==s&&Ol(n,p,{get:()=>r[p],enumerable:!(d=Ub(r,p))||d.enumerable});return n},"__copyProps"),Fb=o((n,r,s)=>(s=n!=null?Mb(Bb(n)):{},qb(r||!n||!n.__esModule?Ol(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),zb=ip({"../learn-card-types/dist/types.cjs.development.js"(n,r){"use strict";var s=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=K((a,f)=>s(a,"name",{value:f,configurable:!0}),"__name"),E=K((a,f)=>{for(var m in f)s(a,m,{get:f[m],enumerable:!0})},"__export"),S=K((a,f,m,w)=>{if(f&&typeof f=="object"||typeof f=="function")for(let b of p(f))!g.call(a,b)&&b!==m&&s(a,b,{get:()=>f[b],enumerable:!(w=d(f,b))||w.enumerable});return a},"__copyProps"),N=K(a=>S(s({},"__esModule",{value:!0}),a),"__toCommonJS"),F={};E(F,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Ri,AchievementCredentialValidator:()=>Jc,AchievementCriteriaValidator:()=>Gc,AchievementSubjectValidator:()=>ha,AchievementTypeValidator:()=>no,AchievementValidator:()=>pa,AddressValidator:()=>je,AlignmentTargetTypeValidator:()=>hs,AlignmentValidator:()=>Xe,AuthGrantQueryValidator:()=>ba,AuthGrantStatusValidator:()=>Is,AuthGrantValidator:()=>uu,AutoBoostConfigValidator:()=>Re,BoostPermissionsQueryValidator:()=>xi,BoostPermissionsValidator:()=>Yt,BoostQueryValidator:()=>nu,BoostRecipientValidator:()=>Rs,BoostRecipientWithChildrenValidator:()=>dr,BoostValidator:()=>Ss,ClaimHookQueryValidator:()=>ru,ClaimHookTypeValidator:()=>ga,ClaimHookValidator:()=>Cs,ClaimTokenValidator:()=>vo,ConsentFlowContractDataForDidValidator:()=>Os,ConsentFlowContractDataValidator:()=>ft,ConsentFlowContractDetailsValidator:()=>Ti,ConsentFlowContractQueryValidator:()=>su,ConsentFlowContractValidator:()=>Ae,ConsentFlowDataForDidQueryValidator:()=>va,ConsentFlowDataQueryValidator:()=>As,ConsentFlowTermValidator:()=>An,ConsentFlowTermsQueryValidator:()=>ks,ConsentFlowTermsStatusValidator:()=>ze,ConsentFlowTermsValidator:()=>kn,ConsentFlowTransactionActionValidator:()=>_a,ConsentFlowTransactionValidator:()=>Pn,ConsentFlowTransactionsQueryValidator:()=>cu,ContactMethodCreateValidator:()=>js,ContactMethodQueryValidator:()=>go,ContactMethodValidator:()=>mo,ContactMethodVerificationRequestValidator:()=>du,ContactMethodVerificationValidator:()=>We,ContextValidator:()=>yi,ContractCredentialValidator:()=>Ci,CredentialInfoValidator:()=>ws,CredentialRecordValidator:()=>Yc,CredentialSchemaValidator:()=>Ja,CredentialStatusValidator:()=>_i,CredentialSubjectValidator:()=>ca,CriteriaValidator:()=>ur,DidDocumentValidator:()=>dt,EncryptedCredentialRecordValidator:()=>ot,EncryptedRecordValidator:()=>so,EndorsementCredentialValidator:()=>da,EndorsementSubjectValidator:()=>bi,EvidenceValidator:()=>wi,FlatAuthGrantValidator:()=>lu,FullClaimHookValidator:()=>Kr,GeoCoordinatesValidator:()=>fs,IdentifierEntryValidator:()=>Ga,IdentifierTypeValidator:()=>Ie,IdentityObjectValidator:()=>ys,ImageValidator:()=>vi,InboxCredentialQueryValidator:()=>Ds,InboxCredentialValidator:()=>Vs,IssueInboxCredentialResponseValidator:()=>Ai,IssueInboxCredentialValidator:()=>yo,IssueInboxSigningAuthorityValidator:()=>Ls,JWERecipientHeaderValidator:()=>Xa,JWERecipientValidator:()=>eo,JWEValidator:()=>to,JWKValidator:()=>nt,JWKWithPrivateKeyValidator:()=>ps,KnownAchievementTypeValidator:()=>ms,LCNBoostClaimLinkOptionsValidator:()=>j,LCNBoostClaimLinkSigningAuthorityValidator:()=>D,LCNBoostStatus:()=>Ei,LCNInboxContactMethodValidator:()=>po,LCNInboxStatusEnumValidator:()=>Pr,LCNNotificationDataValidator:()=>In,LCNNotificationInboxValidator:()=>ho,LCNNotificationMessageValidator:()=>fo,LCNNotificationTypeEnumValidator:()=>Si,LCNNotificationValidator:()=>Qr,LCNProfileConnectionStatusEnum:()=>Xc,LCNProfileDisplayValidator:()=>Es,LCNProfileManagerQueryValidator:()=>tu,LCNProfileManagerValidator:()=>Ar,LCNProfileQueryValidator:()=>Kc,LCNProfileValidator:()=>Jt,LCNSigningAuthorityForUserValidator:()=>fe,LCNSigningAuthorityValidator:()=>G,PaginatedBoostRecipientsValidator:()=>au,PaginatedBoostRecipientsWithChildrenValidator:()=>C,PaginatedBoostsValidator:()=>iu,PaginatedClaimHooksValidator:()=>Dt,PaginatedConsentFlowContractsValidator:()=>ou,PaginatedConsentFlowDataForDidValidator:()=>On,PaginatedConsentFlowDataValidator:()=>ya,PaginatedConsentFlowTermsValidator:()=>Oe,PaginatedConsentFlowTransactionsValidator:()=>kr,PaginatedContractCredentialsValidator:()=>Ps,PaginatedEncryptedCredentialRecordsValidator:()=>co,PaginatedEncryptedRecordsValidator:()=>xs,PaginatedInboxCredentialsValidator:()=>fu,PaginatedLCNProfileManagersValidator:()=>eu,PaginatedLCNProfilesAndManagersValidator:()=>lo,PaginatedLCNProfilesValidator:()=>Qc,PaginationOptionsValidator:()=>oo,PaginationResponseValidator:()=>Ye,ProfileValidator:()=>Sn,ProofValidator:()=>lt,RefreshServiceValidator:()=>Ya,RegExpValidator:()=>uo,RelatedValidator:()=>Ve,ResultDescriptionValidator:()=>gs,ResultStatusTypeValidator:()=>vs,ResultTypeValidator:()=>lr,ResultValidator:()=>_s,RubricCriterionValidator:()=>fa,SentCredentialInfoValidator:()=>Ts,ServiceValidator:()=>ro,SetPrimaryContactMethodValidator:()=>et,StringQuery:()=>Te,TermsOfUseValidator:()=>ua,UnsignedAchievementCredentialValidator:()=>Yr,UnsignedVCValidator:()=>Be,UnsignedVPValidator:()=>Qa,VC2EvidenceValidator:()=>Ka,VCValidator:()=>Gt,VPValidator:()=>la,VerificationCheckValidator:()=>bs,VerificationItemValidator:()=>ao,VerificationMethodValidator:()=>cr,VerificationStatusEnum:()=>io,VerificationStatusValidator:()=>ma}),r.exports=N(F);var V;(function(a){a.assertEqual=b=>b;function f(b){}o(f,"assertIs"),K(f,"assertIs"),y(f,"assertIs"),a.assertIs=f;function m(b){throw new Error}o(m,"assertNever"),K(m,"assertNever"),y(m,"assertNever"),a.assertNever=m,a.arrayToEnum=b=>{let I={};for(let P of b)I[P]=P;return I},a.getValidEnumValues=b=>{let I=a.objectKeys(b).filter(Z=>typeof b[b[Z]]!="number"),P={};for(let Z of I)P[Z]=b[Z];return a.objectValues(P)},a.objectValues=b=>a.objectKeys(b).map(function(I){return b[I]}),a.objectKeys=typeof Object.keys=="function"?b=>Object.keys(b):b=>{let I=[];for(let P in b)Object.prototype.hasOwnProperty.call(b,P)&&I.push(P);return I},a.find=(b,I)=>{for(let P of b)if(I(P))return P},a.isInteger=typeof Number.isInteger=="function"?b=>Number.isInteger(b):b=>typeof b=="number"&&isFinite(b)&&Math.floor(b)===b;function w(b,I=" | "){return b.map(P=>typeof P=="string"?`'${P}'`:P).join(I)}o(w,"joinValues"),K(w,"joinValues"),y(w,"joinValues"),a.joinValues=w,a.jsonStringifyReplacer=(b,I)=>typeof I=="bigint"?I.toString():I})(V||(V={}));var k;(function(a){a.mergeShapes=(f,m)=>({...f,...m})})(k||(k={}));var R=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),q=y(a=>{switch(typeof a){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(a)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(a)?R.array:a===null?R.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?R.promise:typeof Map<"u"&&a instanceof Map?R.map:typeof Set<"u"&&a instanceof Set?R.set:typeof Date<"u"&&a instanceof Date?R.date:R.object;default:return R.unknown}},"getParsedType"),A=V.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"]),X=y(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Q=K(class extends Error{constructor(a){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};let f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=a}get errors(){return this.issues}format(a){let f=a||function(b){return b.message},m={_errors:[]},w=y(b=>{for(let I of b.issues)if(I.code==="invalid_union")I.unionErrors.map(w);else if(I.code==="invalid_return_type")w(I.returnTypeError);else if(I.code==="invalid_arguments")w(I.argumentsError);else if(I.path.length===0)m._errors.push(f(I));else{let P=m,Z=0;for(;Z<I.path.length;){let U=I.path[Z];Z===I.path.length-1?(P[U]=P[U]||{_errors:[]},P[U]._errors.push(f(I))):P[U]=P[U]||{_errors:[]},P=P[U],Z++}}},"processError");return w(this),m}static assert(a){if(!(a instanceof Q))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=f=>f.message){let f={},m=[];for(let w of this.issues)w.path.length>0?(f[w.path[0]]=f[w.path[0]]||[],f[w.path[0]].push(a(w))):m.push(a(w));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}},"ZodError");y(Q,"ZodError"),Q.create=a=>new Q(a);var ne=y((a,f)=>{let m;switch(a.code){case A.invalid_type:a.received===R.undefined?m="Required":m=`Expected ${a.expected}, received ${a.received}`;break;case A.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(a.expected,V.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:m=`Unrecognized key(s) in object: ${V.joinValues(a.keys,", ")}`;break;case A.invalid_union:m="Invalid input";break;case A.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${V.joinValues(a.options)}`;break;case A.invalid_enum_value:m=`Invalid enum value. Expected ${V.joinValues(a.options)}, received '${a.received}'`;break;case A.invalid_arguments:m="Invalid function arguments";break;case A.invalid_return_type:m="Invalid function return type";break;case A.invalid_date:m="Invalid date";break;case A.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(m=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(m=`${m} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?m=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?m=`Invalid input: must end with "${a.validation.endsWith}"`:V.assertNever(a.validation):a.validation!=="regex"?m=`Invalid ${a.validation}`:m="Invalid";break;case A.too_small:a.type==="array"?m=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?m=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?m=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?m=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:m="Invalid input";break;case A.too_big:a.type==="array"?m=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?m=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?m=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?m=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?m=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:m="Invalid input";break;case A.custom:m="Invalid input";break;case A.invalid_intersection_types:m="Intersection results could not be merged";break;case A.not_multiple_of:m=`Number must be a multiple of ${a.multipleOf}`;break;case A.not_finite:m="Number must be finite";break;default:m=f.defaultError,V.assertNever(a)}return{message:m}},"errorMap"),Se=ne;function be(a){Se=a}o(be,"setErrorMap"),K(be,"setErrorMap"),y(be,"setErrorMap");function Ne(){return Se}o(Ne,"getErrorMap"),K(Ne,"getErrorMap"),y(Ne,"getErrorMap");var Ue=y(a=>{let{data:f,path:m,errorMaps:w,issueData:b}=a,I=[...m,...b.path||[]],P={...b,path:I};if(b.message!==void 0)return{...b,path:I,message:b.message};let Z="",U=w.filter(le=>!!le).slice().reverse();for(let le of U)Z=le(P,{data:f,defaultError:Z}).message;return{...b,path:I,message:Z}},"makeIssue"),Ur=[];function $(a,f){let m=Ne(),w=Ue({issueData:f,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,m,m===ne?void 0:ne].filter(b=>!!b)});a.common.issues.push(w)}o($,"addIssueToContext"),K($,"addIssueToContext"),y($,"addIssueToContext");var Je=K(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(a,f){let m=[];for(let w of f){if(w.status==="aborted")return re;w.status==="dirty"&&a.dirty(),m.push(w.value)}return{status:a.value,value:m}}static async mergeObjectAsync(a,f){let m=[];for(let w of f){let b=await w.key,I=await w.value;m.push({key:b,value:I})}return Je.mergeObjectSync(a,m)}static mergeObjectSync(a,f){let m={};for(let w of f){let{key:b,value:I}=w;if(b.status==="aborted"||I.status==="aborted")return re;b.status==="dirty"&&a.dirty(),I.status==="dirty"&&a.dirty(),b.value!=="__proto__"&&(typeof I.value<"u"||w.alwaysSet)&&(m[b.value]=I.value)}return{status:a.value,value:m}}},"ParseStatus");y(Je,"ParseStatus");var re=Object.freeze({status:"aborted"}),$t=y(a=>({status:"dirty",value:a}),"DIRTY"),Fe=y(a=>({status:"valid",value:a}),"OK"),br=y(a=>a.status==="aborted","isAborted"),mn=y(a=>a.status==="dirty","isDirty"),Ot=y(a=>a.status==="valid","isValid"),vt=y(a=>typeof Promise<"u"&&a instanceof Promise,"isAsync");function gn(a,f,m,w){if(m==="a"&&!w)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?a!==f||!w:!f.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?w:m==="a"?w.call(a):w?w.value:f.get(a)}o(gn,"__classPrivateFieldGet"),K(gn,"__classPrivateFieldGet"),y(gn,"__classPrivateFieldGet");function Br(a,f,m,w,b){if(w==="m")throw new TypeError("Private method is not writable");if(w==="a"&&!b)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?a!==f||!b:!f.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return w==="a"?b.call(a,m):b?b.value=m:f.set(a,m),m}o(Br,"__classPrivateFieldSet"),K(Br,"__classPrivateFieldSet"),y(Br,"__classPrivateFieldSet");var Y;(function(a){a.errToObj=f=>typeof f=="string"?{message:f}:f||{},a.toString=f=>typeof f=="string"?f:f?.message})(Y||(Y={}));var ai,oi,At=K(class{constructor(a,f,m,w){this._cachedPath=[],this.parent=a,this.data=f,this._path=m,this._key=w}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}},"ParseInputLazyPath");y(At,"ParseInputLazyPath");var Zr=y((a,f)=>{if(Ot(f))return{success:!0,data:f.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let m=new Q(a.common.issues);return this._error=m,this._error}}},"handleResult");function ce(a){if(!a)return{};let{errorMap:f,invalid_type_error:m,required_error:w,description:b}=a;if(f&&(m||w))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return f?{errorMap:f,description:b}:{errorMap:y((P,Z)=>{var U,le;let{message:De}=a;return P.code==="invalid_enum_value"?{message:De??Z.defaultError}:typeof Z.data>"u"?{message:(U=De??w)!==null&&U!==void 0?U:Z.defaultError}:P.code!=="invalid_type"?{message:Z.defaultError}:{message:(le=De??m)!==null&&le!==void 0?le:Z.defaultError}},"customMap"),description:b}}o(ce,"processCreateParams"),K(ce,"processCreateParams"),y(ce,"processCreateParams");var pe=K(class{constructor(a){this.spa=this.safeParseAsync,this._def=a,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._def.description}_getType(a){return q(a.data)}_getOrReturnCtx(a,f){return f||{common:a.parent.common,data:a.data,parsedType:q(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new Je,ctx:{common:a.parent.common,data:a.data,parsedType:q(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){let f=this._parse(a);if(vt(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(a){let f=this._parse(a);return Promise.resolve(f)}parse(a,f){let m=this.safeParse(a,f);if(m.success)return m.data;throw m.error}safeParse(a,f){var m;let w={common:{issues:[],async:(m=f?.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f?.errorMap},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:q(a)},b=this._parseSync({data:a,path:w.path,parent:w});return Zr(w,b)}async parseAsync(a,f){let m=await this.safeParseAsync(a,f);if(m.success)return m.data;throw m.error}async safeParseAsync(a,f){let m={common:{issues:[],contextualErrorMap:f?.errorMap,async:!0},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:q(a)},w=this._parse({data:a,path:m.path,parent:m}),b=await(vt(w)?w:Promise.resolve(w));return Zr(m,b)}refine(a,f){let m=y(w=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(w):f,"getIssueProperties");return this._refinement((w,b)=>{let I=a(w),P=y(()=>b.addIssue({code:A.custom,...m(w)}),"setError");return typeof Promise<"u"&&I instanceof Promise?I.then(Z=>Z?!0:(P(),!1)):I?!0:(P(),!1)})}refinement(a,f){return this._refinement((m,w)=>a(m)?!0:(w.addIssue(typeof f=="function"?f(m,w):f),!1))}_refinement(a){return new bt({schema:this,typeName:ie.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}optional(){return Vt.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return Hr.create(this,this._def)}or(a){return $r.create([this,a],this._def)}and(a){return _n.create(this,a,this._def)}transform(a){return new bt({...ce(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:a}})}default(a){let f=typeof a=="function"?a:()=>a;return new xn({...ce(this._def),innerType:this,defaultValue:f,typeName:ie.ZodDefault})}brand(){return new na({typeName:ie.ZodBranded,type:this,...ce(this._def)})}catch(a){let f=typeof a=="function"?a:()=>a;return new Gr({...ce(this._def),innerType:this,catchValue:f,typeName:ie.ZodCatch})}describe(a){let f=this.constructor;return new f({...this._def,description:a})}pipe(a){return mi.create(this,a)}readonly(){return En.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(pe,"ZodType");var si=/^c[^\s-]{8,}$/i,ci=/^[0-9a-z]+$/,Nc=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qi=/^[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,Xi=/^[a-z0-9_-]{21}$/i,zo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ui="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Za,nr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$o=/^(([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})))$/,jc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Pt=new RegExp(`^${yn}$`);function wr(a){let f="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?f=`${f}\\.\\d{${a.precision}}`:a.precision==null&&(f=`${f}(\\.\\d+)?`),f}o(wr,"timeRegexSource"),K(wr,"timeRegexSource"),y(wr,"timeRegexSource");function vn(a){return new RegExp(`^${wr(a)}$`)}o(vn,"timeRegex"),K(vn,"timeRegex"),y(vn,"timeRegex");function ea(a){let f=`${yn}T${wr(a)}`,m=[];return m.push(a.local?"Z?":"Z"),a.offset&&m.push("([+-]\\d{2}:?\\d{2})"),f=`${f}(${m.join("|")})`,new RegExp(`^${f}$`)}o(ea,"datetimeRegex"),K(ea,"datetimeRegex"),y(ea,"datetimeRegex");function qr(a,f){return!!((f==="v4"||!f)&&nr.test(a)||(f==="v6"||!f)&&$o.test(a))}o(qr,"isValidIP"),K(qr,"isValidIP"),y(qr,"isValidIP");var It=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==R.string){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.string,received:b.parsedType}),re}let m=new Je,w;for(let b of this._def.checks)if(b.kind==="min")a.data.length<b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="max")a.data.length>b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="length"){let I=a.data.length>b.value,P=a.data.length<b.value;(I||P)&&(w=this._getOrReturnCtx(a,w),I?$(w,{code:A.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}):P&&$(w,{code:A.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}),m.dirty())}else if(b.kind==="email")kt.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"email",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="emoji")Za||(Za=new RegExp(ui,"u")),Za.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"emoji",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="uuid")Qi.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"uuid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="nanoid")Xi.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"nanoid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid")si.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"cuid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid2")ci.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"cuid2",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="ulid")Nc.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"ulid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="url")try{new URL(a.data)}catch{w=this._getOrReturnCtx(a,w),$(w,{validation:"url",code:A.invalid_string,message:b.message}),m.dirty()}else b.kind==="regex"?(b.regex.lastIndex=0,b.regex.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"regex",code:A.invalid_string,message:b.message}),m.dirty())):b.kind==="trim"?a.data=a.data.trim():b.kind==="includes"?a.data.includes(b.value,b.position)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),m.dirty()):b.kind==="toLowerCase"?a.data=a.data.toLowerCase():b.kind==="toUpperCase"?a.data=a.data.toUpperCase():b.kind==="startsWith"?a.data.startsWith(b.value)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{startsWith:b.value},message:b.message}),m.dirty()):b.kind==="endsWith"?a.data.endsWith(b.value)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{endsWith:b.value},message:b.message}),m.dirty()):b.kind==="datetime"?ea(b).test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"datetime",message:b.message}),m.dirty()):b.kind==="date"?Pt.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"date",message:b.message}),m.dirty()):b.kind==="time"?vn(b).test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"time",message:b.message}),m.dirty()):b.kind==="duration"?zo.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"duration",code:A.invalid_string,message:b.message}),m.dirty()):b.kind==="ip"?qr(a.data,b.version)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"ip",code:A.invalid_string,message:b.message}),m.dirty()):b.kind==="base64"?jc.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"base64",code:A.invalid_string,message:b.message}),m.dirty()):V.assertNever(b);return{status:m.value,value:a.data}}_regex(a,f,m){return this.refinement(w=>a.test(w),{validation:f,code:A.invalid_string,...Y.errToObj(m)})}_addCheck(a){return new It({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...Y.errToObj(a)})}url(a){return this._addCheck({kind:"url",...Y.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...Y.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...Y.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...Y.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...Y.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...Y.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...Y.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...Y.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...Y.errToObj(a)})}datetime(a){var f,m;return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof a?.precision>"u"?null:a?.precision,offset:(f=a?.offset)!==null&&f!==void 0?f:!1,local:(m=a?.local)!==null&&m!==void 0?m:!1,...Y.errToObj(a?.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof a?.precision>"u"?null:a?.precision,...Y.errToObj(a?.message)})}duration(a){return this._addCheck({kind:"duration",...Y.errToObj(a)})}regex(a,f){return this._addCheck({kind:"regex",regex:a,...Y.errToObj(f)})}includes(a,f){return this._addCheck({kind:"includes",value:a,position:f?.position,...Y.errToObj(f?.message)})}startsWith(a,f){return this._addCheck({kind:"startsWith",value:a,...Y.errToObj(f)})}endsWith(a,f){return this._addCheck({kind:"endsWith",value:a,...Y.errToObj(f)})}min(a,f){return this._addCheck({kind:"min",value:a,...Y.errToObj(f)})}max(a,f){return this._addCheck({kind:"max",value:a,...Y.errToObj(f)})}length(a,f){return this._addCheck({kind:"length",value:a,...Y.errToObj(f)})}nonempty(a){return this.min(1,Y.errToObj(a))}trim(){return new It({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new It({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new It({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get minLength(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxLength(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}},"ZodString");y(It,"ZodString"),It.create=a=>{var f;return new It({checks:[],typeName:ie.ZodString,coerce:(f=a?.coerce)!==null&&f!==void 0?f:!1,...ce(a)})};function Fr(a,f){let m=(a.toString().split(".")[1]||"").length,w=(f.toString().split(".")[1]||"").length,b=m>w?m:w,I=parseInt(a.toFixed(b).replace(".","")),P=parseInt(f.toFixed(b).replace(".",""));return I%P/Math.pow(10,b)}o(Fr,"floatSafeRemainder"),K(Fr,"floatSafeRemainder"),y(Fr,"floatSafeRemainder");var ut=K(class extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==R.number){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.number,received:b.parsedType}),re}let m,w=new Je;for(let b of this._def.checks)b.kind==="int"?V.isInteger(a.data)||(m=this._getOrReturnCtx(a,m),$(m,{code:A.invalid_type,expected:"integer",received:"float",message:b.message}),w.dirty()):b.kind==="min"?(b.inclusive?a.data<b.value:a.data<=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),w.dirty()):b.kind==="max"?(b.inclusive?a.data>b.value:a.data>=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),w.dirty()):b.kind==="multipleOf"?Fr(a.data,b.value)!==0&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_multiple_of,multipleOf:b.value,message:b.message}),w.dirty()):b.kind==="finite"?Number.isFinite(a.data)||(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_finite,message:b.message}),w.dirty()):V.assertNever(b);return{status:w.value,value:a.data}}gte(a,f){return this.setLimit("min",a,!0,Y.toString(f))}gt(a,f){return this.setLimit("min",a,!1,Y.toString(f))}lte(a,f){return this.setLimit("max",a,!0,Y.toString(f))}lt(a,f){return this.setLimit("max",a,!1,Y.toString(f))}setLimit(a,f,m,w){return new ut({...this._def,checks:[...this._def.checks,{kind:a,value:f,inclusive:m,message:Y.toString(w)}]})}_addCheck(a){return new ut({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:Y.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Y.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Y.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Y.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Y.toString(a)})}multipleOf(a,f){return this._addCheck({kind:"multipleOf",value:a,message:Y.toString(f)})}finite(a){return this._addCheck({kind:"finite",message:Y.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Y.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Y.toString(a)})}get minValue(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxValue(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}get isInt(){return!!this._def.checks.find(a=>a.kind==="int"||a.kind==="multipleOf"&&V.isInteger(a.value))}get isFinite(){let a=null,f=null;for(let m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(a===null||m.value<a)&&(a=m.value)}return Number.isFinite(f)&&Number.isFinite(a)}},"ZodNumber");y(ut,"ZodNumber"),ut.create=a=>new ut({checks:[],typeName:ie.ZodNumber,coerce:a?.coerce||!1,...ce(a)});var Wt=K(class extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce&&(a.data=BigInt(a.data)),this._getType(a)!==R.bigint){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.bigint,received:b.parsedType}),re}let m,w=new Je;for(let b of this._def.checks)b.kind==="min"?(b.inclusive?a.data<b.value:a.data<=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),w.dirty()):b.kind==="max"?(b.inclusive?a.data>b.value:a.data>=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),w.dirty()):b.kind==="multipleOf"?a.data%b.value!==BigInt(0)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_multiple_of,multipleOf:b.value,message:b.message}),w.dirty()):V.assertNever(b);return{status:w.value,value:a.data}}gte(a,f){return this.setLimit("min",a,!0,Y.toString(f))}gt(a,f){return this.setLimit("min",a,!1,Y.toString(f))}lte(a,f){return this.setLimit("max",a,!0,Y.toString(f))}lt(a,f){return this.setLimit("max",a,!1,Y.toString(f))}setLimit(a,f,m,w){return new Wt({...this._def,checks:[...this._def.checks,{kind:a,value:f,inclusive:m,message:Y.toString(w)}]})}_addCheck(a){return new Wt({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Y.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Y.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Y.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Y.toString(a)})}multipleOf(a,f){return this._addCheck({kind:"multipleOf",value:a,message:Y.toString(f)})}get minValue(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxValue(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}},"ZodBigInt");y(Wt,"ZodBigInt"),Wt.create=a=>{var f;return new Wt({checks:[],typeName:ie.ZodBigInt,coerce:(f=a?.coerce)!==null&&f!==void 0?f:!1,...ce(a)})};var xr=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=Boolean(a.data)),this._getType(a)!==R.boolean){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.boolean,received:m.parsedType}),re}return Fe(a.data)}},"ZodBoolean");y(xr,"ZodBoolean"),xr.create=a=>new xr({typeName:ie.ZodBoolean,coerce:a?.coerce||!1,...ce(a)});var ir=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==R.date){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.date,received:b.parsedType}),re}if(isNaN(a.data.getTime())){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_date}),re}let m=new Je,w;for(let b of this._def.checks)b.kind==="min"?a.data.getTime()<b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),m.dirty()):b.kind==="max"?a.data.getTime()>b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),m.dirty()):V.assertNever(b);return{status:m.value,value:new Date(a.data.getTime())}}_addCheck(a){return new ir({...this._def,checks:[...this._def.checks,a]})}min(a,f){return this._addCheck({kind:"min",value:a.getTime(),message:Y.toString(f)})}max(a,f){return this._addCheck({kind:"max",value:a.getTime(),message:Y.toString(f)})}get minDate(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a!=null?new Date(a):null}},"ZodDate");y(ir,"ZodDate"),ir.create=a=>new ir({checks:[],coerce:a?.coerce||!1,typeName:ie.ZodDate,...ce(a)});var zr=K(class extends pe{_parse(a){if(this._getType(a)!==R.symbol){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.symbol,received:m.parsedType}),re}return Fe(a.data)}},"ZodSymbol");y(zr,"ZodSymbol"),zr.create=a=>new zr({typeName:ie.ZodSymbol,...ce(a)});var Er=K(class extends pe{_parse(a){if(this._getType(a)!==R.undefined){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.undefined,received:m.parsedType}),re}return Fe(a.data)}},"ZodUndefined");y(Er,"ZodUndefined"),Er.create=a=>new Er({typeName:ie.ZodUndefined,...ce(a)});var Tr=K(class extends pe{_parse(a){if(this._getType(a)!==R.null){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.null,received:m.parsedType}),re}return Fe(a.data)}},"ZodNull");y(Tr,"ZodNull"),Tr.create=a=>new Tr({typeName:ie.ZodNull,...ce(a)});var ar=K(class extends pe{constructor(){super(...arguments),this._any=!0}_parse(a){return Fe(a.data)}},"ZodAny");y(ar,"ZodAny"),ar.create=a=>new ar({typeName:ie.ZodAny,...ce(a)});var Ht=K(class extends pe{constructor(){super(...arguments),this._unknown=!0}_parse(a){return Fe(a.data)}},"ZodUnknown");y(Ht,"ZodUnknown"),Ht.create=a=>new Ht({typeName:ie.ZodUnknown,...ce(a)});var _t=K(class extends pe{_parse(a){let f=this._getOrReturnCtx(a);return $(f,{code:A.invalid_type,expected:R.never,received:f.parsedType}),re}},"ZodNever");y(_t,"ZodNever"),_t.create=a=>new _t({typeName:ie.ZodNever,...ce(a)});var li=K(class extends pe{_parse(a){if(this._getType(a)!==R.undefined){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.void,received:m.parsedType}),re}return Fe(a.data)}},"ZodVoid");y(li,"ZodVoid"),li.create=a=>new li({typeName:ie.ZodVoid,...ce(a)});var Nt=K(class extends pe{_parse(a){let{ctx:f,status:m}=this._processInputParams(a),w=this._def;if(f.parsedType!==R.array)return $(f,{code:A.invalid_type,expected:R.array,received:f.parsedType}),re;if(w.exactLength!==null){let I=f.data.length>w.exactLength.value,P=f.data.length<w.exactLength.value;(I||P)&&($(f,{code:I?A.too_big:A.too_small,minimum:P?w.exactLength.value:void 0,maximum:I?w.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:w.exactLength.message}),m.dirty())}if(w.minLength!==null&&f.data.length<w.minLength.value&&($(f,{code:A.too_small,minimum:w.minLength.value,type:"array",inclusive:!0,exact:!1,message:w.minLength.message}),m.dirty()),w.maxLength!==null&&f.data.length>w.maxLength.value&&($(f,{code:A.too_big,maximum:w.maxLength.value,type:"array",inclusive:!0,exact:!1,message:w.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((I,P)=>w.type._parseAsync(new At(f,I,f.path,P)))).then(I=>Je.mergeArray(m,I));let b=[...f.data].map((I,P)=>w.type._parseSync(new At(f,I,f.path,P)));return Je.mergeArray(m,b)}get element(){return this._def.type}min(a,f){return new Nt({...this._def,minLength:{value:a,message:Y.toString(f)}})}max(a,f){return new Nt({...this._def,maxLength:{value:a,message:Y.toString(f)}})}length(a,f){return new Nt({...this._def,exactLength:{value:a,message:Y.toString(f)}})}nonempty(a){return this.min(1,a)}},"ZodArray");y(Nt,"ZodArray"),Nt.create=(a,f)=>new Nt({type:a,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...ce(f)});function Cr(a){if(a instanceof Le){let f={};for(let m in a.shape){let w=a.shape[m];f[m]=Vt.create(Cr(w))}return new Le({...a._def,shape:()=>f})}else return a instanceof Nt?new Nt({...a._def,type:Cr(a.element)}):a instanceof Vt?Vt.create(Cr(a.unwrap())):a instanceof sr?sr.create(Cr(a.unwrap())):a instanceof jt?jt.create(a.items.map(f=>Cr(f))):a}o(Cr,"deepPartialify"),K(Cr,"deepPartialify"),y(Cr,"deepPartialify");var Le=K(class extends pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let a=this._def.shape(),f=V.objectKeys(a);return this._cached={shape:a,keys:f}}_parse(a){if(this._getType(a)!==R.object){let U=this._getOrReturnCtx(a);return $(U,{code:A.invalid_type,expected:R.object,received:U.parsedType}),re}let{status:m,ctx:w}=this._processInputParams(a),{shape:b,keys:I}=this._getCached(),P=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let U in w.data)I.includes(U)||P.push(U);let Z=[];for(let U of I){let le=b[U],De=w.data[U];Z.push({key:{status:"valid",value:U},value:le._parse(new At(w,De,w.path,U)),alwaysSet:U in w.data})}if(this._def.catchall instanceof _t){let U=this._def.unknownKeys;if(U==="passthrough")for(let le of P)Z.push({key:{status:"valid",value:le},value:{status:"valid",value:w.data[le]}});else if(U==="strict")P.length>0&&($(w,{code:A.unrecognized_keys,keys:P}),m.dirty());else if(U!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let le of P){let De=w.data[le];Z.push({key:{status:"valid",value:le},value:U._parse(new At(w,De,w.path,le)),alwaysSet:le in w.data})}}return w.common.async?Promise.resolve().then(async()=>{let U=[];for(let le of Z){let De=await le.key,Nn=await le.value;U.push({key:De,value:Nn,alwaysSet:le.alwaysSet})}return U}).then(U=>Je.mergeObjectSync(m,U)):Je.mergeObjectSync(m,Z)}get shape(){return this._def.shape()}strict(a){return Y.errToObj,new Le({...this._def,unknownKeys:"strict",...a!==void 0?{errorMap:(f,m)=>{var w,b,I,P;let Z=(I=(b=(w=this._def).errorMap)===null||b===void 0?void 0:b.call(w,f,m).message)!==null&&I!==void 0?I:m.defaultError;return f.code==="unrecognized_keys"?{message:(P=Y.errToObj(a).message)!==null&&P!==void 0?P:Z}:{message:Z}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(a){return new Le({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new Le({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:ie.ZodObject})}setKey(a,f){return this.augment({[a]:f})}catchall(a){return new Le({...this._def,catchall:a})}pick(a){let f={};return V.objectKeys(a).forEach(m=>{a[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}omit(a){let f={};return V.objectKeys(this.shape).forEach(m=>{a[m]||(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}deepPartial(){return Cr(this)}partial(a){let f={};return V.objectKeys(this.shape).forEach(m=>{let w=this.shape[m];a&&!a[m]?f[m]=w:f[m]=w.optional()}),new Le({...this._def,shape:()=>f})}required(a){let f={};return V.objectKeys(this.shape).forEach(m=>{if(a&&!a[m])f[m]=this.shape[m];else{let b=this.shape[m];for(;b instanceof Vt;)b=b._def.innerType;f[m]=b}}),new Le({...this._def,shape:()=>f})}keyof(){return ra(V.objectKeys(this.shape))}},"ZodObject");y(Le,"ZodObject"),Le.create=(a,f)=>new Le({shape:()=>a,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)}),Le.strictCreate=(a,f)=>new Le({shape:()=>a,unknownKeys:"strict",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)}),Le.lazycreate=(a,f)=>new Le({shape:a,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)});var $r=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=this._def.options;function w(b){for(let P of b)if(P.result.status==="valid")return P.result;for(let P of b)if(P.result.status==="dirty")return f.common.issues.push(...P.ctx.common.issues),P.result;let I=b.map(P=>new Q(P.ctx.common.issues));return $(f,{code:A.invalid_union,unionErrors:I}),re}if(o(w,"handleResults"),K(w,"handleResults"),y(w,"handleResults"),f.common.async)return Promise.all(m.map(async b=>{let I={...f,common:{...f.common,issues:[]},parent:null};return{result:await b._parseAsync({data:f.data,path:f.path,parent:I}),ctx:I}})).then(w);{let b,I=[];for(let Z of m){let U={...f,common:{...f.common,issues:[]},parent:null},le=Z._parseSync({data:f.data,path:f.path,parent:U});if(le.status==="valid")return le;le.status==="dirty"&&!b&&(b={result:le,ctx:U}),U.common.issues.length&&I.push(U.common.issues)}if(b)return f.common.issues.push(...b.ctx.common.issues),b.result;let P=I.map(Z=>new Q(Z));return $(f,{code:A.invalid_union,unionErrors:P}),re}}get options(){return this._def.options}},"ZodUnion");y($r,"ZodUnion"),$r.create=(a,f)=>new $r({options:a,typeName:ie.ZodUnion,...ce(f)});var or=y(a=>a instanceof bn?or(a.schema):a instanceof bt?or(a.innerType()):a instanceof Rr?[a.value]:a instanceof Or?a.options:a instanceof wn?V.objectValues(a.enum):a instanceof xn?or(a._def.innerType):a instanceof Er?[void 0]:a instanceof Tr?[null]:a instanceof Vt?[void 0,...or(a.unwrap())]:a instanceof sr?[null,...or(a.unwrap())]:a instanceof na||a instanceof En?or(a.unwrap()):a instanceof Gr?or(a._def.innerType):[],"getDiscriminator"),ta=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.object)return $(f,{code:A.invalid_type,expected:R.object,received:f.parsedType}),re;let m=this.discriminator,w=f.data[m],b=this.optionsMap.get(w);return b?f.common.async?b._parseAsync({data:f.data,path:f.path,parent:f}):b._parseSync({data:f.data,path:f.path,parent:f}):($(f,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(a,f,m){let w=new Map;for(let b of f){let I=or(b.shape[a]);if(!I.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(let P of I){if(w.has(P))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(P)}`);w.set(P,b)}}return new ta({typeName:ie.ZodDiscriminatedUnion,discriminator:a,options:f,optionsMap:w,...ce(m)})}},"ZodDiscriminatedUnion");y(ta,"ZodDiscriminatedUnion");function di(a,f){let m=q(a),w=q(f);if(a===f)return{valid:!0,data:a};if(m===R.object&&w===R.object){let b=V.objectKeys(f),I=V.objectKeys(a).filter(Z=>b.indexOf(Z)!==-1),P={...a,...f};for(let Z of I){let U=di(a[Z],f[Z]);if(!U.valid)return{valid:!1};P[Z]=U.data}return{valid:!0,data:P}}else if(m===R.array&&w===R.array){if(a.length!==f.length)return{valid:!1};let b=[];for(let I=0;I<a.length;I++){let P=a[I],Z=f[I],U=di(P,Z);if(!U.valid)return{valid:!1};b.push(U.data)}return{valid:!0,data:b}}else return m===R.date&&w===R.date&&+a==+f?{valid:!0,data:a}:{valid:!1}}o(di,"mergeValues"),K(di,"mergeValues"),y(di,"mergeValues");var _n=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a),w=y((b,I)=>{if(br(b)||br(I))return re;let P=di(b.value,I.value);return P.valid?((mn(b)||mn(I))&&f.dirty(),{status:f.value,value:P.data}):($(m,{code:A.invalid_intersection_types}),re)},"handleParsed");return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([b,I])=>w(b,I)):w(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}},"ZodIntersection");y(_n,"ZodIntersection"),_n.create=(a,f,m)=>new _n({left:a,right:f,typeName:ie.ZodIntersection,...ce(m)});var jt=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.array)return $(m,{code:A.invalid_type,expected:R.array,received:m.parsedType}),re;if(m.data.length<this._def.items.length)return $(m,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&m.data.length>this._def.items.length&&($(m,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());let b=[...m.data].map((I,P)=>{let Z=this._def.items[P]||this._def.rest;return Z?Z._parse(new At(m,I,m.path,P)):null}).filter(I=>!!I);return m.common.async?Promise.all(b).then(I=>Je.mergeArray(f,I)):Je.mergeArray(f,b)}get items(){return this._def.items}rest(a){return new jt({...this._def,rest:a})}},"ZodTuple");y(jt,"ZodTuple"),jt.create=(a,f)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jt({items:a,typeName:ie.ZodTuple,rest:null,...ce(f)})};var fi=K(class extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.object)return $(m,{code:A.invalid_type,expected:R.object,received:m.parsedType}),re;let w=[],b=this._def.keyType,I=this._def.valueType;for(let P in m.data)w.push({key:b._parse(new At(m,P,m.path,P)),value:I._parse(new At(m,m.data[P],m.path,P)),alwaysSet:P in m.data});return m.common.async?Je.mergeObjectAsync(f,w):Je.mergeObjectSync(f,w)}get element(){return this._def.valueType}static create(a,f,m){return f instanceof pe?new fi({keyType:a,valueType:f,typeName:ie.ZodRecord,...ce(m)}):new fi({keyType:It.create(),valueType:a,typeName:ie.ZodRecord,...ce(f)})}},"ZodRecord");y(fi,"ZodRecord");var pi=K(class extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.map)return $(m,{code:A.invalid_type,expected:R.map,received:m.parsedType}),re;let w=this._def.keyType,b=this._def.valueType,I=[...m.data.entries()].map(([P,Z],U)=>({key:w._parse(new At(m,P,m.path,[U,"key"])),value:b._parse(new At(m,Z,m.path,[U,"value"]))}));if(m.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let Z of I){let U=await Z.key,le=await Z.value;if(U.status==="aborted"||le.status==="aborted")return re;(U.status==="dirty"||le.status==="dirty")&&f.dirty(),P.set(U.value,le.value)}return{status:f.value,value:P}})}else{let P=new Map;for(let Z of I){let U=Z.key,le=Z.value;if(U.status==="aborted"||le.status==="aborted")return re;(U.status==="dirty"||le.status==="dirty")&&f.dirty(),P.set(U.value,le.value)}return{status:f.value,value:P}}}},"ZodMap");y(pi,"ZodMap"),pi.create=(a,f,m)=>new pi({valueType:f,keyType:a,typeName:ie.ZodMap,...ce(m)});var Wr=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.set)return $(m,{code:A.invalid_type,expected:R.set,received:m.parsedType}),re;let w=this._def;w.minSize!==null&&m.data.size<w.minSize.value&&($(m,{code:A.too_small,minimum:w.minSize.value,type:"set",inclusive:!0,exact:!1,message:w.minSize.message}),f.dirty()),w.maxSize!==null&&m.data.size>w.maxSize.value&&($(m,{code:A.too_big,maximum:w.maxSize.value,type:"set",inclusive:!0,exact:!1,message:w.maxSize.message}),f.dirty());let b=this._def.valueType;function I(Z){let U=new Set;for(let le of Z){if(le.status==="aborted")return re;le.status==="dirty"&&f.dirty(),U.add(le.value)}return{status:f.value,value:U}}o(I,"finalizeSet"),K(I,"finalizeSet"),y(I,"finalizeSet");let P=[...m.data.values()].map((Z,U)=>b._parse(new At(m,Z,m.path,U)));return m.common.async?Promise.all(P).then(Z=>I(Z)):I(P)}min(a,f){return new Wr({...this._def,minSize:{value:a,message:Y.toString(f)}})}max(a,f){return new Wr({...this._def,maxSize:{value:a,message:Y.toString(f)}})}size(a,f){return this.min(a,f).max(a,f)}nonempty(a){return this.min(1,a)}},"ZodSet");y(Wr,"ZodSet"),Wr.create=(a,f)=>new Wr({valueType:a,minSize:null,maxSize:null,typeName:ie.ZodSet,...ce(f)});var Sr=K(class extends pe{constructor(){super(...arguments),this.validate=this.implement}_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.function)return $(f,{code:A.invalid_type,expected:R.function,received:f.parsedType}),re;function m(P,Z){return Ue({data:P,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_arguments,argumentsError:Z}})}o(m,"makeArgsIssue"),K(m,"makeArgsIssue"),y(m,"makeArgsIssue");function w(P,Z){return Ue({data:P,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_return_type,returnTypeError:Z}})}o(w,"makeReturnsIssue"),K(w,"makeReturnsIssue"),y(w,"makeReturnsIssue");let b={errorMap:f.common.contextualErrorMap},I=f.data;if(this._def.returns instanceof Hr){let P=this;return Fe(async function(...Z){let U=new Q([]),le=await P._def.args.parseAsync(Z,b).catch(wa=>{throw U.addIssue(m(Z,wa)),U}),De=await Reflect.apply(I,this,le);return await P._def.returns._def.type.parseAsync(De,b).catch(wa=>{throw U.addIssue(w(De,wa)),U})})}else{let P=this;return Fe(function(...Z){let U=P._def.args.safeParse(Z,b);if(!U.success)throw new Q([m(Z,U.error)]);let le=Reflect.apply(I,this,U.data),De=P._def.returns.safeParse(le,b);if(!De.success)throw new Q([w(le,De.error)]);return De.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...a){return new Sr({...this._def,args:jt.create(a).rest(Ht.create())})}returns(a){return new Sr({...this._def,returns:a})}implement(a){return this.parse(a)}strictImplement(a){return this.parse(a)}static create(a,f,m){return new Sr({args:a||jt.create([]).rest(Ht.create()),returns:f||Ht.create(),typeName:ie.ZodFunction,...ce(m)})}},"ZodFunction");y(Sr,"ZodFunction");var bn=K(class extends pe{get schema(){return this._def.getter()}_parse(a){let{ctx:f}=this._processInputParams(a);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}},"ZodLazy");y(bn,"ZodLazy"),bn.create=(a,f)=>new bn({getter:a,typeName:ie.ZodLazy,...ce(f)});var Rr=K(class extends pe{_parse(a){if(a.data!==this._def.value){let f=this._getOrReturnCtx(a);return $(f,{received:f.data,code:A.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:a.data}}get value(){return this._def.value}},"ZodLiteral");y(Rr,"ZodLiteral"),Rr.create=(a,f)=>new Rr({value:a,typeName:ie.ZodLiteral,...ce(f)});function ra(a,f){return new Or({values:a,typeName:ie.ZodEnum,...ce(f)})}o(ra,"createZodEnum"),K(ra,"createZodEnum"),y(ra,"createZodEnum");var Or=K(class extends pe{constructor(){super(...arguments),ai.set(this,void 0)}_parse(a){if(typeof a.data!="string"){let f=this._getOrReturnCtx(a),m=this._def.values;return $(f,{expected:V.joinValues(m),received:f.parsedType,code:A.invalid_type}),re}if(gn(this,ai,"f")||Br(this,ai,new Set(this._def.values),"f"),!gn(this,ai,"f").has(a.data)){let f=this._getOrReturnCtx(a),m=this._def.values;return $(f,{received:f.data,code:A.invalid_enum_value,options:m}),re}return Fe(a.data)}get options(){return this._def.values}get enum(){let a={};for(let f of this._def.values)a[f]=f;return a}get Values(){let a={};for(let f of this._def.values)a[f]=f;return a}get Enum(){let a={};for(let f of this._def.values)a[f]=f;return a}extract(a,f=this._def){return Or.create(a,{...this._def,...f})}exclude(a,f=this._def){return Or.create(this.options.filter(m=>!a.includes(m)),{...this._def,...f})}},"ZodEnum");y(Or,"ZodEnum"),ai=new WeakMap,Or.create=ra;var wn=K(class extends pe{constructor(){super(...arguments),oi.set(this,void 0)}_parse(a){let f=V.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(a);if(m.parsedType!==R.string&&m.parsedType!==R.number){let w=V.objectValues(f);return $(m,{expected:V.joinValues(w),received:m.parsedType,code:A.invalid_type}),re}if(gn(this,oi,"f")||Br(this,oi,new Set(V.getValidEnumValues(this._def.values)),"f"),!gn(this,oi,"f").has(a.data)){let w=V.objectValues(f);return $(m,{received:m.data,code:A.invalid_enum_value,options:w}),re}return Fe(a.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(wn,"ZodNativeEnum"),oi=new WeakMap,wn.create=(a,f)=>new wn({values:a,typeName:ie.ZodNativeEnum,...ce(f)});var Hr=K(class extends pe{unwrap(){return this._def.type}_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.promise&&f.common.async===!1)return $(f,{code:A.invalid_type,expected:R.promise,received:f.parsedType}),re;let m=f.parsedType===R.promise?f.data:Promise.resolve(f.data);return Fe(m.then(w=>this._def.type.parseAsync(w,{path:f.path,errorMap:f.common.contextualErrorMap})))}},"ZodPromise");y(Hr,"ZodPromise"),Hr.create=(a,f)=>new Hr({type:a,typeName:ie.ZodPromise,...ce(f)});var bt=K(class extends pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(a){let{status:f,ctx:m}=this._processInputParams(a),w=this._def.effect||null,b={addIssue:I=>{$(m,I),I.fatal?f.abort():f.dirty()},get path(){return m.path}};if(b.addIssue=b.addIssue.bind(b),w.type==="preprocess"){let I=w.transform(m.data,b);if(m.common.async)return Promise.resolve(I).then(async P=>{if(f.value==="aborted")return re;let Z=await this._def.schema._parseAsync({data:P,path:m.path,parent:m});return Z.status==="aborted"?re:Z.status==="dirty"||f.value==="dirty"?$t(Z.value):Z});{if(f.value==="aborted")return re;let P=this._def.schema._parseSync({data:I,path:m.path,parent:m});return P.status==="aborted"?re:P.status==="dirty"||f.value==="dirty"?$t(P.value):P}}if(w.type==="refinement"){let I=y(P=>{let Z=w.refinement(P,b);if(m.common.async)return Promise.resolve(Z);if(Z instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P},"executeRefinement");if(m.common.async===!1){let P=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return P.status==="aborted"?re:(P.status==="dirty"&&f.dirty(),I(P.value),{status:f.value,value:P.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(P=>P.status==="aborted"?re:(P.status==="dirty"&&f.dirty(),I(P.value).then(()=>({status:f.value,value:P.value}))))}if(w.type==="transform")if(m.common.async===!1){let I=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!Ot(I))return I;let P=w.transform(I.value,b);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:P}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(I=>Ot(I)?Promise.resolve(w.transform(I.value,b)).then(P=>({status:f.value,value:P})):I);V.assertNever(w)}},"ZodEffects");y(bt,"ZodEffects"),bt.create=(a,f,m)=>new bt({schema:a,typeName:ie.ZodEffects,effect:f,...ce(m)}),bt.createWithPreprocess=(a,f,m)=>new bt({schema:f,effect:{type:"preprocess",transform:a},typeName:ie.ZodEffects,...ce(m)});var Vt=K(class extends pe{_parse(a){return this._getType(a)===R.undefined?Fe(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}},"ZodOptional");y(Vt,"ZodOptional"),Vt.create=(a,f)=>new Vt({innerType:a,typeName:ie.ZodOptional,...ce(f)});var sr=K(class extends pe{_parse(a){return this._getType(a)===R.null?Fe(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}},"ZodNullable");y(sr,"ZodNullable"),sr.create=(a,f)=>new sr({innerType:a,typeName:ie.ZodNullable,...ce(f)});var xn=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=f.data;return f.parsedType===R.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}},"ZodDefault");y(xn,"ZodDefault"),xn.create=(a,f)=>new xn({innerType:a,typeName:ie.ZodDefault,defaultValue:typeof f.default=="function"?f.default:()=>f.default,...ce(f)});var Gr=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m={...f,common:{...f.common,issues:[]}},w=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return vt(w)?w.then(b=>({status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new Q(m.common.issues)},input:m.data})})):{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new Q(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(Gr,"ZodCatch"),Gr.create=(a,f)=>new Gr({innerType:a,typeName:ie.ZodCatch,catchValue:typeof f.catch=="function"?f.catch:()=>f.catch,...ce(f)});var hi=K(class extends pe{_parse(a){if(this._getType(a)!==R.nan){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.nan,received:m.parsedType}),re}return{status:"valid",value:a.data}}},"ZodNaN");y(hi,"ZodNaN"),hi.create=a=>new hi({typeName:ie.ZodNaN,...ce(a)});var Vc=Symbol("zod_brand"),na=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}},"ZodBranded");y(na,"ZodBranded");var mi=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.common.async)return y(async()=>{let b=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return b.status==="aborted"?re:b.status==="dirty"?(f.dirty(),$t(b.value)):this._def.out._parseAsync({data:b.value,path:m.path,parent:m})},"handleAsync")();{let w=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return w.status==="aborted"?re:w.status==="dirty"?(f.dirty(),{status:"dirty",value:w.value}):this._def.out._parseSync({data:w.value,path:m.path,parent:m})}}static create(a,f){return new mi({in:a,out:f,typeName:ie.ZodPipeline})}},"ZodPipeline");y(mi,"ZodPipeline");var En=K(class extends pe{_parse(a){let f=this._def.innerType._parse(a),m=y(w=>(Ot(w)&&(w.value=Object.freeze(w.value)),w),"freeze");return vt(f)?f.then(w=>m(w)):m(f)}unwrap(){return this._def.innerType}},"ZodReadonly");y(En,"ZodReadonly"),En.create=(a,f)=>new En({innerType:a,typeName:ie.ZodReadonly,...ce(f)});function ia(a,f={},m){return a?ar.create().superRefine((w,b)=>{var I,P;if(!a(w)){let Z=typeof f=="function"?f(w):typeof f=="string"?{message:f}:f,U=(P=(I=Z.fatal)!==null&&I!==void 0?I:m)!==null&&P!==void 0?P:!0,le=typeof Z=="string"?{message:Z}:Z;b.addIssue({code:"custom",...le,fatal:U})}}):ar.create()}o(ia,"custom"),K(ia,"custom"),y(ia,"custom");var aa={object:Le.lazycreate},ie;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(ie||(ie={}));var oa=y((a,f={message:`Input not instance of ${a.name}`})=>ia(m=>m instanceof a,f),"instanceOfType"),Wo=It.create,Ho=ut.create,Dc=hi.create,Go=Wt.create,qa=xr.create,Jo=ir.create,Lc=zr.create,Mc=Er.create,Uc=Tr.create,Bc=ar.create,Yo=Ht.create,Ko=_t.create,Qo=li.create,Fa=Nt.create,Zc=Le.create,Xo=Le.strictCreate,sa=$r.create,es=ta.create,qc=_n.create,ts=jt.create,rs=fi.create,za=pi.create,Fc=Wr.create,ns=Sr.create,$a=bn.create,Wa=Rr.create,Tn=Or.create,is=wn.create,as=Hr.create,os=bt.create,ss=Vt.create,cs=sr.create,us=bt.createWithPreprocess,ls=mi.create,zc=y(()=>Wo().optional(),"ostring"),$c=y(()=>Ho().optional(),"onumber"),Wc=y(()=>qa().optional(),"oboolean"),ds={string:a=>It.create({...a,coerce:!0}),number:a=>ut.create({...a,coerce:!0}),boolean:a=>xr.create({...a,coerce:!0}),bigint:a=>Wt.create({...a,coerce:!0}),date:a=>ir.create({...a,coerce:!0})},Hc=re,u=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:be,getErrorMap:Ne,makeIssue:Ue,EMPTY_PATH:Ur,addIssueToContext:$,ParseStatus:Je,INVALID:re,DIRTY:$t,OK:Fe,isAborted:br,isDirty:mn,isValid:Ot,isAsync:vt,get util(){return V},get objectUtil(){return k},ZodParsedType:R,getParsedType:q,ZodType:pe,datetimeRegex:ea,ZodString:It,ZodNumber:ut,ZodBigInt:Wt,ZodBoolean:xr,ZodDate:ir,ZodSymbol:zr,ZodUndefined:Er,ZodNull:Tr,ZodAny:ar,ZodUnknown:Ht,ZodNever:_t,ZodVoid:li,ZodArray:Nt,ZodObject:Le,ZodUnion:$r,ZodDiscriminatedUnion:ta,ZodIntersection:_n,ZodTuple:jt,ZodRecord:fi,ZodMap:pi,ZodSet:Wr,ZodFunction:Sr,ZodLazy:bn,ZodLiteral:Rr,ZodEnum:Or,ZodNativeEnum:wn,ZodPromise:Hr,ZodEffects:bt,ZodTransformer:bt,ZodOptional:Vt,ZodNullable:sr,ZodDefault:xn,ZodCatch:Gr,ZodNaN:hi,BRAND:Vc,ZodBranded:na,ZodPipeline:mi,ZodReadonly:En,custom:ia,Schema:pe,ZodSchema:pe,late:aa,get ZodFirstPartyTypeKind(){return ie},coerce:ds,any:Bc,array:Fa,bigint:Go,boolean:qa,date:Jo,discriminatedUnion:es,effect:os,enum:Tn,function:ns,instanceof:oa,intersection:qc,lazy:$a,literal:Wa,map:za,nan:Dc,nativeEnum:is,never:Ko,null:Uc,nullable:cs,number:Ho,object:Zc,oboolean:Wc,onumber:$c,optional:ss,ostring:zc,pipeline:ls,preprocess:us,promise:as,record:rs,set:Fc,strictObject:Xo,string:Wo,symbol:Lc,transformer:os,tuple:ts,undefined:Mc,union:sa,unknown:Yo,void:Qo,NEVER:Hc,ZodIssueCode:A,quotelessJson:X,ZodError:Q}),gi=Symbol("current"),Cn=Symbol("previous"),Jr=y((a,{ref:f,refType:m,param:w,header:b,...I}={})=>({...I,...a}),"mergeOpenApi");function Ha(a){if(typeof a.ZodType.prototype.openapi<"u")return;a.ZodType.prototype.openapi=function(I){let{zodOpenApi:P,...Z}=this._def,U=new this.constructor({...Z,zodOpenApi:{openapi:Jr(I,P?.openapi)}});return U._def.zodOpenApi[gi]=U,P&&(U._def.zodOpenApi[Cn]=this),U};let f=a.ZodType.prototype.describe;a.ZodType.prototype.describe=function(...I){let P=f.apply(this,I),Z=P._def;if(Z.zodOpenApi){let U={...Z.zodOpenApi};U.openapi=Jr({description:I[0]},U.openapi),U[Cn]=this,U[gi]=P,Z.zodOpenApi=U}else Z.zodOpenApi={openapi:{description:I[0]},[gi]:P};return P};let m=a.ZodObject.prototype.extend;a.ZodObject.prototype.extend=function(...I){let P=m.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),U[Cn]=this,P._def.zodOpenApi=U}else P._def.zodOpenApi={[Cn]:this};return P};let w=a.ZodObject.prototype.omit;a.ZodObject.prototype.omit=function(...I){let P=w.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),delete U[Cn],delete U[gi],P._def.zodOpenApi=U}return P};let b=a.ZodObject.prototype.pick;a.ZodObject.prototype.pick=function(...I){let P=b.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),delete U[Cn],delete U[gi],P._def.zodOpenApi=U}return P}}o(Ha,"extendZodWithOpenApi"),K(Ha,"extendZodWithOpenApi"),y(Ha,"extendZodWithOpenApi"),Ha(u);var yi=u.array(u.string().or(u.record(u.any()))),Gc=u.object({type:u.string().optional(),narrative:u.string().optional()}),vi=u.string().or(u.object({id:u.string(),type:u.string(),caption:u.string().optional()})),fs=u.object({type:u.string().min(1).or(u.string().array().nonempty()),latitude:u.number(),longitude:u.number()}),je=u.object({type:u.string().min(1).or(u.string().array().nonempty()),addressCountry:u.string().optional(),addressCountryCode:u.string().optional(),addressRegion:u.string().optional(),addressLocality:u.string().optional(),streetAddress:u.string().optional(),postOfficeBoxNumber:u.string().optional(),postalCode:u.string().optional(),geo:fs.optional()}),Ie=u.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(u.string()),Ga=u.object({type:u.string().min(1).or(u.string().array().nonempty()),identifier:u.string(),identifierType:Ie}),Sn=u.string().or(u.object({id:u.string().optional(),type:u.string().or(u.string().array().nonempty().optional()),name:u.string().optional(),url:u.string().optional(),phone:u.string().optional(),description:u.string().optional(),endorsement:u.any().array().optional(),image:vi.optional(),email:u.string().email().optional(),address:je.optional(),otherIdentifier:Ga.array().optional(),official:u.string().optional(),parentOrg:u.any().optional(),familyName:u.string().optional(),givenName:u.string().optional(),additionalName:u.string().optional(),patronymicName:u.string().optional(),honorificPrefix:u.string().optional(),honorificSuffix:u.string().optional(),familyNamePrefix:u.string().optional(),dateOfBirth:u.string().optional()}).catchall(u.any())),ca=u.object({id:u.string().optional()}).catchall(u.any()),_i=u.object({type:u.string(),id:u.string()}).catchall(u.any()),Ja=u.object({id:u.string(),type:u.string()}).catchall(u.any()),Ya=u.object({id:u.string().optional(),type:u.string()}).catchall(u.any()),ua=u.object({type:u.string(),id:u.string().optional()}).catchall(u.any()),Ka=u.object({type:u.string().or(u.string().array().nonempty()),id:u.string().optional()}).catchall(u.any()),Be=u.object({"@context":yi,id:u.string().optional(),type:u.string().array().nonempty(),issuer:Sn,credentialSubject:ca.or(ca.array()),refreshService:Ya.or(Ya.array()).optional(),credentialSchema:Ja.or(Ja.array()).optional(),issuanceDate:u.string().optional(),expirationDate:u.string().optional(),credentialStatus:_i.or(_i.array()).optional(),name:u.string().optional(),description:u.string().optional(),validFrom:u.string().optional(),validUntil:u.string().optional(),status:_i.or(_i.array()).optional(),termsOfUse:ua.or(ua.array()).optional(),evidence:Ka.or(Ka.array()).optional()}).catchall(u.any()),lt=u.object({type:u.string(),created:u.string(),challenge:u.string().optional(),domain:u.string().optional(),nonce:u.string().optional(),proofPurpose:u.string(),verificationMethod:u.string(),jws:u.string().optional()}).catchall(u.any()),Gt=Be.extend({proof:lt.or(lt.array())}),Qa=u.object({"@context":yi,id:u.string().optional(),type:u.string().or(u.string().array().nonempty()),verifiableCredential:Gt.or(Gt.array()).optional(),holder:u.string().optional()}).catchall(u.any()),la=Qa.extend({proof:lt.or(lt.array())}),nt=u.object({kty:u.string(),crv:u.string(),x:u.string(),y:u.string().optional(),n:u.string().optional(),d:u.string().optional()}),ps=nt.omit({d:!0}).extend({d:u.string()}),Xa=u.object({alg:u.string(),iv:u.string(),tag:u.string(),epk:nt.partial().optional(),kid:u.string().optional(),apv:u.string().optional(),apu:u.string().optional()}),eo=u.object({header:Xa,encrypted_key:u.string()}),to=u.object({protected:u.string(),iv:u.string(),ciphertext:u.string(),tag:u.string(),aad:u.string().optional(),recipients:eo.array().optional()}),cr=u.string().or(u.object({"@context":yi.optional(),id:u.string(),type:u.string(),controller:u.string(),publicKeyJwk:nt.optional(),publicKeyBase58:u.string().optional(),publicKeyMultibase:u.string().optional(),blockChainAccountId:u.string().optional()}).catchall(u.any())),ro=u.object({id:u.string(),type:u.string().or(u.string().array().nonempty()),serviceEndpoint:u.any().or(u.any().array().nonempty())}).catchall(u.any()),dt=u.object({"@context":yi,id:u.string(),alsoKnownAs:u.string().optional(),controller:u.string().or(u.string().array().nonempty()).optional(),verificationMethod:cr.array().optional(),authentication:cr.array().optional(),assertionMethod:cr.array().optional(),keyAgreement:cr.array().optional(),capabilityInvocation:cr.array().optional(),capabilityDelegation:cr.array().optional(),publicKey:cr.array().optional(),service:ro.array().optional(),proof:lt.or(lt.array()).optional()}).catchall(u.any()),hs=u.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(u.string()),Xe=u.object({type:u.string().array().nonempty(),targetCode:u.string().optional(),targetDescription:u.string().optional(),targetName:u.string(),targetFramework:u.string().optional(),targetType:hs.optional(),targetUrl:u.string()}),ms=u.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),no=ms.or(u.string()),ur=u.object({id:u.string().optional(),narrative:u.string().optional()}).catchall(u.any()),bi=u.object({id:u.string(),type:u.string().array().nonempty(),endorsementComment:u.string().optional()}),da=Be.extend({credentialSubject:bi,proof:lt.or(lt.array()).optional()}),Ve=u.object({id:u.string(),"@language":u.string().optional(),version:u.string().optional()}),lr=u.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(u.string()),fa=u.object({id:u.string(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),description:u.string().optional(),level:u.string().optional(),name:u.string(),points:u.string().optional()}).catchall(u.any()),gs=u.object({id:u.string(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),allowedValue:u.string().array().optional(),name:u.string(),requiredLevel:u.string().optional(),requiredValue:u.string().optional(),resultType:lr,rubricCriterionLevel:fa.array().optional(),valueMax:u.string().optional(),valueMin:u.string().optional()}).catchall(u.any()),pa=u.object({id:u.string().optional(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),achievementType:no.optional(),creator:Sn.optional(),creditsAvailable:u.number().optional(),criteria:ur,description:u.string(),endorsement:da.array().optional(),fieldOfStudy:u.string().optional(),humanCode:u.string().optional(),image:vi.optional(),"@language":u.string().optional(),name:u.string(),otherIdentifier:Ga.array().optional(),related:Ve.array().optional(),resultDescription:gs.array().optional(),specialization:u.string().optional(),tag:u.string().array().optional(),version:u.string().optional()}).catchall(u.any()),ys=u.object({type:u.string(),hashed:u.boolean(),identityHash:u.string(),identityType:u.string(),salt:u.string().optional()}),vs=u.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),_s=u.object({type:u.string().array().nonempty(),achievedLevel:u.string().optional(),alignment:Xe.array().optional(),resultDescription:u.string().optional(),status:vs.optional(),value:u.string().optional()}).catchall(u.any()),ha=u.object({id:u.string().optional(),type:u.string().array().nonempty(),activityEndDate:u.string().optional(),activityStartDate:u.string().optional(),creditsEarned:u.number().optional(),achievement:pa.optional(),identifier:ys.array().optional(),image:vi.optional(),licenseNumber:u.string().optional(),narrative:u.string().optional(),result:_s.array().optional(),role:u.string().optional(),source:Sn.optional(),term:u.string().optional()}).catchall(u.any()),wi=u.object({id:u.string().optional(),type:u.string().or(u.string().array().nonempty()),narrative:u.string().optional(),name:u.string().optional(),description:u.string().optional(),genre:u.string().optional(),audience:u.string().optional()}).catchall(u.any()),Yr=Be.extend({name:u.string().optional(),description:u.string().optional(),image:vi.optional(),credentialSubject:ha.or(ha.array()),endorsement:Be.array().optional(),evidence:wi.array().optional()}),Jc=Yr.extend({proof:lt.or(lt.array())}),bs=u.object({checks:u.string().array(),warnings:u.string().array(),errors:u.string().array()}),ma=u.enum(["Success","Failed","Error"]),io=ma.enum,ao=u.object({check:u.string(),status:ma,message:u.string().optional(),details:u.string().optional()}),ws=u.object({title:u.string().optional(),createdAt:u.string().optional(),issuer:Sn.optional(),issuee:Sn.optional(),credentialSubject:ca.optional()}),Yc=u.object({id:u.string(),uri:u.string()}).catchall(u.any()),oo=u.object({limit:u.number(),cursor:u.string().optional(),sort:u.string().optional()}),Ye=u.object({cursor:u.string().optional(),hasMore:u.boolean()}),so=u.object({encryptedRecord:to,fields:u.string().array()}).catchall(u.any()),xs=Ye.extend({records:so.array()}),ot=so.extend({id:u.string()}),co=Ye.extend({records:ot.array()}),Rn=y(a=>{let f=a.match(/^\/(.*)\/([gimsuy]*)$/);if(!f)throw new Error("Invalid RegExp string format");return{pattern:f[1],flags:f[2]}},"parseRegexString"),uo=u.instanceof(RegExp).or(u.string().refine(a=>{try{return Rn(a),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(a=>{let{pattern:f,flags:m}=Rn(a);try{return new RegExp(f,m)}catch(w){throw new Error(`Invalid RegExp: ${w.message}`)}})),Te=u.string().or(u.object({$in:u.string().array()})).or(u.object({$regex:uo})),Es=u.object({backgroundColor:u.string().optional(),backgroundImage:u.string().optional(),fadeBackgroundImage:u.boolean().optional(),repeatBackgroundImage:u.boolean().optional(),fontColor:u.string().optional(),accentColor:u.string().optional(),accentFontColor:u.string().optional(),idBackgroundImage:u.string().optional(),fadeIdBackgroundImage:u.boolean().optional(),idBackgroundColor:u.string().optional(),repeatIdBackgroundImage:u.boolean().optional()}),Jt=u.object({profileId:u.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:u.string().default("").describe("Human-readable display name for the profile."),shortBio:u.string().default("").describe("Short bio for the profile."),bio:u.string().default("").describe("Longer bio for the profile."),did:u.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:u.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:u.string().optional().describe("Contact email address for the profile. (deprecated)"),image:u.string().optional().describe("Profile image URL for the profile."),heroImage:u.string().optional().describe("Hero image URL for the profile."),websiteLink:u.string().optional().describe("Website link for the profile."),isServiceProfile:u.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:u.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:u.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Es.optional().describe("Display settings for the profile."),highlightedCredentials:u.array(u.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:u.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:u.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:u.string().optional().describe("Country for the profile."),approved:u.boolean().optional().describe("Approval status for the profile.")}),Kc=u.object({profileId:Te,displayName:Te,shortBio:Te,bio:Te,email:Te,websiteLink:Te,isServiceProfile:u.boolean(),type:Te}).partial(),Qc=Ye.extend({records:Jt.array()}),Xc=u.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Ar=u.object({id:u.string(),created:u.string(),displayName:u.string().default("").optional(),shortBio:u.string().default("").optional(),bio:u.string().default("").optional(),email:u.string().optional(),image:u.string().optional(),heroImage:u.string().optional()}),eu=Ye.extend({records:Ar.extend({did:u.string()}).array()}),tu=u.object({id:Te,displayName:Te,shortBio:Te,bio:Te,email:Te}).partial(),lo=Ye.extend({records:u.object({profile:Jt,manager:Ar.extend({did:u.string()}).optional()}).array()}),Ts=u.object({uri:u.string(),to:u.string(),from:u.string(),sent:u.string().datetime(),received:u.string().datetime().optional()}),Yt=u.object({role:u.string(),canEdit:u.boolean(),canIssue:u.boolean(),canRevoke:u.boolean(),canManagePermissions:u.boolean(),canIssueChildren:u.string(),canCreateChildren:u.string(),canEditChildren:u.string(),canRevokeChildren:u.string(),canManageChildrenPermissions:u.string(),canManageChildrenProfiles:u.boolean().default(!1).optional(),canViewAnalytics:u.boolean()}),xi=u.object({role:Te,canEdit:u.boolean(),canIssue:u.boolean(),canRevoke:u.boolean(),canManagePermissions:u.boolean(),canIssueChildren:Te,canCreateChildren:Te,canEditChildren:Te,canRevokeChildren:Te,canManageChildrenPermissions:Te,canManageChildrenProfiles:u.boolean(),canViewAnalytics:u.boolean()}).partial(),ga=u.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Cs=u.discriminatedUnion("type",[u.object({type:u.literal(ga.Values.GRANT_PERMISSIONS),data:u.object({claimUri:u.string(),targetUri:u.string(),permissions:Yt.partial()})}),u.object({type:u.literal(ga.Values.ADD_ADMIN),data:u.object({claimUri:u.string(),targetUri:u.string()})}),u.object({type:u.literal(ga.Values.AUTO_CONNECT),data:u.object({claimUri:u.string(),targetUri:u.string()})})]),ru=u.object({type:Te,data:u.object({claimUri:Te,targetUri:Te,permissions:xi})}).deepPartial(),Kr=u.object({id:u.string(),createdAt:u.string(),updatedAt:u.string()}).and(Cs),Dt=Ye.extend({records:Kr.array()}),Ei=u.enum(["DRAFT","LIVE"]),Ss=u.object({uri:u.string(),name:u.string().optional(),type:u.string().optional(),category:u.string().optional(),status:Ei.optional(),autoConnectRecipients:u.boolean().optional(),meta:u.record(u.any()).optional(),claimPermissions:Yt.optional(),allowAnyoneToCreateChildren:u.boolean().optional()}),nu=u.object({uri:Te,name:Te,type:Te,category:Te,meta:u.record(Te),status:Ei.or(u.object({$in:Ei.array()})),autoConnectRecipients:u.boolean()}).partial(),iu=Ye.extend({records:Ss.array()}),Rs=u.object({to:Jt,from:u.string(),received:u.string().optional(),uri:u.string().optional()}),au=Ye.extend({records:Rs.array()}),dr=u.object({to:Jt,from:u.string(),received:u.string().optional(),boostUris:u.array(u.string()),credentialUris:u.array(u.string()).optional()}),C=Ye.extend({records:dr.array()}),D=u.object({endpoint:u.string(),name:u.string(),did:u.string().optional()}),j=u.object({ttlSeconds:u.number().optional(),totalUses:u.number().optional()}),G=u.object({endpoint:u.string()}),fe=u.object({signingAuthority:G,relationship:u.object({name:u.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:u.string(),isPrimary:u.boolean().optional()})}),Re=u.object({boostUri:u.string(),signingAuthority:u.object({endpoint:u.string(),name:u.string()})}),ze=u.enum(["live","stale","withdrawn"]),Ae=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),personal:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),write:u.object({credentials:u.object({categories:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),personal:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({})}),Ti=u.object({contract:Ae,owner:Jt,name:u.string(),subtitle:u.string().optional(),description:u.string().optional(),reasonForAccessing:u.string().optional(),image:u.string().optional(),uri:u.string(),needsGuardianConsent:u.boolean().optional(),redirectUrl:u.string().optional(),frontDoorBoostUri:u.string().optional(),createdAt:u.string(),updatedAt:u.string(),expiresAt:u.string().optional(),autoBoosts:u.string().array().optional(),writers:u.array(Jt).optional()}),ou=Ye.extend({records:Ti.omit({owner:!0}).array()}),ft=u.object({credentials:u.object({categories:u.record(u.string().array()).default({})}),personal:u.record(u.string()).default({}),date:u.string()}),ya=Ye.extend({records:ft.array()}),Os=u.object({credentials:u.object({category:u.string(),uri:u.string()}).array(),personal:u.record(u.string()).default({}),date:u.string(),contractUri:u.string()}),On=Ye.extend({records:Os.array()}),An=u.object({sharing:u.boolean().optional(),shared:u.string().array().optional(),shareAll:u.boolean().optional(),shareUntil:u.string().optional()}),kn=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({shareAll:u.boolean().optional(),sharing:u.boolean().optional(),categories:u.record(An).default({})}).default({}),personal:u.record(u.string()).default({})}).default({}),write:u.object({credentials:u.object({categories:u.record(u.boolean()).default({})}).default({}),personal:u.record(u.boolean()).default({})}).default({}),deniedWriters:u.array(u.string()).optional()}),Oe=Ye.extend({records:u.object({expiresAt:u.string().optional(),oneTime:u.boolean().optional(),terms:kn,contract:Ti,uri:u.string(),consenter:Jt,status:ze}).array()}),su=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),personal:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),write:u.object({credentials:u.object({categories:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),personal:u.record(u.object({required:u.boolean().optional()})).optional()}).optional()}),As=u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional()}),va=u.object({credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional(),id:Te.optional()}),ks=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({shareAll:u.boolean().optional(),sharing:u.boolean().optional(),categories:u.record(An.optional()).optional()}).optional(),personal:u.record(u.string()).optional()}).optional(),write:u.object({credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional()}).optional()}),_a=u.enum(["consent","update","sync","withdraw","write"]),cu=u.object({terms:ks.optional(),action:_a.or(_a.array()).optional(),date:u.object({$gt:u.string()}).or(u.object({$lt:u.string()})).or(u.object({$eq:u.string()})).optional(),expiresAt:u.object({$gt:u.string()}).or(u.object({$lt:u.string()})).or(u.object({$eq:u.string()})).optional(),oneTime:u.boolean().optional()}),Pn=u.object({expiresAt:u.string().optional(),oneTime:u.boolean().optional(),terms:kn.optional(),id:u.string(),action:_a,date:u.string(),uris:u.string().array().optional()}),kr=Ye.extend({records:Pn.array()}),Ci=u.object({credentialUri:u.string(),termsUri:u.string(),contractUri:u.string(),boostUri:u.string(),category:u.string().optional(),date:u.string()}),Ps=Ye.extend({records:Ci.array()}),Si=u.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR"]),fo=u.object({title:u.string().optional(),body:u.string().optional()}),po=u.object({type:u.string(),value:u.string()}),Pr=u.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),ho=u.object({issuanceId:u.string(),status:Pr,recipient:u.object({contactMethod:po.optional(),learnCardId:u.string().optional()}),timestamp:u.string().datetime().optional()}),In=u.object({vcUris:u.array(u.string()).optional(),vpUris:u.array(u.string()).optional(),transaction:Pn.optional(),inbox:ho.optional()}),Qr=u.object({type:Si,to:Jt.partial().and(u.object({did:u.string()})),from:Jt.partial().and(u.object({did:u.string()})),message:fo.optional(),data:In.optional(),sent:u.string().datetime().optional(),webhookUrl:u.string().optional()}),Ri="auth-grant:",uu=u.object({id:u.string(),name:u.string(),description:u.string().optional(),challenge:u.string().startsWith(Ri).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:u.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:u.string(),createdAt:u.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:u.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),lu=u.object({id:u.string()}).catchall(u.any()),Is=u.enum(["active","revoked"]),ba=u.object({id:Te,name:Te,description:Te,status:Is}).partial(),Oi=u.object({id:u.string(),isVerified:u.boolean(),verifiedAt:u.string().optional(),isPrimary:u.boolean(),createdAt:u.string()}),mo=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}).merge(Oi),u.object({type:u.literal("phone"),value:u.string()}).merge(Oi)]),Ns=u.object({isVerified:u.boolean().optional(),isPrimary:u.boolean().optional()}),js=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}).merge(Ns),u.object({type:u.literal("phone"),value:u.string()}).merge(Ns)]),go=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}),u.object({type:u.literal("phone"),value:u.string()})]),du=u.object({value:u.string(),type:u.enum(["email","phone"])}),We=u.object({token:u.string()}),et=u.object({contactMethodId:u.string()}),Vs=u.object({id:u.string(),credential:u.string(),isSigned:u.boolean(),currentStatus:Pr,expiresAt:u.string(),createdAt:u.string(),issuerDid:u.string(),webhookUrl:u.string().optional(),signingAuthority:u.object({endpoint:u.string().optional(),name:u.string().optional()}).optional()}),fu=u.object({hasMore:u.boolean(),records:u.array(Vs),cursor:u.string().optional()}),Ds=u.object({currentStatus:Pr,id:u.string(),isSigned:u.boolean(),issuerDid:u.string()}).partial(),Ls=u.object({endpoint:u.string().url(),name:u.string()}),yo=u.object({recipient:go.describe("The recipient of the credential"),credential:Gt.passthrough().or(la.passthrough()).or(Be.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:u.object({signingAuthority:Ls.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:u.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:u.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:u.object({suppress:u.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:u.object({id:u.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:u.object({issuer:u.object({name:u.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:u.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:u.object({name:u.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:u.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:u.object({name:u.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Ai=u.object({issuanceId:u.string(),status:Pr,recipient:go,claimUrl:u.string().url().optional(),recipientDid:u.string().optional()}),vo=u.object({token:u.string(),contactMethodId:u.string(),autoVerifyContactMethod:u.boolean().optional().default(!1),createdAt:u.string(),expiresAt:u.string(),used:u.boolean()})}}),$b=ip({"../learn-card-types/dist/index.js"(n,r){"use strict";r.exports=zb()}}),Wb=Fb($b());var Zi=K(n=>Wb.JWEValidator.safeParse(n).success,"isEncrypted");var Ce;(function(n){n.assertEqual=p=>p;function r(p){}o(r,"assertIs"),n.assertIs=r;function s(p){throw new Error}o(s,"assertNever"),n.assertNever=s,n.arrayToEnum=p=>{let g={};for(let y of p)g[y]=y;return g},n.getValidEnumValues=p=>{let g=n.objectKeys(p).filter(E=>typeof p[p[E]]!="number"),y={};for(let E of g)y[E]=p[E];return n.objectValues(y)},n.objectValues=p=>n.objectKeys(p).map(function(g){return p[g]}),n.objectKeys=typeof Object.keys=="function"?p=>Object.keys(p):p=>{let g=[];for(let y in p)Object.prototype.hasOwnProperty.call(p,y)&&g.push(y);return g},n.find=(p,g)=>{for(let y of p)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?p=>Number.isInteger(p):p=>typeof p=="number"&&isFinite(p)&&Math.floor(p)===p;function d(p,g=" | "){return p.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}o(d,"joinValues"),n.joinValues=d,n.jsonStringifyReplacer=(p,g)=>typeof g=="bigint"?g.toString():g})(Ce||(Ce={}));var kl;(function(n){n.mergeShapes=(r,s)=>({...r,...s})})(kl||(kl={}));var J=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=o(n=>{switch(typeof n){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(n)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(n)?J.array:n===null?J.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?J.promise:typeof Map<"u"&&n instanceof Map?J.map:typeof Set<"u"&&n instanceof Set?J.set:typeof Date<"u"&&n instanceof Date?J.date:J.object;default:return J.unknown}},"getParsedType"),z=Ce.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"]),Hb=o(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ct=class extends Error{constructor(r){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let s=r||function(g){return g.message},d={_errors:[]},p=o(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(p);else if(y.code==="invalid_return_type")p(y.returnTypeError);else if(y.code==="invalid_arguments")p(y.argumentsError);else if(y.path.length===0)d._errors.push(s(y));else{let E=d,S=0;for(;S<y.path.length;){let N=y.path[S];S===y.path.length-1?(E[N]=E[N]||{_errors:[]},E[N]._errors.push(s(y))):E[N]=E[N]||{_errors:[]},E=E[N],S++}}},"processError");return p(this),d}static assert(r){if(!(r instanceof ct))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=s=>s.message){let s={},d=[];for(let p of this.issues)p.path.length>0?(s[p.path[0]]=s[p.path[0]]||[],s[p.path[0]].push(r(p))):d.push(r(p));return{formErrors:d,fieldErrors:s}}get formErrors(){return this.flatten()}};o(ct,"ZodError");ct.create=n=>new ct(n);var La=o((n,r)=>{let s;switch(n.code){case z.invalid_type:n.received===J.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case z.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,Ce.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:s=`Unrecognized key(s) in object: ${Ce.joinValues(n.keys,", ")}`;break;case z.invalid_union:s="Invalid input";break;case z.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Ce.joinValues(n.options)}`;break;case z.invalid_enum_value:s=`Invalid enum value. Expected ${Ce.joinValues(n.options)}, received '${n.received}'`;break;case z.invalid_arguments:s="Invalid function arguments";break;case z.invalid_return_type:s="Invalid function return type";break;case z.invalid_date:s="Invalid date";break;case z.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:Ce.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case z.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case z.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case z.custom:s="Invalid input";break;case z.invalid_intersection_types:s="Intersection results could not be merged";break;case z.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case z.not_finite:s="Number must be finite";break;default:s=r.defaultError,Ce.assertNever(n)}return{message:s}},"errorMap"),sp=La;function Gb(n){sp=n}o(Gb,"setErrorMap");function Cc(){return sp}o(Cc,"getErrorMap");var Sc=o(n=>{let{data:r,path:s,errorMaps:d,issueData:p}=n,g=[...s,...p.path||[]],y={...p,path:g};if(p.message!==void 0)return{...p,path:g,message:p.message};let E="",S=d.filter(N=>!!N).slice().reverse();for(let N of S)E=N(y,{data:r,defaultError:E}).message;return{...p,path:g,message:E}},"makeIssue"),Jb=[];function H(n,r){let s=Cc(),d=Sc({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===La?void 0:La].filter(p=>!!p)});n.common.issues.push(d)}o(H,"addIssueToContext");var Qe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,s){let d=[];for(let p of s){if(p.status==="aborted")return de;p.status==="dirty"&&r.dirty(),d.push(p.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,s){let d=[];for(let p of s){let g=await p.key,y=await p.value;d.push({key:g,value:y})}return Qe.mergeObjectSync(r,d)}static mergeObjectSync(r,s){let d={};for(let p of s){let{key:g,value:y}=p;if(g.status==="aborted"||y.status==="aborted")return de;g.status==="dirty"&&r.dirty(),y.status==="dirty"&&r.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||p.alwaysSet)&&(d[g.value]=y.value)}return{status:r.value,value:d}}};o(Qe,"ParseStatus");var de=Object.freeze({status:"aborted"}),Va=o(n=>({status:"dirty",value:n}),"DIRTY"),gt=o(n=>({status:"valid",value:n}),"OK"),Pl=o(n=>n.status==="aborted","isAborted"),Il=o(n=>n.status==="dirty","isDirty"),Lo=o(n=>n.status==="valid","isValid"),Mo=o(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function Rc(n,r,s,d){if(s==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?n!==r||!d:!r.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?d:s==="a"?d.call(n):d?d.value:r.get(n)}o(Rc,"__classPrivateFieldGet");function cp(n,r,s,d,p){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?n!==r||!p:!r.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?p.call(n,s):p?p.value=s:r.set(n,s),s}o(cp,"__classPrivateFieldSet");var te;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(te||(te={}));var Vo,Do,Zt=class{constructor(r,s,d,p){this._cachedPath=[],this.parent=r,this.data=s,this._path=d,this._key=p}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}};o(Zt,"ParseInputLazyPath");var ap=o((n,r)=>{if(Lo(r))return{success:!0,data:r.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new ct(n.common.issues);return this._error=s,this._error}}},"handleResult");function ge(n){if(!n)return{};let{errorMap:r,invalid_type_error:s,required_error:d,description:p}=n;if(r&&(s||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:p}:{errorMap:o((y,E)=>{var S,N;let{message:F}=n;return y.code==="invalid_enum_value"?{message:F??E.defaultError}:typeof E.data>"u"?{message:(S=F??d)!==null&&S!==void 0?S:E.defaultError}:y.code!=="invalid_type"?{message:E.defaultError}:{message:(N=F??s)!==null&&N!==void 0?N:E.defaultError}},"customMap"),description:p}}o(ge,"processCreateParams");var me=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,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._def.description}_getType(r){return zn(r.data)}_getOrReturnCtx(r,s){return s||{common:r.parent.common,data:r.data,parsedType:zn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Qe,ctx:{common:r.parent.common,data:r.data,parsedType:zn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let s=this._parse(r);if(Mo(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(r){let s=this._parse(r);return Promise.resolve(s)}parse(r,s){let d=this.safeParse(r,s);if(d.success)return d.data;throw d.error}safeParse(r,s){var d;let p={common:{issues:[],async:(d=s?.async)!==null&&d!==void 0?d:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:zn(r)},g=this._parseSync({data:r,path:p.path,parent:p});return ap(p,g)}async parseAsync(r,s){let d=await this.safeParseAsync(r,s);if(d.success)return d.data;throw d.error}async safeParseAsync(r,s){let d={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:zn(r)},p=this._parse({data:r,path:d.path,parent:d}),g=await(Mo(p)?p:Promise.resolve(p));return ap(d,g)}refine(r,s){let d=o(p=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(p):s,"getIssueProperties");return this._refinement((p,g)=>{let y=r(p),E=o(()=>g.addIssue({code:z.custom,...d(p)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(S=>S?!0:(E(),!1)):y?!0:(E(),!1)})}refinement(r,s){return this._refinement((d,p)=>r(d)?!0:(p.addIssue(typeof s=="function"?s(d,p):s),!1))}_refinement(r){return new Rt({schema:this,typeName:ue.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return Ft.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return St.create(this,this._def)}promise(){return pn.create(this,this._def)}or(r){return Gn.create([this,r],this._def)}and(r){return Jn.create(this,r,this._def)}transform(r){return new Rt({...ge(this._def),schema:this,typeName:ue.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let s=typeof r=="function"?r:()=>r;return new ei({...ge(this._def),innerType:this,defaultValue:s,typeName:ue.ZodDefault})}brand(){return new Da({typeName:ue.ZodBranded,type:this,...ge(this._def)})}catch(r){let s=typeof r=="function"?r:()=>r;return new ti({...ge(this._def),innerType:this,catchValue:s,typeName:ue.ZodCatch})}describe(r){let s=this.constructor;return new s({...this._def,description:r})}pipe(r){return ri.create(this,r)}readonly(){return ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(me,"ZodType");var Yb=/^c[^\s-]{8,}$/i,Kb=/^[0-9a-z]+$/,Qb=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xb=/^[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,ew=/^[a-z0-9_-]{21}$/i,tw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Al,iw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aw=/^(([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})))$/,ow=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,up="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sw=new RegExp(`^${up}$`);function lp(n){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?r=`${r}\\.\\d{${n.precision}}`:n.precision==null&&(r=`${r}(\\.\\d+)?`),r}o(lp,"timeRegexSource");function cw(n){return new RegExp(`^${lp(n)}$`)}o(cw,"timeRegex");function dp(n){let r=`${up}T${lp(n)}`,s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${s.join("|")})`,new RegExp(`^${r}$`)}o(dp,"datetimeRegex");function uw(n,r){return!!((r==="v4"||!r)&&iw.test(n)||(r==="v6"||!r)&&aw.test(n))}o(uw,"isValidIP");var Ct=class extends me{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==J.string){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.string,received:g.parsedType}),de}let d=new Qe,p;for(let g of this._def.checks)if(g.kind==="min")r.data.length<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="max")r.data.length>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="length"){let y=r.data.length>g.value,E=r.data.length<g.value;(y||E)&&(p=this._getOrReturnCtx(r,p),y?H(p,{code:z.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):E&&H(p,{code:z.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),d.dirty())}else if(g.kind==="email")rw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"email",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="emoji")Al||(Al=new RegExp(nw,"u")),Al.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"emoji",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="uuid")Xb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"uuid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="nanoid")ew.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"nanoid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid")Yb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid2")Kb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid2",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="ulid")Qb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ulid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="url")try{new URL(r.data)}catch{p=this._getOrReturnCtx(r,p),H(p,{validation:"url",code:z.invalid_string,message:g.message}),d.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"regex",code:z.invalid_string,message:g.message}),d.dirty())):g.kind==="trim"?r.data=r.data.trim():g.kind==="includes"?r.data.includes(g.value,g.position)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),d.dirty()):g.kind==="toLowerCase"?r.data=r.data.toLowerCase():g.kind==="toUpperCase"?r.data=r.data.toUpperCase():g.kind==="startsWith"?r.data.startsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{startsWith:g.value},message:g.message}),d.dirty()):g.kind==="endsWith"?r.data.endsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{endsWith:g.value},message:g.message}),d.dirty()):g.kind==="datetime"?dp(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"datetime",message:g.message}),d.dirty()):g.kind==="date"?sw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"date",message:g.message}),d.dirty()):g.kind==="time"?cw(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"time",message:g.message}),d.dirty()):g.kind==="duration"?tw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"duration",code:z.invalid_string,message:g.message}),d.dirty()):g.kind==="ip"?uw(r.data,g.version)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ip",code:z.invalid_string,message:g.message}),d.dirty()):g.kind==="base64"?ow.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"base64",code:z.invalid_string,message:g.message}),d.dirty()):Ce.assertNever(g);return{status:d.value,value:r.data}}_regex(r,s,d){return this.refinement(p=>r.test(p),{validation:s,code:z.invalid_string,...te.errToObj(d)})}_addCheck(r){return new Ct({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var s,d;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(s=r?.offset)!==null&&s!==void 0?s:!1,local:(d=r?.local)!==null&&d!==void 0?d:!1,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,s){return this._addCheck({kind:"regex",regex:r,...te.errToObj(s)})}includes(r,s){return this._addCheck({kind:"includes",value:r,position:s?.position,...te.errToObj(s?.message)})}startsWith(r,s){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(s)})}endsWith(r,s){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(s)})}min(r,s){return this._addCheck({kind:"min",value:r,...te.errToObj(s)})}max(r,s){return this._addCheck({kind:"max",value:r,...te.errToObj(s)})}length(r,s){return this._addCheck({kind:"length",value:r,...te.errToObj(s)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxLength(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}};o(Ct,"ZodString");Ct.create=n=>{var r;return new Ct({checks:[],typeName:ue.ZodString,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ge(n)})};function lw(n,r){let s=(n.toString().split(".")[1]||"").length,d=(r.toString().split(".")[1]||"").length,p=s>d?s:d,g=parseInt(n.toFixed(p).replace(".","")),y=parseInt(r.toFixed(p).replace(".",""));return g%y/Math.pow(10,p)}o(lw,"floatSafeRemainder");var mr=class extends me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==J.number){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.number,received:g.parsedType}),de}let d,p=new Qe;for(let g of this._def.checks)g.kind==="int"?Ce.isInteger(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:z.invalid_type,expected:"integer",received:"float",message:g.message}),p.dirty()):g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="multipleOf"?lw(r.data,g.value)!==0&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):g.kind==="finite"?Number.isFinite(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_finite,message:g.message}),p.dirty()):Ce.assertNever(g);return{status:p.value,value:r.data}}gte(r,s){return this.setLimit("min",r,!0,te.toString(s))}gt(r,s){return this.setLimit("min",r,!1,te.toString(s))}lte(r,s){return this.setLimit("max",r,!0,te.toString(s))}lt(r,s){return this.setLimit("max",r,!1,te.toString(s))}setLimit(r,s,d,p){return new mr({...this._def,checks:[...this._def.checks,{kind:r,value:s,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new mr({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,s){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(s)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxValue(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Ce.isInteger(r.value))}get isFinite(){let r=null,s=null;for(let d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(s===null||d.value>s)&&(s=d.value):d.kind==="max"&&(r===null||d.value<r)&&(r=d.value)}return Number.isFinite(s)&&Number.isFinite(r)}};o(mr,"ZodNumber");mr.create=n=>new mr({checks:[],typeName:ue.ZodNumber,coerce:n?.coerce||!1,...ge(n)});var gr=class extends me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==J.bigint){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.bigint,received:g.parsedType}),de}let d,p=new Qe;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="multipleOf"?r.data%g.value!==BigInt(0)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):Ce.assertNever(g);return{status:p.value,value:r.data}}gte(r,s){return this.setLimit("min",r,!0,te.toString(s))}gt(r,s){return this.setLimit("min",r,!1,te.toString(s))}lte(r,s){return this.setLimit("max",r,!0,te.toString(s))}lt(r,s){return this.setLimit("max",r,!1,te.toString(s))}setLimit(r,s,d,p){return new gr({...this._def,checks:[...this._def.checks,{kind:r,value:s,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new gr({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,s){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(s)})}get minValue(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxValue(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}};o(gr,"ZodBigInt");gr.create=n=>{var r;return new gr({checks:[],typeName:ue.ZodBigInt,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ge(n)})};var $n=class extends me{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==J.boolean){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.boolean,received:d.parsedType}),de}return gt(r.data)}};o($n,"ZodBoolean");$n.create=n=>new $n({typeName:ue.ZodBoolean,coerce:n?.coerce||!1,...ge(n)});var Vr=class extends me{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==J.date){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.date,received:g.parsedType}),de}if(isNaN(r.data.getTime())){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_date}),de}let d=new Qe,p;for(let g of this._def.checks)g.kind==="min"?r.data.getTime()<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),d.dirty()):g.kind==="max"?r.data.getTime()>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),d.dirty()):Ce.assertNever(g);return{status:d.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Vr({...this._def,checks:[...this._def.checks,r]})}min(r,s){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(s)})}max(r,s){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(s)})}get minDate(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r!=null?new Date(r):null}};o(Vr,"ZodDate");Vr.create=n=>new Vr({checks:[],coerce:n?.coerce||!1,typeName:ue.ZodDate,...ge(n)});var qi=class extends me{_parse(r){if(this._getType(r)!==J.symbol){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.symbol,received:d.parsedType}),de}return gt(r.data)}};o(qi,"ZodSymbol");qi.create=n=>new qi({typeName:ue.ZodSymbol,...ge(n)});var Wn=class extends me{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.undefined,received:d.parsedType}),de}return gt(r.data)}};o(Wn,"ZodUndefined");Wn.create=n=>new Wn({typeName:ue.ZodUndefined,...ge(n)});var Hn=class extends me{_parse(r){if(this._getType(r)!==J.null){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.null,received:d.parsedType}),de}return gt(r.data)}};o(Hn,"ZodNull");Hn.create=n=>new Hn({typeName:ue.ZodNull,...ge(n)});var dn=class extends me{constructor(){super(...arguments),this._any=!0}_parse(r){return gt(r.data)}};o(dn,"ZodAny");dn.create=n=>new dn({typeName:ue.ZodAny,...ge(n)});var Dr=class extends me{constructor(){super(...arguments),this._unknown=!0}_parse(r){return gt(r.data)}};o(Dr,"ZodUnknown");Dr.create=n=>new Dr({typeName:ue.ZodUnknown,...ge(n)});var rr=class extends me{_parse(r){let s=this._getOrReturnCtx(r);return H(s,{code:z.invalid_type,expected:J.never,received:s.parsedType}),de}};o(rr,"ZodNever");rr.create=n=>new rr({typeName:ue.ZodNever,...ge(n)});var Fi=class extends me{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.void,received:d.parsedType}),de}return gt(r.data)}};o(Fi,"ZodVoid");Fi.create=n=>new Fi({typeName:ue.ZodVoid,...ge(n)});var St=class extends me{_parse(r){let{ctx:s,status:d}=this._processInputParams(r),p=this._def;if(s.parsedType!==J.array)return H(s,{code:z.invalid_type,expected:J.array,received:s.parsedType}),de;if(p.exactLength!==null){let y=s.data.length>p.exactLength.value,E=s.data.length<p.exactLength.value;(y||E)&&(H(s,{code:y?z.too_big:z.too_small,minimum:E?p.exactLength.value:void 0,maximum:y?p.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:p.exactLength.message}),d.dirty())}if(p.minLength!==null&&s.data.length<p.minLength.value&&(H(s,{code:z.too_small,minimum:p.minLength.value,type:"array",inclusive:!0,exact:!1,message:p.minLength.message}),d.dirty()),p.maxLength!==null&&s.data.length>p.maxLength.value&&(H(s,{code:z.too_big,maximum:p.maxLength.value,type:"array",inclusive:!0,exact:!1,message:p.maxLength.message}),d.dirty()),s.common.async)return Promise.all([...s.data].map((y,E)=>p.type._parseAsync(new Zt(s,y,s.path,E)))).then(y=>Qe.mergeArray(d,y));let g=[...s.data].map((y,E)=>p.type._parseSync(new Zt(s,y,s.path,E)));return Qe.mergeArray(d,g)}get element(){return this._def.type}min(r,s){return new St({...this._def,minLength:{value:r,message:te.toString(s)}})}max(r,s){return new St({...this._def,maxLength:{value:r,message:te.toString(s)}})}length(r,s){return new St({...this._def,exactLength:{value:r,message:te.toString(s)}})}nonempty(r){return this.min(1,r)}};o(St,"ZodArray");St.create=(n,r)=>new St({type:n,minLength:null,maxLength:null,exactLength:null,typeName:ue.ZodArray,...ge(r)});function ja(n){if(n instanceof Me){let r={};for(let s in n.shape){let d=n.shape[s];r[s]=Ft.create(ja(d))}return new Me({...n._def,shape:()=>r})}else return n instanceof St?new St({...n._def,type:ja(n.element)}):n instanceof Ft?Ft.create(ja(n.unwrap())):n instanceof vr?vr.create(ja(n.unwrap())):n instanceof qt?qt.create(n.items.map(r=>ja(r))):n}o(ja,"deepPartialify");var Me=class extends me{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),s=Ce.objectKeys(r);return this._cached={shape:r,keys:s}}_parse(r){if(this._getType(r)!==J.object){let N=this._getOrReturnCtx(r);return H(N,{code:z.invalid_type,expected:J.object,received:N.parsedType}),de}let{status:d,ctx:p}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),E=[];if(!(this._def.catchall instanceof rr&&this._def.unknownKeys==="strip"))for(let N in p.data)y.includes(N)||E.push(N);let S=[];for(let N of y){let F=g[N],V=p.data[N];S.push({key:{status:"valid",value:N},value:F._parse(new Zt(p,V,p.path,N)),alwaysSet:N in p.data})}if(this._def.catchall instanceof rr){let N=this._def.unknownKeys;if(N==="passthrough")for(let F of E)S.push({key:{status:"valid",value:F},value:{status:"valid",value:p.data[F]}});else if(N==="strict")E.length>0&&(H(p,{code:z.unrecognized_keys,keys:E}),d.dirty());else if(N!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let N=this._def.catchall;for(let F of E){let V=p.data[F];S.push({key:{status:"valid",value:F},value:N._parse(new Zt(p,V,p.path,F)),alwaysSet:F in p.data})}}return p.common.async?Promise.resolve().then(async()=>{let N=[];for(let F of S){let V=await F.key,k=await F.value;N.push({key:V,value:k,alwaysSet:F.alwaysSet})}return N}).then(N=>Qe.mergeObjectSync(d,N)):Qe.mergeObjectSync(d,S)}get shape(){return this._def.shape()}strict(r){return te.errToObj,new Me({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(s,d)=>{var p,g,y,E;let S=(y=(g=(p=this._def).errorMap)===null||g===void 0?void 0:g.call(p,s,d).message)!==null&&y!==void 0?y:d.defaultError;return s.code==="unrecognized_keys"?{message:(E=te.errToObj(r).message)!==null&&E!==void 0?E:S}:{message:S}}}:{}})}strip(){return new Me({...this._def,unknownKeys:"strip"})}passthrough(){return new Me({...this._def,unknownKeys:"passthrough"})}extend(r){return new Me({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new Me({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ue.ZodObject})}setKey(r,s){return this.augment({[r]:s})}catchall(r){return new Me({...this._def,catchall:r})}pick(r){let s={};return Ce.objectKeys(r).forEach(d=>{r[d]&&this.shape[d]&&(s[d]=this.shape[d])}),new Me({...this._def,shape:()=>s})}omit(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{r[d]||(s[d]=this.shape[d])}),new Me({...this._def,shape:()=>s})}deepPartial(){return ja(this)}partial(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{let p=this.shape[d];r&&!r[d]?s[d]=p:s[d]=p.optional()}),new Me({...this._def,shape:()=>s})}required(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{if(r&&!r[d])s[d]=this.shape[d];else{let g=this.shape[d];for(;g instanceof Ft;)g=g._def.innerType;s[d]=g}}),new Me({...this._def,shape:()=>s})}keyof(){return fp(Ce.objectKeys(this.shape))}};o(Me,"ZodObject");Me.create=(n,r)=>new Me({shape:()=>n,unknownKeys:"strip",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});Me.strictCreate=(n,r)=>new Me({shape:()=>n,unknownKeys:"strict",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});Me.lazycreate=(n,r)=>new Me({shape:n,unknownKeys:"strip",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});var Gn=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=this._def.options;function p(g){for(let E of g)if(E.result.status==="valid")return E.result;for(let E of g)if(E.result.status==="dirty")return s.common.issues.push(...E.ctx.common.issues),E.result;let y=g.map(E=>new ct(E.ctx.common.issues));return H(s,{code:z.invalid_union,unionErrors:y}),de}if(o(p,"handleResults"),s.common.async)return Promise.all(d.map(async g=>{let y={...s,common:{...s.common,issues:[]},parent:null};return{result:await g._parseAsync({data:s.data,path:s.path,parent:y}),ctx:y}})).then(p);{let g,y=[];for(let S of d){let N={...s,common:{...s.common,issues:[]},parent:null},F=S._parseSync({data:s.data,path:s.path,parent:N});if(F.status==="valid")return F;F.status==="dirty"&&!g&&(g={result:F,ctx:N}),N.common.issues.length&&y.push(N.common.issues)}if(g)return s.common.issues.push(...g.ctx.common.issues),g.result;let E=y.map(S=>new ct(S));return H(s,{code:z.invalid_union,unionErrors:E}),de}}get options(){return this._def.options}};o(Gn,"ZodUnion");Gn.create=(n,r)=>new Gn({options:n,typeName:ue.ZodUnion,...ge(r)});var ln=o(n=>n instanceof Kn?ln(n.schema):n instanceof Rt?ln(n.innerType()):n instanceof Qn?[n.value]:n instanceof yr?n.options:n instanceof Xn?Ce.objectValues(n.enum):n instanceof ei?ln(n._def.innerType):n instanceof Wn?[void 0]:n instanceof Hn?[null]:n instanceof Ft?[void 0,...ln(n.unwrap())]:n instanceof vr?[null,...ln(n.unwrap())]:n instanceof Da||n instanceof ni?ln(n.unwrap()):n instanceof ti?ln(n._def.innerType):[],"getDiscriminator"),zi=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.object)return H(s,{code:z.invalid_type,expected:J.object,received:s.parsedType}),de;let d=this.discriminator,p=s.data[d],g=this.optionsMap.get(p);return g?s.common.async?g._parseAsync({data:s.data,path:s.path,parent:s}):g._parseSync({data:s.data,path:s.path,parent:s}):(H(s,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),de)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,s,d){let p=new Map;for(let g of s){let y=ln(g.shape[r]);if(!y.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let E of y){if(p.has(E))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(E)}`);p.set(E,g)}}return new zi({typeName:ue.ZodDiscriminatedUnion,discriminator:r,options:s,optionsMap:p,...ge(d)})}};o(zi,"ZodDiscriminatedUnion");function Nl(n,r){let s=zn(n),d=zn(r);if(n===r)return{valid:!0,data:n};if(s===J.object&&d===J.object){let p=Ce.objectKeys(r),g=Ce.objectKeys(n).filter(E=>p.indexOf(E)!==-1),y={...n,...r};for(let E of g){let S=Nl(n[E],r[E]);if(!S.valid)return{valid:!1};y[E]=S.data}return{valid:!0,data:y}}else if(s===J.array&&d===J.array){if(n.length!==r.length)return{valid:!1};let p=[];for(let g=0;g<n.length;g++){let y=n[g],E=r[g],S=Nl(y,E);if(!S.valid)return{valid:!1};p.push(S.data)}return{valid:!0,data:p}}else return s===J.date&&d===J.date&&+n==+r?{valid:!0,data:n}:{valid:!1}}o(Nl,"mergeValues");var Jn=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r),p=o((g,y)=>{if(Pl(g)||Pl(y))return de;let E=Nl(g.value,y.value);return E.valid?((Il(g)||Il(y))&&s.dirty(),{status:s.value,value:E.data}):(H(d,{code:z.invalid_intersection_types}),de)},"handleParsed");return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([g,y])=>p(g,y)):p(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}};o(Jn,"ZodIntersection");Jn.create=(n,r,s)=>new Jn({left:n,right:r,typeName:ue.ZodIntersection,...ge(s)});var qt=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.array)return H(d,{code:z.invalid_type,expected:J.array,received:d.parsedType}),de;if(d.data.length<this._def.items.length)return H(d,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&d.data.length>this._def.items.length&&(H(d,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let g=[...d.data].map((y,E)=>{let S=this._def.items[E]||this._def.rest;return S?S._parse(new Zt(d,y,d.path,E)):null}).filter(y=>!!y);return d.common.async?Promise.all(g).then(y=>Qe.mergeArray(s,y)):Qe.mergeArray(s,g)}get items(){return this._def.items}rest(r){return new qt({...this._def,rest:r})}};o(qt,"ZodTuple");qt.create=(n,r)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qt({items:n,typeName:ue.ZodTuple,rest:null,...ge(r)})};var Yn=class extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.object)return H(d,{code:z.invalid_type,expected:J.object,received:d.parsedType}),de;let p=[],g=this._def.keyType,y=this._def.valueType;for(let E in d.data)p.push({key:g._parse(new Zt(d,E,d.path,E)),value:y._parse(new Zt(d,d.data[E],d.path,E)),alwaysSet:E in d.data});return d.common.async?Qe.mergeObjectAsync(s,p):Qe.mergeObjectSync(s,p)}get element(){return this._def.valueType}static create(r,s,d){return s instanceof me?new Yn({keyType:r,valueType:s,typeName:ue.ZodRecord,...ge(d)}):new Yn({keyType:Ct.create(),valueType:r,typeName:ue.ZodRecord,...ge(s)})}};o(Yn,"ZodRecord");var $i=class extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.map)return H(d,{code:z.invalid_type,expected:J.map,received:d.parsedType}),de;let p=this._def.keyType,g=this._def.valueType,y=[...d.data.entries()].map(([E,S],N)=>({key:p._parse(new Zt(d,E,d.path,[N,"key"])),value:g._parse(new Zt(d,S,d.path,[N,"value"]))}));if(d.common.async){let E=new Map;return Promise.resolve().then(async()=>{for(let S of y){let N=await S.key,F=await S.value;if(N.status==="aborted"||F.status==="aborted")return de;(N.status==="dirty"||F.status==="dirty")&&s.dirty(),E.set(N.value,F.value)}return{status:s.value,value:E}})}else{let E=new Map;for(let S of y){let N=S.key,F=S.value;if(N.status==="aborted"||F.status==="aborted")return de;(N.status==="dirty"||F.status==="dirty")&&s.dirty(),E.set(N.value,F.value)}return{status:s.value,value:E}}}};o($i,"ZodMap");$i.create=(n,r,s)=>new $i({valueType:r,keyType:n,typeName:ue.ZodMap,...ge(s)});var Lr=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.set)return H(d,{code:z.invalid_type,expected:J.set,received:d.parsedType}),de;let p=this._def;p.minSize!==null&&d.data.size<p.minSize.value&&(H(d,{code:z.too_small,minimum:p.minSize.value,type:"set",inclusive:!0,exact:!1,message:p.minSize.message}),s.dirty()),p.maxSize!==null&&d.data.size>p.maxSize.value&&(H(d,{code:z.too_big,maximum:p.maxSize.value,type:"set",inclusive:!0,exact:!1,message:p.maxSize.message}),s.dirty());let g=this._def.valueType;function y(S){let N=new Set;for(let F of S){if(F.status==="aborted")return de;F.status==="dirty"&&s.dirty(),N.add(F.value)}return{status:s.value,value:N}}o(y,"finalizeSet");let E=[...d.data.values()].map((S,N)=>g._parse(new Zt(d,S,d.path,N)));return d.common.async?Promise.all(E).then(S=>y(S)):y(E)}min(r,s){return new Lr({...this._def,minSize:{value:r,message:te.toString(s)}})}max(r,s){return new Lr({...this._def,maxSize:{value:r,message:te.toString(s)}})}size(r,s){return this.min(r,s).max(r,s)}nonempty(r){return this.min(1,r)}};o(Lr,"ZodSet");Lr.create=(n,r)=>new Lr({valueType:n,minSize:null,maxSize:null,typeName:ue.ZodSet,...ge(r)});var fn=class extends me{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.function)return H(s,{code:z.invalid_type,expected:J.function,received:s.parsedType}),de;function d(E,S){return Sc({data:E,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Cc(),La].filter(N=>!!N),issueData:{code:z.invalid_arguments,argumentsError:S}})}o(d,"makeArgsIssue");function p(E,S){return Sc({data:E,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Cc(),La].filter(N=>!!N),issueData:{code:z.invalid_return_type,returnTypeError:S}})}o(p,"makeReturnsIssue");let g={errorMap:s.common.contextualErrorMap},y=s.data;if(this._def.returns instanceof pn){let E=this;return gt(async function(...S){let N=new ct([]),F=await E._def.args.parseAsync(S,g).catch(R=>{throw N.addIssue(d(S,R)),N}),V=await Reflect.apply(y,this,F);return await E._def.returns._def.type.parseAsync(V,g).catch(R=>{throw N.addIssue(p(V,R)),N})})}else{let E=this;return gt(function(...S){let N=E._def.args.safeParse(S,g);if(!N.success)throw new ct([d(S,N.error)]);let F=Reflect.apply(y,this,N.data),V=E._def.returns.safeParse(F,g);if(!V.success)throw new ct([p(F,V.error)]);return V.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new fn({...this._def,args:qt.create(r).rest(Dr.create())})}returns(r){return new fn({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,s,d){return new fn({args:r||qt.create([]).rest(Dr.create()),returns:s||Dr.create(),typeName:ue.ZodFunction,...ge(d)})}};o(fn,"ZodFunction");var Kn=class extends me{get schema(){return this._def.getter()}_parse(r){let{ctx:s}=this._processInputParams(r);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};o(Kn,"ZodLazy");Kn.create=(n,r)=>new Kn({getter:n,typeName:ue.ZodLazy,...ge(r)});var Qn=class extends me{_parse(r){if(r.data!==this._def.value){let s=this._getOrReturnCtx(r);return H(s,{received:s.data,code:z.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:r.data}}get value(){return this._def.value}};o(Qn,"ZodLiteral");Qn.create=(n,r)=>new Qn({value:n,typeName:ue.ZodLiteral,...ge(r)});function fp(n,r){return new yr({values:n,typeName:ue.ZodEnum,...ge(r)})}o(fp,"createZodEnum");var yr=class extends me{constructor(){super(...arguments),Vo.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let s=this._getOrReturnCtx(r),d=this._def.values;return H(s,{expected:Ce.joinValues(d),received:s.parsedType,code:z.invalid_type}),de}if(Rc(this,Vo,"f")||cp(this,Vo,new Set(this._def.values),"f"),!Rc(this,Vo,"f").has(r.data)){let s=this._getOrReturnCtx(r),d=this._def.values;return H(s,{received:s.data,code:z.invalid_enum_value,options:d}),de}return gt(r.data)}get options(){return this._def.values}get enum(){let r={};for(let s of this._def.values)r[s]=s;return r}get Values(){let r={};for(let s of this._def.values)r[s]=s;return r}get Enum(){let r={};for(let s of this._def.values)r[s]=s;return r}extract(r,s=this._def){return yr.create(r,{...this._def,...s})}exclude(r,s=this._def){return yr.create(this.options.filter(d=>!r.includes(d)),{...this._def,...s})}};o(yr,"ZodEnum");Vo=new WeakMap;yr.create=fp;var Xn=class extends me{constructor(){super(...arguments),Do.set(this,void 0)}_parse(r){let s=Ce.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==J.string&&d.parsedType!==J.number){let p=Ce.objectValues(s);return H(d,{expected:Ce.joinValues(p),received:d.parsedType,code:z.invalid_type}),de}if(Rc(this,Do,"f")||cp(this,Do,new Set(Ce.getValidEnumValues(this._def.values)),"f"),!Rc(this,Do,"f").has(r.data)){let p=Ce.objectValues(s);return H(d,{received:d.data,code:z.invalid_enum_value,options:p}),de}return gt(r.data)}get enum(){return this._def.values}};o(Xn,"ZodNativeEnum");Do=new WeakMap;Xn.create=(n,r)=>new Xn({values:n,typeName:ue.ZodNativeEnum,...ge(r)});var pn=class extends me{unwrap(){return this._def.type}_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.promise&&s.common.async===!1)return H(s,{code:z.invalid_type,expected:J.promise,received:s.parsedType}),de;let d=s.parsedType===J.promise?s.data:Promise.resolve(s.data);return gt(d.then(p=>this._def.type.parseAsync(p,{path:s.path,errorMap:s.common.contextualErrorMap})))}};o(pn,"ZodPromise");pn.create=(n,r)=>new pn({type:n,typeName:ue.ZodPromise,...ge(r)});var Rt=class extends me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:s,ctx:d}=this._processInputParams(r),p=this._def.effect||null,g={addIssue:y=>{H(d,y),y.fatal?s.abort():s.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),p.type==="preprocess"){let y=p.transform(d.data,g);if(d.common.async)return Promise.resolve(y).then(async E=>{if(s.value==="aborted")return de;let S=await this._def.schema._parseAsync({data:E,path:d.path,parent:d});return S.status==="aborted"?de:S.status==="dirty"||s.value==="dirty"?Va(S.value):S});{if(s.value==="aborted")return de;let E=this._def.schema._parseSync({data:y,path:d.path,parent:d});return E.status==="aborted"?de:E.status==="dirty"||s.value==="dirty"?Va(E.value):E}}if(p.type==="refinement"){let y=o(E=>{let S=p.refinement(E,g);if(d.common.async)return Promise.resolve(S);if(S instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return E},"executeRefinement");if(d.common.async===!1){let E=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return E.status==="aborted"?de:(E.status==="dirty"&&s.dirty(),y(E.value),{status:s.value,value:E.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(E=>E.status==="aborted"?de:(E.status==="dirty"&&s.dirty(),y(E.value).then(()=>({status:s.value,value:E.value}))))}if(p.type==="transform")if(d.common.async===!1){let y=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Lo(y))return y;let E=p.transform(y.value,g);if(E instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:E}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(y=>Lo(y)?Promise.resolve(p.transform(y.value,g)).then(E=>({status:s.value,value:E})):y);Ce.assertNever(p)}};o(Rt,"ZodEffects");Rt.create=(n,r,s)=>new Rt({schema:n,typeName:ue.ZodEffects,effect:r,...ge(s)});Rt.createWithPreprocess=(n,r,s)=>new Rt({schema:r,effect:{type:"preprocess",transform:n},typeName:ue.ZodEffects,...ge(s)});var Ft=class extends me{_parse(r){return this._getType(r)===J.undefined?gt(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};o(Ft,"ZodOptional");Ft.create=(n,r)=>new Ft({innerType:n,typeName:ue.ZodOptional,...ge(r)});var vr=class extends me{_parse(r){return this._getType(r)===J.null?gt(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};o(vr,"ZodNullable");vr.create=(n,r)=>new vr({innerType:n,typeName:ue.ZodNullable,...ge(r)});var ei=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=s.data;return s.parsedType===J.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};o(ei,"ZodDefault");ei.create=(n,r)=>new ei({innerType:n,typeName:ue.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...ge(r)});var ti=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d={...s,common:{...s.common,issues:[]}},p=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return Mo(p)?p.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new ct(d.common.issues)},input:d.data})})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new ct(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}};o(ti,"ZodCatch");ti.create=(n,r)=>new ti({innerType:n,typeName:ue.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...ge(r)});var Wi=class extends me{_parse(r){if(this._getType(r)!==J.nan){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.nan,received:d.parsedType}),de}return{status:"valid",value:r.data}}};o(Wi,"ZodNaN");Wi.create=n=>new Wi({typeName:ue.ZodNaN,...ge(n)});var dw=Symbol("zod_brand"),Da=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=s.data;return this._def.type._parse({data:d,path:s.path,parent:s})}unwrap(){return this._def.type}};o(Da,"ZodBranded");var ri=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.common.async)return o(async()=>{let g=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return g.status==="aborted"?de:g.status==="dirty"?(s.dirty(),Va(g.value)):this._def.out._parseAsync({data:g.value,path:d.path,parent:d})},"handleAsync")();{let p=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return p.status==="aborted"?de:p.status==="dirty"?(s.dirty(),{status:"dirty",value:p.value}):this._def.out._parseSync({data:p.value,path:d.path,parent:d})}}static create(r,s){return new ri({in:r,out:s,typeName:ue.ZodPipeline})}};o(ri,"ZodPipeline");var ni=class extends me{_parse(r){let s=this._def.innerType._parse(r),d=o(p=>(Lo(p)&&(p.value=Object.freeze(p.value)),p),"freeze");return Mo(s)?s.then(p=>d(p)):d(s)}unwrap(){return this._def.innerType}};o(ni,"ZodReadonly");ni.create=(n,r)=>new ni({innerType:n,typeName:ue.ZodReadonly,...ge(r)});function pp(n,r={},s){return n?dn.create().superRefine((d,p)=>{var g,y;if(!n(d)){let E=typeof r=="function"?r(d):typeof r=="string"?{message:r}:r,S=(y=(g=E.fatal)!==null&&g!==void 0?g:s)!==null&&y!==void 0?y:!0,N=typeof E=="string"?{message:E}:E;p.addIssue({code:"custom",...N,fatal:S})}}):dn.create()}o(pp,"custom");var fw={object:Me.lazycreate},ue;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(ue||(ue={}));var pw=o((n,r={message:`Input not instance of ${n.name}`})=>pp(s=>s instanceof n,r),"instanceOfType"),hp=Ct.create,mp=mr.create,hw=Wi.create,mw=gr.create,gp=$n.create,gw=Vr.create,yw=qi.create,vw=Wn.create,_w=Hn.create,bw=dn.create,ww=Dr.create,xw=rr.create,Ew=Fi.create,Tw=St.create,Cw=Me.create,Sw=Me.strictCreate,Rw=Gn.create,Ow=zi.create,Aw=Jn.create,kw=qt.create,Pw=Yn.create,Iw=$i.create,Nw=Lr.create,jw=fn.create,Vw=Kn.create,Dw=Qn.create,Lw=yr.create,Mw=Xn.create,Uw=pn.create,op=Rt.create,Bw=Ft.create,Zw=vr.create,qw=Rt.createWithPreprocess,Fw=ri.create,zw=o(()=>hp().optional(),"ostring"),$w=o(()=>mp().optional(),"onumber"),Ww=o(()=>gp().optional(),"oboolean"),Hw={string:n=>Ct.create({...n,coerce:!0}),number:n=>mr.create({...n,coerce:!0}),boolean:n=>$n.create({...n,coerce:!0}),bigint:n=>gr.create({...n,coerce:!0}),date:n=>Vr.create({...n,coerce:!0})},Gw=de,c=Object.freeze({__proto__:null,defaultErrorMap:La,setErrorMap:Gb,getErrorMap:Cc,makeIssue:Sc,EMPTY_PATH:Jb,addIssueToContext:H,ParseStatus:Qe,INVALID:de,DIRTY:Va,OK:gt,isAborted:Pl,isDirty:Il,isValid:Lo,isAsync:Mo,get util(){return Ce},get objectUtil(){return kl},ZodParsedType:J,getParsedType:zn,ZodType:me,datetimeRegex:dp,ZodString:Ct,ZodNumber:mr,ZodBigInt:gr,ZodBoolean:$n,ZodDate:Vr,ZodSymbol:qi,ZodUndefined:Wn,ZodNull:Hn,ZodAny:dn,ZodUnknown:Dr,ZodNever:rr,ZodVoid:Fi,ZodArray:St,ZodObject:Me,ZodUnion:Gn,ZodDiscriminatedUnion:zi,ZodIntersection:Jn,ZodTuple:qt,ZodRecord:Yn,ZodMap:$i,ZodSet:Lr,ZodFunction:fn,ZodLazy:Kn,ZodLiteral:Qn,ZodEnum:yr,ZodNativeEnum:Xn,ZodPromise:pn,ZodEffects:Rt,ZodTransformer:Rt,ZodOptional:Ft,ZodNullable:vr,ZodDefault:ei,ZodCatch:ti,ZodNaN:Wi,BRAND:dw,ZodBranded:Da,ZodPipeline:ri,ZodReadonly:ni,custom:pp,Schema:me,ZodSchema:me,late:fw,get ZodFirstPartyTypeKind(){return ue},coerce:Hw,any:bw,array:Tw,bigint:mw,boolean:gp,date:gw,discriminatedUnion:Ow,effect:op,enum:Lw,function:jw,instanceof:pw,intersection:Aw,lazy:Vw,literal:Dw,map:Iw,nan:hw,nativeEnum:Mw,never:xw,null:_w,nullable:Zw,number:mp,object:Cw,oboolean:Ww,onumber:$w,optional:Bw,ostring:zw,pipeline:Fw,preprocess:qw,promise:Uw,record:Pw,set:Nw,strictObject:Sw,string:hp,symbol:yw,transformer:op,tuple:kw,undefined:vw,union:Rw,unknown:ww,void:Ew,NEVER:Gw,ZodIssueCode:z,quotelessJson:Hb,ZodError:ct});var Ma=Symbol("current"),Hi=Symbol("previous");var Uo=o((n,{ref:r,refType:s,param:d,header:p,...g}={})=>({...g,...n}),"mergeOpenApi");function yp(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...E}=this._def,S=new this.constructor({...E,zodOpenApi:{openapi:Uo(g,y?.openapi)}});return S._def.zodOpenApi[Ma]=S,y&&(S._def.zodOpenApi[Hi]=this),S};let r=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=r.apply(this,g),E=y._def;if(E.zodOpenApi){let S={...E.zodOpenApi};S.openapi=Uo({description:g[0]},S.openapi),S[Hi]=this,S[Ma]=y,E.zodOpenApi=S}else E.zodOpenApi={openapi:{description:g[0]},[Ma]:y};return y};let s=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=s.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),S[Hi]=this,y._def.zodOpenApi=S}else y._def.zodOpenApi={[Hi]:this};return y};let d=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=d.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),delete S[Hi],delete S[Ma],y._def.zodOpenApi=S}return y};let p=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=p.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),delete S[Hi],delete S[Ma],y._def.zodOpenApi=S}return y}}o(yp,"extendZodWithOpenApi");yp(c);var Jw=Object.defineProperty,Yw=o((n,r)=>Jw(n,"name",{value:r,configurable:!0}),"__name"),Ac=c.array(c.string().or(c.record(c.any()))),HO=c.object({type:c.string().optional(),narrative:c.string().optional()}),kc=c.string().or(c.object({id:c.string(),type:c.string(),caption:c.string().optional()})),Kw=c.object({type:c.string().min(1).or(c.string().array().nonempty()),latitude:c.number(),longitude:c.number()}),Qw=c.object({type:c.string().min(1).or(c.string().array().nonempty()),addressCountry:c.string().optional(),addressCountryCode:c.string().optional(),addressRegion:c.string().optional(),addressLocality:c.string().optional(),streetAddress:c.string().optional(),postOfficeBoxNumber:c.string().optional(),postalCode:c.string().optional(),geo:Kw.optional()}),Xw=c.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(c.string()),Sp=c.object({type:c.string().min(1).or(c.string().array().nonempty()),identifier:c.string(),identifierType:Xw}),Bo=c.string().or(c.object({id:c.string().optional(),type:c.string().or(c.string().array().nonempty().optional()),name:c.string().optional(),url:c.string().optional(),phone:c.string().optional(),description:c.string().optional(),endorsement:c.any().array().optional(),image:kc.optional(),email:c.string().email().optional(),address:Qw.optional(),otherIdentifier:Sp.array().optional(),official:c.string().optional(),parentOrg:c.any().optional(),familyName:c.string().optional(),givenName:c.string().optional(),additionalName:c.string().optional(),patronymicName:c.string().optional(),honorificPrefix:c.string().optional(),honorificSuffix:c.string().optional(),familyNamePrefix:c.string().optional(),dateOfBirth:c.string().optional()}).catchall(c.any())),Vl=c.object({id:c.string().optional()}).catchall(c.any()),Oc=c.object({type:c.string(),id:c.string()}).catchall(c.any()),vp=c.object({id:c.string(),type:c.string()}).catchall(c.any()),_p=c.object({id:c.string().optional(),type:c.string()}).catchall(c.any()),bp=c.object({type:c.string(),id:c.string().optional()}).catchall(c.any()),wp=c.object({type:c.string().or(c.string().array().nonempty()),id:c.string().optional()}).catchall(c.any()),Zo=c.object({"@context":Ac,id:c.string().optional(),type:c.string().array().nonempty(),issuer:Bo,credentialSubject:Vl.or(Vl.array()),refreshService:_p.or(_p.array()).optional(),credentialSchema:vp.or(vp.array()).optional(),issuanceDate:c.string().optional(),expirationDate:c.string().optional(),credentialStatus:Oc.or(Oc.array()).optional(),name:c.string().optional(),description:c.string().optional(),validFrom:c.string().optional(),validUntil:c.string().optional(),status:Oc.or(Oc.array()).optional(),termsOfUse:bp.or(bp.array()).optional(),evidence:wp.or(wp.array()).optional()}).catchall(c.any()),Mr=c.object({type:c.string(),created:c.string(),challenge:c.string().optional(),domain:c.string().optional(),nonce:c.string().optional(),proofPurpose:c.string(),verificationMethod:c.string(),jws:c.string().optional()}).catchall(c.any()),Ji=Zo.extend({proof:Mr.or(Mr.array())}),ex=c.object({"@context":Ac,id:c.string().optional(),type:c.string().or(c.string().array().nonempty()),verifiableCredential:Ji.or(Ji.array()).optional(),holder:c.string().optional()}).catchall(c.any()),qo=ex.extend({proof:Mr.or(Mr.array())}),Ml=c.object({kty:c.string(),crv:c.string(),x:c.string(),y:c.string().optional(),n:c.string().optional(),d:c.string().optional()}),YO=Ml.omit({d:!0}).extend({d:c.string()}),tx=c.object({alg:c.string(),iv:c.string(),tag:c.string(),epk:Ml.partial().optional(),kid:c.string().optional(),apv:c.string().optional(),apu:c.string().optional()}),rx=c.object({header:tx,encrypted_key:c.string()}),nx=c.object({protected:c.string(),iv:c.string(),ciphertext:c.string(),tag:c.string(),aad:c.string().optional(),recipients:rx.array().optional()}),Gi=c.string().or(c.object({"@context":Ac.optional(),id:c.string(),type:c.string(),controller:c.string(),publicKeyJwk:Ml.optional(),publicKeyBase58:c.string().optional(),publicKeyMultibase:c.string().optional(),blockChainAccountId:c.string().optional()}).catchall(c.any())),ix=c.object({id:c.string(),type:c.string().or(c.string().array().nonempty()),serviceEndpoint:c.any().or(c.any().array().nonempty())}).catchall(c.any()),KO=c.object({"@context":Ac,id:c.string(),alsoKnownAs:c.string().optional(),controller:c.string().or(c.string().array().nonempty()).optional(),verificationMethod:Gi.array().optional(),authentication:Gi.array().optional(),assertionMethod:Gi.array().optional(),keyAgreement:Gi.array().optional(),capabilityInvocation:Gi.array().optional(),capabilityDelegation:Gi.array().optional(),publicKey:Gi.array().optional(),service:ix.array().optional(),proof:Mr.or(Mr.array()).optional()}).catchall(c.any()),ax=c.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(c.string()),Pc=c.object({type:c.string().array().nonempty(),targetCode:c.string().optional(),targetDescription:c.string().optional(),targetName:c.string(),targetFramework:c.string().optional(),targetType:ax.optional(),targetUrl:c.string()}),ox=c.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),sx=ox.or(c.string()),cx=c.object({id:c.string().optional(),narrative:c.string().optional()}).catchall(c.any()),ux=c.object({id:c.string(),type:c.string().array().nonempty(),endorsementComment:c.string().optional()}),lx=Zo.extend({credentialSubject:ux,proof:Mr.or(Mr.array()).optional()}),dx=c.object({id:c.string(),"@language":c.string().optional(),version:c.string().optional()}),fx=c.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(c.string()),px=c.object({id:c.string(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),description:c.string().optional(),level:c.string().optional(),name:c.string(),points:c.string().optional()}).catchall(c.any()),hx=c.object({id:c.string(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),allowedValue:c.string().array().optional(),name:c.string(),requiredLevel:c.string().optional(),requiredValue:c.string().optional(),resultType:fx,rubricCriterionLevel:px.array().optional(),valueMax:c.string().optional(),valueMin:c.string().optional()}).catchall(c.any()),mx=c.object({id:c.string().optional(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),achievementType:sx.optional(),creator:Bo.optional(),creditsAvailable:c.number().optional(),criteria:cx,description:c.string(),endorsement:lx.array().optional(),fieldOfStudy:c.string().optional(),humanCode:c.string().optional(),image:kc.optional(),"@language":c.string().optional(),name:c.string(),otherIdentifier:Sp.array().optional(),related:dx.array().optional(),resultDescription:hx.array().optional(),specialization:c.string().optional(),tag:c.string().array().optional(),version:c.string().optional()}).catchall(c.any()),gx=c.object({type:c.string(),hashed:c.boolean(),identityHash:c.string(),identityType:c.string(),salt:c.string().optional()}),yx=c.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),vx=c.object({type:c.string().array().nonempty(),achievedLevel:c.string().optional(),alignment:Pc.array().optional(),resultDescription:c.string().optional(),status:yx.optional(),value:c.string().optional()}).catchall(c.any()),xp=c.object({id:c.string().optional(),type:c.string().array().nonempty(),activityEndDate:c.string().optional(),activityStartDate:c.string().optional(),creditsEarned:c.number().optional(),achievement:mx.optional(),identifier:gx.array().optional(),image:kc.optional(),licenseNumber:c.string().optional(),narrative:c.string().optional(),result:vx.array().optional(),role:c.string().optional(),source:Bo.optional(),term:c.string().optional()}).catchall(c.any()),_x=c.object({id:c.string().optional(),type:c.string().or(c.string().array().nonempty()),narrative:c.string().optional(),name:c.string().optional(),description:c.string().optional(),genre:c.string().optional(),audience:c.string().optional()}).catchall(c.any()),bx=Zo.extend({name:c.string().optional(),description:c.string().optional(),image:kc.optional(),credentialSubject:xp.or(xp.array()),endorsement:Zo.array().optional(),evidence:_x.array().optional()}),XO=bx.extend({proof:Mr.or(Mr.array())}),tA=c.object({checks:c.string().array(),warnings:c.string().array(),errors:c.string().array()}),Rp=c.enum(["Success","Failed","Error"]),rA=Rp.enum,nA=c.object({check:c.string(),status:Rp,message:c.string().optional(),details:c.string().optional()}),iA=c.object({title:c.string().optional(),createdAt:c.string().optional(),issuer:Bo.optional(),issuee:Bo.optional(),credentialSubject:Vl.optional()}),aA=c.object({id:c.string(),uri:c.string()}).catchall(c.any()),cA=c.object({limit:c.number(),cursor:c.string().optional(),sort:c.string().optional()}),yt=c.object({cursor:c.string().optional(),hasMore:c.boolean()}),Op=c.object({encryptedRecord:nx,fields:c.string().array()}).catchall(c.any()),uA=yt.extend({records:Op.array()}),wx=Op.extend({id:c.string()}),lA=yt.extend({records:wx.array()}),Ep=Yw(n=>{let r=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!r)throw new Error("Invalid RegExp string format");return{pattern:r[1],flags:r[2]}},"parseRegexString"),xx=c.instanceof(RegExp).or(c.string().refine(n=>{try{return Ep(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:r,flags:s}=Ep(n);try{return new RegExp(r,s)}catch(d){throw new Error(`Invalid RegExp: ${d.message}`)}})),Pe=c.string().or(c.object({$in:c.string().array()})).or(c.object({$regex:xx})),Ex=c.object({backgroundColor:c.string().optional(),backgroundImage:c.string().optional(),fadeBackgroundImage:c.boolean().optional(),repeatBackgroundImage:c.boolean().optional(),fontColor:c.string().optional(),accentColor:c.string().optional(),accentFontColor:c.string().optional(),idBackgroundImage:c.string().optional(),fadeIdBackgroundImage:c.boolean().optional(),idBackgroundColor:c.string().optional(),repeatIdBackgroundImage:c.boolean().optional()}),hn=c.object({profileId:c.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:c.string().default("").describe("Human-readable display name for the profile."),shortBio:c.string().default("").describe("Short bio for the profile."),bio:c.string().default("").describe("Longer bio for the profile."),did:c.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:c.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:c.string().optional().describe("Contact email address for the profile. (deprecated)"),image:c.string().optional().describe("Profile image URL for the profile."),heroImage:c.string().optional().describe("Hero image URL for the profile."),websiteLink:c.string().optional().describe("Website link for the profile."),isServiceProfile:c.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:c.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:c.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Ex.optional().describe("Display settings for the profile."),highlightedCredentials:c.array(c.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:c.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:c.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:c.string().optional().describe("Country for the profile."),approved:c.boolean().optional().describe("Approval status for the profile.")}),pA=c.object({profileId:Pe,displayName:Pe,shortBio:Pe,bio:Pe,email:Pe,websiteLink:Pe,isServiceProfile:c.boolean(),type:Pe}).partial(),hA=yt.extend({records:hn.array()}),mA=c.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Ap=c.object({id:c.string(),created:c.string(),displayName:c.string().default("").optional(),shortBio:c.string().default("").optional(),bio:c.string().default("").optional(),email:c.string().optional(),image:c.string().optional(),heroImage:c.string().optional()}),gA=yt.extend({records:Ap.extend({did:c.string()}).array()}),yA=c.object({id:Pe,displayName:Pe,shortBio:Pe,bio:Pe,email:Pe}).partial(),vA=yt.extend({records:c.object({profile:hn,manager:Ap.extend({did:c.string()}).optional()}).array()}),_A=c.object({uri:c.string(),to:c.string(),from:c.string(),sent:c.string().datetime(),received:c.string().datetime().optional()}),kp=c.object({role:c.string(),canEdit:c.boolean(),canIssue:c.boolean(),canRevoke:c.boolean(),canManagePermissions:c.boolean(),canIssueChildren:c.string(),canCreateChildren:c.string(),canEditChildren:c.string(),canRevokeChildren:c.string(),canManageChildrenPermissions:c.string(),canManageChildrenProfiles:c.boolean().default(!1).optional(),canViewAnalytics:c.boolean()}),Tx=c.object({role:Pe,canEdit:c.boolean(),canIssue:c.boolean(),canRevoke:c.boolean(),canManagePermissions:c.boolean(),canIssueChildren:Pe,canCreateChildren:Pe,canEditChildren:Pe,canRevokeChildren:Pe,canManageChildrenPermissions:Pe,canManageChildrenProfiles:c.boolean(),canViewAnalytics:c.boolean()}).partial(),jl=c.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Cx=c.discriminatedUnion("type",[c.object({type:c.literal(jl.Values.GRANT_PERMISSIONS),data:c.object({claimUri:c.string(),targetUri:c.string(),permissions:kp.partial()})}),c.object({type:c.literal(jl.Values.ADD_ADMIN),data:c.object({claimUri:c.string(),targetUri:c.string()})}),c.object({type:c.literal(jl.Values.AUTO_CONNECT),data:c.object({claimUri:c.string(),targetUri:c.string()})})]),bA=c.object({type:Pe,data:c.object({claimUri:Pe,targetUri:Pe,permissions:Tx})}).deepPartial(),Sx=c.object({id:c.string(),createdAt:c.string(),updatedAt:c.string()}).and(Cx),wA=yt.extend({records:Sx.array()}),Dl=c.enum(["DRAFT","LIVE"]),Rx=c.object({uri:c.string(),name:c.string().optional(),type:c.string().optional(),category:c.string().optional(),status:Dl.optional(),autoConnectRecipients:c.boolean().optional(),meta:c.record(c.any()).optional(),claimPermissions:kp.optional(),allowAnyoneToCreateChildren:c.boolean().optional()}),xA=c.object({uri:Pe,name:Pe,type:Pe,category:Pe,meta:c.record(Pe),status:Dl.or(c.object({$in:Dl.array()})),autoConnectRecipients:c.boolean()}).partial(),EA=yt.extend({records:Rx.array()}),Ox=c.object({to:hn,from:c.string(),received:c.string().optional(),uri:c.string().optional()}),TA=yt.extend({records:Ox.array()}),Ax=c.object({to:hn,from:c.string(),received:c.string().optional(),boostUris:c.array(c.string()),credentialUris:c.array(c.string()).optional()}),CA=yt.extend({records:Ax.array()}),SA=c.object({endpoint:c.string(),name:c.string(),did:c.string().optional()}),RA=c.object({ttlSeconds:c.number().optional(),totalUses:c.number().optional()}),kx=c.object({endpoint:c.string()}),OA=c.object({signingAuthority:kx,relationship:c.object({name:c.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:c.string(),isPrimary:c.boolean().optional()})}),AA=c.object({boostUri:c.string(),signingAuthority:c.object({endpoint:c.string(),name:c.string()})}),Px=c.enum(["live","stale","withdrawn"]),Ix=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),personal:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),write:c.object({credentials:c.object({categories:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),personal:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({})}),Pp=c.object({contract:Ix,owner:hn,name:c.string(),subtitle:c.string().optional(),description:c.string().optional(),reasonForAccessing:c.string().optional(),image:c.string().optional(),uri:c.string(),needsGuardianConsent:c.boolean().optional(),redirectUrl:c.string().optional(),frontDoorBoostUri:c.string().optional(),createdAt:c.string(),updatedAt:c.string(),expiresAt:c.string().optional(),autoBoosts:c.string().array().optional(),writers:c.array(hn).optional()}),kA=yt.extend({records:Pp.omit({owner:!0}).array()}),Nx=c.object({credentials:c.object({categories:c.record(c.string().array()).default({})}),personal:c.record(c.string()).default({}),date:c.string()}),PA=yt.extend({records:Nx.array()}),jx=c.object({credentials:c.object({category:c.string(),uri:c.string()}).array(),personal:c.record(c.string()).default({}),date:c.string(),contractUri:c.string()}),IA=yt.extend({records:jx.array()}),Ip=c.object({sharing:c.boolean().optional(),shared:c.string().array().optional(),shareAll:c.boolean().optional(),shareUntil:c.string().optional()}),Np=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({shareAll:c.boolean().optional(),sharing:c.boolean().optional(),categories:c.record(Ip).default({})}).default({}),personal:c.record(c.string()).default({})}).default({}),write:c.object({credentials:c.object({categories:c.record(c.boolean()).default({})}).default({}),personal:c.record(c.boolean()).default({})}).default({}),deniedWriters:c.array(c.string()).optional()}),NA=yt.extend({records:c.object({expiresAt:c.string().optional(),oneTime:c.boolean().optional(),terms:Np,contract:Pp,uri:c.string(),consenter:hn,status:Px}).array()}),jA=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),personal:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),write:c.object({credentials:c.object({categories:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),personal:c.record(c.object({required:c.boolean().optional()})).optional()}).optional()}),VA=c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional()}),DA=c.object({credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional(),id:Pe.optional()}),Vx=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({shareAll:c.boolean().optional(),sharing:c.boolean().optional(),categories:c.record(Ip.optional()).optional()}).optional(),personal:c.record(c.string()).optional()}).optional(),write:c.object({credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional()}).optional()}),Ll=c.enum(["consent","update","sync","withdraw","write"]),LA=c.object({terms:Vx.optional(),action:Ll.or(Ll.array()).optional(),date:c.object({$gt:c.string()}).or(c.object({$lt:c.string()})).or(c.object({$eq:c.string()})).optional(),expiresAt:c.object({$gt:c.string()}).or(c.object({$lt:c.string()})).or(c.object({$eq:c.string()})).optional(),oneTime:c.boolean().optional()}),jp=c.object({expiresAt:c.string().optional(),oneTime:c.boolean().optional(),terms:Np.optional(),id:c.string(),action:Ll,date:c.string(),uris:c.string().array().optional()}),MA=yt.extend({records:jp.array()}),Dx=c.object({credentialUri:c.string(),termsUri:c.string(),contractUri:c.string(),boostUri:c.string(),category:c.string().optional(),date:c.string()}),UA=yt.extend({records:Dx.array()}),Lx=c.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR"]),Mx=c.object({title:c.string().optional(),body:c.string().optional()}),Ux=c.object({type:c.string(),value:c.string()}),Ic=c.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Bx=c.object({issuanceId:c.string(),status:Ic,recipient:c.object({contactMethod:Ux.optional(),learnCardId:c.string().optional()}),timestamp:c.string().datetime().optional()}),Zx=c.object({vcUris:c.array(c.string()).optional(),vpUris:c.array(c.string()).optional(),transaction:jp.optional(),inbox:Bx.optional()}),BA=c.object({type:Lx,to:hn.partial().and(c.object({did:c.string()})),from:hn.partial().and(c.object({did:c.string()})),message:Mx.optional(),data:Zx.optional(),sent:c.string().datetime().optional(),webhookUrl:c.string().optional()}),qx="auth-grant:",ZA=c.object({id:c.string(),name:c.string(),description:c.string().optional(),challenge:c.string().startsWith(qx).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:c.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:c.string(),createdAt:c.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:c.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),qA=c.object({id:c.string()}).catchall(c.any()),Fx=c.enum(["active","revoked"]),FA=c.object({id:Pe,name:Pe,description:Pe,status:Fx}).partial(),Tp=c.object({id:c.string(),isVerified:c.boolean(),verifiedAt:c.string().optional(),isPrimary:c.boolean(),createdAt:c.string()}),zA=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}).merge(Tp),c.object({type:c.literal("phone"),value:c.string()}).merge(Tp)]),Cp=c.object({isVerified:c.boolean().optional(),isPrimary:c.boolean().optional()}),$A=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}).merge(Cp),c.object({type:c.literal("phone"),value:c.string()}).merge(Cp)]),Vp=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}),c.object({type:c.literal("phone"),value:c.string()})]),WA=c.object({value:c.string(),type:c.enum(["email","phone"])}),HA=c.object({token:c.string()}),GA=c.object({contactMethodId:c.string()}),zx=c.object({id:c.string(),credential:c.string(),isSigned:c.boolean(),currentStatus:Ic,expiresAt:c.string(),createdAt:c.string(),issuerDid:c.string(),webhookUrl:c.string().optional(),signingAuthority:c.object({endpoint:c.string().optional(),name:c.string().optional()}).optional()}),JA=c.object({hasMore:c.boolean(),records:c.array(zx),cursor:c.string().optional()}),YA=c.object({currentStatus:Ic,id:c.string(),isSigned:c.boolean(),issuerDid:c.string()}).partial(),$x=c.object({endpoint:c.string().url(),name:c.string()}),KA=c.object({recipient:Vp.describe("The recipient of the credential"),credential:Ji.passthrough().or(qo.passthrough()).or(Zo.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:c.object({signingAuthority:$x.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:c.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:c.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:c.object({suppress:c.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:c.object({id:c.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:c.object({issuer:c.object({name:c.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:c.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:c.object({name:c.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:c.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:c.object({name:c.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),QA=c.object({issuanceId:c.string(),status:Ic,recipient:Vp,claimUrl:c.string().url().optional(),recipientDid:c.string().optional()}),XA=c.object({token:c.string(),contactMethodId:c.string(),autoVerifyContactMethod:c.boolean().optional().default(!1),createdAt:c.string(),expiresAt:c.string(),used:c.boolean()});var Fp=Ef(Bp());var Ua={"SHA-1":{outputLength:20,blockSize:64},"SHA-256":{outputLength:32,blockSize:64},"SHA-384":{outputLength:48,blockSize:128},"SHA-512":{outputLength:64,blockSize:128}};function qp(n,r,s,d,p="SHA-256"){return new Promise((g,y)=>{p in Ua||y(new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ua).toString()}`)),typeof n=="string"?n=new TextEncoder().encode(n):n instanceof ArrayBuffer?n=new Uint8Array(n):ArrayBuffer.isView(n)||y(RangeError("P should be string, ArrayBuffer, TypedArray, DataView")),typeof r=="string"?r=new TextEncoder().encode(r):r instanceof ArrayBuffer?r=new Uint8Array(r):ArrayBuffer.isView(r)?r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):y(RangeError("S should be string, ArrayBuffer, TypedArray, DataView")),crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits"]).then(E=>{let S={name:"PBKDF2",hash:p,salt:r,iterations:s};crypto.subtle.deriveBits(S,E,8*d).then(N=>g(N),N=>{(async function(F,V,k,R,q){if(!(q in Ua))throw new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ua).toString()}`);if(!Number.isInteger(k)||k<=0)throw new RangeError("c must be a positive integer");let A=Ua[q].outputLength;if(!Number.isInteger(R)||R<=0||R>=(2**32-1)*A)throw new RangeError("dkLen must be a positive integer < (2 ** 32 - 1) * hLen");let X=Math.ceil(R/A),Q=R-(X-1)*A,ne=new Array(X);F.byteLength===0&&(F=new Uint8Array(Ua[q].blockSize));let Se=await crypto.subtle.importKey("raw",F,{name:"HMAC",hash:{name:q}},!0,["sign"]),be=o(async function(Ue,Ur){let $=await crypto.subtle.sign("HMAC",Ue,Ur);return new Uint8Array($)},"g");for(let Ue=0;Ue<X;Ue++)ne[Ue]=await Ne(Se,V,k,Ue+1);async function Ne(Ue,Ur,$,Je){function re(br){let mn=new ArrayBuffer(4);return new DataView(mn).setUint32(0,br,!1),new Uint8Array(mn)}o(re,"i");let $t=await be(Ue,Zp(Ur,re(Je))),Fe=$t;for(let br=1;br<$;br++)Fe=await be(Ue,Fe),tE($t,Fe);return $t}return o(Ne,"h"),ne[X-1]=ne[X-1].slice(0,Q),Zp(...ne).buffer})(n,r,s,d,p).then(F=>g(F),F=>y(F))})},E=>y(E))})}o(qp,"t");function Zp(...n){let r=n.reduce((p,g)=>p+g.length,0);if(n.length===0)throw new RangeError("Cannot concat no arrays");let s=new Uint8Array(r),d=0;for(let p of n)s.set(p,d),d+=p.length;return s}o(Zp,"r");function tE(n,r){for(let s=0;s<n.length;s++)n[s]^=r[s]}o(tE,"n");var Ba=o(async(n,r)=>{let s=await n.invoke.hash?.(r,"PBKDF2-HMAC-SHA256");if(s)return s;let d=n.invoke.crypto(),p=new TextEncoder().encode(r),g=n.id.keypair("secp256k1").d,y=await qp(g,"salt",1e3,32),E=await d.subtle.importKey("raw",y,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),S=await d.subtle.sign("HMAC",E,p);return Array.from(new Uint8Array(S)).map(F=>F.toString(16).padStart(2,"0")).join("")},"hash"),zt=o(async(n,r,s)=>n.invoke.createDagJwe(s,[r]),"generateJWE"),_r=o(async(n,r)=>n.invoke.decryptDagJwe(r),"decryptJWE"),Yi=o(async(n,r,s=[])=>{let d=Object.entries(r);return(await Promise.all(d.map(async([p,g])=>s.includes(p)?"":await Ba(n,`${p}:${(0,Fp.default)(g)}`)))).filter(Boolean)},"generateEncryptedFieldsArray"),Ki=o(async(n,r,s=[])=>{let d=await n.invoke.createDagJwe(r),p=await Yi(n,r,s);return{...Object.fromEntries(Object.entries(r).filter(([y])=>s.includes(y))),encryptedRecord:d,fields:p}},"generateEncryptedRecord");var Ul=o(async(n,r)=>rp(n,async s=>{let d=await r.invoke.getDidAuthVp({proofFormat:"jwt",challenge:s});if(typeof d!="string")throw new Error("Error getting DID-Auth-JWT!");return d}),"getLearnCloudClient"),rE=o(async(n,r,s=[],d=[],p=!0)=>{let g=n;g.debug?.("Adding LearnCloud Plugin");let y=await Ul(r,g),E=[g.id.did()];y.user.getDids.query().then(k=>E=k);let S={},N=y.utilities.getDid.query(),F=o(async k=>(S[k]||(S[k]=await Ul(k,g)),S[k]),"getOtherClient"),V=o(async k=>{let R=g.id.did(),q=k.id.did();if(R!==q){if(!E.includes(q)&&p){let A=await k.invoke.getDidAuthVp();await y.user.addDid.mutate({presentation:A}),q.split(":")[1]==="web"&&await y.user.setPrimaryDid.mutate({presentation:A}),E=await y.user.getDids.query()}y=await Ul(r,k)}g=k},"updateLearnCard");return{name:"LearnCloud",displayName:"LearnCloud",description:"LearnCloud Integration",methods:{learnCloudCreate:async(k,R)=>{await V(k);let q=await Ki(k,R,d);return y.customStorage.create.mutate({item:await zt(k,await N,q)})},learnCloudCreateMany:async(k,R)=>{await V(k);let q=await Promise.all(R.map(async A=>Ki(k,A,d)));return y.customStorage.createMany.mutate({items:await zt(k,await N,q)})},learnCloudRead:async(k,R,q)=>{await V(k);let A=[],X=await k.invoke.learnCloudReadPage(R,{},q);for(A.push(...X.records);X.hasMore;)X=await k.invoke.learnCloudReadPage(R,{},q),A.push(...X.records);return A},learnCloudReadPage:async(k,R,q,A)=>{if(await V(k),!R){let be=await y.customStorage.read.query({includeAssociatedDids:A,...q}),Ne=Zi(be)?await _r(k,be):be;return{...Ne,records:await Promise.all(Ne.records.map(async Ue=>({...await _r(k,Ue.encryptedRecord),_id:Ue._id})))}}let X=await Yi(k,R,[...d,"_id"]),Q=Object.fromEntries(Object.entries(R).filter(([be])=>[...d,"_id"].includes(be))),ne=await y.customStorage.read.query({query:await zt(k,await N,{...Q,...X.length>0?{fields:{$in:X}}:{}}),...q,includeAssociatedDids:A}),Se=Zi(ne)?await _r(k,ne):ne;return{...Se,records:await Promise.all(Se.records.map(async be=>({...await _r(k,be.encryptedRecord),_id:be._id})))}},learnCloudCount:async(k,R,q)=>{if(await V(k),!R)return y.customStorage.count.query({includeAssociatedDids:q});let A=await Yi(k,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([Q])=>[...d,"_id"].includes(Q)));return y.customStorage.count.query({query:await zt(k,await N,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:q})},learnCloudUpdate:async(k,R,q)=>{await V(k);let A=await k.invoke.learnCloudRead(R);return(await Promise.all(A.map(async Q=>y.customStorage.update.mutate({query:await zt(k,await N,{_id:Q._id}),update:await zt(k,await N,await Ki(k,{...Q,...q},d))})))).reduce((Q,ne)=>ne+Q,0)},learnCloudDelete:async(k,R,q)=>{if(await V(k),!R)return y.customStorage.delete.mutate({includeAssociatedDids:q});let A=await Yi(k,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([Q])=>[...d,"_id"].includes(Q)));return y.customStorage.delete.mutate({query:await zt(k,await N,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:q})},learnCloudBatchResolve:async(k,R)=>{let q=await y.storage.batchResolve.query({uris:R});return Promise.all(q.map(async A=>{if(!A)return null;try{let X=await k.invoke.decryptDagJwe(A);return await Ji.or(qo).parseAsync(X)}catch(X){return k.debug?.(X),null}}))}},read:{get:async(k,R)=>{if(g.debug?.("LearnCloud read.get",R),!R)return;let q=R.split(":");if(g.debug?.("LearnCloud read.get parts:",q),q.length!==5)return;let[A,X,Q]=q;if(A!=="lc"||X!=="cloud"){g.debug?.("LearnCloud read.get not cloud URI!",{lc:A,method:X});return}if(Q.replace(/https?:\/\//g,"")!==r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")){let ne=(Q.startsWith("http")?Q:`http${Q.includes("http")||Q.includes("localhost")?"":"s"}://${Q}`).replaceAll("%3A",":");g.debug?.("LearnCloud read.get different LearnCloud!",{uriUrl:Q,url:r,fullUrl:ne,comparison:{a:Q.replace(/https?:\/\//g,""),b:r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")}});let Se=await F(ne);try{let be=await Se.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",be);let Ne=await k.invoke.decryptDagJwe(be);return g.debug?.("LearnCloud read.get decryptedResult",Ne),await Ji.or(qo).parseAsync(Ne)}catch(be){k.debug?.(be);return}}try{let ne=await y.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",ne);let Se=await k.invoke.decryptDagJwe(ne);return g.debug?.("LearnCloud read.get decryptedResult",Se),await Ji.or(qo).parseAsync(Se)}catch(ne){k.debug?.(ne);return}}},store:{upload:async(k,R)=>(k.debug?.("learnCard.store['LearnCard Network'].upload"),y.storage.store.mutate({item:R})),uploadEncrypted:async(k,R,{recipients:q=[]}={recipients:[]})=>{k.debug?.("learnCard.store['LearnCard Network'].upload");let A=await k.invoke.createDagJwe(R,[k.id.did(),...q]);return y.storage.store.mutate({item:A})}},index:{get:async(k,R)=>{await V(k);let q=[],A=await k.index.LearnCloud.getPage(R);for(q.push(...A.records);A.hasMore;)A=await k.index.LearnCloud.getPage(R,{cursor:A.cursor}),q.push(...A.records);return q},getPage:async(k,R,q)=>{await V(k),k.debug?.("LearnCloud index.getPaginated",R,q);let A={...q,sort:["newestFirst","oldestFirst"].includes(q?.sort??"")?q?.sort:void 0};if(!R){k.debug?.("LearnCloud index.get (no query)");let be=await y.index.get.query(A);k.debug?.("LearnCloud index.get (no query response)",be);let Ne=Zi(be)?await _r(k,be):be;return k.debug?.("LearnCloud index.get (no query encryptedRecords)",Ne),{...Ne,records:await Promise.all(Ne.records.map(async Ue=>_r(k,Ue.encryptedRecord)))}}k.debug?.("LearnCloud index.get (query)");let X=await Yi(k,R,s);k.debug?.("LearnCloud index.get (query fields)",X);let Q=Object.fromEntries(Object.entries(R).filter(([be])=>s.includes(be)));k.debug?.("LearnCloud index.get (query unencryptedEntries)",Q);let ne=await y.index.get.query({query:await zt(k,await N,{...Q,...X.length>0?{fields:{$in:X}}:{}}),...A});k.debug?.("LearnCloud index.get (query jwe)",ne);let Se=Zi(ne)?await _r(k,ne):ne;return k.debug?.("LearnCloud index.get (query encryptedRecords)",Se),{...Se,records:await Promise.all(Se.records.map(async be=>_r(k,be.encryptedRecord)))}},getCount:async(k,R)=>{if(await V(k),!R){k.debug?.("LearnCloud index.count (no query)");let ne=await y.index.count.query();k.debug?.("LearnCloud index.count (no query response)",ne);let Se=Zi(ne)?await _r(k,ne):ne;return k.debug?.("LearnCloud index.count (no query count)",Se),Se}k.debug?.("LearnCloud index.getCount (query)");let q=await Yi(k,R,s);k.debug?.("LearnCloud index.getCount (query fields)",q);let A=Object.fromEntries(Object.entries(R).filter(([ne])=>s.includes(ne)));k.debug?.("LearnCloud index.getCount (query unencryptedEntries)",A);let X=await y.index.count.query({query:await zt(k,await N,{...A,...q.length>0?{fields:{$in:q}}:{}})});k.debug?.("LearnCloud index.count (query response)",X);let Q=Zi(X)?await _r(k,X):X;return k.debug?.("LearnCloud index.count (query count)",Q),Q},add:async(k,R)=>{await V(k);let q=R.id||k.invoke.crypto().randomUUID();return y.index.add.mutate({record:await zt(k,await N,{...await Ki(k,{...R,id:q},s),id:await Ba(k,q)})})},addMany:async(k,R)=>(await V(k),(await Promise.all((0,zp.chunk)(R,25).map(async A=>{let X=await Promise.all(A.map(async Q=>{let ne=Q.id||k.invoke.crypto().randomUUID();return{...await Ki(k,{...Q,id:ne},s),id:await Ba(k,ne)}}));return y.index.addMany.mutate({records:await zt(k,await N,X)})}))).every(Boolean)),update:async(k,R,q)=>{await V(k);let A=await k.index.LearnCloud.get({id:R});if(A.length!==1)return!1;let Q={...A[0],...q};return y.index.update.mutate({id:await Ba(k,R),updates:await zt(k,await N,await Ki(k,Q,s))})},remove:async(k,R)=>(await V(k),y.index.remove.mutate({id:await Ba(k,R)})),removeAll:async k=>(await V(k),y.index.removeAll.mutate())}}},"getLearnCloudPlugin");
24
+ `.trim();async function Uf(n,r,s){try{let d=r.middlewares[n];return await d({...s,meta:r.meta,input:s.input,next(g){let y=g;return Uf(n+1,r,{...s,ctx:y?.ctx?{...s.ctx,...y.ctx}:s.ctx,input:y&&"input"in y?y.input:s.input,getRawInput:y?.getRawInput??s.getRawInput})}})}catch(d){return{ok:!1,error:un(d),marker:hc}}}o(Uf,"callRecursive");function hb(n){async function r(s){if(!s||!("getRawInput"in s))throw new Error(pb);let d=await Uf(0,n,s);if(!d)throw new at({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!d.ok)throw d.error;return d.data}return o(r,"procedure"),r._def=n,r.procedure=!0,r.meta=n.meta,r}o(hb,"createProcedureCaller");var yc=typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var Mi=class{context(){return new Mi}meta(){return new Mi}create(r){let s={...r,transformer:sl(r?.transformer??Zn),isDev:r?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:r?.allowOutsideOfServer??!1,errorFormatter:r?.errorFormatter??Un,isServer:r?.isServer??yc,$types:null};if(!(r?.isServer??yc)&&r?.allowOutsideOfServer!==!0)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:s,procedure:gc({meta:r?.defaultMeta}),middleware:yl(),router:dc(s),mergeRouters:ul,createCallerFactory:fc()}}};o(Mi,"TRPCBuilder");var Bf=new Mi;function vc(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(vc,"_define_property");function wl(n){return n instanceof Ke}o(wl,"isTRPCClientError");function xb(n){return qe(n)&&qe(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}o(xb,"isTRPCErrorResponse");function Eb(n,r){return typeof n=="string"?n:qe(n)&&typeof n.message=="string"?n.message:r}o(Eb,"getMessageFromUnknownError");var Ke=class extends Error{static from(r,s={}){let d=r;return wl(d)?(s.meta&&(d.meta={...d.meta,...s.meta}),d):xb(d)?new Ke(d.error.message,{...s,result:d}):new Ke(Eb(d,"Unknown error"),{...s,cause:d})}constructor(r,s){let d=s?.cause;super(r,{cause:d}),vc(this,"cause",void 0),vc(this,"shape",void 0),vc(this,"data",void 0),vc(this,"meta",void 0),this.meta=s?.meta,this.cause=d,this.shape=s?.result?.error,this.data=s?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ke.prototype)}};o(Ke,"TRPCClientError");function xl(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(xl,"_define_property");var Ui=class{$request(r){return al({links:this.links,op:{...r,context:r.context??{},id:++this.requestId}}).pipe(il())}async requestAsPromise(r){try{let s=this.$request(r);return(await nl(s)).result.data}catch(s){throw Ke.from(s)}}query(r,s,d){return this.requestAsPromise({type:"query",path:r,input:s,context:d?.context,signal:d?.signal})}mutation(r,s,d){return this.requestAsPromise({type:"mutation",path:r,input:s,context:d?.context,signal:d?.signal})}subscription(r,s,d){return this.$request({type:"subscription",path:r,input:s,context:d.context,signal:d.signal}).subscribe({next(g){switch(g.result.type){case"state":{d.onConnectionStateChange?.(g.result);break}case"started":{d.onStarted?.({context:g.context});break}case"stopped":{d.onStopped?.();break}case"data":case void 0:{d.onData?.(g.result.data);break}}},error(g){d.onError?.(g)},complete(){d.onComplete?.()}})}constructor(r){xl(this,"links",void 0),xl(this,"runtime",void 0),xl(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=r.links.map(s=>s(this.runtime))}};o(Ui,"TRPCUntypedClient");var Tb=Symbol.for("trpc_untypedClient"),Cb={query:"query",mutate:"mutation",subscribe:"subscription"},zf=o(n=>Cb[n],"clientCallTypeToProcedureType");function $f(n){let r=ka(({path:s,args:d})=>{let p=[...s],g=zf(p.pop()),y=p.join(".");return n[g](y,...d)});return cc(s=>s===Tb?n:r[s])}o($f,"createTRPCClientProxy");function No(n){let r=new Ui(n);return $f(r)}o(No,"createTRPCClient");var Wf=o(n=>typeof n=="function","isFunction");function El(n){if(n)return n;if(typeof window<"u"&&Wf(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Wf(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}o(El,"getFetch");var Hf=o(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function _c(n){let r=null,s=null,d=o(()=>{clearTimeout(s),s=null,r=null},"destroyTimerAndPendingItems");function p(E){let S=[[]],N=0;for(;;){let F=E[N];if(!F)break;let V=S[S.length-1];if(F.aborted){F.reject?.(new Error("Aborted")),N++;continue}if(n.validate(V.concat(F).map(R=>R.key))){V.push(F),N++;continue}if(V.length===0){F.reject?.(new Error("Input is too big for a single dispatch")),N++;continue}S.push([])}return S}o(p,"groupItems");function g(){let E=p(r);d();for(let S of E){if(!S.length)continue;let N={items:S};for(let V of S)V.batch=N;n.fetch(N.items.map(V=>V.key)).then(async V=>{await Promise.all(V.map(async(k,R)=>{let q=N.items[R];try{let A=await Promise.resolve(k);q.resolve?.(A)}catch(A){q.reject?.(A)}q.batch=null,q.reject=null,q.resolve=null}));for(let k of N.items)k.reject?.(new Error("Missing result")),k.batch=null}).catch(V=>{for(let k of N.items)k.reject?.(V),k.batch=null})}}o(g,"dispatch");function y(E){let S={aborted:!1,key:E,batch:null,resolve:Hf,reject:Hf},N=new Promise((F,V)=>{S.reject=V,S.resolve=F,r??(r=[]),r.push(S)});return s??(s=setTimeout(g)),N}return o(y,"load"),{load:y}}o(_c,"dataLoader");function Tl(...n){let r=new AbortController,s=n.length,d=0,p=o(()=>{++d===s&&r.abort()},"onAbort");for(let g of n)g?.aborted?p():g?.addEventListener("abort",p,{once:!0});return r.signal}o(Tl,"allAbortSignals");function jo(n){let r=n;return r?"input"in r?r:{input:r,output:r}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}}o(jo,"getTransformer");function wc(n){return{url:n.url.toString(),fetch:n.fetch,transformer:jo(n.transformer),methodOverride:n.methodOverride}}o(wc,"resolveHTTPLinkOptions");function Sb(n){let r={};for(let s=0;s<n.length;s++){let d=n[s];r[s]=d}return r}o(Sb,"arrayToDict");var Rb={query:"GET",mutation:"POST",subscription:"PATCH"};function Gf(n){return"input"in n?n.transformer.input.serialize(n.input):Sb(n.inputs.map(r=>n.transformer.input.serialize(r)))}o(Gf,"getInput");var Na=o(n=>{let r=n.url.split("?"),d=r[0].replace(/\/$/,"")+"/"+n.path,p=[];if(r[1]&&p.push(r[1]),"inputs"in n&&p.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=Gf(n);g!==void 0&&n.methodOverride!=="POST"&&p.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return p.length&&(d+="?"+p.join("&")),d},"getUrl"),Jf=o(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let r=Gf(n);return r!==void 0?JSON.stringify(r):void 0},"getBody"),Cl=o(n=>Kf({...n,contentTypeHeader:"application/json",getUrl:Na,getBody:Jf}),"jsonHttpRequester"),bc=class extends Error{constructor(){let r="AbortError";super(r),this.name=r,this.message=r}};o(bc,"AbortError");var Ob=o(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new bc},"throwIfAborted");async function Yf(n){Ob(n.signal);let r=n.getUrl(n),s=n.getBody(n),{type:d}=n,p=await(async()=>{let y=await n.headers();return Symbol.iterator in y?Object.fromEntries(y):y})(),g={...n.contentTypeHeader?{"content-type":n.contentTypeHeader}:{},...n.trpcAcceptHeader?{"trpc-accept":n.trpcAcceptHeader}:void 0,...p};return El(n.fetch)(r,{method:n.methodOverride??Rb[d],signal:n.signal,body:s,headers:g})}o(Yf,"fetchHTTPResponse");async function Kf(n){let r={},s=await Yf(n);r.response=s;let d=await s.json();return r.responseJSON=d,{json:d,meta:r}}o(Kf,"httpRequest");function xc(n){let r=wc(n),s=n.maxURLLength??1/0,d=n.maxItems??1/0;return()=>{let p=o(S=>({validate(N){if(s===1/0&&d===1/0)return!0;if(N.length>d)return!1;let F=N.map(R=>R.path).join(","),V=N.map(R=>R.input);return Na({...r,type:S,path:F,inputs:V,signal:null}).length<=s},async fetch(N){let F=N.map(X=>X.path).join(","),V=N.map(X=>X.input),k=Tl(...N.map(X=>X.signal)),R=await Cl({...r,path:F,inputs:V,type:S,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:N}):n.headers:{}},signal:k});return(Array.isArray(R.json)?R.json:N.map(()=>R.json)).map(X=>({meta:R.meta,json:X}))}}),"batchLoader"),g=_c(p("query")),y=_c(p("mutation")),E={query:g,mutation:y};return({op:S})=>rt(N=>{if(S.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let V=E[S.type].load(S),k;return V.then(R=>{k=R;let q=Io(R.json,r.transformer.output);if(!q.ok){N.error(Ke.from(q.error,{meta:R.meta}));return}N.next({context:R.meta,result:q.result}),N.complete()}).catch(R=>{N.error(Ke.from(R,{meta:k?.meta}))}),()=>{}})}}o(xc,"httpBatchLink");var Ec=o((n,...r)=>typeof n=="function"?n(...r):n,"resultOf");function Sl(){let n,r;return{promise:new Promise((d,p)=>{n=d,r=p}),resolve:n,reject:r}}o(Sl,"withResolvers");async function Xf(n){let r=await Ec(n.url);if(!n.connectionParams)return r;let d=`${r.includes("?")?"&":"?"}connectionParams=1`;return r+d}o(Xf,"prepareUrl");async function ep(n){let r={method:"connectionParams",data:await Ec(n)};return JSON.stringify(r)}o(ep,"buildConnectionMessage");function Bi(n,r,s){return r in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,n}o(Bi,"_define_property");function Pb(n){let{promise:r,resolve:s,reject:d}=Sl();return n.addEventListener("open",()=>{n.removeEventListener("error",d),s()}),n.addEventListener("error",d),r}o(Pb,"asyncWsOpen");function Ib(n,{intervalMs:r,pongTimeoutMs:s}){let d,p;function g(){d=setTimeout(()=>{n.send("PING"),p=setTimeout(()=>{n.close()},s)},r)}o(g,"start");function y(){clearTimeout(d),g()}o(y,"reset");function E(){clearTimeout(p),y()}o(E,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:S})=>{clearTimeout(d),g(),S==="PONG"&&E()}),n.addEventListener("close",()=>{clearTimeout(d),clearTimeout(p)})}o(Ib,"setupPingInterval");var Fn=class{get ws(){return this.wsObservable.get()}set ws(r){this.wsObservable.next(r)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Fn.connectCount;let r=Xf(this.urlOptions).then(s=>new this.WebSocketPonyfill(s));this.openPromise=r.then(async s=>{this.ws=s,s.addEventListener("message",function({data:d}){d==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Ib(s,this.keepAliveOpts),s.addEventListener("close",()=>{this.ws===s&&(this.ws=null)}),await Pb(s),this.urlOptions.connectionParams&&s.send(await ep(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(r){if(Bi(this,"id",++Fn.connectCount),Bi(this,"WebSocketPonyfill",void 0),Bi(this,"urlOptions",void 0),Bi(this,"keepAliveOpts",void 0),Bi(this,"wsObservable",Aa(null)),Bi(this,"openPromise",null),this.WebSocketPonyfill=r.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=r.urlOptions,this.keepAliveOpts=r.keepAlive}};o(Fn,"WsConnection");Bi(Fn,"connectCount",0);function jb(n){return n}o(jb,"identity");function Vb(n){return n.length===0?jb:n.length===1?n[0]:o(function(s){return n.reduce((d,p)=>p(d),s)},"piped")}o(Vb,"pipeFromArray");function Rl(n){let r={subscribe(s){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return o(E,"unsubscribe"),d=n({next(S){p||s.next?.(S)},error(S){p||(p=!0,s.error?.(S),E())},complete(){p||(p=!0,s.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...s){return Vb(s)(r)}};return r}o(Rl,"observable");var Db=Object.defineProperty,Tc=o((n,r)=>Db(n,"name",{value:r,configurable:!0}),"__name"),Lb=Tc(n=>()=>({next:r,op:s})=>Rl(d=>{let p=null,g=0,y=!1,E=Tc(()=>{g+=1,p?.unsubscribe(),p=r(s).subscribe({error:async S=>{if(g>5||S.data?.httpStatus!==401)return d.error(S);await n(),E()},next:S=>d.next(S),complete:()=>{y&&d.complete()}})},"attempt");return E(),()=>{y=!0,p?.unsubscribe()}}),"callbackLink"),rp=Tc(async(n,r)=>{let s=[],d=No({links:[xc({methodOverride:"POST",url:n,maxURLLength:3072,maxItems:50,headers:{Authorization:`Bearer ${await r()}`}})]}),p=Tc(async(y=95+Math.round((Math.random()-.5)*5))=>d.utilities.getChallenges.query({amount:y}),"getChallenges");return p().then(y=>s=y),No({links:[Lb(async()=>{s=await p()}),xc({methodOverride:"POST",url:n,maxItems:50,maxURLLength:3072,headers:async()=>(s.length===0&&s.push(...await p()),{Authorization:`Bearer ${await r(s.pop())}`})})]})},"getClient");var Mb=Object.create,Ol=Object.defineProperty,Ub=Object.getOwnPropertyDescriptor,np=Object.getOwnPropertyNames,Bb=Object.getPrototypeOf,Zb=Object.prototype.hasOwnProperty,K=o((n,r)=>Ol(n,"name",{value:r,configurable:!0}),"__name"),ip=o((n,r)=>o(function(){return r||(0,n[np(n)[0]])((r={exports:{}}).exports,r),r.exports},"__require"),"__commonJS"),qb=o((n,r,s,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of np(r))!Zb.call(n,p)&&p!==s&&Ol(n,p,{get:()=>r[p],enumerable:!(d=Ub(r,p))||d.enumerable});return n},"__copyProps"),Fb=o((n,r,s)=>(s=n!=null?Mb(Bb(n)):{},qb(r||!n||!n.__esModule?Ol(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),zb=ip({"../learn-card-types/dist/types.cjs.development.js"(n,r){"use strict";var s=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=K((a,f)=>s(a,"name",{value:f,configurable:!0}),"__name"),E=K((a,f)=>{for(var m in f)s(a,m,{get:f[m],enumerable:!0})},"__export"),S=K((a,f,m,w)=>{if(f&&typeof f=="object"||typeof f=="function")for(let b of p(f))!g.call(a,b)&&b!==m&&s(a,b,{get:()=>f[b],enumerable:!(w=d(f,b))||w.enumerable});return a},"__copyProps"),N=K(a=>S(s({},"__esModule",{value:!0}),a),"__toCommonJS"),F={};E(F,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Ri,AchievementCredentialValidator:()=>Jc,AchievementCriteriaValidator:()=>Gc,AchievementSubjectValidator:()=>ha,AchievementTypeValidator:()=>no,AchievementValidator:()=>pa,AddressValidator:()=>je,AlignmentTargetTypeValidator:()=>hs,AlignmentValidator:()=>Xe,AuthGrantQueryValidator:()=>ba,AuthGrantStatusValidator:()=>Is,AuthGrantValidator:()=>uu,AutoBoostConfigValidator:()=>Re,BoostPermissionsQueryValidator:()=>xi,BoostPermissionsValidator:()=>Yt,BoostQueryValidator:()=>nu,BoostRecipientValidator:()=>Rs,BoostRecipientWithChildrenValidator:()=>dr,BoostValidator:()=>Ss,ClaimHookQueryValidator:()=>ru,ClaimHookTypeValidator:()=>ga,ClaimHookValidator:()=>Cs,ClaimTokenValidator:()=>vo,ConsentFlowContractDataForDidValidator:()=>Os,ConsentFlowContractDataValidator:()=>ft,ConsentFlowContractDetailsValidator:()=>Ti,ConsentFlowContractQueryValidator:()=>su,ConsentFlowContractValidator:()=>Ae,ConsentFlowDataForDidQueryValidator:()=>va,ConsentFlowDataQueryValidator:()=>As,ConsentFlowTermValidator:()=>An,ConsentFlowTermsQueryValidator:()=>ks,ConsentFlowTermsStatusValidator:()=>ze,ConsentFlowTermsValidator:()=>kn,ConsentFlowTransactionActionValidator:()=>_a,ConsentFlowTransactionValidator:()=>Pn,ConsentFlowTransactionsQueryValidator:()=>cu,ContactMethodCreateValidator:()=>js,ContactMethodQueryValidator:()=>go,ContactMethodValidator:()=>mo,ContactMethodVerificationRequestValidator:()=>du,ContactMethodVerificationValidator:()=>We,ContextValidator:()=>yi,ContractCredentialValidator:()=>Ci,CredentialInfoValidator:()=>ws,CredentialRecordValidator:()=>Yc,CredentialSchemaValidator:()=>Ja,CredentialStatusValidator:()=>_i,CredentialSubjectValidator:()=>ca,CriteriaValidator:()=>ur,DidDocumentValidator:()=>dt,EncryptedCredentialRecordValidator:()=>ot,EncryptedRecordValidator:()=>so,EndorsementCredentialValidator:()=>da,EndorsementSubjectValidator:()=>bi,EvidenceValidator:()=>wi,FlatAuthGrantValidator:()=>lu,FullClaimHookValidator:()=>Kr,GeoCoordinatesValidator:()=>fs,IdentifierEntryValidator:()=>Ga,IdentifierTypeValidator:()=>Ie,IdentityObjectValidator:()=>ys,ImageValidator:()=>vi,InboxCredentialQueryValidator:()=>Ds,InboxCredentialValidator:()=>Vs,IssueInboxCredentialResponseValidator:()=>Ai,IssueInboxCredentialValidator:()=>yo,IssueInboxSigningAuthorityValidator:()=>Ls,JWERecipientHeaderValidator:()=>Xa,JWERecipientValidator:()=>eo,JWEValidator:()=>to,JWKValidator:()=>nt,JWKWithPrivateKeyValidator:()=>ps,KnownAchievementTypeValidator:()=>ms,LCNBoostClaimLinkOptionsValidator:()=>j,LCNBoostClaimLinkSigningAuthorityValidator:()=>D,LCNBoostStatus:()=>Ei,LCNInboxContactMethodValidator:()=>po,LCNInboxStatusEnumValidator:()=>Pr,LCNNotificationDataValidator:()=>In,LCNNotificationInboxValidator:()=>ho,LCNNotificationMessageValidator:()=>fo,LCNNotificationTypeEnumValidator:()=>Si,LCNNotificationValidator:()=>Qr,LCNProfileConnectionStatusEnum:()=>Xc,LCNProfileDisplayValidator:()=>Es,LCNProfileManagerQueryValidator:()=>tu,LCNProfileManagerValidator:()=>Ar,LCNProfileQueryValidator:()=>Kc,LCNProfileValidator:()=>Jt,LCNSigningAuthorityForUserValidator:()=>fe,LCNSigningAuthorityValidator:()=>G,PaginatedBoostRecipientsValidator:()=>au,PaginatedBoostRecipientsWithChildrenValidator:()=>C,PaginatedBoostsValidator:()=>iu,PaginatedClaimHooksValidator:()=>Dt,PaginatedConsentFlowContractsValidator:()=>ou,PaginatedConsentFlowDataForDidValidator:()=>On,PaginatedConsentFlowDataValidator:()=>ya,PaginatedConsentFlowTermsValidator:()=>Oe,PaginatedConsentFlowTransactionsValidator:()=>kr,PaginatedContractCredentialsValidator:()=>Ps,PaginatedEncryptedCredentialRecordsValidator:()=>co,PaginatedEncryptedRecordsValidator:()=>xs,PaginatedInboxCredentialsValidator:()=>fu,PaginatedLCNProfileManagersValidator:()=>eu,PaginatedLCNProfilesAndManagersValidator:()=>lo,PaginatedLCNProfilesValidator:()=>Qc,PaginationOptionsValidator:()=>oo,PaginationResponseValidator:()=>Ye,ProfileValidator:()=>Sn,ProofValidator:()=>lt,RefreshServiceValidator:()=>Ya,RegExpValidator:()=>uo,RelatedValidator:()=>Ve,ResultDescriptionValidator:()=>gs,ResultStatusTypeValidator:()=>vs,ResultTypeValidator:()=>lr,ResultValidator:()=>_s,RubricCriterionValidator:()=>fa,SentCredentialInfoValidator:()=>Ts,ServiceValidator:()=>ro,SetPrimaryContactMethodValidator:()=>et,StringQuery:()=>Te,TermsOfUseValidator:()=>ua,UnsignedAchievementCredentialValidator:()=>Yr,UnsignedVCValidator:()=>Be,UnsignedVPValidator:()=>Qa,VC2EvidenceValidator:()=>Ka,VCValidator:()=>Gt,VPValidator:()=>la,VerificationCheckValidator:()=>bs,VerificationItemValidator:()=>ao,VerificationMethodValidator:()=>cr,VerificationStatusEnum:()=>io,VerificationStatusValidator:()=>ma}),r.exports=N(F);var V;(function(a){a.assertEqual=b=>b;function f(b){}o(f,"assertIs"),K(f,"assertIs"),y(f,"assertIs"),a.assertIs=f;function m(b){throw new Error}o(m,"assertNever"),K(m,"assertNever"),y(m,"assertNever"),a.assertNever=m,a.arrayToEnum=b=>{let I={};for(let P of b)I[P]=P;return I},a.getValidEnumValues=b=>{let I=a.objectKeys(b).filter(Z=>typeof b[b[Z]]!="number"),P={};for(let Z of I)P[Z]=b[Z];return a.objectValues(P)},a.objectValues=b=>a.objectKeys(b).map(function(I){return b[I]}),a.objectKeys=typeof Object.keys=="function"?b=>Object.keys(b):b=>{let I=[];for(let P in b)Object.prototype.hasOwnProperty.call(b,P)&&I.push(P);return I},a.find=(b,I)=>{for(let P of b)if(I(P))return P},a.isInteger=typeof Number.isInteger=="function"?b=>Number.isInteger(b):b=>typeof b=="number"&&isFinite(b)&&Math.floor(b)===b;function w(b,I=" | "){return b.map(P=>typeof P=="string"?`'${P}'`:P).join(I)}o(w,"joinValues"),K(w,"joinValues"),y(w,"joinValues"),a.joinValues=w,a.jsonStringifyReplacer=(b,I)=>typeof I=="bigint"?I.toString():I})(V||(V={}));var k;(function(a){a.mergeShapes=(f,m)=>({...f,...m})})(k||(k={}));var R=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),q=y(a=>{switch(typeof a){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(a)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(a)?R.array:a===null?R.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?R.promise:typeof Map<"u"&&a instanceof Map?R.map:typeof Set<"u"&&a instanceof Set?R.set:typeof Date<"u"&&a instanceof Date?R.date:R.object;default:return R.unknown}},"getParsedType"),A=V.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"]),X=y(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Q=K(class extends Error{constructor(a){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};let f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=a}get errors(){return this.issues}format(a){let f=a||function(b){return b.message},m={_errors:[]},w=y(b=>{for(let I of b.issues)if(I.code==="invalid_union")I.unionErrors.map(w);else if(I.code==="invalid_return_type")w(I.returnTypeError);else if(I.code==="invalid_arguments")w(I.argumentsError);else if(I.path.length===0)m._errors.push(f(I));else{let P=m,Z=0;for(;Z<I.path.length;){let U=I.path[Z];Z===I.path.length-1?(P[U]=P[U]||{_errors:[]},P[U]._errors.push(f(I))):P[U]=P[U]||{_errors:[]},P=P[U],Z++}}},"processError");return w(this),m}static assert(a){if(!(a instanceof Q))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=f=>f.message){let f={},m=[];for(let w of this.issues)w.path.length>0?(f[w.path[0]]=f[w.path[0]]||[],f[w.path[0]].push(a(w))):m.push(a(w));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}},"ZodError");y(Q,"ZodError"),Q.create=a=>new Q(a);var ne=y((a,f)=>{let m;switch(a.code){case A.invalid_type:a.received===R.undefined?m="Required":m=`Expected ${a.expected}, received ${a.received}`;break;case A.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(a.expected,V.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:m=`Unrecognized key(s) in object: ${V.joinValues(a.keys,", ")}`;break;case A.invalid_union:m="Invalid input";break;case A.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${V.joinValues(a.options)}`;break;case A.invalid_enum_value:m=`Invalid enum value. Expected ${V.joinValues(a.options)}, received '${a.received}'`;break;case A.invalid_arguments:m="Invalid function arguments";break;case A.invalid_return_type:m="Invalid function return type";break;case A.invalid_date:m="Invalid date";break;case A.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(m=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(m=`${m} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?m=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?m=`Invalid input: must end with "${a.validation.endsWith}"`:V.assertNever(a.validation):a.validation!=="regex"?m=`Invalid ${a.validation}`:m="Invalid";break;case A.too_small:a.type==="array"?m=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?m=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?m=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?m=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:m="Invalid input";break;case A.too_big:a.type==="array"?m=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?m=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?m=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?m=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?m=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:m="Invalid input";break;case A.custom:m="Invalid input";break;case A.invalid_intersection_types:m="Intersection results could not be merged";break;case A.not_multiple_of:m=`Number must be a multiple of ${a.multipleOf}`;break;case A.not_finite:m="Number must be finite";break;default:m=f.defaultError,V.assertNever(a)}return{message:m}},"errorMap"),Se=ne;function be(a){Se=a}o(be,"setErrorMap"),K(be,"setErrorMap"),y(be,"setErrorMap");function Ne(){return Se}o(Ne,"getErrorMap"),K(Ne,"getErrorMap"),y(Ne,"getErrorMap");var Ue=y(a=>{let{data:f,path:m,errorMaps:w,issueData:b}=a,I=[...m,...b.path||[]],P={...b,path:I};if(b.message!==void 0)return{...b,path:I,message:b.message};let Z="",U=w.filter(le=>!!le).slice().reverse();for(let le of U)Z=le(P,{data:f,defaultError:Z}).message;return{...b,path:I,message:Z}},"makeIssue"),Ur=[];function $(a,f){let m=Ne(),w=Ue({issueData:f,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,m,m===ne?void 0:ne].filter(b=>!!b)});a.common.issues.push(w)}o($,"addIssueToContext"),K($,"addIssueToContext"),y($,"addIssueToContext");var Je=K(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(a,f){let m=[];for(let w of f){if(w.status==="aborted")return re;w.status==="dirty"&&a.dirty(),m.push(w.value)}return{status:a.value,value:m}}static async mergeObjectAsync(a,f){let m=[];for(let w of f){let b=await w.key,I=await w.value;m.push({key:b,value:I})}return Je.mergeObjectSync(a,m)}static mergeObjectSync(a,f){let m={};for(let w of f){let{key:b,value:I}=w;if(b.status==="aborted"||I.status==="aborted")return re;b.status==="dirty"&&a.dirty(),I.status==="dirty"&&a.dirty(),b.value!=="__proto__"&&(typeof I.value<"u"||w.alwaysSet)&&(m[b.value]=I.value)}return{status:a.value,value:m}}},"ParseStatus");y(Je,"ParseStatus");var re=Object.freeze({status:"aborted"}),$t=y(a=>({status:"dirty",value:a}),"DIRTY"),Fe=y(a=>({status:"valid",value:a}),"OK"),br=y(a=>a.status==="aborted","isAborted"),mn=y(a=>a.status==="dirty","isDirty"),Ot=y(a=>a.status==="valid","isValid"),vt=y(a=>typeof Promise<"u"&&a instanceof Promise,"isAsync");function gn(a,f,m,w){if(m==="a"&&!w)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?a!==f||!w:!f.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?w:m==="a"?w.call(a):w?w.value:f.get(a)}o(gn,"__classPrivateFieldGet"),K(gn,"__classPrivateFieldGet"),y(gn,"__classPrivateFieldGet");function Br(a,f,m,w,b){if(w==="m")throw new TypeError("Private method is not writable");if(w==="a"&&!b)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?a!==f||!b:!f.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return w==="a"?b.call(a,m):b?b.value=m:f.set(a,m),m}o(Br,"__classPrivateFieldSet"),K(Br,"__classPrivateFieldSet"),y(Br,"__classPrivateFieldSet");var Y;(function(a){a.errToObj=f=>typeof f=="string"?{message:f}:f||{},a.toString=f=>typeof f=="string"?f:f?.message})(Y||(Y={}));var ai,oi,At=K(class{constructor(a,f,m,w){this._cachedPath=[],this.parent=a,this.data=f,this._path=m,this._key=w}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}},"ParseInputLazyPath");y(At,"ParseInputLazyPath");var Zr=y((a,f)=>{if(Ot(f))return{success:!0,data:f.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let m=new Q(a.common.issues);return this._error=m,this._error}}},"handleResult");function ce(a){if(!a)return{};let{errorMap:f,invalid_type_error:m,required_error:w,description:b}=a;if(f&&(m||w))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return f?{errorMap:f,description:b}:{errorMap:y((P,Z)=>{var U,le;let{message:De}=a;return P.code==="invalid_enum_value"?{message:De??Z.defaultError}:typeof Z.data>"u"?{message:(U=De??w)!==null&&U!==void 0?U:Z.defaultError}:P.code!=="invalid_type"?{message:Z.defaultError}:{message:(le=De??m)!==null&&le!==void 0?le:Z.defaultError}},"customMap"),description:b}}o(ce,"processCreateParams"),K(ce,"processCreateParams"),y(ce,"processCreateParams");var pe=K(class{constructor(a){this.spa=this.safeParseAsync,this._def=a,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._def.description}_getType(a){return q(a.data)}_getOrReturnCtx(a,f){return f||{common:a.parent.common,data:a.data,parsedType:q(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new Je,ctx:{common:a.parent.common,data:a.data,parsedType:q(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){let f=this._parse(a);if(vt(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(a){let f=this._parse(a);return Promise.resolve(f)}parse(a,f){let m=this.safeParse(a,f);if(m.success)return m.data;throw m.error}safeParse(a,f){var m;let w={common:{issues:[],async:(m=f?.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f?.errorMap},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:q(a)},b=this._parseSync({data:a,path:w.path,parent:w});return Zr(w,b)}async parseAsync(a,f){let m=await this.safeParseAsync(a,f);if(m.success)return m.data;throw m.error}async safeParseAsync(a,f){let m={common:{issues:[],contextualErrorMap:f?.errorMap,async:!0},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:q(a)},w=this._parse({data:a,path:m.path,parent:m}),b=await(vt(w)?w:Promise.resolve(w));return Zr(m,b)}refine(a,f){let m=y(w=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(w):f,"getIssueProperties");return this._refinement((w,b)=>{let I=a(w),P=y(()=>b.addIssue({code:A.custom,...m(w)}),"setError");return typeof Promise<"u"&&I instanceof Promise?I.then(Z=>Z?!0:(P(),!1)):I?!0:(P(),!1)})}refinement(a,f){return this._refinement((m,w)=>a(m)?!0:(w.addIssue(typeof f=="function"?f(m,w):f),!1))}_refinement(a){return new bt({schema:this,typeName:ie.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}optional(){return Vt.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return Hr.create(this,this._def)}or(a){return $r.create([this,a],this._def)}and(a){return _n.create(this,a,this._def)}transform(a){return new bt({...ce(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:a}})}default(a){let f=typeof a=="function"?a:()=>a;return new xn({...ce(this._def),innerType:this,defaultValue:f,typeName:ie.ZodDefault})}brand(){return new na({typeName:ie.ZodBranded,type:this,...ce(this._def)})}catch(a){let f=typeof a=="function"?a:()=>a;return new Gr({...ce(this._def),innerType:this,catchValue:f,typeName:ie.ZodCatch})}describe(a){let f=this.constructor;return new f({...this._def,description:a})}pipe(a){return mi.create(this,a)}readonly(){return En.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(pe,"ZodType");var si=/^c[^\s-]{8,}$/i,ci=/^[0-9a-z]+$/,Nc=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qi=/^[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,Xi=/^[a-z0-9_-]{21}$/i,zo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ui="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Za,nr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$o=/^(([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})))$/,jc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Pt=new RegExp(`^${yn}$`);function wr(a){let f="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?f=`${f}\\.\\d{${a.precision}}`:a.precision==null&&(f=`${f}(\\.\\d+)?`),f}o(wr,"timeRegexSource"),K(wr,"timeRegexSource"),y(wr,"timeRegexSource");function vn(a){return new RegExp(`^${wr(a)}$`)}o(vn,"timeRegex"),K(vn,"timeRegex"),y(vn,"timeRegex");function ea(a){let f=`${yn}T${wr(a)}`,m=[];return m.push(a.local?"Z?":"Z"),a.offset&&m.push("([+-]\\d{2}:?\\d{2})"),f=`${f}(${m.join("|")})`,new RegExp(`^${f}$`)}o(ea,"datetimeRegex"),K(ea,"datetimeRegex"),y(ea,"datetimeRegex");function qr(a,f){return!!((f==="v4"||!f)&&nr.test(a)||(f==="v6"||!f)&&$o.test(a))}o(qr,"isValidIP"),K(qr,"isValidIP"),y(qr,"isValidIP");var It=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==R.string){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.string,received:b.parsedType}),re}let m=new Je,w;for(let b of this._def.checks)if(b.kind==="min")a.data.length<b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="max")a.data.length>b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="length"){let I=a.data.length>b.value,P=a.data.length<b.value;(I||P)&&(w=this._getOrReturnCtx(a,w),I?$(w,{code:A.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}):P&&$(w,{code:A.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}),m.dirty())}else if(b.kind==="email")kt.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"email",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="emoji")Za||(Za=new RegExp(ui,"u")),Za.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"emoji",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="uuid")Qi.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"uuid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="nanoid")Xi.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"nanoid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid")si.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"cuid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid2")ci.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"cuid2",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="ulid")Nc.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"ulid",code:A.invalid_string,message:b.message}),m.dirty());else if(b.kind==="url")try{new URL(a.data)}catch{w=this._getOrReturnCtx(a,w),$(w,{validation:"url",code:A.invalid_string,message:b.message}),m.dirty()}else b.kind==="regex"?(b.regex.lastIndex=0,b.regex.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"regex",code:A.invalid_string,message:b.message}),m.dirty())):b.kind==="trim"?a.data=a.data.trim():b.kind==="includes"?a.data.includes(b.value,b.position)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),m.dirty()):b.kind==="toLowerCase"?a.data=a.data.toLowerCase():b.kind==="toUpperCase"?a.data=a.data.toUpperCase():b.kind==="startsWith"?a.data.startsWith(b.value)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{startsWith:b.value},message:b.message}),m.dirty()):b.kind==="endsWith"?a.data.endsWith(b.value)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:{endsWith:b.value},message:b.message}),m.dirty()):b.kind==="datetime"?ea(b).test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"datetime",message:b.message}),m.dirty()):b.kind==="date"?Pt.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"date",message:b.message}),m.dirty()):b.kind==="time"?vn(b).test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{code:A.invalid_string,validation:"time",message:b.message}),m.dirty()):b.kind==="duration"?zo.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"duration",code:A.invalid_string,message:b.message}),m.dirty()):b.kind==="ip"?qr(a.data,b.version)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"ip",code:A.invalid_string,message:b.message}),m.dirty()):b.kind==="base64"?jc.test(a.data)||(w=this._getOrReturnCtx(a,w),$(w,{validation:"base64",code:A.invalid_string,message:b.message}),m.dirty()):V.assertNever(b);return{status:m.value,value:a.data}}_regex(a,f,m){return this.refinement(w=>a.test(w),{validation:f,code:A.invalid_string,...Y.errToObj(m)})}_addCheck(a){return new It({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...Y.errToObj(a)})}url(a){return this._addCheck({kind:"url",...Y.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...Y.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...Y.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...Y.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...Y.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...Y.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...Y.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...Y.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...Y.errToObj(a)})}datetime(a){var f,m;return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof a?.precision>"u"?null:a?.precision,offset:(f=a?.offset)!==null&&f!==void 0?f:!1,local:(m=a?.local)!==null&&m!==void 0?m:!1,...Y.errToObj(a?.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof a?.precision>"u"?null:a?.precision,...Y.errToObj(a?.message)})}duration(a){return this._addCheck({kind:"duration",...Y.errToObj(a)})}regex(a,f){return this._addCheck({kind:"regex",regex:a,...Y.errToObj(f)})}includes(a,f){return this._addCheck({kind:"includes",value:a,position:f?.position,...Y.errToObj(f?.message)})}startsWith(a,f){return this._addCheck({kind:"startsWith",value:a,...Y.errToObj(f)})}endsWith(a,f){return this._addCheck({kind:"endsWith",value:a,...Y.errToObj(f)})}min(a,f){return this._addCheck({kind:"min",value:a,...Y.errToObj(f)})}max(a,f){return this._addCheck({kind:"max",value:a,...Y.errToObj(f)})}length(a,f){return this._addCheck({kind:"length",value:a,...Y.errToObj(f)})}nonempty(a){return this.min(1,Y.errToObj(a))}trim(){return new It({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new It({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new It({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get minLength(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxLength(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}},"ZodString");y(It,"ZodString"),It.create=a=>{var f;return new It({checks:[],typeName:ie.ZodString,coerce:(f=a?.coerce)!==null&&f!==void 0?f:!1,...ce(a)})};function Fr(a,f){let m=(a.toString().split(".")[1]||"").length,w=(f.toString().split(".")[1]||"").length,b=m>w?m:w,I=parseInt(a.toFixed(b).replace(".","")),P=parseInt(f.toFixed(b).replace(".",""));return I%P/Math.pow(10,b)}o(Fr,"floatSafeRemainder"),K(Fr,"floatSafeRemainder"),y(Fr,"floatSafeRemainder");var ut=K(class extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==R.number){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.number,received:b.parsedType}),re}let m,w=new Je;for(let b of this._def.checks)b.kind==="int"?V.isInteger(a.data)||(m=this._getOrReturnCtx(a,m),$(m,{code:A.invalid_type,expected:"integer",received:"float",message:b.message}),w.dirty()):b.kind==="min"?(b.inclusive?a.data<b.value:a.data<=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),w.dirty()):b.kind==="max"?(b.inclusive?a.data>b.value:a.data>=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),w.dirty()):b.kind==="multipleOf"?Fr(a.data,b.value)!==0&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_multiple_of,multipleOf:b.value,message:b.message}),w.dirty()):b.kind==="finite"?Number.isFinite(a.data)||(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_finite,message:b.message}),w.dirty()):V.assertNever(b);return{status:w.value,value:a.data}}gte(a,f){return this.setLimit("min",a,!0,Y.toString(f))}gt(a,f){return this.setLimit("min",a,!1,Y.toString(f))}lte(a,f){return this.setLimit("max",a,!0,Y.toString(f))}lt(a,f){return this.setLimit("max",a,!1,Y.toString(f))}setLimit(a,f,m,w){return new ut({...this._def,checks:[...this._def.checks,{kind:a,value:f,inclusive:m,message:Y.toString(w)}]})}_addCheck(a){return new ut({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:Y.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Y.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Y.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Y.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Y.toString(a)})}multipleOf(a,f){return this._addCheck({kind:"multipleOf",value:a,message:Y.toString(f)})}finite(a){return this._addCheck({kind:"finite",message:Y.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Y.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Y.toString(a)})}get minValue(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxValue(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}get isInt(){return!!this._def.checks.find(a=>a.kind==="int"||a.kind==="multipleOf"&&V.isInteger(a.value))}get isFinite(){let a=null,f=null;for(let m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(a===null||m.value<a)&&(a=m.value)}return Number.isFinite(f)&&Number.isFinite(a)}},"ZodNumber");y(ut,"ZodNumber"),ut.create=a=>new ut({checks:[],typeName:ie.ZodNumber,coerce:a?.coerce||!1,...ce(a)});var Wt=K(class extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce&&(a.data=BigInt(a.data)),this._getType(a)!==R.bigint){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.bigint,received:b.parsedType}),re}let m,w=new Je;for(let b of this._def.checks)b.kind==="min"?(b.inclusive?a.data<b.value:a.data<=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),w.dirty()):b.kind==="max"?(b.inclusive?a.data>b.value:a.data>=b.value)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),w.dirty()):b.kind==="multipleOf"?a.data%b.value!==BigInt(0)&&(m=this._getOrReturnCtx(a,m),$(m,{code:A.not_multiple_of,multipleOf:b.value,message:b.message}),w.dirty()):V.assertNever(b);return{status:w.value,value:a.data}}gte(a,f){return this.setLimit("min",a,!0,Y.toString(f))}gt(a,f){return this.setLimit("min",a,!1,Y.toString(f))}lte(a,f){return this.setLimit("max",a,!0,Y.toString(f))}lt(a,f){return this.setLimit("max",a,!1,Y.toString(f))}setLimit(a,f,m,w){return new Wt({...this._def,checks:[...this._def.checks,{kind:a,value:f,inclusive:m,message:Y.toString(w)}]})}_addCheck(a){return new Wt({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Y.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Y.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Y.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Y.toString(a)})}multipleOf(a,f){return this._addCheck({kind:"multipleOf",value:a,message:Y.toString(f)})}get minValue(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a}get maxValue(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a}},"ZodBigInt");y(Wt,"ZodBigInt"),Wt.create=a=>{var f;return new Wt({checks:[],typeName:ie.ZodBigInt,coerce:(f=a?.coerce)!==null&&f!==void 0?f:!1,...ce(a)})};var xr=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=Boolean(a.data)),this._getType(a)!==R.boolean){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.boolean,received:m.parsedType}),re}return Fe(a.data)}},"ZodBoolean");y(xr,"ZodBoolean"),xr.create=a=>new xr({typeName:ie.ZodBoolean,coerce:a?.coerce||!1,...ce(a)});var ir=K(class extends pe{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==R.date){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_type,expected:R.date,received:b.parsedType}),re}if(isNaN(a.data.getTime())){let b=this._getOrReturnCtx(a);return $(b,{code:A.invalid_date}),re}let m=new Je,w;for(let b of this._def.checks)b.kind==="min"?a.data.getTime()<b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),m.dirty()):b.kind==="max"?a.data.getTime()>b.value&&(w=this._getOrReturnCtx(a,w),$(w,{code:A.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),m.dirty()):V.assertNever(b);return{status:m.value,value:new Date(a.data.getTime())}}_addCheck(a){return new ir({...this._def,checks:[...this._def.checks,a]})}min(a,f){return this._addCheck({kind:"min",value:a.getTime(),message:Y.toString(f)})}max(a,f){return this._addCheck({kind:"max",value:a.getTime(),message:Y.toString(f)})}get minDate(){let a=null;for(let f of this._def.checks)f.kind==="min"&&(a===null||f.value>a)&&(a=f.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(let f of this._def.checks)f.kind==="max"&&(a===null||f.value<a)&&(a=f.value);return a!=null?new Date(a):null}},"ZodDate");y(ir,"ZodDate"),ir.create=a=>new ir({checks:[],coerce:a?.coerce||!1,typeName:ie.ZodDate,...ce(a)});var zr=K(class extends pe{_parse(a){if(this._getType(a)!==R.symbol){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.symbol,received:m.parsedType}),re}return Fe(a.data)}},"ZodSymbol");y(zr,"ZodSymbol"),zr.create=a=>new zr({typeName:ie.ZodSymbol,...ce(a)});var Er=K(class extends pe{_parse(a){if(this._getType(a)!==R.undefined){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.undefined,received:m.parsedType}),re}return Fe(a.data)}},"ZodUndefined");y(Er,"ZodUndefined"),Er.create=a=>new Er({typeName:ie.ZodUndefined,...ce(a)});var Tr=K(class extends pe{_parse(a){if(this._getType(a)!==R.null){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.null,received:m.parsedType}),re}return Fe(a.data)}},"ZodNull");y(Tr,"ZodNull"),Tr.create=a=>new Tr({typeName:ie.ZodNull,...ce(a)});var ar=K(class extends pe{constructor(){super(...arguments),this._any=!0}_parse(a){return Fe(a.data)}},"ZodAny");y(ar,"ZodAny"),ar.create=a=>new ar({typeName:ie.ZodAny,...ce(a)});var Ht=K(class extends pe{constructor(){super(...arguments),this._unknown=!0}_parse(a){return Fe(a.data)}},"ZodUnknown");y(Ht,"ZodUnknown"),Ht.create=a=>new Ht({typeName:ie.ZodUnknown,...ce(a)});var _t=K(class extends pe{_parse(a){let f=this._getOrReturnCtx(a);return $(f,{code:A.invalid_type,expected:R.never,received:f.parsedType}),re}},"ZodNever");y(_t,"ZodNever"),_t.create=a=>new _t({typeName:ie.ZodNever,...ce(a)});var li=K(class extends pe{_parse(a){if(this._getType(a)!==R.undefined){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.void,received:m.parsedType}),re}return Fe(a.data)}},"ZodVoid");y(li,"ZodVoid"),li.create=a=>new li({typeName:ie.ZodVoid,...ce(a)});var Nt=K(class extends pe{_parse(a){let{ctx:f,status:m}=this._processInputParams(a),w=this._def;if(f.parsedType!==R.array)return $(f,{code:A.invalid_type,expected:R.array,received:f.parsedType}),re;if(w.exactLength!==null){let I=f.data.length>w.exactLength.value,P=f.data.length<w.exactLength.value;(I||P)&&($(f,{code:I?A.too_big:A.too_small,minimum:P?w.exactLength.value:void 0,maximum:I?w.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:w.exactLength.message}),m.dirty())}if(w.minLength!==null&&f.data.length<w.minLength.value&&($(f,{code:A.too_small,minimum:w.minLength.value,type:"array",inclusive:!0,exact:!1,message:w.minLength.message}),m.dirty()),w.maxLength!==null&&f.data.length>w.maxLength.value&&($(f,{code:A.too_big,maximum:w.maxLength.value,type:"array",inclusive:!0,exact:!1,message:w.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((I,P)=>w.type._parseAsync(new At(f,I,f.path,P)))).then(I=>Je.mergeArray(m,I));let b=[...f.data].map((I,P)=>w.type._parseSync(new At(f,I,f.path,P)));return Je.mergeArray(m,b)}get element(){return this._def.type}min(a,f){return new Nt({...this._def,minLength:{value:a,message:Y.toString(f)}})}max(a,f){return new Nt({...this._def,maxLength:{value:a,message:Y.toString(f)}})}length(a,f){return new Nt({...this._def,exactLength:{value:a,message:Y.toString(f)}})}nonempty(a){return this.min(1,a)}},"ZodArray");y(Nt,"ZodArray"),Nt.create=(a,f)=>new Nt({type:a,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...ce(f)});function Cr(a){if(a instanceof Le){let f={};for(let m in a.shape){let w=a.shape[m];f[m]=Vt.create(Cr(w))}return new Le({...a._def,shape:()=>f})}else return a instanceof Nt?new Nt({...a._def,type:Cr(a.element)}):a instanceof Vt?Vt.create(Cr(a.unwrap())):a instanceof sr?sr.create(Cr(a.unwrap())):a instanceof jt?jt.create(a.items.map(f=>Cr(f))):a}o(Cr,"deepPartialify"),K(Cr,"deepPartialify"),y(Cr,"deepPartialify");var Le=K(class extends pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let a=this._def.shape(),f=V.objectKeys(a);return this._cached={shape:a,keys:f}}_parse(a){if(this._getType(a)!==R.object){let U=this._getOrReturnCtx(a);return $(U,{code:A.invalid_type,expected:R.object,received:U.parsedType}),re}let{status:m,ctx:w}=this._processInputParams(a),{shape:b,keys:I}=this._getCached(),P=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let U in w.data)I.includes(U)||P.push(U);let Z=[];for(let U of I){let le=b[U],De=w.data[U];Z.push({key:{status:"valid",value:U},value:le._parse(new At(w,De,w.path,U)),alwaysSet:U in w.data})}if(this._def.catchall instanceof _t){let U=this._def.unknownKeys;if(U==="passthrough")for(let le of P)Z.push({key:{status:"valid",value:le},value:{status:"valid",value:w.data[le]}});else if(U==="strict")P.length>0&&($(w,{code:A.unrecognized_keys,keys:P}),m.dirty());else if(U!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let le of P){let De=w.data[le];Z.push({key:{status:"valid",value:le},value:U._parse(new At(w,De,w.path,le)),alwaysSet:le in w.data})}}return w.common.async?Promise.resolve().then(async()=>{let U=[];for(let le of Z){let De=await le.key,Nn=await le.value;U.push({key:De,value:Nn,alwaysSet:le.alwaysSet})}return U}).then(U=>Je.mergeObjectSync(m,U)):Je.mergeObjectSync(m,Z)}get shape(){return this._def.shape()}strict(a){return Y.errToObj,new Le({...this._def,unknownKeys:"strict",...a!==void 0?{errorMap:(f,m)=>{var w,b,I,P;let Z=(I=(b=(w=this._def).errorMap)===null||b===void 0?void 0:b.call(w,f,m).message)!==null&&I!==void 0?I:m.defaultError;return f.code==="unrecognized_keys"?{message:(P=Y.errToObj(a).message)!==null&&P!==void 0?P:Z}:{message:Z}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(a){return new Le({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new Le({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:ie.ZodObject})}setKey(a,f){return this.augment({[a]:f})}catchall(a){return new Le({...this._def,catchall:a})}pick(a){let f={};return V.objectKeys(a).forEach(m=>{a[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}omit(a){let f={};return V.objectKeys(this.shape).forEach(m=>{a[m]||(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}deepPartial(){return Cr(this)}partial(a){let f={};return V.objectKeys(this.shape).forEach(m=>{let w=this.shape[m];a&&!a[m]?f[m]=w:f[m]=w.optional()}),new Le({...this._def,shape:()=>f})}required(a){let f={};return V.objectKeys(this.shape).forEach(m=>{if(a&&!a[m])f[m]=this.shape[m];else{let b=this.shape[m];for(;b instanceof Vt;)b=b._def.innerType;f[m]=b}}),new Le({...this._def,shape:()=>f})}keyof(){return ra(V.objectKeys(this.shape))}},"ZodObject");y(Le,"ZodObject"),Le.create=(a,f)=>new Le({shape:()=>a,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)}),Le.strictCreate=(a,f)=>new Le({shape:()=>a,unknownKeys:"strict",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)}),Le.lazycreate=(a,f)=>new Le({shape:a,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...ce(f)});var $r=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=this._def.options;function w(b){for(let P of b)if(P.result.status==="valid")return P.result;for(let P of b)if(P.result.status==="dirty")return f.common.issues.push(...P.ctx.common.issues),P.result;let I=b.map(P=>new Q(P.ctx.common.issues));return $(f,{code:A.invalid_union,unionErrors:I}),re}if(o(w,"handleResults"),K(w,"handleResults"),y(w,"handleResults"),f.common.async)return Promise.all(m.map(async b=>{let I={...f,common:{...f.common,issues:[]},parent:null};return{result:await b._parseAsync({data:f.data,path:f.path,parent:I}),ctx:I}})).then(w);{let b,I=[];for(let Z of m){let U={...f,common:{...f.common,issues:[]},parent:null},le=Z._parseSync({data:f.data,path:f.path,parent:U});if(le.status==="valid")return le;le.status==="dirty"&&!b&&(b={result:le,ctx:U}),U.common.issues.length&&I.push(U.common.issues)}if(b)return f.common.issues.push(...b.ctx.common.issues),b.result;let P=I.map(Z=>new Q(Z));return $(f,{code:A.invalid_union,unionErrors:P}),re}}get options(){return this._def.options}},"ZodUnion");y($r,"ZodUnion"),$r.create=(a,f)=>new $r({options:a,typeName:ie.ZodUnion,...ce(f)});var or=y(a=>a instanceof bn?or(a.schema):a instanceof bt?or(a.innerType()):a instanceof Rr?[a.value]:a instanceof Or?a.options:a instanceof wn?V.objectValues(a.enum):a instanceof xn?or(a._def.innerType):a instanceof Er?[void 0]:a instanceof Tr?[null]:a instanceof Vt?[void 0,...or(a.unwrap())]:a instanceof sr?[null,...or(a.unwrap())]:a instanceof na||a instanceof En?or(a.unwrap()):a instanceof Gr?or(a._def.innerType):[],"getDiscriminator"),ta=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.object)return $(f,{code:A.invalid_type,expected:R.object,received:f.parsedType}),re;let m=this.discriminator,w=f.data[m],b=this.optionsMap.get(w);return b?f.common.async?b._parseAsync({data:f.data,path:f.path,parent:f}):b._parseSync({data:f.data,path:f.path,parent:f}):($(f,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(a,f,m){let w=new Map;for(let b of f){let I=or(b.shape[a]);if(!I.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(let P of I){if(w.has(P))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(P)}`);w.set(P,b)}}return new ta({typeName:ie.ZodDiscriminatedUnion,discriminator:a,options:f,optionsMap:w,...ce(m)})}},"ZodDiscriminatedUnion");y(ta,"ZodDiscriminatedUnion");function di(a,f){let m=q(a),w=q(f);if(a===f)return{valid:!0,data:a};if(m===R.object&&w===R.object){let b=V.objectKeys(f),I=V.objectKeys(a).filter(Z=>b.indexOf(Z)!==-1),P={...a,...f};for(let Z of I){let U=di(a[Z],f[Z]);if(!U.valid)return{valid:!1};P[Z]=U.data}return{valid:!0,data:P}}else if(m===R.array&&w===R.array){if(a.length!==f.length)return{valid:!1};let b=[];for(let I=0;I<a.length;I++){let P=a[I],Z=f[I],U=di(P,Z);if(!U.valid)return{valid:!1};b.push(U.data)}return{valid:!0,data:b}}else return m===R.date&&w===R.date&&+a==+f?{valid:!0,data:a}:{valid:!1}}o(di,"mergeValues"),K(di,"mergeValues"),y(di,"mergeValues");var _n=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a),w=y((b,I)=>{if(br(b)||br(I))return re;let P=di(b.value,I.value);return P.valid?((mn(b)||mn(I))&&f.dirty(),{status:f.value,value:P.data}):($(m,{code:A.invalid_intersection_types}),re)},"handleParsed");return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([b,I])=>w(b,I)):w(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}},"ZodIntersection");y(_n,"ZodIntersection"),_n.create=(a,f,m)=>new _n({left:a,right:f,typeName:ie.ZodIntersection,...ce(m)});var jt=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.array)return $(m,{code:A.invalid_type,expected:R.array,received:m.parsedType}),re;if(m.data.length<this._def.items.length)return $(m,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&m.data.length>this._def.items.length&&($(m,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());let b=[...m.data].map((I,P)=>{let Z=this._def.items[P]||this._def.rest;return Z?Z._parse(new At(m,I,m.path,P)):null}).filter(I=>!!I);return m.common.async?Promise.all(b).then(I=>Je.mergeArray(f,I)):Je.mergeArray(f,b)}get items(){return this._def.items}rest(a){return new jt({...this._def,rest:a})}},"ZodTuple");y(jt,"ZodTuple"),jt.create=(a,f)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jt({items:a,typeName:ie.ZodTuple,rest:null,...ce(f)})};var fi=K(class extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.object)return $(m,{code:A.invalid_type,expected:R.object,received:m.parsedType}),re;let w=[],b=this._def.keyType,I=this._def.valueType;for(let P in m.data)w.push({key:b._parse(new At(m,P,m.path,P)),value:I._parse(new At(m,m.data[P],m.path,P)),alwaysSet:P in m.data});return m.common.async?Je.mergeObjectAsync(f,w):Je.mergeObjectSync(f,w)}get element(){return this._def.valueType}static create(a,f,m){return f instanceof pe?new fi({keyType:a,valueType:f,typeName:ie.ZodRecord,...ce(m)}):new fi({keyType:It.create(),valueType:a,typeName:ie.ZodRecord,...ce(f)})}},"ZodRecord");y(fi,"ZodRecord");var pi=K(class extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.map)return $(m,{code:A.invalid_type,expected:R.map,received:m.parsedType}),re;let w=this._def.keyType,b=this._def.valueType,I=[...m.data.entries()].map(([P,Z],U)=>({key:w._parse(new At(m,P,m.path,[U,"key"])),value:b._parse(new At(m,Z,m.path,[U,"value"]))}));if(m.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let Z of I){let U=await Z.key,le=await Z.value;if(U.status==="aborted"||le.status==="aborted")return re;(U.status==="dirty"||le.status==="dirty")&&f.dirty(),P.set(U.value,le.value)}return{status:f.value,value:P}})}else{let P=new Map;for(let Z of I){let U=Z.key,le=Z.value;if(U.status==="aborted"||le.status==="aborted")return re;(U.status==="dirty"||le.status==="dirty")&&f.dirty(),P.set(U.value,le.value)}return{status:f.value,value:P}}}},"ZodMap");y(pi,"ZodMap"),pi.create=(a,f,m)=>new pi({valueType:f,keyType:a,typeName:ie.ZodMap,...ce(m)});var Wr=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.parsedType!==R.set)return $(m,{code:A.invalid_type,expected:R.set,received:m.parsedType}),re;let w=this._def;w.minSize!==null&&m.data.size<w.minSize.value&&($(m,{code:A.too_small,minimum:w.minSize.value,type:"set",inclusive:!0,exact:!1,message:w.minSize.message}),f.dirty()),w.maxSize!==null&&m.data.size>w.maxSize.value&&($(m,{code:A.too_big,maximum:w.maxSize.value,type:"set",inclusive:!0,exact:!1,message:w.maxSize.message}),f.dirty());let b=this._def.valueType;function I(Z){let U=new Set;for(let le of Z){if(le.status==="aborted")return re;le.status==="dirty"&&f.dirty(),U.add(le.value)}return{status:f.value,value:U}}o(I,"finalizeSet"),K(I,"finalizeSet"),y(I,"finalizeSet");let P=[...m.data.values()].map((Z,U)=>b._parse(new At(m,Z,m.path,U)));return m.common.async?Promise.all(P).then(Z=>I(Z)):I(P)}min(a,f){return new Wr({...this._def,minSize:{value:a,message:Y.toString(f)}})}max(a,f){return new Wr({...this._def,maxSize:{value:a,message:Y.toString(f)}})}size(a,f){return this.min(a,f).max(a,f)}nonempty(a){return this.min(1,a)}},"ZodSet");y(Wr,"ZodSet"),Wr.create=(a,f)=>new Wr({valueType:a,minSize:null,maxSize:null,typeName:ie.ZodSet,...ce(f)});var Sr=K(class extends pe{constructor(){super(...arguments),this.validate=this.implement}_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.function)return $(f,{code:A.invalid_type,expected:R.function,received:f.parsedType}),re;function m(P,Z){return Ue({data:P,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_arguments,argumentsError:Z}})}o(m,"makeArgsIssue"),K(m,"makeArgsIssue"),y(m,"makeArgsIssue");function w(P,Z){return Ue({data:P,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_return_type,returnTypeError:Z}})}o(w,"makeReturnsIssue"),K(w,"makeReturnsIssue"),y(w,"makeReturnsIssue");let b={errorMap:f.common.contextualErrorMap},I=f.data;if(this._def.returns instanceof Hr){let P=this;return Fe(async function(...Z){let U=new Q([]),le=await P._def.args.parseAsync(Z,b).catch(wa=>{throw U.addIssue(m(Z,wa)),U}),De=await Reflect.apply(I,this,le);return await P._def.returns._def.type.parseAsync(De,b).catch(wa=>{throw U.addIssue(w(De,wa)),U})})}else{let P=this;return Fe(function(...Z){let U=P._def.args.safeParse(Z,b);if(!U.success)throw new Q([m(Z,U.error)]);let le=Reflect.apply(I,this,U.data),De=P._def.returns.safeParse(le,b);if(!De.success)throw new Q([w(le,De.error)]);return De.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...a){return new Sr({...this._def,args:jt.create(a).rest(Ht.create())})}returns(a){return new Sr({...this._def,returns:a})}implement(a){return this.parse(a)}strictImplement(a){return this.parse(a)}static create(a,f,m){return new Sr({args:a||jt.create([]).rest(Ht.create()),returns:f||Ht.create(),typeName:ie.ZodFunction,...ce(m)})}},"ZodFunction");y(Sr,"ZodFunction");var bn=K(class extends pe{get schema(){return this._def.getter()}_parse(a){let{ctx:f}=this._processInputParams(a);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}},"ZodLazy");y(bn,"ZodLazy"),bn.create=(a,f)=>new bn({getter:a,typeName:ie.ZodLazy,...ce(f)});var Rr=K(class extends pe{_parse(a){if(a.data!==this._def.value){let f=this._getOrReturnCtx(a);return $(f,{received:f.data,code:A.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:a.data}}get value(){return this._def.value}},"ZodLiteral");y(Rr,"ZodLiteral"),Rr.create=(a,f)=>new Rr({value:a,typeName:ie.ZodLiteral,...ce(f)});function ra(a,f){return new Or({values:a,typeName:ie.ZodEnum,...ce(f)})}o(ra,"createZodEnum"),K(ra,"createZodEnum"),y(ra,"createZodEnum");var Or=K(class extends pe{constructor(){super(...arguments),ai.set(this,void 0)}_parse(a){if(typeof a.data!="string"){let f=this._getOrReturnCtx(a),m=this._def.values;return $(f,{expected:V.joinValues(m),received:f.parsedType,code:A.invalid_type}),re}if(gn(this,ai,"f")||Br(this,ai,new Set(this._def.values),"f"),!gn(this,ai,"f").has(a.data)){let f=this._getOrReturnCtx(a),m=this._def.values;return $(f,{received:f.data,code:A.invalid_enum_value,options:m}),re}return Fe(a.data)}get options(){return this._def.values}get enum(){let a={};for(let f of this._def.values)a[f]=f;return a}get Values(){let a={};for(let f of this._def.values)a[f]=f;return a}get Enum(){let a={};for(let f of this._def.values)a[f]=f;return a}extract(a,f=this._def){return Or.create(a,{...this._def,...f})}exclude(a,f=this._def){return Or.create(this.options.filter(m=>!a.includes(m)),{...this._def,...f})}},"ZodEnum");y(Or,"ZodEnum"),ai=new WeakMap,Or.create=ra;var wn=K(class extends pe{constructor(){super(...arguments),oi.set(this,void 0)}_parse(a){let f=V.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(a);if(m.parsedType!==R.string&&m.parsedType!==R.number){let w=V.objectValues(f);return $(m,{expected:V.joinValues(w),received:m.parsedType,code:A.invalid_type}),re}if(gn(this,oi,"f")||Br(this,oi,new Set(V.getValidEnumValues(this._def.values)),"f"),!gn(this,oi,"f").has(a.data)){let w=V.objectValues(f);return $(m,{received:m.data,code:A.invalid_enum_value,options:w}),re}return Fe(a.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(wn,"ZodNativeEnum"),oi=new WeakMap,wn.create=(a,f)=>new wn({values:a,typeName:ie.ZodNativeEnum,...ce(f)});var Hr=K(class extends pe{unwrap(){return this._def.type}_parse(a){let{ctx:f}=this._processInputParams(a);if(f.parsedType!==R.promise&&f.common.async===!1)return $(f,{code:A.invalid_type,expected:R.promise,received:f.parsedType}),re;let m=f.parsedType===R.promise?f.data:Promise.resolve(f.data);return Fe(m.then(w=>this._def.type.parseAsync(w,{path:f.path,errorMap:f.common.contextualErrorMap})))}},"ZodPromise");y(Hr,"ZodPromise"),Hr.create=(a,f)=>new Hr({type:a,typeName:ie.ZodPromise,...ce(f)});var bt=K(class extends pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(a){let{status:f,ctx:m}=this._processInputParams(a),w=this._def.effect||null,b={addIssue:I=>{$(m,I),I.fatal?f.abort():f.dirty()},get path(){return m.path}};if(b.addIssue=b.addIssue.bind(b),w.type==="preprocess"){let I=w.transform(m.data,b);if(m.common.async)return Promise.resolve(I).then(async P=>{if(f.value==="aborted")return re;let Z=await this._def.schema._parseAsync({data:P,path:m.path,parent:m});return Z.status==="aborted"?re:Z.status==="dirty"||f.value==="dirty"?$t(Z.value):Z});{if(f.value==="aborted")return re;let P=this._def.schema._parseSync({data:I,path:m.path,parent:m});return P.status==="aborted"?re:P.status==="dirty"||f.value==="dirty"?$t(P.value):P}}if(w.type==="refinement"){let I=y(P=>{let Z=w.refinement(P,b);if(m.common.async)return Promise.resolve(Z);if(Z instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P},"executeRefinement");if(m.common.async===!1){let P=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return P.status==="aborted"?re:(P.status==="dirty"&&f.dirty(),I(P.value),{status:f.value,value:P.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(P=>P.status==="aborted"?re:(P.status==="dirty"&&f.dirty(),I(P.value).then(()=>({status:f.value,value:P.value}))))}if(w.type==="transform")if(m.common.async===!1){let I=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!Ot(I))return I;let P=w.transform(I.value,b);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:P}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(I=>Ot(I)?Promise.resolve(w.transform(I.value,b)).then(P=>({status:f.value,value:P})):I);V.assertNever(w)}},"ZodEffects");y(bt,"ZodEffects"),bt.create=(a,f,m)=>new bt({schema:a,typeName:ie.ZodEffects,effect:f,...ce(m)}),bt.createWithPreprocess=(a,f,m)=>new bt({schema:f,effect:{type:"preprocess",transform:a},typeName:ie.ZodEffects,...ce(m)});var Vt=K(class extends pe{_parse(a){return this._getType(a)===R.undefined?Fe(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}},"ZodOptional");y(Vt,"ZodOptional"),Vt.create=(a,f)=>new Vt({innerType:a,typeName:ie.ZodOptional,...ce(f)});var sr=K(class extends pe{_parse(a){return this._getType(a)===R.null?Fe(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}},"ZodNullable");y(sr,"ZodNullable"),sr.create=(a,f)=>new sr({innerType:a,typeName:ie.ZodNullable,...ce(f)});var xn=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=f.data;return f.parsedType===R.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}},"ZodDefault");y(xn,"ZodDefault"),xn.create=(a,f)=>new xn({innerType:a,typeName:ie.ZodDefault,defaultValue:typeof f.default=="function"?f.default:()=>f.default,...ce(f)});var Gr=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m={...f,common:{...f.common,issues:[]}},w=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return vt(w)?w.then(b=>({status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new Q(m.common.issues)},input:m.data})})):{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new Q(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(Gr,"ZodCatch"),Gr.create=(a,f)=>new Gr({innerType:a,typeName:ie.ZodCatch,catchValue:typeof f.catch=="function"?f.catch:()=>f.catch,...ce(f)});var hi=K(class extends pe{_parse(a){if(this._getType(a)!==R.nan){let m=this._getOrReturnCtx(a);return $(m,{code:A.invalid_type,expected:R.nan,received:m.parsedType}),re}return{status:"valid",value:a.data}}},"ZodNaN");y(hi,"ZodNaN"),hi.create=a=>new hi({typeName:ie.ZodNaN,...ce(a)});var Vc=Symbol("zod_brand"),na=K(class extends pe{_parse(a){let{ctx:f}=this._processInputParams(a),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}},"ZodBranded");y(na,"ZodBranded");var mi=K(class extends pe{_parse(a){let{status:f,ctx:m}=this._processInputParams(a);if(m.common.async)return y(async()=>{let b=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return b.status==="aborted"?re:b.status==="dirty"?(f.dirty(),$t(b.value)):this._def.out._parseAsync({data:b.value,path:m.path,parent:m})},"handleAsync")();{let w=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return w.status==="aborted"?re:w.status==="dirty"?(f.dirty(),{status:"dirty",value:w.value}):this._def.out._parseSync({data:w.value,path:m.path,parent:m})}}static create(a,f){return new mi({in:a,out:f,typeName:ie.ZodPipeline})}},"ZodPipeline");y(mi,"ZodPipeline");var En=K(class extends pe{_parse(a){let f=this._def.innerType._parse(a),m=y(w=>(Ot(w)&&(w.value=Object.freeze(w.value)),w),"freeze");return vt(f)?f.then(w=>m(w)):m(f)}unwrap(){return this._def.innerType}},"ZodReadonly");y(En,"ZodReadonly"),En.create=(a,f)=>new En({innerType:a,typeName:ie.ZodReadonly,...ce(f)});function ia(a,f={},m){return a?ar.create().superRefine((w,b)=>{var I,P;if(!a(w)){let Z=typeof f=="function"?f(w):typeof f=="string"?{message:f}:f,U=(P=(I=Z.fatal)!==null&&I!==void 0?I:m)!==null&&P!==void 0?P:!0,le=typeof Z=="string"?{message:Z}:Z;b.addIssue({code:"custom",...le,fatal:U})}}):ar.create()}o(ia,"custom"),K(ia,"custom"),y(ia,"custom");var aa={object:Le.lazycreate},ie;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(ie||(ie={}));var oa=y((a,f={message:`Input not instance of ${a.name}`})=>ia(m=>m instanceof a,f),"instanceOfType"),Wo=It.create,Ho=ut.create,Dc=hi.create,Go=Wt.create,qa=xr.create,Jo=ir.create,Lc=zr.create,Mc=Er.create,Uc=Tr.create,Bc=ar.create,Yo=Ht.create,Ko=_t.create,Qo=li.create,Fa=Nt.create,Zc=Le.create,Xo=Le.strictCreate,sa=$r.create,es=ta.create,qc=_n.create,ts=jt.create,rs=fi.create,za=pi.create,Fc=Wr.create,ns=Sr.create,$a=bn.create,Wa=Rr.create,Tn=Or.create,is=wn.create,as=Hr.create,os=bt.create,ss=Vt.create,cs=sr.create,us=bt.createWithPreprocess,ls=mi.create,zc=y(()=>Wo().optional(),"ostring"),$c=y(()=>Ho().optional(),"onumber"),Wc=y(()=>qa().optional(),"oboolean"),ds={string:a=>It.create({...a,coerce:!0}),number:a=>ut.create({...a,coerce:!0}),boolean:a=>xr.create({...a,coerce:!0}),bigint:a=>Wt.create({...a,coerce:!0}),date:a=>ir.create({...a,coerce:!0})},Hc=re,u=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:be,getErrorMap:Ne,makeIssue:Ue,EMPTY_PATH:Ur,addIssueToContext:$,ParseStatus:Je,INVALID:re,DIRTY:$t,OK:Fe,isAborted:br,isDirty:mn,isValid:Ot,isAsync:vt,get util(){return V},get objectUtil(){return k},ZodParsedType:R,getParsedType:q,ZodType:pe,datetimeRegex:ea,ZodString:It,ZodNumber:ut,ZodBigInt:Wt,ZodBoolean:xr,ZodDate:ir,ZodSymbol:zr,ZodUndefined:Er,ZodNull:Tr,ZodAny:ar,ZodUnknown:Ht,ZodNever:_t,ZodVoid:li,ZodArray:Nt,ZodObject:Le,ZodUnion:$r,ZodDiscriminatedUnion:ta,ZodIntersection:_n,ZodTuple:jt,ZodRecord:fi,ZodMap:pi,ZodSet:Wr,ZodFunction:Sr,ZodLazy:bn,ZodLiteral:Rr,ZodEnum:Or,ZodNativeEnum:wn,ZodPromise:Hr,ZodEffects:bt,ZodTransformer:bt,ZodOptional:Vt,ZodNullable:sr,ZodDefault:xn,ZodCatch:Gr,ZodNaN:hi,BRAND:Vc,ZodBranded:na,ZodPipeline:mi,ZodReadonly:En,custom:ia,Schema:pe,ZodSchema:pe,late:aa,get ZodFirstPartyTypeKind(){return ie},coerce:ds,any:Bc,array:Fa,bigint:Go,boolean:qa,date:Jo,discriminatedUnion:es,effect:os,enum:Tn,function:ns,instanceof:oa,intersection:qc,lazy:$a,literal:Wa,map:za,nan:Dc,nativeEnum:is,never:Ko,null:Uc,nullable:cs,number:Ho,object:Zc,oboolean:Wc,onumber:$c,optional:ss,ostring:zc,pipeline:ls,preprocess:us,promise:as,record:rs,set:Fc,strictObject:Xo,string:Wo,symbol:Lc,transformer:os,tuple:ts,undefined:Mc,union:sa,unknown:Yo,void:Qo,NEVER:Hc,ZodIssueCode:A,quotelessJson:X,ZodError:Q}),gi=Symbol("current"),Cn=Symbol("previous"),Jr=y((a,{ref:f,refType:m,param:w,header:b,...I}={})=>({...I,...a}),"mergeOpenApi");function Ha(a){if(typeof a.ZodType.prototype.openapi<"u")return;a.ZodType.prototype.openapi=function(I){let{zodOpenApi:P,...Z}=this._def,U=new this.constructor({...Z,zodOpenApi:{openapi:Jr(I,P?.openapi)}});return U._def.zodOpenApi[gi]=U,P&&(U._def.zodOpenApi[Cn]=this),U};let f=a.ZodType.prototype.describe;a.ZodType.prototype.describe=function(...I){let P=f.apply(this,I),Z=P._def;if(Z.zodOpenApi){let U={...Z.zodOpenApi};U.openapi=Jr({description:I[0]},U.openapi),U[Cn]=this,U[gi]=P,Z.zodOpenApi=U}else Z.zodOpenApi={openapi:{description:I[0]},[gi]:P};return P};let m=a.ZodObject.prototype.extend;a.ZodObject.prototype.extend=function(...I){let P=m.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),U[Cn]=this,P._def.zodOpenApi=U}else P._def.zodOpenApi={[Cn]:this};return P};let w=a.ZodObject.prototype.omit;a.ZodObject.prototype.omit=function(...I){let P=w.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),delete U[Cn],delete U[gi],P._def.zodOpenApi=U}return P};let b=a.ZodObject.prototype.pick;a.ZodObject.prototype.pick=function(...I){let P=b.apply(this,I),Z=P._def.zodOpenApi;if(Z){let U={...Z};U.openapi=Jr({},U.openapi),delete U[Cn],delete U[gi],P._def.zodOpenApi=U}return P}}o(Ha,"extendZodWithOpenApi"),K(Ha,"extendZodWithOpenApi"),y(Ha,"extendZodWithOpenApi"),Ha(u);var yi=u.array(u.string().or(u.record(u.any()))),Gc=u.object({type:u.string().optional(),narrative:u.string().optional()}),vi=u.string().or(u.object({id:u.string(),type:u.string(),caption:u.string().optional()})),fs=u.object({type:u.string().min(1).or(u.string().array().nonempty()),latitude:u.number(),longitude:u.number()}),je=u.object({type:u.string().min(1).or(u.string().array().nonempty()),addressCountry:u.string().optional(),addressCountryCode:u.string().optional(),addressRegion:u.string().optional(),addressLocality:u.string().optional(),streetAddress:u.string().optional(),postOfficeBoxNumber:u.string().optional(),postalCode:u.string().optional(),geo:fs.optional()}),Ie=u.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(u.string()),Ga=u.object({type:u.string().min(1).or(u.string().array().nonempty()),identifier:u.string(),identifierType:Ie}),Sn=u.string().or(u.object({id:u.string().optional(),type:u.string().or(u.string().array().nonempty().optional()),name:u.string().optional(),url:u.string().optional(),phone:u.string().optional(),description:u.string().optional(),endorsement:u.any().array().optional(),image:vi.optional(),email:u.string().email().optional(),address:je.optional(),otherIdentifier:Ga.array().optional(),official:u.string().optional(),parentOrg:u.any().optional(),familyName:u.string().optional(),givenName:u.string().optional(),additionalName:u.string().optional(),patronymicName:u.string().optional(),honorificPrefix:u.string().optional(),honorificSuffix:u.string().optional(),familyNamePrefix:u.string().optional(),dateOfBirth:u.string().optional()}).catchall(u.any())),ca=u.object({id:u.string().optional()}).catchall(u.any()),_i=u.object({type:u.string(),id:u.string()}).catchall(u.any()),Ja=u.object({id:u.string(),type:u.string()}).catchall(u.any()),Ya=u.object({id:u.string().optional(),type:u.string()}).catchall(u.any()),ua=u.object({type:u.string(),id:u.string().optional()}).catchall(u.any()),Ka=u.object({type:u.string().or(u.string().array().nonempty()),id:u.string().optional()}).catchall(u.any()),Be=u.object({"@context":yi,id:u.string().optional(),type:u.string().array().nonempty(),issuer:Sn,credentialSubject:ca.or(ca.array()),refreshService:Ya.or(Ya.array()).optional(),credentialSchema:Ja.or(Ja.array()).optional(),issuanceDate:u.string().optional(),expirationDate:u.string().optional(),credentialStatus:_i.or(_i.array()).optional(),name:u.string().optional(),description:u.string().optional(),validFrom:u.string().optional(),validUntil:u.string().optional(),status:_i.or(_i.array()).optional(),termsOfUse:ua.or(ua.array()).optional(),evidence:Ka.or(Ka.array()).optional()}).catchall(u.any()),lt=u.object({type:u.string(),created:u.string(),challenge:u.string().optional(),domain:u.string().optional(),nonce:u.string().optional(),proofPurpose:u.string(),verificationMethod:u.string(),jws:u.string().optional()}).catchall(u.any()),Gt=Be.extend({proof:lt.or(lt.array())}),Qa=u.object({"@context":yi,id:u.string().optional(),type:u.string().or(u.string().array().nonempty()),verifiableCredential:Gt.or(Gt.array()).optional(),holder:u.string().optional()}).catchall(u.any()),la=Qa.extend({proof:lt.or(lt.array())}),nt=u.object({kty:u.string(),crv:u.string(),x:u.string(),y:u.string().optional(),n:u.string().optional(),d:u.string().optional()}),ps=nt.omit({d:!0}).extend({d:u.string()}),Xa=u.object({alg:u.string(),iv:u.string(),tag:u.string(),epk:nt.partial().optional(),kid:u.string().optional(),apv:u.string().optional(),apu:u.string().optional()}),eo=u.object({header:Xa,encrypted_key:u.string()}),to=u.object({protected:u.string(),iv:u.string(),ciphertext:u.string(),tag:u.string(),aad:u.string().optional(),recipients:eo.array().optional()}),cr=u.string().or(u.object({"@context":yi.optional(),id:u.string(),type:u.string(),controller:u.string(),publicKeyJwk:nt.optional(),publicKeyBase58:u.string().optional(),publicKeyMultibase:u.string().optional(),blockChainAccountId:u.string().optional()}).catchall(u.any())),ro=u.object({id:u.string(),type:u.string().or(u.string().array().nonempty()),serviceEndpoint:u.any().or(u.any().array().nonempty())}).catchall(u.any()),dt=u.object({"@context":yi,id:u.string(),alsoKnownAs:u.string().optional(),controller:u.string().or(u.string().array().nonempty()).optional(),verificationMethod:cr.array().optional(),authentication:cr.array().optional(),assertionMethod:cr.array().optional(),keyAgreement:cr.array().optional(),capabilityInvocation:cr.array().optional(),capabilityDelegation:cr.array().optional(),publicKey:cr.array().optional(),service:ro.array().optional(),proof:lt.or(lt.array()).optional()}).catchall(u.any()),hs=u.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(u.string()),Xe=u.object({type:u.string().array().nonempty(),targetCode:u.string().optional(),targetDescription:u.string().optional(),targetName:u.string(),targetFramework:u.string().optional(),targetType:hs.optional(),targetUrl:u.string()}),ms=u.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),no=ms.or(u.string()),ur=u.object({id:u.string().optional(),narrative:u.string().optional()}).catchall(u.any()),bi=u.object({id:u.string(),type:u.string().array().nonempty(),endorsementComment:u.string().optional()}),da=Be.extend({credentialSubject:bi,proof:lt.or(lt.array()).optional()}),Ve=u.object({id:u.string(),"@language":u.string().optional(),version:u.string().optional()}),lr=u.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(u.string()),fa=u.object({id:u.string(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),description:u.string().optional(),level:u.string().optional(),name:u.string(),points:u.string().optional()}).catchall(u.any()),gs=u.object({id:u.string(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),allowedValue:u.string().array().optional(),name:u.string(),requiredLevel:u.string().optional(),requiredValue:u.string().optional(),resultType:lr,rubricCriterionLevel:fa.array().optional(),valueMax:u.string().optional(),valueMin:u.string().optional()}).catchall(u.any()),pa=u.object({id:u.string().optional(),type:u.string().array().nonempty(),alignment:Xe.array().optional(),achievementType:no.optional(),creator:Sn.optional(),creditsAvailable:u.number().optional(),criteria:ur,description:u.string(),endorsement:da.array().optional(),fieldOfStudy:u.string().optional(),humanCode:u.string().optional(),image:vi.optional(),"@language":u.string().optional(),name:u.string(),otherIdentifier:Ga.array().optional(),related:Ve.array().optional(),resultDescription:gs.array().optional(),specialization:u.string().optional(),tag:u.string().array().optional(),version:u.string().optional()}).catchall(u.any()),ys=u.object({type:u.string(),hashed:u.boolean(),identityHash:u.string(),identityType:u.string(),salt:u.string().optional()}),vs=u.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),_s=u.object({type:u.string().array().nonempty(),achievedLevel:u.string().optional(),alignment:Xe.array().optional(),resultDescription:u.string().optional(),status:vs.optional(),value:u.string().optional()}).catchall(u.any()),ha=u.object({id:u.string().optional(),type:u.string().array().nonempty(),activityEndDate:u.string().optional(),activityStartDate:u.string().optional(),creditsEarned:u.number().optional(),achievement:pa.optional(),identifier:ys.array().optional(),image:vi.optional(),licenseNumber:u.string().optional(),narrative:u.string().optional(),result:_s.array().optional(),role:u.string().optional(),source:Sn.optional(),term:u.string().optional()}).catchall(u.any()),wi=u.object({id:u.string().optional(),type:u.string().or(u.string().array().nonempty()),narrative:u.string().optional(),name:u.string().optional(),description:u.string().optional(),genre:u.string().optional(),audience:u.string().optional()}).catchall(u.any()),Yr=Be.extend({name:u.string().optional(),description:u.string().optional(),image:vi.optional(),credentialSubject:ha.or(ha.array()),endorsement:Be.array().optional(),evidence:wi.array().optional()}),Jc=Yr.extend({proof:lt.or(lt.array())}),bs=u.object({checks:u.string().array(),warnings:u.string().array(),errors:u.string().array()}),ma=u.enum(["Success","Failed","Error"]),io=ma.enum,ao=u.object({check:u.string(),status:ma,message:u.string().optional(),details:u.string().optional()}),ws=u.object({title:u.string().optional(),createdAt:u.string().optional(),issuer:Sn.optional(),issuee:Sn.optional(),credentialSubject:ca.optional()}),Yc=u.object({id:u.string(),uri:u.string()}).catchall(u.any()),oo=u.object({limit:u.number(),cursor:u.string().optional(),sort:u.string().optional()}),Ye=u.object({cursor:u.string().optional(),hasMore:u.boolean()}),so=u.object({encryptedRecord:to,fields:u.string().array()}).catchall(u.any()),xs=Ye.extend({records:so.array()}),ot=so.extend({id:u.string()}),co=Ye.extend({records:ot.array()}),Rn=y(a=>{let f=a.match(/^\/(.*)\/([gimsuy]*)$/);if(!f)throw new Error("Invalid RegExp string format");return{pattern:f[1],flags:f[2]}},"parseRegexString"),uo=u.instanceof(RegExp).or(u.string().refine(a=>{try{return Rn(a),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(a=>{let{pattern:f,flags:m}=Rn(a);try{return new RegExp(f,m)}catch(w){throw new Error(`Invalid RegExp: ${w.message}`)}})),Te=u.string().or(u.object({$in:u.string().array()})).or(u.object({$regex:uo})),Es=u.object({backgroundColor:u.string().optional(),backgroundImage:u.string().optional(),fadeBackgroundImage:u.boolean().optional(),repeatBackgroundImage:u.boolean().optional(),fontColor:u.string().optional(),accentColor:u.string().optional(),accentFontColor:u.string().optional(),idBackgroundImage:u.string().optional(),fadeIdBackgroundImage:u.boolean().optional(),idBackgroundColor:u.string().optional(),repeatIdBackgroundImage:u.boolean().optional()}),Jt=u.object({profileId:u.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:u.string().default("").describe("Human-readable display name for the profile."),shortBio:u.string().default("").describe("Short bio for the profile."),bio:u.string().default("").describe("Longer bio for the profile."),did:u.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:u.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:u.string().optional().describe("Contact email address for the profile. (deprecated)"),image:u.string().optional().describe("Profile image URL for the profile."),heroImage:u.string().optional().describe("Hero image URL for the profile."),websiteLink:u.string().optional().describe("Website link for the profile."),isServiceProfile:u.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:u.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:u.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Es.optional().describe("Display settings for the profile."),highlightedCredentials:u.array(u.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:u.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:u.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:u.string().optional().describe("Country for the profile."),approved:u.boolean().optional().describe("Approval status for the profile.")}),Kc=u.object({profileId:Te,displayName:Te,shortBio:Te,bio:Te,email:Te,websiteLink:Te,isServiceProfile:u.boolean(),type:Te}).partial(),Qc=Ye.extend({records:Jt.array()}),Xc=u.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Ar=u.object({id:u.string(),created:u.string(),displayName:u.string().default("").optional(),shortBio:u.string().default("").optional(),bio:u.string().default("").optional(),email:u.string().optional(),image:u.string().optional(),heroImage:u.string().optional()}),eu=Ye.extend({records:Ar.extend({did:u.string()}).array()}),tu=u.object({id:Te,displayName:Te,shortBio:Te,bio:Te,email:Te}).partial(),lo=Ye.extend({records:u.object({profile:Jt,manager:Ar.extend({did:u.string()}).optional()}).array()}),Ts=u.object({uri:u.string(),to:u.string(),from:u.string(),sent:u.string().datetime(),received:u.string().datetime().optional()}),Yt=u.object({role:u.string(),canEdit:u.boolean(),canIssue:u.boolean(),canRevoke:u.boolean(),canManagePermissions:u.boolean(),canIssueChildren:u.string(),canCreateChildren:u.string(),canEditChildren:u.string(),canRevokeChildren:u.string(),canManageChildrenPermissions:u.string(),canManageChildrenProfiles:u.boolean().default(!1).optional(),canViewAnalytics:u.boolean()}),xi=u.object({role:Te,canEdit:u.boolean(),canIssue:u.boolean(),canRevoke:u.boolean(),canManagePermissions:u.boolean(),canIssueChildren:Te,canCreateChildren:Te,canEditChildren:Te,canRevokeChildren:Te,canManageChildrenPermissions:Te,canManageChildrenProfiles:u.boolean(),canViewAnalytics:u.boolean()}).partial(),ga=u.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Cs=u.discriminatedUnion("type",[u.object({type:u.literal(ga.Values.GRANT_PERMISSIONS),data:u.object({claimUri:u.string(),targetUri:u.string(),permissions:Yt.partial()})}),u.object({type:u.literal(ga.Values.ADD_ADMIN),data:u.object({claimUri:u.string(),targetUri:u.string()})}),u.object({type:u.literal(ga.Values.AUTO_CONNECT),data:u.object({claimUri:u.string(),targetUri:u.string()})})]),ru=u.object({type:Te,data:u.object({claimUri:Te,targetUri:Te,permissions:xi})}).deepPartial(),Kr=u.object({id:u.string(),createdAt:u.string(),updatedAt:u.string()}).and(Cs),Dt=Ye.extend({records:Kr.array()}),Ei=u.enum(["DRAFT","LIVE"]),Ss=u.object({uri:u.string(),name:u.string().optional(),type:u.string().optional(),category:u.string().optional(),status:Ei.optional(),autoConnectRecipients:u.boolean().optional(),meta:u.record(u.any()).optional(),claimPermissions:Yt.optional(),allowAnyoneToCreateChildren:u.boolean().optional()}),nu=u.object({uri:Te,name:Te,type:Te,category:Te,meta:u.record(Te),status:Ei.or(u.object({$in:Ei.array()})),autoConnectRecipients:u.boolean()}).partial(),iu=Ye.extend({records:Ss.array()}),Rs=u.object({to:Jt,from:u.string(),received:u.string().optional(),uri:u.string().optional()}),au=Ye.extend({records:Rs.array()}),dr=u.object({to:Jt,from:u.string(),received:u.string().optional(),boostUris:u.array(u.string()),credentialUris:u.array(u.string()).optional()}),C=Ye.extend({records:dr.array()}),D=u.object({endpoint:u.string(),name:u.string(),did:u.string().optional()}),j=u.object({ttlSeconds:u.number().optional(),totalUses:u.number().optional()}),G=u.object({endpoint:u.string()}),fe=u.object({signingAuthority:G,relationship:u.object({name:u.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:u.string(),isPrimary:u.boolean().optional()})}),Re=u.object({boostUri:u.string(),signingAuthority:u.object({endpoint:u.string(),name:u.string()})}),ze=u.enum(["live","stale","withdrawn"]),Ae=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),personal:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),write:u.object({credentials:u.object({categories:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({}),personal:u.record(u.object({required:u.boolean(),defaultEnabled:u.boolean().optional()})).default({})}).default({})}),Ti=u.object({contract:Ae,owner:Jt,name:u.string(),subtitle:u.string().optional(),description:u.string().optional(),reasonForAccessing:u.string().optional(),image:u.string().optional(),uri:u.string(),needsGuardianConsent:u.boolean().optional(),redirectUrl:u.string().optional(),frontDoorBoostUri:u.string().optional(),createdAt:u.string(),updatedAt:u.string(),expiresAt:u.string().optional(),autoBoosts:u.string().array().optional(),writers:u.array(Jt).optional()}),ou=Ye.extend({records:Ti.omit({owner:!0}).array()}),ft=u.object({credentials:u.object({categories:u.record(u.string().array()).default({})}),personal:u.record(u.string()).default({}),date:u.string()}),ya=Ye.extend({records:ft.array()}),Os=u.object({credentials:u.object({category:u.string(),uri:u.string()}).array(),personal:u.record(u.string()).default({}),date:u.string(),contractUri:u.string()}),On=Ye.extend({records:Os.array()}),An=u.object({sharing:u.boolean().optional(),shared:u.string().array().optional(),shareAll:u.boolean().optional(),shareUntil:u.string().optional()}),kn=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({shareAll:u.boolean().optional(),sharing:u.boolean().optional(),categories:u.record(An).default({})}).default({}),personal:u.record(u.string()).default({})}).default({}),write:u.object({credentials:u.object({categories:u.record(u.boolean()).default({})}).default({}),personal:u.record(u.boolean()).default({})}).default({}),deniedWriters:u.array(u.string()).optional()}),Oe=Ye.extend({records:u.object({expiresAt:u.string().optional(),oneTime:u.boolean().optional(),terms:kn,contract:Ti,uri:u.string(),consenter:Jt,status:ze}).array()}),su=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),personal:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),write:u.object({credentials:u.object({categories:u.record(u.object({required:u.boolean().optional()})).optional()}).optional(),personal:u.record(u.object({required:u.boolean().optional()})).optional()}).optional()}),As=u.object({anonymize:u.boolean().optional(),credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional()}),va=u.object({credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional(),id:Te.optional()}),ks=u.object({read:u.object({anonymize:u.boolean().optional(),credentials:u.object({shareAll:u.boolean().optional(),sharing:u.boolean().optional(),categories:u.record(An.optional()).optional()}).optional(),personal:u.record(u.string()).optional()}).optional(),write:u.object({credentials:u.object({categories:u.record(u.boolean()).optional()}).optional(),personal:u.record(u.boolean()).optional()}).optional()}),_a=u.enum(["consent","update","sync","withdraw","write"]),cu=u.object({terms:ks.optional(),action:_a.or(_a.array()).optional(),date:u.object({$gt:u.string()}).or(u.object({$lt:u.string()})).or(u.object({$eq:u.string()})).optional(),expiresAt:u.object({$gt:u.string()}).or(u.object({$lt:u.string()})).or(u.object({$eq:u.string()})).optional(),oneTime:u.boolean().optional()}),Pn=u.object({expiresAt:u.string().optional(),oneTime:u.boolean().optional(),terms:kn.optional(),id:u.string(),action:_a,date:u.string(),uris:u.string().array().optional()}),kr=Ye.extend({records:Pn.array()}),Ci=u.object({credentialUri:u.string(),termsUri:u.string(),contractUri:u.string(),boostUri:u.string(),category:u.string().optional(),date:u.string()}),Ps=Ye.extend({records:Ci.array()}),Si=u.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),fo=u.object({title:u.string().optional(),body:u.string().optional()}),po=u.object({type:u.string(),value:u.string()}),Pr=u.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),ho=u.object({issuanceId:u.string(),status:Pr,recipient:u.object({contactMethod:po.optional(),learnCardId:u.string().optional()}),timestamp:u.string().datetime().optional()}),In=u.object({vcUris:u.array(u.string()).optional(),vpUris:u.array(u.string()).optional(),transaction:Pn.optional(),inbox:ho.optional()}),Qr=u.object({type:Si,to:Jt.partial().and(u.object({did:u.string()})),from:Jt.partial().and(u.object({did:u.string()})),message:fo.optional(),data:In.optional(),sent:u.string().datetime().optional(),webhookUrl:u.string().optional()}),Ri="auth-grant:",uu=u.object({id:u.string(),name:u.string(),description:u.string().optional(),challenge:u.string().startsWith(Ri).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:u.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:u.string(),createdAt:u.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:u.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),lu=u.object({id:u.string()}).catchall(u.any()),Is=u.enum(["active","revoked"]),ba=u.object({id:Te,name:Te,description:Te,status:Is}).partial(),Oi=u.object({id:u.string(),isVerified:u.boolean(),verifiedAt:u.string().optional(),isPrimary:u.boolean(),createdAt:u.string()}),mo=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}).merge(Oi),u.object({type:u.literal("phone"),value:u.string()}).merge(Oi)]),Ns=u.object({isVerified:u.boolean().optional(),isPrimary:u.boolean().optional()}),js=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}).merge(Ns),u.object({type:u.literal("phone"),value:u.string()}).merge(Ns)]),go=u.discriminatedUnion("type",[u.object({type:u.literal("email"),value:u.string().email()}),u.object({type:u.literal("phone"),value:u.string()})]),du=u.object({value:u.string(),type:u.enum(["email","phone"])}),We=u.object({token:u.string()}),et=u.object({contactMethodId:u.string()}),Vs=u.object({id:u.string(),credential:u.string(),isSigned:u.boolean(),currentStatus:Pr,expiresAt:u.string(),createdAt:u.string(),issuerDid:u.string(),webhookUrl:u.string().optional(),signingAuthority:u.object({endpoint:u.string().optional(),name:u.string().optional()}).optional()}),fu=u.object({hasMore:u.boolean(),records:u.array(Vs),cursor:u.string().optional()}),Ds=u.object({currentStatus:Pr,id:u.string(),isSigned:u.boolean(),issuerDid:u.string()}).partial(),Ls=u.object({endpoint:u.string().url(),name:u.string()}),yo=u.object({recipient:go.describe("The recipient of the credential"),credential:Gt.passthrough().or(la.passthrough()).or(Be.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:u.object({signingAuthority:Ls.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:u.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:u.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:u.object({suppress:u.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:u.object({id:u.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:u.object({issuer:u.object({name:u.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:u.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:u.object({name:u.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:u.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:u.object({name:u.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Ai=u.object({issuanceId:u.string(),status:Pr,recipient:go,claimUrl:u.string().url().optional(),recipientDid:u.string().optional()}),vo=u.object({token:u.string(),contactMethodId:u.string(),autoVerifyContactMethod:u.boolean().optional().default(!1),createdAt:u.string(),expiresAt:u.string(),used:u.boolean()})}}),$b=ip({"../learn-card-types/dist/index.js"(n,r){"use strict";r.exports=zb()}}),Wb=Fb($b());var Zi=K(n=>Wb.JWEValidator.safeParse(n).success,"isEncrypted");var Ce;(function(n){n.assertEqual=p=>p;function r(p){}o(r,"assertIs"),n.assertIs=r;function s(p){throw new Error}o(s,"assertNever"),n.assertNever=s,n.arrayToEnum=p=>{let g={};for(let y of p)g[y]=y;return g},n.getValidEnumValues=p=>{let g=n.objectKeys(p).filter(E=>typeof p[p[E]]!="number"),y={};for(let E of g)y[E]=p[E];return n.objectValues(y)},n.objectValues=p=>n.objectKeys(p).map(function(g){return p[g]}),n.objectKeys=typeof Object.keys=="function"?p=>Object.keys(p):p=>{let g=[];for(let y in p)Object.prototype.hasOwnProperty.call(p,y)&&g.push(y);return g},n.find=(p,g)=>{for(let y of p)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?p=>Number.isInteger(p):p=>typeof p=="number"&&isFinite(p)&&Math.floor(p)===p;function d(p,g=" | "){return p.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}o(d,"joinValues"),n.joinValues=d,n.jsonStringifyReplacer=(p,g)=>typeof g=="bigint"?g.toString():g})(Ce||(Ce={}));var kl;(function(n){n.mergeShapes=(r,s)=>({...r,...s})})(kl||(kl={}));var J=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=o(n=>{switch(typeof n){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(n)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(n)?J.array:n===null?J.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?J.promise:typeof Map<"u"&&n instanceof Map?J.map:typeof Set<"u"&&n instanceof Set?J.set:typeof Date<"u"&&n instanceof Date?J.date:J.object;default:return J.unknown}},"getParsedType"),z=Ce.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"]),Hb=o(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ct=class extends Error{constructor(r){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let s=r||function(g){return g.message},d={_errors:[]},p=o(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(p);else if(y.code==="invalid_return_type")p(y.returnTypeError);else if(y.code==="invalid_arguments")p(y.argumentsError);else if(y.path.length===0)d._errors.push(s(y));else{let E=d,S=0;for(;S<y.path.length;){let N=y.path[S];S===y.path.length-1?(E[N]=E[N]||{_errors:[]},E[N]._errors.push(s(y))):E[N]=E[N]||{_errors:[]},E=E[N],S++}}},"processError");return p(this),d}static assert(r){if(!(r instanceof ct))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=s=>s.message){let s={},d=[];for(let p of this.issues)p.path.length>0?(s[p.path[0]]=s[p.path[0]]||[],s[p.path[0]].push(r(p))):d.push(r(p));return{formErrors:d,fieldErrors:s}}get formErrors(){return this.flatten()}};o(ct,"ZodError");ct.create=n=>new ct(n);var La=o((n,r)=>{let s;switch(n.code){case z.invalid_type:n.received===J.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case z.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,Ce.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:s=`Unrecognized key(s) in object: ${Ce.joinValues(n.keys,", ")}`;break;case z.invalid_union:s="Invalid input";break;case z.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Ce.joinValues(n.options)}`;break;case z.invalid_enum_value:s=`Invalid enum value. Expected ${Ce.joinValues(n.options)}, received '${n.received}'`;break;case z.invalid_arguments:s="Invalid function arguments";break;case z.invalid_return_type:s="Invalid function return type";break;case z.invalid_date:s="Invalid date";break;case z.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:Ce.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case z.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case z.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case z.custom:s="Invalid input";break;case z.invalid_intersection_types:s="Intersection results could not be merged";break;case z.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case z.not_finite:s="Number must be finite";break;default:s=r.defaultError,Ce.assertNever(n)}return{message:s}},"errorMap"),sp=La;function Gb(n){sp=n}o(Gb,"setErrorMap");function Cc(){return sp}o(Cc,"getErrorMap");var Sc=o(n=>{let{data:r,path:s,errorMaps:d,issueData:p}=n,g=[...s,...p.path||[]],y={...p,path:g};if(p.message!==void 0)return{...p,path:g,message:p.message};let E="",S=d.filter(N=>!!N).slice().reverse();for(let N of S)E=N(y,{data:r,defaultError:E}).message;return{...p,path:g,message:E}},"makeIssue"),Jb=[];function H(n,r){let s=Cc(),d=Sc({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===La?void 0:La].filter(p=>!!p)});n.common.issues.push(d)}o(H,"addIssueToContext");var Qe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,s){let d=[];for(let p of s){if(p.status==="aborted")return de;p.status==="dirty"&&r.dirty(),d.push(p.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,s){let d=[];for(let p of s){let g=await p.key,y=await p.value;d.push({key:g,value:y})}return Qe.mergeObjectSync(r,d)}static mergeObjectSync(r,s){let d={};for(let p of s){let{key:g,value:y}=p;if(g.status==="aborted"||y.status==="aborted")return de;g.status==="dirty"&&r.dirty(),y.status==="dirty"&&r.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||p.alwaysSet)&&(d[g.value]=y.value)}return{status:r.value,value:d}}};o(Qe,"ParseStatus");var de=Object.freeze({status:"aborted"}),Va=o(n=>({status:"dirty",value:n}),"DIRTY"),gt=o(n=>({status:"valid",value:n}),"OK"),Pl=o(n=>n.status==="aborted","isAborted"),Il=o(n=>n.status==="dirty","isDirty"),Lo=o(n=>n.status==="valid","isValid"),Mo=o(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function Rc(n,r,s,d){if(s==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?n!==r||!d:!r.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?d:s==="a"?d.call(n):d?d.value:r.get(n)}o(Rc,"__classPrivateFieldGet");function cp(n,r,s,d,p){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?n!==r||!p:!r.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?p.call(n,s):p?p.value=s:r.set(n,s),s}o(cp,"__classPrivateFieldSet");var te;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(te||(te={}));var Vo,Do,Zt=class{constructor(r,s,d,p){this._cachedPath=[],this.parent=r,this.data=s,this._path=d,this._key=p}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}};o(Zt,"ParseInputLazyPath");var ap=o((n,r)=>{if(Lo(r))return{success:!0,data:r.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new ct(n.common.issues);return this._error=s,this._error}}},"handleResult");function ge(n){if(!n)return{};let{errorMap:r,invalid_type_error:s,required_error:d,description:p}=n;if(r&&(s||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:p}:{errorMap:o((y,E)=>{var S,N;let{message:F}=n;return y.code==="invalid_enum_value"?{message:F??E.defaultError}:typeof E.data>"u"?{message:(S=F??d)!==null&&S!==void 0?S:E.defaultError}:y.code!=="invalid_type"?{message:E.defaultError}:{message:(N=F??s)!==null&&N!==void 0?N:E.defaultError}},"customMap"),description:p}}o(ge,"processCreateParams");var me=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,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._def.description}_getType(r){return zn(r.data)}_getOrReturnCtx(r,s){return s||{common:r.parent.common,data:r.data,parsedType:zn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Qe,ctx:{common:r.parent.common,data:r.data,parsedType:zn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let s=this._parse(r);if(Mo(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(r){let s=this._parse(r);return Promise.resolve(s)}parse(r,s){let d=this.safeParse(r,s);if(d.success)return d.data;throw d.error}safeParse(r,s){var d;let p={common:{issues:[],async:(d=s?.async)!==null&&d!==void 0?d:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:zn(r)},g=this._parseSync({data:r,path:p.path,parent:p});return ap(p,g)}async parseAsync(r,s){let d=await this.safeParseAsync(r,s);if(d.success)return d.data;throw d.error}async safeParseAsync(r,s){let d={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:zn(r)},p=this._parse({data:r,path:d.path,parent:d}),g=await(Mo(p)?p:Promise.resolve(p));return ap(d,g)}refine(r,s){let d=o(p=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(p):s,"getIssueProperties");return this._refinement((p,g)=>{let y=r(p),E=o(()=>g.addIssue({code:z.custom,...d(p)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(S=>S?!0:(E(),!1)):y?!0:(E(),!1)})}refinement(r,s){return this._refinement((d,p)=>r(d)?!0:(p.addIssue(typeof s=="function"?s(d,p):s),!1))}_refinement(r){return new Rt({schema:this,typeName:ue.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return Ft.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return St.create(this,this._def)}promise(){return pn.create(this,this._def)}or(r){return Gn.create([this,r],this._def)}and(r){return Jn.create(this,r,this._def)}transform(r){return new Rt({...ge(this._def),schema:this,typeName:ue.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let s=typeof r=="function"?r:()=>r;return new ei({...ge(this._def),innerType:this,defaultValue:s,typeName:ue.ZodDefault})}brand(){return new Da({typeName:ue.ZodBranded,type:this,...ge(this._def)})}catch(r){let s=typeof r=="function"?r:()=>r;return new ti({...ge(this._def),innerType:this,catchValue:s,typeName:ue.ZodCatch})}describe(r){let s=this.constructor;return new s({...this._def,description:r})}pipe(r){return ri.create(this,r)}readonly(){return ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(me,"ZodType");var Yb=/^c[^\s-]{8,}$/i,Kb=/^[0-9a-z]+$/,Qb=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xb=/^[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,ew=/^[a-z0-9_-]{21}$/i,tw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Al,iw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aw=/^(([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})))$/,ow=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,up="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sw=new RegExp(`^${up}$`);function lp(n){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?r=`${r}\\.\\d{${n.precision}}`:n.precision==null&&(r=`${r}(\\.\\d+)?`),r}o(lp,"timeRegexSource");function cw(n){return new RegExp(`^${lp(n)}$`)}o(cw,"timeRegex");function dp(n){let r=`${up}T${lp(n)}`,s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${s.join("|")})`,new RegExp(`^${r}$`)}o(dp,"datetimeRegex");function uw(n,r){return!!((r==="v4"||!r)&&iw.test(n)||(r==="v6"||!r)&&aw.test(n))}o(uw,"isValidIP");var Ct=class extends me{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==J.string){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.string,received:g.parsedType}),de}let d=new Qe,p;for(let g of this._def.checks)if(g.kind==="min")r.data.length<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="max")r.data.length>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="length"){let y=r.data.length>g.value,E=r.data.length<g.value;(y||E)&&(p=this._getOrReturnCtx(r,p),y?H(p,{code:z.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):E&&H(p,{code:z.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),d.dirty())}else if(g.kind==="email")rw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"email",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="emoji")Al||(Al=new RegExp(nw,"u")),Al.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"emoji",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="uuid")Xb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"uuid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="nanoid")ew.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"nanoid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid")Yb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid2")Kb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid2",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="ulid")Qb.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ulid",code:z.invalid_string,message:g.message}),d.dirty());else if(g.kind==="url")try{new URL(r.data)}catch{p=this._getOrReturnCtx(r,p),H(p,{validation:"url",code:z.invalid_string,message:g.message}),d.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"regex",code:z.invalid_string,message:g.message}),d.dirty())):g.kind==="trim"?r.data=r.data.trim():g.kind==="includes"?r.data.includes(g.value,g.position)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),d.dirty()):g.kind==="toLowerCase"?r.data=r.data.toLowerCase():g.kind==="toUpperCase"?r.data=r.data.toUpperCase():g.kind==="startsWith"?r.data.startsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{startsWith:g.value},message:g.message}),d.dirty()):g.kind==="endsWith"?r.data.endsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:{endsWith:g.value},message:g.message}),d.dirty()):g.kind==="datetime"?dp(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"datetime",message:g.message}),d.dirty()):g.kind==="date"?sw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"date",message:g.message}),d.dirty()):g.kind==="time"?cw(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:z.invalid_string,validation:"time",message:g.message}),d.dirty()):g.kind==="duration"?tw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"duration",code:z.invalid_string,message:g.message}),d.dirty()):g.kind==="ip"?uw(r.data,g.version)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ip",code:z.invalid_string,message:g.message}),d.dirty()):g.kind==="base64"?ow.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"base64",code:z.invalid_string,message:g.message}),d.dirty()):Ce.assertNever(g);return{status:d.value,value:r.data}}_regex(r,s,d){return this.refinement(p=>r.test(p),{validation:s,code:z.invalid_string,...te.errToObj(d)})}_addCheck(r){return new Ct({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var s,d;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(s=r?.offset)!==null&&s!==void 0?s:!1,local:(d=r?.local)!==null&&d!==void 0?d:!1,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,s){return this._addCheck({kind:"regex",regex:r,...te.errToObj(s)})}includes(r,s){return this._addCheck({kind:"includes",value:r,position:s?.position,...te.errToObj(s?.message)})}startsWith(r,s){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(s)})}endsWith(r,s){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(s)})}min(r,s){return this._addCheck({kind:"min",value:r,...te.errToObj(s)})}max(r,s){return this._addCheck({kind:"max",value:r,...te.errToObj(s)})}length(r,s){return this._addCheck({kind:"length",value:r,...te.errToObj(s)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ct({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxLength(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}};o(Ct,"ZodString");Ct.create=n=>{var r;return new Ct({checks:[],typeName:ue.ZodString,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ge(n)})};function lw(n,r){let s=(n.toString().split(".")[1]||"").length,d=(r.toString().split(".")[1]||"").length,p=s>d?s:d,g=parseInt(n.toFixed(p).replace(".","")),y=parseInt(r.toFixed(p).replace(".",""));return g%y/Math.pow(10,p)}o(lw,"floatSafeRemainder");var mr=class extends me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==J.number){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.number,received:g.parsedType}),de}let d,p=new Qe;for(let g of this._def.checks)g.kind==="int"?Ce.isInteger(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:z.invalid_type,expected:"integer",received:"float",message:g.message}),p.dirty()):g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="multipleOf"?lw(r.data,g.value)!==0&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):g.kind==="finite"?Number.isFinite(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_finite,message:g.message}),p.dirty()):Ce.assertNever(g);return{status:p.value,value:r.data}}gte(r,s){return this.setLimit("min",r,!0,te.toString(s))}gt(r,s){return this.setLimit("min",r,!1,te.toString(s))}lte(r,s){return this.setLimit("max",r,!0,te.toString(s))}lt(r,s){return this.setLimit("max",r,!1,te.toString(s))}setLimit(r,s,d,p){return new mr({...this._def,checks:[...this._def.checks,{kind:r,value:s,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new mr({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,s){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(s)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxValue(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Ce.isInteger(r.value))}get isFinite(){let r=null,s=null;for(let d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(s===null||d.value>s)&&(s=d.value):d.kind==="max"&&(r===null||d.value<r)&&(r=d.value)}return Number.isFinite(s)&&Number.isFinite(r)}};o(mr,"ZodNumber");mr.create=n=>new mr({checks:[],typeName:ue.ZodNumber,coerce:n?.coerce||!1,...ge(n)});var gr=class extends me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==J.bigint){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.bigint,received:g.parsedType}),de}let d,p=new Qe;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="multipleOf"?r.data%g.value!==BigInt(0)&&(d=this._getOrReturnCtx(r,d),H(d,{code:z.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):Ce.assertNever(g);return{status:p.value,value:r.data}}gte(r,s){return this.setLimit("min",r,!0,te.toString(s))}gt(r,s){return this.setLimit("min",r,!1,te.toString(s))}lte(r,s){return this.setLimit("max",r,!0,te.toString(s))}lt(r,s){return this.setLimit("max",r,!1,te.toString(s))}setLimit(r,s,d,p){return new gr({...this._def,checks:[...this._def.checks,{kind:r,value:s,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new gr({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,s){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(s)})}get minValue(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r}get maxValue(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r}};o(gr,"ZodBigInt");gr.create=n=>{var r;return new gr({checks:[],typeName:ue.ZodBigInt,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ge(n)})};var $n=class extends me{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==J.boolean){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.boolean,received:d.parsedType}),de}return gt(r.data)}};o($n,"ZodBoolean");$n.create=n=>new $n({typeName:ue.ZodBoolean,coerce:n?.coerce||!1,...ge(n)});var Vr=class extends me{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==J.date){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_type,expected:J.date,received:g.parsedType}),de}if(isNaN(r.data.getTime())){let g=this._getOrReturnCtx(r);return H(g,{code:z.invalid_date}),de}let d=new Qe,p;for(let g of this._def.checks)g.kind==="min"?r.data.getTime()<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),d.dirty()):g.kind==="max"?r.data.getTime()>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:z.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),d.dirty()):Ce.assertNever(g);return{status:d.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Vr({...this._def,checks:[...this._def.checks,r]})}min(r,s){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(s)})}max(r,s){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(s)})}get minDate(){let r=null;for(let s of this._def.checks)s.kind==="min"&&(r===null||s.value>r)&&(r=s.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let s of this._def.checks)s.kind==="max"&&(r===null||s.value<r)&&(r=s.value);return r!=null?new Date(r):null}};o(Vr,"ZodDate");Vr.create=n=>new Vr({checks:[],coerce:n?.coerce||!1,typeName:ue.ZodDate,...ge(n)});var qi=class extends me{_parse(r){if(this._getType(r)!==J.symbol){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.symbol,received:d.parsedType}),de}return gt(r.data)}};o(qi,"ZodSymbol");qi.create=n=>new qi({typeName:ue.ZodSymbol,...ge(n)});var Wn=class extends me{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.undefined,received:d.parsedType}),de}return gt(r.data)}};o(Wn,"ZodUndefined");Wn.create=n=>new Wn({typeName:ue.ZodUndefined,...ge(n)});var Hn=class extends me{_parse(r){if(this._getType(r)!==J.null){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.null,received:d.parsedType}),de}return gt(r.data)}};o(Hn,"ZodNull");Hn.create=n=>new Hn({typeName:ue.ZodNull,...ge(n)});var dn=class extends me{constructor(){super(...arguments),this._any=!0}_parse(r){return gt(r.data)}};o(dn,"ZodAny");dn.create=n=>new dn({typeName:ue.ZodAny,...ge(n)});var Dr=class extends me{constructor(){super(...arguments),this._unknown=!0}_parse(r){return gt(r.data)}};o(Dr,"ZodUnknown");Dr.create=n=>new Dr({typeName:ue.ZodUnknown,...ge(n)});var rr=class extends me{_parse(r){let s=this._getOrReturnCtx(r);return H(s,{code:z.invalid_type,expected:J.never,received:s.parsedType}),de}};o(rr,"ZodNever");rr.create=n=>new rr({typeName:ue.ZodNever,...ge(n)});var Fi=class extends me{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.void,received:d.parsedType}),de}return gt(r.data)}};o(Fi,"ZodVoid");Fi.create=n=>new Fi({typeName:ue.ZodVoid,...ge(n)});var St=class extends me{_parse(r){let{ctx:s,status:d}=this._processInputParams(r),p=this._def;if(s.parsedType!==J.array)return H(s,{code:z.invalid_type,expected:J.array,received:s.parsedType}),de;if(p.exactLength!==null){let y=s.data.length>p.exactLength.value,E=s.data.length<p.exactLength.value;(y||E)&&(H(s,{code:y?z.too_big:z.too_small,minimum:E?p.exactLength.value:void 0,maximum:y?p.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:p.exactLength.message}),d.dirty())}if(p.minLength!==null&&s.data.length<p.minLength.value&&(H(s,{code:z.too_small,minimum:p.minLength.value,type:"array",inclusive:!0,exact:!1,message:p.minLength.message}),d.dirty()),p.maxLength!==null&&s.data.length>p.maxLength.value&&(H(s,{code:z.too_big,maximum:p.maxLength.value,type:"array",inclusive:!0,exact:!1,message:p.maxLength.message}),d.dirty()),s.common.async)return Promise.all([...s.data].map((y,E)=>p.type._parseAsync(new Zt(s,y,s.path,E)))).then(y=>Qe.mergeArray(d,y));let g=[...s.data].map((y,E)=>p.type._parseSync(new Zt(s,y,s.path,E)));return Qe.mergeArray(d,g)}get element(){return this._def.type}min(r,s){return new St({...this._def,minLength:{value:r,message:te.toString(s)}})}max(r,s){return new St({...this._def,maxLength:{value:r,message:te.toString(s)}})}length(r,s){return new St({...this._def,exactLength:{value:r,message:te.toString(s)}})}nonempty(r){return this.min(1,r)}};o(St,"ZodArray");St.create=(n,r)=>new St({type:n,minLength:null,maxLength:null,exactLength:null,typeName:ue.ZodArray,...ge(r)});function ja(n){if(n instanceof Me){let r={};for(let s in n.shape){let d=n.shape[s];r[s]=Ft.create(ja(d))}return new Me({...n._def,shape:()=>r})}else return n instanceof St?new St({...n._def,type:ja(n.element)}):n instanceof Ft?Ft.create(ja(n.unwrap())):n instanceof vr?vr.create(ja(n.unwrap())):n instanceof qt?qt.create(n.items.map(r=>ja(r))):n}o(ja,"deepPartialify");var Me=class extends me{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),s=Ce.objectKeys(r);return this._cached={shape:r,keys:s}}_parse(r){if(this._getType(r)!==J.object){let N=this._getOrReturnCtx(r);return H(N,{code:z.invalid_type,expected:J.object,received:N.parsedType}),de}let{status:d,ctx:p}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),E=[];if(!(this._def.catchall instanceof rr&&this._def.unknownKeys==="strip"))for(let N in p.data)y.includes(N)||E.push(N);let S=[];for(let N of y){let F=g[N],V=p.data[N];S.push({key:{status:"valid",value:N},value:F._parse(new Zt(p,V,p.path,N)),alwaysSet:N in p.data})}if(this._def.catchall instanceof rr){let N=this._def.unknownKeys;if(N==="passthrough")for(let F of E)S.push({key:{status:"valid",value:F},value:{status:"valid",value:p.data[F]}});else if(N==="strict")E.length>0&&(H(p,{code:z.unrecognized_keys,keys:E}),d.dirty());else if(N!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let N=this._def.catchall;for(let F of E){let V=p.data[F];S.push({key:{status:"valid",value:F},value:N._parse(new Zt(p,V,p.path,F)),alwaysSet:F in p.data})}}return p.common.async?Promise.resolve().then(async()=>{let N=[];for(let F of S){let V=await F.key,k=await F.value;N.push({key:V,value:k,alwaysSet:F.alwaysSet})}return N}).then(N=>Qe.mergeObjectSync(d,N)):Qe.mergeObjectSync(d,S)}get shape(){return this._def.shape()}strict(r){return te.errToObj,new Me({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(s,d)=>{var p,g,y,E;let S=(y=(g=(p=this._def).errorMap)===null||g===void 0?void 0:g.call(p,s,d).message)!==null&&y!==void 0?y:d.defaultError;return s.code==="unrecognized_keys"?{message:(E=te.errToObj(r).message)!==null&&E!==void 0?E:S}:{message:S}}}:{}})}strip(){return new Me({...this._def,unknownKeys:"strip"})}passthrough(){return new Me({...this._def,unknownKeys:"passthrough"})}extend(r){return new Me({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new Me({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ue.ZodObject})}setKey(r,s){return this.augment({[r]:s})}catchall(r){return new Me({...this._def,catchall:r})}pick(r){let s={};return Ce.objectKeys(r).forEach(d=>{r[d]&&this.shape[d]&&(s[d]=this.shape[d])}),new Me({...this._def,shape:()=>s})}omit(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{r[d]||(s[d]=this.shape[d])}),new Me({...this._def,shape:()=>s})}deepPartial(){return ja(this)}partial(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{let p=this.shape[d];r&&!r[d]?s[d]=p:s[d]=p.optional()}),new Me({...this._def,shape:()=>s})}required(r){let s={};return Ce.objectKeys(this.shape).forEach(d=>{if(r&&!r[d])s[d]=this.shape[d];else{let g=this.shape[d];for(;g instanceof Ft;)g=g._def.innerType;s[d]=g}}),new Me({...this._def,shape:()=>s})}keyof(){return fp(Ce.objectKeys(this.shape))}};o(Me,"ZodObject");Me.create=(n,r)=>new Me({shape:()=>n,unknownKeys:"strip",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});Me.strictCreate=(n,r)=>new Me({shape:()=>n,unknownKeys:"strict",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});Me.lazycreate=(n,r)=>new Me({shape:n,unknownKeys:"strip",catchall:rr.create(),typeName:ue.ZodObject,...ge(r)});var Gn=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=this._def.options;function p(g){for(let E of g)if(E.result.status==="valid")return E.result;for(let E of g)if(E.result.status==="dirty")return s.common.issues.push(...E.ctx.common.issues),E.result;let y=g.map(E=>new ct(E.ctx.common.issues));return H(s,{code:z.invalid_union,unionErrors:y}),de}if(o(p,"handleResults"),s.common.async)return Promise.all(d.map(async g=>{let y={...s,common:{...s.common,issues:[]},parent:null};return{result:await g._parseAsync({data:s.data,path:s.path,parent:y}),ctx:y}})).then(p);{let g,y=[];for(let S of d){let N={...s,common:{...s.common,issues:[]},parent:null},F=S._parseSync({data:s.data,path:s.path,parent:N});if(F.status==="valid")return F;F.status==="dirty"&&!g&&(g={result:F,ctx:N}),N.common.issues.length&&y.push(N.common.issues)}if(g)return s.common.issues.push(...g.ctx.common.issues),g.result;let E=y.map(S=>new ct(S));return H(s,{code:z.invalid_union,unionErrors:E}),de}}get options(){return this._def.options}};o(Gn,"ZodUnion");Gn.create=(n,r)=>new Gn({options:n,typeName:ue.ZodUnion,...ge(r)});var ln=o(n=>n instanceof Kn?ln(n.schema):n instanceof Rt?ln(n.innerType()):n instanceof Qn?[n.value]:n instanceof yr?n.options:n instanceof Xn?Ce.objectValues(n.enum):n instanceof ei?ln(n._def.innerType):n instanceof Wn?[void 0]:n instanceof Hn?[null]:n instanceof Ft?[void 0,...ln(n.unwrap())]:n instanceof vr?[null,...ln(n.unwrap())]:n instanceof Da||n instanceof ni?ln(n.unwrap()):n instanceof ti?ln(n._def.innerType):[],"getDiscriminator"),zi=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.object)return H(s,{code:z.invalid_type,expected:J.object,received:s.parsedType}),de;let d=this.discriminator,p=s.data[d],g=this.optionsMap.get(p);return g?s.common.async?g._parseAsync({data:s.data,path:s.path,parent:s}):g._parseSync({data:s.data,path:s.path,parent:s}):(H(s,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),de)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,s,d){let p=new Map;for(let g of s){let y=ln(g.shape[r]);if(!y.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let E of y){if(p.has(E))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(E)}`);p.set(E,g)}}return new zi({typeName:ue.ZodDiscriminatedUnion,discriminator:r,options:s,optionsMap:p,...ge(d)})}};o(zi,"ZodDiscriminatedUnion");function Nl(n,r){let s=zn(n),d=zn(r);if(n===r)return{valid:!0,data:n};if(s===J.object&&d===J.object){let p=Ce.objectKeys(r),g=Ce.objectKeys(n).filter(E=>p.indexOf(E)!==-1),y={...n,...r};for(let E of g){let S=Nl(n[E],r[E]);if(!S.valid)return{valid:!1};y[E]=S.data}return{valid:!0,data:y}}else if(s===J.array&&d===J.array){if(n.length!==r.length)return{valid:!1};let p=[];for(let g=0;g<n.length;g++){let y=n[g],E=r[g],S=Nl(y,E);if(!S.valid)return{valid:!1};p.push(S.data)}return{valid:!0,data:p}}else return s===J.date&&d===J.date&&+n==+r?{valid:!0,data:n}:{valid:!1}}o(Nl,"mergeValues");var Jn=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r),p=o((g,y)=>{if(Pl(g)||Pl(y))return de;let E=Nl(g.value,y.value);return E.valid?((Il(g)||Il(y))&&s.dirty(),{status:s.value,value:E.data}):(H(d,{code:z.invalid_intersection_types}),de)},"handleParsed");return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([g,y])=>p(g,y)):p(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}};o(Jn,"ZodIntersection");Jn.create=(n,r,s)=>new Jn({left:n,right:r,typeName:ue.ZodIntersection,...ge(s)});var qt=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.array)return H(d,{code:z.invalid_type,expected:J.array,received:d.parsedType}),de;if(d.data.length<this._def.items.length)return H(d,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&d.data.length>this._def.items.length&&(H(d,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let g=[...d.data].map((y,E)=>{let S=this._def.items[E]||this._def.rest;return S?S._parse(new Zt(d,y,d.path,E)):null}).filter(y=>!!y);return d.common.async?Promise.all(g).then(y=>Qe.mergeArray(s,y)):Qe.mergeArray(s,g)}get items(){return this._def.items}rest(r){return new qt({...this._def,rest:r})}};o(qt,"ZodTuple");qt.create=(n,r)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qt({items:n,typeName:ue.ZodTuple,rest:null,...ge(r)})};var Yn=class extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.object)return H(d,{code:z.invalid_type,expected:J.object,received:d.parsedType}),de;let p=[],g=this._def.keyType,y=this._def.valueType;for(let E in d.data)p.push({key:g._parse(new Zt(d,E,d.path,E)),value:y._parse(new Zt(d,d.data[E],d.path,E)),alwaysSet:E in d.data});return d.common.async?Qe.mergeObjectAsync(s,p):Qe.mergeObjectSync(s,p)}get element(){return this._def.valueType}static create(r,s,d){return s instanceof me?new Yn({keyType:r,valueType:s,typeName:ue.ZodRecord,...ge(d)}):new Yn({keyType:Ct.create(),valueType:r,typeName:ue.ZodRecord,...ge(s)})}};o(Yn,"ZodRecord");var $i=class extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.map)return H(d,{code:z.invalid_type,expected:J.map,received:d.parsedType}),de;let p=this._def.keyType,g=this._def.valueType,y=[...d.data.entries()].map(([E,S],N)=>({key:p._parse(new Zt(d,E,d.path,[N,"key"])),value:g._parse(new Zt(d,S,d.path,[N,"value"]))}));if(d.common.async){let E=new Map;return Promise.resolve().then(async()=>{for(let S of y){let N=await S.key,F=await S.value;if(N.status==="aborted"||F.status==="aborted")return de;(N.status==="dirty"||F.status==="dirty")&&s.dirty(),E.set(N.value,F.value)}return{status:s.value,value:E}})}else{let E=new Map;for(let S of y){let N=S.key,F=S.value;if(N.status==="aborted"||F.status==="aborted")return de;(N.status==="dirty"||F.status==="dirty")&&s.dirty(),E.set(N.value,F.value)}return{status:s.value,value:E}}}};o($i,"ZodMap");$i.create=(n,r,s)=>new $i({valueType:r,keyType:n,typeName:ue.ZodMap,...ge(s)});var Lr=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.set)return H(d,{code:z.invalid_type,expected:J.set,received:d.parsedType}),de;let p=this._def;p.minSize!==null&&d.data.size<p.minSize.value&&(H(d,{code:z.too_small,minimum:p.minSize.value,type:"set",inclusive:!0,exact:!1,message:p.minSize.message}),s.dirty()),p.maxSize!==null&&d.data.size>p.maxSize.value&&(H(d,{code:z.too_big,maximum:p.maxSize.value,type:"set",inclusive:!0,exact:!1,message:p.maxSize.message}),s.dirty());let g=this._def.valueType;function y(S){let N=new Set;for(let F of S){if(F.status==="aborted")return de;F.status==="dirty"&&s.dirty(),N.add(F.value)}return{status:s.value,value:N}}o(y,"finalizeSet");let E=[...d.data.values()].map((S,N)=>g._parse(new Zt(d,S,d.path,N)));return d.common.async?Promise.all(E).then(S=>y(S)):y(E)}min(r,s){return new Lr({...this._def,minSize:{value:r,message:te.toString(s)}})}max(r,s){return new Lr({...this._def,maxSize:{value:r,message:te.toString(s)}})}size(r,s){return this.min(r,s).max(r,s)}nonempty(r){return this.min(1,r)}};o(Lr,"ZodSet");Lr.create=(n,r)=>new Lr({valueType:n,minSize:null,maxSize:null,typeName:ue.ZodSet,...ge(r)});var fn=class extends me{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.function)return H(s,{code:z.invalid_type,expected:J.function,received:s.parsedType}),de;function d(E,S){return Sc({data:E,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Cc(),La].filter(N=>!!N),issueData:{code:z.invalid_arguments,argumentsError:S}})}o(d,"makeArgsIssue");function p(E,S){return Sc({data:E,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Cc(),La].filter(N=>!!N),issueData:{code:z.invalid_return_type,returnTypeError:S}})}o(p,"makeReturnsIssue");let g={errorMap:s.common.contextualErrorMap},y=s.data;if(this._def.returns instanceof pn){let E=this;return gt(async function(...S){let N=new ct([]),F=await E._def.args.parseAsync(S,g).catch(R=>{throw N.addIssue(d(S,R)),N}),V=await Reflect.apply(y,this,F);return await E._def.returns._def.type.parseAsync(V,g).catch(R=>{throw N.addIssue(p(V,R)),N})})}else{let E=this;return gt(function(...S){let N=E._def.args.safeParse(S,g);if(!N.success)throw new ct([d(S,N.error)]);let F=Reflect.apply(y,this,N.data),V=E._def.returns.safeParse(F,g);if(!V.success)throw new ct([p(F,V.error)]);return V.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new fn({...this._def,args:qt.create(r).rest(Dr.create())})}returns(r){return new fn({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,s,d){return new fn({args:r||qt.create([]).rest(Dr.create()),returns:s||Dr.create(),typeName:ue.ZodFunction,...ge(d)})}};o(fn,"ZodFunction");var Kn=class extends me{get schema(){return this._def.getter()}_parse(r){let{ctx:s}=this._processInputParams(r);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};o(Kn,"ZodLazy");Kn.create=(n,r)=>new Kn({getter:n,typeName:ue.ZodLazy,...ge(r)});var Qn=class extends me{_parse(r){if(r.data!==this._def.value){let s=this._getOrReturnCtx(r);return H(s,{received:s.data,code:z.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:r.data}}get value(){return this._def.value}};o(Qn,"ZodLiteral");Qn.create=(n,r)=>new Qn({value:n,typeName:ue.ZodLiteral,...ge(r)});function fp(n,r){return new yr({values:n,typeName:ue.ZodEnum,...ge(r)})}o(fp,"createZodEnum");var yr=class extends me{constructor(){super(...arguments),Vo.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let s=this._getOrReturnCtx(r),d=this._def.values;return H(s,{expected:Ce.joinValues(d),received:s.parsedType,code:z.invalid_type}),de}if(Rc(this,Vo,"f")||cp(this,Vo,new Set(this._def.values),"f"),!Rc(this,Vo,"f").has(r.data)){let s=this._getOrReturnCtx(r),d=this._def.values;return H(s,{received:s.data,code:z.invalid_enum_value,options:d}),de}return gt(r.data)}get options(){return this._def.values}get enum(){let r={};for(let s of this._def.values)r[s]=s;return r}get Values(){let r={};for(let s of this._def.values)r[s]=s;return r}get Enum(){let r={};for(let s of this._def.values)r[s]=s;return r}extract(r,s=this._def){return yr.create(r,{...this._def,...s})}exclude(r,s=this._def){return yr.create(this.options.filter(d=>!r.includes(d)),{...this._def,...s})}};o(yr,"ZodEnum");Vo=new WeakMap;yr.create=fp;var Xn=class extends me{constructor(){super(...arguments),Do.set(this,void 0)}_parse(r){let s=Ce.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==J.string&&d.parsedType!==J.number){let p=Ce.objectValues(s);return H(d,{expected:Ce.joinValues(p),received:d.parsedType,code:z.invalid_type}),de}if(Rc(this,Do,"f")||cp(this,Do,new Set(Ce.getValidEnumValues(this._def.values)),"f"),!Rc(this,Do,"f").has(r.data)){let p=Ce.objectValues(s);return H(d,{received:d.data,code:z.invalid_enum_value,options:p}),de}return gt(r.data)}get enum(){return this._def.values}};o(Xn,"ZodNativeEnum");Do=new WeakMap;Xn.create=(n,r)=>new Xn({values:n,typeName:ue.ZodNativeEnum,...ge(r)});var pn=class extends me{unwrap(){return this._def.type}_parse(r){let{ctx:s}=this._processInputParams(r);if(s.parsedType!==J.promise&&s.common.async===!1)return H(s,{code:z.invalid_type,expected:J.promise,received:s.parsedType}),de;let d=s.parsedType===J.promise?s.data:Promise.resolve(s.data);return gt(d.then(p=>this._def.type.parseAsync(p,{path:s.path,errorMap:s.common.contextualErrorMap})))}};o(pn,"ZodPromise");pn.create=(n,r)=>new pn({type:n,typeName:ue.ZodPromise,...ge(r)});var Rt=class extends me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:s,ctx:d}=this._processInputParams(r),p=this._def.effect||null,g={addIssue:y=>{H(d,y),y.fatal?s.abort():s.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),p.type==="preprocess"){let y=p.transform(d.data,g);if(d.common.async)return Promise.resolve(y).then(async E=>{if(s.value==="aborted")return de;let S=await this._def.schema._parseAsync({data:E,path:d.path,parent:d});return S.status==="aborted"?de:S.status==="dirty"||s.value==="dirty"?Va(S.value):S});{if(s.value==="aborted")return de;let E=this._def.schema._parseSync({data:y,path:d.path,parent:d});return E.status==="aborted"?de:E.status==="dirty"||s.value==="dirty"?Va(E.value):E}}if(p.type==="refinement"){let y=o(E=>{let S=p.refinement(E,g);if(d.common.async)return Promise.resolve(S);if(S instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return E},"executeRefinement");if(d.common.async===!1){let E=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return E.status==="aborted"?de:(E.status==="dirty"&&s.dirty(),y(E.value),{status:s.value,value:E.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(E=>E.status==="aborted"?de:(E.status==="dirty"&&s.dirty(),y(E.value).then(()=>({status:s.value,value:E.value}))))}if(p.type==="transform")if(d.common.async===!1){let y=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Lo(y))return y;let E=p.transform(y.value,g);if(E instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:E}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(y=>Lo(y)?Promise.resolve(p.transform(y.value,g)).then(E=>({status:s.value,value:E})):y);Ce.assertNever(p)}};o(Rt,"ZodEffects");Rt.create=(n,r,s)=>new Rt({schema:n,typeName:ue.ZodEffects,effect:r,...ge(s)});Rt.createWithPreprocess=(n,r,s)=>new Rt({schema:r,effect:{type:"preprocess",transform:n},typeName:ue.ZodEffects,...ge(s)});var Ft=class extends me{_parse(r){return this._getType(r)===J.undefined?gt(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};o(Ft,"ZodOptional");Ft.create=(n,r)=>new Ft({innerType:n,typeName:ue.ZodOptional,...ge(r)});var vr=class extends me{_parse(r){return this._getType(r)===J.null?gt(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};o(vr,"ZodNullable");vr.create=(n,r)=>new vr({innerType:n,typeName:ue.ZodNullable,...ge(r)});var ei=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=s.data;return s.parsedType===J.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};o(ei,"ZodDefault");ei.create=(n,r)=>new ei({innerType:n,typeName:ue.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...ge(r)});var ti=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d={...s,common:{...s.common,issues:[]}},p=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return Mo(p)?p.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new ct(d.common.issues)},input:d.data})})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new ct(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}};o(ti,"ZodCatch");ti.create=(n,r)=>new ti({innerType:n,typeName:ue.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...ge(r)});var Wi=class extends me{_parse(r){if(this._getType(r)!==J.nan){let d=this._getOrReturnCtx(r);return H(d,{code:z.invalid_type,expected:J.nan,received:d.parsedType}),de}return{status:"valid",value:r.data}}};o(Wi,"ZodNaN");Wi.create=n=>new Wi({typeName:ue.ZodNaN,...ge(n)});var dw=Symbol("zod_brand"),Da=class extends me{_parse(r){let{ctx:s}=this._processInputParams(r),d=s.data;return this._def.type._parse({data:d,path:s.path,parent:s})}unwrap(){return this._def.type}};o(Da,"ZodBranded");var ri=class extends me{_parse(r){let{status:s,ctx:d}=this._processInputParams(r);if(d.common.async)return o(async()=>{let g=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return g.status==="aborted"?de:g.status==="dirty"?(s.dirty(),Va(g.value)):this._def.out._parseAsync({data:g.value,path:d.path,parent:d})},"handleAsync")();{let p=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return p.status==="aborted"?de:p.status==="dirty"?(s.dirty(),{status:"dirty",value:p.value}):this._def.out._parseSync({data:p.value,path:d.path,parent:d})}}static create(r,s){return new ri({in:r,out:s,typeName:ue.ZodPipeline})}};o(ri,"ZodPipeline");var ni=class extends me{_parse(r){let s=this._def.innerType._parse(r),d=o(p=>(Lo(p)&&(p.value=Object.freeze(p.value)),p),"freeze");return Mo(s)?s.then(p=>d(p)):d(s)}unwrap(){return this._def.innerType}};o(ni,"ZodReadonly");ni.create=(n,r)=>new ni({innerType:n,typeName:ue.ZodReadonly,...ge(r)});function pp(n,r={},s){return n?dn.create().superRefine((d,p)=>{var g,y;if(!n(d)){let E=typeof r=="function"?r(d):typeof r=="string"?{message:r}:r,S=(y=(g=E.fatal)!==null&&g!==void 0?g:s)!==null&&y!==void 0?y:!0,N=typeof E=="string"?{message:E}:E;p.addIssue({code:"custom",...N,fatal:S})}}):dn.create()}o(pp,"custom");var fw={object:Me.lazycreate},ue;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(ue||(ue={}));var pw=o((n,r={message:`Input not instance of ${n.name}`})=>pp(s=>s instanceof n,r),"instanceOfType"),hp=Ct.create,mp=mr.create,hw=Wi.create,mw=gr.create,gp=$n.create,gw=Vr.create,yw=qi.create,vw=Wn.create,_w=Hn.create,bw=dn.create,ww=Dr.create,xw=rr.create,Ew=Fi.create,Tw=St.create,Cw=Me.create,Sw=Me.strictCreate,Rw=Gn.create,Ow=zi.create,Aw=Jn.create,kw=qt.create,Pw=Yn.create,Iw=$i.create,Nw=Lr.create,jw=fn.create,Vw=Kn.create,Dw=Qn.create,Lw=yr.create,Mw=Xn.create,Uw=pn.create,op=Rt.create,Bw=Ft.create,Zw=vr.create,qw=Rt.createWithPreprocess,Fw=ri.create,zw=o(()=>hp().optional(),"ostring"),$w=o(()=>mp().optional(),"onumber"),Ww=o(()=>gp().optional(),"oboolean"),Hw={string:n=>Ct.create({...n,coerce:!0}),number:n=>mr.create({...n,coerce:!0}),boolean:n=>$n.create({...n,coerce:!0}),bigint:n=>gr.create({...n,coerce:!0}),date:n=>Vr.create({...n,coerce:!0})},Gw=de,c=Object.freeze({__proto__:null,defaultErrorMap:La,setErrorMap:Gb,getErrorMap:Cc,makeIssue:Sc,EMPTY_PATH:Jb,addIssueToContext:H,ParseStatus:Qe,INVALID:de,DIRTY:Va,OK:gt,isAborted:Pl,isDirty:Il,isValid:Lo,isAsync:Mo,get util(){return Ce},get objectUtil(){return kl},ZodParsedType:J,getParsedType:zn,ZodType:me,datetimeRegex:dp,ZodString:Ct,ZodNumber:mr,ZodBigInt:gr,ZodBoolean:$n,ZodDate:Vr,ZodSymbol:qi,ZodUndefined:Wn,ZodNull:Hn,ZodAny:dn,ZodUnknown:Dr,ZodNever:rr,ZodVoid:Fi,ZodArray:St,ZodObject:Me,ZodUnion:Gn,ZodDiscriminatedUnion:zi,ZodIntersection:Jn,ZodTuple:qt,ZodRecord:Yn,ZodMap:$i,ZodSet:Lr,ZodFunction:fn,ZodLazy:Kn,ZodLiteral:Qn,ZodEnum:yr,ZodNativeEnum:Xn,ZodPromise:pn,ZodEffects:Rt,ZodTransformer:Rt,ZodOptional:Ft,ZodNullable:vr,ZodDefault:ei,ZodCatch:ti,ZodNaN:Wi,BRAND:dw,ZodBranded:Da,ZodPipeline:ri,ZodReadonly:ni,custom:pp,Schema:me,ZodSchema:me,late:fw,get ZodFirstPartyTypeKind(){return ue},coerce:Hw,any:bw,array:Tw,bigint:mw,boolean:gp,date:gw,discriminatedUnion:Ow,effect:op,enum:Lw,function:jw,instanceof:pw,intersection:Aw,lazy:Vw,literal:Dw,map:Iw,nan:hw,nativeEnum:Mw,never:xw,null:_w,nullable:Zw,number:mp,object:Cw,oboolean:Ww,onumber:$w,optional:Bw,ostring:zw,pipeline:Fw,preprocess:qw,promise:Uw,record:Pw,set:Nw,strictObject:Sw,string:hp,symbol:yw,transformer:op,tuple:kw,undefined:vw,union:Rw,unknown:ww,void:Ew,NEVER:Gw,ZodIssueCode:z,quotelessJson:Hb,ZodError:ct});var Ma=Symbol("current"),Hi=Symbol("previous");var Uo=o((n,{ref:r,refType:s,param:d,header:p,...g}={})=>({...g,...n}),"mergeOpenApi");function yp(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...E}=this._def,S=new this.constructor({...E,zodOpenApi:{openapi:Uo(g,y?.openapi)}});return S._def.zodOpenApi[Ma]=S,y&&(S._def.zodOpenApi[Hi]=this),S};let r=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=r.apply(this,g),E=y._def;if(E.zodOpenApi){let S={...E.zodOpenApi};S.openapi=Uo({description:g[0]},S.openapi),S[Hi]=this,S[Ma]=y,E.zodOpenApi=S}else E.zodOpenApi={openapi:{description:g[0]},[Ma]:y};return y};let s=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=s.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),S[Hi]=this,y._def.zodOpenApi=S}else y._def.zodOpenApi={[Hi]:this};return y};let d=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=d.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),delete S[Hi],delete S[Ma],y._def.zodOpenApi=S}return y};let p=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=p.apply(this,g),E=y._def.zodOpenApi;if(E){let S={...E};S.openapi=Uo({},S.openapi),delete S[Hi],delete S[Ma],y._def.zodOpenApi=S}return y}}o(yp,"extendZodWithOpenApi");yp(c);var Jw=Object.defineProperty,Yw=o((n,r)=>Jw(n,"name",{value:r,configurable:!0}),"__name"),Ac=c.array(c.string().or(c.record(c.any()))),HO=c.object({type:c.string().optional(),narrative:c.string().optional()}),kc=c.string().or(c.object({id:c.string(),type:c.string(),caption:c.string().optional()})),Kw=c.object({type:c.string().min(1).or(c.string().array().nonempty()),latitude:c.number(),longitude:c.number()}),Qw=c.object({type:c.string().min(1).or(c.string().array().nonempty()),addressCountry:c.string().optional(),addressCountryCode:c.string().optional(),addressRegion:c.string().optional(),addressLocality:c.string().optional(),streetAddress:c.string().optional(),postOfficeBoxNumber:c.string().optional(),postalCode:c.string().optional(),geo:Kw.optional()}),Xw=c.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(c.string()),Sp=c.object({type:c.string().min(1).or(c.string().array().nonempty()),identifier:c.string(),identifierType:Xw}),Bo=c.string().or(c.object({id:c.string().optional(),type:c.string().or(c.string().array().nonempty().optional()),name:c.string().optional(),url:c.string().optional(),phone:c.string().optional(),description:c.string().optional(),endorsement:c.any().array().optional(),image:kc.optional(),email:c.string().email().optional(),address:Qw.optional(),otherIdentifier:Sp.array().optional(),official:c.string().optional(),parentOrg:c.any().optional(),familyName:c.string().optional(),givenName:c.string().optional(),additionalName:c.string().optional(),patronymicName:c.string().optional(),honorificPrefix:c.string().optional(),honorificSuffix:c.string().optional(),familyNamePrefix:c.string().optional(),dateOfBirth:c.string().optional()}).catchall(c.any())),Vl=c.object({id:c.string().optional()}).catchall(c.any()),Oc=c.object({type:c.string(),id:c.string()}).catchall(c.any()),vp=c.object({id:c.string(),type:c.string()}).catchall(c.any()),_p=c.object({id:c.string().optional(),type:c.string()}).catchall(c.any()),bp=c.object({type:c.string(),id:c.string().optional()}).catchall(c.any()),wp=c.object({type:c.string().or(c.string().array().nonempty()),id:c.string().optional()}).catchall(c.any()),Zo=c.object({"@context":Ac,id:c.string().optional(),type:c.string().array().nonempty(),issuer:Bo,credentialSubject:Vl.or(Vl.array()),refreshService:_p.or(_p.array()).optional(),credentialSchema:vp.or(vp.array()).optional(),issuanceDate:c.string().optional(),expirationDate:c.string().optional(),credentialStatus:Oc.or(Oc.array()).optional(),name:c.string().optional(),description:c.string().optional(),validFrom:c.string().optional(),validUntil:c.string().optional(),status:Oc.or(Oc.array()).optional(),termsOfUse:bp.or(bp.array()).optional(),evidence:wp.or(wp.array()).optional()}).catchall(c.any()),Mr=c.object({type:c.string(),created:c.string(),challenge:c.string().optional(),domain:c.string().optional(),nonce:c.string().optional(),proofPurpose:c.string(),verificationMethod:c.string(),jws:c.string().optional()}).catchall(c.any()),Ji=Zo.extend({proof:Mr.or(Mr.array())}),ex=c.object({"@context":Ac,id:c.string().optional(),type:c.string().or(c.string().array().nonempty()),verifiableCredential:Ji.or(Ji.array()).optional(),holder:c.string().optional()}).catchall(c.any()),qo=ex.extend({proof:Mr.or(Mr.array())}),Ml=c.object({kty:c.string(),crv:c.string(),x:c.string(),y:c.string().optional(),n:c.string().optional(),d:c.string().optional()}),YO=Ml.omit({d:!0}).extend({d:c.string()}),tx=c.object({alg:c.string(),iv:c.string(),tag:c.string(),epk:Ml.partial().optional(),kid:c.string().optional(),apv:c.string().optional(),apu:c.string().optional()}),rx=c.object({header:tx,encrypted_key:c.string()}),nx=c.object({protected:c.string(),iv:c.string(),ciphertext:c.string(),tag:c.string(),aad:c.string().optional(),recipients:rx.array().optional()}),Gi=c.string().or(c.object({"@context":Ac.optional(),id:c.string(),type:c.string(),controller:c.string(),publicKeyJwk:Ml.optional(),publicKeyBase58:c.string().optional(),publicKeyMultibase:c.string().optional(),blockChainAccountId:c.string().optional()}).catchall(c.any())),ix=c.object({id:c.string(),type:c.string().or(c.string().array().nonempty()),serviceEndpoint:c.any().or(c.any().array().nonempty())}).catchall(c.any()),KO=c.object({"@context":Ac,id:c.string(),alsoKnownAs:c.string().optional(),controller:c.string().or(c.string().array().nonempty()).optional(),verificationMethod:Gi.array().optional(),authentication:Gi.array().optional(),assertionMethod:Gi.array().optional(),keyAgreement:Gi.array().optional(),capabilityInvocation:Gi.array().optional(),capabilityDelegation:Gi.array().optional(),publicKey:Gi.array().optional(),service:ix.array().optional(),proof:Mr.or(Mr.array()).optional()}).catchall(c.any()),ax=c.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(c.string()),Pc=c.object({type:c.string().array().nonempty(),targetCode:c.string().optional(),targetDescription:c.string().optional(),targetName:c.string(),targetFramework:c.string().optional(),targetType:ax.optional(),targetUrl:c.string()}),ox=c.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),sx=ox.or(c.string()),cx=c.object({id:c.string().optional(),narrative:c.string().optional()}).catchall(c.any()),ux=c.object({id:c.string(),type:c.string().array().nonempty(),endorsementComment:c.string().optional()}),lx=Zo.extend({credentialSubject:ux,proof:Mr.or(Mr.array()).optional()}),dx=c.object({id:c.string(),"@language":c.string().optional(),version:c.string().optional()}),fx=c.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(c.string()),px=c.object({id:c.string(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),description:c.string().optional(),level:c.string().optional(),name:c.string(),points:c.string().optional()}).catchall(c.any()),hx=c.object({id:c.string(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),allowedValue:c.string().array().optional(),name:c.string(),requiredLevel:c.string().optional(),requiredValue:c.string().optional(),resultType:fx,rubricCriterionLevel:px.array().optional(),valueMax:c.string().optional(),valueMin:c.string().optional()}).catchall(c.any()),mx=c.object({id:c.string().optional(),type:c.string().array().nonempty(),alignment:Pc.array().optional(),achievementType:sx.optional(),creator:Bo.optional(),creditsAvailable:c.number().optional(),criteria:cx,description:c.string(),endorsement:lx.array().optional(),fieldOfStudy:c.string().optional(),humanCode:c.string().optional(),image:kc.optional(),"@language":c.string().optional(),name:c.string(),otherIdentifier:Sp.array().optional(),related:dx.array().optional(),resultDescription:hx.array().optional(),specialization:c.string().optional(),tag:c.string().array().optional(),version:c.string().optional()}).catchall(c.any()),gx=c.object({type:c.string(),hashed:c.boolean(),identityHash:c.string(),identityType:c.string(),salt:c.string().optional()}),yx=c.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),vx=c.object({type:c.string().array().nonempty(),achievedLevel:c.string().optional(),alignment:Pc.array().optional(),resultDescription:c.string().optional(),status:yx.optional(),value:c.string().optional()}).catchall(c.any()),xp=c.object({id:c.string().optional(),type:c.string().array().nonempty(),activityEndDate:c.string().optional(),activityStartDate:c.string().optional(),creditsEarned:c.number().optional(),achievement:mx.optional(),identifier:gx.array().optional(),image:kc.optional(),licenseNumber:c.string().optional(),narrative:c.string().optional(),result:vx.array().optional(),role:c.string().optional(),source:Bo.optional(),term:c.string().optional()}).catchall(c.any()),_x=c.object({id:c.string().optional(),type:c.string().or(c.string().array().nonempty()),narrative:c.string().optional(),name:c.string().optional(),description:c.string().optional(),genre:c.string().optional(),audience:c.string().optional()}).catchall(c.any()),bx=Zo.extend({name:c.string().optional(),description:c.string().optional(),image:kc.optional(),credentialSubject:xp.or(xp.array()),endorsement:Zo.array().optional(),evidence:_x.array().optional()}),XO=bx.extend({proof:Mr.or(Mr.array())}),tA=c.object({checks:c.string().array(),warnings:c.string().array(),errors:c.string().array()}),Rp=c.enum(["Success","Failed","Error"]),rA=Rp.enum,nA=c.object({check:c.string(),status:Rp,message:c.string().optional(),details:c.string().optional()}),iA=c.object({title:c.string().optional(),createdAt:c.string().optional(),issuer:Bo.optional(),issuee:Bo.optional(),credentialSubject:Vl.optional()}),aA=c.object({id:c.string(),uri:c.string()}).catchall(c.any()),cA=c.object({limit:c.number(),cursor:c.string().optional(),sort:c.string().optional()}),yt=c.object({cursor:c.string().optional(),hasMore:c.boolean()}),Op=c.object({encryptedRecord:nx,fields:c.string().array()}).catchall(c.any()),uA=yt.extend({records:Op.array()}),wx=Op.extend({id:c.string()}),lA=yt.extend({records:wx.array()}),Ep=Yw(n=>{let r=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!r)throw new Error("Invalid RegExp string format");return{pattern:r[1],flags:r[2]}},"parseRegexString"),xx=c.instanceof(RegExp).or(c.string().refine(n=>{try{return Ep(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:r,flags:s}=Ep(n);try{return new RegExp(r,s)}catch(d){throw new Error(`Invalid RegExp: ${d.message}`)}})),Pe=c.string().or(c.object({$in:c.string().array()})).or(c.object({$regex:xx})),Ex=c.object({backgroundColor:c.string().optional(),backgroundImage:c.string().optional(),fadeBackgroundImage:c.boolean().optional(),repeatBackgroundImage:c.boolean().optional(),fontColor:c.string().optional(),accentColor:c.string().optional(),accentFontColor:c.string().optional(),idBackgroundImage:c.string().optional(),fadeIdBackgroundImage:c.boolean().optional(),idBackgroundColor:c.string().optional(),repeatIdBackgroundImage:c.boolean().optional()}),hn=c.object({profileId:c.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:c.string().default("").describe("Human-readable display name for the profile."),shortBio:c.string().default("").describe("Short bio for the profile."),bio:c.string().default("").describe("Longer bio for the profile."),did:c.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:c.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:c.string().optional().describe("Contact email address for the profile. (deprecated)"),image:c.string().optional().describe("Profile image URL for the profile."),heroImage:c.string().optional().describe("Hero image URL for the profile."),websiteLink:c.string().optional().describe("Website link for the profile."),isServiceProfile:c.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:c.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:c.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Ex.optional().describe("Display settings for the profile."),highlightedCredentials:c.array(c.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:c.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:c.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:c.string().optional().describe("Country for the profile."),approved:c.boolean().optional().describe("Approval status for the profile.")}),pA=c.object({profileId:Pe,displayName:Pe,shortBio:Pe,bio:Pe,email:Pe,websiteLink:Pe,isServiceProfile:c.boolean(),type:Pe}).partial(),hA=yt.extend({records:hn.array()}),mA=c.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Ap=c.object({id:c.string(),created:c.string(),displayName:c.string().default("").optional(),shortBio:c.string().default("").optional(),bio:c.string().default("").optional(),email:c.string().optional(),image:c.string().optional(),heroImage:c.string().optional()}),gA=yt.extend({records:Ap.extend({did:c.string()}).array()}),yA=c.object({id:Pe,displayName:Pe,shortBio:Pe,bio:Pe,email:Pe}).partial(),vA=yt.extend({records:c.object({profile:hn,manager:Ap.extend({did:c.string()}).optional()}).array()}),_A=c.object({uri:c.string(),to:c.string(),from:c.string(),sent:c.string().datetime(),received:c.string().datetime().optional()}),kp=c.object({role:c.string(),canEdit:c.boolean(),canIssue:c.boolean(),canRevoke:c.boolean(),canManagePermissions:c.boolean(),canIssueChildren:c.string(),canCreateChildren:c.string(),canEditChildren:c.string(),canRevokeChildren:c.string(),canManageChildrenPermissions:c.string(),canManageChildrenProfiles:c.boolean().default(!1).optional(),canViewAnalytics:c.boolean()}),Tx=c.object({role:Pe,canEdit:c.boolean(),canIssue:c.boolean(),canRevoke:c.boolean(),canManagePermissions:c.boolean(),canIssueChildren:Pe,canCreateChildren:Pe,canEditChildren:Pe,canRevokeChildren:Pe,canManageChildrenPermissions:Pe,canManageChildrenProfiles:c.boolean(),canViewAnalytics:c.boolean()}).partial(),jl=c.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Cx=c.discriminatedUnion("type",[c.object({type:c.literal(jl.Values.GRANT_PERMISSIONS),data:c.object({claimUri:c.string(),targetUri:c.string(),permissions:kp.partial()})}),c.object({type:c.literal(jl.Values.ADD_ADMIN),data:c.object({claimUri:c.string(),targetUri:c.string()})}),c.object({type:c.literal(jl.Values.AUTO_CONNECT),data:c.object({claimUri:c.string(),targetUri:c.string()})})]),bA=c.object({type:Pe,data:c.object({claimUri:Pe,targetUri:Pe,permissions:Tx})}).deepPartial(),Sx=c.object({id:c.string(),createdAt:c.string(),updatedAt:c.string()}).and(Cx),wA=yt.extend({records:Sx.array()}),Dl=c.enum(["DRAFT","LIVE"]),Rx=c.object({uri:c.string(),name:c.string().optional(),type:c.string().optional(),category:c.string().optional(),status:Dl.optional(),autoConnectRecipients:c.boolean().optional(),meta:c.record(c.any()).optional(),claimPermissions:kp.optional(),allowAnyoneToCreateChildren:c.boolean().optional()}),xA=c.object({uri:Pe,name:Pe,type:Pe,category:Pe,meta:c.record(Pe),status:Dl.or(c.object({$in:Dl.array()})),autoConnectRecipients:c.boolean()}).partial(),EA=yt.extend({records:Rx.array()}),Ox=c.object({to:hn,from:c.string(),received:c.string().optional(),uri:c.string().optional()}),TA=yt.extend({records:Ox.array()}),Ax=c.object({to:hn,from:c.string(),received:c.string().optional(),boostUris:c.array(c.string()),credentialUris:c.array(c.string()).optional()}),CA=yt.extend({records:Ax.array()}),SA=c.object({endpoint:c.string(),name:c.string(),did:c.string().optional()}),RA=c.object({ttlSeconds:c.number().optional(),totalUses:c.number().optional()}),kx=c.object({endpoint:c.string()}),OA=c.object({signingAuthority:kx,relationship:c.object({name:c.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:c.string(),isPrimary:c.boolean().optional()})}),AA=c.object({boostUri:c.string(),signingAuthority:c.object({endpoint:c.string(),name:c.string()})}),Px=c.enum(["live","stale","withdrawn"]),Ix=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),personal:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),write:c.object({credentials:c.object({categories:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({}),personal:c.record(c.object({required:c.boolean(),defaultEnabled:c.boolean().optional()})).default({})}).default({})}),Pp=c.object({contract:Ix,owner:hn,name:c.string(),subtitle:c.string().optional(),description:c.string().optional(),reasonForAccessing:c.string().optional(),image:c.string().optional(),uri:c.string(),needsGuardianConsent:c.boolean().optional(),redirectUrl:c.string().optional(),frontDoorBoostUri:c.string().optional(),createdAt:c.string(),updatedAt:c.string(),expiresAt:c.string().optional(),autoBoosts:c.string().array().optional(),writers:c.array(hn).optional()}),kA=yt.extend({records:Pp.omit({owner:!0}).array()}),Nx=c.object({credentials:c.object({categories:c.record(c.string().array()).default({})}),personal:c.record(c.string()).default({}),date:c.string()}),PA=yt.extend({records:Nx.array()}),jx=c.object({credentials:c.object({category:c.string(),uri:c.string()}).array(),personal:c.record(c.string()).default({}),date:c.string(),contractUri:c.string()}),IA=yt.extend({records:jx.array()}),Ip=c.object({sharing:c.boolean().optional(),shared:c.string().array().optional(),shareAll:c.boolean().optional(),shareUntil:c.string().optional()}),Np=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({shareAll:c.boolean().optional(),sharing:c.boolean().optional(),categories:c.record(Ip).default({})}).default({}),personal:c.record(c.string()).default({})}).default({}),write:c.object({credentials:c.object({categories:c.record(c.boolean()).default({})}).default({}),personal:c.record(c.boolean()).default({})}).default({}),deniedWriters:c.array(c.string()).optional()}),NA=yt.extend({records:c.object({expiresAt:c.string().optional(),oneTime:c.boolean().optional(),terms:Np,contract:Pp,uri:c.string(),consenter:hn,status:Px}).array()}),jA=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),personal:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),write:c.object({credentials:c.object({categories:c.record(c.object({required:c.boolean().optional()})).optional()}).optional(),personal:c.record(c.object({required:c.boolean().optional()})).optional()}).optional()}),VA=c.object({anonymize:c.boolean().optional(),credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional()}),DA=c.object({credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional(),id:Pe.optional()}),Vx=c.object({read:c.object({anonymize:c.boolean().optional(),credentials:c.object({shareAll:c.boolean().optional(),sharing:c.boolean().optional(),categories:c.record(Ip.optional()).optional()}).optional(),personal:c.record(c.string()).optional()}).optional(),write:c.object({credentials:c.object({categories:c.record(c.boolean()).optional()}).optional(),personal:c.record(c.boolean()).optional()}).optional()}),Ll=c.enum(["consent","update","sync","withdraw","write"]),LA=c.object({terms:Vx.optional(),action:Ll.or(Ll.array()).optional(),date:c.object({$gt:c.string()}).or(c.object({$lt:c.string()})).or(c.object({$eq:c.string()})).optional(),expiresAt:c.object({$gt:c.string()}).or(c.object({$lt:c.string()})).or(c.object({$eq:c.string()})).optional(),oneTime:c.boolean().optional()}),jp=c.object({expiresAt:c.string().optional(),oneTime:c.boolean().optional(),terms:Np.optional(),id:c.string(),action:Ll,date:c.string(),uris:c.string().array().optional()}),MA=yt.extend({records:jp.array()}),Dx=c.object({credentialUri:c.string(),termsUri:c.string(),contractUri:c.string(),boostUri:c.string(),category:c.string().optional(),date:c.string()}),UA=yt.extend({records:Dx.array()}),Lx=c.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),Mx=c.object({title:c.string().optional(),body:c.string().optional()}),Ux=c.object({type:c.string(),value:c.string()}),Ic=c.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Bx=c.object({issuanceId:c.string(),status:Ic,recipient:c.object({contactMethod:Ux.optional(),learnCardId:c.string().optional()}),timestamp:c.string().datetime().optional()}),Zx=c.object({vcUris:c.array(c.string()).optional(),vpUris:c.array(c.string()).optional(),transaction:jp.optional(),inbox:Bx.optional()}),BA=c.object({type:Lx,to:hn.partial().and(c.object({did:c.string()})),from:hn.partial().and(c.object({did:c.string()})),message:Mx.optional(),data:Zx.optional(),sent:c.string().datetime().optional(),webhookUrl:c.string().optional()}),qx="auth-grant:",ZA=c.object({id:c.string(),name:c.string(),description:c.string().optional(),challenge:c.string().startsWith(qx).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:c.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:c.string(),createdAt:c.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:c.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),qA=c.object({id:c.string()}).catchall(c.any()),Fx=c.enum(["active","revoked"]),FA=c.object({id:Pe,name:Pe,description:Pe,status:Fx}).partial(),Tp=c.object({id:c.string(),isVerified:c.boolean(),verifiedAt:c.string().optional(),isPrimary:c.boolean(),createdAt:c.string()}),zA=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}).merge(Tp),c.object({type:c.literal("phone"),value:c.string()}).merge(Tp)]),Cp=c.object({isVerified:c.boolean().optional(),isPrimary:c.boolean().optional()}),$A=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}).merge(Cp),c.object({type:c.literal("phone"),value:c.string()}).merge(Cp)]),Vp=c.discriminatedUnion("type",[c.object({type:c.literal("email"),value:c.string().email()}),c.object({type:c.literal("phone"),value:c.string()})]),WA=c.object({value:c.string(),type:c.enum(["email","phone"])}),HA=c.object({token:c.string()}),GA=c.object({contactMethodId:c.string()}),zx=c.object({id:c.string(),credential:c.string(),isSigned:c.boolean(),currentStatus:Ic,expiresAt:c.string(),createdAt:c.string(),issuerDid:c.string(),webhookUrl:c.string().optional(),signingAuthority:c.object({endpoint:c.string().optional(),name:c.string().optional()}).optional()}),JA=c.object({hasMore:c.boolean(),records:c.array(zx),cursor:c.string().optional()}),YA=c.object({currentStatus:Ic,id:c.string(),isSigned:c.boolean(),issuerDid:c.string()}).partial(),$x=c.object({endpoint:c.string().url(),name:c.string()}),KA=c.object({recipient:Vp.describe("The recipient of the credential"),credential:Ji.passthrough().or(qo.passthrough()).or(Zo.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:c.object({signingAuthority:$x.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:c.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:c.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:c.object({suppress:c.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:c.object({id:c.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:c.object({issuer:c.object({name:c.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:c.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:c.object({name:c.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:c.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:c.object({name:c.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),QA=c.object({issuanceId:c.string(),status:Ic,recipient:Vp,claimUrl:c.string().url().optional(),recipientDid:c.string().optional()}),XA=c.object({token:c.string(),contactMethodId:c.string(),autoVerifyContactMethod:c.boolean().optional().default(!1),createdAt:c.string(),expiresAt:c.string(),used:c.boolean()});var Fp=Ef(Bp());var Ua={"SHA-1":{outputLength:20,blockSize:64},"SHA-256":{outputLength:32,blockSize:64},"SHA-384":{outputLength:48,blockSize:128},"SHA-512":{outputLength:64,blockSize:128}};function qp(n,r,s,d,p="SHA-256"){return new Promise((g,y)=>{p in Ua||y(new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ua).toString()}`)),typeof n=="string"?n=new TextEncoder().encode(n):n instanceof ArrayBuffer?n=new Uint8Array(n):ArrayBuffer.isView(n)||y(RangeError("P should be string, ArrayBuffer, TypedArray, DataView")),typeof r=="string"?r=new TextEncoder().encode(r):r instanceof ArrayBuffer?r=new Uint8Array(r):ArrayBuffer.isView(r)?r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):y(RangeError("S should be string, ArrayBuffer, TypedArray, DataView")),crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits"]).then(E=>{let S={name:"PBKDF2",hash:p,salt:r,iterations:s};crypto.subtle.deriveBits(S,E,8*d).then(N=>g(N),N=>{(async function(F,V,k,R,q){if(!(q in Ua))throw new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ua).toString()}`);if(!Number.isInteger(k)||k<=0)throw new RangeError("c must be a positive integer");let A=Ua[q].outputLength;if(!Number.isInteger(R)||R<=0||R>=(2**32-1)*A)throw new RangeError("dkLen must be a positive integer < (2 ** 32 - 1) * hLen");let X=Math.ceil(R/A),Q=R-(X-1)*A,ne=new Array(X);F.byteLength===0&&(F=new Uint8Array(Ua[q].blockSize));let Se=await crypto.subtle.importKey("raw",F,{name:"HMAC",hash:{name:q}},!0,["sign"]),be=o(async function(Ue,Ur){let $=await crypto.subtle.sign("HMAC",Ue,Ur);return new Uint8Array($)},"g");for(let Ue=0;Ue<X;Ue++)ne[Ue]=await Ne(Se,V,k,Ue+1);async function Ne(Ue,Ur,$,Je){function re(br){let mn=new ArrayBuffer(4);return new DataView(mn).setUint32(0,br,!1),new Uint8Array(mn)}o(re,"i");let $t=await be(Ue,Zp(Ur,re(Je))),Fe=$t;for(let br=1;br<$;br++)Fe=await be(Ue,Fe),tE($t,Fe);return $t}return o(Ne,"h"),ne[X-1]=ne[X-1].slice(0,Q),Zp(...ne).buffer})(n,r,s,d,p).then(F=>g(F),F=>y(F))})},E=>y(E))})}o(qp,"t");function Zp(...n){let r=n.reduce((p,g)=>p+g.length,0);if(n.length===0)throw new RangeError("Cannot concat no arrays");let s=new Uint8Array(r),d=0;for(let p of n)s.set(p,d),d+=p.length;return s}o(Zp,"r");function tE(n,r){for(let s=0;s<n.length;s++)n[s]^=r[s]}o(tE,"n");var Ba=o(async(n,r)=>{let s=await n.invoke.hash?.(r,"PBKDF2-HMAC-SHA256");if(s)return s;let d=n.invoke.crypto(),p=new TextEncoder().encode(r),g=n.id.keypair("secp256k1").d,y=await qp(g,"salt",1e3,32),E=await d.subtle.importKey("raw",y,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),S=await d.subtle.sign("HMAC",E,p);return Array.from(new Uint8Array(S)).map(F=>F.toString(16).padStart(2,"0")).join("")},"hash"),zt=o(async(n,r,s)=>n.invoke.createDagJwe(s,[r]),"generateJWE"),_r=o(async(n,r)=>n.invoke.decryptDagJwe(r),"decryptJWE"),Yi=o(async(n,r,s=[])=>{let d=Object.entries(r);return(await Promise.all(d.map(async([p,g])=>s.includes(p)?"":await Ba(n,`${p}:${(0,Fp.default)(g)}`)))).filter(Boolean)},"generateEncryptedFieldsArray"),Ki=o(async(n,r,s=[])=>{let d=await n.invoke.createDagJwe(r),p=await Yi(n,r,s);return{...Object.fromEntries(Object.entries(r).filter(([y])=>s.includes(y))),encryptedRecord:d,fields:p}},"generateEncryptedRecord");var Ul=o(async(n,r)=>rp(n,async s=>{let d=await r.invoke.getDidAuthVp({proofFormat:"jwt",challenge:s});if(typeof d!="string")throw new Error("Error getting DID-Auth-JWT!");return d}),"getLearnCloudClient"),rE=o(async(n,r,s=[],d=[],p=!0)=>{let g=n;g.debug?.("Adding LearnCloud Plugin");let y=await Ul(r,g),E=[g.id.did()];y.user.getDids.query().then(k=>E=k);let S={},N=y.utilities.getDid.query(),F=o(async k=>(S[k]||(S[k]=await Ul(k,g)),S[k]),"getOtherClient"),V=o(async k=>{let R=g.id.did(),q=k.id.did();if(R!==q){if(!E.includes(q)&&p){let A=await k.invoke.getDidAuthVp();await y.user.addDid.mutate({presentation:A}),q.split(":")[1]==="web"&&await y.user.setPrimaryDid.mutate({presentation:A}),E=await y.user.getDids.query()}y=await Ul(r,k)}g=k},"updateLearnCard");return{name:"LearnCloud",displayName:"LearnCloud",description:"LearnCloud Integration",methods:{learnCloudCreate:async(k,R)=>{await V(k);let q=await Ki(k,R,d);return y.customStorage.create.mutate({item:await zt(k,await N,q)})},learnCloudCreateMany:async(k,R)=>{await V(k);let q=await Promise.all(R.map(async A=>Ki(k,A,d)));return y.customStorage.createMany.mutate({items:await zt(k,await N,q)})},learnCloudRead:async(k,R,q)=>{await V(k);let A=[],X=await k.invoke.learnCloudReadPage(R,{},q);for(A.push(...X.records);X.hasMore;)X=await k.invoke.learnCloudReadPage(R,{},q),A.push(...X.records);return A},learnCloudReadPage:async(k,R,q,A)=>{if(await V(k),!R){let be=await y.customStorage.read.query({includeAssociatedDids:A,...q}),Ne=Zi(be)?await _r(k,be):be;return{...Ne,records:await Promise.all(Ne.records.map(async Ue=>({...await _r(k,Ue.encryptedRecord),_id:Ue._id})))}}let X=await Yi(k,R,[...d,"_id"]),Q=Object.fromEntries(Object.entries(R).filter(([be])=>[...d,"_id"].includes(be))),ne=await y.customStorage.read.query({query:await zt(k,await N,{...Q,...X.length>0?{fields:{$in:X}}:{}}),...q,includeAssociatedDids:A}),Se=Zi(ne)?await _r(k,ne):ne;return{...Se,records:await Promise.all(Se.records.map(async be=>({...await _r(k,be.encryptedRecord),_id:be._id})))}},learnCloudCount:async(k,R,q)=>{if(await V(k),!R)return y.customStorage.count.query({includeAssociatedDids:q});let A=await Yi(k,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([Q])=>[...d,"_id"].includes(Q)));return y.customStorage.count.query({query:await zt(k,await N,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:q})},learnCloudUpdate:async(k,R,q)=>{await V(k);let A=await k.invoke.learnCloudRead(R);return(await Promise.all(A.map(async Q=>y.customStorage.update.mutate({query:await zt(k,await N,{_id:Q._id}),update:await zt(k,await N,await Ki(k,{...Q,...q},d))})))).reduce((Q,ne)=>ne+Q,0)},learnCloudDelete:async(k,R,q)=>{if(await V(k),!R)return y.customStorage.delete.mutate({includeAssociatedDids:q});let A=await Yi(k,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([Q])=>[...d,"_id"].includes(Q)));return y.customStorage.delete.mutate({query:await zt(k,await N,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:q})},learnCloudBatchResolve:async(k,R)=>{let q=await y.storage.batchResolve.query({uris:R});return Promise.all(q.map(async A=>{if(!A)return null;try{let X=await k.invoke.decryptDagJwe(A);return await Ji.or(qo).parseAsync(X)}catch(X){return k.debug?.(X),null}}))}},read:{get:async(k,R)=>{if(g.debug?.("LearnCloud read.get",R),!R)return;let q=R.split(":");if(g.debug?.("LearnCloud read.get parts:",q),q.length!==5)return;let[A,X,Q]=q;if(A!=="lc"||X!=="cloud"){g.debug?.("LearnCloud read.get not cloud URI!",{lc:A,method:X});return}if(Q.replace(/https?:\/\//g,"")!==r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")){let ne=(Q.startsWith("http")?Q:`http${Q.includes("http")||Q.includes("localhost")?"":"s"}://${Q}`).replaceAll("%3A",":");g.debug?.("LearnCloud read.get different LearnCloud!",{uriUrl:Q,url:r,fullUrl:ne,comparison:{a:Q.replace(/https?:\/\//g,""),b:r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")}});let Se=await F(ne);try{let be=await Se.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",be);let Ne=await k.invoke.decryptDagJwe(be);return g.debug?.("LearnCloud read.get decryptedResult",Ne),await Ji.or(qo).parseAsync(Ne)}catch(be){k.debug?.(be);return}}try{let ne=await y.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",ne);let Se=await k.invoke.decryptDagJwe(ne);return g.debug?.("LearnCloud read.get decryptedResult",Se),await Ji.or(qo).parseAsync(Se)}catch(ne){k.debug?.(ne);return}}},store:{upload:async(k,R)=>(k.debug?.("learnCard.store['LearnCard Network'].upload"),y.storage.store.mutate({item:R})),uploadEncrypted:async(k,R,{recipients:q=[]}={recipients:[]})=>{k.debug?.("learnCard.store['LearnCard Network'].upload");let A=await k.invoke.createDagJwe(R,[k.id.did(),...q]);return y.storage.store.mutate({item:A})}},index:{get:async(k,R)=>{await V(k);let q=[],A=await k.index.LearnCloud.getPage(R);for(q.push(...A.records);A.hasMore;)A=await k.index.LearnCloud.getPage(R,{cursor:A.cursor}),q.push(...A.records);return q},getPage:async(k,R,q)=>{await V(k),k.debug?.("LearnCloud index.getPaginated",R,q);let A={...q,sort:["newestFirst","oldestFirst"].includes(q?.sort??"")?q?.sort:void 0};if(!R){k.debug?.("LearnCloud index.get (no query)");let be=await y.index.get.query(A);k.debug?.("LearnCloud index.get (no query response)",be);let Ne=Zi(be)?await _r(k,be):be;return k.debug?.("LearnCloud index.get (no query encryptedRecords)",Ne),{...Ne,records:await Promise.all(Ne.records.map(async Ue=>_r(k,Ue.encryptedRecord)))}}k.debug?.("LearnCloud index.get (query)");let X=await Yi(k,R,s);k.debug?.("LearnCloud index.get (query fields)",X);let Q=Object.fromEntries(Object.entries(R).filter(([be])=>s.includes(be)));k.debug?.("LearnCloud index.get (query unencryptedEntries)",Q);let ne=await y.index.get.query({query:await zt(k,await N,{...Q,...X.length>0?{fields:{$in:X}}:{}}),...A});k.debug?.("LearnCloud index.get (query jwe)",ne);let Se=Zi(ne)?await _r(k,ne):ne;return k.debug?.("LearnCloud index.get (query encryptedRecords)",Se),{...Se,records:await Promise.all(Se.records.map(async be=>_r(k,be.encryptedRecord)))}},getCount:async(k,R)=>{if(await V(k),!R){k.debug?.("LearnCloud index.count (no query)");let ne=await y.index.count.query();k.debug?.("LearnCloud index.count (no query response)",ne);let Se=Zi(ne)?await _r(k,ne):ne;return k.debug?.("LearnCloud index.count (no query count)",Se),Se}k.debug?.("LearnCloud index.getCount (query)");let q=await Yi(k,R,s);k.debug?.("LearnCloud index.getCount (query fields)",q);let A=Object.fromEntries(Object.entries(R).filter(([ne])=>s.includes(ne)));k.debug?.("LearnCloud index.getCount (query unencryptedEntries)",A);let X=await y.index.count.query({query:await zt(k,await N,{...A,...q.length>0?{fields:{$in:q}}:{}})});k.debug?.("LearnCloud index.count (query response)",X);let Q=Zi(X)?await _r(k,X):X;return k.debug?.("LearnCloud index.count (query count)",Q),Q},add:async(k,R)=>{await V(k);let q=R.id||k.invoke.crypto().randomUUID();return y.index.add.mutate({record:await zt(k,await N,{...await Ki(k,{...R,id:q},s),id:await Ba(k,q)})})},addMany:async(k,R)=>(await V(k),(await Promise.all((0,zp.chunk)(R,25).map(async A=>{let X=await Promise.all(A.map(async Q=>{let ne=Q.id||k.invoke.crypto().randomUUID();return{...await Ki(k,{...Q,id:ne},s),id:await Ba(k,ne)}}));return y.index.addMany.mutate({records:await zt(k,await N,X)})}))).every(Boolean)),update:async(k,R,q)=>{await V(k);let A=await k.index.LearnCloud.get({id:R});if(A.length!==1)return!1;let Q={...A[0],...q};return y.index.update.mutate({id:await Ba(k,R),updates:await zt(k,await N,await Ki(k,Q,s))})},remove:async(k,R)=>(await V(k),y.index.remove.mutate({id:await Ba(k,R)})),removeAll:async k=>(await V(k),y.index.removeAll.mutate())}}},"getLearnCloudPlugin");
25
25
  /* istanbul ignore file -- @preserve */
26
26
  /* istanbul ignore if -- @preserve */
27
27
  /* istanbul ignore next -- @preserve */