@telia-ace/alliance-internal-node-utilities 4.0.0 → 4.0.1-next.2

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.
@@ -69,4 +69,4 @@ Default "index" lookups for the main are deprecated for ES modules.`,"Deprecatio
69
69
  </html>
70
70
  `.trim();function $n(e){return e.replaceAll("\\","\\\\")}import{existsSync as Cs}from"fs";import{readFile as Va}from"fs/promises";import{dirname as Wa,normalize as Mr,resolve as za}from"path";var Eu=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Cu=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,_u=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function vu(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){xu(e);return}return t}function xu(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function wu(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!_u.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Eu.test(e)||Cu.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,vu)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function Pn(e,t={}){return wu(e,{...t,strict:!0})}var ys=Zr(qn(),1);import{createRequire as Pa}from"module";import{extname as Fs,resolve as La}from"path";import{fileURLToPath as ja,pathToFileURL as Ma}from"url";import ma from"assert";import{statSync as cs,realpathSync as ga}from"fs";import Oe from"process";import{URL as N,fileURLToPath as R,pathToFileURL as Nr}from"url";import ls from"path";import{builtinModules as fs}from"module";import{fileURLToPath as aa}from"url";import oa from"fs";import ia from"path";import{fileURLToPath as Or}from"url";import Yu from"v8";import ke from"assert";import"url";import{format as qu,inspect as br}from"util";var Hu={}.hasOwnProperty,Ju=/^([A-Z][a-z\d]*)+$/,Xu=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),M={};function Tr(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}var Jn=new Map,Qu="__node_internal_",Hn;M.ERR_INVALID_ARG_TYPE=X("ERR_INVALID_ARG_TYPE",(e,t,r)=>{ke(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";if(e.endsWith(" argument"))n+=`${e} `;else{let u=e.includes(".")?"property":"argument";n+=`"${e}" ${u} `}n+="must be ";let s=[],o=[],i=[];for(let u of t)ke(typeof u=="string","All expected entries have to be of type string"),Xu.has(u)?s.push(u.toLowerCase()):Ju.exec(u)===null?(ke(u!=="object",'The value "object" should be written as "Object"'),i.push(u)):o.push(u);if(o.length>0){let u=s.indexOf("object");u!==-1&&(s.slice(u,1),o.push("Object"))}return s.length>0&&(n+=`${s.length>1?"one of type":"of type"} ${Tr(s,"or")}`,(o.length>0||i.length>0)&&(n+=" or ")),o.length>0&&(n+=`an instance of ${Tr(o,"or")}`,i.length>0&&(n+=" or ")),i.length>0&&(i.length>1?n+=`one of ${Tr(i,"or")}`:(i[0].toLowerCase()!==i[0]&&(n+="an "),n+=`${i[0]}`)),n+=`. Received ${sa(r)}`,n},TypeError);M.ERR_INVALID_MODULE_SPECIFIER=X("ERR_INVALID_MODULE_SPECIFIER",(e,t,r=void 0)=>`Invalid module "${e}" ${t}${r?` imported from ${r}`:""}`,TypeError);M.ERR_INVALID_PACKAGE_CONFIG=X("ERR_INVALID_PACKAGE_CONFIG",(e,t,r)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${r?`. ${r}`:""}`,Error);M.ERR_INVALID_PACKAGE_TARGET=X("ERR_INVALID_PACKAGE_TARGET",(e,t,r,n=!1,s=void 0)=>{let o=typeof r=="string"&&!n&&r.length>0&&!r.startsWith("./");return t==="."?(ke(n===!1),`Invalid "exports" main target ${JSON.stringify(r)} defined in the package config ${e}package.json${s?` imported from ${s}`:""}${o?'; targets must start with "./"':""}`):`Invalid "${n?"imports":"exports"}" target ${JSON.stringify(r)} defined for '${t}' in the package config ${e}package.json${s?` imported from ${s}`:""}${o?'; targets must start with "./"':""}`},Error);M.ERR_MODULE_NOT_FOUND=X("ERR_MODULE_NOT_FOUND",(e,t,r=!1)=>`Cannot find ${r?"module":"package"} '${e}' imported from ${t}`,Error);M.ERR_NETWORK_IMPORT_DISALLOWED=X("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error);M.ERR_PACKAGE_IMPORT_NOT_DEFINED=X("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,r)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${r}`,TypeError);M.ERR_PACKAGE_PATH_NOT_EXPORTED=X("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,r=void 0)=>t==="."?`No "exports" main defined in ${e}package.json${r?` imported from ${r}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${r?` imported from ${r}`:""}`,Error);M.ERR_UNSUPPORTED_DIR_IMPORT=X("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error);M.ERR_UNSUPPORTED_RESOLVE_REQUEST=X("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError);M.ERR_UNKNOWN_FILE_EXTENSION=X("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError);M.ERR_INVALID_ARG_VALUE=X("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=br(t);return n.length>128&&(n=`${n.slice(0,128)}...`),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);function X(e,t,r){return Jn.set(e,t),ea(r,e)}function ea(e,t){return r;function r(...n){let s=Error.stackTraceLimit;kr()&&(Error.stackTraceLimit=0);let o=new e;kr()&&(Error.stackTraceLimit=s);let i=na(t,n,o);return Object.defineProperties(o,{message:{value:i,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),ra(o),o.code=t,o}}function kr(){try{if(Yu.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return e===void 0?Object.isExtensible(Error):Hu.call(e,"writable")&&e.writable!==void 0?e.writable:e.set!==void 0}function ta(e){let t=Qu+e.name;return Object.defineProperty(e,"name",{value:t}),e}var ra=ta(function(e){let t=kr();return t&&(Hn=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Hn),e});function na(e,t,r){let n=Jn.get(e);if(ke(n!==void 0,"expected `message` to be found"),typeof n=="function")return ke(n.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n.length}).`),Reflect.apply(n,r,t);let s=/%[dfijoOs]/g,o=0;for(;s.exec(n)!==null;)o++;return ke(o===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${o}).`),t.length===0?n:(t.unshift(n),Reflect.apply(qu,null,t))}function sa(e){if(e==null)return String(e);if(typeof e=="function"&&e.name)return`function ${e.name}`;if(typeof e=="object")return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${br(e,{depth:-1})}`;let t=br(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}var ht={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:ua}=M,Xn=new Map;function Rr(e,{base:t,specifier:r}){let n=Xn.get(e);if(n)return n;let s;try{s=oa.readFileSync(ia.toNamespacedPath(e),"utf8")}catch(i){let u=i;if(u.code!=="ENOENT")throw u}let o={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(s!==void 0){let i;try{i=JSON.parse(s)}catch(u){let a=u,l=new ua(e,(t?`"${r}" from `:"")+Or(t||r),a.message);throw l.cause=a,l}o.exists=!0,ht.call(i,"name")&&typeof i.name=="string"&&(o.name=i.name),ht.call(i,"main")&&typeof i.main=="string"&&(o.main=i.main),ht.call(i,"exports")&&(o.exports=i.exports),ht.call(i,"imports")&&(o.imports=i.imports),ht.call(i,"type")&&(i.type==="commonjs"||i.type==="module")&&(o.type=i.type)}return Xn.set(e,o),o}function $t(e){let t=new URL("package.json",e);for(;!t.pathname.endsWith("node_modules/package.json");){let s=Rr(Or(t),{specifier:e});if(s.exists)return s;let o=t;if(t=new URL("../package.json",t),t.pathname===o.pathname)break}return{pjsonPath:Or(t),exists:!1,type:"none"}}function Br(e){return $t(e).type}var{ERR_UNKNOWN_FILE_EXTENSION:ca}=M,la={}.hasOwnProperty,fa={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};function da(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":e==="application/json"?"json":null}var Qn={__proto__:null,"data:":Da,"file:":ha,"http:":es,"https:":es,"node:"(){return"builtin"}};function Da(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return da(t)}function pa(e){let t=e.pathname,r=t.length;for(;r--;){let n=t.codePointAt(r);if(n===47)return"";if(n===46)return t.codePointAt(r-1)===47?"":t.slice(r)}return""}function ha(e,t,r){let n=pa(e);if(n===".js"){let i=Br(e);return i!=="none"?i:"commonjs"}if(n===""){let i=Br(e);return i==="none"||i==="commonjs"?"commonjs":"module"}let s=fa[n];if(s)return s;if(r)return;let o=aa(e);throw new ca(n,o)}function es(){}function ts(e,t){let r=e.protocol;return la.call(Qn,r)&&Qn[r](e,t,!0)||null}var Pt=RegExp.prototype[Symbol.replace],{ERR_NETWORK_IMPORT_DISALLOWED:Lf,ERR_INVALID_MODULE_SPECIFIER:jt,ERR_INVALID_PACKAGE_CONFIG:ds,ERR_INVALID_PACKAGE_TARGET:Fa,ERR_MODULE_NOT_FOUND:$r,ERR_PACKAGE_IMPORT_NOT_DEFINED:ya,ERR_PACKAGE_PATH_NOT_EXPORTED:Ea,ERR_UNSUPPORTED_DIR_IMPORT:Ca,ERR_UNSUPPORTED_RESOLVE_REQUEST:rs}=M,Ds={}.hasOwnProperty,ns=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,ss=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,_a=/^\.|%|\\/,Lt=/\*/g,va=/%2f|%5c/i,os=new Set,xa=/[/\\]{2}/;function is(e,t,r,n,s,o,i){if(Oe.noDeprecation)return;let u=R(n),a=xa.exec(i?e:t)!==null;Oe.emitWarning(`Use of deprecated ${a?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===r?"":`matched to "${r}" `}in the "${s?"imports":"exports"}" field module resolution of the package at ${u}${o?` imported from ${R(o)}`:""}.`,"DeprecationWarning","DEP0166")}function us(e,t,r,n){if(Oe.noDeprecation||ts(e,{parentURL:r.href})!=="module")return;let o=R(e.href),i=R(new N(".",t)),u=R(r);n?ls.resolve(i,n)!==o&&Oe.emitWarning(`Package ${i} has a "main" field set to "${n}", excluding the full filename and extension to the resolved file at "${o.slice(i.length)}", imported from ${u}.
71
71
  Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):Oe.emitWarning(`No "main" or "exports" field defined in the package.json for ${i} resolving the main entry point "${o.slice(i.length)}", imported from ${u}.
72
- Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function ps(e){try{return cs(e)}catch{}}function Ir(e){let t=cs(e,{throwIfNoEntry:!1}),r=t?t.isFile():void 0;return r??!1}function wa(e,t,r){let n;if(t.main!==void 0){if(n=new N(t.main,e),Ir(n))return n;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],u=-1;for(;++u<i.length&&(n=new N(i[u],e),!Ir(n));)n=void 0;if(n)return us(n,e,r,t.main),n}let s=["./index.js","./index.json","./index.node"],o=-1;for(;++o<s.length&&(n=new N(s[o],e),!Ir(n));)n=void 0;if(n)return us(n,e,r,t.main),n;throw new $r(R(new N(".",e)),R(r))}function Aa(e,t,r){if(va.exec(e.pathname)!==null)throw new jt(e.pathname,'must not include encoded "/" or "\\" characters',R(t));let n;try{n=R(e)}catch(o){let i=o;throw Object.defineProperty(i,"input",{value:String(e)}),Object.defineProperty(i,"module",{value:String(t)}),i}let s=ps(n.endsWith("/")?n.slice(-1):n);if(s&&s.isDirectory()){let o=new Ca(n,R(t));throw o.url=String(e),o}if(!s||!s.isFile()){let o=new $r(n||e.pathname,t&&R(t),!0);throw o.url=String(e),o}if(!r){let o=ga(n),{search:i,hash:u}=e;e=Nr(o+(n.endsWith(ls.sep)?"/":"")),e.search=i,e.hash=u}return e}function Ta(e,t,r){return new ya(e,t&&R(new N(".",t)),R(r))}function Sr(e,t,r){return new Ea(R(new N(".",t)),e,r&&R(r))}function ba(e,t,r,n,s){let o=`request is not a valid match in pattern "${t}" for the "${n?"imports":"exports"}" resolution of ${R(r)}`;throw new jt(e,o,s&&R(s))}function mt(e,t,r,n,s){return t=typeof t=="object"&&t!==null?JSON.stringify(t,null,""):`${t}`,new Fa(R(new N(".",r)),e,t,n,s&&R(s))}function ka(e,t,r,n,s,o,i,u,a){if(t!==""&&!o&&e[e.length-1]!=="/")throw mt(r,e,n,i,s);if(!e.startsWith("./")){if(i&&!e.startsWith("../")&&!e.startsWith("/")){let h=!1;try{new N(e),h=!0}catch{}if(!h){let p=o?Pt.call(Lt,e,()=>t):e+t;return ms(p,n,a)}}throw mt(r,e,n,i,s)}if(ns.exec(e.slice(2))!==null)if(ss.exec(e.slice(2))===null){if(!u){let h=o?r.replace("*",()=>t):r+t,p=o?Pt.call(Lt,e,()=>t):e;is(p,h,r,n,i,s,!0)}}else throw mt(r,e,n,i,s);let l=new N(e,n),c=l.pathname,f=new N(".",n).pathname;if(!c.startsWith(f))throw mt(r,e,n,i,s);if(t==="")return l;if(ns.exec(t)!==null){let h=o?r.replace("*",()=>t):r+t;if(ss.exec(t)===null){if(!u){let p=o?Pt.call(Lt,e,()=>t):e;is(p,h,r,n,i,s,!1)}}else ba(h,r,n,i,s)}return o?new N(Pt.call(Lt,l.href,()=>t)):new N(t,l)}function Oa(e){let t=Number(e);return`${t}`!==e?!1:t>=0&&t<4294967295}function Qe(e,t,r,n,s,o,i,u,a){if(typeof t=="string")return ka(t,r,n,e,s,o,i,u,a);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let c,f=-1;for(;++f<l.length;){let h=l[f],p;try{p=Qe(e,h,r,n,s,o,i,u,a)}catch(C){let b=C;if(c=b,b.code==="ERR_INVALID_PACKAGE_TARGET")continue;throw C}if(p!==void 0){if(p===null){c=null;continue}return p}}if(c==null)return null;throw c}if(typeof t=="object"&&t!==null){let l=Object.getOwnPropertyNames(t),c=-1;for(;++c<l.length;){let f=l[c];if(Oa(f))throw new ds(R(e),s,'"exports" cannot contain numeric property keys.')}for(c=-1;++c<l.length;){let f=l[c];if(f==="default"||a&&a.has(f)){let h=t[f],p=Qe(e,h,r,n,s,o,i,u,a);if(p===void 0)continue;return p}}return null}if(t===null)return null;throw mt(n,t,e,i,s)}function Ra(e,t,r){if(typeof e=="string"||Array.isArray(e))return!0;if(typeof e!="object"||e===null)return!1;let n=Object.getOwnPropertyNames(e),s=!1,o=0,i=-1;for(;++i<n.length;){let u=n[i],a=u===""||u[0]!==".";if(o++===0)s=a;else if(s!==a)throw new ds(R(t),r,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return s}function Ba(e,t,r){if(Oe.noDeprecation)return;let n=R(t);os.has(n+"|"+e)||(os.add(n+"|"+e),Oe.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${n}${r?` imported from ${R(r)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function as(e,t,r,n,s){let o=r.exports;if(Ra(o,e,n)&&(o={".":o}),Ds.call(o,t)&&!t.includes("*")&&!t.endsWith("/")){let c=o[t],f=Qe(e,c,"",t,n,!1,!1,!1,s);if(f==null)throw Sr(t,e,n);return f}let i="",u="",a=Object.getOwnPropertyNames(o),l=-1;for(;++l<a.length;){let c=a[l],f=c.indexOf("*");if(f!==-1&&t.startsWith(c.slice(0,f))){t.endsWith("/")&&Ba(t,e,n);let h=c.slice(f+1);t.length>=c.length&&t.endsWith(h)&&hs(i,c)===1&&c.lastIndexOf("*")===f&&(i=c,u=t.slice(f,t.length-h.length))}}if(i){let c=o[i],f=Qe(e,c,u,i,n,!0,!1,t.endsWith("/"),s);if(f==null)throw Sr(t,e,n);return f}throw Sr(t,e,n)}function hs(e,t){let r=e.indexOf("*"),n=t.indexOf("*"),s=r===-1?e.length:r+1,o=n===-1?t.length:n+1;return s>o?-1:o>s||r===-1?1:n===-1||e.length>t.length?-1:t.length>e.length?1:0}function Ia(e,t,r){if(e==="#"||e.startsWith("#/")||e.endsWith("/")){let o="is not a valid internal imports specifier name";throw new jt(e,o,R(t))}let n,s=$t(t);if(s.exists){n=Nr(s.pjsonPath);let o=s.imports;if(o)if(Ds.call(o,e)&&!e.includes("*")){let i=Qe(n,o[e],"",e,t,!1,!0,!1,r);if(i!=null)return i}else{let i="",u="",a=Object.getOwnPropertyNames(o),l=-1;for(;++l<a.length;){let c=a[l],f=c.indexOf("*");if(f!==-1&&e.startsWith(c.slice(0,-1))){let h=c.slice(f+1);e.length>=c.length&&e.endsWith(h)&&hs(i,c)===1&&c.lastIndexOf("*")===f&&(i=c,u=e.slice(f,e.length-h.length))}}if(i){let c=o[i],f=Qe(n,c,u,i,t,!0,!0,!1,r);if(f!=null)return f}}}throw Ta(e,n,t)}function Sa(e,t){let r=e.indexOf("/"),n=!0,s=!1;e[0]==="@"&&(s=!0,r===-1||e.length===0?n=!1:r=e.indexOf("/",r+1));let o=r===-1?e:e.slice(0,r);if(_a.exec(o)!==null&&(n=!1),!n)throw new jt(e,"is not a valid package name",R(t));let i="."+(r===-1?"":e.slice(r));return{packageName:o,packageSubpath:i,isScoped:s}}function ms(e,t,r){if(fs.includes(e))return new N("node:"+e);let{packageName:n,packageSubpath:s,isScoped:o}=Sa(e,t),i=$t(t);if(i.exists){let c=Nr(i.pjsonPath);if(i.name===n&&i.exports!==void 0&&i.exports!==null)return as(c,s,i,t,r)}let u=new N("./node_modules/"+n+"/package.json",t),a=R(u),l;do{let c=ps(a.slice(0,-13));if(!c||!c.isDirectory()){l=a,u=new N((o?"../../../../node_modules/":"../../../node_modules/")+n+"/package.json",u),a=R(u);continue}let f=Rr(a,{base:t,specifier:e});return f.exports!==void 0&&f.exports!==null?as(u,s,f,t,r):s==="."?wa(u,f,t):new N(s,u)}while(a.length!==l.length);throw new $r(n,R(t),!1)}function Na(e){return e[0]==="."&&(e.length===1||e[1]==="/"||e[1]==="."&&(e.length===2||e[2]==="/"))}function $a(e){return e===""?!1:e[0]==="/"?!0:Na(e)}function Pr(e,t,r,n){let s=t.protocol,i=s==="data:"||s==="http:"||s==="https:",u;if($a(e))try{u=new N(e,t)}catch(a){let l=new rs(e,t);throw l.cause=a,l}else if(s==="file:"&&e[0]==="#")u=Ia(e,t,r);else try{u=new N(e)}catch(a){if(i&&!fs.includes(e)){let l=new rs(e,t);throw l.cause=a,l}u=ms(e,t,r)}return ma(u!==void 0,"expected to be defined"),u.protocol!=="file:"?u:Aa(u,t,n)}var ie=(0,ys.default)("import-from-esm"),Ua=Pa(import.meta.url),Mt=[".js",".mjs",".cjs",".json"];function gs(...e){return Ma(La(...e))}function Lr(e,t){ie(`Trying to resolve '${e}' from '${t.href}'`);try{return Pr(e,t,new Set(["node","import"]))}catch(r){ie(`Failed to resolve '${e}' from '${t.href}': ${String(r)}`)}}async function gt(e){if(e)try{ie(`Trying to determine file extension for '${e.href}'`);let t=ja(e),r=Fs(t)===".json";return ie(`Trying to import '${e.href}'${r?" as JSON":""}`),r?Ua(t):await import(e)}catch(t){if(ie(`Failed to determine file extension or to import '${e.href}': ${String(t)}`),t instanceof SyntaxError)throw t}}async function jr(e,t){ie(`Executing importFrom('${e}', '${t}')`);let r;if(/^(\/|\.\.\/|\.\/|[a-zA-Z]:)/.test(t)){ie(`'${t}' is a file module`);let n=gs(e,t);if(r=await gt(n),!r&&!Mt.includes(Fs(t))){for(let s of Mt)if(r=await gt(`${n}${s}`),r)break}}else{ie(`'${t}' is not a file module`);let n=gs(e,"noop.js");if(r=await gt(Lr(t,n)),!r&&!t.startsWith("#")){for(let s of Mt)if(r=await gt(Lr(`${t}${s}`,n)),r)break;if(!r){for(let s of Mt)if(r=await gt(Lr(`${t}/index${s}`,n)),r)break}}}if(!r){let n=`Cannot find module '${t}'`;ie(n);let s=new Error(n);throw s.code="MODULE_NOT_FOUND",s}return ie(`Successfully loaded module '${t}' from '${e}'`),r.default??r}jr.silent=async function(e,t){try{return await jr(e,t)}catch{}};var Es=jr;async function ed(e){let t=[];for(let r of e){let n=await Er(r).then(Mr);if(!n||!Cs(n)){re.warn(`Could not find package.json for '${r}'`);continue}let s=await Va(n).then(f=>Pn(f.toString())).catch(()=>null);if(!s){re.warn(`Could not read package.json for '${r}'`);continue}let o=s?.exports;if(!o){re.warn(`No exports found in package.json for '${r}'`);continue}if(typeof o=="string"||Array.isArray(o)){re.warn(`Invalid exports found in package.json for '${r}'`);continue}let i=o["./manifest"];if(!i){re.warn(`No './manifest' export found in package.json for '${r}'`);continue}if(typeof i=="string"||Array.isArray(i)){re.warn(`Invalid './manifest' export found in package.json for '${r}'`);continue}let u=i.default;if(!u){re.warn(`No default export found in './manifest' export in package.json for '${r}'`);continue}if(typeof u!="string"){re.warn(`Invalid default export found in './manifest' export in package.json for '${r}'`);continue}let a=Mr(za(Wa(n),u));if(!Cs(a)){re.warn(`Could not find manifest file for '${r}' at '${a}'`);continue}let l=Mr(process.cwd()),c=await Es(l,a).catch(()=>null);if(!c){re.warn(`Could not read manifest for '${r}' at '${a}'`);continue}c.$schema=void 0,t.push({...c,version:s.version||"0.0.0"})}return t}var Is={};Ps(Is,{BRAND:()=>mc,DIRTY:()=>Re,EMPTY_PATH:()=>Ya,INVALID:()=>F,NEVER:()=>el,OK:()=>W,ParseStatus:()=>V,Schema:()=>x,ZodAny:()=>ve,ZodArray:()=>De,ZodBigInt:()=>Ie,ZodBoolean:()=>Se,ZodBranded:()=>yt,ZodCatch:()=>Ze,ZodDate:()=>Ne,ZodDefault:()=>ze,ZodDiscriminatedUnion:()=>Wt,ZodEffects:()=>te,ZodEnum:()=>Ve,ZodError:()=>K,ZodFirstPartyTypeKind:()=>E,ZodFunction:()=>Zt,ZodIntersection:()=>je,ZodIssueCode:()=>d,ZodLazy:()=>Me,ZodLiteral:()=>Ue,ZodMap:()=>ot,ZodNaN:()=>ut,ZodNativeEnum:()=>We,ZodNever:()=>ne,ZodNull:()=>Pe,ZodNullable:()=>ce,ZodNumber:()=>Be,ZodObject:()=>Y,ZodOptional:()=>Q,ZodParsedType:()=>m,ZodPipeline:()=>Et,ZodPromise:()=>xe,ZodReadonly:()=>Ge,ZodRecord:()=>zt,ZodSchema:()=>x,ZodSet:()=>it,ZodString:()=>_e,ZodSymbol:()=>nt,ZodTransformer:()=>te,ZodTuple:()=>ae,ZodType:()=>x,ZodUndefined:()=>$e,ZodUnion:()=>Le,ZodUnknown:()=>de,ZodVoid:()=>st,addIssueToContext:()=>D,any:()=>wc,array:()=>kc,bigint:()=>Ec,boolean:()=>Bs,coerce:()=>Qc,custom:()=>ks,date:()=>Cc,datetimeRegex:()=>Ts,defaultErrorMap:()=>le,discriminatedUnion:()=>Ic,effect:()=>Zc,enum:()=>Vc,function:()=>jc,getErrorMap:()=>et,getParsedType:()=>ue,instanceof:()=>Fc,intersection:()=>Sc,isAborted:()=>Ut,isAsync:()=>tt,isDirty:()=>Vt,isValid:()=>Ce,late:()=>gc,lazy:()=>Mc,literal:()=>Uc,makeIssue:()=>Ft,map:()=>Pc,nan:()=>yc,nativeEnum:()=>Wc,never:()=>Tc,null:()=>xc,nullable:()=>Kc,number:()=>Rs,object:()=>Oc,objectUtil:()=>Ur,oboolean:()=>Xc,onumber:()=>Jc,optional:()=>Gc,ostring:()=>Hc,pipeline:()=>qc,preprocess:()=>Yc,promise:()=>zc,quotelessJson:()=>Za,record:()=>$c,set:()=>Lc,setErrorMap:()=>Ka,strictObject:()=>Rc,string:()=>Os,symbol:()=>_c,transformer:()=>Zc,tuple:()=>Nc,undefined:()=>vc,union:()=>Bc,unknown:()=>Ac,util:()=>T,void:()=>bc});var T;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),i={};for(let u of o)i[u]=s[u];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(T||(T={}));var Ur;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ur||(Ur={}));var m=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ue=e=>{switch(typeof e){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(e)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(e)?m.array:e===null?m.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?m.promise:typeof Map<"u"&&e instanceof Map?m.map:typeof Set<"u"&&e instanceof Set?m.set:typeof Date<"u"&&e instanceof Date?m.date:m.object;default:return m.unknown}};var d=T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Za=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),K=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let u=n,a=0;for(;a<i.path.length;){let l=i.path[a];a===i.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(r(i))):u[l]=u[l]||{_errors:[]},u=u[l],a++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};K.create=e=>new K(e);var Ga=(e,t)=>{let r;switch(e.code){case d.invalid_type:e.received===m.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,T.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${T.joinValues(e.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${T.joinValues(e.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${T.joinValues(e.options)}, received '${e.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:T.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case d.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case d.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=t.defaultError,T.assertNever(e)}return{message:r}},le=Ga;var _s=le;function Ka(e){_s=e}function et(){return _s}var Ft=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="",a=n.filter(l=>!!l).slice().reverse();for(let l of a)u=l(i,{data:t,defaultError:u}).message;return{...s,path:o,message:u}},Ya=[];function D(e,t){let r=et(),n=Ft({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===le?void 0:le].filter(s=>!!s)});e.common.issues.push(n)}var V=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return F;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return F;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},F=Object.freeze({status:"aborted"}),Re=e=>({status:"dirty",value:e}),W=e=>({status:"valid",value:e}),Ut=e=>e.status==="aborted",Vt=e=>e.status==="dirty",Ce=e=>e.status==="valid",tt=e=>typeof Promise<"u"&&e instanceof Promise;var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(g||(g={}));var ee=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vs=(e,t)=>{if(Ce(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new K(e.common.issues);return this._error=r,this._error}}};function _(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,u)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??u.defaultError}:typeof u.data>"u"?{message:a??n??u.defaultError}:i.code!=="invalid_type"?{message:u.defaultError}:{message:a??r??u.defaultError}},description:s}}var x=class{get description(){return this._def.description}_getType(t){return ue(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ue(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new V,ctx:{common:t.parent.common,data:t.data,parsedType:ue(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(tt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)},s=this._parseSync({data:t,path:n.path,parent:n});return vs(n,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ce(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Ce(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(tt(s)?s:Promise.resolve(s));return vs(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),u=()=>o.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(a=>a?!0:(u(),!1)):i?!0:(u(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new te({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Q.create(this,this._def)}nullable(){return ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return De.create(this)}promise(){return xe.create(this,this._def)}or(t){return Le.create([this,t],this._def)}and(t){return je.create(this,t,this._def)}transform(t){return new te({..._(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ze({..._(this._def),innerType:this,defaultValue:r,typeName:E.ZodDefault})}brand(){return new yt({typeName:E.ZodBranded,type:this,..._(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ze({..._(this._def),innerType:this,catchValue:r,typeName:E.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Et.create(this,t)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qa=/^c[^\s-]{8,}$/i,Ha=/^[0-9a-z]+$/,Ja=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xa=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qa=/^[a-z0-9_-]{21}$/i,ec=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vr,sc=/^(?:(?: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])$/,oc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ic=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ac=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ws="((\\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])))",lc=new RegExp(`^${ws}$`);function As(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function fc(e){return new RegExp(`^${As(e)}$`)}function Ts(e){let t=`${ws}T${As(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function dc(e,t){return!!((t==="v4"||!t)&&sc.test(e)||(t==="v6"||!t)&&ic.test(e))}function Dc(e,t){if(!ec.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function pc(e,t){return!!((t==="v4"||!t)&&oc.test(e)||(t==="v6"||!t)&&uc.test(e))}var _e=class e extends x{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==m.string){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.string,received:o.parsedType}),F}let n=new V,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,u=t.data.length<o.value;(i||u)&&(s=this._getOrReturnCtx(t,s),i?D(s,{code:d.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&D(s,{code:d.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")rc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"email",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Vr||(Vr=new RegExp(nc,"u")),Vr.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"emoji",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Xa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"uuid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Qa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"nanoid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")qa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cuid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ha.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cuid2",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ja.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"ulid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),D(s,{validation:"url",code:d.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"regex",code:d.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ts(o).test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?lc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?fc(o).test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?tc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"duration",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?dc(t.data,o.version)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"ip",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Dc(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"jwt",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?pc(t.data,o.version)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cidr",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ac.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"base64",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?cc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"base64url",code:d.invalid_string,message:o.message}),n.dirty()):T.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:d.invalid_string,...g.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...g.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...g.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...g.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...g.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...g.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...g.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...g.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...g.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...g.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...g.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...g.errToObj(r)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};_e.create=e=>new _e({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,..._(e)});function hc(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}var Be=class e extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==m.number){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.number,received:o.parsedType}),F}let n,s=new V;for(let o of this._def.checks)o.kind==="int"?T.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:d.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?hc(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_finite,message:o.message}),s.dirty()):T.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&T.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Be.create=e=>new Be({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,..._(e)});var Ie=class e extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==m.bigint)return this._getInvalidInput(t);let n,s=new V;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):T.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return D(r,{code:d.invalid_type,expected:m.bigint,received:r.parsedType}),F}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ie.create=e=>new Ie({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,..._(e)});var Se=class extends x{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==m.boolean){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),F}return W(t.data)}};Se.create=e=>new Se({typeName:E.ZodBoolean,coerce:e?.coerce||!1,..._(e)});var Ne=class e extends x{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==m.date){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.date,received:o.parsedType}),F}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_date}),F}let n=new V,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):T.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ne.create=e=>new Ne({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,..._(e)});var nt=class extends x{_parse(t){if(this._getType(t)!==m.symbol){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),F}return W(t.data)}};nt.create=e=>new nt({typeName:E.ZodSymbol,..._(e)});var $e=class extends x{_parse(t){if(this._getType(t)!==m.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),F}return W(t.data)}};$e.create=e=>new $e({typeName:E.ZodUndefined,..._(e)});var Pe=class extends x{_parse(t){if(this._getType(t)!==m.null){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),F}return W(t.data)}};Pe.create=e=>new Pe({typeName:E.ZodNull,..._(e)});var ve=class extends x{constructor(){super(...arguments),this._any=!0}_parse(t){return W(t.data)}};ve.create=e=>new ve({typeName:E.ZodAny,..._(e)});var de=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(t){return W(t.data)}};de.create=e=>new de({typeName:E.ZodUnknown,..._(e)});var ne=class extends x{_parse(t){let r=this._getOrReturnCtx(t);return D(r,{code:d.invalid_type,expected:m.never,received:r.parsedType}),F}};ne.create=e=>new ne({typeName:E.ZodNever,..._(e)});var st=class extends x{_parse(t){if(this._getType(t)!==m.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),F}return W(t.data)}};st.create=e=>new st({typeName:E.ZodVoid,..._(e)});var De=class e extends x{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==m.array)return D(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),F;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,u=r.data.length<s.exactLength.value;(i||u)&&(D(r,{code:i?d.too_big:d.too_small,minimum:u?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(D(r,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(D(r,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,u)=>s.type._parseAsync(new ee(r,i,r.path,u)))).then(i=>V.mergeArray(n,i));let o=[...r.data].map((i,u)=>s.type._parseSync(new ee(r,i,r.path,u)));return V.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}};De.create=(e,t)=>new De({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,..._(t)});function rt(e){if(e instanceof Y){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Q.create(rt(n))}return new Y({...e._def,shape:()=>t})}else return e instanceof De?new De({...e._def,type:rt(e.element)}):e instanceof Q?Q.create(rt(e.unwrap())):e instanceof ce?ce.create(rt(e.unwrap())):e instanceof ae?ae.create(e.items.map(t=>rt(t))):e}var Y=class e extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=T.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==m.object){let l=this._getOrReturnCtx(t);return D(l,{code:d.invalid_type,expected:m.object,received:l.parsedType}),F}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),u=[];if(!(this._def.catchall instanceof ne&&this._def.unknownKeys==="strip"))for(let l in s.data)i.includes(l)||u.push(l);let a=[];for(let l of i){let c=o[l],f=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new ee(s,f,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof ne){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of u)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")u.length>0&&(D(s,{code:d.unrecognized_keys,keys:u}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of u){let f=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new ee(s,f,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of a){let f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>V.mergeObjectSync(n,l)):V.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:g.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of T.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of T.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return rt(this)}partial(t){let r={};for(let n of T.objectKeys(this.shape)){let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of T.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Q;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return bs(T.objectKeys(this.shape))}};Y.create=(e,t)=>new Y({shape:()=>e,unknownKeys:"strip",catchall:ne.create(),typeName:E.ZodObject,..._(t)});Y.strictCreate=(e,t)=>new Y({shape:()=>e,unknownKeys:"strict",catchall:ne.create(),typeName:E.ZodObject,..._(t)});Y.lazycreate=(e,t)=>new Y({shape:e,unknownKeys:"strip",catchall:ne.create(),typeName:E.ZodObject,..._(t)});var Le=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let u of o)if(u.result.status==="valid")return u.result;for(let u of o)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let i=o.map(u=>new K(u.ctx.common.issues));return D(r,{code:d.invalid_union,unionErrors:i}),F}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let a of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=a._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let u=i.map(a=>new K(a));return D(r,{code:d.invalid_union,unionErrors:u}),F}}get options(){return this._def.options}};Le.create=(e,t)=>new Le({options:e,typeName:E.ZodUnion,..._(t)});var fe=e=>e instanceof Me?fe(e.schema):e instanceof te?fe(e.innerType()):e instanceof Ue?[e.value]:e instanceof Ve?e.options:e instanceof We?T.objectValues(e.enum):e instanceof ze?fe(e._def.innerType):e instanceof $e?[void 0]:e instanceof Pe?[null]:e instanceof Q?[void 0,...fe(e.unwrap())]:e instanceof ce?[null,...fe(e.unwrap())]:e instanceof yt||e instanceof Ge?fe(e.unwrap()):e instanceof Ze?fe(e._def.innerType):[],Wt=class e extends x{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.object)return D(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),F;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),F)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=fe(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of i){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new e({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,..._(n)})}};function Wr(e,t){let r=ue(e),n=ue(t);if(e===t)return{valid:!0,data:e};if(r===m.object&&n===m.object){let s=T.objectKeys(t),o=T.objectKeys(e).filter(u=>s.indexOf(u)!==-1),i={...e,...t};for(let u of o){let a=Wr(e[u],t[u]);if(!a.valid)return{valid:!1};i[u]=a.data}return{valid:!0,data:i}}else if(r===m.array&&n===m.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],u=t[o],a=Wr(i,u);if(!a.valid)return{valid:!1};s.push(a.data)}return{valid:!0,data:s}}else return r===m.date&&n===m.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var je=class extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(Ut(o)||Ut(i))return F;let u=Wr(o.value,i.value);return u.valid?((Vt(o)||Vt(i))&&r.dirty(),{status:r.value,value:u.data}):(D(n,{code:d.invalid_intersection_types}),F)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};je.create=(e,t,r)=>new je({left:e,right:t,typeName:E.ZodIntersection,..._(r)});var ae=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.array)return D(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),F;if(n.data.length<this._def.items.length)return D(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,u)=>{let a=this._def.items[u]||this._def.rest;return a?a._parse(new ee(n,i,n.path,u)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>V.mergeArray(r,i)):V.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:E.ZodTuple,rest:null,..._(t)})};var zt=class e extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.object)return D(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),F;let s=[],o=this._def.keyType,i=this._def.valueType;for(let u in n.data)s.push({key:o._parse(new ee(n,u,n.path,u)),value:i._parse(new ee(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?V.mergeObjectAsync(r,s):V.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof x?new e({keyType:t,valueType:r,typeName:E.ZodRecord,..._(n)}):new e({keyType:_e.create(),valueType:t,typeName:E.ZodRecord,..._(r)})}},ot=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.map)return D(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),F;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([u,a],l)=>({key:s._parse(new ee(n,u,n.path,[l,"key"])),value:o._parse(new ee(n,a,n.path,[l,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let a of i){let l=await a.key,c=await a.value;if(l.status==="aborted"||c.status==="aborted")return F;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),u.set(l.value,c.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let a of i){let l=a.key,c=a.value;if(l.status==="aborted"||c.status==="aborted")return F;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),u.set(l.value,c.value)}return{status:r.value,value:u}}}};ot.create=(e,t,r)=>new ot({valueType:t,keyType:e,typeName:E.ZodMap,..._(r)});var it=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.set)return D(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),F;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(D(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(D(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(a){let l=new Set;for(let c of a){if(c.status==="aborted")return F;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let u=[...n.data.values()].map((a,l)=>o._parse(new ee(n,a,n.path,l)));return n.common.async?Promise.all(u).then(a=>i(a)):i(u)}min(t,r){return new e({...this._def,minSize:{value:t,message:g.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:g.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};it.create=(e,t)=>new it({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,..._(t)});var Zt=class e extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.function)return D(r,{code:d.invalid_type,expected:m.function,received:r.parsedType}),F;function n(u,a){return Ft({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,et(),le].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:a}})}function s(u,a){return Ft({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,et(),le].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:a}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof xe){let u=this;return W(async function(...a){let l=new K([]),c=await u._def.args.parseAsync(a,o).catch(p=>{throw l.addIssue(n(a,p)),l}),f=await Reflect.apply(i,this,c);return await u._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(s(f,p)),l})})}else{let u=this;return W(function(...a){let l=u._def.args.safeParse(a,o);if(!l.success)throw new K([n(a,l.error)]);let c=Reflect.apply(i,this,l.data),f=u._def.returns.safeParse(c,o);if(!f.success)throw new K([s(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ae.create(t).rest(de.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ae.create([]).rest(de.create()),returns:r||de.create(),typeName:E.ZodFunction,..._(n)})}},Me=class extends x{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Me.create=(e,t)=>new Me({getter:e,typeName:E.ZodLazy,..._(t)});var Ue=class extends x{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return D(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),F}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ue.create=(e,t)=>new Ue({value:e,typeName:E.ZodLiteral,..._(t)});function bs(e,t){return new Ve({values:e,typeName:E.ZodEnum,..._(t)})}var Ve=class e extends x{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{expected:T.joinValues(n),received:r.parsedType,code:d.invalid_type}),F}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{received:r.data,code:d.invalid_enum_value,options:n}),F}return W(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ve.create=bs;var We=class extends x{_parse(t){let r=T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==m.string&&n.parsedType!==m.number){let s=T.objectValues(r);return D(n,{expected:T.joinValues(s),received:n.parsedType,code:d.invalid_type}),F}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=T.objectValues(r);return D(n,{received:n.data,code:d.invalid_enum_value,options:s}),F}return W(t.data)}get enum(){return this._def.values}};We.create=(e,t)=>new We({values:e,typeName:E.ZodNativeEnum,..._(t)});var xe=class extends x{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.promise&&r.common.async===!1)return D(r,{code:d.invalid_type,expected:m.promise,received:r.parsedType}),F;let n=r.parsedType===m.promise?r.data:Promise.resolve(r.data);return W(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};xe.create=(e,t)=>new xe({type:e,typeName:E.ZodPromise,..._(t)});var te=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{D(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async u=>{if(r.value==="aborted")return F;let a=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return a.status==="aborted"?F:a.status==="dirty"?Re(a.value):r.value==="dirty"?Re(a.value):a});{if(r.value==="aborted")return F;let u=this._def.schema._parseSync({data:i,path:n.path,parent:n});return u.status==="aborted"?F:u.status==="dirty"?Re(u.value):r.value==="dirty"?Re(u.value):u}}if(s.type==="refinement"){let i=u=>{let a=s.refinement(u,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?F:(u.status==="dirty"&&r.dirty(),i(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?F:(u.status==="dirty"&&r.dirty(),i(u.value).then(()=>({status:r.value,value:u.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ce(i))return F;let u=s.transform(i.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ce(i)?Promise.resolve(s.transform(i.value,o)).then(u=>({status:r.value,value:u})):F);T.assertNever(s)}};te.create=(e,t,r)=>new te({schema:e,typeName:E.ZodEffects,effect:t,..._(r)});te.createWithPreprocess=(e,t,r)=>new te({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,..._(r)});var Q=class extends x{_parse(t){return this._getType(t)===m.undefined?W(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Q.create=(e,t)=>new Q({innerType:e,typeName:E.ZodOptional,..._(t)});var ce=class extends x{_parse(t){return this._getType(t)===m.null?W(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ce.create=(e,t)=>new ce({innerType:e,typeName:E.ZodNullable,..._(t)});var ze=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ze.create=(e,t)=>new ze({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._(t)});var Ze=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ze.create=(e,t)=>new Ze({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._(t)});var ut=class extends x{_parse(t){if(this._getType(t)!==m.nan){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),F}return{status:"valid",value:t.data}}};ut.create=e=>new ut({typeName:E.ZodNaN,..._(e)});var mc=Symbol("zod_brand"),yt=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Et=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?F:o.status==="dirty"?(r.dirty(),Re(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?F:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:E.ZodPipeline})}},Ge=class extends x{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Ce(s)&&(s.value=Object.freeze(s.value)),s);return tt(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Ge.create=(e,t)=>new Ge({innerType:e,typeName:E.ZodReadonly,..._(t)});function xs(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ks(e,t={},r){return e?ve.create().superRefine((n,s)=>{let o=e(n);if(o instanceof Promise)return o.then(i=>{if(!i){let u=xs(t,n),a=u.fatal??r??!0;s.addIssue({code:"custom",...u,fatal:a})}});if(!o){let i=xs(t,n),u=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:u})}}):ve.create()}var gc={object:Y.lazycreate},E;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(E||(E={}));var Fc=(e,t={message:`Input not instance of ${e.name}`})=>ks(r=>r instanceof e,t),Os=_e.create,Rs=Be.create,yc=ut.create,Ec=Ie.create,Bs=Se.create,Cc=Ne.create,_c=nt.create,vc=$e.create,xc=Pe.create,wc=ve.create,Ac=de.create,Tc=ne.create,bc=st.create,kc=De.create,Oc=Y.create,Rc=Y.strictCreate,Bc=Le.create,Ic=Wt.create,Sc=je.create,Nc=ae.create,$c=zt.create,Pc=ot.create,Lc=it.create,jc=Zt.create,Mc=Me.create,Uc=Ue.create,Vc=Ve.create,Wc=We.create,zc=xe.create,Zc=te.create,Gc=Q.create,Kc=ce.create,Yc=te.createWithPreprocess,qc=Et.create,Hc=()=>Os().optional(),Jc=()=>Rs().optional(),Xc=()=>Bs().optional(),Qc={string:e=>_e.create({...e,coerce:!0}),number:e=>Be.create({...e,coerce:!0}),boolean:e=>Se.create({...e,coerce:!0}),bigint:e=>Ie.create({...e,coerce:!0}),date:e=>Ne.create({...e,coerce:!0})};var el=F;export{Is as a,G as b,tl as c,re as d,Ql as e,Nn as f,of as g,wu as h,ed as i};
72
+ Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function ps(e){try{return cs(e)}catch{}}function Ir(e){let t=cs(e,{throwIfNoEntry:!1}),r=t?t.isFile():void 0;return r??!1}function wa(e,t,r){let n;if(t.main!==void 0){if(n=new N(t.main,e),Ir(n))return n;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],u=-1;for(;++u<i.length&&(n=new N(i[u],e),!Ir(n));)n=void 0;if(n)return us(n,e,r,t.main),n}let s=["./index.js","./index.json","./index.node"],o=-1;for(;++o<s.length&&(n=new N(s[o],e),!Ir(n));)n=void 0;if(n)return us(n,e,r,t.main),n;throw new $r(R(new N(".",e)),R(r))}function Aa(e,t,r){if(va.exec(e.pathname)!==null)throw new jt(e.pathname,'must not include encoded "/" or "\\" characters',R(t));let n;try{n=R(e)}catch(o){let i=o;throw Object.defineProperty(i,"input",{value:String(e)}),Object.defineProperty(i,"module",{value:String(t)}),i}let s=ps(n.endsWith("/")?n.slice(-1):n);if(s&&s.isDirectory()){let o=new Ca(n,R(t));throw o.url=String(e),o}if(!s||!s.isFile()){let o=new $r(n||e.pathname,t&&R(t),!0);throw o.url=String(e),o}if(!r){let o=ga(n),{search:i,hash:u}=e;e=Nr(o+(n.endsWith(ls.sep)?"/":"")),e.search=i,e.hash=u}return e}function Ta(e,t,r){return new ya(e,t&&R(new N(".",t)),R(r))}function Sr(e,t,r){return new Ea(R(new N(".",t)),e,r&&R(r))}function ba(e,t,r,n,s){let o=`request is not a valid match in pattern "${t}" for the "${n?"imports":"exports"}" resolution of ${R(r)}`;throw new jt(e,o,s&&R(s))}function mt(e,t,r,n,s){return t=typeof t=="object"&&t!==null?JSON.stringify(t,null,""):`${t}`,new Fa(R(new N(".",r)),e,t,n,s&&R(s))}function ka(e,t,r,n,s,o,i,u,a){if(t!==""&&!o&&e[e.length-1]!=="/")throw mt(r,e,n,i,s);if(!e.startsWith("./")){if(i&&!e.startsWith("../")&&!e.startsWith("/")){let h=!1;try{new N(e),h=!0}catch{}if(!h){let p=o?Pt.call(Lt,e,()=>t):e+t;return ms(p,n,a)}}throw mt(r,e,n,i,s)}if(ns.exec(e.slice(2))!==null)if(ss.exec(e.slice(2))===null){if(!u){let h=o?r.replace("*",()=>t):r+t,p=o?Pt.call(Lt,e,()=>t):e;is(p,h,r,n,i,s,!0)}}else throw mt(r,e,n,i,s);let l=new N(e,n),c=l.pathname,f=new N(".",n).pathname;if(!c.startsWith(f))throw mt(r,e,n,i,s);if(t==="")return l;if(ns.exec(t)!==null){let h=o?r.replace("*",()=>t):r+t;if(ss.exec(t)===null){if(!u){let p=o?Pt.call(Lt,e,()=>t):e;is(p,h,r,n,i,s,!1)}}else ba(h,r,n,i,s)}return o?new N(Pt.call(Lt,l.href,()=>t)):new N(t,l)}function Oa(e){let t=Number(e);return`${t}`!==e?!1:t>=0&&t<4294967295}function Qe(e,t,r,n,s,o,i,u,a){if(typeof t=="string")return ka(t,r,n,e,s,o,i,u,a);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let c,f=-1;for(;++f<l.length;){let h=l[f],p;try{p=Qe(e,h,r,n,s,o,i,u,a)}catch(C){let b=C;if(c=b,b.code==="ERR_INVALID_PACKAGE_TARGET")continue;throw C}if(p!==void 0){if(p===null){c=null;continue}return p}}if(c==null)return null;throw c}if(typeof t=="object"&&t!==null){let l=Object.getOwnPropertyNames(t),c=-1;for(;++c<l.length;){let f=l[c];if(Oa(f))throw new ds(R(e),s,'"exports" cannot contain numeric property keys.')}for(c=-1;++c<l.length;){let f=l[c];if(f==="default"||a&&a.has(f)){let h=t[f],p=Qe(e,h,r,n,s,o,i,u,a);if(p===void 0)continue;return p}}return null}if(t===null)return null;throw mt(n,t,e,i,s)}function Ra(e,t,r){if(typeof e=="string"||Array.isArray(e))return!0;if(typeof e!="object"||e===null)return!1;let n=Object.getOwnPropertyNames(e),s=!1,o=0,i=-1;for(;++i<n.length;){let u=n[i],a=u===""||u[0]!==".";if(o++===0)s=a;else if(s!==a)throw new ds(R(t),r,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return s}function Ba(e,t,r){if(Oe.noDeprecation)return;let n=R(t);os.has(n+"|"+e)||(os.add(n+"|"+e),Oe.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${n}${r?` imported from ${R(r)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function as(e,t,r,n,s){let o=r.exports;if(Ra(o,e,n)&&(o={".":o}),Ds.call(o,t)&&!t.includes("*")&&!t.endsWith("/")){let c=o[t],f=Qe(e,c,"",t,n,!1,!1,!1,s);if(f==null)throw Sr(t,e,n);return f}let i="",u="",a=Object.getOwnPropertyNames(o),l=-1;for(;++l<a.length;){let c=a[l],f=c.indexOf("*");if(f!==-1&&t.startsWith(c.slice(0,f))){t.endsWith("/")&&Ba(t,e,n);let h=c.slice(f+1);t.length>=c.length&&t.endsWith(h)&&hs(i,c)===1&&c.lastIndexOf("*")===f&&(i=c,u=t.slice(f,t.length-h.length))}}if(i){let c=o[i],f=Qe(e,c,u,i,n,!0,!1,t.endsWith("/"),s);if(f==null)throw Sr(t,e,n);return f}throw Sr(t,e,n)}function hs(e,t){let r=e.indexOf("*"),n=t.indexOf("*"),s=r===-1?e.length:r+1,o=n===-1?t.length:n+1;return s>o?-1:o>s||r===-1?1:n===-1||e.length>t.length?-1:t.length>e.length?1:0}function Ia(e,t,r){if(e==="#"||e.startsWith("#/")||e.endsWith("/")){let o="is not a valid internal imports specifier name";throw new jt(e,o,R(t))}let n,s=$t(t);if(s.exists){n=Nr(s.pjsonPath);let o=s.imports;if(o)if(Ds.call(o,e)&&!e.includes("*")){let i=Qe(n,o[e],"",e,t,!1,!0,!1,r);if(i!=null)return i}else{let i="",u="",a=Object.getOwnPropertyNames(o),l=-1;for(;++l<a.length;){let c=a[l],f=c.indexOf("*");if(f!==-1&&e.startsWith(c.slice(0,-1))){let h=c.slice(f+1);e.length>=c.length&&e.endsWith(h)&&hs(i,c)===1&&c.lastIndexOf("*")===f&&(i=c,u=e.slice(f,e.length-h.length))}}if(i){let c=o[i],f=Qe(n,c,u,i,t,!0,!0,!1,r);if(f!=null)return f}}}throw Ta(e,n,t)}function Sa(e,t){let r=e.indexOf("/"),n=!0,s=!1;e[0]==="@"&&(s=!0,r===-1||e.length===0?n=!1:r=e.indexOf("/",r+1));let o=r===-1?e:e.slice(0,r);if(_a.exec(o)!==null&&(n=!1),!n)throw new jt(e,"is not a valid package name",R(t));let i="."+(r===-1?"":e.slice(r));return{packageName:o,packageSubpath:i,isScoped:s}}function ms(e,t,r){if(fs.includes(e))return new N("node:"+e);let{packageName:n,packageSubpath:s,isScoped:o}=Sa(e,t),i=$t(t);if(i.exists){let c=Nr(i.pjsonPath);if(i.name===n&&i.exports!==void 0&&i.exports!==null)return as(c,s,i,t,r)}let u=new N("./node_modules/"+n+"/package.json",t),a=R(u),l;do{let c=ps(a.slice(0,-13));if(!c||!c.isDirectory()){l=a,u=new N((o?"../../../../node_modules/":"../../../node_modules/")+n+"/package.json",u),a=R(u);continue}let f=Rr(a,{base:t,specifier:e});return f.exports!==void 0&&f.exports!==null?as(u,s,f,t,r):s==="."?wa(u,f,t):new N(s,u)}while(a.length!==l.length);throw new $r(n,R(t),!1)}function Na(e){return e[0]==="."&&(e.length===1||e[1]==="/"||e[1]==="."&&(e.length===2||e[2]==="/"))}function $a(e){return e===""?!1:e[0]==="/"?!0:Na(e)}function Pr(e,t,r,n){let s=t.protocol,i=s==="data:"||s==="http:"||s==="https:",u;if($a(e))try{u=new N(e,t)}catch(a){let l=new rs(e,t);throw l.cause=a,l}else if(s==="file:"&&e[0]==="#")u=Ia(e,t,r);else try{u=new N(e)}catch(a){if(i&&!fs.includes(e)){let l=new rs(e,t);throw l.cause=a,l}u=ms(e,t,r)}return ma(u!==void 0,"expected to be defined"),u.protocol!=="file:"?u:Aa(u,t,n)}var ie=(0,ys.default)("import-from-esm"),Ua=Pa(import.meta.url),Mt=[".js",".mjs",".cjs",".json"];function gs(...e){return Ma(La(...e))}function Lr(e,t){ie(`Trying to resolve '${e}' from '${t.href}'`);try{return Pr(e,t,new Set(["node","import"]))}catch(r){ie(`Failed to resolve '${e}' from '${t.href}': ${String(r)}`)}}async function gt(e){if(e)try{ie(`Trying to determine file extension for '${e.href}'`);let t=ja(e),r=Fs(t)===".json";return ie(`Trying to import '${e.href}'${r?" as JSON":""}`),r?Ua(t):await import(e)}catch(t){if(ie(`Failed to determine file extension or to import '${e.href}': ${String(t)}`),t instanceof SyntaxError)throw t}}async function jr(e,t){ie(`Executing importFrom('${e}', '${t}')`);let r;if(/^(\/|\.\.\/|\.\/|[a-zA-Z]:)/.test(t)){ie(`'${t}' is a file module`);let n=gs(e,t);if(r=await gt(n),!r&&!Mt.includes(Fs(t))){for(let s of Mt)if(r=await gt(`${n}${s}`),r)break}}else{ie(`'${t}' is not a file module`);let n=gs(e,"noop.js");if(r=await gt(Lr(t,n)),!r&&!t.startsWith("#")){for(let s of Mt)if(r=await gt(Lr(`${t}${s}`,n)),r)break;if(!r){for(let s of Mt)if(r=await gt(Lr(`${t}/index${s}`,n)),r)break}}}if(!r){let n=`Cannot find module '${t}'`;ie(n);let s=new Error(n);throw s.code="MODULE_NOT_FOUND",s}return ie(`Successfully loaded module '${t}' from '${e}'`),r.default??r}jr.silent=async function(e,t){try{return await jr(e,t)}catch{}};var Es=jr;async function ed(e){let t=[];for(let r of e){let n=await Er(r).then(Mr);if(!n||!Cs(n)){re.warn(`Could not find package.json for '${r}'`);continue}let s=await Va(n).then(f=>Pn(f.toString())).catch(()=>null);if(!s){re.warn(`Could not read package.json for '${r}'`);continue}let o=s?.exports;if(!o){re.warn(`No exports found in package.json for '${r}'`);continue}if(typeof o=="string"||Array.isArray(o)){re.warn(`Invalid exports found in package.json for '${r}'`);continue}let i=o["./manifest"];if(!i){re.warn(`No './manifest' export found in package.json for '${r}'`);continue}if(typeof i=="string"||Array.isArray(i)){re.warn(`Invalid './manifest' export found in package.json for '${r}'`);continue}let u=i.default;if(!u){re.warn(`No default export found in './manifest' export in package.json for '${r}'`);continue}if(typeof u!="string"){re.warn(`Invalid default export found in './manifest' export in package.json for '${r}'`);continue}let a=Mr(za(Wa(n),u));if(!Cs(a)){re.warn(`Could not find manifest file for '${r}' at '${a}'`);continue}let l=Mr(process.cwd()),c=await Es(l,a).catch(()=>null);if(!c){re.warn(`Could not read manifest for '${r}' at '${a}'`);continue}c.$schema=void 0,t.push({...c,version:s.version||"0.0.0"})}return t}var Is={};Ps(Is,{BRAND:()=>mc,DIRTY:()=>Re,EMPTY_PATH:()=>Ya,INVALID:()=>F,NEVER:()=>el,OK:()=>W,ParseStatus:()=>V,Schema:()=>x,ZodAny:()=>ve,ZodArray:()=>De,ZodBigInt:()=>Ie,ZodBoolean:()=>Se,ZodBranded:()=>yt,ZodCatch:()=>Ze,ZodDate:()=>Ne,ZodDefault:()=>ze,ZodDiscriminatedUnion:()=>Wt,ZodEffects:()=>te,ZodEnum:()=>Ve,ZodError:()=>K,ZodFirstPartyTypeKind:()=>E,ZodFunction:()=>Zt,ZodIntersection:()=>je,ZodIssueCode:()=>d,ZodLazy:()=>Me,ZodLiteral:()=>Ue,ZodMap:()=>ot,ZodNaN:()=>ut,ZodNativeEnum:()=>We,ZodNever:()=>ne,ZodNull:()=>Pe,ZodNullable:()=>ce,ZodNumber:()=>Be,ZodObject:()=>Y,ZodOptional:()=>Q,ZodParsedType:()=>m,ZodPipeline:()=>Et,ZodPromise:()=>xe,ZodReadonly:()=>Ge,ZodRecord:()=>zt,ZodSchema:()=>x,ZodSet:()=>it,ZodString:()=>_e,ZodSymbol:()=>nt,ZodTransformer:()=>te,ZodTuple:()=>ae,ZodType:()=>x,ZodUndefined:()=>$e,ZodUnion:()=>Le,ZodUnknown:()=>de,ZodVoid:()=>st,addIssueToContext:()=>D,any:()=>wc,array:()=>kc,bigint:()=>Ec,boolean:()=>Bs,coerce:()=>Qc,custom:()=>ks,date:()=>Cc,datetimeRegex:()=>Ts,defaultErrorMap:()=>le,discriminatedUnion:()=>Ic,effect:()=>Zc,enum:()=>Vc,function:()=>jc,getErrorMap:()=>et,getParsedType:()=>ue,instanceof:()=>Fc,intersection:()=>Sc,isAborted:()=>Ut,isAsync:()=>tt,isDirty:()=>Vt,isValid:()=>Ce,late:()=>gc,lazy:()=>Mc,literal:()=>Uc,makeIssue:()=>Ft,map:()=>Pc,nan:()=>yc,nativeEnum:()=>Wc,never:()=>Tc,null:()=>xc,nullable:()=>Kc,number:()=>Rs,object:()=>Oc,objectUtil:()=>Ur,oboolean:()=>Xc,onumber:()=>Jc,optional:()=>Gc,ostring:()=>Hc,pipeline:()=>qc,preprocess:()=>Yc,promise:()=>zc,quotelessJson:()=>Za,record:()=>$c,set:()=>Lc,setErrorMap:()=>Ka,strictObject:()=>Rc,string:()=>Os,symbol:()=>_c,transformer:()=>Zc,tuple:()=>Nc,undefined:()=>vc,union:()=>Bc,unknown:()=>Ac,util:()=>T,void:()=>bc});var T;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),i={};for(let u of o)i[u]=s[u];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(T||(T={}));var Ur;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ur||(Ur={}));var m=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ue=e=>{switch(typeof e){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(e)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(e)?m.array:e===null?m.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?m.promise:typeof Map<"u"&&e instanceof Map?m.map:typeof Set<"u"&&e instanceof Set?m.set:typeof Date<"u"&&e instanceof Date?m.date:m.object;default:return m.unknown}};var d=T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Za=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),K=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let u=n,a=0;for(;a<i.path.length;){let l=i.path[a];a===i.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(r(i))):u[l]=u[l]||{_errors:[]},u=u[l],a++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};K.create=e=>new K(e);var Ga=(e,t)=>{let r;switch(e.code){case d.invalid_type:e.received===m.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,T.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${T.joinValues(e.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${T.joinValues(e.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${T.joinValues(e.options)}, received '${e.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:T.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case d.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case d.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=t.defaultError,T.assertNever(e)}return{message:r}},le=Ga;var _s=le;function Ka(e){_s=e}function et(){return _s}var Ft=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="",a=n.filter(l=>!!l).slice().reverse();for(let l of a)u=l(i,{data:t,defaultError:u}).message;return{...s,path:o,message:u}},Ya=[];function D(e,t){let r=et(),n=Ft({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===le?void 0:le].filter(s=>!!s)});e.common.issues.push(n)}var V=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return F;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return F;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},F=Object.freeze({status:"aborted"}),Re=e=>({status:"dirty",value:e}),W=e=>({status:"valid",value:e}),Ut=e=>e.status==="aborted",Vt=e=>e.status==="dirty",Ce=e=>e.status==="valid",tt=e=>typeof Promise<"u"&&e instanceof Promise;var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(g||(g={}));var ee=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vs=(e,t)=>{if(Ce(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new K(e.common.issues);return this._error=r,this._error}}};function _(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,u)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??u.defaultError}:typeof u.data>"u"?{message:a??n??u.defaultError}:i.code!=="invalid_type"?{message:u.defaultError}:{message:a??r??u.defaultError}},description:s}}var x=class{get description(){return this._def.description}_getType(t){return ue(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ue(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new V,ctx:{common:t.parent.common,data:t.data,parsedType:ue(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(tt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)},s=this._parseSync({data:t,path:n.path,parent:n});return vs(n,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ce(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Ce(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ue(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(tt(s)?s:Promise.resolve(s));return vs(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),u=()=>o.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(a=>a?!0:(u(),!1)):i?!0:(u(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new te({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Q.create(this,this._def)}nullable(){return ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return De.create(this)}promise(){return xe.create(this,this._def)}or(t){return Le.create([this,t],this._def)}and(t){return je.create(this,t,this._def)}transform(t){return new te({..._(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ze({..._(this._def),innerType:this,defaultValue:r,typeName:E.ZodDefault})}brand(){return new yt({typeName:E.ZodBranded,type:this,..._(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ze({..._(this._def),innerType:this,catchValue:r,typeName:E.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Et.create(this,t)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qa=/^c[^\s-]{8,}$/i,Ha=/^[0-9a-z]+$/,Ja=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xa=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qa=/^[a-z0-9_-]{21}$/i,ec=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vr,sc=/^(?:(?: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])$/,oc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ic=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ac=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ws="((\\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])))",lc=new RegExp(`^${ws}$`);function As(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function fc(e){return new RegExp(`^${As(e)}$`)}function Ts(e){let t=`${ws}T${As(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function dc(e,t){return!!((t==="v4"||!t)&&sc.test(e)||(t==="v6"||!t)&&ic.test(e))}function Dc(e,t){if(!ec.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function pc(e,t){return!!((t==="v4"||!t)&&oc.test(e)||(t==="v6"||!t)&&uc.test(e))}var _e=class e extends x{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==m.string){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.string,received:o.parsedType}),F}let n=new V,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,u=t.data.length<o.value;(i||u)&&(s=this._getOrReturnCtx(t,s),i?D(s,{code:d.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&D(s,{code:d.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")rc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"email",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Vr||(Vr=new RegExp(nc,"u")),Vr.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"emoji",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Xa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"uuid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Qa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"nanoid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")qa.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cuid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ha.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cuid2",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ja.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"ulid",code:d.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),D(s,{validation:"url",code:d.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"regex",code:d.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ts(o).test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?lc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?fc(o).test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{code:d.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?tc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"duration",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?dc(t.data,o.version)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"ip",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Dc(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"jwt",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?pc(t.data,o.version)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"cidr",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ac.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"base64",code:d.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?cc.test(t.data)||(s=this._getOrReturnCtx(t,s),D(s,{validation:"base64url",code:d.invalid_string,message:o.message}),n.dirty()):T.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:d.invalid_string,...g.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...g.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...g.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...g.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...g.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...g.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...g.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...g.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...g.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...g.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...g.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...g.errToObj(r)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};_e.create=e=>new _e({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,..._(e)});function hc(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}var Be=class e extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==m.number){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.number,received:o.parsedType}),F}let n,s=new V;for(let o of this._def.checks)o.kind==="int"?T.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:d.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?hc(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_finite,message:o.message}),s.dirty()):T.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&T.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Be.create=e=>new Be({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,..._(e)});var Ie=class e extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==m.bigint)return this._getInvalidInput(t);let n,s=new V;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),D(n,{code:d.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):T.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return D(r,{code:d.invalid_type,expected:m.bigint,received:r.parsedType}),F}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ie.create=e=>new Ie({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,..._(e)});var Se=class extends x{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==m.boolean){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),F}return W(t.data)}};Se.create=e=>new Se({typeName:E.ZodBoolean,coerce:e?.coerce||!1,..._(e)});var Ne=class e extends x{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==m.date){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_type,expected:m.date,received:o.parsedType}),F}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return D(o,{code:d.invalid_date}),F}let n=new V,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),D(s,{code:d.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):T.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ne.create=e=>new Ne({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,..._(e)});var nt=class extends x{_parse(t){if(this._getType(t)!==m.symbol){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),F}return W(t.data)}};nt.create=e=>new nt({typeName:E.ZodSymbol,..._(e)});var $e=class extends x{_parse(t){if(this._getType(t)!==m.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),F}return W(t.data)}};$e.create=e=>new $e({typeName:E.ZodUndefined,..._(e)});var Pe=class extends x{_parse(t){if(this._getType(t)!==m.null){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),F}return W(t.data)}};Pe.create=e=>new Pe({typeName:E.ZodNull,..._(e)});var ve=class extends x{constructor(){super(...arguments),this._any=!0}_parse(t){return W(t.data)}};ve.create=e=>new ve({typeName:E.ZodAny,..._(e)});var de=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(t){return W(t.data)}};de.create=e=>new de({typeName:E.ZodUnknown,..._(e)});var ne=class extends x{_parse(t){let r=this._getOrReturnCtx(t);return D(r,{code:d.invalid_type,expected:m.never,received:r.parsedType}),F}};ne.create=e=>new ne({typeName:E.ZodNever,..._(e)});var st=class extends x{_parse(t){if(this._getType(t)!==m.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),F}return W(t.data)}};st.create=e=>new st({typeName:E.ZodVoid,..._(e)});var De=class e extends x{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==m.array)return D(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),F;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,u=r.data.length<s.exactLength.value;(i||u)&&(D(r,{code:i?d.too_big:d.too_small,minimum:u?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(D(r,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(D(r,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,u)=>s.type._parseAsync(new ee(r,i,r.path,u)))).then(i=>V.mergeArray(n,i));let o=[...r.data].map((i,u)=>s.type._parseSync(new ee(r,i,r.path,u)));return V.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}};De.create=(e,t)=>new De({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,..._(t)});function rt(e){if(e instanceof Y){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Q.create(rt(n))}return new Y({...e._def,shape:()=>t})}else return e instanceof De?new De({...e._def,type:rt(e.element)}):e instanceof Q?Q.create(rt(e.unwrap())):e instanceof ce?ce.create(rt(e.unwrap())):e instanceof ae?ae.create(e.items.map(t=>rt(t))):e}var Y=class e extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=T.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==m.object){let l=this._getOrReturnCtx(t);return D(l,{code:d.invalid_type,expected:m.object,received:l.parsedType}),F}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),u=[];if(!(this._def.catchall instanceof ne&&this._def.unknownKeys==="strip"))for(let l in s.data)i.includes(l)||u.push(l);let a=[];for(let l of i){let c=o[l],f=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new ee(s,f,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof ne){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of u)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")u.length>0&&(D(s,{code:d.unrecognized_keys,keys:u}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of u){let f=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new ee(s,f,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of a){let f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>V.mergeObjectSync(n,l)):V.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:g.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of T.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of T.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return rt(this)}partial(t){let r={};for(let n of T.objectKeys(this.shape)){let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of T.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Q;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return bs(T.objectKeys(this.shape))}};Y.create=(e,t)=>new Y({shape:()=>e,unknownKeys:"strip",catchall:ne.create(),typeName:E.ZodObject,..._(t)});Y.strictCreate=(e,t)=>new Y({shape:()=>e,unknownKeys:"strict",catchall:ne.create(),typeName:E.ZodObject,..._(t)});Y.lazycreate=(e,t)=>new Y({shape:e,unknownKeys:"strip",catchall:ne.create(),typeName:E.ZodObject,..._(t)});var Le=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let u of o)if(u.result.status==="valid")return u.result;for(let u of o)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let i=o.map(u=>new K(u.ctx.common.issues));return D(r,{code:d.invalid_union,unionErrors:i}),F}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let a of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=a._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let u=i.map(a=>new K(a));return D(r,{code:d.invalid_union,unionErrors:u}),F}}get options(){return this._def.options}};Le.create=(e,t)=>new Le({options:e,typeName:E.ZodUnion,..._(t)});var fe=e=>e instanceof Me?fe(e.schema):e instanceof te?fe(e.innerType()):e instanceof Ue?[e.value]:e instanceof Ve?e.options:e instanceof We?T.objectValues(e.enum):e instanceof ze?fe(e._def.innerType):e instanceof $e?[void 0]:e instanceof Pe?[null]:e instanceof Q?[void 0,...fe(e.unwrap())]:e instanceof ce?[null,...fe(e.unwrap())]:e instanceof yt||e instanceof Ge?fe(e.unwrap()):e instanceof Ze?fe(e._def.innerType):[],Wt=class e extends x{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.object)return D(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),F;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),F)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=fe(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of i){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new e({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,..._(n)})}};function Wr(e,t){let r=ue(e),n=ue(t);if(e===t)return{valid:!0,data:e};if(r===m.object&&n===m.object){let s=T.objectKeys(t),o=T.objectKeys(e).filter(u=>s.indexOf(u)!==-1),i={...e,...t};for(let u of o){let a=Wr(e[u],t[u]);if(!a.valid)return{valid:!1};i[u]=a.data}return{valid:!0,data:i}}else if(r===m.array&&n===m.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],u=t[o],a=Wr(i,u);if(!a.valid)return{valid:!1};s.push(a.data)}return{valid:!0,data:s}}else return r===m.date&&n===m.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var je=class extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(Ut(o)||Ut(i))return F;let u=Wr(o.value,i.value);return u.valid?((Vt(o)||Vt(i))&&r.dirty(),{status:r.value,value:u.data}):(D(n,{code:d.invalid_intersection_types}),F)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};je.create=(e,t,r)=>new je({left:e,right:t,typeName:E.ZodIntersection,..._(r)});var ae=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.array)return D(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),F;if(n.data.length<this._def.items.length)return D(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,u)=>{let a=this._def.items[u]||this._def.rest;return a?a._parse(new ee(n,i,n.path,u)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>V.mergeArray(r,i)):V.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ae.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:e,typeName:E.ZodTuple,rest:null,..._(t)})};var zt=class e extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.object)return D(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),F;let s=[],o=this._def.keyType,i=this._def.valueType;for(let u in n.data)s.push({key:o._parse(new ee(n,u,n.path,u)),value:i._parse(new ee(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?V.mergeObjectAsync(r,s):V.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof x?new e({keyType:t,valueType:r,typeName:E.ZodRecord,..._(n)}):new e({keyType:_e.create(),valueType:t,typeName:E.ZodRecord,..._(r)})}},ot=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.map)return D(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),F;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([u,a],l)=>({key:s._parse(new ee(n,u,n.path,[l,"key"])),value:o._parse(new ee(n,a,n.path,[l,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let a of i){let l=await a.key,c=await a.value;if(l.status==="aborted"||c.status==="aborted")return F;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),u.set(l.value,c.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let a of i){let l=a.key,c=a.value;if(l.status==="aborted"||c.status==="aborted")return F;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),u.set(l.value,c.value)}return{status:r.value,value:u}}}};ot.create=(e,t,r)=>new ot({valueType:t,keyType:e,typeName:E.ZodMap,..._(r)});var it=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==m.set)return D(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),F;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(D(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(D(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(a){let l=new Set;for(let c of a){if(c.status==="aborted")return F;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let u=[...n.data.values()].map((a,l)=>o._parse(new ee(n,a,n.path,l)));return n.common.async?Promise.all(u).then(a=>i(a)):i(u)}min(t,r){return new e({...this._def,minSize:{value:t,message:g.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:g.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};it.create=(e,t)=>new it({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,..._(t)});var Zt=class e extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.function)return D(r,{code:d.invalid_type,expected:m.function,received:r.parsedType}),F;function n(u,a){return Ft({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,et(),le].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:a}})}function s(u,a){return Ft({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,et(),le].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:a}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof xe){let u=this;return W(async function(...a){let l=new K([]),c=await u._def.args.parseAsync(a,o).catch(p=>{throw l.addIssue(n(a,p)),l}),f=await Reflect.apply(i,this,c);return await u._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(s(f,p)),l})})}else{let u=this;return W(function(...a){let l=u._def.args.safeParse(a,o);if(!l.success)throw new K([n(a,l.error)]);let c=Reflect.apply(i,this,l.data),f=u._def.returns.safeParse(c,o);if(!f.success)throw new K([s(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ae.create(t).rest(de.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ae.create([]).rest(de.create()),returns:r||de.create(),typeName:E.ZodFunction,..._(n)})}},Me=class extends x{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Me.create=(e,t)=>new Me({getter:e,typeName:E.ZodLazy,..._(t)});var Ue=class extends x{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return D(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),F}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ue.create=(e,t)=>new Ue({value:e,typeName:E.ZodLiteral,..._(t)});function bs(e,t){return new Ve({values:e,typeName:E.ZodEnum,..._(t)})}var Ve=class e extends x{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{expected:T.joinValues(n),received:r.parsedType,code:d.invalid_type}),F}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{received:r.data,code:d.invalid_enum_value,options:n}),F}return W(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ve.create=bs;var We=class extends x{_parse(t){let r=T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==m.string&&n.parsedType!==m.number){let s=T.objectValues(r);return D(n,{expected:T.joinValues(s),received:n.parsedType,code:d.invalid_type}),F}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=T.objectValues(r);return D(n,{received:n.data,code:d.invalid_enum_value,options:s}),F}return W(t.data)}get enum(){return this._def.values}};We.create=(e,t)=>new We({values:e,typeName:E.ZodNativeEnum,..._(t)});var xe=class extends x{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==m.promise&&r.common.async===!1)return D(r,{code:d.invalid_type,expected:m.promise,received:r.parsedType}),F;let n=r.parsedType===m.promise?r.data:Promise.resolve(r.data);return W(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};xe.create=(e,t)=>new xe({type:e,typeName:E.ZodPromise,..._(t)});var te=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{D(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async u=>{if(r.value==="aborted")return F;let a=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return a.status==="aborted"?F:a.status==="dirty"?Re(a.value):r.value==="dirty"?Re(a.value):a});{if(r.value==="aborted")return F;let u=this._def.schema._parseSync({data:i,path:n.path,parent:n});return u.status==="aborted"?F:u.status==="dirty"?Re(u.value):r.value==="dirty"?Re(u.value):u}}if(s.type==="refinement"){let i=u=>{let a=s.refinement(u,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?F:(u.status==="dirty"&&r.dirty(),i(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?F:(u.status==="dirty"&&r.dirty(),i(u.value).then(()=>({status:r.value,value:u.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ce(i))return F;let u=s.transform(i.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ce(i)?Promise.resolve(s.transform(i.value,o)).then(u=>({status:r.value,value:u})):F);T.assertNever(s)}};te.create=(e,t,r)=>new te({schema:e,typeName:E.ZodEffects,effect:t,..._(r)});te.createWithPreprocess=(e,t,r)=>new te({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,..._(r)});var Q=class extends x{_parse(t){return this._getType(t)===m.undefined?W(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Q.create=(e,t)=>new Q({innerType:e,typeName:E.ZodOptional,..._(t)});var ce=class extends x{_parse(t){return this._getType(t)===m.null?W(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ce.create=(e,t)=>new ce({innerType:e,typeName:E.ZodNullable,..._(t)});var ze=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ze.create=(e,t)=>new ze({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._(t)});var Ze=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ze.create=(e,t)=>new Ze({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._(t)});var ut=class extends x{_parse(t){if(this._getType(t)!==m.nan){let n=this._getOrReturnCtx(t);return D(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),F}return{status:"valid",value:t.data}}};ut.create=e=>new ut({typeName:E.ZodNaN,..._(e)});var mc=Symbol("zod_brand"),yt=class extends x{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Et=class e extends x{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?F:o.status==="dirty"?(r.dirty(),Re(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?F:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:E.ZodPipeline})}},Ge=class extends x{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Ce(s)&&(s.value=Object.freeze(s.value)),s);return tt(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Ge.create=(e,t)=>new Ge({innerType:e,typeName:E.ZodReadonly,..._(t)});function xs(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ks(e,t={},r){return e?ve.create().superRefine((n,s)=>{let o=e(n);if(o instanceof Promise)return o.then(i=>{if(!i){let u=xs(t,n),a=u.fatal??r??!0;s.addIssue({code:"custom",...u,fatal:a})}});if(!o){let i=xs(t,n),u=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:u})}}):ve.create()}var gc={object:Y.lazycreate},E;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(E||(E={}));var Fc=(e,t={message:`Input not instance of ${e.name}`})=>ks(r=>r instanceof e,t),Os=_e.create,Rs=Be.create,yc=ut.create,Ec=Ie.create,Bs=Se.create,Cc=Ne.create,_c=nt.create,vc=$e.create,xc=Pe.create,wc=ve.create,Ac=de.create,Tc=ne.create,bc=st.create,kc=De.create,Oc=Y.create,Rc=Y.strictCreate,Bc=Le.create,Ic=Wt.create,Sc=je.create,Nc=ae.create,$c=zt.create,Pc=ot.create,Lc=it.create,jc=Zt.create,Mc=Me.create,Uc=Ue.create,Vc=Ve.create,Wc=We.create,zc=xe.create,Zc=te.create,Gc=Q.create,Kc=ce.create,Yc=te.createWithPreprocess,qc=Et.create,Hc=()=>Os().optional(),Jc=()=>Rs().optional(),Xc=()=>Bs().optional(),Qc={string:e=>_e.create({...e,coerce:!0}),number:e=>Be.create({...e,coerce:!0}),boolean:e=>Se.create({...e,coerce:!0}),bigint:e=>Ie.create({...e,coerce:!0}),date:e=>Ne.create({...e,coerce:!0})};var el=F;export{Is as a,G as b,tl as c,re as d,Ql as e,Nn as f,of as g,wu as h,jn as i,Gn as j,ed as k};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as c__createRequire } from 'node:module';
3
3
  const require = c__createRequire(import.meta.url);
4
- import{a as h,b as p,c as x,d as y,e as S,g as j,i as I}from"./chunk-BTGZNKCJ.js";import"./chunk-COPUUGH4.js";import{existsSync as ce,mkdirSync as le,readFileSync as L,writeFileSync as P}from"fs";import{relative as ue,resolve as w}from"path";var B=h.enum(["necessary","functional","analytics","marketing"]),G=h.object({purpose:h.string().describe("Purpose of the storing the value."),category:B.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:h.string().describe("Basic description of how long the value will be stored.")}),$=h.record(G.describe("Key used when writing to the storage.")),F=h.object({value:h.string().describe("The localization token default value."),description:h.string().describe("The localization token description.")}),V=h.object({localization:h.record(F.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),_=h.object({common:h.object({order:h.number().optional().describe("Order of the capability in the common capabilities list."),variant:h.enum(["primary","secondary","expressive","destructive","text","primary-white","secondary-white","expressive-white","tertiary-purple"]).default("secondary").describe("Variant of the capability button.")}).optional().describe("Common capability configuration."),label:h.string().optional().describe("Label for the capability.")}),Y=h.object({name:h.string().describe("URL friendly name of the app."),endpoints:h.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:h.string().array().default([]).describe("Permissions that can be added to user roles."),resources:V.default({}).describe("Resources used by the app."),storage:$.default({}).describe("Cookies, session storage, and local storage values that are used by the app."),capabilities:h.record(_.describe("Capability key.")).default({}).describe("Capabilities that the app has.")}).passthrough();function D(e,o){let t=Y.safeParse(e);return t.success?t.data:O(t.error.format(),o?[o]:[]).join(`
4
+ import{a as h,b as p,c as x,d as y,e as S,g as j,k as I}from"./chunk-J3XUJIHG.js";import"./chunk-COPUUGH4.js";import{existsSync as ce,mkdirSync as le,readFileSync as L,writeFileSync as P}from"fs";import{relative as ue,resolve as w}from"path";var B=h.enum(["necessary","functional","analytics","marketing"]),G=h.object({purpose:h.string().describe("Purpose of the storing the value."),category:B.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:h.string().describe("Basic description of how long the value will be stored.")}),$=h.record(G.describe("Key used when writing to the storage.")),F=h.object({value:h.string().describe("The localization token default value."),description:h.string().describe("The localization token description.")}),V=h.object({localization:h.record(F.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),_=h.object({common:h.object({order:h.number().optional().describe("Order of the capability in the common capabilities list."),variant:h.enum(["primary","secondary","expressive","destructive","text","primary-white","secondary-white","expressive-white","tertiary-purple"]).default("secondary").describe("Variant of the capability button.")}).optional().describe("Common capability configuration."),label:h.string().optional().describe("Label for the capability.")}),Y=h.object({name:h.string().describe("URL friendly name of the app."),endpoints:h.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:h.string().array().default([]).describe("Permissions that can be added to user roles."),resources:V.default({}).describe("Resources used by the app."),storage:$.default({}).describe("Cookies, session storage, and local storage values that are used by the app."),capabilities:h.record(_.describe("Capability key.")).default({}).describe("Capabilities that the app has.")}).passthrough();function D(e,o){let t=Y.safeParse(e);return t.success?t.data:O(t.error.format(),o?[o]:[]).join(`
5
5
  `)}function O(e,o=[],t=""){e._errors?.length&&o.push(`${t} - ${e._errors.join(" + ")}`);for(let[a,i]of Object.entries(e))a==="_errors"||!i||typeof i!="object"||Array.isArray(i)||O(i,o,t?`${t}.${a}`:a);return o}import"tty";function K(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function T(e,o=""){let t=[];for(let a of e)for(let[i,n]of a.entries())t[i]=Math.max(t[i]||0,n.length);return e.map(a=>a.map((i,n)=>o+i[n===0?"padStart":"padEnd"](t[n])).join(" ")).join(`
6
6
  `)}function m(e){return typeof e=="function"?e():e}var b=class extends Error{constructor(o,t){super(o),this.code=t,this.name="CLIError"}},J=/\d/,Z=["-","_","/","."];function X(e=""){if(!J.test(e))return e!==e.toLowerCase()}function N(e,o){let t=o??Z,a=[];if(!e||typeof e!="string")return a;let i="",n,u;for(let r of e){let s=t.includes(r);if(s===!0){a.push(i),i="",n=void 0;continue}let c=X(r);if(u===!1){if(n===!1&&c===!0){a.push(i),i=r,n=c;continue}if(n===!0&&c===!1&&i.length>1){let f=i.at(-1);a.push(i.slice(0,Math.max(0,i.length-1))),i=f+r,n=c;continue}}i+=r,n=c,u=s}return a.push(i),a}function W(e){return e?e[0].toUpperCase()+e.slice(1):""}function Q(e){return e?e[0].toLowerCase()+e.slice(1):""}function ee(e,o){return e?(Array.isArray(e)?e:N(e)).map(t=>W(o?.normalize?t.toLowerCase():t)).join(""):""}function oe(e,o){return Q(ee(e||"",o))}function te(e,o){return e?(Array.isArray(e)?e:N(e)).map(t=>t.toLowerCase()).join(o??"-"):""}function E(e){return e==null?[]:Array.isArray(e)?e:[e]}function ie(e,o,t,a){let i,n=e[o],u=~a.string.indexOf(o)?t==null||t===!0?"":String(t):typeof t=="boolean"?t:~a.boolean.indexOf(o)?t==="false"?!1:t==="true"||(e._.push((i=+t,i*0===0?i:t)),!!t):(i=+t,i*0===0?i:t);e[o]=n==null?u:Array.isArray(n)?n.concat(u):[n,u]}function ae(e=[],o={}){let t,a,i,n,u,r={_:[]},s=0,c=0,f=0,A=e.length,C=o.alias!==void 0,l=o.unknown!==void 0,d=o.default!==void 0;if(o.alias=o.alias||{},o.string=E(o.string),o.boolean=E(o.boolean),C)for(t in o.alias)for(a=o.alias[t]=E(o.alias[t]),s=0;s<a.length;s++)(o.alias[a[s]]=a.concat(t)).splice(s,1);for(s=o.boolean.length;s-- >0;)for(a=o.alias[o.boolean[s]]||[],c=a.length;c-- >0;)o.boolean.push(a[c]);for(s=o.string.length;s-- >0;)for(a=o.alias[o.string[s]]||[],c=a.length;c-- >0;)o.string.push(a[c]);if(d){for(t in o.default)if(n=typeof o.default[t],a=o.alias[t]=o.alias[t]||[],o[n]!==void 0)for(o[n].push(t),s=0;s<a.length;s++)o[n].push(a[s])}let g=l?Object.keys(o.alias):[];for(s=0;s<A;s++){if(i=e[s],i==="--"){r._=r._.concat(e.slice(++s));break}for(c=0;c<i.length&&i.charCodeAt(c)===45;c++);if(c===0)r._.push(i);else if(i.substring(c,c+3)==="no-"){if(n=i.slice(Math.max(0,c+3)),l&&!~g.indexOf(n))return o.unknown(i);r[n]=!1}else{for(f=c+1;f<i.length&&i.charCodeAt(f)!==61;f++);for(n=i.substring(c,f),u=i.slice(Math.max(0,++f))||s+1===A||(""+e[s+1]).charCodeAt(0)===45||e[++s],a=c===2?[n]:n,f=0;f<a.length;f++){if(n=a[f],l&&!~g.indexOf(n))return o.unknown("-".repeat(c)+n);ie(r,n,f+1<a.length||u,o)}}}if(d)for(t in o.default)r[t]===void 0&&(r[t]=o.default[t]);if(C)for(t in r)for(a=o.alias[t]||[];a.length>0;)r[a.shift()]=r[t];return r}function re(e,o){let t={boolean:[],string:[],mixed:[],alias:{},default:{}},a=U(o);for(let r of a)r.type!=="positional"&&(r.type==="string"?t.string.push(r.name):r.type==="boolean"&&t.boolean.push(r.name),r.default!==void 0&&(t.default[r.name]=r.default),r.alias&&(t.alias[r.name]=r.alias));let i=ae(e,t),[...n]=i._,u=new Proxy(i,{get(r,s){return r[s]??r[oe(s)]??r[te(s)]}});for(let[,r]of a.entries())if(r.type==="positional"){let s=n.shift();if(s!==void 0)u[r.name]=s;else{if(r.default===void 0&&r.required!==!1)throw new b(`Missing required positional argument: ${r.name.toUpperCase()}`,"EARG");u[r.name]=r.default}}else if(r.required&&u[r.name]===void 0)throw new b(`Missing required argument: --${r.name}`,"EARG");return u}function U(e){let o=[];for(let[t,a]of Object.entries(e||{}))o.push({...a,name:t,alias:K(a.alias)});return o}async function R(e,o){let t=await m(e.args||{}),a=re(o.rawArgs,t),i={rawArgs:o.rawArgs,args:a,data:o.data,cmd:e};typeof e.setup=="function"&&await e.setup(i);let n;try{let u=await m(e.subCommands);if(u&&Object.keys(u).length>0){let r=o.rawArgs.findIndex(c=>!c.startsWith("-")),s=o.rawArgs[r];if(s){if(!u[s])throw new b(`Unknown command \`${s}\``,"E_UNKNOWN_COMMAND");let c=await m(u[s]);c&&await R(c,{rawArgs:o.rawArgs.slice(r+1)})}else if(!e.run)throw new b("No command specified.","E_NO_COMMAND")}typeof e.run=="function"&&(n=await e.run(i))}finally{typeof e.cleanup=="function"&&await e.cleanup(i)}return{result:n}}async function M(e,o,t){let a=await m(e.subCommands);if(a&&Object.keys(a).length>0){let i=o.findIndex(r=>!r.startsWith("-")),n=o[i],u=await m(a[n]);if(u)return M(u,o.slice(i+1),e)}return[e,t]}async function ne(e,o){try{y.log(await se(e,o)+`
7
7
  `)}catch(t){y.error(t)}}async function se(e,o){let t=await m(e.meta||{}),a=U(await m(e.args||{})),i=await m(o?.meta||{}),n=`${i.name?`${i.name} `:""}`+(t.name||process.argv[1]),u=[],r=[],s=[],c=[];for(let l of a)if(l.type==="positional"){let d=l.name.toUpperCase(),g=l.required!==!1&&l.default===void 0,k=l.default?`="${l.default}"`:"";r.push(["`"+d+k+"`",l.description||"",l.valueHint?`<${l.valueHint}>`:""]),c.push(g?`<${d}>`:`[${d}]`)}else{let d=l.required===!0&&l.default===void 0,g=(l.type==="boolean"&&l.default===!0?[...(l.alias||[]).map(k=>`--no-${k}`),`--no-${l.name}`].join(", "):[...(l.alias||[]).map(k=>`-${k}`),`--${l.name}`].join(", "))+(l.type==="string"&&(l.valueHint||l.default)?`=${l.valueHint?`<${l.valueHint}>`:`"${l.default||""}"`}`:"");u.push(["`"+g+(d?" (required)":"")+"`",l.description||""]),d&&c.push(g)}if(e.subCommands){let l=[],d=await m(e.subCommands);for(let[g,k]of Object.entries(d)){let z=await m(k),H=await m(z?.meta);s.push([`\`${g}\``,H?.description||""]),l.push(g)}c.push(l.join("|"))}let f=[],A=t.version||i.version;f.push(p.gray(`${t.description} (${n+(A?` v${A}`:"")})`),"");let C=u.length>0||r.length>0;return f.push(`${p.underline(p.bold("USAGE"))} \`${n}${C?" [OPTIONS]":""} ${c.join(" ")}\``,""),r.length>0&&(f.push(p.underline(p.bold("ARGUMENTS")),""),f.push(T(r," ")),f.push("")),u.length>0&&(f.push(p.underline(p.bold("OPTIONS")),""),f.push(T(u," ")),f.push("")),s.length>0&&(f.push(p.underline(p.bold("COMMANDS")),""),f.push(T(s," ")),f.push("",`Use \`${n} <command> --help\` for more information about a command.`)),f.filter(l=>typeof l=="string").join(`
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { RequestHandler, ErrorRequestHandler } from 'express';
2
+ import { RequestHandler, ErrorRequestHandler, Express } from 'express';
3
3
  import { TransportTargetOptions } from 'pino';
4
4
  import { StorageValue, Storage } from 'unstorage';
5
5
  import { AppManifest } from '@telia-ace/alliance-framework/manifest';
6
+ import * as axios from 'axios';
7
+ import http from 'node:http';
6
8
 
7
9
  type BearerTokenSettings = {
8
10
  privateKey: string;
@@ -237,4 +239,9 @@ declare function getAppManifests(apps: string[]): Promise<AppManifest[]>;
237
239
 
238
240
  declare function slugify(value: string, replacement?: string): string;
239
241
 
240
- export { AllianceError, AllianceHeaders, type AppImportInfo, type BearerTokenContent, DataErrorCode, GatewayErrorCode, type Logger, type PublicKeys, createBearerToken, createFileStorage, createIndexHtml, createLogger, createPrettyLogger, createPublicKeys, getAppManifests, getCleanPublicKey, getPrivateKey, requestErrorHandler, requestLoggerHandler, slugify, zBooleanEnum, zNonEmptyString, zSharedConfig };
242
+ declare function createTestServer(app: Express): Promise<{
243
+ server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
244
+ client: axios.AxiosInstance;
245
+ }>;
246
+
247
+ export { AllianceError, AllianceHeaders, type AppImportInfo, type BearerTokenContent, DataErrorCode, GatewayErrorCode, type Logger, type PublicKeys, createBearerToken, createFileStorage, createIndexHtml, createLogger, createPrettyLogger, createPublicKeys, createTestServer, getAppManifests, getCleanPublicKey, getPrivateKey, requestErrorHandler, requestLoggerHandler, slugify, zBooleanEnum, zNonEmptyString, zSharedConfig };