@jsfsi-core/ts-crossplatform 1.1.41 → 1.1.43

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 CHANGED
@@ -1,6 +1,6 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=>e,t=e=>[e,void 0],n=e=>[void 0,e],r=class{name;constructor(){this.name=this.constructor.name}},i=e=>t=>!(t instanceof e),a=e=>t=>t instanceof e,o=(e,t=process.env)=>{let n=e.safeParse(t);if(!n.success)throw Error(`Invalid environment variables: ${JSON.stringify(n.error.issues)}`);return n.data};function s(e){return new Promise(t=>setTimeout(t,e))}function c(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`})}function l(e,t){return new Date(e).toLocaleTimeString(t,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function u(e,t){return`${c(e,t)} ${l(e,t)}`}function d({allDay:e,startDate:t,startTime:n,endTime:r}){let i={startDate:new Date(new Date(t).setHours(0,0,0,0)),endDate:new Date(new Date(t).setHours(23,59,59,999))};if(e)return i;if(n){let e=new Date(t);e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i.startDate=e}if(r){let e=new Date(t);e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),i.endDate=e}return i}var f=`00000000-0000-0000-0000-000000000000`,p=/^(?:[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 ee(e){return typeof e==`string`&&p.test(e)}function te(e){if(!ee(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function ne(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var re,ie=new Uint8Array(16);function ae(){if(!re){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);re=crypto.getRandomValues.bind(crypto)}return re(ie)}var oe={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function se(e,t,n){e||={};let r=e.random??e.rng?.()??ae();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ne(r)}function ce(e,t,n){return oe.randomUUID&&!t&&!e?oe.randomUUID():se(e,t,n)}var le=class e{uuid;constructor(e){te(e),this.uuid=e}toString(){return this.uuid}equals(e){return this.uuid===e.toString()}static new(){return new e(ce())}static empty(){return new e(f)}static isValid(e){return!!(e&&ee(e))}static parse(t){return t&&e.isValid(t)?new e(t):void 0}};Object.freeze({status:`aborted`});function h(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var g=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ue=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},_={};function v(e){return e&&Object.assign(_,e),_}function de(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function y(e,t){return typeof t==`bigint`?t.toString():t}function fe(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function pe(e){return e==null}function me(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function he(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ge=Symbol(`evaluating`);function b(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ge)return r===void 0&&(r=ge,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function S(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function _e(e){return JSON.stringify(e)}function ve(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ye=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var be=fe(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function w(e){if(C(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(C(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function xe(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e}var Se=new Set([`string`,`number`,`symbol`]);function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var we={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Te(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return x(this,`shape`,e),e},checks:[]}))}function Ee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return x(this,`shape`,r),r},checks:[]}))}function De(e,t){if(!w(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function Oe(e,t){if(!w(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function ke(e,t){return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return x(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Ae(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return x(this,`shape`,i),i},checks:[]}))}function je(e,t,n){return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return x(this,`shape`,i),i}}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Me(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function k(e){return typeof e==`string`?e:e?.message}function A(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=k(e.inst?._zod.def?.error?.(e))??k(t?.error?.(e))??k(n.customError?.(e))??k(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function j(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function M(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ne=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,y,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Pe=h(`$ZodError`,Ne),Fe=h(`$ZodError`,Ne,{Parent:Error});function Ie(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Le(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var N=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new g;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>A(e,a,v())));throw ye(t,i?.callee),t}return o.value},P=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>A(e,a,v())));throw ye(t,i?.callee),t}return o.value},F=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new g;return a.issues.length?{success:!1,error:new(e??Pe)(a.issues.map(e=>A(e,i,v())))}:{success:!0,data:a.value}},Re=F(Fe),I=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>A(e,i,v())))}:{success:!0,data:a.value}},ze=I(Fe),Be=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return N(e)(t,n,i)},Ve=e=>(t,n,r)=>N(e)(t,n,r),He=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return P(e)(t,n,i)},Ue=e=>async(t,n,r)=>P(e)(t,n,r),We=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return F(e)(t,n,i)},Ge=e=>(t,n,r)=>F(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return I(e)(t,n,i)},qe=e=>async(t,n,r)=>I(e)(t,n,r),Je=/^[cC][^\s-]{8,}$/,Ye=/^[0-9a-z]+$/,Xe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ze=/^[0-9a-vA-V]{20}$/,Qe=/^[A-Za-z0-9]{27}$/,$e=/^[a-zA-Z0-9_-]{21}$/,et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,it=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function at(){return new RegExp(it,`u`)}var ot=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,st=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ct=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dt=/^[A-Za-z0-9_-]*$/,ft=/^\+[1-9]\d{6,14}$/,pt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,mt=RegExp(`^${pt}$`);function ht(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gt(e){return RegExp(`^${ht(e)}$`)}function _t(e){let t=ht({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${pt}T(?:${r})$`)}var vt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yt=/^-?\d+$/,bt=/^-?\d+(?:\.\d+)?$/,xt=/^[^A-Z]*$/,St=/^[^a-z]*$/,L=h(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ct={number:`number`,bigint:`bigint`,object:`date`},wt=h(`$ZodCheckLessThan`,(e,t)=>{L.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tt=h(`$ZodCheckGreaterThan`,(e,t)=>{L.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Et=h(`$ZodCheckMultipleOf`,(e,t)=>{L.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):he(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dt=h(`$ZodCheckNumberFormat`,(e,t)=>{L.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=we[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ot=h(`$ZodCheckMaxLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!pe(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=j(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kt=h(`$ZodCheckMinLength`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!pe(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=j(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),At=h(`$ZodCheckLengthEquals`,(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!pe(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=j(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),R=h(`$ZodCheckStringFormat`,(e,t)=>{var n,r;L.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jt=h(`$ZodCheckRegex`,(e,t)=>{R.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mt=h(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xt,R.init(e,t)}),Nt=h(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=St,R.init(e,t)}),Pt=h(`$ZodCheckIncludes`,(e,t)=>{L.init(e,t);let n=T(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ft=h(`$ZodCheckStartsWith`,(e,t)=>{L.init(e,t);let n=RegExp(`^${T(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),It=h(`$ZodCheckEndsWith`,(e,t)=>{L.init(e,t);let n=RegExp(`.*${T(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lt=h(`$ZodCheckOverwrite`,(e,t)=>{L.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Rt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=>e,t=e=>[e,void 0],n=e=>[void 0,e],r=class{name;constructor(){this.name=this.constructor.name}},i=e=>t=>!(t instanceof e),a=e=>t=>t instanceof e,o=(e,t=process.env)=>{let n=e.safeParse(t);if(!n.success)throw Error(`Invalid environment variables: ${JSON.stringify(n.error.issues)}`);return n.data};function s(e){return new Promise(t=>setTimeout(t,e))}function c(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`})}function l(e,t){return new Date(e).toLocaleTimeString(t,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function u(e,t){return`${c(e,t)} ${l(e,t)}`}function d({allDay:e,startDate:t,startTime:n,endTime:r}){let i={startDate:new Date(new Date(t).setHours(0,0,0,0)),endDate:new Date(new Date(t).setHours(23,59,59,999))};if(e)return i;if(n){let e=new Date(t);e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i.startDate=e}if(r){let e=new Date(t);e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),i.endDate=e}return i}var f=`00000000-0000-0000-0000-000000000000`,p=/^(?:[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 ee(e){return typeof e==`string`&&p.test(e)}function te(e){if(!ee(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function ne(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var re=new Uint8Array(16);function ie(){return crypto.getRandomValues(re)}function ae(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():oe(e,t,n)}function oe(e,t,n){e||={};let r=e.random??e.rng?.()??ie();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ne(r)}var se=class e{uuid;constructor(e){te(e),this.uuid=e}toString(){return this.uuid}equals(e){return this.uuid===e.toString()}static new(){return new e(ae())}static empty(){return new e(f)}static isValid(e){return!!(e&&ee(e))}static parse(t){return t&&e.isValid(t)?new e(t):void 0}};Object.freeze({status:`aborted`});function h(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var g=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},le={};function _(e){return e&&Object.assign(le,e),le}function ue(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function de(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function fe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var pe=Symbol(`evaluating`);function x(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pe)return r===void 0&&(r=pe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function S(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function C(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function me(e){return JSON.stringify(e)}function he(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ge=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _e=v(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(w(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ve(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e}var ye=new Set([`string`,`number`,`symbol`]);function E(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function D(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function O(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Se(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return D(e,C(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function Ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return D(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function we(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function Te(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function Ee(e,t){return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function De(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return D(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function Oe(e,t,n){return D(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function k(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function A(e){return typeof e==`string`?e:e?.message}function j(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=A(e.inst?._zod.def?.error?.(e))??A(t?.error?.(e))??A(n.customError?.(e))??A(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ae(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function M(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var je=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,de,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Me=h(`$ZodError`,je),Ne=h(`$ZodError`,je,{Parent:Error});function Pe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Fe(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var Ie=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new g;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw ge(t,i?.callee),t}return o.value},Le=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw ge(t,i?.callee),t}return o.value},N=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new g;return a.issues.length?{success:!1,error:new(e??Me)(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},Re=N(Ne),P=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},ze=P(Ne),Be=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ie(e)(t,n,i)},Ve=e=>(t,n,r)=>Ie(e)(t,n,r),He=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Le(e)(t,n,i)},Ue=e=>async(t,n,r)=>Le(e)(t,n,r),We=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return N(e)(t,n,i)},Ge=e=>(t,n,r)=>N(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return P(e)(t,n,i)},qe=e=>async(t,n,r)=>P(e)(t,n,r),Je=/^[cC][^\s-]{8,}$/,Ye=/^[0-9a-z]+$/,Xe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ze=/^[0-9a-vA-V]{20}$/,Qe=/^[A-Za-z0-9]{27}$/,$e=/^[a-zA-Z0-9_-]{21}$/,et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,it=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function at(){return new RegExp(it,`u`)}var ot=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,st=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ct=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dt=/^[A-Za-z0-9_-]*$/,ft=/^\+[1-9]\d{6,14}$/,pt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,mt=RegExp(`^${pt}$`);function ht(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gt(e){return RegExp(`^${ht(e)}$`)}function _t(e){let t=ht({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${pt}T(?:${r})$`)}var vt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yt=/^-?\d+$/,bt=/^-?\d+(?:\.\d+)?$/,xt=/^[^A-Z]*$/,St=/^[^a-z]*$/,F=h(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ct={number:`number`,bigint:`bigint`,object:`date`},wt=h(`$ZodCheckLessThan`,(e,t)=>{F.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tt=h(`$ZodCheckGreaterThan`,(e,t)=>{F.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Et=h(`$ZodCheckMultipleOf`,(e,t)=>{F.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):fe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dt=h(`$ZodCheckNumberFormat`,(e,t)=>{F.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ot=h(`$ZodCheckMaxLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kt=h(`$ZodCheckMinLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),At=h(`$ZodCheckLengthEquals`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ae(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),I=h(`$ZodCheckStringFormat`,(e,t)=>{var n,r;F.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jt=h(`$ZodCheckRegex`,(e,t)=>{I.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mt=h(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xt,I.init(e,t)}),Nt=h(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=St,I.init(e,t)}),Pt=h(`$ZodCheckIncludes`,(e,t)=>{F.init(e,t);let n=E(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ft=h(`$ZodCheckStartsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`^${E(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),It=h(`$ZodCheckEndsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`.*${E(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lt=h(`$ZodCheckOverwrite`,(e,t)=>{F.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Rt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
2
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
- `))}},zt={major:4,minor:3,patch:6},z=h(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=O(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new g;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=O(e,t))});else{if(e.issues.length===t)continue;r||=O(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(O(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(e=>t(e,r,a))}return t(o,r,a)}}b(e,`~standard`,()=>({validate:t=>{try{let n=Re(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ze(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Bt=h(`$ZodString`,(e,t)=>{z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),B=h(`$ZodStringFormat`,(e,t)=>{R.init(e,t),Bt.init(e,t)}),Vt=h(`$ZodGUID`,(e,t)=>{t.pattern??=tt,B.init(e,t)}),Ht=h(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nt(e)}else t.pattern??=nt();B.init(e,t)}),Ut=h(`$ZodEmail`,(e,t)=>{t.pattern??=rt,B.init(e,t)}),Wt=h(`$ZodURL`,(e,t)=>{B.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Gt=h(`$ZodEmoji`,(e,t)=>{t.pattern??=at(),B.init(e,t)}),Kt=h(`$ZodNanoID`,(e,t)=>{t.pattern??=$e,B.init(e,t)}),qt=h(`$ZodCUID`,(e,t)=>{t.pattern??=Je,B.init(e,t)}),Jt=h(`$ZodCUID2`,(e,t)=>{t.pattern??=Ye,B.init(e,t)}),Yt=h(`$ZodULID`,(e,t)=>{t.pattern??=Xe,B.init(e,t)}),Xt=h(`$ZodXID`,(e,t)=>{t.pattern??=Ze,B.init(e,t)}),Zt=h(`$ZodKSUID`,(e,t)=>{t.pattern??=Qe,B.init(e,t)}),Qt=h(`$ZodISODateTime`,(e,t)=>{t.pattern??=_t(t),B.init(e,t)}),$t=h(`$ZodISODate`,(e,t)=>{t.pattern??=mt,B.init(e,t)}),en=h(`$ZodISOTime`,(e,t)=>{t.pattern??=gt(t),B.init(e,t)}),tn=h(`$ZodISODuration`,(e,t)=>{t.pattern??=et,B.init(e,t)}),nn=h(`$ZodIPv4`,(e,t)=>{t.pattern??=ot,B.init(e,t),e._zod.bag.format=`ipv4`}),rn=h(`$ZodIPv6`,(e,t)=>{t.pattern??=st,B.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),an=h(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ct,B.init(e,t)}),on=h(`$ZodCIDRv6`,(e,t)=>{t.pattern??=lt,B.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function sn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var cn=h(`$ZodBase64`,(e,t)=>{t.pattern??=ut,B.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{sn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ln(e){if(!dt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return sn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var un=h(`$ZodBase64URL`,(e,t)=>{t.pattern??=dt,B.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ln(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),dn=h(`$ZodE164`,(e,t)=>{t.pattern??=ft,B.init(e,t)});function fn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var pn=h(`$ZodJWT`,(e,t)=>{B.init(e,t),e._zod.check=n=>{fn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),mn=h(`$ZodNumber`,(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),hn=h(`$ZodNumberFormat`,(e,t)=>{Dt.init(e,t),mn.init(e,t)}),gn=h(`$ZodUnknown`,(e,t)=>{z.init(e,t),e._zod.parse=e=>e}),_n=h(`$ZodNever`,(e,t)=>{z.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),vn=h(`$ZodVoid`,(e,t)=>{z.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function yn(e,t,n){e.issues.length&&t.issues.push(...Me(n,e.issues)),t.value[n]=e.value}var bn=h(`$ZodArray`,(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>yn(t,n,e))):yn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function V(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Me(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function xn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ce(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Sn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>V(e,n,i,t,u))):V(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Cn=h(`$ZodObject`,(e,t)=>{if(z.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=fe(()=>xn(t));b(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=C,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>V(n,t,e,s,r))):V(i,t,e,s,r)}return i?Sn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),wn=h(`$ZodObjectJIT`,(e,t)=>{Cn.init(e,t);let n=e._zod.parse,r=fe(()=>xn(t)),i=e=>{let t=new Rt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=_e(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=_e(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
3
+ `))}},zt={major:4,minor:3,patch:6},L=h(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=k(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new g;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=k(e,t))});else{if(e.issues.length===t)continue;r||=k(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(k(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(e=>t(e,r,a))}return t(o,r,a)}}x(e,`~standard`,()=>({validate:t=>{try{let n=Re(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ze(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),R=h(`$ZodString`,(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=h(`$ZodStringFormat`,(e,t)=>{I.init(e,t),R.init(e,t)}),Bt=h(`$ZodGUID`,(e,t)=>{t.pattern??=tt,z.init(e,t)}),Vt=h(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nt(e)}else t.pattern??=nt();z.init(e,t)}),Ht=h(`$ZodEmail`,(e,t)=>{t.pattern??=rt,z.init(e,t)}),Ut=h(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Wt=h(`$ZodEmoji`,(e,t)=>{t.pattern??=at(),z.init(e,t)}),Gt=h(`$ZodNanoID`,(e,t)=>{t.pattern??=$e,z.init(e,t)}),Kt=h(`$ZodCUID`,(e,t)=>{t.pattern??=Je,z.init(e,t)}),qt=h(`$ZodCUID2`,(e,t)=>{t.pattern??=Ye,z.init(e,t)}),Jt=h(`$ZodULID`,(e,t)=>{t.pattern??=Xe,z.init(e,t)}),Yt=h(`$ZodXID`,(e,t)=>{t.pattern??=Ze,z.init(e,t)}),Xt=h(`$ZodKSUID`,(e,t)=>{t.pattern??=Qe,z.init(e,t)}),Zt=h(`$ZodISODateTime`,(e,t)=>{t.pattern??=_t(t),z.init(e,t)}),Qt=h(`$ZodISODate`,(e,t)=>{t.pattern??=mt,z.init(e,t)}),$t=h(`$ZodISOTime`,(e,t)=>{t.pattern??=gt(t),z.init(e,t)}),en=h(`$ZodISODuration`,(e,t)=>{t.pattern??=et,z.init(e,t)}),tn=h(`$ZodIPv4`,(e,t)=>{t.pattern??=ot,z.init(e,t),e._zod.bag.format=`ipv4`}),nn=h(`$ZodIPv6`,(e,t)=>{t.pattern??=st,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),rn=h(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ct,z.init(e,t)}),an=h(`$ZodCIDRv6`,(e,t)=>{t.pattern??=lt,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function on(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var sn=h(`$ZodBase64`,(e,t)=>{t.pattern??=ut,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{on(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function cn(e){if(!dt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return on(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ln=h(`$ZodBase64URL`,(e,t)=>{t.pattern??=dt,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{cn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),un=h(`$ZodE164`,(e,t)=>{t.pattern??=ft,z.init(e,t)});function dn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var fn=h(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{dn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),pn=h(`$ZodNumber`,(e,t)=>{L.init(e,t),e._zod.pattern=e._zod.bag.pattern??bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mn=h(`$ZodNumberFormat`,(e,t)=>{Dt.init(e,t),pn.init(e,t)}),hn=h(`$ZodUnknown`,(e,t)=>{L.init(e,t),e._zod.parse=e=>e}),gn=h(`$ZodNever`,(e,t)=>{L.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),_n=h(`$ZodVoid`,(e,t)=>{L.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function vn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}var yn=h(`$ZodArray`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>vn(t,n,e))):vn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ke(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=be(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u))):B(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Sn=h(`$ZodObject`,(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=v(()=>bn(t));x(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=w,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>B(n,t,e,s,r))):B(i,t,e,s,r)}return i?xn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cn=h(`$ZodObjectJIT`,(e,t)=>{Sn.init(e,t);let n=e._zod.parse,r=v(()=>bn(t)),i=e=>{let t=new Rt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=me(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=me(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
4
4
  if (${n}.issues.length) {
5
5
  if (${o} in input) {
6
6
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -34,6 +34,6 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=
34
34
  newResult[${o}] = ${n}.value;
35
35
  }
36
36
 
37
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=C,s=!_.jitless,c=s&&be.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Sn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Tn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!O(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>A(e,r,v())))}),t)}var En=h(`$ZodUnion`,(e,t)=>{z.init(e,t),b(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),b(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),b(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>me(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Tn(t,i,e,a)):Tn(s,i,e,a)}}),Dn=h(`$ZodIntersection`,(e,t)=>{z.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>kn(e,t,n)):kn(e,i,a)}});function On(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(w(e)&&w(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=On(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=On(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),O(e))return e;let o=On(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var An=h(`$ZodEnum`,(e,t)=>{z.init(e,t);let n=de(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Se.has(typeof e)).map(e=>typeof e==`string`?T(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jn=h(`$ZodTransform`,(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ue(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new g;return n.value=i,n}});function Mn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Nn=h(`$ZodOptional`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${me(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Mn(t,e.value)):Mn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Pn=h(`$ZodExactOptional`,(e,t)=>{Nn.init(e,t),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Fn=h(`$ZodNullable`,(e,t)=>{z.init(e,t),b(e._zod,`optin`,()=>t.innerType._zod.optin),b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${me(e.source)}|null)$`):void 0}),b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),In=h(`$ZodDefault`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ln(e,t)):Ln(r,t)}});function Ln(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Rn=h(`$ZodPrefault`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),zn=h(`$ZodNonOptional`,(e,t)=>{z.init(e,t),b(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Bn(t,e)):Bn(i,e)}});function Bn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Vn=h(`$ZodCatch`,(e,t)=>{z.init(e,t),b(e._zod,`optin`,()=>t.innerType._zod.optin),b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,v()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,v()))},input:e.value}),e.issues=[]),e)}}),Hn=h(`$ZodPipe`,(e,t)=>{z.init(e,t),b(e._zod,`values`,()=>t.in._zod.values),b(e._zod,`optin`,()=>t.in._zod.optin),b(e._zod,`optout`,()=>t.out._zod.optout),b(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Un=h(`$ZodReadonly`,(e,t)=>{z.init(e,t),b(e._zod,`propValues`,()=>t.innerType._zod.propValues),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`optin`,()=>t.innerType?._zod?.optin),b(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wn):Wn(r)}});function Wn(e){return e.value=Object.freeze(e.value),e}var Gn=h(`$ZodCustom`,(e,t)=>{L.init(e,t),z.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Kn(t,n,r,e));Kn(i,n,r,e)}});function Kn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(M(e))}}var qn,Jn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Yn(){return new Jn}(qn=globalThis).__zod_globalRegistry??(qn.__zod_globalRegistry=Yn());var U=globalThis.__zod_globalRegistry;function Xn(e,t){return new e({type:`string`,...D(t)})}function Zn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function Qn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function $n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function tr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function rr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function ir(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function ar(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function or(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function sr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function cr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function lr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function ur(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function dr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function fr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function pr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function mr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function hr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function gr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function _r(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function vr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function yr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function br(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function xr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function Sr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Cr(e,t){return new e({type:`number`,checks:[],...D(t)})}function wr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Tr(e){return new e({type:`unknown`})}function Er(e,t){return new e({type:`never`,...D(t)})}function Dr(e,t){return new e({type:`void`,...D(t)})}function Or(e,t){return new wt({check:`less_than`,...D(t),value:e,inclusive:!1})}function kr(e,t){return new wt({check:`less_than`,...D(t),value:e,inclusive:!0})}function Ar(e,t){return new Tt({check:`greater_than`,...D(t),value:e,inclusive:!1})}function jr(e,t){return new Tt({check:`greater_than`,...D(t),value:e,inclusive:!0})}function Mr(e,t){return new Et({check:`multiple_of`,...D(t),value:e})}function Nr(e,t){return new Ot({check:`max_length`,...D(t),maximum:e})}function W(e,t){return new kt({check:`min_length`,...D(t),minimum:e})}function Pr(e,t){return new At({check:`length_equals`,...D(t),length:e})}function Fr(e,t){return new jt({check:`string_format`,format:`regex`,...D(t),pattern:e})}function Ir(e){return new Mt({check:`string_format`,format:`lowercase`,...D(e)})}function Lr(e){return new Nt({check:`string_format`,format:`uppercase`,...D(e)})}function Rr(e,t){return new Pt({check:`string_format`,format:`includes`,...D(t),includes:e})}function zr(e,t){return new Ft({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function Br(e,t){return new It({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function G(e){return new Lt({check:`overwrite`,tx:e})}function Vr(e){return G(t=>t.normalize(e))}function Hr(){return G(e=>e.trim())}function Ur(){return G(e=>e.toLowerCase())}function Wr(){return G(e=>e.toUpperCase())}function Gr(){return G(e=>ve(e))}function Kr(e,t,n){return new e({type:`array`,element:t,...D(n)})}function qr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function Jr(e){let t=Yr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(M(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(M(r))}},e(n.value,n)));return t}function Yr(e,t){let n=new L({check:`custom`,...D(t)});return n._zod.check=e,n}function Xr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??U,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function K(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,K(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&q(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Zr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
37
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=w,s=!le.jitless,c=s&&_e.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!k(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>j(e,r,_())))}),t)}var Tn=h(`$ZodUnion`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),x(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),x(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),x(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>b(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>wn(t,i,e,a)):wn(s,i,e,a)}}),En=h(`$ZodIntersection`,(e,t)=>{L.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Dn(e,t,n)):Dn(e,i,a)}});function V(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(T(e)&&T(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=V(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=V(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),k(e))return e;let o=V(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var On=h(`$ZodEnum`,(e,t)=>{L.init(e,t);let n=ue(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ye.has(typeof e)).map(e=>typeof e==`string`?E(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),kn=h(`$ZodTransform`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new g;return n.value=i,n}});function An(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var jn=h(`$ZodOptional`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${b(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>An(t,e.value)):An(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Mn=h(`$ZodExactOptional`,(e,t)=>{jn.init(e,t),x(e._zod,`values`,()=>t.innerType._zod.values),x(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nn=h(`$ZodNullable`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${b(e.source)}|null)$`):void 0}),x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pn=h(`$ZodDefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fn(e,t)):Fn(r,t)}});function Fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var In=h(`$ZodPrefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ln=h(`$ZodNonOptional`,(e,t)=>{L.init(e,t),x(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}});function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var zn=h(`$ZodCatch`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[]),e)}}),Bn=h(`$ZodPipe`,(e,t)=>{L.init(e,t),x(e._zod,`values`,()=>t.in._zod.values),x(e._zod,`optin`,()=>t.in._zod.optin),x(e._zod,`optout`,()=>t.out._zod.optout),x(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Vn=h(`$ZodReadonly`,(e,t)=>{L.init(e,t),x(e._zod,`propValues`,()=>t.innerType._zod.propValues),x(e._zod,`values`,()=>t.innerType._zod.values),x(e._zod,`optin`,()=>t.innerType?._zod?.optin),x(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Hn):Hn(r)}});function Hn(e){return e.value=Object.freeze(e.value),e}var Un=h(`$ZodCustom`,(e,t)=>{F.init(e,t),L.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wn(t,n,r,e));Wn(i,n,r,e)}});function Wn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(M(e))}}var Gn,Kn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function qn(){return new Kn}(Gn=globalThis).__zod_globalRegistry??(Gn.__zod_globalRegistry=qn());var U=globalThis.__zod_globalRegistry;function Jn(e,t){return new e({type:`string`,...O(t)})}function Yn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...O(t)})}function Xn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...O(t)})}function Zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...O(t)})}function Qn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...O(t)})}function $n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...O(t)})}function er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...O(t)})}function tr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...O(t)})}function nr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...O(t)})}function rr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...O(t)})}function ir(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...O(t)})}function ar(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...O(t)})}function or(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...O(t)})}function sr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...O(t)})}function cr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...O(t)})}function lr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...O(t)})}function ur(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...O(t)})}function dr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...O(t)})}function fr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...O(t)})}function pr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...O(t)})}function mr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...O(t)})}function hr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...O(t)})}function gr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...O(t)})}function _r(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...O(t)})}function vr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...O(t)})}function yr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...O(t)})}function br(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...O(t)})}function xr(e,t){return new e({type:`number`,checks:[],...O(t)})}function Sr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...O(t)})}function Cr(e){return new e({type:`unknown`})}function wr(e,t){return new e({type:`never`,...O(t)})}function Tr(e,t){return new e({type:`void`,...O(t)})}function Er(e,t){return new wt({check:`less_than`,...O(t),value:e,inclusive:!1})}function Dr(e,t){return new wt({check:`less_than`,...O(t),value:e,inclusive:!0})}function Or(e,t){return new Tt({check:`greater_than`,...O(t),value:e,inclusive:!1})}function kr(e,t){return new Tt({check:`greater_than`,...O(t),value:e,inclusive:!0})}function Ar(e,t){return new Et({check:`multiple_of`,...O(t),value:e})}function jr(e,t){return new Ot({check:`max_length`,...O(t),maximum:e})}function W(e,t){return new kt({check:`min_length`,...O(t),minimum:e})}function Mr(e,t){return new At({check:`length_equals`,...O(t),length:e})}function Nr(e,t){return new jt({check:`string_format`,format:`regex`,...O(t),pattern:e})}function Pr(e){return new Mt({check:`string_format`,format:`lowercase`,...O(e)})}function Fr(e){return new Nt({check:`string_format`,format:`uppercase`,...O(e)})}function Ir(e,t){return new Pt({check:`string_format`,format:`includes`,...O(t),includes:e})}function Lr(e,t){return new Ft({check:`string_format`,format:`starts_with`,...O(t),prefix:e})}function Rr(e,t){return new It({check:`string_format`,format:`ends_with`,...O(t),suffix:e})}function G(e){return new Lt({check:`overwrite`,tx:e})}function zr(e){return G(t=>t.normalize(e))}function Br(){return G(e=>e.trim())}function Vr(){return G(e=>e.toLowerCase())}function Hr(){return G(e=>e.toUpperCase())}function Ur(){return G(e=>he(e))}function Wr(e,t,n){return new e({type:`array`,element:t,...O(n)})}function Gr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...O(n)})}function Kr(e){let t=qr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(M(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(M(r))}},e(n.value,n)));return t}function qr(e,t){let n=new F({check:`custom`,...O(t)});return n._zod.check=e,n}function Jr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??U,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function K(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,K(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&q(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Yr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
38
38
 
39
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Qr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:J(t,`input`,e.processors),output:J(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function q(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return q(r.element,n);if(r.type===`set`)return q(r.valueType,n);if(r.type===`lazy`)return q(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return q(r.innerType,n);if(r.type===`intersection`)return q(r.left,n)||q(r.right,n);if(r.type===`record`||r.type===`map`)return q(r.keyType,n)||q(r.valueType,n);if(r.type===`pipe`)return q(r.in,n)||q(r.out,n);if(r.type===`object`){for(let e in r.shape)if(q(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(q(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(q(e,n))return!0;return!!(r.rest&&q(r.rest,n))}return!1}var $r=(e,t={})=>n=>{let r=Xr({...n,processors:t});return K(e,r),Zr(r,e),Qr(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Xr({...i??{},target:a,io:t,processors:n});return K(e,o),Zr(o,e),Qr(o,e)},ei={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ti=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ei[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ni=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},ri=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ii=(e,t,n,r)=>{n.not={}},ai=(e,t,n,r)=>{let i=e._zod.def,a=de(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},oi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ci=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=K(a.element,t,{...r,path:[...r.path,`items`]})},li=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=K(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=K(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ui=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>K(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},di=(e,t,n,r)=>{let i=e._zod.def,a=K(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=K(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},fi=(e,t,n,r)=>{let i=e._zod.def,a=K(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},pi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},hi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},gi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},_i=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;K(a,t,r);let o=t.seen.get(e);o.ref=a},vi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},yi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=h(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),Z.init(e,t)});function xi(e){return yr(bi,e)}var Si=h(`ZodISODate`,(e,t)=>{$t.init(e,t),Z.init(e,t)});function Ci(e){return br(Si,e)}var wi=h(`ZodISOTime`,(e,t)=>{en.init(e,t),Z.init(e,t)});function Ti(e){return xr(wi,e)}var Ei=h(`ZodISODuration`,(e,t)=>{tn.init(e,t),Z.init(e,t)});function Di(e){return Sr(Ei,e)}var Oi=(e,t)=>{Pe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Le(e,t)},flatten:{value:t=>Ie(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,y,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,y,2)}},isEmpty:{get(){return e.issues.length===0}}})};h(`ZodError`,Oi);var Y=h(`ZodError`,Oi,{Parent:Error}),ki=N(Y),Ai=P(Y),ji=F(Y),Mi=I(Y),Ni=Be(Y),Pi=Ve(Y),Fi=He(Y),Ii=Ue(Y),Li=We(Y),Ri=Ge(Y),zi=Ke(Y),Bi=qe(Y),X=h(`ZodType`,(e,t)=>(z.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:J(e,`input`),output:J(e,`output`)}}),e.toJSONSchema=$r(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(S(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>E(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>ki(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ji(e,t,n),e.parseAsync=async(t,n)=>Ai(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Mi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ni(e,t,n),e.decode=(t,n)=>Pi(e,t,n),e.encodeAsync=async(t,n)=>Fi(e,t,n),e.decodeAsync=async(t,n)=>Ii(e,t,n),e.safeEncode=(t,n)=>Li(e,t,n),e.safeDecode=(t,n)=>Ri(e,t,n),e.safeEncodeAsync=async(t,n)=>zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Bi(e,t,n),e.refine=(t,n)=>e.check(Ja(t,n)),e.superRefine=t=>e.check(Ya(t)),e.overwrite=t=>e.check(G(t)),e.optional=()=>Aa(e),e.exactOptional=()=>Ma(e),e.nullable=()=>Pa(e),e.nullish=()=>Aa(Pa(e)),e.nonoptional=t=>Ba(e,t),e.array=()=>va(e),e.or=t=>Sa([e,t]),e.and=t=>wa(e,t),e.transform=t=>Wa(e,Oa(t)),e.default=t=>Ia(e,t),e.prefault=t=>Ra(e,t),e.catch=t=>Ha(e,t),e.pipe=t=>Wa(e,t),e.readonly=()=>Ka(e),e.describe=t=>{let n=e.clone();return U.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return U.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return U.get(e);let n=e.clone();return U.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Vi=h(`_ZodString`,(e,t)=>{Bt.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Fr(...t)),e.includes=(...t)=>e.check(Rr(...t)),e.startsWith=(...t)=>e.check(zr(...t)),e.endsWith=(...t)=>e.check(Br(...t)),e.min=(...t)=>e.check(W(...t)),e.max=(...t)=>e.check(Nr(...t)),e.length=(...t)=>e.check(Pr(...t)),e.nonempty=(...t)=>e.check(W(1,...t)),e.lowercase=t=>e.check(Ir(t)),e.uppercase=t=>e.check(Lr(t)),e.trim=()=>e.check(Hr()),e.normalize=(...t)=>e.check(Vr(...t)),e.toLowerCase=()=>e.check(Ur()),e.toUpperCase=()=>e.check(Wr()),e.slugify=()=>e.check(Gr())}),Hi=h(`ZodString`,(e,t)=>{Bt.init(e,t),Vi.init(e,t),e.email=t=>e.check(Zn(Wi,t)),e.url=t=>e.check(rr(Ki,t)),e.jwt=t=>e.check(vr(sa,t)),e.emoji=t=>e.check(ir(qi,t)),e.guid=t=>e.check(Qn(Gi,t)),e.uuid=t=>e.check($n(Q,t)),e.uuidv4=t=>e.check(er(Q,t)),e.uuidv6=t=>e.check(tr(Q,t)),e.uuidv7=t=>e.check(nr(Q,t)),e.nanoid=t=>e.check(ar(Ji,t)),e.guid=t=>e.check(Qn(Gi,t)),e.cuid=t=>e.check(or(Yi,t)),e.cuid2=t=>e.check(sr(Xi,t)),e.ulid=t=>e.check(cr(Zi,t)),e.base64=t=>e.check(hr(ia,t)),e.base64url=t=>e.check(gr(aa,t)),e.xid=t=>e.check(lr(Qi,t)),e.ksuid=t=>e.check(ur($i,t)),e.ipv4=t=>e.check(dr(ea,t)),e.ipv6=t=>e.check(fr(ta,t)),e.cidrv4=t=>e.check(pr(na,t)),e.cidrv6=t=>e.check(mr(ra,t)),e.e164=t=>e.check(_r(oa,t)),e.datetime=t=>e.check(xi(t)),e.date=t=>e.check(Ci(t)),e.time=t=>e.check(Ti(t)),e.duration=t=>e.check(Di(t))});function Ui(e){return Xn(Hi,e)}var Z=h(`ZodStringFormat`,(e,t)=>{B.init(e,t),Vi.init(e,t)}),Wi=h(`ZodEmail`,(e,t)=>{Ut.init(e,t),Z.init(e,t)}),Gi=h(`ZodGUID`,(e,t)=>{Vt.init(e,t),Z.init(e,t)}),Q=h(`ZodUUID`,(e,t)=>{Ht.init(e,t),Z.init(e,t)}),Ki=h(`ZodURL`,(e,t)=>{Wt.init(e,t),Z.init(e,t)}),qi=h(`ZodEmoji`,(e,t)=>{Gt.init(e,t),Z.init(e,t)}),Ji=h(`ZodNanoID`,(e,t)=>{Kt.init(e,t),Z.init(e,t)}),Yi=h(`ZodCUID`,(e,t)=>{qt.init(e,t),Z.init(e,t)}),Xi=h(`ZodCUID2`,(e,t)=>{Jt.init(e,t),Z.init(e,t)}),Zi=h(`ZodULID`,(e,t)=>{Yt.init(e,t),Z.init(e,t)}),Qi=h(`ZodXID`,(e,t)=>{Xt.init(e,t),Z.init(e,t)}),$i=h(`ZodKSUID`,(e,t)=>{Zt.init(e,t),Z.init(e,t)}),ea=h(`ZodIPv4`,(e,t)=>{nn.init(e,t),Z.init(e,t)}),ta=h(`ZodIPv6`,(e,t)=>{rn.init(e,t),Z.init(e,t)}),na=h(`ZodCIDRv4`,(e,t)=>{an.init(e,t),Z.init(e,t)}),ra=h(`ZodCIDRv6`,(e,t)=>{on.init(e,t),Z.init(e,t)}),ia=h(`ZodBase64`,(e,t)=>{cn.init(e,t),Z.init(e,t)}),aa=h(`ZodBase64URL`,(e,t)=>{un.init(e,t),Z.init(e,t)}),oa=h(`ZodE164`,(e,t)=>{dn.init(e,t),Z.init(e,t)}),sa=h(`ZodJWT`,(e,t)=>{pn.init(e,t),Z.init(e,t)}),ca=h(`ZodNumber`,(e,t)=>{mn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.gt=(t,n)=>e.check(Ar(t,n)),e.gte=(t,n)=>e.check(jr(t,n)),e.min=(t,n)=>e.check(jr(t,n)),e.lt=(t,n)=>e.check(Or(t,n)),e.lte=(t,n)=>e.check(kr(t,n)),e.max=(t,n)=>e.check(kr(t,n)),e.int=t=>e.check(ua(t)),e.safe=t=>e.check(ua(t)),e.positive=t=>e.check(Ar(0,t)),e.nonnegative=t=>e.check(jr(0,t)),e.negative=t=>e.check(Or(0,t)),e.nonpositive=t=>e.check(kr(0,t)),e.multipleOf=(t,n)=>e.check(Mr(t,n)),e.step=(t,n)=>e.check(Mr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $(e){return Cr(ca,e)}var la=h(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),ca.init(e,t)});function ua(e){return wr(la,e)}var da=h(`ZodUnknown`,(e,t)=>{gn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fa(){return Tr(da)}var pa=h(`ZodNever`,(e,t)=>{_n.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r)});function ma(e){return Er(pa,e)}var ha=h(`ZodVoid`,(e,t)=>{vn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r)});function ga(e){return Dr(ha,e)}var _a=h(`ZodArray`,(e,t)=>{bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(W(t,n)),e.nonempty=t=>e.check(W(1,t)),e.max=(t,n)=>e.check(Nr(t,n)),e.length=(t,n)=>e.check(Pr(t,n)),e.unwrap=()=>e.element});function va(e,t){return Kr(_a,e,t)}var ya=h(`ZodObject`,(e,t)=>{wn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),b(e,`shape`,()=>t.shape),e.keyof=()=>Ea(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fa()}),e.loose=()=>e.clone({...e._zod.def,catchall:fa()}),e.strict=()=>e.clone({...e._zod.def,catchall:ma()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>De(e,t),e.safeExtend=t=>Oe(e,t),e.merge=t=>ke(e,t),e.pick=t=>Te(e,t),e.omit=t=>Ee(e,t),e.partial=(...t)=>Ae(ka,e,t[0]),e.required=(...t)=>je(za,e,t[0])});function ba(e,t){return new ya({type:`object`,shape:e??{},...D(t)})}var xa=h(`ZodUnion`,(e,t)=>{En.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.options=t.options});function Sa(e,t){return new xa({type:`union`,options:e,...D(t)})}var Ca=h(`ZodIntersection`,(e,t)=>{Dn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function wa(e,t){return new Ca({type:`intersection`,left:e,right:t})}var Ta=h(`ZodEnum`,(e,t)=>{An.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ta({...t,checks:[],...D(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ta({...t,checks:[],...D(r),entries:i})}});function Ea(e,t){return new Ta({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}var Da=h(`ZodTransform`,(e,t)=>{jn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ue(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Oa(e){return new Da({type:`transform`,transform:e})}var ka=h(`ZodOptional`,(e,t)=>{Nn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Aa(e){return new ka({type:`optional`,innerType:e})}var ja=h(`ZodExactOptional`,(e,t)=>{Pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ma(e){return new ja({type:`optional`,innerType:e})}var Na=h(`ZodNullable`,(e,t)=>{Fn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pa(e){return new Na({type:`nullable`,innerType:e})}var Fa=h(`ZodDefault`,(e,t)=>{In.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ia(e,t){return new Fa({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}var La=h(`ZodPrefault`,(e,t)=>{Rn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ra(e,t){return new La({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}var za=h(`ZodNonOptional`,(e,t)=>{zn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ba(e,t){return new za({type:`nonoptional`,innerType:e,...D(t)})}var Va=h(`ZodCatch`,(e,t)=>{Vn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ha(e,t){return new Va({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ua=h(`ZodPipe`,(e,t)=>{Hn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.in=t.in,e.out=t.out});function Wa(e,t){return new Ua({type:`pipe`,in:e,out:t})}var Ga=h(`ZodReadonly`,(e,t)=>{Un.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ka(e){return new Ga({type:`readonly`,innerType:e})}var qa=h(`ZodCustom`,(e,t)=>{Gn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r)});function Ja(e,t={}){return qr(qa,e,t)}function Ya(e){return Jr(e)}var Xa=e=>ba({pages:$(),nextPage:$().optional(),totalElements:$(),currentPage:$(),pageSize:$(),elements:va(e)});function Za(){return{pages:0,nextPage:void 0,totalElements:0,currentPage:0,pageSize:0,elements:[]}}var Qa=Sa([$(),Ui()]).optional().transform(e=>e===void 0||e===``?void 0:Number(e)).refine(e=>e===void 0||!Number.isNaN(e),{message:`Must be a valid number`}),$a=ba({page:Qa,pageSize:Qa}),eo=class extends r{constructor(e){super(),this.error=e}},to=class extends r{constructor(e){super(),this.error=e}},no=class extends r{constructor(){super()}},ro=class{constructor(e){this.baseUrl=e}async fetch(e,r,i,a={}){try{let o=await this.mergeHeaders(a.headers),s=await fetch(`${this.baseUrl}${e}`,{...a,headers:o});if(s.status===409)return n(new eo({status:s.status,statusText:s.statusText,body:await s.json().catch(()=>s.text())}));if(s.status===404)return n(new no);if(!s.ok)return n(new i({error:await s.json().catch(()=>({message:s.statusText})),metadata:{status:s.status,statusText:s.statusText}}));let c=(await s.text()).trim(),l=s.status===204?void 0:c?JSON.parse(c):void 0,u=r.safeParse(l);return u.success?t(u.data):n(new i(Error(`Invalid response body`),l))}catch(e){return n(new to(e))}}async fetchBlob(e,r,i={}){try{let a=await this.mergeHeaders(i.headers),o=await fetch(`${this.baseUrl}${e}`,{...i,headers:a});return o.status===404?n(new no):o.ok?t(await o.blob()):n(new r(await o.json().catch(()=>({message:o.statusText})),{status:o.status,statusText:o.statusText}))}catch(e){return n(new to(e))}}async mergeHeaders(e){let t=new Headers([...await this.getHeaders()]);return new Headers(e).forEach((e,n)=>t.set(n,e)),t}},io=ga(),ao=/^(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*\.[A-Za-z]{2,63}$/i;function oo(e){let t=e?.message??`Please enter a valid domain`;return Ui().min(3,{message:t}).max(253).refine(e=>ao.test(e),{message:t})}exports.EmptyPage=Za,exports.EmptyResponse=io,exports.Fail=n,exports.Failure=r,exports.Guid=le,exports.HttpSafeClient=ro,exports.NetworkConflictFailure=eo,exports.NetworkFailure=to,exports.NotFoundFailure=no,exports.Ok=t,exports.PageQuery=$a,exports.SafeDomain=oo,exports.convertDateInfoToDateRange=d,exports.createPageSchema=Xa,exports.formatDate=c,exports.formatDateTime=u,exports.formatTime=l,exports.isFailure=a,exports.mock=e,exports.notFailure=i,exports.parseConfig=o,exports.sleep=s;
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Xr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:J(t,`input`,e.processors),output:J(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function q(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return q(r.element,n);if(r.type===`set`)return q(r.valueType,n);if(r.type===`lazy`)return q(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return q(r.innerType,n);if(r.type===`intersection`)return q(r.left,n)||q(r.right,n);if(r.type===`record`||r.type===`map`)return q(r.keyType,n)||q(r.valueType,n);if(r.type===`pipe`)return q(r.in,n)||q(r.out,n);if(r.type===`object`){for(let e in r.shape)if(q(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(q(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(q(e,n))return!0;return!!(r.rest&&q(r.rest,n))}return!1}var Zr=(e,t={})=>n=>{let r=Jr({...n,processors:t});return K(e,r),Yr(r,e),Xr(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Jr({...i??{},target:a,io:t,processors:n});return K(e,o),Yr(o,e),Xr(o,e)},Qr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},$r=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Qr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ei=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},ti=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ni=(e,t,n,r)=>{n.not={}},ri=(e,t,n,r)=>{let i=e._zod.def,a=ue(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ii=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},oi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=K(a.element,t,{...r,path:[...r.path,`items`]})},si=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=K(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=K(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ci=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>K(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},li=(e,t,n,r)=>{let i=e._zod.def,a=K(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=K(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ui=(e,t,n,r)=>{let i=e._zod.def,a=K(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},di=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},pi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},mi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},hi=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;K(a,t,r);let o=t.seen.get(e);o.ref=a},gi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_i=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vi=h(`ZodISODateTime`,(e,t)=>{Zt.init(e,t),Z.init(e,t)});function yi(e){return _r(vi,e)}var bi=h(`ZodISODate`,(e,t)=>{Qt.init(e,t),Z.init(e,t)});function xi(e){return vr(bi,e)}var Si=h(`ZodISOTime`,(e,t)=>{$t.init(e,t),Z.init(e,t)});function Ci(e){return yr(Si,e)}var wi=h(`ZodISODuration`,(e,t)=>{en.init(e,t),Z.init(e,t)});function Ti(e){return br(wi,e)}var Ei=(e,t)=>{Me.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Fe(e,t)},flatten:{value:t=>Pe(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}},isEmpty:{get(){return e.issues.length===0}}})};h(`ZodError`,Ei);var Y=h(`ZodError`,Ei,{Parent:Error}),Di=Ie(Y),Oi=Le(Y),ki=N(Y),Ai=P(Y),ji=Be(Y),Mi=Ve(Y),Ni=He(Y),Pi=Ue(Y),Fi=We(Y),Ii=Ge(Y),Li=Ke(Y),Ri=qe(Y),X=h(`ZodType`,(e,t)=>(L.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:J(e,`input`),output:J(e,`output`)}}),e.toJSONSchema=Zr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(C(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>D(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Di(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ki(e,t,n),e.parseAsync=async(t,n)=>Oi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ai(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ji(e,t,n),e.decode=(t,n)=>Mi(e,t,n),e.encodeAsync=async(t,n)=>Ni(e,t,n),e.decodeAsync=async(t,n)=>Pi(e,t,n),e.safeEncode=(t,n)=>Fi(e,t,n),e.safeDecode=(t,n)=>Ii(e,t,n),e.safeEncodeAsync=async(t,n)=>Li(e,t,n),e.safeDecodeAsync=async(t,n)=>Ri(e,t,n),e.refine=(t,n)=>e.check(Ka(t,n)),e.superRefine=t=>e.check(qa(t)),e.overwrite=t=>e.check(G(t)),e.optional=()=>Oa(e),e.exactOptional=()=>Aa(e),e.nullable=()=>Ma(e),e.nullish=()=>Oa(Ma(e)),e.nonoptional=t=>Ra(e,t),e.array=()=>ga(e),e.or=t=>ba([e,t]),e.and=t=>Sa(e,t),e.transform=t=>Ha(e,Ea(t)),e.default=t=>Pa(e,t),e.prefault=t=>Ia(e,t),e.catch=t=>Ba(e,t),e.pipe=t=>Ha(e,t),e.readonly=()=>Wa(e),e.describe=t=>{let n=e.clone();return U.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return U.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return U.get(e);let n=e.clone();return U.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zi=h(`_ZodString`,(e,t)=>{R.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Nr(...t)),e.includes=(...t)=>e.check(Ir(...t)),e.startsWith=(...t)=>e.check(Lr(...t)),e.endsWith=(...t)=>e.check(Rr(...t)),e.min=(...t)=>e.check(W(...t)),e.max=(...t)=>e.check(jr(...t)),e.length=(...t)=>e.check(Mr(...t)),e.nonempty=(...t)=>e.check(W(1,...t)),e.lowercase=t=>e.check(Pr(t)),e.uppercase=t=>e.check(Fr(t)),e.trim=()=>e.check(Br()),e.normalize=(...t)=>e.check(zr(...t)),e.toLowerCase=()=>e.check(Vr()),e.toUpperCase=()=>e.check(Hr()),e.slugify=()=>e.check(Ur())}),Bi=h(`ZodString`,(e,t)=>{R.init(e,t),zi.init(e,t),e.email=t=>e.check(Yn(Hi,t)),e.url=t=>e.check(tr(Wi,t)),e.jwt=t=>e.check(gr(aa,t)),e.emoji=t=>e.check(nr(Gi,t)),e.guid=t=>e.check(Xn(Ui,t)),e.uuid=t=>e.check(Zn(Q,t)),e.uuidv4=t=>e.check(Qn(Q,t)),e.uuidv6=t=>e.check($n(Q,t)),e.uuidv7=t=>e.check(er(Q,t)),e.nanoid=t=>e.check(rr(Ki,t)),e.guid=t=>e.check(Xn(Ui,t)),e.cuid=t=>e.check(ir(qi,t)),e.cuid2=t=>e.check(ar(Ji,t)),e.ulid=t=>e.check(or(Yi,t)),e.base64=t=>e.check(pr(na,t)),e.base64url=t=>e.check(mr(ra,t)),e.xid=t=>e.check(sr(Xi,t)),e.ksuid=t=>e.check(cr(Zi,t)),e.ipv4=t=>e.check(lr(Qi,t)),e.ipv6=t=>e.check(ur($i,t)),e.cidrv4=t=>e.check(dr(ea,t)),e.cidrv6=t=>e.check(fr(ta,t)),e.e164=t=>e.check(hr(ia,t)),e.datetime=t=>e.check(yi(t)),e.date=t=>e.check(xi(t)),e.time=t=>e.check(Ci(t)),e.duration=t=>e.check(Ti(t))});function Vi(e){return Jn(Bi,e)}var Z=h(`ZodStringFormat`,(e,t)=>{z.init(e,t),zi.init(e,t)}),Hi=h(`ZodEmail`,(e,t)=>{Ht.init(e,t),Z.init(e,t)}),Ui=h(`ZodGUID`,(e,t)=>{Bt.init(e,t),Z.init(e,t)}),Q=h(`ZodUUID`,(e,t)=>{Vt.init(e,t),Z.init(e,t)}),Wi=h(`ZodURL`,(e,t)=>{Ut.init(e,t),Z.init(e,t)}),Gi=h(`ZodEmoji`,(e,t)=>{Wt.init(e,t),Z.init(e,t)}),Ki=h(`ZodNanoID`,(e,t)=>{Gt.init(e,t),Z.init(e,t)}),qi=h(`ZodCUID`,(e,t)=>{Kt.init(e,t),Z.init(e,t)}),Ji=h(`ZodCUID2`,(e,t)=>{qt.init(e,t),Z.init(e,t)}),Yi=h(`ZodULID`,(e,t)=>{Jt.init(e,t),Z.init(e,t)}),Xi=h(`ZodXID`,(e,t)=>{Yt.init(e,t),Z.init(e,t)}),Zi=h(`ZodKSUID`,(e,t)=>{Xt.init(e,t),Z.init(e,t)}),Qi=h(`ZodIPv4`,(e,t)=>{tn.init(e,t),Z.init(e,t)}),$i=h(`ZodIPv6`,(e,t)=>{nn.init(e,t),Z.init(e,t)}),ea=h(`ZodCIDRv4`,(e,t)=>{rn.init(e,t),Z.init(e,t)}),ta=h(`ZodCIDRv6`,(e,t)=>{an.init(e,t),Z.init(e,t)}),na=h(`ZodBase64`,(e,t)=>{sn.init(e,t),Z.init(e,t)}),ra=h(`ZodBase64URL`,(e,t)=>{ln.init(e,t),Z.init(e,t)}),ia=h(`ZodE164`,(e,t)=>{un.init(e,t),Z.init(e,t)}),aa=h(`ZodJWT`,(e,t)=>{fn.init(e,t),Z.init(e,t)}),oa=h(`ZodNumber`,(e,t)=>{pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r),e.gt=(t,n)=>e.check(Or(t,n)),e.gte=(t,n)=>e.check(kr(t,n)),e.min=(t,n)=>e.check(kr(t,n)),e.lt=(t,n)=>e.check(Er(t,n)),e.lte=(t,n)=>e.check(Dr(t,n)),e.max=(t,n)=>e.check(Dr(t,n)),e.int=t=>e.check(ca(t)),e.safe=t=>e.check(ca(t)),e.positive=t=>e.check(Or(0,t)),e.nonnegative=t=>e.check(kr(0,t)),e.negative=t=>e.check(Er(0,t)),e.nonpositive=t=>e.check(Dr(0,t)),e.multipleOf=(t,n)=>e.check(Ar(t,n)),e.step=(t,n)=>e.check(Ar(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $(e){return xr(oa,e)}var sa=h(`ZodNumberFormat`,(e,t)=>{mn.init(e,t),oa.init(e,t)});function ca(e){return Sr(sa,e)}var la=h(`ZodUnknown`,(e,t)=>{hn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ua(){return Cr(la)}var da=h(`ZodNever`,(e,t)=>{gn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r)});function fa(e){return wr(da,e)}var pa=h(`ZodVoid`,(e,t)=>{_n.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r)});function ma(e){return Tr(pa,e)}var ha=h(`ZodArray`,(e,t)=>{yn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(W(t,n)),e.nonempty=t=>e.check(W(1,t)),e.max=(t,n)=>e.check(jr(t,n)),e.length=(t,n)=>e.check(Mr(t,n)),e.unwrap=()=>e.element});function ga(e,t){return Wr(ha,e,t)}var _a=h(`ZodObject`,(e,t)=>{Cn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),x(e,`shape`,()=>t.shape),e.keyof=()=>wa(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ua()}),e.loose=()=>e.clone({...e._zod.def,catchall:ua()}),e.strict=()=>e.clone({...e._zod.def,catchall:fa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>we(e,t),e.safeExtend=t=>Te(e,t),e.merge=t=>Ee(e,t),e.pick=t=>Se(e,t),e.omit=t=>Ce(e,t),e.partial=(...t)=>De(Da,e,t[0]),e.required=(...t)=>Oe(La,e,t[0])});function va(e,t){return new _a({type:`object`,shape:e??{},...O(t)})}var ya=h(`ZodUnion`,(e,t)=>{Tn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),e.options=t.options});function ba(e,t){return new ya({type:`union`,options:e,...O(t)})}var xa=h(`ZodIntersection`,(e,t)=>{En.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r)});function Sa(e,t){return new xa({type:`intersection`,left:e,right:t})}var Ca=h(`ZodEnum`,(e,t)=>{On.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ca({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ca({...t,checks:[],...O(r),entries:i})}});function wa(e,t){return new Ca({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}var Ta=h(`ZodTransform`,(e,t)=>{kn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ea(e){return new Ta({type:`transform`,transform:e})}var Da=h(`ZodOptional`,(e,t)=>{jn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oa(e){return new Da({type:`optional`,innerType:e})}var ka=h(`ZodExactOptional`,(e,t)=>{Mn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Aa(e){return new ka({type:`optional`,innerType:e})}var ja=h(`ZodNullable`,(e,t)=>{Nn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ma(e){return new ja({type:`nullable`,innerType:e})}var Na=h(`ZodDefault`,(e,t)=>{Pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pa(e,t){return new Na({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Fa=h(`ZodPrefault`,(e,t)=>{In.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ia(e,t){return new Fa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var La=h(`ZodNonOptional`,(e,t)=>{Ln.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ra(e,t){return new La({type:`nonoptional`,innerType:e,...O(t)})}var za=h(`ZodCatch`,(e,t)=>{zn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ba(e,t){return new za({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Va=h(`ZodPipe`,(e,t)=>{Bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.in=t.in,e.out=t.out});function Ha(e,t){return new Va({type:`pipe`,in:e,out:t})}var Ua=h(`ZodReadonly`,(e,t)=>{Vn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wa(e){return new Ua({type:`readonly`,innerType:e})}var Ga=h(`ZodCustom`,(e,t)=>{Un.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r)});function Ka(e,t={}){return Gr(Ga,e,t)}function qa(e){return Kr(e)}var Ja=e=>va({pages:$(),nextPage:$().optional(),totalElements:$(),currentPage:$(),pageSize:$(),elements:ga(e)});function Ya(){return{pages:0,nextPage:void 0,totalElements:0,currentPage:0,pageSize:0,elements:[]}}var Xa=ba([$(),Vi()]).optional().transform(e=>e===void 0||e===``?void 0:Number(e)).refine(e=>e===void 0||!Number.isNaN(e),{message:`Must be a valid number`}),Za=va({page:Xa,pageSize:Xa}),Qa=class extends r{constructor(e){super(),this.error=e}},$a=class extends r{constructor(e){super(),this.error=e}},eo=class extends r{constructor(){super()}},to=class{constructor(e){this.baseUrl=e}async fetch(e,r,i,a={}){try{let o=await this.mergeHeaders(a.headers),s=await fetch(`${this.baseUrl}${e}`,{...a,headers:o});if(s.status===409)return n(new Qa({status:s.status,statusText:s.statusText,body:await s.json().catch(()=>s.text())}));if(s.status===404)return n(new eo);if(!s.ok)return n(new i({error:await s.json().catch(()=>({message:s.statusText})),metadata:{status:s.status,statusText:s.statusText}}));let c=(await s.text()).trim(),l=s.status===204?void 0:c?JSON.parse(c):void 0,u=r.safeParse(l);return u.success?t(u.data):n(new i(Error(`Invalid response body`),l))}catch(e){return n(new $a(e))}}async fetchBlob(e,r,i={}){try{let a=await this.mergeHeaders(i.headers),o=await fetch(`${this.baseUrl}${e}`,{...i,headers:a});return o.status===404?n(new eo):o.ok?t(await o.blob()):n(new r(await o.json().catch(()=>({message:o.statusText})),{status:o.status,statusText:o.statusText}))}catch(e){return n(new $a(e))}}async mergeHeaders(e){let t=new Headers([...await this.getHeaders()]);return new Headers(e).forEach((e,n)=>t.set(n,e)),t}},no=ma(),ro=/^(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*\.[A-Za-z]{2,63}$/i;function io(e){let t=e?.message??`Please enter a valid domain`;return Vi().min(3,{message:t}).max(253).refine(e=>ro.test(e),{message:t})}exports.EmptyPage=Ya,exports.EmptyResponse=no,exports.Fail=n,exports.Failure=r,exports.Guid=se,exports.HttpSafeClient=to,exports.NetworkConflictFailure=Qa,exports.NetworkFailure=$a,exports.NotFoundFailure=eo,exports.Ok=t,exports.PageQuery=Za,exports.SafeDomain=io,exports.convertDateInfoToDateRange=d,exports.createPageSchema=Ja,exports.formatDate=c,exports.formatDateTime=u,exports.formatTime=l,exports.isFailure=a,exports.mock=e,exports.notFailure=i,exports.parseConfig=o,exports.sleep=s;