@jsfsi-core/ts-crossplatform 1.0.10 → 1.0.12
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.
- package/dist/index.cjs +26 -1
- package/dist/index.mjs +1410 -2566
- package/dist/src/configuration/configuration.d.ts +2 -2
- package/dist/src/paging/Page.d.ts +2 -16
- package/dist/src/paging/PageQuery.d.ts +1 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ne=(s={})=>s,Ae=s=>[s,void 0],Ze=s=>[void 0,s];class Re{name;constructor(){this.name=this.constructor.name}}const Ie=s=>e=>!(e instanceof s),Ee=s=>e=>e instanceof s,je=(s,e=process.env)=>{const t=s.safeParse(e);if(!t.success)throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);return t.data};function $e(s){return new Promise(e=>setTimeout(e,s))}function xe(s,e){return new Date(s).toLocaleDateString(e,{year:"numeric",month:"2-digit",day:"2-digit"})}function ke(s,e){return new Date(s).toLocaleTimeString(e,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ve(s,e){return`${xe(s,e)} ${ke(s,e)}`}const Pe="00000000-0000-0000-0000-000000000000",De=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function be(s){return typeof s=="string"&&De.test(s)}function Le(s){if(!be(s))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(s.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(s.slice(9,13),16))>>>8,e&255,(e=parseInt(s.slice(14,18),16))>>>8,e&255,(e=parseInt(s.slice(19,23),16))>>>8,e&255,(e=parseInt(s.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}const k=[];for(let s=0;s<256;++s)k.push((s+256).toString(16).slice(1));function Me(s,e=0){return(k[s[e+0]]+k[s[e+1]]+k[s[e+2]]+k[s[e+3]]+"-"+k[s[e+4]]+k[s[e+5]]+"-"+k[s[e+6]]+k[s[e+7]]+"-"+k[s[e+8]]+k[s[e+9]]+"-"+k[s[e+10]]+k[s[e+11]]+k[s[e+12]]+k[s[e+13]]+k[s[e+14]]+k[s[e+15]]).toLowerCase()}let Y;const ze=new Uint8Array(16);function Ue(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(ze)}const Fe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:Fe};function Be(s,e,t){if(re.randomUUID&&!s)return re.randomUUID();s=s||{};const r=s.random??s.rng?.()??Ue();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Me(r)}class j{uuid;constructor(e){Le(e),this.uuid=e}toString(){return this.uuid}equals(e){return this.uuid===e.toString()}static new(){return new j(Be())}static empty(){return new j(Pe)}static isValid(e){return!!(e&&be(e))}static parse(e){return e&&j.isValid(e)?new j(e):void 0}}var _;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(_||(_={}));var ae;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(ae||(ae={}));const u=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),S=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=_.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"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;f<i.path.length;){const h=i.path[f];f===i.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(i))):o[h]=o[h]||{_errors:[]},o=o[h],f++}}};return a(this),r}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const X=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,_.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:_.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(s)}return{message:t}};let We=X;function qe(){return We}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let o="";const f=r.filter(h=>!!h).slice().reverse();for(const h of f)o=h(i,{data:e,defaultError:o}).message;return{...a,path:n,message:o}};function c(s,e){const t=qe(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===X?void 0:X].filter(a=>!!a)});s.common.issues.push(r)}class b{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return b.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),z=s=>({status:"dirty",value:s}),w=s=>({status:"valid",value:s}),ne=s=>s.status==="aborted",ie=s=>s.status==="dirty",$=s=>s.status==="valid",B=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(l||(l={}));class N{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const oe=(s,e)=>{if($(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new T(s.common.issues);return this._error=t,this._error}}};function g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return S(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:S(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:S(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(B(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:S(e)},a=this._parseSync({data:e,path:r.path,parent:r});return oe(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:S(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return $(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>$(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:S(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(B(a)?a:Promise.resolve(a));return oe(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new D({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C.create(this)}promise(){return H.create(this,this._def)}or(e){return q.create([this,e],this._def)}and(e){return J.create(this,e,this._def)}transform(e){return new D({...g(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new K({...g(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new gt({typeName:p.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ee({...g(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return se.create(this,e)}readonly(){return te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ye=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[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,Ge=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?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)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Q;const rt=/^(?:(?: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])$/,at=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,nt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,we="((\\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])))",ct=new RegExp(`^${we}$`);function Ce(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${Ce(s)}$`)}function lt(s){let e=`${we}T${Ce(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ft(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&nt.test(s))}function ht(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}class R extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.string,received:n.parsedType}),m}const r=new b;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.length<n.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&c(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")tt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"email",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")Q||(Q=new RegExp(st,"u")),Q.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"emoji",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")Xe.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"uuid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")Ge.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"nanoid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")He.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")Ye.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid2",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")Qe.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ulid",code:d.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),c(a,{validation:"url",code:d.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"regex",code:d.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?lt(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?ct.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?ut(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?et.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"duration",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?ft(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ip",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="jwt"?ht(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"jwt",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="cidr"?mt(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cidr",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?ot.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64",code:d.invalid_string,message:n.message}),r.dirty()):n.kind==="base64url"?dt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64url",code:d.invalid_string,message:n.message}),r.dirty()):_.assertNever(n);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:d.invalid_string,...l.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...l.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...l.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...l.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}R.create=s=>new R({checks:[],typeName:p.ZodString,coerce:s?.coerce??!1,...g(s)});function pt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class V extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.number,received:n.parsedType}),m}let r;const a=new b;for(const n of this._def.checks)n.kind==="int"?_.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?pt(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):_.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,a){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(a)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}V.create=s=>new V({checks:[],typeName:p.ZodNumber,coerce:s?.coerce||!1,...g(s)});class U extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const a=new b;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):_.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,a){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(a)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}U.create=s=>new U({checks:[],typeName:p.ZodBigInt,coerce:s?.coerce??!1,...g(s)});class de extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return w(e.data)}}de.create=s=>new de({typeName:p.ZodBoolean,coerce:s?.coerce||!1,...g(s)});class W extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new b;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):_.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}W.create=s=>new W({checks:[],coerce:s?.coerce||!1,typeName:p.ZodDate,...g(s)});class ce extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return w(e.data)}}ce.create=s=>new ce({typeName:p.ZodSymbol,...g(s)});class ue extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return w(e.data)}}ue.create=s=>new ue({typeName:p.ZodUndefined,...g(s)});class le extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return w(e.data)}}le.create=s=>new le({typeName:p.ZodNull,...g(s)});class fe extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}fe.create=s=>new fe({typeName:p.ZodAny,...g(s)});class he extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}he.create=s=>new he({typeName:p.ZodUnknown,...g(s)});class A extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}A.create=s=>new A({typeName:p.ZodNever,...g(s)});class me extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return w(e.data)}}me.create=s=>new me({typeName:p.ZodVoid,...g(s)});class C extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(i||o)&&(c(t,{code:i?d.too_big:d.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(c(t,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new N(t,i,t.path,o)))).then(i=>b.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new N(t,i,t.path,o)));return b.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new C({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new C({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new C({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}C.create=(s,e)=>new C({type:s,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...g(e)});function E(s){if(s instanceof x){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=O.create(E(r))}return new x({...s._def,shape:()=>e})}else return s instanceof C?new C({...s._def,type:E(s.element)}):s instanceof O?O.create(E(s.unwrap())):s instanceof L?L.create(E(s.unwrap())):s instanceof I?I.create(s.items.map(e=>E(e))):s}class x extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const h=this._getOrReturnCtx(e);return c(h,{code:d.invalid_type,expected:u.object,received:h.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof A&&this._def.unknownKeys==="strip"))for(const h in a.data)i.includes(h)||o.push(h);const f=[];for(const h of i){const v=n[h],M=a.data[h];f.push({key:{status:"valid",value:h},value:v._parse(new N(a,M,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof A){const h=this._def.unknownKeys;if(h==="passthrough")for(const v of o)f.push({key:{status:"valid",value:v},value:{status:"valid",value:a.data[v]}});else if(h==="strict")o.length>0&&(c(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const v of o){const M=a.data[v];f.push({key:{status:"valid",value:v},value:h._parse(new N(a,M,a.path,v)),alwaysSet:v in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const v of f){const M=await v.key,Oe=await v.value;h.push({key:M,value:Oe,alwaysSet:v.alwaysSet})}return h}).then(h=>b.mergeObjectSync(r,h)):b.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{const a=this._def.errorMap?.(t,r).message??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};for(const r of _.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}omit(e){const t={};for(const r of _.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}deepPartial(){return E(this)}partial(e){const t={};for(const r of _.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new x({...this._def,shape:()=>t})}required(e){const t={};for(const r of _.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof O;)n=n._def.innerType;t[r]=n}return new x({...this._def,shape:()=>t})}keyof(){return Te(_.objectKeys(this.shape))}}x.create=(s,e)=>new x({shape:()=>s,unknownKeys:"strip",catchall:A.create(),typeName:p.ZodObject,...g(e)});x.strictCreate=(s,e)=>new x({shape:()=>s,unknownKeys:"strict",catchall:A.create(),typeName:p.ZodObject,...g(e)});x.lazycreate=(s,e)=>new x({shape:s,unknownKeys:"strip",catchall:A.create(),typeName:p.ZodObject,...g(e)});class q extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new T(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const h={...t,common:{...t.common,issues:[]},parent:null},v=f._parseSync({data:t.data,path:t.path,parent:h});if(v.status==="valid")return v;v.status==="dirty"&&!n&&(n={result:v,ctx:h}),h.common.issues.length&&i.push(h.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(f=>new T(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}q.create=(s,e)=>new q({options:s,typeName:p.ZodUnion,...g(e)});function G(s,e){const t=S(s),r=S(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const a=_.objectKeys(e),n=_.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=G(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<s.length;n++){const i=s[n],o=e[n],f=G(i,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===u.date&&r===u.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class J extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(n,i)=>{if(ne(n)||ne(i))return m;const o=G(n.value,i.value);return o.valid?((ie(n)||ie(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}J.create=(s,e,t)=>new J({left:s,right:e,typeName:p.ZodIntersection,...g(t)});class I extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.length<this._def.items.length)return c(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&r.data.length>this._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new N(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>b.mergeArray(t,i)):b.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:s,typeName:p.ZodTuple,rest:null,...g(e)})};class pe extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],h)=>({key:a._parse(new N(r,o,r.path,[h,"key"])),value:n._parse(new N(r,f,r.path,[h,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const h=await f.key,v=await f.value;if(h.status==="aborted"||v.status==="aborted")return m;(h.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(h.value,v.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const h=f.key,v=f.value;if(h.status==="aborted"||v.status==="aborted")return m;(h.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(h.value,v.value)}return{status:t.value,value:o}}}}pe.create=(s,e,t)=>new pe({valueType:e,keyType:s,typeName:p.ZodMap,...g(t)});class F extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(c(r,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const h=new Set;for(const v of f){if(v.status==="aborted")return m;v.status==="dirty"&&t.dirty(),h.add(v.value)}return{status:t.value,value:h}}const o=[...r.data.values()].map((f,h)=>n._parse(new N(r,f,r.path,h)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new F({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new F({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}F.create=(s,e)=>new F({valueType:s,minSize:null,maxSize:null,typeName:p.ZodSet,...g(e)});class ge extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ge.create=(s,e)=>new ge({getter:s,typeName:p.ZodLazy,...g(e)});class ye extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}ye.create=(s,e)=>new ye({value:s,typeName:p.ZodLiteral,...g(e)});function Te(s,e){return new P({values:s,typeName:p.ZodEnum,...g(e)})}class P extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:_.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return w(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return P.create(e,{...this._def,...t})}exclude(e,t=this._def){return P.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}P.create=Te;class _e extends y{_parse(e){const t=_.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const a=_.objectValues(t);return c(r,{expected:_.joinValues(a),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=_.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return w(e.data)}get enum(){return this._def.values}}_e.create=(s,e)=>new _e({values:s,typeName:p.ZodNativeEnum,...g(e)});class H extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return w(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}H.create=(s,e)=>new H({type:s,typeName:p.ZodPromise,...g(e)});class D extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?z(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?z(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$(i))return m;const o=a.transform(i.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>$(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);_.assertNever(a)}}D.create=(s,e,t)=>new D({schema:s,typeName:p.ZodEffects,effect:e,...g(t)});D.createWithPreprocess=(s,e,t)=>new D({schema:e,effect:{type:"preprocess",transform:s},typeName:p.ZodEffects,...g(t)});class O extends y{_parse(e){return this._getType(e)===u.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(s,e)=>new O({innerType:s,typeName:p.ZodOptional,...g(e)});class L extends y{_parse(e){return this._getType(e)===u.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:p.ZodNullable,...g(e)});class K extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}K.create=(s,e)=>new K({innerType:s,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return B(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ee.create=(s,e)=>new ee({innerType:s,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class ve extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}ve.create=s=>new ve({typeName:p.ZodNaN,...g(s)});class gt extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class se extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),z(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new se({in:e,out:t,typeName:p.ZodPipeline})}}class te extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>($(a)&&(a.value=Object.freeze(a.value)),a);return B(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}te.create=(s,e)=>new te({innerType:s,typeName:p.ZodReadonly,...g(e)});var p;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(p||(p={}));const Z=V.create;A.create;const yt=C.create,Se=x.create;q.create;J.create;I.create;P.create;H.create;O.create;L.create;const _t=s=>Se({pages:Z(),nextPage:Z().optional(),totalElements:Z(),currentPage:Z(),pageSize:Z(),elements:yt(s)}),vt=Se({page:Z(),pageSize:Z()});exports.Fail=Ze;exports.Failure=Re;exports.Guid=j;exports.Ok=Ae;exports.PageQuery=vt;exports.createPageSchema=_t;exports.formatDate=xe;exports.formatDateTime=Ve;exports.formatTime=ke;exports.isFailure=Ee;exports.mock=Ne;exports.notFailure=Ie;exports.parseConfig=je;exports.sleep=$e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=(e={})=>e,Le=e=>[e,void 0],Ge=e=>[void 0,e];class Ke{name;constructor(){this.name=this.constructor.name}}const Ye=e=>n=>!(n instanceof e),qe=e=>n=>n instanceof e,Be=(e,n=process.env)=>{const t=e.safeParse(n);if(!t.success)throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);return t.data};function Xe(e){return new Promise(n=>setTimeout(n,e))}function ye(e,n){return new Date(e).toLocaleDateString(n,{year:"numeric",month:"2-digit",day:"2-digit"})}function ke(e,n){return new Date(e).toLocaleTimeString(n,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Je(e,n){return`${ye(e,n)} ${ke(e,n)}`}const Qe="00000000-0000-0000-0000-000000000000",We=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function $e(e){return typeof e=="string"&&We.test(e)}function He(e){if(!$e(e))throw TypeError("Invalid UUID");let n;return Uint8Array.of((n=parseInt(e.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(e.slice(9,13),16))>>>8,n&255,(n=parseInt(e.slice(14,18),16))>>>8,n&255,(n=parseInt(e.slice(19,23),16))>>>8,n&255,(n=parseInt(e.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}const b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function en(e,n=0){return(b[e[n+0]]+b[e[n+1]]+b[e[n+2]]+b[e[n+3]]+"-"+b[e[n+4]]+b[e[n+5]]+"-"+b[e[n+6]]+b[e[n+7]]+"-"+b[e[n+8]]+b[e[n+9]]+"-"+b[e[n+10]]+b[e[n+11]]+b[e[n+12]]+b[e[n+13]]+b[e[n+14]]+b[e[n+15]]).toLowerCase()}let L;const nn=new Uint8Array(16);function tn(){if(!L){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");L=crypto.getRandomValues.bind(crypto)}return L(nn)}const rn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:rn};function on(e,n,t){if(re.randomUUID&&!e)return re.randomUUID();e=e||{};const r=e.random??e.rng?.()??tn();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,en(r)}class N{uuid;constructor(n){He(n),this.uuid=n}toString(){return this.uuid}equals(n){return this.uuid===n.toString()}static new(){return new N(on())}static empty(){return new N(Qe)}static isValid(n){return!!(n&&$e(n))}static parse(n){return n&&N.isValid(n)?new N(n):void 0}}function c(e,n,t){function r(s,l){var f;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(f=s._zod).traits??(f.traits=new Set),s._zod.traits.add(e),n(s,l);for(const y in i.prototype)y in s||Object.defineProperty(s,y,{value:i.prototype[y].bind(s)});s._zod.constr=i,s._zod.def=l}const o=t?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function i(s){var l;const f=t?.Parent?new u:this;r(f,s),(l=f._zod).deferred??(l.deferred=[]);for(const y of f._zod.deferred)y();return f}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class S extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Ze={};function P(e){return Ze}function un(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>n.indexOf(+r)===-1).map(([r,o])=>o)}function sn(e,n){return typeof n=="bigint"?n.toString():n}function Ee(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function J(e){return e==null}function Q(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}function cn(e,n){const t=(e.toString().split(".")[1]||"").length,r=(n.toString().split(".")[1]||"").length,o=t>r?t:r,u=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(n.toFixed(o).replace(".",""));return u%i/10**o}function h(e,n,t){Object.defineProperty(e,n,{get(){{const r=t();return e[n]=r,r}},set(r){Object.defineProperty(e,n,{value:r})},configurable:!0})}function W(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function x(e){return JSON.stringify(e)}const Pe=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const an=Ee(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function q(e){if(Y(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(Y(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}const ln=new Set(["string","number","symbol"]);function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e,n,t){const r=new e._zod.constr(n??e._zod.def);return(!n||t?.parent)&&(r._zod.parent=e),r}function g(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function pn(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const hn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dn(e,n){const t={},r=e._zod.def;for(const o in n){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(t[o]=r.shape[o])}return I(e,{...e._zod.def,shape:t,checks:[]})}function mn(e,n){const t={...e._zod.def.shape},r=e._zod.def;for(const o in n){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);n[o]&&delete t[o]}return I(e,{...e._zod.def,shape:t,checks:[]})}function _n(e,n){if(!q(n))throw new Error("Invalid input to extend: expected a plain object");const t={...e._zod.def,get shape(){const r={...e._zod.def.shape,...n};return W(this,"shape",r),r},checks:[]};return I(e,t)}function vn(e,n){return I(e,{...e._zod.def,get shape(){const t={...e._zod.def.shape,...n._zod.def.shape};return W(this,"shape",t),t},catchall:n._zod.def.catchall,checks:[]})}function gn(e,n,t){const r=n._zod.def.shape,o={...r};if(t)for(const u in t){if(!(u in r))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=e?new e({type:"optional",innerType:r[u]}):r[u])}else for(const u in r)o[u]=e?new e({type:"optional",innerType:r[u]}):r[u];return I(n,{...n._zod.def,shape:o,checks:[]})}function zn(e,n,t){const r=n._zod.def.shape,o={...r};if(t)for(const u in t){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(const u in r)o[u]=new e({type:"nonoptional",innerType:r[u]});return I(n,{...n._zod.def,shape:o,checks:[]})}function j(e,n=0){for(let t=n;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function H(e,n){return n.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function F(e){return typeof e=="string"?e:e?.message}function T(e,n,t){const r={...e,path:e.path??[]};if(!e.message){const o=F(e.inst?._zod.def?.error?.(e))??F(n?.error?.(e))??F(t.customError?.(e))??F(t.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function ee(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function A(...e){const[n,t,r]=e;return typeof n=="string"?{message:n,code:"custom",input:t,inst:r}:{...n}}const Te=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(n,sn,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ie=c("$ZodError",Te),Ne=c("$ZodError",Te,{Parent:Error});function wn(e,n=t=>t.message){const t={},r=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(n(o))):r.push(n(o));return{formErrors:r,fieldErrors:t}}function bn(e,n){const t=n||function(u){return u.message},r={_errors:[]},o=u=>{for(const i of u.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let s=r,l=0;for(;l<i.path.length;){const f=i.path[l];l===i.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(t(i))):s[f]=s[f]||{_errors:[]},s=s[f],l++}}};return o(e),r}const yn=e=>(n,t,r,o)=>{const u=r?Object.assign(r,{async:!1}):{async:!1},i=n._zod.run({value:t,issues:[]},u);if(i instanceof Promise)throw new S;if(i.issues.length){const s=new(o?.Err??e)(i.issues.map(l=>T(l,u,P())));throw Pe(s,o?.callee),s}return i.value},kn=e=>async(n,t,r,o)=>{const u=r?Object.assign(r,{async:!0}):{async:!0};let i=n._zod.run({value:t,issues:[]},u);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new(o?.Err??e)(i.issues.map(l=>T(l,u,P())));throw Pe(s,o?.callee),s}return i.value},Oe=e=>(n,t,r)=>{const o=r?{...r,async:!1}:{async:!1},u=n._zod.run({value:t,issues:[]},o);if(u instanceof Promise)throw new S;return u.issues.length?{success:!1,error:new(e??Ie)(u.issues.map(i=>T(i,o,P())))}:{success:!0,data:u.value}},$n=Oe(Ne),xe=e=>async(n,t,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let u=n._zod.run({value:t,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(i=>T(i,o,P())))}:{success:!0,data:u.value}},Zn=xe(Ne),En=/^\d+$/,Pn=/^-?\d+(?:\.\d+)?/i,$=c("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),je={number:"number",bigint:"bigint",object:"date"},Se=c("$ZodCheckLessThan",(e,n)=>{$.init(e,n);const t=je[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,u=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<u&&(n.inclusive?o.maximum=n.value:o.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:t,code:"too_big",maximum:n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Ae=c("$ZodCheckGreaterThan",(e,n)=>{$.init(e,n);const t=je[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,u=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>u&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:t,code:"too_small",minimum:n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Tn=c("$ZodCheckMultipleOf",(e,n)=>{$.init(e,n),e._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=t=>{if(typeof t.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%n.value===BigInt(0):cn(t.value,n.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:n.value,input:t.value,inst:e,continue:!n.abort})}}),In=c("$ZodCheckNumberFormat",(e,n)=>{$.init(e,n),n.format=n.format||"float64";const t=n.format?.includes("int"),r=t?"int":"number",[o,u]=hn[n.format];e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=n.format,s.minimum=o,s.maximum=u,t&&(s.pattern=En)}),e._zod.check=i=>{const s=i.value;if(t){if(!Number.isInteger(s)){i.issues.push({expected:r,format:n.format,code:"invalid_type",input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort});return}}s<o&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),s>u&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:u,inst:e})}}),Nn=c("$ZodCheckMaxLength",(e,n)=>{var t;$.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!J(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<o&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=n.maximum)return;const i=ee(o);r.issues.push({origin:i,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),On=c("$ZodCheckMinLength",(e,n)=>{var t;$.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!J(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=n.minimum)return;const i=ee(o);r.issues.push({origin:i,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),xn=c("$ZodCheckLengthEquals",(e,n)=>{var t;$.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!J(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=r=>{const o=r.value,u=o.length;if(u===n.length)return;const i=ee(o),s=u>n.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),jn=c("$ZodCheckOverwrite",(e,n)=>{$.init(e,n),e._zod.check=t=>{t.value=n.tx(t.value)}});class Sn{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
|
|
2
|
+
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),u=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of u)this.content.push(i)}compile(){const n=Function,t=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new n(...t,o.join(`
|
|
3
|
+
`))}}const An={major:4,minor:0,patch:5},_=c("$ZodType",(e,n)=>{var t;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=An;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const u of o._zod.onattach)u(e);if(r.length===0)(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,i,s)=>{let l=j(u),f;for(const y of i){if(y._zod.def.when){if(!y._zod.def.when(u))continue}else if(l)continue;const a=u.issues.length,p=y._zod.check(u);if(p instanceof Promise&&s?.async===!1)throw new S;if(f||p instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await p,u.issues.length!==a&&(l||(l=j(u,a)))});else{if(u.issues.length===a)continue;l||(l=j(u,a))}}return f?f.then(()=>u):u};e._zod.run=(u,i)=>{const s=e._zod.parse(u,i);if(s instanceof Promise){if(i.async===!1)throw new S;return s.then(l=>o(l,r,i))}return o(s,r,i)}}e["~standard"]={validate:o=>{try{const u=$n(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Zn(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Re=c("$ZodNumber",(e,n)=>{_.init(e,n),e._zod.pattern=e._zod.bag.pattern??Pn,e._zod.parse=(t,r)=>{if(n.coerce)try{t.value=Number(t.value)}catch{}const o=t.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return t;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),t}}),Rn=c("$ZodNumber",(e,n)=>{In.init(e,n),Re.init(e,n)}),Cn=c("$ZodUnknown",(e,n)=>{_.init(e,n),e._zod.parse=t=>t}),Fn=c("$ZodNever",(e,n)=>{_.init(e,n),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function oe(e,n,t){e.issues.length&&n.issues.push(...H(t,e.issues)),n.value[t]=e.value}const Mn=c("$ZodArray",(e,n)=>{_.init(e,n),e._zod.parse=(t,r)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),t;t.value=Array(o.length);const u=[];for(let i=0;i<o.length;i++){const s=o[i],l=n.element._zod.run({value:s,issues:[]},r);l instanceof Promise?u.push(l.then(f=>oe(f,t,i))):oe(l,t,i)}return u.length?Promise.all(u).then(()=>t):t}});function M(e,n,t){e.issues.length&&n.issues.push(...H(t,e.issues)),n.value[t]=e.value}function ue(e,n,t,r){e.issues.length?r[t]===void 0?t in r?n.value[t]=void 0:n.value[t]=e.value:n.issues.push(...H(t,e.issues)):e.value===void 0?t in r&&(n.value[t]=void 0):n.value[t]=e.value}const Un=c("$ZodObject",(e,n)=>{_.init(e,n);const t=Ee(()=>{const a=Object.keys(n.shape);for(const d of a)if(!(n.shape[d]instanceof _))throw new Error(`Invalid element at key "${d}": expected a Zod schema`);const p=pn(n.shape);return{shape:n.shape,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(p)}});h(e._zod,"propValues",()=>{const a=n.shape,p={};for(const d in a){const k=a[d]._zod;if(k.values){p[d]??(p[d]=new Set);for(const Z of k.values)p[d].add(Z)}}return p});const r=a=>{const p=new Sn(["shape","payload","ctx"]),d=t.value,k=w=>{const m=x(w);return`shape[${m}]._zod.run({ value: input[${m}], issues: [] }, ctx)`};p.write("const input = payload.value;");const Z=Object.create(null);let D=0;for(const w of d.keys)Z[w]=`key_${D++}`;p.write("const newResult = {}");for(const w of d.keys)if(d.optionalKeys.has(w)){const m=Z[w];p.write(`const ${m} = ${k(w)};`);const v=x(w);p.write(`
|
|
4
|
+
if (${m}.issues.length) {
|
|
5
|
+
if (input[${v}] === undefined) {
|
|
6
|
+
if (${v} in input) {
|
|
7
|
+
newResult[${v}] = undefined;
|
|
8
|
+
}
|
|
9
|
+
} else {
|
|
10
|
+
payload.issues = payload.issues.concat(
|
|
11
|
+
${m}.issues.map((iss) => ({
|
|
12
|
+
...iss,
|
|
13
|
+
path: iss.path ? [${v}, ...iss.path] : [${v}],
|
|
14
|
+
}))
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
} else if (${m}.value === undefined) {
|
|
18
|
+
if (${v} in input) newResult[${v}] = undefined;
|
|
19
|
+
} else {
|
|
20
|
+
newResult[${v}] = ${m}.value;
|
|
21
|
+
}
|
|
22
|
+
`)}else{const m=Z[w];p.write(`const ${m} = ${k(w)};`),p.write(`
|
|
23
|
+
if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${x(w)}, ...iss.path] : [${x(w)}]
|
|
26
|
+
})));`),p.write(`newResult[${x(w)}] = ${m}.value`)}p.write("payload.value = newResult;"),p.write("return payload;");const R=p.compile();return(w,m)=>R(a,w,m)};let o;const u=Y,i=!Ze.jitless,l=i&&an.value,f=n.catchall;let y;e._zod.parse=(a,p)=>{y??(y=t.value);const d=a.value;if(!u(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;const k=[];if(i&&l&&p?.async===!1&&p.jitless!==!0)o||(o=r(n.shape)),a=o(a,p);else{a.value={};const m=y.shape;for(const v of y.keys){const O=m[v],C=O._zod.run({value:d[v],issues:[]},p),ne=O._zod.optin==="optional"&&O._zod.optout==="optional";C instanceof Promise?k.push(C.then(te=>ne?ue(te,a,v,d):M(te,a,v))):ne?ue(C,a,v,d):M(C,a,v)}}if(!f)return k.length?Promise.all(k).then(()=>a):a;const Z=[],D=y.keySet,R=f._zod,w=R.def.type;for(const m of Object.keys(d)){if(D.has(m))continue;if(w==="never"){Z.push(m);continue}const v=R.run({value:d[m],issues:[]},p);v instanceof Promise?k.push(v.then(O=>M(O,a,m))):M(v,a,m)}return Z.length&&a.issues.push({code:"unrecognized_keys",keys:Z,input:d,inst:e}),k.length?Promise.all(k).then(()=>a):a}});function ie(e,n,t,r){for(const o of e)if(o.issues.length===0)return n.value=o.value,n;return n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(o=>o.issues.map(u=>T(u,r,P())))}),n}const Vn=c("$ZodUnion",(e,n)=>{_.init(e,n),h(e._zod,"optin",()=>n.options.some(t=>t._zod.optin==="optional")?"optional":void 0),h(e._zod,"optout",()=>n.options.some(t=>t._zod.optout==="optional")?"optional":void 0),h(e._zod,"values",()=>{if(n.options.every(t=>t._zod.values))return new Set(n.options.flatMap(t=>Array.from(t._zod.values)))}),h(e._zod,"pattern",()=>{if(n.options.every(t=>t._zod.pattern)){const t=n.options.map(r=>r._zod.pattern);return new RegExp(`^(${t.map(r=>Q(r.source)).join("|")})$`)}}),e._zod.parse=(t,r)=>{let o=!1;const u=[];for(const i of n.options){const s=i._zod.run({value:t.value,issues:[]},r);if(s instanceof Promise)u.push(s),o=!0;else{if(s.issues.length===0)return s;u.push(s)}}return o?Promise.all(u).then(i=>ie(i,t,e,r)):ie(u,t,e,r)}}),Dn=c("$ZodIntersection",(e,n)=>{_.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,u=n.left._zod.run({value:o,issues:[]},r),i=n.right._zod.run({value:o,issues:[]},r);return u instanceof Promise||i instanceof Promise?Promise.all([u,i]).then(([l,f])=>se(t,l,f)):se(t,u,i)}});function B(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(q(e)&&q(n)){const t=Object.keys(n),r=Object.keys(e).filter(u=>t.indexOf(u)!==-1),o={...e,...n};for(const u of r){const i=B(e[u],n[u]);if(!i.valid)return{valid:!1,mergeErrorPath:[u,...i.mergeErrorPath]};o[u]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<e.length;r++){const o=e[r],u=n[r],i=B(o,u);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};t.push(i.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function se(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),j(e))return e;const r=B(n.value,t.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Ln=c("$ZodEnum",(e,n)=>{_.init(e,n);const t=un(n.entries);e._zod.values=new Set(t),e._zod.pattern=new RegExp(`^(${t.filter(r=>ln.has(typeof r)).map(r=>typeof r=="string"?fn(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const u=r.value;return e._zod.values.has(u)||r.issues.push({code:"invalid_value",values:t,input:u,inst:e}),r}}),Gn=c("$ZodTransform",(e,n)=>{_.init(e,n),e._zod.parse=(t,r)=>{const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(t.value=i,t));if(o instanceof Promise)throw new S;return t.value=o,t}}),Kn=c("$ZodOptional",(e,n)=>{_.init(e,n),e._zod.optin="optional",e._zod.optout="optional",h(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),h(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Q(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>n.innerType._zod.optin==="optional"?n.innerType._zod.run(t,r):t.value===void 0?t:n.innerType._zod.run(t,r)}),Yn=c("$ZodNullable",(e,n)=>{_.init(e,n),h(e._zod,"optin",()=>n.innerType._zod.optin),h(e._zod,"optout",()=>n.innerType._zod.optout),h(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Q(t.source)}|null)$`):void 0}),h(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(t,r)=>t.value===null?t:n.innerType._zod.run(t,r)}),qn=c("$ZodDefault",(e,n)=>{_.init(e,n),e._zod.optin="optional",h(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(t.value===void 0)return t.value=n.defaultValue,t;const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(u=>ce(u,n)):ce(o,n)}});function ce(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const Bn=c("$ZodPrefault",(e,n)=>{_.init(e,n),e._zod.optin="optional",h(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),Xn=c("$ZodNonOptional",(e,n)=>{_.init(e,n),h(e._zod,"values",()=>{const t=n.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(u=>ae(u,e)):ae(o,e)}});function ae(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const Jn=c("$ZodCatch",(e,n)=>{_.init(e,n),e._zod.optin="optional",h(e._zod,"optout",()=>n.innerType._zod.optout),h(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(u=>(t.value=u.value,u.issues.length&&(t.value=n.catchValue({...t,error:{issues:u.issues.map(i=>T(i,r,P()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=n.catchValue({...t,error:{issues:o.issues.map(u=>T(u,r,P()))},input:t.value}),t.issues=[]),t)}}),Qn=c("$ZodPipe",(e,n)=>{_.init(e,n),h(e._zod,"values",()=>n.in._zod.values),h(e._zod,"optin",()=>n.in._zod.optin),h(e._zod,"optout",()=>n.out._zod.optout),h(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(u=>le(u,n,r)):le(o,n,r)}});function le(e,n,t){return j(e)?e:n.out._zod.run({value:e.value,issues:e.issues},t)}const Wn=c("$ZodReadonly",(e,n)=>{_.init(e,n),h(e._zod,"propValues",()=>n.innerType._zod.propValues),h(e._zod,"values",()=>n.innerType._zod.values),h(e._zod,"optin",()=>n.innerType._zod.optin),h(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(fe):fe(o)}});function fe(e){return e.value=Object.freeze(e.value),e}const Hn=c("$ZodCustom",(e,n)=>{$.init(e,n),_.init(e,n),e._zod.parse=(t,r)=>t,e._zod.check=t=>{const r=t.value,o=n.fn(r);if(o instanceof Promise)return o.then(u=>pe(u,t,r,e));pe(o,t,r,e)}});function pe(e,n,t,r){if(!e){const o={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),n.issues.push(A(o))}}class et{constructor(){this._map=new Map,this._idmap=new Map}add(n,...t){const r=t[0];if(this._map.set(n,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,n)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(n){const t=this._map.get(n);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(n),this}get(n){const t=n._zod.parent;if(t){const r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(n)}}return this._map.get(n)}has(n){return this._map.has(n)}}function nt(){return new et}const U=nt();function tt(e,n){return new e({type:"number",checks:[],...g(n)})}function rt(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(n)})}function ot(e){return new e({type:"unknown"})}function ut(e,n){return new e({type:"never",...g(n)})}function he(e,n){return new Se({check:"less_than",...g(n),value:e,inclusive:!1})}function G(e,n){return new Se({check:"less_than",...g(n),value:e,inclusive:!0})}function de(e,n){return new Ae({check:"greater_than",...g(n),value:e,inclusive:!1})}function K(e,n){return new Ae({check:"greater_than",...g(n),value:e,inclusive:!0})}function me(e,n){return new Tn({check:"multiple_of",...g(n),value:e})}function it(e,n){return new Nn({check:"max_length",...g(n),maximum:e})}function _e(e,n){return new On({check:"min_length",...g(n),minimum:e})}function st(e,n){return new xn({check:"length_equals",...g(n),length:e})}function ct(e){return new jn({check:"overwrite",tx:e})}function at(e,n,t){return new e({type:"array",element:n,...g(t)})}function lt(e,n,t){return new e({type:"custom",check:"custom",fn:n,...g(t)})}const ft=(e,n)=>{Ie.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>bn(e,t)},flatten:{value:t=>wn(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},V=c("ZodError",ft,{Parent:Error}),pt=yn(V),ht=kn(V),dt=Oe(V),mt=xe(V),z=c("ZodType",(e,n)=>(_.init(e,n),e.def=n,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone({...n,checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(t,r)=>I(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>pt(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>dt(e,t,r),e.parseAsync=async(t,r)=>ht(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>mt(e,t,r),e.spa=e.safeParseAsync,e.refine=(t,r)=>e.check(Dt(t,r)),e.superRefine=t=>e.check(Lt(t)),e.overwrite=t=>e.check(ct(t)),e.optional=()=>ze(e),e.nullable=()=>we(e),e.nullish=()=>ze(we(e)),e.nonoptional=t=>St(e,t),e.array=()=>Fe(e),e.or=t=>kt([e,t]),e.and=t=>Zt(e,t),e.transform=t=>be(e,Tt(t)),e.default=t=>Ot(e,t),e.prefault=t=>jt(e,t),e.catch=t=>Rt(e,t),e.pipe=t=>be(e,t),e.readonly=()=>Mt(e),e.describe=t=>{const r=e.clone();return U.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return U.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return U.get(e);const r=e.clone();return U.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ce=c("ZodNumber",(e,n)=>{Re.init(e,n),z.init(e,n),e.gt=(r,o)=>e.check(de(r,o)),e.gte=(r,o)=>e.check(K(r,o)),e.min=(r,o)=>e.check(K(r,o)),e.lt=(r,o)=>e.check(he(r,o)),e.lte=(r,o)=>e.check(G(r,o)),e.max=(r,o)=>e.check(G(r,o)),e.int=r=>e.check(ve(r)),e.safe=r=>e.check(ve(r)),e.positive=r=>e.check(de(0,r)),e.nonnegative=r=>e.check(K(0,r)),e.negative=r=>e.check(he(0,r)),e.nonpositive=r=>e.check(G(0,r)),e.multipleOf=(r,o)=>e.check(me(r,o)),e.step=(r,o)=>e.check(me(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function E(e){return tt(Ce,e)}const _t=c("ZodNumberFormat",(e,n)=>{Rn.init(e,n),Ce.init(e,n)});function ve(e){return rt(_t,e)}const vt=c("ZodUnknown",(e,n)=>{Cn.init(e,n),z.init(e,n)});function ge(){return ot(vt)}const gt=c("ZodNever",(e,n)=>{Fn.init(e,n),z.init(e,n)});function zt(e){return ut(gt,e)}const wt=c("ZodArray",(e,n)=>{Mn.init(e,n),z.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(_e(t,r)),e.nonempty=t=>e.check(_e(1,t)),e.max=(t,r)=>e.check(it(t,r)),e.length=(t,r)=>e.check(st(t,r)),e.unwrap=()=>e.element});function Fe(e,n){return at(wt,e,n)}const bt=c("ZodObject",(e,n)=>{Un.init(e,n),z.init(e,n),h(e,"shape",()=>n.shape),e.keyof=()=>Et(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ge()}),e.loose=()=>e.clone({...e._zod.def,catchall:ge()}),e.strict=()=>e.clone({...e._zod.def,catchall:zt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>_n(e,t),e.merge=t=>vn(e,t),e.pick=t=>dn(e,t),e.omit=t=>mn(e,t),e.partial=(...t)=>gn(Ue,e,t[0]),e.required=(...t)=>zn(Ve,e,t[0])});function Me(e,n){const t={type:"object",get shape(){return W(this,"shape",{...e}),this.shape},...g(n)};return new bt(t)}const yt=c("ZodUnion",(e,n)=>{Vn.init(e,n),z.init(e,n),e.options=n.options});function kt(e,n){return new yt({type:"union",options:e,...g(n)})}const $t=c("ZodIntersection",(e,n)=>{Dn.init(e,n),z.init(e,n)});function Zt(e,n){return new $t({type:"intersection",left:e,right:n})}const X=c("ZodEnum",(e,n)=>{Ln.init(e,n),z.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const u={};for(const i of r)if(t.has(i))u[i]=n.entries[i];else throw new Error(`Key ${i} not found in enum`);return new X({...n,checks:[],...g(o),entries:u})},e.exclude=(r,o)=>{const u={...n.entries};for(const i of r)if(t.has(i))delete u[i];else throw new Error(`Key ${i} not found in enum`);return new X({...n,checks:[],...g(o),entries:u})}});function Et(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new X({type:"enum",entries:t,...g(n)})}const Pt=c("ZodTransform",(e,n)=>{Gn.init(e,n),z.init(e,n),e._zod.parse=(t,r)=>{t.addIssue=u=>{if(typeof u=="string")t.issues.push(A(u,t.value,n));else{const i=u;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),t.issues.push(A(i))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(u=>(t.value=u,t)):(t.value=o,t)}});function Tt(e){return new Pt({type:"transform",transform:e})}const Ue=c("ZodOptional",(e,n)=>{Kn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ze(e){return new Ue({type:"optional",innerType:e})}const It=c("ZodNullable",(e,n)=>{Yn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType});function we(e){return new It({type:"nullable",innerType:e})}const Nt=c("ZodDefault",(e,n)=>{qn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ot(e,n){return new Nt({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():n}})}const xt=c("ZodPrefault",(e,n)=>{Bn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType});function jt(e,n){return new xt({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():n}})}const Ve=c("ZodNonOptional",(e,n)=>{Xn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType});function St(e,n){return new Ve({type:"nonoptional",innerType:e,...g(n)})}const At=c("ZodCatch",(e,n)=>{Jn.init(e,n),z.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rt(e,n){return new At({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Ct=c("ZodPipe",(e,n)=>{Qn.init(e,n),z.init(e,n),e.in=n.in,e.out=n.out});function be(e,n){return new Ct({type:"pipe",in:e,out:n})}const Ft=c("ZodReadonly",(e,n)=>{Wn.init(e,n),z.init(e,n)});function Mt(e){return new Ft({type:"readonly",innerType:e})}const Ut=c("ZodCustom",(e,n)=>{Hn.init(e,n),z.init(e,n)});function Vt(e){const n=new $({check:"custom"});return n._zod.check=e,n}function Dt(e,n={}){return lt(Ut,e,n)}function Lt(e){const n=Vt(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(A(r,t.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),t.issues.push(A(o))}},e(t.value,t)));return n}const Gt=e=>Me({pages:E(),nextPage:E().optional(),totalElements:E(),currentPage:E(),pageSize:E(),elements:Fe(e)}),Kt=Me({page:E(),pageSize:E()});exports.Fail=Ge;exports.Failure=Ke;exports.Guid=N;exports.Ok=Le;exports.PageQuery=Kt;exports.createPageSchema=Gt;exports.formatDate=ye;exports.formatDateTime=Je;exports.formatTime=ke;exports.isFailure=qe;exports.mock=De;exports.notFailure=Ye;exports.parseConfig=Be;exports.sleep=Xe;
|