@jsfsi-core/ts-crossplatform 1.0.16 → 1.1.1
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 +3 -3
- package/dist/index.mjs +175 -176
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=(e={})=>e,Be=e=>[e,void 0],Xe=e=>[void 0,e];class We{name;constructor(){this.name=this.constructor.name}}const Qe=(e=>n=>!(n instanceof e)),He=(e=>n=>n instanceof e),en=(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 nn(e){return new Promise(n=>setTimeout(n,e))}function Ee(e,n){return new Date(e).toLocaleDateString(n,{year:"numeric",month:"2-digit",day:"2-digit"})}function $e(e,n){return new Date(e).toLocaleTimeString(n,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function tn(e,n){return`${Ee(e,n)} ${$e(e,n)}`}const rn="00000000-0000-0000-0000-000000000000",on=/^(?:[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 Ze(e){return typeof e=="string"&&on.test(e)}function un(e){if(!Ze(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 v=[];for(let e=0;e<256;++e)v.push((e+256).toString(16).slice(1));function sn(e,n=0){return(v[e[n+0]]+v[e[n+1]]+v[e[n+2]]+v[e[n+3]]+"-"+v[e[n+4]]+v[e[n+5]]+"-"+v[e[n+6]]+v[e[n+7]]+"-"+v[e[n+8]]+v[e[n+9]]+"-"+v[e[n+10]]+v[e[n+11]]+v[e[n+12]]+v[e[n+13]]+v[e[n+14]]+v[e[n+15]]).toLowerCase()}let J;const cn=new Uint8Array(16);function an(){if(!J){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(cn)}const ln=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oe={randomUUID:ln};function fn(e,n,t){e=e||{};const r=e.random??e.rng?.()??an();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,sn(r)}function dn(e,n,t){return oe.randomUUID&&!e?oe.randomUUID():fn(e)}class N{uuid;constructor(n){un(n),this.uuid=n}toString(){return this.uuid}equals(n){return this.uuid===n.toString()}static new(){return new N(dn())}static empty(){return new N(rn)}static isValid(n){return!!(n&&Ze(n))}static parse(n){return n&&N.isValid(n)?new N(n):void 0}}function a(e,n,t){function r(i,c){var l;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(l=i._zod).traits??(l.traits=new Set),i._zod.traits.add(e),n(i,c);for(const f in u.prototype)f in i||Object.defineProperty(i,f,{value:u.prototype[f].bind(i)});i._zod.constr=u,i._zod.def=c}const o=t?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function u(i){var c;const l=t?.Parent?new s:this;r(l,i),(c=l._zod).deferred??(c.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(u,"init",{value:r}),Object.defineProperty(u,Symbol.hasInstance,{value:i=>t?.Parent&&i instanceof t.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class A extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pe extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Oe={};function P(e){return Oe}function hn(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 q(e,n){return typeof n=="bigint"?n.toString():n}function W(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Q(e){return e==null}function H(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}function pn(e,n){const t=(e.toString().split(".")[1]||"").length,r=n.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=t>o?t:o,u=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(n.toFixed(s).replace(".",""));return u%i/10**s}const ue=Symbol("evaluating");function d(e,n,t){let r;Object.defineProperty(e,n,{get(){if(r!==ue)return r===void 0&&(r=ue,r=t()),r},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function T(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function I(...e){const n={};for(const t of e){const r=Object.getOwnPropertyDescriptors(t);Object.assign(n,r)}return Object.defineProperties({},n)}function se(e){return JSON.stringify(e)}const Te="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function U(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mn=W(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function x(e){if(U(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(U(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Ie(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e}const _n=new Set(["string","number","symbol"]);function gn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $(e,n,t){const r=new e._zod.constr(n??e._zod.def);return(!n||t?.parent)&&(r._zod.parent=e),r}function p(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 vn(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const zn={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 bn(e,n){const t=e._zod.def,r=I(e._zod.def,{get shape(){const o={};for(const s in n){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=t.shape[s])}return T(this,"shape",o),o},checks:[]});return $(e,r)}function wn(e,n){const t=e._zod.def,r=I(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in n){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);n[s]&&delete o[s]}return T(this,"shape",o),o},checks:[]});return $(e,r)}function yn(e,n){if(!x(n))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=I(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n};return T(this,"shape",s),s},checks:[]});return $(e,o)}function kn(e,n){if(!x(n))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const r={...e._zod.def.shape,...n};return T(this,"shape",r),r},checks:e._zod.def.checks};return $(e,t)}function En(e,n){const t=I(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return T(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return $(e,t)}function $n(e,n,t){const r=I(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(t)for(const u in t){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=e?new e({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)s[u]=e?new e({type:"optional",innerType:o[u]}):o[u];return T(this,"shape",s),s},checks:[]});return $(n,r)}function Zn(e,n,t){const r=I(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(t)for(const u in t){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)s[u]=new e({type:"nonoptional",innerType:o[u]});return T(this,"shape",s),s},checks:[]});return $(n,r)}function j(e,n=0){if(e.aborted===!0)return!0;for(let t=n;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function Ne(e,n){return n.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function C(e){return typeof e=="string"?e:e?.message}function O(e,n,t){const r={...e,path:e.path??[]};if(!e.message){const o=C(e.inst?._zod.def?.error?.(e))??C(n?.error?.(e))??C(t.customError?.(e))??C(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 R(...e){const[n,t,r]=e;return typeof n=="string"?{message:n,code:"custom",input:t,inst:r}:{...n}}const je=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,q,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ae=a("$ZodError",je),Se=a("$ZodError",je,{Parent:Error});function Pn(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 On(e,n=t=>t.message){const t={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>r({issues:u}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)t._errors.push(n(s));else{let u=t,i=0;for(;i<s.path.length;){const c=s.path[i];i===s.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(s))):u[c]=u[c]||{_errors:[]},u=u[c],i++}}};return r(e),t}const ne=e=>(n,t,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},u=n._zod.run({value:t,issues:[]},s);if(u instanceof Promise)throw new A;if(u.issues.length){const i=new(o?.Err??e)(u.issues.map(c=>O(c,s,P())));throw Te(i,o?.callee),i}return u.value},te=e=>async(n,t,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let u=n._zod.run({value:t,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){const i=new(o?.Err??e)(u.issues.map(c=>O(c,s,P())));throw Te(i,o?.callee),i}return u.value},V=e=>(n,t,r)=>{const o=r?{...r,async:!1}:{async:!1},s=n._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new A;return s.issues.length?{success:!1,error:new(e??Ae)(s.issues.map(u=>O(u,o,P())))}:{success:!0,data:s.value}},Tn=V(Se),L=e=>async(n,t,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=n._zod.run({value:t,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>O(u,o,P())))}:{success:!0,data:s.value}},In=L(Se),Nn=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ne(e)(n,t,o)},jn=e=>(n,t,r)=>ne(e)(n,t,r),An=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return te(e)(n,t,o)},Sn=e=>async(n,t,r)=>te(e)(n,t,r),xn=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return V(e)(n,t,o)},Rn=e=>(n,t,r)=>V(e)(n,t,r),Cn=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return L(e)(n,t,o)},Dn=e=>async(n,t,r)=>L(e)(n,t,r),Fn=/^-?\d+$/,Un=/^-?\d+(?:\.\d+)?/,k=a("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),xe={number:"number",bigint:"bigint",object:"date"},Re=a("$ZodCheckLessThan",(e,n)=>{k.init(e,n);const t=xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<s&&(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})}}),Ce=a("$ZodCheckGreaterThan",(e,n)=>{k.init(e,n);const t=xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>s&&(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})}}),Mn=a("$ZodCheckMultipleOf",(e,n)=>{k.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):pn(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})}}),Vn=a("$ZodCheckNumberFormat",(e,n)=>{k.init(e,n),n.format=n.format||"float64";const t=n.format?.includes("int"),r=t?"int":"number",[o,s]=zn[n.format];e._zod.onattach.push(u=>{const i=u._zod.bag;i.format=n.format,i.minimum=o,i.maximum=s,t&&(i.pattern=Fn)}),e._zod.check=u=>{const i=u.value;if(t){if(!Number.isInteger(i)){u.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:i,inst:e});return}if(!Number.isSafeInteger(i)){i>0?u.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort}):u.issues.push({input:i,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}}i<o&&u.issues.push({origin:"number",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),i>s&&u.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inst:e})}}),Ln=a("$ZodCheckMaxLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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 u=ee(o);r.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Gn=a("$ZodCheckMinLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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 u=ee(o);r.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Jn=a("$ZodCheckLengthEquals",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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,s=o.length;if(s===n.length)return;const u=ee(o),i=s>n.length;r.issues.push({origin:u,...i?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Kn=a("$ZodCheckOverwrite",(e,n)=>{k.init(e,n),e._zod.check=t=>{t.value=n.tx(t.value)}});class Yn{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(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=(e={})=>e,Be=e=>[e,void 0],Xe=e=>[void 0,e];class We{name;constructor(){this.name=this.constructor.name}}const Qe=(e=>n=>!(n instanceof e)),He=(e=>n=>n instanceof e),en=(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 nn(e){return new Promise(n=>setTimeout(n,e))}function Ee(e,n){return new Date(e).toLocaleDateString(n,{year:"numeric",month:"2-digit",day:"2-digit"})}function $e(e,n){return new Date(e).toLocaleTimeString(n,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function tn(e,n){return`${Ee(e,n)} ${$e(e,n)}`}const rn="00000000-0000-0000-0000-000000000000",on=/^(?:[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 Ze(e){return typeof e=="string"&&on.test(e)}function un(e){if(!Ze(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 v=[];for(let e=0;e<256;++e)v.push((e+256).toString(16).slice(1));function sn(e,n=0){return(v[e[n+0]]+v[e[n+1]]+v[e[n+2]]+v[e[n+3]]+"-"+v[e[n+4]]+v[e[n+5]]+"-"+v[e[n+6]]+v[e[n+7]]+"-"+v[e[n+8]]+v[e[n+9]]+"-"+v[e[n+10]]+v[e[n+11]]+v[e[n+12]]+v[e[n+13]]+v[e[n+14]]+v[e[n+15]]).toLowerCase()}let J;const cn=new Uint8Array(16);function an(){if(!J){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(cn)}const ln=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oe={randomUUID:ln};function fn(e,n,t){if(oe.randomUUID&&!e)return oe.randomUUID();e=e||{};const r=e.random??e.rng?.()??an();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,sn(r)}class N{uuid;constructor(n){un(n),this.uuid=n}toString(){return this.uuid}equals(n){return this.uuid===n.toString()}static new(){return new N(fn())}static empty(){return new N(rn)}static isValid(n){return!!(n&&Ze(n))}static parse(n){return n&&N.isValid(n)?new N(n):void 0}}function a(e,n,t){function r(i,c){var l;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(l=i._zod).traits??(l.traits=new Set),i._zod.traits.add(e),n(i,c);for(const f in u.prototype)f in i||Object.defineProperty(i,f,{value:u.prototype[f].bind(i)});i._zod.constr=u,i._zod.def=c}const o=t?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function u(i){var c;const l=t?.Parent?new s:this;r(l,i),(c=l._zod).deferred??(c.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(u,"init",{value:r}),Object.defineProperty(u,Symbol.hasInstance,{value:i=>t?.Parent&&i instanceof t.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class A extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pe extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Oe={};function P(e){return Oe}function dn(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 q(e,n){return typeof n=="bigint"?n.toString():n}function W(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Q(e){return e==null}function H(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}function hn(e,n){const t=(e.toString().split(".")[1]||"").length,r=n.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=t>o?t:o,u=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(n.toFixed(s).replace(".",""));return u%i/10**s}const ue=Symbol("evaluating");function d(e,n,t){let r;Object.defineProperty(e,n,{get(){if(r!==ue)return r===void 0&&(r=ue,r=t()),r},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function T(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function I(...e){const n={};for(const t of e){const r=Object.getOwnPropertyDescriptors(t);Object.assign(n,r)}return Object.defineProperties({},n)}function se(e){return JSON.stringify(e)}const Te="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function U(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const pn=W(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function x(e){if(U(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(U(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Ie(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e}const mn=new Set(["string","number","symbol"]);function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $(e,n,t){const r=new e._zod.constr(n??e._zod.def);return(!n||t?.parent)&&(r._zod.parent=e),r}function p(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 gn(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const vn={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 zn(e,n){const t=e._zod.def,r=I(e._zod.def,{get shape(){const o={};for(const s in n){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=t.shape[s])}return T(this,"shape",o),o},checks:[]});return $(e,r)}function bn(e,n){const t=e._zod.def,r=I(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in n){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);n[s]&&delete o[s]}return T(this,"shape",o),o},checks:[]});return $(e,r)}function wn(e,n){if(!x(n))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=I(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n};return T(this,"shape",s),s},checks:[]});return $(e,o)}function yn(e,n){if(!x(n))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const r={...e._zod.def.shape,...n};return T(this,"shape",r),r},checks:e._zod.def.checks};return $(e,t)}function kn(e,n){const t=I(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return T(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return $(e,t)}function En(e,n,t){const r=I(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(t)for(const u in t){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=e?new e({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)s[u]=e?new e({type:"optional",innerType:o[u]}):o[u];return T(this,"shape",s),s},checks:[]});return $(n,r)}function $n(e,n,t){const r=I(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(t)for(const u in t){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)s[u]=new e({type:"nonoptional",innerType:o[u]});return T(this,"shape",s),s},checks:[]});return $(n,r)}function j(e,n=0){if(e.aborted===!0)return!0;for(let t=n;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function Ne(e,n){return n.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function C(e){return typeof e=="string"?e:e?.message}function O(e,n,t){const r={...e,path:e.path??[]};if(!e.message){const o=C(e.inst?._zod.def?.error?.(e))??C(n?.error?.(e))??C(t.customError?.(e))??C(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 R(...e){const[n,t,r]=e;return typeof n=="string"?{message:n,code:"custom",input:t,inst:r}:{...n}}const je=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,q,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ae=a("$ZodError",je),Se=a("$ZodError",je,{Parent:Error});function Zn(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 Pn(e,n=t=>t.message){const t={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>r({issues:u}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)t._errors.push(n(s));else{let u=t,i=0;for(;i<s.path.length;){const c=s.path[i];i===s.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(s))):u[c]=u[c]||{_errors:[]},u=u[c],i++}}};return r(e),t}const ne=e=>(n,t,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},u=n._zod.run({value:t,issues:[]},s);if(u instanceof Promise)throw new A;if(u.issues.length){const i=new(o?.Err??e)(u.issues.map(c=>O(c,s,P())));throw Te(i,o?.callee),i}return u.value},te=e=>async(n,t,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let u=n._zod.run({value:t,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){const i=new(o?.Err??e)(u.issues.map(c=>O(c,s,P())));throw Te(i,o?.callee),i}return u.value},V=e=>(n,t,r)=>{const o=r?{...r,async:!1}:{async:!1},s=n._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new A;return s.issues.length?{success:!1,error:new(e??Ae)(s.issues.map(u=>O(u,o,P())))}:{success:!0,data:s.value}},On=V(Se),L=e=>async(n,t,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=n._zod.run({value:t,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>O(u,o,P())))}:{success:!0,data:s.value}},Tn=L(Se),In=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ne(e)(n,t,o)},Nn=e=>(n,t,r)=>ne(e)(n,t,r),jn=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return te(e)(n,t,o)},An=e=>async(n,t,r)=>te(e)(n,t,r),Sn=e=>(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return V(e)(n,t,o)},xn=e=>(n,t,r)=>V(e)(n,t,r),Rn=e=>async(n,t,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return L(e)(n,t,o)},Cn=e=>async(n,t,r)=>L(e)(n,t,r),Dn=/^-?\d+$/,Fn=/^-?\d+(?:\.\d+)?/,k=a("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),xe={number:"number",bigint:"bigint",object:"date"},Re=a("$ZodCheckLessThan",(e,n)=>{k.init(e,n);const t=xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<s&&(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})}}),Ce=a("$ZodCheckGreaterThan",(e,n)=>{k.init(e,n);const t=xe[typeof n.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>s&&(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})}}),Un=a("$ZodCheckMultipleOf",(e,n)=>{k.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):hn(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})}}),Mn=a("$ZodCheckNumberFormat",(e,n)=>{k.init(e,n),n.format=n.format||"float64";const t=n.format?.includes("int"),r=t?"int":"number",[o,s]=vn[n.format];e._zod.onattach.push(u=>{const i=u._zod.bag;i.format=n.format,i.minimum=o,i.maximum=s,t&&(i.pattern=Dn)}),e._zod.check=u=>{const i=u.value;if(t){if(!Number.isInteger(i)){u.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:i,inst:e});return}if(!Number.isSafeInteger(i)){i>0?u.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!n.abort}):u.issues.push({input:i,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}}i<o&&u.issues.push({origin:"number",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),i>s&&u.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inst:e})}}),Vn=a("$ZodCheckMaxLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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 u=ee(o);r.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Ln=a("$ZodCheckMinLength",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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 u=ee(o);r.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Gn=a("$ZodCheckLengthEquals",(e,n)=>{var t;k.init(e,n),(t=e._zod.def).when??(t.when=r=>{const o=r.value;return!Q(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,s=o.length;if(s===n.length)return;const u=ee(o),i=s>n.length;r.issues.push({origin:u,...i?{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=a("$ZodCheckOverwrite",(e,n)=>{k.init(e,n),e._zod.check=t=>{t.value=n.tx(t.value)}});class Kn{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
2
|
`).filter(u=>u),o=Math.min(...r.map(u=>u.length-u.trimStart().length)),s=r.map(u=>u.slice(o)).map(u=>" ".repeat(this.indent*2)+u);for(const u of s)this.content.push(u)}compile(){const n=Function,t=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new n(...t,o.join(`
|
|
3
|
-
`))}}const
|
|
3
|
+
`))}}const Yn={major:4,minor:1,patch:12},m=a("$ZodType",(e,n)=>{var t;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Yn;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(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,c)=>{let l=j(u),f;for(const z of i){if(z._zod.def.when){if(!z._zod.def.when(u))continue}else if(l)continue;const h=u.issues.length,_=z._zod.check(u);if(_ instanceof Promise&&c?.async===!1)throw new A;if(f||_ instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await _,u.issues.length!==h&&(l||(l=j(u,h)))});else{if(u.issues.length===h)continue;l||(l=j(u,h))}}return f?f.then(()=>u):u},s=(u,i,c)=>{if(j(u))return u.aborted=!0,u;const l=o(i,r,c);if(l instanceof Promise){if(c.async===!1)throw new A;return l.then(f=>e._zod.parse(f,c))}return e._zod.parse(l,c)};e._zod.run=(u,i)=>{if(i.skipChecks)return e._zod.parse(u,i);if(i.direction==="backward"){const l=e._zod.parse({value:u.value,issues:[]},{...i,skipChecks:!0});return l instanceof Promise?l.then(f=>s(f,u,i)):s(l,u,i)}const c=e._zod.parse(u,i);if(c instanceof Promise){if(i.async===!1)throw new A;return c.then(l=>o(l,r,i))}return o(c,r,i)}}e["~standard"]={validate:o=>{try{const s=On(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Tn(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}}),De=a("$ZodNumber",(e,n)=>{m.init(e,n),e._zod.pattern=e._zod.bag.pattern??Fn,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 s=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,...s?{received:s}:{}}),t}}),qn=a("$ZodNumber",(e,n)=>{Mn.init(e,n),De.init(e,n)}),Bn=a("$ZodUnknown",(e,n)=>{m.init(e,n),e._zod.parse=t=>t}),Xn=a("$ZodNever",(e,n)=>{m.init(e,n),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ie(e,n,t){e.issues.length&&n.issues.push(...Ne(t,e.issues)),n.value[t]=e.value}const Wn=a("$ZodArray",(e,n)=>{m.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 s=[];for(let u=0;u<o.length;u++){const i=o[u],c=n.element._zod.run({value:i,issues:[]},r);c instanceof Promise?s.push(c.then(l=>ie(l,t,u))):ie(c,t,u)}return s.length?Promise.all(s).then(()=>t):t}});function M(e,n,t,r){e.issues.length&&n.issues.push(...Ne(t,e.issues)),e.value===void 0?t in r&&(n.value[t]=void 0):n.value[t]=e.value}function Fe(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const t=gn(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(t)}}function Ue(e,n,t,r,o,s){const u=[],i=o.keySet,c=o.catchall._zod,l=c.def.type;for(const f of Object.keys(n)){if(i.has(f))continue;if(l==="never"){u.push(f);continue}const z=c.run({value:n[f],issues:[]},r);z instanceof Promise?e.push(z.then(h=>M(h,t,f,n))):M(z,t,f,n)}return u.length&&t.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:s}),e.length?Promise.all(e).then(()=>t):t}const Qn=a("$ZodObject",(e,n)=>{if(m.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const i=n.shape;Object.defineProperty(n,"shape",{get:()=>{const c={...i};return Object.defineProperty(n,"shape",{value:c}),c}})}const r=W(()=>Fe(n));d(e._zod,"propValues",()=>{const i=n.shape,c={};for(const l in i){const f=i[l]._zod;if(f.values){c[l]??(c[l]=new Set);for(const z of f.values)c[l].add(z)}}return c});const o=U,s=n.catchall;let u;e._zod.parse=(i,c)=>{u??(u=r.value);const l=i.value;if(!o(l))return i.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),i;i.value={};const f=[],z=u.shape;for(const h of u.keys){const b=z[h]._zod.run({value:l[h],issues:[]},c);b instanceof Promise?f.push(b.then(G=>M(G,i,h,l))):M(b,i,h,l)}return s?Ue(f,l,i,c,r.value,e):f.length?Promise.all(f).then(()=>i):i}}),Hn=a("$ZodObjectJIT",(e,n)=>{Qn.init(e,n);const t=e._zod.parse,r=W(()=>Fe(n)),o=h=>{const _=new Kn(["shape","payload","ctx"]),b=r.value,G=E=>{const y=se(E);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};_.write("const input = payload.value;");const re=Object.create(null);let Ke=0;for(const E of b.keys)re[E]=`key_${Ke++}`;_.write("const newResult = {};");for(const E of b.keys){const y=re[E],S=se(E);_.write(`const ${y} = ${G(E)};`),_.write(`
|
|
4
4
|
if (${y}.issues.length) {
|
|
5
5
|
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
6
6
|
...iss,
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
newResult[${S}] = ${y}.value;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
`)}_.write("payload.value = newResult;"),_.write("return payload;");const Ye=_.compile();return(E,y)=>Ye(h,E,y)};let s;const u=U,i=!Oe.jitless,l=i&&mn.value,f=n.catchall;let z;e._zod.parse=(h,_)=>{z??(z=r.value);const b=h.value;return u(b)?i&&l&&_?.async===!1&&_.jitless!==!0?(s||(s=o(n.shape)),h=s(h,_),f?Ue([],b,h,_,z,e):h):t(h,_):(h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h)}});function ce(e,n,t,r){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!j(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(s=>s.issues.map(u=>O(u,r,P())))}),n)}const nt=a("$ZodUnion",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),d(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),d(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),d(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>H(s.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return r(o,s);let u=!1;const i=[];for(const c of n.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)i.push(l),u=!0;else{if(l.issues.length===0)return l;i.push(l)}}return u?Promise.all(i).then(c=>ce(c,o,e,s)):ce(i,o,e,s)}}),tt=a("$ZodIntersection",(e,n)=>{m.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,s=n.left._zod.run({value:o,issues:[]},r),u=n.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||u instanceof Promise?Promise.all([s,u]).then(([c,l])=>ae(t,c,l)):ae(t,s,u)}});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(x(e)&&x(n)){const t=Object.keys(n),r=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...n};for(const s of r){const u=B(e[s],n[s]);if(!u.valid)return{valid:!1,mergeErrorPath:[s,...u.mergeErrorPath]};o[s]=u.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],s=n[r],u=B(o,s);if(!u.valid)return{valid:!1,mergeErrorPath:[r,...u.mergeErrorPath]};t.push(u.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function ae(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 rt=a("$ZodEnum",(e,n)=>{m.init(e,n);const t=hn(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>_n.has(typeof o)).map(o=>typeof o=="string"?gn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const u=o.value;return r.has(u)||o.issues.push({code:"invalid_value",values:t,input:u,inst:e}),o}}),ot=a("$ZodTransform",(e,n)=>{m.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Pe(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(t.value=u,t));if(o instanceof Promise)throw new A;return t.value=o,t}});function le(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const ut=a("$ZodOptional",(e,n)=>{m.init(e,n),e._zod.optin="optional",e._zod.optout="optional",d(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),d(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${H(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>le(s,t.value)):le(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),st=a("$ZodNullable",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),d(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${H(t.source)}|null)$`):void 0}),d(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)}),it=a("$ZodDefault",(e,n)=>{m.init(e,n),e._zod.optin="optional",d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(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(s=>fe(s,n)):fe(o,n)}});function fe(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const ct=a("$ZodPrefault",(e,n)=>{m.init(e,n),e._zod.optin="optional",d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),at=a("$ZodNonOptional",(e,n)=>{m.init(e,n),d(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(s=>de(s,e)):de(o,e)}});function de(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 lt=a("$ZodCatch",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=n.catchValue({...t,error:{issues:s.issues.map(u=>O(u,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(s=>O(s,r,P()))},input:t.value}),t.issues=[]),t)}}),ft=a("$ZodPipe",(e,n)=>{m.init(e,n),d(e._zod,"values",()=>n.in._zod.values),d(e._zod,"optin",()=>n.in._zod.optin),d(e._zod,"optout",()=>n.out._zod.optout),d(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=n.out._zod.run(t,r);return s instanceof Promise?s.then(u=>D(u,n.in,r)):D(s,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(s=>D(s,n.out,r)):D(o,n.out,r)}});function D(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const dt=a("$ZodReadonly",(e,n)=>{m.init(e,n),d(e._zod,"propValues",()=>n.innerType._zod.propValues),d(e._zod,"values",()=>n.innerType._zod.values),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(he):he(o)}});function he(e){return e.value=Object.freeze(e.value),e}const ht=a("$ZodCustom",(e,n)=>{k.init(e,n),m.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(s=>pe(s,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(R(o))}}class pt{constructor(){this._map=new WeakMap,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 WeakMap,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)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function mt(){return new pt}const F=mt();function _t(e,n){return new e({type:"number",checks:[],...p(n)})}function gt(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...p(n)})}function vt(e){return new e({type:"unknown"})}function zt(e,n){return new e({type:"never",...p(n)})}function me(e,n){return new Re({check:"less_than",...p(n),value:e,inclusive:!1})}function K(e,n){return new Re({check:"less_than",...p(n),value:e,inclusive:!0})}function _e(e,n){return new Ce({check:"greater_than",...p(n),value:e,inclusive:!1})}function Y(e,n){return new Ce({check:"greater_than",...p(n),value:e,inclusive:!0})}function ge(e,n){return new Mn({check:"multiple_of",...p(n),value:e})}function bt(e,n){return new Ln({check:"max_length",...p(n),maximum:e})}function ve(e,n){return new Gn({check:"min_length",...p(n),minimum:e})}function wt(e,n){return new Jn({check:"length_equals",...p(n),length:e})}function yt(e){return new Kn({check:"overwrite",tx:e})}function kt(e,n,t){return new e({type:"array",element:n,...p(t)})}function Et(e,n,t){return new e({type:"custom",check:"custom",fn:n,...p(t)})}function $t(e){const n=Zt(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(R(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(R(o))}},e(t.value,t)));return n}function Zt(e,n){const t=new k({check:"custom",...p(n)});return t._zod.check=e,t}const Pt=(e,n)=>{Ae.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>On(e,t)},flatten:{value:t=>Pn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,q,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,q,2)}},isEmpty:{get(){return e.issues.length===0}}})},w=a("ZodError",Pt,{Parent:Error}),Ot=ne(w),Tt=te(w),It=V(w),Nt=L(w),jt=Nn(w),At=jn(w),St=An(w),xt=Sn(w),Rt=xn(w),Ct=Rn(w),Dt=Cn(w),Ft=Dn(w),g=a("ZodType",(e,n)=>(m.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(I(n,{checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(t,r)=>$(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>Ot(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>It(e,t,r),e.parseAsync=async(t,r)=>Tt(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Nt(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>jt(e,t,r),e.decode=(t,r)=>At(e,t,r),e.encodeAsync=async(t,r)=>St(e,t,r),e.decodeAsync=async(t,r)=>xt(e,t,r),e.safeEncode=(t,r)=>Rt(e,t,r),e.safeDecode=(t,r)=>Ct(e,t,r),e.safeEncodeAsync=async(t,r)=>Dt(e,t,r),e.safeDecodeAsync=async(t,r)=>Ft(e,t,r),e.refine=(t,r)=>e.check(fr(t,r)),e.superRefine=t=>e.check(dr(t)),e.overwrite=t=>e.check(yt(t)),e.optional=()=>we(e),e.nullable=()=>ye(e),e.nullish=()=>we(ye(e)),e.nonoptional=t=>or(e,t),e.array=()=>Ve(e),e.or=t=>Yt([e,t]),e.and=t=>Bt(e,t),e.transform=t=>ke(e,Qt(t)),e.default=t=>nr(e,t),e.prefault=t=>rr(e,t),e.catch=t=>sr(e,t),e.pipe=t=>ke(e,t),e.readonly=()=>ar(e),e.describe=t=>{const r=e.clone();return F.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return F.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return F.get(e);const r=e.clone();return F.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Me=a("ZodNumber",(e,n)=>{De.init(e,n),g.init(e,n),e.gt=(r,o)=>e.check(_e(r,o)),e.gte=(r,o)=>e.check(Y(r,o)),e.min=(r,o)=>e.check(Y(r,o)),e.lt=(r,o)=>e.check(me(r,o)),e.lte=(r,o)=>e.check(K(r,o)),e.max=(r,o)=>e.check(K(r,o)),e.int=r=>e.check(ze(r)),e.safe=r=>e.check(ze(r)),e.positive=r=>e.check(_e(0,r)),e.nonnegative=r=>e.check(Y(0,r)),e.negative=r=>e.check(me(0,r)),e.nonpositive=r=>e.check(K(0,r)),e.multipleOf=(r,o)=>e.check(ge(r,o)),e.step=(r,o)=>e.check(ge(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 Z(e){return _t(Me,e)}const Ut=a("ZodNumberFormat",(e,n)=>{Bn.init(e,n),Me.init(e,n)});function ze(e){return gt(Ut,e)}const Mt=a("ZodUnknown",(e,n)=>{Xn.init(e,n),g.init(e,n)});function be(){return vt(Mt)}const Vt=a("ZodNever",(e,n)=>{Wn.init(e,n),g.init(e,n)});function Lt(e){return zt(Vt,e)}const Gt=a("ZodArray",(e,n)=>{Qn.init(e,n),g.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(ve(t,r)),e.nonempty=t=>e.check(ve(1,t)),e.max=(t,r)=>e.check(bt(t,r)),e.length=(t,r)=>e.check(wt(t,r)),e.unwrap=()=>e.element});function Ve(e,n){return kt(Gt,e,n)}const Jt=a("ZodObject",(e,n)=>{et.init(e,n),g.init(e,n),d(e,"shape",()=>n.shape),e.keyof=()=>Xt(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:be()}),e.loose=()=>e.clone({...e._zod.def,catchall:be()}),e.strict=()=>e.clone({...e._zod.def,catchall:Lt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>yn(e,t),e.safeExtend=t=>kn(e,t),e.merge=t=>En(e,t),e.pick=t=>bn(e,t),e.omit=t=>wn(e,t),e.partial=(...t)=>$n(Ge,e,t[0]),e.required=(...t)=>Zn(Je,e,t[0])});function Le(e,n){const t={type:"object",shape:e??{},...p(n)};return new Jt(t)}const Kt=a("ZodUnion",(e,n)=>{nt.init(e,n),g.init(e,n),e.options=n.options});function Yt(e,n){return new Kt({type:"union",options:e,...p(n)})}const qt=a("ZodIntersection",(e,n)=>{tt.init(e,n),g.init(e,n)});function Bt(e,n){return new qt({type:"intersection",left:e,right:n})}const X=a("ZodEnum",(e,n)=>{rt.init(e,n),g.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 s={};for(const u of r)if(t.has(u))s[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new X({...n,checks:[],...p(o),entries:s})},e.exclude=(r,o)=>{const s={...n.entries};for(const u of r)if(t.has(u))delete s[u];else throw new Error(`Key ${u} not found in enum`);return new X({...n,checks:[],...p(o),entries:s})}});function Xt(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new X({type:"enum",entries:t,...p(n)})}const Wt=a("ZodTransform",(e,n)=>{ot.init(e,n),g.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Pe(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(R(s,t.value,n));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=t.value),u.inst??(u.inst=e),t.issues.push(R(u))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function Qt(e){return new Wt({type:"transform",transform:e})}const Ge=a("ZodOptional",(e,n)=>{ut.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function we(e){return new Ge({type:"optional",innerType:e})}const Ht=a("ZodNullable",(e,n)=>{st.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ye(e){return new Ht({type:"nullable",innerType:e})}const er=a("ZodDefault",(e,n)=>{it.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function nr(e,n){return new er({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Ie(n)}})}const tr=a("ZodPrefault",(e,n)=>{ct.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function rr(e,n){return new tr({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Ie(n)}})}const Je=a("ZodNonOptional",(e,n)=>{at.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function or(e,n){return new Je({type:"nonoptional",innerType:e,...p(n)})}const ur=a("ZodCatch",(e,n)=>{lt.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sr(e,n){return new ur({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const ir=a("ZodPipe",(e,n)=>{ft.init(e,n),g.init(e,n),e.in=n.in,e.out=n.out});function ke(e,n){return new ir({type:"pipe",in:e,out:n})}const cr=a("ZodReadonly",(e,n)=>{dt.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ar(e){return new cr({type:"readonly",innerType:e})}const lr=a("ZodCustom",(e,n)=>{ht.init(e,n),g.init(e,n)});function fr(e,n={}){return Et(lr,e,n)}function dr(e){return $t(e)}const hr=e=>Le({pages:Z(),nextPage:Z().optional(),totalElements:Z(),currentPage:Z(),pageSize:Z(),elements:Ve(e)}),pr=Le({page:Z(),pageSize:Z()});exports.Fail=Xe;exports.Failure=We;exports.Guid=N;exports.Ok=Be;exports.PageQuery=pr;exports.createPageSchema=hr;exports.formatDate=Ee;exports.formatDateTime=tn;exports.formatTime=$e;exports.isFailure=He;exports.mock=qe;exports.notFailure=Qe;exports.parseConfig=en;exports.sleep=nn;
|
|
20
|
+
`)}_.write("payload.value = newResult;"),_.write("return payload;");const Ye=_.compile();return(E,y)=>Ye(h,E,y)};let s;const u=U,i=!Oe.jitless,l=i&&pn.value,f=n.catchall;let z;e._zod.parse=(h,_)=>{z??(z=r.value);const b=h.value;return u(b)?i&&l&&_?.async===!1&&_.jitless!==!0?(s||(s=o(n.shape)),h=s(h,_),f?Ue([],b,h,_,z,e):h):t(h,_):(h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h)}});function ce(e,n,t,r){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!j(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(s=>s.issues.map(u=>O(u,r,P())))}),n)}const et=a("$ZodUnion",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),d(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),d(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),d(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>H(s.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return r(o,s);let u=!1;const i=[];for(const c of n.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)i.push(l),u=!0;else{if(l.issues.length===0)return l;i.push(l)}}return u?Promise.all(i).then(c=>ce(c,o,e,s)):ce(i,o,e,s)}}),nt=a("$ZodIntersection",(e,n)=>{m.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,s=n.left._zod.run({value:o,issues:[]},r),u=n.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||u instanceof Promise?Promise.all([s,u]).then(([c,l])=>ae(t,c,l)):ae(t,s,u)}});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(x(e)&&x(n)){const t=Object.keys(n),r=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...n};for(const s of r){const u=B(e[s],n[s]);if(!u.valid)return{valid:!1,mergeErrorPath:[s,...u.mergeErrorPath]};o[s]=u.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],s=n[r],u=B(o,s);if(!u.valid)return{valid:!1,mergeErrorPath:[r,...u.mergeErrorPath]};t.push(u.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function ae(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 tt=a("$ZodEnum",(e,n)=>{m.init(e,n);const t=dn(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>mn.has(typeof o)).map(o=>typeof o=="string"?_n(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const u=o.value;return r.has(u)||o.issues.push({code:"invalid_value",values:t,input:u,inst:e}),o}}),rt=a("$ZodTransform",(e,n)=>{m.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Pe(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(t.value=u,t));if(o instanceof Promise)throw new A;return t.value=o,t}});function le(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const ot=a("$ZodOptional",(e,n)=>{m.init(e,n),e._zod.optin="optional",e._zod.optout="optional",d(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),d(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${H(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>le(s,t.value)):le(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),ut=a("$ZodNullable",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),d(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${H(t.source)}|null)$`):void 0}),d(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)}),st=a("$ZodDefault",(e,n)=>{m.init(e,n),e._zod.optin="optional",d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(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(s=>fe(s,n)):fe(o,n)}});function fe(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const it=a("$ZodPrefault",(e,n)=>{m.init(e,n),e._zod.optin="optional",d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),ct=a("$ZodNonOptional",(e,n)=>{m.init(e,n),d(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(s=>de(s,e)):de(o,e)}});function de(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 at=a("$ZodCatch",(e,n)=>{m.init(e,n),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),d(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=n.catchValue({...t,error:{issues:s.issues.map(u=>O(u,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(s=>O(s,r,P()))},input:t.value}),t.issues=[]),t)}}),lt=a("$ZodPipe",(e,n)=>{m.init(e,n),d(e._zod,"values",()=>n.in._zod.values),d(e._zod,"optin",()=>n.in._zod.optin),d(e._zod,"optout",()=>n.out._zod.optout),d(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=n.out._zod.run(t,r);return s instanceof Promise?s.then(u=>D(u,n.in,r)):D(s,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(s=>D(s,n.out,r)):D(o,n.out,r)}});function D(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const ft=a("$ZodReadonly",(e,n)=>{m.init(e,n),d(e._zod,"propValues",()=>n.innerType._zod.propValues),d(e._zod,"values",()=>n.innerType._zod.values),d(e._zod,"optin",()=>n.innerType._zod.optin),d(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(he):he(o)}});function he(e){return e.value=Object.freeze(e.value),e}const dt=a("$ZodCustom",(e,n)=>{k.init(e,n),m.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(s=>pe(s,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(R(o))}}class ht{constructor(){this._map=new WeakMap,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 WeakMap,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)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function pt(){return new ht}const F=pt();function mt(e,n){return new e({type:"number",checks:[],...p(n)})}function _t(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...p(n)})}function gt(e){return new e({type:"unknown"})}function vt(e,n){return new e({type:"never",...p(n)})}function me(e,n){return new Re({check:"less_than",...p(n),value:e,inclusive:!1})}function K(e,n){return new Re({check:"less_than",...p(n),value:e,inclusive:!0})}function _e(e,n){return new Ce({check:"greater_than",...p(n),value:e,inclusive:!1})}function Y(e,n){return new Ce({check:"greater_than",...p(n),value:e,inclusive:!0})}function ge(e,n){return new Un({check:"multiple_of",...p(n),value:e})}function zt(e,n){return new Vn({check:"max_length",...p(n),maximum:e})}function ve(e,n){return new Ln({check:"min_length",...p(n),minimum:e})}function bt(e,n){return new Gn({check:"length_equals",...p(n),length:e})}function wt(e){return new Jn({check:"overwrite",tx:e})}function yt(e,n,t){return new e({type:"array",element:n,...p(t)})}function kt(e,n,t){return new e({type:"custom",check:"custom",fn:n,...p(t)})}function Et(e){const n=$t(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(R(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(R(o))}},e(t.value,t)));return n}function $t(e,n){const t=new k({check:"custom",...p(n)});return t._zod.check=e,t}const Zt=(e,n)=>{Ae.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Pn(e,t)},flatten:{value:t=>Zn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,q,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,q,2)}},isEmpty:{get(){return e.issues.length===0}}})},w=a("ZodError",Zt,{Parent:Error}),Pt=ne(w),Ot=te(w),Tt=V(w),It=L(w),Nt=In(w),jt=Nn(w),At=jn(w),St=An(w),xt=Sn(w),Rt=xn(w),Ct=Rn(w),Dt=Cn(w),g=a("ZodType",(e,n)=>(m.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(I(n,{checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(t,r)=>$(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)=>Tt(e,t,r),e.parseAsync=async(t,r)=>Ot(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>It(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Nt(e,t,r),e.decode=(t,r)=>jt(e,t,r),e.encodeAsync=async(t,r)=>At(e,t,r),e.decodeAsync=async(t,r)=>St(e,t,r),e.safeEncode=(t,r)=>xt(e,t,r),e.safeDecode=(t,r)=>Rt(e,t,r),e.safeEncodeAsync=async(t,r)=>Ct(e,t,r),e.safeDecodeAsync=async(t,r)=>Dt(e,t,r),e.refine=(t,r)=>e.check(lr(t,r)),e.superRefine=t=>e.check(fr(t)),e.overwrite=t=>e.check(wt(t)),e.optional=()=>we(e),e.nullable=()=>ye(e),e.nullish=()=>we(ye(e)),e.nonoptional=t=>rr(e,t),e.array=()=>Ve(e),e.or=t=>Kt([e,t]),e.and=t=>qt(e,t),e.transform=t=>ke(e,Wt(t)),e.default=t=>er(e,t),e.prefault=t=>tr(e,t),e.catch=t=>ur(e,t),e.pipe=t=>ke(e,t),e.readonly=()=>cr(e),e.describe=t=>{const r=e.clone();return F.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return F.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return F.get(e);const r=e.clone();return F.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Me=a("ZodNumber",(e,n)=>{De.init(e,n),g.init(e,n),e.gt=(r,o)=>e.check(_e(r,o)),e.gte=(r,o)=>e.check(Y(r,o)),e.min=(r,o)=>e.check(Y(r,o)),e.lt=(r,o)=>e.check(me(r,o)),e.lte=(r,o)=>e.check(K(r,o)),e.max=(r,o)=>e.check(K(r,o)),e.int=r=>e.check(ze(r)),e.safe=r=>e.check(ze(r)),e.positive=r=>e.check(_e(0,r)),e.nonnegative=r=>e.check(Y(0,r)),e.negative=r=>e.check(me(0,r)),e.nonpositive=r=>e.check(K(0,r)),e.multipleOf=(r,o)=>e.check(ge(r,o)),e.step=(r,o)=>e.check(ge(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 Z(e){return mt(Me,e)}const Ft=a("ZodNumberFormat",(e,n)=>{qn.init(e,n),Me.init(e,n)});function ze(e){return _t(Ft,e)}const Ut=a("ZodUnknown",(e,n)=>{Bn.init(e,n),g.init(e,n)});function be(){return gt(Ut)}const Mt=a("ZodNever",(e,n)=>{Xn.init(e,n),g.init(e,n)});function Vt(e){return vt(Mt,e)}const Lt=a("ZodArray",(e,n)=>{Wn.init(e,n),g.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(ve(t,r)),e.nonempty=t=>e.check(ve(1,t)),e.max=(t,r)=>e.check(zt(t,r)),e.length=(t,r)=>e.check(bt(t,r)),e.unwrap=()=>e.element});function Ve(e,n){return yt(Lt,e,n)}const Gt=a("ZodObject",(e,n)=>{Hn.init(e,n),g.init(e,n),d(e,"shape",()=>n.shape),e.keyof=()=>Bt(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:be()}),e.loose=()=>e.clone({...e._zod.def,catchall:be()}),e.strict=()=>e.clone({...e._zod.def,catchall:Vt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>wn(e,t),e.safeExtend=t=>yn(e,t),e.merge=t=>kn(e,t),e.pick=t=>zn(e,t),e.omit=t=>bn(e,t),e.partial=(...t)=>En(Ge,e,t[0]),e.required=(...t)=>$n(Je,e,t[0])});function Le(e,n){const t={type:"object",shape:e??{},...p(n)};return new Gt(t)}const Jt=a("ZodUnion",(e,n)=>{et.init(e,n),g.init(e,n),e.options=n.options});function Kt(e,n){return new Jt({type:"union",options:e,...p(n)})}const Yt=a("ZodIntersection",(e,n)=>{nt.init(e,n),g.init(e,n)});function qt(e,n){return new Yt({type:"intersection",left:e,right:n})}const X=a("ZodEnum",(e,n)=>{tt.init(e,n),g.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 s={};for(const u of r)if(t.has(u))s[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new X({...n,checks:[],...p(o),entries:s})},e.exclude=(r,o)=>{const s={...n.entries};for(const u of r)if(t.has(u))delete s[u];else throw new Error(`Key ${u} not found in enum`);return new X({...n,checks:[],...p(o),entries:s})}});function Bt(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new X({type:"enum",entries:t,...p(n)})}const Xt=a("ZodTransform",(e,n)=>{rt.init(e,n),g.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Pe(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(R(s,t.value,n));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=t.value),u.inst??(u.inst=e),t.issues.push(R(u))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function Wt(e){return new Xt({type:"transform",transform:e})}const Ge=a("ZodOptional",(e,n)=>{ot.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function we(e){return new Ge({type:"optional",innerType:e})}const Qt=a("ZodNullable",(e,n)=>{ut.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ye(e){return new Qt({type:"nullable",innerType:e})}const Ht=a("ZodDefault",(e,n)=>{st.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function er(e,n){return new Ht({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Ie(n)}})}const nr=a("ZodPrefault",(e,n)=>{it.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function tr(e,n){return new nr({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Ie(n)}})}const Je=a("ZodNonOptional",(e,n)=>{ct.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function rr(e,n){return new Je({type:"nonoptional",innerType:e,...p(n)})}const or=a("ZodCatch",(e,n)=>{at.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ur(e,n){return new or({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const sr=a("ZodPipe",(e,n)=>{lt.init(e,n),g.init(e,n),e.in=n.in,e.out=n.out});function ke(e,n){return new sr({type:"pipe",in:e,out:n})}const ir=a("ZodReadonly",(e,n)=>{ft.init(e,n),g.init(e,n),e.unwrap=()=>e._zod.def.innerType});function cr(e){return new ir({type:"readonly",innerType:e})}const ar=a("ZodCustom",(e,n)=>{dt.init(e,n),g.init(e,n)});function lr(e,n={}){return kt(ar,e,n)}function fr(e){return Et(e)}const dr=e=>Le({pages:Z(),nextPage:Z().optional(),totalElements:Z(),currentPage:Z(),pageSize:Z(),elements:Ve(e)}),hr=Le({page:Z(),pageSize:Z()});exports.Fail=Xe;exports.Failure=We;exports.Guid=N;exports.Ok=Be;exports.PageQuery=hr;exports.createPageSchema=dr;exports.formatDate=Ee;exports.formatDateTime=tn;exports.formatTime=$e;exports.isFailure=He;exports.mock=qe;exports.notFailure=Qe;exports.parseConfig=en;exports.sleep=nn;
|
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
const
|
|
1
|
+
const rr = (e = {}) => e, or = (e) => [e, void 0], ur = (e) => [
|
|
2
2
|
void 0,
|
|
3
3
|
e
|
|
4
4
|
];
|
|
5
|
-
class
|
|
5
|
+
class sr {
|
|
6
6
|
name;
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = this.constructor.name;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const ir = (
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
((e) => (n) => !(n instanceof e))
|
|
14
|
-
),
|
|
14
|
+
), cr = (
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
((e) => (n) => n instanceof e)
|
|
17
|
-
),
|
|
17
|
+
), ar = (e, n = process.env) => {
|
|
18
18
|
const t = e.safeParse(n);
|
|
19
19
|
if (!t.success)
|
|
20
20
|
throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
|
|
21
21
|
return t.data;
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function lr(e) {
|
|
24
24
|
return new Promise((n) => setTimeout(n, e));
|
|
25
25
|
}
|
|
26
26
|
function Ke(e, n) {
|
|
@@ -38,7 +38,7 @@ function Ye(e, n) {
|
|
|
38
38
|
second: "2-digit"
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function fr(e, n) {
|
|
42
42
|
return `${Ke(e, n)} ${Ye(e, n)}`;
|
|
43
43
|
}
|
|
44
44
|
const qe = "00000000-0000-0000-0000-000000000000", Be = /^(?:[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;
|
|
@@ -69,15 +69,14 @@ function Qe() {
|
|
|
69
69
|
}
|
|
70
70
|
const en = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: en };
|
|
71
71
|
function nn(e, n, t) {
|
|
72
|
+
if (oe.randomUUID && !e)
|
|
73
|
+
return oe.randomUUID();
|
|
72
74
|
e = e || {};
|
|
73
75
|
const r = e.random ?? e.rng?.() ?? Qe();
|
|
74
76
|
if (r.length < 16)
|
|
75
77
|
throw new Error("Random bytes length must be >= 16");
|
|
76
78
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, We(r);
|
|
77
79
|
}
|
|
78
|
-
function tn(e, n, t) {
|
|
79
|
-
return oe.randomUUID && !e ? oe.randomUUID() : nn(e);
|
|
80
|
-
}
|
|
81
80
|
class S {
|
|
82
81
|
uuid;
|
|
83
82
|
constructor(n) {
|
|
@@ -90,7 +89,7 @@ class S {
|
|
|
90
89
|
return this.uuid === n.toString();
|
|
91
90
|
}
|
|
92
91
|
static new() {
|
|
93
|
-
return new S(
|
|
92
|
+
return new S(nn());
|
|
94
93
|
}
|
|
95
94
|
static empty() {
|
|
96
95
|
return new S(qe);
|
|
@@ -143,7 +142,7 @@ const Ze = {};
|
|
|
143
142
|
function P(e) {
|
|
144
143
|
return Ze;
|
|
145
144
|
}
|
|
146
|
-
function
|
|
145
|
+
function tn(e) {
|
|
147
146
|
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
148
147
|
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
|
|
149
148
|
}
|
|
@@ -167,7 +166,7 @@ function Q(e) {
|
|
|
167
166
|
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
168
167
|
return e.slice(n, t);
|
|
169
168
|
}
|
|
170
|
-
function
|
|
169
|
+
function rn(e, n) {
|
|
171
170
|
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
|
|
172
171
|
let o = (r.split(".")[1] || "").length;
|
|
173
172
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
@@ -218,7 +217,7 @@ const Pe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
218
217
|
function F(e) {
|
|
219
218
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
220
219
|
}
|
|
221
|
-
const
|
|
220
|
+
const on = W(() => {
|
|
222
221
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
223
222
|
return !1;
|
|
224
223
|
try {
|
|
@@ -240,8 +239,8 @@ function x(e) {
|
|
|
240
239
|
function Oe(e) {
|
|
241
240
|
return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
242
241
|
}
|
|
243
|
-
const
|
|
244
|
-
function
|
|
242
|
+
const un = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
243
|
+
function sn(e) {
|
|
245
244
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
246
245
|
}
|
|
247
246
|
function $(e, n, t) {
|
|
@@ -261,17 +260,17 @@ function p(e) {
|
|
|
261
260
|
}
|
|
262
261
|
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
263
262
|
}
|
|
264
|
-
function
|
|
263
|
+
function cn(e) {
|
|
265
264
|
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
266
265
|
}
|
|
267
|
-
const
|
|
266
|
+
const an = {
|
|
268
267
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
269
268
|
int32: [-2147483648, 2147483647],
|
|
270
269
|
uint32: [0, 4294967295],
|
|
271
270
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
272
271
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
273
272
|
};
|
|
274
|
-
function
|
|
273
|
+
function ln(e, n) {
|
|
275
274
|
const t = e._zod.def, r = I(e._zod.def, {
|
|
276
275
|
get shape() {
|
|
277
276
|
const o = {};
|
|
@@ -286,7 +285,7 @@ function fn(e, n) {
|
|
|
286
285
|
});
|
|
287
286
|
return $(e, r);
|
|
288
287
|
}
|
|
289
|
-
function
|
|
288
|
+
function fn(e, n) {
|
|
290
289
|
const t = e._zod.def, r = I(e._zod.def, {
|
|
291
290
|
get shape() {
|
|
292
291
|
const o = { ...e._zod.def.shape };
|
|
@@ -301,7 +300,7 @@ function dn(e, n) {
|
|
|
301
300
|
});
|
|
302
301
|
return $(e, r);
|
|
303
302
|
}
|
|
304
|
-
function
|
|
303
|
+
function dn(e, n) {
|
|
305
304
|
if (!x(n))
|
|
306
305
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
307
306
|
const t = e._zod.def.checks;
|
|
@@ -316,7 +315,7 @@ function hn(e, n) {
|
|
|
316
315
|
});
|
|
317
316
|
return $(e, o);
|
|
318
317
|
}
|
|
319
|
-
function
|
|
318
|
+
function hn(e, n) {
|
|
320
319
|
if (!x(n))
|
|
321
320
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
322
321
|
const t = {
|
|
@@ -329,7 +328,7 @@ function pn(e, n) {
|
|
|
329
328
|
};
|
|
330
329
|
return $(e, t);
|
|
331
330
|
}
|
|
332
|
-
function
|
|
331
|
+
function pn(e, n) {
|
|
333
332
|
const t = I(e._zod.def, {
|
|
334
333
|
get shape() {
|
|
335
334
|
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
@@ -343,7 +342,7 @@ function mn(e, n) {
|
|
|
343
342
|
});
|
|
344
343
|
return $(e, t);
|
|
345
344
|
}
|
|
346
|
-
function
|
|
345
|
+
function mn(e, n, t) {
|
|
347
346
|
const r = I(n._zod.def, {
|
|
348
347
|
get shape() {
|
|
349
348
|
const o = n._zod.def.shape, s = { ...o };
|
|
@@ -368,7 +367,7 @@ function _n(e, n, t) {
|
|
|
368
367
|
});
|
|
369
368
|
return $(n, r);
|
|
370
369
|
}
|
|
371
|
-
function
|
|
370
|
+
function _n(e, n, t) {
|
|
372
371
|
const r = I(n._zod.def, {
|
|
373
372
|
get shape() {
|
|
374
373
|
const o = n._zod.def.shape, s = { ...o };
|
|
@@ -442,13 +441,13 @@ const Ie = (e, n) => {
|
|
|
442
441
|
enumerable: !1
|
|
443
442
|
});
|
|
444
443
|
}, Ne = a("$ZodError", Ie), je = a("$ZodError", Ie, { Parent: Error });
|
|
445
|
-
function
|
|
444
|
+
function gn(e, n = (t) => t.message) {
|
|
446
445
|
const t = {}, r = [];
|
|
447
446
|
for (const o of e.issues)
|
|
448
447
|
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
449
448
|
return { formErrors: r, fieldErrors: t };
|
|
450
449
|
}
|
|
451
|
-
function
|
|
450
|
+
function vn(e, n = (t) => t.message) {
|
|
452
451
|
const t = { _errors: [] }, r = (o) => {
|
|
453
452
|
for (const s of o.issues)
|
|
454
453
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -494,26 +493,26 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
494
493
|
success: !1,
|
|
495
494
|
error: new (e ?? Ne)(s.issues.map((u) => O(u, o, P())))
|
|
496
495
|
} : { success: !0, data: s.value };
|
|
497
|
-
},
|
|
496
|
+
}, zn = /* @__PURE__ */ V(je), L = (e) => async (n, t, r) => {
|
|
498
497
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
499
498
|
let s = n._zod.run({ value: t, issues: [] }, o);
|
|
500
499
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
501
500
|
success: !1,
|
|
502
501
|
error: new e(s.issues.map((u) => O(u, o, P())))
|
|
503
502
|
} : { success: !0, data: s.value };
|
|
504
|
-
},
|
|
503
|
+
}, bn = /* @__PURE__ */ L(je), wn = (e) => (n, t, r) => {
|
|
505
504
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
506
505
|
return ne(e)(n, t, o);
|
|
507
|
-
},
|
|
506
|
+
}, yn = (e) => (n, t, r) => ne(e)(n, t, r), kn = (e) => async (n, t, r) => {
|
|
508
507
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
509
508
|
return te(e)(n, t, o);
|
|
510
|
-
},
|
|
509
|
+
}, En = (e) => async (n, t, r) => te(e)(n, t, r), $n = (e) => (n, t, r) => {
|
|
511
510
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
512
511
|
return V(e)(n, t, o);
|
|
513
|
-
},
|
|
512
|
+
}, Zn = (e) => (n, t, r) => V(e)(n, t, r), Pn = (e) => async (n, t, r) => {
|
|
514
513
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
515
514
|
return L(e)(n, t, o);
|
|
516
|
-
},
|
|
515
|
+
}, On = (e) => async (n, t, r) => L(e)(n, t, r), Tn = /^-?\d+$/, In = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
|
|
517
516
|
var t;
|
|
518
517
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
519
518
|
}), Ae = {
|
|
@@ -554,14 +553,14 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
554
553
|
continue: !n.abort
|
|
555
554
|
});
|
|
556
555
|
};
|
|
557
|
-
}),
|
|
556
|
+
}), Nn = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
|
|
558
557
|
k.init(e, n), e._zod.onattach.push((t) => {
|
|
559
558
|
var r;
|
|
560
559
|
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
|
|
561
560
|
}), e._zod.check = (t) => {
|
|
562
561
|
if (typeof t.value != typeof n.value)
|
|
563
562
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
564
|
-
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) :
|
|
563
|
+
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : rn(t.value, n.value) === 0) || t.issues.push({
|
|
565
564
|
origin: typeof t.value,
|
|
566
565
|
code: "not_multiple_of",
|
|
567
566
|
divisor: n.value,
|
|
@@ -570,12 +569,12 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
570
569
|
continue: !n.abort
|
|
571
570
|
});
|
|
572
571
|
};
|
|
573
|
-
}),
|
|
572
|
+
}), jn = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
|
|
574
573
|
k.init(e, n), n.format = n.format || "float64";
|
|
575
|
-
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] =
|
|
574
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = an[n.format];
|
|
576
575
|
e._zod.onattach.push((u) => {
|
|
577
576
|
const i = u._zod.bag;
|
|
578
|
-
i.format = n.format, i.minimum = o, i.maximum = s, t && (i.pattern =
|
|
577
|
+
i.format = n.format, i.minimum = o, i.maximum = s, t && (i.pattern = Tn);
|
|
579
578
|
}), e._zod.check = (u) => {
|
|
580
579
|
const i = u.value;
|
|
581
580
|
if (t) {
|
|
@@ -627,7 +626,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
627
626
|
inst: e
|
|
628
627
|
});
|
|
629
628
|
};
|
|
630
|
-
}),
|
|
629
|
+
}), An = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
|
|
631
630
|
var t;
|
|
632
631
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
633
632
|
const o = r.value;
|
|
@@ -650,7 +649,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
650
649
|
continue: !n.abort
|
|
651
650
|
});
|
|
652
651
|
};
|
|
653
|
-
}),
|
|
652
|
+
}), Sn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
|
|
654
653
|
var t;
|
|
655
654
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
656
655
|
const o = r.value;
|
|
@@ -673,7 +672,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
673
672
|
continue: !n.abort
|
|
674
673
|
});
|
|
675
674
|
};
|
|
676
|
-
}),
|
|
675
|
+
}), xn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
|
|
677
676
|
var t;
|
|
678
677
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
679
678
|
const o = r.value;
|
|
@@ -696,12 +695,12 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
696
695
|
continue: !n.abort
|
|
697
696
|
});
|
|
698
697
|
};
|
|
699
|
-
}),
|
|
698
|
+
}), Rn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
|
|
700
699
|
k.init(e, n), e._zod.check = (t) => {
|
|
701
700
|
t.value = n.tx(t.value);
|
|
702
701
|
};
|
|
703
702
|
});
|
|
704
|
-
class
|
|
703
|
+
class Cn {
|
|
705
704
|
constructor(n = []) {
|
|
706
705
|
this.content = [], this.indent = 0, this && (this.args = n);
|
|
707
706
|
}
|
|
@@ -724,13 +723,13 @@ class Dn {
|
|
|
724
723
|
`));
|
|
725
724
|
}
|
|
726
725
|
}
|
|
727
|
-
const
|
|
726
|
+
const Dn = {
|
|
728
727
|
major: 4,
|
|
729
728
|
minor: 1,
|
|
730
729
|
patch: 12
|
|
731
730
|
}, m = /* @__PURE__ */ a("$ZodType", (e, n) => {
|
|
732
731
|
var t;
|
|
733
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
732
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Dn;
|
|
734
733
|
const r = [...e._zod.def.checks ?? []];
|
|
735
734
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
736
735
|
for (const o of r)
|
|
@@ -793,17 +792,17 @@ const Un = {
|
|
|
793
792
|
e["~standard"] = {
|
|
794
793
|
validate: (o) => {
|
|
795
794
|
try {
|
|
796
|
-
const s =
|
|
795
|
+
const s = zn(e, o);
|
|
797
796
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
798
797
|
} catch {
|
|
799
|
-
return
|
|
798
|
+
return bn(e, o).then((u) => u.success ? { value: u.data } : { issues: u.error?.issues });
|
|
800
799
|
}
|
|
801
800
|
},
|
|
802
801
|
vendor: "zod",
|
|
803
802
|
version: 1
|
|
804
803
|
};
|
|
805
804
|
}), Re = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
806
|
-
m.init(e, n), e._zod.pattern = e._zod.bag.pattern ??
|
|
805
|
+
m.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? In, e._zod.parse = (t, r) => {
|
|
807
806
|
if (n.coerce)
|
|
808
807
|
try {
|
|
809
808
|
t.value = Number(t.value);
|
|
@@ -821,11 +820,11 @@ const Un = {
|
|
|
821
820
|
...s ? { received: s } : {}
|
|
822
821
|
}), t;
|
|
823
822
|
};
|
|
824
|
-
}),
|
|
825
|
-
|
|
826
|
-
}),
|
|
823
|
+
}), Un = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
824
|
+
jn.init(e, n), Re.init(e, n);
|
|
825
|
+
}), Fn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
|
|
827
826
|
m.init(e, n), e._zod.parse = (t) => t;
|
|
828
|
-
}),
|
|
827
|
+
}), Mn = /* @__PURE__ */ a("$ZodNever", (e, n) => {
|
|
829
828
|
m.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
830
829
|
expected: "never",
|
|
831
830
|
code: "invalid_type",
|
|
@@ -836,7 +835,7 @@ const Un = {
|
|
|
836
835
|
function ie(e, n, t) {
|
|
837
836
|
e.issues.length && n.issues.push(...Te(t, e.issues)), n.value[t] = e.value;
|
|
838
837
|
}
|
|
839
|
-
const
|
|
838
|
+
const Vn = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
840
839
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
841
840
|
const o = t.value;
|
|
842
841
|
if (!Array.isArray(o))
|
|
@@ -866,7 +865,7 @@ function Ce(e) {
|
|
|
866
865
|
for (const r of n)
|
|
867
866
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
868
867
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
869
|
-
const t =
|
|
868
|
+
const t = cn(e.shape);
|
|
870
869
|
return {
|
|
871
870
|
...e,
|
|
872
871
|
keys: n,
|
|
@@ -894,7 +893,7 @@ function De(e, n, t, r, o, s) {
|
|
|
894
893
|
inst: s
|
|
895
894
|
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
896
895
|
}
|
|
897
|
-
const
|
|
896
|
+
const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
898
897
|
if (m.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
899
898
|
const i = n.shape;
|
|
900
899
|
Object.defineProperty(n, "shape", {
|
|
@@ -939,10 +938,10 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
939
938
|
}
|
|
940
939
|
return s ? De(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
|
|
941
940
|
};
|
|
942
|
-
}),
|
|
943
|
-
|
|
941
|
+
}), Gn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
|
|
942
|
+
Ln.init(e, n);
|
|
944
943
|
const t = e._zod.parse, r = W(() => Ce(n)), o = (h) => {
|
|
945
|
-
const _ = new
|
|
944
|
+
const _ = new Cn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
|
|
946
945
|
const y = se(E);
|
|
947
946
|
return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
|
|
948
947
|
};
|
|
@@ -978,7 +977,7 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
978
977
|
return (E, y) => Je(h, E, y);
|
|
979
978
|
};
|
|
980
979
|
let s;
|
|
981
|
-
const u = F, i = !Ze.jitless, l = i &&
|
|
980
|
+
const u = F, i = !Ze.jitless, l = i && on.value, f = n.catchall;
|
|
982
981
|
let z;
|
|
983
982
|
e._zod.parse = (h, _) => {
|
|
984
983
|
z ?? (z = r.value);
|
|
@@ -1003,7 +1002,7 @@ function ce(e, n, t, r) {
|
|
|
1003
1002
|
errors: e.map((s) => s.issues.map((u) => O(u, r, P())))
|
|
1004
1003
|
}), n);
|
|
1005
1004
|
}
|
|
1006
|
-
const
|
|
1005
|
+
const Jn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
1007
1006
|
m.init(e, n), d(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), d(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), d(e._zod, "values", () => {
|
|
1008
1007
|
if (n.options.every((o) => o._zod.values))
|
|
1009
1008
|
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
@@ -1034,7 +1033,7 @@ const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
|
1034
1033
|
}
|
|
1035
1034
|
return u ? Promise.all(i).then((c) => ce(c, o, e, s)) : ce(i, o, e, s);
|
|
1036
1035
|
};
|
|
1037
|
-
}),
|
|
1036
|
+
}), Kn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
|
|
1038
1037
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
1039
1038
|
const o = t.value, s = n.left._zod.run({ value: o, issues: [] }, r), u = n.right._zod.run({ value: o, issues: [] }, r);
|
|
1040
1039
|
return s instanceof Promise || u instanceof Promise ? Promise.all([s, u]).then(([c, l]) => ae(t, c, l)) : ae(t, s, u);
|
|
@@ -1083,10 +1082,10 @@ function ae(e, n, t) {
|
|
|
1083
1082
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1084
1083
|
return e.value = r.data, e;
|
|
1085
1084
|
}
|
|
1086
|
-
const
|
|
1085
|
+
const Yn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
1087
1086
|
m.init(e, n);
|
|
1088
|
-
const t =
|
|
1089
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) =>
|
|
1087
|
+
const t = tn(n.entries), r = new Set(t);
|
|
1088
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => un.has(typeof o)).map((o) => typeof o == "string" ? sn(o) : o.toString()).join("|")})$`), e._zod.parse = (o, s) => {
|
|
1090
1089
|
const u = o.value;
|
|
1091
1090
|
return r.has(u) || o.issues.push({
|
|
1092
1091
|
code: "invalid_value",
|
|
@@ -1095,7 +1094,7 @@ const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1095
1094
|
inst: e
|
|
1096
1095
|
}), o;
|
|
1097
1096
|
};
|
|
1098
|
-
}),
|
|
1097
|
+
}), qn = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
|
|
1099
1098
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
1100
1099
|
if (r.direction === "backward")
|
|
1101
1100
|
throw new $e(e.constructor.name);
|
|
@@ -1110,7 +1109,7 @@ const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1110
1109
|
function le(e, n) {
|
|
1111
1110
|
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1112
1111
|
}
|
|
1113
|
-
const
|
|
1112
|
+
const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
1114
1113
|
m.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), d(e._zod, "pattern", () => {
|
|
1115
1114
|
const t = n.innerType._zod.pattern;
|
|
1116
1115
|
return t ? new RegExp(`^(${Q(t.source)})?$`) : void 0;
|
|
@@ -1121,12 +1120,12 @@ const Xn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1121
1120
|
}
|
|
1122
1121
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1123
1122
|
};
|
|
1124
|
-
}),
|
|
1123
|
+
}), Xn = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
|
|
1125
1124
|
m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "pattern", () => {
|
|
1126
1125
|
const t = n.innerType._zod.pattern;
|
|
1127
1126
|
return t ? new RegExp(`^(${Q(t.source)}|null)$`) : void 0;
|
|
1128
1127
|
}), d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
|
|
1129
|
-
}),
|
|
1128
|
+
}), Wn = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
|
|
1130
1129
|
m.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1131
1130
|
if (r.direction === "backward")
|
|
1132
1131
|
return n.innerType._zod.run(t, r);
|
|
@@ -1139,9 +1138,9 @@ const Xn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1139
1138
|
function fe(e, n) {
|
|
1140
1139
|
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1141
1140
|
}
|
|
1142
|
-
const
|
|
1141
|
+
const Hn = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
|
|
1143
1142
|
m.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
1144
|
-
}),
|
|
1143
|
+
}), Qn = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
|
|
1145
1144
|
m.init(e, n), d(e._zod, "values", () => {
|
|
1146
1145
|
const t = n.innerType._zod.values;
|
|
1147
1146
|
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
@@ -1158,7 +1157,7 @@ function de(e, n) {
|
|
|
1158
1157
|
inst: n
|
|
1159
1158
|
}), e;
|
|
1160
1159
|
}
|
|
1161
|
-
const
|
|
1160
|
+
const et = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
1162
1161
|
m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1163
1162
|
if (r.direction === "backward")
|
|
1164
1163
|
return n.innerType._zod.run(t, r);
|
|
@@ -1177,7 +1176,7 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1177
1176
|
input: t.value
|
|
1178
1177
|
}), t.issues = []), t);
|
|
1179
1178
|
};
|
|
1180
|
-
}),
|
|
1179
|
+
}), nt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
|
|
1181
1180
|
m.init(e, n), d(e._zod, "values", () => n.in._zod.values), d(e._zod, "optin", () => n.in._zod.optin), d(e._zod, "optout", () => n.out._zod.optout), d(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1182
1181
|
if (r.direction === "backward") {
|
|
1183
1182
|
const s = n.out._zod.run(t, r);
|
|
@@ -1190,7 +1189,7 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1190
1189
|
function D(e, n, t) {
|
|
1191
1190
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1192
1191
|
}
|
|
1193
|
-
const
|
|
1192
|
+
const tt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
1194
1193
|
m.init(e, n), d(e._zod, "propValues", () => n.innerType._zod.propValues), d(e._zod, "values", () => n.innerType._zod.values), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
|
|
1195
1194
|
if (r.direction === "backward")
|
|
1196
1195
|
return n.innerType._zod.run(t, r);
|
|
@@ -1201,7 +1200,7 @@ const rt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
|
1201
1200
|
function he(e) {
|
|
1202
1201
|
return e.value = Object.freeze(e.value), e;
|
|
1203
1202
|
}
|
|
1204
|
-
const
|
|
1203
|
+
const rt = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
|
|
1205
1204
|
k.init(e, n), m.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1206
1205
|
const r = t.value, o = n.fn(r);
|
|
1207
1206
|
if (o instanceof Promise)
|
|
@@ -1224,7 +1223,7 @@ function pe(e, n, t, r) {
|
|
|
1224
1223
|
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(R(o));
|
|
1225
1224
|
}
|
|
1226
1225
|
}
|
|
1227
|
-
class
|
|
1226
|
+
class ot {
|
|
1228
1227
|
constructor() {
|
|
1229
1228
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1230
1229
|
}
|
|
@@ -1258,18 +1257,18 @@ class ut {
|
|
|
1258
1257
|
return this._map.has(n);
|
|
1259
1258
|
}
|
|
1260
1259
|
}
|
|
1261
|
-
function
|
|
1262
|
-
return new
|
|
1260
|
+
function ut() {
|
|
1261
|
+
return new ot();
|
|
1263
1262
|
}
|
|
1264
|
-
const U = /* @__PURE__ */
|
|
1265
|
-
function
|
|
1263
|
+
const U = /* @__PURE__ */ ut();
|
|
1264
|
+
function st(e, n) {
|
|
1266
1265
|
return new e({
|
|
1267
1266
|
type: "number",
|
|
1268
1267
|
checks: [],
|
|
1269
1268
|
...p(n)
|
|
1270
1269
|
});
|
|
1271
1270
|
}
|
|
1272
|
-
function
|
|
1271
|
+
function it(e, n) {
|
|
1273
1272
|
return new e({
|
|
1274
1273
|
type: "number",
|
|
1275
1274
|
check: "number_format",
|
|
@@ -1278,12 +1277,12 @@ function ct(e, n) {
|
|
|
1278
1277
|
...p(n)
|
|
1279
1278
|
});
|
|
1280
1279
|
}
|
|
1281
|
-
function
|
|
1280
|
+
function ct(e) {
|
|
1282
1281
|
return new e({
|
|
1283
1282
|
type: "unknown"
|
|
1284
1283
|
});
|
|
1285
1284
|
}
|
|
1286
|
-
function
|
|
1285
|
+
function at(e, n) {
|
|
1287
1286
|
return new e({
|
|
1288
1287
|
type: "never",
|
|
1289
1288
|
...p(n)
|
|
@@ -1322,40 +1321,40 @@ function Y(e, n) {
|
|
|
1322
1321
|
});
|
|
1323
1322
|
}
|
|
1324
1323
|
function ge(e, n) {
|
|
1325
|
-
return new
|
|
1324
|
+
return new Nn({
|
|
1326
1325
|
check: "multiple_of",
|
|
1327
1326
|
...p(n),
|
|
1328
1327
|
value: e
|
|
1329
1328
|
});
|
|
1330
1329
|
}
|
|
1331
|
-
function
|
|
1332
|
-
return new
|
|
1330
|
+
function lt(e, n) {
|
|
1331
|
+
return new An({
|
|
1333
1332
|
check: "max_length",
|
|
1334
1333
|
...p(n),
|
|
1335
1334
|
maximum: e
|
|
1336
1335
|
});
|
|
1337
1336
|
}
|
|
1338
1337
|
function ve(e, n) {
|
|
1339
|
-
return new
|
|
1338
|
+
return new Sn({
|
|
1340
1339
|
check: "min_length",
|
|
1341
1340
|
...p(n),
|
|
1342
1341
|
minimum: e
|
|
1343
1342
|
});
|
|
1344
1343
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return new
|
|
1344
|
+
function ft(e, n) {
|
|
1345
|
+
return new xn({
|
|
1347
1346
|
check: "length_equals",
|
|
1348
1347
|
...p(n),
|
|
1349
1348
|
length: e
|
|
1350
1349
|
});
|
|
1351
1350
|
}
|
|
1352
|
-
function
|
|
1353
|
-
return new
|
|
1351
|
+
function dt(e) {
|
|
1352
|
+
return new Rn({
|
|
1354
1353
|
check: "overwrite",
|
|
1355
1354
|
tx: e
|
|
1356
1355
|
});
|
|
1357
1356
|
}
|
|
1358
|
-
function
|
|
1357
|
+
function ht(e, n, t) {
|
|
1359
1358
|
return new e({
|
|
1360
1359
|
type: "array",
|
|
1361
1360
|
element: n,
|
|
@@ -1365,7 +1364,7 @@ function pt(e, n, t) {
|
|
|
1365
1364
|
...p(t)
|
|
1366
1365
|
});
|
|
1367
1366
|
}
|
|
1368
|
-
function
|
|
1367
|
+
function pt(e, n, t) {
|
|
1369
1368
|
return new e({
|
|
1370
1369
|
type: "custom",
|
|
1371
1370
|
check: "custom",
|
|
@@ -1373,8 +1372,8 @@ function mt(e, n, t) {
|
|
|
1373
1372
|
...p(t)
|
|
1374
1373
|
});
|
|
1375
1374
|
}
|
|
1376
|
-
function
|
|
1377
|
-
const n =
|
|
1375
|
+
function mt(e) {
|
|
1376
|
+
const n = _t((t) => (t.addIssue = (r) => {
|
|
1378
1377
|
if (typeof r == "string")
|
|
1379
1378
|
t.issues.push(R(r, t.value, n._zod.def));
|
|
1380
1379
|
else {
|
|
@@ -1384,21 +1383,21 @@ function _t(e) {
|
|
|
1384
1383
|
}, e(t.value, t)));
|
|
1385
1384
|
return n;
|
|
1386
1385
|
}
|
|
1387
|
-
function
|
|
1386
|
+
function _t(e, n) {
|
|
1388
1387
|
const t = new k({
|
|
1389
1388
|
check: "custom",
|
|
1390
1389
|
...p(n)
|
|
1391
1390
|
});
|
|
1392
1391
|
return t._zod.check = e, t;
|
|
1393
1392
|
}
|
|
1394
|
-
const
|
|
1393
|
+
const gt = (e, n) => {
|
|
1395
1394
|
Ne.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
1396
1395
|
format: {
|
|
1397
|
-
value: (t) =>
|
|
1396
|
+
value: (t) => vn(e, t)
|
|
1398
1397
|
// enumerable: false,
|
|
1399
1398
|
},
|
|
1400
1399
|
flatten: {
|
|
1401
|
-
value: (t) =>
|
|
1400
|
+
value: (t) => gn(e, t)
|
|
1402
1401
|
// enumerable: false,
|
|
1403
1402
|
},
|
|
1404
1403
|
addIssue: {
|
|
@@ -1420,14 +1419,14 @@ const vt = (e, n) => {
|
|
|
1420
1419
|
// enumerable: false,
|
|
1421
1420
|
}
|
|
1422
1421
|
});
|
|
1423
|
-
}, w = a("ZodError",
|
|
1422
|
+
}, w = a("ZodError", gt, {
|
|
1424
1423
|
Parent: Error
|
|
1425
|
-
}),
|
|
1424
|
+
}), vt = /* @__PURE__ */ ne(w), zt = /* @__PURE__ */ te(w), bt = /* @__PURE__ */ V(w), wt = /* @__PURE__ */ L(w), yt = /* @__PURE__ */ wn(w), kt = /* @__PURE__ */ yn(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w), Tt = /* @__PURE__ */ On(w), g = /* @__PURE__ */ a("ZodType", (e, n) => (m.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(I(n, {
|
|
1426
1425
|
checks: [
|
|
1427
1426
|
...n.checks ?? [],
|
|
1428
1427
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1429
1428
|
]
|
|
1430
|
-
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) =>
|
|
1429
|
+
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => vt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => bt(e, t, r), e.parseAsync = async (t, r) => zt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => wt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => yt(e, t, r), e.decode = (t, r) => kt(e, t, r), e.encodeAsync = async (t, r) => Et(e, t, r), e.decodeAsync = async (t, r) => $t(e, t, r), e.safeEncode = (t, r) => Zt(e, t, r), e.safeDecode = (t, r) => Pt(e, t, r), e.safeEncodeAsync = async (t, r) => Ot(e, t, r), e.safeDecodeAsync = async (t, r) => Tt(e, t, r), e.refine = (t, r) => e.check(nr(t, r)), e.superRefine = (t) => e.check(tr(t)), e.overwrite = (t) => e.check(dt(t)), e.optional = () => we(e), e.nullable = () => ye(e), e.nullish = () => we(ye(e)), e.nonoptional = (t) => qt(e, t), e.array = () => Fe(e), e.or = (t) => Ct([e, t]), e.and = (t) => Ut(e, t), e.transform = (t) => ke(e, Vt(t)), e.default = (t) => Jt(e, t), e.prefault = (t) => Yt(e, t), e.catch = (t) => Xt(e, t), e.pipe = (t) => ke(e, t), e.readonly = () => Qt(e), e.describe = (t) => {
|
|
1431
1430
|
const r = e.clone();
|
|
1432
1431
|
return U.add(r, { description: t }), r;
|
|
1433
1432
|
}, Object.defineProperty(e, "description", {
|
|
@@ -1446,34 +1445,34 @@ const vt = (e, n) => {
|
|
|
1446
1445
|
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 ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
|
|
1447
1446
|
});
|
|
1448
1447
|
function Z(e) {
|
|
1449
|
-
return
|
|
1448
|
+
return st(Ue, e);
|
|
1450
1449
|
}
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1450
|
+
const It = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
|
|
1451
|
+
Un.init(e, n), Ue.init(e, n);
|
|
1453
1452
|
});
|
|
1454
1453
|
function ze(e) {
|
|
1455
|
-
return
|
|
1454
|
+
return it(It, e);
|
|
1456
1455
|
}
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1456
|
+
const Nt = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
|
|
1457
|
+
Fn.init(e, n), g.init(e, n);
|
|
1459
1458
|
});
|
|
1460
1459
|
function be() {
|
|
1461
|
-
return
|
|
1460
|
+
return ct(Nt);
|
|
1462
1461
|
}
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1462
|
+
const jt = /* @__PURE__ */ a("ZodNever", (e, n) => {
|
|
1463
|
+
Mn.init(e, n), g.init(e, n);
|
|
1465
1464
|
});
|
|
1466
|
-
function
|
|
1467
|
-
return
|
|
1465
|
+
function At(e) {
|
|
1466
|
+
return at(jt, e);
|
|
1468
1467
|
}
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1468
|
+
const St = /* @__PURE__ */ a("ZodArray", (e, n) => {
|
|
1469
|
+
Vn.init(e, n), g.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ve(t, r)), e.nonempty = (t) => e.check(ve(1, t)), e.max = (t, r) => e.check(lt(t, r)), e.length = (t, r) => e.check(ft(t, r)), e.unwrap = () => e.element;
|
|
1471
1470
|
});
|
|
1472
1471
|
function Fe(e, n) {
|
|
1473
|
-
return
|
|
1472
|
+
return ht(St, e, n);
|
|
1474
1473
|
}
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1474
|
+
const xt = /* @__PURE__ */ a("ZodObject", (e, n) => {
|
|
1475
|
+
Gn.init(e, n), g.init(e, n), d(e, "shape", () => n.shape), e.keyof = () => Ft(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: be() }), e.loose = () => e.clone({ ...e._zod.def, catchall: be() }), e.strict = () => e.clone({ ...e._zod.def, catchall: At() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => dn(e, t), e.safeExtend = (t) => hn(e, t), e.merge = (t) => pn(e, t), e.pick = (t) => ln(e, t), e.omit = (t) => fn(e, t), e.partial = (...t) => mn(Ve, e, t[0]), e.required = (...t) => _n(Le, e, t[0]);
|
|
1477
1476
|
});
|
|
1478
1477
|
function Me(e, n) {
|
|
1479
1478
|
const t = {
|
|
@@ -1481,30 +1480,30 @@ function Me(e, n) {
|
|
|
1481
1480
|
shape: e ?? {},
|
|
1482
1481
|
...p(n)
|
|
1483
1482
|
};
|
|
1484
|
-
return new
|
|
1483
|
+
return new xt(t);
|
|
1485
1484
|
}
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1485
|
+
const Rt = /* @__PURE__ */ a("ZodUnion", (e, n) => {
|
|
1486
|
+
Jn.init(e, n), g.init(e, n), e.options = n.options;
|
|
1488
1487
|
});
|
|
1489
|
-
function
|
|
1490
|
-
return new
|
|
1488
|
+
function Ct(e, n) {
|
|
1489
|
+
return new Rt({
|
|
1491
1490
|
type: "union",
|
|
1492
1491
|
options: e,
|
|
1493
1492
|
...p(n)
|
|
1494
1493
|
});
|
|
1495
1494
|
}
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1495
|
+
const Dt = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
|
|
1496
|
+
Kn.init(e, n), g.init(e, n);
|
|
1498
1497
|
});
|
|
1499
|
-
function
|
|
1500
|
-
return new
|
|
1498
|
+
function Ut(e, n) {
|
|
1499
|
+
return new Dt({
|
|
1501
1500
|
type: "intersection",
|
|
1502
1501
|
left: e,
|
|
1503
1502
|
right: n
|
|
1504
1503
|
});
|
|
1505
1504
|
}
|
|
1506
1505
|
const X = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
1507
|
-
|
|
1506
|
+
Yn.init(e, n), g.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
1508
1507
|
const t = new Set(Object.keys(n.entries));
|
|
1509
1508
|
e.extract = (r, o) => {
|
|
1510
1509
|
const s = {};
|
|
@@ -1534,7 +1533,7 @@ const X = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
|
1534
1533
|
});
|
|
1535
1534
|
};
|
|
1536
1535
|
});
|
|
1537
|
-
function
|
|
1536
|
+
function Ft(e, n) {
|
|
1538
1537
|
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
1539
1538
|
return new X({
|
|
1540
1539
|
type: "enum",
|
|
@@ -1542,8 +1541,8 @@ function Mt(e, n) {
|
|
|
1542
1541
|
...p(n)
|
|
1543
1542
|
});
|
|
1544
1543
|
}
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1544
|
+
const Mt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
1545
|
+
qn.init(e, n), g.init(e, n), e._zod.parse = (t, r) => {
|
|
1547
1546
|
if (r.direction === "backward")
|
|
1548
1547
|
throw new $e(e.constructor.name);
|
|
1549
1548
|
t.addIssue = (s) => {
|
|
@@ -1558,14 +1557,14 @@ const Vt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
|
1558
1557
|
return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
|
|
1559
1558
|
};
|
|
1560
1559
|
});
|
|
1561
|
-
function
|
|
1562
|
-
return new
|
|
1560
|
+
function Vt(e) {
|
|
1561
|
+
return new Mt({
|
|
1563
1562
|
type: "transform",
|
|
1564
1563
|
transform: e
|
|
1565
1564
|
});
|
|
1566
1565
|
}
|
|
1567
1566
|
const Ve = /* @__PURE__ */ a("ZodOptional", (e, n) => {
|
|
1568
|
-
|
|
1567
|
+
Bn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1569
1568
|
});
|
|
1570
1569
|
function we(e) {
|
|
1571
1570
|
return new Ve({
|
|
@@ -1573,20 +1572,20 @@ function we(e) {
|
|
|
1573
1572
|
innerType: e
|
|
1574
1573
|
});
|
|
1575
1574
|
}
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1575
|
+
const Lt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
|
|
1576
|
+
Xn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1578
1577
|
});
|
|
1579
1578
|
function ye(e) {
|
|
1580
|
-
return new
|
|
1579
|
+
return new Lt({
|
|
1581
1580
|
type: "nullable",
|
|
1582
1581
|
innerType: e
|
|
1583
1582
|
});
|
|
1584
1583
|
}
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1584
|
+
const Gt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
|
|
1585
|
+
Wn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1587
1586
|
});
|
|
1588
|
-
function
|
|
1589
|
-
return new
|
|
1587
|
+
function Jt(e, n) {
|
|
1588
|
+
return new Gt({
|
|
1590
1589
|
type: "default",
|
|
1591
1590
|
innerType: e,
|
|
1592
1591
|
get defaultValue() {
|
|
@@ -1594,11 +1593,11 @@ function Kt(e, n) {
|
|
|
1594
1593
|
}
|
|
1595
1594
|
});
|
|
1596
1595
|
}
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1596
|
+
const Kt = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
|
|
1597
|
+
Hn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1599
1598
|
});
|
|
1600
|
-
function
|
|
1601
|
-
return new
|
|
1599
|
+
function Yt(e, n) {
|
|
1600
|
+
return new Kt({
|
|
1602
1601
|
type: "prefault",
|
|
1603
1602
|
innerType: e,
|
|
1604
1603
|
get defaultValue() {
|
|
@@ -1607,78 +1606,78 @@ function qt(e, n) {
|
|
|
1607
1606
|
});
|
|
1608
1607
|
}
|
|
1609
1608
|
const Le = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
|
|
1610
|
-
|
|
1609
|
+
Qn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1611
1610
|
});
|
|
1612
|
-
function
|
|
1611
|
+
function qt(e, n) {
|
|
1613
1612
|
return new Le({
|
|
1614
1613
|
type: "nonoptional",
|
|
1615
1614
|
innerType: e,
|
|
1616
1615
|
...p(n)
|
|
1617
1616
|
});
|
|
1618
1617
|
}
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1618
|
+
const Bt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
|
|
1619
|
+
et.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1621
1620
|
});
|
|
1622
|
-
function
|
|
1623
|
-
return new
|
|
1621
|
+
function Xt(e, n) {
|
|
1622
|
+
return new Bt({
|
|
1624
1623
|
type: "catch",
|
|
1625
1624
|
innerType: e,
|
|
1626
1625
|
catchValue: typeof n == "function" ? n : () => n
|
|
1627
1626
|
});
|
|
1628
1627
|
}
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1628
|
+
const Wt = /* @__PURE__ */ a("ZodPipe", (e, n) => {
|
|
1629
|
+
nt.init(e, n), g.init(e, n), e.in = n.in, e.out = n.out;
|
|
1631
1630
|
});
|
|
1632
1631
|
function ke(e, n) {
|
|
1633
|
-
return new
|
|
1632
|
+
return new Wt({
|
|
1634
1633
|
type: "pipe",
|
|
1635
1634
|
in: e,
|
|
1636
1635
|
out: n
|
|
1637
1636
|
// ...util.normalizeParams(params),
|
|
1638
1637
|
});
|
|
1639
1638
|
}
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1639
|
+
const Ht = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
|
|
1640
|
+
tt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1642
1641
|
});
|
|
1643
|
-
function
|
|
1644
|
-
return new
|
|
1642
|
+
function Qt(e) {
|
|
1643
|
+
return new Ht({
|
|
1645
1644
|
type: "readonly",
|
|
1646
1645
|
innerType: e
|
|
1647
1646
|
});
|
|
1648
1647
|
}
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1648
|
+
const er = /* @__PURE__ */ a("ZodCustom", (e, n) => {
|
|
1649
|
+
rt.init(e, n), g.init(e, n);
|
|
1651
1650
|
});
|
|
1652
|
-
function
|
|
1653
|
-
return
|
|
1651
|
+
function nr(e, n = {}) {
|
|
1652
|
+
return pt(er, e, n);
|
|
1654
1653
|
}
|
|
1655
|
-
function
|
|
1656
|
-
return
|
|
1654
|
+
function tr(e) {
|
|
1655
|
+
return mt(e);
|
|
1657
1656
|
}
|
|
1658
|
-
const
|
|
1657
|
+
const dr = (e) => Me({
|
|
1659
1658
|
pages: Z(),
|
|
1660
1659
|
nextPage: Z().optional(),
|
|
1661
1660
|
totalElements: Z(),
|
|
1662
1661
|
currentPage: Z(),
|
|
1663
1662
|
pageSize: Z(),
|
|
1664
1663
|
elements: Fe(e)
|
|
1665
|
-
}),
|
|
1664
|
+
}), hr = Me({
|
|
1666
1665
|
page: Z(),
|
|
1667
1666
|
pageSize: Z()
|
|
1668
1667
|
});
|
|
1669
1668
|
export {
|
|
1670
|
-
|
|
1671
|
-
|
|
1669
|
+
ur as Fail,
|
|
1670
|
+
sr as Failure,
|
|
1672
1671
|
S as Guid,
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1672
|
+
or as Ok,
|
|
1673
|
+
hr as PageQuery,
|
|
1674
|
+
dr as createPageSchema,
|
|
1676
1675
|
Ke as formatDate,
|
|
1677
|
-
|
|
1676
|
+
fr as formatDateTime,
|
|
1678
1677
|
Ye as formatTime,
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1678
|
+
cr as isFailure,
|
|
1679
|
+
rr as mock,
|
|
1680
|
+
ir as notFailure,
|
|
1681
|
+
ar as parseConfig,
|
|
1682
|
+
lr as sleep
|
|
1684
1683
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsfsi-core/ts-crossplatform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"zod": "4.1.12"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@vitest/coverage-v8": "
|
|
37
|
-
"vite": "7.1.
|
|
36
|
+
"@vitest/coverage-v8": "4.0.4",
|
|
37
|
+
"vite": "7.1.12",
|
|
38
38
|
"vite-plugin-dts": "4.5.4",
|
|
39
|
-
"vitest": "
|
|
39
|
+
"vitest": "4.0.4"
|
|
40
40
|
}
|
|
41
41
|
}
|