@redocly/cli 2.57.0 → 2.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/THIRD_PARTY_NOTICES +45 -23
- package/lib/chunks/{YEACSN2C.js → 263OU3EK.js} +1 -1
- package/lib/chunks/2CAHRLJ3.js +22 -0
- package/lib/chunks/{FDOONAMV.js → 4R5JMLPR.js} +1 -1
- package/lib/chunks/{GVJFU4AP.js → 4U5QHDPF.js} +1 -1
- package/lib/chunks/{MZWBJKK2.js → 4WEATF5W.js} +1 -1
- package/lib/chunks/{7EB22KXX.js → 4Y6NCJUT.js} +1 -1
- package/lib/chunks/{XYKNLM5G.js → 5TPCSTMC.js} +1 -1
- package/lib/chunks/{R2FG6TUX.js → 6MXKU6BN.js} +1 -1
- package/lib/chunks/{OR3KBRCI.js → 6NXEK35A.js} +1 -1
- package/lib/chunks/6VBDC3HP.js +13 -0
- package/lib/chunks/{J3DL5HGI.js → 7HGHXQBL.js} +1 -1
- package/lib/chunks/{GHOLYNZA.js → 7INWM6QM.js} +1 -1
- package/lib/chunks/{VBHLPG5Q.js → AW5K6TIG.js} +1 -1
- package/lib/chunks/{H5OX3UOD.js → B2Q7DOT4.js} +1 -1
- package/lib/chunks/{UXFJO2OQ.js → BNNOQCQA.js} +1 -1
- package/lib/chunks/{XTTR5PBC.js → BQBQIRKC.js} +1 -1
- package/lib/chunks/{CWEET26O.js → BWDHENL3.js} +1 -1
- package/lib/chunks/{P7A7BCIN.js → CMHJY4T2.js} +1 -1
- package/lib/chunks/{LUW2ZJJO.js → CTTC32GG.js} +1 -1
- package/lib/chunks/{LI6IH6DJ.js → DEZGXWTS.js} +1 -1
- package/lib/chunks/{F57WBWGV.js → DTH2KLMU.js} +2 -2
- package/lib/chunks/{VT3BHT6S.js → ENBAORPS.js} +3 -3
- package/lib/chunks/{VIPV4IEH.js → FYDETXDC.js} +1 -1
- package/lib/chunks/{YDVOCOBI.js → GACZ2YWU.js} +1 -1
- package/lib/chunks/H4NHEW6K.js +9 -0
- package/lib/chunks/H4VN2RX3.js +7 -0
- package/lib/chunks/{ZVXAH4QD.js → H67F6VQQ.js} +1 -1
- package/lib/chunks/{65AQJO4M.js → IBYLYDST.js} +2 -2
- package/lib/chunks/{AOCVSFC3.js → IXAUPJML.js} +1 -1
- package/lib/chunks/JD3HIQIK.js +193 -0
- package/lib/chunks/{VUU57INZ.js → JFQX5N4D.js} +1 -1
- package/lib/chunks/{664FDTDV.js → JIN2S34E.js} +1 -1
- package/lib/chunks/{5FVKAWNE.js → K3GO5B32.js} +1 -1
- package/lib/chunks/{S5PUZGYS.js → K4HCHGLF.js} +1 -1
- package/lib/chunks/{3QGJWJKQ.js → K4MJBKZB.js} +1 -1
- package/lib/chunks/{YMDFCK3F.js → KIUUH6YY.js} +1 -1
- package/lib/chunks/{4SXCDBB7.js → KMRFAGWI.js} +1 -1
- package/lib/chunks/{SRCGYHDN.js → KRKCMWGM.js} +1 -1
- package/lib/chunks/{MKS4O6F4.js → LHKIMOHX.js} +2 -2
- package/lib/chunks/LRFPMBTV.js +7 -0
- package/lib/chunks/{X5NXRMUW.js → M7T6N7AK.js} +1 -1
- package/lib/chunks/ML6MFXCA.js +7 -0
- package/lib/chunks/{VE7VT5PT.js → MSKEZAFV.js} +1 -1
- package/lib/chunks/{D7WNH6Z5.js → MULE7RHG.js} +1 -1
- package/lib/chunks/{WKCOTH3C.js → MVXFJBMU.js} +1 -1
- package/lib/chunks/NMS2HUB3.js +7 -0
- package/lib/chunks/{GEWI247R.js → NX3RWANU.js} +1 -1
- package/lib/chunks/{EDU3YBRA.js → PI42YPSD.js} +1 -1
- package/lib/chunks/{52MXI4PU.js → PJXZKT3O.js} +1 -1
- package/lib/chunks/{Y2AFRRAT.js → PY4MYMQT.js} +1 -1
- package/lib/chunks/{DMW5VJBT.js → PZF2WPD3.js} +1 -1
- package/lib/chunks/Q4ESEW3O.js +160 -0
- package/lib/chunks/{YOBULQYM.js → QK7R3ZTY.js} +1 -1
- package/lib/chunks/{ZFJHZEI3.js → R2IHROCG.js} +1 -1
- package/lib/chunks/{N2GTHB37.js → ROQ7FTVG.js} +1 -1
- package/lib/chunks/RVRYLTME.js +17 -0
- package/lib/chunks/{ZBOUASE7.js → RW4XUFPU.js} +1 -1
- package/lib/chunks/SQUNMRDS.js +9 -0
- package/lib/chunks/T2G7FRCU.js +23 -0
- package/lib/chunks/{4HG5PCQA.js → TDNSQRQT.js} +1 -1
- package/lib/chunks/{QDSAT32N.js → TGAC4ILD.js} +1 -1
- package/lib/chunks/{7XKYPQPI.js → URZNERQS.js} +1 -1
- package/lib/chunks/{F5V42ZYY.js → V2PTVECL.js} +1 -1
- package/lib/chunks/{4JBK2BSL.js → VJQJVOIN.js} +1 -1
- package/lib/chunks/{IDI3SURO.js → WDWS64N7.js} +1 -1
- package/lib/chunks/{NALRPITK.js → WSDNWUOV.js} +1 -1
- package/lib/chunks/{JMFIKCPX.js → WYZDPMVU.js} +1 -1
- package/lib/chunks/{5UDC2SWY.js → XTW63JDM.js} +1 -1
- package/lib/chunks/YURX7H3N.js +15 -0
- package/lib/chunks/{DT66L2TO.js → YZRKJF2V.js} +1 -1
- package/lib/chunks/Z7JI42WA.js +31 -0
- package/lib/chunks/ZIIE7LXR.js +34 -0
- package/lib/chunks/index.aff +205 -0
- package/lib/chunks/index.dic +49569 -0
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/index.js +66 -61
- package/package.json +1 -1
- package/lib/chunks/2PGNW76R.js +0 -11
- package/lib/chunks/3I7XLHPY.js +0 -45
- package/lib/chunks/ARDTVDGR.js +0 -22
- package/lib/chunks/K2ENYHHD.js +0 -7
- package/lib/chunks/LJPUHAWE.js +0 -13
- package/lib/chunks/M4YE5ALG.js +0 -193
- package/lib/chunks/OM4VGI2Q.js +0 -9
- package/lib/chunks/VYHYEZI5.js +0 -7
- package/lib/chunks/YFI3NLJF.js +0 -9
- package/lib/chunks/YUNIBLZR.js +0 -30
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{c as p}from"./HBUZKWXC.js";import{a as i,b as s}from"./4PTNG4EI.js";import{
|
|
7
|
+
import{c as p}from"./HBUZKWXC.js";import{a as i,b as s}from"./4PTNG4EI.js";import{ga as t}from"./JD3HIQIK.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as g}from"node:child_process";import{existsSync as l,readFileSync as P}from"node:fs";import w from"node:path";var S=async({argv:r})=>{let{plan:e,port:a}=r,n=r["project-dir"],o=r.product||h(n);if(!j(o))throw t.info(`Invalid product ${o}.`),new Error("Project preview launch failed.");let c=s[o],d=i[o];t.info(`
|
|
8
8
|
Launching preview of ${c} ${e} using NPX.
|
|
9
9
|
|
|
10
10
|
`);let{npxExecutableName:m,shell:f}=p();g(m,["-y",d,"preview",`--plan=${e}`,`--port=${a||4e3}`],{stdio:"inherit",cwd:n,shell:f}).on("error",u=>{throw t.info(`Project preview launch failed: ${u.message}`),new Error("Project preview launch failed.")})},j=r=>r?!!s[r]:!1,h=r=>{let e=w.join(process.cwd(),r,"package.json");if(l(e))try{let n=JSON.parse(P(e,"utf-8")).dependencies||{};for(let[o,c]of Object.entries(i))if(n[c])return t.info(`
|
|
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{l as t}from"./
|
|
7
|
+
import{l as t}from"./SQUNMRDS.js";import"./LRUXN6H5.js";import{ga as o}from"./JD3HIQIK.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
|
|
8
8
|
`)}export{i as handleLogout};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as ee,b as te,f as ne,g as E,h as re}from"./
|
|
7
|
+
import{a as ee,b as te,f as ne,g as E,h as re}from"./IBYLYDST.js";import{a as y}from"./WZXA5XPB.js";import{O as W,T as V,c as x,ga as b,ia as Q,pa as Y,r as v,ra as T,s as H,t as J,ya as Z}from"./JD3HIQIK.js";import{b as A,c as G,k as D}from"./LD5MEXEL.js";import{mkdir as ct,readFile as ut,writeFile as dt}from"node:fs/promises";import{dirname as ke,parse as ft,resolve as R,sep as pt}from"node:path";function M(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./K3GO5B32.js").then(t=>({run:t.tanstackQueryGenerator(e)}))}}var U={outputMode:"it always emits one self-contained file",runtime:"the runtime is always embedded in the generated file",argsStyle:"inputs follow the target language's own idiom",importExt:"the generated file has no relative imports"},I={typescript:{load:()=>import("./KMRFAGWI.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./6MXKU6BN.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./IULINGO6.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":M("react"),"tanstack-query-vue":M("vue"),"tanstack-query-svelte":M("svelte"),"tanstack-query-solid":M("solid"),swr:{requires:["typescript"],errorModes:["throw"],load:()=>import("./JFQX5N4D.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./7INWM6QM.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./K4HCHGLF.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./IXAUPJML.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./BQBQIRKC.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./TDNSQRQT.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function oe(e,t,n,r){let s=new Set(e);t.goPackage!==void 0&&!s.has("go")&&b.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
|
|
8
8
|
`);let o=t.errorMode??"throw",i=t.dateType??"string";for(let a of e){let c=n.get(a);if(!c)throw new y(`Unknown generator: ${a}`);for(let d of c.requires??[])if(!s.has(d)){let f=[...new Set([d,...e])].map(m=>`--generator ${m}`).join(" ");throw new y(`The "${a}" generator requires the "${d}" generator. Add it, e.g. ${f}.`)}if(c.errorModes&&!c.errorModes.includes(o))throw new y(`The "${a}" generator does not support --error-mode "${o}" (supported: ${c.errorModes.join(", ")}).`);if(c.dateTypes&&!c.dateTypes.includes(i))throw new y(`The "${a}" generator requires --date-type ${c.dateTypes.join(" or ")} (got "${i}") so the runtime values match the generated types.`);let u={...t,outputMode:r};for(let[d,f]of Object.entries(c.notApplicable??{}))u[d]!==void 0&&b.warn(`generate-client: the "${a}" generator ignores ${d} \u2014 ${f}.
|
|
9
9
|
`)}}function se(e,t,n){let r=new Map;for(let s of e){let o=t.get(s)?.options,i=n?.[s];if(o===void 0){i!==void 0&&b.warn(`generate-client: the "${s}" generator declares no options, so client.options.${s} is ignored.
|
|
10
10
|
`),r.set(s,{});continue}r.set(s,ve(s,o,i))}return r}function ve(e,t,n){if(n!==void 0&&!x(n))throw new y(`The "${e}" generator's options must be a map of option names to values.`);let r=n??{},s=Object.keys(t.properties);if(t.additionalProperties!==!0){for(let i of Object.keys(r))if(!s.includes(i))throw new y(`The "${e}" generator got an unknown option "${i}". Declared options: ${s.join(", ")||"(none)"}.`)}for(let i of t.required??[])if(r[i]===void 0)throw new y(`The "${e}" generator requires the "${i}" option.`);let o={...r};for(let[i,a]of Object.entries(t.properties)){if(o[i]===void 0){a.default!==void 0&&(o[i]=a.default);continue}let c=Se(a,o[i]);if(c!==void 0)throw new y(`The "${e}" generator's "${i}" ${c}.`)}return o}function Se(e,t){if("enum"in e)return e.enum.includes(t)?void 0:`must be one of: ${e.enum.join(", ")}`;if(e.type==="array"){let n=e.items.type;return Array.isArray(t)&&t.every(r=>typeof r===n)?void 0:`must be an array of ${n}`}return typeof t===e.type?void 0:`must be a ${e.type}`}import{isAbsolute as xe,resolve as qe}from"node:path";import{pathToFileURL as Pe}from"node:url";var Oe=function(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,o,i){return r?t?".jsx":".js":s&&(!o||!i)?n:s+o+"."+i.toLowerCase()+"js"}):e};async function ae(e,t={}){let n=new Map;for(let a of t.customGenerators??[])ce(n,a);let r=[];for(let a of e)r.push(await ie(a,n,t.configDir));let s=[],o=new Set,i=async a=>{if(!(s.includes(a)||o.has(a))){o.add(a);for(let c of n.get(a).requires??[])(n.has(c)||c in I)&&await i(await ie(c,n,t.configDir));o.delete(a),s.push(a)}};for(let a of r)await i(a);return{selected:s,registry:n}}async function ie(e,t,n){if(t.has(e))return e;let r=I[e];if(r!==void 0){let{load:o,...i}=r;return t.set(e,{...i,...await o()}),e}if(e==="sdk")throw new y('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let s=await je(e,n??process.cwd());return ce(t,s),s.name}function ce(e,t){if(!x(t)||typeof t.name!="string"||t.name===""||typeof t.run!="function")throw new y("Invalid custom generator: expected an object with a non-empty string `name` and a `run` function (build one with `defineGenerator`).");if(e.has(t.name))throw new y(`Generator name "${t.name}" collides with an existing generator. Rename the custom generator.`);if(t.requiresGenerator!==void 0){let n=re(E,t.requiresGenerator);if(n===void 0)throw new y(`Generator "${t.name}" declares requiresGenerator "${t.requiresGenerator}", which is not a range we read. Use ^1.2.0, ~1.2.0, >=1.2.0, or an exact version.`);if(!n)throw new y(`Generator "${t.name}" needs @redocly/client-generator ${t.requiresGenerator}; this CLI ships ${E}. Upgrade @redocly/cli if the generator is newer, or update the generator \u2014 \`redocly eject-generator <name> --update\` for an ejected file, or upgrade its package.`)}t.name in I&&b.warn(`generate-client: custom generator "${t.name}" takes over the built-in generator of the same name.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as F,b as O,c as k,d as g}from"./2CAHRLJ3.js";import{a as A}from"./DEZGXWTS.js";import{c as d,d as M}from"./MVXFJBMU.js";import{$,X as y,Z as C,_ as R,ca as S,ga as s,ma as l,na as b}from"./JD3HIQIK.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(e,o){let t=[["operations",e.totals.operations],["parameters",e.totals.parameters],["schema properties",e.totals.properties],["response codes",e.totals.responses]],r=Math.max(...t.map(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}function T(e,o){let t={version:1,meta:{...o,exchanges:e.exchanges},totals:e.totals,operations:e.operations};return`${JSON.stringify(t,null,2)}
|
|
10
|
+
`}async function P(e){let o=await M(e.trafficPath);if(o.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=O.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity,coverage:e.coverage}),r=0,n=0;for(let a of o){let i=await A(a,e.format);if(!i){s.warn(`Skipping traffic file with unrecognized format: ${a}
|
|
11
|
+
`);continue}r+=1;for await(let c of i.parse(a))await t.process({...c,index:n}),n+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(n===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var L=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function W(e){let o=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let n of r.servers)o.add(n.rawUrl);return Array.from(o).sort()}function _(e,o,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){s.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
|
|
12
|
+
`);return}if(e.documentedExchanges>0||r===0)return;let n=W(o),a=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${n.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${n.join(", ")}), or use --server to declare the server the traffic was captured against.`;s.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${a}
|
|
13
|
+
`)}async function j(e,o){let t=d(e);await z(V.dirname(t),{recursive:!0}),await J(t,o,"utf8")}async function fe({argv:e,config:o}){let t=d(e.traffic),r=e["traffic-format"],n=e.rules?g(e.rules):void 0,a=e["ignore-headers"]?g(e["ignore-headers"]):void 0,i=e.server;if(i&&e["match-mode"])throw new l("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let c=e["match-mode"]??"strict-host",f=d(e.api),u=await k(f,o);if(u.loadedOperations===0)throw new l(`No OpenAPI operations were loaded from: ${f}`);let p=e["coverage-output"],{runId:N,summary:m,findings:U,coverage:h}=await P({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:a,previewFindingsLimit:e["max-findings"],activeRules:n,openApiIndex:u,server:i,minSeverity:e["min-severity"],coverage:e.coverage||p!==void 0});_(m,u,i);let v=F({runId:N,summary:m,findings:U,meta:{specSource:f,trafficPath:t,format:r,matchMode:c,server:i}},{format:e["report-format"],color:L&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});e.output?(await j(e.output,v),s.info(`Drift report written to: ${d(e.output)}
|
|
14
|
+
`)):s.output(v);let w=e["report-format"]!=="pretty"&&!e.output;if(e.coverage&&h){let x=I(h,L&&!w);w?s.info(`
|
|
15
|
+
${x}`):s.output(`
|
|
16
|
+
${x}`)}if(p&&h&&(await j(p,T(h,{spec:f,traffic:t,matchMode:c,server:i})),s.info(`Coverage report written to: ${d(p)}
|
|
17
|
+
`)),m.findingsBySeverity.error>0)throw new b("Drift detected.")}export{fe as handleDrift};
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a,b}from"./
|
|
7
|
+
import{a,b}from"./CMHJY4T2.js";import"./ZIIE7LXR.js";import"./JD3HIQIK.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as bundleTelemetry,b as handleBundle};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as ue}from"./LRUXN6H5.js";import{j as b,l as A,ma as m,o as z,p as H,ra as q,ya as Y}from"./JD3HIQIK.js";import{e as ce}from"./RFWIIJFG.js";var S=ce(ue(),1);function V(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function K(n){let t=process.env.NO_PROXY||process.env.no_proxy;if(!t)return!1;let e=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(e.length===0)return!1;let r;try{r=new URL(n).hostname.toLowerCase()}catch{return!1}return e.some(o=>!!(o==="*"||r===o||o.startsWith(".")&&r.endsWith(o)||!o.startsWith(".")&&r.endsWith("."+o)))}var G=async(n,{timeout:t,...e}={})=>{let r=V(),o=r&&!K(n),s,i=t?{connect:{timeout:t}}:{};return o?s=new S.ProxyAgent({uri:r,...i}):t&&(s=new S.Agent(i)),await fetch(n,{signal:t?AbortSignal.timeout(t):void 0,...e,dispatcher:s})};var le=/^[\x21-\x7e]+( [\x21-\x7e]+)*$/;function X(){let n=process.env.REDOCLY_ENVIRONMENT?.trim();return n&&le.test(n)?n:void 0}var u=class extends Error{status;constructor(t,e){super(t),this.status=e}},T=class{command;version;sunsetWarnings=[];constructor(t,e="2.0"){this.command=t,this.version=e}async request(t,e){let r=X(),o={...e.headers,"user-agent":`redocly-cli/${this.version} ${this.command}${r?` ${r}`:""}`};try{let s=await G(t,{...e,headers:o});return this.collectSunsetWarning(s),s}catch(s){let i="Failed to fetch.";throw s.cause&&(i+=` Caused by ${s.cause.message||s.cause.name}.`),(s.code||s.cause?.code)&&(i+=` Code: ${s.code||s.cause?.code}`),new Error(i)}}collectSunsetWarning(t){let e=this.getSunsetDate(t);if(!e)return;let r=new Date(e);e>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(t){let{headers:e}=t;if(!e)return;let r=e.get("sunset")||e.get("Sunset");if(r)return Date.parse(r)}},U=class{client;domain;apiKey;constructor(t,e,r){this.client=t,this.domain=e,this.apiKey=r}async getParsedResponse(t){let e=await t.json();if(t.ok)return e;throw new u(`${e.title||t.statusText||"Unknown error"}.`,t.status)}},N=class extends U{async find(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return r.status===404?void 0:await this.getParsedResponse(r)}catch(r){let o=`Failed to fetch project. ${r.message}`;throw r instanceof u?new u(o,r.status):new Error(o)}}},j=class extends U{async getDefaultBranch(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/source`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let o=`Failed to fetch default branch. ${r.message}`;throw r instanceof u?new u(o,r.status):new Error(o)}}async upsert(t,e,r){try{let o=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/remotes`,{timeout:6e3,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(o)}catch(o){let s=`Failed to upsert remote. ${o.message}`;throw o instanceof u?new u(s,o.status):new Error(s)}}async push(t,e,r,o){let s=new globalThis.FormData;s.append("remoteId",r.remoteId),s.append("commit[message]",r.commit.message),s.append("commit[author][name]",r.commit.author.name),s.append("commit[author][email]",r.commit.author.email),s.append("commit[branchName]",r.commit.branchName),r.commit.url&&s.append("commit[url]",r.commit.url),r.commit.namespace&&s.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&s.append("commit[sha]",r.commit.sha),r.commit.repository&&s.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&s.append("commit[createdAt]",r.commit.createdAt);for(let i of o){let a=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await de(i.stream)]);s.append(`files[${i.path}]`,a,i.path)}r.isMainBranch&&s.append("isMainBranch","true"),r.replace&&s.append("replace","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:s});return await this.getParsedResponse(i)}catch(i){let a=`Failed to push. ${i.message}`;throw i instanceof u?new u(a,i.status):new Error(a)}}async getPush({organizationId:t,projectId:e,pushId:r}){try{let o=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes/${r}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(o)}catch(o){let s=`Failed to get push status. ${o.message}`;throw o instanceof u?new u(s,o.status):new Error(s)}}},g=class{apiClient;projects;remotes;constructor({domain:t,apiKey:e,command:r,version:o}){this.apiClient=new T(r,o),this.projects=new N(this.apiClient,t,e),this.remotes=new j(this.apiClient,t,e)}getSunsetWarning(){return Z(this.apiClient.sunsetWarnings)}};function Z(n){let[t]=[...n].sort((e,r)=>e.isSunsetExpired!==r.isSunsetExpired?e.isSunsetExpired?-1:1:e.sunsetDate>r.sunsetDate?1:-1);return t}async function de(n){let t=[];for await(let e of n)t.push(e);return Buffer.concat(t)}function he(){if(process.env.REDOCLY_AUTHORIZATION)return process.env.REDOCLY_AUTHORIZATION;throw new Error("No api key provided, please use environment variable REDOCLY_AUTHORIZATION.")}var P={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function fe(){return process.env.REDOCLY_DOMAIN||P.us}var J=pe((n,t)=>{try{let e=t||n?.resolvedConfig.residency;return me(e)?P[e]:e?new URL(e).origin:n?.resolvedConfig.scorecard?.fromProjectUrl?new URL(n.resolvedConfig.scorecard.fromProjectUrl).origin:P.us}catch{throw new E}});function D(n){try{J(void 0,n)}catch{return!1}return!0}function pe(n){return(...t)=>{let e=n(...t);if(!e.startsWith("https://"))throw new E;return e}}var E=class extends Error{constructor(){super("Invalid Reunite URL")}};function me(n){return typeof n=="string"&&n in P}import{Buffer as O}from"node:buffer";import F from"node:crypto";import{mkdirSync as ge,existsSync as ee,writeFileSync as we,readFileSync as ye,rmSync as ve}from"node:fs";import{homedir as Te}from"node:os";import te from"node:path";import*as Q from"node:child_process";var w=class{baseUrl;apiClient;clientName="redocly-cli";constructor(t,e){this.baseUrl=t,this.apiClient=new T("login",e)}async run(t){let e=await this.getDeviceCode();t?.({verificationUri:e.verificationUri,verificationUriComplete:e.verificationUriComplete,userCode:e.userCode}),this.openBrowser(e.verificationUriComplete);let r=await this.pollingAccessToken(e.deviceCode,e.interval,e.expiresIn);return this.withResidency(r)}openBrowser(t){if(!/^https?:\/\//.test(t))return;let[e,r]=process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:process.platform==="darwin"?["open",[t]]:["xdg-open",[t]];Q.spawn(e,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}async verifyToken(t){try{return!!(await this.sendRequest("/session","GET",void 0,{Cookie:`accessToken=${t};`})).user}catch{return!1}}async verifyApiKey(t){try{return!!(await this.sendRequest("/api-keys-verify","POST",{apiKey:t})).success}catch{return!1}}async refreshToken(t){let e=await this.sendRequest("/device-rotate-token","POST",{grant_type:"refresh_token",client_name:this.clientName,refresh_token:t});if(!e.access_token)throw new Error("Failed to refresh token");return this.withResidency({access_token:e.access_token,refresh_token:e.refresh_token,expires_in:e.expires_in})}async pollingAccessToken(t,e,r){return new Promise((o,s)=>{let i=setInterval(async()=>{let c=await this.getAccessToken(t);c.access_token&&(clearInterval(i),clearTimeout(a),o(c)),c.error&&c.error!=="authorization_pending"&&(clearInterval(i),clearTimeout(a),s(c.error_description))},e*1e3),a=setTimeout(async()=>{clearInterval(i),clearTimeout(a),s("Authorization has expired. Please try again.")},r*1e3)})}async getAccessToken(t){return await this.sendRequest("/device-token","POST",{client_name:this.clientName,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})}async getDeviceCode(){let{device_code:t,user_code:e,verification_uri:r,verification_uri_complete:o,interval:s=10,expires_in:i=300}=await this.sendRequest("/device-authorize","POST",{client_name:this.clientName});return{deviceCode:t,userCode:e,verificationUri:r,verificationUriComplete:o,interval:s,expiresIn:i}}async sendRequest(t,e="GET",r=void 0,o={}){let s=`${this.baseUrl}/api${t}`,i=await this.apiClient.request(s,{body:r&&JSON.stringify(r),method:e,headers:{"Content-Type":"application/json",...o},timeout:6e3});return i.status===204?{success:!0}:await i.json()}withResidency(t){return{...t,residency:this.baseUrl}}};var xe="4618dbc9-8aed-4e27-aaf0-225f4603e5a4",re="aes-256-cbc",k=class{version;credentialsFolderPath;credentialsFilePath;credentialsFileName;key;iv;constructor(t){this.version=t;let e=Te();this.credentialsFolderPath=te.join(e,".redocly"),this.credentialsFileName="credentials",this.credentialsFilePath=te.join(this.credentialsFolderPath,this.credentialsFileName),this.key=F.createHash("sha256").update(`${this.credentialsFolderPath}${xe}`).digest(),this.iv=F.createHash("md5").update(this.credentialsFolderPath).digest(),ge(this.credentialsFolderPath,{recursive:!0})}async login(t,e){let o=await new w(t,this.version).run(e);if(!o)throw new Error("Failed to login. No credentials received.");await this.saveCredentials(o)}async logout(){try{this.removeCredentials()}catch{}}async isAuthorized(t,e){return e?new w(t,this.version).verifyApiKey(e):!!await this.getAccessToken(t)}getAccessToken=async t=>{let e=new w(t,this.version),r=await this.readCredentials();if(!r||!D(t)||r.residency&&r.residency!==t)return null;if(await e.verifyToken(r.access_token))return r.access_token;try{let s=await e.refreshToken(r.refresh_token);return await this.saveCredentials(s),s.access_token}catch{return null}};async saveCredentials(t){try{let e=this.encryptCredentials(t);we(this.credentialsFilePath,e,"utf8")}catch(e){throw new Error(`Failed to save credentials: ${e.message}`)}}async readCredentials(){if(!ee(this.credentialsFilePath))return null;try{let t=ye(this.credentialsFilePath,"utf8");return this.decryptCredentials(t)}catch{return null}}async removeCredentials(){ee(this.credentialsFilePath)&&ve(this.credentialsFilePath)}encryptCredentials(t){let e=F.createCipheriv(re,this.key,this.iv);return O.concat([e.update(JSON.stringify(t),"utf8"),e.final()]).toString("hex")}decryptCredentials(t){let e=F.createDecipheriv(re,this.key,this.iv),r=O.concat([e.update(O.from(t,"hex")),e.final()]);return JSON.parse(r.toString("utf8"))}};import*as y from"node:fs";import*as h from"node:path";var Ce=/\/orgs\/([^/]+)\/projects\//,Pe=[401,403];async function x(n,{organization:t,project:e,onSlugDeprecated:r}){let o=await Ee(n,t,e);if(!o)return{organizationId:t,projectId:e};let s={organizationId:Re(o.uri),projectId:o.id};return(s.organizationId!==t||s.projectId!==e)&&r?.(s),s}async function Ee(n,t,e){try{let r=await n.projects.find(t,e);if(!r)throw new u(`Project "${e}" was not found in organization "${t}". Use the IDs from the organization and project settings in Reunite.`,404);return r}catch(r){if(r instanceof u&&Pe.includes(r.status))return;throw r}}function Re(n){let t=n.match(Ce)?.[1];if(!t)throw new Error(`Could not read the organization ID from the project URI "${n}".`);return t}async function $e({domain:n,apiKey:t,organization:e,project:r,mountPath:o,files:s,defaultBranch:i,commit:a,version:c,replace:R,onUploadStart:$,onSunsetWarning:v,onSlugDeprecated:I}){let f=new g({domain:n,apiKey:t,command:"push",version:c});try{let{organizationId:d,projectId:l}=await x(f,{organization:e,project:r,onSlugDeprecated:I}),M=await f.remotes.getDefaultBranch(d,l),p=await f.remotes.upsert(d,l,{mountBranchName:M,mountPath:o});$?.(p);let{id:C}=await f.remotes.push(d,l,{remoteId:p.id,commit:a,isMainBranch:i===a.branchName,replace:R},s.map(W=>({path:z(W.name),stream:y.createReadStream(W.path)})));return{pushId:C,organizationId:d,projectId:l}}finally{let d=f.getSunsetWarning();d&&v?.(d)}}function Se(n,t){let e={};for(let o of n)if(y.statSync(o).isDirectory()){let s=o;ne(s,[]).forEach(a=>r(a,s))}else r(o,h.dirname(o));function r(o,s){let i=h.relative(s,o);e[i]&&t?.(e[i],o),e[i]=o}return Object.entries(e).map(([o,s])=>({name:o,path:h.resolve(s)}))}function ne(n,t){let e=y.readdirSync(n);for(let r of e){let o=h.join(n,r);y.statSync(o).isDirectory()?t=ne(o,t):t.push(o)}return t}async function se({operation:n,condition:t,onConditionNotMet:e,startTime:r=Date.now(),retryTimeoutMs:o=6e5,retryIntervalMs:s=5e3}){async function i(){let a=await n();if(t(a))return a;if(Date.now()-r>o)throw new Error("Timeout exceeded.");return await e?.(a),await b(s),i()}return i()}var _e=1200,Ue=5e3,Fe=["pending","running"];async function Ie(n){let t=oe(n);try{let e=await x(t,n);return await ae(t,e,n.pushId)}finally{ie(t,n)}}async function Ae({buildType:n,maxExecutionTime:t=_e,retryIntervalMs:e=Ue,startTime:r=Date.now(),onRetry:o,...s}){let i=oe(s);try{let a=await x(i,s);return await se({operation:()=>ae(i,a,s.pushId),condition:c=>!Fe.includes(c.status[n].deploy.status),onConditionNotMet:o,startTime:r,retryTimeoutMs:t*1e3,retryIntervalMs:e})}finally{ie(i,s)}}function oe({domain:n,apiKey:t,version:e}){return new g({domain:n,apiKey:t,command:"push-status",version:e})}function ie(n,{onSunsetWarning:t}){let e=n.getSunsetWarning();e&&t?.(e)}function ae(n,{organizationId:t,projectId:e},r){return n.remotes.getPush({organizationId:t,projectId:e,pushId:r})}async function Ne({projectUrl:n,auth:t,isApiKey:e=!1,onDebug:r}){let o=je(n);if(!o)throw new m(`Invalid project URL format: ${n}`);try{let s=await De({...o,auth:t,isApiKey:e,onDebug:r}),i=s.config.scorecardClassic||s.config.scorecard;if(!i)throw new Error("No scorecard configuration found.");let a=s.config.pluginsUrl,c=a?await Oe(a,r):void 0;return{scorecard:i,plugins:c,pluginsUrl:a}}catch(s){throw new m(s instanceof Error?s.message:String(s))}}function je(n){let t=new URL(n),e=t.pathname.match(/\/org\/(?<orgSlug>[^/]+)\/project\/(?<projectSlug>[^/]+)/);if(!e?.groups)return;let{orgSlug:r,projectSlug:o}=e.groups;return{residency:t.origin,orgSlug:r,projectSlug:o}}async function De({residency:n,orgSlug:t,projectSlug:e,auth:r,isApiKey:o,onDebug:s}){let i=new URL(`${n}/api/orgs/${t}/projects/${e}`),a=await fetch(i,{headers:ke(r,o)});if(s?.(`Project fetch response status: ${a.status}`),a.status===401||a.status===403)throw s?.(`Authentication failed with status ${a.status}.`),s?.("Check that your credentials are valid and have the necessary permissions."),new Error(`Unauthorized access to project: ${e}. Please check your credentials.`);if(a.status!==200)throw new Error(`Failed to fetch project: ${e}. Status: ${a.status}`);return s?.("Successfully received project configuration."),a.json()}async function Oe(n,t){t?.(`Fetching plugins from: ${n}`);try{let e=await fetch(n);if(t?.(`Plugins fetch response status: ${e.status}`),e.status!==200){t?.("Failed to fetch plugins");return}return e.text()}catch(e){t?.(`Error fetching plugins: ${e instanceof Error?e.message:String(e)}`);return}}function ke(n,t){return t?{Authorization:`Bearer ${n}`}:{Cookie:`accessToken=${n}`}}async function L(n,t,e=[],r=[],o){let s={};for(let i of e){let a={[i.name]:{root:n,rules:t}},c=await q({apis:a,...i,plugins:r},{configPath:o});s[i.name]=c.forAlias(i.name)}return s}function B(n,t){if(n){for(let e of n)if(Object.entries(e.where?.metadata||{}).every(([o,s])=>Le(o,s,t)))return e}}function Le(n,t,e){if(t.match(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}Z)?\/(\d{4}-\d{2}-\d{2})?$/)){if(!e[n])return!1;let[r,o]=t.split("/"),s=new Date(e[n]);return!(s<new Date(r)||o&&s>new Date(o))}else if(t.match(/^\/.*\//)){if(!e[n])return!1;try{return H(t).test(e[n])}catch{throw new m(`Invalid regex in scorecard target "${n}": ${t}`)}}return e[n]===t}import{pathToFileURL as Be}from"node:url";async function Me(n,t){if(!n)return[];let e=Be(t??process.cwd()).href+"/",r=n.replaceAll("__redocly_dirname",`"${e}"`);return(await import(`data:text/javascript;base64,${btoa(r)}`)).default.map(i=>i())}var We=".redocly.com";function be(n){try{return new URL(n).hostname.toLowerCase().endsWith(We)}catch{return!1}}async function ze({apiPath:n,document:t,externalRefResolver:e,scorecardConfig:r,configPath:o,plugins:s=[],targetLevel:i,metadata:a={},onDebug:c}){let R=[],$=new Map,v=r.levels||[];if(i&&!v.some(l=>l.name===i))throw new m(`Target level "${i}" not found in the scorecard configuration levels.
|
|
8
|
+
`);let I=B(r.targets,a)?.rules,f=await L(n,I,v,s,o||"");for(let l of v){c?.(`
|
|
9
|
+
Validating level: "${l.name}"`),s.length>0&&c?.(`Using ${s.length} ${A("plugin",s.length)} for this level.`),c?.("Linting document against level rules...");let p=(await Y({document:t,externalRefResolver:e,config:f[l.name]})).filter(({ignored:C})=>!C).map(C=>({...C,scorecardLevel:l.name}));c?.(`Found ${p.length} ${A("problem",p.length)} for level "${l.name}".`),$.set(l.name,p),R.push(...p)}let d=He($,v,i);return{problems:R,achievedLevel:d,targetLevelAchieved:i?d===i:!0}}function He(n,t,e){let r=null;for(let o of t){if((n.get(o.name)||[]).some(a=>a.severity==="error"))return r||"Non Conformant";if(r=o.name,e&&o.name===e)return o.name}return r||"Non Conformant"}export{u as a,T as b,g as c,Z as d,he as e,P as f,fe as g,J as h,D as i,E as j,w as k,k as l,x as m,$e as n,Se as o,Ie as p,Ae as q,Ne as r,L as s,B as t,Me as u,be as v,ze as w};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as g}from"./RFWIIJFG.js";var $=g((br,H)=>{H.exports=function(r){return r!=null&&r.constructor!=null&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}});var K=g((yr,J)=>{"use strict";J.exports=Xe;var Ge=[];function Xe(e,r){var i=0,t;if(!r)return Ge;if(e.FLAG==="long"){for(t=new Array(Math.ceil(r.length/2));i<r.length;)t[i/2]=r.slice(i,i+2),i+=2;return t}return r.split(e.FLAG==="num"?",":"")}});var ee=g((Sr,Z)=>{"use strict";var ke=K();Z.exports=He;var _e=[].push,M="etaoinshrdlcumwfgypbvkjxqz".split(""),I=/\s+/,Ve=["qwertzuop","yxcvbnm","qaw","say","wse","dsx","sy","edr","fdc","dx","rft","gfv","fc","tgz","hgb","gv","zhu","jhn","hb","uji","kjm","jn","iko","lkm"];function He(e){var r=Object.create(null),i=Object.create(null),t=Object.create(null),n=[],o={in:[],out:[]},s=[],h=e.toString("utf8"),f=[],c=0,a=h.indexOf(`
|
|
8
|
+
`),l,R,u,d,O,E,m,x,D,v,N,p,A;for(t.KEY=[];a>-1;)C(h.slice(c,a)),c=a+1,a=h.indexOf(`
|
|
9
|
+
`,c);for(C(h.slice(c)),a=-1;++a<f.length;)if(R=f[a],l=R.split(I),u=l[0],u==="REP"){for(d=a+parseInt(l[1],10);++a<=d;)l=f[a].split(I),n.push([l[1],l[2]]);a--}else if(u==="ICONV"||u==="OCONV"){for(d=a+parseInt(l[1],10),x=o[u==="ICONV"?"in":"out"];++a<=d;)l=f[a].split(I),x.push([new RegExp(l[1],"g"),l[2]]);a--}else if(u==="COMPOUNDRULE"){for(d=a+parseInt(l[1],10);++a<=d;)for(v=f[a].split(I)[1],D=-1,s.push(v);++D<v.length;)i[v.charAt(D)]=[];a--}else if(u==="PFX"||u==="SFX"){for(d=a+parseInt(l[3],10),v={type:u,combineable:l[2]==="Y",entries:[]},r[l[1]]=v;++a<=d;){l=f[a].split(I),O=l[2],E=l[3].split("/"),m=l[4],x={add:"",remove:"",match:"",continuation:ke(t,E[1])},E&&E[0]!=="0"&&(x.add=E[0]);try{O!=="0"&&(x.remove=u==="SFX"?Q(O):O),m&&m!=="."&&(x.match=u==="SFX"?Q(m):$e(m))}catch{x=null}x&&v.entries.push(x)}a--}else if(u==="TRY"){for(m=l[1],p=-1,N=[];++p<m.length;)A=m.charAt(p),A.toLowerCase()===A&&N.push(A);for(p=-1;++p<M.length;)m.indexOf(M[p])<0&&N.push(M[p]);t[u]=N}else u==="KEY"?_e.apply(t[u],l[1].split("|")):u==="COMPOUNDMIN"?t[u]=Number(l[1]):u==="ONLYINCOMPOUND"?(t[u]=l[1],i[l[1]]=[]):t[u]=l[1];return isNaN(t.COMPOUNDMIN)&&(t.COMPOUNDMIN=3),t.KEY.length||(t.KEY=Ve),t.TRY||(t.TRY=M.concat()),t.KEEPCASE||(t.KEEPCASE=!1),{compoundRuleCodes:i,replacementTable:n,conversion:o,compoundRules:s,rules:r,flags:t};function C(w){w=w.trim(),w&&w.charCodeAt(0)!==35&&f.push(w)}}function Q(e){return new RegExp(e+"$")}function $e(e){return new RegExp("^"+e)}});var z=g((Lr,re)=>{"use strict";re.exports=Je;function Je(e,r){for(var i=-1;++i<r.length;)e=e.replace(r[i][0],r[i][1]);return e}});var U=g((Ir,te)=>{"use strict";te.exports=Qe;function Qe(e,r,i){return i&&r in e&&i.indexOf(e[r])>-1}});var ae=g((Ur,ie)=>{"use strict";var Ze=U();ie.exports=er;function er(e,r){var i=-1;if(e.data[r])return!Ze(e.flags,"ONLYINCOMPOUND",e.data[r]);if(r.length>=e.flags.COMPOUNDMIN){for(;++i<e.compoundRules.length;)if(e.compoundRules[i].test(r))return!0}return!1}});var B=g((Fr,ne)=>{"use strict";var rr=z(),j=ae(),G=U();ne.exports=tr;function tr(e,r,i){var t=r.trim(),n;if(!t)return null;if(t=rr(t,e.conversion.in),j(e,t))return!i&&G(e.flags,"FORBIDDENWORD",e.data[t])?null:t;if(t.toUpperCase()===t){if(n=t.charAt(0)+t.slice(1).toLowerCase(),se(e.flags,e.data[n],i))return null;if(j(e,n))return n}if(n=t.toLowerCase(),n!==t){if(se(e.flags,e.data[n],i))return null;if(j(e,n))return n}return null}function se(e,r,i){return G(e,"KEEPCASE",r)||i||G(e,"FORBIDDENWORD",r)}});var oe=g((Mr,ue)=>{"use strict";var ir=B();ue.exports=ar;function ar(e){return!!ir(this,e)}});var ce=g((Br,fe)=>{"use strict";fe.exports=sr;function sr(e){var r=le(e.charAt(0)),i=e.slice(1);return!i||(i=le(i),r===i)?r:r==="u"&&i==="l"?"s":null}function le(e){return e===e.toLowerCase()?"l":e===e.toUpperCase()?"u":null}});var de=g((Pr,ve)=>{"use strict";var P=ce(),he=z(),nr=U(),ur=B();ve.exports=lr;var or=[].push;function lr(e){var r=this,i={},t=[],n={},o,s,h=[],f,c,a,l,R,u,d,O,E,m,x,D,v,N,p,A,C,w,y,L,Y,W,F;if(e=he(e.trim(),r.conversion.in),!e||r.correct(e))return[];for(F=P(e),c=-1;++c<r.replacementTable.length;)for(s=r.replacementTable[c],a=e.indexOf(s[0]);a>-1;)h.push(e.replace(s[0],s[1])),a=e.indexOf(s[0],a+1);for(c=-1;++c<e.length;)for(O=e.charAt(c),m=e.slice(0,c),x=e.slice(c+1),v=O.toLowerCase(),D=v!==O,i={},a=-1;++a<r.flags.KEY.length;)if(E=r.flags.KEY[a],l=E.indexOf(v),!(l<0)){for(u=-1;++u<E.length;)if(u!==l){if(d=E.charAt(u),i[d])continue;i[d]=!0,D&&(d=d.toUpperCase()),h.push(m+d+x)}}for(c=-1,C=e.charAt(0),f=[""],w=1,y=0;++c<e.length;){for(O=C,C=e.charAt(c+1),m=e.slice(0,c),s=O===C?"":O+O,a=-1,R=f.length;++a<R;)a<=w&&f.push(f[a]+s),f[a]+=O;++y<3&&(w=f.length)}for(or.apply(h,f),f=[e],s=e.toLowerCase(),(e===s||F===null)&&f.push(e.charAt(0).toUpperCase()+s.slice(1)),s=e.toUpperCase(),e!==s&&f.push(s),o={state:{},weighted:n,suggestions:t},N=pe(r,o,f,h),p=0,w=Math.min(N.length,Math.pow(Math.max(15-e.length,3),3)),L=Math.max(Math.pow(10-e.length,3),1);!t.length&&p<w;)A=p+L,pe(r,o,N.slice(p,A)),p=A;for(t.sort(We),f=[],Y=[],c=-1;++c<t.length;)W=he(t[c],r.conversion.out),s=W.toLowerCase(),Y.indexOf(s)<0&&(f.push(W),Y.push(s));return f;function We(q,b){return Ke(q,b)||ze(q,b)||je(q,b)}function Ke(q,b){return n[q]===n[b]?0:n[q]>n[b]?-1:1}function ze(q,b){var _=P(q),V=P(b);return _===V?0:_===F?-1:V===F?1:void 0}function je(q,b){return q.localeCompare(b)}}function pe(e,r,i,t){var n=e.flags.TRY,o=e.data,s=e.flags,h=[],f=-1,c,a,l,R,u,d,O,E,m,x,D,v,N;if(t)for(;++f<t.length;)p(t[f],!0);for(f=-1;++f<i.length;)for(c=i[f],a="",l="",R=c.charAt(0),u=c,d=c.slice(1),O=R.toLowerCase()!==R,E=P(c),m=-1;++m<=c.length;)for(a+=l,x=u,u=d,d=u.slice(1),l=R,R=c.charAt(m+1),D=O,R&&(O=R.toLowerCase()!==R),u&&D!==O&&(p(a+A(u)),p(a+A(R)+A(l)+d)),p(a+u),u&&p(a+R+l+d),N=-1;++N<n.length;)v=n[N],D&&v!==v.toUpperCase()?(E!=="s"&&(p(a+v+x),p(a+v+u)),v=v.toUpperCase(),p(a+v+x),p(a+v+u)):(p(a+v+x),p(a+v+u));return h;function p(C,w){var y=r.state[C],L;y!==!!y&&(h.push(C),L=ur(e,C),y=L&&!nr(s,"NOSUGGEST",o[L]),r.state[C]=y,y&&(r.weighted[C]=w?10:0,r.suggestions.push(C))),y&&r.weighted[C]++}function A(C){var w=C.charAt(0);return(w.toLowerCase()===w?w.toUpperCase():w.toLowerCase())+C.slice(1)}}});var Oe=g((Tr,we)=>{"use strict";var fr=B(),ge=U();we.exports=cr;function cr(e){var r=this,i=fr(r,e,!0);return{correct:r.correct(e),forbidden:!!(i&&ge(r.flags,"FORBIDDENWORD",r.data[i])),warn:!!(i&&ge(r.flags,"WARN",r.data[i]))}}});var xe=g((Yr,me)=>{"use strict";me.exports=Ce;function Ce(e,r,i,t){for(var n=-1,o,s,h,f,c;++n<r.entries.length;)if(o=r.entries[n],f=o.continuation,c=-1,(!o.match||o.match.test(e))&&(s=o.remove?e.replace(o.remove,""):e,s=r.type==="SFX"?s+o.add:o.add+s,t.push(s),f&&f.length))for(;++c<f.length;)h=i[f[c]],h&&Ce(s,h,i,t);return t}});var k=g((Wr,Ee)=>{"use strict";var Re=xe();Ee.exports=vr;var hr=[].push,X=[];function pr(e,r,i){var t=e[r];r in e?t===X?e[r]=i.concat():hr.apply(t,i):e[r]=i.concat()}function vr(e,r,i,t){var n=-1,o,s,h,f,c,a,l;for((!("NEEDAFFIX"in t.flags)||i.indexOf(t.flags.NEEDAFFIX)<0)&&pr(e,r,i);++n<i.length;)if(o=t.rules[i[n]],i[n]in t.compoundRuleCodes&&t.compoundRuleCodes[i[n]].push(r),o){for(a=Re(r,o,t.rules,[]),s=-1;++s<a.length;)if(a[s]in e||(e[a[s]]=X),o.combineable){for(h=n;++h<i.length;)if(c=t.rules[i[h]],c&&c.combineable&&o.type!==c.type)for(l=Re(a[s],c,t.rules,[]),f=-1;++f<l.length;)l[f]in e||(e[l[f]]=X)}}}});var Ae=g((Kr,Ne)=>{"use strict";var dr=k();Ne.exports=wr;var gr=[];function wr(e,r){var i=this;return dr(i.data,e,i.data[r]||gr,i),i}});var qe=g((zr,De)=>{"use strict";De.exports=Or;function Or(e){var r=this;return delete r.data[e],r}});var ye=g((jr,be)=>{"use strict";be.exports=Cr;function Cr(){return this.flags.WORDCHARS||null}});var Ue=g((Gr,Ie)=>{"use strict";var mr=K(),xr=k();Ie.exports=Rr;var Se=/\s/g;function Rr(e,r,i){for(var t=e.toString("utf8"),n=t.indexOf(`
|
|
10
|
+
`)+1,o=t.indexOf(`
|
|
11
|
+
`,n);o>-1;)t.charCodeAt(n)!==9&&Le(t.slice(n,o),r,i),n=o+1,o=t.indexOf(`
|
|
12
|
+
`,n);Le(t.slice(n),r,i)}function Le(e,r,i){for(var t=e.indexOf("/"),n=e.indexOf("#"),o="",s,h;t>-1&&e.charCodeAt(t-1)===92;)e=e.slice(0,t-1)+e.slice(t),t=e.indexOf("/",t);n>-1?t>-1&&t<n?(s=e.slice(0,t),Se.lastIndex=t+1,h=Se.exec(e),o=e.slice(t+1,h?h.index:void 0)):s=e.slice(0,n):t>-1?(s=e.slice(0,t),o=e.slice(t+1)):s=e,s=s.trim(),s&&xr(i,s,mr(r.flags,o.trim()),r)}});var Me=g((Xr,Fe)=>{"use strict";var Er=Ue();Fe.exports=Nr;function Nr(e){var r=this,i=-1,t,n,o,s;for(Er(e,r,r.data);++i<r.compoundRules.length;){for(t=r.compoundRules[i],n="",s=-1;++s<t.length;)o=t.charAt(s),n+=r.compoundRuleCodes[o].length?"(?:"+r.compoundRuleCodes[o].join("|")+")":o;r.compoundRules[i]=new RegExp(n,"i")}return r}});var Pe=g((kr,Be)=>{"use strict";Be.exports=Ar;function Ar(e){var r=this,i=e.toString("utf8").split(`
|
|
13
|
+
`),t=-1,n,o,s,h;for(r.flags.FORBIDDENWORD===void 0&&(r.flags.FORBIDDENWORD=!1),h=r.flags.FORBIDDENWORD;++t<i.length;)n=i[t].trim(),n&&(n=n.split("/"),s=n[0],o=s.charAt(0)==="*",o&&(s=s.slice(1)),r.add(s,n[1]),o&&r.data[s].push(h));return r}});var qr=g((_r,Ye)=>{var Te=$(),Dr=ee();Ye.exports=T;var S=T.prototype;S.correct=oe();S.suggest=de();S.spell=Oe();S.add=Ae();S.remove=qe();S.wordCharacters=ye();S.dictionary=Me();S.personal=Pe();function T(e,r){var i=-1,t;if(!(this instanceof T))return new T(e,r);if(typeof e=="string"||Te(e)?(typeof r=="string"||Te(r))&&(t=[{dic:r}]):e&&("length"in e?(t=e,e=e[0]&&e[0].aff):(e.dic&&(t=[e]),e=e.aff)),!e)throw new Error("Missing `aff` in dictionary");if(e=Dr(e),this.data=Object.create(null),this.compoundRuleCodes=e.compoundRuleCodes,this.replacementTable=e.replacementTable,this.conversion=e.conversion,this.compoundRules=e.compoundRules,this.rules=e.rules,this.flags=e.flags,t)for(;++i<t.length;)t[i].dic&&this.dictionary(t[i].dic)}});export default qr();
|
|
14
|
+
/*! Bundled license information:
|
|
15
|
+
|
|
16
|
+
is-buffer/index.js:
|
|
17
|
+
(*!
|
|
18
|
+
* Determine if an object is a Buffer
|
|
19
|
+
*
|
|
20
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
21
|
+
* @license MIT
|
|
22
|
+
*)
|
|
23
|
+
*/
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a,b,c,d,e}from"./
|
|
7
|
+
import{a,b,c,d,e}from"./K4MJBKZB.js";import"./2U6O26CV.js";import"./FYDETXDC.js";import"./IBYLYDST.js";import"./WZXA5XPB.js";import"./JD3HIQIK.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as phpDocs,c as phpGenerator,d as phpSample,a as phpType,b as renderPhpModels};
|
|
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as g,b as q,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as z,l as C,m as D,n as E,o as G,p as H}from"./
|
|
7
|
+
import{a as g,b as q,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as z,l as C,m as D,n as E,o as G,p as H}from"./FYDETXDC.js";import{a as A,e as B,g as F}from"./IBYLYDST.js";import{a}from"./WZXA5XPB.js";import"./JD3HIQIK.js";import"./NEWT5A6S.js";import{a as b,b as c,c as d,d as e,e as f,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{y as AUTHORING_HELPER_NAMES,F as GENERATOR_VERSION,a as NotSupportedError,b as Printer,d as RESERVED_WORDS,B as WIRING_NAMES,A as allOperations,c as casing,D as constantCase,z as defineClientSetup,G as defineGenerator,h as deref,j as discriminatorCases,n as docText,m as enumValues,i as flattenAllOf,H as generateClient,C as groupSlug,p as headerCoerceType,e as identifierFor,t as isBinaryContentType,s as isMultipartBody,k as isNullable,q as jsonSuccessSchema,E as mergeConfig,w as paginationItemSchema,g as paginationRuleFor,x as renderReferencePage,o as resolveSchemaPointer,o as schemaAtPointer,v as securityRequirements,u as serverUrlParts,r as sseResponse,f as uniqueIdentifiers,l as unwrapNullable};
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{C as ys,D as xs,K as Pp,L as Tp,Q as lo,R as po,V as dr,X as ge,c as we,ca as _e,da as zs}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import{a as Oe,c as ie,d as uo,e as pr}from"./RFWIIJFG.js";var Cl=ie((ub,Rl)=>{Rl.exports=El;El.sync=bh;var Pl=Oe("fs");function wh(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var n=r[o].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Tl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:wh(t,r)}function El(e,t,r){Pl.stat(e,function(o,n){r(o,o?!1:Tl(n,e,t))})}function bh(e,t){return Tl(Pl.statSync(e),e,t)}});var Nl=ie((lb,Al)=>{Al.exports=Zl;Zl.sync=Sh;var Ol=Oe("fs");function Zl(e,t,r){Ol.stat(e,function(o,n){r(o,o?!1:Il(n,t))})}function Sh(e,t){return Il(Ol.statSync(e),t)}function Il(e,t){return e.isFile()&&kh(e,t)}function kh(e,t){var r=e.mode,o=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),p=a|c,d=r&u||r&c&&n===i||r&a&&o===s||r&p&&s===0;return d}});var Ml=ie((db,jl)=>{var pb=Oe("fs"),no;process.platform==="win32"||global.TESTING_WINDOWS?no=Cl():no=Nl();jl.exports=ss;ss.sync=$h;function ss(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,n){ss(e,t||{},function(s,i){s?n(s):o(i)})})}no(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function $h(e,t){try{return no.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hl=ie((fb,Vl)=>{var vt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dl=Oe("path"),Ph=vt?";":":",Ll=Ml(),Ul=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ql=(e,t)=>{let r=t.colon||Ph,o=e.match(/\//)||vt&&e.match(/\\/)?[""]:[...vt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=vt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vt?n.split(r):[""];return vt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},Fl=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:n,pathExtExe:s}=ql(e,t),i=[],a=u=>new Promise((p,d)=>{if(u===o.length)return t.all&&i.length?p(i):d(Ul(e));let h=o[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,z=Dl.join(m,e),S=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+z:z;p(c(S,u,0))}),c=(u,p,d)=>new Promise((h,m)=>{if(d===n.length)return h(a(p+1));let z=n[d];Ll(u+z,{pathExt:s},(S,k)=>{if(!S&&k)if(t.all)i.push(u+z);else return h(u+z);return h(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Th=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:o,pathExtExe:n}=ql(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Dl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let h=p+o[d];try{if(Ll.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Ul(e)};Vl.exports=Fl;Fl.sync=Th});var Bl=ie((mb,is)=>{"use strict";var Jl=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};is.exports=Jl;is.exports.default=Jl});var Xl=ie((hb,Kl)=>{"use strict";var Wl=Oe("path"),Eh=Hl(),Rh=Bl();function Gl(e,t){let r=e.options.env||process.env,o=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Eh.sync(e.command,{path:r[Rh({env:r})],pathExt:t?Wl.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=Wl.resolve(n?e.options.cwd:"",i)),i}function Ch(e){return Gl(e)||Gl(e,!0)}Kl.exports=Ch});var Yl=ie((gb,cs)=>{"use strict";var as=/([()\][%!^"`<>&|;, *?])/g;function Oh(e){return e=e.replace(as,"^$1"),e}function Zh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(as,"^$1"),t&&(e=e.replace(as,"^$1")),e}cs.exports.command=Oh;cs.exports.argument=Zh});var ep=ie((_b,Ql)=>{"use strict";Ql.exports=/^#!(.*)/});var rp=ie((yb,tp)=>{"use strict";var Ih=ep();tp.exports=(e="")=>{let t=e.match(Ih);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var np=ie((xb,op)=>{"use strict";var us=Oe("fs"),Ah=rp();function Nh(e){let r=Buffer.alloc(150),o;try{o=us.openSync(e,"r"),us.readSync(o,r,0,150,0),us.closeSync(o)}catch{}return Ah(r.toString())}op.exports=Nh});var cp=ie((zb,ap)=>{"use strict";var jh=Oe("path"),sp=Xl(),ip=Yl(),Mh=np(),Dh=process.platform==="win32",Lh=/\.(?:com|exe)$/i,Uh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qh(e){e.file=sp(e);let t=e.file&&Mh(e.file);return t?(e.args.unshift(e.file),e.command=t,sp(e)):e.file}function Fh(e){if(!Dh)return e;let t=qh(e),r=!Lh.test(t);if(e.options.forceShell||r){let o=Uh.test(t);e.command=jh.normalize(e.command),e.command=ip.command(e.command),e.args=e.args.map(s=>ip.argument(s,o));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vh(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let o={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?o:Fh(o)}ap.exports=Vh});var pp=ie((vb,lp)=>{"use strict";var ls=process.platform==="win32";function ps(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Hh(e,t){if(!ls)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=up(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function up(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawn"):null}function Jh(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawnSync"):null}lp.exports={hookChildProcess:Hh,verifyENOENT:up,verifyENOENTSync:Jh,notFoundError:ps}});var mp=ie((wb,wt)=>{"use strict";var dp=Oe("child_process"),ds=cp(),fs=pp();function fp(e,t,r){let o=ds(e,t,r),n=dp.spawn(o.command,o.args,o.options);return fs.hookChildProcess(n,o),n}function Bh(e,t,r){let o=ds(e,t,r),n=dp.spawnSync(o.command,o.args,o.options);return n.error=n.error||fs.verifyENOENTSync(n.status,o),n}wt.exports=fp;wt.exports.spawn=fp;wt.exports.sync=Bh;wt.exports._parse=ds;wt.exports._enoent=fs});var zp=ie(hs=>{"use strict";var _p=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Qh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,yp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,eg=/\\([\u000b\u0020-\u00ff])/g,tg=/([\\"])/g,xp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;hs.format=rg;hs.parse=og;function rg(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!xp.test(r))throw new TypeError("invalid type");var o=r;if(t&&typeof t=="object")for(var n,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(n=s[i],!yp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+sg(t[n])}return o}function og(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ng(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),o=r!==-1?t.slice(0,r).trim():t.trim();if(!xp.test(o))throw new TypeError("invalid media type");var n=new ig(o.toLowerCase());if(r!==-1){var s,i,a;for(_p.lastIndex=r;i=_p.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(eg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ng(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function sg(e){var t=String(e);if(yp.test(t))return t;if(t.length>0&&!Qh.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(tg,"\\$1")+'"'}function ig(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as dg,mkdirSync as fg,readFileSync as mg,writeFileSync as hg}from"node:fs";import{dirname as gg}from"node:path";import{isDeepStrictEqual as St}from"node:util";function bt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])we(r)&&t.set(r.name,r);return t}function fr(e,t,r){let o=bt(t);return e.map(n=>{let s=o.get(n.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...n,...i}})}function Ep(e,t){let r=bt(t);return fr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:fr(o.arguments,n,["example"])}})}function fo(e,t,r){let o=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},n=we(o["x-mcp"])?o["x-mcp"]:{},s={...n};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>we(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=fr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Ep(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=fr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Rp(e,t){let r=bt(e),o=bt(t),n=[...o.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!o.has(c)),i=[...o.keys()].filter(c=>r.has(c)&&!St(r.get(c),o.get(c))),a=[];return n.length>0&&a.push(`added: ${n.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vs(e,t){if(St(e,t))return[];let r=we(e["x-mcp"])?e["x-mcp"]:{},o=we(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Rp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return St(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),St(r.capabilities,o.capabilities)||n.push("capabilities changed"),St(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var ws,mo=Object.freeze({status:"aborted"});function f(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let h=p[d];h in a||(a[h]=u[h].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},tt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ws=globalThis).__zod_globalConfig??(ws.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ae(e){return e&&Object.assign(rt,e),rt}var C={};uo(C,{BIGINT_FORMAT_RANGES:()=>$s,Class:()=>go,NUMBER_FORMAT_RANGES:()=>wo,aborted:()=>Ae,allowsEval:()=>xo,assert:()=>Ap,assertEqual:()=>Cp,assertIs:()=>Zp,assertNever:()=>Ip,assertNotEqual:()=>Op,assignProp:()=>Ze,base64ToUint8Array:()=>Ts,base64urlToUint8Array:()=>Yp,cached:()=>nt,captureStackTrace:()=>gr,cleanEnum:()=>Xp,cleanRegex:()=>Tt,clone:()=>de,cloneDef:()=>jp,createTransparentProxy:()=>Fp,defineLazy:()=>I,esc:()=>hr,escapeRegex:()=>Se,explicitlyAborted:()=>bo,extend:()=>Jp,finalizeIssue:()=>fe,floatSafeRemainder:()=>_o,getElementAtPath:()=>Mp,getEnumValues:()=>$t,getLengthableOrigin:()=>Et,getParsedType:()=>qp,getSizableOrigin:()=>Ps,hexToUint8Array:()=>ed,isObject:()=>Fe,isPlainObject:()=>Ie,issue:()=>st,joinValues:()=>mr,jsonStringifyReplacer:()=>ot,merge:()=>Wp,mergeDefs:()=>be,normalizeParams:()=>w,nullish:()=>Pt,numKeys:()=>Up,objectClone:()=>Np,omit:()=>Hp,optionalKeys:()=>vo,parsedType:()=>So,partial:()=>Gp,pick:()=>Vp,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>Dp,propertyKeyTypes:()=>zo,randomString:()=>Lp,required:()=>Kp,safeExtend:()=>Bp,shallowClone:()=>Ss,slugify:()=>yo,stringifyPrimitive:()=>_r,uint8ArrayToBase64:()=>Es,uint8ArrayToBase64url:()=>Qp,uint8ArrayToHex:()=>td,unwrapMessage:()=>kt});function Cp(e){return e}function Op(e){return e}function Zp(e){}function Ip(e){throw new Error("Unexpected value in exhaustive check")}function Ap(e){}function $t(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function mr(e,t="|"){return e.map(r=>_r(r)).join(t)}function ot(e,t){return typeof t=="bigint"?t.toString():t}function nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var bs=Symbol("evaluating");function I(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==bs)return o===void 0&&(o=bs,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Np(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ze(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function be(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function jp(e){return be(e._zod.def)}function Mp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Dp(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function Lp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hr(e){return JSON.stringify(e)}function yo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var gr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xo=nt(()=>{if(rt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ie(e){if(Fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Fe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ss(e){return Ie(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var qp=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},zo=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function w(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Fp(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function _r(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var wo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$s={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=be(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return Ze(this,"shape",i),i},checks:[]});return de(e,s)}function Hp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=be(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ze(this,"shape",i),i},checks:[]});return de(e,s)}function Jp(e,t){if(!Ie(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=be(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return de(e,n)}function Bp(e,t){if(!Ie(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return de(e,r)}function Wp(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return de(e,r)}function Gp(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=be(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Ze(this,"shape",c),c},checks:[]});return de(t,i)}function Kp(e,t,r){let o=be(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Ze(this,"shape",s),s}});return de(t,o)}function Ae(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function bo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kt(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){let o=e.message?e.message:kt(e.inst?._zod.def?.error?.(e))??kt(t?.error?.(e))??kt(r.customError?.(e))??kt(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function Ps(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Et(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function So(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function st(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Xp(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ts(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Es(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Yp(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ts(t+r)}function Qp(e){return Es(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ed(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function td(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var go=class{constructor(...t){}};var Rs=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yr=f("$ZodError",Rs),ko=f("$ZodError",Rs,{Parent:Error});function $o(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Po(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let p=a[u];u===a.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}}};return o(e),r}var xr=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ve;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var zr=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var Rt=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new ve;return s.issues.length?{success:!1,error:new(e??yr)(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},Ct=Rt(ko),Ot=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},vr=Ot(ko),Cs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return xr(e)(t,r,n)};var Os=e=>(t,r,o)=>xr(e)(t,r,o);var Zs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)};var Is=e=>async(t,r,o)=>zr(e)(t,r,o);var As=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rt(e)(t,r,n)};var Ns=e=>(t,r,o)=>Rt(e)(t,r,o);var js=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Ms=e=>async(t,r,o)=>Ot(e)(t,r,o);var Ds=/^[cC][0-9a-z]{6,}$/,Ls=/^[0-9a-z]+$/,Us=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qs=/^[0-9a-vA-V]{20}$/,Fs=/^[A-Za-z0-9]{27}$/,Vs=/^[a-zA-Z0-9_-]{21}$/,Hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Js=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,To=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Bs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var od="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ws(){return new RegExp(od,"u")}var Gs=/^(?:(?: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])$/,Ks=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Xs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ys=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/;var ei=/^https?$/,ti=/^\+[1-9]\d{6,14}$/,ri="(?:(?:\\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])))",oi=new RegExp(`^${ri}$`);function ni(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function si(e){return new RegExp(`^${ni(e)}$`)}function ii(e){let t=ni({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ri}T(?:${o})$`)}var ai=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ci=/^-?\d+n?$/,ui=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,li=/^(?:true|false)$/i,pi=/^null$/i;var di=/^[^A-Z]*$/,fi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mi={number:"number",bigint:"bigint",object:"date"},Co=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=mi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oo=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=mi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hi=f("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):_o(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gi=f("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=wo[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=ui)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var _i=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=Et(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yi=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=Et(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=Et(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),It=f("$ZodCheckStringFormat",(e,t)=>{var r,o;Q.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),zi=f("$ZodCheckRegex",(e,t)=>{It.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=di),It.init(e,t)}),wi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fi),It.init(e,t)}),bi=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Se(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Si=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Se(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Se(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var $i=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var wr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
7
|
+
import{$ as lo,N as ys,O as xs,V as Pp,W as Tp,aa as po,c as we,ea as dr,ga as ge,ma as _e,na as zs}from"./JD3HIQIK.js";import"./NEWT5A6S.js";import{a as Oe,c as ie,d as uo,e as pr}from"./RFWIIJFG.js";var Cl=ie((ub,Rl)=>{Rl.exports=El;El.sync=bh;var Pl=Oe("fs");function wh(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var n=r[o].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Tl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:wh(t,r)}function El(e,t,r){Pl.stat(e,function(o,n){r(o,o?!1:Tl(n,e,t))})}function bh(e,t){return Tl(Pl.statSync(e),e,t)}});var Nl=ie((lb,Al)=>{Al.exports=Zl;Zl.sync=Sh;var Ol=Oe("fs");function Zl(e,t,r){Ol.stat(e,function(o,n){r(o,o?!1:Il(n,t))})}function Sh(e,t){return Il(Ol.statSync(e),t)}function Il(e,t){return e.isFile()&&kh(e,t)}function kh(e,t){var r=e.mode,o=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),p=a|c,d=r&u||r&c&&n===i||r&a&&o===s||r&p&&s===0;return d}});var Ml=ie((db,jl)=>{var pb=Oe("fs"),no;process.platform==="win32"||global.TESTING_WINDOWS?no=Cl():no=Nl();jl.exports=ss;ss.sync=$h;function ss(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,n){ss(e,t||{},function(s,i){s?n(s):o(i)})})}no(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function $h(e,t){try{return no.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hl=ie((fb,Vl)=>{var vt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dl=Oe("path"),Ph=vt?";":":",Ll=Ml(),Ul=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ql=(e,t)=>{let r=t.colon||Ph,o=e.match(/\//)||vt&&e.match(/\\/)?[""]:[...vt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=vt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vt?n.split(r):[""];return vt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},Fl=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:n,pathExtExe:s}=ql(e,t),i=[],a=u=>new Promise((p,d)=>{if(u===o.length)return t.all&&i.length?p(i):d(Ul(e));let h=o[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,z=Dl.join(m,e),S=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+z:z;p(c(S,u,0))}),c=(u,p,d)=>new Promise((h,m)=>{if(d===n.length)return h(a(p+1));let z=n[d];Ll(u+z,{pathExt:s},(S,k)=>{if(!S&&k)if(t.all)i.push(u+z);else return h(u+z);return h(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Th=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:o,pathExtExe:n}=ql(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Dl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let h=p+o[d];try{if(Ll.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Ul(e)};Vl.exports=Fl;Fl.sync=Th});var Bl=ie((mb,is)=>{"use strict";var Jl=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};is.exports=Jl;is.exports.default=Jl});var Xl=ie((hb,Kl)=>{"use strict";var Wl=Oe("path"),Eh=Hl(),Rh=Bl();function Gl(e,t){let r=e.options.env||process.env,o=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Eh.sync(e.command,{path:r[Rh({env:r})],pathExt:t?Wl.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=Wl.resolve(n?e.options.cwd:"",i)),i}function Ch(e){return Gl(e)||Gl(e,!0)}Kl.exports=Ch});var Yl=ie((gb,cs)=>{"use strict";var as=/([()\][%!^"`<>&|;, *?])/g;function Oh(e){return e=e.replace(as,"^$1"),e}function Zh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(as,"^$1"),t&&(e=e.replace(as,"^$1")),e}cs.exports.command=Oh;cs.exports.argument=Zh});var ep=ie((_b,Ql)=>{"use strict";Ql.exports=/^#!(.*)/});var rp=ie((yb,tp)=>{"use strict";var Ih=ep();tp.exports=(e="")=>{let t=e.match(Ih);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var np=ie((xb,op)=>{"use strict";var us=Oe("fs"),Ah=rp();function Nh(e){let r=Buffer.alloc(150),o;try{o=us.openSync(e,"r"),us.readSync(o,r,0,150,0),us.closeSync(o)}catch{}return Ah(r.toString())}op.exports=Nh});var cp=ie((zb,ap)=>{"use strict";var jh=Oe("path"),sp=Xl(),ip=Yl(),Mh=np(),Dh=process.platform==="win32",Lh=/\.(?:com|exe)$/i,Uh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qh(e){e.file=sp(e);let t=e.file&&Mh(e.file);return t?(e.args.unshift(e.file),e.command=t,sp(e)):e.file}function Fh(e){if(!Dh)return e;let t=qh(e),r=!Lh.test(t);if(e.options.forceShell||r){let o=Uh.test(t);e.command=jh.normalize(e.command),e.command=ip.command(e.command),e.args=e.args.map(s=>ip.argument(s,o));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vh(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let o={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?o:Fh(o)}ap.exports=Vh});var pp=ie((vb,lp)=>{"use strict";var ls=process.platform==="win32";function ps(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Hh(e,t){if(!ls)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=up(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function up(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawn"):null}function Jh(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawnSync"):null}lp.exports={hookChildProcess:Hh,verifyENOENT:up,verifyENOENTSync:Jh,notFoundError:ps}});var mp=ie((wb,wt)=>{"use strict";var dp=Oe("child_process"),ds=cp(),fs=pp();function fp(e,t,r){let o=ds(e,t,r),n=dp.spawn(o.command,o.args,o.options);return fs.hookChildProcess(n,o),n}function Bh(e,t,r){let o=ds(e,t,r),n=dp.spawnSync(o.command,o.args,o.options);return n.error=n.error||fs.verifyENOENTSync(n.status,o),n}wt.exports=fp;wt.exports.spawn=fp;wt.exports.sync=Bh;wt.exports._parse=ds;wt.exports._enoent=fs});var zp=ie(hs=>{"use strict";var _p=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Qh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,yp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,eg=/\\([\u000b\u0020-\u00ff])/g,tg=/([\\"])/g,xp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;hs.format=rg;hs.parse=og;function rg(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!xp.test(r))throw new TypeError("invalid type");var o=r;if(t&&typeof t=="object")for(var n,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(n=s[i],!yp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+sg(t[n])}return o}function og(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ng(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),o=r!==-1?t.slice(0,r).trim():t.trim();if(!xp.test(o))throw new TypeError("invalid media type");var n=new ig(o.toLowerCase());if(r!==-1){var s,i,a;for(_p.lastIndex=r;i=_p.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(eg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ng(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function sg(e){var t=String(e);if(yp.test(t))return t;if(t.length>0&&!Qh.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(tg,"\\$1")+'"'}function ig(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as dg,mkdirSync as fg,readFileSync as mg,writeFileSync as hg}from"node:fs";import{dirname as gg}from"node:path";import{isDeepStrictEqual as St}from"node:util";function bt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])we(r)&&t.set(r.name,r);return t}function fr(e,t,r){let o=bt(t);return e.map(n=>{let s=o.get(n.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...n,...i}})}function Ep(e,t){let r=bt(t);return fr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:fr(o.arguments,n,["example"])}})}function fo(e,t,r){let o=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},n=we(o["x-mcp"])?o["x-mcp"]:{},s={...n};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>we(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=fr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Ep(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=fr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Rp(e,t){let r=bt(e),o=bt(t),n=[...o.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!o.has(c)),i=[...o.keys()].filter(c=>r.has(c)&&!St(r.get(c),o.get(c))),a=[];return n.length>0&&a.push(`added: ${n.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vs(e,t){if(St(e,t))return[];let r=we(e["x-mcp"])?e["x-mcp"]:{},o=we(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Rp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return St(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),St(r.capabilities,o.capabilities)||n.push("capabilities changed"),St(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var ws,mo=Object.freeze({status:"aborted"});function f(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let h=p[d];h in a||(a[h]=u[h].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},tt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ws=globalThis).__zod_globalConfig??(ws.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ae(e){return e&&Object.assign(rt,e),rt}var C={};uo(C,{BIGINT_FORMAT_RANGES:()=>$s,Class:()=>go,NUMBER_FORMAT_RANGES:()=>wo,aborted:()=>Ae,allowsEval:()=>xo,assert:()=>Ap,assertEqual:()=>Cp,assertIs:()=>Zp,assertNever:()=>Ip,assertNotEqual:()=>Op,assignProp:()=>Ze,base64ToUint8Array:()=>Ts,base64urlToUint8Array:()=>Yp,cached:()=>nt,captureStackTrace:()=>gr,cleanEnum:()=>Xp,cleanRegex:()=>Tt,clone:()=>de,cloneDef:()=>jp,createTransparentProxy:()=>Fp,defineLazy:()=>I,esc:()=>hr,escapeRegex:()=>Se,explicitlyAborted:()=>bo,extend:()=>Jp,finalizeIssue:()=>fe,floatSafeRemainder:()=>_o,getElementAtPath:()=>Mp,getEnumValues:()=>$t,getLengthableOrigin:()=>Et,getParsedType:()=>qp,getSizableOrigin:()=>Ps,hexToUint8Array:()=>ed,isObject:()=>Fe,isPlainObject:()=>Ie,issue:()=>st,joinValues:()=>mr,jsonStringifyReplacer:()=>ot,merge:()=>Wp,mergeDefs:()=>be,normalizeParams:()=>w,nullish:()=>Pt,numKeys:()=>Up,objectClone:()=>Np,omit:()=>Hp,optionalKeys:()=>vo,parsedType:()=>So,partial:()=>Gp,pick:()=>Vp,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>Dp,propertyKeyTypes:()=>zo,randomString:()=>Lp,required:()=>Kp,safeExtend:()=>Bp,shallowClone:()=>Ss,slugify:()=>yo,stringifyPrimitive:()=>_r,uint8ArrayToBase64:()=>Es,uint8ArrayToBase64url:()=>Qp,uint8ArrayToHex:()=>td,unwrapMessage:()=>kt});function Cp(e){return e}function Op(e){return e}function Zp(e){}function Ip(e){throw new Error("Unexpected value in exhaustive check")}function Ap(e){}function $t(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function mr(e,t="|"){return e.map(r=>_r(r)).join(t)}function ot(e,t){return typeof t=="bigint"?t.toString():t}function nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var bs=Symbol("evaluating");function I(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==bs)return o===void 0&&(o=bs,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Np(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ze(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function be(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function jp(e){return be(e._zod.def)}function Mp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Dp(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function Lp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hr(e){return JSON.stringify(e)}function yo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var gr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xo=nt(()=>{if(rt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ie(e){if(Fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Fe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ss(e){return Ie(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var qp=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},zo=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function w(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Fp(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function _r(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var wo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$s={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=be(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return Ze(this,"shape",i),i},checks:[]});return de(e,s)}function Hp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=be(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ze(this,"shape",i),i},checks:[]});return de(e,s)}function Jp(e,t){if(!Ie(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=be(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return de(e,n)}function Bp(e,t){if(!Ie(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return de(e,r)}function Wp(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return de(e,r)}function Gp(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=be(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Ze(this,"shape",c),c},checks:[]});return de(t,i)}function Kp(e,t,r){let o=be(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Ze(this,"shape",s),s}});return de(t,o)}function Ae(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function bo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kt(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){let o=e.message?e.message:kt(e.inst?._zod.def?.error?.(e))??kt(t?.error?.(e))??kt(r.customError?.(e))??kt(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function Ps(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Et(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function So(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function st(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Xp(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ts(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Es(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Yp(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ts(t+r)}function Qp(e){return Es(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ed(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function td(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var go=class{constructor(...t){}};var Rs=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yr=f("$ZodError",Rs),ko=f("$ZodError",Rs,{Parent:Error});function $o(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Po(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let p=a[u];u===a.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}}};return o(e),r}var xr=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ve;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var zr=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var Rt=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new ve;return s.issues.length?{success:!1,error:new(e??yr)(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},Ct=Rt(ko),Ot=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},vr=Ot(ko),Cs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return xr(e)(t,r,n)};var Os=e=>(t,r,o)=>xr(e)(t,r,o);var Zs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)};var Is=e=>async(t,r,o)=>zr(e)(t,r,o);var As=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rt(e)(t,r,n)};var Ns=e=>(t,r,o)=>Rt(e)(t,r,o);var js=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Ms=e=>async(t,r,o)=>Ot(e)(t,r,o);var Ds=/^[cC][0-9a-z]{6,}$/,Ls=/^[0-9a-z]+$/,Us=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qs=/^[0-9a-vA-V]{20}$/,Fs=/^[A-Za-z0-9]{27}$/,Vs=/^[a-zA-Z0-9_-]{21}$/,Hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Js=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,To=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Bs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var od="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ws(){return new RegExp(od,"u")}var Gs=/^(?:(?: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])$/,Ks=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Xs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ys=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/;var ei=/^https?$/,ti=/^\+[1-9]\d{6,14}$/,ri="(?:(?:\\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])))",oi=new RegExp(`^${ri}$`);function ni(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function si(e){return new RegExp(`^${ni(e)}$`)}function ii(e){let t=ni({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ri}T(?:${o})$`)}var ai=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ci=/^-?\d+n?$/,ui=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,li=/^(?:true|false)$/i,pi=/^null$/i;var di=/^[^A-Z]*$/,fi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mi={number:"number",bigint:"bigint",object:"date"},Co=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=mi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oo=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=mi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hi=f("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):_o(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gi=f("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=wo[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=ui)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var _i=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=Et(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yi=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=Et(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=Et(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),It=f("$ZodCheckStringFormat",(e,t)=>{var r,o;Q.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),zi=f("$ZodCheckRegex",(e,t)=>{It.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=di),It.init(e,t)}),wi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fi),It.init(e,t)}),bi=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Se(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Si=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Se(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Se(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var $i=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var wr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
8
8
|
`).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,n.join(`
|
|
9
9
|
`))}};var Ti={major:4,minor:4,patch:3};var A=f("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ti;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,a,c)=>{let u=Ae(i),p;for(let d of a){if(d._zod.def.when){if(bo(i)||!d._zod.def.when(i))continue}else if(u)continue;let h=i.issues.length,m=d._zod.check(i);if(m instanceof Promise&&c?.async===!1)throw new ve;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,i.issues.length!==h&&(u||(u=Ae(i,h)))});else{if(i.issues.length===h)continue;u||(u=Ae(i,h))}}return p?p.then(()=>i):i},s=(i,a,c)=>{if(Ae(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new ve;return u.then(p=>e._zod.parse(p,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(p=>s(p,i,a)):s(u,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new ve;return c.then(u=>n(u,o,a))}return n(c,o,a)}}I(e,"~standard",()=>({validate:n=>{try{let s=Ct(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vr(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),kr=f("$ZodString",(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ai(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),D=f("$ZodStringFormat",(e,t)=>{It.init(e,t),kr.init(e,t)}),ji=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Js),D.init(e,t)}),Mi=f("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=To(o))}else t.pattern??(t.pattern=To());D.init(e,t)}),Di=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bs),D.init(e,t)}),Li=f("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===ei.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ui=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ws()),D.init(e,t)}),qi=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Vs),D.init(e,t)}),Fi=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ds),D.init(e,t)}),Vi=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ls),D.init(e,t)}),Hi=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Us),D.init(e,t)}),Ji=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qs),D.init(e,t)}),Bi=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fs),D.init(e,t)}),Wi=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ii(t)),D.init(e,t)}),Gi=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oi),D.init(e,t)}),Ki=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=si(t)),D.init(e,t)}),Xi=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hs),D.init(e,t)}),Yi=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gs),D.init(e,t),e._zod.bag.format="ipv4"}),Qi=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ks),D.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var ea=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xs),D.init(e,t)}),ta=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ys),D.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ra(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var oa=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qs),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ra(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function id(e){if(!Eo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ra(r)}var na=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Eo),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{id(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),sa=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ti),D.init(e,t)});function ad(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var ia=f("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=r=>{ad(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Io=f("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ro,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),aa=f("$ZodNumberFormat",(e,t)=>{gi.init(e,t),Io.init(e,t)}),ca=f("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=li,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ua=f("$ZodBigInt",(e,t)=>{A.init(e,t),e._zod.pattern=ci,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var la=f("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=pi,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),pa=f("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=r=>r}),da=f("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=r=>r}),fa=f("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var ma=f("$ZodDate",(e,t)=>{A.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Ei(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}var ha=f("$ZodArray",(e,t)=>{A.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>Ei(u,r,i))):Ei(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Sr(e,t,r,o,n,s){let i=r in o;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...ke(r,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function ga(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=vo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function _a(e,t,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,p=c.optin==="optional",d=c.optout==="optional";for(let h in t){if(h==="__proto__"||a.has(h))continue;if(u==="never"){i.push(h);continue}let m=c.run({value:t[h],issues:[]},o);m instanceof Promise?e.push(m.then(z=>Sr(z,r,h,t,p,d))):Sr(m,r,h,t,p,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}var cd=f("$ZodObject",(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=nt(()=>ga(t));I(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let p=a[u]._zod;if(p.values){c[u]??(c[u]=new Set);for(let d of p.values)c[u].add(d)}}return c});let n=Fe,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let p=[],d=i.shape;for(let h of i.keys){let m=d[h],z=m._zod.optin==="optional",S=m._zod.optout==="optional",k=m._zod.run({value:u[h],issues:[]},c);k instanceof Promise?p.push(k.then(B=>Sr(B,a,h,u,z,S))):Sr(k,a,h,u,z,S)}return s?_a(p,u,a,c,o.value,e):p.length?Promise.all(p).then(()=>a):a}}),ya=f("$ZodObjectJIT",(e,t)=>{cd.init(e,t);let r=e._zod.parse,o=nt(()=>ga(t)),n=h=>{let m=new wr(["shape","payload","ctx"]),z=o.value,S=P=>{let R=hr(P);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};m.write("const input = payload.value;");let k=Object.create(null),B=0;for(let P of z.keys)k[P]=`key_${B++}`;m.write("const newResult = {};");for(let P of z.keys){let R=k[P],_=hr(P),x=h[P],E=x?._zod?.optin==="optional",W=x?._zod?.optout==="optional";m.write(`const ${R} = ${S(P)};`),E&&W?m.write(`
|
|
10
10
|
if (${R}.issues.length) {
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as x,b as f,c as m,d}from"./
|
|
7
|
+
import{a as x,b as f,c as m,d}from"./7HGHXQBL.js";import{b as y,d as h,e as l}from"./LD5MEXEL.js";import{m as P}from"./UW4UC7ZI.js";import{join as E}from"node:path";function q(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[j(n,t,r),...n.filter(f).map(i=>K(i,t.queryKeyPrefix)),Q(e,n,r,t.queryKeyPrefix,t.argsStyle),...R(n,r)].join(`
|
|
8
8
|
`)}function b(e,t){if(!f(e))return!1;let n=t.get(e.name);return n!==void 0&&n.spec.style!=="link"}function j(e,t,n){let r=[...e.some(a=>b(a,n))?["infiniteQueryOptions"]:[],...e.some(f)?["queryOptions"]:[]],s=[...e.filter(m).map(d),"RequestOptions"].sort().map(a=>`type ${a}`),i=[];return r.length>0&&i.push(`import { ${r.join(", ")} } from "@tanstack/${t.framework}-query";`),i.push(`import { client, ${s.join(", ")} } from "${t.sdkModule}";`),i.join(`
|
|
9
9
|
`)}function K(e,t){let n=M(e,t);return m(e)?`export const ${e.name}QueryKey = (vars?: ${d(e)}) =>
|
|
10
10
|
vars === undefined ? ([${n}] as const) : ([${n}, vars] as const);`:`export const ${e.name}QueryKey = () => [${n}] as const;`}function M(e,t){return t===void 0?`"${e.name}"`:`${h(t)}, "${e.name}"`}function Q(e,t,n,r,s){return`/**
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as h}from"./
|
|
7
|
+
import{a as h}from"./IBYLYDST.js";import{e as g,h as p,k as $}from"./LD5MEXEL.js";import{join as R}from"node:path";var a=" ";function m(e){return`${$(e)}Schema`}var y=new Map;function u(e,r=y,t=""){return j(w(e,r,t),e)}function w(e,r,t){switch(e.kind){case"scalar":return z(e.scalar,e.metadata);case"object":return b(e.properties,r,t);case"array":return`z.array(${u(e.items,r,t)})`;case"record":return`z.record(z.string(), ${u(e.value,r,t)})`;case"ref":return`z.lazy(() => ${m(e.name)})`;case"literal":return`z.literal(${p(e.value)})`;case"enum":return q(e.values);case"union":return k(e.members,r,t);case"intersection":return e.members.map(n=>u(n,r,t)).reduce((n,o)=>`${n}.and(${o})`);case"null":return"z.null()";case"unknown":return"z.unknown()";case"omit":return E(e.base,e.keys,r,t)}}function z(e,r){switch(e){case"string":return r?.format==="binary"?"z.instanceof(Blob)":"z.string()";case"integer":return"z.number().int()";case"number":return"z.number()";case"boolean":return"z.boolean()"}}function c(e){return g(e)===e?e:JSON.stringify(e)}function b(e,r,t){if(e.length===0)return"z.object({})";let n=t+a;return`z.object({
|
|
8
8
|
${e.map((s,i)=>{let d=u(s.schema,r,n),l=s.required?d:`${d}.optional()`,x=i===e.length-1?"":",";return`${n}${c(s.name)}: ${l}${x}`}).join(`
|
|
9
9
|
`)}
|
|
10
10
|
${t}})`}function q(e){return e.every(r=>typeof r=="string")?`z.enum([${e.map(r=>JSON.stringify(r)).join(", ")}])`:`z.union([${e.map(r=>`z.literal(${p(r)})`).join(", ")}])`}function k(e,r,t){let n=e.map(o=>u(o,r,t));return n.length===1?n[0]:`z.union([${n.join(", ")}])`}function E(e,r,t,n){let o=t.get(e);if(o&&o.kind!=="object")return u(f(o,r,t,new Set([e])),t,n);let s=r.map(i=>`${c(i)}: true`).join(", ");return`${m(e)}.omit({ ${s} })`}function f(e,r,t,n){switch(e.kind){case"object":return{...e,properties:e.properties.filter(o=>!r.includes(o.name))};case"union":case"intersection":return{...e,members:e.members.map(o=>f(o,r,t,n))};case"ref":{if(n.has(e.name))return e;let o=t.get(e.name);if(!o)return e;if(o.kind==="object"){let s=r.filter(i=>o.properties.some(d=>d.name===i));return s.length>0?{kind:"omit",base:e.name,keys:s}:e}return f(o,r,t,new Set([...n,e.name]))}default:return e}}function j(e,r){let t=r.metadata;if(!t)return e;let n=e;return r.kind==="scalar"&&r.scalar==="string"&&(t.minLength!==void 0&&(n=`${n}.min(${t.minLength})`),t.maxLength!==void 0&&(n=`${n}.max(${t.maxLength})`),t.pattern!==void 0&&(n=`${n}.regex(new RegExp(${JSON.stringify(t.pattern)}))`)),r.kind==="scalar"&&(r.scalar==="number"||r.scalar==="integer")&&(t.minimum!==void 0&&(n=`${n}.min(${t.minimum})`),t.maximum!==void 0&&(n=`${n}.max(${t.maximum})`),t.exclusiveMinimum!==void 0&&(n=`${n}.gt(${t.exclusiveMinimum})`),t.exclusiveMaximum!==void 0&&(n=`${n}.lt(${t.exclusiveMaximum})`)),r.kind==="array"&&(t.minItems!==void 0&&(n=`${n}.min(${t.minItems})`),t.maxItems!==void 0&&(n=`${n}.max(${t.maxItems})`)),n}function Z(e,r){let t=[];for(let n of h(e.services)){if(n.sse!==void 0)continue;let o=n.requestBody,s=o&&o.contentType.toLowerCase().includes("json")?u(o.schema,r,a):void 0,i=n.successResponses.find(l=>l.contentType.toLowerCase().includes("json")),d=i?u(i.schema,r,a):void 0;!s&&!d||t.push({name:n.specName??n.name,request:s,response:d})}return t}function I(e){let r=e.flatMap(n=>[`${a}${c(n.name)}: {`,...n.request?[`${a}${a}request: z.ZodType;`]:[],...n.response?[`${a}${a}response: z.ZodType;`]:[],`${a}};`]),t=e.map((n,o)=>{let s=[...n.request?[`request: ${n.request}`]:[],...n.response?[`response: ${n.response}`]:[]].join(", "),i=o===e.length-1?"":",";return`${a}${c(n.name)}: { ${s} }${i}`});return["/**"," * Request/response validators by operationId \u2014 powers `zodValidation`, or import one directly."," */","export const operationSchemas: {",...r,"} = {",...t,"};"].join(`
|