@halliday-sdk/payments 2.8.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/paymentsApiClient/index.cjs.min.js +1 -1
- package/dist/paymentsApiClient/index.cjs.min.js.map +1 -1
- package/dist/paymentsApiClient/index.d.ts +3432 -1105
- package/dist/paymentsApiClient/index.esm.min.js +1 -1
- package/dist/paymentsApiClient/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/ethers/index.d.ts +1 -3
- package/dist/paymentsWidget/index.cjs.min.js +1 -1
- package/dist/paymentsWidget/index.cjs.min.js.map +1 -1
- package/dist/paymentsWidget/index.d.ts +110 -274
- package/dist/paymentsWidget/index.esm.min.js +1 -1
- package/dist/paymentsWidget/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/index.umd.min.js +1 -1
- package/dist/paymentsWidget/index.umd.min.js.map +1 -1
- package/dist/paymentsWidget/viem/index.d.ts +1 -3
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("axios");function t(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function n(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}"function"==typeof SuppressedError&&SuppressedError;class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const s={};function a(e){return s}function u(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function c(e,t){return"bigint"==typeof t?t.toString():t}function d(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function p(e){return null==e}function l(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const f=Symbol("evaluating");function h(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==f)return void 0===r&&(r=f,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function m(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function g(e){return JSON.stringify(e)}const v="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const w=d((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function b(e){if(!1===_(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==_(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function z(e){return b(e)?{...e}:Array.isArray(e)?[...e]:e}const k=new Set(["string","number","symbol"]);function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function E(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const S={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function T(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function R(e){return"string"==typeof e?e:e?.message}function A(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=R(e.inst?._zod.def?.error?.(e))??R(t?.error?.(e))??R(n.customError?.(e))??R(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function P(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function I(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const N=(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,c,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},j=r("$ZodError",N),Z=r("$ZodError",N,{Parent:Error});const C=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new o;if(u.issues.length){const t=new(i?.Err??e)(u.issues.map((e=>A(e,s,a()))));throw v(t,i?.callee),t}return u.value},F=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>A(e,i,a()))));throw v(t,o?.callee),t}return s.value},M=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new o;return s.issues.length?{success:!1,error:new(e??j)(s.issues.map((e=>A(e,i,a()))))}:{success:!0,data:s.value}},D=M(Z),V=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map((e=>A(e,o,a()))))}:{success:!0,data:i.value}},U=V(Z),q=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return C(e)(t,n,o)},J=e=>(t,n,r)=>C(e)(t,n,r),L=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return F(e)(t,n,o)},W=e=>async(t,n,r)=>F(e)(t,n,r),B=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return M(e)(t,n,o)},H=e=>(t,n,r)=>M(e)(t,n,r),G=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return V(e)(t,n,o)},K=e=>async(t,n,r)=>V(e)(t,n,r),Y=/^[cC][^\s-]{8,}$/,Q=/^[0-9a-z]+$/,X=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,te=/^[A-Za-z0-9]{27}$/,ne=/^[a-zA-Z0-9_-]{21}$/,re=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oe=/^([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})$/,ie=e=>e?new 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)$/,se=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ae=/^(?:(?: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])$/,ue=/^(([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}|:))$/,ce=/^((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])$/,de=/^(([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])$/,pe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,le=/^[A-Za-z0-9_-]*$/,fe=/^\+[1-9]\d{6,14}$/,he="(?:(?:\\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])))",me=new RegExp(`^${he}$`);function ye(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ge=/^-?\d+n?$/,ve=/^-?\d+$/,_e=/^-?\d+(?:\.\d+)?$/,we=/^(?:true|false)$/i,be=/^undefined$/i,ze=/^[^A-Z]*$/,ke=/^[^a-z]*$/,Oe=r("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Ee=r("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Se=r("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),$e=r("$ZodCheckMultipleOf",((e,t)=>{Oe.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 new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),Te=r("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=S[t.format];e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=ve)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}})),Re=r("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!p(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=P(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),Ae=r("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!p(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=P(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),Pe=r("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!p(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=P(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Ie=r("$ZodCheckStringFormat",((e,t)=>{var n,r;Oe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(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=()=>{})})),Ne=r("$ZodCheckRegex",((e,t)=>{Ie.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})}})),je=r("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ze),Ie.init(e,t)})),Ze=r("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ke),Ie.init(e,t)})),Ce=r("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=O(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),Fe=r("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${O(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),Me=r("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${O(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),De=r("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Ve{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),r=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ue={major:4,minor:3,patch:6},qe=r("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ue;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,i=$(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new o;if(r||a instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await a;e.issues.length!==t&&(i||(i=$(e,t)))}));else{if(e.issues.length===t)continue;i||(i=$(e,t))}}return r?r.then((()=>e)):e},n=(n,i,s)=>{if($(n))return n.aborted=!0,n;const a=t(i,r,s);if(a instanceof Promise){if(!1===s.async)throw new o;return a.then((t=>e._zod.parse(t,s)))}return e._zod.parse(a,s)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if("backward"===s.direction){const t=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,i,s))):n(t,i,s)}const a=e._zod.parse(i,s);if(a instanceof Promise){if(!1===s.async)throw new o;return a.then((e=>t(e,r,s)))}return t(a,r,s)}}h(e,"~standard",(()=>({validate:t=>{try{const n=D(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return U(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1})))})),Je=r("$ZodString",((e,t)=>{var n;qe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),Le=r("$ZodStringFormat",((e,t)=>{Ie.init(e,t),Je.init(e,t)})),We=r("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=oe),Le.init(e,t)})),Be=r("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ie(e))}else t.pattern??(t.pattern=ie());Le.init(e,t)})),He=r("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=se),Le.init(e,t)})),Ge=r("$ZodURL",((e,t)=>{Le.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),Ke=r("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Le.init(e,t)})),Ye=r("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=ne),Le.init(e,t)})),Qe=r("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=Y),Le.init(e,t)})),Xe=r("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=Q),Le.init(e,t)})),et=r("$ZodULID",((e,t)=>{t.pattern??(t.pattern=X),Le.init(e,t)})),tt=r("$ZodXID",((e,t)=>{t.pattern??(t.pattern=ee),Le.init(e,t)})),nt=r("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=te),Le.init(e,t)})),rt=r("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ye({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${he}T(?:${r})$`)}(t)),Le.init(e,t)})),ot=r("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=me),Le.init(e,t)})),it=r("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ye(t)}$`)),Le.init(e,t)})),st=r("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=re),Le.init(e,t)})),at=r("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ae),Le.init(e,t),e._zod.bag.format="ipv4"})),ut=r("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ue),Le.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})}}})),ct=r("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=ce),Le.init(e,t)})),dt=r("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=de),Le.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function pt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const lt=r("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=pe),Le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{pt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}));const ft=r("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=le),Le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!le.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return pt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),ht=r("$ZodE164",((e,t)=>{t.pattern??(t.pattern=fe),Le.init(e,t)}));const mt=r("$ZodJWT",((e,t)=>{Le.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),yt=r("$ZodNumber",((e,t)=>{qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??_e,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}})),gt=r("$ZodNumberFormat",((e,t)=>{Te.init(e,t),yt.init(e,t)})),vt=r("$ZodBoolean",((e,t)=>{qe.init(e,t),e._zod.pattern=we,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),_t=r("$ZodBigInt",((e,t)=>{qe.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}})),wt=r("$ZodUndefined",((e,t)=>{qe.init(e,t),e._zod.pattern=be,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}})),bt=r("$ZodAny",((e,t)=>{qe.init(e,t),e._zod.parse=e=>e})),zt=r("$ZodUnknown",((e,t)=>{qe.init(e,t),e._zod.parse=e=>e})),kt=r("$ZodNever",((e,t)=>{qe.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function Ot(e,t,n){e.issues.length&&t.issues.push(...T(n,e.issues)),t.value[n]=e.value}const xt=r("$ZodArray",((e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then((t=>Ot(t,n,e)))):Ot(a,n,e)}return i.length?Promise.all(i).then((()=>n)):n}}));function Et(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...T(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function St(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter((e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout)));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $t(e,t,n,r,o,i){const s=[],a=o.keySet,u=o.catchall._zod,c=u.def.type,d="optional"===u.optout;for(const o in t){if(a.has(o))continue;if("never"===c){s.push(o);continue}const i=u.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then((e=>Et(e,n,o,t,d)))):Et(i,n,o,t,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then((()=>n)):n}const Tt=r("$ZodObject",((e,t)=>{qe.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=d((()=>St(t)));h(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n}));const o=_,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const u=[],c=s.shape;for(const e of s.keys){const r=c[e],o="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?u.push(i.then((n=>Et(n,t,e,a,o)))):Et(i,t,e,a,o)}return i?$t(u,a,t,n,r.value,e):u.length?Promise.all(u).then((()=>t)):t}})),Rt=r("$ZodObjectJIT",((e,t)=>{Tt.init(e,t);const n=e._zod.parse,r=d((()=>St(t)));let o;const i=_,a=!s.jitless,u=a&&w.value,c=t.catchall;let p;e._zod.parse=(s,d)=>{p??(p=r.value);const l=s.value;return i(l)?a&&u&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new Ve(["shape","payload","ctx"]),n=r.value,o=e=>{const t=g(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],s=g(r),a=e[r],u="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),u?t.write(`\n if (${n}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),s=o(s,d),c?$t([],l,s,d,p,e):s):n(s,d):(s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s)}}));function At(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!$(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>A(e,r,a())))))}),t)}const Pt=r("$ZodUnion",((e,t)=>{qe.init(e,t),h(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),h(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),h(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),h(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>l(e.source))).join("|")})$`)}}));const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>At(t,o,e,i))):At(a,o,e,i)}})),It=r("$ZodDiscriminatedUnion",((e,t)=>{t.inclusive=!1,Pt.init(e,t);const n=e._zod.parse;h(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e}));const r=d((()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n}));e._zod.parse=(o,i)=>{const s=o.value;if(!_(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}})),Nt=r("$ZodIntersection",((e,t)=>{qe.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then((([t,n])=>Zt(e,t,n))):Zt(e,o,i)}}));function jt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(b(e)&&b(t)){const n=Object.keys(t),r=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of r){const r=jt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=jt(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zt(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){o??(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter((([,e])=>e.l&&e.r)).map((([e])=>e));if(i.length&&o&&e.issues.push({...o,keys:i}),$(e))return e;const s=jt(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Ct=r("$ZodRecord",((e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!b(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const s=t.valueType._zod.run({value:o[e],issues:[]},r);s instanceof Promise?i.push(s.then((t=>{t.issues.length&&n.issues.push(...T(e,t.issues)),n.value[e]=t.value}))):(s.issues.length&&n.issues.push(...T(e,s.issues)),n.value[e]=s.value)}let u;for(const e in o)a.has(e)||(u=u??[],u.push(e));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u})}else{n.value={};for(const s of Reflect.ownKeys(o)){if("__proto__"===s)continue;let u=t.keyType._zod.run({value:s,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof s&&_e.test(s)&&u.issues.length){const e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(u=e)}if(u.issues.length){"loose"===t.mode?n.value[s]=o[s]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map((e=>A(e,r,a()))),input:s,path:[s],inst:e});continue}const c=t.valueType._zod.run({value:o[s],issues:[]},r);c instanceof Promise?i.push(c.then((e=>{e.issues.length&&n.issues.push(...T(s,e.issues)),n.value[u.value]=e.value}))):(c.issues.length&&n.issues.push(...T(s,c.issues)),n.value[u.value]=c.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),Ft=r("$ZodEnum",((e,t)=>{qe.init(e,t);const n=u(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter((e=>k.has(typeof e))).map((e=>"string"==typeof e?O(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}})),Mt=r("$ZodLiteral",((e,t)=>{if(qe.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?O(e):e?O(e.toString()):String(e))).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}})),Dt=r("$ZodTransform",((e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return(s instanceof Promise?s:Promise.resolve(s)).then((e=>(n.value=e,n)))}if(s instanceof Promise)throw new o;return n.value=s,n}}));function Vt(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Ut=r("$ZodOptional",((e,t)=>{qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",h(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),h(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((t=>Vt(t,e.value))):Vt(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),qt=r("$ZodExactOptional",((e,t)=>{Ut.init(e,t),h(e._zod,"values",(()=>t.innerType._zod.values)),h(e._zod,"pattern",(()=>t.innerType._zod.pattern)),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)})),Jt=r("$ZodNullable",((e,t)=>{qe.init(e,t),h(e._zod,"optin",(()=>t.innerType._zod.optin)),h(e._zod,"optout",(()=>t.innerType._zod.optout)),h(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l(e.source)}|null)$`):void 0})),h(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Lt=r("$ZodDefault",((e,t)=>{qe.init(e,t),e._zod.optin="optional",h(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((e=>Wt(e,t))):Wt(r,t)}}));function Wt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Bt=r("$ZodPrefault",((e,t)=>{qe.init(e,t),e._zod.optin="optional",h(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Ht=r("$ZodNonOptional",((e,t)=>{qe.init(e,t),h(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then((t=>Gt(t,e))):Gt(o,e)}}));function Gt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Kt=r("$ZodCatch",((e,t)=>{qe.init(e,t),h(e._zod,"optin",(()=>t.innerType._zod.optin)),h(e._zod,"optout",(()=>t.innerType._zod.optout)),h(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const 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,a())))},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,a())))},input:e.value}),e.issues=[]),e)}})),Yt=r("$ZodPipe",((e,t)=>{qe.init(e,t),h(e._zod,"values",(()=>t.in._zod.values)),h(e._zod,"optin",(()=>t.in._zod.optin)),h(e._zod,"optout",(()=>t.out._zod.optout)),h(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then((e=>Qt(e,t.in,n))):Qt(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then((e=>Qt(e,t.out,n))):Qt(r,t.out,n)}}));function Qt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Xt=r("$ZodReadonly",((e,t)=>{qe.init(e,t),h(e._zod,"propValues",(()=>t.innerType._zod.propValues)),h(e._zod,"values",(()=>t.innerType._zod.values)),h(e._zod,"optin",(()=>t.innerType?._zod?.optin)),h(e._zod,"optout",(()=>t.innerType?._zod?.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(en):en(r)}}));function en(e){return e.value=Object.freeze(e.value),e}const tn=r("$ZodCustom",((e,t)=>{Oe.init(e,t),qe.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then((t=>nn(t,n,r,e)));nn(o,n,r,e)}}));function nn(e,t,n,r){if(!e){const 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(I(e))}}var rn;class on{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const 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)}}(rn=globalThis).__zod_globalRegistry??(rn.__zod_globalRegistry=new on);const sn=globalThis.__zod_globalRegistry;function an(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function un(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function cn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function dn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function pn(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!1})}function ln(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!0})}function fn(e,t){return new Se({check:"greater_than",...E(t),value:e,inclusive:!1})}function hn(e,t){return new Se({check:"greater_than",...E(t),value:e,inclusive:!0})}function mn(e,t){return new $e({check:"multiple_of",...E(t),value:e})}function yn(e,t){return new Re({check:"max_length",...E(t),maximum:e})}function gn(e,t){return new Ae({check:"min_length",...E(t),minimum:e})}function vn(e,t){return new Pe({check:"length_equals",...E(t),length:e})}function _n(e){return new De({check:"overwrite",tx:e})}function wn(e){const t=function(e,t){const n=new Oe({check:"custom",...E(t)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(I(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(I(r))}},e(n.value,n))));return t}function bn(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??sn,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 zn(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i){i.count++;return n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema}const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),zn(i,t,r),t.seen.get(i).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(s.schema,u),"input"===t.io&&xn(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function kn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new 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])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const s=r.schema;for(const e in s)delete s[e];s.$ref=o};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;i?o(n):(r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}}function On(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},s=n.ref;if(n.ref=null,s){r(s);const n=e.seen.get(s),a=n.schema;!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,i);if(t._zod.parent===s)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:En(t,"input",e.processors),output:En(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function xn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return xn(r.element,n);if("set"===r.type)return xn(r.valueType,n);if("lazy"===r.type)return xn(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return xn(r.innerType,n);if("intersection"===r.type)return xn(r.left,n)||xn(r.right,n);if("record"===r.type||"map"===r.type)return xn(r.keyType,n)||xn(r.valueType,n);if("pipe"===r.type)return xn(r.in,n)||xn(r.out,n);if("object"===r.type){for(const e in r.shape)if(xn(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(xn(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(xn(e,n))return!0;return!(!r.rest||!xn(r.rest,n))}return!1}const En=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=bn({...o??{},target:i,io:t,processors:n});return zn(e,s),kn(s,e),On(s,e)},Sn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$n=(e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r);t.seen.get(e).ref=o.innerType},Tn=r("ZodISODateTime",((e,t)=>{rt.init(e,t),nr.init(e,t)}));function Rn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}(Tn,e)}const An=r("ZodISODate",((e,t)=>{ot.init(e,t),nr.init(e,t)}));function Pn(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}(An,e)}const In=r("ZodISOTime",((e,t)=>{it.init(e,t),nr.init(e,t)}));function Nn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}(In,e)}const jn=r("ZodISODuration",((e,t)=>{st.init(e,t),nr.init(e,t)}));function Zn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}(jn,e)}const Cn=(e,t)=>{j.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map((e=>r({issues:e})));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get:()=>0===e.issues.length}})},Fn=r("ZodError",Cn),Mn=r("ZodError",Cn,{Parent:Error}),Dn=C(Mn),Vn=F(Mn),Un=M(Mn),qn=V(Mn),Jn=q(Mn),Ln=J(Mn),Wn=L(Mn),Bn=W(Mn),Hn=B(Mn),Gn=H(Mn),Kn=G(Mn),Yn=K(Mn),Qn=r("ZodType",((e,t)=>(qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:En(e,"input"),output:En(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=bn({...n,processors:t});return zn(e,r),kn(r,e),On(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(y(t,{checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>x(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Dn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Un(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Jn(e,t,n),e.decode=(t,n)=>Ln(e,t,n),e.encodeAsync=async(t,n)=>Wn(e,t,n),e.decodeAsync=async(t,n)=>Bn(e,t,n),e.safeEncode=(t,n)=>Hn(e,t,n),e.safeDecode=(t,n)=>Gn(e,t,n),e.safeEncodeAsync=async(t,n)=>Kn(e,t,n),e.safeDecodeAsync=async(t,n)=>Yn(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...E(n)})}(fo,e,t)}(t,n)),e.superRefine=t=>e.check(wn(t)),e.overwrite=t=>e.check(_n(t)),e.optional=()=>to(e),e.exactOptional=()=>new no({type:"optional",innerType:e}),e.nullable=()=>oo(e),e.nullish=()=>to(oo(e)),e.nonoptional=t=>function(e,t){return new ao({type:"nonoptional",innerType:e,...E(t)})}(e,t),e.array=()=>Fr(e),e.or=t=>Ur([e,t]),e.and=t=>new Lr({type:"intersection",left:e,right:t}),e.transform=t=>po(e,Xr(t)),e.default=t=>{return n=t,new io({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():z(n)}});var n},e.prefault=t=>{return n=t,new so({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():z(n)}});var n},e.catch=t=>{return new uo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>po(e,t),e.readonly=()=>new lo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return sn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>sn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return sn.get(e);const n=e.clone();return sn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e))),Xn=r("_ZodString",((e,t)=>{Je.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),s&&(r.format=Sn[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map((e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source})))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ne({check:"string_format",format:"regex",...E(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ce({check:"string_format",format:"includes",...E(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Fe({check:"string_format",format:"starts_with",...E(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...E(t),suffix:e})}(...t)),e.min=(...t)=>e.check(gn(...t)),e.max=(...t)=>e.check(yn(...t)),e.length=(...t)=>e.check(vn(...t)),e.nonempty=(...t)=>e.check(gn(1,...t)),e.lowercase=t=>e.check(function(e){return new je({check:"string_format",format:"lowercase",...E(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ze({check:"string_format",format:"uppercase",...E(e)})}(t)),e.trim=()=>e.check(_n((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return _n((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(_n((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(_n((e=>e.toUpperCase()))),e.slugify=()=>e.check(_n((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))))})),er=r("ZodString",((e,t)=>{Je.init(e,t),Xn.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}(rr,t)),e.url=t=>e.check(un(sr,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}(zr,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}(ur,t)),e.guid=t=>e.check(an(or,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}(ir,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}(ir,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}(ir,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}(ir,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}(cr,t)),e.guid=t=>e.check(an(or,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}(dr,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}(pr,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}(lr,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}(_r,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}(wr,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}(fr,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}(hr,t)),e.ipv4=t=>e.check(cn(mr,t)),e.ipv6=t=>e.check(dn(yr,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}(gr,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}(vr,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}(br,t)),e.datetime=t=>e.check(Rn(t)),e.date=t=>e.check(Pn(t)),e.time=t=>e.check(Nn(t)),e.duration=t=>e.check(Zn(t))}));function tr(e){return function(e,t){return new e({type:"string",...E(t)})}(er,e)}const nr=r("ZodStringFormat",((e,t)=>{Le.init(e,t),Xn.init(e,t)})),rr=r("ZodEmail",((e,t)=>{He.init(e,t),nr.init(e,t)})),or=r("ZodGUID",((e,t)=>{We.init(e,t),nr.init(e,t)})),ir=r("ZodUUID",((e,t)=>{Be.init(e,t),nr.init(e,t)})),sr=r("ZodURL",((e,t)=>{Ge.init(e,t),nr.init(e,t)}));function ar(e){return un(sr,e)}const ur=r("ZodEmoji",((e,t)=>{Ke.init(e,t),nr.init(e,t)})),cr=r("ZodNanoID",((e,t)=>{Ye.init(e,t),nr.init(e,t)})),dr=r("ZodCUID",((e,t)=>{Qe.init(e,t),nr.init(e,t)})),pr=r("ZodCUID2",((e,t)=>{Xe.init(e,t),nr.init(e,t)})),lr=r("ZodULID",((e,t)=>{et.init(e,t),nr.init(e,t)})),fr=r("ZodXID",((e,t)=>{tt.init(e,t),nr.init(e,t)})),hr=r("ZodKSUID",((e,t)=>{nt.init(e,t),nr.init(e,t)})),mr=r("ZodIPv4",((e,t)=>{at.init(e,t),nr.init(e,t)}));const yr=r("ZodIPv6",((e,t)=>{ut.init(e,t),nr.init(e,t)}));const gr=r("ZodCIDRv4",((e,t)=>{ct.init(e,t),nr.init(e,t)})),vr=r("ZodCIDRv6",((e,t)=>{dt.init(e,t),nr.init(e,t)})),_r=r("ZodBase64",((e,t)=>{lt.init(e,t),nr.init(e,t)})),wr=r("ZodBase64URL",((e,t)=>{ft.init(e,t),nr.init(e,t)})),br=r("ZodE164",((e,t)=>{ht.init(e,t),nr.init(e,t)})),zr=r("ZodJWT",((e,t)=>{mt.init(e,t),nr.init(e,t)})),kr=r("ZodNumber",((e,t)=>{yt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number","number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c),"number"==typeof o&&(r.minimum=o,"number"==typeof c&&"draft-04"!==t.target&&(c>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),"number"==typeof i&&(r.maximum=i,"number"==typeof u&&"draft-04"!==t.target&&(u<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(hn(t,n)),e.min=(t,n)=>e.check(hn(t,n)),e.lt=(t,n)=>e.check(pn(t,n)),e.lte=(t,n)=>e.check(ln(t,n)),e.max=(t,n)=>e.check(ln(t,n)),e.int=t=>e.check(Er(t)),e.safe=t=>e.check(Er(t)),e.positive=t=>e.check(fn(0,t)),e.nonnegative=t=>e.check(hn(0,t)),e.negative=t=>e.check(pn(0,t)),e.nonpositive=t=>e.check(ln(0,t)),e.multipleOf=(t,n)=>e.check(mn(t,n)),e.step=(t,n)=>e.check(mn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Or(e){return function(e,t){return new e({type:"number",checks:[],...E(t)})}(kr,e)}const xr=r("ZodNumberFormat",((e,t)=>{gt.init(e,t),kr.init(e,t)}));function Er(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}(xr,e)}const Sr=r("ZodBoolean",((e,t)=>{vt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)}));function $r(e){return function(e,t){return new e({type:"boolean",...E(t)})}(Sr,e)}const Tr=r("ZodBigInt",((e,t)=>{_t.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(hn(t,n)),e.min=(t,n)=>e.check(hn(t,n)),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(hn(t,n)),e.min=(t,n)=>e.check(hn(t,n)),e.lt=(t,n)=>e.check(pn(t,n)),e.lte=(t,n)=>e.check(ln(t,n)),e.max=(t,n)=>e.check(ln(t,n)),e.positive=t=>e.check(fn(BigInt(0),t)),e.negative=t=>e.check(pn(BigInt(0),t)),e.nonpositive=t=>e.check(ln(BigInt(0),t)),e.nonnegative=t=>e.check(hn(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(mn(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function Rr(e){return function(e,t){return new e({type:"bigint",...E(t)})}(Tr,e)}const Ar=r("ZodUndefined",((e,t)=>{wt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)}));const Pr=r("ZodAny",((e,t)=>{bt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));const Ir=r("ZodUnknown",((e,t)=>{zt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Nr(){return new Ir({type:"unknown"})}const jr=r("ZodNever",((e,t)=>{kt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}));function Zr(e){return function(e,t){return new e({type:"never",...E(t)})}(jr,e)}const Cr=r("ZodArray",((e,t)=>{xt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=zn(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(gn(t,n)),e.nonempty=t=>e.check(gn(1,t)),e.max=(t,n)=>e.check(yn(t,n)),e.length=(t,n)=>e.check(vn(t,n)),e.unwrap=()=>e.element}));function Fr(e,t){return function(e,t,n){return new e({type:"array",element:t,...E(n)})}(Cr,e,t)}const Mr=r("ZodObject",((e,t)=>{Rt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const e in s)o.properties[e]=zn(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter((e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout})));u.size>0&&(o.required=Array.from(u)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=zn(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),h(e,"shape",(()=>t.shape)),e.keyof=()=>Gr(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return m(this,"shape",n),n}});return x(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return m(this,"shape",n),n}});return x(e,n)}(e,t),e.merge=t=>function(e,t){const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return m(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return x(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return x(e,y(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return m(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=y(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return m(this,"shape",r),r},checks:[]});return x(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=y(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return m(this,"shape",o),o},checks:[]});return x(t,o)}(eo,e,t[0]),e.required=(...t)=>function(e,t,n){const r=y(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return m(this,"shape",o),o}});return x(t,r)}(ao,e,t[0])}));function Dr(e,t){const n={type:"object",shape:e??{},...E(t)};return new Mr(n)}const Vr=r("ZodUnion",((e,t)=>{Pt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map(((e,n)=>zn(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]})));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options}));function Ur(e,t){return new Vr({type:"union",options:e,...E(t)})}const qr=r("ZodDiscriminatedUnion",((e,t)=>{Vr.init(e,t),It.init(e,t)}));function Jr(e,t,n){return new qr({type:"union",options:t,discriminator:e,...E(n)})}const Lr=r("ZodIntersection",((e,t)=>{Nt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=zn(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=zn(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,r)}));const Wr=r("ZodRecord",((e,t)=>{Ct.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,a=s._zod.bag,u=a?.patterns;if("loose"===i.mode&&u&&u.size>0){const e=zn(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const t of u)o.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(o.propertyNames=zn(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=zn(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const e=[...c].filter((e=>"string"==typeof e||"number"==typeof e));e.length>0&&(o.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}));function Br(e,t,n){return new Wr({type:"record",keyType:e,valueType:t,...E(n)})}const Hr=r("ZodEnum",((e,t)=>{Ft.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=u(e._zod.def.entries);r.every((e=>"number"==typeof e))&&(n.type="number"),r.every((e=>"string"==typeof e))&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new Hr({...t,checks:[],...E(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hr({...t,checks:[],...E(r),entries:o})}}));function Gr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hr({type:"enum",entries:n,...E(t)})}const Kr=r("ZodLiteral",((e,t)=>{Mt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every((e=>"number"==typeof e))&&(n.type="number"),o.every((e=>"string"==typeof e))&&(n.type="string"),o.every((e=>"boolean"==typeof e))&&(n.type="boolean"),o.every((e=>null===e))&&(n.type="null"),n.enum=o})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function Yr(e,t){return new Kr({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Qr=r("ZodTransform",((e,t)=>{Dt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(I(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(I(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Xr(e){return new Qr({type:"transform",transform:e})}const eo=r("ZodOptional",((e,t)=>{Ut.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$n(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function to(e){return new eo({type:"optional",innerType:e})}const no=r("ZodExactOptional",((e,t)=>{qt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$n(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));const ro=r("ZodNullable",((e,t)=>{Jt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=zn(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));function oo(e){return new ro({type:"nullable",innerType:e})}const io=r("ZodDefault",((e,t)=>{Lt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));const so=r("ZodPrefault",((e,t)=>{Bt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));const ao=r("ZodNonOptional",((e,t)=>{Ht.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));const uo=r("ZodCatch",((e,t)=>{Kt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));const co=r("ZodPipe",((e,t)=>{Yt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;zn(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out}));function po(e,t){return new co({type:"pipe",in:e,out:t})}const lo=r("ZodReadonly",((e,t)=>{Xt.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));const fo=r("ZodCustom",((e,t)=>{tn.init(e,t),Qn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}));const ho="https://v2.prod.halliday.xyz",mo=/^(https:\/\/(?:[\w-]+\.)*halliday\.xyz(?:\/.*)?|http:\/\/localhost(?::\d+)?(?:\/.*)?|https:\/\/localhost(?::\d+)?(?:\/.*)?)$/,yo=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,go=tr().regex(/^0x[a-fA-F0-9]*$/,{message:"Must be a hex string beginning with 0x"}).transform((e=>e)),vo=tr().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Must be a 40-character hex string beginning with 0x"}).transform((e=>e.toLowerCase())),_o=tr(),wo=tr();Dr({EVM:vo,SOL:_o}).keyof();const bo=tr().regex(/^(\d+|\d*\.\d+)$/);Rr().min(0n),Rr().min(0n);const zo=tr().refine((e=>/^[a-zA-Z_]{3,}$/.test(e)),{message:"Invalid fiat"}),ko=Dr({issuer:tr(),name:tr(),alias:tr().optional(),symbol:tr(),decimals:Or()}),Oo=tr(),xo=tr().regex(/^[a-zA-Z]\w{1,7}$/,{message:"Must be a short alpha-numeric symbol"}),Eo=Or().min(0).max(18),So=tr().url(),$o=tr(),To=Dr({chain:tr(),address:go}),Ro=Dr({chain:Yr("solana"),address:_o}),Ao=Dr({chain:tr(),address:tr()}),Po=Ur([To,Ro,Ao]),Io=tr().refine((e=>{const[t,n]=e.split(":");return Po.safeParse({chain:t,address:n}).success}),{message:"Invalid token"}),No=Dr({name:Oo,symbol:xo,decimals:Eo,alias:xo.optional(),image_url:So.optional(),coingecko_id:$o.optional(),wrapper:xo.optional(),is_native:$r().optional()}),jo=To.extend(No.shape),Zo=Ro.extend(No.shape),Co=Ur([jo,Zo,Ao.extend(No.shape)]),Fo=Ur([Io,zo]),Mo=Ur([Co,ko]),Do=Jr("type",[Dr({type:Yr("chain"),chain:tr()}),Dr({type:Yr("issuer"),issuer:tr()})]),Vo=tr().transform((e=>e.toLowerCase())),Uo=(qo=e=>"string"==typeof e?e.toUpperCase():e,Jo=Gr(["ONRAMP","OFFRAMP"]),po(Xr(qo),Jo));var qo,Jo;const Lo=Dr({to:vo,from:vo.optional(),nonce:Or().optional(),gasLimit:Rr().optional(),gasPrice:Rr().optional(),maxPriorityFeePerGas:Rr().optional(),maxFeePerGas:Rr().optional(),data:tr().optional(),value:Rr().optional(),chainId:Or()}),Wo=Dr({transactionHash:tr().optional(),blockHash:tr().optional(),blockNumber:Or().optional(),from:vo.optional(),to:vo.optional(),rawReceipt:new Pr({type:"any"})}),Bo=Dr({chain_id:Rr(),network:tr(),address_family:function(e,t){return new e({type:"undefined",...E(t)})}(Ar,Ho),explorer:ar().optional(),image:ar().optional(),is_testnet:$r()});var Ho;const Go=Bo.extend({address_family:Yr("EVM"),native_currency:Dr({name:tr(),symbol:tr(),decimals:Or()}),rpc:tr().optional()}),Ko=Bo.extend({address_family:Yr("SOL")}),Yo=Jr("address_family",[Go,Ko,Bo]),Qo=Gr(["CREDIT_CARD","DEBIT_CARD","ACH","FIAT_BALANCE","TOKEN_BALANCE","APPLE_PAY","PAYPAL","VENMO","REVOLUT","GOOGLE_PAY","SEPA","FASTER_PAYMENTS","PIX","UPI","WIRE"]);class Xo{static stringify(e,t){return JSON.stringify(e,(this??Xo).replacer,t)}static parse(e){return JSON.parse(e,(this??Xo).reviver)}}Xo.replacer=(e,t)=>"bigint"==typeof t?{"#":t.toString()}:t,Xo.reviver=(e,t)=>t&&"object"==typeof t&&"#"in t&&1===Object.keys(t).length?BigInt(t["#"]):t;var ei,ti="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ni={};!function(){return ei||(ei=1,function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof ti?ti:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=r(e);function r(e,t){return function(n,r){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0!==t.Reflect&&(n=r(t.Reflect,n)),function(e,t){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,o=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!s&&!a,c={create:s?function(){return pe(Object.create(null))}:a?function(){return pe({__proto__:null})}:function(){return pe({})},has:u?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},d=Object.getPrototypeOf(Function),p="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:ue(),l="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:ce(),f="function"==typeof WeakMap?WeakMap:de(),h=r?Symbol.for("@reflect-metadata:registry"):void 0,m=oe(),y=ie(m);function g(e,t,n,r){if(C(n)){if(!W(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!W(e))throw new TypeError;if(!D(t))throw new TypeError;if(!D(r)&&!C(r)&&!F(r))throw new TypeError;return F(r)&&(r=void 0),$(e,t,n=L(n),r)}function v(e,t){function n(n,r){if(!D(n))throw new TypeError;if(!C(r)&&!G(r))throw new TypeError;I(e,t,n,r)}return n}function _(e,t,n,r){if(!D(n))throw new TypeError;return C(r)||(r=L(r)),I(e,t,n,r)}function w(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=L(n)),T(e,t,n)}function b(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=L(n)),R(e,t,n)}function z(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=L(n)),A(e,t,n)}function k(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=L(n)),P(e,t,n)}function O(e,t){if(!D(e))throw new TypeError;return C(t)||(t=L(t)),N(e,t)}function x(e,t){if(!D(e))throw new TypeError;return C(t)||(t=L(t)),j(e,t)}function E(e,t,n){if(!D(t))throw new TypeError;if(C(n)||(n=L(n)),!D(t))throw new TypeError;C(n)||(n=L(n));var r=ae(t,n,!1);return!C(r)&&r.OrdinaryDeleteMetadata(e,t,n)}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!C(r)&&!F(r)){if(!H(r))throw new TypeError;t=r}}return t}function $(e,t,n,r){for(var o=e.length-1;o>=0;--o){var i=(0,e[o])(t,n,r);if(!C(i)&&!F(i)){if(!D(i))throw new TypeError;r=i}}return r}function T(e,t,n){if(R(e,t,n))return!0;var r=ne(t);return!F(r)&&T(e,r,n)}function R(e,t,n){var r=ae(t,n,!1);return!C(r)&&q(r.OrdinaryHasOwnMetadata(e,t,n))}function A(e,t,n){if(R(e,t,n))return P(e,t,n);var r=ne(t);return F(r)?void 0:A(e,r,n)}function P(e,t,n){var r=ae(t,n,!1);if(!C(r))return r.OrdinaryGetOwnMetadata(e,t,n)}function I(e,t,n,r){ae(n,r,!0).OrdinaryDefineOwnMetadata(e,t,n,r)}function N(e,t){var n=j(e,t),r=ne(e);if(null===r)return n;var o=N(r,t);if(o.length<=0)return n;if(n.length<=0)return o;for(var i=new l,s=[],a=0,u=n;a<u.length;a++){var c=u[a];i.has(c)||(i.add(c),s.push(c))}for(var d=0,p=o;d<p.length;d++){c=p[d];i.has(c)||(i.add(c),s.push(c))}return s}function j(e,t){var n=ae(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function Z(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function C(e){return void 0===e}function F(e){return null===e}function M(e){return"symbol"==typeof e}function D(e){return"object"==typeof e?null!==e:"function"==typeof e}function V(e,t){switch(Z(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n="string",r=Y(e,o);if(void 0!==r){var i=r.call(e,n);if(D(i))throw new TypeError;return i}return U(e)}function U(e,t){var n,r,o=e.toString;if(B(o)&&!D(r=o.call(e)))return r;if(B(n=e.valueOf)&&!D(r=n.call(e)))return r;throw new TypeError}function q(e){return!!e}function J(e){return""+e}function L(e){var t=V(e);return M(t)?t:J(t)}function W(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function B(e){return"function"==typeof e}function H(e){return"function"==typeof e}function G(e){switch(Z(e)){case 3:case 4:return!0;default:return!1}}function K(e,t){return e===t||e!=e&&t!=t}function Y(e,t){var n=e[t];if(null!=n){if(!B(n))throw new TypeError;return n}}function Q(e){var t=Y(e,i);if(!B(t))throw new TypeError;var n=t.call(e);if(!D(n))throw new TypeError;return n}function X(e){return e.value}function ee(e){var t=e.next();return!t.done&&t}function te(e){var t=e.return;t&&t.call(e)}function ne(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===d)return t;if(t!==d)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var o=r.constructor;return"function"!=typeof o||o===e?t:o}function re(){var e,n,r,o;C(h)||void 0===t.Reflect||h in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=se(t.Reflect));var i=new f,s={registerProvider:a,getProvider:c,setProvider:m};return s;function a(t){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case C(n):n=t;break;case n===t:break;case C(r):r=t;break;case r===t:break;default:void 0===o&&(o=new l),o.add(t)}}function u(t,i){if(!C(n)){if(n.isProviderFor(t,i))return n;if(!C(r)){if(r.isProviderFor(t,i))return n;if(!C(o))for(var s=Q(o);;){var a=ee(s);if(!a)return;var u=X(a);if(u.isProviderFor(t,i))return te(s),u}}}if(!C(e)&&e.isProviderFor(t,i))return e}function c(e,t){var n,r=i.get(e);return C(r)||(n=r.get(t)),C(n)?(C(n=u(e,t))||(C(r)&&(r=new p,i.set(e,r)),r.set(t,n)),n):n}function d(e){if(C(e))throw new TypeError;return n===e||r===e||!C(o)&&o.has(e)}function m(e,t,n){if(!d(n))throw new Error("Metadata provider not registered.");var r=c(e,t);if(r!==n){if(!C(r))return!1;var o=i.get(e);C(o)&&(o=new p,i.set(e,o)),o.set(t,n)}return!0}}function oe(){var e;return!C(h)&&D(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[h]),C(e)&&(e=re()),!C(h)&&D(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function ie(e){var t=new f,n={isProviderFor:function(e,n){var r=t.get(e);return!C(r)&&r.has(n)},OrdinaryDefineOwnMetadata:s,OrdinaryHasOwnMetadata:o,OrdinaryGetOwnMetadata:i,OrdinaryOwnMetadataKeys:a,OrdinaryDeleteMetadata:u};return m.registerProvider(n),n;function r(r,o,i){var s=t.get(r),a=!1;if(C(s)){if(!i)return;s=new p,t.set(r,s),a=!0}var u=s.get(o);if(C(u)){if(!i)return;if(u=new p,s.set(o,u),!e.setProvider(r,o,n))throw s.delete(o),a&&t.delete(r),new Error("Wrong provider for target.")}return u}function o(e,t,n){var o=r(t,n,!1);return!C(o)&&q(o.has(e))}function i(e,t,n){var o=r(t,n,!1);if(!C(o))return o.get(e)}function s(e,t,n,o){r(n,o,!0).set(e,t)}function a(e,t){var n=[],o=r(e,t,!1);if(C(o))return n;for(var i=Q(o.keys()),s=0;;){var a=ee(i);if(!a)return n.length=s,n;var u=X(a);try{n[s]=u}catch(e){try{te(i)}finally{throw e}}s++}}function u(e,n,o){var i=r(n,o,!1);if(C(i))return!1;if(!i.delete(e))return!1;if(0===i.size){var s=t.get(n);C(s)||(s.delete(o),0===s.size&&t.delete(s))}return!0}}function se(e){var t=e.defineMetadata,n=e.hasOwnMetadata,r=e.getOwnMetadata,o=e.getOwnMetadataKeys,i=e.deleteMetadata,s=new f;return{isProviderFor:function(e,t){var n=s.get(e);return!(C(n)||!n.has(t))||!!o(e,t).length&&(C(n)&&(n=new l,s.set(e,n)),n.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}function ae(e,t,n){var r=m.getProvider(e,t);if(!C(r))return r;if(n){if(m.setProvider(e,t,y))return y;throw new Error("Illegal state.")}}function ue(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,o=n+1;o<r;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,K(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){if(!K(this._cacheKey,e)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++)if(K(this._keys[n],e)){this._cacheIndex=n;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function s(e,t){return[e,t]}}function ce(){return function(){function e(){this._map=new p}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function de(){var e=16,t=c.create(),r=o();return function(){function e(){this._key=o()}return e.prototype.has=function(e){var t=i(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){return i(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=o()},e}();function o(){var e;do{e="@@WeakMap@@"+u()}while(c.has(t,e));return t[e]=!0,e}function i(e,t){if(!n.call(e,r)){if(!t)return;Object.defineProperty(e,r,{value:c.create()})}return e[r]}function s(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function a(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):s(t,e),t}return s(new Array(e),e)}function u(){var t=a(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var o=t[r];4!==r&&6!==r&&8!==r||(n+="-"),o<16&&(n+="0"),n+=o.toString(16).toLowerCase()}return n}}function pe(e){return e.__=void 0,delete e.__,e}e("decorate",g),e("metadata",v),e("defineMetadata",_),e("hasMetadata",w),e("hasOwnMetadata",b),e("getMetadata",z),e("getOwnMetadata",k),e("getMetadataKeys",O),e("getOwnMetadataKeys",x),e("deleteMetadata",E)}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(e||(e={}))),ni;var e}();const ri=Symbol("api-method-metadata"),oi=new Map,ii=e=>(t,n)=>{Reflect.defineMetadata(ri,e,t,n);const r=e.httpVerb,o=e.endpoint,i=`${r.toLowerCase()} ${o}`;oi.set(i,e);const s=t.constructor;"function"!=typeof s.toJSON&&Object.defineProperty(s,"toJSON",{value:e=>Reflect.getMetadata(ri,s.prototype,e),writable:!1,configurable:!1})},si={enabled:!0,debug:!1},ai=(e,t=si)=>{if(t.enabled)try{const n=((e,t=ho)=>{if(!e)return"";let n=new URL(e,t).pathname;return n=n.replace(/\/[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}/gi,""),n})(e.config.url||"");if(!n)return void(t.debug&&console.debug("[HallidayPaymentsApiClient] No endpoint found in URL:",e.config.url));const r=`${e.config.method?.toLowerCase()||"get"} ${n}`,o=oi.get(r)?.outputSchema;if(!o)return void(t.debug&&console.debug(`[HallidayPaymentsApiClient] No validation schema defined for endpoint: ${n}`));const i=o.safeParse(e.data);i.success||(console.warn(`[HallidayPaymentsApiClient] Response validation failed for ${n}. Your SDK version might be outdated - please check for updates.`),t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",i.error))}catch(e){t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",e)}};var ui;exports.ErrorCodes=void 0,(ui=exports.ErrorCodes||(exports.ErrorCodes={})).VALIDATION_ERROR="VALIDATION_ERROR",ui.API_ERROR="API_ERROR",ui.SERVER_ERROR="SERVER_ERROR",ui.NETWORK_ERROR="NETWORK_ERROR",ui.UNKNOWN_ERROR="UNKNOWN_ERROR";class ci extends Error{constructor({message:e,code:t,status:n,statusText:r,reqHeaders:o,resHeaders:i,data:s,config:a,request:u,response:c,error:d,validationIssues:p,validationMessage:l}){super(e),this.name="HallidayPaymentsApiClientError",this.validationIssues=null,this.validationMessage=null,this.status=null,this.statusText=null,this.reqHeaders=null,this.resHeaders=null,this.data=null,this.config=null,this.request=null,this.response=null,this.error=null,this.code=t,this.message=e,this.status=n??null,this.statusText=r??null,this.reqHeaders=o??null,this.resHeaders=i??null,this.data=s??null,this.config=a??null,this.request=u??null,this.response=c??null,this.error=d??null,this.validationIssues=p??null,this.validationMessage=l??null,Object.setPrototypeOf(this,ci.prototype)}static isPaymentsApiClientError(e){return e instanceof ci}static parseValidationError({message:e,error:t}){return new ci({message:e??t?.message??"Validation error",code:exports.ErrorCodes.VALIDATION_ERROR,validationIssues:t instanceof Fn?t.issues:null,validationMessage:t instanceof Fn?t.message:null,...void 0!==t&&{error:t}})}static parseAxiosError(e){if(e.response){const t=e.response.status;let n=e.response.data?.errors||[],r=null;Array.isArray(n)||(n=[n]);let o=n.map((e=>"string"!=typeof e?JSON.stringify(e):e)).join("\n")||e.message||"Unknown error",i=e.response?.statusText;return 500===t?new ci({message:o,code:exports.ErrorCodes.SERVER_ERROR,status:500,statusText:`${e.code??"500"}: ${i??"Server Error"}`,data:e.response?.data,...void 0!==e.config&&{config:e.config},request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers}):(400===t?(o=`Bad request: ${o}`,i=`${e.code??"400"}: ${i??"Bad Request"}`,r=n):401===t?(o=`Unauthorized: ${o}`,i=`${e.code??"401"}: ${i??"Unauthorized"}`):403===t?(o=`Forbidden: ${o}`,i=`${e.code??"403"}: ${i??"Forbidden"}`):404===t?(o=`Resource not found: ${o}`,i=`${e.code??"404"}: ${i??"Not Found"}`):(o=`Request failed with status ${t}: ${o}`,i=`${e.code??t}: ${i??"Unexpected error"}`),new ci({message:o,code:exports.ErrorCodes.API_ERROR,status:t,statusText:i,data:e.response?.data,...void 0!==e.config&&{config:e.config},request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers,validationIssues:r}))}return e.request?new ci({message:e.message||`No response received from the server: ${e.code}`,code:exports.ErrorCodes.NETWORK_ERROR,...void 0!==e.config&&{config:e.config},request:e.request,reqHeaders:e.request?.headers}):"ERR_CANCELED"===e.code?null:new ci({message:`${e.code?`${e.code}: `:""}${e.message||"No message"}`,code:exports.ErrorCodes.NETWORK_ERROR,...void 0!==e.config&&{config:e.config},request:e.request,error:e})}toJSON(){return JSON.stringify({name:this.name,code:this.code,message:this.message,validationIssues:this.validationIssues,status:this.status,statusText:this.statusText,config:this.config,stack:this.stack})}}const di=({apiKey:t,baseUrl:n=ho,responseValidationOptions:r=si})=>{if(!mo.test(n))throw new Error(`Invalid base URL: ${n}`);if(!t)throw new Error("API key is required");const o=e.create({baseURL:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},parseReviver:Xo.reviver}),i=(s=r,{onFulfilled:e=>(ai(e,s),e),onRejected:e=>{throw e}});var s;o.interceptors.response.use(i.onFulfilled,i.onRejected);const a={onFulfilled:e=>e,onRejected:t=>{if(e.isAxiosError(t)){const e=ci.parseAxiosError(t);if(e)throw e;return{data:null}}throw new ci({message:t.message||"Unknown error",code:exports.ErrorCodes.UNKNOWN_ERROR,error:t})}};return o.interceptors.response.use(a.onFulfilled,a.onRejected),o},pi=e=>Object.entries(e).reduce(((e,[t,n])=>{if("sandbox"===t)e.push("sandbox="+(!0===n?"true":"false"));else if(Array.isArray(n))for(const r of n)e.push(`${t}[]=${r}`);else e.push(`${t}=${n}`);return e}),[]).join("&"),li=tr().refine((e=>yo.test(e)),{message:"Invalid payment ID"}),fi=Gr(["BETA_EDGES","ORG_BETA_EDGES","ORG_EDGES"]),hi=Dr({onramps:Fr(Vo).optional(),offramps:Fr(Vo).optional(),sandbox:$r().optional().default(!1),features:Fr(fi).optional()}),mi=hi.extend({inputs:Fr(Fo).optional(),outputs:Fr(Fo)}),yi=hi.extend({inputs:Fr(Fo),outputs:Fr(Fo).optional()}),gi=Ur([mi,yi]),vi=Dr({asset:Fo,amount:bo}),_i=Dr({token:Io,amount:bo}),wi=tr(),bi=Ur([function(e){return cn(mr,e)}(),function(e){return dn(yr,e)}()]),zi=Dr({price_currency:zo,onramps:Fr(Vo).optional(),onramp_methods:Fr(Qo).optional(),customer_ip_address:tr().optional(),customer_id:tr().optional(),label:tr().optional(),parent_payment_id:li.optional(),features:Fr(fi).optional(),rev_share_name:tr().optional(),allow_unsafe_transfer_out:$r().optional(),show_all_issues:$r().optional(),allow_exceed_max_input_limit:$r().optional(),allow_unsafe_slippage:$r().optional()}),ki=Dr({"#":tr()}),Oi=Dr({type:Yr("CallImmediateAction"),target:tr(),value:ki,calldata:tr()}),xi=Dr({actions:Fr(Oi),user_estimated_gas:ki}),Ei=Jr("kind",[Dr({kind:Yr("FIXED_INPUT"),fixed_input_amount:vi,output_asset:Fo,custom_actions:xi.optional(),dest_address:tr().optional()})]),Si=zi.extend({request:Ei}),$i=Gr(["USER","DEST","HALLIDAY","SPW","REV_SHARE","BRIDGE"]),Ti=Gr(["APPROVAL","BALANCE"]),Ri=Dr({asset:Fo,property:Ti}),Ai=Dr({account:$i,resource:Ri}),Pi=Ur([Yr("COMPLETE"),Yr("UNREACHABLE"),Yr("FAILED")]),Ii=Ur([Pi,Yr("PENDING")]),Ni=Gr(["PENDING","COMPLETE","FAILED","EXPIRED","WITHDRAWN","TAINTED"]),ji=Dr({consume:Fr(Ai),produce:Fr(Ai)}),Zi=Ai.extend({amount:bo}),Ci=ji.extend({consume:Fr(Zi),produce:Fr(Zi)}),Fi=Br(Fo,tr()),Mi=Jr("kind",[Dr({kind:Ur([Yr("amount"),Yr("amount-downstream")]),given:tr(),limits:Dr({min:tr().optional(),max:tr().optional()}),source:tr(),message:tr()}),Dr({kind:Yr("geolocation"),message:tr()}),Dr({kind:Yr("provider"),message:tr()}),Dr({kind:Yr("other"),message:tr()}),Dr({kind:Yr("unknown"),message:tr()})]),Di=Dr({service_ids:Fr(tr()),latency_seconds:Or(),issues:Fr(Mi).optional()}),Vi=Ur([Yr("USER_FUND"),Yr("ONCHAIN_STEP"),Yr("ONRAMP")]),Ui=Dr({type:Vi,net_effect:Ci,pieces_info:Fr(Dr({type:Ur([Yr("onramp"),Yr("poll"),Yr("bridge"),Yr("rev_share"),Yr("transfer_out"),Yr("convert")])})),step_index:Or().optional()}),qi=Dr({payment_id:tr(),output_amount:Dr({asset:Fo,amount:tr()}),onramp:Vo.optional(),onramp_method:Qo.optional(),fees:Dr({total_fees:tr(),conversion_fees:tr(),network_fees:tr(),business_fees:tr(),currency_symbol:zo}),route:Fr(Ui)}),Ji=Ui.extend({status:Ii,transaction_hash:tr().optional()}),Li=qi.omit({payment_id:!0}).partial({output_amount:!0,onramp:!0,onramp_method:!0,fees:!0}).extend({route:Fr(Ji)}),Wi=Dr({quote_request:Si,quotes:Fr(qi),current_prices:Fi,price_currency:zo,state_token:tr(),quoted_at:tr(),accept_by:tr(),failures:Fr(Di)}),Bi=Dr({payment_id:li,state_token:tr(),owner_chain:tr().optional(),owner_address:wo,destination_address:wo,client_redirect_url:tr().optional(),allow_unsafe_owner:$r().optional()}),Hi=Dr({deposit_token:Io,deposit_chain:tr(),deposit_amount:bo,deposit_address:wo}),Gi=Dr({type:Gr(["ONRAMP","TRANSFER_IN"]),payment_id:li,funding_page_url:ar(),deposit_info:Fr(Hi)}),Ki=Dr({payment_id:li,org_id:tr(),status:Ni,funded:$r(),created_at:tr(),updated_at:tr(),initiate_fund_by:tr(),completed_at:tr().optional(),quote_request:Si,quoted:qi.omit({payment_id:!0}),fulfilled:Li,current_prices:Fi,price_currency:zo,customer_id:tr().optional(),label:tr().optional(),processing_addresses:Fr(Dr({address:wo,chain:tr()})),owner_chain:tr(),owner_address:wo,destination_address:wo,next_instruction:Gi.optional(),parent_payment_id:li.optional(),client_redirect_url:tr().nullable()}),Yi=Ki,Qi=Dr({payment_id:li,redirect_url:tr(),referrer_domain:tr().optional()}),Xi=Dr({funding_page_onramp_url:tr(),client_redirect_url:tr().optional(),client_secret:tr().optional()}),es=Dr({id_query:tr().optional(),pagination_key:tr().optional(),dest_address:wo.optional(),owner_address:wo.optional(),limit:Or().int().positive().optional(),category:Gr(["ALL","NEW_OR_FUNDED"]).optional(),label:tr().optional()}),ts=Dr({payment_statuses:Fr(Yi),next_pagination_key:tr().nullable()}),ns=Dr({payment_id:li.optional(),custom_queries:Fr(Dr({address:wo,token:Ur([Io,Po])})).optional()}).refine((e=>!(!e.payment_id&&!e.custom_queries?.length)),{message:"payment_id or custom_queries is required"}),rs=Dr({balance_results:Fr(Dr({address:wo,token:Io,value:Jr("kind",[Dr({kind:Yr("amount"),amount:bo}),Dr({kind:Yr("error")})])}))}),os=Dr({fiat:zo,tokens:Fr(Io)}),is=tr(),ss=Dr({payment_id:li,token_amounts:Fr(_i),recipient_address:wo}),as=Dr({payment_id:li,withdraw_authorization:is}),us=ss.extend({owner_signature:wi}),cs=Dr({payment_id:li,transaction_hash:tr()});class ds{constructor(e){this.getChains=async(e=!1)=>{const{data:t}=await this.apiClient.get("/chains?sandbox="+(e?"true":"false"));return t},this.getAssetDetails=async({assets:e=[],sandbox:t})=>{if("boolean"!=typeof t)throw ci.parseValidationError({message:"Invalid sandbox value"});let n=`sandbox=${t}`;if(e){if(!Array.isArray(e))throw ci.parseValidationError({message:"Invalid assets"});for(const t of e)try{n+=`&assets[]=${Fo.parse(t)}`}catch(e){throw ci.parseValidationError({message:`Invalid asset: ${t}`,error:e})}}return(await this.apiClient.get(`/assets?${n}`)).data},this.getInputs=async e=>{let t;try{const n=mi.parse(e);t=pi(n)}catch(e){throw ci.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-inputs?${t}`)).data},this.getOutputs=async e=>{let t;try{const n=yi.parse(e);t=pi(n)}catch(e){throw ci.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-outputs?${t}`)).data},this.getQuotes=async(e,t)=>{let n;try{n=Si.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for quotes",error:e})}return(await this.apiClient.post("/payments/quotes",n,{...void 0!==t&&{signal:t}})).data},this.confirmQuote=async e=>{let t;try{t=Bi.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for confirming quote",error:e})}return(await this.apiClient.post("/payments/confirm",t)).data},this.createPaymentSession=async e=>{let t;try{t=Qi.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for onramp session",error:e})}return(await this.apiClient.post("/onramp",t)).data},this.getStatus=async(e,t)=>{try{li.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid payment ID",error:e})}const n=new URLSearchParams;n.set("payment_id",e);const r=n.toString();return(await this.apiClient.get(`/payments?${r}`,{...void 0!==t&&{signal:t}})).data},this.getPaymentsHistory=async e=>{let t;try{t=es.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for payments",error:e})}const n=new URLSearchParams;t.id_query&&n.set("id_query",t.id_query),t.pagination_key&&n.set("pagination_key",t.pagination_key),t.dest_address&&n.set("dest_address",t.dest_address),t.owner_address&&n.set("owner_address",t.owner_address),t.limit&&n.set("limit",t.limit.toString()),t.category&&n.set("category",t.category),t.label&&n.set("label",t.label);let r=n.toString();r&&(r=`?${r}`);return(await this.apiClient.get(`/payments/history${r}`)).data},this.getBalance=async e=>{let t;try{t=ns.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for balance",error:e})}return(await this.apiClient.post("/payments/balances",t)).data},this.getPrices=async e=>{let t;try{t=os.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for prices",error:e})}return(await this.apiClient.post("/prices",t)).data},this.getWithdrawAuthorization=async e=>{let t;try{t=ss.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for withdraw authorization",error:e})}return(await this.apiClient.post("/payments/withdraw",t)).data},this.withdraw=async e=>{let t;try{t=us.parse(e)}catch(e){throw ci.parseValidationError({message:"Invalid request for withdraw",error:e})}return(await this.apiClient.post("/payments/withdraw/confirm",t)).data};const{apiKey:t,baseUrl:n=ho,responseValidation:r={}}=e,o={...si,...r};this.apiClient=di({baseUrl:n,apiKey:t,responseValidationOptions:o})}static toJSON(e){return Reflect.getMetadata(ri,this.prototype,e)}}t([ii({description:"Retrieves the supported chain configuration.",httpVerb:"GET",endpoint:"/chains",inputSchema:$r().optional(),outputSchema:Br(tr(),Yo)}),n("design:type",Object)],ds.prototype,"getChains",void 0),t([ii({description:"Retrieves the asset details for all or the specified assets.",httpVerb:"GET",endpoint:"/assets",inputSchema:Dr({assets:Fr(Fo).optional(),sandbox:$r().optional()}),outputSchema:Br(Fo,Mo)}),n("design:type",Object)],ds.prototype,"getAssetDetails",void 0),t([ii({description:"Retrieves the supported inputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-inputs",inputSchema:mi,outputSchema:Br(Fo,Dr({fiats:Fr(zo),tokens:Fr(Io)}))}),n("design:type",Object)],ds.prototype,"getInputs",void 0),t([ii({description:"Retrieves the supported outputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-outputs",inputSchema:yi,outputSchema:Br(Fo,Dr({fiats:Fr(zo),tokens:Fr(Io)}))}),n("design:type",Object)],ds.prototype,"getOutputs",void 0),t([ii({description:"Retrieves quotes for the given input and output asset.",httpVerb:"POST",endpoint:"/payments/quotes",inputSchema:Si,outputSchema:Wi}),n("design:type",Object)],ds.prototype,"getQuotes",void 0),t([ii({description:"Confirms a quote.",httpVerb:"POST",endpoint:"/payments/confirm",inputSchema:Bi,outputSchema:Ki}),n("design:type",Object)],ds.prototype,"confirmQuote",void 0),t([ii({description:"Creates a onramp provider session for a given payment.",httpVerb:"POST",endpoint:"/onramp",inputSchema:Qi,outputSchema:Xi}),n("design:type",Object)],ds.prototype,"createPaymentSession",void 0),t([ii({description:"Retrieves the status of a given payment.",httpVerb:"GET",endpoint:"/payments",inputSchema:li,outputSchema:Yi}),n("design:type",Object)],ds.prototype,"getStatus",void 0),t([ii({description:"Retrieves the payments history of a given destination address.",httpVerb:"GET",endpoint:"/payments/history",inputSchema:es,outputSchema:ts}),n("design:type",Object)],ds.prototype,"getPaymentsHistory",void 0),t([ii({description:"Retrieves the balance of a given workflow or spw address.",httpVerb:"POST",endpoint:"/payments/balances",inputSchema:ns,outputSchema:rs}),n("design:type",Object)],ds.prototype,"getBalance",void 0),t([ii({description:"Retrieves the prices tokens in a given fiat currency.",httpVerb:"POST",endpoint:"/prices",inputSchema:os,outputSchema:Fi}),n("design:type",Object)],ds.prototype,"getPrices",void 0),t([ii({description:"Retrieves the withdraw authorization for a given workflow.",httpVerb:"POST",endpoint:"/payments/withdraw",inputSchema:ss,outputSchema:as}),n("design:type",Object)],ds.prototype,"getWithdrawAuthorization",void 0),t([ii({description:"Submits the owner signature for a withdraw payload.",httpVerb:"POST",endpoint:"/payments/withdraw/confirm",inputSchema:us,outputSchema:cs}),n("design:type",Object)],ds.prototype,"withdraw",void 0),exports.Account=$i,exports.Address=wo,exports.Amount=bo,exports.Asset=Fo,exports.AssetDetails=Mo,exports.AssetFilters=gi,exports.BalanceResponse=rs,exports.ChainConfig=Yo,exports.ChangeAmount=Zi,exports.ConfirmQuoteResponse=Ki,exports.DepositInfo=Hi,exports.EVMAddress=vo,exports.EVMChainConfig=Go,exports.EVMTokenAddress=go,exports.EVMTokenDetails=jo,exports.Failure=Di,exports.Feature=fi,exports.Fiat=zo,exports.FiatDetails=ko,exports.Fulfillment=Li,exports.FulfillmentRoute=Ji,exports.HSON=Xo,exports.IPAddressOverride=bi,exports.InputsAssetFilters=mi,exports.Issue=Mi,exports.NextInstruction=Gi,exports.ObservedStatus=Ii,exports.OnrampMethod=Qo,exports.OnrampSessionResponse=Xi,exports.OutputsAssetFilters=yi,exports.PaymentHistoryResult=ts,exports.PaymentId=li,exports.PaymentStatus=Yi,exports.PaymentsApiClientError=ci,exports.Prices=Fi,exports.Quote=qi,exports.QuotedRoute=Ui,exports.QuotesResponse=Wi,exports.RampName=Vo,exports.RampType=Uo,exports.Realm=Do,exports.RequestForBalance=ns,exports.RequestForConfirmQuote=Bi,exports.RequestForOnrampSession=Qi,exports.RequestForPaymentsHistory=es,exports.RequestForPrices=os,exports.RequestForQuotes=Si,exports.RequestForWithdraw=us,exports.RequestForWithdrawAuthorization=ss,exports.RouteType=Vi,exports.SolAddress=_o,exports.SolChainConfig=Ko,exports.SolTokenAddress=_o,exports.SolTokenDetails=Zo,exports.Token=Io,exports.TokenDetails=Co,exports.TransactionReceipt=Wo,exports.TransactionRequest=Lo,exports.TypedData=is,exports.WithdrawAuthorizationResponse=as,exports.WithdrawResponse=cs,exports.default=ds;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("axios");function t(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function n(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}"function"==typeof SuppressedError&&SuppressedError;const r=Object.freeze({status:"aborted"});function o(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:i,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=i.prototype,s=Object.keys(o);for(let e=0;e<s.length;e++){const t=s[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class s extends o{}function i(e){var t;const o=n?.Parent?new s:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const a={};function u(e){return a}function c(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function p(e,t){return"bigint"==typeof t?t.toString():t}function d(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function l(e){return null==e}function f(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const h=Symbol("evaluating");function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==h)return void 0===r&&(r=h,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function g(e){return JSON.stringify(e)}const v="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const b=d((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function x(e){if(!1===w(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==w(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function k(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e}const I=new Set(["string","number","symbol"]);function z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function E(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const S={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function R(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function P(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function T(e){return"string"==typeof e?e:e?.message}function A(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=T(e.inst?._zod.def?.error?.(e))??T(t?.error?.(e))??T(n.customError?.(e))??T(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function $(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function N(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const C=(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,p,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Z=o("$ZodError",C),j=o("$ZodError",C,{Parent:Error});const M=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new s;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>A(e,i,u()))));throw v(t,o?.callee),t}return a.value},D=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(o?.Err??e)(i.issues.map((e=>A(e,s,u()))));throw v(t,o?.callee),t}return i.value},F=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new s;return i.issues.length?{success:!1,error:new(e??Z)(i.issues.map((e=>A(e,o,u()))))}:{success:!0,data:i.value}},U=F(j),q=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map((e=>A(e,o,u()))))}:{success:!0,data:s.value}},V=q(j),L=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return M(e)(t,n,o)},J=e=>(t,n,r)=>M(e)(t,n,r),W=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return D(e)(t,n,o)},H=e=>async(t,n,r)=>D(e)(t,n,r),G=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return F(e)(t,n,o)},B=e=>(t,n,r)=>F(e)(t,n,r),K=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return q(e)(t,n,o)},Y=e=>async(t,n,r)=>q(e)(t,n,r),X=/^[cC][^\s-]{8,}$/,Q=/^[0-9a-z]+$/,ee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,te=/^[0-9a-vA-V]{20}$/,ne=/^[A-Za-z0-9]{27}$/,re=/^[a-zA-Z0-9_-]{21}$/,oe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,se=/^([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})$/,ie=e=>e?new 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)$/,ae=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ue=/^(?:(?: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])$/,ce=/^(([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}|:))$/,pe=/^((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])$/,de=/^(([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])$/,le=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fe=/^[A-Za-z0-9_-]*$/,he=/^\+[1-9]\d{6,14}$/,me="(?:(?:\\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])))",ye=new RegExp(`^${me}$`);function _e(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ge=/^-?\d+n?$/,ve=/^-?\d+$/,we=/^-?\d+(?:\.\d+)?$/,be=/^(?:true|false)$/i,xe=/^undefined$/i,ke=/^[^A-Z]*$/,Ie=/^[^a-z]*$/,ze=o("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Oe={number:"number",bigint:"bigint",object:"date"},Ee=o("$ZodCheckLessThan",((e,t)=>{ze.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Se=o("$ZodCheckGreaterThan",((e,t)=>{ze.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Re=o("$ZodCheckMultipleOf",((e,t)=>{ze.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 new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const s=n>o?n:o;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),Pe=o("$ZodCheckNumberFormat",((e,t)=>{ze.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=S[t.format];e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=s,n&&(r.pattern=ve)})),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a))return void i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}})),Te=o("$ZodCheckMaxLength",((e,t)=>{var n;ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=$(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),Ae=o("$ZodCheckMinLength",((e,t)=>{var n;ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=$(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),$e=o("$ZodCheckLengthEquals",((e,t)=>{var n;ze.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const s=$(r),i=o>t.length;n.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Ne=o("$ZodCheckStringFormat",((e,t)=>{var n,r;ze.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(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=()=>{})})),Ce=o("$ZodCheckRegex",((e,t)=>{Ne.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})}})),Ze=o("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ke),Ne.init(e,t)})),je=o("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=Ie),Ne.init(e,t)})),Me=o("$ZodCheckIncludes",((e,t)=>{ze.init(e,t);const n=z(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),De=o("$ZodCheckStartsWith",((e,t)=>{ze.init(e,t);const n=new RegExp(`^${z(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),Fe=o("$ZodCheckEndsWith",((e,t)=>{ze.init(e,t);const n=new RegExp(`.*${z(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(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})}})),Ue=o("$ZodCheckOverwrite",((e,t)=>{ze.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class qe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),r=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ve={major:4,minor:3,patch:6},Le=o("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ve;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,o=R(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=i._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new s;if(r||a instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await a;e.issues.length!==t&&(o||(o=R(e,t)))}));else{if(e.issues.length===t)continue;o||(o=R(e,t))}}return r?r.then((()=>e)):e},n=(n,o,i)=>{if(R(n))return n.aborted=!0,n;const a=t(o,r,i);if(a instanceof Promise){if(!1===i.async)throw new s;return a.then((t=>e._zod.parse(t,i)))}return e._zod.parse(a,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,i))):n(t,o,i)}const a=e._zod.parse(o,i);if(a instanceof Promise){if(!1===i.async)throw new s;return a.then((e=>t(e,r,i)))}return t(a,r,i)}}m(e,"~standard",(()=>({validate:t=>{try{const n=U(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return V(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1})))})),Je=o("$ZodString",((e,t)=>{var n;Le.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),We=o("$ZodStringFormat",((e,t)=>{Ne.init(e,t),Je.init(e,t)})),He=o("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=se),We.init(e,t)})),Ge=o("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ie(e))}else t.pattern??(t.pattern=ie());We.init(e,t)})),Be=o("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=ae),We.init(e,t)})),Ke=o("$ZodURL",((e,t)=>{We.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),Ye=o("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),We.init(e,t)})),Xe=o("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=re),We.init(e,t)})),Qe=o("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=X),We.init(e,t)})),et=o("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=Q),We.init(e,t)})),tt=o("$ZodULID",((e,t)=>{t.pattern??(t.pattern=ee),We.init(e,t)})),nt=o("$ZodXID",((e,t)=>{t.pattern??(t.pattern=te),We.init(e,t)})),rt=o("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=ne),We.init(e,t)})),ot=o("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=_e({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${me}T(?:${r})$`)}(t)),We.init(e,t)})),st=o("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ye),We.init(e,t)})),it=o("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${_e(t)}$`)),We.init(e,t)})),at=o("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=oe),We.init(e,t)})),ut=o("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ue),We.init(e,t),e._zod.bag.format="ipv4"})),ct=o("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ce),We.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})}}})),pt=o("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=pe),We.init(e,t)})),dt=o("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=de),We.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function lt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ft=o("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=le),We.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{lt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}));const ht=o("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=fe),We.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!fe.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return lt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),mt=o("$ZodE164",((e,t)=>{t.pattern??(t.pattern=he),We.init(e,t)}));const yt=o("$ZodJWT",((e,t)=>{We.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),_t=o("$ZodNumber",((e,t)=>{Le.init(e,t),e._zod.pattern=e._zod.bag.pattern??we,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}})),gt=o("$ZodNumberFormat",((e,t)=>{Pe.init(e,t),_t.init(e,t)})),vt=o("$ZodBoolean",((e,t)=>{Le.init(e,t),e._zod.pattern=be,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),wt=o("$ZodBigInt",((e,t)=>{Le.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}})),bt=o("$ZodUndefined",((e,t)=>{Le.init(e,t),e._zod.pattern=xe,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}})),xt=o("$ZodAny",((e,t)=>{Le.init(e,t),e._zod.parse=e=>e})),kt=o("$ZodUnknown",((e,t)=>{Le.init(e,t),e._zod.parse=e=>e})),It=o("$ZodNever",((e,t)=>{Le.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),zt=o("$ZodDate",((e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),n}}));function Ot(e,t,n){e.issues.length&&t.issues.push(...P(n,e.issues)),t.value[n]=e.value}const Et=o("$ZodArray",((e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let e=0;e<o.length;e++){const i=o[e],a=t.element._zod.run({value:i,issues:[]},r);a instanceof Promise?s.push(a.then((t=>Ot(t,n,e)))):Ot(a,n,e)}return s.length?Promise.all(s).then((()=>n)):n}}));function St(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...P(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Rt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter((e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout)));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pt(e,t,n,r,o,s){const i=[],a=o.keySet,u=o.catchall._zod,c=u.def.type,p="optional"===u.optout;for(const o in t){if(a.has(o))continue;if("never"===c){i.push(o);continue}const s=u.run({value:t[o],issues:[]},r);s instanceof Promise?e.push(s.then((e=>St(e,n,o,t,p)))):St(s,n,o,t,p)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then((()=>n)):n}const Tt=o("$ZodObject",((e,t)=>{Le.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=d((()=>Rt(t)));m(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n}));const o=w,s=t.catchall;let i;e._zod.parse=(t,n)=>{i??(i=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const u=[],c=i.shape;for(const e of i.keys){const r=c[e],o="optional"===r._zod.optout,s=r._zod.run({value:a[e],issues:[]},n);s instanceof Promise?u.push(s.then((n=>St(n,t,e,a,o)))):St(s,t,e,a,o)}return s?Pt(u,a,t,n,r.value,e):u.length?Promise.all(u).then((()=>t)):t}})),At=o("$ZodObjectJIT",((e,t)=>{Tt.init(e,t);const n=e._zod.parse,r=d((()=>Rt(t)));let o;const s=w,i=!a.jitless,u=i&&b.value,c=t.catchall;let p;e._zod.parse=(a,d)=>{p??(p=r.value);const l=a.value;return s(l)?i&&u&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new qe(["shape","payload","ctx"]),n=r.value,o=e=>{const t=g(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of n.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const r of n.keys){const n=s[r],i=g(r),a=e[r],u="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),u?t.write(`\n if (${n}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),a=o(a,d),c?Pt([],l,a,d,p,e):a):n(a,d):(a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a)}}));function $t(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!R(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>A(e,r,u())))))}),t)}const Nt=o("$ZodUnion",((e,t)=>{Le.init(e,t),m(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),m(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),m(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),m(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>f(e.source))).join("|")})$`)}}));const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},s);if(t instanceof Promise)a.push(t),i=!0;else{if(0===t.issues.length)return t;a.push(t)}}return i?Promise.all(a).then((t=>$t(t,o,e,s))):$t(a,o,e,s)}})),Ct=o("$ZodDiscriminatedUnion",((e,t)=>{t.inclusive=!1,Nt.init(e,t);const n=e._zod.parse;m(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e}));const r=d((()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n}));e._zod.parse=(o,s)=>{const i=o.value;if(!w(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;const a=r.value.get(i?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),o)}})),Zt=o("$ZodIntersection",((e,t)=>{Le.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then((([t,n])=>Mt(e,t,n))):Mt(e,o,s)}}));function jt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(x(e)&&x(t)){const n=Object.keys(t),r=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of r){const r=jt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=jt(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Mt(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){o??(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const s=[...r].filter((([,e])=>e.l&&e.r)).map((([e])=>e));if(s.length&&o&&e.issues.push({...o,keys:s}),R(e))return e;const i=jt(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Dt=o("$ZodRecord",((e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!x(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const e of i)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const i=t.valueType._zod.run({value:o[e],issues:[]},r);i instanceof Promise?s.push(i.then((t=>{t.issues.length&&n.issues.push(...P(e,t.issues)),n.value[e]=t.value}))):(i.issues.length&&n.issues.push(...P(e,i.issues)),n.value[e]=i.value)}let u;for(const e in o)a.has(e)||(u=u??[],u.push(e));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u})}else{n.value={};for(const i of Reflect.ownKeys(o)){if("__proto__"===i)continue;let a=t.keyType._zod.run({value:i,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof i&&we.test(i)&&a.issues.length){const e=t.keyType._zod.run({value:Number(i),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[i]=o[i]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map((e=>A(e,r,u()))),input:i,path:[i],inst:e});continue}const c=t.valueType._zod.run({value:o[i],issues:[]},r);c instanceof Promise?s.push(c.then((e=>{e.issues.length&&n.issues.push(...P(i,e.issues)),n.value[a.value]=e.value}))):(c.issues.length&&n.issues.push(...P(i,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then((()=>n)):n}})),Ft=o("$ZodEnum",((e,t)=>{Le.init(e,t);const n=c(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter((e=>I.has(typeof e))).map((e=>"string"==typeof e?z(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}})),Ut=o("$ZodLiteral",((e,t)=>{if(Le.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?z(e):e?z(e.toString()):String(e))).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}})),qt=o("$ZodTransform",((e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)))}if(o instanceof Promise)throw new s;return n.value=o,n}}));function Vt(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Lt=o("$ZodOptional",((e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${f(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((t=>Vt(t,e.value))):Vt(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),Jt=o("$ZodExactOptional",((e,t)=>{Lt.init(e,t),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"pattern",(()=>t.innerType._zod.pattern)),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)})),Wt=o("$ZodNullable",((e,t)=>{Le.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${f(e.source)}|null)$`):void 0})),m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Ht=o("$ZodDefault",((e,t)=>{Le.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((e=>Gt(e,t))):Gt(r,t)}}));function Gt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Bt=o("$ZodPrefault",((e,t)=>{Le.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Kt=o("$ZodNonOptional",((e,t)=>{Le.init(e,t),m(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then((t=>Yt(t,e))):Yt(o,e)}}));function Yt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Xt=o("$ZodCatch",((e,t)=>{Le.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const 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,u())))},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,u())))},input:e.value}),e.issues=[]),e)}})),Qt=o("$ZodPipe",((e,t)=>{Le.init(e,t),m(e._zod,"values",(()=>t.in._zod.values)),m(e._zod,"optin",(()=>t.in._zod.optin)),m(e._zod,"optout",(()=>t.out._zod.optout)),m(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then((e=>en(e,t.in,n))):en(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then((e=>en(e,t.out,n))):en(r,t.out,n)}}));function en(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const tn=o("$ZodReadonly",((e,t)=>{Le.init(e,t),m(e._zod,"propValues",(()=>t.innerType._zod.propValues)),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"optin",(()=>t.innerType?._zod?.optin)),m(e._zod,"optout",(()=>t.innerType?._zod?.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(nn):nn(r)}}));function nn(e){return e.value=Object.freeze(e.value),e}const rn=o("$ZodCustom",((e,t)=>{ze.init(e,t),Le.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then((t=>on(t,n,r,e)));on(o,n,r,e)}}));function on(e,t,n,r){if(!e){const 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(N(e))}}var sn;class an{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const 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)}}(sn=globalThis).__zod_globalRegistry??(sn.__zod_globalRegistry=new an);const un=globalThis.__zod_globalRegistry;function cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function dn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function ln(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function fn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function hn(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!1})}function mn(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!0})}function yn(e,t){return new Se({check:"greater_than",...E(t),value:e,inclusive:!1})}function _n(e,t){return new Se({check:"greater_than",...E(t),value:e,inclusive:!0})}function gn(e,t){return new Re({check:"multiple_of",...E(t),value:e})}function vn(e,t){return new Te({check:"max_length",...E(t),maximum:e})}function wn(e,t){return new Ae({check:"min_length",...E(t),minimum:e})}function bn(e,t){return new $e({check:"length_equals",...E(t),length:e})}function xn(e){return new Ue({check:"overwrite",tx:e})}function kn(e){const t=function(e,t){const n=new ze({check:"custom",...E(t)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(N(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(N(r))}},e(n.value,n))));return t}function In(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??un,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 zn(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s){s.count++;return n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{const n=i.schema,s=t.processors[o.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);s(e,t,n,r)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),zn(s,t,r),t.seen.get(s).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(i.schema,u),"input"===t.io&&Sn(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function On(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new 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])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:s}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${o("__shared")}#/${r}/${s}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:o+s}})(t);r.def={...r.schema},s&&(r.defId=s);const i=r.schema;for(const e in i)delete i[e];i.$ref=o};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const s=e.metadataRegistry.get(n[0])?.id;s?o(n):(r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}}function En(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,s={...o},i=n.ref;if(n.ref=null,i){r(i);const n=e.seen.get(i),a=n.schema;!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,s);if(t._zod.parent===i)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in s||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==i){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?o.$defs=s:o.definitions=s);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rn(t,"input",e.processors),output:Rn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Sn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Sn(r.element,n);if("set"===r.type)return Sn(r.valueType,n);if("lazy"===r.type)return Sn(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Sn(r.innerType,n);if("intersection"===r.type)return Sn(r.left,n)||Sn(r.right,n);if("record"===r.type||"map"===r.type)return Sn(r.keyType,n)||Sn(r.valueType,n);if("pipe"===r.type)return Sn(r.in,n)||Sn(r.out,n);if("object"===r.type){for(const e in r.shape)if(Sn(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Sn(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Sn(e,n))return!0;return!(!r.rest||!Sn(r.rest,n))}return!1}const Rn=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=In({...o??{},target:s,io:t,processors:n});return zn(e,i),On(i,e),En(i,e)},Pn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Tn=(e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r);t.seen.get(e).ref=o.innerType},An=o("ZodISODateTime",((e,t)=>{ot.init(e,t),sr.init(e,t)}));function $n(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}(An,e)}const Nn=o("ZodISODate",((e,t)=>{st.init(e,t),sr.init(e,t)}));function Cn(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}(Nn,e)}const Zn=o("ZodISOTime",((e,t)=>{it.init(e,t),sr.init(e,t)}));function jn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}(Zn,e)}const Mn=o("ZodISODuration",((e,t)=>{at.init(e,t),sr.init(e,t)}));function Dn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}(Mn,e)}const Fn=(e,t)=>{Z.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map((e=>r({issues:e})));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get:()=>0===e.issues.length}})},Un=o("ZodError",Fn),qn=o("ZodError",Fn,{Parent:Error}),Vn=M(qn),Ln=D(qn),Jn=F(qn),Wn=q(qn),Hn=L(qn),Gn=J(qn),Bn=W(qn),Kn=H(qn),Yn=G(qn),Xn=B(qn),Qn=K(qn),er=Y(qn),tr=o("ZodType",((e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rn(e,"input"),output:Rn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=In({...n,processors:t});return zn(e,r),On(r,e),En(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(_(t,{checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>O(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Jn(e,t,n),e.parseAsync=async(t,n)=>Ln(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Hn(e,t,n),e.decode=(t,n)=>Gn(e,t,n),e.encodeAsync=async(t,n)=>Bn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Yn(e,t,n),e.safeDecode=(t,n)=>Xn(e,t,n),e.safeEncodeAsync=async(t,n)=>Qn(e,t,n),e.safeDecodeAsync=async(t,n)=>er(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...E(n)})}(vo,e,t)}(t,n)),e.superRefine=t=>e.check(kn(t)),e.overwrite=t=>e.check(xn(t)),e.optional=()=>ao(e),e.exactOptional=()=>new uo({type:"optional",innerType:e}),e.nullable=()=>po(e),e.nullish=()=>ao(po(e)),e.nonoptional=t=>function(e,t){return new ho({type:"nonoptional",innerType:e,...E(t)})}(e,t),e.array=()=>Lr(e),e.or=t=>Gr([e,t]),e.and=t=>new Yr({type:"intersection",left:e,right:t}),e.transform=t=>_o(e,so(t)),e.default=t=>{return n=t,new lo({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():k(n)}});var n},e.prefault=t=>{return n=t,new fo({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():k(n)}});var n},e.catch=t=>{return new mo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>_o(e,t),e.readonly=()=>new go({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return un.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>un.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return un.get(e);const n=e.clone();return un.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e))),nr=o("_ZodString",((e,t)=>{Je.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:s,format:i,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof s&&(r.maxLength=s),i&&(r.format=Pn[i]??i,""===r.format&&delete r.format,"time"===i&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map((e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source})))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ce({check:"string_format",format:"regex",...E(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"includes",...E(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new De({check:"string_format",format:"starts_with",...E(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Fe({check:"string_format",format:"ends_with",...E(t),suffix:e})}(...t)),e.min=(...t)=>e.check(wn(...t)),e.max=(...t)=>e.check(vn(...t)),e.length=(...t)=>e.check(bn(...t)),e.nonempty=(...t)=>e.check(wn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ze({check:"string_format",format:"lowercase",...E(e)})}(t)),e.uppercase=t=>e.check(function(e){return new je({check:"string_format",format:"uppercase",...E(e)})}(t)),e.trim=()=>e.check(xn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return xn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(xn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(xn((e=>e.toUpperCase()))),e.slugify=()=>e.check(xn((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))))})),rr=o("ZodString",((e,t)=>{Je.init(e,t),nr.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}(ir,t)),e.url=t=>e.check(dn(pr,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}(Or,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}(lr,t)),e.guid=t=>e.check(cn(ar,t)),e.uuid=t=>e.check(pn(ur,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}(ur,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}(ur,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}(ur,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}(fr,t)),e.guid=t=>e.check(cn(ar,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}(hr,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}(mr,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}(yr,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}(kr,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}(Ir,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}(_r,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}(gr,t)),e.ipv4=t=>e.check(ln(vr,t)),e.ipv6=t=>e.check(fn(wr,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}(br,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}(xr,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}(zr,t)),e.datetime=t=>e.check($n(t)),e.date=t=>e.check(Cn(t)),e.time=t=>e.check(jn(t)),e.duration=t=>e.check(Dn(t))}));function or(e){return function(e,t){return new e({type:"string",...E(t)})}(rr,e)}const sr=o("ZodStringFormat",((e,t)=>{We.init(e,t),nr.init(e,t)})),ir=o("ZodEmail",((e,t)=>{Be.init(e,t),sr.init(e,t)})),ar=o("ZodGUID",((e,t)=>{He.init(e,t),sr.init(e,t)})),ur=o("ZodUUID",((e,t)=>{Ge.init(e,t),sr.init(e,t)}));function cr(e){return pn(ur,e)}const pr=o("ZodURL",((e,t)=>{Ke.init(e,t),sr.init(e,t)}));function dr(e){return dn(pr,e)}const lr=o("ZodEmoji",((e,t)=>{Ye.init(e,t),sr.init(e,t)})),fr=o("ZodNanoID",((e,t)=>{Xe.init(e,t),sr.init(e,t)})),hr=o("ZodCUID",((e,t)=>{Qe.init(e,t),sr.init(e,t)})),mr=o("ZodCUID2",((e,t)=>{et.init(e,t),sr.init(e,t)})),yr=o("ZodULID",((e,t)=>{tt.init(e,t),sr.init(e,t)})),_r=o("ZodXID",((e,t)=>{nt.init(e,t),sr.init(e,t)})),gr=o("ZodKSUID",((e,t)=>{rt.init(e,t),sr.init(e,t)})),vr=o("ZodIPv4",((e,t)=>{ut.init(e,t),sr.init(e,t)}));const wr=o("ZodIPv6",((e,t)=>{ct.init(e,t),sr.init(e,t)}));const br=o("ZodCIDRv4",((e,t)=>{pt.init(e,t),sr.init(e,t)})),xr=o("ZodCIDRv6",((e,t)=>{dt.init(e,t),sr.init(e,t)})),kr=o("ZodBase64",((e,t)=>{ft.init(e,t),sr.init(e,t)})),Ir=o("ZodBase64URL",((e,t)=>{ht.init(e,t),sr.init(e,t)})),zr=o("ZodE164",((e,t)=>{mt.init(e,t),sr.init(e,t)})),Or=o("ZodJWT",((e,t)=>{yt.init(e,t),sr.init(e,t)})),Er=o("ZodNumber",((e,t)=>{_t.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:s,format:i,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof i&&i.includes("int")?r.type="integer":r.type="number","number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c),"number"==typeof o&&(r.minimum=o,"number"==typeof c&&"draft-04"!==t.target&&(c>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),"number"==typeof s&&(r.maximum=s,"number"==typeof u&&"draft-04"!==t.target&&(u<=s?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(yn(t,n)),e.gte=(t,n)=>e.check(_n(t,n)),e.min=(t,n)=>e.check(_n(t,n)),e.lt=(t,n)=>e.check(hn(t,n)),e.lte=(t,n)=>e.check(mn(t,n)),e.max=(t,n)=>e.check(mn(t,n)),e.int=t=>e.check(Pr(t)),e.safe=t=>e.check(Pr(t)),e.positive=t=>e.check(yn(0,t)),e.nonnegative=t=>e.check(_n(0,t)),e.negative=t=>e.check(hn(0,t)),e.nonpositive=t=>e.check(mn(0,t)),e.multipleOf=(t,n)=>e.check(gn(t,n)),e.step=(t,n)=>e.check(gn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Sr(e){return function(e,t){return new e({type:"number",checks:[],...E(t)})}(Er,e)}const Rr=o("ZodNumberFormat",((e,t)=>{gt.init(e,t),Er.init(e,t)}));function Pr(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}(Rr,e)}const Tr=o("ZodBoolean",((e,t)=>{vt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)}));function Ar(e){return function(e,t){return new e({type:"boolean",...E(t)})}(Tr,e)}const $r=o("ZodBigInt",((e,t)=>{wt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(_n(t,n)),e.min=(t,n)=>e.check(_n(t,n)),e.gt=(t,n)=>e.check(yn(t,n)),e.gte=(t,n)=>e.check(_n(t,n)),e.min=(t,n)=>e.check(_n(t,n)),e.lt=(t,n)=>e.check(hn(t,n)),e.lte=(t,n)=>e.check(mn(t,n)),e.max=(t,n)=>e.check(mn(t,n)),e.positive=t=>e.check(yn(BigInt(0),t)),e.negative=t=>e.check(hn(BigInt(0),t)),e.nonpositive=t=>e.check(mn(BigInt(0),t)),e.nonnegative=t=>e.check(_n(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(gn(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function Nr(e){return function(e,t){return new e({type:"bigint",...E(t)})}($r,e)}const Cr=o("ZodUndefined",((e,t)=>{bt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)}));const Zr=o("ZodAny",((e,t)=>{xt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function jr(){return new Zr({type:"any"})}const Mr=o("ZodUnknown",((e,t)=>{kt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Dr(){return new Mr({type:"unknown"})}const Fr=o("ZodNever",((e,t)=>{It.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}));function Ur(e){return function(e,t){return new e({type:"never",...E(t)})}(Fr,e)}const qr=o("ZodDate",((e,t)=>{zt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(_n(t,n)),e.max=(t,n)=>e.check(mn(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const Vr=o("ZodArray",((e,t)=>{Et.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;"number"==typeof i&&(o.minItems=i),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=zn(s.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(wn(t,n)),e.nonempty=t=>e.check(wn(1,t)),e.max=(t,n)=>e.check(vn(t,n)),e.length=(t,n)=>e.check(bn(t,n)),e.unwrap=()=>e.element}));function Lr(e,t){return function(e,t,n){return new e({type:"array",element:t,...E(n)})}(Vr,e,t)}const Jr=o("ZodObject",((e,t)=>{At.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const e in i)o.properties[e]=zn(i[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(i)),u=new Set([...a].filter((e=>{const n=s.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout})));u.size>0&&(o.required=Array.from(u)),"never"===s.catchall?._zod.def.type?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=zn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),m(e,"shape",(()=>t.shape)),e.keyof=()=>to(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Dr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Dr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ur()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!x(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return y(this,"shape",n),n}});return O(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!x(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return y(this,"shape",n),n}});return O(e,n)}(e,t),e.merge=t=>function(e,t){const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return y(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return O(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return O(e,_(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return y(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=_(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return y(this,"shape",r),r},checks:[]});return O(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return y(this,"shape",o),o},checks:[]});return O(t,o)}(io,e,t[0]),e.required=(...t)=>function(e,t,n){const r=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return y(this,"shape",o),o}});return O(t,r)}(ho,e,t[0])}));function Wr(e,t){const n={type:"object",shape:e??{},...E(t)};return new Jr(n)}const Hr=o("ZodUnion",((e,t)=>{Nt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=!1===o.inclusive,i=o.options.map(((e,n)=>zn(e,t,{...r,path:[...r.path,s?"oneOf":"anyOf",n]})));s?n.oneOf=i:n.anyOf=i})(e,t,n,r),e.options=t.options}));function Gr(e,t){return new Hr({type:"union",options:e,...E(t)})}const Br=o("ZodDiscriminatedUnion",((e,t)=>{Hr.init(e,t),Ct.init(e,t)}));function Kr(e,t,n){return new Br({type:"union",options:t,discriminator:e,...E(n)})}const Yr=o("ZodIntersection",((e,t)=>{Zt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=zn(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=zn(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=u})(e,t,n,r)}));const Xr=o("ZodRecord",((e,t)=>{Dt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const i=s.keyType,a=i._zod.bag,u=a?.patterns;if("loose"===s.mode&&u&&u.size>0){const e=zn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const t of u)o.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(o.propertyNames=zn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=zn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=i._zod.values;if(c){const e=[...c].filter((e=>"string"==typeof e||"number"==typeof e));e.length>0&&(o.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}));function Qr(e,t,n){return new Xr({type:"record",keyType:e,valueType:t,...E(n)})}const eo=o("ZodEnum",((e,t)=>{Ft.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=c(e._zod.def.entries);r.every((e=>"number"==typeof e))&&(n.type="number"),r.every((e=>"string"==typeof e))&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new eo({...t,checks:[],...E(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new eo({...t,checks:[],...E(r),entries:o})}}));function to(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new eo({type:"enum",entries:n,...E(t)})}const no=o("ZodLiteral",((e,t)=>{Ut.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every((e=>"number"==typeof e))&&(n.type="number"),o.every((e=>"string"==typeof e))&&(n.type="string"),o.every((e=>"boolean"==typeof e))&&(n.type="boolean"),o.every((e=>null===e))&&(n.type="null"),n.enum=o})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function ro(e,t){return new no({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const oo=o("ZodTransform",((e,t)=>{qt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(N(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(N(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function so(e){return new oo({type:"transform",transform:e})}const io=o("ZodOptional",((e,t)=>{Lt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function ao(e){return new io({type:"optional",innerType:e})}const uo=o("ZodExactOptional",((e,t)=>{Jt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));const co=o("ZodNullable",((e,t)=>{Wt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=zn(o.innerType,t,r),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));function po(e){return new co({type:"nullable",innerType:e})}const lo=o("ZodDefault",((e,t)=>{Ht.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));const fo=o("ZodPrefault",((e,t)=>{Bt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));const ho=o("ZodNonOptional",((e,t)=>{Kt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));const mo=o("ZodCatch",((e,t)=>{Xt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let s;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));const yo=o("ZodPipe",((e,t)=>{Qt.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;zn(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out}));function _o(e,t){return new yo({type:"pipe",in:e,out:t})}const go=o("ZodReadonly",((e,t)=>{tn.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;zn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));const vo=o("ZodCustom",((e,t)=>{rn.init(e,t),tr.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}));function wo(e,t){return _o(so(e),t)}const bo="custom";const xo="https://v2.prod.halliday.xyz",ko=/^(https:\/\/(?:[\w-]+\.)*halliday\.xyz(?:\/.*)?|http:\/\/localhost(?::\d+)?(?:\/.*)?|https:\/\/localhost(?::\d+)?(?:\/.*)?)$/;const Io="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Uint8Array.from(Io,(e=>e.charCodeAt(0)));const zo=[...Io].reduce(((e,t,n)=>(e[Io.charCodeAt(n)]=n,e)),new Uint8Array(128));new TextDecoder;const Oo=/^[1-9A-HJ-NP-Za-km-z]+$/;function Eo(e){let t=0;for(;t<e.length&&"1"===e[t];)t++;return t+function(e){let t=0;for(let n=e;n>0n;n>>=8n)t++;return t}(function(e){let t=0n;for(let n=0;n<e.length;n++)t=58n*t+BigInt(zo[e.charCodeAt(n)]);return t}(e))}const So=or().regex(/^0x[a-fA-F0-9]*$/,{message:"Must be a hex string beginning with 0x"}).transform((e=>e.toLowerCase())),Ro=or().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Must be a 40-character hex string beginning with 0x"}).transform((e=>e.toLowerCase())),Po=or().superRefine(((e,t)=>{if(!Oo.test(e))return t.addIssue({code:bo,message:"Must be a base58-encoded Solana address"});32!==Eo(e)&&t.addIssue({code:bo,message:"Solana address must decode to exactly 32 bytes"})})),To=or().regex(/^(1[1-9A-HJ-NP-Za-km-z]{25,34}|3[1-9A-HJ-NP-Za-km-z]{25,34}|[bB][cC]1[a-z0-9]{25,87}|[bB][cC]1[A-Z0-9]{25,87})$/,{message:"Must be a valid Bitcoin address (P2PKH, P2SH, or Bech32/Bech32m)"}).transform((e=>/^[bB][cC]1/.test(e)?e.toLowerCase():e)),Ao=or().regex(/^[a-zA-Z0-9_-]{48}$/,{message:"Must be a valid TON user-friendly address (48-character base64url)"}),$o=or().superRefine(((e,t)=>{if(!/^T[1-9A-HJ-NP-Za-km-z]{33}$/.test(e))return t.addIssue({code:bo,message:"Must be a base58check Tron address starting with T (34 characters)"});25!==Eo(e)&&t.addIssue({code:bo,message:"Tron address must decode to exactly 25 bytes"})})),No=or().regex(/^aleo1[a-z0-9]{58}$/,{message:"Must be a valid Aleo address starting with aleo1 and 58 characters"}),Co=or().superRefine(((e,t)=>{if(!/^[DA9][1-9A-HJ-NP-Za-km-z]{25,33}$/.test(e))return t.addIssue({code:bo,message:"Must be a valid Dogecoin address (P2PKH starting with D, or P2SH starting with A or 9)"});25!==Eo(e)&&t.addIssue({code:bo,message:"Dogecoin address must decode to exactly 25 bytes"})})),Zo=or().regex(/^([LM3][1-9A-HJ-NP-Za-km-z]{25,33}|ltc1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{39,59})$/,{message:"Must be a valid Litecoin address (P2PKH starting with L, P2SH starting with M or 3, or Bech32 starting with ltc1)"}),jo=or().regex(/^(r[1-9A-HJ-NP-Za-km-z]{24,34}|X[1-9A-HJ-NP-Za-km-z]{46})$/,{message:"Must be a valid XRPL address (classic r-address or X-address)"}),Mo=or(),Do=Wr({EVM:Ro,SOL:Po,BTC:To,TON:Ao,TRON:$o,ALEO:No,DOGE:Co,LTC:Zo,XRPL:jo}),Fo=Do.keyof(),Uo=or().regex(/^(\d+|\d*\.\d+)$/),qo=Uo.regex(/^\d+(\.\d{1,2})?$/,"Percentage must be a number with at most 2 decimal places").refine((e=>{const t=Number(e);return Number.isFinite(t)&&t>=0&&t<=100}),{message:"Percentage must be between 0 and 100"}),Vo=Nr(),Lo=Gr([Ar(),ro(0),ro(1),ro("0"),ro("1"),ro("false"),ro("true")]).transform((e=>!0===e||1===e||"1"===e||"true"===e)),Jo=Nr().min(0n),Wo=Nr().min(0n),Ho=Sr(),Go=Wr({}),Bo=or(),Ko=wo((e=>"string"==typeof e||"number"==typeof e?Number(e):e),Sr().refine((e=>Number.isFinite(e)&&e>0))),Yo=Gr([function(e,t){return new e({type:"date",...E(t)})}(qr,Xo),or().transform((e=>new Date(e)))]);var Xo;const Qo=or(),es=or().regex(/^https:\/\/.+$/),ts=or().min(1).refine((e=>!/^(javascript|data|blob|vbscript):/i.test(e)),{message:"Blocked URL scheme"}).refine((e=>/^[a-zA-Z][a-zA-Z0-9+\-.]*:\/?\/?/.test(e)),{message:"Must be a valid URL with a scheme (e.g. https://, myapp://)"}),ns=or().length(2),rs=or().length(2),os=or().length(3),ss=Gr([function(e){return ln(vr,e)}(),function(e){return fn(wr,e)}()]),is=Wr({ip_address:ss,alpha3_country_code:os,state_code:Gr([ns,ro("")])}),as=Gr([or(),Wr({network:or()})]).transform((e=>"string"==typeof e?e:e.network)),us=or(),cs=or(),ps=Gr([cs,us]),ds=or(),ls=or(),fs=or(),hs=or(),ms=or(),ys=Uo,_s=Qr(ds,ys),gs=Wr({asset:ps,amount:Uo}),vs=Wr({token:us,amount:Uo}),ws=Wr({min:Uo.optional(),max:Uo.optional()}),bs=to(["CREDIT_CARD","DEBIT_CARD","ACH","FIAT_BALANCE","TOKEN_BALANCE","APPLE_PAY","PAYPAL","VENMO","REVOLUT","GOOGLE_PAY","SEPA","FASTER_PAYMENTS","PIX","UPI","WIRE"]),xs=or(),ks=Wr({kind:Gr([ro("amount"),ro("amount-downstream")]),asset:ps,given:Uo,limits:ws,downstream_limits:ws.optional(),source:or(),message:or(),reason:to(["TOO_LOW","TOO_HIGH","UNEXPECTEDLY_LOW","UNEXPECTEDLY_HIGH","NO_VALID_AMOUNT","UNKNOWN"])}),Is=Wr({kind:ro("funding"),token:us,balance:Jo}),zs=Wr({kind:ro("owner"),message:or(),mitigation:Gr([ro("change"),ro("verify")])}),Os=Wr({kind:ro("geolocation"),message:or()}),Es=Wr({kind:ro("other"),message:or()}),Ss=Wr({kind:ro("payin_method"),message:or()}),Rs=Wr({kind:ro("provider"),message:or()}),Ps=Wr({kind:ro("unknown"),message:or()}),Ts=Gr([ks,Is,zs,Os,Es,Ss,Rs,Ps]),As=Gr([Wr({issuer:or(),name:or(),symbol:or(),decimals:Sr(),alias:or().optional(),image_url:or().optional()}),Wr({chain:as,address:Mo,name:or(),symbol:or(),decimals:Sr(),alias:or().optional(),image_url:or().optional(),is_native:Ar().optional(),is_oft:Ar().optional(),coingecko_id:or().optional(),wrapper:or().optional()})]),$s=Gr([Wr({chain_id:Nr(),network:or(),address_family:Fo,explorer:dr().optional(),image:dr().optional(),is_testnet:Ar()}),Wr({chain_id:Nr(),network:or(),address_family:Fo,explorer:dr().optional(),image:dr().optional(),is_testnet:Ar(),native_currency:Wr({name:or(),symbol:or(),decimals:Sr()}),rpc:dr().optional()})]),Ns=to(["USER","DEST","HALLIDAY","SPW","REV_SHARE","BRIDGE"]),Cs=to(["APPROVAL","BALANCE","SIDE_EFFECT"]),Zs=Wr({asset:ps,property:Cs}),js=Wr({account:Ns,resource:Zs}),Ms=Wr({consume:Lr(js),produce:Lr(js)}),Ds=js.extend({sau:Jo}),Fs=Wr({consume:Lr(Ds),produce:Lr(Ds)}),Us=Wr({type:or()}),qs=Wr({type:or(),custom_actions:jr().optional()}),Vs=Gr([ro("QUOTE_SIGNER"),ro("AUCTION_AUTHORITY"),ro("TEST_FUNDER"),ro("SOLVER")]),Ls=Do.partial(),Js=Wr({purpose:or().toUpperCase().pipe(Vs)}),Ws=Wr({evm:Lr(Ro)}),Hs=or().overwrite((e=>e.toLowerCase())),Gs=Wr({name:or(),alpha2:rs,alpha3:os}),Bs=to(["INITIALIZED","PAYMENT_SUBMITTED","COMPLETED","FAILED","NOT_FOUND"]),Ks=Wr({alpha3_country_code:os,state_code:ns}),Ys=to(["BETA_EDGES","ORG_BETA_EDGES","ORG_EDGES"]),Xs=Wr({sandbox:Lo.optional(),assets:Lr(ps).optional()}),Qs=Qr(ds,As),ei=Wr({sandbox:Lo.optional()}),ti=Qr(ls,$s),ni=Wr({sandbox:Lo.optional(),inputs:Lr(ps).optional(),outputs:Lr(ps),onramps:Lr(Hs).optional(),offramps:Lr(Hs).optional(),features:Lr(Ys).optional()}),ri=Wr({sandbox:Lo.optional(),inputs:Lr(ps),outputs:Lr(ps).optional(),onramps:Lr(Hs).optional(),offramps:Lr(Hs).optional(),features:Lr(Ys).optional()}),oi=Wr({fiats:Lr(cs),tokens:Lr(us)}),si=Qr(ds,oi),ii=Wr({providers:Qr(or(),Lr(bs))}),ai=or().superRefine(((e,t)=>{e.startsWith("mailto:")?0===e.slice(7).trim().length&&t.addIssue({code:bo,message:"mailto address must not be empty"}):e.startsWith("tel:")?0===e.slice(4).trim().length&&t.addIssue({code:bo,message:"tel address must not be empty"}):t.addIssue({code:bo,message:"AddressUrl must use either mailto: or tel: scheme"})})),ui=Wr({includes:Lr(or()).optional(),excludes:Lr(or()).optional()}),ci=to(["pending","accepted","declined","cancelled"]),pi=or();class di{}di.MAX_REV_SHARE_PCT="2.5";const li=qo.refine((e=>Number(e)>0&&Number(e)<=Number(di.MAX_REV_SHARE_PCT)),{message:`Percentage must be between 0 and ${di.MAX_REV_SHARE_PCT}`}),fi=Wr({gas_fee_subsidization:qo.optional()}),hi=cr(),mi=cr(),yi=cr(),_i=Wr({name:or().trim().min(1)}),gi=Wr({id:hi,name:or()}),vi=Wr({label:or(),perms:ui}),wi=Wr({label:or(),public_key:or(),secret_key:or()}),bi=Wr({public_key:or(),label:or().optional(),perms:ui.optional()}),xi=Wr({public_key:or()}),ki=Lr(Wr({label:or().nullable(),public_key:or(),perms:ui,created_at:Yo})),Ii=Wr({user_id:yi.optional()}),zi=Lr(Wr({org_id:hi,user_id:yi,created_at:Yo,updated_at:Yo,perms:ui,user_address:ai})),Oi=Wr({user_id:yi,perms:ui}),Ei=Wr({user_id:yi}),Si=Lr(Wr({id:hi,name:or(),created_at:Yo})),Ri=or().transform(((e,t)=>{const[n,o]=e.split("_");if(!o||!n)return t.addIssue({code:"custom",message:"Pagination key must contain org_id and iso_timestamp separated by '_'"}),r;const s=hi.safeParse(n);if(!s.success)return t.addIssue({code:"custom",message:"Invalid org_id in pagination key"}),r;const i=new Date(o);return isNaN(i.getTime())?(t.addIssue({code:"custom",message:"Invalid ISO timestamp in pagination key"}),r):{timestamp:i,org_id:s.data}})),Pi=Wr({limit:function(e){return function(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}(Er,e)}().int().positive().default(25),pagination_key:Ri.optional()}),Ti=Wr({orgs:Lr(Wr({id:hi,name:or(),membership:Wr({user_id:yi,user_address:ai,member_since:Yo,updated_at:Yo,effective_permissions:Lr(Wr({key:or(),description:or()}))})})),next_pagination_key:or().nullable()}),Ai=Wr({invitee_address:or(),perms:ui}),$i=Wr({statuses:ci.array().optional()}),Ni=Wr({statuses:ci.array().optional()}),Ci=Lr(Wr({id:mi,org_id:hi,org_name:or(),inviter:or(),invitee_address:ai,status:ci,created_at:Yo,updated_at:Yo})),Zi=Wr({id:mi,status:ci}),ji=Wr({id:mi}),Mi=Wr({user_id:yi}),Di=Wr({id:hi}),Fi=Wr({name:or().trim().min(1).optional()}).refine((e=>Object.keys(e).length>0),{message:"At least one field must be provided"}),Ui=Wr({name:or(),percentage:li,preferred_tokens:Lr(us),addresses:Do.partial(),allow_arbitrary:Ar()}),qi=Wr({name:or(),percentage:li.optional(),preferred_tokens:Lr(us).optional(),addresses:Do.partial().optional(),allow_arbitrary:Ar().optional()}),Vi=Wr({id:cr(),org_id:hi,name:or(),percentage:Uo,preferred_tokens:Lr(us),addresses:Do.partial(),allow_arbitrary:Ar(),created_by:or(),created_at:Yo,updated_at:Yo}),Li=Wr({name:or().optional()}),Ji=Wr({name:or()}),Wi=Lr(Vi),Hi=Vi,Gi=Vi,Bi=Wr({name:or(),percentage:Uo,preferred_tokens:Lr(us),addresses:Do.partial(),allow_arbitrary:Ar()}),Ki=Wr({org_id:hi,credit:Jo,sandbox:Ar()}),Yi=Wr({org_id:hi,features:Lr(pi)}),Xi=Wr({org_id:hi,config:fi}),Qi=Wr({id:hi,name:or(),created_at:Yo,features:Lr(pi),config:fi.optional()}),ea=Wr({fiat:cs,tokens:Lr(us)}),ta=Wr({spw_address:or(),chains:Lr(as).optional()}),na=Wr({chain:as,counterfactual_exists:Ar()}),ra=Wr({workflow_id:or(),chain_infos:Lr(na)}),oa=ra.nullable(),sa=Wr({workflow_ids:Lr(cr()).optional(),verification_code:or()}),ia=js.extend({amount:Uo}),aa=Ms.extend({consume:Lr(ia),produce:Lr(ia)}),ua=ia.extend({tx_id:or().optional()}),ca=Wr({consume:Lr(ua),produce:Lr(ua)}),pa=Gr([ro("COMPLETE"),ro("UNREACHABLE"),ro("FAILED")]),da=Gr([ro("PENDING"),ro("ATTEMPT_FAILED")]),la=Gr([pa,da]),fa=Wr({service_ids:Lr(or()),latency_seconds:Sr(),issues:ao(Lr(Ts))}),ha=Gr([ro("PENDING"),ro("COMPLETE"),ro("FAILED"),ro("EXPIRED")]),ma=Gr([...ha.options,ro("WITHDRAWN"),ro("TAINTED"),ro("UNCONFIRMED"),ro("WITHDRAW_PENDING")]),ya=Wr({total_fees:or(),conversion_fees:or(),network_fees:or(),business_fees:or(),currency_symbol:cs}),_a=Wr({kind:ro("FIXED_INPUT"),fixed_input_amount:gs,output_asset:ps,custom_actions:jr().optional(),dest_address:Mo.optional()}),ga=to(["ONRAMP","ONCHAIN_STEP","USER_FUND"]),va=Wr({type:ga,net_effect:aa,pieces_info:Lr(qs),step_index:Sr().optional(),custom_actions_input_amount:Uo.optional()}),wa=va,ba=Gr([la]),xa=va.extend({status:ba,net_effect:ca,transaction_hash:or().optional()}),ka=Wr({request:Kr("kind",[_a]),price_currency:cs,onramps:Lr(Hs).optional(),onramp_methods:Lr(bs).optional(),customer_ip_address:ss.optional(),customer_id:or().optional(),label:or().max(255).optional(),parent_payment_id:cr().optional(),features:Lr(Ys).optional(),rev_share_name:or().optional(),allow_unsafe_transfer_out:Ar().optional(),show_all_issues:Ar().optional(),allow_exceed_max_input_limit:Ar().optional(),allow_unsafe_slippage:Ar().optional(),use_intent_refund:Ar().optional(),hops:Lr(or()).optional()}),Ia=Wr({input:cs,output:ps,customer_ip_address:ss.optional(),features:Lr(Ys).optional()}),za=Wr({customer_ip_address:ss.optional()}),Oa=Wr({alpha3_country_code:os,state_code:Gr([ns,ro("")]),default_currency:or().optional()}),Ea=Wr({fees:ya.optional(),output_amount:gs.optional(),onramp:Hs.optional(),onramp_method:bs.optional()}),Sa=Ea.extend({route:Lr(xa)}),Ra=Ea.extend({fees:ya,output_amount:gs,route:Lr(wa),latency_seconds:Sr().optional()}),Pa=Ra.extend({payment_id:or()}),Ta=Wr({quote_request:ka,quotes:Lr(Pa),current_prices:_s,price_currency:cs,state_token:or(),quoted_at:Yo,accept_by:Yo,fault:Ts.nullable(),failures:Lr(fa),limits:Lr(ws)}),Aa=or().transform(((e,t)=>{const[n,o]=e.split("_");if(!o||!n)return t.addIssue({code:bo,message:"Pagination key must contain workflow_id and iso_timestamp separated by '_'"}),r;const s=new Date(o);return isNaN(s.getTime())?(t.addIssue({code:bo,message:"Invalid ISO timestamp in pagination key"}),r):36!==n.length?(t.addIssue({code:bo,message:"Invalid workflow_id in pagination key"}),r):{timestamp:s,workflow_id:n}})),$a=to(["ALL","NEW_OR_FUNDED"]),Na=Wr({id_query:or().optional(),pagination_key:Aa.optional(),dest_address:Mo.optional(),owner_address:Mo.optional(),limit:Ko.default(25),category:$a.default("NEW_OR_FUNDED"),label:or().optional()}),Ca=Na.extend({owner_address:Mo}),Za=to(["intent","spw"]),ja=to(["INTENT","SPW"]),Ma=to(["EIP712","EIP191"]),Da=Wr({workflow_id:cr(),token_amounts:Lr(vs),recipient_address:Mo,accept_blame:Lo.optional().default(!0),account_type:Za.optional(),withdraw_account:ja.optional()}),Fa=Kr("type",[Wr({type:ro("eip712"),signature_type:Ma,workflow_id:or(),payload:or(),state_token:or()}),Wr({type:ro("erc191"),signature_type:Ma,workflow_id:or(),payload:or(),state_token:or()})]),Ua=Wr({workflow_id:cr(),token_amounts:Lr(vs),recipient_address:Mo,accept_blame:Lo.optional().default(!0),signature:Qo,payload:or().optional(),account_type:Za.optional(),withdraw_account:ja.optional(),polling_timeout:Sr().int().nonnegative().max(3e5).optional().default(3e5)}),qa=Wr({signature:Qo,state_token:or(),polling_timeout:Sr().int().nonnegative().max(3e5).optional().default(3e5)}),Va=Wr({workflow_id:or(),tx_id:Bo}),La=Wr({payment_id:cr(),state_token:or(),owner_chain:as.optional(),owner_address:Mo,destination_address:Mo}),Ja=to(["OWNER_VERIFY","SIMULATE_WITHDRAWAL"]),Wa=to(["EVM_OWNER","EVM_WITHDRAWAL"]),Ha=Wr({type:ro("ONRAMP"),payment_id:or(),funding_page_url:es,deposit_info:Lr(Wr({deposit_token:us,deposit_amount:Uo,deposit_address:Mo,deposit_chain:as}))}),Ga=Wr({type:ro("TRANSFER_IN"),payment_id:or(),funding_page_url:es,deposit_info:Lr(Wr({deposit_token:us,deposit_amount:Uo,deposit_address:Mo,deposit_chain:as}))}),Ba=Wr({type:ro("USER_VERIFY"),verification_token:or(),verifications:Lr(Wr({reason:Wa,signature_type:Ma,payload:or()}))}),Ka=Kr("type",[Ha,Ga,Ba]),Ya=Wr({status:Gr([ro("PENDING"),ro("SUCCESS"),ro("FAILED"),ro("EXPIRED")]),token_amounts:Lr(vs),recipient_address:or(),transaction_hash:or().nullable(),issues:Lr(Ts).nullable()}),Xa=Wr({payment_id:or(),org_id:hi,status:ma,funded:Ar(),created_at:Yo,updated_at:Yo,initiate_fund_by:Yo,completed_at:Yo.optional(),quote_request:ka.optional(),quoted:Ra,fulfilled:Sa,current_prices:_s,price_currency:cs,customer_id:or().optional(),label:or().optional(),processing_addresses:Lr(Wr({chain:or(),address:Mo})),owner_chain:as,owner_address:Mo,destination_address:Mo,next_instruction:Ka.optional(),issues:Lr(Ts).optional(),withdrawals:Lr(Ya).nullable(),parent_payment_id:cr().optional(),client_redirect_url:ts.nullable()}),Qa=Wr({payment_statuses:Lr(Xa),next_pagination_key:or().nullable()}),eu=to(["COMPLETED","FUNDED"]),tu=Wr({payment_id:cr(),state_token:or(),owner_chain:as.optional(),owner_address:Mo,destination_address:Mo,client_redirect_url:ts.optional(),client_redirect_after:eu.optional().default("COMPLETED"),allow_unsafe_owner:Ar().optional(),simulate_withdrawal:Ar().optional(),payment_expiration_minutes:Sr().int().positive().max(60).optional()}),nu=Wr({verification_token:or(),signatures:Lr(Wr({reason:Wa,signature:or()}))}),ru=Gr([tu,nu]),ou=Gr([Xa,Wr({next_instruction:Ka})]),su=Wr({payment_id:cr(),enable_withdraw_pending:Ar().optional()}),iu=Wr({payment_id:cr(),redirect_url:es,referrer_domain:es.optional()}),au=Wr({funding_page_onramp_url:es,client_secret:or().optional(),client_redirect_url:ts.nullable(),onramp_redirect_url:ts}),uu=Wr({payment_id:cr(),token_amounts:Lr(vs),recipient_address:Mo,account_type:Za.optional(),withdraw_account:ja.optional()}),cu=Kr("type",[Wr({type:ro("eip712"),signature_type:Ma,payment_id:or(),withdraw_authorization:or(),state_token:or()}),Wr({type:ro("erc191"),signature_type:Ma,payment_id:or(),withdraw_authorization:or(),state_token:or()})]),pu=Wr({payment_id:cr(),token_amounts:Lr(vs),recipient_address:Mo,owner_signature:Qo,payload:or().optional(),account_type:Za.optional(),withdraw_account:ja.optional(),polling_timeout:Sr().int().nonnegative().max(3e5).optional().default(3e5)}),du=Wr({signature:Qo,state_token:or(),polling_timeout:Sr().int().nonnegative().max(3e5).optional().default(3e5)}),lu=Wr({payment_id:or(),status:Gr([ro("SUCCESS"),ro("PENDING")]),transaction_hash:Bo.nullable()}),fu=Wr({payment_id:cr().optional(),custom_queries:Lr(Wr({address:Mo,token:us})).optional(),near_queries:Lr(Wr({address:Mo,token:us})).optional()}),hu=Wr({address:Mo,token:us,account:Za,withdraw_account:ja.default("SPW"),value:Gr([Wr({kind:ro("amount"),amount:Uo,withdrawal_fee:Uo.nullable()}),Wr({kind:ro("error")})])}),mu=Wr({balance_results:Lr(hu)}),yu=Qr(or(),jr()).nullable(),_u=Wr({domain:Qr(or(),jr()),types:Qr(or(),Lr(Wr({name:or(),type:or()}))),primaryType:or(),message:Qr(or(),jr())}),gu=Wr({owner_address:Mo,typed_data:_u,signature:Qo,login:yu.optional()}),vu=Wr({}),wu=Wr({address:Mo}),bu=Wr({verified:Ar(),login:Lr(or()).nullable()}).nullable(),xu=or().refine((e=>/^[a-zA-Z_]{3,}$/.test(e)),{message:"Invalid fiat"}),ku=Wr({issuer:or(),name:or(),alias:or().optional(),symbol:or(),decimals:Sr(),sign:or().optional()}),Iu=or(),zu=or().regex(/^[a-zA-Z]\w{1,7}$/,{message:"Must be a short alpha-numeric symbol"}),Ou=Sr().min(0).max(18),Eu=or().url(),Su=or(),Ru=Wr({chain:or(),address:So}),Pu=Wr({chain:ro("solana"),address:Po}),Tu=Wr({chain:or(),address:or()}),Au=Gr([Ru,Pu,Tu]),$u=or().refine((e=>{const[t,n]=e.split(":");return Au.safeParse({chain:t,address:n}).success}),{message:"Invalid token"}),Nu=Wr({name:Iu,symbol:zu,decimals:Ou,alias:zu.optional(),image_url:Eu.optional(),coingecko_id:Su.optional(),wrapper:zu.optional(),is_native:Ar().optional()}),Cu=Ru.extend(Nu.shape),Zu=Pu.extend(Nu.shape),ju=Gr([Cu,Zu,Tu.extend(Nu.shape)]),Mu=Gr([$u,xu]),Du=Gr([ju,ku]),Fu=Kr("type",[Wr({type:ro("chain"),chain:or()}),Wr({type:ro("issuer"),issuer:or()})]),Uu=wo((e=>"string"==typeof e?e.toUpperCase():e),to(["ONRAMP","OFFRAMP"])),qu=Wr({to:Ro,from:Ro.optional(),nonce:Sr().optional(),gasLimit:Nr().optional(),gasPrice:Nr().optional(),maxPriorityFeePerGas:Nr().optional(),maxFeePerGas:Nr().optional(),data:or().optional(),value:Nr().optional(),chainId:Sr()}),Vu=Wr({transactionHash:or().optional(),blockHash:or().optional(),blockNumber:Sr().optional(),from:Ro.optional(),to:Ro.optional(),rawReceipt:jr()}),Lu=Wr({chain_id:Nr(),network:or(),address_family:function(e){return function(e,t){return new e({type:"undefined",...E(t)})}(Cr,e)}(),explorer:dr().optional(),image:dr().optional(),is_testnet:Ar()}),Ju=Lu.extend({address_family:ro("EVM"),native_currency:Wr({name:or(),symbol:or(),decimals:Sr()}),rpc:or().optional()}),Wu=Lu.extend({address_family:ro("SOL")}),Hu=Kr("address_family",[Ju,Wu,Lu]),Gu=bs;class Bu{static stringify(e,t){return JSON.stringify(e,(this??Bu).replacer,t)}static parse(e){return JSON.parse(e,(this??Bu).reviver)}}Bu.replacer=(e,t)=>"bigint"==typeof t?{"#":t.toString()}:t,Bu.reviver=(e,t)=>t&&"object"==typeof t&&"#"in t&&1===Object.keys(t).length?BigInt(t["#"]):t;var Ku,Yu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Xu={};!function(){return Ku||(Ku=1,function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof Yu?Yu:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=r(e);function r(e,t){return function(n,r){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0!==t.Reflect&&(n=r(t.Reflect,n)),function(e,t){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,o=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!i&&!a,c={create:i?function(){return de(Object.create(null))}:a?function(){return de({__proto__:null})}:function(){return de({})},has:u?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},p=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:ue(),l="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:ce(),f="function"==typeof WeakMap?WeakMap:pe(),h=r?Symbol.for("@reflect-metadata:registry"):void 0,m=oe(),y=se(m);function _(e,t,n,r){if(j(n)){if(!W(e))throw new TypeError;if(!G(t))throw new TypeError;return E(e,t)}if(!W(e))throw new TypeError;if(!F(t))throw new TypeError;if(!F(r)&&!j(r)&&!M(r))throw new TypeError;return M(r)&&(r=void 0),S(e,t,n=J(n),r)}function g(e,t){function n(n,r){if(!F(n))throw new TypeError;if(!j(r)&&!B(r))throw new TypeError;$(e,t,n,r)}return n}function v(e,t,n,r){if(!F(n))throw new TypeError;return j(r)||(r=J(r)),$(e,t,n,r)}function w(e,t,n){if(!F(t))throw new TypeError;return j(n)||(n=J(n)),R(e,t,n)}function b(e,t,n){if(!F(t))throw new TypeError;return j(n)||(n=J(n)),P(e,t,n)}function x(e,t,n){if(!F(t))throw new TypeError;return j(n)||(n=J(n)),T(e,t,n)}function k(e,t,n){if(!F(t))throw new TypeError;return j(n)||(n=J(n)),A(e,t,n)}function I(e,t){if(!F(e))throw new TypeError;return j(t)||(t=J(t)),N(e,t)}function z(e,t){if(!F(e))throw new TypeError;return j(t)||(t=J(t)),C(e,t)}function O(e,t,n){if(!F(t))throw new TypeError;if(j(n)||(n=J(n)),!F(t))throw new TypeError;j(n)||(n=J(n));var r=ae(t,n,!1);return!j(r)&&r.OrdinaryDeleteMetadata(e,t,n)}function E(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!j(r)&&!M(r)){if(!G(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var o=e.length-1;o>=0;--o){var s=(0,e[o])(t,n,r);if(!j(s)&&!M(s)){if(!F(s))throw new TypeError;r=s}}return r}function R(e,t,n){if(P(e,t,n))return!0;var r=ne(t);return!M(r)&&R(e,r,n)}function P(e,t,n){var r=ae(t,n,!1);return!j(r)&&V(r.OrdinaryHasOwnMetadata(e,t,n))}function T(e,t,n){if(P(e,t,n))return A(e,t,n);var r=ne(t);return M(r)?void 0:T(e,r,n)}function A(e,t,n){var r=ae(t,n,!1);if(!j(r))return r.OrdinaryGetOwnMetadata(e,t,n)}function $(e,t,n,r){ae(n,r,!0).OrdinaryDefineOwnMetadata(e,t,n,r)}function N(e,t){var n=C(e,t),r=ne(e);if(null===r)return n;var o=N(r,t);if(o.length<=0)return n;if(n.length<=0)return o;for(var s=new l,i=[],a=0,u=n;a<u.length;a++){var c=u[a];s.has(c)||(s.add(c),i.push(c))}for(var p=0,d=o;p<d.length;p++){c=d[p];s.has(c)||(s.add(c),i.push(c))}return i}function C(e,t){var n=ae(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function Z(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function j(e){return void 0===e}function M(e){return null===e}function D(e){return"symbol"==typeof e}function F(e){return"object"==typeof e?null!==e:"function"==typeof e}function U(e,t){switch(Z(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n="string",r=Y(e,o);if(void 0!==r){var s=r.call(e,n);if(F(s))throw new TypeError;return s}return q(e)}function q(e,t){var n,r,o=e.toString;if(H(o)&&!F(r=o.call(e)))return r;if(H(n=e.valueOf)&&!F(r=n.call(e)))return r;throw new TypeError}function V(e){return!!e}function L(e){return""+e}function J(e){var t=U(e);return D(t)?t:L(t)}function W(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function G(e){return"function"==typeof e}function B(e){switch(Z(e)){case 3:case 4:return!0;default:return!1}}function K(e,t){return e===t||e!=e&&t!=t}function Y(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function X(e){var t=Y(e,s);if(!H(t))throw new TypeError;var n=t.call(e);if(!F(n))throw new TypeError;return n}function Q(e){return e.value}function ee(e){var t=e.next();return!t.done&&t}function te(e){var t=e.return;t&&t.call(e)}function ne(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===p)return t;if(t!==p)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var o=r.constructor;return"function"!=typeof o||o===e?t:o}function re(){var e,n,r,o;j(h)||void 0===t.Reflect||h in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=ie(t.Reflect));var s=new f,i={registerProvider:a,getProvider:c,setProvider:m};return i;function a(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case j(n):n=t;break;case n===t:break;case j(r):r=t;break;case r===t:break;default:void 0===o&&(o=new l),o.add(t)}}function u(t,s){if(!j(n)){if(n.isProviderFor(t,s))return n;if(!j(r)){if(r.isProviderFor(t,s))return n;if(!j(o))for(var i=X(o);;){var a=ee(i);if(!a)return;var u=Q(a);if(u.isProviderFor(t,s))return te(i),u}}}if(!j(e)&&e.isProviderFor(t,s))return e}function c(e,t){var n,r=s.get(e);return j(r)||(n=r.get(t)),j(n)?(j(n=u(e,t))||(j(r)&&(r=new d,s.set(e,r)),r.set(t,n)),n):n}function p(e){if(j(e))throw new TypeError;return n===e||r===e||!j(o)&&o.has(e)}function m(e,t,n){if(!p(n))throw new Error("Metadata provider not registered.");var r=c(e,t);if(r!==n){if(!j(r))return!1;var o=s.get(e);j(o)&&(o=new d,s.set(e,o)),o.set(t,n)}return!0}}function oe(){var e;return!j(h)&&F(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[h]),j(e)&&(e=re()),!j(h)&&F(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function se(e){var t=new f,n={isProviderFor:function(e,n){var r=t.get(e);return!j(r)&&r.has(n)},OrdinaryDefineOwnMetadata:i,OrdinaryHasOwnMetadata:o,OrdinaryGetOwnMetadata:s,OrdinaryOwnMetadataKeys:a,OrdinaryDeleteMetadata:u};return m.registerProvider(n),n;function r(r,o,s){var i=t.get(r),a=!1;if(j(i)){if(!s)return;i=new d,t.set(r,i),a=!0}var u=i.get(o);if(j(u)){if(!s)return;if(u=new d,i.set(o,u),!e.setProvider(r,o,n))throw i.delete(o),a&&t.delete(r),new Error("Wrong provider for target.")}return u}function o(e,t,n){var o=r(t,n,!1);return!j(o)&&V(o.has(e))}function s(e,t,n){var o=r(t,n,!1);if(!j(o))return o.get(e)}function i(e,t,n,o){r(n,o,!0).set(e,t)}function a(e,t){var n=[],o=r(e,t,!1);if(j(o))return n;for(var s=X(o.keys()),i=0;;){var a=ee(s);if(!a)return n.length=i,n;var u=Q(a);try{n[i]=u}catch(e){try{te(s)}finally{throw e}}i++}}function u(e,n,o){var s=r(n,o,!1);if(j(s))return!1;if(!s.delete(e))return!1;if(0===s.size){var i=t.get(n);j(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}}function ie(e){var t=e.defineMetadata,n=e.hasOwnMetadata,r=e.getOwnMetadata,o=e.getOwnMetadataKeys,s=e.deleteMetadata,i=new f;return{isProviderFor:function(e,t){var n=i.get(e);return!(j(n)||!n.has(t))||!!o(e,t).length&&(j(n)&&(n=new l,i.set(e,n)),n.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:s}}function ae(e,t,n){var r=m.getProvider(e,t);if(!j(r))return r;if(n){if(m.setProvider(e,t,y))return y;throw new Error("Illegal state.")}}function ue(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[s]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,o=n+1;o<r;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,K(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[s]=function(){return this.entries()},t.prototype._find=function(e,t){if(!K(this._cacheKey,e)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++)if(K(this._keys[n],e)){this._cacheIndex=n;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}function ce(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[s]=function(){return this.keys()},e}()}function pe(){var e=16,t=c.create(),r=o();return function(){function e(){this._key=o()}return e.prototype.has=function(e){var t=s(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=s(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){return s(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=s(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=o()},e}();function o(){var e;do{e="@@WeakMap@@"+u()}while(c.has(t,e));return t[e]=!0,e}function s(e,t){if(!n.call(e,r)){if(!t)return;Object.defineProperty(e,r,{value:c.create()})}return e[r]}function i(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function a(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):i(t,e),t}return i(new Array(e),e)}function u(){var t=a(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var o=t[r];4!==r&&6!==r&&8!==r||(n+="-"),o<16&&(n+="0"),n+=o.toString(16).toLowerCase()}return n}}function de(e){return e.__=void 0,delete e.__,e}e("decorate",_),e("metadata",g),e("defineMetadata",v),e("hasMetadata",w),e("hasOwnMetadata",b),e("getMetadata",x),e("getOwnMetadata",k),e("getMetadataKeys",I),e("getOwnMetadataKeys",z),e("deleteMetadata",O)}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(e||(e={}))),Xu;var e}();const Qu=Symbol("api-method-metadata"),ec=new Map,tc=e=>(t,n)=>{Reflect.defineMetadata(Qu,e,t,n);const r=e.httpVerb,o=e.endpoint,s=`${r.toLowerCase()} ${o}`;ec.set(s,e);const i=t.constructor;"function"!=typeof i.toJSON&&Object.defineProperty(i,"toJSON",{value:e=>Reflect.getMetadata(Qu,i.prototype,e),writable:!1,configurable:!1})},nc={enabled:!0,debug:!1},rc=(e,t=nc)=>{if(t.enabled)try{const n=((e,t=xo)=>{if(!e)return"";let n=new URL(e,t).pathname;return n=n.replace(/\/[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}/gi,""),n})(e.config.url||"");if(!n)return void(t.debug&&console.debug("[HallidayPaymentsApiClient] No endpoint found in URL:",e.config.url));const r=`${e.config.method?.toLowerCase()||"get"} ${n}`,o=ec.get(r)?.outputSchema;if(!o)return void(t.debug&&console.debug(`[HallidayPaymentsApiClient] No validation schema defined for endpoint: ${n}`));const s=o.safeParse(e.data);s.success||(console.warn(`[HallidayPaymentsApiClient] Response validation failed for ${n}. Your SDK version might be outdated - please check for updates.`),t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",s.error))}catch(e){t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",e)}};var oc;exports.ErrorCodes=void 0,(oc=exports.ErrorCodes||(exports.ErrorCodes={})).VALIDATION_ERROR="VALIDATION_ERROR",oc.API_ERROR="API_ERROR",oc.SERVER_ERROR="SERVER_ERROR",oc.NETWORK_ERROR="NETWORK_ERROR",oc.UNKNOWN_ERROR="UNKNOWN_ERROR";class sc extends Error{constructor({message:e,code:t,status:n,statusText:r,reqHeaders:o,resHeaders:s,data:i,config:a,request:u,response:c,error:p,validationIssues:d,validationMessage:l}){super(e),this.name="HallidayPaymentsApiClientError",this.validationIssues=null,this.validationMessage=null,this.status=null,this.statusText=null,this.reqHeaders=null,this.resHeaders=null,this.data=null,this.config=null,this.request=null,this.response=null,this.error=null,this.code=t,this.message=e,this.status=n??null,this.statusText=r??null,this.reqHeaders=o??null,this.resHeaders=s??null,this.data=i??null,this.config=a??null,this.request=u??null,this.response=c??null,this.error=p??null,this.validationIssues=d??null,this.validationMessage=l??null,Object.setPrototypeOf(this,sc.prototype)}static isPaymentsApiClientError(e){return e instanceof sc}static parseValidationError({message:e,error:t}){return new sc({message:e??t?.message??"Validation error",code:exports.ErrorCodes.VALIDATION_ERROR,validationIssues:t instanceof Un?t.issues:null,validationMessage:t instanceof Un?t.message:null,...void 0!==t&&{error:t}})}static parseAxiosError(e){if(e.response){const t=e.response.status;let n=e.response.data?.errors||[],r=null;Array.isArray(n)||(n=[n]);let o=n.map((e=>"string"!=typeof e?JSON.stringify(e):e)).join("\n")||e.message||"Unknown error",s=e.response?.statusText;return 500===t?new sc({message:o,code:exports.ErrorCodes.SERVER_ERROR,status:500,statusText:`${e.code??"500"}: ${s??"Server Error"}`,data:e.response?.data,...void 0!==e.config&&{config:e.config},request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers}):(400===t?(o=`Bad request: ${o}`,s=`${e.code??"400"}: ${s??"Bad Request"}`,r=n):401===t?(o=`Unauthorized: ${o}`,s=`${e.code??"401"}: ${s??"Unauthorized"}`):403===t?(o=`Forbidden: ${o}`,s=`${e.code??"403"}: ${s??"Forbidden"}`):404===t?(o=`Resource not found: ${o}`,s=`${e.code??"404"}: ${s??"Not Found"}`):(o=`Request failed with status ${t}: ${o}`,s=`${e.code??t}: ${s??"Unexpected error"}`),new sc({message:o,code:exports.ErrorCodes.API_ERROR,status:t,statusText:s,data:e.response?.data,...void 0!==e.config&&{config:e.config},request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers,validationIssues:r}))}return e.request?new sc({message:e.message||`No response received from the server: ${e.code}`,code:exports.ErrorCodes.NETWORK_ERROR,...void 0!==e.config&&{config:e.config},request:e.request,reqHeaders:e.request?.headers}):"ERR_CANCELED"===e.code?null:new sc({message:`${e.code?`${e.code}: `:""}${e.message||"No message"}`,code:exports.ErrorCodes.NETWORK_ERROR,...void 0!==e.config&&{config:e.config},request:e.request,error:e})}toJSON(){return JSON.stringify({name:this.name,code:this.code,message:this.message,validationIssues:this.validationIssues,status:this.status,statusText:this.statusText,config:this.config,stack:this.stack})}}const ic=({apiKey:t,baseUrl:n=xo,responseValidationOptions:r=nc})=>{if(!ko.test(n))throw new Error(`Invalid base URL: ${n}`);if(!t)throw new Error("API key is required");const o=e.create({baseURL:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},parseReviver:Bu.reviver}),s=(i=r,{onFulfilled:e=>(rc(e,i),e),onRejected:e=>{throw e}});var i;o.interceptors.response.use(s.onFulfilled,s.onRejected);const a={onFulfilled:e=>e,onRejected:t=>{if(e.isAxiosError(t)){const e=sc.parseAxiosError(t);if(e)throw e;return{data:null}}throw new sc({message:t.message||"Unknown error",code:exports.ErrorCodes.UNKNOWN_ERROR,error:t})}};return o.interceptors.response.use(a.onFulfilled,a.onRejected),o},ac=e=>Object.entries(e).reduce(((e,[t,n])=>{if("sandbox"===t)e.push("sandbox="+(!0===n?"true":"false"));else if(Array.isArray(n))for(const r of n)e.push(`${t}[]=${r}`);else e.push(`${t}=${n}`);return e}),[]).join("&");class uc{constructor(e){this.getChains=async(e=!1)=>{const{data:t}=await this.apiClient.get("/chains?sandbox="+(e?"true":"false"));return t},this.getAssetDetails=async({assets:e=[],sandbox:t})=>{if("boolean"!=typeof t)throw sc.parseValidationError({message:"Invalid sandbox value"});let n=`sandbox=${t}`;if(e){if(!Array.isArray(e))throw sc.parseValidationError({message:"Invalid assets"});for(const t of e)try{n+=`&assets[]=${Mu.parse(t)}`}catch(e){throw sc.parseValidationError({message:`Invalid asset: ${t}`,error:e})}}return(await this.apiClient.get(`/assets?${n}`)).data},this.getInputs=async e=>{let t;try{const n=ni.parse(e);t=ac(n)}catch(e){throw sc.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-inputs?${t}`)).data},this.getOutputs=async e=>{let t;try{const n=ri.parse(e);t=ac(n)}catch(e){throw sc.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-outputs?${t}`)).data},this.getQuotes=async(e,t)=>{let n;try{n=ka.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for quotes",error:e})}return(await this.apiClient.post("/payments/quotes",n,{...void 0!==t&&{signal:t}})).data},this.confirmQuote=async e=>{let t;try{t=tu.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for confirming quote",error:e})}return(await this.apiClient.post("/payments/confirm",t)).data},this.createPaymentSession=async e=>{let t;try{t=iu.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for onramp session",error:e})}return(await this.apiClient.post("/onramp",t)).data},this.getStatus=async(e,t)=>{try{cr().parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid payment ID",error:e})}const n=new URLSearchParams;n.set("payment_id",e);const r=n.toString();return(await this.apiClient.get(`/payments?${r}`,{...void 0!==t&&{signal:t}})).data},this.getPaymentsHistory=async e=>{const t=Na.omit({pagination_key:!0}).extend({pagination_key:or().optional()});let n;try{n=t.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for payments",error:e})}const r=new URLSearchParams;n.id_query&&r.set("id_query",n.id_query),n.pagination_key&&r.set("pagination_key",n.pagination_key),n.dest_address&&r.set("dest_address",n.dest_address),n.owner_address&&r.set("owner_address",n.owner_address),n.limit&&r.set("limit",n.limit.toString()),n.category&&r.set("category",n.category),n.label&&r.set("label",n.label);let o=r.toString();o&&(o=`?${o}`);return(await this.apiClient.get(`/payments/history${o}`)).data},this.getBalance=async e=>{let t;try{t=fu.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for balance",error:e})}return(await this.apiClient.post("/payments/balances",t)).data},this.getPrices=async e=>{let t;try{t=ea.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for prices",error:e})}return(await this.apiClient.post("/prices",t)).data},this.getWithdrawAuthorization=async e=>{let t;try{t=uu.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for withdraw authorization",error:e})}return(await this.apiClient.post("/payments/withdraw",t)).data},this.withdraw=async e=>{let t;try{t=du.parse(e)}catch(e){throw sc.parseValidationError({message:"Invalid request for withdraw",error:e})}return(await this.apiClient.post("/payments/withdraw/confirm",t)).data};const{apiKey:t,baseUrl:n=xo,responseValidation:r={}}=e,o={...nc,...r};this.apiClient=ic({baseUrl:n,apiKey:t,responseValidationOptions:o})}static toJSON(e){return Reflect.getMetadata(Qu,this.prototype,e)}}t([tc({description:"Retrieves the supported chain configuration.",httpVerb:"GET",endpoint:"/chains",inputSchema:Ar().optional(),outputSchema:Qr(or(),Hu)}),n("design:type",Object)],uc.prototype,"getChains",void 0),t([tc({description:"Retrieves the asset details for all or the specified assets.",httpVerb:"GET",endpoint:"/assets",inputSchema:Wr({assets:Lr(Mu).optional(),sandbox:Ar().optional()}),outputSchema:Qr(Mu,Du)}),n("design:type",Object)],uc.prototype,"getAssetDetails",void 0),t([tc({description:"Retrieves the supported inputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-inputs",inputSchema:ni,outputSchema:Qr(Mu,Wr({fiats:Lr(xu),tokens:Lr($u)}))}),n("design:type",Object)],uc.prototype,"getInputs",void 0),t([tc({description:"Retrieves the supported outputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-outputs",inputSchema:ri,outputSchema:Qr(Mu,Wr({fiats:Lr(xu),tokens:Lr($u)}))}),n("design:type",Object)],uc.prototype,"getOutputs",void 0),t([tc({description:"Retrieves quotes for the given input and output asset.",httpVerb:"POST",endpoint:"/payments/quotes",inputSchema:ka,outputSchema:Ta}),n("design:type",Object)],uc.prototype,"getQuotes",void 0),t([tc({description:"Confirms a quote.",httpVerb:"POST",endpoint:"/payments/confirm",inputSchema:tu,outputSchema:ou}),n("design:type",Object)],uc.prototype,"confirmQuote",void 0),t([tc({description:"Creates a onramp provider session for a given payment.",httpVerb:"POST",endpoint:"/onramp",inputSchema:iu,outputSchema:au}),n("design:type",Object)],uc.prototype,"createPaymentSession",void 0),t([tc({description:"Retrieves the status of a given payment.",httpVerb:"GET",endpoint:"/payments",inputSchema:cr(),outputSchema:Xa}),n("design:type",Object)],uc.prototype,"getStatus",void 0),t([tc({description:"Retrieves the payments history of a given destination address.",httpVerb:"GET",endpoint:"/payments/history",inputSchema:Na,outputSchema:Qa}),n("design:type",Object)],uc.prototype,"getPaymentsHistory",void 0),t([tc({description:"Retrieves the balance of a given workflow or spw address.",httpVerb:"POST",endpoint:"/payments/balances",inputSchema:fu,outputSchema:mu}),n("design:type",Object)],uc.prototype,"getBalance",void 0),t([tc({description:"Retrieves the prices tokens in a given fiat currency.",httpVerb:"POST",endpoint:"/prices",inputSchema:ea,outputSchema:_s}),n("design:type",Object)],uc.prototype,"getPrices",void 0),t([tc({description:"Retrieves the withdraw authorization for a given workflow.",httpVerb:"POST",endpoint:"/payments/withdraw",inputSchema:uu,outputSchema:cu}),n("design:type",Object)],uc.prototype,"getWithdrawAuthorization",void 0),t([tc({description:"Submits the owner signature for a withdraw payload.",httpVerb:"POST",endpoint:"/payments/withdraw/confirm",inputSchema:du,outputSchema:lu}),n("design:type",Object)],uc.prototype,"withdraw",void 0),exports.Account=Ns,exports.Address=Mo,exports.AddressFamily=Fo,exports.AddressFamilyMap=Do,exports.AddressUrl=ai,exports.AleoAddress=No,exports.Amount=Uo,exports.Asset=Mu,exports.AssetDetails=Du,exports.AssetKey=ds,exports.Balance=Vo,exports.BlockNumber=Wo,exports.Bool=Lo,exports.BtcAddress=To,exports.ChainConfig=Hu,exports.ChainKey=ls,exports.ClientRedirectAfter=eu,exports.Constants=di,exports.CountryAlpha2=rs,exports.CountryAlpha3=os,exports.CountryCode=Gs,exports.DogeAddress=Co,exports.EIP712TypedData=_u,exports.EVMAddress=Ro,exports.EVMChainConfig=Ju,exports.EVMTokenAddress=So,exports.EVMTokenDetails=Cu,exports.Feature=Ys,exports.Fiat=xu,exports.FiatDetails=ku,exports.FiatKey=fs,exports.FulfilledStatus=ba,exports.GeoFilter=Ks,exports.Geolocation=is,exports.GeolocationIssue=Os,exports.HSON=Bu,exports.HttpsUrl=es,exports.IAmountIssue=ks,exports.IAsset=ps,exports.IAssetAmount=gs,exports.IAssetDetails=As,exports.IAssetsResults=Qs,exports.IChain=as,exports.IChainDetails=$s,exports.IChainInfo=na,exports.IChainsResults=ti,exports.IChange=Ds,exports.IChangeAmount=ia,exports.IChangeStructure=js,exports.IConfirmPaymentRequest=ru,exports.IConfirmPaymentResponse=ou,exports.IContinueConfirmPaymentRequest=nu,exports.ICreateAPIKeyRequest=vi,exports.ICreateAPIKeyResponse=wi,exports.ICreateOrgInviteRequest=Ai,exports.ICreateOrgRequest=_i,exports.ICreateOrgResponse=gi,exports.ICreateRevShareRequest=Ui,exports.ICreateRevShareResponse=Hi,exports.IDeleteAPIKeyRequest=xi,exports.IDeleteInviteRequest=ji,exports.IDeleteOrgMemberRequest=Ei,exports.IDeleteRevShareRequest=Ji,exports.IDisableOrgRequest=Di,exports.IEffect=Fs,exports.IEffectAmount=aa,exports.IEffectStructure=Ms,exports.IEntry=Ea,exports.IFailureContent=fa,exports.IFees=ya,exports.IFiat=cs,exports.IFixedInputQuoteRequest=_a,exports.IFulfilledChangeAmount=ua,exports.IFulfilledEffectAmount=ca,exports.IFulfilledEntry=Sa,exports.IFulfilledRouteItem=xa,exports.IFundingIssue=Is,exports.IGeolocationRequest=za,exports.IGeolocationResponse=Oa,exports.IGetAPIKeysResponse=ki,exports.IGetMyOrgInvitesRequest=$i,exports.IGetMyOrgsRequest=Pi,exports.IGetMyOrgsResponse=Ti,exports.IGetOrgInfoResponse=Qi,exports.IGetOrgInvitesRequest=Ni,exports.IGetOrgInvitesResponse=Ci,exports.IGetOrgMembersRequest=Ii,exports.IGetOrgMembersResponse=zi,exports.IGetOrgsResponse=Si,exports.IGetRevSharesRequest=Li,exports.IGetRevSharesResponse=Wi,exports.IGetWalletInfoRequest=wu,exports.IGetWalletInfoResponse=bu,exports.IInitialConfirmPaymentRequest=tu,exports.IInputsOutputsResult=oi,exports.IInputsOutputsResults=si,exports.IInstruction=Ka,exports.IIssue=Ts,exports.IOnrampInstruction=Ha,exports.IOnrampSessionRequest=iu,exports.IOnrampSessionResult=au,exports.IPayinMethodsRequest=Ia,exports.IPayinMethodsResponse=ii,exports.IPaymentBalancesResponse=mu,exports.IPaymentBalancesResult=hu,exports.IPaymentChoice=La,exports.IPaymentStatus=Xa,exports.IPaymentStatusRequest=su,exports.IPaymentStatusesResults=Qa,exports.IPiece=Us,exports.IQuote=Pa,exports.IQuoteRequest=ka,exports.IQuoteResponse=Ta,exports.IQuotedEntry=Ra,exports.IQuotedRouteItem=wa,exports.IRequestForAssets=Xs,exports.IRequestForChains=ei,exports.IRequestForInputs=ni,exports.IRequestForOrgPayments=Na,exports.IRequestForOutputs=ri,exports.IRequestForPaymentBalances=fu,exports.IRequestForPaymentsPaginationKey=Aa,exports.IRequestForPrices=ea,exports.IRequestForSPWInfo=ta,exports.IRequestForUpdateLegacy=sa,exports.IRequestForUserPayments=Ca,exports.IRequestForWallet=Js,exports.IRequestForWithdrawLegacy=Ua,exports.IRequestForWithdrawPayload=Da,exports.IRequestForWithdrawWithStateToken=qa,exports.IResource=Zs,exports.IRevShare=Vi,exports.IRevShareProfile=Bi,exports.IRouteItem=va,exports.ISPWInfo=ra,exports.ISPWInfoResponse=oa,exports.ISignatureType=Ma,exports.IToken=us,exports.ITokenAmount=vs,exports.ITransferInInstruction=Ga,exports.IUpdateAPIKeyRequest=bi,exports.IUpdateInviteRequest=Zi,exports.IUpdateOrgConfigRequest=Xi,exports.IUpdateOrgCreditRequest=Ki,exports.IUpdateOrgFeaturesRequest=Yi,exports.IUpdateOrgMemberPermsRequest=Oi,exports.IUpdateOrgOwnerRequest=Mi,exports.IUpdateOrgRequest=Fi,exports.IUpdateRevShareRequest=qi,exports.IUpdateRevShareResponse=Gi,exports.IUserVerifyInstruction=Ba,exports.IVerificationReason=Wa,exports.IVerificationType=Ja,exports.IVerifyOwnershipRequest=gu,exports.IVerifyOwnershipResponse=vu,exports.IWalletResult=Ws,exports.IWithdrawPayloadResponse=Fa,exports.IWithdrawPaymentAuthorizationRequest=uu,exports.IWithdrawPaymentAuthorizationResponse=cu,exports.IWithdrawPaymentRequestLegacy=pu,exports.IWithdrawPaymentRequestWithStateToken=du,exports.IWithdrawPaymentResponse=lu,exports.IWithdrawResponse=Va,exports.IWithdrawalStatus=Ya,exports.InviteStatus=ci,exports.Ip=ss,exports.Limits=ws,exports.Login=yu,exports.LtcAddress=Zo,exports.Milliseconds=Ho,exports.MyOrgsPaginationKey=Ri,exports.NonTerminalObservedStatus=da,exports.None=Go,exports.ObservedStatus=la,exports.OnrampMethod=Gu,exports.OrgConfig=fi,exports.OrgFeature=pi,exports.OrgId=hi,exports.OrgInviteId=mi,exports.OrgMemberId=yi,exports.OtherIssue=Es,exports.OwnerIssue=zs,exports.PayinMethod=bs,exports.PayinMethodIssue=Ss,exports.PayinMethodKey=ms,exports.PaymentCategory=$a,exports.PaymentsApiClientError=sc,exports.PayoutMethod=xs,exports.Percentage=qo,exports.Perms=ui,exports.PieceInfo=qs,exports.PositiveNumeric=Ko,exports.Price=ys,exports.Prices=_s,exports.Property=Cs,exports.ProviderIssue=Rs,exports.PurchaseStatus=Bs,exports.RampName=Hs,exports.RampType=Uu,exports.Realm=Fu,exports.RevShareAddressMap=Ls,exports.RevSharePercentage=li,exports.SafeUrl=ts,exports.Sau=Jo,exports.Signature=Qo,exports.SolAddress=Po,exports.SolChainConfig=Wu,exports.SolTokenAddress=Po,exports.SolTokenDetails=Zu,exports.StateAlpha2=ns,exports.StepType=ga,exports.TerminalObservedStatus=pa,exports.Token=$u,exports.TokenDetails=ju,exports.TokenKey=hs,exports.TonAddress=Ao,exports.TransactionReceipt=Vu,exports.TransactionRequest=qu,exports.TronAddress=$o,exports.TxId=Bo,exports.UnknownIssue=Ps,exports.WalletPurpose=Vs,exports.WithdrawAccount=ja,exports.WorkflowAccount=Za,exports.WorkflowOverallStatus=ma,exports.WorkflowOverallStatusStored=ha,exports.XrplAddress=jo,exports.ZDate=Yo,exports.default=uc;
|
|
2
2
|
//# sourceMappingURL=index.cjs.min.js.map
|