@zuplo/core 6.32.4 → 6.32.5

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.
@@ -630,7 +630,7 @@ Did you specify these with the most recent transformation maps first?`);let d=g5
630
630
  //# sourceMappingURL=data:application/json;base64,`,tbt=yp(()=>process.sourceMapsEnabled??!0,"shouldApplySourceMap"),rbt=yp(({code:a,map:s})=>a+dTr+Buffer.from(JSON.stringify(s),"utf8").toString("base64"),"inlineSourceMap"),mTr=[".cts",".mts",".ts",".tsx",".jsx"],hTr=[".js",".cjs",".mjs"],nbt=[".ts",".tsx",".jsx"],v5e=yp((a,s,c,f)=>{let d=Object.getOwnPropertyDescriptor(a,s);d?.set?a[s]=c:(!d||d.configurable)&&Object.defineProperty(a,s,{value:c,enumerable:d?.enumerable||f?.enumerable,writable:f?.writable??(d?d.writable:!0),configurable:f?.configurable??(d?d.configurable:!0)})},"safeSet"),gTr=yp((a,s,c)=>{let f=s[".js"],d=yp((v,E)=>{if(a.enabled===!1)return f(v,E);let[A,O]=E.split("?");if((new URLSearchParams(O).get("namespace")??void 0)!==c)return f(v,E);v.id.startsWith("data:text/javascript,")&&(v.path=NS.dirname(A)),Upe?.send&&Upe.send({type:"dependency",path:A});let M=mTr.some(K=>A.endsWith(K)),H=hTr.some(K=>A.endsWith(K));if(!M&&!H)return f(v,A);let $=lTr.readFileSync(A,"utf8");if(A.endsWith(".cjs")){let K=Bpe(E,$);K&&($=tbt()?rbt(K):K.code)}else if(M||dvt($)){let K=Zvt($,E,{tsconfigRaw:_bt?.(A)});$=tbt()?rbt(K):K.code}v._compile($,A)},"transformer");v5e(s,".js",d);for(let v of nbt)v5e(s,v,d,{enumerable:!c,writable:!0,configurable:!0});return v5e(s,".mjs",d,{writable:!0,configurable:!0}),()=>{s[".js"]===d&&(s[".js"]=f);for(let v of[...nbt,".mjs"])s[v]===d&&delete s[v]}},"createExtensions"),yTr=yp(a=>s=>{if((s==="."||s===".."||s.endsWith("/.."))&&(s+="/"),lbt.test(s)){let c=NS.join(s,"index.js");s.startsWith("./")&&(c=`./${c}`);try{return a(c)}catch{}}try{return a(s)}catch(c){let f=c;if(f.code==="MODULE_NOT_FOUND")try{return a(`${s}${NS.sep}index.js`)}catch{}throw f}},"createImplicitResolver"),dbt=[".js",".json"],mbt=[".ts",".tsx",".jsx"],vTr=[...mbt,...dbt],bTr=[...dbt,...mbt],iY=Object.create(null);iY[".js"]=[".ts",".tsx",".js",".jsx"],iY[".jsx"]=[".tsx",".ts",".jsx",".js"],iY[".cjs"]=[".cts"],iY[".mjs"]=[".mts"];var STr=yp(a=>{let s=a.split("?"),c=s[1]?`?${s[1]}`:"",[f]=s,d=NS.extname(f),v=[],E=iY[d];if(E){let O=f.slice(0,-d.length);v.push(...E.map(M=>O+M+c))}let A=!(a.startsWith(sY)||Jpe(f))||f.includes(fbt)||f.includes("/node_modules/")?bTr:vTr;return v.push(...A.map(O=>f+O+c)),v},"mapTsExtensions"),$pe=yp((a,s,c)=>{if(lbt.test(s)||!c&&!pbt)return;let f=STr(s);if(f)for(let d of f)try{return a(d)}catch(v){let{code:E}=v;if(E!=="MODULE_NOT_FOUND"&&E!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw v}},"resolveTsFilename"),TTr=yp((a,s)=>c=>{if(Jpe(c)){let f=$pe(a,c,s);if(f)return f}try{return a(c)}catch(f){let d=f;if(d.code==="MODULE_NOT_FOUND"){if(typeof d.path=="string"&&d.path.endsWith(`${NS.sep}package.json`)){let E=d.message.match(/^Cannot find module '([^']+)'$/);if(E){let O=E[1],M=$pe(a,O,s);if(M)return M}let A=d.message.match(/^Cannot find module '([^']+)'. Please verify that the package.json has a valid "main" entry$/);if(A){let O=A[1],M=$pe(a,O,s);if(M)return M}}let v=$pe(a,c,s);if(v)return v}throw d}},"createTsExtensionResolver"),ibt="at cjsPreparseModuleExports (node:internal",CTr=yp(a=>{let s=a.stack.split(`
631
631
  `).slice(1);return s[1].includes(ibt)||s[2].includes(ibt)},"isFromCjsLexer"),ETr=yp((a,s)=>{let c=a.split("?"),f=new URLSearchParams(c[1]);if(s?.filename){let d=obt(s.filename),v;if(d){let A=d.split("?"),O=A[0];v=A[1],s.filename=O,s.path=NS.dirname(O),s.paths=_k._nodeModulePaths(s.path),_k._cache[O]=s}v||(v=s.filename.split("?")[1]);let E=new URLSearchParams(v).get("namespace");E&&f.append("namespace",E)}return[c[0],f,(d,v)=>(NS.isAbsolute(d)&&!d.endsWith(".json")&&!d.endsWith(".node")&&!(v===0&&CTr(new Error))&&(d+=S5e(f)),d)]},"preserveQuery"),xTr=yp((a,s,c)=>{if(a.startsWith(sY)&&(a=abt(a)),b5e&&!Jpe(a)&&!s?.filename?.includes(fbt)){let f=b5e(a);for(let d of f)try{return c(d)}catch{}}return c(a)},"resolveTsPaths"),DTr=yp((a,s,c)=>(f,d,...v)=>{if(a.enabled===!1)return s(f,d,...v);f=T5e(f);let[E,A,O]=ETr(f,d);if((A.get("namespace")??void 0)!==c)return s(f,d,...v);let M=yp($=>s($,d,...v),"nextResolveSimple");M=TTr(M,!!(c||d?.filename&&_Tr.test(d.filename))),M=yTr(M);let H=xTr(E,d,M);return O(H,v.length)},"createResolveFilename"),sbt=yp((a,s)=>{if(!s)throw new Error("The current file path (__filename or import.meta.url) must be provided in the second argument of tsx.require()");return a.startsWith(".")?((typeof s=="string"&&s.startsWith(sY)||s instanceof URL)&&(s=abt(s)),NS.resolve(NS.dirname(s),a)):a},"resolveContext"),aY=yp(a=>{let{sourceMapsEnabled:s}=process,c={enabled:!0};pTr(process.env.TSX_TSCONFIG_PATH),process.setSourceMapsEnabled(!0);let f=_k._resolveFilename,d=DTr(c,f,a?.namespace);_k._resolveFilename=d;let v=gTr(c,_k._extensions,a?.namespace),E=yp(()=>{s===!1&&process.setSourceMapsEnabled(!1),c.enabled=!1,_k._resolveFilename===d&&(_k._resolveFilename=f),v()},"unregister");if(a?.namespace){let A=yp((M,H)=>{let $=sbt(M,H),[K,Ne]=$.split("?"),xe=new URLSearchParams(Ne);return a.namespace&&!K.startsWith("node:")&&xe.set("namespace",a.namespace),S7(K+S5e(xe))},"scopedRequire");E.require=A;let O=yp((M,H,$)=>{let K=sbt(M,H),[Ne,xe]=K.split("?"),Te=new URLSearchParams(xe);return a.namespace&&!Ne.startsWith("node:")&&Te.set("namespace",a.namespace),d(Ne+S5e(Te),module,!1,$)},"scopedResolve");E.resolve=O,E.unregister=E}return E},"register");import{pathToFileURL as wTr}from"url";var ATr=Object.defineProperty,qpe=t((a,s)=>ATr(a,"name",{value:s,configurable:!0}),"o"),PTr=qpe(a=>(s,c)=>{if(!c)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");let f=c.startsWith(sY)?c:wTr(c).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:f,namespace:a})}`)},"createScopedImport"),hbt=!1,gbt=qpe(a=>{if(!zpe.register)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!hbt){let{_resolveFilename:A}=zpe;zpe._resolveFilename=(O,...M)=>A(T5e(O),...M),hbt=!0}let{sourceMapsEnabled:s}=process;process.setSourceMapsEnabled(!0);let{port1:c,port2:f}=new kTr;zpe.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:f,namespace:a?.namespace,tsconfig:a?.tsconfig},transferList:[f]});let d=a?.onImport,v=d&&(A=>{A.type==="load"&&d(A.url)});v&&(c.on("message",v),c.unref());let E=qpe(()=>(s===!1&&process.setSourceMapsEnabled(!1),v&&c.off("message",v),c.postMessage("deactivate"),new Promise(A=>{let O=qpe(M=>{M.type==="deactivated"&&(A(),c.off("message",O))},"onDeactivated");c.on("message",O)})),"unregister");return a?.namespace&&(E.import=PTr(a.namespace),E.unregister=E),E},"register");var NTr=Object.defineProperty,vbt=t((a,s)=>NTr(a,"name",{value:s,configurable:!0}),"a"),oU,Vpe=vbt((a,s)=>(oU||(oU=aY({namespace:Date.now().toString()})),oU.require(a,s)),"tsxRequire"),ybt=vbt((a,s,c)=>(oU||(oU=aY({namespace:Date.now().toString()})),oU.resolve(a,s,c)),"resolve");ybt.paths=S7.resolve.paths,Vpe.resolve=ybt,Vpe.main=S7.main,Vpe.extensions=S7.extensions,Vpe.cache=S7.cache;var ITr=Object.defineProperty,bbt=t((a,s)=>ITr(a,"name",{value:s,configurable:!0}),"o"),OTr=bbt((a,s)=>{let c=a[0]-s[0];if(c===0){let f=a[1]-s[1];return f===0?a[2]>=s[2]:f>0}return c>0},"isVersionGreaterOrEqual"),FTr=process.versions.node.split(".").map(Number),Sbt=bbt((a,s=FTr)=>{for(let c=0;c<a.length;c+=1){let f=a[c];if(c===a.length-1||s[0]===f[0])return OTr(s,f)}return!1},"isFeatureSupported");var Tbt=[[20,11,0],[21,3,0]];import"esbuild";var LTr=Object.defineProperty,RTr=t((a,s)=>LTr(a,"name",{value:s,configurable:!0}),"i"),Cbt=RTr((a,s)=>{if(!s||typeof s=="object"&&!s.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");let c=typeof s=="string",f=c?s:s.parentURL,d=Date.now().toString(),v=aY({namespace:d});return!Sbt(Tbt)&&!ubt.test(a)&&cbt.test(a)?Promise.resolve(v.require(a,f)):gbt({namespace:d,...c?{}:s}).import(a,f)},"tsImport");var of;(function(a){a.assertEqual=d=>d;function s(d){}t(s,"assertIs"),a.assertIs=s;function c(d){throw new Error}t(c,"assertNever"),a.assertNever=c,a.arrayToEnum=d=>{let v={};for(let E of d)v[E]=E;return v},a.getValidEnumValues=d=>{let v=a.objectKeys(d).filter(A=>typeof d[d[A]]!="number"),E={};for(let A of v)E[A]=d[A];return a.objectValues(E)},a.objectValues=d=>a.objectKeys(d).map(function(v){return d[v]}),a.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{let v=[];for(let E in d)Object.prototype.hasOwnProperty.call(d,E)&&v.push(E);return v},a.find=(d,v)=>{for(let E of d)if(v(E))return E},a.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&isFinite(d)&&Math.floor(d)===d;function f(d,v=" | "){return d.map(E=>typeof E=="string"?`'${E}'`:E).join(v)}t(f,"joinValues"),a.joinValues=f,a.jsonStringifyReplacer=(d,v)=>typeof v=="bigint"?v.toString():v})(of||(of={}));var E5e;(function(a){a.mergeShapes=(s,c)=>({...s,...c})})(E5e||(E5e={}));var Xa=of.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),WN=t(a=>{switch(typeof a){case"undefined":return Xa.undefined;case"string":return Xa.string;case"number":return isNaN(a)?Xa.nan:Xa.number;case"boolean":return Xa.boolean;case"function":return Xa.function;case"bigint":return Xa.bigint;case"symbol":return Xa.symbol;case"object":return Array.isArray(a)?Xa.array:a===null?Xa.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?Xa.promise:typeof Map<"u"&&a instanceof Map?Xa.map:typeof Set<"u"&&a instanceof Set?Xa.set:typeof Date<"u"&&a instanceof Date?Xa.date:Xa.object;default:return Xa.unknown}},"getParsedType"),As=of.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"]),MTr=t(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),IS=class a extends Error{static{t(this,"ZodError")}constructor(s){super(),this.issues=[],this.addIssue=f=>{this.issues=[...this.issues,f]},this.addIssues=(f=[])=>{this.issues=[...this.issues,...f]};let c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=s}get errors(){return this.issues}format(s){let c=s||function(v){return v.message},f={_errors:[]},d=t(v=>{for(let E of v.issues)if(E.code==="invalid_union")E.unionErrors.map(d);else if(E.code==="invalid_return_type")d(E.returnTypeError);else if(E.code==="invalid_arguments")d(E.argumentsError);else if(E.path.length===0)f._errors.push(c(E));else{let A=f,O=0;for(;O<E.path.length;){let M=E.path[O];O===E.path.length-1?(A[M]=A[M]||{_errors:[]},A[M]._errors.push(c(E))):A[M]=A[M]||{_errors:[]},A=A[M],O++}}},"processError");return d(this),f}static assert(s){if(!(s instanceof a))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,of.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(s=c=>c.message){let c={},f=[];for(let d of this.issues)d.path.length>0?(c[d.path[0]]=c[d.path[0]]||[],c[d.path[0]].push(s(d))):f.push(s(d));return{formErrors:f,fieldErrors:c}}get formErrors(){return this.flatten()}};IS.create=a=>new IS(a);var uU=t((a,s)=>{let c;switch(a.code){case As.invalid_type:a.received===Xa.undefined?c="Required":c=`Expected ${a.expected}, received ${a.received}`;break;case As.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(a.expected,of.jsonStringifyReplacer)}`;break;case As.unrecognized_keys:c=`Unrecognized key(s) in object: ${of.joinValues(a.keys,", ")}`;break;case As.invalid_union:c="Invalid input";break;case As.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${of.joinValues(a.options)}`;break;case As.invalid_enum_value:c=`Invalid enum value. Expected ${of.joinValues(a.options)}, received '${a.received}'`;break;case As.invalid_arguments:c="Invalid function arguments";break;case As.invalid_return_type:c="Invalid function return type";break;case As.invalid_date:c="Invalid date";break;case As.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(c=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(c=`${c} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?c=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?c=`Invalid input: must end with "${a.validation.endsWith}"`:of.assertNever(a.validation):a.validation!=="regex"?c=`Invalid ${a.validation}`:c="Invalid";break;case As.too_small:a.type==="array"?c=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?c=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?c=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?c=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:c="Invalid input";break;case As.too_big:a.type==="array"?c=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?c=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?c=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?c=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?c=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:c="Invalid input";break;case As.custom:c="Invalid input";break;case As.invalid_intersection_types:c="Intersection results could not be merged";break;case As.not_multiple_of:c=`Number must be a multiple of ${a.multipleOf}`;break;case As.not_finite:c="Number must be finite";break;default:c=s.defaultError,of.assertNever(a)}return{message:c}},"errorMap"),Dbt=uU;function jTr(a){Dbt=a}t(jTr,"setErrorMap");function Wpe(){return Dbt}t(Wpe,"getErrorMap");var Hpe=t(a=>{let{data:s,path:c,errorMaps:f,issueData:d}=a,v=[...c,...d.path||[]],E={...d,path:v};if(d.message!==void 0)return{...d,path:v,message:d.message};let A="",O=f.filter(M=>!!M).slice().reverse();for(let M of O)A=M(E,{data:s,defaultError:A}).message;return{...d,path:v,message:A}},"makeIssue"),BTr=[];function Ba(a,s){let c=Wpe(),f=Hpe({issueData:s,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,c,c===uU?void 0:uU].filter(d=>!!d)});a.common.issues.push(f)}t(Ba,"addIssueToContext");var u1=class a{static{t(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(s,c){let f=[];for(let d of c){if(d.status==="aborted")return Oc;d.status==="dirty"&&s.dirty(),f.push(d.value)}return{status:s.value,value:f}}static async mergeObjectAsync(s,c){let f=[];for(let d of c){let v=await d.key,E=await d.value;f.push({key:v,value:E})}return a.mergeObjectSync(s,f)}static mergeObjectSync(s,c){let f={};for(let d of c){let{key:v,value:E}=d;if(v.status==="aborted"||E.status==="aborted")return Oc;v.status==="dirty"&&s.dirty(),E.status==="dirty"&&s.dirty(),v.value!=="__proto__"&&(typeof E.value<"u"||d.alwaysSet)&&(f[v.value]=E.value)}return{status:s.value,value:f}}},Oc=Object.freeze({status:"aborted"}),lU=t(a=>({status:"dirty",value:a}),"DIRTY"),Nv=t(a=>({status:"valid",value:a}),"OK"),x5e=t(a=>a.status==="aborted","isAborted"),D5e=t(a=>a.status==="dirty","isDirty"),lY=t(a=>a.status==="valid","isValid"),uY=t(a=>typeof Promise<"u"&&a instanceof Promise,"isAsync");function Gpe(a,s,c,f){if(c==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?a!==s||!f:!s.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?f:c==="a"?f.call(a):f?f.value:s.get(a)}t(Gpe,"__classPrivateFieldGet");function Abt(a,s,c,f,d){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?a!==s||!d:!s.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?d.call(a,c):d?d.value=c:s.set(a,c),c}t(Abt,"__classPrivateFieldSet");var Jo;(function(a){a.errToObj=s=>typeof s=="string"?{message:s}:s||{},a.toString=s=>typeof s=="string"?s:s?.message})(Jo||(Jo={}));var oY,cY,IC=class{static{t(this,"ParseInputLazyPath")}constructor(s,c,f,d){this._cachedPath=[],this.parent=s,this.data=c,this._path=f,this._key=d}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}},Ebt=t((a,s)=>{if(lY(s))return{success:!0,data:s.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 c=new IS(a.common.issues);return this._error=c,this._error}}},"handleResult");function xl(a){if(!a)return{};let{errorMap:s,invalid_type_error:c,required_error:f,description:d}=a;if(s&&(c||f))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return s?{errorMap:s,description:d}:{errorMap:t((E,A)=>{var O,M;let{message:H}=a;return E.code==="invalid_enum_value"?{message:H??A.defaultError}:typeof A.data>"u"?{message:(O=H??f)!==null&&O!==void 0?O:A.defaultError}:E.code!=="invalid_type"?{message:A.defaultError}:{message:(M=H??c)!==null&&M!==void 0?M:A.defaultError}},"customMap"),description:d}}t(xl,"processCreateParams");var Dl=class{static{t(this,"ZodType")}constructor(s){this.spa=this.safeParseAsync,this._def=s,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(s){return WN(s.data)}_getOrReturnCtx(s,c){return c||{common:s.parent.common,data:s.data,parsedType:WN(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}_processInputParams(s){return{status:new u1,ctx:{common:s.parent.common,data:s.data,parsedType:WN(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}}_parseSync(s){let c=this._parse(s);if(uY(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(s){let c=this._parse(s);return Promise.resolve(c)}parse(s,c){let f=this.safeParse(s,c);if(f.success)return f.data;throw f.error}safeParse(s,c){var f;let d={common:{issues:[],async:(f=c?.async)!==null&&f!==void 0?f:!1,contextualErrorMap:c?.errorMap},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:WN(s)},v=this._parseSync({data:s,path:d.path,parent:d});return Ebt(d,v)}async parseAsync(s,c){let f=await this.safeParseAsync(s,c);if(f.success)return f.data;throw f.error}async safeParseAsync(s,c){let f={common:{issues:[],contextualErrorMap:c?.errorMap,async:!0},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:WN(s)},d=this._parse({data:s,path:f.path,parent:f}),v=await(uY(d)?d:Promise.resolve(d));return Ebt(f,v)}refine(s,c){let f=t(d=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(d):c,"getIssueProperties");return this._refinement((d,v)=>{let E=s(d),A=t(()=>v.addIssue({code:As.custom,...f(d)}),"setError");return typeof Promise<"u"&&E instanceof Promise?E.then(O=>O?!0:(A(),!1)):E?!0:(A(),!1)})}refinement(s,c){return this._refinement((f,d)=>s(f)?!0:(d.addIssue(typeof c=="function"?c(f,d):c),!1))}_refinement(s){return new OS({schema:this,typeName:kc.ZodEffects,effect:{type:"refinement",refinement:s}})}superRefine(s){return this._refinement(s)}optional(){return NC.create(this,this._def)}nullable(){return dk.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return x6.create(this,this._def)}promise(){return QN.create(this,this._def)}or(s){return P7.create([this,s],this._def)}and(s){return N7.create(this,s,this._def)}transform(s){return new OS({...xl(this._def),schema:this,typeName:kc.ZodEffects,effect:{type:"transform",transform:s}})}default(s){let c=typeof s=="function"?s:()=>s;return new R7({...xl(this._def),innerType:this,defaultValue:c,typeName:kc.ZodDefault})}brand(){return new fY({typeName:kc.ZodBranded,type:this,...xl(this._def)})}catch(s){let c=typeof s=="function"?s:()=>s;return new M7({...xl(this._def),innerType:this,catchValue:c,typeName:kc.ZodCatch})}describe(s){let c=this.constructor;return new c({...this._def,description:s})}pipe(s){return _Y.create(this,s)}readonly(){return j7.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},UTr=/^c[^\s-]{8,}$/i,$Tr=/^[0-9a-z]+$/,JTr=/^[0-9A-HJKMNP-TV-Z]{26}$/,zTr=/^[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,qTr=/^[a-z0-9_-]{21}$/i,VTr=/^[-+]?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)?)??$/,WTr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,HTr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",C5e,GTr=/^(?:(?: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])$/,QTr=/^(([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})))$/,KTr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kbt="((\\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])))",YTr=new RegExp(`^${kbt}$`);function wbt(a){let s="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?s=`${s}\\.\\d{${a.precision}}`:a.precision==null&&(s=`${s}(\\.\\d+)?`),s}t(wbt,"timeRegexSource");function XTr(a){return new RegExp(`^${wbt(a)}$`)}t(XTr,"timeRegex");function Pbt(a){let s=`${kbt}T${wbt(a)}`,c=[];return c.push(a.local?"Z?":"Z"),a.offset&&c.push("([+-]\\d{2}:?\\d{2})"),s=`${s}(${c.join("|")})`,new RegExp(`^${s}$`)}t(Pbt,"datetimeRegex");function ZTr(a,s){return!!((s==="v4"||!s)&&GTr.test(a)||(s==="v6"||!s)&&QTr.test(a))}t(ZTr,"isValidIP");var HN=class a extends Dl{static{t(this,"ZodString")}_parse(s){if(this._def.coerce&&(s.data=String(s.data)),this._getType(s)!==Xa.string){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.string,received:v.parsedType}),Oc}let f=new u1,d;for(let v of this._def.checks)if(v.kind==="min")s.data.length<v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),f.dirty());else if(v.kind==="max")s.data.length>v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),f.dirty());else if(v.kind==="length"){let E=s.data.length>v.value,A=s.data.length<v.value;(E||A)&&(d=this._getOrReturnCtx(s,d),E?Ba(d,{code:As.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message}):A&&Ba(d,{code:As.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message}),f.dirty())}else if(v.kind==="email")WTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"email",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="emoji")C5e||(C5e=new RegExp(HTr,"u")),C5e.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"emoji",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="uuid")zTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"uuid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="nanoid")qTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"nanoid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="cuid")UTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"cuid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="cuid2")$Tr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"cuid2",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="ulid")JTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"ulid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="url")try{new URL(s.data)}catch{d=this._getOrReturnCtx(s,d),Ba(d,{validation:"url",code:As.invalid_string,message:v.message}),f.dirty()}else v.kind==="regex"?(v.regex.lastIndex=0,v.regex.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"regex",code:As.invalid_string,message:v.message}),f.dirty())):v.kind==="trim"?s.data=s.data.trim():v.kind==="includes"?s.data.includes(v.value,v.position)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{includes:v.value,position:v.position},message:v.message}),f.dirty()):v.kind==="toLowerCase"?s.data=s.data.toLowerCase():v.kind==="toUpperCase"?s.data=s.data.toUpperCase():v.kind==="startsWith"?s.data.startsWith(v.value)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{startsWith:v.value},message:v.message}),f.dirty()):v.kind==="endsWith"?s.data.endsWith(v.value)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{endsWith:v.value},message:v.message}),f.dirty()):v.kind==="datetime"?Pbt(v).test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"datetime",message:v.message}),f.dirty()):v.kind==="date"?YTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"date",message:v.message}),f.dirty()):v.kind==="time"?XTr(v).test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"time",message:v.message}),f.dirty()):v.kind==="duration"?VTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"duration",code:As.invalid_string,message:v.message}),f.dirty()):v.kind==="ip"?ZTr(s.data,v.version)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"ip",code:As.invalid_string,message:v.message}),f.dirty()):v.kind==="base64"?KTr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"base64",code:As.invalid_string,message:v.message}),f.dirty()):of.assertNever(v);return{status:f.value,value:s.data}}_regex(s,c,f){return this.refinement(d=>s.test(d),{validation:c,code:As.invalid_string,...Jo.errToObj(f)})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}email(s){return this._addCheck({kind:"email",...Jo.errToObj(s)})}url(s){return this._addCheck({kind:"url",...Jo.errToObj(s)})}emoji(s){return this._addCheck({kind:"emoji",...Jo.errToObj(s)})}uuid(s){return this._addCheck({kind:"uuid",...Jo.errToObj(s)})}nanoid(s){return this._addCheck({kind:"nanoid",...Jo.errToObj(s)})}cuid(s){return this._addCheck({kind:"cuid",...Jo.errToObj(s)})}cuid2(s){return this._addCheck({kind:"cuid2",...Jo.errToObj(s)})}ulid(s){return this._addCheck({kind:"ulid",...Jo.errToObj(s)})}base64(s){return this._addCheck({kind:"base64",...Jo.errToObj(s)})}ip(s){return this._addCheck({kind:"ip",...Jo.errToObj(s)})}datetime(s){var c,f;return typeof s=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:s}):this._addCheck({kind:"datetime",precision:typeof s?.precision>"u"?null:s?.precision,offset:(c=s?.offset)!==null&&c!==void 0?c:!1,local:(f=s?.local)!==null&&f!==void 0?f:!1,...Jo.errToObj(s?.message)})}date(s){return this._addCheck({kind:"date",message:s})}time(s){return typeof s=="string"?this._addCheck({kind:"time",precision:null,message:s}):this._addCheck({kind:"time",precision:typeof s?.precision>"u"?null:s?.precision,...Jo.errToObj(s?.message)})}duration(s){return this._addCheck({kind:"duration",...Jo.errToObj(s)})}regex(s,c){return this._addCheck({kind:"regex",regex:s,...Jo.errToObj(c)})}includes(s,c){return this._addCheck({kind:"includes",value:s,position:c?.position,...Jo.errToObj(c?.message)})}startsWith(s,c){return this._addCheck({kind:"startsWith",value:s,...Jo.errToObj(c)})}endsWith(s,c){return this._addCheck({kind:"endsWith",value:s,...Jo.errToObj(c)})}min(s,c){return this._addCheck({kind:"min",value:s,...Jo.errToObj(c)})}max(s,c){return this._addCheck({kind:"max",value:s,...Jo.errToObj(c)})}length(s,c){return this._addCheck({kind:"length",value:s,...Jo.errToObj(c)})}nonempty(s){return this.min(1,Jo.errToObj(s))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(s=>s.kind==="datetime")}get isDate(){return!!this._def.checks.find(s=>s.kind==="date")}get isTime(){return!!this._def.checks.find(s=>s.kind==="time")}get isDuration(){return!!this._def.checks.find(s=>s.kind==="duration")}get isEmail(){return!!this._def.checks.find(s=>s.kind==="email")}get isURL(){return!!this._def.checks.find(s=>s.kind==="url")}get isEmoji(){return!!this._def.checks.find(s=>s.kind==="emoji")}get isUUID(){return!!this._def.checks.find(s=>s.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(s=>s.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(s=>s.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(s=>s.kind==="cuid2")}get isULID(){return!!this._def.checks.find(s=>s.kind==="ulid")}get isIP(){return!!this._def.checks.find(s=>s.kind==="ip")}get isBase64(){return!!this._def.checks.find(s=>s.kind==="base64")}get minLength(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxLength(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}};HN.create=a=>{var s;return new HN({checks:[],typeName:kc.ZodString,coerce:(s=a?.coerce)!==null&&s!==void 0?s:!1,...xl(a)})};function eCr(a,s){let c=(a.toString().split(".")[1]||"").length,f=(s.toString().split(".")[1]||"").length,d=c>f?c:f,v=parseInt(a.toFixed(d).replace(".","")),E=parseInt(s.toFixed(d).replace(".",""));return v%E/Math.pow(10,d)}t(eCr,"floatSafeRemainder");var E7=class a extends Dl{static{t(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(s){if(this._def.coerce&&(s.data=Number(s.data)),this._getType(s)!==Xa.number){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.number,received:v.parsedType}),Oc}let f,d=new u1;for(let v of this._def.checks)v.kind==="int"?of.isInteger(s.data)||(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.invalid_type,expected:"integer",received:"float",message:v.message}),d.dirty()):v.kind==="min"?(v.inclusive?s.data<v.value:s.data<=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),d.dirty()):v.kind==="max"?(v.inclusive?s.data>v.value:s.data>=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),d.dirty()):v.kind==="multipleOf"?eCr(s.data,v.value)!==0&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_multiple_of,multipleOf:v.value,message:v.message}),d.dirty()):v.kind==="finite"?Number.isFinite(s.data)||(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_finite,message:v.message}),d.dirty()):of.assertNever(v);return{status:d.value,value:s.data}}gte(s,c){return this.setLimit("min",s,!0,Jo.toString(c))}gt(s,c){return this.setLimit("min",s,!1,Jo.toString(c))}lte(s,c){return this.setLimit("max",s,!0,Jo.toString(c))}lt(s,c){return this.setLimit("max",s,!1,Jo.toString(c))}setLimit(s,c,f,d){return new a({...this._def,checks:[...this._def.checks,{kind:s,value:c,inclusive:f,message:Jo.toString(d)}]})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}int(s){return this._addCheck({kind:"int",message:Jo.toString(s)})}positive(s){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jo.toString(s)})}negative(s){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jo.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jo.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jo.toString(s)})}multipleOf(s,c){return this._addCheck({kind:"multipleOf",value:s,message:Jo.toString(c)})}finite(s){return this._addCheck({kind:"finite",message:Jo.toString(s)})}safe(s){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jo.toString(s)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jo.toString(s)})}get minValue(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxValue(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}get isInt(){return!!this._def.checks.find(s=>s.kind==="int"||s.kind==="multipleOf"&&of.isInteger(s.value))}get isFinite(){let s=null,c=null;for(let f of this._def.checks){if(f.kind==="finite"||f.kind==="int"||f.kind==="multipleOf")return!0;f.kind==="min"?(c===null||f.value>c)&&(c=f.value):f.kind==="max"&&(s===null||f.value<s)&&(s=f.value)}return Number.isFinite(c)&&Number.isFinite(s)}};E7.create=a=>new E7({checks:[],typeName:kc.ZodNumber,coerce:a?.coerce||!1,...xl(a)});var x7=class a extends Dl{static{t(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(s){if(this._def.coerce&&(s.data=BigInt(s.data)),this._getType(s)!==Xa.bigint){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.bigint,received:v.parsedType}),Oc}let f,d=new u1;for(let v of this._def.checks)v.kind==="min"?(v.inclusive?s.data<v.value:s.data<=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),d.dirty()):v.kind==="max"?(v.inclusive?s.data>v.value:s.data>=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),d.dirty()):v.kind==="multipleOf"?s.data%v.value!==BigInt(0)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_multiple_of,multipleOf:v.value,message:v.message}),d.dirty()):of.assertNever(v);return{status:d.value,value:s.data}}gte(s,c){return this.setLimit("min",s,!0,Jo.toString(c))}gt(s,c){return this.setLimit("min",s,!1,Jo.toString(c))}lte(s,c){return this.setLimit("max",s,!0,Jo.toString(c))}lt(s,c){return this.setLimit("max",s,!1,Jo.toString(c))}setLimit(s,c,f,d){return new a({...this._def,checks:[...this._def.checks,{kind:s,value:c,inclusive:f,message:Jo.toString(d)}]})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}positive(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Jo.toString(s)})}negative(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jo.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jo.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jo.toString(s)})}multipleOf(s,c){return this._addCheck({kind:"multipleOf",value:s,message:Jo.toString(c)})}get minValue(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxValue(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}};x7.create=a=>{var s;return new x7({checks:[],typeName:kc.ZodBigInt,coerce:(s=a?.coerce)!==null&&s!==void 0?s:!1,...xl(a)})};var D7=class extends Dl{static{t(this,"ZodBoolean")}_parse(s){if(this._def.coerce&&(s.data=!!s.data),this._getType(s)!==Xa.boolean){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.boolean,received:f.parsedType}),Oc}return Nv(s.data)}};D7.create=a=>new D7({typeName:kc.ZodBoolean,coerce:a?.coerce||!1,...xl(a)});var A7=class a extends Dl{static{t(this,"ZodDate")}_parse(s){if(this._def.coerce&&(s.data=new Date(s.data)),this._getType(s)!==Xa.date){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.date,received:v.parsedType}),Oc}if(isNaN(s.data.getTime())){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_date}),Oc}let f=new u1,d;for(let v of this._def.checks)v.kind==="min"?s.data.getTime()<v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_small,message:v.message,inclusive:!0,exact:!1,minimum:v.value,type:"date"}),f.dirty()):v.kind==="max"?s.data.getTime()>v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),f.dirty()):of.assertNever(v);return{status:f.value,value:new Date(s.data.getTime())}}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}min(s,c){return this._addCheck({kind:"min",value:s.getTime(),message:Jo.toString(c)})}max(s,c){return this._addCheck({kind:"max",value:s.getTime(),message:Jo.toString(c)})}get minDate(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s!=null?new Date(s):null}get maxDate(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s!=null?new Date(s):null}};A7.create=a=>new A7({checks:[],coerce:a?.coerce||!1,typeName:kc.ZodDate,...xl(a)});var fU=class extends Dl{static{t(this,"ZodSymbol")}_parse(s){if(this._getType(s)!==Xa.symbol){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.symbol,received:f.parsedType}),Oc}return Nv(s.data)}};fU.create=a=>new fU({typeName:kc.ZodSymbol,...xl(a)});var k7=class extends Dl{static{t(this,"ZodUndefined")}_parse(s){if(this._getType(s)!==Xa.undefined){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.undefined,received:f.parsedType}),Oc}return Nv(s.data)}};k7.create=a=>new k7({typeName:kc.ZodUndefined,...xl(a)});var w7=class extends Dl{static{t(this,"ZodNull")}_parse(s){if(this._getType(s)!==Xa.null){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.null,received:f.parsedType}),Oc}return Nv(s.data)}};w7.create=a=>new w7({typeName:kc.ZodNull,...xl(a)});var GN=class extends Dl{static{t(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(s){return Nv(s.data)}};GN.create=a=>new GN({typeName:kc.ZodAny,...xl(a)});var E6=class extends Dl{static{t(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(s){return Nv(s.data)}};E6.create=a=>new E6({typeName:kc.ZodUnknown,...xl(a)});var qx=class extends Dl{static{t(this,"ZodNever")}_parse(s){let c=this._getOrReturnCtx(s);return Ba(c,{code:As.invalid_type,expected:Xa.never,received:c.parsedType}),Oc}};qx.create=a=>new qx({typeName:kc.ZodNever,...xl(a)});var _U=class extends Dl{static{t(this,"ZodVoid")}_parse(s){if(this._getType(s)!==Xa.undefined){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.void,received:f.parsedType}),Oc}return Nv(s.data)}};_U.create=a=>new _U({typeName:kc.ZodVoid,...xl(a)});var x6=class a extends Dl{static{t(this,"ZodArray")}_parse(s){let{ctx:c,status:f}=this._processInputParams(s),d=this._def;if(c.parsedType!==Xa.array)return Ba(c,{code:As.invalid_type,expected:Xa.array,received:c.parsedType}),Oc;if(d.exactLength!==null){let E=c.data.length>d.exactLength.value,A=c.data.length<d.exactLength.value;(E||A)&&(Ba(c,{code:E?As.too_big:As.too_small,minimum:A?d.exactLength.value:void 0,maximum:E?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),f.dirty())}if(d.minLength!==null&&c.data.length<d.minLength.value&&(Ba(c,{code:As.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),f.dirty()),d.maxLength!==null&&c.data.length>d.maxLength.value&&(Ba(c,{code:As.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),f.dirty()),c.common.async)return Promise.all([...c.data].map((E,A)=>d.type._parseAsync(new IC(c,E,c.path,A)))).then(E=>u1.mergeArray(f,E));let v=[...c.data].map((E,A)=>d.type._parseSync(new IC(c,E,c.path,A)));return u1.mergeArray(f,v)}get element(){return this._def.type}min(s,c){return new a({...this._def,minLength:{value:s,message:Jo.toString(c)}})}max(s,c){return new a({...this._def,maxLength:{value:s,message:Jo.toString(c)}})}length(s,c){return new a({...this._def,exactLength:{value:s,message:Jo.toString(c)}})}nonempty(s){return this.min(1,s)}};x6.create=(a,s)=>new x6({type:a,minLength:null,maxLength:null,exactLength:null,typeName:kc.ZodArray,...xl(s)});function cU(a){if(a instanceof Qb){let s={};for(let c in a.shape){let f=a.shape[c];s[c]=NC.create(cU(f))}return new Qb({...a._def,shape:t(()=>s,"shape")})}else return a instanceof x6?new x6({...a._def,type:cU(a.element)}):a instanceof NC?NC.create(cU(a.unwrap())):a instanceof dk?dk.create(cU(a.unwrap())):a instanceof pk?pk.create(a.items.map(s=>cU(s))):a}t(cU,"deepPartialify");var Qb=class a extends Dl{static{t(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let s=this._def.shape(),c=of.objectKeys(s);return this._cached={shape:s,keys:c}}_parse(s){if(this._getType(s)!==Xa.object){let M=this._getOrReturnCtx(s);return Ba(M,{code:As.invalid_type,expected:Xa.object,received:M.parsedType}),Oc}let{status:f,ctx:d}=this._processInputParams(s),{shape:v,keys:E}=this._getCached(),A=[];if(!(this._def.catchall instanceof qx&&this._def.unknownKeys==="strip"))for(let M in d.data)E.includes(M)||A.push(M);let O=[];for(let M of E){let H=v[M],$=d.data[M];O.push({key:{status:"valid",value:M},value:H._parse(new IC(d,$,d.path,M)),alwaysSet:M in d.data})}if(this._def.catchall instanceof qx){let M=this._def.unknownKeys;if(M==="passthrough")for(let H of A)O.push({key:{status:"valid",value:H},value:{status:"valid",value:d.data[H]}});else if(M==="strict")A.length>0&&(Ba(d,{code:As.unrecognized_keys,keys:A}),f.dirty());else if(M!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let M=this._def.catchall;for(let H of A){let $=d.data[H];O.push({key:{status:"valid",value:H},value:M._parse(new IC(d,$,d.path,H)),alwaysSet:H in d.data})}}return d.common.async?Promise.resolve().then(async()=>{let M=[];for(let H of O){let $=await H.key,K=await H.value;M.push({key:$,value:K,alwaysSet:H.alwaysSet})}return M}).then(M=>u1.mergeObjectSync(f,M)):u1.mergeObjectSync(f,O)}get shape(){return this._def.shape()}strict(s){return Jo.errToObj,new a({...this._def,unknownKeys:"strict",...s!==void 0?{errorMap:t((c,f)=>{var d,v,E,A;let O=(E=(v=(d=this._def).errorMap)===null||v===void 0?void 0:v.call(d,c,f).message)!==null&&E!==void 0?E:f.defaultError;return c.code==="unrecognized_keys"?{message:(A=Jo.errToObj(s).message)!==null&&A!==void 0?A:O}:{message:O}},"errorMap")}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(s){return new a({...this._def,shape:t(()=>({...this._def.shape(),...s}),"shape")})}merge(s){return new a({unknownKeys:s._def.unknownKeys,catchall:s._def.catchall,shape:t(()=>({...this._def.shape(),...s._def.shape()}),"shape"),typeName:kc.ZodObject})}setKey(s,c){return this.augment({[s]:c})}catchall(s){return new a({...this._def,catchall:s})}pick(s){let c={};return of.objectKeys(s).forEach(f=>{s[f]&&this.shape[f]&&(c[f]=this.shape[f])}),new a({...this._def,shape:t(()=>c,"shape")})}omit(s){let c={};return of.objectKeys(this.shape).forEach(f=>{s[f]||(c[f]=this.shape[f])}),new a({...this._def,shape:t(()=>c,"shape")})}deepPartial(){return cU(this)}partial(s){let c={};return of.objectKeys(this.shape).forEach(f=>{let d=this.shape[f];s&&!s[f]?c[f]=d:c[f]=d.optional()}),new a({...this._def,shape:t(()=>c,"shape")})}required(s){let c={};return of.objectKeys(this.shape).forEach(f=>{if(s&&!s[f])c[f]=this.shape[f];else{let v=this.shape[f];for(;v instanceof NC;)v=v._def.innerType;c[f]=v}}),new a({...this._def,shape:t(()=>c,"shape")})}keyof(){return Nbt(of.objectKeys(this.shape))}};Qb.create=(a,s)=>new Qb({shape:t(()=>a,"shape"),unknownKeys:"strip",catchall:qx.create(),typeName:kc.ZodObject,...xl(s)});Qb.strictCreate=(a,s)=>new Qb({shape:t(()=>a,"shape"),unknownKeys:"strict",catchall:qx.create(),typeName:kc.ZodObject,...xl(s)});Qb.lazycreate=(a,s)=>new Qb({shape:a,unknownKeys:"strip",catchall:qx.create(),typeName:kc.ZodObject,...xl(s)});var P7=class extends Dl{static{t(this,"ZodUnion")}_parse(s){let{ctx:c}=this._processInputParams(s),f=this._def.options;function d(v){for(let A of v)if(A.result.status==="valid")return A.result;for(let A of v)if(A.result.status==="dirty")return c.common.issues.push(...A.ctx.common.issues),A.result;let E=v.map(A=>new IS(A.ctx.common.issues));return Ba(c,{code:As.invalid_union,unionErrors:E}),Oc}if(t(d,"handleResults"),c.common.async)return Promise.all(f.map(async v=>{let E={...c,common:{...c.common,issues:[]},parent:null};return{result:await v._parseAsync({data:c.data,path:c.path,parent:E}),ctx:E}})).then(d);{let v,E=[];for(let O of f){let M={...c,common:{...c.common,issues:[]},parent:null},H=O._parseSync({data:c.data,path:c.path,parent:M});if(H.status==="valid")return H;H.status==="dirty"&&!v&&(v={result:H,ctx:M}),M.common.issues.length&&E.push(M.common.issues)}if(v)return c.common.issues.push(...v.ctx.common.issues),v.result;let A=E.map(O=>new IS(O));return Ba(c,{code:As.invalid_union,unionErrors:A}),Oc}}get options(){return this._def.options}};P7.create=(a,s)=>new P7({options:a,typeName:kc.ZodUnion,...xl(s)});var C6=t(a=>a instanceof I7?C6(a.schema):a instanceof OS?C6(a.innerType()):a instanceof O7?[a.value]:a instanceof F7?a.options:a instanceof L7?of.objectValues(a.enum):a instanceof R7?C6(a._def.innerType):a instanceof k7?[void 0]:a instanceof w7?[null]:a instanceof NC?[void 0,...C6(a.unwrap())]:a instanceof dk?[null,...C6(a.unwrap())]:a instanceof fY||a instanceof j7?C6(a.unwrap()):a instanceof M7?C6(a._def.innerType):[],"getDiscriminator"),Qpe=class a extends Dl{static{t(this,"ZodDiscriminatedUnion")}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.object)return Ba(c,{code:As.invalid_type,expected:Xa.object,received:c.parsedType}),Oc;let f=this.discriminator,d=c.data[f],v=this.optionsMap.get(d);return v?c.common.async?v._parseAsync({data:c.data,path:c.path,parent:c}):v._parseSync({data:c.data,path:c.path,parent:c}):(Ba(c,{code:As.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[f]}),Oc)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(s,c,f){let d=new Map;for(let v of c){let E=C6(v.shape[s]);if(!E.length)throw new Error(`A discriminator value for key \`${s}\` could not be extracted from all schema options`);for(let A of E){if(d.has(A))throw new Error(`Discriminator property ${String(s)} has duplicate value ${String(A)}`);d.set(A,v)}}return new a({typeName:kc.ZodDiscriminatedUnion,discriminator:s,options:c,optionsMap:d,...xl(f)})}};function A5e(a,s){let c=WN(a),f=WN(s);if(a===s)return{valid:!0,data:a};if(c===Xa.object&&f===Xa.object){let d=of.objectKeys(s),v=of.objectKeys(a).filter(A=>d.indexOf(A)!==-1),E={...a,...s};for(let A of v){let O=A5e(a[A],s[A]);if(!O.valid)return{valid:!1};E[A]=O.data}return{valid:!0,data:E}}else if(c===Xa.array&&f===Xa.array){if(a.length!==s.length)return{valid:!1};let d=[];for(let v=0;v<a.length;v++){let E=a[v],A=s[v],O=A5e(E,A);if(!O.valid)return{valid:!1};d.push(O.data)}return{valid:!0,data:d}}else return c===Xa.date&&f===Xa.date&&+a==+s?{valid:!0,data:a}:{valid:!1}}t(A5e,"mergeValues");var N7=class extends Dl{static{t(this,"ZodIntersection")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s),d=t((v,E)=>{if(x5e(v)||x5e(E))return Oc;let A=A5e(v.value,E.value);return A.valid?((D5e(v)||D5e(E))&&c.dirty(),{status:c.value,value:A.data}):(Ba(f,{code:As.invalid_intersection_types}),Oc)},"handleParsed");return f.common.async?Promise.all([this._def.left._parseAsync({data:f.data,path:f.path,parent:f}),this._def.right._parseAsync({data:f.data,path:f.path,parent:f})]).then(([v,E])=>d(v,E)):d(this._def.left._parseSync({data:f.data,path:f.path,parent:f}),this._def.right._parseSync({data:f.data,path:f.path,parent:f}))}};N7.create=(a,s,c)=>new N7({left:a,right:s,typeName:kc.ZodIntersection,...xl(c)});var pk=class a extends Dl{static{t(this,"ZodTuple")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.array)return Ba(f,{code:As.invalid_type,expected:Xa.array,received:f.parsedType}),Oc;if(f.data.length<this._def.items.length)return Ba(f,{code:As.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oc;!this._def.rest&&f.data.length>this._def.items.length&&(Ba(f,{code:As.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());let v=[...f.data].map((E,A)=>{let O=this._def.items[A]||this._def.rest;return O?O._parse(new IC(f,E,f.path,A)):null}).filter(E=>!!E);return f.common.async?Promise.all(v).then(E=>u1.mergeArray(c,E)):u1.mergeArray(c,v)}get items(){return this._def.items}rest(s){return new a({...this._def,rest:s})}};pk.create=(a,s)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pk({items:a,typeName:kc.ZodTuple,rest:null,...xl(s)})};var Kpe=class a extends Dl{static{t(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.object)return Ba(f,{code:As.invalid_type,expected:Xa.object,received:f.parsedType}),Oc;let d=[],v=this._def.keyType,E=this._def.valueType;for(let A in f.data)d.push({key:v._parse(new IC(f,A,f.path,A)),value:E._parse(new IC(f,f.data[A],f.path,A)),alwaysSet:A in f.data});return f.common.async?u1.mergeObjectAsync(c,d):u1.mergeObjectSync(c,d)}get element(){return this._def.valueType}static create(s,c,f){return c instanceof Dl?new a({keyType:s,valueType:c,typeName:kc.ZodRecord,...xl(f)}):new a({keyType:HN.create(),valueType:s,typeName:kc.ZodRecord,...xl(c)})}},pU=class extends Dl{static{t(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.map)return Ba(f,{code:As.invalid_type,expected:Xa.map,received:f.parsedType}),Oc;let d=this._def.keyType,v=this._def.valueType,E=[...f.data.entries()].map(([A,O],M)=>({key:d._parse(new IC(f,A,f.path,[M,"key"])),value:v._parse(new IC(f,O,f.path,[M,"value"]))}));if(f.common.async){let A=new Map;return Promise.resolve().then(async()=>{for(let O of E){let M=await O.key,H=await O.value;if(M.status==="aborted"||H.status==="aborted")return Oc;(M.status==="dirty"||H.status==="dirty")&&c.dirty(),A.set(M.value,H.value)}return{status:c.value,value:A}})}else{let A=new Map;for(let O of E){let M=O.key,H=O.value;if(M.status==="aborted"||H.status==="aborted")return Oc;(M.status==="dirty"||H.status==="dirty")&&c.dirty(),A.set(M.value,H.value)}return{status:c.value,value:A}}}};pU.create=(a,s,c)=>new pU({valueType:s,keyType:a,typeName:kc.ZodMap,...xl(c)});var dU=class a extends Dl{static{t(this,"ZodSet")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.set)return Ba(f,{code:As.invalid_type,expected:Xa.set,received:f.parsedType}),Oc;let d=this._def;d.minSize!==null&&f.data.size<d.minSize.value&&(Ba(f,{code:As.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),c.dirty()),d.maxSize!==null&&f.data.size>d.maxSize.value&&(Ba(f,{code:As.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),c.dirty());let v=this._def.valueType;function E(O){let M=new Set;for(let H of O){if(H.status==="aborted")return Oc;H.status==="dirty"&&c.dirty(),M.add(H.value)}return{status:c.value,value:M}}t(E,"finalizeSet");let A=[...f.data.values()].map((O,M)=>v._parse(new IC(f,O,f.path,M)));return f.common.async?Promise.all(A).then(O=>E(O)):E(A)}min(s,c){return new a({...this._def,minSize:{value:s,message:Jo.toString(c)}})}max(s,c){return new a({...this._def,maxSize:{value:s,message:Jo.toString(c)}})}size(s,c){return this.min(s,c).max(s,c)}nonempty(s){return this.min(1,s)}};dU.create=(a,s)=>new dU({valueType:a,minSize:null,maxSize:null,typeName:kc.ZodSet,...xl(s)});var Ype=class a extends Dl{static{t(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.function)return Ba(c,{code:As.invalid_type,expected:Xa.function,received:c.parsedType}),Oc;function f(A,O){return Hpe({data:A,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wpe(),uU].filter(M=>!!M),issueData:{code:As.invalid_arguments,argumentsError:O}})}t(f,"makeArgsIssue");function d(A,O){return Hpe({data:A,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wpe(),uU].filter(M=>!!M),issueData:{code:As.invalid_return_type,returnTypeError:O}})}t(d,"makeReturnsIssue");let v={errorMap:c.common.contextualErrorMap},E=c.data;if(this._def.returns instanceof QN){let A=this;return Nv(async function(...O){let M=new IS([]),H=await A._def.args.parseAsync(O,v).catch(Ne=>{throw M.addIssue(f(O,Ne)),M}),$=await Reflect.apply(E,this,H);return await A._def.returns._def.type.parseAsync($,v).catch(Ne=>{throw M.addIssue(d($,Ne)),M})})}else{let A=this;return Nv(function(...O){let M=A._def.args.safeParse(O,v);if(!M.success)throw new IS([f(O,M.error)]);let H=Reflect.apply(E,this,M.data),$=A._def.returns.safeParse(H,v);if(!$.success)throw new IS([d(H,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...s){return new a({...this._def,args:pk.create(s).rest(E6.create())})}returns(s){return new a({...this._def,returns:s})}implement(s){return this.parse(s)}strictImplement(s){return this.parse(s)}static create(s,c,f){return new a({args:s||pk.create([]).rest(E6.create()),returns:c||E6.create(),typeName:kc.ZodFunction,...xl(f)})}},I7=class extends Dl{static{t(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(s){let{ctx:c}=this._processInputParams(s);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}};I7.create=(a,s)=>new I7({getter:a,typeName:kc.ZodLazy,...xl(s)});var O7=class extends Dl{static{t(this,"ZodLiteral")}_parse(s){if(s.data!==this._def.value){let c=this._getOrReturnCtx(s);return Ba(c,{received:c.data,code:As.invalid_literal,expected:this._def.value}),Oc}return{status:"valid",value:s.data}}get value(){return this._def.value}};O7.create=(a,s)=>new O7({value:a,typeName:kc.ZodLiteral,...xl(s)});function Nbt(a,s){return new F7({values:a,typeName:kc.ZodEnum,...xl(s)})}t(Nbt,"createZodEnum");var F7=class a extends Dl{static{t(this,"ZodEnum")}constructor(){super(...arguments),oY.set(this,void 0)}_parse(s){if(typeof s.data!="string"){let c=this._getOrReturnCtx(s),f=this._def.values;return Ba(c,{expected:of.joinValues(f),received:c.parsedType,code:As.invalid_type}),Oc}if(Gpe(this,oY,"f")||Abt(this,oY,new Set(this._def.values),"f"),!Gpe(this,oY,"f").has(s.data)){let c=this._getOrReturnCtx(s),f=this._def.values;return Ba(c,{received:c.data,code:As.invalid_enum_value,options:f}),Oc}return Nv(s.data)}get options(){return this._def.values}get enum(){let s={};for(let c of this._def.values)s[c]=c;return s}get Values(){let s={};for(let c of this._def.values)s[c]=c;return s}get Enum(){let s={};for(let c of this._def.values)s[c]=c;return s}extract(s,c=this._def){return a.create(s,{...this._def,...c})}exclude(s,c=this._def){return a.create(this.options.filter(f=>!s.includes(f)),{...this._def,...c})}};oY=new WeakMap;F7.create=Nbt;var L7=class extends Dl{static{t(this,"ZodNativeEnum")}constructor(){super(...arguments),cY.set(this,void 0)}_parse(s){let c=of.getValidEnumValues(this._def.values),f=this._getOrReturnCtx(s);if(f.parsedType!==Xa.string&&f.parsedType!==Xa.number){let d=of.objectValues(c);return Ba(f,{expected:of.joinValues(d),received:f.parsedType,code:As.invalid_type}),Oc}if(Gpe(this,cY,"f")||Abt(this,cY,new Set(of.getValidEnumValues(this._def.values)),"f"),!Gpe(this,cY,"f").has(s.data)){let d=of.objectValues(c);return Ba(f,{received:f.data,code:As.invalid_enum_value,options:d}),Oc}return Nv(s.data)}get enum(){return this._def.values}};cY=new WeakMap;L7.create=(a,s)=>new L7({values:a,typeName:kc.ZodNativeEnum,...xl(s)});var QN=class extends Dl{static{t(this,"ZodPromise")}unwrap(){return this._def.type}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.promise&&c.common.async===!1)return Ba(c,{code:As.invalid_type,expected:Xa.promise,received:c.parsedType}),Oc;let f=c.parsedType===Xa.promise?c.data:Promise.resolve(c.data);return Nv(f.then(d=>this._def.type.parseAsync(d,{path:c.path,errorMap:c.common.contextualErrorMap})))}};QN.create=(a,s)=>new QN({type:a,typeName:kc.ZodPromise,...xl(s)});var OS=class extends Dl{static{t(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===kc.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(s){let{status:c,ctx:f}=this._processInputParams(s),d=this._def.effect||null,v={addIssue:t(E=>{Ba(f,E),E.fatal?c.abort():c.dirty()},"addIssue"),get path(){return f.path}};if(v.addIssue=v.addIssue.bind(v),d.type==="preprocess"){let E=d.transform(f.data,v);if(f.common.async)return Promise.resolve(E).then(async A=>{if(c.value==="aborted")return Oc;let O=await this._def.schema._parseAsync({data:A,path:f.path,parent:f});return O.status==="aborted"?Oc:O.status==="dirty"||c.value==="dirty"?lU(O.value):O});{if(c.value==="aborted")return Oc;let A=this._def.schema._parseSync({data:E,path:f.path,parent:f});return A.status==="aborted"?Oc:A.status==="dirty"||c.value==="dirty"?lU(A.value):A}}if(d.type==="refinement"){let E=t(A=>{let O=d.refinement(A,v);if(f.common.async)return Promise.resolve(O);if(O instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return A},"executeRefinement");if(f.common.async===!1){let A=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});return A.status==="aborted"?Oc:(A.status==="dirty"&&c.dirty(),E(A.value),{status:c.value,value:A.value})}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(A=>A.status==="aborted"?Oc:(A.status==="dirty"&&c.dirty(),E(A.value).then(()=>({status:c.value,value:A.value}))))}if(d.type==="transform")if(f.common.async===!1){let E=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(!lY(E))return E;let A=d.transform(E.value,v);if(A instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:A}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(E=>lY(E)?Promise.resolve(d.transform(E.value,v)).then(A=>({status:c.value,value:A})):E);of.assertNever(d)}};OS.create=(a,s,c)=>new OS({schema:a,typeName:kc.ZodEffects,effect:s,...xl(c)});OS.createWithPreprocess=(a,s,c)=>new OS({schema:s,effect:{type:"preprocess",transform:a},typeName:kc.ZodEffects,...xl(c)});var NC=class extends Dl{static{t(this,"ZodOptional")}_parse(s){return this._getType(s)===Xa.undefined?Nv(void 0):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}};NC.create=(a,s)=>new NC({innerType:a,typeName:kc.ZodOptional,...xl(s)});var dk=class extends Dl{static{t(this,"ZodNullable")}_parse(s){return this._getType(s)===Xa.null?Nv(null):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}};dk.create=(a,s)=>new dk({innerType:a,typeName:kc.ZodNullable,...xl(s)});var R7=class extends Dl{static{t(this,"ZodDefault")}_parse(s){let{ctx:c}=this._processInputParams(s),f=c.data;return c.parsedType===Xa.undefined&&(f=this._def.defaultValue()),this._def.innerType._parse({data:f,path:c.path,parent:c})}removeDefault(){return this._def.innerType}};R7.create=(a,s)=>new R7({innerType:a,typeName:kc.ZodDefault,defaultValue:typeof s.default=="function"?s.default:()=>s.default,...xl(s)});var M7=class extends Dl{static{t(this,"ZodCatch")}_parse(s){let{ctx:c}=this._processInputParams(s),f={...c,common:{...c.common,issues:[]}},d=this._def.innerType._parse({data:f.data,path:f.path,parent:{...f}});return uY(d)?d.then(v=>({status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new IS(f.common.issues)},input:f.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new IS(f.common.issues)},input:f.data})}}removeCatch(){return this._def.innerType}};M7.create=(a,s)=>new M7({innerType:a,typeName:kc.ZodCatch,catchValue:typeof s.catch=="function"?s.catch:()=>s.catch,...xl(s)});var mU=class extends Dl{static{t(this,"ZodNaN")}_parse(s){if(this._getType(s)!==Xa.nan){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.nan,received:f.parsedType}),Oc}return{status:"valid",value:s.data}}};mU.create=a=>new mU({typeName:kc.ZodNaN,...xl(a)});var tCr=Symbol("zod_brand"),fY=class extends Dl{static{t(this,"ZodBranded")}_parse(s){let{ctx:c}=this._processInputParams(s),f=c.data;return this._def.type._parse({data:f,path:c.path,parent:c})}unwrap(){return this._def.type}},_Y=class a extends Dl{static{t(this,"ZodPipeline")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.common.async)return t(async()=>{let v=await this._def.in._parseAsync({data:f.data,path:f.path,parent:f});return v.status==="aborted"?Oc:v.status==="dirty"?(c.dirty(),lU(v.value)):this._def.out._parseAsync({data:v.value,path:f.path,parent:f})},"handleAsync")();{let d=this._def.in._parseSync({data:f.data,path:f.path,parent:f});return d.status==="aborted"?Oc:d.status==="dirty"?(c.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:f.path,parent:f})}}static create(s,c){return new a({in:s,out:c,typeName:kc.ZodPipeline})}},j7=class extends Dl{static{t(this,"ZodReadonly")}_parse(s){let c=this._def.innerType._parse(s),f=t(d=>(lY(d)&&(d.value=Object.freeze(d.value)),d),"freeze");return uY(c)?c.then(d=>f(d)):f(c)}unwrap(){return this._def.innerType}};j7.create=(a,s)=>new j7({innerType:a,typeName:kc.ZodReadonly,...xl(s)});function Ibt(a,s={},c){return a?GN.create().superRefine((f,d)=>{var v,E;if(!a(f)){let A=typeof s=="function"?s(f):typeof s=="string"?{message:s}:s,O=(E=(v=A.fatal)!==null&&v!==void 0?v:c)!==null&&E!==void 0?E:!0,M=typeof A=="string"?{message:A}:A;d.addIssue({code:"custom",...M,fatal:O})}}):GN.create()}t(Ibt,"custom");var rCr={object:Qb.lazycreate},kc;(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"})(kc||(kc={}));var nCr=t((a,s={message:`Input not instance of ${a.name}`})=>Ibt(c=>c instanceof a,s),"instanceOfType"),Obt=HN.create,Fbt=E7.create,iCr=mU.create,sCr=x7.create,Lbt=D7.create,aCr=A7.create,oCr=fU.create,cCr=k7.create,lCr=w7.create,uCr=GN.create,fCr=E6.create,_Cr=qx.create,pCr=_U.create,dCr=x6.create,mCr=Qb.create,hCr=Qb.strictCreate,gCr=P7.create,yCr=Qpe.create,vCr=N7.create,bCr=pk.create,SCr=Kpe.create,TCr=pU.create,CCr=dU.create,ECr=Ype.create,xCr=I7.create,DCr=O7.create,ACr=F7.create,kCr=L7.create,wCr=QN.create,xbt=OS.create,PCr=NC.create,NCr=dk.create,ICr=OS.createWithPreprocess,OCr=_Y.create,FCr=t(()=>Obt().optional(),"ostring"),LCr=t(()=>Fbt().optional(),"onumber"),RCr=t(()=>Lbt().optional(),"oboolean"),MCr={string:t(a=>HN.create({...a,coerce:!0}),"string"),number:t(a=>E7.create({...a,coerce:!0}),"number"),boolean:t(a=>D7.create({...a,coerce:!0}),"boolean"),bigint:t(a=>x7.create({...a,coerce:!0}),"bigint"),date:t(a=>A7.create({...a,coerce:!0}),"date")},jCr=Oc,Vr=Object.freeze({__proto__:null,defaultErrorMap:uU,setErrorMap:jTr,getErrorMap:Wpe,makeIssue:Hpe,EMPTY_PATH:BTr,addIssueToContext:Ba,ParseStatus:u1,INVALID:Oc,DIRTY:lU,OK:Nv,isAborted:x5e,isDirty:D5e,isValid:lY,isAsync:uY,get util(){return of},get objectUtil(){return E5e},ZodParsedType:Xa,getParsedType:WN,ZodType:Dl,datetimeRegex:Pbt,ZodString:HN,ZodNumber:E7,ZodBigInt:x7,ZodBoolean:D7,ZodDate:A7,ZodSymbol:fU,ZodUndefined:k7,ZodNull:w7,ZodAny:GN,ZodUnknown:E6,ZodNever:qx,ZodVoid:_U,ZodArray:x6,ZodObject:Qb,ZodUnion:P7,ZodDiscriminatedUnion:Qpe,ZodIntersection:N7,ZodTuple:pk,ZodRecord:Kpe,ZodMap:pU,ZodSet:dU,ZodFunction:Ype,ZodLazy:I7,ZodLiteral:O7,ZodEnum:F7,ZodNativeEnum:L7,ZodPromise:QN,ZodEffects:OS,ZodTransformer:OS,ZodOptional:NC,ZodNullable:dk,ZodDefault:R7,ZodCatch:M7,ZodNaN:mU,BRAND:tCr,ZodBranded:fY,ZodPipeline:_Y,ZodReadonly:j7,custom:Ibt,Schema:Dl,ZodSchema:Dl,late:rCr,get ZodFirstPartyTypeKind(){return kc},coerce:MCr,any:uCr,array:dCr,bigint:sCr,boolean:Lbt,date:aCr,discriminatedUnion:yCr,effect:xbt,enum:ACr,function:ECr,instanceof:nCr,intersection:vCr,lazy:xCr,literal:DCr,map:TCr,nan:iCr,nativeEnum:kCr,never:_Cr,null:lCr,nullable:NCr,number:Fbt,object:mCr,oboolean:RCr,onumber:LCr,optional:PCr,ostring:FCr,pipeline:OCr,preprocess:ICr,promise:wCr,record:SCr,set:CCr,strictObject:hCr,string:Obt,symbol:oCr,transformer:xbt,tuple:bCr,undefined:cCr,union:gCr,unknown:fCr,void:pCr,NEVER:jCr,ZodIssueCode:As,quotelessJson:MTr,ZodError:IS});function Rbt(a){return a instanceof Error&&a.name==="ZodError"&&"issues"in a&&Array.isArray(a.issues)}t(Rbt,"isZodErrorLike");var k5e=class extends Error{static{t(this,"ValidationError")}name;details;constructor(a,s){super(a,s),this.name="ZodValidationError",this.details=UCr(s)}toString(){return this.message}};function UCr(a){if(a){let s=a.cause;if(Rbt(s))return s.issues}return[]}t(UCr,"getIssuesFromErrorOptions");function Mbt(a){return a.length!==0}t(Mbt,"isNonEmptyArray");var $Cr=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function JCr(a){return a.length===1?a[0].toString():a.reduce((s,c)=>{if(typeof c=="number")return s+"["+c.toString()+"]";if(c.includes('"'))return s+'["'+zCr(c)+'"]';if(!$Cr.test(c))return s+'["'+c+'"]';let f=s.length===0?"":".";return s+f+c},"")}t(JCr,"joinPath");function zCr(a){return a.replace(/"/g,'\\"')}t(zCr,"escapeQuotes");var qCr="; ",VCr=99,jbt="Validation error",WCr=": ",HCr=", or ";function GCr(a={}){let{issueSeparator:s=qCr,unionSeparator:c=HCr,prefixSeparator:f=WCr,prefix:d=jbt,includePath:v=!0,maxIssuesInMessage:E=VCr}=a;return A=>{let O=A.slice(0,E).map(M=>Xpe({issue:M,issueSeparator:s,unionSeparator:c,includePath:v})).join(s);return QCr(O,d,f)}}t(GCr,"createMessageBuilder");function Xpe(a){let{issue:s,issueSeparator:c,unionSeparator:f,includePath:d}=a;if(s.code===As.invalid_union)return s.unionErrors.reduce((v,E)=>{let A=E.issues.map(O=>Xpe({issue:O,issueSeparator:c,unionSeparator:f,includePath:d})).join(c);return v.includes(A)||v.push(A),v},[]).join(f);if(s.code===As.invalid_arguments)return[s.message,...s.argumentsError.issues.map(v=>Xpe({issue:v,issueSeparator:c,unionSeparator:f,includePath:d}))].join(c);if(s.code===As.invalid_return_type)return[s.message,...s.returnTypeError.issues.map(v=>Xpe({issue:v,issueSeparator:c,unionSeparator:f,includePath:d}))].join(c);if(d&&Mbt(s.path)){if(s.path.length===1){let v=s.path[0];if(typeof v=="number")return`${s.message} at index ${v}`}return`${s.message} at "${JCr(s.path)}"`}return s.message}t(Xpe,"getMessageFromZodIssue");function QCr(a,s,c){return s!==null?a.length>0?[s,a].join(c):s:a.length>0?a:jbt}t(QCr,"prefixMessage");function KCr(a,s={}){let c=a.errors,f;return Mbt(c)?f=YCr(s)(c):f=a.message,new k5e(f,{cause:a})}t(KCr,"fromZodErrorWithoutRuntimeCheck");function YCr(a){return"messageBuilder"in a?a.messageBuilder:GCr(a)}t(YCr,"createMessageBuilderFromOptions2");var XCr=t((a={})=>s=>Rbt(s)?KCr(s,a):s instanceof Error?new k5e(s.message,{cause:s}):new k5e("Unknown error"),"toValidationError");function Zpe(a,s={}){return XCr(s)(a)}t(Zpe,"fromError");var ede=t((a,s)=>{let c={};for(let[f,d]of Object.entries(a))Array.isArray(d)?c[f]=d.map(v=>typeof v=="object"&&v!==null?ede(v,s):v):typeof d=="object"&&d!==null?c[f]=ede(d,s):c[f]=d;return s(c)},"traverse"),rEr=t(({keys:a}={})=>s=>ede(s,c=>{let f={};for(let[d,v]of Object.entries(c))d.startsWith("x-")&&(a===void 0||a.includes(d))||(f[d]=v);return f}),"removeExtensions"),nEr=t(({paths:a={},shouldRemove:s})=>c=>ede(c,f=>{if(!f.paths)return f;let d={};for(let[v,E]of Object.entries(f.paths)){let A=f.paths[v];if(a[v]!==!0&&!s?.({path:v,method:!0,operation:A}))if(typeof E=="object"&&E!==null){let O=Object.fromEntries(Object.entries(E).filter(([M])=>{let H=f.paths[v][M],$=Array.isArray(a[v])&&a[v].includes(M),K=s?.({path:v,method:M,operation:H});return!$&&!K}));d[v]=O}else d[v]=E}return{...f,paths:d}}),"removePaths");function iEr(a){return a.apis&&(Array.isArray(a.apis)?a.apis=a.apis.map($bt):a.apis=$bt(a.apis)),a}t(iEr,"withZuplo");function $bt(a){return a.type==="file"&&(a.postProcessors=[rEr({keys:["x-zuplo-route","x-zuplo-path"]}),nEr({shouldRemove:t(({operation:s})=>s["x-internal"],"shouldRemove")}),...a.postProcessors??[]]),a}t($bt,"configureApis");var sEr=iEr,Hbt=Vr.object({label:Vr.string(),color:Vr.enum(["green","blue","yellow","red","purple","indigo","gray"]),placement:Vr.enum(["start","end"]).optional()}),aEr=Vr.object({type:Vr.literal("doc"),id:Vr.string(),label:Vr.string().optional()}),oEr=Vr.union([aEr,Vr.string()]),cEr=Vr.object({type:Vr.literal("doc"),id:Vr.string(),icon:Vr.custom().optional(),label:Vr.string().optional(),badge:Hbt.optional()}),lEr=Vr.union([cEr,Vr.string()]),uEr=Vr.object({type:Vr.literal("link"),label:Vr.string(),href:Vr.string(),description:Vr.string().optional(),badge:Hbt.optional()}),fEr=Vr.object({type:Vr.literal("category"),icon:Vr.custom().optional(),label:Vr.string(),description:Vr.string().optional(),collapsible:Vr.boolean().optional(),collapsed:Vr.boolean().optional(),link:oEr.optional()}),Gbt=Vr.lazy(()=>Vr.union([lEr,uEr,_Er])),_Er=fEr.extend({items:Gbt.array()}),pEr=Gbt.array(),w5e=Vr.object({}).passthrough(),Jbt=Vr.object({background:Vr.string(),foreground:Vr.string(),card:Vr.string(),cardForeground:Vr.string(),popover:Vr.string(),popoverForeground:Vr.string(),primary:Vr.string(),primaryForeground:Vr.string(),secondary:Vr.string(),secondaryForeground:Vr.string(),muted:Vr.string(),mutedForeground:Vr.string(),accent:Vr.string(),accentForeground:Vr.string(),destructive:Vr.string(),destructiveForeground:Vr.string(),border:Vr.string(),input:Vr.string(),ring:Vr.string(),radius:Vr.string()}).partial(),dEr=Vr.object({label:Vr.string(),tags:Vr.array(Vr.string())}),P5e=Vr.object({id:Vr.string().optional(),server:Vr.string().optional(),navigationId:Vr.string().optional(),categories:Vr.array(dEr).optional()}),mEr=Vr.function().args(w5e).returns(Vr.union([w5e,Vr.promise(w5e)])),zbt=Vr.union([Vr.object({type:Vr.literal("url"),input:Vr.string()}).merge(P5e),Vr.object({type:Vr.literal("file"),input:Vr.string()}).merge(P5e).merge(Vr.object({postProcessors:mEr.array().optional()})),Vr.object({type:Vr.literal("raw"),input:Vr.string()}).merge(P5e)]),hEr=Vr.union([Vr.object({enabled:Vr.boolean(),endpoint:Vr.string()}),Vr.object({enabled:Vr.boolean(),getKeys:Vr.custom(a=>typeof a=="function"),rollKey:Vr.custom(a=>typeof a=="function").optional(),deleteKey:Vr.custom(a=>typeof a=="function").optional(),updateKeyDescription:Vr.custom(a=>typeof a=="function").optional(),createKey:Vr.custom(a=>typeof a=="function").optional()})]),gEr=Vr.object({src:Vr.object({light:Vr.string(),dark:Vr.string()}),alt:Vr.string().optional(),width:Vr.string().optional()}),yEr=Vr.object({siteUrl:Vr.string(),changefreq:Vr.optional(Vr.enum(["always","hourly","daily","weekly","monthly","yearly","never"])),priority:Vr.optional(Vr.number()),outDir:Vr.string().optional(),autoLastmod:Vr.boolean().optional(),exclude:Vr.union([Vr.function().returns(Vr.promise(Vr.array(Vr.string()))),Vr.array(Vr.string())]).optional()}).optional(),qbt=Vr.object({files:Vr.string(),defaultOptions:Vr.object({toc:Vr.boolean(),disablePager:Vr.boolean()}).partial().optional()}),vEr=Vr.object({label:Vr.string(),id:Vr.string(),default:Vr.string().optional(),display:Vr.enum(["auth","anon","always"]).default("always").optional()}),bEr=Vr.object({from:Vr.string(),to:Vr.string()}),SEr=Vr.object({type:Vr.literal("inkeep"),apiKey:Vr.string(),integrationId:Vr.string(),organizationId:Vr.string(),primaryBrandColor:Vr.string(),organizationDisplayName:Vr.string()}).optional(),TEr=Vr.union([Vr.object({type:Vr.literal("clerk"),clerkPubKey:Vr.custom(a=>typeof a=="string"?/^pk_(test|live)_\w+$/.test(a):!1),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()}),Vr.object({type:Vr.literal("openid"),clientId:Vr.string(),issuer:Vr.string(),audience:Vr.string().optional(),scopes:Vr.array(Vr.string()).optional(),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()}),Vr.object({type:Vr.literal("auth0"),clientId:Vr.string(),domain:Vr.string(),audience:Vr.string().optional(),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()})]),CEr=Vr.object({title:Vr.string(),description:Vr.string(),logo:Vr.string(),favicon:Vr.string(),generator:Vr.string(),applicationName:Vr.string(),referrer:Vr.string(),keywords:Vr.array(Vr.string()),authors:Vr.array(Vr.string()),creator:Vr.string(),publisher:Vr.string()}).partial(),Vbt=Vr.object({url:Vr.string(),fontFamily:Vr.string()}),EEr=Vr.object({sans:Vbt.optional(),mono:Vbt.optional()}),xEr=Vr.object({pageTitle:Vr.string(),logoUrl:Vr.string(),logo:gEr,banner:Vr.object({message:Vr.custom(),color:Vr.enum(["note","tip","info","caution","danger"]).or(Vr.string()).optional(),dismissible:Vr.boolean().optional()})}).partial(),Wbt=Vr.object({navigationId:Vr.string(),label:Vr.string(),items:Vr.array(Vr.string()).optional()}),Qbt=Vr.object({basePath:Vr.string().optional(),page:xEr,topNavigation:Vr.array(vEr),sidebar:Vr.record(pEr),theme:Vr.object({light:Jbt,dark:Jbt,fonts:EEr}).partial(),metadata:CEr,authentication:TEr,search:SEr,docs:Vr.union([qbt,Vr.array(qbt)]),apis:Vr.union([zbt,Vr.array(zbt)]),catalog:Vr.union([Wbt,Vr.array(Wbt)]),apiKeys:hEr,redirects:Vr.array(bEr),sitemap:yEr}),Kbt=t((a,s)=>{if(!a.sidebar||!a.topNavigation)return;let c=a.topNavigation.map(d=>d.id),f=Object.keys(a.sidebar).filter(d=>!c.includes(d));f.length>0&&s.addIssue({code:Vr.ZodIssueCode.custom,message:`Sidebar ID [${f.map(d=>`"${d}"`).join(", ")}] not found in top navigation.
632
632
  Following IDs are available: ${c.join(", ")}`})},"refine"),DEr=Qbt.partial(),AEr=DEr.superRefine(Kbt);function kEr(a){let s=AEr.safeParse(a);s.success||(console.log("Validation errors:"),console.log(Zpe(s.error).toString()))}t(kEr,"validateCommonConfig");var wEr=Vr.object({UNSAFE_slotlets:Vr.record(Vr.string(),Vr.custom()),mdx:Vr.object({components:Vr.custom()}).partial(),customPages:Vr.array(Vr.object({path:Vr.string(),element:Vr.custom().optional(),render:Vr.custom().optional(),prose:Vr.boolean().optional()})),plugins:Vr.array(Vr.custom()),build:Vr.custom()}),PEr=Qbt.merge(wEr).partial().superRefine(Kbt);function NEr(a){let s=PEr.safeParse(a);s.success||(console.log("Validation errors:"),console.log(Zpe(s.error).toString()))}t(NEr,"validateConfig");var IEr=["zudoku.config.js","zudoku.config.jsx","zudoku.config.ts","zudoku.config.tsx","zudoku.config.mjs"],OEr="dev-portal.json",N5e=t(a=>eEr(a).then(()=>!0).catch(()=>!1),"fileExists"),D6,KN;async function O5e(a){if(D6&&KN&&await N5e(D6))return{configPath:D6,configType:KN};let s=Bbt.join(a,OEr);if(await N5e(s))return D6=s,KN="dev-portal",{configPath:D6,configType:KN};for(let c of IEr){let f=Bbt.join(a,c);if(await N5e(f))return D6=f,KN="zudoku",{configPath:D6,configType:KN}}return D6=void 0,KN=void 0,{configPath:D6,configType:KN}}t(O5e,"findConfigFilePath");async function FEr(a){let s=await O5e(a);if(s.configType)return s;throw new Error("No zudoku config file found in project root.")}t(FEr,"getConfigFilePath");async function LEr(a,s,c){let f=Ubt(s).href,d=[],v=await Cbt(f,{parentURL:import.meta.url,onImport:t(E=>{let A=tEr(E.startsWith("file://")?E:Ubt(E).href);A.startsWith(a)&&d.push(A)},"onImport")}).then(E=>E.default);if(!v)throw new Error(`Failed to load config file: ${s}`);return{dependencies:d,config:v}}t(LEr,"loadZudokuCodeConfig");async function REr(a,s){let c=await ZCr(a,"utf-8"),f;try{f=JSON.parse(c)}catch{throw new Error("Failed to parse dev-portal.json. Check that the file is valid JSON.")}return kEr(f),f=I5e(f,s),f=sEr(f),f}t(REr,"loadDevPortalConfig");function I5e(a,s){if(typeof a=="string"){let c=a.match(/^\$env\(([^)]+)\)$/);if(c){let f=c[1];return s[f]}return a}else{if(Array.isArray(a))return a.map(c=>I5e(c,s));if(typeof a=="object"&&a!==null){let c={};for(let f in a)Object.hasOwn(a,f)&&(c[f]=I5e(a[f],s));return c}}return a}t(I5e,"replaceEnvVariables");async function Ybt(a,s,c){let{configPath:f,configType:d}=await FEr(a),v,E;return d==="dev-portal"?(v=await REr(f,s),E=[]):({config:v,dependencies:E}=await(c?.loadZudokuCodeConfig??LEr)(a,f,s),NEr(v)),{...v,__meta:{dependencies:E,path:f,registerDependency:t((...O)=>E.push(...O),"registerDependency")}}}t(Ybt,"tryLoadZudokuConfig");import e2t from"fs/promises";import B7 from"path";import{writeFile as MEr}from"fs/promises";async function mk(a,s){await Ml.mkdirForFilePathIfNotExits(a);let c=await import("prettier"),f=s;try{f=await c.format(s,{parser:"babel"})}catch{}await MEr(a,f,"utf-8")}t(mk,"writeDebugSourceFile");import F5e from"path";async function Xbt(a){if(await Ml.fileExists(`${a}/config/dev-portal.json`))return"dev-portal";if((await O5e(F5e.join(a,"docs")))?.configType)return"zudoku"}t(Xbt,"getDevPortalType");function hU(a,s){let c=F5e.relative(process.cwd(),F5e.join(a,Vj));return Object.keys(s?.outputs??{}).map(d=>`.${d.replace(c,"")}`)}t(hU,"getBuildModules");var Zbt="/docs",BEr="/__zuplo/dev-portal";function UEr(a){let s=a.trim().toLowerCase();return s.endsWith("/")&&(s=s.slice(0,-1)),s}t(UEr,"normalizePathname");function $Er(a){let s={sitePathname:a?.sitePathname===BEr?Zbt:a?.sitePathname?UEr(a.sitePathname):Zbt,enabled:a?a.enabled??!0:!1,version:a?.version??"legacy"};return`const devPortal = ${JSON.stringify(s)};
633
- export default devPortal;`}t($Er,"generateSource");function t2t(a){return{name:"dev-portal-config",setup(s){s.onResolve({filter:/dev-portal.json$/},c=>({namespace:"dev-portal-json",path:B7.isAbsolute(c.path)?c.path:B7.join(c.resolveDir,c.path),pluginName:"dev-portal"})),s.onLoad({filter:/.*/,namespace:"dev-portal-json"},async c=>f_.timeFn("Generating dev-portal.json data",async()=>{let f,d,v=[],E=await Xbt(a.sourceDirectory);if(E==="zudoku")try{let O=B7.join(B7.resolve(B7.dirname(c.path),".."),Blt);f={version:"zudoku",enabled:!0,sitePathname:(await Ybt(O,{},{loadZudokuCodeConfig:JEr(a.sourceDirectory,a.logger)})).basePath}}catch(O){a.logger.error(O,"Failed to load developer portal configuration"),v.push({id:"dev-portal-build-error",text:"Could not load developer portal configuration.",location:{file:"docs/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:O.message,pluginName:"dev-portal",notes:[]})}else if(E==="dev-portal"){d=await e2t.readFile(c.path,"utf-8");try{f=JSON.parse(d)}catch(O){v.push({id:"dev-portal-build-error",text:"Could not parse dev-portal.json. Ensure that the file is valid JSON.",location:{file:"config/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}}let A;try{if(A=$Er(f),Mh.DEBUG_BUILD_MODE&&A){let O=B7.join(a.sourceDirectory,".zuplo","dev-portal.js");await mk(O,A)}}catch(O){v.push({id:"dev-portal-build-error",text:O.message,location:{file:"dev-portal.json",namespace:"dev-portal-json",line:1,column:0,length:0,lineText:"issue",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}return{contents:A,errors:v,pluginName:"dev-portal",loader:"js",resolveDir:B7.dirname(c.path),watchFiles:[c.path]}}))}}}t(t2t,"devPortalConfigPlugin");function JEr(a,s){return t(async function(f,d,v){let E;try{E=Ml.safePath(a).resolve(d)}catch(K){throw s.error(`Error resolving path ${d} inside ${a}`),K}let A=await e2t.readFile(E,"utf-8"),O=await jEr(A,{target:"esnext",syntax:"typescript",tsx:!0}),M=zEr(O);return{dependencies:[],config:{basePath:M??"/docs"}}},"loadZudokuCodeConfig")}t(JEr,"createLoadDevPortalConfigFunction");function zEr(a){let s;return a.body.forEach(c=>{if(c.type==="VariableDeclaration"){let f=c.declarations[0];f.id.type==="Identifier"&&f.id.value==="config"&&f.init&&f.init.type==="ObjectExpression"&&f.init.properties.forEach(v=>{v.type==="KeyValueProperty"&&(v.key.type==="Identifier"&&v.key.value==="basePath"||v.key.type==="StringLiteral"&&v.key.value==="basePath")&&v.value.type==="StringLiteral"&&(s=v.value.value)})}}),s}t(zEr,"getBasePathFromConfig");import r2t from"path";var n2t="legacy-environment",i2t="legacy-environment",qEr=`import { environment } from "@zuplo/runtime";
633
+ export default devPortal;`}t($Er,"generateSource");function t2t(a){return{name:"dev-portal-config",setup(s){s.onResolve({filter:/dev-portal.json$/},c=>({namespace:"dev-portal-json",path:B7.isAbsolute(c.path)?c.path:B7.join(c.resolveDir,c.path),pluginName:"dev-portal"})),s.onLoad({filter:/.*/,namespace:"dev-portal-json"},async c=>f_.timeFn("Generating dev-portal.json data",async()=>{let f,d,v=[],E=await Xbt(a.sourceDirectory);if(E==="zudoku")try{let O=B7.join(B7.resolve(B7.dirname(c.path),".."),Blt);f={version:"zudoku",enabled:!0,sitePathname:(await Ybt(O,{},{loadZudokuCodeConfig:JEr(a.sourceDirectory,a.logger)})).basePath}}catch(O){a.logger.error(O,"Failed to load developer portal configuration"),v.push({id:"dev-portal-build-error",text:"Could not load developer portal configuration.",location:{file:"docs/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:O.message,pluginName:"dev-portal",notes:[]})}else if(E==="dev-portal"){d=await e2t.readFile(c.path,"utf-8");try{f=JSON.parse(d)}catch(O){v.push({id:"dev-portal-build-error",text:"Could not parse dev-portal.json. Ensure that the file is valid JSON.",location:{file:"config/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}}let A;try{if(A=$Er(f),Mh.DEBUG_BUILD_MODE&&A){let O=B7.join(a.sourceDirectory,".zuplo","dev-portal.js");await mk(O,A)}}catch(O){v.push({id:"dev-portal-build-error",text:O.message,location:{file:"dev-portal.json",namespace:"dev-portal-json",line:1,column:0,length:0,lineText:"issue",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}return{contents:A,errors:v,pluginName:"dev-portal",loader:"js",resolveDir:B7.dirname(c.path),watchFiles:[c.path]}}))}}}t(t2t,"devPortalConfigPlugin");function JEr(a,s){return t(async function(f,d,v){let E;try{E=Ml.safePath(a).resolve(d)}catch(K){throw s.error(`Error resolving path ${d} inside ${a}`),K}let A=await e2t.readFile(E,"utf-8"),O=await jEr(A,{target:"esnext",syntax:"typescript",tsx:!0}),M=zEr(O);return{dependencies:[],config:{basePath:M??"/"}}},"loadZudokuCodeConfig")}t(JEr,"createLoadDevPortalConfigFunction");function zEr(a){let s;return a.body.forEach(c=>{if(c.type==="VariableDeclaration"){let f=c.declarations[0];f.id.type==="Identifier"&&f.id.value==="config"&&f.init&&f.init.type==="ObjectExpression"&&f.init.properties.forEach(v=>{v.type==="KeyValueProperty"&&(v.key.type==="Identifier"&&v.key.value==="basePath"||v.key.type==="StringLiteral"&&v.key.value==="basePath")&&v.value.type==="StringLiteral"&&(s=v.value.value)})}}),s}t(zEr,"getBasePathFromConfig");import r2t from"path";var n2t="legacy-environment",i2t="legacy-environment",qEr=`import { environment } from "@zuplo/runtime";
634
634
  export default environment;`;function s2t(a){return{name:"environment",setup(s){s.onResolve({filter:/@app\/environment$/},()=>({namespace:i2t,pluginName:n2t,path:r2t.join(a.sourceDirectory,hN,"environment.js")})),s.onLoad({filter:/.*/,namespace:i2t},async c=>({contents:qEr,loader:"ts",resolveDir:r2t.dirname(c.path),pluginName:n2t}))}}}t(s2t,"environmentPlugin");var hCt=jp(CLe(),1),gCt=jp(jTt(),1),yCt=jp(GLe(),1),vCt=jp(QLe(),1);import z6r from"fs/promises";import FS from"path";var Tk="schemas",Rde="json-schema";function bCt(a){return{name:Tk,async setup(s){let c=new yCt.Ajv2020({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});(0,gCt.default)(c,{mode:"fast"}),c.opts.code.formats=hCt._`require("ajv-formats/dist/formats").fastFormats`;let f=FS.join(a.sourceDirectory,oQ),d,v=[],E=[];if(await Ml.dirExists(f)&&(c.addKeyword("faker"),d=await Ml.listFolderContents(f,oQ),await Promise.all(d.map(async A=>{try{let O=Ml.safePath(a.sourceDirectory).resolve(f,A);if(!O.startsWith(f))throw new Error("All schemas must be in the schemas directory");let M=await z6r.readFile(O,"utf-8");if(M===""||M===void 0)throw new Error(`Schema 'schemas/${A}' is empty and will be ignored.`);let H=JSON.parse(M);if(H.$schema&&H.$schema!=="https://json-schema.org/draft/2020-12/schema")throw new Error(`Error in ${A}: All JSON schemas must use version 2020-12. See release notes for changes: https://json-schema.org/draft/2020-12/release-notes.html`);if(c.addSchema(H,A),c.errors?.length){let $=c.errors[0];v.push({id:"json-schema-validation-error",pluginName:Tk,text:`Error: ${$.message}`,location:{file:FS.join(oQ,A)},detail:{params:$.params,propertyName:$.propertyName,schemaPath:$.schemaPath,data:$.data}})}}catch(O){if(O.message.endsWith("is empty and will be ignored.")){E.push({id:"empty-json-schema-file",pluginName:Tk,text:`Schema 'schemas/${A}' is empty and will be ignored.`,location:{file:`schemas/${A}`,suggestion:"Add schema details or remove the file from the project."},detail:"EmptyJSONSchemaFile",notes:[{text:`Schema 'schemas/${A}' is empty and will be ignored.`,location:{file:`schemas/${A}`,suggestion:"Add schema details or remove the file from the project."}}]});return}let M=await C7e(A,a.sourceDirectory,O.message);v.push({id:"json-schema-add-error",pluginName:Tk,text:`Error: ${O.message}`,location:M,detail:"InvalidAddSchemaError",notes:[{text:O.message}]})}})),await Promise.all(d.map(async A=>{try{let O=c.getSchema(A);O&&c.compile(O.schema).errors?.forEach(H=>{v.push({text:`Failed to compile ${A}: ${H.message}`})})}catch(O){let M=await C7e(A,a.sourceDirectory,O.message);v.push({id:"json-schema-compile-error",pluginName:Tk,text:`The schema file '${A}' is not valid. Error: ${O.message}`,location:M,detail:"InvalidSchemaError",notes:[{text:O.message}]})}})),Mh.DEBUG_BUILD_MODE)){let A=FS.resolve(a.outputDirectory,oQ);await Ml.mkdirIfNotExists(A)}s.onStart(async()=>{if(d)return{errors:v,warnings:E}}),s.onResolve({filter:/schemas\/.*\.json$/},async A=>{let O=FS.isAbsolute(A.path)?A.path:FS.join(A.resolveDir,A.path);if(A.importer&&A.importer!==FS.join(a.sourceDirectory,"config/routes.json"))return{path:O};if(!await Ml.fileExists(O)){let M="policies.json";return{errors:[{id:"json-schema-build-error",text:`Unable to resolve reference to '${A.path}' from ${M}`,location:{file:FS.join(A.resolveDir,M),namespace:Rde,line:1,column:0,length:0,lineText:`Invalid JSON schema reference in ${M}`,suggestion:""},detail:"RouteReferenceError",pluginName:Tk,notes:[{text:`Unable to resolve reference to '${A.path}' from ${M}`,location:null}]}],namespace:Rde,path:O,pluginName:Tk}}return{path:O,namespace:Rde,pluginName:Tk}}),s.onLoad({filter:/.*/,namespace:Rde},async A=>f_.timeFn(`Generating json schema data: ${FS.basename(A.path)}`,async()=>{let O=[],M;try{let H=FS.relative(f,A.path),$=c.getSchema(H);if(!$)throw new Error(`Could not load schema at ${A.path}`);M=$.source?.validateCode;let K=c.compile($.schema);M=(0,vCt.default)(c,K)}catch(H){O.push({pluginName:Tk,text:`Cannot parse project's schemas/${FS.basename(A.path)} file. Error: ${H.message}`,location:null,notes:[{text:H.message,location:null}],detail:H})}if(Mh.DEBUG_BUILD_MODE&&M){let H=FS.relative(f,A.path),$=FS.join(a.sourceDirectory,".zuplo",`${H}.js`);await mk($,M)}return{contents:M,errors:O,pluginName:Tk,resolveDir:FS.dirname(A.path),watchFiles:[A.path]}}))}}}t(bCt,"jsonSchemaPlugin");import{relative as q6r}from"path";var SCt=["node:assert","node:async_hooks","node:buffer","node:crypto","node:diagnostics_channel","node:events","node:path","node:process","node:stream","node:string_decoder","node:util"],V6r="nodejs-compat-plugin";function TCt({sourceDirectory:a}){return{name:V6r,setup(s){let c=new Set;s.onStart(()=>{c.clear()}),s.onResolve({filter:/node:.*/},async({path:f,kind:d,resolveDir:v,...E})=>{let A=`${f}:${d}:${v}:${E.importer}`;if(c.has(A))return;c.add(A);let O=await s.resolve(f,{kind:d,resolveDir:v,importer:E.importer});return O.errors.length>0?SCt.includes(f)||f.includes("/")&&SCt.includes(f.split("/")[0])?{external:!0}:{external:!0,warnings:O.errors.map(H=>({...H,location:{file:q6r(a,E.importer),line:0,column:0,namespace:"",length:0,lineText:"",suggestion:"Remove the imported node module"},detail:`The package "${f}" wasn't found on the file system but is built into node. If this code is executed it will fail.`}))}:O})}}}t(TCt,"nodejsCompatPlugin");import CCt from"fs/promises";import Yx from"path";var jU="open-api-routes-plugin",Mde="open-api-routes-json";function ECt(a){return{name:"open-api-routes-plugin",setup(s){s.onResolve({filter:/routes.json$/},c=>({watchFiles:[...KLe(Yx.join(a.sourceDirectory,DS),[".oas.json"],!0),Yx.join(a.sourceDirectory,DS,jue)],namespace:Mde,path:Yx.isAbsolute(c.path)?c.path:Yx.join(c.resolveDir,c.path),pluginName:jU})),s.onResolve({filter:/^\.\.\/modules\/.*/,namespace:Mde},async c=>{let f=Yx.join(c.resolveDir,`${c.path}.ts`);if(!await Ml.fileExists(f)){let d=`$import(.${c.path.replace(/^../,"")})`,v=Yx.resolve(a.sourceDirectory,"config"),E=await HF(v),A=await Pft(E,d,"Update your route configuration to use code from the 'modules' folder");return{errors:[{id:"route-build-error",text:`Invalid handler reference in routes.json. Unable to resolve reference to '${d}' from routes.json`,location:A,detail:"RouteReferenceError",pluginName:jU}],namespace:Mde,path:c.path,pluginName:jU}}}),s.onLoad({filter:/.*/,namespace:Mde},async c=>f_.timeFn("Generating route.json data",async()=>{let f=Yx.resolve(a.sourceDirectory,"config"),d=await HF(f),v=await Promise.all(d.map(async M=>({content:await CCt.readFile(M,"utf-8"),fileName:M}))),E=Yx.resolve(f,"policies.json");if(!await Ml.fileExists(E))return{errors:[{text:"The project must include a policies file ('/config/policies.json')",detail:"OASPoliciesFileMissing",pluginName:jU,location:{line:0,column:0,file:"/config/policies.json"}}],pluginName:jU};let A={content:await CCt.readFile(E,"utf-8"),fileName:E},O;try{O=await v7e({sourceDirectory:a.sourceDirectory,oasContent:v,policiesContent:A})}catch(M){throw new Error("Error compiling routes: "+M.message)}if(Mh.DEBUG_BUILD_MODE&&O.content){let M=Yx.join(a.sourceDirectory,".zuplo"),H=Yx.resolve(M,"routes.js");await mk(H,O.content)}return{contents:O.content,errors:O.errors,pluginName:jU,resolveDir:Yx.dirname(c.path),watchFiles:[c.path]}}))}}}t(ECt,"openApiRoutesPlugin");import jde from"path";var VY="raw-route-plugin",xCt="raw-route";function DCt(a){return{name:"raw-route-plugin",setup(s){s.onResolve({filter:/raw.json$/},c=>({namespace:xCt,path:c.path,pluginName:VY})),s.onLoad({filter:/.*/,namespace:xCt},async c=>{let f=jde.resolve(a.sourceDirectory,DS);if(!await Ml.dirExists(f))return{loader:"js",resolveDir:jde.dirname(c.path),pluginName:VY};let d=await HF(f);try{let v=await T7e({oasFiles:d,sourceDirectory:a.sourceDirectory,logger:a.logger});if(Mh.DEBUG_BUILD_MODE&&v){let E=jde.join(a.sourceDirectory,".zuplo","raw-routes.js");await mk(E,v)}return{contents:v,loader:"js",resolveDir:jde.dirname(c.path),pluginName:VY}}catch(v){if(v instanceof Tv)return{contents:"",loader:"ts",errors:[{id:"route-build-error",text:v.issue.text,location:v.issue.location,detail:v.issue.detail,pluginName:VY}],pluginName:VY};throw v}})}}}t(DCt,"rawRoutePlugin");import W6r from"fs/promises";import YLe from"path";var Bde="runtime-config",ACt="runtime-config-plugin";function kCt(){return{name:Bde,setup(a){a.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},s=>({namespace:ACt,path:YLe.isAbsolute(s.path)?s.path:YLe.join(s.resolveDir,s.path),pluginName:Bde})),a.onLoad({filter:/.*/,namespace:ACt},async s=>f_.timeFn("Generating zuplo.runtime.ts data",async()=>{let c="export const runtimeInit = undefined;",f=[];return await Ml.fileExists(s.path)?(c=await W6r.readFile(s.path,"utf-8"),{contents:c,loader:"ts",resolveDir:YLe.dirname(s.path),errors:f,pluginName:Bde,watchFiles:[s.path]}):{contents:c,loader:"ts",errors:f,pluginName:Bde}}))}}}t(kCt,"runtimeConfigPlugin");var PCt=jp(GLe(),1),NCt=jp(QLe(),1);import eRe from"fs/promises";import Y7 from"path";var XLe="schema-validation-plugin",wCt="schema-validation",H6r="module.exports = {}";function ICt(a){return{name:"schema-validation-plugin",setup(s){s.onResolve({filter:/ajv-schema.json$/},c=>({namespace:wCt,path:c.path,pluginName:XLe})),s.onLoad({filter:/.*/,namespace:wCt},async c=>{let f=Y7.resolve(a.sourceDirectory,DS,"policies.json");if(!await Ml.fileExists(f))return{contents:H6r,loader:"js",resolveDir:Y7.dirname(c.path),pluginName:XLe};let d=await Q6r(a.sourceDirectory),v=Y7.resolve(a.sourceDirectory,DS),E=await HF(v),A=await Z6r(E,d),O=await G6r({oasFiles:E,routesWithSchemaValidation:A,sourceDirectory:a.sourceDirectory,logger:a.logger});if(Mh.DEBUG_BUILD_MODE&&O){let M=Y7.join(a.sourceDirectory,".zuplo","schema-validation.js");await mk(M,O)}return{contents:O,loader:"js",resolveDir:Y7.dirname(c.path),pluginName:XLe}})}}}t(ICt,"schemaValidationPlugin");async function G6r({oasFiles:a,routesWithSchemaValidation:s,sourceDirectory:c,logger:f}){let d="",v=new wN(c,f);if(s.length===0)return d;let E=new PCt.Ajv2020({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let A of a){let O=await eRe.readFile(A,"utf-8"),M=Y7.basename(A,".oas.json"),H=s.filter(Te=>Te.fileName===M),$=await v.resolve(A),K=JSON.parse(O),Ne=[],xe=new Map;H.forEach(Te=>{let Tt=K.paths[Te.path][Te.method];if(Tt.requestBody){let Dt;if(Tt.requestBody.$ref){let br=Tt.requestBody.$ref;Dt=$.get(br)?.content}else Tt.requestBody.content&&(Dt=Tt.requestBody.content);if(Dt)for(let br in Dt){let dr=Dt[br].schema,jr=r8e(Te.path,Te.method,br);dr.$id=jr,E.addSchema(dr),ZLe(dr,A,M,E,$,Ne,xe)}}if(Tt.parameters)for(let Dt of Tt.parameters){let br=Dt.$ref?$.get(Dt.$ref):Dt,dr=br.schema.$ref?$.get(br.schema.$ref):br.schema,jr=t8e(Te.path,Te.method,br.in,br.name);dr.$id=jr,E.addSchema(dr),ZLe(br,A,M,E,$,Ne,xe)}});for(let Te of Ne){let Tt=$.get(Te),Dt=XQ(M,Te);E.addSchema(Tt,Dt)}}return d=(0,NCt.default)(E),d}t(G6r,"schemaValidationSource");function ZLe(a,s,c,f,d,v,E){for(let A in a){let O=a[A];if(A==="$ref"){let M=XQ(c,bN(s,O));a[A]=M,OQ(s,c,bN(s,O),d,v,E,(H,$)=>XQ(H,bN(s,$)))}else typeof O=="object"&&ZLe(O,s,c,f,d,v,E)}}t(ZLe,"addRefsToSchema");async function Q6r(a){let s=new Set(["RequestValidationInboundPolicy"]),c=await eRe.readFile(`${a}/config/policies.json`,"utf-8"),f=JSON.parse(c);return K6r(f,s)}t(Q6r,"getPolicyNamesUsingSchemaValidationPolicies");function K6r(a,s){let c=new Set;a.policies?.forEach(d=>{d.handler?.export&&s.has(d.handler.export)&&d.handler.module==="$import(@zuplo/runtime)"&&c.add(d.name)});let f=Y6r(a,c);return new Set([...c,...f])}t(K6r,"getPolicyNamesReferencingPolicyHandlers");function Y6r(a,s){let c=new Set;return a.policies?.forEach(f=>{f.handler?.export==="CompositeInboundPolicy"&&f.handler?.options?.policies?.forEach(d=>{s.has(d)&&c.add(f.name)})}),c}t(Y6r,"getCompositePoliciesContainingPolicy");function X6r(a,s){if(!a["x-zuplo-route"]||!a["x-zuplo-route"].policies)return!1;let c=a["x-zuplo-route"].policies.inbound;if(c){for(let d of c)if(s.has(d))return!0}let f=a["x-zuplo-route"].policies.outbound;if(f){for(let d of f)if(s.has(d))return!0}return!1}t(X6r,"isPolicyPresentInOperation");async function Z6r(a,s){let c=[];for(let f of a){let d=await eRe.readFile(f,"utf-8"),E=JSON.parse(d).paths;for(let A in E){let O=E[A];for(let M in O){let H=O[M];X6r(H,s)&&c.push({fileName:Y7.basename(f,".oas.json"),path:A,method:M})}}}return c}t(Z6r,"getRoutesContainingPolicies");import{mkdirSync as e4r,writeFileSync as t4r}from"fs";import r4r from"path";function OCt(a){return{name:"write-modules-plugin",setup(s){s.onEnd(async c=>{if(c){let f=hU(a.sourceDirectory,c.metafile);e4r(a.outputDirectory,{recursive:!0}),t4r(r4r.join(a.outputDirectory,"modules.json"),JSON.stringify(f,null,2))}})}}}t(OCt,"writeModulesPlugin");var n4r=p1t("zuplo:core:build"),i4r=["workerd","worker","browser"],RCt=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],tRe.resolve(FCt(LCt(import.meta.url)),"..","..","..","node_modules"),tRe.resolve(FCt(LCt(import.meta.url)),"..","..","..","..","..","node_modules")];async function WY({systemDirectory:a,outputDirectory:s,sourceDirectory:c,cacheDirectory:f,logger:d,minify:v=!0,command:E,flags:A}){let O=tRe.join(a,Uue);n4r(`Building with node paths: ${RCt.join(", ")}`);let M=v&&E!=="dev"&&!process.env.DEBUG_BUILD_DISABLE_MINIFY?{minify:!0,chunkNames:"[hash]"}:{minify:!1,keepNames:!0,chunkNames:"[name]-[hash]"},H=Object.freeze({sourceDirectory:c,outputDirectory:s,cacheDirectory:f,logger:d,debugMode:Mh.DEBUG_BUILD_MODE,flags:A});return{platform:"browser",target:"es2022",outdir:s,splitting:!0,metafile:!0,format:"esm",nodePaths:RCt,entryPoints:[O],sourcemap:"linked",legalComments:"none",treeShaking:!0,bundle:!0,...M,external:[],logLevel:"silent",conditions:i4r,plugins:[s2t(H),d1t(H),ECt(H),DCt(H),ICt(H),kCt(),t2t(H),bCt(H),TCt(H),OCt(H)]}}t(WY,"getBaseESBuildConfig");var X7="run-esbuild",jCt=t(async function({systemDirectory:a,outputDirectory:s,sourceDirectory:c,cacheDirectory:f,buildId:d,logger:v,config:E,command:A,minify:O},{data:M}){return f_.timeFn("Running esbuild",async()=>{v.debug("Running esbuild");let H=await WY({command:A,minify:O,systemDirectory:a,outputDirectory:s,cacheDirectory:f,sourceDirectory:c,logger:v,flags:E.flags}),$;try{if(!await iB(c))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");$=await MCt.build(H),M.set("metafile",$.metafile)}catch(xe){if(v.error(xe),xe.errors||xe.warnings)$=xe;else if(xe.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))$={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:X7,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw xe}$.errors.length>0&&$.errors.length>1&&($.errors.length=1);let{errors:K,warnings:Ne}=rRe({buildId:d,result:$});return{errors:K,warnings:Ne}})},"runEsbuild");function rRe({buildId:a,result:s}){return{status:s.errors.length>0?"Failed":s.warnings.length>0?"Warnings":"Good",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:a,warnings:s.warnings.map(f=>f.text==="Using direct eval with a bundler is not recommended and may cause problems"?{location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:"We do not support the use of 'eval' or 'new Function(...)'",severity:Lue,pluginName:f.pluginName||X7}:{location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:f.text,severity:Lue,pluginName:f.pluginName||X7}),errors:s.errors.map(f=>({location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:f.text,severity:V3e,pluginName:f.pluginName||X7})),metafile:s.metafile}}t(rRe,"esbuildResultToBuildResult");var s4r=t((a,s)=>{let c=s;if(s.includes(a)){let f=new RegExp(`.*(${a})`,"g");c=s.replace(f,"")}return c.match(/^(\/)?(\.\.(\/)?)+/)&&(c=c.replace(/^(\/)?(\.\.(\/)?)+/,"/")),c},"removePrefixFromString"),a4r=t((a,s)=>{let c=s;if(c.includes(a)){let f=new RegExp(`[a-zA-Z0-9-_.\\/]+(${a})`,"g");c=c.replace(f,"")}return c},"cleanFilePathsInMessage"),BCt=t((a,s,c)=>{if(!a||a.length<=0)return a;let f=a.filter(d=>d.message!=='Could not resolve "@zuplo/runtime"');return f&&f.length>0&&f.forEach(d=>{try{d.location&&d.location.file&&(d.location.file=s4r(s,d.location.file)),d.location&&d.location.lineText&&d.location.lineText.includes("@zuplo/core/index.minified.js")&&(d.location.lineText=d.location.lineText.substring(0,200)+"...<Truncated>"),d.message=a4r(s,d.message),d.notes&&d.notes.length>0&&delete d.notes,d.text&&delete d.text,d.pluginName===""&&(d.pluginName=c)}catch{}}),f},"cleanDataOnBuildIssue");function UCt(a,s){let c=nRe.basename(s);a.errors&&(a.errors=BCt(a.errors,c,X7)),a.warnings&&(a.warnings=BCt(a.warnings,c,X7))}t(UCt,"formatBuildResult");var o4r=t(a=>nRe.basename(a).startsWith("."),"isHiddenOnUnix"),c4r=t((a,s=[])=>s.map(c=>c.startsWith(".")?c:`.${c}`).some(c=>a.endsWith(c)),"hasMatchingExtname");function KLe(a,s=[],c=!1){let f=[],d;if(!Ude.existsSync(a)){let v;if(wQ.hasMagic(a))v=a;else{let E=s.map(A=>A.startsWith(".")?A:`.${A}`).join("|");v=`${a}+(${E})`}if(f.push(...wQ.sync(v,{nodir:!0})),!f.length)throw Error(`Cannot find any files matching pattern "${a}"`);return f}try{if(d=Ude.statSync(a),d.isFile())return[a]}catch{return[]}return Ude.readdirSync(a).forEach(v=>{let E=nRe.join(a,v),A;try{if(A=Ude.statSync(E),A.isDirectory()){c&&f.push(...KLe(E,s,c));return}}catch{return}if(!s.length)throw Error(`Argument '${s}' required when argument '${a}' is a directory`);!A.isFile()||!c4r(E,s)||o4r(E)||f.push(E)}),f}t(KLe,"lookupFiles");var Z7=new Vue({level:process.env.FORCE_BUILD_COLORS?2:void 0}),sI=` ${Z7.gray("|")} `;function iRe({output:a,buildId:s,runtimeVersion:c,compatibilityDate:f}){let d=["Building Zuplo API...",`${sI}Build ID: ${s}`,`${sI}Runtime Version: ${c}`];f&&d.push(`${sI}Compatibility Date: ${f}`),a.info(d.join(`
635
635
  `))}t(iRe,"outputApiBuildStart");async function $de(a,s,c){UCt(c,a),await Promise.all(c.warnings.map(async f=>$Ct(a,s,f))),await Promise.all(c.errors.map(async f=>$Ct(a,s,f))),c.status==="Good"?s.info(Z7.green("Build succeeded"),{status:"success"}):c.status==="Warnings"?s.warn(Z7.yellow("Build succeeded with warnings"),{status:"success"}):c.status==="Failed"&&s.error(Z7.red("Build failed."),{status:"failed"})}t($de,"outputBuildResult");async function $Ct(a,s,c){let f=[],d=c.severity??"error",v=d==="error"?Z7.red:Z7.yellow,E=v(`${d.toUpperCase()}: ${c.message}${c.detail?`
636
636
  ${sI}${c.detail.toString().split(`
package/index.minified.js CHANGED
@@ -630,7 +630,7 @@ Did you specify these with the most recent transformation maps first?`);let d=C5
630
630
  //# sourceMappingURL=data:application/json;base64,`,obt=vp(()=>process.sourceMapsEnabled??!0,"shouldApplySourceMap"),cbt=vp(({code:a,map:s})=>a+BTr+Buffer.from(JSON.stringify(s),"utf8").toString("base64"),"inlineSourceMap"),UTr=[".cts",".mts",".ts",".tsx",".jsx"],$Tr=[".js",".cjs",".mjs"],lbt=[".ts",".tsx",".jsx"],x5e=vp((a,s,c,f)=>{let d=Object.getOwnPropertyDescriptor(a,s);d?.set?a[s]=c:(!d||d.configurable)&&Object.defineProperty(a,s,{value:c,enumerable:d?.enumerable||f?.enumerable,writable:f?.writable??(d?d.writable:!0),configurable:f?.configurable??(d?d.configurable:!0)})},"safeSet"),JTr=vp((a,s,c)=>{let f=s[".js"],d=vp((v,E)=>{if(a.enabled===!1)return f(v,E);let[A,O]=E.split("?");if((new URLSearchParams(O).get("namespace")??void 0)!==c)return f(v,E);v.id.startsWith("data:text/javascript,")&&(v.path=NS.dirname(A)),$pe?.send&&$pe.send({type:"dependency",path:A});let M=UTr.some(K=>A.endsWith(K)),H=$Tr.some(K=>A.endsWith(K));if(!M&&!H)return f(v,A);let $=FTr.readFileSync(A,"utf8");if(A.endsWith(".cjs")){let K=Upe(E,$);K&&($=obt()?cbt(K):K.code)}else if(M||bvt($)){let K=sbt($,E,{tsconfigRaw:ybt?.(A)});$=obt()?cbt(K):K.code}v._compile($,A)},"transformer");x5e(s,".js",d);for(let v of lbt)x5e(s,v,d,{enumerable:!c,writable:!0,configurable:!0});return x5e(s,".mjs",d,{writable:!0,configurable:!0}),()=>{s[".js"]===d&&(s[".js"]=f);for(let v of[...lbt,".mjs"])s[v]===d&&delete s[v]}},"createExtensions"),zTr=vp(a=>s=>{if((s==="."||s===".."||s.endsWith("/.."))&&(s+="/"),mbt.test(s)){let c=NS.join(s,"index.js");s.startsWith("./")&&(c=`./${c}`);try{return a(c)}catch{}}try{return a(s)}catch(c){let f=c;if(f.code==="MODULE_NOT_FOUND")try{return a(`${s}${NS.sep}index.js`)}catch{}throw f}},"createImplicitResolver"),bbt=[".js",".json"],Sbt=[".ts",".tsx",".jsx"],qTr=[...Sbt,...bbt],VTr=[...bbt,...Sbt],iY=Object.create(null);iY[".js"]=[".ts",".tsx",".js",".jsx"],iY[".jsx"]=[".tsx",".ts",".jsx",".js"],iY[".cjs"]=[".cts"],iY[".mjs"]=[".mts"];var WTr=vp(a=>{let s=a.split("?"),c=s[1]?`?${s[1]}`:"",[f]=s,d=NS.extname(f),v=[],E=iY[d];if(E){let O=f.slice(0,-d.length);v.push(...E.map(M=>O+M+c))}let A=!(a.startsWith(sY)||zpe(f))||f.includes(gbt)||f.includes("/node_modules/")?VTr:qTr;return v.push(...A.map(O=>f+O+c)),v},"mapTsExtensions"),Jpe=vp((a,s,c)=>{if(mbt.test(s)||!c&&!vbt)return;let f=WTr(s);if(f)for(let d of f)try{return a(d)}catch(v){let{code:E}=v;if(E!=="MODULE_NOT_FOUND"&&E!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw v}},"resolveTsFilename"),HTr=vp((a,s)=>c=>{if(zpe(c)){let f=Jpe(a,c,s);if(f)return f}try{return a(c)}catch(f){let d=f;if(d.code==="MODULE_NOT_FOUND"){if(typeof d.path=="string"&&d.path.endsWith(`${NS.sep}package.json`)){let E=d.message.match(/^Cannot find module '([^']+)'$/);if(E){let O=E[1],M=Jpe(a,O,s);if(M)return M}let A=d.message.match(/^Cannot find module '([^']+)'. Please verify that the package.json has a valid "main" entry$/);if(A){let O=A[1],M=Jpe(a,O,s);if(M)return M}}let v=Jpe(a,c,s);if(v)return v}throw d}},"createTsExtensionResolver"),ubt="at cjsPreparseModuleExports (node:internal",GTr=vp(a=>{let s=a.stack.split(`
631
631
  `).slice(1);return s[1].includes(ubt)||s[2].includes(ubt)},"isFromCjsLexer"),QTr=vp((a,s)=>{let c=a.split("?"),f=new URLSearchParams(c[1]);if(s?.filename){let d=pbt(s.filename),v;if(d){let A=d.split("?"),O=A[0];v=A[1],s.filename=O,s.path=NS.dirname(O),s.paths=pk._nodeModulePaths(s.path),pk._cache[O]=s}v||(v=s.filename.split("?")[1]);let E=new URLSearchParams(v).get("namespace");E&&f.append("namespace",E)}return[c[0],f,(d,v)=>(NS.isAbsolute(d)&&!d.endsWith(".json")&&!d.endsWith(".node")&&!(v===0&&GTr(new Error))&&(d+=A5e(f)),d)]},"preserveQuery"),KTr=vp((a,s,c)=>{if(a.startsWith(sY)&&(a=_bt(a)),D5e&&!zpe(a)&&!s?.filename?.includes(gbt)){let f=D5e(a);for(let d of f)try{return c(d)}catch{}}return c(a)},"resolveTsPaths"),YTr=vp((a,s,c)=>(f,d,...v)=>{if(a.enabled===!1)return s(f,d,...v);f=k5e(f);let[E,A,O]=QTr(f,d);if((A.get("namespace")??void 0)!==c)return s(f,d,...v);let M=vp($=>s($,d,...v),"nextResolveSimple");M=HTr(M,!!(c||d?.filename&&MTr.test(d.filename))),M=zTr(M);let H=KTr(E,d,M);return O(H,v.length)},"createResolveFilename"),fbt=vp((a,s)=>{if(!s)throw new Error("The current file path (__filename or import.meta.url) must be provided in the second argument of tsx.require()");return a.startsWith(".")?((typeof s=="string"&&s.startsWith(sY)||s instanceof URL)&&(s=_bt(s)),NS.resolve(NS.dirname(s),a)):a},"resolveContext"),aY=vp(a=>{let{sourceMapsEnabled:s}=process,c={enabled:!0};jTr(process.env.TSX_TSCONFIG_PATH),process.setSourceMapsEnabled(!0);let f=pk._resolveFilename,d=YTr(c,f,a?.namespace);pk._resolveFilename=d;let v=JTr(c,pk._extensions,a?.namespace),E=vp(()=>{s===!1&&process.setSourceMapsEnabled(!1),c.enabled=!1,pk._resolveFilename===d&&(pk._resolveFilename=f),v()},"unregister");if(a?.namespace){let A=vp((M,H)=>{let $=fbt(M,H),[K,Ne]=$.split("?"),xe=new URLSearchParams(Ne);return a.namespace&&!K.startsWith("node:")&&xe.set("namespace",a.namespace),C7(K+A5e(xe))},"scopedRequire");E.require=A;let O=vp((M,H,$)=>{let K=fbt(M,H),[Ne,xe]=K.split("?"),Te=new URLSearchParams(xe);return a.namespace&&!Ne.startsWith("node:")&&Te.set("namespace",a.namespace),d(Ne+A5e(Te),module,!1,$)},"scopedResolve");E.resolve=O,E.unregister=E}return E},"register");import{pathToFileURL as eCr}from"url";var XTr=Object.defineProperty,Vpe=t((a,s)=>XTr(a,"name",{value:s,configurable:!0}),"o"),tCr=Vpe(a=>(s,c)=>{if(!c)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");let f=c.startsWith(sY)?c:eCr(c).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:f,namespace:a})}`)},"createScopedImport"),Tbt=!1,Cbt=Vpe(a=>{if(!qpe.register)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Tbt){let{_resolveFilename:A}=qpe;qpe._resolveFilename=(O,...M)=>A(k5e(O),...M),Tbt=!0}let{sourceMapsEnabled:s}=process;process.setSourceMapsEnabled(!0);let{port1:c,port2:f}=new ZTr;qpe.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:f,namespace:a?.namespace,tsconfig:a?.tsconfig},transferList:[f]});let d=a?.onImport,v=d&&(A=>{A.type==="load"&&d(A.url)});v&&(c.on("message",v),c.unref());let E=Vpe(()=>(s===!1&&process.setSourceMapsEnabled(!1),v&&c.off("message",v),c.postMessage("deactivate"),new Promise(A=>{let O=Vpe(M=>{M.type==="deactivated"&&(A(),c.off("message",O))},"onDeactivated");c.on("message",O)})),"unregister");return a?.namespace&&(E.import=tCr(a.namespace),E.unregister=E),E},"register");var rCr=Object.defineProperty,xbt=t((a,s)=>rCr(a,"name",{value:s,configurable:!0}),"a"),cU,Wpe=xbt((a,s)=>(cU||(cU=aY({namespace:Date.now().toString()})),cU.require(a,s)),"tsxRequire"),Ebt=xbt((a,s,c)=>(cU||(cU=aY({namespace:Date.now().toString()})),cU.resolve(a,s,c)),"resolve");Ebt.paths=C7.resolve.paths,Wpe.resolve=Ebt,Wpe.main=C7.main,Wpe.extensions=C7.extensions,Wpe.cache=C7.cache;var nCr=Object.defineProperty,Dbt=t((a,s)=>nCr(a,"name",{value:s,configurable:!0}),"o"),iCr=Dbt((a,s)=>{let c=a[0]-s[0];if(c===0){let f=a[1]-s[1];return f===0?a[2]>=s[2]:f>0}return c>0},"isVersionGreaterOrEqual"),sCr=process.versions.node.split(".").map(Number),Abt=Dbt((a,s=sCr)=>{for(let c=0;c<a.length;c+=1){let f=a[c];if(c===a.length-1||s[0]===f[0])return iCr(s,f)}return!1},"isFeatureSupported");var kbt=[[20,11,0],[21,3,0]];import"esbuild";var aCr=Object.defineProperty,oCr=t((a,s)=>aCr(a,"name",{value:s,configurable:!0}),"i"),wbt=oCr((a,s)=>{if(!s||typeof s=="object"&&!s.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");let c=typeof s=="string",f=c?s:s.parentURL,d=Date.now().toString(),v=aY({namespace:d});return!Abt(kbt)&&!hbt.test(a)&&dbt.test(a)?Promise.resolve(v.require(a,f)):Cbt({namespace:d,...c?{}:s}).import(a,f)},"tsImport");var of;(function(a){a.assertEqual=d=>d;function s(d){}t(s,"assertIs"),a.assertIs=s;function c(d){throw new Error}t(c,"assertNever"),a.assertNever=c,a.arrayToEnum=d=>{let v={};for(let E of d)v[E]=E;return v},a.getValidEnumValues=d=>{let v=a.objectKeys(d).filter(A=>typeof d[d[A]]!="number"),E={};for(let A of v)E[A]=d[A];return a.objectValues(E)},a.objectValues=d=>a.objectKeys(d).map(function(v){return d[v]}),a.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{let v=[];for(let E in d)Object.prototype.hasOwnProperty.call(d,E)&&v.push(E);return v},a.find=(d,v)=>{for(let E of d)if(v(E))return E},a.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&isFinite(d)&&Math.floor(d)===d;function f(d,v=" | "){return d.map(E=>typeof E=="string"?`'${E}'`:E).join(v)}t(f,"joinValues"),a.joinValues=f,a.jsonStringifyReplacer=(d,v)=>typeof v=="bigint"?v.toString():v})(of||(of={}));var P5e;(function(a){a.mergeShapes=(s,c)=>({...s,...c})})(P5e||(P5e={}));var Xa=of.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),GN=t(a=>{switch(typeof a){case"undefined":return Xa.undefined;case"string":return Xa.string;case"number":return isNaN(a)?Xa.nan:Xa.number;case"boolean":return Xa.boolean;case"function":return Xa.function;case"bigint":return Xa.bigint;case"symbol":return Xa.symbol;case"object":return Array.isArray(a)?Xa.array:a===null?Xa.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?Xa.promise:typeof Map<"u"&&a instanceof Map?Xa.map:typeof Set<"u"&&a instanceof Set?Xa.set:typeof Date<"u"&&a instanceof Date?Xa.date:Xa.object;default:return Xa.unknown}},"getParsedType"),As=of.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"]),cCr=t(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),IS=class a extends Error{static{t(this,"ZodError")}constructor(s){super(),this.issues=[],this.addIssue=f=>{this.issues=[...this.issues,f]},this.addIssues=(f=[])=>{this.issues=[...this.issues,...f]};let c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=s}get errors(){return this.issues}format(s){let c=s||function(v){return v.message},f={_errors:[]},d=t(v=>{for(let E of v.issues)if(E.code==="invalid_union")E.unionErrors.map(d);else if(E.code==="invalid_return_type")d(E.returnTypeError);else if(E.code==="invalid_arguments")d(E.argumentsError);else if(E.path.length===0)f._errors.push(c(E));else{let A=f,O=0;for(;O<E.path.length;){let M=E.path[O];O===E.path.length-1?(A[M]=A[M]||{_errors:[]},A[M]._errors.push(c(E))):A[M]=A[M]||{_errors:[]},A=A[M],O++}}},"processError");return d(this),f}static assert(s){if(!(s instanceof a))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,of.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(s=c=>c.message){let c={},f=[];for(let d of this.issues)d.path.length>0?(c[d.path[0]]=c[d.path[0]]||[],c[d.path[0]].push(s(d))):f.push(s(d));return{formErrors:f,fieldErrors:c}}get formErrors(){return this.flatten()}};IS.create=a=>new IS(a);var fU=t((a,s)=>{let c;switch(a.code){case As.invalid_type:a.received===Xa.undefined?c="Required":c=`Expected ${a.expected}, received ${a.received}`;break;case As.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(a.expected,of.jsonStringifyReplacer)}`;break;case As.unrecognized_keys:c=`Unrecognized key(s) in object: ${of.joinValues(a.keys,", ")}`;break;case As.invalid_union:c="Invalid input";break;case As.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${of.joinValues(a.options)}`;break;case As.invalid_enum_value:c=`Invalid enum value. Expected ${of.joinValues(a.options)}, received '${a.received}'`;break;case As.invalid_arguments:c="Invalid function arguments";break;case As.invalid_return_type:c="Invalid function return type";break;case As.invalid_date:c="Invalid date";break;case As.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(c=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(c=`${c} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?c=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?c=`Invalid input: must end with "${a.validation.endsWith}"`:of.assertNever(a.validation):a.validation!=="regex"?c=`Invalid ${a.validation}`:c="Invalid";break;case As.too_small:a.type==="array"?c=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?c=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?c=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?c=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:c="Invalid input";break;case As.too_big:a.type==="array"?c=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?c=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?c=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?c=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?c=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:c="Invalid input";break;case As.custom:c="Invalid input";break;case As.invalid_intersection_types:c="Intersection results could not be merged";break;case As.not_multiple_of:c=`Number must be a multiple of ${a.multipleOf}`;break;case As.not_finite:c="Number must be finite";break;default:c=s.defaultError,of.assertNever(a)}return{message:c}},"errorMap"),Ibt=fU;function lCr(a){Ibt=a}t(lCr,"setErrorMap");function Hpe(){return Ibt}t(Hpe,"getErrorMap");var Gpe=t(a=>{let{data:s,path:c,errorMaps:f,issueData:d}=a,v=[...c,...d.path||[]],E={...d,path:v};if(d.message!==void 0)return{...d,path:v,message:d.message};let A="",O=f.filter(M=>!!M).slice().reverse();for(let M of O)A=M(E,{data:s,defaultError:A}).message;return{...d,path:v,message:A}},"makeIssue"),uCr=[];function Ba(a,s){let c=Hpe(),f=Gpe({issueData:s,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,c,c===fU?void 0:fU].filter(d=>!!d)});a.common.issues.push(f)}t(Ba,"addIssueToContext");var u1=class a{static{t(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(s,c){let f=[];for(let d of c){if(d.status==="aborted")return Oc;d.status==="dirty"&&s.dirty(),f.push(d.value)}return{status:s.value,value:f}}static async mergeObjectAsync(s,c){let f=[];for(let d of c){let v=await d.key,E=await d.value;f.push({key:v,value:E})}return a.mergeObjectSync(s,f)}static mergeObjectSync(s,c){let f={};for(let d of c){let{key:v,value:E}=d;if(v.status==="aborted"||E.status==="aborted")return Oc;v.status==="dirty"&&s.dirty(),E.status==="dirty"&&s.dirty(),v.value!=="__proto__"&&(typeof E.value<"u"||d.alwaysSet)&&(f[v.value]=E.value)}return{status:s.value,value:f}}},Oc=Object.freeze({status:"aborted"}),uU=t(a=>({status:"dirty",value:a}),"DIRTY"),Nv=t(a=>({status:"valid",value:a}),"OK"),N5e=t(a=>a.status==="aborted","isAborted"),I5e=t(a=>a.status==="dirty","isDirty"),lY=t(a=>a.status==="valid","isValid"),uY=t(a=>typeof Promise<"u"&&a instanceof Promise,"isAsync");function Qpe(a,s,c,f){if(c==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?a!==s||!f:!s.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?f:c==="a"?f.call(a):f?f.value:s.get(a)}t(Qpe,"__classPrivateFieldGet");function Obt(a,s,c,f,d){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?a!==s||!d:!s.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?d.call(a,c):d?d.value=c:s.set(a,c),c}t(Obt,"__classPrivateFieldSet");var Jo;(function(a){a.errToObj=s=>typeof s=="string"?{message:s}:s||{},a.toString=s=>typeof s=="string"?s:s?.message})(Jo||(Jo={}));var oY,cY,IC=class{static{t(this,"ParseInputLazyPath")}constructor(s,c,f,d){this._cachedPath=[],this.parent=s,this.data=c,this._path=f,this._key=d}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}},Pbt=t((a,s)=>{if(lY(s))return{success:!0,data:s.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 c=new IS(a.common.issues);return this._error=c,this._error}}},"handleResult");function xl(a){if(!a)return{};let{errorMap:s,invalid_type_error:c,required_error:f,description:d}=a;if(s&&(c||f))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return s?{errorMap:s,description:d}:{errorMap:t((E,A)=>{var O,M;let{message:H}=a;return E.code==="invalid_enum_value"?{message:H??A.defaultError}:typeof A.data>"u"?{message:(O=H??f)!==null&&O!==void 0?O:A.defaultError}:E.code!=="invalid_type"?{message:A.defaultError}:{message:(M=H??c)!==null&&M!==void 0?M:A.defaultError}},"customMap"),description:d}}t(xl,"processCreateParams");var Dl=class{static{t(this,"ZodType")}constructor(s){this.spa=this.safeParseAsync,this._def=s,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(s){return GN(s.data)}_getOrReturnCtx(s,c){return c||{common:s.parent.common,data:s.data,parsedType:GN(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}_processInputParams(s){return{status:new u1,ctx:{common:s.parent.common,data:s.data,parsedType:GN(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}}_parseSync(s){let c=this._parse(s);if(uY(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(s){let c=this._parse(s);return Promise.resolve(c)}parse(s,c){let f=this.safeParse(s,c);if(f.success)return f.data;throw f.error}safeParse(s,c){var f;let d={common:{issues:[],async:(f=c?.async)!==null&&f!==void 0?f:!1,contextualErrorMap:c?.errorMap},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:GN(s)},v=this._parseSync({data:s,path:d.path,parent:d});return Pbt(d,v)}async parseAsync(s,c){let f=await this.safeParseAsync(s,c);if(f.success)return f.data;throw f.error}async safeParseAsync(s,c){let f={common:{issues:[],contextualErrorMap:c?.errorMap,async:!0},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:GN(s)},d=this._parse({data:s,path:f.path,parent:f}),v=await(uY(d)?d:Promise.resolve(d));return Pbt(f,v)}refine(s,c){let f=t(d=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(d):c,"getIssueProperties");return this._refinement((d,v)=>{let E=s(d),A=t(()=>v.addIssue({code:As.custom,...f(d)}),"setError");return typeof Promise<"u"&&E instanceof Promise?E.then(O=>O?!0:(A(),!1)):E?!0:(A(),!1)})}refinement(s,c){return this._refinement((f,d)=>s(f)?!0:(d.addIssue(typeof c=="function"?c(f,d):c),!1))}_refinement(s){return new OS({schema:this,typeName:kc.ZodEffects,effect:{type:"refinement",refinement:s}})}superRefine(s){return this._refinement(s)}optional(){return NC.create(this,this._def)}nullable(){return mk.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return k6.create(this,this._def)}promise(){return YN.create(this,this._def)}or(s){return I7.create([this,s],this._def)}and(s){return O7.create(this,s,this._def)}transform(s){return new OS({...xl(this._def),schema:this,typeName:kc.ZodEffects,effect:{type:"transform",transform:s}})}default(s){let c=typeof s=="function"?s:()=>s;return new j7({...xl(this._def),innerType:this,defaultValue:c,typeName:kc.ZodDefault})}brand(){return new fY({typeName:kc.ZodBranded,type:this,...xl(this._def)})}catch(s){let c=typeof s=="function"?s:()=>s;return new B7({...xl(this._def),innerType:this,catchValue:c,typeName:kc.ZodCatch})}describe(s){let c=this.constructor;return new c({...this._def,description:s})}pipe(s){return _Y.create(this,s)}readonly(){return U7.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fCr=/^c[^\s-]{8,}$/i,_Cr=/^[0-9a-z]+$/,pCr=/^[0-9A-HJKMNP-TV-Z]{26}$/,dCr=/^[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,mCr=/^[a-z0-9_-]{21}$/i,hCr=/^[-+]?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)?)??$/,gCr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yCr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",w5e,vCr=/^(?:(?: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])$/,bCr=/^(([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})))$/,SCr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fbt="((\\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])))",TCr=new RegExp(`^${Fbt}$`);function Lbt(a){let s="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?s=`${s}\\.\\d{${a.precision}}`:a.precision==null&&(s=`${s}(\\.\\d+)?`),s}t(Lbt,"timeRegexSource");function CCr(a){return new RegExp(`^${Lbt(a)}$`)}t(CCr,"timeRegex");function Rbt(a){let s=`${Fbt}T${Lbt(a)}`,c=[];return c.push(a.local?"Z?":"Z"),a.offset&&c.push("([+-]\\d{2}:?\\d{2})"),s=`${s}(${c.join("|")})`,new RegExp(`^${s}$`)}t(Rbt,"datetimeRegex");function ECr(a,s){return!!((s==="v4"||!s)&&vCr.test(a)||(s==="v6"||!s)&&bCr.test(a))}t(ECr,"isValidIP");var QN=class a extends Dl{static{t(this,"ZodString")}_parse(s){if(this._def.coerce&&(s.data=String(s.data)),this._getType(s)!==Xa.string){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.string,received:v.parsedType}),Oc}let f=new u1,d;for(let v of this._def.checks)if(v.kind==="min")s.data.length<v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),f.dirty());else if(v.kind==="max")s.data.length>v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),f.dirty());else if(v.kind==="length"){let E=s.data.length>v.value,A=s.data.length<v.value;(E||A)&&(d=this._getOrReturnCtx(s,d),E?Ba(d,{code:As.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message}):A&&Ba(d,{code:As.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message}),f.dirty())}else if(v.kind==="email")gCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"email",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="emoji")w5e||(w5e=new RegExp(yCr,"u")),w5e.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"emoji",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="uuid")dCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"uuid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="nanoid")mCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"nanoid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="cuid")fCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"cuid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="cuid2")_Cr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"cuid2",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="ulid")pCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"ulid",code:As.invalid_string,message:v.message}),f.dirty());else if(v.kind==="url")try{new URL(s.data)}catch{d=this._getOrReturnCtx(s,d),Ba(d,{validation:"url",code:As.invalid_string,message:v.message}),f.dirty()}else v.kind==="regex"?(v.regex.lastIndex=0,v.regex.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"regex",code:As.invalid_string,message:v.message}),f.dirty())):v.kind==="trim"?s.data=s.data.trim():v.kind==="includes"?s.data.includes(v.value,v.position)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{includes:v.value,position:v.position},message:v.message}),f.dirty()):v.kind==="toLowerCase"?s.data=s.data.toLowerCase():v.kind==="toUpperCase"?s.data=s.data.toUpperCase():v.kind==="startsWith"?s.data.startsWith(v.value)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{startsWith:v.value},message:v.message}),f.dirty()):v.kind==="endsWith"?s.data.endsWith(v.value)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:{endsWith:v.value},message:v.message}),f.dirty()):v.kind==="datetime"?Rbt(v).test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"datetime",message:v.message}),f.dirty()):v.kind==="date"?TCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"date",message:v.message}),f.dirty()):v.kind==="time"?CCr(v).test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.invalid_string,validation:"time",message:v.message}),f.dirty()):v.kind==="duration"?hCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"duration",code:As.invalid_string,message:v.message}),f.dirty()):v.kind==="ip"?ECr(s.data,v.version)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"ip",code:As.invalid_string,message:v.message}),f.dirty()):v.kind==="base64"?SCr.test(s.data)||(d=this._getOrReturnCtx(s,d),Ba(d,{validation:"base64",code:As.invalid_string,message:v.message}),f.dirty()):of.assertNever(v);return{status:f.value,value:s.data}}_regex(s,c,f){return this.refinement(d=>s.test(d),{validation:c,code:As.invalid_string,...Jo.errToObj(f)})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}email(s){return this._addCheck({kind:"email",...Jo.errToObj(s)})}url(s){return this._addCheck({kind:"url",...Jo.errToObj(s)})}emoji(s){return this._addCheck({kind:"emoji",...Jo.errToObj(s)})}uuid(s){return this._addCheck({kind:"uuid",...Jo.errToObj(s)})}nanoid(s){return this._addCheck({kind:"nanoid",...Jo.errToObj(s)})}cuid(s){return this._addCheck({kind:"cuid",...Jo.errToObj(s)})}cuid2(s){return this._addCheck({kind:"cuid2",...Jo.errToObj(s)})}ulid(s){return this._addCheck({kind:"ulid",...Jo.errToObj(s)})}base64(s){return this._addCheck({kind:"base64",...Jo.errToObj(s)})}ip(s){return this._addCheck({kind:"ip",...Jo.errToObj(s)})}datetime(s){var c,f;return typeof s=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:s}):this._addCheck({kind:"datetime",precision:typeof s?.precision>"u"?null:s?.precision,offset:(c=s?.offset)!==null&&c!==void 0?c:!1,local:(f=s?.local)!==null&&f!==void 0?f:!1,...Jo.errToObj(s?.message)})}date(s){return this._addCheck({kind:"date",message:s})}time(s){return typeof s=="string"?this._addCheck({kind:"time",precision:null,message:s}):this._addCheck({kind:"time",precision:typeof s?.precision>"u"?null:s?.precision,...Jo.errToObj(s?.message)})}duration(s){return this._addCheck({kind:"duration",...Jo.errToObj(s)})}regex(s,c){return this._addCheck({kind:"regex",regex:s,...Jo.errToObj(c)})}includes(s,c){return this._addCheck({kind:"includes",value:s,position:c?.position,...Jo.errToObj(c?.message)})}startsWith(s,c){return this._addCheck({kind:"startsWith",value:s,...Jo.errToObj(c)})}endsWith(s,c){return this._addCheck({kind:"endsWith",value:s,...Jo.errToObj(c)})}min(s,c){return this._addCheck({kind:"min",value:s,...Jo.errToObj(c)})}max(s,c){return this._addCheck({kind:"max",value:s,...Jo.errToObj(c)})}length(s,c){return this._addCheck({kind:"length",value:s,...Jo.errToObj(c)})}nonempty(s){return this.min(1,Jo.errToObj(s))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(s=>s.kind==="datetime")}get isDate(){return!!this._def.checks.find(s=>s.kind==="date")}get isTime(){return!!this._def.checks.find(s=>s.kind==="time")}get isDuration(){return!!this._def.checks.find(s=>s.kind==="duration")}get isEmail(){return!!this._def.checks.find(s=>s.kind==="email")}get isURL(){return!!this._def.checks.find(s=>s.kind==="url")}get isEmoji(){return!!this._def.checks.find(s=>s.kind==="emoji")}get isUUID(){return!!this._def.checks.find(s=>s.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(s=>s.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(s=>s.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(s=>s.kind==="cuid2")}get isULID(){return!!this._def.checks.find(s=>s.kind==="ulid")}get isIP(){return!!this._def.checks.find(s=>s.kind==="ip")}get isBase64(){return!!this._def.checks.find(s=>s.kind==="base64")}get minLength(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxLength(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}};QN.create=a=>{var s;return new QN({checks:[],typeName:kc.ZodString,coerce:(s=a?.coerce)!==null&&s!==void 0?s:!1,...xl(a)})};function xCr(a,s){let c=(a.toString().split(".")[1]||"").length,f=(s.toString().split(".")[1]||"").length,d=c>f?c:f,v=parseInt(a.toFixed(d).replace(".","")),E=parseInt(s.toFixed(d).replace(".",""));return v%E/Math.pow(10,d)}t(xCr,"floatSafeRemainder");var D7=class a extends Dl{static{t(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(s){if(this._def.coerce&&(s.data=Number(s.data)),this._getType(s)!==Xa.number){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.number,received:v.parsedType}),Oc}let f,d=new u1;for(let v of this._def.checks)v.kind==="int"?of.isInteger(s.data)||(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.invalid_type,expected:"integer",received:"float",message:v.message}),d.dirty()):v.kind==="min"?(v.inclusive?s.data<v.value:s.data<=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),d.dirty()):v.kind==="max"?(v.inclusive?s.data>v.value:s.data>=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),d.dirty()):v.kind==="multipleOf"?xCr(s.data,v.value)!==0&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_multiple_of,multipleOf:v.value,message:v.message}),d.dirty()):v.kind==="finite"?Number.isFinite(s.data)||(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_finite,message:v.message}),d.dirty()):of.assertNever(v);return{status:d.value,value:s.data}}gte(s,c){return this.setLimit("min",s,!0,Jo.toString(c))}gt(s,c){return this.setLimit("min",s,!1,Jo.toString(c))}lte(s,c){return this.setLimit("max",s,!0,Jo.toString(c))}lt(s,c){return this.setLimit("max",s,!1,Jo.toString(c))}setLimit(s,c,f,d){return new a({...this._def,checks:[...this._def.checks,{kind:s,value:c,inclusive:f,message:Jo.toString(d)}]})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}int(s){return this._addCheck({kind:"int",message:Jo.toString(s)})}positive(s){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jo.toString(s)})}negative(s){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jo.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jo.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jo.toString(s)})}multipleOf(s,c){return this._addCheck({kind:"multipleOf",value:s,message:Jo.toString(c)})}finite(s){return this._addCheck({kind:"finite",message:Jo.toString(s)})}safe(s){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jo.toString(s)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jo.toString(s)})}get minValue(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxValue(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}get isInt(){return!!this._def.checks.find(s=>s.kind==="int"||s.kind==="multipleOf"&&of.isInteger(s.value))}get isFinite(){let s=null,c=null;for(let f of this._def.checks){if(f.kind==="finite"||f.kind==="int"||f.kind==="multipleOf")return!0;f.kind==="min"?(c===null||f.value>c)&&(c=f.value):f.kind==="max"&&(s===null||f.value<s)&&(s=f.value)}return Number.isFinite(c)&&Number.isFinite(s)}};D7.create=a=>new D7({checks:[],typeName:kc.ZodNumber,coerce:a?.coerce||!1,...xl(a)});var A7=class a extends Dl{static{t(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(s){if(this._def.coerce&&(s.data=BigInt(s.data)),this._getType(s)!==Xa.bigint){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.bigint,received:v.parsedType}),Oc}let f,d=new u1;for(let v of this._def.checks)v.kind==="min"?(v.inclusive?s.data<v.value:s.data<=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),d.dirty()):v.kind==="max"?(v.inclusive?s.data>v.value:s.data>=v.value)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),d.dirty()):v.kind==="multipleOf"?s.data%v.value!==BigInt(0)&&(f=this._getOrReturnCtx(s,f),Ba(f,{code:As.not_multiple_of,multipleOf:v.value,message:v.message}),d.dirty()):of.assertNever(v);return{status:d.value,value:s.data}}gte(s,c){return this.setLimit("min",s,!0,Jo.toString(c))}gt(s,c){return this.setLimit("min",s,!1,Jo.toString(c))}lte(s,c){return this.setLimit("max",s,!0,Jo.toString(c))}lt(s,c){return this.setLimit("max",s,!1,Jo.toString(c))}setLimit(s,c,f,d){return new a({...this._def,checks:[...this._def.checks,{kind:s,value:c,inclusive:f,message:Jo.toString(d)}]})}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}positive(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Jo.toString(s)})}negative(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jo.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jo.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jo.toString(s)})}multipleOf(s,c){return this._addCheck({kind:"multipleOf",value:s,message:Jo.toString(c)})}get minValue(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s}get maxValue(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s}};A7.create=a=>{var s;return new A7({checks:[],typeName:kc.ZodBigInt,coerce:(s=a?.coerce)!==null&&s!==void 0?s:!1,...xl(a)})};var k7=class extends Dl{static{t(this,"ZodBoolean")}_parse(s){if(this._def.coerce&&(s.data=!!s.data),this._getType(s)!==Xa.boolean){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.boolean,received:f.parsedType}),Oc}return Nv(s.data)}};k7.create=a=>new k7({typeName:kc.ZodBoolean,coerce:a?.coerce||!1,...xl(a)});var w7=class a extends Dl{static{t(this,"ZodDate")}_parse(s){if(this._def.coerce&&(s.data=new Date(s.data)),this._getType(s)!==Xa.date){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_type,expected:Xa.date,received:v.parsedType}),Oc}if(isNaN(s.data.getTime())){let v=this._getOrReturnCtx(s);return Ba(v,{code:As.invalid_date}),Oc}let f=new u1,d;for(let v of this._def.checks)v.kind==="min"?s.data.getTime()<v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_small,message:v.message,inclusive:!0,exact:!1,minimum:v.value,type:"date"}),f.dirty()):v.kind==="max"?s.data.getTime()>v.value&&(d=this._getOrReturnCtx(s,d),Ba(d,{code:As.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),f.dirty()):of.assertNever(v);return{status:f.value,value:new Date(s.data.getTime())}}_addCheck(s){return new a({...this._def,checks:[...this._def.checks,s]})}min(s,c){return this._addCheck({kind:"min",value:s.getTime(),message:Jo.toString(c)})}max(s,c){return this._addCheck({kind:"max",value:s.getTime(),message:Jo.toString(c)})}get minDate(){let s=null;for(let c of this._def.checks)c.kind==="min"&&(s===null||c.value>s)&&(s=c.value);return s!=null?new Date(s):null}get maxDate(){let s=null;for(let c of this._def.checks)c.kind==="max"&&(s===null||c.value<s)&&(s=c.value);return s!=null?new Date(s):null}};w7.create=a=>new w7({checks:[],coerce:a?.coerce||!1,typeName:kc.ZodDate,...xl(a)});var _U=class extends Dl{static{t(this,"ZodSymbol")}_parse(s){if(this._getType(s)!==Xa.symbol){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.symbol,received:f.parsedType}),Oc}return Nv(s.data)}};_U.create=a=>new _U({typeName:kc.ZodSymbol,...xl(a)});var P7=class extends Dl{static{t(this,"ZodUndefined")}_parse(s){if(this._getType(s)!==Xa.undefined){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.undefined,received:f.parsedType}),Oc}return Nv(s.data)}};P7.create=a=>new P7({typeName:kc.ZodUndefined,...xl(a)});var N7=class extends Dl{static{t(this,"ZodNull")}_parse(s){if(this._getType(s)!==Xa.null){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.null,received:f.parsedType}),Oc}return Nv(s.data)}};N7.create=a=>new N7({typeName:kc.ZodNull,...xl(a)});var KN=class extends Dl{static{t(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(s){return Nv(s.data)}};KN.create=a=>new KN({typeName:kc.ZodAny,...xl(a)});var A6=class extends Dl{static{t(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(s){return Nv(s.data)}};A6.create=a=>new A6({typeName:kc.ZodUnknown,...xl(a)});var Vx=class extends Dl{static{t(this,"ZodNever")}_parse(s){let c=this._getOrReturnCtx(s);return Ba(c,{code:As.invalid_type,expected:Xa.never,received:c.parsedType}),Oc}};Vx.create=a=>new Vx({typeName:kc.ZodNever,...xl(a)});var pU=class extends Dl{static{t(this,"ZodVoid")}_parse(s){if(this._getType(s)!==Xa.undefined){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.void,received:f.parsedType}),Oc}return Nv(s.data)}};pU.create=a=>new pU({typeName:kc.ZodVoid,...xl(a)});var k6=class a extends Dl{static{t(this,"ZodArray")}_parse(s){let{ctx:c,status:f}=this._processInputParams(s),d=this._def;if(c.parsedType!==Xa.array)return Ba(c,{code:As.invalid_type,expected:Xa.array,received:c.parsedType}),Oc;if(d.exactLength!==null){let E=c.data.length>d.exactLength.value,A=c.data.length<d.exactLength.value;(E||A)&&(Ba(c,{code:E?As.too_big:As.too_small,minimum:A?d.exactLength.value:void 0,maximum:E?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),f.dirty())}if(d.minLength!==null&&c.data.length<d.minLength.value&&(Ba(c,{code:As.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),f.dirty()),d.maxLength!==null&&c.data.length>d.maxLength.value&&(Ba(c,{code:As.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),f.dirty()),c.common.async)return Promise.all([...c.data].map((E,A)=>d.type._parseAsync(new IC(c,E,c.path,A)))).then(E=>u1.mergeArray(f,E));let v=[...c.data].map((E,A)=>d.type._parseSync(new IC(c,E,c.path,A)));return u1.mergeArray(f,v)}get element(){return this._def.type}min(s,c){return new a({...this._def,minLength:{value:s,message:Jo.toString(c)}})}max(s,c){return new a({...this._def,maxLength:{value:s,message:Jo.toString(c)}})}length(s,c){return new a({...this._def,exactLength:{value:s,message:Jo.toString(c)}})}nonempty(s){return this.min(1,s)}};k6.create=(a,s)=>new k6({type:a,minLength:null,maxLength:null,exactLength:null,typeName:kc.ZodArray,...xl(s)});function lU(a){if(a instanceof Kb){let s={};for(let c in a.shape){let f=a.shape[c];s[c]=NC.create(lU(f))}return new Kb({...a._def,shape:t(()=>s,"shape")})}else return a instanceof k6?new k6({...a._def,type:lU(a.element)}):a instanceof NC?NC.create(lU(a.unwrap())):a instanceof mk?mk.create(lU(a.unwrap())):a instanceof dk?dk.create(a.items.map(s=>lU(s))):a}t(lU,"deepPartialify");var Kb=class a extends Dl{static{t(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let s=this._def.shape(),c=of.objectKeys(s);return this._cached={shape:s,keys:c}}_parse(s){if(this._getType(s)!==Xa.object){let M=this._getOrReturnCtx(s);return Ba(M,{code:As.invalid_type,expected:Xa.object,received:M.parsedType}),Oc}let{status:f,ctx:d}=this._processInputParams(s),{shape:v,keys:E}=this._getCached(),A=[];if(!(this._def.catchall instanceof Vx&&this._def.unknownKeys==="strip"))for(let M in d.data)E.includes(M)||A.push(M);let O=[];for(let M of E){let H=v[M],$=d.data[M];O.push({key:{status:"valid",value:M},value:H._parse(new IC(d,$,d.path,M)),alwaysSet:M in d.data})}if(this._def.catchall instanceof Vx){let M=this._def.unknownKeys;if(M==="passthrough")for(let H of A)O.push({key:{status:"valid",value:H},value:{status:"valid",value:d.data[H]}});else if(M==="strict")A.length>0&&(Ba(d,{code:As.unrecognized_keys,keys:A}),f.dirty());else if(M!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let M=this._def.catchall;for(let H of A){let $=d.data[H];O.push({key:{status:"valid",value:H},value:M._parse(new IC(d,$,d.path,H)),alwaysSet:H in d.data})}}return d.common.async?Promise.resolve().then(async()=>{let M=[];for(let H of O){let $=await H.key,K=await H.value;M.push({key:$,value:K,alwaysSet:H.alwaysSet})}return M}).then(M=>u1.mergeObjectSync(f,M)):u1.mergeObjectSync(f,O)}get shape(){return this._def.shape()}strict(s){return Jo.errToObj,new a({...this._def,unknownKeys:"strict",...s!==void 0?{errorMap:t((c,f)=>{var d,v,E,A;let O=(E=(v=(d=this._def).errorMap)===null||v===void 0?void 0:v.call(d,c,f).message)!==null&&E!==void 0?E:f.defaultError;return c.code==="unrecognized_keys"?{message:(A=Jo.errToObj(s).message)!==null&&A!==void 0?A:O}:{message:O}},"errorMap")}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(s){return new a({...this._def,shape:t(()=>({...this._def.shape(),...s}),"shape")})}merge(s){return new a({unknownKeys:s._def.unknownKeys,catchall:s._def.catchall,shape:t(()=>({...this._def.shape(),...s._def.shape()}),"shape"),typeName:kc.ZodObject})}setKey(s,c){return this.augment({[s]:c})}catchall(s){return new a({...this._def,catchall:s})}pick(s){let c={};return of.objectKeys(s).forEach(f=>{s[f]&&this.shape[f]&&(c[f]=this.shape[f])}),new a({...this._def,shape:t(()=>c,"shape")})}omit(s){let c={};return of.objectKeys(this.shape).forEach(f=>{s[f]||(c[f]=this.shape[f])}),new a({...this._def,shape:t(()=>c,"shape")})}deepPartial(){return lU(this)}partial(s){let c={};return of.objectKeys(this.shape).forEach(f=>{let d=this.shape[f];s&&!s[f]?c[f]=d:c[f]=d.optional()}),new a({...this._def,shape:t(()=>c,"shape")})}required(s){let c={};return of.objectKeys(this.shape).forEach(f=>{if(s&&!s[f])c[f]=this.shape[f];else{let v=this.shape[f];for(;v instanceof NC;)v=v._def.innerType;c[f]=v}}),new a({...this._def,shape:t(()=>c,"shape")})}keyof(){return Mbt(of.objectKeys(this.shape))}};Kb.create=(a,s)=>new Kb({shape:t(()=>a,"shape"),unknownKeys:"strip",catchall:Vx.create(),typeName:kc.ZodObject,...xl(s)});Kb.strictCreate=(a,s)=>new Kb({shape:t(()=>a,"shape"),unknownKeys:"strict",catchall:Vx.create(),typeName:kc.ZodObject,...xl(s)});Kb.lazycreate=(a,s)=>new Kb({shape:a,unknownKeys:"strip",catchall:Vx.create(),typeName:kc.ZodObject,...xl(s)});var I7=class extends Dl{static{t(this,"ZodUnion")}_parse(s){let{ctx:c}=this._processInputParams(s),f=this._def.options;function d(v){for(let A of v)if(A.result.status==="valid")return A.result;for(let A of v)if(A.result.status==="dirty")return c.common.issues.push(...A.ctx.common.issues),A.result;let E=v.map(A=>new IS(A.ctx.common.issues));return Ba(c,{code:As.invalid_union,unionErrors:E}),Oc}if(t(d,"handleResults"),c.common.async)return Promise.all(f.map(async v=>{let E={...c,common:{...c.common,issues:[]},parent:null};return{result:await v._parseAsync({data:c.data,path:c.path,parent:E}),ctx:E}})).then(d);{let v,E=[];for(let O of f){let M={...c,common:{...c.common,issues:[]},parent:null},H=O._parseSync({data:c.data,path:c.path,parent:M});if(H.status==="valid")return H;H.status==="dirty"&&!v&&(v={result:H,ctx:M}),M.common.issues.length&&E.push(M.common.issues)}if(v)return c.common.issues.push(...v.ctx.common.issues),v.result;let A=E.map(O=>new IS(O));return Ba(c,{code:As.invalid_union,unionErrors:A}),Oc}}get options(){return this._def.options}};I7.create=(a,s)=>new I7({options:a,typeName:kc.ZodUnion,...xl(s)});var D6=t(a=>a instanceof F7?D6(a.schema):a instanceof OS?D6(a.innerType()):a instanceof L7?[a.value]:a instanceof R7?a.options:a instanceof M7?of.objectValues(a.enum):a instanceof j7?D6(a._def.innerType):a instanceof P7?[void 0]:a instanceof N7?[null]:a instanceof NC?[void 0,...D6(a.unwrap())]:a instanceof mk?[null,...D6(a.unwrap())]:a instanceof fY||a instanceof U7?D6(a.unwrap()):a instanceof B7?D6(a._def.innerType):[],"getDiscriminator"),Kpe=class a extends Dl{static{t(this,"ZodDiscriminatedUnion")}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.object)return Ba(c,{code:As.invalid_type,expected:Xa.object,received:c.parsedType}),Oc;let f=this.discriminator,d=c.data[f],v=this.optionsMap.get(d);return v?c.common.async?v._parseAsync({data:c.data,path:c.path,parent:c}):v._parseSync({data:c.data,path:c.path,parent:c}):(Ba(c,{code:As.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[f]}),Oc)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(s,c,f){let d=new Map;for(let v of c){let E=D6(v.shape[s]);if(!E.length)throw new Error(`A discriminator value for key \`${s}\` could not be extracted from all schema options`);for(let A of E){if(d.has(A))throw new Error(`Discriminator property ${String(s)} has duplicate value ${String(A)}`);d.set(A,v)}}return new a({typeName:kc.ZodDiscriminatedUnion,discriminator:s,options:c,optionsMap:d,...xl(f)})}};function O5e(a,s){let c=GN(a),f=GN(s);if(a===s)return{valid:!0,data:a};if(c===Xa.object&&f===Xa.object){let d=of.objectKeys(s),v=of.objectKeys(a).filter(A=>d.indexOf(A)!==-1),E={...a,...s};for(let A of v){let O=O5e(a[A],s[A]);if(!O.valid)return{valid:!1};E[A]=O.data}return{valid:!0,data:E}}else if(c===Xa.array&&f===Xa.array){if(a.length!==s.length)return{valid:!1};let d=[];for(let v=0;v<a.length;v++){let E=a[v],A=s[v],O=O5e(E,A);if(!O.valid)return{valid:!1};d.push(O.data)}return{valid:!0,data:d}}else return c===Xa.date&&f===Xa.date&&+a==+s?{valid:!0,data:a}:{valid:!1}}t(O5e,"mergeValues");var O7=class extends Dl{static{t(this,"ZodIntersection")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s),d=t((v,E)=>{if(N5e(v)||N5e(E))return Oc;let A=O5e(v.value,E.value);return A.valid?((I5e(v)||I5e(E))&&c.dirty(),{status:c.value,value:A.data}):(Ba(f,{code:As.invalid_intersection_types}),Oc)},"handleParsed");return f.common.async?Promise.all([this._def.left._parseAsync({data:f.data,path:f.path,parent:f}),this._def.right._parseAsync({data:f.data,path:f.path,parent:f})]).then(([v,E])=>d(v,E)):d(this._def.left._parseSync({data:f.data,path:f.path,parent:f}),this._def.right._parseSync({data:f.data,path:f.path,parent:f}))}};O7.create=(a,s,c)=>new O7({left:a,right:s,typeName:kc.ZodIntersection,...xl(c)});var dk=class a extends Dl{static{t(this,"ZodTuple")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.array)return Ba(f,{code:As.invalid_type,expected:Xa.array,received:f.parsedType}),Oc;if(f.data.length<this._def.items.length)return Ba(f,{code:As.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oc;!this._def.rest&&f.data.length>this._def.items.length&&(Ba(f,{code:As.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());let v=[...f.data].map((E,A)=>{let O=this._def.items[A]||this._def.rest;return O?O._parse(new IC(f,E,f.path,A)):null}).filter(E=>!!E);return f.common.async?Promise.all(v).then(E=>u1.mergeArray(c,E)):u1.mergeArray(c,v)}get items(){return this._def.items}rest(s){return new a({...this._def,rest:s})}};dk.create=(a,s)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new dk({items:a,typeName:kc.ZodTuple,rest:null,...xl(s)})};var Ype=class a extends Dl{static{t(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.object)return Ba(f,{code:As.invalid_type,expected:Xa.object,received:f.parsedType}),Oc;let d=[],v=this._def.keyType,E=this._def.valueType;for(let A in f.data)d.push({key:v._parse(new IC(f,A,f.path,A)),value:E._parse(new IC(f,f.data[A],f.path,A)),alwaysSet:A in f.data});return f.common.async?u1.mergeObjectAsync(c,d):u1.mergeObjectSync(c,d)}get element(){return this._def.valueType}static create(s,c,f){return c instanceof Dl?new a({keyType:s,valueType:c,typeName:kc.ZodRecord,...xl(f)}):new a({keyType:QN.create(),valueType:s,typeName:kc.ZodRecord,...xl(c)})}},dU=class extends Dl{static{t(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.map)return Ba(f,{code:As.invalid_type,expected:Xa.map,received:f.parsedType}),Oc;let d=this._def.keyType,v=this._def.valueType,E=[...f.data.entries()].map(([A,O],M)=>({key:d._parse(new IC(f,A,f.path,[M,"key"])),value:v._parse(new IC(f,O,f.path,[M,"value"]))}));if(f.common.async){let A=new Map;return Promise.resolve().then(async()=>{for(let O of E){let M=await O.key,H=await O.value;if(M.status==="aborted"||H.status==="aborted")return Oc;(M.status==="dirty"||H.status==="dirty")&&c.dirty(),A.set(M.value,H.value)}return{status:c.value,value:A}})}else{let A=new Map;for(let O of E){let M=O.key,H=O.value;if(M.status==="aborted"||H.status==="aborted")return Oc;(M.status==="dirty"||H.status==="dirty")&&c.dirty(),A.set(M.value,H.value)}return{status:c.value,value:A}}}};dU.create=(a,s,c)=>new dU({valueType:s,keyType:a,typeName:kc.ZodMap,...xl(c)});var mU=class a extends Dl{static{t(this,"ZodSet")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.parsedType!==Xa.set)return Ba(f,{code:As.invalid_type,expected:Xa.set,received:f.parsedType}),Oc;let d=this._def;d.minSize!==null&&f.data.size<d.minSize.value&&(Ba(f,{code:As.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),c.dirty()),d.maxSize!==null&&f.data.size>d.maxSize.value&&(Ba(f,{code:As.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),c.dirty());let v=this._def.valueType;function E(O){let M=new Set;for(let H of O){if(H.status==="aborted")return Oc;H.status==="dirty"&&c.dirty(),M.add(H.value)}return{status:c.value,value:M}}t(E,"finalizeSet");let A=[...f.data.values()].map((O,M)=>v._parse(new IC(f,O,f.path,M)));return f.common.async?Promise.all(A).then(O=>E(O)):E(A)}min(s,c){return new a({...this._def,minSize:{value:s,message:Jo.toString(c)}})}max(s,c){return new a({...this._def,maxSize:{value:s,message:Jo.toString(c)}})}size(s,c){return this.min(s,c).max(s,c)}nonempty(s){return this.min(1,s)}};mU.create=(a,s)=>new mU({valueType:a,minSize:null,maxSize:null,typeName:kc.ZodSet,...xl(s)});var Xpe=class a extends Dl{static{t(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.function)return Ba(c,{code:As.invalid_type,expected:Xa.function,received:c.parsedType}),Oc;function f(A,O){return Gpe({data:A,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Hpe(),fU].filter(M=>!!M),issueData:{code:As.invalid_arguments,argumentsError:O}})}t(f,"makeArgsIssue");function d(A,O){return Gpe({data:A,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Hpe(),fU].filter(M=>!!M),issueData:{code:As.invalid_return_type,returnTypeError:O}})}t(d,"makeReturnsIssue");let v={errorMap:c.common.contextualErrorMap},E=c.data;if(this._def.returns instanceof YN){let A=this;return Nv(async function(...O){let M=new IS([]),H=await A._def.args.parseAsync(O,v).catch(Ne=>{throw M.addIssue(f(O,Ne)),M}),$=await Reflect.apply(E,this,H);return await A._def.returns._def.type.parseAsync($,v).catch(Ne=>{throw M.addIssue(d($,Ne)),M})})}else{let A=this;return Nv(function(...O){let M=A._def.args.safeParse(O,v);if(!M.success)throw new IS([f(O,M.error)]);let H=Reflect.apply(E,this,M.data),$=A._def.returns.safeParse(H,v);if(!$.success)throw new IS([d(H,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...s){return new a({...this._def,args:dk.create(s).rest(A6.create())})}returns(s){return new a({...this._def,returns:s})}implement(s){return this.parse(s)}strictImplement(s){return this.parse(s)}static create(s,c,f){return new a({args:s||dk.create([]).rest(A6.create()),returns:c||A6.create(),typeName:kc.ZodFunction,...xl(f)})}},F7=class extends Dl{static{t(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(s){let{ctx:c}=this._processInputParams(s);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}};F7.create=(a,s)=>new F7({getter:a,typeName:kc.ZodLazy,...xl(s)});var L7=class extends Dl{static{t(this,"ZodLiteral")}_parse(s){if(s.data!==this._def.value){let c=this._getOrReturnCtx(s);return Ba(c,{received:c.data,code:As.invalid_literal,expected:this._def.value}),Oc}return{status:"valid",value:s.data}}get value(){return this._def.value}};L7.create=(a,s)=>new L7({value:a,typeName:kc.ZodLiteral,...xl(s)});function Mbt(a,s){return new R7({values:a,typeName:kc.ZodEnum,...xl(s)})}t(Mbt,"createZodEnum");var R7=class a extends Dl{static{t(this,"ZodEnum")}constructor(){super(...arguments),oY.set(this,void 0)}_parse(s){if(typeof s.data!="string"){let c=this._getOrReturnCtx(s),f=this._def.values;return Ba(c,{expected:of.joinValues(f),received:c.parsedType,code:As.invalid_type}),Oc}if(Qpe(this,oY,"f")||Obt(this,oY,new Set(this._def.values),"f"),!Qpe(this,oY,"f").has(s.data)){let c=this._getOrReturnCtx(s),f=this._def.values;return Ba(c,{received:c.data,code:As.invalid_enum_value,options:f}),Oc}return Nv(s.data)}get options(){return this._def.values}get enum(){let s={};for(let c of this._def.values)s[c]=c;return s}get Values(){let s={};for(let c of this._def.values)s[c]=c;return s}get Enum(){let s={};for(let c of this._def.values)s[c]=c;return s}extract(s,c=this._def){return a.create(s,{...this._def,...c})}exclude(s,c=this._def){return a.create(this.options.filter(f=>!s.includes(f)),{...this._def,...c})}};oY=new WeakMap;R7.create=Mbt;var M7=class extends Dl{static{t(this,"ZodNativeEnum")}constructor(){super(...arguments),cY.set(this,void 0)}_parse(s){let c=of.getValidEnumValues(this._def.values),f=this._getOrReturnCtx(s);if(f.parsedType!==Xa.string&&f.parsedType!==Xa.number){let d=of.objectValues(c);return Ba(f,{expected:of.joinValues(d),received:f.parsedType,code:As.invalid_type}),Oc}if(Qpe(this,cY,"f")||Obt(this,cY,new Set(of.getValidEnumValues(this._def.values)),"f"),!Qpe(this,cY,"f").has(s.data)){let d=of.objectValues(c);return Ba(f,{received:f.data,code:As.invalid_enum_value,options:d}),Oc}return Nv(s.data)}get enum(){return this._def.values}};cY=new WeakMap;M7.create=(a,s)=>new M7({values:a,typeName:kc.ZodNativeEnum,...xl(s)});var YN=class extends Dl{static{t(this,"ZodPromise")}unwrap(){return this._def.type}_parse(s){let{ctx:c}=this._processInputParams(s);if(c.parsedType!==Xa.promise&&c.common.async===!1)return Ba(c,{code:As.invalid_type,expected:Xa.promise,received:c.parsedType}),Oc;let f=c.parsedType===Xa.promise?c.data:Promise.resolve(c.data);return Nv(f.then(d=>this._def.type.parseAsync(d,{path:c.path,errorMap:c.common.contextualErrorMap})))}};YN.create=(a,s)=>new YN({type:a,typeName:kc.ZodPromise,...xl(s)});var OS=class extends Dl{static{t(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===kc.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(s){let{status:c,ctx:f}=this._processInputParams(s),d=this._def.effect||null,v={addIssue:t(E=>{Ba(f,E),E.fatal?c.abort():c.dirty()},"addIssue"),get path(){return f.path}};if(v.addIssue=v.addIssue.bind(v),d.type==="preprocess"){let E=d.transform(f.data,v);if(f.common.async)return Promise.resolve(E).then(async A=>{if(c.value==="aborted")return Oc;let O=await this._def.schema._parseAsync({data:A,path:f.path,parent:f});return O.status==="aborted"?Oc:O.status==="dirty"||c.value==="dirty"?uU(O.value):O});{if(c.value==="aborted")return Oc;let A=this._def.schema._parseSync({data:E,path:f.path,parent:f});return A.status==="aborted"?Oc:A.status==="dirty"||c.value==="dirty"?uU(A.value):A}}if(d.type==="refinement"){let E=t(A=>{let O=d.refinement(A,v);if(f.common.async)return Promise.resolve(O);if(O instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return A},"executeRefinement");if(f.common.async===!1){let A=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});return A.status==="aborted"?Oc:(A.status==="dirty"&&c.dirty(),E(A.value),{status:c.value,value:A.value})}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(A=>A.status==="aborted"?Oc:(A.status==="dirty"&&c.dirty(),E(A.value).then(()=>({status:c.value,value:A.value}))))}if(d.type==="transform")if(f.common.async===!1){let E=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(!lY(E))return E;let A=d.transform(E.value,v);if(A instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:A}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(E=>lY(E)?Promise.resolve(d.transform(E.value,v)).then(A=>({status:c.value,value:A})):E);of.assertNever(d)}};OS.create=(a,s,c)=>new OS({schema:a,typeName:kc.ZodEffects,effect:s,...xl(c)});OS.createWithPreprocess=(a,s,c)=>new OS({schema:s,effect:{type:"preprocess",transform:a},typeName:kc.ZodEffects,...xl(c)});var NC=class extends Dl{static{t(this,"ZodOptional")}_parse(s){return this._getType(s)===Xa.undefined?Nv(void 0):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}};NC.create=(a,s)=>new NC({innerType:a,typeName:kc.ZodOptional,...xl(s)});var mk=class extends Dl{static{t(this,"ZodNullable")}_parse(s){return this._getType(s)===Xa.null?Nv(null):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}};mk.create=(a,s)=>new mk({innerType:a,typeName:kc.ZodNullable,...xl(s)});var j7=class extends Dl{static{t(this,"ZodDefault")}_parse(s){let{ctx:c}=this._processInputParams(s),f=c.data;return c.parsedType===Xa.undefined&&(f=this._def.defaultValue()),this._def.innerType._parse({data:f,path:c.path,parent:c})}removeDefault(){return this._def.innerType}};j7.create=(a,s)=>new j7({innerType:a,typeName:kc.ZodDefault,defaultValue:typeof s.default=="function"?s.default:()=>s.default,...xl(s)});var B7=class extends Dl{static{t(this,"ZodCatch")}_parse(s){let{ctx:c}=this._processInputParams(s),f={...c,common:{...c.common,issues:[]}},d=this._def.innerType._parse({data:f.data,path:f.path,parent:{...f}});return uY(d)?d.then(v=>({status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new IS(f.common.issues)},input:f.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new IS(f.common.issues)},input:f.data})}}removeCatch(){return this._def.innerType}};B7.create=(a,s)=>new B7({innerType:a,typeName:kc.ZodCatch,catchValue:typeof s.catch=="function"?s.catch:()=>s.catch,...xl(s)});var hU=class extends Dl{static{t(this,"ZodNaN")}_parse(s){if(this._getType(s)!==Xa.nan){let f=this._getOrReturnCtx(s);return Ba(f,{code:As.invalid_type,expected:Xa.nan,received:f.parsedType}),Oc}return{status:"valid",value:s.data}}};hU.create=a=>new hU({typeName:kc.ZodNaN,...xl(a)});var DCr=Symbol("zod_brand"),fY=class extends Dl{static{t(this,"ZodBranded")}_parse(s){let{ctx:c}=this._processInputParams(s),f=c.data;return this._def.type._parse({data:f,path:c.path,parent:c})}unwrap(){return this._def.type}},_Y=class a extends Dl{static{t(this,"ZodPipeline")}_parse(s){let{status:c,ctx:f}=this._processInputParams(s);if(f.common.async)return t(async()=>{let v=await this._def.in._parseAsync({data:f.data,path:f.path,parent:f});return v.status==="aborted"?Oc:v.status==="dirty"?(c.dirty(),uU(v.value)):this._def.out._parseAsync({data:v.value,path:f.path,parent:f})},"handleAsync")();{let d=this._def.in._parseSync({data:f.data,path:f.path,parent:f});return d.status==="aborted"?Oc:d.status==="dirty"?(c.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:f.path,parent:f})}}static create(s,c){return new a({in:s,out:c,typeName:kc.ZodPipeline})}},U7=class extends Dl{static{t(this,"ZodReadonly")}_parse(s){let c=this._def.innerType._parse(s),f=t(d=>(lY(d)&&(d.value=Object.freeze(d.value)),d),"freeze");return uY(c)?c.then(d=>f(d)):f(c)}unwrap(){return this._def.innerType}};U7.create=(a,s)=>new U7({innerType:a,typeName:kc.ZodReadonly,...xl(s)});function jbt(a,s={},c){return a?KN.create().superRefine((f,d)=>{var v,E;if(!a(f)){let A=typeof s=="function"?s(f):typeof s=="string"?{message:s}:s,O=(E=(v=A.fatal)!==null&&v!==void 0?v:c)!==null&&E!==void 0?E:!0,M=typeof A=="string"?{message:A}:A;d.addIssue({code:"custom",...M,fatal:O})}}):KN.create()}t(jbt,"custom");var ACr={object:Kb.lazycreate},kc;(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"})(kc||(kc={}));var kCr=t((a,s={message:`Input not instance of ${a.name}`})=>jbt(c=>c instanceof a,s),"instanceOfType"),Bbt=QN.create,Ubt=D7.create,wCr=hU.create,PCr=A7.create,$bt=k7.create,NCr=w7.create,ICr=_U.create,OCr=P7.create,FCr=N7.create,LCr=KN.create,RCr=A6.create,MCr=Vx.create,jCr=pU.create,BCr=k6.create,UCr=Kb.create,$Cr=Kb.strictCreate,JCr=I7.create,zCr=Kpe.create,qCr=O7.create,VCr=dk.create,WCr=Ype.create,HCr=dU.create,GCr=mU.create,QCr=Xpe.create,KCr=F7.create,YCr=L7.create,XCr=R7.create,ZCr=M7.create,eEr=YN.create,Nbt=OS.create,tEr=NC.create,rEr=mk.create,nEr=OS.createWithPreprocess,iEr=_Y.create,sEr=t(()=>Bbt().optional(),"ostring"),aEr=t(()=>Ubt().optional(),"onumber"),oEr=t(()=>$bt().optional(),"oboolean"),cEr={string:t(a=>QN.create({...a,coerce:!0}),"string"),number:t(a=>D7.create({...a,coerce:!0}),"number"),boolean:t(a=>k7.create({...a,coerce:!0}),"boolean"),bigint:t(a=>A7.create({...a,coerce:!0}),"bigint"),date:t(a=>w7.create({...a,coerce:!0}),"date")},lEr=Oc,Vr=Object.freeze({__proto__:null,defaultErrorMap:fU,setErrorMap:lCr,getErrorMap:Hpe,makeIssue:Gpe,EMPTY_PATH:uCr,addIssueToContext:Ba,ParseStatus:u1,INVALID:Oc,DIRTY:uU,OK:Nv,isAborted:N5e,isDirty:I5e,isValid:lY,isAsync:uY,get util(){return of},get objectUtil(){return P5e},ZodParsedType:Xa,getParsedType:GN,ZodType:Dl,datetimeRegex:Rbt,ZodString:QN,ZodNumber:D7,ZodBigInt:A7,ZodBoolean:k7,ZodDate:w7,ZodSymbol:_U,ZodUndefined:P7,ZodNull:N7,ZodAny:KN,ZodUnknown:A6,ZodNever:Vx,ZodVoid:pU,ZodArray:k6,ZodObject:Kb,ZodUnion:I7,ZodDiscriminatedUnion:Kpe,ZodIntersection:O7,ZodTuple:dk,ZodRecord:Ype,ZodMap:dU,ZodSet:mU,ZodFunction:Xpe,ZodLazy:F7,ZodLiteral:L7,ZodEnum:R7,ZodNativeEnum:M7,ZodPromise:YN,ZodEffects:OS,ZodTransformer:OS,ZodOptional:NC,ZodNullable:mk,ZodDefault:j7,ZodCatch:B7,ZodNaN:hU,BRAND:DCr,ZodBranded:fY,ZodPipeline:_Y,ZodReadonly:U7,custom:jbt,Schema:Dl,ZodSchema:Dl,late:ACr,get ZodFirstPartyTypeKind(){return kc},coerce:cEr,any:LCr,array:BCr,bigint:PCr,boolean:$bt,date:NCr,discriminatedUnion:zCr,effect:Nbt,enum:XCr,function:QCr,instanceof:kCr,intersection:qCr,lazy:KCr,literal:YCr,map:HCr,nan:wCr,nativeEnum:ZCr,never:MCr,null:FCr,nullable:rEr,number:Ubt,object:UCr,oboolean:oEr,onumber:aEr,optional:tEr,ostring:sEr,pipeline:iEr,preprocess:nEr,promise:eEr,record:WCr,set:GCr,strictObject:$Cr,string:Bbt,symbol:ICr,transformer:Nbt,tuple:VCr,undefined:OCr,union:JCr,unknown:RCr,void:jCr,NEVER:lEr,ZodIssueCode:As,quotelessJson:cCr,ZodError:IS});function Jbt(a){return a instanceof Error&&a.name==="ZodError"&&"issues"in a&&Array.isArray(a.issues)}t(Jbt,"isZodErrorLike");var F5e=class extends Error{static{t(this,"ValidationError")}name;details;constructor(a,s){super(a,s),this.name="ZodValidationError",this.details=fEr(s)}toString(){return this.message}};function fEr(a){if(a){let s=a.cause;if(Jbt(s))return s.issues}return[]}t(fEr,"getIssuesFromErrorOptions");function zbt(a){return a.length!==0}t(zbt,"isNonEmptyArray");var _Er=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function pEr(a){return a.length===1?a[0].toString():a.reduce((s,c)=>{if(typeof c=="number")return s+"["+c.toString()+"]";if(c.includes('"'))return s+'["'+dEr(c)+'"]';if(!_Er.test(c))return s+'["'+c+'"]';let f=s.length===0?"":".";return s+f+c},"")}t(pEr,"joinPath");function dEr(a){return a.replace(/"/g,'\\"')}t(dEr,"escapeQuotes");var mEr="; ",hEr=99,qbt="Validation error",gEr=": ",yEr=", or ";function vEr(a={}){let{issueSeparator:s=mEr,unionSeparator:c=yEr,prefixSeparator:f=gEr,prefix:d=qbt,includePath:v=!0,maxIssuesInMessage:E=hEr}=a;return A=>{let O=A.slice(0,E).map(M=>Zpe({issue:M,issueSeparator:s,unionSeparator:c,includePath:v})).join(s);return bEr(O,d,f)}}t(vEr,"createMessageBuilder");function Zpe(a){let{issue:s,issueSeparator:c,unionSeparator:f,includePath:d}=a;if(s.code===As.invalid_union)return s.unionErrors.reduce((v,E)=>{let A=E.issues.map(O=>Zpe({issue:O,issueSeparator:c,unionSeparator:f,includePath:d})).join(c);return v.includes(A)||v.push(A),v},[]).join(f);if(s.code===As.invalid_arguments)return[s.message,...s.argumentsError.issues.map(v=>Zpe({issue:v,issueSeparator:c,unionSeparator:f,includePath:d}))].join(c);if(s.code===As.invalid_return_type)return[s.message,...s.returnTypeError.issues.map(v=>Zpe({issue:v,issueSeparator:c,unionSeparator:f,includePath:d}))].join(c);if(d&&zbt(s.path)){if(s.path.length===1){let v=s.path[0];if(typeof v=="number")return`${s.message} at index ${v}`}return`${s.message} at "${pEr(s.path)}"`}return s.message}t(Zpe,"getMessageFromZodIssue");function bEr(a,s,c){return s!==null?a.length>0?[s,a].join(c):s:a.length>0?a:qbt}t(bEr,"prefixMessage");function SEr(a,s={}){let c=a.errors,f;return zbt(c)?f=TEr(s)(c):f=a.message,new F5e(f,{cause:a})}t(SEr,"fromZodErrorWithoutRuntimeCheck");function TEr(a){return"messageBuilder"in a?a.messageBuilder:vEr(a)}t(TEr,"createMessageBuilderFromOptions2");var CEr=t((a={})=>s=>Jbt(s)?SEr(s,a):s instanceof Error?new F5e(s.message,{cause:s}):new F5e("Unknown error"),"toValidationError");function ede(a,s={}){return CEr(s)(a)}t(ede,"fromError");var tde=t((a,s)=>{let c={};for(let[f,d]of Object.entries(a))Array.isArray(d)?c[f]=d.map(v=>typeof v=="object"&&v!==null?tde(v,s):v):typeof d=="object"&&d!==null?c[f]=tde(d,s):c[f]=d;return s(c)},"traverse"),AEr=t(({keys:a}={})=>s=>tde(s,c=>{let f={};for(let[d,v]of Object.entries(c))d.startsWith("x-")&&(a===void 0||a.includes(d))||(f[d]=v);return f}),"removeExtensions"),kEr=t(({paths:a={},shouldRemove:s})=>c=>tde(c,f=>{if(!f.paths)return f;let d={};for(let[v,E]of Object.entries(f.paths)){let A=f.paths[v];if(a[v]!==!0&&!s?.({path:v,method:!0,operation:A}))if(typeof E=="object"&&E!==null){let O=Object.fromEntries(Object.entries(E).filter(([M])=>{let H=f.paths[v][M],$=Array.isArray(a[v])&&a[v].includes(M),K=s?.({path:v,method:M,operation:H});return!$&&!K}));d[v]=O}else d[v]=E}return{...f,paths:d}}),"removePaths");function wEr(a){return a.apis&&(Array.isArray(a.apis)?a.apis=a.apis.map(Hbt):a.apis=Hbt(a.apis)),a}t(wEr,"withZuplo");function Hbt(a){return a.type==="file"&&(a.postProcessors=[AEr({keys:["x-zuplo-route","x-zuplo-path"]}),kEr({shouldRemove:t(({operation:s})=>s["x-internal"],"shouldRemove")}),...a.postProcessors??[]]),a}t(Hbt,"configureApis");var PEr=wEr,Zbt=Vr.object({label:Vr.string(),color:Vr.enum(["green","blue","yellow","red","purple","indigo","gray"]),placement:Vr.enum(["start","end"]).optional()}),NEr=Vr.object({type:Vr.literal("doc"),id:Vr.string(),label:Vr.string().optional()}),IEr=Vr.union([NEr,Vr.string()]),OEr=Vr.object({type:Vr.literal("doc"),id:Vr.string(),icon:Vr.custom().optional(),label:Vr.string().optional(),badge:Zbt.optional()}),FEr=Vr.union([OEr,Vr.string()]),LEr=Vr.object({type:Vr.literal("link"),label:Vr.string(),href:Vr.string(),description:Vr.string().optional(),badge:Zbt.optional()}),REr=Vr.object({type:Vr.literal("category"),icon:Vr.custom().optional(),label:Vr.string(),description:Vr.string().optional(),collapsible:Vr.boolean().optional(),collapsed:Vr.boolean().optional(),link:IEr.optional()}),e2t=Vr.lazy(()=>Vr.union([FEr,LEr,MEr])),MEr=REr.extend({items:e2t.array()}),jEr=e2t.array(),L5e=Vr.object({}).passthrough(),Gbt=Vr.object({background:Vr.string(),foreground:Vr.string(),card:Vr.string(),cardForeground:Vr.string(),popover:Vr.string(),popoverForeground:Vr.string(),primary:Vr.string(),primaryForeground:Vr.string(),secondary:Vr.string(),secondaryForeground:Vr.string(),muted:Vr.string(),mutedForeground:Vr.string(),accent:Vr.string(),accentForeground:Vr.string(),destructive:Vr.string(),destructiveForeground:Vr.string(),border:Vr.string(),input:Vr.string(),ring:Vr.string(),radius:Vr.string()}).partial(),BEr=Vr.object({label:Vr.string(),tags:Vr.array(Vr.string())}),R5e=Vr.object({id:Vr.string().optional(),server:Vr.string().optional(),navigationId:Vr.string().optional(),categories:Vr.array(BEr).optional()}),UEr=Vr.function().args(L5e).returns(Vr.union([L5e,Vr.promise(L5e)])),Qbt=Vr.union([Vr.object({type:Vr.literal("url"),input:Vr.string()}).merge(R5e),Vr.object({type:Vr.literal("file"),input:Vr.string()}).merge(R5e).merge(Vr.object({postProcessors:UEr.array().optional()})),Vr.object({type:Vr.literal("raw"),input:Vr.string()}).merge(R5e)]),$Er=Vr.union([Vr.object({enabled:Vr.boolean(),endpoint:Vr.string()}),Vr.object({enabled:Vr.boolean(),getKeys:Vr.custom(a=>typeof a=="function"),rollKey:Vr.custom(a=>typeof a=="function").optional(),deleteKey:Vr.custom(a=>typeof a=="function").optional(),updateKeyDescription:Vr.custom(a=>typeof a=="function").optional(),createKey:Vr.custom(a=>typeof a=="function").optional()})]),JEr=Vr.object({src:Vr.object({light:Vr.string(),dark:Vr.string()}),alt:Vr.string().optional(),width:Vr.string().optional()}),zEr=Vr.object({siteUrl:Vr.string(),changefreq:Vr.optional(Vr.enum(["always","hourly","daily","weekly","monthly","yearly","never"])),priority:Vr.optional(Vr.number()),outDir:Vr.string().optional(),autoLastmod:Vr.boolean().optional(),exclude:Vr.union([Vr.function().returns(Vr.promise(Vr.array(Vr.string()))),Vr.array(Vr.string())]).optional()}).optional(),Kbt=Vr.object({files:Vr.string(),defaultOptions:Vr.object({toc:Vr.boolean(),disablePager:Vr.boolean()}).partial().optional()}),qEr=Vr.object({label:Vr.string(),id:Vr.string(),default:Vr.string().optional(),display:Vr.enum(["auth","anon","always"]).default("always").optional()}),VEr=Vr.object({from:Vr.string(),to:Vr.string()}),WEr=Vr.object({type:Vr.literal("inkeep"),apiKey:Vr.string(),integrationId:Vr.string(),organizationId:Vr.string(),primaryBrandColor:Vr.string(),organizationDisplayName:Vr.string()}).optional(),HEr=Vr.union([Vr.object({type:Vr.literal("clerk"),clerkPubKey:Vr.custom(a=>typeof a=="string"?/^pk_(test|live)_\w+$/.test(a):!1),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()}),Vr.object({type:Vr.literal("openid"),clientId:Vr.string(),issuer:Vr.string(),audience:Vr.string().optional(),scopes:Vr.array(Vr.string()).optional(),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()}),Vr.object({type:Vr.literal("auth0"),clientId:Vr.string(),domain:Vr.string(),audience:Vr.string().optional(),redirectToAfterSignUp:Vr.string().optional(),redirectToAfterSignIn:Vr.string().optional(),redirectToAfterSignOut:Vr.string().optional()})]),GEr=Vr.object({title:Vr.string(),description:Vr.string(),logo:Vr.string(),favicon:Vr.string(),generator:Vr.string(),applicationName:Vr.string(),referrer:Vr.string(),keywords:Vr.array(Vr.string()),authors:Vr.array(Vr.string()),creator:Vr.string(),publisher:Vr.string()}).partial(),Ybt=Vr.object({url:Vr.string(),fontFamily:Vr.string()}),QEr=Vr.object({sans:Ybt.optional(),mono:Ybt.optional()}),KEr=Vr.object({pageTitle:Vr.string(),logoUrl:Vr.string(),logo:JEr,banner:Vr.object({message:Vr.custom(),color:Vr.enum(["note","tip","info","caution","danger"]).or(Vr.string()).optional(),dismissible:Vr.boolean().optional()})}).partial(),Xbt=Vr.object({navigationId:Vr.string(),label:Vr.string(),items:Vr.array(Vr.string()).optional()}),t2t=Vr.object({basePath:Vr.string().optional(),page:KEr,topNavigation:Vr.array(qEr),sidebar:Vr.record(jEr),theme:Vr.object({light:Gbt,dark:Gbt,fonts:QEr}).partial(),metadata:GEr,authentication:HEr,search:WEr,docs:Vr.union([Kbt,Vr.array(Kbt)]),apis:Vr.union([Qbt,Vr.array(Qbt)]),catalog:Vr.union([Xbt,Vr.array(Xbt)]),apiKeys:$Er,redirects:Vr.array(VEr),sitemap:zEr}),r2t=t((a,s)=>{if(!a.sidebar||!a.topNavigation)return;let c=a.topNavigation.map(d=>d.id),f=Object.keys(a.sidebar).filter(d=>!c.includes(d));f.length>0&&s.addIssue({code:Vr.ZodIssueCode.custom,message:`Sidebar ID [${f.map(d=>`"${d}"`).join(", ")}] not found in top navigation.
632
632
  Following IDs are available: ${c.join(", ")}`})},"refine"),YEr=t2t.partial(),XEr=YEr.superRefine(r2t);function ZEr(a){let s=XEr.safeParse(a);s.success||(console.log("Validation errors:"),console.log(ede(s.error).toString()))}t(ZEr,"validateCommonConfig");var exr=Vr.object({UNSAFE_slotlets:Vr.record(Vr.string(),Vr.custom()),mdx:Vr.object({components:Vr.custom()}).partial(),customPages:Vr.array(Vr.object({path:Vr.string(),element:Vr.custom().optional(),render:Vr.custom().optional(),prose:Vr.boolean().optional()})),plugins:Vr.array(Vr.custom()),build:Vr.custom()}),txr=t2t.merge(exr).partial().superRefine(r2t);function rxr(a){let s=txr.safeParse(a);s.success||(console.log("Validation errors:"),console.log(ede(s.error).toString()))}t(rxr,"validateConfig");var nxr=["zudoku.config.js","zudoku.config.jsx","zudoku.config.ts","zudoku.config.tsx","zudoku.config.mjs"],ixr="dev-portal.json",M5e=t(a=>xEr(a).then(()=>!0).catch(()=>!1),"fileExists"),w6,XN;async function B5e(a){if(w6&&XN&&await M5e(w6))return{configPath:w6,configType:XN};let s=Vbt.join(a,ixr);if(await M5e(s))return w6=s,XN="dev-portal",{configPath:w6,configType:XN};for(let c of nxr){let f=Vbt.join(a,c);if(await M5e(f))return w6=f,XN="zudoku",{configPath:w6,configType:XN}}return w6=void 0,XN=void 0,{configPath:w6,configType:XN}}t(B5e,"findConfigFilePath");async function sxr(a){let s=await B5e(a);if(s.configType)return s;throw new Error("No zudoku config file found in project root.")}t(sxr,"getConfigFilePath");async function axr(a,s,c){let f=Wbt(s).href,d=[],v=await wbt(f,{parentURL:import.meta.url,onImport:t(E=>{let A=DEr(E.startsWith("file://")?E:Wbt(E).href);A.startsWith(a)&&d.push(A)},"onImport")}).then(E=>E.default);if(!v)throw new Error(`Failed to load config file: ${s}`);return{dependencies:d,config:v}}t(axr,"loadZudokuCodeConfig");async function oxr(a,s){let c=await EEr(a,"utf-8"),f;try{f=JSON.parse(c)}catch{throw new Error("Failed to parse dev-portal.json. Check that the file is valid JSON.")}return ZEr(f),f=j5e(f,s),f=PEr(f),f}t(oxr,"loadDevPortalConfig");function j5e(a,s){if(typeof a=="string"){let c=a.match(/^\$env\(([^)]+)\)$/);if(c){let f=c[1];return s[f]}return a}else{if(Array.isArray(a))return a.map(c=>j5e(c,s));if(typeof a=="object"&&a!==null){let c={};for(let f in a)Object.hasOwn(a,f)&&(c[f]=j5e(a[f],s));return c}}return a}t(j5e,"replaceEnvVariables");async function n2t(a,s,c){let{configPath:f,configType:d}=await sxr(a),v,E;return d==="dev-portal"?(v=await oxr(f,s),E=[]):({config:v,dependencies:E}=await(c?.loadZudokuCodeConfig??axr)(a,f,s),rxr(v)),{...v,__meta:{dependencies:E,path:f,registerDependency:t((...O)=>E.push(...O),"registerDependency")}}}t(n2t,"tryLoadZudokuConfig");import s2t from"fs/promises";import $7 from"path";import{writeFile as cxr}from"fs/promises";async function hk(a,s){await Ml.mkdirForFilePathIfNotExits(a);let c=await import("prettier"),f=s;try{f=await c.format(s,{parser:"babel"})}catch{}await cxr(a,f,"utf-8")}t(hk,"writeDebugSourceFile");import U5e from"path";async function $5e(a){if(await Ml.fileExists(`${a}/config/dev-portal.json`))return"dev-portal";if((await B5e(U5e.join(a,"docs")))?.configType)return"zudoku"}t($5e,"getDevPortalType");function gU(a,s){let c=U5e.relative(process.cwd(),U5e.join(a,qF));return Object.keys(s?.outputs??{}).map(d=>`.${d.replace(c,"")}`)}t(gU,"getBuildModules");var i2t="/docs",uxr="/__zuplo/dev-portal";function fxr(a){let s=a.trim().toLowerCase();return s.endsWith("/")&&(s=s.slice(0,-1)),s}t(fxr,"normalizePathname");function _xr(a){let s={sitePathname:a?.sitePathname===uxr?i2t:a?.sitePathname?fxr(a.sitePathname):i2t,enabled:a?a.enabled??!0:!1,version:a?.version??"legacy"};return`const devPortal = ${JSON.stringify(s)};
633
- export default devPortal;`}t(_xr,"generateSource");function a2t(a){return{name:"dev-portal-config",setup(s){s.onResolve({filter:/dev-portal.json$/},c=>({namespace:"dev-portal-json",path:$7.isAbsolute(c.path)?c.path:$7.join(c.resolveDir,c.path),pluginName:"dev-portal"})),s.onLoad({filter:/.*/,namespace:"dev-portal-json"},async c=>f_.timeFn("Generating dev-portal.json data",async()=>{let f,d,v=[],E=await $5e(a.sourceDirectory);if(E==="zudoku")try{let O=$7.join($7.resolve($7.dirname(c.path),".."),Hlt);f={version:"zudoku",enabled:!0,sitePathname:(await n2t(O,{},{loadZudokuCodeConfig:pxr(a.sourceDirectory,a.logger)})).basePath}}catch(O){a.logger.error(O,"Failed to load developer portal configuration"),v.push({id:"dev-portal-build-error",text:"Could not load developer portal configuration.",location:{file:"docs/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:O.message,pluginName:"dev-portal",notes:[]})}else if(E==="dev-portal"){d=await s2t.readFile(c.path,"utf-8");try{f=JSON.parse(d)}catch(O){v.push({id:"dev-portal-build-error",text:"Could not parse dev-portal.json. Ensure that the file is valid JSON.",location:{file:"config/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}}let A;try{if(A=_xr(f),_h.DEBUG_BUILD_MODE&&A){let O=$7.join(a.sourceDirectory,".zuplo","dev-portal.js");await hk(O,A)}}catch(O){v.push({id:"dev-portal-build-error",text:O.message,location:{file:"dev-portal.json",namespace:"dev-portal-json",line:1,column:0,length:0,lineText:"issue",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}return{contents:A,errors:v,pluginName:"dev-portal",loader:"js",resolveDir:$7.dirname(c.path),watchFiles:[c.path]}}))}}}t(a2t,"devPortalConfigPlugin");function pxr(a,s){return t(async function(f,d,v){let E;try{E=Ml.safePath(a).resolve(d)}catch(K){throw s.error(`Error resolving path ${d} inside ${a}`),K}let A=await s2t.readFile(E,"utf-8"),O=await lxr(A,{target:"esnext",syntax:"typescript",tsx:!0}),M=dxr(O);return{dependencies:[],config:{basePath:M??"/docs"}}},"loadZudokuCodeConfig")}t(pxr,"createLoadDevPortalConfigFunction");function dxr(a){let s;return a.body.forEach(c=>{if(c.type==="VariableDeclaration"){let f=c.declarations[0];f.id.type==="Identifier"&&f.id.value==="config"&&f.init&&f.init.type==="ObjectExpression"&&f.init.properties.forEach(v=>{v.type==="KeyValueProperty"&&(v.key.type==="Identifier"&&v.key.value==="basePath"||v.key.type==="StringLiteral"&&v.key.value==="basePath")&&v.value.type==="StringLiteral"&&(s=v.value.value)})}}),s}t(dxr,"getBasePathFromConfig");import o2t from"path";var c2t="legacy-environment",l2t="legacy-environment",mxr=`import { environment } from "@zuplo/runtime";
633
+ export default devPortal;`}t(_xr,"generateSource");function a2t(a){return{name:"dev-portal-config",setup(s){s.onResolve({filter:/dev-portal.json$/},c=>({namespace:"dev-portal-json",path:$7.isAbsolute(c.path)?c.path:$7.join(c.resolveDir,c.path),pluginName:"dev-portal"})),s.onLoad({filter:/.*/,namespace:"dev-portal-json"},async c=>f_.timeFn("Generating dev-portal.json data",async()=>{let f,d,v=[],E=await $5e(a.sourceDirectory);if(E==="zudoku")try{let O=$7.join($7.resolve($7.dirname(c.path),".."),Hlt);f={version:"zudoku",enabled:!0,sitePathname:(await n2t(O,{},{loadZudokuCodeConfig:pxr(a.sourceDirectory,a.logger)})).basePath}}catch(O){a.logger.error(O,"Failed to load developer portal configuration"),v.push({id:"dev-portal-build-error",text:"Could not load developer portal configuration.",location:{file:"docs/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:O.message,pluginName:"dev-portal",notes:[]})}else if(E==="dev-portal"){d=await s2t.readFile(c.path,"utf-8");try{f=JSON.parse(d)}catch(O){v.push({id:"dev-portal-build-error",text:"Could not parse dev-portal.json. Ensure that the file is valid JSON.",location:{file:"config/dev-portal.json",namespace:"",line:1,column:0,length:0,lineText:"",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}}let A;try{if(A=_xr(f),_h.DEBUG_BUILD_MODE&&A){let O=$7.join(a.sourceDirectory,".zuplo","dev-portal.js");await hk(O,A)}}catch(O){v.push({id:"dev-portal-build-error",text:O.message,location:{file:"dev-portal.json",namespace:"dev-portal-json",line:1,column:0,length:0,lineText:"issue",suggestion:""},detail:"DevPortalValidationError",pluginName:"dev-portal",notes:[{text:O.message,location:null}]})}return{contents:A,errors:v,pluginName:"dev-portal",loader:"js",resolveDir:$7.dirname(c.path),watchFiles:[c.path]}}))}}}t(a2t,"devPortalConfigPlugin");function pxr(a,s){return t(async function(f,d,v){let E;try{E=Ml.safePath(a).resolve(d)}catch(K){throw s.error(`Error resolving path ${d} inside ${a}`),K}let A=await s2t.readFile(E,"utf-8"),O=await lxr(A,{target:"esnext",syntax:"typescript",tsx:!0}),M=dxr(O);return{dependencies:[],config:{basePath:M??"/"}}},"loadZudokuCodeConfig")}t(pxr,"createLoadDevPortalConfigFunction");function dxr(a){let s;return a.body.forEach(c=>{if(c.type==="VariableDeclaration"){let f=c.declarations[0];f.id.type==="Identifier"&&f.id.value==="config"&&f.init&&f.init.type==="ObjectExpression"&&f.init.properties.forEach(v=>{v.type==="KeyValueProperty"&&(v.key.type==="Identifier"&&v.key.value==="basePath"||v.key.type==="StringLiteral"&&v.key.value==="basePath")&&v.value.type==="StringLiteral"&&(s=v.value.value)})}}),s}t(dxr,"getBasePathFromConfig");import o2t from"path";var c2t="legacy-environment",l2t="legacy-environment",mxr=`import { environment } from "@zuplo/runtime";
634
634
  export default environment;`;function u2t(a){return{name:"environment",setup(s){s.onResolve({filter:/@app\/environment$/},()=>({namespace:l2t,pluginName:c2t,path:o2t.join(a.sourceDirectory,yN,"environment.js")})),s.onLoad({filter:/.*/,namespace:l2t},async c=>({contents:mxr,loader:"ts",resolveDir:o2t.dirname(c.path),pluginName:c2t}))}}}t(u2t,"environmentPlugin");var SCt=W_(PLe(),1),TCt=W_(zTt(),1),CCt=W_(tRe(),1),ECt=W_(rRe(),1);import d4r from"fs/promises";import FS from"path";var Ck="schemas",Mde="json-schema";function xCt(a){return{name:Ck,async setup(s){let c=new CCt.Ajv2020({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});(0,TCt.default)(c,{mode:"fast"}),c.opts.code.formats=SCt._`require("ajv-formats/dist/formats").fastFormats`;let f=FS.join(a.sourceDirectory,oQ),d,v=[],E=[];if(await Ml.dirExists(f)&&(c.addKeyword("faker"),d=await Ml.listFolderContents(f,oQ),await Promise.all(d.map(async A=>{try{let O=Ml.safePath(a.sourceDirectory).resolve(f,A);if(!O.startsWith(f))throw new Error("All schemas must be in the schemas directory");let M=await d4r.readFile(O,"utf-8");if(M===""||M===void 0)throw new Error(`Schema 'schemas/${A}' is empty and will be ignored.`);let H=JSON.parse(M);if(H.$schema&&H.$schema!=="https://json-schema.org/draft/2020-12/schema")throw new Error(`Error in ${A}: All JSON schemas must use version 2020-12. See release notes for changes: https://json-schema.org/draft/2020-12/release-notes.html`);if(c.addSchema(H,A),c.errors?.length){let $=c.errors[0];v.push({id:"json-schema-validation-error",pluginName:Ck,text:`Error: ${$.message}`,location:{file:FS.join(oQ,A)},detail:{params:$.params,propertyName:$.propertyName,schemaPath:$.schemaPath,data:$.data}})}}catch(O){if(O.message.endsWith("is empty and will be ignored.")){E.push({id:"empty-json-schema-file",pluginName:Ck,text:`Schema 'schemas/${A}' is empty and will be ignored.`,location:{file:`schemas/${A}`,suggestion:"Add schema details or remove the file from the project."},detail:"EmptyJSONSchemaFile",notes:[{text:`Schema 'schemas/${A}' is empty and will be ignored.`,location:{file:`schemas/${A}`,suggestion:"Add schema details or remove the file from the project."}}]});return}let M=await w7e(A,a.sourceDirectory,O.message);v.push({id:"json-schema-add-error",pluginName:Ck,text:`Error: ${O.message}`,location:M,detail:"InvalidAddSchemaError",notes:[{text:O.message}]})}})),await Promise.all(d.map(async A=>{try{let O=c.getSchema(A);O&&c.compile(O.schema).errors?.forEach(H=>{v.push({text:`Failed to compile ${A}: ${H.message}`})})}catch(O){let M=await w7e(A,a.sourceDirectory,O.message);v.push({id:"json-schema-compile-error",pluginName:Ck,text:`The schema file '${A}' is not valid. Error: ${O.message}`,location:M,detail:"InvalidSchemaError",notes:[{text:O.message}]})}})),_h.DEBUG_BUILD_MODE)){let A=FS.resolve(a.outputDirectory,oQ);await Ml.mkdirIfNotExists(A)}s.onStart(async()=>{if(d)return{errors:v,warnings:E}}),s.onResolve({filter:/schemas\/.*\.json$/},async A=>{let O=FS.isAbsolute(A.path)?A.path:FS.join(A.resolveDir,A.path);if(A.importer&&A.importer!==FS.join(a.sourceDirectory,"config/routes.json"))return{path:O};if(!await Ml.fileExists(O)){let M="policies.json";return{errors:[{id:"json-schema-build-error",text:`Unable to resolve reference to '${A.path}' from ${M}`,location:{file:FS.join(A.resolveDir,M),namespace:Mde,line:1,column:0,length:0,lineText:`Invalid JSON schema reference in ${M}`,suggestion:""},detail:"RouteReferenceError",pluginName:Ck,notes:[{text:`Unable to resolve reference to '${A.path}' from ${M}`,location:null}]}],namespace:Mde,path:O,pluginName:Ck}}return{path:O,namespace:Mde,pluginName:Ck}}),s.onLoad({filter:/.*/,namespace:Mde},async A=>f_.timeFn(`Generating json schema data: ${FS.basename(A.path)}`,async()=>{let O=[],M;try{let H=FS.relative(f,A.path),$=c.getSchema(H);if(!$)throw new Error(`Could not load schema at ${A.path}`);M=$.source?.validateCode;let K=c.compile($.schema);M=(0,ECt.default)(c,K)}catch(H){O.push({pluginName:Ck,text:`Cannot parse project's schemas/${FS.basename(A.path)} file. Error: ${H.message}`,location:null,notes:[{text:H.message,location:null}],detail:H})}if(_h.DEBUG_BUILD_MODE&&M){let H=FS.relative(f,A.path),$=FS.join(a.sourceDirectory,".zuplo",`${H}.js`);await hk($,M)}return{contents:M,errors:O,pluginName:Ck,resolveDir:FS.dirname(A.path),watchFiles:[A.path]}}))}}}t(xCt,"jsonSchemaPlugin");import{relative as m4r}from"path";var DCt=["node:assert","node:async_hooks","node:buffer","node:crypto","node:diagnostics_channel","node:events","node:path","node:process","node:stream","node:string_decoder","node:util"],h4r="nodejs-compat-plugin";function ACt({sourceDirectory:a}){return{name:h4r,setup(s){let c=new Set;s.onStart(()=>{c.clear()}),s.onResolve({filter:/node:.*/},async({path:f,kind:d,resolveDir:v,...E})=>{let A=`${f}:${d}:${v}:${E.importer}`;if(c.has(A))return;c.add(A);let O=await s.resolve(f,{kind:d,resolveDir:v,importer:E.importer});return O.errors.length>0?DCt.includes(f)||f.includes("/")&&DCt.includes(f.split("/")[0])?{external:!0}:{external:!0,warnings:O.errors.map(H=>({...H,location:{file:m4r(a,E.importer),line:0,column:0,namespace:"",length:0,lineText:"",suggestion:"Remove the imported node module"},detail:`The package "${f}" wasn't found on the file system but is built into node. If this code is executed it will fail.`}))}:O})}}}t(ACt,"nodejsCompatPlugin");import kCt from"fs/promises";import Xx from"path";var BU="open-api-routes-plugin",jde="open-api-routes-json";function wCt(a){return{name:"open-api-routes-plugin",setup(s){s.onResolve({filter:/routes.json$/},c=>({watchFiles:[...nRe(Xx.join(a.sourceDirectory,zb),[".oas.json"],!0),Xx.join(a.sourceDirectory,zb,Bue)],namespace:jde,path:Xx.isAbsolute(c.path)?c.path:Xx.join(c.resolveDir,c.path),pluginName:BU})),s.onResolve({filter:/^\.\.\/modules\/.*/,namespace:jde},async c=>{let f=Xx.join(c.resolveDir,`${c.path}.ts`);if(!await Ml.fileExists(f)){let d=`$import(.${c.path.replace(/^../,"")})`,v=Xx.resolve(a.sourceDirectory,"config"),E=await QF(v),A=await Rft(E,d,"Update your route configuration to use code from the 'modules' folder");return{errors:[{id:"route-build-error",text:`Invalid handler reference in routes.json. Unable to resolve reference to '${d}' from routes.json`,location:A,detail:"RouteReferenceError",pluginName:BU}],namespace:jde,path:c.path,pluginName:BU}}}),s.onLoad({filter:/.*/,namespace:jde},async c=>f_.timeFn("Generating route.json data",async()=>{let f=Xx.resolve(a.sourceDirectory,"config"),d=await QF(f),v=await Promise.all(d.map(async M=>({content:await kCt.readFile(M,"utf-8"),fileName:M}))),E=Xx.resolve(f,"policies.json");if(!await Ml.fileExists(E))return{errors:[{text:"The project must include a policies file ('/config/policies.json')",detail:"OASPoliciesFileMissing",pluginName:BU,location:{line:0,column:0,file:"/config/policies.json"}}],pluginName:BU};let A={content:await kCt.readFile(E,"utf-8"),fileName:E},O;try{O=await x7e({sourceDirectory:a.sourceDirectory,oasContent:v,policiesContent:A})}catch(M){throw new Error("Error compiling routes: "+M.message)}if(_h.DEBUG_BUILD_MODE&&O.content){let M=Xx.join(a.sourceDirectory,".zuplo"),H=Xx.resolve(M,"routes.js");await hk(H,O.content)}return{contents:O.content,errors:O.errors,pluginName:BU,resolveDir:Xx.dirname(c.path),watchFiles:[c.path]}}))}}}t(wCt,"openApiRoutesPlugin");import Bde from"path";var VY="raw-route-plugin",PCt="raw-route";function NCt(a){return{name:"raw-route-plugin",setup(s){s.onResolve({filter:/raw.json$/},c=>({namespace:PCt,path:c.path,pluginName:VY})),s.onLoad({filter:/.*/,namespace:PCt},async c=>{let f=Bde.resolve(a.sourceDirectory,zb);if(!await Ml.dirExists(f))return{loader:"js",resolveDir:Bde.dirname(c.path),pluginName:VY};let d=await QF(f);try{let v=await k7e({oasFiles:d,sourceDirectory:a.sourceDirectory,logger:a.logger});if(_h.DEBUG_BUILD_MODE&&v){let E=Bde.join(a.sourceDirectory,".zuplo","raw-routes.js");await hk(E,v)}return{contents:v,loader:"js",resolveDir:Bde.dirname(c.path),pluginName:VY}}catch(v){if(v instanceof Tv)return{contents:"",loader:"ts",errors:[{id:"route-build-error",text:v.issue.text,location:v.issue.location,detail:v.issue.detail,pluginName:VY}],pluginName:VY};throw v}})}}}t(NCt,"rawRoutePlugin");import g4r from"fs/promises";import iRe from"path";var Ude="runtime-config",ICt="runtime-config-plugin";function OCt(){return{name:Ude,setup(a){a.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},s=>({namespace:ICt,path:iRe.isAbsolute(s.path)?s.path:iRe.join(s.resolveDir,s.path),pluginName:Ude})),a.onLoad({filter:/.*/,namespace:ICt},async s=>f_.timeFn("Generating zuplo.runtime.ts data",async()=>{let c="export const runtimeInit = undefined;",f=[];return await Ml.fileExists(s.path)?(c=await g4r.readFile(s.path,"utf-8"),{contents:c,loader:"ts",resolveDir:iRe.dirname(s.path),errors:f,pluginName:Ude,watchFiles:[s.path]}):{contents:c,loader:"ts",errors:f,pluginName:Ude}}))}}}t(OCt,"runtimeConfigPlugin");var LCt=W_(tRe(),1),RCt=W_(rRe(),1);import oRe from"fs/promises";import Z7 from"path";var sRe="schema-validation-plugin",FCt="schema-validation",y4r="module.exports = {}";function MCt(a){return{name:"schema-validation-plugin",setup(s){s.onResolve({filter:/ajv-schema.json$/},c=>({namespace:FCt,path:c.path,pluginName:sRe})),s.onLoad({filter:/.*/,namespace:FCt},async c=>{let f=Z7.resolve(a.sourceDirectory,zb,"policies.json");if(!await Ml.fileExists(f))return{contents:y4r,loader:"js",resolveDir:Z7.dirname(c.path),pluginName:sRe};let d=await b4r(a.sourceDirectory),v=Z7.resolve(a.sourceDirectory,zb),E=await QF(v),A=await E4r(E,d),O=await v4r({oasFiles:E,routesWithSchemaValidation:A,sourceDirectory:a.sourceDirectory,logger:a.logger});if(_h.DEBUG_BUILD_MODE&&O){let M=Z7.join(a.sourceDirectory,".zuplo","schema-validation.js");await hk(M,O)}return{contents:O,loader:"js",resolveDir:Z7.dirname(c.path),pluginName:sRe}})}}}t(MCt,"schemaValidationPlugin");async function v4r({oasFiles:a,routesWithSchemaValidation:s,sourceDirectory:c,logger:f}){let d="",v=new NN(c,f);if(s.length===0)return d;let E=new LCt.Ajv2020({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let A of a){let O=await oRe.readFile(A,"utf-8"),M=Z7.basename(A,".oas.json"),H=s.filter(Te=>Te.fileName===M),$=await v.resolve(A),K=JSON.parse(O),Ne=[],xe=new Map;H.forEach(Te=>{let Tt=K.paths[Te.path][Te.method];if(Tt.requestBody){let Dt;if(Tt.requestBody.$ref){let br=Tt.requestBody.$ref;Dt=$.get(br)?.content}else Tt.requestBody.content&&(Dt=Tt.requestBody.content);if(Dt)for(let br in Dt){let dr=Dt[br].schema,jr=c8e(Te.path,Te.method,br);dr.$id=jr,E.addSchema(dr),aRe(dr,A,M,E,$,Ne,xe)}}if(Tt.parameters)for(let Dt of Tt.parameters){let br=Dt.$ref?$.get(Dt.$ref):Dt,dr=br.schema.$ref?$.get(br.schema.$ref):br.schema,jr=o8e(Te.path,Te.method,br.in,br.name);dr.$id=jr,E.addSchema(dr),aRe(br,A,M,E,$,Ne,xe)}});for(let Te of Ne){let Tt=$.get(Te),Dt=XQ(M,Te);E.addSchema(Tt,Dt)}}return d=(0,RCt.default)(E),d}t(v4r,"schemaValidationSource");function aRe(a,s,c,f,d,v,E){for(let A in a){let O=a[A];if(A==="$ref"){let M=XQ(c,TN(s,O));a[A]=M,OQ(s,c,TN(s,O),d,v,E,(H,$)=>XQ(H,TN(s,$)))}else typeof O=="object"&&aRe(O,s,c,f,d,v,E)}}t(aRe,"addRefsToSchema");async function b4r(a){let s=new Set(["RequestValidationInboundPolicy"]),c=await oRe.readFile(`${a}/config/policies.json`,"utf-8"),f=JSON.parse(c);return S4r(f,s)}t(b4r,"getPolicyNamesUsingSchemaValidationPolicies");function S4r(a,s){let c=new Set;a.policies?.forEach(d=>{d.handler?.export&&s.has(d.handler.export)&&d.handler.module==="$import(@zuplo/runtime)"&&c.add(d.name)});let f=T4r(a,c);return new Set([...c,...f])}t(S4r,"getPolicyNamesReferencingPolicyHandlers");function T4r(a,s){let c=new Set;return a.policies?.forEach(f=>{f.handler?.export==="CompositeInboundPolicy"&&f.handler?.options?.policies?.forEach(d=>{s.has(d)&&c.add(f.name)})}),c}t(T4r,"getCompositePoliciesContainingPolicy");function C4r(a,s){if(!a["x-zuplo-route"]||!a["x-zuplo-route"].policies)return!1;let c=a["x-zuplo-route"].policies.inbound;if(c){for(let d of c)if(s.has(d))return!0}let f=a["x-zuplo-route"].policies.outbound;if(f){for(let d of f)if(s.has(d))return!0}return!1}t(C4r,"isPolicyPresentInOperation");async function E4r(a,s){let c=[];for(let f of a){let d=await oRe.readFile(f,"utf-8"),E=JSON.parse(d).paths;for(let A in E){let O=E[A];for(let M in O){let H=O[M];C4r(H,s)&&c.push({fileName:Z7.basename(f,".oas.json"),path:A,method:M})}}}return c}t(E4r,"getRoutesContainingPolicies");import{mkdirSync as x4r,writeFileSync as D4r}from"fs";import A4r from"path";function jCt(a){return{name:"write-modules-plugin",setup(s){s.onEnd(async c=>{if(c){let f=gU(a.sourceDirectory,c.metafile);x4r(a.outputDirectory,{recursive:!0}),D4r(A4r.join(a.outputDirectory,"modules.json"),JSON.stringify(f,null,2))}})}}}t(jCt,"writeModulesPlugin");var k4r=v1t("zuplo:core:build"),w4r=["workerd","worker","browser"],$Ct=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],cRe.resolve(BCt(UCt(import.meta.url)),"..","..","..","node_modules"),cRe.resolve(BCt(UCt(import.meta.url)),"..","..","..","..","..","node_modules")];async function WY({systemDirectory:a,outputDirectory:s,sourceDirectory:c,cacheDirectory:f,logger:d,minify:v=!0,command:E,flags:A}){let O=cRe.join(a,$ue);k4r(`Building with node paths: ${$Ct.join(", ")}`);let M=v&&E!=="dev"&&!process.env.DEBUG_BUILD_DISABLE_MINIFY?{minify:!0,chunkNames:"[hash]"}:{minify:!1,keepNames:!0,chunkNames:"[name]-[hash]"},H=Object.freeze({sourceDirectory:c,outputDirectory:s,cacheDirectory:f,logger:d,debugMode:_h.DEBUG_BUILD_MODE,flags:A});return{platform:"browser",target:"es2022",outdir:s,splitting:!0,metafile:!0,format:"esm",nodePaths:$Ct,entryPoints:[O],sourcemap:"linked",legalComments:"none",treeShaking:!0,bundle:!0,...M,external:[],logLevel:"silent",conditions:w4r,plugins:[u2t(H),b1t(H),wCt(H),NCt(H),MCt(H),OCt(),a2t(H),xCt(H),ACt(H),jCt(H)]}}t(WY,"getBaseESBuildConfig");var e5="run-esbuild",zCt=t(async function({systemDirectory:a,outputDirectory:s,sourceDirectory:c,cacheDirectory:f,buildId:d,logger:v,config:E,command:A,minify:O},{data:M}){return f_.timeFn("Running esbuild",async()=>{v.debug("Running esbuild");let H=await WY({command:A,minify:O,systemDirectory:a,outputDirectory:s,cacheDirectory:f,sourceDirectory:c,logger:v,flags:E.flags}),$;try{if(!await sB(c))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");$=await JCt.build(H),M.set("metafile",$.metafile)}catch(xe){if(v.error(xe),xe.errors||xe.warnings)$=xe;else if(xe.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))$={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:e5,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw xe}$.errors.length>0&&$.errors.length>1&&($.errors.length=1);let{errors:K,warnings:Ne}=lRe({buildId:d,result:$});return{errors:K,warnings:Ne}})},"runEsbuild");function lRe({buildId:a,result:s}){return{status:s.errors.length>0?"Failed":s.warnings.length>0?"Warnings":"Good",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:a,warnings:s.warnings.map(f=>f.text==="Using direct eval with a bundler is not recommended and may cause problems"?{location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:"We do not support the use of 'eval' or 'new Function(...)'",severity:Rue,pluginName:f.pluginName||e5}:{location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:f.text,severity:Rue,pluginName:f.pluginName||e5}),errors:s.errors.map(f=>({location:f.location,detail:f.detail,id:f.id,notes:f.notes,message:f.text,severity:Q3e,pluginName:f.pluginName||e5})),metafile:s.metafile}}t(lRe,"esbuildResultToBuildResult");var P4r=t((a,s)=>{let c=s;if(s.includes(a)){let f=new RegExp(`.*(${a})`,"g");c=s.replace(f,"")}return c.match(/^(\/)?(\.\.(\/)?)+/)&&(c=c.replace(/^(\/)?(\.\.(\/)?)+/,"/")),c},"removePrefixFromString"),N4r=t((a,s)=>{let c=s;if(c.includes(a)){let f=new RegExp(`[a-zA-Z0-9-_.\\/]+(${a})`,"g");c=c.replace(f,"")}return c},"cleanFilePathsInMessage"),qCt=t((a,s,c)=>{if(!a||a.length<=0)return a;let f=a.filter(d=>d.message!=='Could not resolve "@zuplo/runtime"');return f&&f.length>0&&f.forEach(d=>{try{d.location&&d.location.file&&(d.location.file=P4r(s,d.location.file)),d.location&&d.location.lineText&&d.location.lineText.includes("@zuplo/core/index.minified.js")&&(d.location.lineText=d.location.lineText.substring(0,200)+"...<Truncated>"),d.message=N4r(s,d.message),d.notes&&d.notes.length>0&&delete d.notes,d.text&&delete d.text,d.pluginName===""&&(d.pluginName=c)}catch{}}),f},"cleanDataOnBuildIssue");function VCt(a,s){let c=uRe.basename(s);a.errors&&(a.errors=qCt(a.errors,c,e5)),a.warnings&&(a.warnings=qCt(a.warnings,c,e5))}t(VCt,"formatBuildResult");var I4r=t(a=>uRe.basename(a).startsWith("."),"isHiddenOnUnix"),O4r=t((a,s=[])=>s.map(c=>c.startsWith(".")?c:`.${c}`).some(c=>a.endsWith(c)),"hasMatchingExtname");function nRe(a,s=[],c=!1){let f=[],d;if(!$de.existsSync(a)){let v;if(wQ.hasMagic(a))v=a;else{let E=s.map(A=>A.startsWith(".")?A:`.${A}`).join("|");v=`${a}+(${E})`}if(f.push(...wQ.sync(v,{nodir:!0})),!f.length)throw Error(`Cannot find any files matching pattern "${a}"`);return f}try{if(d=$de.statSync(a),d.isFile())return[a]}catch{return[]}return $de.readdirSync(a).forEach(v=>{let E=uRe.join(a,v),A;try{if(A=$de.statSync(E),A.isDirectory()){c&&f.push(...nRe(E,s,c));return}}catch{return}if(!s.length)throw Error(`Argument '${s}' required when argument '${a}' is a directory`);!A.isFile()||!O4r(E,s)||I4r(E)||f.push(E)}),f}t(nRe,"lookupFiles");var jC=new Wue({level:process.env.FORCE_BUILD_COLORS?2:void 0}),Ek=` ${jC.gray("|")} `;function oZr(a,s,c){a.info(jC.green(s),c)}t(oZr,"outputSuccess");function cZr(a,s,c){a.warn(jC.yellow(s),c)}t(cZr,"outputWarning");function lZr(a,s,c){a.error(`
635
635
  ${jC.red(s)}`,c)}t(lZr,"outputCritical");function uZr(a,s,c){let f=c.sort((E,A)=>{let O=E.path.split("/").length,M=A.path.split("/").length;return O!==M?O-M:E.path.localeCompare(A.path)}),d=Math.max(...f.map(E=>E.path.length)),v=`${s}
636
636
  `;f.forEach(E=>{let A=" ".repeat(d-E.path.length),O=E.bytes/1024,M=` ${E.path}${A} ${O.toFixed(2)} KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/core",
3
- "version": "6.32.4",
3
+ "version": "6.32.5",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -40,8 +40,8 @@
40
40
  "prettier": "^3.3.3"
41
41
  },
42
42
  "peerDependencies": {
43
- "@zuplo/graphql": "^6.32.4",
44
- "@zuplo/otel": "^6.32.4",
45
- "@zuplo/runtime": "^6.32.4"
43
+ "@zuplo/graphql": "^6.32.5",
44
+ "@zuplo/otel": "^6.32.5",
45
+ "@zuplo/runtime": "^6.32.5"
46
46
  }
47
47
  }