@redocly/cli 0.0.0-snapshot.1789492843 → 0.0.0-snapshot.1789731437
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/lib/chunks/{XPHOWQ3Y.js → 2LERQER3.js} +1 -1
- package/lib/chunks/{57GP3VNL.js → 2U5KIADI.js} +1 -1
- package/lib/chunks/{MVJAMA7T.js → 3OB725C6.js} +2 -2
- package/lib/chunks/{GIVKLJ6M.js → 476FUIKA.js} +1 -1
- package/lib/chunks/{43DAQT7Q.js → 55H7Y6TK.js} +1 -1
- package/lib/chunks/{ME6DYHXT.js → 5PXWSJYP.js} +1 -1
- package/lib/chunks/{D5P2JJM4.js → 6GSPSKCJ.js} +1 -1
- package/lib/chunks/{4PTP4OCB.js → A3AB6T42.js} +1 -1
- package/lib/chunks/{XOQ7F7PG.js → APRETK7A.js} +1 -1
- package/lib/chunks/{U2VUE67W.js → AVYCSY2T.js} +1 -1
- package/lib/chunks/{BYVXO73S.js → BCNZNT7P.js} +1 -1
- package/lib/chunks/{S4WGHFZF.js → BUJIIH33.js} +1 -1
- package/lib/chunks/{HYMEM6GK.js → C7BV5J6H.js} +1 -1
- package/lib/chunks/{U5ULU4YC.js → CMTYC2JL.js} +1 -1
- package/lib/chunks/{WE77IT4J.js → DCO2HIXB.js} +1 -1
- package/lib/chunks/{BCV45Q5S.js → DILJGE67.js} +1 -1
- package/lib/chunks/{GI2P4DJS.js → DMBUELJC.js} +1 -1
- package/lib/chunks/{5HKSYDFX.js → DPE2PRU7.js} +1 -1
- package/lib/chunks/{R4QNRX2V.js → G2Z3DHA6.js} +3 -3
- package/lib/chunks/{MF3UDNOR.js → GHLFAXX5.js} +1 -1
- package/lib/chunks/{2KH4MQ3B.js → IDVV5SWN.js} +1 -1
- package/lib/chunks/{B7HP2NMU.js → KEQD3VCF.js} +1 -1
- package/lib/chunks/{JN7Q5OWX.js → KOODQW3O.js} +1 -1
- package/lib/chunks/{YOCL55CM.js → L33C5R2L.js} +1 -1
- package/lib/chunks/{ZOFGEOU5.js → MYEB35VJ.js} +1 -1
- package/lib/chunks/{YAZQNS6J.js → MZ336HKB.js} +1 -1
- package/lib/chunks/{NL75ACYZ.js → NBW7PB6V.js} +1 -1
- package/lib/chunks/{VSQ4F6HO.js → OC7NSSO4.js} +1 -1
- package/lib/chunks/{NLXJZIJP.js → P2QB7VRJ.js} +4 -4
- package/lib/chunks/{MIU2OX56.js → QGBC3NI6.js} +1 -1
- package/lib/chunks/{VFBCMWFE.js → R3HNU4OS.js} +91 -90
- package/lib/chunks/{3BWPRH4F.js → RXJWWBFC.js} +1 -1
- package/lib/chunks/{5PJFC6B6.js → RYILGU4U.js} +1 -1
- package/lib/chunks/{PH4WC53M.js → SNRRXQ2V.js} +1 -1
- package/lib/chunks/{OPDPF2NK.js → STYPRBHE.js} +1 -1
- package/lib/chunks/{GOKDNVJA.js → T4EYMF7N.js} +1 -1
- package/lib/chunks/{OUHUMQS4.js → TGSI74ZY.js} +1 -1
- package/lib/chunks/{TPGZ3EG6.js → TH3VPXOL.js} +1 -1
- package/lib/chunks/{HYIXASSO.js → VPNH5OJ3.js} +1 -1
- package/lib/chunks/{WS7VOHDI.js → WB2XM3OI.js} +1 -1
- package/lib/chunks/{XC3B3YFA.js → WVVIKK3F.js} +1 -1
- package/lib/chunks/{MFO2DJIE.js → XYNOAVXV.js} +1 -1
- package/lib/chunks/{5FYLGP6X.js → Z4HQEPH4.js} +1 -1
- package/lib/chunks/{W5K3VP5Q.js → ZFS3FOZL.js} +2 -2
- 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 +8 -8
- package/package.json +1 -1
|
@@ -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 $,b as a,c,d as i,e as m,f}from"./
|
|
7
|
+
import{a as $,b as a,c,d as i,e as m,f}from"./SNRRXQ2V.js";import{k as l}from"./LD5MEXEL.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
|
|
8
8
|
|
|
9
9
|
`)}function y(t,n,e){return`export function use${l(t.name)}(${n}) {
|
|
10
10
|
return ${e};
|
|
@@ -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}from"./
|
|
7
|
+
import{a as x}from"./AVYCSY2T.js";import{a as v,b as y,c as R,d as u}from"./G2Z3DHA6.js";import{c as f,d as w}from"./OC7NSSO4.js";import{a as g,b as m}from"./A3AB6T42.js";import{O as a}from"./R3HNU4OS.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as A,writeFile as C}from"node:fs/promises";import S from"node:path";async function F(e){let i=await w(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.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}),r=0,o=0;for(let n of i){let s=await x(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
|
|
8
8
|
`);continue}r+=1;for await(let c of s.parse(n))await t.process({...c,index:o}),o+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(o===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var E=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function T(e){let i=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let o of r.servers)i.add(o.rawUrl);return Array.from(i).sort()}function I(e,i,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){a.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
|
|
9
9
|
`);return}if(e.documentedExchanges>0||r===0)return;let o=T(i),n=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 (${o.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 (${o.join(", ")}), or use --server to declare the server the traffic was captured against.`;a.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${n}
|
|
10
10
|
`)}async function $(e,i){let t=f(e);await A(S.dirname(t),{recursive:!0}),await C(t,i,"utf8")}async function q({argv:e,config:i}){let t=f(e.traffic),r=e["traffic-format"],o=e.rules?u(e.rules):void 0,n=e["ignore-headers"]?u(e["ignore-headers"]):void 0,s=e.server;if(s&&e["match-mode"])return m("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",d=f(e.api),p=await R(d,i);if(p.loadedOperations===0)return m(`No OpenAPI operations were loaded from: ${d}`);let{runId:k,summary:h,findings:O}=await F({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:n,previewFindingsLimit:e["max-findings"],activeRules:o,openApiIndex:p,server:s,minSeverity:e["min-severity"]});I(h,p,s);let l=v({runId:k,summary:h,findings:O,meta:{specSource:d,trafficPath:t,format:r,matchMode:c,server:s}},{format:e["report-format"],color:E&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});if(e.output?(await $(e.output,l),a.info(`Drift report written to: ${f(e.output)}
|
|
@@ -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{
|
|
7
|
+
import{O,c as x}from"./R3HNU4OS.js";import{m}from"./UW4UC7ZI.js";function R(e){return e.flatMap(n=>n.operations)}function P(e,n,s){let r=e.specName??e.name;if(s?.exclude?.includes(r))return{};let a=s?.operations?.[r];if(a!==void 0)return y(e,n,a,`pagination.operations["${r}"]`,!0);if(e.paginationExtension!==void 0)return y(e,n,e.paginationExtension,"x-redoclyPagination",!0);if(s?.style!==void 0){let{exclude:o,operations:c,...t}=s;return y(e,n,t,"pagination convention",!1)}return{}}function H(e,n){let s=new Map,r=[];for(let a of R(e.services)){let o=P(a,e,n);o.error!==void 0?r.push(o.error):o.spec!==void 0&&s.set(a.name,{spec:o.spec,itemSchema:o.itemSchema})}if(r.length>0)throw new Error(["Invalid pagination configuration:",...r].join(`
|
|
8
8
|
- `));return s}function y(e,n,s,r,a){let o=`Pagination for operation "${e.name}" (${r})`,c=q(s);if(c!==void 0)return{error:`${o}: ${c}`};let t=s,d=i=>a?{error:`${o}: ${i}`}:{};if(e.sse!==void 0)return d("the operation is a Server-Sent Events stream");if(t.style!=="link"){let i=t.style==="cursor"?"cursorParam":"offsetParam",l=t.style==="cursor"?t.cursorParam:t.offsetParam,k=e.queryParams.find(u=>u.name===l);if(!k){let u=e.queryParams.map(E=>E.name).join(", ");return d(`query parameter "${l}" is not declared on the operation`+(u===""?"":` (declared: ${u})`))}let p=C(k.schema,n);if(!(p!==void 0&&(t.style==="cursor"?b(p,n):p.kind==="scalar"&&(p.scalar==="number"||p.scalar==="integer")))){let u=t.style==="cursor"?"a string":"a number";return d(`the "${i}" query parameter "${l}" must accept ${u} (got ${I(p)})`)}}let g=e.successResponses.find(i=>i.contentType.toLowerCase().includes("json"));if(!g)return d("the operation has no JSON success response");if(t.style==="link"){let i=e.successResponseHeaders?.some(l=>l.name==="link")===!0;if(!i&&!a)return{};i||O.warn(`generate-client: ${o.toLowerCase()} follows the Link header, but the success response does not document one.
|
|
9
9
|
`)}let h=m(g.schema,t.items,n);if(h===void 0)return d(`the "items" pointer "${t.items}" does not resolve in the success response schema`);if(h.kind!=="array")return d(`the "items" pointer "${t.items}" must point at an array (got ${h.kind})`);if(t.style==="cursor"){let i=m(g.schema,t.nextCursor,n);if(i===void 0)return d(`the "nextCursor" pointer "${t.nextCursor}" does not resolve in the success response schema`);if(!b(i,n))return d(`the "nextCursor" pointer "${t.nextCursor}" must point at a string (got ${i.kind})`);if(t.hasMore!==void 0){let l=m(g.schema,t.hasMore,n);if(l===void 0)return d(`the "hasMore" pointer "${t.hasMore}" does not resolve in the success response schema`);if(l.kind!=="scalar"||l.scalar!=="boolean")return d(`the "hasMore" pointer "${t.hasMore}" must point at a boolean (got ${l.kind})`)}}let f=t.limitParam!==void 0?{limitParam:t.limitParam}:{};return{spec:t.style==="cursor"?{style:"cursor",param:t.cursorParam,...f,nextCursor:t.nextCursor,...t.hasMore!==void 0?{hasMore:t.hasMore}:{},items:t.items}:t.style==="link"?{style:"link",...f,items:t.items}:{style:t.style,param:t.offsetParam,...f,items:t.items},itemSchema:h.items}}function q(e){if(!x(e))return"the rule must be an object";let{style:n,cursorParam:s,nextCursor:r,hasMore:a,offsetParam:o,limitParam:c,items:t}=e;if(n!=="cursor"&&n!=="offset"&&n!=="page"&&n!=="link")return`"style" must be one of "cursor" | "offset" | "page" | "link" (got ${JSON.stringify(n)})`;if(typeof t!="string"||t!==""&&!t.startsWith("/"))return'"items" must be a JSON pointer starting with "/" (or "" when the response body is the item array itself)';if(n==="cursor"){if(typeof s!="string"||s==="")return'cursor style requires a "cursorParam" query parameter name';if(typeof r!="string"||!r.startsWith("/"))return'cursor style requires a "nextCursor" JSON pointer starting with "/"';if(a!==void 0&&(typeof a!="string"||!a.startsWith("/")))return'"hasMore" must be a JSON pointer starting with "/"'}else if((n==="offset"||n==="page")&&(typeof o!="string"||o===""))return`${n} style requires an "offsetParam" query parameter name`;if(c!==void 0&&typeof c!="string")return'"limitParam" must be a query parameter name'}function I(e){return e===void 0?"an unresolvable ref":e.kind==="scalar"||e.kind==="enum"?e.scalar:e.kind}function C(e,n){let s=new Set,r=e;for(;r.kind==="ref";){let{name:a}=r;if(s.has(a))return;s.add(a);let o=n.schemas.find(c=>c.name===a);if(o===void 0)return;r=o.schema}return r}function b(e,n){return e.kind==="scalar"||e.kind==="enum"?e.scalar==="string":e.kind==="literal"?typeof e.value=="string":e.kind==="union"?e.members.every(s=>{let r=C(s,n);return r!==void 0&&(r.kind==="null"||r.kind!=="union"&&b(r,n))}):!1}var G={"types.ts":`/**
|
|
10
10
|
* The public type surface of the client runtime \u2014 \`@redocly/client-generator\`'s
|
|
@@ -5397,4 +5397,4 @@ async function runSingle(
|
|
|
5397
5397
|
}
|
|
5398
5398
|
return fail(1, detail);
|
|
5399
5399
|
}
|
|
5400
|
-
}`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.0.0-snapshot.
|
|
5400
|
+
}`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.0.0-snapshot.1789731437",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,publishConfig:{access:"public"},scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"0.0.0-snapshot.1789731437"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{R as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
|
|
@@ -8,4 +8,4 @@ import{a as m,m as l}from"./UW4UC7ZI.js";function d(e,t){let n=t??{},i=e.specNam
|
|
|
8
8
|
`))e.line(c);e.line("```"),e.blank()}let s=[...t.pathParams,...t.queryParams,...t.headerParams];s.length>0&&h(e,s),t.requestBody!==void 0&&e.line(`Body: \`${t.requestBody.contentType}\`${t.requestBody.required?", required":", optional"}, of type ${o(t.requestBody.schema)}.`);let r=t.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${o(r.schema)}.`),(n.paginated!==void 0?n.paginated.has(t.name):d(t,n.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),t.successResponses.some(c=>c.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),g(t)&&e.line("This operation returns binary content."),e.blank()}function k(e,t){let n=new m;if(t.frontmatter&&(n.line("---"),n.line(`title: ${t.title}`),n.line("---"),n.blank()),n.line(`# ${t.title}`),n.blank(),n.line(`Generated reference for the ${t.language.label} SDK, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line(t.language.requires),n.blank(),n.line("## Authentication"),n.blank(),e.securitySchemes.length===0)n.line("The description declares no security schemes.");else{n.line("The description declares these schemes, which you pass to the client:"),n.blank(),n.line("| Scheme | Kind | Sent as |"),n.line("| ------ | ---- | ------- |");for(let r of e.securitySchemes){let a=r.kind==="bearer"?"`Authorization: Bearer <token>`":r.kind==="basic"?"`Authorization: Basic <base64>`":r.kind==="apiKeyHeader"?`the \`${r.headerName}\` header`:r.kind==="apiKeyQuery"?`the \`${r.paramName}\` query parameter`:`the \`${r.cookieName}\` cookie`;n.line(`| \`${r.key}\` | ${r.kind} | ${a} |`)}}n.blank();let i=e.services.flatMap(r=>r.operations),s=[...new Set(i.map(r=>r.tags[0]))];for(let r of s){n.line(r===void 0?"## Operations":`## ${r}`),n.blank();for(let a of i.filter(c=>c.tags[0]===r))x(n,a,t)}return n.toString().replace(/\n{3,}/g,`
|
|
9
9
|
|
|
10
10
|
`).trimEnd()+`
|
|
11
|
-
`}function b(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function R(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function S(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function $(e){let t=new Set(e.variables.map(a=>a.name)),n=[],i="",s=e.url,r=/\{([^{}]+)\}/;for(let a=r.exec(s);a!==null;a=r.exec(s))i+=s.slice(0,a.index),t.has(a[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:a[1]})):i+=a[0],s=s.slice(a.index+a[0].length);return i+=s,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function P(e,t){return e.security.map(n=>n.flatMap(i=>{let s=t.securitySchemes.find(r=>r.key===i);return s===void 0?[]:s.kind==="bearer"||s.kind==="basic"?[{scheme:i,kind:s.kind}]:s.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:s.headerName,in:"header"}]:s.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:s.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:s.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function C(e,t,n){if(e===void 0||t===void 0)return;let i=l(e,t,n);return i?.kind==="array"?i.items:void 0}var J=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function v(e){return e}function N(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function q(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function A(e,t){let n={...e};for(let[i,s]of Object.entries(t))s!==void 0&&(n[i]=s);return n}function fe(e){return e}async function ge(e){return(await import("./
|
|
11
|
+
`}function b(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function R(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function S(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function $(e){let t=new Set(e.variables.map(a=>a.name)),n=[],i="",s=e.url,r=/\{([^{}]+)\}/;for(let a=r.exec(s);a!==null;a=r.exec(s))i+=s.slice(0,a.index),t.has(a[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:a[1]})):i+=a[0],s=s.slice(a.index+a[0].length);return i+=s,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function P(e,t){return e.security.map(n=>n.flatMap(i=>{let s=t.securitySchemes.find(r=>r.key===i);return s===void 0?[]:s.kind==="bearer"||s.kind==="basic"?[{scheme:i,kind:s.kind}]:s.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:s.headerName,in:"header"}]:s.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:s.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:s.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function C(e,t,n){if(e===void 0||t===void 0)return;let i=l(e,t,n);return i?.kind==="array"?i.items:void 0}var J=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function v(e){return e}function N(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function q(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function A(e,t){let n={...e};for(let[i,s]of Object.entries(t))s!==void 0&&(n[i]=s);return n}function fe(e){return e}async function ge(e){return(await import("./XYNOAVXV.js")).generateClient(e)}export{d as a,k as b,b as c,R as d,S as e,$ as f,P as g,C as h,J as i,v as j,N as k,q as l,A as m,fe as n,ge as o};
|
|
@@ -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}from"./
|
|
7
|
+
import{a}from"./C7BV5J6H.js";import"./SNRRXQ2V.js";import"./WB2XM3OI.js";import"./476FUIKA.js";import"./3OB725C6.js";import"./WZXA5XPB.js";import"./R3HNU4OS.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
|
|
@@ -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 O}from"./RS5PUOTT.js";import{a as I}from"./BXI4SF2U.js";import{c as p}from"./P26PQ2RU.js";import{a as R}from"./
|
|
7
|
+
import{a as O}from"./RS5PUOTT.js";import{a as I}from"./BXI4SF2U.js";import{c as p}from"./P26PQ2RU.js";import{a as R}from"./RXJWWBFC.js";import{G as T,I as w,O as a}from"./R3HNU4OS.js";import{e as C}from"./RFWIIJFG.js";import{Buffer as P}from"node:buffer";import y from"node:crypto";import{mkdirSync as j,existsSync as F,writeFileSync as q,readFileSync as z,rmSync as M}from"node:fs";import{homedir as H}from"node:os";import B from"node:path";var l={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function G(){return process.env.REDOCLY_DOMAIN||l.us}var U=D((o,e)=>{try{let t=e||o?.resolvedConfig.residency;return W(t)?l[t]:t?new URL(t).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:l.us}catch{throw new f}});function x(o){try{U(void 0,o)}catch{return!1}return!0}function D(o){return(...e)=>{let t=o(...e);if(!t.startsWith("https://"))throw new f;return t}}var f=class extends Error{constructor(){super("Invalid Reunite URL")}};function W(o){return typeof o=="string"&&o in l}import*as k from"node:child_process";var g=C(I(),1);var N=C(O(),1);function b(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function S(o){let e=process.env.NO_PROXY||process.env.no_proxy;if(!e)return!1;let t=e.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(t.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return t.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var _=async(o,{timeout:e,...t}={})=>{let r=b(),s=r&&!S(o),n,i=e?{connect:{timeout:e}}:{};return s?n=new g.ProxyAgent({uri:r,...i}):e&&(n=new g.Agent(i)),await fetch(o,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:n})};var c=class extends Error{constructor(t,r){super(t);this.status=r}status},h=class{constructor(e){this.command=e}command;sunsetWarnings=[];async request(e,t){let r={...t.headers,"user-agent":`redocly-cli/${R} ${this.command}`};try{let s=await _(e,{...t,headers:r});return this.collectSunsetWarning(s),s}catch(s){let n="Failed to fetch.";throw s.cause&&(n+=` Caused by ${s.cause.message||s.cause.name}.`),(s.code||s.cause?.code)&&(n+=` Code: ${s.code||s.cause?.code}`),new Error(n)}}collectSunsetWarning(e){let t=this.getSunsetDate(e);if(!t)return;let r=new Date(t);t>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(e){let{headers:t}=e;if(!t)return;let r=t.get("sunset")||t.get("Sunset");if(r)return Date.parse(r)}},v=class{constructor(e,t,r){this.client=e;this.domain=t;this.apiKey=r}client;domain;apiKey;async getParsedResponse(e){let t=await e.json();if(e.ok)return t;throw new c(`${t.title||e.statusText||"Unknown error"}.`,e.status)}async getDefaultBranch(e,t){try{let r=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/source`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof c?new c(s,r.status):new Error(s)}}async upsert(e,t,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes`,{timeout:p,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(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async push(e,t,r,s){let n=new globalThis.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let u=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await L(i.stream)]);n.append(`files[${i.path}]`,u,i.path)}r.isMainBranch&&n.append("isMainBranch","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:n});return await this.getParsedResponse(i)}catch(i){let u=`Failed to push. ${i.message}`;throw i instanceof c?new c(u,i.status):new Error(u)}}async getRemotesList({organizationId:e,projectId:t,mountPath:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes?filter=mountPath:/${r}/`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get remote list. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async getPush({organizationId:e,projectId:t,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes/${r}`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}},$=class{apiClient;command;remotes;constructor({domain:e,apiKey:t,command:r}){this.command=r,this.apiClient=new h(this.command),this.remotes=new v(this.apiClient,e,t)}reportSunsetWarnings(){let e=this.apiClient.sunsetWarnings;if(e.length){let[{isSunsetExpired:t,sunsetDate:r}]=e.sort((n,i)=>n.isSunsetExpired!==i.isSunsetExpired?n.isSunsetExpired?-1:1:n.sunsetDate>i.sunsetDate?1:-1),s='Update to the latest version by running "npm install @redocly/cli@latest".';t?a.error(`The "${this.command}" command is not compatible with your version of Redocly CLI. ${s}
|
|
8
8
|
|
|
9
9
|
`):a.warn(`The "${this.command}" command will be incompatible with your version of Redocly CLI after ${r.toLocaleString()}. ${s}
|
|
10
10
|
|
|
@@ -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 zs,b as _e}from"./4PTP4OCB.js";import{B as ys,C as xs,J as Pp,K as Tp,P as lo,Q as po,U as dr,W as ge,c as we}from"./VFBCMWFE.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{a as zs,b as _e}from"./A3AB6T42.js";import{B as ys,C as xs,H as lo,I as po,M as dr,O as ge,V as Pp,W as Tp,c as we}from"./R3HNU4OS.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,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{ma as e}from"./
|
|
7
|
+
import{ma as e}from"./R3HNU4OS.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
|
|
@@ -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}from"./
|
|
7
|
+
import{a}from"./2LERQER3.js";import"./SNRRXQ2V.js";import"./WB2XM3OI.js";import"./476FUIKA.js";import"./3OB725C6.js";import"./WZXA5XPB.js";import"./R3HNU4OS.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
|
|
@@ -4,6 +4,6 @@ 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{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./
|
|
7
|
+
import{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./OC7NSSO4.js";import{c as g}from"./R3HNU4OS.js";import A from"node:path";function L(e,n){if(C(e)!=="application/x-www-form-urlencoded"||!Array.isArray(n))return;let o=new URLSearchParams;for(let s of n){if(!g(s))continue;let t=a(s.name);t!==void 0&&o.append(t,a(s.value)??"")}return o.size>0?o.toString():void 0}function K(e,n,o){let s=e?.request,t=e?.response;if(!s)return null;let r=s?.postData,i=a(r?.mimeType),u=r?.text??L(i,r?.params),c=a(r?.encoding),y=t?.content?.text,S=a(t?.content?.encoding),q=p(t?.status);return l({method:a(s?.method),url:a(s?.url),requestHeaders:s?.headers,requestBody:T(u,c),requestContentType:i,responseStatus:q===0?void 0:q,responseStatusText:a(t?.statusText),responseHeaders:t?.headers,responseBody:T(y,S),responseContentType:a(t?.content?.mimeType),startedAt:a(e?.startedDateTime),raw:e},n,o)}var b=class{id="har";canParse(n,o){if(A.extname(n).toLowerCase()===".har")return!0;let t=o.toLowerCase();return t.includes('"log"')&&t.includes('"entries"')}async*parse(n){let o=0;for await(let s of f(n,"log.entries")){let t=K(s,o,n);t&&(yield t),o+=1}}};import $ from"node:path";function H(e){let n=a(e.url??e.uri);if(n)return{url:n};let o=a(e.host??e.headers?.host),s=a(e.path??e.request_uri),t=a(e.scheme??e.forwarded_proto);return o&&s?{url:`${t??"http"}://${o}${s}`,schemeKnown:!!t}:{url:s,schemeKnown:!!t}}function z(e,n,o){let s=e?.request??e?.req??e?.http?.request;if(!s)return null;let t=e?.response??e?.res??e?.http?.response,r=t?.body??t?.raw_body??t?.payload??t?.data,i=s?.body??s?.raw_body??s?.payload??s?.data,{url:u,schemeKnown:c}=H(s);return l({method:a(s?.method??s?.http_method),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:i,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode),responseHeaders:t?.headers,responseBody:r,responseContentType:d(t?.headers),startedAt:a(e?.started_at??e?.startedAt??e?.timestamp),raw:e},n,o)}var x=class{id="kong";canParse(n,o){if($.extname(n).toLowerCase()===".kong")return!0;let t=o.toLowerCase();return t.includes('"latencies"')||t.includes('"request"')&&t.includes('"response"')&&t.includes('"route"')}async*parse(n){let o=(await m(n,16)).trim().slice(0,1),s=0;if(o==="["){for await(let t of f(n)){let r=z(t,s,n);r&&(yield r),s+=1}return}for await(let t of h(n)){let r=z(t,s,n);r&&(yield r),s+=1}}};import R from"node:path";function U(e){return e?.request??e?.req??e?.httpRequest??e?.http?.request??e}function I(e){return e?.response??e?.res??e?.httpResponse??e?.http?.response}function O(e,n){let o=a(n?.url??n?.uri??n?.requestUrl??e?.url);if(o)return{url:o};let s=a(n?.host??n?.headers?.host??e?.host),t=a(n?.path??e?.path??n?.pathname),r=a(n?.scheme??e?.scheme);return s&&t?{url:`${r??"http"}://${s}${t}`,schemeKnown:!!r}:{url:t,schemeKnown:!!r}}function k(e,n,o){let s=U(e),t=I(e),r=s?.body??s?.bodyText??s?.payload??s?.data??s?.rawBody,i=t?.body??t?.bodyText??t?.payload??t?.data??t?.rawBody,{url:u,schemeKnown:c}=O(e,s);return l({method:a(s?.method??s?.httpMethod??e?.method??e?.httpMethod),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:r,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode??e?.status??e?.statusCode),responseHeaders:t?.headers,responseBody:i,responseContentType:d(t?.headers),startedAt:a(e?.startedAt??e?.timestamp??e?.time),raw:e},n,o)}var w=class{id="ndjson";canParse(n,o){let s=R.extname(n).toLowerCase();if(s===".ndjson"||s===".jsonl"||s===".jsonlines")return!0;let t=o.lastIndexOf(`
|
|
8
8
|
`),i=(t===-1?o:o.slice(0,t)).split(`
|
|
9
9
|
`).map(u=>u.trim()).find(Boolean);if(!i?.startsWith("{")||!i.endsWith("}"))return!1;try{return JSON.parse(i),!0}catch{return!1}}async*parse(n){let o=0;for await(let s of h(n)){let t=k(s,o,n);t&&(yield t),o+=1}}};import J from"node:path";function P(e){if(!e)return{};let n=e.trim().split(/\s+/);return n.length<2?{}:{method:n[0],path:n[1],protocol:n[2]}}function W(e,n){let o=a(n?.url??n?.request_uri??n?.uri??e?.url??e?.request_url??e?.absolute_uri),s=P(a(e?.request??n?.request_line)),t=a(n?.request_uri??n?.uri??n?.path??e?.request_uri??e?.uri)??s.path;if(o?.startsWith("http://")||o?.startsWith("https://"))return{url:o};let r=a(n?.host??n?.headers?.host??e?.host??e?.http_host??e?.server_name??e?.vhost),i=a(e?.scheme??n?.scheme??e?.request_scheme),u=!!i;if(r&&(o||t)){let c=i??"http",y=o??t;return y?.startsWith("/")?{url:`${c}://${r}${y}`,schemeKnown:u}:{url:`${c}://${r}/${y}`,schemeKnown:u}}return{url:o??t,schemeKnown:u}}function E(e,n,o){let s=g(e?.request)?e.request:e,t=g(e?.response)?e.response:void 0,r=P(a(e?.request)),i=a(s?.method??s?.request_method??e?.request_method??e?.method)??r.method,{url:u,schemeKnown:c}=W(e,s);return l({method:i,url:u,schemeKnown:c,requestHeaders:s?.headers??s?.request_headers??e?.request_headers??e?.headers,requestBody:s?.body??s?.request_body??e?.request_body??e?.body,requestContentType:d(s?.headers??s?.request_headers??e?.request_headers),responseStatus:p(t?.status??t?.status_code??e?.status??e?.status_code??e?.response_status),responseHeaders:t?.headers??t?.response_headers??e?.response_headers??e?.headers_out,responseBody:t?.body??t?.response_body??e?.response_body,responseContentType:d(t?.headers??t?.response_headers??e?.response_headers),startedAt:a(e?.time_iso8601??e?.timestamp??e?.time??e?.time_local??e?.["@timestamp"]),raw:e},n,o)}async function*j(e){if((await m(e,16)).trim().slice(0,1)==="["){yield*f(e);return}for await(let o of h(e))yield o}var N=class{id="nginx-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("nginx"))return!0;let r=o.toLowerCase();return r.includes('"request_uri"')||r.includes('"time_iso8601"')||r.includes('"upstream_response_time"')||r.includes('"remote_addr"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}},_=class{id="apache-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("apache"))return!0;let r=o.toLowerCase();return r.includes('"request_method"')||r.includes('"request_uri"')||r.includes('"vhost"')||r.includes('"response_status"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}};var B=[new b,new x,new N,new _,new w];async function le(e,n){if(n!=="auto"){let s=B.find(t=>t.id===n);if(!s)throw new Error(`Unsupported parser format: ${n}`);return s}let o=await m(e);return B.find(s=>s.canParse(e,o))}export{le as a};
|
|
@@ -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}from"./
|
|
7
|
+
import{a,b,c}from"./KEQD3VCF.js";import"./2U6O26CV.js";import"./WB2XM3OI.js";import"./476FUIKA.js";import"./3OB725C6.js";import"./WZXA5XPB.js";import"./R3HNU4OS.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
|