forge-terminal 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -10
- package/dist/chunks/available-QN6QAGCU.js +3 -0
- package/dist/chunks/boot-3M2WUSSL.js +3 -0
- package/dist/chunks/catalog-O3V24DK7.js +3 -0
- package/dist/chunks/check-DN7SEN44.js +3 -0
- package/dist/chunks/chunk-4L6HNYSN.js +4 -0
- package/dist/chunks/{chunk-XFEHJ4C7.js → chunk-6ZEGAH36.js} +1 -1
- package/dist/chunks/chunk-775ILWZI.js +3 -0
- package/dist/chunks/chunk-E5QDHFKQ.js +3 -0
- package/dist/chunks/{chunk-VH5RWPGZ.js → chunk-GDQQDHXJ.js} +2 -2
- package/dist/chunks/chunk-HON4OV7M.js +3 -0
- package/dist/chunks/chunk-IBPGC4N2.js +3 -0
- package/dist/chunks/chunk-LI2JPLF7.js +3 -0
- package/dist/chunks/{chunk-5B7WODWH.js → chunk-M6LD6DHO.js} +1 -1
- package/dist/chunks/chunk-NY6BX7QS.js +5 -0
- package/dist/chunks/chunk-OIZCRBLT.js +3 -0
- package/dist/chunks/chunk-Q45MSMTN.js +3 -0
- package/dist/chunks/chunk-RE7E6NA7.js +3 -0
- package/dist/chunks/{chunk-PN73WK2S.js → chunk-VNAIHACR.js} +1 -1
- package/dist/chunks/chunk-W42HVOBD.js +3 -0
- package/dist/chunks/chunk-XSOCV3F2.js +3 -0
- package/dist/chunks/chunk-XYYVNUE6.js +4 -0
- package/dist/chunks/chunk-YILLB45O.js +3 -0
- package/dist/chunks/chunk-YZG5A3GA.js +4 -0
- package/dist/chunks/chunk-Z5PQWCG5.js +4 -0
- package/dist/chunks/chunk-ZRP5CWIK.js +3 -0
- package/dist/chunks/{catalog-NTACQH5V.js → clipboard-CPHPA4FH.js} +1 -1
- package/dist/chunks/colour-6YGDI44N.js +3 -0
- package/dist/chunks/config-command-UW6BYQ2K.js +3 -0
- package/dist/chunks/execute-BRPAGFUR.js +3 -0
- package/dist/chunks/extensions-command-5QO6YX6O.js +3 -0
- package/dist/chunks/image-ESDL7GZU.js +3 -0
- package/dist/chunks/install-HCF5BIA6.js +3 -0
- package/dist/chunks/launch-ILBEFGNR.js +65 -0
- package/dist/chunks/lock-RZ6NVZFD.js +3 -0
- package/dist/chunks/manager-7HNOLCYH.js +4 -0
- package/dist/chunks/paths-H2WS22BA.js +3 -0
- package/dist/chunks/preferences-AKDCPHJ5.js +3 -0
- package/dist/chunks/restart-6ONEYN6T.js +3 -0
- package/dist/chunks/run-C475RRUL.js +4 -0
- package/dist/chunks/{server-DU7QWDAH.js → server-ETHSTOP6.js} +6 -6
- package/dist/chunks/theme-TYCKAIEA.js +3 -0
- package/dist/chunks/update-command-HT2RBFLR.js +3 -0
- package/dist/chunks/update-note-ES7TWSUT.js +3 -0
- package/dist/index.js +33 -29
- package/package.json +7 -4
- package/skills/forge/SKILL.md +3 -0
- package/dist/chunks/available-HEUREG6L.js +0 -3
- package/dist/chunks/boot-BUGERSEB.js +0 -3
- package/dist/chunks/chunk-2WYHI73Y.js +0 -3
- package/dist/chunks/chunk-4YCO7S4K.js +0 -3
- package/dist/chunks/chunk-C2WYXNRM.js +0 -4
- package/dist/chunks/chunk-C7OOWUMU.js +0 -3
- package/dist/chunks/chunk-EOYBXOCV.js +0 -4
- package/dist/chunks/chunk-G2D6BKOS.js +0 -4
- package/dist/chunks/chunk-HUAEVW2A.js +0 -3
- package/dist/chunks/chunk-L76Q54MB.js +0 -3
- package/dist/chunks/chunk-PD5DFBCU.js +0 -3
- package/dist/chunks/chunk-TEGB7JRM.js +0 -3
- package/dist/chunks/chunk-YXDEOLNA.js +0 -3
- package/dist/chunks/colour-DE6N6AZO.js +0 -3
- package/dist/chunks/config-command-SQXRTBRO.js +0 -3
- package/dist/chunks/execute-M3C3TTWB.js +0 -3
- package/dist/chunks/extensions-command-HJDBUBYO.js +0 -3
- package/dist/chunks/image-GYUUMS6H.js +0 -3
- package/dist/chunks/launch-WBUFRVQ7.js +0 -65
- package/dist/chunks/lock-XD4L3WFM.js +0 -3
- package/dist/chunks/manager-KBJTXZ27.js +0 -4
- package/dist/chunks/paths-JUM6GKQU.js +0 -3
- package/dist/chunks/run-RXVQD4DZ.js +0 -4
- package/dist/chunks/theme-DESCJOCE.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as bd,c as Rd}from"./chunk-C2WYXNRM.js";import{f as zd}from"./chunk-PBIS2ONZ.js";import{m as Sd,n as yd,r as vd}from"./chunk-C7OOWUMU.js";import{c as fd,d as hd,e as gd,f as _d}from"./chunk-PN73WK2S.js";import{a as ac}from"./chunk-QVACE4IE.js";import{d as dd,f as pd,h as md}from"./chunk-5B7WODWH.js";import"./chunk-L76Q54MB.js";import{a as ir}from"./chunk-G2D6BKOS.js";import{a as cc}from"./chunk-EOYBXOCV.js";import"./chunk-YXDEOLNA.js";import{I as mt,g as ld}from"./chunk-PD5DFBCU.js";import{d as ud}from"./chunk-J7FLFHQJ.js";import{d as ic}from"./chunk-TMUK2DD3.js";var rS=Object.create,ss=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,nS=Object.getOwnPropertyNames,sS=Object.getPrototypeOf,iS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$d=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},aS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=nS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!iS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=oS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?rS(sS(e)):{},aS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var cS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),wd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),uS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),lS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Pd(e){return typeof e=="string"&&wd.has(e.replace(/#$/,""))}function Ed(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(cS.has(r))return"2020-12";if(wd.has(r))return"2019-09";if(uS.has(r)||lS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Md,Class:()=>dc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ct,allowsEval:()=>_c,assert:()=>hS,assertEqual:()=>dS,assertIs:()=>mS,assertNever:()=>fS,assertNotEqual:()=>pS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>Ad,base64urlToUint8Array:()=>jS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>NS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>SS,codePointLength:()=>Lo,constantCatch:()=>Ld,createTransparentProxy:()=>$S,defineLazy:()=>fc,defineLazyInternal:()=>ge,derived:()=>MS,esc:()=>hc,escapeRegex:()=>St,explicitlyAborted:()=>vc,extend:()=>ES,finalizeIssue:()=>ut,floatSafeRemainder:()=>mc,getElementAtPath:()=>yS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>RS,getSizableOrigin:()=>xd,hexToUint8Array:()=>AS,hide:()=>ms,installLazyProp:()=>US,isObject:()=>cr,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>zc,merge:()=>kS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>pc,numKeys:()=>zS,objectClone:()=>gS,omit:()=>PS,optionalKeys:()=>yc,own:()=>xt,parsedType:()=>bc,partial:()=>CS,pick:()=>wS,prefixIssues:()=>yt,primitiveTypes:()=>Nd,promiseAllObject:()=>vS,propertyKeyTypes:()=>Sc,randomString:()=>bS,rawShape:()=>jr,required:()=>IS,safeExtend:()=>TS,shallowClone:()=>Od,slugify:()=>gc,stringifyPrimitive:()=>us,toZod:()=>kd,uint8ArrayToBase64:()=>qd,uint8ArrayToBase64url:()=>xS,uint8ArrayToHex:()=>qS,unwrapMessage:()=>Cr});function dS(e){return e}function pS(e){return e}function kd(){return e=>e}function mS(e){}function fS(e){throw new Error("Unexpected value in exhaustive check")}function hS(e){}function Ir(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 as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var lc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new lc(e)}function pc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Td=Symbol("evaluating");function fc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Td)return o===void 0&&(o=Td,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Cd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Id(e,t,r){t in e?Ye(e,t,r):e[t]=r}function ar(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Cd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Id(e,s,o?o(i.value,s):i.value))}}function _S(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Cd(e,r,()=>t[r]):Id(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function SS(e){return _t(e._zod.def)}function yS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function vS(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 bS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hc(e){return JSON.stringify(e)}function gc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _c=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Od(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function zS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var RS=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}`)}},Sc=new Set(["string","number","symbol"]),Nd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(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 $S(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 us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wS(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={};return ar(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function PS(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=new Set(ds(e,t)),i={};return ar(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function ES(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function jd(e,t){let r={};return ar(r,e,Reflect.ownKeys(gt(e))),_S(r,t),r}function TS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function kS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ar(r,e,Reflect.ownKeys(gt(e))),ar(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function CS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return ar(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function IS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return ar(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ct(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 vc(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 yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function ut(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function xd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var OS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!OS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bc(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 xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function NS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ad(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 qd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function jS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ad(t+r)}function xS(e){return qd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AS(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 qS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dc=class{constructor(...t){}};function zc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):LS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function MS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function LS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function DS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var uc,jt=!1,ZS={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&uc!==e._zod){uc=void 0;return}uc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,ZS);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function US(e,t,r,o){let n=DS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Md="~constantCatch";function Ld(e){let t=()=>e;return t[Md]=!0,t}var Dd,$c=Object.freeze({status:"aborted"}),Rc={value:void 0,enumerable:!1},Zd="captureStackTrace"in Error?Error:null;function VS(e){let t=Zd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Zd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Rc.value=new s(v);try{Object.defineProperty(g,"_zod",Rc)}finally{Rc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),zc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?VS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Dd=globalThis).__zod_globalConfig??(Dd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function FS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function HS(e){this._zod.message=e}var JS={get:FS,set:HS,enumerable:!0,configurable:!0},Pc={value:void 0,enumerable:!1},Ud=new WeakSet([Object.prototype,Error.prototype]),Vd=(e,t)=>{e.name="$ZodError",Pc.value=t,Object.defineProperty(e,"issues",Pc),Pc.value=void 0,Object.defineProperty(e,"message",JS);let r=Object.getPrototypeOf(e);Ud.has(r)||(Ud.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Fd=q("$ZodError",Vd),uR=q("$ZodError",Vd,void 0,{Parent:Error});function BS(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Ec(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?BS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Tc(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(c=>o({issues:c},[...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 c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new lt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=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 lt;return s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};function Hd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>ut(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=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?Hd(e,s.issues,n):{success:!0,data:s.value}};var KS=Symbol.for("zod.compile.invalid"),GS=Symbol.for("zod.compile.fallback"),kc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==KS)return!0;if(o.definite===!0&&r===void 0)return!1}return WS(e,t,r)});function WS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[GS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new lt;return s.issues.length===0}var Cc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Jd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Bd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Kd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Wd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Yd=e=>(t,r,o)=>_s(e)(t,r,o);var Xd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var Qd=e=>async(t,r,o)=>Ss(e)(t,r,o);var ep=/^[cC][0-9a-z]{6,}$/,tp=/^[0-9a-z]+$/,rp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,op=/^[0-9a-vA-V]{20}$/,np=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/;function ip(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ap=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var cp=/^([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})$/,Oc=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 up=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lp(){return new RegExp(YS,"u")}var dp=/^(?:(?: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])$/,pp=/^(([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 mp=/^((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])$/,fp=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var _p=/^https?$/,Sp=/^\+[1-9]\d{6,14}$/;var yp="(?:(?:\\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])))";function XS(e){return new RegExp(`^${e}$`)}var vp=XS(yp);function Ic(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bp(e){return new RegExp(`^${Ic(e)}$`)}function zp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ic({precision:e.precision})}`:r;return new RegExp(`^${yp}T(?:${o})$`)}var Rp=/^[\s\S]{0,}$/;var $p=/^-?\d+n?$/,Nc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,wp=/^(?:true|false)$/i,Pp=/^null$/i;var Ep=/^[^A-Z]*$/,Tp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var jc=e=>{let t=e.value;return!pc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},xc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??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})}}),Ac=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??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})}}),kp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):mc(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})}}),Cp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,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:c,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}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ip=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Op=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...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})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),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=()=>{})}),jp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),xp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Uo.init(e,t)}),Ap=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=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})}}),Mp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),Lp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=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 Dp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
3
|
+
import{f as zd}from"./chunk-PBIS2ONZ.js";import{a as bd,c as Rd}from"./chunk-XYYVNUE6.js";import{n as Sd,o as yd,s as vd}from"./chunk-RE7E6NA7.js";import{a as ac}from"./chunk-QVACE4IE.js";import{d as dd,f as pd,h as md}from"./chunk-M6LD6DHO.js";import{c as fd,d as hd,e as gd,f as _d}from"./chunk-VNAIHACR.js";import"./chunk-LI2JPLF7.js";import"./chunk-775ILWZI.js";import"./chunk-OIZCRBLT.js";import{a as ir}from"./chunk-Z5PQWCG5.js";import{I as mt,g as ld}from"./chunk-E5QDHFKQ.js";import{d as ud}from"./chunk-J7FLFHQJ.js";import{b as cc}from"./chunk-4L6HNYSN.js";import"./chunk-HON4OV7M.js";import{d as ic}from"./chunk-TMUK2DD3.js";var rS=Object.create,ss=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,nS=Object.getOwnPropertyNames,sS=Object.getPrototypeOf,iS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$d=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},aS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=nS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!iS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=oS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?rS(sS(e)):{},aS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var cS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),wd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),uS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),lS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Pd(e){return typeof e=="string"&&wd.has(e.replace(/#$/,""))}function Ed(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(cS.has(r))return"2020-12";if(wd.has(r))return"2019-09";if(uS.has(r)||lS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Md,Class:()=>dc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ct,allowsEval:()=>_c,assert:()=>hS,assertEqual:()=>dS,assertIs:()=>mS,assertNever:()=>fS,assertNotEqual:()=>pS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>Ad,base64urlToUint8Array:()=>jS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>NS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>SS,codePointLength:()=>Lo,constantCatch:()=>Ld,createTransparentProxy:()=>$S,defineLazy:()=>fc,defineLazyInternal:()=>ge,derived:()=>MS,esc:()=>hc,escapeRegex:()=>St,explicitlyAborted:()=>vc,extend:()=>ES,finalizeIssue:()=>ut,floatSafeRemainder:()=>mc,getElementAtPath:()=>yS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>RS,getSizableOrigin:()=>xd,hexToUint8Array:()=>AS,hide:()=>ms,installLazyProp:()=>US,isObject:()=>cr,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>zc,merge:()=>kS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>pc,numKeys:()=>zS,objectClone:()=>gS,omit:()=>PS,optionalKeys:()=>yc,own:()=>xt,parsedType:()=>bc,partial:()=>CS,pick:()=>wS,prefixIssues:()=>yt,primitiveTypes:()=>Nd,promiseAllObject:()=>vS,propertyKeyTypes:()=>Sc,randomString:()=>bS,rawShape:()=>jr,required:()=>IS,safeExtend:()=>TS,shallowClone:()=>Od,slugify:()=>gc,stringifyPrimitive:()=>us,toZod:()=>kd,uint8ArrayToBase64:()=>qd,uint8ArrayToBase64url:()=>xS,uint8ArrayToHex:()=>qS,unwrapMessage:()=>Cr});function dS(e){return e}function pS(e){return e}function kd(){return e=>e}function mS(e){}function fS(e){throw new Error("Unexpected value in exhaustive check")}function hS(e){}function Ir(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 as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var lc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new lc(e)}function pc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Td=Symbol("evaluating");function fc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Td)return o===void 0&&(o=Td,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Cd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Id(e,t,r){t in e?Ye(e,t,r):e[t]=r}function ar(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Cd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Id(e,s,o?o(i.value,s):i.value))}}function _S(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Cd(e,r,()=>t[r]):Id(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function SS(e){return _t(e._zod.def)}function yS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function vS(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 bS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hc(e){return JSON.stringify(e)}function gc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _c=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Od(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function zS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var RS=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}`)}},Sc=new Set(["string","number","symbol"]),Nd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(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 $S(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 us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wS(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={};return ar(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function PS(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=new Set(ds(e,t)),i={};return ar(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function ES(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function jd(e,t){let r={};return ar(r,e,Reflect.ownKeys(gt(e))),_S(r,t),r}function TS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function kS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ar(r,e,Reflect.ownKeys(gt(e))),ar(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function CS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return ar(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function IS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return ar(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ct(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 vc(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 yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function ut(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function xd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var OS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!OS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bc(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 xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function NS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ad(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 qd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function jS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ad(t+r)}function xS(e){return qd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AS(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 qS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dc=class{constructor(...t){}};function zc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):LS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function MS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function LS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function DS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var uc,jt=!1,ZS={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&uc!==e._zod){uc=void 0;return}uc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,ZS);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function US(e,t,r,o){let n=DS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Md="~constantCatch";function Ld(e){let t=()=>e;return t[Md]=!0,t}var Dd,$c=Object.freeze({status:"aborted"}),Rc={value:void 0,enumerable:!1},Zd="captureStackTrace"in Error?Error:null;function VS(e){let t=Zd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Zd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Rc.value=new s(v);try{Object.defineProperty(g,"_zod",Rc)}finally{Rc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),zc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?VS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Dd=globalThis).__zod_globalConfig??(Dd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function FS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function HS(e){this._zod.message=e}var JS={get:FS,set:HS,enumerable:!0,configurable:!0},Pc={value:void 0,enumerable:!1},Ud=new WeakSet([Object.prototype,Error.prototype]),Vd=(e,t)=>{e.name="$ZodError",Pc.value=t,Object.defineProperty(e,"issues",Pc),Pc.value=void 0,Object.defineProperty(e,"message",JS);let r=Object.getPrototypeOf(e);Ud.has(r)||(Ud.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Fd=q("$ZodError",Vd),lR=q("$ZodError",Vd,void 0,{Parent:Error});function BS(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Ec(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?BS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Tc(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(c=>o({issues:c},[...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 c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new lt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=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 lt;return s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};function Hd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>ut(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=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?Hd(e,s.issues,n):{success:!0,data:s.value}};var KS=Symbol.for("zod.compile.invalid"),GS=Symbol.for("zod.compile.fallback"),kc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==KS)return!0;if(o.definite===!0&&r===void 0)return!1}return WS(e,t,r)});function WS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[GS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new lt;return s.issues.length===0}var Cc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Jd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Bd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Kd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Wd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Yd=e=>(t,r,o)=>_s(e)(t,r,o);var Xd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var Qd=e=>async(t,r,o)=>Ss(e)(t,r,o);var ep=/^[cC][0-9a-z]{6,}$/,tp=/^[0-9a-z]+$/,rp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,op=/^[0-9a-vA-V]{20}$/,np=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/;function ip(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ap=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var cp=/^([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})$/,Oc=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 up=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lp(){return new RegExp(YS,"u")}var dp=/^(?:(?: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])$/,pp=/^(([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 mp=/^((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])$/,fp=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var _p=/^https?$/,Sp=/^\+[1-9]\d{6,14}$/;var yp="(?:(?:\\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])))";function XS(e){return new RegExp(`^${e}$`)}var vp=XS(yp);function Ic(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bp(e){return new RegExp(`^${Ic(e)}$`)}function zp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ic({precision:e.precision})}`:r;return new RegExp(`^${yp}T(?:${o})$`)}var Rp=/^[\s\S]{0,}$/;var $p=/^-?\d+n?$/,Nc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,wp=/^(?:true|false)$/i,Pp=/^null$/i;var Ep=/^[^A-Z]*$/,Tp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var jc=e=>{let t=e.value;return!pc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},xc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??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})}}),Ac=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??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})}}),kp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):mc(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})}}),Cp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,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:c,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}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ip=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Op=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...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})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),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=()=>{})}),jp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),xp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Uo.init(e,t)}),Ap=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=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})}}),Mp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),Lp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=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 Dp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
4
4
|
`).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?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${r.join(`
|
|
6
6
|
`)}
|
|
@@ -56,7 +56,7 @@ ${r.join(`
|
|
|
56
56
|
|
|
57
57
|
`)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,c=cr,a=!Xe.jitless,d=a&&_c.value,m=t.catchall,g;e._zod.parse=(v,p)=>{g??(g=o.value);let _=v.value;return c(_)?a&&d&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),v=i(v,p),m?qm([],_,v,p,g,e,p?.abortEarly===!0):v):r(v,p):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function Hp(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!ct(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>ut(i,o,Qe())))}),t)}var Zc=q("$ZodUnion",(e,t)=>{Se.init(e,t),ge(e,"optin",o=>o.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),ge(e,"optout",o=>o.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ge(e,"values",o=>{if(o.def.options.every(n=>n._zod.values))return new Set(o.def.options.flatMap(n=>Array.from(n._zod.values)))}),ge(e,"pattern",o=>{if(o.def.options.every(n=>n._zod.pattern)){let n=o.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>qo(s.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}return s?Promise.all(i).then(c=>Hp(c,o,e,n)):Hp(i,o,e,n)}});function dy(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var Lm=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Zc.init(e,t);let r=e._zod.parse;ge(e,"propValues",n=>{let s={},i=0;for(let c of n.def.options){let a=c._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(c)}"`);a[n.def.discriminator]?.has(void 0)&&i++;for(let[u,d]of Object.entries(a)){Object.prototype.hasOwnProperty.call(s,u)||Ye(s,u,new Set);for(let m of d)s[u].add(m)}}return!n.def.unionFallback&&i>1&&s[n.def.discriminator]?.delete(void 0),s}),t.options.forEach((n,s)=>{let i=jr(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});let o=Nr(()=>dy(t));e._zod.parse=(n,s)=>{let i=n.value;if(!cr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=i?.[t.discriminator],a=o.value.get(c);return a&&(c!==void 0||s.direction!=="backward")?a._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter(u=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n)}}),Dm=q("$ZodIntersection",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([a,u])=>Jp(r,a,u)):Jp(r,s,i)}});function qc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(At(e)&&At(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=qc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=qc(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Jp(e,t,r){let o=new Map,n,s=new Map,i=(u,d)=>{let m;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),m=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let g=String(u.path[0]);s.has(g)||s.set(g,u),m=[g]}else return!1;for(let g of m)o.has(g)||o.set(g,{}),o.get(g)[d]=!0;return!0};for(let u of t.issues)i(u,"l")||e.issues.push(u);for(let u of r.issues)i(u,"r")||e.issues.push(u);let c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter(d=>n.keys.includes(d)):[];u.length&&e.issues.push({...n,keys:u});for(let d of c)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}let a=qc(t.value,r.value);if(!a.valid){if(ct(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Zm=q("$ZodRecord",(e,t)=>{Se.init(e,t);let r=Xe.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!At(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],c=t.keyType._zod.values;if(c&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let a=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(a.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let m=t.keyType._zod.run({value:d,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(p=>ut(p,n,Qe())),input:d,path:[d],inst:e});continue}let g=m.value;if(g==="__proto__")continue;let v=t.valueType._zod.run({value:s[d],issues:[]},n);v instanceof Promise?i.push(v.then(p=>{p.issues.length&&o.issues.push(...yt(d,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...yt(d,v.issues)),o.value[g]=v.value)}let u;for(let d in s)if(!a.has(d))if(t.mode==="loose"){if(d==="__proto__")continue;o.value[d]=s[d]}else u=u??[],u.push(d);u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let a;for(let u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let d=t.keyType._zod.run({value:u,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Zo.test(u)&&d.issues.length){let p=t.keyType._zod.run({value:Number(u),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?o.value[u]=s[u]:c?(a=a??[],a.push(u)):o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>ut(p,n,Qe())),input:u,path:[u],inst:e});continue}let g=d.value;if(g==="__proto__")continue;let v=t.valueType._zod.run({value:s[u],issues:[]},n);v instanceof Promise?i.push(v.then(p=>{p.issues.length&&o.issues.push(...yt(u,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...yt(u,v.issues)),o.value[g]=v.value)}a&&a.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}return i.length?Promise.all(i).then(()=>o):o}});var Um=q("$ZodEnum",(e,t)=>{Se.init(e,t);let r=Ir(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",n=>{let s=Ir(n.def.entries).filter(i=>Sc.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>St(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Vm=q("$ZodLiteral",(e,t)=>{Se.init(e,t);let r=new Set(t.values);e._zod.values=r,ge(e,"pattern",o=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map(s=>typeof s=="string"?St(s):s?St(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Fm=q("$ZodTransform",(e,t)=>{Se.init(e,t),e._zod.optin="optional",Xe.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ar(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r));if(n instanceof Promise)throw new lt;return r.value=n,r}});function Bp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Uc=q("$ZodOptional",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ge(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ge(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${qo(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Bp(r,s)):Bp(r,n)}return t.innerType._zod.run(r,o)}}),Hm=q("$ZodExactOptional",(e,t)=>{Uc.init(e,t),ge(e,"values",r=>r.def.innerType._zod.values),ge(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Jm=q("$ZodNullable",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin),ge(e,"optout",r=>r.def.innerType._zod.optout),ge(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${qo(o.source)}|null)$`):void 0}),ge(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Bm=q("$ZodDefault",(e,t)=>{Se.init(e,t),e._zod.optin="defaulted",ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Kp(s,t)):Kp(n,t)}});function Kp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Km=q("$ZodPrefault",(e,t)=>{Se.init(e,t),e._zod.optin="defaulted",ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Gm=q("$ZodNonOptional",(e,t)=>{Se.init(e,t),ge(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Gp(s,e)):Gp(n,e)}});function Gp(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Wp(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>ut(n,o,Qe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Wm=q("$ZodCatch",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ge(e,"optout",r=>r.def.innerType._zod.optout),ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Wp(r,s,t,o)):Wp(r,n,t,o)}});var Vc=q("$ZodPipe",(e,t)=>{Se.init(e,t),ge(e,"values",r=>r.def.in._zod.values),ge(e,"optin",r=>r.def.in._zod.optin),ge(e,"optout",r=>r.def.out._zod.optout),ge(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>bs(i,t.in,o)):bs(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>bs(s,t.out,o)):bs(n,t.out,o)}});function bs(e,t,r){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Ym=q("$ZodPreprocess",(e,t)=>{Vc.init(e,t)}),Xm=q("$ZodReadonly",(e,t)=>{Se.init(e,t),ge(e,"propValues",r=>r.def.innerType._zod.propValues),ge(e,"values",r=>r.def.innerType._zod.values),ge(e,"optin",r=>r.def.innerType?._zod?.optin),ge(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Yp):Yp(n)}});function Yp(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Qm=q("$ZodLazy",(e,t)=>{Se.init(e,t),fc(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ge(e,"pattern",r=>r.innerType?._zod?.pattern),ge(e,"propValues",r=>r.innerType?._zod?.propValues),ge(e,"optin",r=>r.innerType?._zod?.optin??void 0),ge(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),ef=q("$ZodCustom",(e,t)=>{Ze.init(e,t),Se.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>Xp(s,r,o,e));Xp(n,r,o,e)}});function Xp(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(xr(n))}}var Hc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Jc="~memo",tf=[];function rf(e){return e!==null&&typeof e=="object"}function Fc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var of=new WeakMap,Vo=0,Ts=1,Fo=2;function ks(e,t,r){let o=of.get(e);if(o!==void 0)return o?Fo:Vo;if(t.has(e))return Fo;t.add(e);let n=Vo,s=d=>{if(n!==Fo&&d?._zod){let m=ks(d,t,r);m>n&&(n=m)}},i=(d,m)=>{let g=Vo;for(let v of Reflect.ownKeys(d)){let p=Object.getOwnPropertyDescriptor(d,v);if(m&&!p.enumerable)continue;let _=p.get?Ts:p.value?._zod?ks(p.value,t,r):Vo;_>g&&(g=_)}return g},c=d=>{d>n&&(n=d)},a=e._zod.def,u=a.type;switch(u){case"object":{let d=jr(a);c(d?i(d,!0):Ts),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(let d of a.items)s(d);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(let d of a.options)s(d);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{let d=a._cachedInner??(r?e._zod.innerType:void 0);c(d?ks(d,t,!1):Ts);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let d in a){let m=Object.getOwnPropertyDescriptor(a,d);if(!m||m.get)continue;let g=m.value;if(!(!g||typeof g!="object")){if(g._zod)s(g);else if(Array.isArray(g))for(let v of g)s(v)}}}return t.delete(e),py(e,n)}function py(e,t){return t!==Ts&&of.set(e,t===Fo),t}function my(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Ps,Es=[],fy={alloc(e,t,r){let o=Ps;if(!o)return r;Ps=void 0;let n={value:r,issues:null};return o.set(t.value,n),Es.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&hy(s,n.value))throw new Hc;return r(n,s)};e._zod.parse=o,e._zod.run===r&&(e._zod.run=o)})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,c=(a,u)=>{if(r===void 0){let f=ks(e,new Set,!1);if(f===Vo)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Fo||o?r=!0:o=!0}let d=a.value;if(!rf(d))return i(a,u);let m=u[Jc];m||(m={buckets:new WeakMap,backEdges:void 0},u[Jc]=m);let g;n===u?g=s:(g=my(m,e),n=u,s=g);let v=g.get(d);if(v)return a.value=v.value,v.issues?v.issues.length&&a.issues.push(...Fc(v.issues)):(a.memo=!0,m.backEdges??(m.backEdges=new WeakSet),m.backEdges.add(v.value)),a;Ps=g;let p=Es.length,_=i(a,u);Ps=void 0;let h=Es.length>p?Es.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Fc(f.issues):tf),f)):(h&&(h.issues=_.issues.length?Fc(_.issues):tf),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function Bc(){return fy}function hy(e,t){let r=e[Jc]?.backEdges;return r!==void 0&&rf(t)&&r.has(t)}var gy=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):o[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=n(s.expected),c=bc(s.input),a=n(c,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${us(s.values[0])}`:`Invalid option: expected one of ${as(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${as(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`'${c}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function nf(){return{localeError:gy()}}var sf;var Kc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function af(){return new Kc}(sf=globalThis).__zod_globalRegistry??(sf.__zod_globalRegistry=af());var qt=globalThis.__zod_globalRegistry;function Cs(e){return e.checks&&(e.checks=[...e.checks]),e}function cf(e,t){return new e(Cs({type:"string",...te(t)}))}function uf(e,t){return new e(Cs({type:"string",coerce:!0,...te(t)}))}function Gc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function lf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function df(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function pf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function mf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function ff(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function Wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function hf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function gf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function _f(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function Sf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function yf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function vf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function bf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function zf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Rf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function $f(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function wf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Pf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Ef(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Tf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function kf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Is(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Os(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Ns(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function js(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Cf(e,t){return new e(Cs({type:"number",checks:[],...te(t)}))}function If(e,t){return new e(Cs({type:"number",coerce:!0,checks:[],...te(t)}))}function Of(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Nf(e,t){return new e({type:"boolean",...te(t)})}function jf(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function xf(e,t){return new e({type:"bigint",coerce:!0,...te(t)})}function Af(e,t){return new e({type:"null",...te(t)})}function qf(e){return new e({type:"any"})}function Mf(e){return new e({type:"unknown"})}function Lf(e,t){return new e({type:"never",...te(t)})}function Df(e,t){return new e({type:"date",coerce:!0,...te(t)})}function Mr(e,t){return new xc({check:"less_than",...te(t),value:e,inclusive:!1})}function vt(e,t){return new xc({check:"less_than",...te(t),value:e,inclusive:!0})}function Lr(e,t){return new Ac({check:"greater_than",...te(t),value:e,inclusive:!1})}function bt(e,t){return new Ac({check:"greater_than",...te(t),value:e,inclusive:!0})}function Ho(e,t){return new kp({check:"multiple_of",...te(t),value:e})}function xs(e,t){return new Ip({check:"max_length",...te(t),maximum:e})}function Dr(e,t){return new Op({check:"min_length",...te(t),minimum:e})}function As(e,t){return new Np({check:"length_equals",...te(t),length:e})}function Yc(e,t){return new jp({check:"string_format",format:"regex",...te(t),pattern:e})}function Xc(e){return new xp({check:"string_format",format:"lowercase",...te(e)})}function Qc(e){return new Ap({check:"string_format",format:"uppercase",...te(e)})}function eu(e,t){return new qp({check:"string_format",format:"includes",...te(t),includes:e})}function tu(e,t){return new Mp({check:"string_format",format:"starts_with",...te(t),prefix:e})}function ru(e,t){return new Lp({check:"string_format",format:"ends_with",...te(t),suffix:e})}function Mt(e){return new Dp({check:"overwrite",tx:e})}function ou(e){return Mt(t=>t.normalize(e))}function nu(){return Mt(e=>e.trim())}function su(){return Mt(e=>e.toLowerCase())}function iu(){return Mt(e=>e.toUpperCase())}function au(){return Mt(e=>gc(e))}function Zf(e,t,r){return new e({type:"array",element:t,...te(r)})}function Uf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function Vf(e,t){let r=_y(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(xr(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(xr(s))}},e(o.value,o)),t);return r}function _y(e,t){let r=new Ze({check:"custom",...te(t)});return r._zod.check=e,r}function Jo(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,o)&&Ye(e,o,r[o]);return e}function Ko(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??qt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function qe(e,t,r,o,n){let s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(n);return Object.assign(r,s),!0}function ve(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let g=i.schema,v=t.processors[n.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);v(e,t,g,d)}let m=e._zod.parent;m&&(i.ref||(i.ref=m),ve(m,t,d),t.seen.get(m).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Jo(i.schema,a),t.io==="input"&&Ge(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Ff(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Go(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let a=o.get(c);if(a&&a!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(i[0])?.id,g=e.external.uri??(p=>p);if(m)return{ref:g(m)};let v=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${Ff(v)}`}}let a="#",u=`${a}/${c}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+Ff(d)}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:a,defId:u}=n(i);c.def={...c.schema},u&&(c.defId=u);let d=c.schema;for(let m in d)delete d[m];d.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
58
58
|
|
|
59
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}c.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Bf(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;Bf(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Kf=new Set(["type","properties","required","additionalProperties"]),Hf=["oneOf","anyOf"];function Jf(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function cu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!Kf.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let c=[];for(let u of t){let d=u.properties?.[i]??Jf(u);d!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:cu(c)??{allOf:c};Ye(r,i,a)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(s=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let c=Jf(i);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?n.additionalProperties=s[0]:s.length>1&&(n.additionalProperties={allOf:s})}return n}function Sy(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Kf)if(n in e)return;let r=t.filter(n=>Hf.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=cu(t);else{let n=r[0],s=Hf.find(a=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let i=t.filter(a=>a!==n),c=n[s].map(a=>cu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Jo(e,o))}function Wo(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,d={...u},m=a.ref;if(a.ref=null,m){o(m);let v=e.seen.get(m),p=v.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Jo(u,p),Jo(u,d),c._zod.parent===m)for(let h in u)h==="$ref"||h==="allOf"||h in d||delete u[h];if(p.$ref&&v.def)for(let h in u)h==="$ref"||h==="allOf"||h in v.def&&JSON.stringify(u[h])===JSON.stringify(v.def[h])&&delete u[h]}let g=c._zod.parent;if(g&&g!==m){o(g);let v=e.seen.get(g);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(let p in u)p==="$ref"||p==="allOf"||p in v.def&&JSON.stringify(u[p])===JSON.stringify(v.def[p])&&delete u[p]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Bf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let m=c.get(d);m?m.push(u):c.set(d,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Sy(u)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Jo(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,Ye(i,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bo(t,"input",e.processors),output:Bo(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ge(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ge(o.element,r);if(o.type==="set")return Ge(o.valueType,r);if(o.type==="lazy")return Ge(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Ge(o.innerType,r);if(o.type==="intersection")return Ge(o.left,r)||Ge(o.right,r);if(o.type==="record"||o.type==="map")return Ge(o.keyType,r)||Ge(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ge(o.in,r)||Ge(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ge(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ge(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ge(n,r))return!0;return!!(o.rest&&Ge(o.rest,r))}return!1}var Gf=(e,t={})=>r=>{let o=Ko({...r,processors:t});return ve(e,o),Go(o,e),Wo(o,e)},Bo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Ko({...n??{},target:s,io:t,processors:r});return ve(e,i),Go(i,e),Wo(i,e)};var Zr=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Ur=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Wf=(e,t)=>{Zr(e,"minimum",t),Ur(e,"maximum",t)},th=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},rh=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},oh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},nh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Yf=(e,t)=>Zr(e,"minimum",t.minimum),Xf=(e,t)=>Ur(e,"maximum",t.maximum),Qf=e=>(t,r)=>{nh(t,r.format);let[o,n]=e[r.format];Zr(t,"minimum",o),Ur(t,"maximum",n)},yy={greater_than:(e,t)=>Zr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ur(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>th(e,t.value),number_format:Qf(Mo),bigint_format:Qf(ls),min_length:Yf,max_length:Xf,length_equals:(e,t)=>Wf(e,t.length),min_size:Yf,max_size:Xf,size_equals:(e,t)=>Wf(e,t.size),string_format:(e,t)=>{nh(e,t.format),t.pattern&&rh(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>oh(e,t.mime)};function xe(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)yy[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Zr(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Zr(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Ur(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Ur(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&th(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&oh(t,n.mime);for(let s of n.patterns??[])rh(t,s);return t}var vy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},by=new Map([[Lc,hp],[ws,gp]]),sh=e=>by.get(e)??e,du=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:d}=xe(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=vy[c]??c,n.format===""&&delete n.format,(c==="time"||d)&&delete n.format),u&&(n.contentEncoding=u),a&&a.size>0){let m=[...a].map(sh);m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},pu=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:d}=xe(e);n.type=d?"integer":"number";let m=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),g=typeof a=="number"&&a<=(i??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(m?v?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),g?v?(n.maximum=a,n.exclusiveMaximum=!0):n.exclusiveMaximum=a:typeof i=="number"&&(n.maximum=i),c){let p=new Set;for(let f of c)Number.isFinite(f)&&f!==0?p.add(Math.abs(f)):qe(e,t,n,o,`A multipleOf divisor of ${f} cannot be represented in JSON Schema`);let[_,...h]=p;_!==void 0&&(n.multipleOf=_),h.length&&(n.allOf=[...n.allOf??[],...h.map(f=>({multipleOf:f}))])}},mu=(e,t,r,o)=>{r.type="boolean"},fu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},ih=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},hu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ah=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},ch=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},gu=(e,t,r,o)=>{r.not={}},_u=(e,t,r,o)=>{},Su=(e,t,r,o)=>{},yu=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{let n=e._zod.def,s=Ir(n.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},bu=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(qe(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(qe(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},uh=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},lh=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},dh=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=xe(e);s!==void 0&&(n.minLength=s),i!==void 0&&(n.maxLength=i),c&&(c.length===0?n.not={}:c.length===1?n.contentMediaType=c[0]:n.anyOf=c.map(a=>({contentMediaType:a})))},ph=(e,t,r,o)=>{r.type="boolean"},zu=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},mh=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},fh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},hh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},$u=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=xe(e);typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=ve(s.element,t,{...o,path:[...o.path,"items"]})};function Yo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Yo(t.out):t.type==="catch"?Yo(t.innerType):e._zod.optin}var wu=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&qe(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)Ye(n.properties,u,ve(i[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(i)){let d=s.shape[u];(t.io==="input"?Yo(d)===void 0:d._zod.optout===void 0)&&a.push(u)}a.length>0&&(n.required=a),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=ve(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Pu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,a)=>ve(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",a]}));s?r.oneOf=i:r.anyOf=i},Eu=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=ve(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)},gh=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((_,h)=>ve(_,t,{...o,path:[...o.path,i,h]})),u=s.rest?ve(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,d=s.items.length;for(;d>0;){let _=s.items[d-1];if(!(t.io==="input"?Yo(_)!==void 0:_._zod.optout==="optional"))break;d--}let m=s.items.length,g=!s.rest;t.target==="draft-2020-12"?(n.prefixItems=a,g?n.items=!1:u&&(n.items=u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):t.target==="openapi-3.0"?(n.items={anyOf:a},u&&n.items.anyOf.push(u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):(n.items=a,g?n.additionalItems=!1:u&&(n.additionalItems=u),d>0&&(n.minItems=d),g&&(n.maxItems=m));let{minimum:v,maximum:p}=xe(e);typeof v=="number"&&(n.minItems=v),typeof p=="number"&&(n.maxItems=p)};function uu(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let p=e.get(t)?.def;if(!p)return t;let _=uu(e,p,r);return _===p?t:_}for(let p of["anyOf","oneOf"]){let _=t[p];if(!Array.isArray(_))continue;let h=_.map(f=>uu(e,f,r));h.some((f,z)=>f!==_[z])&&(t={...t,[p]:h})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(p=>p==="number"||p==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(p=>typeof p=="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:d,format:m,id:g,...v}=t;return v.enum?v.enum=v.enum.map(p=>typeof p=="number"?String(p):p):typeof v.const=="number"&&(v.const=String(v.const)),n&&(v.type="string",s||(v.pattern=(o.includes("number")?Zo:Nc).source)),v}var lu=new WeakMap;function zy(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of lu.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=uu(t,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);s&&(n.propertyNames=s)}}var Tu=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=xe(i).patterns;if(s.mode==="loose"&&c&&c.size>0){let d=ve(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let m of c)Ye(n.patternProperties,sh(m).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=ve(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let d=lu.get(t);d||(d=[],lu.set(t,d),t.deferred.push(()=>zy(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&Yo(s.valueType)!==void 0;if(a&&!s.partial&&!u){let d=[...a].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(n.required=d.map(String))}},ku=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Cu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Iu=Symbol();function _h(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(s=!0,null));return s?(qe(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Iu):JSON.parse(i)}var Ou=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=_h(n.defaultValue,e,t,r,o);i!==Iu&&(r.default=i)},Nu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=_h(n.defaultValue,e,t,r,o);i!==Iu&&(r._prefault=i)},ju=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{qe(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},xu=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;ve(i,t,o);let c=t.seen.get(e);c.ref=i},Au=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Sh=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},eh={string:du,number:pu,boolean:mu,bigint:fu,symbol:ih,null:hu,undefined:ah,void:ch,never:gu,any:_u,unknown:Su,date:yu,enum:vu,literal:bu,nan:uh,template_literal:lh,file:dh,success:ph,custom:zu,function:mh,transform:Ru,map:fh,set:hh,array:$u,object:wu,union:Pu,intersection:Eu,tuple:gh,record:Tu,nullable:ku,nonoptional:Cu,default:Ou,prefault:Nu,catch:ju,pipe:xu,readonly:Au,promise:Sh,optional:qs,lazy:qu};function Ms(e,t){if("_idmap"in e){let o=e,n=Ko({...t,processors:eh}),s={};for(let a of o._idmap.entries()){let[u,d]=a;ve(d,n)}let i={},c={registry:o,uri:t?.uri,defs:s};n.external=c;for(let a of o._idmap.entries()){let[u,d]=a;Go(n,d),Ye(i,u,Wo(n,d))}if(Object.keys(s).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:s}}return{schemas:i}}let r=Ko({...t,processors:eh});return ve(e,r),Go(r,e),Wo(r,e)}var yh=new WeakSet([Object.prototype,Error.prototype]);function Ls(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Iy=(e,t)=>{Fd.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);yh.has(r)||(yh.add(r),Ls(r,"format",o=>n=>Tc(o,n)),Ls(r,"flatten",o=>n=>Ec(o,n)),Ls(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Or,2)}),Ls(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Or,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var rt=q("ZodError",Iy,void 0,{Parent:Error});var vh=hs(rt),bh=gs(rt),Ds=_s(rt),zh=Ss(rt),Rh=Jd(rt),$h=Bd(rt),wh=Kd(rt),Ph=Gd(rt),Eh=Wd(rt),Th=Yd(rt),kh=Xd(rt),Ch=Qd(rt);function Ny(){Xe.localeError||Qe(nf())}function Us(){Xe.memoizer||Qe({memoizer:Bc()})}var ye=q("ZodType",(e,t)=>(Ny(),Se.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ae.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return st(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(vv(e,t))},superRefine(e,t){return this.check(bv(e,t))},overwrite(e){return this.check(Mt(e))},optional(){return X(this)},exactOptional(){return iv(this)},nullable(){return Nh(this)},nullish(){return X(Nh(this))},nonoptional(e){return pv(this,e)},array(){return I(this)},or(e){return W([this,e])},and(e){return zt(this,e)},transform(e){return jh(this,Fh(e))},default(e){return uv(this,e)},prefault(e){return dv(this,e)},catch(e){return fv(this,e)},pipe(e){return jh(this,e)},readonly(){return _v(this)},describe(e){let t=this.clone();return qt.add(t,{description:e}),t},meta(...e){if(e.length===0)return qt.get(this);let t=this.clone();return qt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ae.hide(this,"~standard",{...Mc(this),jsonSchema:{input:Bo(this,"input"),output:Bo(this,"output")}})},set"~standard"(e){ae.own(this,"~standard",e)},parse:function e(t,r){return vh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await bh(this,t,r,{callee:e})},safeParse(e,t){return Ds(this,e,t)},async safeParseAsync(e,t){return zh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ae.own(this,"spa",e)},validate(e,t){return kc(this,e,t)},validateAsync(e,t){return Cc(this,e,t)},encode:function e(t,r){return Rh(this,t,r,{callee:e})},decode:function e(t,r){return $h(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await wh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Ph(this,t,r,{callee:e})},safeEncode(e,t){return Eh(this,e,t)},safeDecode(e,t){return Th(this,e,t)},async safeEncodeAsync(e,t){return kh(this,e,t)},async safeDecodeAsync(e,t){return Ch(this,e,t)},toJSONSchema(e){return Gf(this,{})(e)},get description(){return qt.get(this)?.description},get _def(){return this._zod.def}}),xh=q("_ZodString",(e,t)=>{$s.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n)},ae.derived({format:e=>xe(e).format??null,minLength:e=>xe(e).minimum??null,maxLength:e=>xe(e).maximum??null},{regex(...e){return this.check(Yc(...e))},includes(...e){return this.check(eu(...e))},startsWith(...e){return this.check(tu(...e))},endsWith(...e){return this.check(ru(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(xs(...e))},length(...e){return this.check(As(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(Xc(e))},uppercase(e){return this.check(Qc(e))},trim(){return this.check(nu())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(su())},toUpperCase(){return this.check(iu())},slugify(){return this.check(au())}})),Lu=q("ZodString",(e,t)=>{$s.init(e,t),xh.init(e,t)},{email(e){return this.check(Gc(Ah,e))},url(e){return this.check(Wc(Mh,e))},jwt(e){return this.check(kf(Gy,e))},emoji(e){return this.check(hf(xy,e))},guid(e){return this.check(lf(jy,e))},uuid(e){return this.check(df(Zs,e))},uuidv4(e){return this.check(pf(Zs,e))},uuidv6(e){return this.check(mf(Zs,e))},uuidv7(e){return this.check(ff(Zs,e))},nanoid(e){return this.check(gf(Ay,e))},cuid(e){return this.check(_f(qy,e))},cuid2(e){return this.check(Sf(My,e))},ulid(e){return this.check(yf(Ly,e))},base64(e){return this.check(Pf(Jy,e))},base64url(e){return this.check(Ef(By,e))},xid(e){return this.check(vf(Dy,e))},ksuid(e){return this.check(bf(Zy,e))},ipv4(e){return this.check(zf(Uy,e))},ipv6(e){return this.check(Rf(Vy,e))},cidrv4(e){return this.check($f(Fy,e))},cidrv6(e){return this.check(wf(Hy,e))},e164(e){return this.check(Tf(Ky,e))},datetime(e){return this.check(Is(Xo,e))},date(e){return this.check(Os(Qo,e))},time(e){return this.check(Ns(en,e))},duration(e){return this.check(js(tn,e))}});function l(e){return cf(Lu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),xh.init(e,t)}),Xo=q("ZodISODateTime",(e,t)=>{mm.init(e,t),Pe.init(e,t)}),Qo=q("ZodISODate",(e,t)=>{fm.init(e,t),Pe.init(e,t)}),en=q("ZodISOTime",(e,t)=>{hm.init(e,t),Pe.init(e,t)}),tn=q("ZodISODuration",(e,t)=>{gm.init(e,t),Pe.init(e,t)}),Ah=q("ZodEmail",(e,t)=>{rm.init(e,t),Pe.init(e,t)});function qh(e){return Gc(Ah,e)}var jy=q("ZodGUID",(e,t)=>{em.init(e,t),Pe.init(e,t)});var Zs=q("ZodUUID",(e,t)=>{tm.init(e,t),Pe.init(e,t)});var Mh=q("ZodURL",(e,t)=>{sm.init(e,t),Pe.init(e,t)});function Vs(e){return Wc(Mh,e)}var xy=q("ZodEmoji",(e,t)=>{im.init(e,t),Pe.init(e,t)});var Ay=q("ZodNanoID",(e,t)=>{am.init(e,t),Pe.init(e,t)});var qy=q("ZodCUID",(e,t)=>{cm.init(e,t),Pe.init(e,t)});var My=q("ZodCUID2",(e,t)=>{um.init(e,t),Pe.init(e,t)});var Ly=q("ZodULID",(e,t)=>{lm.init(e,t),Pe.init(e,t)});var Dy=q("ZodXID",(e,t)=>{dm.init(e,t),Pe.init(e,t)});var Zy=q("ZodKSUID",(e,t)=>{pm.init(e,t),Pe.init(e,t)});var Uy=q("ZodIPv4",(e,t)=>{_m.init(e,t),Pe.init(e,t)});var Vy=q("ZodIPv6",(e,t)=>{ym.init(e,t),Pe.init(e,t)});var Fy=q("ZodCIDRv4",(e,t)=>{vm.init(e,t),Pe.init(e,t)});var Hy=q("ZodCIDRv6",(e,t)=>{bm.init(e,t),Pe.init(e,t)});var Jy=q("ZodBase64",(e,t)=>{Rm.init(e,t),Pe.init(e,t)});var By=q("ZodBase64URL",(e,t)=>{$m.init(e,t),Pe.init(e,t)});var Ky=q("ZodE164",(e,t)=>{wm.init(e,t),Pe.init(e,t)});var Gy=q("ZodJWT",(e,t)=>{Pm.init(e,t),Pe.init(e,t)});var Fs=q("ZodNumber",(e,t)=>{Dc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.isFinite=!0},ae.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=xe(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=xe(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=xe(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>xe(e).format??null},{gt(e,t){return this.check(Lr(e,t))},gte(e,t){return this.check(bt(e,t))},min(e,t){return this.check(bt(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(vt(e,t))},max(e,t){return this.check(vt(e,t))},int(e){return this.check(Ih(e))},safe(e){return this.check(Ih(e))},positive(e){return this.check(Lr(0,e))},nonnegative(e){return this.check(bt(0,e))},negative(e){return this.check(Mr(0,e))},nonpositive(e){return this.check(vt(0,e))},multipleOf(e,t){return this.check(Ho(e,t))},step(e,t){return this.check(Ho(e,t))},finite(){return this}}));function L(e){return Cf(Fs,e)}var Wy=q("ZodNumberFormat",(e,t)=>{Em.init(e,t),Fs.init(e,t)});function Ih(e){return Of(Wy,e)}var Du=q("ZodBoolean",(e,t)=>{Tm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mu(e,r,o,n)});function H(e){return Nf(Du,e)}var Lh=q("ZodBigInt",(e,t)=>{km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fu(e,r,o,n)},ae.derived({minValue:e=>xe(e).minimum??null,maxValue:e=>xe(e).maximum??null,format:e=>xe(e).format??null},{gte(e,t){return this.check(bt(e,t))},min(e,t){return this.check(bt(e,t))},gt(e,t){return this.check(Lr(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(vt(e,t))},max(e,t){return this.check(vt(e,t))},positive(e){return this.check(Lr(BigInt(0),e))},negative(e){return this.check(Mr(BigInt(0),e))},nonpositive(e){return this.check(vt(BigInt(0),e))},nonnegative(e){return this.check(bt(BigInt(0),e))},multipleOf(e,t){return this.check(Ho(e,t))}}));var Yy=q("ZodNull",(e,t)=>{Cm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n)});function ur(e){return Af(Yy,e)}var Xy=q("ZodAny",(e,t)=>{Im.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n)});function Dh(){return qf(Xy)}var Qy=q("ZodUnknown",(e,t)=>{Om.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function Q(){return Mf(Qy)}var ev=q("ZodNever",(e,t)=>{Nm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)});function Zh(e){return Lf(ev,e)}var Uh=q("ZodDate",(e,t)=>{jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n),e.min=(r,o)=>e.check(bt(r,o)),e.max=(r,o)=>e.check(vt(r,o))},ae.derived({minDate:e=>{let{minimum:t}=xe(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=xe(e);return t?new Date(t):null}},{}));var tv=q("ZodArray",(e,t)=>{Us(),xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Dr(e,t))},nonempty(e){return this.check(Dr(1,e))},max(e,t){return this.check(xs(e,t))},length(e,t){return this.check(As(e,t))},unwrap(){return this.element}});function I(e,t){return Zf(tv,e,t)}var Zu=q("ZodObject",(e,t)=>{Us(),Mm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n),ae.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ce(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ae.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},loose(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},strict(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Zh()}))},strip(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ae.extend(this,e)},safeExtend(e){return ae.safeExtend(this,e)},merge(e){return ae.merge(this,e)},pick(e){return ae.pick(this,e)},omit(e){return ae.omit(this,e)},partial(...e){return ae.partial(Hh,this,e[0])},exactPartial(...e){return ae.partial(Jh,this,e[0],"exactPartial")},required(...e){return ae.required(Bh,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ae.normalizeParams(t)};return new Zu(r)}function Me(e,t){return new Zu({type:"object",shape:e,catchall:Zh(),...ae.normalizeParams(t)})}function re(e,t){return new Zu({type:"object",shape:e,catchall:Q(),...ae.normalizeParams(t)})}var Vh=q("ZodUnion",(e,t)=>{Zc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n),e.options=t.options});function W(e,t){return new Vh({type:"union",options:e,...ae.normalizeParams(t)})}var rv=q("ZodDiscriminatedUnion",(e,t)=>{Vh.init(e,t),Lm.init(e,t)});function Lt(e,t,r){return new rv({type:"union",options:t,discriminator:e,...ae.normalizeParams(r)})}var ov=q("ZodIntersection",(e,t)=>{Dm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function zt(e,t){return new ov({type:"intersection",left:e,right:t})}var Oh=q("ZodRecord",(e,t)=>{Us(),Zm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new Oh({type:"record",keyType:l(),valueType:e,...ae.normalizeParams(t)}):new Oh({type:"record",keyType:e,valueType:t,...ae.normalizeParams(r)})}var Mu=q("ZodEnum",(e,t)=>{Um.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>vu(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})}});function ce(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Mu({type:"enum",entries:r,...ae.normalizeParams(t)})}var nv=q("ZodLiteral",(e,t)=>{Vm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function O(e,t){return new nv({type:"literal",values:Array.isArray(e)?e:[e],...ae.normalizeParams(t)})}var sv=q("ZodTransform",(e,t)=>{Us(),Fm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ar(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ae.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ae.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function Fh(e){return new sv({type:"transform",transform:e})}var Hh=q("ZodOptional",(e,t)=>{Uc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Hh({type:"optional",innerType:e})}var Jh=q("ZodExactOptional",(e,t)=>{Hm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function iv(e){return new Jh({type:"optional",innerType:e})}var av=q("ZodNullable",(e,t)=>{Jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Nh(e){return new av({type:"nullable",innerType:e})}var cv=q("ZodDefault",(e,t)=>{Bm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uv(e,t){return new cv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var lv=q("ZodPrefault",(e,t)=>{Km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function dv(e,t){return new lv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var Bh=q("ZodNonOptional",(e,t)=>{Gm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function pv(e,t){return new Bh({type:"nonoptional",innerType:e,...ae.normalizeParams(t)})}var mv=q("ZodCatch",(e,t)=>{Wm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fv(e,t){return new mv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ae.constantCatch(t)})}var Kh=q("ZodPipe",(e,t)=>{Vc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.in=t.in,e.out=t.out});function jh(e,t){return new Kh({type:"pipe",in:e,out:t})}var hv=q("ZodPreprocess",(e,t)=>{Kh.init(e,t),Ym.init(e,t)}),gv=q("ZodReadonly",(e,t)=>{Xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _v(e){return new gv({type:"readonly",innerType:e})}var Sv=q("ZodLazy",(e,t)=>{Qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function rn(e){return new Sv({type:"lazy",getter:e})}var yv=q("ZodCustom",(e,t)=>{ef.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function vv(e,t={}){return Uf(yv,e,t)}function bv(e,t){return Vf(e,t)}function lr(e,t){return new hv({type:"pipe",in:Fh(e),out:t})}var Wh={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Gh;Gh||(Gh={});var Rt={};ic(Rt,{ZodISODate:()=>Qo,ZodISODateTime:()=>Xo,ZodISODuration:()=>tn,ZodISOTime:()=>en,date:()=>$v,datetime:()=>Rv,duration:()=>Pv,time:()=>wv});function Rv(e){return Is(Xo,e)}function $v(e){return Os(Qo,e)}function wv(e){return Ns(en,e)}function Pv(e){return js(tn,e)}var Hs={};ic(Hs,{bigint:()=>Cv,boolean:()=>kv,date:()=>Iv,number:()=>Tv,string:()=>Ev});function Ev(e){return uf(Lu,e)}function Tv(e){return If(Fs,e)}function kv(e){return jf(Du,e)}function Cv(e){return xf(Lh,e)}function Iv(e){return Df(Uh,e)}var pr="2025-11-25";var Js=[pr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Bs="io.modelcontextprotocol/related-task",mr="io.modelcontextprotocol/protocolVersion",Fr="io.modelcontextprotocol/clientInfo",wt="io.modelcontextprotocol/serverInfo",Pt="io.modelcontextprotocol/clientCapabilities",on="io.modelcontextprotocol/subscriptionId",Zt="io.modelcontextprotocol/logLevel";var fr="2.0";var Dt=rn(()=>W([l(),L(),H(),ur(),K(l(),Dt),I(Dt)])),Ee=K(l(),Dt),Vu=I(Dt),nn=W([l(),L().int()]),sn=l(),Ks=P({ttl:L().optional()}),Gs=P({taskId:l()}),an=re({progressToken:nn.optional(),[Bs]:Gs.optional()}),De=P({_meta:an.optional()}),hr=De.extend({task:Ks.optional()}),Te=P({method:l(),params:De.loose().optional()}),He=P({_meta:an.optional()}),Je=P({method:l(),params:He.loose().optional()}),cn=re({get[wt](){return Br.optional().catch(void 0)}}),ke=re({_meta:cn.optional()}),Ut=W([l(),L().int()]),un=P({jsonrpc:O(fr),id:Ut,...Te.shape}).strict(),ln=P({jsonrpc:O(fr),...Je.shape}).strict(),Hr=P({jsonrpc:O(fr),id:Ut,result:ke}).strict(),Jr=P({jsonrpc:O(fr),id:Ut.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),dn=W([un,ln,Hr,Jr]),Fu=W([Hr,Jr]),pn=ke.strict(),Ws=He.extend({requestId:Ut.optional(),reason:l().optional()}),mn=Je.extend({method:O("notifications/cancelled"),params:Ws}),Ys=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),Vt=P({icons:I(Ys).optional()}),$t=P({name:l(),title:l().optional()}),Br=$t.extend({...$t.shape,...Vt.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Nv=zt(P({applyDefaults:H().optional()}),Ee),jv=lr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zt(P({form:Nv.optional(),url:Ee.optional()}),Ee.optional())),Xs=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({sampling:re({createMessage:Ee.optional()}).optional(),elicitation:re({create:Ee.optional()}).optional()}).optional()}),Qs=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({tools:re({call:Ee.optional()}).optional()}).optional()}),ei=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:jv.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:Xs.optional(),extensions:K(l(),Ee).optional()}),ti=De.extend({protocolVersion:l(),capabilities:ei,clientInfo:Br}),ri=Te.extend({method:O("initialize"),params:ti}),fn=P({experimental:K(l(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:Qs.optional(),extensions:K(l(),Ee).optional()}),oi=ke.extend({protocolVersion:l(),capabilities:fn,serverInfo:Br,instructions:l().optional()}),ni=Je.extend({method:O("notifications/initialized"),params:He.optional()}),si=Te.extend({method:O("server/discover"),params:De.optional()}),ii=ke.extend({supportedVersions:I(l()),capabilities:fn,instructions:l().optional()}),hn=Te.extend({method:O("ping"),params:De.optional()}),ai=P({progress:L(),total:X(L()),message:X(l())}),ci=P({...He.shape,...ai.shape,progressToken:nn}),gn=Je.extend({method:O("notifications/progress"),params:ci}),ui=De.extend({cursor:sn.optional()}),Ft=Te.extend({params:ui.optional()}),Ht=ke.extend({nextCursor:sn.optional()}),_n=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),Sn=_n.extend({text:l()}),Hu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),yn=_n.extend({blob:Hu}),Jt=ce(["user","assistant"]),Et=P({audience:I(Jt).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),vn=P({...$t.shape,...Vt.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Et.optional(),_meta:X(re({}))}),li=P({...$t.shape,...Vt.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Et.optional(),_meta:X(re({}))}),di=Ft.extend({method:O("resources/list")}),pi=Ht.extend({resources:I(vn)}),mi=Ft.extend({method:O("resources/templates/list")}),fi=Ht.extend({resourceTemplates:I(li)}),Kr=De.extend({uri:l()}),hi=Kr,gi=Te.extend({method:O("resources/read"),params:hi}),_i=ke.extend({contents:I(W([Sn,yn]))}),Si=Je.extend({method:O("notifications/resources/list_changed"),params:He.optional()}),yi=Kr,vi=Te.extend({method:O("resources/subscribe"),params:yi}),bi=Kr,zi=Te.extend({method:O("resources/unsubscribe"),params:bi}),bn=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ri=De.extend({notifications:bn}),$i=Te.extend({method:O("subscriptions/listen"),params:Ri}),wi=He.extend({notifications:bn}),Pi=Je.extend({method:O("notifications/subscriptions/acknowledged"),params:wi}),Ei=cn.extend({[on]:Ut}),Ti=ke.extend({_meta:Ei}),ki=He.extend({uri:l()}),Ci=Je.extend({method:O("notifications/resources/updated"),params:ki}),Ii=P({name:l(),description:X(l()),required:X(H())}),Oi=P({...$t.shape,...Vt.shape,description:X(l()),arguments:X(I(Ii)),_meta:X(re({}))}),Ni=Ft.extend({method:O("prompts/list")}),ji=Ht.extend({prompts:I(Oi)}),xi=De.extend({name:l(),arguments:K(l(),l()).optional()}),Ai=Te.extend({method:O("prompts/get"),params:xi}),Gr=P({type:O("text"),text:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Wr=P({type:O("image"),data:Hu,mimeType:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Yr=P({type:O("audio"),data:Hu,mimeType:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),qi=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Mi=P({type:O("resource"),resource:W([Sn,yn]),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Li=vn.extend({type:O("resource_link")}),Xr=W([Gr,Wr,Yr,Li,Mi]),Di=P({role:Jt,content:Xr}),Zi=ke.extend({description:l().optional(),messages:I(Di)}),Ui=Je.extend({method:O("notifications/prompts/list_changed"),params:He.optional()}),Vi=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Fi=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),zn=P({...$t.shape,...Vt.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Dt).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:re({$schema:l().optional()}).optional(),annotations:Vi.optional(),execution:Fi.optional(),_meta:K(l(),Q()).optional()}),Hi=Ft.extend({method:O("tools/list")}),Ji=Ht.extend({tools:I(zn)}),Rn=ke.extend({content:I(Xr).default([]),structuredContent:Q().optional(),isError:H().optional()}),Ju=Rn.or(ke.extend({toolResult:Q()})),Bi=hr.extend({name:l(),arguments:K(l(),Q()).optional()}),Ki=Te.extend({method:O("tools/call"),params:Bi}),Gi=Je.extend({method:O("notifications/tools/list_changed"),params:He.optional()}),Bu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bt=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),Wi=De.extend({level:Bt}),Yi=Te.extend({method:O("logging/setLevel"),params:Wi}),Xi=He.extend({level:Bt,logger:l().optional(),data:Q()}),Qi=Je.extend({method:O("notifications/message"),params:Xi}),ea=P({name:l().optional()}),ta=P({hints:I(ea).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ra=P({mode:ce(["auto","required","none"]).optional()}),oa=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(Xr),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),na=Lt("type",[Gr,Wr,Yr]),dr=Lt("type",[Gr,Wr,Yr,qi,oa]),sa=P({role:Jt,content:W([dr,I(dr)]),_meta:K(l(),Q()).optional()}),ia=hr.extend({messages:I(sa),modelPreferences:ta.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(zn).optional(),toolChoice:ra.optional()}),aa=Te.extend({method:O("sampling/createMessage"),params:ia}),ca=ke.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:Jt,content:na}),ua=ke.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Jt,content:W([dr,I(dr)])}),$n=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Qr=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),eo=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),wn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Pn=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),En=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),la=W([wn,Pn]),Tn=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),kn=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),da=W([Tn,kn]),pa=W([En,la,da]),Cn=W([pa,$n,Qr,eo]),to=hr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Cn),required:I(l()).optional()}).catchall(Q())}),ma=hr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),fa=W([to,ma]),ha=Te.extend({method:O("elicitation/create"),params:fa}),ga=He.extend({elicitationId:l()}),_a=Je.extend({method:O("notifications/elicitation/complete"),params:ga}),Sa=ke.extend({action:ce(["accept","decline","cancel"]),content:lr(e=>e===null?void 0:e,K(l(),W([l(),L(),H(),I(l())])).optional())}),ya=P({type:O("ref/resource"),uri:l()}),va=P({type:O("ref/prompt"),name:l()}),ba=De.extend({ref:W([va,ya]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),za=Te.extend({method:O("completion/complete"),params:ba}),Ra=ke.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),$a=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),wa=Te.extend({method:O("roots/list"),params:De.optional()}),Pa=ke.extend({roots:I($a)}),Ea=Je.extend({method:O("notifications/roots/list_changed"),params:He.optional()}),Ku=re({ttl:L().optional(),pollInterval:L().optional()}),Ta=ce(["working","input_required","completed","failed","cancelled"]),Kt=P({taskId:l(),status:Ta,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),Gu=ke.extend({task:Kt}),ka=He.merge(Kt),Wu=Je.extend({method:O("notifications/tasks/status"),params:ka}),Yu=Te.extend({method:O("tasks/get"),params:De.extend({taskId:l()})}),Xu=ke.merge(Kt),Qu=Te.extend({method:O("tasks/result"),params:De.extend({taskId:l()})}),el=ke.loose(),tl=Ft.extend({method:O("tasks/list")}),rl=Ht.extend({tasks:I(Kt)}),ol=Te.extend({method:O("tasks/cancel"),params:De.extend({taskId:l()})}),nl=ke.merge(Kt),sl=W([hn,ri,si,za,Yi,Ai,Ni,di,mi,gi,vi,zi,$i,Ki,Hi]),il=W([mn,gn,ni,Ea]),al=W([pn,ca,ua,Sa,Pa]),cl=W([hn,aa,ha,wa]),ul=W([mn,gn,Qi,Ci,Si,Gi,Ui,Pi,_a]),ll=W([pn,oi,ii,Ra,Zi,ji,pi,fi,_i,Rn,Ji,Ti]),Le=Vs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Wh.custom,message:"URL must be parseable",fatal:!0}),$c}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),dl=re({resource:l().url(),authorization_servers:I(Le).optional(),jwks_uri:l().url().optional(),scopes_supported:I(l()).optional(),bearer_methods_supported:I(l()).optional(),resource_signing_alg_values_supported:I(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:H().optional(),authorization_details_types_supported:I(l()).optional(),dpop_signing_alg_values_supported:I(l()).optional(),dpop_bound_access_tokens_required:H().optional()}),Ca=re({issuer:l(),authorization_endpoint:Le,token_endpoint:Le,registration_endpoint:Le.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),service_documentation:Le.optional(),revocation_endpoint:Le.optional(),revocation_endpoint_auth_methods_supported:I(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:I(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:I(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:I(l()).optional(),code_challenge_methods_supported:I(l()).optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0),dpop_signing_alg_values_supported:I(l()).optional()}),Ia=re({issuer:l(),authorization_endpoint:Le,token_endpoint:Le,userinfo_endpoint:Le.optional(),jwks_uri:Le,registration_endpoint:Le.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),acr_values_supported:I(l()).optional(),subject_types_supported:I(l()),id_token_signing_alg_values_supported:I(l()),id_token_encryption_alg_values_supported:I(l()).optional(),id_token_encryption_enc_values_supported:I(l()).optional(),userinfo_signing_alg_values_supported:I(l()).optional(),userinfo_encryption_alg_values_supported:I(l()).optional(),userinfo_encryption_enc_values_supported:I(l()).optional(),request_object_signing_alg_values_supported:I(l()).optional(),request_object_encryption_alg_values_supported:I(l()).optional(),request_object_encryption_enc_values_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),display_values_supported:I(l()).optional(),claim_types_supported:I(l()).optional(),claims_supported:I(l()).optional(),service_documentation:l().optional(),claims_locales_supported:I(l()).optional(),ui_locales_supported:I(l()).optional(),claims_parameter_supported:H().optional(),request_parameter_supported:H().optional(),request_uri_parameter_supported:H().optional(),require_request_uri_registration:H().optional(),op_policy_uri:Le.optional(),op_tos_uri:Le.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),pl=P({...Ia.shape,...Ca.pick({code_challenge_methods_supported:!0}).shape}),ml=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Hs.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),fl=P({issued_token_type:O("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:L().optional(),scope:l().optional()}).strip(),hl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Uu=Le.optional().or(O("").transform(()=>{})),Oa=P({redirect_uris:I(Le),token_endpoint_auth_method:l().optional(),grant_types:I(l()).optional(),response_types:I(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:Le.optional(),logo_uri:Uu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Uu,policy_uri:l().optional(),jwks_uri:Le.optional(),jwks:Dh().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Na=P({client_id:l(),client_secret:l().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional(),issuer:l().optional().catch(void 0)}).strip(),gl=Oa.merge(Na),_l=P({error:l(),error_description:l().optional()}).strip(),Sl=P({token:l(),token_type_hint:l().optional()}).strip();var zl=Symbol.for("mcp.sdk.errorBrands");function Pl(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,zl,{value:r,enumerable:!1,configurable:!0})}function oo(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,zl)){let r=t[zl];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Sg=class yg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return oo(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Pl(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new yg(t.error,t.error_description??t.error,t.error_uri)}},me=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return oo(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",Pl(this,new.target)}},xv=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ig(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Av(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function vg(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Za(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(ig(n)&&ig(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!Av(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var qv="2026-07-28";function An(e){return e>=qv}function bg(e){return e.filter(t=>!An(t))}function El(e){return e.filter(t=>An(t))}function zg(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Rg=["task","inputRequests","requestState"];function Tl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Rg.some(t=>t in e)?e:{...e,content:[]}}function Mv(){let e=rn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=P({ttl:L().optional()}),s=P({taskId:l()}),i=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=P({_meta:i.optional()}),a=c.extend({task:n.optional()}),u=P({method:l(),params:c.loose().optional()}),d=P({_meta:i.optional()}),m=P({method:l(),params:d.loose().optional()}),g=re({_meta:i.optional()}),v=W([l(),L().int()]),p=g.strict(),_=d.extend({requestId:v.optional(),reason:l().optional()}),h=m.extend({method:O("notifications/cancelled"),params:_}),f=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),z=P({icons:I(f).optional()}),y=P({name:l(),title:l().optional()}),R=y.extend({...y.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),w=zt(P({applyDefaults:H().optional()}),t),b=lr(Fe=>Fe&&typeof Fe=="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0?{form:{}}:Fe,zt(P({form:w.optional(),url:t.optional()}),t.optional())),S=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),E=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),j=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:S.optional(),extensions:K(l(),t).optional()}),F=c.extend({protocolVersion:l(),capabilities:j,clientInfo:R}),M=u.extend({method:O("initialize"),params:F}),Z=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:E.optional(),extensions:K(l(),t).optional()}),Y=g.extend({protocolVersion:l(),capabilities:Z,serverInfo:R,instructions:l().optional()}),G=m.extend({method:O("notifications/initialized"),params:d.optional()}),fe=u.extend({method:O("ping"),params:c.optional()}),$e=P({progress:L(),total:X(L()),message:X(l())}),be=P({...d.shape,...$e.shape,progressToken:r}),Oe=m.extend({method:O("notifications/progress"),params:be}),he=c.extend({cursor:o.optional()}),C=u.extend({params:he.optional()}),x=g.extend({nextCursor:o.optional()}),V=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=V.extend({text:l()}),k=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=V.extend({blob:k}),J=ce(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),pe=P({...y.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:ee.optional(),_meta:X(re({}))}),ie=P({...y.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(re({}))}),ze=C.extend({method:O("resources/list")}),Be=x.extend({resources:I(pe)}),T=C.extend({method:O("resources/templates/list")}),A=x.extend({resourceTemplates:I(ie)}),D=c.extend({uri:l()}),ne=D,se=u.extend({method:O("resources/read"),params:ne}),de=g.extend({contents:I(W([$,N]))}),Ce=m.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),je=D,Ue=u.extend({method:O("resources/subscribe"),params:je}),Ne=D,we=u.extend({method:O("resources/unsubscribe"),params:Ne}),ot=d.extend({uri:l()}),Ae=m.extend({method:O("notifications/resources/updated"),params:ot}),ft=P({name:l(),description:X(l()),required:X(H())}),it=P({...y.shape,...z.shape,description:X(l()),arguments:X(I(ft)),_meta:X(re({}))}),ht=C.extend({method:O("prompts/list")}),kt=x.extend({prompts:I(it)}),Ct=c.extend({name:l(),arguments:K(l(),l()).optional()}),Wt=u.extend({method:O("prompts/get"),params:Ct}),Yt=P({type:O("text"),text:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Xt=P({type:O("image"),data:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Qt=P({type:O("audio"),data:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),co=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),It=P({type:O("resource"),resource:W([$,N]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),uo=pe.extend({type:O("resource_link")}),nt=W([Yt,Xt,Qt,uo,It]),yr=P({role:J,content:nt}),vr=g.extend({description:l().optional(),messages:I(yr)}),er=m.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),lo=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),br=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),tr=P({...y.shape,...z.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()).optional(),annotations:lo.optional(),execution:br.optional(),_meta:K(l(),Q()).optional()}),zr=C.extend({method:O("tools/list")}),Rr=x.extend({tools:I(tr)}),$r=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ve=a.extend({name:l(),arguments:K(l(),Q()).optional()}),po=u.extend({method:O("tools/call"),params:Ve}),Vn=m.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),wr=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),mo=c.extend({level:wr}),fo=u.extend({method:O("logging/setLevel"),params:mo}),ho=d.extend({level:wr,logger:l().optional(),data:Q()}),go=m.extend({method:O("notifications/message"),params:ho}),_o=P({name:l().optional()}),So=P({hints:I(_o).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),yo=P({mode:ce(["auto","required","none"]).optional()}),Fn=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(nt),structuredContent:P({}).loose().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),vo=Lt("type",[Yt,Xt,Qt]),Ot=Lt("type",[Yt,Xt,Qt,co,Fn]),bo=P({role:J,content:W([Ot,I(Ot)]),_meta:K(l(),Q()).optional()}),zo=a.extend({messages:I(bo),modelPreferences:So.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(tr).optional(),toolChoice:yo.optional()}),Ro=u.extend({method:O("sampling/createMessage"),params:zo}),$o=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:vo}),wo=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:W([Ot,I(Ot)])}),Po=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Eo=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),To=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),ko=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Co=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),Oo=W([ko,Co]),rr=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),or=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),Hn=W([rr,or]),Jn=W([Io,Oo,Hn]),et=W([Jn,Po,Eo,To]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),No=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),at=W([tt,No]),Bn=u.extend({method:O("elicitation/create"),params:at}),Kn=d.extend({elicitationId:l()}),Gn=m.extend({method:O("notifications/elicitation/complete"),params:Kn}),Wn=g.extend({action:ce(["accept","decline","cancel"]),content:lr(Fe=>Fe===null?void 0:Fe,K(l(),W([l(),L(),H(),I(l())])).optional())}),Yn=P({type:O("ref/resource"),uri:l()}),Xn=P({type:O("ref/prompt"),name:l()}),Qn=c.extend({ref:W([Xn,Yn]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),jo=u.extend({method:O("completion/complete"),params:Qn}),es=g.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),ts=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Pr=u.extend({method:O("roots/list"),params:c.optional()}),xo=g.extend({roots:I(ts)}),rs=m.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),os=re({ttl:L().optional(),pollInterval:L().optional()}),Ao=ce(["working","input_required","completed","failed","cancelled"]),Nt=P({taskId:l(),status:Ao,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:Nt}),ns=d.merge(Nt),nr=m.extend({method:O("notifications/tasks/status"),params:ns}),Er=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Tr=g.merge(Nt),kr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),sc=g.loose(),Ke=C.extend({method:O("tasks/list")}),Ie=x.extend({tasks:I(Nt)}),sr=u.extend({method:O("tasks/cancel"),params:c.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:a,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:m,ResultSchema:g,RequestIdSchema:v,EmptyResultSchema:p,CancelledNotificationParamsSchema:_,CancelledNotificationSchema:h,IconSchema:f,IconsSchema:z,BaseMetadataSchema:y,ImplementationSchema:R,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:j,InitializeRequestParamsSchema:F,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:Y,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:C,PaginatedResultSchema:x,ResourceContentsSchema:V,TextResourceContentsSchema:$,BlobResourceContentsSchema:N,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ie,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Be,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:Ce,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Ue,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:we,ResourceUpdatedNotificationParamsSchema:ot,ResourceUpdatedNotificationSchema:Ae,PromptArgumentSchema:ft,PromptSchema:it,ListPromptsRequestSchema:ht,ListPromptsResultSchema:kt,GetPromptRequestParamsSchema:Ct,GetPromptRequestSchema:Wt,TextContentSchema:Yt,ImageContentSchema:Xt,AudioContentSchema:Qt,ToolUseContentSchema:co,EmbeddedResourceSchema:It,ResourceLinkSchema:uo,ContentBlockSchema:nt,PromptMessageSchema:yr,GetPromptResultSchema:vr,PromptListChangedNotificationSchema:er,ToolAnnotationsSchema:lo,ToolExecutionSchema:br,ToolSchema:tr,ListToolsRequestSchema:zr,ListToolsResultSchema:Rr,CallToolResultSchema:$r,CallToolRequestParamsSchema:Ve,CallToolRequestSchema:po,ToolListChangedNotificationSchema:Vn,LoggingLevelSchema:wr,SetLevelRequestParamsSchema:mo,SetLevelRequestSchema:fo,LoggingMessageNotificationParamsSchema:ho,LoggingMessageNotificationSchema:go,ModelHintSchema:_o,ModelPreferencesSchema:So,ToolChoiceSchema:yo,ToolResultContentSchema:Fn,SamplingContentSchema:vo,SamplingMessageContentBlockSchema:Ot,SamplingMessageSchema:bo,CreateMessageRequestParamsSchema:zo,CreateMessageRequestSchema:Ro,CreateMessageResultSchema:$o,CreateMessageResultWithToolsSchema:wo,BooleanSchemaSchema:Po,StringSchemaSchema:Eo,NumberSchemaSchema:To,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:Co,LegacyTitledEnumSchemaSchema:Io,SingleSelectEnumSchemaSchema:Oo,UntitledMultiSelectEnumSchemaSchema:rr,TitledMultiSelectEnumSchemaSchema:or,MultiSelectEnumSchemaSchema:Hn,EnumSchemaSchema:Jn,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:No,ElicitRequestParamsSchema:at,ElicitRequestSchema:Bn,ElicitationCompleteNotificationParamsSchema:Kn,ElicitationCompleteNotificationSchema:Gn,ElicitResultSchema:Wn,ResourceTemplateReferenceSchema:Yn,PromptReferenceSchema:Xn,CompleteRequestParamsSchema:Qn,CompleteRequestSchema:jo,CompleteResultSchema:es,RootSchema:ts,ListRootsRequestSchema:Pr,ListRootsResultSchema:xo,RootsListChangedNotificationSchema:rs,TaskCreationParamsSchema:os,TaskStatusSchema:Ao,TaskSchema:Nt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:ns,TaskStatusNotificationSchema:nr,GetTaskRequestSchema:Er,GetTaskResultSchema:Tr,GetTaskPayloadRequestSchema:kr,GetTaskPayloadResultSchema:sc,ListTasksRequestSchema:Ke,ListTasksResultSchema:Ie,CancelTaskRequestSchema:sr,CancelTaskResultSchema:g.merge(Nt),ClientRequestSchema:W([fe,M,jo,fo,Wt,ht,ze,T,se,Ue,we,po,zr,Er,kr,Ke,sr]),ClientNotificationSchema:W([h,Oe,G,rs,nr]),ClientResultSchema:W([p,$o,wo,Wn,xo,Tr,Ie,We]),ServerRequestSchema:W([fe,Ro,Bn,Pr,Er,kr,Ke,sr]),ServerNotificationSchema:W([h,Oe,go,Ae,Ce,Vn,er,nr,Gn]),ServerResultSchema:W([p,Y,es,vr,kt,Be,A,de,$r,Rr,Tr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,tS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let cd of Rg)if(cd in Fe){tS.addIssue({code:"custom",message:`content is required when the body carries '${cd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Tl).pipe($r)}}var Lv;function $g(){return Lv??=Mv()}function wg(e){return e.type!=="object"}var Dv=new Set(["const","enum","default","examples"]),Zv=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ag(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Uv(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(ag(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Pd(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(a=>o(a,!1));if(n===null||typeof n!="object"||!s&&ag(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))s?i[a]=o(u,!1):(a==="$ref"||a==="$dynamicRef")&&typeof u=="string"?i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:a==="$recursiveRef"&&u==="#"&&r?c=!0:Dv.has(a)?i[a]=u:Zv.has(a)?i[a]=o(u,!0):i[a]=o(u,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Pg={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Eg={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Vv={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ja;function kl(){if(ja)return ja;let e=$g();return ja={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ja}function Tg(e){return Object.prototype.hasOwnProperty.call(Pg,e)}function kg(e){return Object.prototype.hasOwnProperty.call(Eg,e)}function Fv(e){return Object.prototype.hasOwnProperty.call(Vv,e)}function Hv(e){return Fv(e)?kl().resultSchemas[e]:void 0}function Jv(e){return Tg(e)?kl().requestSchemas[e]:void 0}function Bv(e){return kg(e)?kl().notificationSchemas[e]:void 0}var Ew=Object.keys(Pg),Tw=Object.keys(Eg);function Rl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xa(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var cg={ok:!1,reason:"not-in-era"};function ug(e){return Rl(e)&&Rl(e.outputSchema)&&wg(e.outputSchema)}var Cl={era:"2025-11-25",hasRequestMethod:Tg,hasNotificationMethod:kg,validateRequest:(e,t)=>xa(Jv(e),t),validateResult:(e,t)=>xa(Hv(e),t),validateNotification:(e,t)=>xa(Bv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>cg,validateInputResponse:()=>cg,samplingResultVariant:((e,t)=>{let r=$g();return xa(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=zg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&wg(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Rl(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>ug(o))?t:{...t,tools:r.map(o=>ug(o)?{...o,outputSchema:Uv(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Kv(){let e=rn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=W([l(),L().int()]),s=ce(["user","assistant"]),i=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),c=l().refine(Ie=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),a=P({ttl:L().optional()}),u=P({taskId:l()}),d=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),m=P({_meta:d.optional()}),g=m.extend({task:a.optional()}),v=P({_meta:d.optional()}),p=P({method:l(),params:v.loose().optional()}),_=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),h=P({icons:I(_).optional()}),f=P({name:l(),title:l().optional()}),z=f.extend({...f.shape,...h.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),y=zt(P({applyDefaults:H().optional()}),t),R=lr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,zt(P({form:y.optional(),url:t.optional()}),t.optional())),w=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),b=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),S=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:w.optional(),extensions:K(l(),t).optional()}),E=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:b.optional(),extensions:K(l(),t).optional()}),j=P({progress:L(),total:X(L()),message:X(l())}),F=P({...v.shape,...j.shape,progressToken:r}),M=p.extend({method:O("notifications/progress"),params:F}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),Y=p.extend({method:O("notifications/message"),params:Z}),G=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),fe=G.extend({text:l()}),$e=G.extend({blob:c}),be=P({audience:I(s).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),Oe=P({...f.shape,...h.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:be.optional(),_meta:X(re({}))}),he=P({...f.shape,...h.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(re({}))}),C=p.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),x=v.extend({uri:l()}),V=p.extend({method:O("notifications/resources/updated"),params:x}),$=P({name:l(),description:X(l()),required:X(H())}),k=P({...f.shape,...h.shape,description:X(l()),arguments:X(I($)),_meta:X(re({}))}),N=p.extend({method:O("notifications/prompts/list_changed"),params:v.optional()}),J=P({type:O("text"),text:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ee=P({type:O("image"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),pe=P({type:O("audio"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ie=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),ze=P({type:O("resource"),resource:W([fe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Be=Oe.extend({type:O("resource_link")}),T=W([J,ee,pe,Be,ze]),A=P({role:s,content:T}),D=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),ne=p.extend({method:O("notifications/tools/list_changed"),params:v.optional()}),se=P({name:l().optional()}),de=P({hints:I(se).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Ce=P({mode:ce(["auto","required","none"]).optional()}),je=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Ue=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),we=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),ot=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Ae=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ft=W([we,ot]),it=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),ht=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),kt=W([it,ht]),Ct=W([Ae,ft,kt]),Wt=W([Ct,je,Ue,Ne]),Yt=g.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Wt),required:I(l()).optional()}).catchall(Q())}),Xt=P({type:O("ref/resource"),uri:l()}),Qt=P({type:O("ref/prompt"),name:l()}),co=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),It=S.shape,uo=P({experimental:It.experimental,sampling:It.sampling,elicitation:It.elicitation,roots:It.roots,extensions:It.extensions}),nt=E.shape,yr=P({experimental:nt.experimental,logging:nt.logging,completions:nt.completions,prompts:nt.prompts,resources:nt.resources,tools:nt.tools,extensions:nt.extensions}),vr=re({progressToken:r.optional(),[mr]:l(),[Fr]:z.optional(),[Pt]:uo,[Zt]:i.optional()}),er=P({...f.shape,...h.shape,description:l().optional(),inputSchema:re({$schema:l().optional(),type:O("object")}),outputSchema:re({$schema:l().optional()}).optional(),annotations:D.optional(),_meta:K(l(),Q()).optional()}),lo=P({type:O("tool_result"),toolUseId:l(),content:I(T),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),br=W([J,ee,pe,ie,lo]),tr=P({role:s,content:W([br,I(br)]),_meta:K(l(),Q()).optional()}),zr=l(),Rr=re({[wt]:z.optional().catch(void 0)}),$r=Rr.optional();function Ve(Ie){return re({_meta:$r,resultType:zr.default("complete"),...Ie})}let po=Ve({}),Vn=Ve({nextCursor:o.optional()}),wr=Ve({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),mo=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),fo=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(k),nextCursor:o.optional()}),ho=Ve({description:l().optional(),messages:I(A)}),go=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),_o=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),So=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),yo=Ve({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Fn=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"])}),vo=Ve({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),Ot=P({messages:I(tr),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(er).optional(),toolChoice:Ce.optional()}),bo=P({method:O("sampling/createMessage"),params:Ot}),zo=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),Ro=P({...tr.shape,model:l(),stopReason:l().optional()}),$o=P({roots:I(co)}),wo=P({action:ce(["accept","decline","cancel"]),content:K(l(),W([l(),L(),H(),I(l())])).optional()}),Po=P({mode:O("url"),message:l(),url:l().url()}),Eo=W([Yt,Po]),To=P({method:O("elicitation/create"),params:Eo}),ko=W([bo,zo,To]),Co=W([Ro,$o,wo]),Io=K(l(),ko),Oo=K(l(),Co),rr=Ve({inputRequests:Io.optional(),requestState:l().optional()}),or={inputResponses:Oo.optional(),requestState:l().optional()},Hn=P({_meta:vr,...or}),Jn=re({progressToken:r.optional()});function et(Ie,sr){return P({method:O(Ie),params:P({_meta:vr,...sr})})}function tt(Ie,sr){return P({method:O(Ie),params:P({_meta:Jn.optional(),...sr}).optional()})}let No={name:l(),arguments:K(l(),Q()).optional(),...or},at={cursor:o.optional()},Bn=et("tools/call",No),Kn=et("tools/list",at),Gn=et("prompts/list",at),Wn=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...or}),Yn=et("resources/list",at),Xn=et("resources/templates/list",at),Qn=et("resources/read",{uri:l(),...or}),jo={ref:W([Qt,Xt]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},es=et("completion/complete",jo),ts=et("server/discover",{}),Pr=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),xo={notifications:Pr},rs=et("subscriptions/listen",xo),os=Rr.extend({"io.modelcontextprotocol/subscriptionId":n}),Ao=re({_meta:os,resultType:zr.default("complete")}),Nt={"tools/call":tt("tools/call",No),"tools/list":tt("tools/list",at),"prompts/get":tt("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":tt("prompts/list",at),"resources/list":tt("resources/list",at),"resources/templates/list":tt("resources/templates/list",at),"resources/read":tt("resources/read",{uri:l()}),"completion/complete":tt("completion/complete",jo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",xo)};function We(Ie){return re({_meta:$r,...Ie})}let ns={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),"prompts/get":We({description:l().optional(),messages:I(A)}),"prompts/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(k),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),"completion/complete":We({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),"server/discover":We({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),"subscriptions/listen":We({})},nr=re({"io.modelcontextprotocol/subscriptionId":n.optional()}),Er=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:nr.optional(),notifications:Pr})}),Tr=P({_meta:nr.optional(),requestId:n,reason:l().optional()}),kr=P({method:O("notifications/cancelled"),params:Tr}),sc={"notifications/cancelled":kr,"notifications/progress":M,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":C,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":N,"notifications/subscriptions/acknowledged":Er},Ke=Ie=>P({jsonrpc:O("2.0"),id:W([l(),L().int()]),result:Ie}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:a,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:g,NotificationsParamsSchema:v,NotificationSchema:p,IconSchema:_,IconsSchema:h,BaseMetadataSchema:f,ImplementationSchema:z,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:b,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:j,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:C,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:$,PromptSchema:k,PromptListChangedNotificationSchema:N,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ie,EmbeddedResourceSchema:ze,ResourceLinkSchema:Be,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:de,ToolChoiceSchema:Ce,BooleanSchemaSchema:je,StringSchemaSchema:Ue,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:we,TitledSingleSelectEnumSchemaSchema:ot,LegacyTitledEnumSchemaSchema:Ae,SingleSelectEnumSchemaSchema:ft,UntitledMultiSelectEnumSchemaSchema:it,TitledMultiSelectEnumSchemaSchema:ht,MultiSelectEnumSchemaSchema:kt,EnumSchemaSchema:Ct,PrimitiveSchemaDefinitionSchema:Wt,ElicitRequestFormParamsSchema:Yt,ResourceTemplateReferenceSchema:Xt,PromptReferenceSchema:Qt,RootSchema:co,ClientCapabilities2026Schema:uo,ServerCapabilities2026Schema:yr,RequestMetaEnvelopeSchema:vr,ToolSchema:er,ToolResultContentSchema:lo,SamplingMessageContentBlockSchema:br,SamplingMessageSchema:tr,ResultTypeSchema:zr,ResultMetaSchema:Rr,ResultSchema:po,PaginatedResultSchema:Vn,CallToolResultSchema:wr,ListToolsResultSchema:mo,ListPromptsResultSchema:fo,GetPromptResultSchema:ho,ListResourcesResultSchema:go,ListResourceTemplatesResultSchema:_o,ReadResourceResultSchema:So,CompleteResultSchema:yo,CacheableResultSchema:Fn,DiscoverResultSchema:vo,CreateMessageRequestParamsSchema:Ot,CreateMessageRequestSchema:bo,ListRootsRequestSchema:zo,CreateMessageResultSchema:Ro,ListRootsResultSchema:$o,ElicitResultSchema:wo,ElicitRequestURLParamsSchema:Po,ElicitRequestParamsSchema:Eo,ElicitRequestSchema:To,InputRequestSchema:ko,InputResponseSchema:Co,InputRequestsSchema:Io,InputResponsesSchema:Oo,InputRequiredResultSchema:rr,InputResponseRequestParamsSchema:Hn,CallToolRequestSchema:Bn,ListToolsRequestSchema:Kn,ListPromptsRequestSchema:Gn,GetPromptRequestSchema:Wn,ListResourcesRequestSchema:Yn,ListResourceTemplatesRequestSchema:Xn,ReadResourceRequestSchema:Qn,CompleteRequestSchema:es,DiscoverRequestSchema:ts,SubscriptionFilterSchema:Pr,SubscriptionsListenRequestSchema:rs,SubscriptionsListenResultMetaSchema:os,SubscriptionsListenResultSchema:Ao,dispatchRequestSchemas:Nt,dispatchResultSchemas:ns,NotificationMetaSchema:nr,SubscriptionsAcknowledgedNotificationSchema:Er,CancelledNotificationParamsSchema:Tr,CancelledNotificationSchema:kr,notificationSchemas2026:sc,JSONRPCResultResponseSchema:Ke(po),CallToolResultResponseSchema:Ke(W([wr,rr])),ListToolsResultResponseSchema:Ke(mo),ListPromptsResultResponseSchema:Ke(fo),GetPromptResultResponseSchema:Ke(W([ho,rr])),ListResourcesResultResponseSchema:Ke(go),ListResourceTemplatesResultResponseSchema:Ke(_o),ReadResourceResultResponseSchema:Ke(W([So,rr])),CompleteResultResponseSchema:Ke(yo),DiscoverResultResponseSchema:Ke(vo),SubscriptionsListenResultResponseSchema:Ke(Ao)}}var Gv;function Gt(){return Gv??=Kv()}var Wv=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Yv(e){return Wv.includes(e)}var ro=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ua(e,t){if(t===void 0)return e;let r=e[ro];if(r===void 0)return{...e,[ro]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[ro]:o}}function Xv(e){return e[ro]}function Il(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ol(e){return e==="public"||e==="private"}function Nl(e,t){if(e.ttlMs!==void 0&&!Il(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Ol(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var B=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({}),oe=class Cg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return oo(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Pl(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Ig(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new jl({supported:n.supported,requested:n.requested},r)}if(t===B.InvalidParams||t===B.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===B.ResourceNotFound||Object.keys(n).length===1))return new Va(n.uri,r)}if(t===B.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Fa({requiredCapabilities:n.requiredCapabilities},r)}return new Cg(t,r,o)}},Va=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(B.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Ig=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(B.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},jl=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(B.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Fa=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(B.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qv=0,eb="private",tb=["tools/call","prompts/get","resources/read"];function rb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||tb.includes(e))return t;throw new oe(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ob(e,t){let r=Xv(t);if(t.resultType!=="complete"||!Yv(e))return r===void 0?t:cb(t);let o=t,n=Il(o.ttlMs)?o.ttlMs:ib(r),s=Ol(o.cacheScope)?o.cacheScope:ab(r),i={...o,ttlMs:n,cacheScope:s};return delete i[ro],i}function nb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function sb(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[wt]:t}}:!nb(r)||r[wt]!==void 0?e:{...e,_meta:{...r,[wt]:t}}}function ib(e){return e!==void 0&&Il(e.ttlMs)?e.ttlMs:Qv}function ab(e){return e!==void 0&&Ol(e.cacheScope)?e.cacheScope:eb}function cb(e){let t={...e};return delete t[ro],t}var ub=["elicitation/create","sampling/createMessage","roots/list"],Aa;function Og(){if(Aa)return Aa;let e=Gt();return Aa={request:{"elicitation/create":P({method:O("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":P({method:O("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":P({method:O("roots/list"),params:re({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Aa}function Ng(e){return ub.includes(e)}function yl(e){return Ng(e)?Og().request[e]:void 0}function lb(e){return Ng(e)?Og().response[e]:void 0}var xl={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},jg={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function xg(e){return Object.prototype.hasOwnProperty.call(xl,e)}function Ag(e){return Object.prototype.hasOwnProperty.call(jg,e)}function db(e){return Object.prototype.hasOwnProperty.call(xl,e)}function pb(e){return xg(e)?Gt().dispatchRequestSchemas[e]:void 0}function mb(e){return db(e)?Gt().dispatchResultSchemas[e]:void 0}function fb(e){return Ag(e)?Gt().notificationSchemas2026[e]:void 0}var kw=Object.keys(xl),Cw=Object.keys(jg);function Nn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function In(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var hb={ok:!1,reason:"not-in-era"},gb=[mr,Pt];function _b(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>Nn(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!Nn(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(Nn(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Al={era:"2026-07-28",hasRequestMethod:xg,hasNotificationMethod:Ag,hasInputRequestMethod:e=>yl(e)!==void 0,validateRequest:(e,t)=>In(pb(e),t),validateResult:(e,t)=>In(mb(e),t),validateNotification:(e,t)=>In(fb(e),t),validateInputRequest:(e,t)=>In(yl(e),t),validateInputResponse:(e,t)=>In(lb(e),t),samplingResultVariant:()=>hb,outboundEnvelope(e){return{[mr]:e.protocolVersion,[Fr]:e.clientInfo,[Pt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Zt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of gb)o in e||t.push({key:o,problem:"missing"});let r=Gt().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>zg(e),inputRequestSchema:yl,decodeResult(e,t){if(!Nn(t))return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!="string")return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,c=Nn(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Gt().ResultMetaSchema.safeParse(t._meta),d=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof a!="string"?{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof a=="string"&&{requestState:a},...d!==void 0&&{_meta:d}}}if(r!=="complete")return{kind:"invalid",error:new ue(me.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=Sb(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return sb(ob(e,rb(e,_b(e,t))),r)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=Gt().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}},qa;function Sb(){if(qa)return qa;let e=Gt();return qa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},qa}var ql="2026-07-28";function no(e){return e!==void 0&&An(e)?Al:Cl}function lg(e){return e.revision!==void 0?no(e.revision).era:e.era==="modern"?Al.era:Cl.era}function vl(e){return qg.some(t=>t.hasRequestMethod(e))}function bl(e){return qg.some(t=>t.hasNotificationMethod(e))}function dg(e){return e==="tasks/get"||e==="tasks/cancel"}var qg=[Cl,Al];var yb=$d({AnnotationsSchema:()=>Et,AudioContentSchema:()=>Yr,BaseMetadataSchema:()=>$t,BaseRequestParamsSchema:()=>De,BlobResourceContentsSchema:()=>yn,BooleanSchemaSchema:()=>$n,CallToolRequestParamsSchema:()=>Bi,CallToolRequestSchema:()=>Ki,CallToolResultSchema:()=>Rn,CancelTaskRequestSchema:()=>ol,CancelTaskResultSchema:()=>nl,CancelledNotificationParamsSchema:()=>Ws,CancelledNotificationSchema:()=>mn,ClientCapabilitiesSchema:()=>ei,ClientNotificationSchema:()=>il,ClientRequestSchema:()=>sl,ClientResultSchema:()=>al,ClientTasksCapabilitySchema:()=>Xs,CompatibilityCallToolResultSchema:()=>Ju,CompleteRequestParamsSchema:()=>ba,CompleteRequestSchema:()=>za,CompleteResultSchema:()=>Ra,ContentBlockSchema:()=>Xr,CreateMessageRequestParamsSchema:()=>ia,CreateMessageRequestSchema:()=>aa,CreateMessageResultSchema:()=>ca,CreateMessageResultWithToolsSchema:()=>ua,CreateTaskResultSchema:()=>Gu,CursorSchema:()=>sn,DiscoverRequestSchema:()=>si,DiscoverResultSchema:()=>ii,ElicitRequestFormParamsSchema:()=>to,ElicitRequestParamsSchema:()=>fa,ElicitRequestSchema:()=>ha,ElicitRequestURLParamsSchema:()=>ma,ElicitResultSchema:()=>Sa,ElicitationCompleteNotificationParamsSchema:()=>ga,ElicitationCompleteNotificationSchema:()=>_a,EmbeddedResourceSchema:()=>Mi,EmptyResultSchema:()=>pn,EnumSchemaSchema:()=>pa,GetPromptRequestParamsSchema:()=>xi,GetPromptRequestSchema:()=>Ai,GetPromptResultSchema:()=>Zi,GetTaskPayloadRequestSchema:()=>Qu,GetTaskPayloadResultSchema:()=>el,GetTaskRequestSchema:()=>Yu,GetTaskResultSchema:()=>Xu,IconSchema:()=>Ys,IconsSchema:()=>Vt,ImageContentSchema:()=>Wr,ImplementationSchema:()=>Br,InitializeRequestParamsSchema:()=>ti,InitializeRequestSchema:()=>ri,InitializeResultSchema:()=>oi,InitializedNotificationSchema:()=>ni,JSONArraySchema:()=>Vu,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Jr,JSONRPCMessageSchema:()=>dn,JSONRPCNotificationSchema:()=>ln,JSONRPCRequestSchema:()=>un,JSONRPCResponseSchema:()=>Fu,JSONRPCResultResponseSchema:()=>Hr,JSONValueSchema:()=>Dt,LegacyTitledEnumSchemaSchema:()=>En,ListChangedOptionsBaseSchema:()=>Bu,ListPromptsRequestSchema:()=>Ni,ListPromptsResultSchema:()=>ji,ListResourceTemplatesRequestSchema:()=>mi,ListResourceTemplatesResultSchema:()=>fi,ListResourcesRequestSchema:()=>di,ListResourcesResultSchema:()=>pi,ListRootsRequestSchema:()=>wa,ListRootsResultSchema:()=>Pa,ListTasksRequestSchema:()=>tl,ListTasksResultSchema:()=>rl,ListToolsRequestSchema:()=>Hi,ListToolsResultSchema:()=>Ji,LoggingLevelSchema:()=>Bt,LoggingMessageNotificationParamsSchema:()=>Xi,LoggingMessageNotificationSchema:()=>Qi,ModelHintSchema:()=>ea,ModelPreferencesSchema:()=>ta,MultiSelectEnumSchemaSchema:()=>da,NotificationSchema:()=>Je,NotificationsParamsSchema:()=>He,NumberSchemaSchema:()=>eo,PaginatedRequestParamsSchema:()=>ui,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>Ht,PingRequestSchema:()=>hn,PrimitiveSchemaDefinitionSchema:()=>Cn,ProgressNotificationParamsSchema:()=>ci,ProgressNotificationSchema:()=>gn,ProgressSchema:()=>ai,ProgressTokenSchema:()=>nn,PromptArgumentSchema:()=>Ii,PromptListChangedNotificationSchema:()=>Ui,PromptMessageSchema:()=>Di,PromptReferenceSchema:()=>va,PromptSchema:()=>Oi,ReadResourceRequestParamsSchema:()=>hi,ReadResourceRequestSchema:()=>gi,ReadResourceResultSchema:()=>_i,RelatedTaskMetadataSchema:()=>Gs,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>an,RequestSchema:()=>Te,ResourceContentsSchema:()=>_n,ResourceLinkSchema:()=>Li,ResourceListChangedNotificationSchema:()=>Si,ResourceRequestParamsSchema:()=>Kr,ResourceSchema:()=>vn,ResourceTemplateReferenceSchema:()=>ya,ResourceTemplateSchema:()=>li,ResourceUpdatedNotificationParamsSchema:()=>ki,ResourceUpdatedNotificationSchema:()=>Ci,ResultMetaObjectSchema:()=>cn,ResultSchema:()=>ke,RoleSchema:()=>Jt,RootSchema:()=>$a,RootsListChangedNotificationSchema:()=>Ea,SamplingContentSchema:()=>na,SamplingMessageContentBlockSchema:()=>dr,SamplingMessageSchema:()=>sa,ServerCapabilitiesSchema:()=>fn,ServerNotificationSchema:()=>ul,ServerRequestSchema:()=>cl,ServerResultSchema:()=>ll,ServerTasksCapabilitySchema:()=>Qs,SetLevelRequestParamsSchema:()=>Wi,SetLevelRequestSchema:()=>Yi,SingleSelectEnumSchemaSchema:()=>la,StringSchemaSchema:()=>Qr,SubscribeRequestParamsSchema:()=>yi,SubscribeRequestSchema:()=>vi,SubscriptionFilterSchema:()=>bn,SubscriptionsAcknowledgedNotificationParamsSchema:()=>wi,SubscriptionsAcknowledgedNotificationSchema:()=>Pi,SubscriptionsListenRequestParamsSchema:()=>Ri,SubscriptionsListenRequestSchema:()=>$i,SubscriptionsListenResultMetaSchema:()=>Ei,SubscriptionsListenResultSchema:()=>Ti,TaskAugmentedRequestParamsSchema:()=>hr,TaskCreationParamsSchema:()=>Ku,TaskMetadataSchema:()=>Ks,TaskSchema:()=>Kt,TaskStatusNotificationParamsSchema:()=>ka,TaskStatusNotificationSchema:()=>Wu,TaskStatusSchema:()=>Ta,TextContentSchema:()=>Gr,TextResourceContentsSchema:()=>Sn,TitledMultiSelectEnumSchemaSchema:()=>kn,TitledSingleSelectEnumSchemaSchema:()=>Pn,ToolAnnotationsSchema:()=>Vi,ToolChoiceSchema:()=>ra,ToolExecutionSchema:()=>Fi,ToolListChangedNotificationSchema:()=>Gi,ToolResultContentSchema:()=>oa,ToolSchema:()=>zn,ToolUseContentSchema:()=>qi,UnsubscribeRequestParamsSchema:()=>bi,UnsubscribeRequestSchema:()=>zi,UntitledMultiSelectEnumSchemaSchema:()=>Tn,UntitledSingleSelectEnumSchemaSchema:()=>wn});var Ml=e=>un.safeParse(e).success,Ll=e=>ln.safeParse(e).success,Da=e=>Hr.safeParse(e).success,Dl=e=>Jr.safeParse(e).success;var Tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Zl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Ul(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var pg="x-mcp-header",vb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,bb=new Set(["string","integer","boolean","number"]);function Vl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(pg in a){if(!c||i.length===0)return`${Ma(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=a[pg];if(typeof d!="string"||d.length===0)return`${Ma(i)}: x-mcp-header MUST be a non-empty string`;if(!vb.test(d))return`${Ma(i)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof a.type=="string"?a.type:void 0;if(m===void 0||!bb.has(m))return`${Ma(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;let g=d.toLowerCase(),v=r.get(g);if(v!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${v}')`;r.set(g,d),t.push({path:i,headerName:d,type:m})}let u=a.properties;if(u!==null&&typeof u=="object")for(let[d,m]of Object.entries(u)){let g=o(m,[...i,d],c);if(g!==void 0)return g}for(let d of zb){let m=a[d];if(m===void 0)continue;let g=Array.isArray(m)?m:m!==null&&typeof m=="object"&&Rb.has(d)?Object.values(m):[m];for(let v of g){let p=o(v,[...i,`<${d}>`],!1);if(p!==void 0)return p}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var zb=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Rb=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Ma(e){return e.length===0?"<root>":e.join(".")}var La=-32020,Iw=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[B.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[La,B.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[B.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[B.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[B.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[La],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[B.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[La],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],$b={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[La]:400};function Ha(e,t){return Ds(e,t)}function On(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function so(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var mg=!1,$l="draft-2020-12";function _r(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:$l});else if(r.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");mg||(mg=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=Ms(e,{target:$l,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:Mg(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function Mg(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every(o=>o!==null&&typeof o=="object"&&(o.type==="object"||Mg(o)))}return!1}function wb(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function gr(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>wb(o)).join(", ")}:{success:!0,data:r.value}}function Pb(e){let t=Ms(e,{target:$l,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Eb=/\\\.\\d\{(\d+)\}/;function Tb(e){let t=Eb.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>Rt.datetime({local:o,offset:n,precision:s}))))}function kb(e,t){let r;switch(e){case"email":r=[qh()];break;case"uri":r=[Vs()];break;case"date":r=[Rt.date()];break;case"date-time":r=Tb(t);break}return new Set(r.map(o=>Pb(o)).filter(o=>o!==void 0))}function Cb(e,t,r){return r!=="zod"?!0:kb(e,t).has(t)}function Lg(e){let t=_r(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ib(e){try{return _r(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new oe(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Ob=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Fl(e){return Ob.has(e)||e.startsWith("x-")}var Nb=new Set(["$schema",...Object.keys(to.shape.requestedSchema.shape)]),fg={string:On([Qr,wn,Pn,En]),number:On([eo]),integer:On([eo]),boolean:On([$n]),array:On([Tn,kn])},jb=new Set(Qr.shape.format.unwrap().options);function xb(e,t,r,o){if(!xn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(fg,e.type)?fg[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Fl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?jb.has(e.format)?(typeof c!="string"||!Cb(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function Ab(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&xn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,xb(c,`properties.${i}`,t,o)])):Nb.has(n)?r[n]=s:Fl(n)||o.push(n);if(o.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function qb(e,t){if(!xn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Ha(Cn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function wl(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>wl(o,t[n],`${r}[${n}]`)):!xn(e)||!xn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?wl(n,t[o],s):Fl(o)?[]:[s]})}function Mb(e){if(!so(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=Ab(Ib(e.requestedSchema),t),o=Ha(to.shape.requestedSchema,r);if(!o.success)throw new oe(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${qb(r,o.error.message)}`);let n=wl(r,o.data);if(n.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Lb(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Db=Object.assign(Lb,{elicit(e){try{return{method:"elicitation/create",params:Mb(e)}}catch(t){throw t instanceof oe?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Dg=250;function Zg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Ug(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Vg(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var Zb=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Ub={IdJagTokenExchangeResponseSchema:fl,OAuthClientInformationFullSchema:gl,OAuthClientInformationSchema:Na,OAuthClientMetadataSchema:Oa,OAuthClientRegistrationErrorSchema:_l,OAuthErrorResponseSchema:hl,OAuthMetadataSchema:Ca,OAuthProtectedResourceMetadataSchema:dl,OAuthTokenRevocationRequestSchema:Sl,OAuthTokensSchema:ml,OpenIdProviderDiscoveryMetadataSchema:pl,OpenIdProviderMetadataSchema:Ia},Fg={},Hg={};function Jg(e,t){let r=e.slice(0,-6);Fg[r]=t,Hg[r]=o=>t.safeParse(o).success}for(let e of Zb)Jg(e,yb[e]);for(let[e,t]of Object.entries(Ub))Jg(e,t);var Vb=Object.freeze(Fg),Fb=Object.freeze(Hg);function Hb(e){switch(e){case"initialize":case"notifications/initialized":return no(void 0);case"server/discover":return no(ql);default:return}}var Bg=6e4,Jb=[mr,Fr,Pt,Zt],Bb=["inputResponses","requestState"];function hg(e,t){let r=e.params;if(!jn(r))return{message:e,lifted:{}};let o=r._meta,n=jn(o)?Jb.filter(a=>a in o):[],s=t==="request"?Bb.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&jn(o)){let a={},u={...o};for(let d of n)a[d]=o[d],delete u[d];i.envelope=a,Object.keys(u).length>0?c._meta=u:delete c._meta}for(let a of s)a==="inputResponses"&&(i.inputResponses=c[a]),a==="requestState"&&(i.requestState=c[a]),delete c[a];return{message:{...e,params:c},lifted:i}}function gg(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function qn(e){return()=>e}var Kb=qn(void 0);function Hl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:qn(t)}}}var Gb;var Jl=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Gb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Js,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(me.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),Da(n)||Dl(n)?this._onresponse(n):Ml(n)?this._onrequest(n,s):Ll(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=hg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=lg(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(bl(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=hg(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(_,h,f)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:_,message:h,...f!==void 0&&{data:f}}};s?.send(z).catch(y=>this._onerror(new Error(`Failed to send an error response: ${y}`)))};if(t?.classification!==void 0){let _=lg(t.classification);if(_!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${_} but this instance serves ${n.era}`));let h=t.classification.revision??_;i(B.UnsupportedProtocolVersion,`Unsupported protocol version: ${h}`,{supported:this._supportedProtocolVersions,requested:h});return}}if(vl(r.method)&&!n.hasRequestMethod(r.method)&&!(dg(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(B.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(B.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(B.InvalidParams,a);return}let u=(_,h)=>this._notificationViaCodec(this._resolveOutboundCodec(_.method),_,{...h,relatedRequestId:r.id}),d=(_,h,f)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(_.method),_,h,{...f,relatedRequestId:r.id}),m=new AbortController;this._requestHandlerAbortControllers.set(r.id,m);let g=o.inputResponses===void 0?void 0:Wb(o.inputResponses),v={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...g!==void 0&&{inputResponses:g.accepted},...g!==void 0&&g.droppedKeys.length>0&&{droppedInputResponseKeys:g.droppedKeys},requestState:o.requestState===void 0?Kb:qn(o.requestState),signal:m.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),so(h))return d(_,h,f);let y=gg(z,_.method);if(y===void 0)throw new TypeError(`'${_.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(_,y,h)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},p=this.buildContext(v,t);Promise.resolve().then(()=>c(r,p)).then(async _=>{if(m.signal.aborted)return;let h;try{h=n.encodeResult(r.method,_,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),i(B.InternalError,"Internal error");return}let f={result:h,jsonrpc:"2.0",id:r.id};await s?.send(f)},async _=>{if(m.signal.aborted)return;let h=Number.isSafeInteger(_.code)?_.code:B.InternalError,f={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(h),message:_.message??"Internal error",..._.data!==void 0&&{data:_.data}}};await s?.send(f)}).catch(_=>this._onerror(new Error(`Failed to send response: ${_}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===m&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Da(e)?r(e):r(oe.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(so(t))return dg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=gg(o,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return no(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Hb(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(vl(t)&&!e.hasRequestMethod(t))throw new ue(me.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=o??{},a=Date.now(),u,d;return new Promise((m,g)=>{let v=b=>{g(b)};if(!this._transport){v(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(b){v(b);return}if(o?.signal?.aborted){let b=o.signal.reason;throw b instanceof ue?b:new ue(me.RequestTimeout,String(b))}let p=e.era===ql&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,_=this._requestMessageId++;d=_;let h={...t,jsonrpc:"2.0",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),h.params={...t.params,_meta:{...t.params?._meta,progressToken:_}});let f=this._envelopeOutbound(h),z=!1,y=b=>{z||(this._progressHandlers.delete(_),p===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(b)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`))):p.abort(),g(b instanceof ue?b:new ue(me.RequestTimeout,String(b))))};this._responseHandlers.set(_,b=>{if(o?.signal?.aborted)return;if(z=!0,b instanceof Error)return g(b);let S;try{S=e.decodeResult(t.method,b.result)}catch(j){return g(j instanceof Error?j:new Error(String(j)))}if(S.kind==="invalid")return g(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return m(Yb(S));let j={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(F,M)=>this._requestWithSchemaViaCodec(e,F===void 0?{method:t.method}:{method:t.method,params:F},r,M)};return m(this._resolveNonCompleteResult(S,j))}let E=S.result;gr(r,E).then(j=>{j.success?m(j.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${j.error}`))},g)}),u=()=>y(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??Bg,w=()=>y(new ue(me.RequestTimeout,"Request timed out",{timeout:R}));this._setupTimeout(_,R,o?.maxTotalTimeout,w,o?.resetTimeoutOnProgress??!1),this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:p?.signal}).catch(b=>{this._progressHandlers.delete(_),g(b)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),d!==void 0&&(this._responseHandlers.delete(d),this._cleanupTimeout(d))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(me.NotConnected,"Not connected");if(bl(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(me.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!vl(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(r)o=async(n,s)=>{let i=await gr(t.params,{...n.params});if(!i.success)throw new oe(B.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t=="function"){if(!bl(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await gr(t.params,{...o.params});if(!n.success)throw new oe(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function jn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Bl(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=jn(i)&&jn(s)?{...i,...s}:s}return r}function _g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wb(e){let t={},r=[];if(!_g(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!_g(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Yb(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Xb=U((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var a=typeof c=="object"?s(c):c;if(typeof a!="string")throw new TypeError("argument string is required to be a string");var u=a.indexOf(";"),d=u!==-1?a.slice(0,u).trim():a.trim();if(!o.test(d))throw new TypeError("invalid media type");var m=new i(d.toLowerCase());if(u!==-1){var g,v,p;for(t.lastIndex=u;v=t.exec(a);){if(v.index!==u)throw new TypeError("invalid parameter format");u+=v[0].length,g=v[1].toLowerCase(),p=v[2],p.charCodeAt(0)===34&&(p=p.slice(1,-1),p.indexOf("\\")!==-1&&(p=p.replace(r,"$1"))),m.parameters[g]=p}if(u!==a.length)throw new TypeError("invalid parameter format")}return m}function s(c){var a;if(typeof c.getHeader=="function"?a=c.getHeader("content-type"):typeof c.headers=="object"&&(a=c.headers&&c.headers["content-type"]),typeof a!="string")throw new TypeError("content-type header is missing from object");return a}function i(c){this.parameters=Object.create(null),this.type=c}})),Ow=is(Xb(),1);var Kg=10*1024*1024,Kl=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??Kg}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
|
|
59
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}c.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Bf(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;Bf(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Kf=new Set(["type","properties","required","additionalProperties"]),Hf=["oneOf","anyOf"];function Jf(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function cu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!Kf.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let c=[];for(let u of t){let d=u.properties?.[i]??Jf(u);d!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:cu(c)??{allOf:c};Ye(r,i,a)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(s=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let c=Jf(i);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?n.additionalProperties=s[0]:s.length>1&&(n.additionalProperties={allOf:s})}return n}function Sy(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Kf)if(n in e)return;let r=t.filter(n=>Hf.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=cu(t);else{let n=r[0],s=Hf.find(a=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let i=t.filter(a=>a!==n),c=n[s].map(a=>cu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Jo(e,o))}function Wo(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,d={...u},m=a.ref;if(a.ref=null,m){o(m);let v=e.seen.get(m),p=v.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Jo(u,p),Jo(u,d),c._zod.parent===m)for(let h in u)h==="$ref"||h==="allOf"||h in d||delete u[h];if(p.$ref&&v.def)for(let h in u)h==="$ref"||h==="allOf"||h in v.def&&JSON.stringify(u[h])===JSON.stringify(v.def[h])&&delete u[h]}let g=c._zod.parent;if(g&&g!==m){o(g);let v=e.seen.get(g);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(let p in u)p==="$ref"||p==="allOf"||p in v.def&&JSON.stringify(u[p])===JSON.stringify(v.def[p])&&delete u[p]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Bf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let m=c.get(d);m?m.push(u):c.set(d,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Sy(u)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Jo(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,Ye(i,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bo(t,"input",e.processors),output:Bo(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ge(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ge(o.element,r);if(o.type==="set")return Ge(o.valueType,r);if(o.type==="lazy")return Ge(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Ge(o.innerType,r);if(o.type==="intersection")return Ge(o.left,r)||Ge(o.right,r);if(o.type==="record"||o.type==="map")return Ge(o.keyType,r)||Ge(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ge(o.in,r)||Ge(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ge(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ge(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ge(n,r))return!0;return!!(o.rest&&Ge(o.rest,r))}return!1}var Gf=(e,t={})=>r=>{let o=Ko({...r,processors:t});return ve(e,o),Go(o,e),Wo(o,e)},Bo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Ko({...n??{},target:s,io:t,processors:r});return ve(e,i),Go(i,e),Wo(i,e)};var Zr=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Ur=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Wf=(e,t)=>{Zr(e,"minimum",t),Ur(e,"maximum",t)},th=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},rh=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},oh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},nh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Yf=(e,t)=>Zr(e,"minimum",t.minimum),Xf=(e,t)=>Ur(e,"maximum",t.maximum),Qf=e=>(t,r)=>{nh(t,r.format);let[o,n]=e[r.format];Zr(t,"minimum",o),Ur(t,"maximum",n)},yy={greater_than:(e,t)=>Zr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ur(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>th(e,t.value),number_format:Qf(Mo),bigint_format:Qf(ls),min_length:Yf,max_length:Xf,length_equals:(e,t)=>Wf(e,t.length),min_size:Yf,max_size:Xf,size_equals:(e,t)=>Wf(e,t.size),string_format:(e,t)=>{nh(e,t.format),t.pattern&&rh(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>oh(e,t.mime)};function xe(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)yy[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Zr(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Zr(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Ur(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Ur(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&th(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&oh(t,n.mime);for(let s of n.patterns??[])rh(t,s);return t}var vy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},by=new Map([[Lc,hp],[ws,gp]]),sh=e=>by.get(e)??e,du=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:d}=xe(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=vy[c]??c,n.format===""&&delete n.format,(c==="time"||d)&&delete n.format),u&&(n.contentEncoding=u),a&&a.size>0){let m=[...a].map(sh);m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},pu=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:d}=xe(e);n.type=d?"integer":"number";let m=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),g=typeof a=="number"&&a<=(i??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(m?v?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),g?v?(n.maximum=a,n.exclusiveMaximum=!0):n.exclusiveMaximum=a:typeof i=="number"&&(n.maximum=i),c){let p=new Set;for(let f of c)Number.isFinite(f)&&f!==0?p.add(Math.abs(f)):qe(e,t,n,o,`A multipleOf divisor of ${f} cannot be represented in JSON Schema`);let[_,...h]=p;_!==void 0&&(n.multipleOf=_),h.length&&(n.allOf=[...n.allOf??[],...h.map(f=>({multipleOf:f}))])}},mu=(e,t,r,o)=>{r.type="boolean"},fu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},ih=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},hu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ah=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},ch=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},gu=(e,t,r,o)=>{r.not={}},_u=(e,t,r,o)=>{},Su=(e,t,r,o)=>{},yu=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{let n=e._zod.def,s=Ir(n.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},bu=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(qe(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(qe(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},uh=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},lh=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},dh=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=xe(e);s!==void 0&&(n.minLength=s),i!==void 0&&(n.maxLength=i),c&&(c.length===0?n.not={}:c.length===1?n.contentMediaType=c[0]:n.anyOf=c.map(a=>({contentMediaType:a})))},ph=(e,t,r,o)=>{r.type="boolean"},zu=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},mh=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},fh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},hh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},$u=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=xe(e);typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=ve(s.element,t,{...o,path:[...o.path,"items"]})};function Yo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Yo(t.out):t.type==="catch"?Yo(t.innerType):e._zod.optin}var wu=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&qe(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)Ye(n.properties,u,ve(i[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(i)){let d=s.shape[u];(t.io==="input"?Yo(d)===void 0:d._zod.optout===void 0)&&a.push(u)}a.length>0&&(n.required=a),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=ve(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Pu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,a)=>ve(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",a]}));s?r.oneOf=i:r.anyOf=i},Eu=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=ve(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)},gh=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((_,h)=>ve(_,t,{...o,path:[...o.path,i,h]})),u=s.rest?ve(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,d=s.items.length;for(;d>0;){let _=s.items[d-1];if(!(t.io==="input"?Yo(_)!==void 0:_._zod.optout==="optional"))break;d--}let m=s.items.length,g=!s.rest;t.target==="draft-2020-12"?(n.prefixItems=a,g?n.items=!1:u&&(n.items=u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):t.target==="openapi-3.0"?(n.items={anyOf:a},u&&n.items.anyOf.push(u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):(n.items=a,g?n.additionalItems=!1:u&&(n.additionalItems=u),d>0&&(n.minItems=d),g&&(n.maxItems=m));let{minimum:v,maximum:p}=xe(e);typeof v=="number"&&(n.minItems=v),typeof p=="number"&&(n.maxItems=p)};function uu(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let p=e.get(t)?.def;if(!p)return t;let _=uu(e,p,r);return _===p?t:_}for(let p of["anyOf","oneOf"]){let _=t[p];if(!Array.isArray(_))continue;let h=_.map(f=>uu(e,f,r));h.some((f,z)=>f!==_[z])&&(t={...t,[p]:h})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(p=>p==="number"||p==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(p=>typeof p=="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:d,format:m,id:g,...v}=t;return v.enum?v.enum=v.enum.map(p=>typeof p=="number"?String(p):p):typeof v.const=="number"&&(v.const=String(v.const)),n&&(v.type="string",s||(v.pattern=(o.includes("number")?Zo:Nc).source)),v}var lu=new WeakMap;function zy(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of lu.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=uu(t,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);s&&(n.propertyNames=s)}}var Tu=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=xe(i).patterns;if(s.mode==="loose"&&c&&c.size>0){let d=ve(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let m of c)Ye(n.patternProperties,sh(m).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=ve(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let d=lu.get(t);d||(d=[],lu.set(t,d),t.deferred.push(()=>zy(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&Yo(s.valueType)!==void 0;if(a&&!s.partial&&!u){let d=[...a].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(n.required=d.map(String))}},ku=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Cu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Iu=Symbol();function _h(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(s=!0,null));return s?(qe(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Iu):JSON.parse(i)}var Ou=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=_h(n.defaultValue,e,t,r,o);i!==Iu&&(r.default=i)},Nu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=_h(n.defaultValue,e,t,r,o);i!==Iu&&(r._prefault=i)},ju=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{qe(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},xu=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;ve(i,t,o);let c=t.seen.get(e);c.ref=i},Au=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Sh=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},eh={string:du,number:pu,boolean:mu,bigint:fu,symbol:ih,null:hu,undefined:ah,void:ch,never:gu,any:_u,unknown:Su,date:yu,enum:vu,literal:bu,nan:uh,template_literal:lh,file:dh,success:ph,custom:zu,function:mh,transform:Ru,map:fh,set:hh,array:$u,object:wu,union:Pu,intersection:Eu,tuple:gh,record:Tu,nullable:ku,nonoptional:Cu,default:Ou,prefault:Nu,catch:ju,pipe:xu,readonly:Au,promise:Sh,optional:qs,lazy:qu};function Ms(e,t){if("_idmap"in e){let o=e,n=Ko({...t,processors:eh}),s={};for(let a of o._idmap.entries()){let[u,d]=a;ve(d,n)}let i={},c={registry:o,uri:t?.uri,defs:s};n.external=c;for(let a of o._idmap.entries()){let[u,d]=a;Go(n,d),Ye(i,u,Wo(n,d))}if(Object.keys(s).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:s}}return{schemas:i}}let r=Ko({...t,processors:eh});return ve(e,r),Go(r,e),Wo(r,e)}var yh=new WeakSet([Object.prototype,Error.prototype]);function Ls(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Iy=(e,t)=>{Fd.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);yh.has(r)||(yh.add(r),Ls(r,"format",o=>n=>Tc(o,n)),Ls(r,"flatten",o=>n=>Ec(o,n)),Ls(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Or,2)}),Ls(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Or,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var rt=q("ZodError",Iy,void 0,{Parent:Error});var vh=hs(rt),bh=gs(rt),Ds=_s(rt),zh=Ss(rt),Rh=Jd(rt),$h=Bd(rt),wh=Kd(rt),Ph=Gd(rt),Eh=Wd(rt),Th=Yd(rt),kh=Xd(rt),Ch=Qd(rt);function Ny(){Xe.localeError||Qe(nf())}function Us(){Xe.memoizer||Qe({memoizer:Bc()})}var ye=q("ZodType",(e,t)=>(Ny(),Se.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ae.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return st(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(vv(e,t))},superRefine(e,t){return this.check(bv(e,t))},overwrite(e){return this.check(Mt(e))},optional(){return X(this)},exactOptional(){return iv(this)},nullable(){return Nh(this)},nullish(){return X(Nh(this))},nonoptional(e){return pv(this,e)},array(){return I(this)},or(e){return W([this,e])},and(e){return zt(this,e)},transform(e){return jh(this,Fh(e))},default(e){return uv(this,e)},prefault(e){return dv(this,e)},catch(e){return fv(this,e)},pipe(e){return jh(this,e)},readonly(){return _v(this)},describe(e){let t=this.clone();return qt.add(t,{description:e}),t},meta(...e){if(e.length===0)return qt.get(this);let t=this.clone();return qt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ae.hide(this,"~standard",{...Mc(this),jsonSchema:{input:Bo(this,"input"),output:Bo(this,"output")}})},set"~standard"(e){ae.own(this,"~standard",e)},parse:function e(t,r){return vh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await bh(this,t,r,{callee:e})},safeParse(e,t){return Ds(this,e,t)},async safeParseAsync(e,t){return zh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ae.own(this,"spa",e)},validate(e,t){return kc(this,e,t)},validateAsync(e,t){return Cc(this,e,t)},encode:function e(t,r){return Rh(this,t,r,{callee:e})},decode:function e(t,r){return $h(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await wh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Ph(this,t,r,{callee:e})},safeEncode(e,t){return Eh(this,e,t)},safeDecode(e,t){return Th(this,e,t)},async safeEncodeAsync(e,t){return kh(this,e,t)},async safeDecodeAsync(e,t){return Ch(this,e,t)},toJSONSchema(e){return Gf(this,{})(e)},get description(){return qt.get(this)?.description},get _def(){return this._zod.def}}),xh=q("_ZodString",(e,t)=>{$s.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n)},ae.derived({format:e=>xe(e).format??null,minLength:e=>xe(e).minimum??null,maxLength:e=>xe(e).maximum??null},{regex(...e){return this.check(Yc(...e))},includes(...e){return this.check(eu(...e))},startsWith(...e){return this.check(tu(...e))},endsWith(...e){return this.check(ru(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(xs(...e))},length(...e){return this.check(As(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(Xc(e))},uppercase(e){return this.check(Qc(e))},trim(){return this.check(nu())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(su())},toUpperCase(){return this.check(iu())},slugify(){return this.check(au())}})),Lu=q("ZodString",(e,t)=>{$s.init(e,t),xh.init(e,t)},{email(e){return this.check(Gc(Ah,e))},url(e){return this.check(Wc(Mh,e))},jwt(e){return this.check(kf(Gy,e))},emoji(e){return this.check(hf(xy,e))},guid(e){return this.check(lf(jy,e))},uuid(e){return this.check(df(Zs,e))},uuidv4(e){return this.check(pf(Zs,e))},uuidv6(e){return this.check(mf(Zs,e))},uuidv7(e){return this.check(ff(Zs,e))},nanoid(e){return this.check(gf(Ay,e))},cuid(e){return this.check(_f(qy,e))},cuid2(e){return this.check(Sf(My,e))},ulid(e){return this.check(yf(Ly,e))},base64(e){return this.check(Pf(Jy,e))},base64url(e){return this.check(Ef(By,e))},xid(e){return this.check(vf(Dy,e))},ksuid(e){return this.check(bf(Zy,e))},ipv4(e){return this.check(zf(Uy,e))},ipv6(e){return this.check(Rf(Vy,e))},cidrv4(e){return this.check($f(Fy,e))},cidrv6(e){return this.check(wf(Hy,e))},e164(e){return this.check(Tf(Ky,e))},datetime(e){return this.check(Is(Xo,e))},date(e){return this.check(Os(Qo,e))},time(e){return this.check(Ns(en,e))},duration(e){return this.check(js(tn,e))}});function l(e){return cf(Lu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),xh.init(e,t)}),Xo=q("ZodISODateTime",(e,t)=>{mm.init(e,t),Pe.init(e,t)}),Qo=q("ZodISODate",(e,t)=>{fm.init(e,t),Pe.init(e,t)}),en=q("ZodISOTime",(e,t)=>{hm.init(e,t),Pe.init(e,t)}),tn=q("ZodISODuration",(e,t)=>{gm.init(e,t),Pe.init(e,t)}),Ah=q("ZodEmail",(e,t)=>{rm.init(e,t),Pe.init(e,t)});function qh(e){return Gc(Ah,e)}var jy=q("ZodGUID",(e,t)=>{em.init(e,t),Pe.init(e,t)});var Zs=q("ZodUUID",(e,t)=>{tm.init(e,t),Pe.init(e,t)});var Mh=q("ZodURL",(e,t)=>{sm.init(e,t),Pe.init(e,t)});function Vs(e){return Wc(Mh,e)}var xy=q("ZodEmoji",(e,t)=>{im.init(e,t),Pe.init(e,t)});var Ay=q("ZodNanoID",(e,t)=>{am.init(e,t),Pe.init(e,t)});var qy=q("ZodCUID",(e,t)=>{cm.init(e,t),Pe.init(e,t)});var My=q("ZodCUID2",(e,t)=>{um.init(e,t),Pe.init(e,t)});var Ly=q("ZodULID",(e,t)=>{lm.init(e,t),Pe.init(e,t)});var Dy=q("ZodXID",(e,t)=>{dm.init(e,t),Pe.init(e,t)});var Zy=q("ZodKSUID",(e,t)=>{pm.init(e,t),Pe.init(e,t)});var Uy=q("ZodIPv4",(e,t)=>{_m.init(e,t),Pe.init(e,t)});var Vy=q("ZodIPv6",(e,t)=>{ym.init(e,t),Pe.init(e,t)});var Fy=q("ZodCIDRv4",(e,t)=>{vm.init(e,t),Pe.init(e,t)});var Hy=q("ZodCIDRv6",(e,t)=>{bm.init(e,t),Pe.init(e,t)});var Jy=q("ZodBase64",(e,t)=>{Rm.init(e,t),Pe.init(e,t)});var By=q("ZodBase64URL",(e,t)=>{$m.init(e,t),Pe.init(e,t)});var Ky=q("ZodE164",(e,t)=>{wm.init(e,t),Pe.init(e,t)});var Gy=q("ZodJWT",(e,t)=>{Pm.init(e,t),Pe.init(e,t)});var Fs=q("ZodNumber",(e,t)=>{Dc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.isFinite=!0},ae.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=xe(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=xe(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=xe(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>xe(e).format??null},{gt(e,t){return this.check(Lr(e,t))},gte(e,t){return this.check(bt(e,t))},min(e,t){return this.check(bt(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(vt(e,t))},max(e,t){return this.check(vt(e,t))},int(e){return this.check(Ih(e))},safe(e){return this.check(Ih(e))},positive(e){return this.check(Lr(0,e))},nonnegative(e){return this.check(bt(0,e))},negative(e){return this.check(Mr(0,e))},nonpositive(e){return this.check(vt(0,e))},multipleOf(e,t){return this.check(Ho(e,t))},step(e,t){return this.check(Ho(e,t))},finite(){return this}}));function L(e){return Cf(Fs,e)}var Wy=q("ZodNumberFormat",(e,t)=>{Em.init(e,t),Fs.init(e,t)});function Ih(e){return Of(Wy,e)}var Du=q("ZodBoolean",(e,t)=>{Tm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mu(e,r,o,n)});function H(e){return Nf(Du,e)}var Lh=q("ZodBigInt",(e,t)=>{km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fu(e,r,o,n)},ae.derived({minValue:e=>xe(e).minimum??null,maxValue:e=>xe(e).maximum??null,format:e=>xe(e).format??null},{gte(e,t){return this.check(bt(e,t))},min(e,t){return this.check(bt(e,t))},gt(e,t){return this.check(Lr(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(vt(e,t))},max(e,t){return this.check(vt(e,t))},positive(e){return this.check(Lr(BigInt(0),e))},negative(e){return this.check(Mr(BigInt(0),e))},nonpositive(e){return this.check(vt(BigInt(0),e))},nonnegative(e){return this.check(bt(BigInt(0),e))},multipleOf(e,t){return this.check(Ho(e,t))}}));var Yy=q("ZodNull",(e,t)=>{Cm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n)});function ur(e){return Af(Yy,e)}var Xy=q("ZodAny",(e,t)=>{Im.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n)});function Dh(){return qf(Xy)}var Qy=q("ZodUnknown",(e,t)=>{Om.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function Q(){return Mf(Qy)}var ev=q("ZodNever",(e,t)=>{Nm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)});function Zh(e){return Lf(ev,e)}var Uh=q("ZodDate",(e,t)=>{jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n),e.min=(r,o)=>e.check(bt(r,o)),e.max=(r,o)=>e.check(vt(r,o))},ae.derived({minDate:e=>{let{minimum:t}=xe(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=xe(e);return t?new Date(t):null}},{}));var tv=q("ZodArray",(e,t)=>{Us(),xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Dr(e,t))},nonempty(e){return this.check(Dr(1,e))},max(e,t){return this.check(xs(e,t))},length(e,t){return this.check(As(e,t))},unwrap(){return this.element}});function I(e,t){return Zf(tv,e,t)}var Zu=q("ZodObject",(e,t)=>{Us(),Mm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n),ae.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ce(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ae.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},loose(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},strict(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Zh()}))},strip(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ae.extend(this,e)},safeExtend(e){return ae.safeExtend(this,e)},merge(e){return ae.merge(this,e)},pick(e){return ae.pick(this,e)},omit(e){return ae.omit(this,e)},partial(...e){return ae.partial(Hh,this,e[0])},exactPartial(...e){return ae.partial(Jh,this,e[0],"exactPartial")},required(...e){return ae.required(Bh,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ae.normalizeParams(t)};return new Zu(r)}function Me(e,t){return new Zu({type:"object",shape:e,catchall:Zh(),...ae.normalizeParams(t)})}function re(e,t){return new Zu({type:"object",shape:e,catchall:Q(),...ae.normalizeParams(t)})}var Vh=q("ZodUnion",(e,t)=>{Zc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n),e.options=t.options});function W(e,t){return new Vh({type:"union",options:e,...ae.normalizeParams(t)})}var rv=q("ZodDiscriminatedUnion",(e,t)=>{Vh.init(e,t),Lm.init(e,t)});function Lt(e,t,r){return new rv({type:"union",options:t,discriminator:e,...ae.normalizeParams(r)})}var ov=q("ZodIntersection",(e,t)=>{Dm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function zt(e,t){return new ov({type:"intersection",left:e,right:t})}var Oh=q("ZodRecord",(e,t)=>{Us(),Zm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new Oh({type:"record",keyType:l(),valueType:e,...ae.normalizeParams(t)}):new Oh({type:"record",keyType:e,valueType:t,...ae.normalizeParams(r)})}var Mu=q("ZodEnum",(e,t)=>{Um.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>vu(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})}});function ce(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Mu({type:"enum",entries:r,...ae.normalizeParams(t)})}var nv=q("ZodLiteral",(e,t)=>{Vm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function O(e,t){return new nv({type:"literal",values:Array.isArray(e)?e:[e],...ae.normalizeParams(t)})}var sv=q("ZodTransform",(e,t)=>{Us(),Fm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ar(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ae.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ae.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function Fh(e){return new sv({type:"transform",transform:e})}var Hh=q("ZodOptional",(e,t)=>{Uc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Hh({type:"optional",innerType:e})}var Jh=q("ZodExactOptional",(e,t)=>{Hm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function iv(e){return new Jh({type:"optional",innerType:e})}var av=q("ZodNullable",(e,t)=>{Jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Nh(e){return new av({type:"nullable",innerType:e})}var cv=q("ZodDefault",(e,t)=>{Bm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uv(e,t){return new cv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var lv=q("ZodPrefault",(e,t)=>{Km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function dv(e,t){return new lv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var Bh=q("ZodNonOptional",(e,t)=>{Gm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function pv(e,t){return new Bh({type:"nonoptional",innerType:e,...ae.normalizeParams(t)})}var mv=q("ZodCatch",(e,t)=>{Wm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fv(e,t){return new mv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ae.constantCatch(t)})}var Kh=q("ZodPipe",(e,t)=>{Vc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.in=t.in,e.out=t.out});function jh(e,t){return new Kh({type:"pipe",in:e,out:t})}var hv=q("ZodPreprocess",(e,t)=>{Kh.init(e,t),Ym.init(e,t)}),gv=q("ZodReadonly",(e,t)=>{Xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _v(e){return new gv({type:"readonly",innerType:e})}var Sv=q("ZodLazy",(e,t)=>{Qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function rn(e){return new Sv({type:"lazy",getter:e})}var yv=q("ZodCustom",(e,t)=>{ef.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function vv(e,t={}){return Uf(yv,e,t)}function bv(e,t){return Vf(e,t)}function lr(e,t){return new hv({type:"pipe",in:Fh(e),out:t})}var Wh={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Gh;Gh||(Gh={});var Rt={};ic(Rt,{ZodISODate:()=>Qo,ZodISODateTime:()=>Xo,ZodISODuration:()=>tn,ZodISOTime:()=>en,date:()=>$v,datetime:()=>Rv,duration:()=>Pv,time:()=>wv});function Rv(e){return Is(Xo,e)}function $v(e){return Os(Qo,e)}function wv(e){return Ns(en,e)}function Pv(e){return js(tn,e)}var Hs={};ic(Hs,{bigint:()=>Cv,boolean:()=>kv,date:()=>Iv,number:()=>Tv,string:()=>Ev});function Ev(e){return uf(Lu,e)}function Tv(e){return If(Fs,e)}function kv(e){return jf(Du,e)}function Cv(e){return xf(Lh,e)}function Iv(e){return Df(Uh,e)}var pr="2025-11-25";var Js=[pr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Bs="io.modelcontextprotocol/related-task",mr="io.modelcontextprotocol/protocolVersion",Fr="io.modelcontextprotocol/clientInfo",wt="io.modelcontextprotocol/serverInfo",Pt="io.modelcontextprotocol/clientCapabilities",on="io.modelcontextprotocol/subscriptionId",Zt="io.modelcontextprotocol/logLevel";var fr="2.0";var Dt=rn(()=>W([l(),L(),H(),ur(),K(l(),Dt),I(Dt)])),Ee=K(l(),Dt),Vu=I(Dt),nn=W([l(),L().int()]),sn=l(),Ks=P({ttl:L().optional()}),Gs=P({taskId:l()}),an=re({progressToken:nn.optional(),[Bs]:Gs.optional()}),De=P({_meta:an.optional()}),hr=De.extend({task:Ks.optional()}),Te=P({method:l(),params:De.loose().optional()}),He=P({_meta:an.optional()}),Je=P({method:l(),params:He.loose().optional()}),cn=re({get[wt](){return Br.optional().catch(void 0)}}),ke=re({_meta:cn.optional()}),Ut=W([l(),L().int()]),un=P({jsonrpc:O(fr),id:Ut,...Te.shape}).strict(),ln=P({jsonrpc:O(fr),...Je.shape}).strict(),Hr=P({jsonrpc:O(fr),id:Ut,result:ke}).strict(),Jr=P({jsonrpc:O(fr),id:Ut.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),dn=W([un,ln,Hr,Jr]),Fu=W([Hr,Jr]),pn=ke.strict(),Ws=He.extend({requestId:Ut.optional(),reason:l().optional()}),mn=Je.extend({method:O("notifications/cancelled"),params:Ws}),Ys=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),Vt=P({icons:I(Ys).optional()}),$t=P({name:l(),title:l().optional()}),Br=$t.extend({...$t.shape,...Vt.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Nv=zt(P({applyDefaults:H().optional()}),Ee),jv=lr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zt(P({form:Nv.optional(),url:Ee.optional()}),Ee.optional())),Xs=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({sampling:re({createMessage:Ee.optional()}).optional(),elicitation:re({create:Ee.optional()}).optional()}).optional()}),Qs=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({tools:re({call:Ee.optional()}).optional()}).optional()}),ei=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:jv.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:Xs.optional(),extensions:K(l(),Ee).optional()}),ti=De.extend({protocolVersion:l(),capabilities:ei,clientInfo:Br}),ri=Te.extend({method:O("initialize"),params:ti}),fn=P({experimental:K(l(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:Qs.optional(),extensions:K(l(),Ee).optional()}),oi=ke.extend({protocolVersion:l(),capabilities:fn,serverInfo:Br,instructions:l().optional()}),ni=Je.extend({method:O("notifications/initialized"),params:He.optional()}),si=Te.extend({method:O("server/discover"),params:De.optional()}),ii=ke.extend({supportedVersions:I(l()),capabilities:fn,instructions:l().optional()}),hn=Te.extend({method:O("ping"),params:De.optional()}),ai=P({progress:L(),total:X(L()),message:X(l())}),ci=P({...He.shape,...ai.shape,progressToken:nn}),gn=Je.extend({method:O("notifications/progress"),params:ci}),ui=De.extend({cursor:sn.optional()}),Ft=Te.extend({params:ui.optional()}),Ht=ke.extend({nextCursor:sn.optional()}),_n=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),Sn=_n.extend({text:l()}),Hu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),yn=_n.extend({blob:Hu}),Jt=ce(["user","assistant"]),Et=P({audience:I(Jt).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),vn=P({...$t.shape,...Vt.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Et.optional(),_meta:X(re({}))}),li=P({...$t.shape,...Vt.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Et.optional(),_meta:X(re({}))}),di=Ft.extend({method:O("resources/list")}),pi=Ht.extend({resources:I(vn)}),mi=Ft.extend({method:O("resources/templates/list")}),fi=Ht.extend({resourceTemplates:I(li)}),Kr=De.extend({uri:l()}),hi=Kr,gi=Te.extend({method:O("resources/read"),params:hi}),_i=ke.extend({contents:I(W([Sn,yn]))}),Si=Je.extend({method:O("notifications/resources/list_changed"),params:He.optional()}),yi=Kr,vi=Te.extend({method:O("resources/subscribe"),params:yi}),bi=Kr,zi=Te.extend({method:O("resources/unsubscribe"),params:bi}),bn=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ri=De.extend({notifications:bn}),$i=Te.extend({method:O("subscriptions/listen"),params:Ri}),wi=He.extend({notifications:bn}),Pi=Je.extend({method:O("notifications/subscriptions/acknowledged"),params:wi}),Ei=cn.extend({[on]:Ut}),Ti=ke.extend({_meta:Ei}),ki=He.extend({uri:l()}),Ci=Je.extend({method:O("notifications/resources/updated"),params:ki}),Ii=P({name:l(),description:X(l()),required:X(H())}),Oi=P({...$t.shape,...Vt.shape,description:X(l()),arguments:X(I(Ii)),_meta:X(re({}))}),Ni=Ft.extend({method:O("prompts/list")}),ji=Ht.extend({prompts:I(Oi)}),xi=De.extend({name:l(),arguments:K(l(),l()).optional()}),Ai=Te.extend({method:O("prompts/get"),params:xi}),Gr=P({type:O("text"),text:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Wr=P({type:O("image"),data:Hu,mimeType:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Yr=P({type:O("audio"),data:Hu,mimeType:l(),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),qi=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Mi=P({type:O("resource"),resource:W([Sn,yn]),annotations:Et.optional(),_meta:K(l(),Q()).optional()}),Li=vn.extend({type:O("resource_link")}),Xr=W([Gr,Wr,Yr,Li,Mi]),Di=P({role:Jt,content:Xr}),Zi=ke.extend({description:l().optional(),messages:I(Di)}),Ui=Je.extend({method:O("notifications/prompts/list_changed"),params:He.optional()}),Vi=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Fi=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),zn=P({...$t.shape,...Vt.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Dt).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:re({$schema:l().optional()}).optional(),annotations:Vi.optional(),execution:Fi.optional(),_meta:K(l(),Q()).optional()}),Hi=Ft.extend({method:O("tools/list")}),Ji=Ht.extend({tools:I(zn)}),Rn=ke.extend({content:I(Xr).default([]),structuredContent:Q().optional(),isError:H().optional()}),Ju=Rn.or(ke.extend({toolResult:Q()})),Bi=hr.extend({name:l(),arguments:K(l(),Q()).optional()}),Ki=Te.extend({method:O("tools/call"),params:Bi}),Gi=Je.extend({method:O("notifications/tools/list_changed"),params:He.optional()}),Bu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bt=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),Wi=De.extend({level:Bt}),Yi=Te.extend({method:O("logging/setLevel"),params:Wi}),Xi=He.extend({level:Bt,logger:l().optional(),data:Q()}),Qi=Je.extend({method:O("notifications/message"),params:Xi}),ea=P({name:l().optional()}),ta=P({hints:I(ea).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ra=P({mode:ce(["auto","required","none"]).optional()}),oa=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(Xr),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),na=Lt("type",[Gr,Wr,Yr]),dr=Lt("type",[Gr,Wr,Yr,qi,oa]),sa=P({role:Jt,content:W([dr,I(dr)]),_meta:K(l(),Q()).optional()}),ia=hr.extend({messages:I(sa),modelPreferences:ta.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(zn).optional(),toolChoice:ra.optional()}),aa=Te.extend({method:O("sampling/createMessage"),params:ia}),ca=ke.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:Jt,content:na}),ua=ke.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Jt,content:W([dr,I(dr)])}),$n=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Qr=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),eo=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),wn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Pn=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),En=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),la=W([wn,Pn]),Tn=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),kn=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),da=W([Tn,kn]),pa=W([En,la,da]),Cn=W([pa,$n,Qr,eo]),to=hr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Cn),required:I(l()).optional()}).catchall(Q())}),ma=hr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),fa=W([to,ma]),ha=Te.extend({method:O("elicitation/create"),params:fa}),ga=He.extend({elicitationId:l()}),_a=Je.extend({method:O("notifications/elicitation/complete"),params:ga}),Sa=ke.extend({action:ce(["accept","decline","cancel"]),content:lr(e=>e===null?void 0:e,K(l(),W([l(),L(),H(),I(l())])).optional())}),ya=P({type:O("ref/resource"),uri:l()}),va=P({type:O("ref/prompt"),name:l()}),ba=De.extend({ref:W([va,ya]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),za=Te.extend({method:O("completion/complete"),params:ba}),Ra=ke.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),$a=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),wa=Te.extend({method:O("roots/list"),params:De.optional()}),Pa=ke.extend({roots:I($a)}),Ea=Je.extend({method:O("notifications/roots/list_changed"),params:He.optional()}),Ku=re({ttl:L().optional(),pollInterval:L().optional()}),Ta=ce(["working","input_required","completed","failed","cancelled"]),Kt=P({taskId:l(),status:Ta,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),Gu=ke.extend({task:Kt}),ka=He.merge(Kt),Wu=Je.extend({method:O("notifications/tasks/status"),params:ka}),Yu=Te.extend({method:O("tasks/get"),params:De.extend({taskId:l()})}),Xu=ke.merge(Kt),Qu=Te.extend({method:O("tasks/result"),params:De.extend({taskId:l()})}),el=ke.loose(),tl=Ft.extend({method:O("tasks/list")}),rl=Ht.extend({tasks:I(Kt)}),ol=Te.extend({method:O("tasks/cancel"),params:De.extend({taskId:l()})}),nl=ke.merge(Kt),sl=W([hn,ri,si,za,Yi,Ai,Ni,di,mi,gi,vi,zi,$i,Ki,Hi]),il=W([mn,gn,ni,Ea]),al=W([pn,ca,ua,Sa,Pa]),cl=W([hn,aa,ha,wa]),ul=W([mn,gn,Qi,Ci,Si,Gi,Ui,Pi,_a]),ll=W([pn,oi,ii,Ra,Zi,ji,pi,fi,_i,Rn,Ji,Ti]),Le=Vs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Wh.custom,message:"URL must be parseable",fatal:!0}),$c}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),dl=re({resource:l().url(),authorization_servers:I(Le).optional(),jwks_uri:l().url().optional(),scopes_supported:I(l()).optional(),bearer_methods_supported:I(l()).optional(),resource_signing_alg_values_supported:I(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:H().optional(),authorization_details_types_supported:I(l()).optional(),dpop_signing_alg_values_supported:I(l()).optional(),dpop_bound_access_tokens_required:H().optional()}),Ca=re({issuer:l(),authorization_endpoint:Le,token_endpoint:Le,registration_endpoint:Le.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),service_documentation:Le.optional(),revocation_endpoint:Le.optional(),revocation_endpoint_auth_methods_supported:I(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:I(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:I(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:I(l()).optional(),code_challenge_methods_supported:I(l()).optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0),dpop_signing_alg_values_supported:I(l()).optional()}),Ia=re({issuer:l(),authorization_endpoint:Le,token_endpoint:Le,userinfo_endpoint:Le.optional(),jwks_uri:Le,registration_endpoint:Le.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),acr_values_supported:I(l()).optional(),subject_types_supported:I(l()),id_token_signing_alg_values_supported:I(l()),id_token_encryption_alg_values_supported:I(l()).optional(),id_token_encryption_enc_values_supported:I(l()).optional(),userinfo_signing_alg_values_supported:I(l()).optional(),userinfo_encryption_alg_values_supported:I(l()).optional(),userinfo_encryption_enc_values_supported:I(l()).optional(),request_object_signing_alg_values_supported:I(l()).optional(),request_object_encryption_alg_values_supported:I(l()).optional(),request_object_encryption_enc_values_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),display_values_supported:I(l()).optional(),claim_types_supported:I(l()).optional(),claims_supported:I(l()).optional(),service_documentation:l().optional(),claims_locales_supported:I(l()).optional(),ui_locales_supported:I(l()).optional(),claims_parameter_supported:H().optional(),request_parameter_supported:H().optional(),request_uri_parameter_supported:H().optional(),require_request_uri_registration:H().optional(),op_policy_uri:Le.optional(),op_tos_uri:Le.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),pl=P({...Ia.shape,...Ca.pick({code_challenge_methods_supported:!0}).shape}),ml=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Hs.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),fl=P({issued_token_type:O("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:L().optional(),scope:l().optional()}).strip(),hl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Uu=Le.optional().or(O("").transform(()=>{})),Oa=P({redirect_uris:I(Le),token_endpoint_auth_method:l().optional(),grant_types:I(l()).optional(),response_types:I(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:Le.optional(),logo_uri:Uu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Uu,policy_uri:l().optional(),jwks_uri:Le.optional(),jwks:Dh().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Na=P({client_id:l(),client_secret:l().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional(),issuer:l().optional().catch(void 0)}).strip(),gl=Oa.merge(Na),_l=P({error:l(),error_description:l().optional()}).strip(),Sl=P({token:l(),token_type_hint:l().optional()}).strip();var zl=Symbol.for("mcp.sdk.errorBrands");function Pl(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,zl,{value:r,enumerable:!1,configurable:!0})}function oo(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,zl)){let r=t[zl];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Sg=class yg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return oo(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Pl(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new yg(t.error,t.error_description??t.error,t.error_uri)}},me=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return oo(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",Pl(this,new.target)}},xv=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ig(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Av(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function vg(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Za(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(ig(n)&&ig(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!Av(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var qv="2026-07-28";function An(e){return e>=qv}function bg(e){return e.filter(t=>!An(t))}function El(e){return e.filter(t=>An(t))}function zg(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Rg=["task","inputRequests","requestState"];function Tl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Rg.some(t=>t in e)?e:{...e,content:[]}}function Mv(){let e=rn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=P({ttl:L().optional()}),s=P({taskId:l()}),i=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=P({_meta:i.optional()}),a=c.extend({task:n.optional()}),u=P({method:l(),params:c.loose().optional()}),d=P({_meta:i.optional()}),m=P({method:l(),params:d.loose().optional()}),g=re({_meta:i.optional()}),v=W([l(),L().int()]),p=g.strict(),_=d.extend({requestId:v.optional(),reason:l().optional()}),h=m.extend({method:O("notifications/cancelled"),params:_}),f=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),z=P({icons:I(f).optional()}),y=P({name:l(),title:l().optional()}),R=y.extend({...y.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),w=zt(P({applyDefaults:H().optional()}),t),b=lr(Fe=>Fe&&typeof Fe=="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0?{form:{}}:Fe,zt(P({form:w.optional(),url:t.optional()}),t.optional())),S=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),E=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),j=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:S.optional(),extensions:K(l(),t).optional()}),F=c.extend({protocolVersion:l(),capabilities:j,clientInfo:R}),M=u.extend({method:O("initialize"),params:F}),Z=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:E.optional(),extensions:K(l(),t).optional()}),Y=g.extend({protocolVersion:l(),capabilities:Z,serverInfo:R,instructions:l().optional()}),G=m.extend({method:O("notifications/initialized"),params:d.optional()}),fe=u.extend({method:O("ping"),params:c.optional()}),$e=P({progress:L(),total:X(L()),message:X(l())}),be=P({...d.shape,...$e.shape,progressToken:r}),Oe=m.extend({method:O("notifications/progress"),params:be}),he=c.extend({cursor:o.optional()}),C=u.extend({params:he.optional()}),x=g.extend({nextCursor:o.optional()}),V=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=V.extend({text:l()}),k=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=V.extend({blob:k}),J=ce(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),pe=P({...y.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:ee.optional(),_meta:X(re({}))}),ie=P({...y.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(re({}))}),ze=C.extend({method:O("resources/list")}),Be=x.extend({resources:I(pe)}),T=C.extend({method:O("resources/templates/list")}),A=x.extend({resourceTemplates:I(ie)}),D=c.extend({uri:l()}),ne=D,se=u.extend({method:O("resources/read"),params:ne}),de=g.extend({contents:I(W([$,N]))}),Ce=m.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),je=D,Ue=u.extend({method:O("resources/subscribe"),params:je}),Ne=D,we=u.extend({method:O("resources/unsubscribe"),params:Ne}),ot=d.extend({uri:l()}),Ae=m.extend({method:O("notifications/resources/updated"),params:ot}),ft=P({name:l(),description:X(l()),required:X(H())}),it=P({...y.shape,...z.shape,description:X(l()),arguments:X(I(ft)),_meta:X(re({}))}),ht=C.extend({method:O("prompts/list")}),kt=x.extend({prompts:I(it)}),Ct=c.extend({name:l(),arguments:K(l(),l()).optional()}),Wt=u.extend({method:O("prompts/get"),params:Ct}),Yt=P({type:O("text"),text:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Xt=P({type:O("image"),data:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Qt=P({type:O("audio"),data:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),co=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),It=P({type:O("resource"),resource:W([$,N]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),uo=pe.extend({type:O("resource_link")}),nt=W([Yt,Xt,Qt,uo,It]),yr=P({role:J,content:nt}),vr=g.extend({description:l().optional(),messages:I(yr)}),er=m.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),lo=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),br=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),tr=P({...y.shape,...z.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()).optional(),annotations:lo.optional(),execution:br.optional(),_meta:K(l(),Q()).optional()}),zr=C.extend({method:O("tools/list")}),Rr=x.extend({tools:I(tr)}),$r=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ve=a.extend({name:l(),arguments:K(l(),Q()).optional()}),po=u.extend({method:O("tools/call"),params:Ve}),Vn=m.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),wr=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),mo=c.extend({level:wr}),fo=u.extend({method:O("logging/setLevel"),params:mo}),ho=d.extend({level:wr,logger:l().optional(),data:Q()}),go=m.extend({method:O("notifications/message"),params:ho}),_o=P({name:l().optional()}),So=P({hints:I(_o).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),yo=P({mode:ce(["auto","required","none"]).optional()}),Fn=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(nt),structuredContent:P({}).loose().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),vo=Lt("type",[Yt,Xt,Qt]),Ot=Lt("type",[Yt,Xt,Qt,co,Fn]),bo=P({role:J,content:W([Ot,I(Ot)]),_meta:K(l(),Q()).optional()}),zo=a.extend({messages:I(bo),modelPreferences:So.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(tr).optional(),toolChoice:yo.optional()}),Ro=u.extend({method:O("sampling/createMessage"),params:zo}),$o=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:vo}),wo=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:W([Ot,I(Ot)])}),Po=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Eo=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),To=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),ko=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Co=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),Oo=W([ko,Co]),rr=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),or=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),Hn=W([rr,or]),Jn=W([Io,Oo,Hn]),et=W([Jn,Po,Eo,To]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),No=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),at=W([tt,No]),Bn=u.extend({method:O("elicitation/create"),params:at}),Kn=d.extend({elicitationId:l()}),Gn=m.extend({method:O("notifications/elicitation/complete"),params:Kn}),Wn=g.extend({action:ce(["accept","decline","cancel"]),content:lr(Fe=>Fe===null?void 0:Fe,K(l(),W([l(),L(),H(),I(l())])).optional())}),Yn=P({type:O("ref/resource"),uri:l()}),Xn=P({type:O("ref/prompt"),name:l()}),Qn=c.extend({ref:W([Xn,Yn]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),jo=u.extend({method:O("completion/complete"),params:Qn}),es=g.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),ts=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Pr=u.extend({method:O("roots/list"),params:c.optional()}),xo=g.extend({roots:I(ts)}),rs=m.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),os=re({ttl:L().optional(),pollInterval:L().optional()}),Ao=ce(["working","input_required","completed","failed","cancelled"]),Nt=P({taskId:l(),status:Ao,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:Nt}),ns=d.merge(Nt),nr=m.extend({method:O("notifications/tasks/status"),params:ns}),Er=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Tr=g.merge(Nt),kr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),sc=g.loose(),Ke=C.extend({method:O("tasks/list")}),Ie=x.extend({tasks:I(Nt)}),sr=u.extend({method:O("tasks/cancel"),params:c.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:a,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:m,ResultSchema:g,RequestIdSchema:v,EmptyResultSchema:p,CancelledNotificationParamsSchema:_,CancelledNotificationSchema:h,IconSchema:f,IconsSchema:z,BaseMetadataSchema:y,ImplementationSchema:R,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:j,InitializeRequestParamsSchema:F,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:Y,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:C,PaginatedResultSchema:x,ResourceContentsSchema:V,TextResourceContentsSchema:$,BlobResourceContentsSchema:N,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ie,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Be,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:Ce,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Ue,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:we,ResourceUpdatedNotificationParamsSchema:ot,ResourceUpdatedNotificationSchema:Ae,PromptArgumentSchema:ft,PromptSchema:it,ListPromptsRequestSchema:ht,ListPromptsResultSchema:kt,GetPromptRequestParamsSchema:Ct,GetPromptRequestSchema:Wt,TextContentSchema:Yt,ImageContentSchema:Xt,AudioContentSchema:Qt,ToolUseContentSchema:co,EmbeddedResourceSchema:It,ResourceLinkSchema:uo,ContentBlockSchema:nt,PromptMessageSchema:yr,GetPromptResultSchema:vr,PromptListChangedNotificationSchema:er,ToolAnnotationsSchema:lo,ToolExecutionSchema:br,ToolSchema:tr,ListToolsRequestSchema:zr,ListToolsResultSchema:Rr,CallToolResultSchema:$r,CallToolRequestParamsSchema:Ve,CallToolRequestSchema:po,ToolListChangedNotificationSchema:Vn,LoggingLevelSchema:wr,SetLevelRequestParamsSchema:mo,SetLevelRequestSchema:fo,LoggingMessageNotificationParamsSchema:ho,LoggingMessageNotificationSchema:go,ModelHintSchema:_o,ModelPreferencesSchema:So,ToolChoiceSchema:yo,ToolResultContentSchema:Fn,SamplingContentSchema:vo,SamplingMessageContentBlockSchema:Ot,SamplingMessageSchema:bo,CreateMessageRequestParamsSchema:zo,CreateMessageRequestSchema:Ro,CreateMessageResultSchema:$o,CreateMessageResultWithToolsSchema:wo,BooleanSchemaSchema:Po,StringSchemaSchema:Eo,NumberSchemaSchema:To,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:Co,LegacyTitledEnumSchemaSchema:Io,SingleSelectEnumSchemaSchema:Oo,UntitledMultiSelectEnumSchemaSchema:rr,TitledMultiSelectEnumSchemaSchema:or,MultiSelectEnumSchemaSchema:Hn,EnumSchemaSchema:Jn,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:No,ElicitRequestParamsSchema:at,ElicitRequestSchema:Bn,ElicitationCompleteNotificationParamsSchema:Kn,ElicitationCompleteNotificationSchema:Gn,ElicitResultSchema:Wn,ResourceTemplateReferenceSchema:Yn,PromptReferenceSchema:Xn,CompleteRequestParamsSchema:Qn,CompleteRequestSchema:jo,CompleteResultSchema:es,RootSchema:ts,ListRootsRequestSchema:Pr,ListRootsResultSchema:xo,RootsListChangedNotificationSchema:rs,TaskCreationParamsSchema:os,TaskStatusSchema:Ao,TaskSchema:Nt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:ns,TaskStatusNotificationSchema:nr,GetTaskRequestSchema:Er,GetTaskResultSchema:Tr,GetTaskPayloadRequestSchema:kr,GetTaskPayloadResultSchema:sc,ListTasksRequestSchema:Ke,ListTasksResultSchema:Ie,CancelTaskRequestSchema:sr,CancelTaskResultSchema:g.merge(Nt),ClientRequestSchema:W([fe,M,jo,fo,Wt,ht,ze,T,se,Ue,we,po,zr,Er,kr,Ke,sr]),ClientNotificationSchema:W([h,Oe,G,rs,nr]),ClientResultSchema:W([p,$o,wo,Wn,xo,Tr,Ie,We]),ServerRequestSchema:W([fe,Ro,Bn,Pr,Er,kr,Ke,sr]),ServerNotificationSchema:W([h,Oe,go,Ae,Ce,Vn,er,nr,Gn]),ServerResultSchema:W([p,Y,es,vr,kt,Be,A,de,$r,Rr,Tr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,tS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let cd of Rg)if(cd in Fe){tS.addIssue({code:"custom",message:`content is required when the body carries '${cd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Tl).pipe($r)}}var Lv;function $g(){return Lv??=Mv()}function wg(e){return e.type!=="object"}var Dv=new Set(["const","enum","default","examples"]),Zv=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ag(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Uv(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(ag(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Pd(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(a=>o(a,!1));if(n===null||typeof n!="object"||!s&&ag(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))s?i[a]=o(u,!1):(a==="$ref"||a==="$dynamicRef")&&typeof u=="string"?i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:a==="$recursiveRef"&&u==="#"&&r?c=!0:Dv.has(a)?i[a]=u:Zv.has(a)?i[a]=o(u,!0):i[a]=o(u,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Pg={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Eg={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Vv={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ja;function kl(){if(ja)return ja;let e=$g();return ja={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ja}function Tg(e){return Object.prototype.hasOwnProperty.call(Pg,e)}function kg(e){return Object.prototype.hasOwnProperty.call(Eg,e)}function Fv(e){return Object.prototype.hasOwnProperty.call(Vv,e)}function Hv(e){return Fv(e)?kl().resultSchemas[e]:void 0}function Jv(e){return Tg(e)?kl().requestSchemas[e]:void 0}function Bv(e){return kg(e)?kl().notificationSchemas[e]:void 0}var Tw=Object.keys(Pg),kw=Object.keys(Eg);function Rl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xa(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var cg={ok:!1,reason:"not-in-era"};function ug(e){return Rl(e)&&Rl(e.outputSchema)&&wg(e.outputSchema)}var Cl={era:"2025-11-25",hasRequestMethod:Tg,hasNotificationMethod:kg,validateRequest:(e,t)=>xa(Jv(e),t),validateResult:(e,t)=>xa(Hv(e),t),validateNotification:(e,t)=>xa(Bv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>cg,validateInputResponse:()=>cg,samplingResultVariant:((e,t)=>{let r=$g();return xa(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=zg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&wg(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Rl(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>ug(o))?t:{...t,tools:r.map(o=>ug(o)?{...o,outputSchema:Uv(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Kv(){let e=rn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=W([l(),L().int()]),s=ce(["user","assistant"]),i=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),c=l().refine(Ie=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),a=P({ttl:L().optional()}),u=P({taskId:l()}),d=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),m=P({_meta:d.optional()}),g=m.extend({task:a.optional()}),v=P({_meta:d.optional()}),p=P({method:l(),params:v.loose().optional()}),_=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),h=P({icons:I(_).optional()}),f=P({name:l(),title:l().optional()}),z=f.extend({...f.shape,...h.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),y=zt(P({applyDefaults:H().optional()}),t),R=lr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,zt(P({form:y.optional(),url:t.optional()}),t.optional())),w=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),b=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),S=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:w.optional(),extensions:K(l(),t).optional()}),E=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:b.optional(),extensions:K(l(),t).optional()}),j=P({progress:L(),total:X(L()),message:X(l())}),F=P({...v.shape,...j.shape,progressToken:r}),M=p.extend({method:O("notifications/progress"),params:F}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),Y=p.extend({method:O("notifications/message"),params:Z}),G=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),fe=G.extend({text:l()}),$e=G.extend({blob:c}),be=P({audience:I(s).optional(),priority:L().min(0).max(1).optional(),lastModified:Rt.datetime({offset:!0}).optional()}),Oe=P({...f.shape,...h.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:be.optional(),_meta:X(re({}))}),he=P({...f.shape,...h.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(re({}))}),C=p.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),x=v.extend({uri:l()}),V=p.extend({method:O("notifications/resources/updated"),params:x}),$=P({name:l(),description:X(l()),required:X(H())}),k=P({...f.shape,...h.shape,description:X(l()),arguments:X(I($)),_meta:X(re({}))}),N=p.extend({method:O("notifications/prompts/list_changed"),params:v.optional()}),J=P({type:O("text"),text:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ee=P({type:O("image"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),pe=P({type:O("audio"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ie=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),ze=P({type:O("resource"),resource:W([fe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Be=Oe.extend({type:O("resource_link")}),T=W([J,ee,pe,Be,ze]),A=P({role:s,content:T}),D=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),ne=p.extend({method:O("notifications/tools/list_changed"),params:v.optional()}),se=P({name:l().optional()}),de=P({hints:I(se).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Ce=P({mode:ce(["auto","required","none"]).optional()}),je=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Ue=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),we=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),ot=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Ae=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ft=W([we,ot]),it=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),ht=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),kt=W([it,ht]),Ct=W([Ae,ft,kt]),Wt=W([Ct,je,Ue,Ne]),Yt=g.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Wt),required:I(l()).optional()}).catchall(Q())}),Xt=P({type:O("ref/resource"),uri:l()}),Qt=P({type:O("ref/prompt"),name:l()}),co=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),It=S.shape,uo=P({experimental:It.experimental,sampling:It.sampling,elicitation:It.elicitation,roots:It.roots,extensions:It.extensions}),nt=E.shape,yr=P({experimental:nt.experimental,logging:nt.logging,completions:nt.completions,prompts:nt.prompts,resources:nt.resources,tools:nt.tools,extensions:nt.extensions}),vr=re({progressToken:r.optional(),[mr]:l(),[Fr]:z.optional(),[Pt]:uo,[Zt]:i.optional()}),er=P({...f.shape,...h.shape,description:l().optional(),inputSchema:re({$schema:l().optional(),type:O("object")}),outputSchema:re({$schema:l().optional()}).optional(),annotations:D.optional(),_meta:K(l(),Q()).optional()}),lo=P({type:O("tool_result"),toolUseId:l(),content:I(T),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),br=W([J,ee,pe,ie,lo]),tr=P({role:s,content:W([br,I(br)]),_meta:K(l(),Q()).optional()}),zr=l(),Rr=re({[wt]:z.optional().catch(void 0)}),$r=Rr.optional();function Ve(Ie){return re({_meta:$r,resultType:zr.default("complete"),...Ie})}let po=Ve({}),Vn=Ve({nextCursor:o.optional()}),wr=Ve({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),mo=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),fo=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(k),nextCursor:o.optional()}),ho=Ve({description:l().optional(),messages:I(A)}),go=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),_o=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),So=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),yo=Ve({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Fn=Ve({ttlMs:L().int().min(0),cacheScope:ce(["public","private"])}),vo=Ve({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),Ot=P({messages:I(tr),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(er).optional(),toolChoice:Ce.optional()}),bo=P({method:O("sampling/createMessage"),params:Ot}),zo=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),Ro=P({...tr.shape,model:l(),stopReason:l().optional()}),$o=P({roots:I(co)}),wo=P({action:ce(["accept","decline","cancel"]),content:K(l(),W([l(),L(),H(),I(l())])).optional()}),Po=P({mode:O("url"),message:l(),url:l().url()}),Eo=W([Yt,Po]),To=P({method:O("elicitation/create"),params:Eo}),ko=W([bo,zo,To]),Co=W([Ro,$o,wo]),Io=K(l(),ko),Oo=K(l(),Co),rr=Ve({inputRequests:Io.optional(),requestState:l().optional()}),or={inputResponses:Oo.optional(),requestState:l().optional()},Hn=P({_meta:vr,...or}),Jn=re({progressToken:r.optional()});function et(Ie,sr){return P({method:O(Ie),params:P({_meta:vr,...sr})})}function tt(Ie,sr){return P({method:O(Ie),params:P({_meta:Jn.optional(),...sr}).optional()})}let No={name:l(),arguments:K(l(),Q()).optional(),...or},at={cursor:o.optional()},Bn=et("tools/call",No),Kn=et("tools/list",at),Gn=et("prompts/list",at),Wn=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...or}),Yn=et("resources/list",at),Xn=et("resources/templates/list",at),Qn=et("resources/read",{uri:l(),...or}),jo={ref:W([Qt,Xt]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},es=et("completion/complete",jo),ts=et("server/discover",{}),Pr=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),xo={notifications:Pr},rs=et("subscriptions/listen",xo),os=Rr.extend({"io.modelcontextprotocol/subscriptionId":n}),Ao=re({_meta:os,resultType:zr.default("complete")}),Nt={"tools/call":tt("tools/call",No),"tools/list":tt("tools/list",at),"prompts/get":tt("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":tt("prompts/list",at),"resources/list":tt("resources/list",at),"resources/templates/list":tt("resources/templates/list",at),"resources/read":tt("resources/read",{uri:l()}),"completion/complete":tt("completion/complete",jo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",xo)};function We(Ie){return re({_meta:$r,...Ie})}let ns={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),"prompts/get":We({description:l().optional(),messages:I(A)}),"prompts/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(k),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),"completion/complete":We({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),"server/discover":We({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),"subscriptions/listen":We({})},nr=re({"io.modelcontextprotocol/subscriptionId":n.optional()}),Er=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:nr.optional(),notifications:Pr})}),Tr=P({_meta:nr.optional(),requestId:n,reason:l().optional()}),kr=P({method:O("notifications/cancelled"),params:Tr}),sc={"notifications/cancelled":kr,"notifications/progress":M,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":C,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":N,"notifications/subscriptions/acknowledged":Er},Ke=Ie=>P({jsonrpc:O("2.0"),id:W([l(),L().int()]),result:Ie}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:a,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:g,NotificationsParamsSchema:v,NotificationSchema:p,IconSchema:_,IconsSchema:h,BaseMetadataSchema:f,ImplementationSchema:z,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:b,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:j,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:C,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:$,PromptSchema:k,PromptListChangedNotificationSchema:N,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ie,EmbeddedResourceSchema:ze,ResourceLinkSchema:Be,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:de,ToolChoiceSchema:Ce,BooleanSchemaSchema:je,StringSchemaSchema:Ue,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:we,TitledSingleSelectEnumSchemaSchema:ot,LegacyTitledEnumSchemaSchema:Ae,SingleSelectEnumSchemaSchema:ft,UntitledMultiSelectEnumSchemaSchema:it,TitledMultiSelectEnumSchemaSchema:ht,MultiSelectEnumSchemaSchema:kt,EnumSchemaSchema:Ct,PrimitiveSchemaDefinitionSchema:Wt,ElicitRequestFormParamsSchema:Yt,ResourceTemplateReferenceSchema:Xt,PromptReferenceSchema:Qt,RootSchema:co,ClientCapabilities2026Schema:uo,ServerCapabilities2026Schema:yr,RequestMetaEnvelopeSchema:vr,ToolSchema:er,ToolResultContentSchema:lo,SamplingMessageContentBlockSchema:br,SamplingMessageSchema:tr,ResultTypeSchema:zr,ResultMetaSchema:Rr,ResultSchema:po,PaginatedResultSchema:Vn,CallToolResultSchema:wr,ListToolsResultSchema:mo,ListPromptsResultSchema:fo,GetPromptResultSchema:ho,ListResourcesResultSchema:go,ListResourceTemplatesResultSchema:_o,ReadResourceResultSchema:So,CompleteResultSchema:yo,CacheableResultSchema:Fn,DiscoverResultSchema:vo,CreateMessageRequestParamsSchema:Ot,CreateMessageRequestSchema:bo,ListRootsRequestSchema:zo,CreateMessageResultSchema:Ro,ListRootsResultSchema:$o,ElicitResultSchema:wo,ElicitRequestURLParamsSchema:Po,ElicitRequestParamsSchema:Eo,ElicitRequestSchema:To,InputRequestSchema:ko,InputResponseSchema:Co,InputRequestsSchema:Io,InputResponsesSchema:Oo,InputRequiredResultSchema:rr,InputResponseRequestParamsSchema:Hn,CallToolRequestSchema:Bn,ListToolsRequestSchema:Kn,ListPromptsRequestSchema:Gn,GetPromptRequestSchema:Wn,ListResourcesRequestSchema:Yn,ListResourceTemplatesRequestSchema:Xn,ReadResourceRequestSchema:Qn,CompleteRequestSchema:es,DiscoverRequestSchema:ts,SubscriptionFilterSchema:Pr,SubscriptionsListenRequestSchema:rs,SubscriptionsListenResultMetaSchema:os,SubscriptionsListenResultSchema:Ao,dispatchRequestSchemas:Nt,dispatchResultSchemas:ns,NotificationMetaSchema:nr,SubscriptionsAcknowledgedNotificationSchema:Er,CancelledNotificationParamsSchema:Tr,CancelledNotificationSchema:kr,notificationSchemas2026:sc,JSONRPCResultResponseSchema:Ke(po),CallToolResultResponseSchema:Ke(W([wr,rr])),ListToolsResultResponseSchema:Ke(mo),ListPromptsResultResponseSchema:Ke(fo),GetPromptResultResponseSchema:Ke(W([ho,rr])),ListResourcesResultResponseSchema:Ke(go),ListResourceTemplatesResultResponseSchema:Ke(_o),ReadResourceResultResponseSchema:Ke(W([So,rr])),CompleteResultResponseSchema:Ke(yo),DiscoverResultResponseSchema:Ke(vo),SubscriptionsListenResultResponseSchema:Ke(Ao)}}var Gv;function Gt(){return Gv??=Kv()}var Wv=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Yv(e){return Wv.includes(e)}var ro=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ua(e,t){if(t===void 0)return e;let r=e[ro];if(r===void 0)return{...e,[ro]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[ro]:o}}function Xv(e){return e[ro]}function Il(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ol(e){return e==="public"||e==="private"}function Nl(e,t){if(e.ttlMs!==void 0&&!Il(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Ol(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var B=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({}),oe=class Cg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return oo(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return oo(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Pl(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Ig(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new jl({supported:n.supported,requested:n.requested},r)}if(t===B.InvalidParams||t===B.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===B.ResourceNotFound||Object.keys(n).length===1))return new Va(n.uri,r)}if(t===B.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Fa({requiredCapabilities:n.requiredCapabilities},r)}return new Cg(t,r,o)}},Va=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(B.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Ig=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(B.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},jl=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(B.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Fa=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(B.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qv=0,eb="private",tb=["tools/call","prompts/get","resources/read"];function rb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||tb.includes(e))return t;throw new oe(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ob(e,t){let r=Xv(t);if(t.resultType!=="complete"||!Yv(e))return r===void 0?t:cb(t);let o=t,n=Il(o.ttlMs)?o.ttlMs:ib(r),s=Ol(o.cacheScope)?o.cacheScope:ab(r),i={...o,ttlMs:n,cacheScope:s};return delete i[ro],i}function nb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function sb(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[wt]:t}}:!nb(r)||r[wt]!==void 0?e:{...e,_meta:{...r,[wt]:t}}}function ib(e){return e!==void 0&&Il(e.ttlMs)?e.ttlMs:Qv}function ab(e){return e!==void 0&&Ol(e.cacheScope)?e.cacheScope:eb}function cb(e){let t={...e};return delete t[ro],t}var ub=["elicitation/create","sampling/createMessage","roots/list"],Aa;function Og(){if(Aa)return Aa;let e=Gt();return Aa={request:{"elicitation/create":P({method:O("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":P({method:O("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":P({method:O("roots/list"),params:re({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Aa}function Ng(e){return ub.includes(e)}function yl(e){return Ng(e)?Og().request[e]:void 0}function lb(e){return Ng(e)?Og().response[e]:void 0}var xl={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},jg={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function xg(e){return Object.prototype.hasOwnProperty.call(xl,e)}function Ag(e){return Object.prototype.hasOwnProperty.call(jg,e)}function db(e){return Object.prototype.hasOwnProperty.call(xl,e)}function pb(e){return xg(e)?Gt().dispatchRequestSchemas[e]:void 0}function mb(e){return db(e)?Gt().dispatchResultSchemas[e]:void 0}function fb(e){return Ag(e)?Gt().notificationSchemas2026[e]:void 0}var Cw=Object.keys(xl),Iw=Object.keys(jg);function Nn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function In(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var hb={ok:!1,reason:"not-in-era"},gb=[mr,Pt];function _b(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>Nn(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!Nn(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(Nn(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Al={era:"2026-07-28",hasRequestMethod:xg,hasNotificationMethod:Ag,hasInputRequestMethod:e=>yl(e)!==void 0,validateRequest:(e,t)=>In(pb(e),t),validateResult:(e,t)=>In(mb(e),t),validateNotification:(e,t)=>In(fb(e),t),validateInputRequest:(e,t)=>In(yl(e),t),validateInputResponse:(e,t)=>In(lb(e),t),samplingResultVariant:()=>hb,outboundEnvelope(e){return{[mr]:e.protocolVersion,[Fr]:e.clientInfo,[Pt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Zt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of gb)o in e||t.push({key:o,problem:"missing"});let r=Gt().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>zg(e),inputRequestSchema:yl,decodeResult(e,t){if(!Nn(t))return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!="string")return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,c=Nn(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Gt().ResultMetaSchema.safeParse(t._meta),d=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof a!="string"?{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof a=="string"&&{requestState:a},...d!==void 0&&{_meta:d}}}if(r!=="complete")return{kind:"invalid",error:new ue(me.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=Sb(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return sb(ob(e,rb(e,_b(e,t))),r)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=Gt().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}},qa;function Sb(){if(qa)return qa;let e=Gt();return qa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},qa}var ql="2026-07-28";function no(e){return e!==void 0&&An(e)?Al:Cl}function lg(e){return e.revision!==void 0?no(e.revision).era:e.era==="modern"?Al.era:Cl.era}function vl(e){return qg.some(t=>t.hasRequestMethod(e))}function bl(e){return qg.some(t=>t.hasNotificationMethod(e))}function dg(e){return e==="tasks/get"||e==="tasks/cancel"}var qg=[Cl,Al];var yb=$d({AnnotationsSchema:()=>Et,AudioContentSchema:()=>Yr,BaseMetadataSchema:()=>$t,BaseRequestParamsSchema:()=>De,BlobResourceContentsSchema:()=>yn,BooleanSchemaSchema:()=>$n,CallToolRequestParamsSchema:()=>Bi,CallToolRequestSchema:()=>Ki,CallToolResultSchema:()=>Rn,CancelTaskRequestSchema:()=>ol,CancelTaskResultSchema:()=>nl,CancelledNotificationParamsSchema:()=>Ws,CancelledNotificationSchema:()=>mn,ClientCapabilitiesSchema:()=>ei,ClientNotificationSchema:()=>il,ClientRequestSchema:()=>sl,ClientResultSchema:()=>al,ClientTasksCapabilitySchema:()=>Xs,CompatibilityCallToolResultSchema:()=>Ju,CompleteRequestParamsSchema:()=>ba,CompleteRequestSchema:()=>za,CompleteResultSchema:()=>Ra,ContentBlockSchema:()=>Xr,CreateMessageRequestParamsSchema:()=>ia,CreateMessageRequestSchema:()=>aa,CreateMessageResultSchema:()=>ca,CreateMessageResultWithToolsSchema:()=>ua,CreateTaskResultSchema:()=>Gu,CursorSchema:()=>sn,DiscoverRequestSchema:()=>si,DiscoverResultSchema:()=>ii,ElicitRequestFormParamsSchema:()=>to,ElicitRequestParamsSchema:()=>fa,ElicitRequestSchema:()=>ha,ElicitRequestURLParamsSchema:()=>ma,ElicitResultSchema:()=>Sa,ElicitationCompleteNotificationParamsSchema:()=>ga,ElicitationCompleteNotificationSchema:()=>_a,EmbeddedResourceSchema:()=>Mi,EmptyResultSchema:()=>pn,EnumSchemaSchema:()=>pa,GetPromptRequestParamsSchema:()=>xi,GetPromptRequestSchema:()=>Ai,GetPromptResultSchema:()=>Zi,GetTaskPayloadRequestSchema:()=>Qu,GetTaskPayloadResultSchema:()=>el,GetTaskRequestSchema:()=>Yu,GetTaskResultSchema:()=>Xu,IconSchema:()=>Ys,IconsSchema:()=>Vt,ImageContentSchema:()=>Wr,ImplementationSchema:()=>Br,InitializeRequestParamsSchema:()=>ti,InitializeRequestSchema:()=>ri,InitializeResultSchema:()=>oi,InitializedNotificationSchema:()=>ni,JSONArraySchema:()=>Vu,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Jr,JSONRPCMessageSchema:()=>dn,JSONRPCNotificationSchema:()=>ln,JSONRPCRequestSchema:()=>un,JSONRPCResponseSchema:()=>Fu,JSONRPCResultResponseSchema:()=>Hr,JSONValueSchema:()=>Dt,LegacyTitledEnumSchemaSchema:()=>En,ListChangedOptionsBaseSchema:()=>Bu,ListPromptsRequestSchema:()=>Ni,ListPromptsResultSchema:()=>ji,ListResourceTemplatesRequestSchema:()=>mi,ListResourceTemplatesResultSchema:()=>fi,ListResourcesRequestSchema:()=>di,ListResourcesResultSchema:()=>pi,ListRootsRequestSchema:()=>wa,ListRootsResultSchema:()=>Pa,ListTasksRequestSchema:()=>tl,ListTasksResultSchema:()=>rl,ListToolsRequestSchema:()=>Hi,ListToolsResultSchema:()=>Ji,LoggingLevelSchema:()=>Bt,LoggingMessageNotificationParamsSchema:()=>Xi,LoggingMessageNotificationSchema:()=>Qi,ModelHintSchema:()=>ea,ModelPreferencesSchema:()=>ta,MultiSelectEnumSchemaSchema:()=>da,NotificationSchema:()=>Je,NotificationsParamsSchema:()=>He,NumberSchemaSchema:()=>eo,PaginatedRequestParamsSchema:()=>ui,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>Ht,PingRequestSchema:()=>hn,PrimitiveSchemaDefinitionSchema:()=>Cn,ProgressNotificationParamsSchema:()=>ci,ProgressNotificationSchema:()=>gn,ProgressSchema:()=>ai,ProgressTokenSchema:()=>nn,PromptArgumentSchema:()=>Ii,PromptListChangedNotificationSchema:()=>Ui,PromptMessageSchema:()=>Di,PromptReferenceSchema:()=>va,PromptSchema:()=>Oi,ReadResourceRequestParamsSchema:()=>hi,ReadResourceRequestSchema:()=>gi,ReadResourceResultSchema:()=>_i,RelatedTaskMetadataSchema:()=>Gs,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>an,RequestSchema:()=>Te,ResourceContentsSchema:()=>_n,ResourceLinkSchema:()=>Li,ResourceListChangedNotificationSchema:()=>Si,ResourceRequestParamsSchema:()=>Kr,ResourceSchema:()=>vn,ResourceTemplateReferenceSchema:()=>ya,ResourceTemplateSchema:()=>li,ResourceUpdatedNotificationParamsSchema:()=>ki,ResourceUpdatedNotificationSchema:()=>Ci,ResultMetaObjectSchema:()=>cn,ResultSchema:()=>ke,RoleSchema:()=>Jt,RootSchema:()=>$a,RootsListChangedNotificationSchema:()=>Ea,SamplingContentSchema:()=>na,SamplingMessageContentBlockSchema:()=>dr,SamplingMessageSchema:()=>sa,ServerCapabilitiesSchema:()=>fn,ServerNotificationSchema:()=>ul,ServerRequestSchema:()=>cl,ServerResultSchema:()=>ll,ServerTasksCapabilitySchema:()=>Qs,SetLevelRequestParamsSchema:()=>Wi,SetLevelRequestSchema:()=>Yi,SingleSelectEnumSchemaSchema:()=>la,StringSchemaSchema:()=>Qr,SubscribeRequestParamsSchema:()=>yi,SubscribeRequestSchema:()=>vi,SubscriptionFilterSchema:()=>bn,SubscriptionsAcknowledgedNotificationParamsSchema:()=>wi,SubscriptionsAcknowledgedNotificationSchema:()=>Pi,SubscriptionsListenRequestParamsSchema:()=>Ri,SubscriptionsListenRequestSchema:()=>$i,SubscriptionsListenResultMetaSchema:()=>Ei,SubscriptionsListenResultSchema:()=>Ti,TaskAugmentedRequestParamsSchema:()=>hr,TaskCreationParamsSchema:()=>Ku,TaskMetadataSchema:()=>Ks,TaskSchema:()=>Kt,TaskStatusNotificationParamsSchema:()=>ka,TaskStatusNotificationSchema:()=>Wu,TaskStatusSchema:()=>Ta,TextContentSchema:()=>Gr,TextResourceContentsSchema:()=>Sn,TitledMultiSelectEnumSchemaSchema:()=>kn,TitledSingleSelectEnumSchemaSchema:()=>Pn,ToolAnnotationsSchema:()=>Vi,ToolChoiceSchema:()=>ra,ToolExecutionSchema:()=>Fi,ToolListChangedNotificationSchema:()=>Gi,ToolResultContentSchema:()=>oa,ToolSchema:()=>zn,ToolUseContentSchema:()=>qi,UnsubscribeRequestParamsSchema:()=>bi,UnsubscribeRequestSchema:()=>zi,UntitledMultiSelectEnumSchemaSchema:()=>Tn,UntitledSingleSelectEnumSchemaSchema:()=>wn});var Ml=e=>un.safeParse(e).success,Ll=e=>ln.safeParse(e).success,Da=e=>Hr.safeParse(e).success,Dl=e=>Jr.safeParse(e).success;var Tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Zl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Ul(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var pg="x-mcp-header",vb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,bb=new Set(["string","integer","boolean","number"]);function Vl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(pg in a){if(!c||i.length===0)return`${Ma(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=a[pg];if(typeof d!="string"||d.length===0)return`${Ma(i)}: x-mcp-header MUST be a non-empty string`;if(!vb.test(d))return`${Ma(i)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof a.type=="string"?a.type:void 0;if(m===void 0||!bb.has(m))return`${Ma(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;let g=d.toLowerCase(),v=r.get(g);if(v!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${v}')`;r.set(g,d),t.push({path:i,headerName:d,type:m})}let u=a.properties;if(u!==null&&typeof u=="object")for(let[d,m]of Object.entries(u)){let g=o(m,[...i,d],c);if(g!==void 0)return g}for(let d of zb){let m=a[d];if(m===void 0)continue;let g=Array.isArray(m)?m:m!==null&&typeof m=="object"&&Rb.has(d)?Object.values(m):[m];for(let v of g){let p=o(v,[...i,`<${d}>`],!1);if(p!==void 0)return p}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var zb=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Rb=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Ma(e){return e.length===0?"<root>":e.join(".")}var La=-32020,Ow=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[B.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[La,B.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[B.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[B.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[B.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[La],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[B.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[La],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],$b={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[La]:400};function Ha(e,t){return Ds(e,t)}function On(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function so(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var mg=!1,$l="draft-2020-12";function _r(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:$l});else if(r.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");mg||(mg=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=Ms(e,{target:$l,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:Mg(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function Mg(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every(o=>o!==null&&typeof o=="object"&&(o.type==="object"||Mg(o)))}return!1}function wb(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function gr(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>wb(o)).join(", ")}:{success:!0,data:r.value}}function Pb(e){let t=Ms(e,{target:$l,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Eb=/\\\.\\d\{(\d+)\}/;function Tb(e){let t=Eb.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>Rt.datetime({local:o,offset:n,precision:s}))))}function kb(e,t){let r;switch(e){case"email":r=[qh()];break;case"uri":r=[Vs()];break;case"date":r=[Rt.date()];break;case"date-time":r=Tb(t);break}return new Set(r.map(o=>Pb(o)).filter(o=>o!==void 0))}function Cb(e,t,r){return r!=="zod"?!0:kb(e,t).has(t)}function Lg(e){let t=_r(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ib(e){try{return _r(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new oe(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Ob=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Fl(e){return Ob.has(e)||e.startsWith("x-")}var Nb=new Set(["$schema",...Object.keys(to.shape.requestedSchema.shape)]),fg={string:On([Qr,wn,Pn,En]),number:On([eo]),integer:On([eo]),boolean:On([$n]),array:On([Tn,kn])},jb=new Set(Qr.shape.format.unwrap().options);function xb(e,t,r,o){if(!xn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(fg,e.type)?fg[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Fl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?jb.has(e.format)?(typeof c!="string"||!Cb(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function Ab(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&xn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,xb(c,`properties.${i}`,t,o)])):Nb.has(n)?r[n]=s:Fl(n)||o.push(n);if(o.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function qb(e,t){if(!xn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Ha(Cn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function wl(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>wl(o,t[n],`${r}[${n}]`)):!xn(e)||!xn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?wl(n,t[o],s):Fl(o)?[]:[s]})}function Mb(e){if(!so(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=Ab(Ib(e.requestedSchema),t),o=Ha(to.shape.requestedSchema,r);if(!o.success)throw new oe(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${qb(r,o.error.message)}`);let n=wl(r,o.data);if(n.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Lb(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Db=Object.assign(Lb,{elicit(e){try{return{method:"elicitation/create",params:Mb(e)}}catch(t){throw t instanceof oe?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Dg=250;function Zg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Ug(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Vg(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var Zb=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Ub={IdJagTokenExchangeResponseSchema:fl,OAuthClientInformationFullSchema:gl,OAuthClientInformationSchema:Na,OAuthClientMetadataSchema:Oa,OAuthClientRegistrationErrorSchema:_l,OAuthErrorResponseSchema:hl,OAuthMetadataSchema:Ca,OAuthProtectedResourceMetadataSchema:dl,OAuthTokenRevocationRequestSchema:Sl,OAuthTokensSchema:ml,OpenIdProviderDiscoveryMetadataSchema:pl,OpenIdProviderMetadataSchema:Ia},Fg={},Hg={};function Jg(e,t){let r=e.slice(0,-6);Fg[r]=t,Hg[r]=o=>t.safeParse(o).success}for(let e of Zb)Jg(e,yb[e]);for(let[e,t]of Object.entries(Ub))Jg(e,t);var Vb=Object.freeze(Fg),Fb=Object.freeze(Hg);function Hb(e){switch(e){case"initialize":case"notifications/initialized":return no(void 0);case"server/discover":return no(ql);default:return}}var Bg=6e4,Jb=[mr,Fr,Pt,Zt],Bb=["inputResponses","requestState"];function hg(e,t){let r=e.params;if(!jn(r))return{message:e,lifted:{}};let o=r._meta,n=jn(o)?Jb.filter(a=>a in o):[],s=t==="request"?Bb.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&jn(o)){let a={},u={...o};for(let d of n)a[d]=o[d],delete u[d];i.envelope=a,Object.keys(u).length>0?c._meta=u:delete c._meta}for(let a of s)a==="inputResponses"&&(i.inputResponses=c[a]),a==="requestState"&&(i.requestState=c[a]),delete c[a];return{message:{...e,params:c},lifted:i}}function gg(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function qn(e){return()=>e}var Kb=qn(void 0);function Hl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:qn(t)}}}var Gb;var Jl=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Gb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Js,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(me.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),Da(n)||Dl(n)?this._onresponse(n):Ml(n)?this._onrequest(n,s):Ll(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=hg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=lg(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(bl(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=hg(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(_,h,f)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:_,message:h,...f!==void 0&&{data:f}}};s?.send(z).catch(y=>this._onerror(new Error(`Failed to send an error response: ${y}`)))};if(t?.classification!==void 0){let _=lg(t.classification);if(_!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${_} but this instance serves ${n.era}`));let h=t.classification.revision??_;i(B.UnsupportedProtocolVersion,`Unsupported protocol version: ${h}`,{supported:this._supportedProtocolVersions,requested:h});return}}if(vl(r.method)&&!n.hasRequestMethod(r.method)&&!(dg(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(B.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(B.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(B.InvalidParams,a);return}let u=(_,h)=>this._notificationViaCodec(this._resolveOutboundCodec(_.method),_,{...h,relatedRequestId:r.id}),d=(_,h,f)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(_.method),_,h,{...f,relatedRequestId:r.id}),m=new AbortController;this._requestHandlerAbortControllers.set(r.id,m);let g=o.inputResponses===void 0?void 0:Wb(o.inputResponses),v={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...g!==void 0&&{inputResponses:g.accepted},...g!==void 0&&g.droppedKeys.length>0&&{droppedInputResponseKeys:g.droppedKeys},requestState:o.requestState===void 0?Kb:qn(o.requestState),signal:m.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),so(h))return d(_,h,f);let y=gg(z,_.method);if(y===void 0)throw new TypeError(`'${_.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(_,y,h)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},p=this.buildContext(v,t);Promise.resolve().then(()=>c(r,p)).then(async _=>{if(m.signal.aborted)return;let h;try{h=n.encodeResult(r.method,_,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),i(B.InternalError,"Internal error");return}let f={result:h,jsonrpc:"2.0",id:r.id};await s?.send(f)},async _=>{if(m.signal.aborted)return;let h=Number.isSafeInteger(_.code)?_.code:B.InternalError,f={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(h),message:_.message??"Internal error",..._.data!==void 0&&{data:_.data}}};await s?.send(f)}).catch(_=>this._onerror(new Error(`Failed to send response: ${_}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===m&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Da(e)?r(e):r(oe.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(so(t))return dg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=gg(o,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return no(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Hb(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(vl(t)&&!e.hasRequestMethod(t))throw new ue(me.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=o??{},a=Date.now(),u,d;return new Promise((m,g)=>{let v=b=>{g(b)};if(!this._transport){v(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(b){v(b);return}if(o?.signal?.aborted){let b=o.signal.reason;throw b instanceof ue?b:new ue(me.RequestTimeout,String(b))}let p=e.era===ql&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,_=this._requestMessageId++;d=_;let h={...t,jsonrpc:"2.0",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),h.params={...t.params,_meta:{...t.params?._meta,progressToken:_}});let f=this._envelopeOutbound(h),z=!1,y=b=>{z||(this._progressHandlers.delete(_),p===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(b)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`))):p.abort(),g(b instanceof ue?b:new ue(me.RequestTimeout,String(b))))};this._responseHandlers.set(_,b=>{if(o?.signal?.aborted)return;if(z=!0,b instanceof Error)return g(b);let S;try{S=e.decodeResult(t.method,b.result)}catch(j){return g(j instanceof Error?j:new Error(String(j)))}if(S.kind==="invalid")return g(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return m(Yb(S));let j={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(F,M)=>this._requestWithSchemaViaCodec(e,F===void 0?{method:t.method}:{method:t.method,params:F},r,M)};return m(this._resolveNonCompleteResult(S,j))}let E=S.result;gr(r,E).then(j=>{j.success?m(j.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${j.error}`))},g)}),u=()=>y(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??Bg,w=()=>y(new ue(me.RequestTimeout,"Request timed out",{timeout:R}));this._setupTimeout(_,R,o?.maxTotalTimeout,w,o?.resetTimeoutOnProgress??!1),this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:p?.signal}).catch(b=>{this._progressHandlers.delete(_),g(b)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),d!==void 0&&(this._responseHandlers.delete(d),this._cleanupTimeout(d))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(me.NotConnected,"Not connected");if(bl(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(me.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!vl(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(r)o=async(n,s)=>{let i=await gr(t.params,{...n.params});if(!i.success)throw new oe(B.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t=="function"){if(!bl(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await gr(t.params,{...o.params});if(!n.success)throw new oe(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function jn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Bl(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=jn(i)&&jn(s)?{...i,...s}:s}return r}function _g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wb(e){let t={},r=[];if(!_g(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!_g(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Yb(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Xb=U((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var a=typeof c=="object"?s(c):c;if(typeof a!="string")throw new TypeError("argument string is required to be a string");var u=a.indexOf(";"),d=u!==-1?a.slice(0,u).trim():a.trim();if(!o.test(d))throw new TypeError("invalid media type");var m=new i(d.toLowerCase());if(u!==-1){var g,v,p;for(t.lastIndex=u;v=t.exec(a);){if(v.index!==u)throw new TypeError("invalid parameter format");u+=v[0].length,g=v[1].toLowerCase(),p=v[2],p.charCodeAt(0)===34&&(p=p.slice(1,-1),p.indexOf("\\")!==-1&&(p=p.replace(r,"$1"))),m.parameters[g]=p}if(u!==a.length)throw new TypeError("invalid parameter format")}return m}function s(c){var a;if(typeof c.getHeader=="function"?a=c.getHeader("content-type"):typeof c.headers=="object"&&(a=c.headers&&c.headers["content-type"]),typeof a!="string")throw new TypeError("content-type header is missing from object");return a}function i(c){this.parameters=Object.create(null),this.type=c}})),Nw=is(Xb(),1);var Kg=10*1024*1024,Kl=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??Kg}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
|
|
60
60
|
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return Gg(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function Gg(e){return dn.parse(JSON.parse(e))}function Gl(e){return JSON.stringify(e)+`
|
|
61
61
|
`}var Qb=/^[A-Za-z0-9._-]{1,128}$/;function ez(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Qb.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function tz(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Wl(e){let t=ez(e);return tz(e,t.warnings),t.isValid}function rz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function oz(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function nz(e){if(typeof e!="object"||e===null||so(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>rz(r))}function Ja(e){if(e!==void 0){if(nz(e))return P(e);if(typeof e=="object"&&e!==null&&!so(e)&&Object.values(e).some(t=>oz(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!so(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}var Ka=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((z,y)=>`${z}${y}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((z,y)=>(y instanceof r&&(z[y.str]=(z[y.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(f,...z){let y=[f[0]],R=0;for(;R<z.length;)c(y,z[R]),y.push(f[++R]);return new o(y)}e._=n;let s=new o("+");function i(f,...z){let y=[v(f[0])],R=0;for(;R<z.length;)y.push(s),c(y,z[R]),y.push(s,v(f[++R]));return a(y),new o(y)}e.str=i;function c(f,z){z instanceof o?f.push(...z._items):z instanceof r?f.push(z):f.push(m(z))}e.addCodeArg=c;function a(f){let z=1;for(;z<f.length-1;){if(f[z]===s){let y=u(f[z-1],f[z+1]);if(y!==void 0){f.splice(z-1,3,y);continue}f[z++]="+"}z++}}function u(f,z){if(z==='""')return f;if(f==='""')return z;if(typeof f=="string")return z instanceof r||f[f.length-1]!=='"'?void 0:typeof z!="string"?`${f.slice(0,-1)}${z}"`:z[0]==='"'?f.slice(0,-1)+z.slice(1):void 0;if(typeof z=="string"&&z[0]==='"'&&!(f instanceof r))return`"${f}${z.slice(1)}`}function d(f,z){return z.emptyStr()?f:f.emptyStr()?z:i`${f}${z}`}e.strConcat=d;function m(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:v(Array.isArray(f)?f.join(","):f)}function g(f){return new o(v(f))}e.stringify=g;function v(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function p(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new o(`.${f}`):n`[${f}]`}e.getProperty=p;function _(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new o(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=_;function h(f){return new o(f.toString())}e.regexpCode=h})),Wg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Ka();var r=class extends Error{constructor(a){super(`CodeGen: "code" for ${a} not defined`),this.value=a.value}},o;(function(a){a[a.Started=0]="Started",a[a.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:a,parent:u}={}){this._names={},this._prefixes=a,this._parent=u}toName(a){return a instanceof t.Name?a:this.name(a)}name(a){return new t.Name(this._newName(a))}_newName(a){let u=this._names[a]||this._nameGroup(a);return`${a}${u.index++}`}_nameGroup(a){var u,d;if(!((d=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||d===void 0)&&d.has(a)||this._prefixes&&!this._prefixes.has(a))throw new Error(`CodeGen: prefix "${a}" is not allowed in this scope`);return this._names[a]={prefix:a,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(a,u){super(u),this.prefix=a}setValue(a,{property:u,itemIndex:d}){this.value=a,this.scopePath=(0,t._)`.${new t.Name(u)}[${d}]`}};e.ValueScopeName=s;let i=(0,t._)`\n`;var c=class extends n{constructor(a){super(a),this._values={},this._scope=a.scope,this.opts={...a,_n:a.lines?i:t.nil}}get(){return this._scope}name(a){return new s(a,this._newName(a))}value(a,u){var d;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let m=this.toName(a),{prefix:g}=m,v=(d=u.key)!==null&&d!==void 0?d:u.ref,p=this._values[g];if(p){let f=p.get(v);if(f)return f}else p=this._values[g]=new Map;p.set(v,m);let _=this._scope[g]||(this._scope[g]=[]),h=_.length;return _[h]=u.ref,m.setValue(u,{property:g,itemIndex:h}),m}getValue(a,u){let d=this._values[a];if(d)return d.get(u)}scopeRefs(a,u=this._values){return this._reduceValues(u,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,t._)`${a}${d.scopePath}`})}scopeCode(a=this._values,u,d){return this._reduceValues(a,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},u,d)}_reduceValues(a,u,d={},m){let g=t.nil;for(let v in a){let p=a[v];if(!p)continue;let _=d[v]=d[v]||new Map;p.forEach(h=>{if(_.has(h))return;_.set(h,o.Started);let f=u(h);if(f){let z=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${z} ${h} = ${f};${this.opts._n}`}else if(f=m?.(h))g=(0,t._)`${g}${f}${this.opts._n}`;else throw new r(h);_.set(h,o.Completed)})}return g}};e.ValueScope=c})),le=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=Ka(),r=Wg();var o=Ka();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=Wg();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames($,k){return this}},i=class extends s{constructor($,k,N){super(),this.varKind=$,this.name=k,this.rhs=N}render({es5:$,_n:k}){let N=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${J};`+k}optimizeNames($,k){if($[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,$,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor($,k,N){super(),this.lhs=$,this.rhs=k,this.sideEffects=N}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,k){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,$,k),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,k,N,J){super($,N,J),this.op=k}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}},u=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}},d=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}},m=class extends s{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}},g=class extends s{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,k){return this.code=G(this.code,$,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},v=class extends s{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((k,N)=>k+N.render($),"")}optimizeNodes(){let{nodes:$}=this,k=$.length;for(;k--;){let N=$[k].optimizeNodes();Array.isArray(N)?$.splice(k,1,...N):N?$[k]=N:$.splice(k,1)}return $.length>0?this:void 0}optimizeNames($,k){let{nodes:N}=this,J=N.length;for(;J--;){let ee=N[J];ee.optimizeNames($,k)||(fe($,ee.names),N.splice(J,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce(($,k)=>Z($,k.names),{})}},p=class extends v{render($){return"{"+$._n+super.render($)+"}"+$._n}},_=class extends v{},h=class extends p{};h.kind="else";var f=class Ba extends p{constructor(k,N){super(N),this.condition=k}render(k){let N=`if(${this.condition})`+super.render(k);return this.else&&(N+="else "+this.else.render(k)),N}optimizeNodes(){super.optimizeNodes();let k=this.condition;if(k===!0)return this.nodes;let N=this.else;if(N){let J=N.optimizeNodes();N=this.else=Array.isArray(J)?new h(J):J}if(N)return k===!1?N instanceof Ba?N:N.nodes:this.nodes.length?this:new Ba($e(k),N instanceof Ba?[N]:N.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,N){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(k,N),!!(super.optimizeNames(k,N)||this.else))return this.condition=G(this.condition,k,N),this}get names(){let k=super.names;return Y(k,this.condition),this.else&&Z(k,this.else.names),k}};f.kind="if";var z=class extends p{};z.kind="for";var y=class extends z{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iteration=G(this.iteration,$,k),this}get names(){return Z(super.names,this.iteration.names)}},R=class extends z{constructor($,k,N,J){super(),this.varKind=$,this.name=k,this.from=N,this.to=J}render($){let k=$.es5?r.varKinds.var:this.varKind,{name:N,from:J,to:ee}=this;return`for(${k} ${N}=${J}; ${N}<${ee}; ${N}++)`+super.render($)}get names(){return Y(Y(super.names,this.from),this.to)}},w=class extends z{constructor($,k,N,J){super(),this.loop=$,this.varKind=k,this.name=N,this.iterable=J}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iterable=G(this.iterable,$,k),this}get names(){return Z(super.names,this.iterable.names)}},b=class extends p{constructor($,k,N){super(),this.name=$,this.args=k,this.async=N}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}};b.kind="func";var S=class extends v{render($){return"return "+super.render($)}};S.kind="return";var E=class extends p{render($){let k="try"+super.render($);return this.catch&&(k+=this.catch.render($)),this.finally&&(k+=this.finally.render($)),k}optimizeNodes(){var $,k;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames($,k){var N,J;return super.optimizeNames($,k),(N=this.catch)===null||N===void 0||N.optimizeNames($,k),(J=this.finally)===null||J===void 0||J.optimizeNames($,k),this}get names(){let $=super.names;return this.catch&&Z($,this.catch.names),this.finally&&Z($,this.finally.names),$}},j=class extends p{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};j.kind="catch";var F=class extends p{render($){return"finally"+super.render($)}};F.kind="finally";var M=class{constructor($,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
62
62
|
`:""},this._extScope=$,this._scope=new r.Scope({parent:$}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,k){let N=this._extScope.value($,k);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue($,k){return this._extScope.getValue($,k)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,k,N,J){let ee=this._scope.toName(k);return N!==void 0&&J&&(this._constants[ee.str]=N),this._leafNode(new i($,ee,N)),ee}const($,k,N){return this._def(r.varKinds.const,$,k,N)}let($,k,N){return this._def(r.varKinds.let,$,k,N)}var($,k,N){return this._def(r.varKinds.var,$,k,N)}assign($,k,N){return this._leafNode(new c($,k,N))}add($,k){return this._leafNode(new a($,e.operators.ADD,k))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){let k=["{"];for(let[N,J]of $)k.length>1&&k.push(","),k.push(N),(N!==J||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,J));return k.push("}"),new t._Code(k)}if($,k,N){if(this._blockNode(new f($)),k&&N)this.code(k).else().code(N).endIf();else if(k)this.code(k).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new f($))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(f,h)}_for($,k){return this._blockNode($),k&&this.code(k).endFor(),this}for($,k){return this._for(new y($),k)}forRange($,k,N,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,k,N),()=>J(pe))}forOf($,k,N,J=r.varKinds.const){let ee=this._scope.toName($);if(this.opts.es5){let pe=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${pe}.length`,ie=>{this.var(ee,(0,t._)`${pe}[${ie}]`),N(ee)})}return this._for(new w("of",J,ee,k),()=>N(ee))}forIn($,k,N,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${k})`,N);let ee=this._scope.toName($);return this._for(new w("in",J,ee,k),()=>N(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let k=new S;if(this._blockNode(k),this.code($),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try($,k,N){if(!k&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code($),k){let ee=this.name("e");this._currNode=J.catch=new j(ee),k(ee)}return N&&(this._currNode=J.finally=new F,this.code(N)),this._endBlockNode(j,F)}throw($){return this._leafNode(new m($))}block($,k){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(k),this}endBlock($){let k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");let N=this._nodes.length-k;if(N<0||$!==void 0&&N!==$)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${$} expected`);return this._nodes.length=k,this}func($,k=t.nil,N,J){return this._blockNode(new b($,k,N)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,k){let N=this._currNode;if(N instanceof $||k&&N instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${$.kind}/${k.kind}`:$.kind}"`)}_elseNode($){let k=this._currNode;if(!(k instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let k=this._nodes;k[k.length-1]=$}};e.CodeGen=M;function Z($,k){for(let N in k)$[N]=($[N]||0)+(k[N]||0);return $}function Y($,k){return k instanceof t._CodeOrName?Z($,k.names):$}function G($,k,N){if($ instanceof t.Name)return J($);if(!ee($))return $;return new t._Code($._items.reduce((pe,ie)=>(ie instanceof t.Name&&(ie=J(ie)),ie instanceof t._Code?pe.push(...ie._items):pe.push(ie),pe),[]));function J(pe){let ie=N[pe.str];return ie===void 0||k[pe.str]!==1?pe:(delete k[pe.str],ie)}function ee(pe){return pe instanceof t._Code&&pe._items.some(ie=>ie instanceof t.Name&&k[ie.str]===1&&N[ie.str]!==void 0)}}function fe($,k){for(let N in k)$[N]=($[N]||0)-(k[N]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${V($)}`}e.not=$e;let be=x(e.operators.AND);function Oe(...$){return $.reduce(be)}e.and=Oe;let he=x(e.operators.OR);function C(...$){return $.reduce(he)}e.or=C;function x($){return(k,N)=>k===t.nil?N:N===t.nil?k:(0,t._)`${V(k)} ${$} ${V(N)}`}function V($){return $ instanceof t.Name?$:(0,t._)`(${$})`}})),_e=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=le(),r=Ka();function o(b){let S={};for(let E of b)S[E]=!0;return S}e.toHash=o;function n(b,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(s(b,S),!i(S,b.self.RULES.all))}e.alwaysValidSchema=n;function s(b,S=b.schema){let{opts:E,self:j}=b;if(!E.strictSchema||typeof S=="boolean")return;let F=j.RULES.keywords;for(let M in S)F[M]||w(b,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function i(b,S){if(typeof b=="boolean")return!b;for(let E in b)if(S[E])return!0;return!1}e.schemaHasRules=i;function c(b,S){if(typeof b=="boolean")return!b;for(let E in b)if(E!=="$ref"&&S.all[E])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:b,schemaPath:S},E,j,F){if(!F){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${b}${S}${(0,t.getProperty)(j)}`}e.schemaRefOrVal=a;function u(b){return g(decodeURIComponent(b))}e.unescapeFragment=u;function d(b){return encodeURIComponent(m(b))}e.escapeFragment=d;function m(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=m;function g(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=g;function v(b,S){if(Array.isArray(b))for(let E of b)S(E);else S(b)}e.eachItem=v;function p({mergeNames:b,mergeToName:S,mergeValues:E,resultToName:j}){return(F,M,Z,Y)=>{let G=Z===void 0?M:Z instanceof t.Name?(M instanceof t.Name?b(F,M,Z):S(F,M,Z),Z):M instanceof t.Name?(S(F,Z,M),M):E(M,Z);return Y===t.Name&&!(G instanceof t.Name)?j(F,G):G}}e.mergeEvaluated={props:p({mergeNames:(b,S,E)=>b.if((0,t._)`${E} !== true && ${S} !== undefined`,()=>{b.if((0,t._)`${S} === true`,()=>b.assign(E,!0),()=>b.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${S})`))}),mergeToName:(b,S,E)=>b.if((0,t._)`${E} !== true`,()=>{S===!0?b.assign(E,!0):(b.assign(E,(0,t._)`${E} || {}`),h(b,E,S))}),mergeValues:(b,S)=>b===!0?!0:{...b,...S},resultToName:_}),items:p({mergeNames:(b,S,E)=>b.if((0,t._)`${E} !== true && ${S} !== undefined`,()=>b.assign(E,(0,t._)`${S} === true ? true : ${E} > ${S} ? ${E} : ${S}`)),mergeToName:(b,S,E)=>b.if((0,t._)`${E} !== true`,()=>b.assign(E,S===!0?!0:(0,t._)`${E} > ${S} ? ${E} : ${S}`)),mergeValues:(b,S)=>b===!0?!0:Math.max(b,S),resultToName:(b,S)=>b.var("items",S)})};function _(b,S){if(S===!0)return b.var("props",!0);let E=b.var("props",(0,t._)`{}`);return S!==void 0&&h(b,E,S),E}e.evaluatedPropsToName=_;function h(b,S,E){Object.keys(E).forEach(j=>b.assign((0,t._)`${S}${(0,t.getProperty)(j)}`,!0))}e.setEvaluated=h;let f={};function z(b,S){return b.scopeValue("func",{ref:S,code:f[S.code]||(f[S.code]=new r._Code(S.code))})}e.useFunc=z;var y;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(y||(e.Type=y={}));function R(b,S,E){if(b instanceof t.Name){let j=S===y.Num;return E?j?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:j?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(b).toString():"/"+m(b)}e.getErrorPath=R;function w(b,S,E=b.opts.strictSchema){if(E){if(S=`strict mode: ${S}`,E===!0)throw new Error(S);b.self.logger.warn(S)}}e.checkStrictMode=w})),dt=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r})),Wa=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=le(),r=_e(),o=dt();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:f})=>f?(0,t.str)`"${h}" keyword must be ${f} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function n(h,f=e.keywordError,z,y){let{it:R}=h,{gen:w,compositeRule:b,allErrors:S}=R,E=m(h,f,z);y??(b||S)?a(w,E):u(R,(0,t._)`[${E}]`)}e.reportError=n;function s(h,f=e.keywordError,z){let{it:y}=h,{gen:R,compositeRule:w,allErrors:b}=y;a(R,m(h,f,z)),w||b||u(y,o.default.vErrors)}e.reportExtraError=s;function i(h,f){h.assign(o.default.errors,f),h.if((0,t._)`${o.default.vErrors} !== null`,()=>h.if(f,()=>h.assign((0,t._)`${o.default.vErrors}.length`,f),()=>h.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function c({gen:h,keyword:f,schemaValue:z,data:y,errsCount:R,it:w}){if(R===void 0)throw new Error("ajv implementation error");let b=h.name("err");h.forRange("i",R,o.default.errors,S=>{h.const(b,(0,t._)`${o.default.vErrors}[${S}]`),h.if((0,t._)`${b}.instancePath === undefined`,()=>h.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(o.default.instancePath,w.errorPath))),h.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${w.errSchemaPath}/${f}`),w.opts.verbose&&(h.assign((0,t._)`${b}.schema`,z),h.assign((0,t._)`${b}.data`,y))})}e.extendErrors=c;function a(h,f){let z=h.const("err",f);h.if((0,t._)`${o.default.vErrors} === null`,()=>h.assign(o.default.vErrors,(0,t._)`[${z}]`),(0,t._)`${o.default.vErrors}.push(${z})`),h.code((0,t._)`${o.default.errors}++`)}function u(h,f){let{gen:z,validateName:y,schemaEnv:R}=h;R.$async?z.throw((0,t._)`new ${h.ValidationError}(${f})`):(z.assign((0,t._)`${y}.errors`,f),z.return(!1))}let d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(h,f,z){let{createErrors:y}=h.it;return y===!1?(0,t._)`{}`:g(h,f,z)}function g(h,f,z={}){let{gen:y,it:R}=h,w=[v(R,z),p(h,z)];return _(h,f,w),y.object(...w)}function v({errorPath:h},{instancePath:f}){let z=f?(0,t.str)`${h}${(0,r.getErrorPath)(f,r.Type.Str)}`:h;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)]}function p({keyword:h,it:{errSchemaPath:f}},{schemaPath:z,parentSchema:y}){let R=y?f:(0,t.str)`${f}/${h}`;return z&&(R=(0,t.str)`${R}${(0,r.getErrorPath)(z,r.Type.Str)}`),[d.schemaPath,R]}function _(h,{params:f,message:z},y){let{keyword:R,data:w,schemaValue:b,it:S}=h,{opts:E,propertyName:j,topSchemaRef:F,schemaPath:M}=S;y.push([d.keyword,R],[d.params,typeof f=="function"?f(h):f||(0,t._)`{}`]),E.messages&&y.push([d.message,typeof z=="function"?z(h):z]),E.verbose&&y.push([d.schema,b],[d.parentSchema,(0,t._)`${F}${M}`],[o.default.data,w]),j&&y.push([d.propertyName,j])}})),sz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Wa(),r=le(),o=dt(),n={message:"boolean schema is false"};function s(a){let{gen:u,schema:d,validateName:m}=a;d===!1?c(a,!1):typeof d=="object"&&d.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${m}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function i(a,u){let{gen:d,schema:m}=a;m===!1?(d.var(u,!1),c(a)):d.var(u,!0)}e.boolOrEmptySchema=i;function c(a,u){let{gen:d,data:m}=a,g={gen:d,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(g,n,void 0,u)}})),Yg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o})),Xg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let c=s.RULES.types[i];return c&&c!==!0&&r(n,c)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some(i=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(c=>n[c]!==void 0))}e.shouldUseRule=o})),Ga=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=Yg(),r=Xg(),o=Wa(),n=le(),s=_e();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(y){let R=a(y.type);if(R.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!R.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&R.push("null")}return R}e.getSchemaTypes=c;function a(y){let R=Array.isArray(y)?y:y?[y]:[];if(R.every(t.isJSONType))return R;throw new Error("type must be JSONType or JSONType[]: "+R.join(","))}e.getJSONTypes=a;function u(y,R){let{gen:w,data:b,opts:S}=y,E=m(R,S.coerceTypes),j=R.length>0&&!(E.length===0&&R.length===1&&(0,r.schemaHasRulesForType)(y,R[0]));if(j){let F=_(R,b,S.strictNumbers,i.Wrong);w.if(F,()=>{E.length?g(y,R,E):f(y)})}return j}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function m(y,R){return R?y.filter(w=>d.has(w)||R==="array"&&w==="array"):[]}function g(y,R,w){let{gen:b,data:S,opts:E}=y,j=b.let("dataType",(0,n._)`typeof ${S}`),F=b.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&b.if((0,n._)`${j} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>b.assign(S,(0,n._)`${S}[0]`).assign(j,(0,n._)`typeof ${S}`).if(_(R,S,E.strictNumbers),()=>b.assign(F,S))),b.if((0,n._)`${F} !== undefined`);for(let Z of w)(d.has(Z)||Z==="array"&&E.coerceTypes==="array")&&M(Z);b.else(),f(y),b.endIf(),b.if((0,n._)`${F} !== undefined`,()=>{b.assign(S,F),v(y,F)});function M(Z){switch(Z){case"string":b.elseIf((0,n._)`${j} == "number" || ${j} == "boolean"`).assign(F,(0,n._)`"" + ${S}`).elseIf((0,n._)`${S} === null`).assign(F,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${j} == "boolean" || ${S} === null
|
|
@@ -65,9 +65,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
65
65
|
|| ${j} === "boolean" || ${S} === null`).assign(F,(0,n._)`[${S}]`)}}}function v({gen:y,parentData:R,parentDataProperty:w},b){y.if((0,n._)`${R} !== undefined`,()=>y.assign((0,n._)`${R}[${w}]`,b))}function p(y,R,w,b=i.Correct){let S=b===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(y){case"null":return(0,n._)`${R} ${S} null`;case"array":E=(0,n._)`Array.isArray(${R})`;break;case"object":E=(0,n._)`${R} && typeof ${R} == "object" && !Array.isArray(${R})`;break;case"integer":E=j((0,n._)`!(${R} % 1) && !isNaN(${R})`);break;case"number":E=j();break;default:return(0,n._)`typeof ${R} ${S} ${y}`}return b===i.Correct?E:(0,n.not)(E);function j(F=n.nil){return(0,n.and)((0,n._)`typeof ${R} == "number"`,F,w?(0,n._)`isFinite(${R})`:n.nil)}}e.checkDataType=p;function _(y,R,w,b){if(y.length===1)return p(y[0],R,w,b);let S,E=(0,s.toHash)(y);if(E.array&&E.object){let j=(0,n._)`typeof ${R} != "object"`;S=E.null?j:(0,n._)`!${R} || ${j}`,delete E.null,delete E.array,delete E.object}else S=n.nil;E.number&&delete E.integer;for(let j in E)S=(0,n.and)(S,p(j,R,w,b));return S}e.checkDataTypes=_;let h={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:R})=>typeof y=="string"?(0,n._)`{type: ${y}}`:(0,n._)`{type: ${R}}`};function f(y){let R=z(y);(0,o.reportError)(R,h)}e.reportTypeError=f;function z(y){let{gen:R,data:w,schema:b}=y,S=(0,s.schemaRefOrVal)(y,b,"type");return{gen:R,keyword:"type",data:w,schema:b.type,schemaCode:S,schemaValue:S,parentSchema:b,params:{},it:y}}})),iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=le(),r=_e();function o(s,i){let{properties:c,items:a}=s.schema;if(i==="object"&&c)for(let u in c)n(s,u,c[u].default);else i==="array"&&Array.isArray(a)&&a.forEach((u,d)=>n(s,d,u.default))}e.assignDefaults=o;function n(s,i,c){let{gen:a,compositeRule:u,data:d,opts:m}=s;if(c===void 0)return;let g=(0,t._)`${d}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${g}`);return}let v=(0,t._)`${g} === undefined`;m.useDefaults==="empty"&&(v=(0,t._)`${v} || ${g} === null || ${g} === ""`),a.if(v,(0,t._)`${g} = ${(0,t.stringify)(c)}`)}})),pt=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=le(),r=_e(),o=dt(),n=_e();function s(y,R){let{gen:w,data:b,it:S}=y;w.if(m(w,b,R,S.opts.ownProperties),()=>{y.setParams({missingProperty:(0,t._)`${R}`},!0),y.error()})}e.checkReportMissingProp=s;function i({gen:y,data:R,it:{opts:w}},b,S){return(0,t.or)(...b.map(E=>(0,t.and)(m(y,R,E,w.ownProperties),(0,t._)`${S} = ${E}`)))}e.checkMissingProp=i;function c(y,R){y.setParams({missingProperty:R},!0),y.error()}e.reportMissingProp=c;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(y,R,w){return(0,t._)`${a(y)}.call(${R}, ${w})`}e.isOwnProperty=u;function d(y,R,w,b){let S=(0,t._)`${R}${(0,t.getProperty)(w)} !== undefined`;return b?(0,t._)`${S} && ${u(y,R,w)}`:S}e.propertyInData=d;function m(y,R,w,b){let S=(0,t._)`${R}${(0,t.getProperty)(w)} === undefined`;return b?(0,t.or)(S,(0,t.not)(u(y,R,w))):S}e.noPropertyInData=m;function g(y){return y?Object.keys(y).filter(R=>R!=="__proto__"):[]}e.allSchemaProperties=g;function v(y,R){return g(R).filter(w=>!(0,r.alwaysValidSchema)(y,R[w]))}e.schemaProperties=v;function p({schemaCode:y,data:R,it:{gen:w,topSchemaRef:b,schemaPath:S,errorPath:E},it:j},F,M,Z){let Y=Z?(0,t._)`${y}, ${R}, ${b}${S}`:R,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,j.parentData],[o.default.parentDataProperty,j.parentDataProperty],[o.default.rootData,o.default.rootData]];j.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let fe=(0,t._)`${Y}, ${w.object(...G)}`;return M!==t.nil?(0,t._)`${F}.call(${M}, ${fe})`:(0,t._)`${F}(${fe})`}e.callValidateCode=p;let _=(0,t._)`new RegExp`;function h({gen:y,it:{opts:R}},w){let b=R.unicodeRegExp?"u":"",{regExp:S}=R.code,E=S(w,b);return y.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,t._)`${S.code==="new RegExp"?_:(0,n.useFunc)(y,S)}(${w}, ${b})`})}e.usePattern=h;function f(y){let{gen:R,data:w,keyword:b,it:S}=y,E=R.name("valid");if(S.allErrors){let F=R.let("valid",!0);return j(()=>R.assign(F,!1)),F}return R.var(E,!0),j(()=>R.break()),E;function j(F){let M=R.const("len",(0,t._)`${w}.length`);R.forRange("i",0,M,Z=>{y.subschema({keyword:b,dataProp:Z,dataPropType:r.Type.Num},E),R.if((0,t.not)(E),F)})}}e.validateArray=f;function z(y){let{gen:R,schema:w,keyword:b,it:S}=y;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(F=>(0,r.alwaysValidSchema)(S,F))&&!S.opts.unevaluated)return;let E=R.let("valid",!1),j=R.name("_valid");R.block(()=>w.forEach((F,M)=>{let Z=y.subschema({keyword:b,schemaProp:M,compositeRule:!0},j);R.assign(E,(0,t._)`${E} || ${j}`),y.mergeValidEvaluated(Z,j)||R.if((0,t.not)(E))})),y.result(E,()=>y.reset(),()=>y.error(!0))}e.validateUnion=z})),az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=dt(),o=pt(),n=Wa();function s(v,p){let{gen:_,keyword:h,schema:f,parentSchema:z,it:y}=v,R=p.macro.call(y.self,f,z,y),w=d(_,h,R);y.opts.validateSchema!==!1&&y.self.validateSchema(R,!0);let b=_.name("valid");v.subschema({schema:R,schemaPath:t.nil,errSchemaPath:`${y.errSchemaPath}/${h}`,topSchemaRef:w,compositeRule:!0},b),v.pass(b,()=>v.error(!0))}e.macroKeywordCode=s;function i(v,p){var _;let{gen:h,keyword:f,schema:z,parentSchema:y,$data:R,it:w}=v;u(w,p);let b=d(h,f,!R&&p.compile?p.compile.call(w.self,z,y,w):p.validate),S=h.let("valid");v.block$data(S,E),v.ok((_=p.valid)!==null&&_!==void 0?_:S);function E(){if(p.errors===!1)M(),p.modifying&&c(v),Z(()=>v.error());else{let Y=p.async?j():F();p.modifying&&c(v),Z(()=>a(v,Y))}}function j(){let Y=h.let("ruleErrs",null);return h.try(()=>M((0,t._)`await `),G=>h.assign(S,!1).if((0,t._)`${G} instanceof ${w.ValidationError}`,()=>h.assign(Y,(0,t._)`${G}.errors`),()=>h.throw(G))),Y}function F(){let Y=(0,t._)`${b}.errors`;return h.assign(Y,null),M(t.nil),Y}function M(Y=p.async?(0,t._)`await `:t.nil){let G=w.opts.passContext?r.default.this:r.default.self,fe=!("compile"in p&&!R||p.schema===!1);h.assign(S,(0,t._)`${Y}${(0,o.callValidateCode)(v,b,G,fe)}`,p.modifying)}function Z(Y){var G;h.if((0,t.not)((G=p.valid)!==null&&G!==void 0?G:S),Y)}}e.funcKeywordCode=i;function c(v){let{gen:p,data:_,it:h}=v;p.if(h.parentData,()=>p.assign(_,(0,t._)`${h.parentData}[${h.parentDataProperty}]`))}function a(v,p){let{gen:_}=v;_.if((0,t._)`Array.isArray(${p})`,()=>{_.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${p} : ${r.default.vErrors}.concat(${p})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(v)},()=>v.error())}function u({schemaEnv:v},p){if(p.async&&!v.$async)throw new Error("async keyword in sync schema")}function d(v,p,_){if(_===void 0)throw new Error(`keyword "${p}" failed to compile`);return v.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,t.stringify)(_)})}function m(v,p,_=!1){return!p.length||p.some(h=>h==="array"?Array.isArray(v):h==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==h||_&&typeof v>"u")}e.validSchemaType=m;function g({schema:v,opts:p,self:_,errSchemaPath:h},f,z){if(Array.isArray(f.keyword)?!f.keyword.includes(z):f.keyword!==z)throw new Error("ajv implementation error");let y=f.dependencies;if(y?.some(R=>!Object.prototype.hasOwnProperty.call(v,R)))throw new Error(`parent schema must have dependencies of ${z}: ${y.join(",")}`);if(f.validateSchema&&!f.validateSchema(v[z])){let R=`keyword "${z}" value is invalid at path "${h}": `+_.errorsText(f.validateSchema.errors);if(p.validateSchema==="log")_.logger.error(R);else throw new Error(R)}}e.validateKeywordUsage=g})),cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=le(),r=_e();function o(i,{keyword:c,schemaProp:a,schema:u,schemaPath:d,errSchemaPath:m,topSchemaRef:g}){if(c!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){let v=i.schema[c];return a===void 0?{schema:v,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${c}`}:{schema:v[a],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(c)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${c}/${(0,r.escapeFragment)(a)}`}}if(u!==void 0){if(d===void 0||m===void 0||g===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:g,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,c,{dataProp:a,dataPropType:u,data:d,dataTypes:m,propertyName:g}){if(d!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:v}=c;if(a!==void 0){let{errorPath:_,dataPathArr:h,opts:f}=c;p(v.let("data",(0,t._)`${c.data}${(0,t.getProperty)(a)}`,!0)),i.errorPath=(0,t.str)`${_}${(0,r.getErrorPath)(a,u,f.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[...h,i.parentDataProperty]}d!==void 0&&(p(d instanceof t.Name?d:v.let("data",d,!0)),g!==void 0&&(i.propertyName=g)),m&&(i.dataTypes=m);function p(_){i.data=_,i.dataLevel=c.dataLevel+1,i.dataTypes=[],c.definedProperties=new Set,i.parentData=c.data,i.dataNames=[...c.dataNames,_]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:c,jtdMetadata:a,compositeRule:u,createErrors:d,allErrors:m}){u!==void 0&&(i.compositeRule=u),d!==void 0&&(i.createErrors=d),m!==void 0&&(i.allErrors=m),i.jtdDiscriminator=c,i.jtdMetadata=a}e.extendSubschemaMode=s})),Qg=U(((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,c;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(c=Object.keys(o),s=c.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[i]))return!1;for(i=s;i--!==0;){var a=c[i];if(!r(o[a],n[a]))return!1}return!0}return o!==o&&n!==n}})),uz=U(((e,t)=>{var r=t.exports=function(s,i,c){typeof i=="function"&&(c=i,i={}),c=i.cb||c;var a=typeof c=="function"?c:c.pre||function(){},u=c.post||function(){};o(i,a,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,c,a,u,d,m,g,v,p){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,u,d,m,g,v,p);for(var _ in a){var h=a[_];if(Array.isArray(h)){if(_ in r.arrayKeywords)for(var f=0;f<h.length;f++)o(s,i,c,h[f],u+"/"+_+"/"+f,d,u,_,a,f)}else if(_ in r.propsKeywords){if(h&&typeof h=="object")for(var z in h)o(s,i,c,h[z],u+"/"+_+"/"+n(z),d,u,_,a,z)}else(_ in r.keywords||s.allKeys&&!(_ in r.skipKeywords))&&o(s,i,c,h,u+"/"+_,d,u,_,a)}c(a,u,d,m,g,v,p)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}})),Ya=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=_e(),r=Qg(),o=uz(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(h,f=!0){return typeof h=="boolean"?!0:f===!0?!c(h):f?a(h)<=f:!1}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(h){for(let f in h){if(i.has(f))return!0;let z=h[f];if(Array.isArray(z)&&z.some(c)||typeof z=="object"&&c(z))return!0}return!1}function a(h){let f=0;for(let z in h){if(z==="$ref")return 1/0;if(f++,!n.has(z)&&(typeof h[z]=="object"&&(0,t.eachItem)(h[z],y=>f+=a(y)),f===1/0))return 1/0}return f}function u(h,f="",z){return z!==!1&&(f=g(f)),d(h,h.parse(f))}e.getFullPath=u;function d(h,f){return h.serialize(f).split("#")[0]+"#"}e._getFullPath=d;let m=/#\/?$/;function g(h){return h?h.replace(m,""):""}e.normalizeId=g;function v(h,f,z){return z=g(z),h.resolve(f,z)}e.resolveUrl=v;let p=/^[a-z_][-a-z0-9._]*$/i;function _(h,f){if(typeof h=="boolean")return{};let{schemaId:z,uriResolver:y}=this.opts,R=g(h[z]||f),w={"":R},b=u(y,R,!1),S={},E=new Set;return o(h,{allKeys:!0},(M,Z,Y,G)=>{if(G===void 0)return;let fe=b+Z,$e=w[G];typeof M[z]=="string"&&($e=be.call(this,M[z])),Oe.call(this,M.$anchor),Oe.call(this,M.$dynamicAnchor),w[Z]=$e;function be(he){let C=this.opts.uriResolver.resolve;if(he=g($e?C($e,he):he),E.has(he))throw F(he);E.add(he);let x=this.refs[he];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?j(M,x.schema,he):he!==g(fe)&&(he[0]==="#"?(j(M,S[he],he),S[he]=M):this.refs[he]=fe),he}function Oe(he){if(typeof he=="string"){if(!p.test(he))throw new Error(`invalid anchor "${he}"`);be.call(this,`#${he}`)}}}),S;function j(M,Z,Y){if(Z!==void 0&&!r(M,Z))throw F(Y)}function F(M){return new Error(`reference "${M}" resolves to more than one schema`)}}e.getSchemaRefs=_})),io=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=sz(),r=Ga(),o=Xg(),n=Ga(),s=iz(),i=az(),c=cz(),a=le(),u=dt(),d=Ya(),m=_e(),g=Wa();function v(T){if(b(T)&&(E(T),w(T))){f(T);return}p(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=v;function p({gen:T,validateName:A,schema:D,schemaEnv:ne,opts:se},de){se.code.es5?T.func(A,(0,a._)`${u.default.data}, ${u.default.valCxt}`,ne.$async,()=>{T.code((0,a._)`"use strict"; ${y(D,se)}`),h(T,se),T.code(de)}):T.func(A,(0,a._)`${u.default.data}, ${_(se)}`,ne.$async,()=>T.code(y(D,se)).code(de))}function _(T){return(0,a._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function h(T,A){T.if(u.default.valCxt,()=>{T.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),T.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{T.var(u.default.instancePath,(0,a._)`""`),T.var(u.default.parentData,(0,a._)`undefined`),T.var(u.default.parentDataProperty,(0,a._)`undefined`),T.var(u.default.rootData,u.default.data),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function f(T){let{schema:A,opts:D,gen:ne}=T;p(T,()=>{D.$comment&&A.$comment&&G(T),M(T),ne.let(u.default.vErrors,null),ne.let(u.default.errors,0),D.unevaluated&&z(T),j(T),fe(T)})}function z(T){let{gen:A,validateName:D}=T;T.evaluated=A.const("evaluated",(0,a._)`${D}.evaluated`),A.if((0,a._)`${T.evaluated}.dynamicProps`,()=>A.assign((0,a._)`${T.evaluated}.props`,(0,a._)`undefined`)),A.if((0,a._)`${T.evaluated}.dynamicItems`,()=>A.assign((0,a._)`${T.evaluated}.items`,(0,a._)`undefined`))}function y(T,A){let D=typeof T=="object"&&T[A.schemaId];return D&&(A.code.source||A.code.process)?(0,a._)`/*# sourceURL=${D} */`:a.nil}function R(T,A){if(b(T)&&(E(T),w(T))){S(T,A);return}(0,t.boolOrEmptySchema)(T,A)}function w({schema:T,self:A}){if(typeof T=="boolean")return!T;for(let D in T)if(A.RULES.all[D])return!0;return!1}function b(T){return typeof T.schema!="boolean"}function S(T,A){let{schema:D,gen:ne,opts:se}=T;se.$comment&&D.$comment&&G(T),Z(T),Y(T);let de=ne.const("_errs",u.default.errors);j(T,de),ne.var(A,(0,a._)`${de} === ${u.default.errors}`)}function E(T){(0,m.checkUnknownRules)(T),F(T)}function j(T,A){if(T.opts.jtd)return be(T,[],!1,A);let D=(0,r.getSchemaTypes)(T.schema);be(T,D,!(0,r.coerceAndCheckDataType)(T,D),A)}function F(T){let{schema:A,errSchemaPath:D,opts:ne,self:se}=T;A.$ref&&ne.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(A,se.RULES)&&se.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function M(T){let{schema:A,opts:D}=T;A.default!==void 0&&D.useDefaults&&D.strictSchema&&(0,m.checkStrictMode)(T,"default is ignored in the schema root")}function Z(T){let A=T.schema[T.opts.schemaId];A&&(T.baseId=(0,d.resolveUrl)(T.opts.uriResolver,T.baseId,A))}function Y(T){if(T.schema.$async&&!T.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:T,schemaEnv:A,schema:D,errSchemaPath:ne,opts:se}){let de=D.$comment;if(se.$comment===!0)T.code((0,a._)`${u.default.self}.logger.log(${de})`);else if(typeof se.$comment=="function"){let Ce=(0,a.str)`${ne}/$comment`,je=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${Ce}, ${je}.schema)`)}}function fe(T){let{gen:A,schemaEnv:D,validateName:ne,ValidationError:se,opts:de}=T;D.$async?A.if((0,a._)`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw((0,a._)`new ${se}(${u.default.vErrors})`)):(A.assign((0,a._)`${ne}.errors`,u.default.vErrors),de.unevaluated&&$e(T),A.return((0,a._)`${u.default.errors} === 0`))}function $e({gen:T,evaluated:A,props:D,items:ne}){D instanceof a.Name&&T.assign((0,a._)`${A}.props`,D),ne instanceof a.Name&&T.assign((0,a._)`${A}.items`,ne)}function be(T,A,D,ne){let{gen:se,schema:de,data:Ce,allErrors:je,opts:Ue,self:Ne}=T,{RULES:we}=Ne;if(de.$ref&&(Ue.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(de,we))){se.block(()=>pe(T,"$ref",we.all.$ref.definition));return}Ue.jtd||he(T,A),se.block(()=>{for(let Ae of we.rules)ot(Ae);ot(we.post)});function ot(Ae){(0,o.shouldUseGroup)(de,Ae)&&(Ae.type?(se.if((0,n.checkDataType)(Ae.type,Ce,Ue.strictNumbers)),Oe(T,Ae),A.length===1&&A[0]===Ae.type&&D&&(se.else(),(0,n.reportTypeError)(T)),se.endIf()):Oe(T,Ae),je||se.if((0,a._)`${u.default.errors} === ${ne||0}`))}}function Oe(T,A){let{gen:D,schema:ne,opts:{useDefaults:se}}=T;se&&(0,s.assignDefaults)(T,A.type),D.block(()=>{for(let de of A.rules)(0,o.shouldUseRule)(ne,de)&&pe(T,de.keyword,de.definition,A.type)})}function he(T,A){T.schemaEnv.meta||!T.opts.strictTypes||(C(T,A),T.opts.allowUnionTypes||x(T,A),V(T,T.dataTypes))}function C(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(D=>{k(T.dataTypes,D)||J(T,`type "${D}" not allowed by context "${T.dataTypes.join(",")}"`)}),N(T,A)}}function x(T,A){A.length>1&&!(A.length===2&&A.includes("null"))&&J(T,"use allowUnionTypes to allow union type keyword")}function V(T,A){let D=T.self.RULES.all;for(let ne in D){let se=D[ne];if(typeof se=="object"&&(0,o.shouldUseRule)(T.schema,se)){let{type:de}=se.definition;de.length&&!de.some(Ce=>$(A,Ce))&&J(T,`missing type "${de.join(",")}" for keyword "${ne}"`)}}}function $(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function k(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function N(T,A){let D=[];for(let ne of T.dataTypes)k(A,ne)?D.push(ne):A.includes("integer")&&ne==="number"&&D.push("integer");T.dataTypes=D}function J(T,A){let D=T.schemaEnv.baseId+T.errSchemaPath;A+=` at "${D}" (strictTypes)`,(0,m.checkStrictMode)(T,A,T.opts.strictTypes)}var ee=class{constructor(T,A,D){if((0,i.validateKeywordUsage)(T,A,D),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=D,this.data=T.data,this.schema=T.schema[D],this.$data=A.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(T,this.schema,D,this.$data),this.schemaType=A.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=A,this.$data)this.schemaCode=T.gen.const("vSchema",Be(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=T.gen.const("_errs",u.default.errors))}result(T,A,D){this.failResult((0,a.not)(T),A,D)}failResult(T,A,D){this.gen.if(T),D?D():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(T,A){this.failResult((0,a.not)(T),void 0,A)}fail(T){if(T===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(T),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);let{schemaCode:A}=this;this.fail((0,a._)`${A} !== undefined && (${(0,a.or)(this.invalid$data(),T)})`)}error(T,A,D){if(A){this.setParams(A),this._error(T,D),this.setParams({});return}this._error(T,D)}_error(T,A){(T?g.reportExtraError:g.reportError)(this,this.def.error,A)}$dataError(){(0,g.reportError)(this,this.def.$dataError||g.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,g.resetErrorsCount)(this.gen,this.errsCount)}ok(T){this.allErrors||this.gen.if(T)}setParams(T,A){A?Object.assign(this.params,T):this.params=T}block$data(T,A,D=a.nil){this.gen.block(()=>{this.check$data(T,D),A()})}check$data(T=a.nil,A=a.nil){if(!this.$data)return;let{gen:D,schemaCode:ne,schemaType:se,def:de}=this;D.if((0,a.or)((0,a._)`${ne} === undefined`,A)),T!==a.nil&&D.assign(T,!0),(se.length||de.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),T!==a.nil&&D.assign(T,!1)),D.else()}invalid$data(){let{gen:T,schemaCode:A,schemaType:D,def:ne,it:se}=this;return(0,a.or)(de(),Ce());function de(){if(D.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");let je=Array.isArray(D)?D:[D];return(0,a._)`${(0,n.checkDataTypes)(je,A,se.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Ce(){if(ne.validateSchema){let je=T.scopeValue("validate$data",{ref:ne.validateSchema});return(0,a._)`!${je}(${A})`}return a.nil}}subschema(T,A){let D=(0,c.getSubschema)(this.it,T);(0,c.extendSubschemaData)(D,this.it,T),(0,c.extendSubschemaMode)(D,T);let ne={...this.it,...D,items:void 0,props:void 0};return R(ne,A),ne}mergeEvaluated(T,A){let{it:D,gen:ne}=this;D.opts.unevaluated&&(D.props!==!0&&T.props!==void 0&&(D.props=m.mergeEvaluated.props(ne,T.props,D.props,A)),D.items!==!0&&T.items!==void 0&&(D.items=m.mergeEvaluated.items(ne,T.items,D.items,A)))}mergeValidEvaluated(T,A){let{it:D,gen:ne}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return ne.if(A,()=>this.mergeEvaluated(T,a.Name)),!0}};e.KeywordCxt=ee;function pe(T,A,D,ne){let se=new ee(T,D,A);"code"in D?D.code(se,ne):se.$data&&D.validate?(0,i.funcKeywordCode)(se,D):"macro"in D?(0,i.macroKeywordCode)(se,D):(D.compile||D.validate)&&(0,i.funcKeywordCode)(se,D)}let ie=/^\/(?:[^~]|~0|~1)*$/,ze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Be(T,{dataLevel:A,dataNames:D,dataPathArr:ne}){let se,de;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!ie.test(T))throw new Error(`Invalid JSON-pointer: ${T}`);se=T,de=u.default.rootData}else{let Ne=ze.exec(T);if(!Ne)throw new Error(`Invalid JSON-pointer: ${T}`);let we=+Ne[1];if(se=Ne[2],se==="#"){if(we>=A)throw new Error(Ue("property/index",we));return ne[A-we]}if(we>A)throw new Error(Ue("data",we));if(de=D[A-we],!se)return de}let Ce=de,je=se.split("/");for(let Ne of je)Ne&&(de=(0,a._)`${de}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,Ce=(0,a._)`${Ce} && ${de}`);return Ce;function Ue(Ne,we){return`Cannot access ${Ne} ${we} levels up, current level is ${A}`}}e.getData=Be})),Mn=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t})),ao=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ya();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r})),Xa=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Mn(),o=dt(),n=Ya(),s=_e(),i=io();var c=class{constructor(f){var z;this.refs={},this.dynamicAnchors={};let y;typeof f.schema=="object"&&(y=f.schema),this.schema=f.schema,this.schemaId=f.schemaId,this.root=f.root||this,this.baseId=(z=f.baseId)!==null&&z!==void 0?z:(0,n.normalizeId)(y?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=y?.$async,this.refs={}}};e.SchemaEnv=c;function a(f){let z=m.call(this,f);if(z)return z;let y=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:R,lines:w}=this.opts.code,{ownProperties:b}=this.opts,S=new t.CodeGen(this.scope,{es5:R,lines:w,ownProperties:b}),E;f.$async&&(E=S.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let j=S.scopeName("validate");f.validateName=j;let F={gen:S,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:S.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:j,ValidationError:E,schema:f.schema,schemaEnv:f,rootId:y,baseId:f.baseId||y,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},M;try{this._compilations.add(f),(0,i.validateFunctionCode)(F),S.optimize(this.opts.code.optimize);let Z=S.toString();M=`${S.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process&&(M=this.opts.code.process(M,f));let Y=new Function(`${o.default.self}`,`${o.default.scope}`,M)(this,this.scope.get());if(this.scope.value(j,{ref:Y}),Y.errors=null,Y.schema=f.schema,Y.schemaEnv=f,f.$async&&(Y.$async=!0),this.opts.code.source===!0&&(Y.source={validateName:j,validateCode:Z,scopeValues:S._values}),this.opts.unevaluated){let{props:G,items:fe}=F;Y.evaluated={props:G instanceof t.Name?void 0:G,items:fe instanceof t.Name?void 0:fe,dynamicProps:G instanceof t.Name,dynamicItems:fe instanceof t.Name},Y.source&&(Y.source.evaluated=(0,t.stringify)(Y.evaluated))}return f.validate=Y,f}catch(Z){throw delete f.validate,delete f.validateName,M&&this.logger.error("Error compiling schema, function code:",M),Z}finally{this._compilations.delete(f)}}e.compileSchema=a;function u(f,z,y){var R;y=(0,n.resolveUrl)(this.opts.uriResolver,z,y);let w=f.refs[y];if(w)return w;let b=v.call(this,f,y);if(b===void 0){let S=(R=f.localRefs)===null||R===void 0?void 0:R[y],{schemaId:E}=this.opts;S&&(b=new c({schema:S,schemaId:E,root:f,baseId:z}))}if(b!==void 0)return f.refs[y]=d.call(this,b)}e.resolveRef=u;function d(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function m(f){for(let z of this._compilations)if(g(z,f))return z}e.getCompilingSchema=m;function g(f,z){return f.schema===z.schema&&f.root===z.root&&f.baseId===z.baseId}function v(f,z){let y;for(;typeof(y=this.refs[z])=="string";)z=y;return y||this.schemas[z]||p.call(this,f,z)}function p(f,z){let y=this.opts.uriResolver.parse(z),R=(0,n._getFullPath)(this.opts.uriResolver,y),w=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&R===w)return h.call(this,y,f);let b=(0,n.normalizeId)(R),S=this.refs[b]||this.schemas[b];if(typeof S=="string"){let E=p.call(this,f,S);return typeof E?.schema!="object"?void 0:h.call(this,y,E)}if(typeof S?.schema=="object"){if(S.validate||a.call(this,S),b===(0,n.normalizeId)(z)){let{schema:E}=S,{schemaId:j}=this.opts,F=E[j];return F&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,F)),new c({schema:E,schemaId:j,root:f,baseId:w})}return h.call(this,y,S)}}e.resolveSchema=p;let _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(f,{baseId:z,schema:y,root:R}){var w;if(((w=f.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let E of f.fragment.slice(1).split("/")){if(typeof y=="boolean")return;let j=y[(0,s.unescapeFragment)(E)];if(j===void 0)return;y=j;let F=typeof y=="object"&&y[this.opts.schemaId];!_.has(E)&&F&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,F))}let b;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,z,y.$ref);b=p.call(this,R,E)}let{schemaId:S}=this.opts;if(b=b||new c({schema:y,schemaId:S,root:R,baseId:z}),b.schema!==b.root.schema)return b}})),lz=U(((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}})),e_=U(((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(p){let _="",h=0,f=0;for(f=0;f<p.length;f++)if(h=p[f].charCodeAt(0),h!==48){if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=p[f];break}for(f+=1;f<p.length;f++){if(h=p[f].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=p[f]}return _}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(p){return p.length=0,!0}function c(p,_,h){if(p.length){let f=n(p);if(f!=="")_.push(f);else return h.error=!0,!1;p.length=0}return!0}function a(p){let _=0,h={error:!1,address:"",zone:""},f=[],z=[],y=!1,R=!1,w=c;for(let b=0;b<p.length;b++){let S=p[b];if(!(S==="["||S==="]"))if(S===":"){if(y===!0&&(R=!0),!w(z,f,h))break;if(++_>7){h.error=!0;break}b>0&&p[b-1]===":"&&(y=!0),f.push(":");continue}else if(S==="%"){if(!w(z,f,h))break;w=i}else{z.push(S);continue}}return z.length&&(w===i?h.zone=z.join(""):R?f.push(z.join("")):f.push(n(z))),h.address=f.join(""),h}function u(p){if(d(p,":")<2)return{host:p,isIPV6:!1};let _=a(p);if(_.error)return{host:p,isIPV6:!1};{let h=_.address,f=_.address;return _.zone&&(h+="%"+_.zone,f+="%25"+_.zone),{host:h,isIPV6:!0,escapedHost:f}}}function d(p,_){let h=0;for(let f=0;f<p.length;f++)p[f]===_&&h++;return h}function m(p){let _=p,h=[],f=-1,z=0;for(;z=_.length;){if(z===1){if(_===".")break;if(_==="/"){h.push("/");break}else{h.push(_);break}}else if(z===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){h.push("/");break}}else if(z===3&&_==="/.."){h.length!==0&&h.pop(),h.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),h.length!==0&&h.pop();continue}}if((f=_.indexOf("/",1))===-1){h.push(_);break}else h.push(_.slice(0,f)),_=_.slice(f)}return h.join("")}function g(p,_){let h=_!==!0?escape:unescape;return p.scheme!==void 0&&(p.scheme=h(p.scheme)),p.userinfo!==void 0&&(p.userinfo=h(p.userinfo)),p.host!==void 0&&(p.host=h(p.host)),p.path!==void 0&&(p.path=h(p.path)),p.query!==void 0&&(p.query=h(p.query)),p.fragment!==void 0&&(p.fragment=h(p.fragment)),p}function v(p){let _=[];if(p.userinfo!==void 0&&(_.push(p.userinfo),_.push("@")),p.host!==void 0){let h=unescape(p.host);if(!o(h)){let f=u(h);f.isIPV6===!0?h=`[${f.escapedHost}]`:h=p.host}_.push(h)}return(typeof p.port=="number"||typeof p.port=="string")&&(_.push(":"),_.push(String(p.port))),_.length?_.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:v,normalizeComponentEncoding:g,removeDotSegments:m,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}})),dz=U(((e,t)=>{let{isUUID:r}=e_(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(S){return n.indexOf(S)!==-1}function i(S){return S.secure===!0?!0:S.secure===!1?!1:S.scheme?S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S"):!1}function c(S){return S.host||(S.error=S.error||"HTTP URIs must have a host."),S}function a(S){let E=String(S.scheme).toLowerCase()==="https";return(S.port===(E?443:80)||S.port==="")&&(S.port=void 0),S.path||(S.path="/"),S}function u(S){return S.secure=i(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function d(S){if((S.port===(i(S)?443:80)||S.port==="")&&(S.port=void 0),typeof S.secure=="boolean"&&(S.scheme=S.secure?"wss":"ws",S.secure=void 0),S.resourceName){let[E,j]=S.resourceName.split("?");S.path=E&&E!=="/"?E:void 0,S.query=j,S.resourceName=void 0}return S.fragment=void 0,S}function m(S,E){if(!S.path)return S.error="URN can not be parsed",S;let j=S.path.match(o);if(j){let F=E.scheme||S.scheme||"urn";S.nid=j[1].toLowerCase(),S.nss=j[2];let M=b(`${F}:${E.nid||S.nid}`);S.path=void 0,M&&(S=M.parse(S,E))}else S.error=S.error||"URN can not be parsed.";return S}function g(S,E){if(S.nid===void 0)throw new Error("URN without nid cannot be serialized");let j=E.scheme||S.scheme||"urn",F=S.nid.toLowerCase(),M=b(`${j}:${E.nid||F}`);M&&(S=M.serialize(S,E));let Z=S,Y=S.nss;return Z.path=`${F||E.nid}:${Y}`,E.skipEscape=!0,Z}function v(S,E){let j=S;return j.uuid=j.nss,j.nss=void 0,!E.tolerant&&(!j.uuid||!r(j.uuid))&&(j.error=j.error||"UUID is not valid."),j}function p(S){let E=S;return E.nss=(S.uuid||"").toLowerCase(),E}let _={scheme:"http",domainHost:!0,parse:c,serialize:a},h={scheme:"https",domainHost:_.domainHost,parse:c,serialize:a},f={scheme:"ws",domainHost:!0,parse:u,serialize:d},z={scheme:"wss",domainHost:f.domainHost,parse:f.parse,serialize:f.serialize},w={http:_,https:h,ws:f,wss:z,urn:{scheme:"urn",parse:m,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:p,skipNormalize:!0}};Object.setPrototypeOf(w,null);function b(S){return S&&(w[S]||w[S.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:b}})),pz=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=e_(),{SCHEMES:a,getSchemeHandler:u}=dz();function d(z,y){return typeof z=="string"?z=p(h(z,y),y):typeof z=="object"&&(z=h(p(z,y),y)),z}function m(z,y,R){let w=R?Object.assign({scheme:"null"},R):{scheme:"null"},b=g(h(z,w),h(y,w),w,!0);return w.skipEscape=!0,p(b,w)}function g(z,y,R,w){let b={};return w||(z=h(p(z,R),R),y=h(p(y,R),R)),R=R||{},!R.tolerant&&y.scheme?(b.scheme=y.scheme,b.userinfo=y.userinfo,b.host=y.host,b.port=y.port,b.path=o(y.path||""),b.query=y.query):(y.userinfo!==void 0||y.host!==void 0||y.port!==void 0?(b.userinfo=y.userinfo,b.host=y.host,b.port=y.port,b.path=o(y.path||""),b.query=y.query):(y.path?(y.path[0]==="/"?b.path=o(y.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?b.path="/"+y.path:z.path?b.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+y.path:b.path=y.path,b.path=o(b.path)),b.query=y.query):(b.path=z.path,y.query!==void 0?b.query=y.query:b.query=z.query),b.userinfo=z.userinfo,b.host=z.host,b.port=z.port),b.scheme=z.scheme),b.fragment=y.fragment,b}function v(z,y,R){return typeof z=="string"?(z=unescape(z),z=p(s(h(z,R),!0),{...R,skipEscape:!0})):typeof z=="object"&&(z=p(s(z,!0),{...R,skipEscape:!0})),typeof y=="string"?(y=unescape(y),y=p(s(h(y,R),!0),{...R,skipEscape:!0})):typeof y=="object"&&(y=p(s(y,!0),{...R,skipEscape:!0})),z.toLowerCase()===y.toLowerCase()}function p(z,y){let R={host:z.host,scheme:z.scheme,userinfo:z.userinfo,port:z.port,path:z.path,query:z.query,nid:z.nid,nss:z.nss,uuid:z.uuid,fragment:z.fragment,reference:z.reference,resourceName:z.resourceName,secure:z.secure,error:""},w=Object.assign({},y),b=[],S=u(w.scheme||R.scheme);S&&S.serialize&&S.serialize(R,w),R.path!==void 0&&(w.skipEscape?R.path=unescape(R.path):(R.path=escape(R.path),R.scheme!==void 0&&(R.path=R.path.split("%3A").join(":")))),w.reference!=="suffix"&&R.scheme&&b.push(R.scheme,":");let E=n(R);if(E!==void 0&&(w.reference!=="suffix"&&b.push("//"),b.push(E),R.path&&R.path[0]!=="/"&&b.push("/")),R.path!==void 0){let j=R.path;!w.absolutePath&&(!S||!S.absolutePath)&&(j=o(j)),E===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),b.push(j)}return R.query!==void 0&&b.push("?",R.query),R.fragment!==void 0&&b.push("#",R.fragment),b.join("")}let _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(z,y){let R=Object.assign({},y),w={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},b=!1;R.reference==="suffix"&&(R.scheme?z=R.scheme+":"+z:z="//"+z);let S=z.match(_);if(S){if(w.scheme=S[1],w.userinfo=S[3],w.host=S[4],w.port=parseInt(S[5],10),w.path=S[6]||"",w.query=S[7],w.fragment=S[8],isNaN(w.port)&&(w.port=S[5]),w.host)if(i(w.host)===!1){let j=r(w.host);w.host=j.host.toLowerCase(),b=j.isIPV6}else b=!0;w.scheme===void 0&&w.userinfo===void 0&&w.host===void 0&&w.port===void 0&&w.query===void 0&&!w.path?w.reference="same-document":w.scheme===void 0?w.reference="relative":w.fragment===void 0?w.reference="absolute":w.reference="uri",R.reference&&R.reference!=="suffix"&&R.reference!==w.reference&&(w.error=w.error||"URI is not a "+R.reference+" reference.");let E=u(R.scheme||w.scheme);if(!R.unicodeSupport&&(!E||!E.unicodeSupport)&&w.host&&(R.domainHost||E&&E.domainHost)&&b===!1&&c(w.host))try{w.host=URL.domainToASCII(w.host.toLowerCase())}catch(j){w.error=w.error||"Host's domain name can not be converted to ASCII: "+j}(!E||E&&!E.skipNormalize)&&(z.indexOf("%")!==-1&&(w.scheme!==void 0&&(w.scheme=unescape(w.scheme)),w.host!==void 0&&(w.host=unescape(w.host))),w.path&&(w.path=escape(unescape(w.path))),w.fragment&&(w.fragment=encodeURI(decodeURIComponent(w.fragment)))),E&&E.parse&&E.parse(w,R)}else w.error=w.error||"URI can not be parsed.";return w}let f={SCHEMES:a,normalize:d,resolve:m,resolveComponent:g,equal:v,serialize:p,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f})),mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pz();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),Xl=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=Mn(),n=ao(),s=Yg(),i=Xa(),c=le(),a=Ya(),u=Ga(),d=_e(),m=lz(),g=mz(),v=(C,x)=>new RegExp(C,x);v.code="new RegExp";let p=["removeAdditional","useDefaults","coerceTypes"],_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},z=200;function y(C){var x,V,$,k,N,J,ee,pe,ie,ze,Be,T,A,D,ne,se,de,Ce,je,Ue,Ne,we,ot,Ae,ft;let it=C.strict,ht=(x=C.code)===null||x===void 0?void 0:x.optimize,kt=ht===!0||ht===void 0?1:ht||0,Ct=($=(V=C.code)===null||V===void 0?void 0:V.regExp)!==null&&$!==void 0?$:v,Wt=(k=C.uriResolver)!==null&&k!==void 0?k:g.default;return{strictSchema:(J=(N=C.strictSchema)!==null&&N!==void 0?N:it)!==null&&J!==void 0?J:!0,strictNumbers:(pe=(ee=C.strictNumbers)!==null&&ee!==void 0?ee:it)!==null&&pe!==void 0?pe:!0,strictTypes:(ze=(ie=C.strictTypes)!==null&&ie!==void 0?ie:it)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Be=C.strictTuples)!==null&&Be!==void 0?Be:it)!==null&&T!==void 0?T:"log",strictRequired:(D=(A=C.strictRequired)!==null&&A!==void 0?A:it)!==null&&D!==void 0?D:!1,code:C.code?{...C.code,optimize:kt,regExp:Ct}:{optimize:kt,regExp:Ct},loopRequired:(ne=C.loopRequired)!==null&&ne!==void 0?ne:z,loopEnum:(se=C.loopEnum)!==null&&se!==void 0?se:z,meta:(de=C.meta)!==null&&de!==void 0?de:!0,messages:(Ce=C.messages)!==null&&Ce!==void 0?Ce:!0,inlineRefs:(je=C.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(Ue=C.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Ne=C.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(we=C.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(ot=C.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(Ae=C.unicodeRegExp)!==null&&Ae!==void 0?Ae:!0,int32range:(ft=C.int32range)!==null&&ft!==void 0?ft:!0,uriResolver:Wt}}var R=class{constructor(C={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,...y(C)};let{es5:x,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:x,lines:V}),this.logger=Z(C.logger);let $=C.validateFormats;C.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,h,C,"NOT SUPPORTED"),w.call(this,f,C,"DEPRECATED","warn"),this._metaOpts=F.call(this),C.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&j.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),S.call(this),C.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:C,meta:x,schemaId:V}=this.opts,$=m;V==="id"&&($={...m},$.id=$.$id,delete $.$id),x&&C&&this.addMetaSchema($,$[V],!1)}defaultMeta(){let{meta:C,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof C=="object"?C[x]||C:void 0}validate(C,x){let V;if(typeof C=="string"){if(V=this.getSchema(C),!V)throw new Error(`no schema with key or ref "${C}"`)}else V=this.compile(C);let $=V(x);return"$async"in V||(this.errors=V.errors),$}compile(C,x){let V=this._addSchema(C,x);return V.validate||this._compileSchemaEnv(V)}compileAsync(C,x){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return $.call(this,C,x);async function $(ie,ze){await k.call(this,ie.$schema);let Be=this._addSchema(ie,ze);return Be.validate||N.call(this,Be)}async function k(ie){ie&&!this.getSchema(ie)&&await $.call(this,{$ref:ie},!0)}async function N(ie){try{return this._compileSchemaEnv(ie)}catch(ze){if(!(ze instanceof n.default))throw ze;return J.call(this,ze),await ee.call(this,ze.missingSchema),N.call(this,ie)}}function J({missingSchema:ie,missingRef:ze}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${ze} cannot be resolved`)}async function ee(ie){let ze=await pe.call(this,ie);this.refs[ie]||await k.call(this,ze.$schema),this.refs[ie]||this.addSchema(ze,ie,x)}async function pe(ie){let ze=this._loading[ie];if(ze)return ze;try{return await(this._loading[ie]=V(ie))}finally{delete this._loading[ie]}}}addSchema(C,x,V,$=this.opts.validateSchema){if(Array.isArray(C)){for(let N of C)this.addSchema(N,void 0,V,$);return this}let k;if(typeof C=="object"){let{schemaId:N}=this.opts;if(k=C[N],k!==void 0&&typeof k!="string")throw new Error(`schema ${N} must be string`)}return x=(0,a.normalizeId)(x||k),this._checkUnique(x),this.schemas[x]=this._addSchema(C,V,x,$,!0),this}addMetaSchema(C,x,V=this.opts.validateSchema){return this.addSchema(C,x,!0,V),this}validateSchema(C,x){if(typeof C=="boolean")return!0;let V;if(V=C.$schema,V!==void 0&&typeof V!="string")throw new Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let $=this.validate(V,C);if(!$&&x){let k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return $}getSchema(C){let x;for(;typeof(x=b.call(this,C))=="string";)C=x;if(x===void 0){let{schemaId:V}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:V});if(x=i.resolveSchema.call(this,$,C),!x)return;this.refs[C]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=b.call(this,C);return typeof x=="object"&&this._cache.delete(x.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{let x=C;this._cache.delete(x);let V=C[this.opts.schemaId];return V&&(V=(0,a.normalizeId)(V),delete this.schemas[V],delete this.refs[V]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(C){for(let x of C)this.addKeyword(x);return this}addKeyword(C,x){let V;if(typeof C=="string")V=C,typeof x=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=V);else if(typeof C=="object"&&x===void 0){if(x=C,V=x.keyword,Array.isArray(V)&&!V.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,V,x),!x)return(0,d.eachItem)(V,k=>fe.call(this,k)),this;be.call(this,x);let $={...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)};return(0,d.eachItem)(V,$.type.length===0?k=>fe.call(this,k,$):k=>$.type.forEach(N=>fe.call(this,k,$,N))),this}getKeyword(C){let x=this.RULES.all[C];return typeof x=="object"?x.definition:!!x}removeKeyword(C){let{RULES:x}=this;delete x.keywords[C],delete x.all[C];for(let V of x.rules){let $=V.rules.findIndex(k=>k.keyword===C);$>=0&&V.rules.splice($,1)}return this}addFormat(C,x){return typeof x=="string"&&(x=new RegExp(x)),this.formats[C]=x,this}errorsText(C=this.errors,{separator:x=", ",dataVar:V="data"}={}){return!C||C.length===0?"No errors":C.map($=>`${V}${$.instancePath} ${$.message}`).reduce(($,k)=>$+x+k)}$dataMetaSchema(C,x){let V=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(let $ of x){let k=$.split("/").slice(1),N=C;for(let J of k)N=N[J];for(let J in V){let ee=V[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ie=N[J];pe&&ie&&(N[J]=he(ie))}}return C}_removeAllSchemas(C,x){for(let V in C){let $=C[V];(!x||x.test(V))&&(typeof $=="string"?delete C[V]:$&&!$.meta&&(this._cache.delete($.schema),delete C[V]))}}_addSchema(C,x,V,$=this.opts.validateSchema,k=this.opts.addUsedSchema){let N,{schemaId:J}=this.opts;if(typeof C=="object")N=C[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(C);if(ee!==void 0)return ee;V=(0,a.normalizeId)(N||V);let pe=a.getSchemaRefs.call(this,C,V);return ee=new i.SchemaEnv({schema:C,schemaId:J,meta:x,baseId:V,localRefs:pe}),this._cache.set(ee.schema,ee),k&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=ee),$&&this.validateSchema(C,!0),ee}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):i.compileSchema.call(this,C),!C.validate)throw new Error("ajv implementation error");return C.validate}_compileMetaSchema(C){let x=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,C)}finally{this.opts=x}}};R.ValidationError=o.default,R.MissingRefError=n.default,e.default=R;function w(C,x,V,$="error"){for(let k in C){let N=k;N in x&&this.logger[$](`${V}: option ${k}. ${C[N]}`)}}function b(C){return C=(0,a.normalizeId)(C),this.schemas[C]||this.refs[C]}function S(){let C=this.opts.schemas;if(C)if(Array.isArray(C))this.addSchema(C);else for(let x in C)this.addSchema(C[x],x)}function E(){for(let C in this.opts.formats){let x=this.opts.formats[C];x&&this.addFormat(C,x)}}function j(C){if(Array.isArray(C)){this.addVocabulary(C);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in C){let V=C[x];V.keyword||(V.keyword=x),this.addKeyword(V)}}function F(){let C={...this.opts};for(let x of p)delete C[x];return C}let M={log(){},warn(){},error(){}};function Z(C){if(C===!1)return M;if(C===void 0)return console;if(C.log&&C.warn&&C.error)return C;throw new Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function G(C,x){let{RULES:V}=this;if((0,d.eachItem)(C,$=>{if(V.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!Y.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!x&&x.$data&&!("code"in x||"validate"in x))throw new Error('$data keyword must have "code" or "validate" function')}function fe(C,x,V){var $;let k=x?.post;if(V&&k)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:N}=this,J=k?N.post:N.rules.find(({type:pe})=>pe===V);if(J||(J={type:V,rules:[]},N.rules.push(J)),N.keywords[C]=!0,!x)return;let ee={keyword:C,definition:{...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)}};x.before?$e.call(this,J,ee,x.before):J.rules.push(ee),N.all[C]=ee,($=x.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(C,x,V){let $=C.rules.findIndex(k=>k.keyword===V);$>=0?C.rules.splice($,0,x):(C.rules.push(x),this.logger.warn(`rule ${V} is not defined`))}function be(C){let{metaSchema:x}=C;x!==void 0&&(C.$data&&this.opts.$data&&(x=he(x)),C.validateSchema=this.compile(x,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(C){return{anyOf:[C,Oe]}}})),fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t})),Ql=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=ao(),r=pt(),o=le(),n=dt(),s=Xa(),i=_e(),c={keyword:"$ref",schemaType:"string",code(d){let{gen:m,schema:g,it:v}=d,{baseId:p,schemaEnv:_,validateName:h,opts:f,self:z}=v,{root:y}=_;if((g==="#"||g==="#/")&&p===y.baseId)return w();let R=s.resolveRef.call(z,y,p,g);if(R===void 0)throw new t.default(v.opts.uriResolver,p,g);if(R instanceof s.SchemaEnv)return b(R);return S(R);function w(){if(_===y)return u(d,h,_,_.$async);let E=m.scopeValue("root",{ref:y});return u(d,(0,o._)`${E}.validate`,y,y.$async)}function b(E){u(d,a(d,E),E,E.$async)}function S(E){let j=m.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),F=m.name("valid"),M=d.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:j,errSchemaPath:g},F);d.mergeEvaluated(M),d.ok(F)}}};function a(d,m){let{gen:g}=d;return m.validate?g.scopeValue("validate",{ref:m.validate}):(0,o._)`${g.scopeValue("wrapper",{ref:m})}.validate`}e.getValidate=a;function u(d,m,g,v){let{gen:p,it:_}=d,{allErrors:h,schemaEnv:f,opts:z}=_,y=z.passContext?n.default.this:o.nil;v?R():w();function R(){if(!f.$async)throw new Error("async schema referenced by sync schema");let E=p.let("valid");p.try(()=>{p.code((0,o._)`await ${(0,r.callValidateCode)(d,m,y)}`),S(m),h||p.assign(E,!0)},j=>{p.if((0,o._)`!(${j} instanceof ${_.ValidationError})`,()=>p.throw(j)),b(j),h||p.assign(E,!1)}),d.ok(E)}function w(){d.result((0,r.callValidateCode)(d,m,y),()=>S(m),()=>b(m))}function b(E){let j=(0,o._)`${E}.errors`;p.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${j} : ${n.default.vErrors}.concat(${j})`),p.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function S(E){var j;if(!_.opts.unevaluated)return;let F=(j=g?.validate)===null||j===void 0?void 0:j.evaluated;if(_.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(_.props=i.mergeEvaluated.props(p,F.props,_.props));else{let M=p.var("props",(0,o._)`${E}.evaluated.props`);_.props=i.mergeEvaluated.props(p,M,_.props,o.Name)}if(_.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(_.items=i.mergeEvaluated.items(p,F.items,_.items));else{let M=p.var("items",(0,o._)`${E}.evaluated.items`);_.items=i.mergeEvaluated.items(p,M,_.items,o.Name)}}}e.callRef=u,e.default=c})),t_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fz(),r=Ql(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>(0,t.str)`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>(0,t._)`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:c,schemaCode:a}=s;s.fail$data((0,t._)`${c} ${o[i].fail} ${a} || isNaN(${c})`)}};e.default=n})),gz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:c}=o,a=c.opts.multipleOfPrecision,u=n.let("res"),d=a?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${a}`:(0,t._)`${u} !== parseInt(${u})`;o.fail$data((0,t._)`(${i} === 0 || (${u} = ${s}/${i}, ${d}))`)}};e.default=r})),_z=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;for(;s<o;)n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'})),Sz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=_z(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let c=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${c} than ${i} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){let{keyword:i,data:c,schemaCode:a,it:u}=s,d=i==="maxLength"?t.operators.GT:t.operators.LT,m=u.opts.unicode===!1?(0,t._)`${c}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${c})`;s.fail$data((0,t._)`${m} ${d} ${a}`)}};e.default=n})),yz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=_e(),o=le(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,o.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,o._)`{pattern: ${s}}`},code(s){let{gen:i,data:c,$data:a,schema:u,schemaCode:d,it:m}=s,g=m.opts.unicodeRegExp?"u":"";if(a){let{regExp:v}=m.opts.code,p=v.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(i,v),_=i.let("valid");i.try(()=>i.assign(_,(0,o._)`${p}(${d}, ${g}).test(${c})`),()=>i.assign(_,!1)),s.fail$data((0,o._)`!${_}`)}else{let v=(0,t.usePattern)(s,u);s.fail$data((0,o._)`!${v}.test(${c})`)}}};e.default=n})),vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,c=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${s}).length ${c} ${i}`)}};e.default=r})),bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,r._)`{missingProperty: ${s}}`},code(s){let{gen:i,schema:c,schemaCode:a,data:u,$data:d,it:m}=s,{opts:g}=m;if(!d&&c.length===0)return;let v=c.length>=g.loopRequired;if(m.allErrors?p():_(),g.strictRequired){let z=s.parentSchema.properties,{definedProperties:y}=s.it;for(let R of c)if(z?.[R]===void 0&&!y.has(R)){let w=`required property "${R}" is not defined at "${m.schemaEnv.baseId+m.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(m,w,m.opts.strictRequired)}}function p(){if(v||d)s.block$data(r.nil,h);else for(let z of c)(0,t.checkReportMissingProp)(s,z)}function _(){let z=i.let("missing");if(v||d){let y=i.let("valid",!0);s.block$data(y,()=>f(z,y)),s.ok(y)}else i.if((0,t.checkMissingProp)(s,c,z)),(0,t.reportMissingProp)(s,z),i.else()}function h(){i.forOf("prop",a,z=>{s.setParams({missingProperty:z}),i.if((0,t.noPropertyInData)(i,u,z,g.ownProperties),()=>s.error())})}function f(z,y){s.setParams({missingProperty:z}),i.forOf(z,a,()=>{i.assign(y,(0,t.propertyInData)(i,u,z,g.ownProperties)),i.if((0,r.not)(y),()=>{s.error(),i.break()})},r.nil)}}};e.default=n})),zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,c=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${s}.length ${c} ${i}`)}};e.default=r})),ed=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Qg();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),Rz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ga(),r=le(),o=_e(),n=ed(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:c}})=>(0,r.str)`must NOT have duplicate items (items ## ${c} and ${i} are identical)`,params:({params:{i,j:c}})=>(0,r._)`{i: ${i}, j: ${c}}`},code(i){let{gen:c,data:a,$data:u,schema:d,parentSchema:m,schemaCode:g,it:v}=i;if(!u&&!d)return;let p=c.let("valid"),_=m.items?(0,t.getSchemaTypes)(m.items):[];i.block$data(p,h,(0,r._)`${g} === false`),i.ok(p);function h(){let R=c.let("i",(0,r._)`${a}.length`),w=c.let("j");i.setParams({i:R,j:w}),c.assign(p,!0),c.if((0,r._)`${R} > 1`,()=>(f()?z:y)(R,w))}function f(){return _.length>0&&!_.some(R=>R==="object"||R==="array")}function z(R,w){let b=c.name("item"),S=(0,t.checkDataTypes)(_,b,v.opts.strictNumbers,t.DataType.Wrong),E=c.const("indices",(0,r._)`{}`);c.for((0,r._)`;${R}--;`,()=>{c.let(b,(0,r._)`${a}[${R}]`),c.if(S,(0,r._)`continue`),_.length>1&&c.if((0,r._)`typeof ${b} == "string"`,(0,r._)`${b} += "_"`),c.if((0,r._)`typeof ${E}[${b}] == "number"`,()=>{c.assign(w,(0,r._)`${E}[${b}]`),i.error(),c.assign(p,!1).break()}).code((0,r._)`${E}[${b}] = ${R}`)})}function y(R,w){let b=(0,o.useFunc)(c,n.default),S=c.name("outer");c.label(S).for((0,r._)`;${R}--;`,()=>c.for((0,r._)`${w} = ${R}; ${w}--;`,()=>c.if((0,r._)`${b}(${a}[${R}], ${a}[${w}])`,()=>{i.error(),c.assign(p,!1).break(S)})))}}};e.default=s})),$z=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=ed(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){let{gen:i,data:c,$data:a,schemaCode:u,schema:d}=s;a||d&&typeof d=="object"?s.fail$data((0,t._)`!${(0,r.useFunc)(i,o.default)}(${c}, ${u})`):s.fail((0,t._)`${d} !== ${c}`)}};e.default=n})),wz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=ed(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){let{gen:i,data:c,$data:a,schema:u,schemaCode:d,it:m}=s;if(!a&&u.length===0)throw new Error("enum must have non-empty array");let g=u.length>=m.opts.loopEnum,v,p=()=>v??(v=(0,r.useFunc)(i,o.default)),_;if(g||a)_=i.let("valid"),s.block$data(_,h);else{if(!Array.isArray(u))throw new Error("ajv implementation error");let z=i.const("vSchema",d);_=(0,t.or)(...u.map((y,R)=>f(z,R)))}s.pass(_);function h(){i.assign(_,!1),i.forOf("v",d,z=>i.if((0,t._)`${p()}(${c}, ${z})`,()=>i.assign(_,!0).break()))}function f(z,y){let R=u[y];return typeof R=="object"&&R!==null?(0,t._)`${p()}(${c}, ${z}[${y}])`:(0,t._)`${c} === ${R}`}}};e.default=n})),r_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hz(),r=gz(),o=Sz(),n=yz(),s=vz(),i=bz(),c=zz(),a=Rz(),u=$z(),d=wz(),m=[t.default,r.default,o.default,n.default,s.default,i.default,c.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];e.default=m})),o_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=le(),r=_e(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:i,it:c}=s,{items:a}=i;if(!Array.isArray(a)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,a)}};function n(s,i){let{gen:c,schema:a,data:u,keyword:d,it:m}=s;m.items=!0;let g=c.const("len",(0,t._)`${u}.length`);if(a===!1)s.setParams({len:i.length}),s.pass((0,t._)`${g} <= ${i.length}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(m,a)){let p=c.var("valid",(0,t._)`${g} <= ${i.length}`);c.if((0,t.not)(p),()=>v(p)),s.ok(p)}function v(p){c.forRange("i",i.length,g,_=>{s.subschema({keyword:d,dataProp:_,dataPropType:r.Type.Num},p),m.allErrors||c.if((0,t.not)(p),()=>c.break())})}}e.validateAdditionalItems=n,e.default=o})),n_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=_e(),o=pt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:c,it:a}=i;if(Array.isArray(c))return s(i,"additionalItems",c);a.items=!0,!(0,r.alwaysValidSchema)(a,c)&&i.ok((0,o.validateArray)(i))}};function s(i,c,a=i.schema){let{gen:u,parentSchema:d,data:m,keyword:g,it:v}=i;h(d),v.opts.unevaluated&&a.length&&v.items!==!0&&(v.items=r.mergeEvaluated.items(u,a.length,v.items));let p=u.name("valid"),_=u.const("len",(0,t._)`${m}.length`);a.forEach((f,z)=>{(0,r.alwaysValidSchema)(v,f)||(u.if((0,t._)`${_} > ${z}`,()=>i.subschema({keyword:g,schemaProp:z,dataProp:z},p)),i.ok(p))});function h(f){let{opts:z,errSchemaPath:y}=v,R=a.length,w=R===f.minItems&&(R===f.maxItems||f[c]===!1);if(z.strictTuples&&!w){let b=`"${g}" is ${R}-tuple, but minItems or maxItems/${c} are not specified or different at path "${y}"`;(0,r.checkStrictMode)(v,b,z.strictTuples)}}}e.validateTuple=s,e.default=n})),Pz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),Ez=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=pt(),n=o_(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{schema:c,parentSchema:a,it:u}=i,{prefixItems:d}=a;u.items=!0,!(0,r.alwaysValidSchema)(u,c)&&(d?(0,n.validateAdditionalItems)(i,d):i.ok((0,o.validateArray)(i)))}};e.default=s})),Tz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:c,data:a,it:u}=n,d,m,{minContains:g,maxContains:v}=c;u.opts.next?(d=g===void 0?1:g,m=v):d=1;let p=s.const("len",(0,t._)`${a}.length`);if(n.setParams({min:d,max:m}),m===void 0&&d===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&d>m){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let y=(0,t._)`${p} >= ${d}`;m!==void 0&&(y=(0,t._)`${y} && ${p} <= ${m}`),n.pass(y);return}u.items=!0;let _=s.name("valid");m===void 0&&d===1?f(_,()=>s.if(_,()=>s.break())):d===0?(s.let(_,!0),m!==void 0&&s.if((0,t._)`${a}.length > 0`,h)):(s.let(_,!1),h()),n.result(_,()=>n.reset());function h(){let y=s.name("_valid"),R=s.let("count",0);f(y,()=>s.if(y,()=>z(R)))}function f(y,R){s.forRange("i",0,p,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:r.Type.Num,compositeRule:!0},y),R()})}function z(y){s.code((0,t._)`${y}++`),m===void 0?s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${y} > ${m}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0)))}}};e.default=o})),td=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=_e(),o=pt();e.error={message:({params:{property:a,depsCount:u,deps:d}})=>{let m=u===1?"property":"properties";return(0,t.str)`must have ${m} ${d} when property ${a} is present`},params:({params:{property:a,depsCount:u,deps:d,missingProperty:m}})=>(0,t._)`{property: ${a},
|
|
66
66
|
missingProperty: ${m},
|
|
67
67
|
depsCount: ${u},
|
|
68
|
-
deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,d]=s(a);i(a,u),c(a,d)}};function s({schema:a}){let u={},d={};for(let m in a){if(m==="__proto__")continue;let g=Array.isArray(a[m])?u:d;g[m]=a[m]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:m,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let p in u){let _=u[p];if(_.length===0)continue;let h=(0,o.propertyInData)(d,m,p,g.opts.ownProperties);a.setParams({property:p,depsCount:_.length,deps:_.join(", ")}),g.allErrors?d.if(h,()=>{for(let f of _)(0,o.checkReportMissingProp)(a,f)}):(d.if((0,t._)`${h} && (${(0,o.checkMissingProp)(a,_,v)})`),(0,o.reportMissingProp)(a,v),d.else())}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:d,data:m,keyword:g,it:v}=a,p=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,m,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},p);a.mergeValidEvaluated(h,p)},()=>d.var(p,!0)),a.ok(p))}e.validateSchemaDeps=c,e.default=n})),kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),a.allErrors||s.break()})}),n.ok(u)}};e.default=o})),s_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=dt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:c,schema:a,parentSchema:u,data:d,errsCount:m,it:g}=i;if(!m)throw new Error("ajv implementation error");let{allErrors:v,opts:p}=g;if(g.props=!0,p.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(g,a))return;let _=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${m} === ${o.default.errors}`);function f(){c.forIn("key",d,b=>{!_.length&&!h.length?R(b):c.if(z(b),()=>R(b))})}function z(b){let S;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");S=(0,t.isOwnProperty)(c,E,b)}else _.length?S=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):S=r.nil;return h.length&&(S=(0,r.or)(S,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(S)}function y(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(p.removeAdditional==="all"||p.removeAdditional&&a===!1){y(b);return}if(a===!1){i.setParams({additionalProperty:b}),i.error(),v||c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(g,a)){let S=c.name("valid");p.removeAdditional==="failing"?(w(b,S,!1),c.if((0,r.not)(S),()=>{i.reset(),y(b)})):(w(b,S),v||c.if((0,r.not)(S),()=>c.break()))}}function w(b,S,E){let j={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(j,S)}}};e.default=s})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=pt(),o=_e(),n=s_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:m}=i;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)m.definedProperties.add(f);m.opts.unevaluated&&g.length&&m.props!==!0&&(m.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),m.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(m,a[f]));if(v.length===0)return;let p=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,m.opts.ownProperties)),h(f),m.allErrors||c.else().var(p,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(p);function _(f){return m.opts.useDefaults&&!m.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},p)}}};e.default=s})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:d,it:m}=i,{opts:g}=m,v=(0,t.allSchemaProperties)(a),p=v.filter(w=>(0,o.alwaysValidSchema)(m,a[w]));if(v.length===0||p.length===v.length&&(!m.opts.unevaluated||m.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");m.props!==!0&&!(m.props instanceof r.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));let{props:f}=m;z();function z(){for(let w of v)_&&y(w),m.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function y(w){for(let b in _)new RegExp(w).test(b)&&(0,o.checkStrictMode)(m,`property ${b} matches pattern ${w} (use allowMatchingProperties)`)}function R(w){c.forIn("key",u,b=>{c.if((0,r._)`${(0,t.usePattern)(i,w)}.test(${b})`,()=>{let S=p.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),m.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!m.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),Oz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:c,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,d=s.let("valid",!1),m=s.let("passing",null),g=s.name("_valid");n.setParams({passing:m}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((p,_)=>{let h;(0,r.alwaysValidSchema)(a,p)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(m,(0,t._)`[${m}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(m,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let d=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(d)})}};e.default=r})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:c,it:a}=s;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),d=n(a,"else");if(!u&&!d)return;let m=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,p("then",_),p("else",_))}else u?i.if(g,p("then")):i.if((0,t.not)(g),p("else"));s.pass(m,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function p(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(m,g),s.mergeValidEvaluated(f,m),h?i.assign(h,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r})),i_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=o_(),r=Pz(),o=n_(),n=Ez(),s=Tz(),i=td(),c=kz(),a=s_(),u=Cz(),d=Iz(),m=Oz(),g=Nz(),v=jz(),p=xz(),_=Az(),h=qz();function f(z=!1){let y=[m.default,g.default,v.default,p.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?y.push(r.default,n.default):y.push(t.default,o.default),y.push(s.default),y}e.default=f})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:c,schema:a,schemaCode:u,it:d}=o,{opts:m,errSchemaPath:g,schemaEnv:v,self:p}=d;if(!m.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:p.formats,code:m.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),y=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(y,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(y,(0,t._)`"string"`).assign(R,z)),o.fail$data((0,t.or)(w(),b()));function w(){return m.strictSchema===!1?t.nil:(0,t._)`${u} && !${R}`}function b(){let S=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${S} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${y} === ${n} && !${E}`}}function h(){let f=p.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(m.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let j=E instanceof RegExp?(0,t.regexpCode)(E):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:j});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${F}.validate`]:["string",E,F]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!v.$async)throw new Error("async format in sync schema");return(0,t._)`await ${R}(${i})`}return typeof y=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),a_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Mz().default];e.default=t})),c_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),u_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=a_(),s=c_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Lz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),rd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Lz(),o=Xa(),n=ao(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>(0,t._)`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:d,parentSchema:m,it:g}=c,{oneOf:v}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let p=d.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");let _=a.let("valid",!1),h=a.const("tag",(0,t._)`${u}${(0,t.getProperty)(p)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),c.ok(_);function f(){let R=y();a.if(!1);for(let w in R)a.elseIf((0,t._)`${h} === ${w}`),a.assign(_,z(R[w]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),a.endIf()}function z(R){let w=a.name("valid"),b=c.subschema({keyword:"oneOf",schemaProp:R},w);return c.mergeEvaluated(b,t.Name),w}function y(){var R;let w={},b=E(m),S=!0;for(let M=0;M<v.length;M++){let Z=v[M];if(Z?.$ref&&!(0,s.schemaHasRulesButRef)(Z,g.self.RULES)){let G=Z.$ref;if(Z=o.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,G),Z instanceof o.SchemaEnv&&(Z=Z.schema),Z===void 0)throw new n.default(g.opts.uriResolver,g.baseId,G)}let Y=(R=Z?.properties)===null||R===void 0?void 0:R[p];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);S=S&&(b||E(Z)),j(Y,M)}if(!S)throw new Error(`discriminator: "${p}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(p)}function j(M,Z){if(M.const)F(M.const,Z);else if(M.enum)for(let Y of M.enum)F(Y,Z);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[M]=Z}}}};e.default=i})),Dz=U(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),l_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Xl(),o=u_(),n=rd(),s=Dz(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var m=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),d_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=dt(),o=Xa(),n=Ql(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:m}=a;m.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=m.errSchemaPath==="#"?m.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:m}=a.it,{root:g,baseId:v,localRefs:p,meta:_}=u.root,{schemaId:h}=m.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:p,meta:_});return o.compileSchema.call(m,f),(0,n.getValidate)(a,f)}e.default=s})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=dt(),o=Ql(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:d}=i;if(c[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let m=c.slice(1);if(d.allErrors)g();else{let p=a.let("valid",!1);g(p),i.ok(p)}function g(p){if(d.schemaEnv.root.dynamicAnchors[m]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(m)}`);a.if(_,v(_,p),v(d.validateName,p))}else v(d.validateName,p)()}function v(p,_){return _?()=>a.block(()=>{(0,o.callRef)(i,p),a.let(_,!0)}):()=>(0,o.callRef)(i,p)}}e.dynamicRef=s,e.default=n})),Zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=p_(),o=Zz(),n=Uz(),s=[t.default,r.default,o.default,n.default];e.default=s})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),Fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vz(),r=Fz(),o=Hz(),n=[t.default,r.default,o.default];e.default=n})),Jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=dt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:c,data:a,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:m,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(p(g,h),()=>v(h)))):g!==!0&&i.forIn("key",a,h=>g===void 0?v(h):i.if(_(g,h),()=>v(h))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function v(h){if(c===!1){s.setParams({unevaluatedProperty:h}),s.error(),m||i.break();return}if(!(0,r.alwaysValidSchema)(d,c)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),m||i.if((0,t.not)(f),()=>i.break())}}function p(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function _(h,f){let z=[];for(let y in h)h[y]===!0&&z.push((0,t._)`${f} !== ${y}`);return(0,t.and)(...z)}}};e.default=n})),Bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n,u=a.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let g=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(g),()=>m(g,u)),n.ok(g)}a.items=!0;function m(g,v){s.forRange("i",v,d,p=>{n.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),h_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Jz(),r=Bz(),o=[t.default,r.default];e.default=o})),Kz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),Gz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),Wz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),Yz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),Xz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),Qz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),e0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),t0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Kz(),r=Gz(),o=Wz(),n=Yz(),s=Xz(),i=Qz(),c=e0(),a=["/properties"];function u(d){return[t,r,o,n,m(this,s),i,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),r0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Xl(),o=u_(),n=m_(),s=f_(),i=h_(),c=rd(),a=t0(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:h}=this.opts;h&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var m=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var g=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var v=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var p=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),o0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=m_(),s=f_(),i=h_(),c=a_(),a=c_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),n0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),s0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),i0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),a0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),c0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),u0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),l0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),d0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),p0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n0(),r=s0(),o=i0(),n=a0(),s=c0(),i=u0(),c=l0(),a=d0(),u=["/properties"];function d(m){return[t,r,o,n,s,g(this,i),c,g(this,a)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function g(v,p){return m?v.$dataMetaSchema(p,u):p}}e.default=d})),m0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Xl(),o=o0(),n=rd(),s=p0(),i="https://json-schema.org/draft/2020-12/schema";var c=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:v}=this.opts;v&&(s.default.call(this,g),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),f0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Z){return{validate:M,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(g(!0),v),"iso-time":t(a(),d),"iso-date-time":t(g(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:b},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(M){return M%4===0&&(M%100!==0||M%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(M){let Z=o.exec(M);if(!Z)return!1;let Y=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(Y)?29:n[G])}function i(M,Z){if(M&&Z)return M>Z?1:M<Z?-1:0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(M){return function(Y){let G=c.exec(Y);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),x=+(G[7]||0);if(C>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-C*he-(V<0?1:0);return($===23||$===-1)&&(V===59||V===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let Y=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(Y&&G)return Y-G}function d(M,Z){if(!(M&&Z))return;let Y=c.exec(M),G=c.exec(Z);if(Y&&G)return M=Y[1]+Y[2]+Y[3],Z=G[1]+G[2]+G[3],M>Z?1:M<Z?-1:0}let m=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(m);return fe.length===2&&s(fe[0])&&Z(fe[1])}}function v(M,Z){if(!(M&&Z))return;let Y=new Date(M).valueOf(),G=new Date(Z).valueOf();if(Y&&G)return Y-G}function p(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(m),[fe,$e]=Z.split(m),be=i(Y,fe);if(be!==void 0)return be||u(G,$e)}let _=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(M){return _.test(M)&&h.test(M)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(M){return z.lastIndex=0,z.test(M)}let R=-(2**31),w=2**31-1;function b(M){return Number.isInteger(M)&&M<=w&&M>=R}function S(M){return Number.isInteger(M)}function E(){return!0}let j=/[^\\]\\Z/;function F(M){if(j.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=l_(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword:m,it:g}=c,{opts:v,self:p}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,p.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:p.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${y}[${_.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${R} != "object"`,(0,r._)`${R} instanceof RegExp`,(0,r._)`typeof ${R}.compare != "function"`,z(R)))}function f(){let y=_.schema,R=p.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${m}": format "${y}" does not define "compare" function`);let w=a.scopeValue("formats",{key:y,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(y)}`:void 0});c.fail$data(z(w))}function z(y){return(0,r._)`${y}.compare(${u}, ${d}) ${n[m].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),g0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=f0(),o=h0(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,d={keywords:!0})=>{if(Array.isArray(d))return a(u,d,r.fullFormats,s),u;let[m,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,m,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let m=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function a(u,d,m,g){var v,p;(v=(p=u.opts.code).formats)!==null&&v!==void 0||(p.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,m[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),g_=l_(),_0=r0(),S0=m0(),y0=is(g0(),1),v0=y0.default;function Yl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return v0(t),t}var Qa=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Yl(S0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Ed(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=Yl(_0.Ajv2019):this._ajvDraft7??=Yl(g_.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},Fw=g_.Ajv;import od from"node:process";var $_=Symbol.for("mcp.completable");function sd(e){return!!e&&typeof e=="object"&&$_ in e}function R0(e){return e[$_]?.complete}var xP=2**31-1;function $0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var w0=8,P0=6e5;function E0(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??w0,roundTimeoutMs:e?.roundTimeoutMs??P0,legacyShim:e?.legacyShim??!0}}function w_(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new oe(B.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=vg(o);if(n===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function T0(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function nd(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var k0=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,c=o.mcpReq.signal,a=n,u=0;for(;;){if(u+=1,u>s)return nd(e,Zg(e,s));let d=a.inputRequests,m=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!m&&g===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let v;if(m){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=w_(e,y,R);if(w.method!=="roots/list"&&w.params===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${y}' of kind '${w.method}' without params`);if(Za(b,h)!==void 0)return nd(e,`Cannot request input '${y}' (${w.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([y,w])}let z=Vg(c);try{let y={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},R=await Promise.all(f.map(async([w,b])=>{try{return[w,await this._dispatchLeg(b,y)]}catch(S){throw z.abort(S),S}}));v=Object.fromEntries(R)}catch(y){if(c.aborted)throw y;return nd(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Ug(Dg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:qn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Hl(p,h))}let _=await t(r,p);if(!Tt(_))return _;a=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:T0()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},C0=new Set(["tools/call","prompts/get","resources/read"]),I0,O0,N0;var P_=class extends Jl{_clientCapabilities;_clientVersion;static{I0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},O0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},N0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new k0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Qa,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=E0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Nl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),El(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ue(me.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Ha(Bt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Zt],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Bl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=C0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(Tt(i))throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Tt(i)){if(!o)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Ua(i,r)}}return async(r,o)=>{let n=no(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new oe(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Tt(i))return i;let c=Tl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new oe(a.reason==="not-in-era"?B.InternalError:B.InvalidParams,a.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${a.message}`);return a.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&An(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let m=await this._verifyRequestState(s,o,e);m!==void 0&&(i=Hl(o,m))}let c;try{c=await t(r,i)}catch(m){throw m instanceof oe&&m.code===B.UrlElicitationRequired&&n?new oe(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):m}if(!Tt(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??pr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,c)}let a=c.inputRequests,u=a!=null&&Object.keys(a).length>0,d=typeof c.requestState=="string";if(!u&&!d)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:p,required:_}=w_(e,g,v),h=Za(_,m);if(h!==void 0)throw new Fa({requiredCapabilities:h},`Cannot request input '${g}' (${p.method}): the request's client capabilities do not declare the required capability`)}}return c}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Pt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=bg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??pr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:El(this._supportedProtocolVersions),capabilities:j0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],c=i.some(m=>m.type==="tool_result"),a=e.messages.length>1?e.messages.at(-2):void 0,u=a?Array.isArray(a.content)?a.content:[a.content]:[],d=u.some(m=>m.type==="tool_use");if(c){if(i.some(m=>m.type!=="tool_result"))throw new oe(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new oe(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter(v=>v.type==="tool_use").map(v=>v.id)),g=new Set(i.filter(v=>v.type==="tool_result").map(v=>v.toolUseId));if(m.size!==g.size||![...m].every(v=>g.has(v)))throw new oe(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!c.valid)throw new oe(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof oe?c:new oe(B.InternalError,`Error validating elicitation response: ${c instanceof Error?c.message:String(c)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function j0(e){return{...e}}function x0(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let s of n){if(++r>t)return r;s!==null&&typeof s=="object"&&o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];i!==null&&typeof i=="object"&&o.push(i)}}return r}function A0(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var ec=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return S_;try{let r=_r(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new P_(e,t),this._maxToolInputElements=A0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return $0(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?q0(e,t.inputSchema):S_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=_r(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new oe(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Tt(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof oe&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&x0(t,this._maxToolInputElements)>this._maxToolInputElements)throw new oe(B.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await gr(e.inputSchema,t??{});if(!o.success)throw new oe(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Tt(t)||t.isError)return;if(t.structuredContent===void 0)throw new oe(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await gr(e.outputSchema,t.structuredContent);if(!o.success)throw new oe(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Zl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ul(e),this.handleResourceCompletion(e,e.params.ref);default:throw new oe(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ln;let o=R_(z_(r.argsSchema)?.[e.params.argument.name]);if(!sd(o))return Ln;let n=R0(o);return n?b_(await n(e.params.argument.value,e.params.context)):Ln}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ln;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?b_(await o(e.params.argument.value,e.params.context)):Ln}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new oe(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new oe(B.InvalidParams,`Resource ${r} disabled`);return Ua(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new oe(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Ua(await n.readCallback(r,s,t),n.cacheHint)}}throw new Va(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Lg(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,c=i;if(n!==void 0&&Nl(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{c.uri!==void 0&&c.uri!==r&&(delete this._registeredResources[r],c.uri&&(this._registeredResources[c.uri]=i)),c.name!==void 0&&(i.name=c.name),c.title!==void 0&&(i.title=c.title),c.metadata!==void 0&&(i.metadata=c.metadata),c.callback!==void 0&&(i.readCallback=c.callback),c.scopeChallenge!==void 0&&(i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=i)),a.title!==void 0&&(i.title=a.title),a.template!==void 0&&(i.resourceTemplate=a.template),a.metadata!==void 0&&(i.metadata=a.metadata),a.callback!==void 0&&(i.readCallback=a.callback),a.scopeChallenge!==void 0&&(i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge),a.enabled!==void 0&&(i.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=r.uriTemplate.variableNames;return Array.isArray(c)&&c.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,o,n,s,i,c){let a=o,u=n,d={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:c,handler:v_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(delete this._registeredPrompts[e],m.name&&(this._registeredPrompts[m.name]=d)),m.title!==void 0&&(d.title=m.title),m.description!==void 0&&(d.description=m.description),m.icons!==void 0&&(d.icons=m.icons),m.scopeChallenge!==void 0&&(d.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(d._meta=m._meta);let g=!1;m.argsSchema!==void 0&&(d.argsSchema=m.argsSchema,a=m.argsSchema,g=!0),m.callback!==void 0&&(u=m.callback,g=!0),g&&(d.handler=v_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=z_(o);m&&Object.values(m).some(g=>sd(R_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){Wl(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=y_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:__(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Wl(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=v,e=p.name)),p.title!==void 0&&(v.title=p.title),p.description!==void 0&&(v.description=p.description);let _=!1;p.paramsSchema!==void 0&&(v.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),p.callback!==void 0&&(v.handler=p.callback,m=p.callback,_=!0),_&&(v.executor=__(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=y_(p.outputSchema)),p.annotations!==void 0&&(v.annotations=p.annotations),p.icons!==void 0&&(v.icons=p.icons),p.scopeChallenge!==void 0&&(v.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(v._meta=p._meta),p.enabled!==void 0&&(v.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:c,icons:a,scopeChallenge:u,_meta:d}=t;return this._createRegisteredTool(e,o,n,Ja(s),Ja(i),c,a,void 0,u,d,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:c,_meta:a}=t,u=this._createRegisteredPrompt(e,o,n,Ja(s),r,i,c,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function __(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var S_={type:"object",properties:{}};function q0(e,t){let r=_r(t,"input"),o=Vl(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function y_(e){if(e!==void 0)try{return _r(e,"output")}catch{return}}function v_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await gr(t,n??{});if(!i.success)throw new oe(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function b_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Ln={completion:{values:[],hasMore:!1}};function z_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function M0(e){return e?.type==="optional"}function R_(e){return M0(e)?e.def?.innerType??e:e}var kE=4*1024*1024;var E_=Symbol("swallowsErrorsAfterClose"),T_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=od.stdin,t=od.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Kl({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[E_]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[E_]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Gl(e),n=!1,s=c=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(c))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}};import{isAbsolute as J0}from"node:path";function k_(e,t){let r=e.find(o=>o.id===t);if(r?.kind!=="select")throw new Error(`no select option "${t}"`);return r.choices.map(o=>o.value)}var C_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},B0=dd(),K0=vd.map(e=>e.id),G0=k_(Sd.options([C_],{},cc),"degrees").map(Number),BE=k_(yd.options([C_],{},cc),"mode");var tc=l().refine(J0,"must be an absolute path").describe("An absolute path."),rc=I(tc).min(1),W0=Lt("mode",[P({mode:O("every-page")}),P({mode:O("every-n"),n:L().int().min(1)}),P({mode:O("points"),after:I(L().int().min(1)).min(1).describe("Cut after these pages (1-based).")})]).describe("How to split: every page, every N pages, or after the given pages."),I_=P({paths:rc.describe("Absolute paths of files (or folders) to inspect.")}),O_=P({}),N_=P({paths:rc.describe("Absolute paths of files, folders or globs to convert."),to:ce(B0).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim or resize, which keep each image's own format when it is omitted.`),output:tc.optional().describe("A folder (or, for one input, a file) to write to. Default: beside each source."),quality:L().int().min(1).max(100).optional().describe("For lossy targets, 1-100."),dpi:L().int().min(36).max(600).optional().describe("PDF \u2192 image resolution. Default 150."),pages:l().optional().describe('PDF \u2192 image page selection, e.g. "3-7,12". Default all.'),background:l().optional().describe("Fill colour when transparency must be flattened. Default #ffffff."),keepMetadata:H().optional().describe("Keep EXIF and GPS data. Default false."),password:l().optional().describe("Password for an encrypted PDF. Never echoed back."),overwrite:H().optional().describe("Replace existing outputs. Default false \u2014 only when the user asked."),recursive:H().optional().describe("Descend into subfolders of a folder input."),trim:H().optional().describe("Images only: cut transparent or solid-colour edges, writing name-trimmed. Keeps the format unless `to` is given. Refused for animated images and when nothing would be trimmed (unless also resizing)."),resize:W([Me({percent:L().min(1).max(md)}),Me({width:L().int().min(1)}),Me({height:L().int().min(1)})]).optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following. Writes name-<W>x<H>; with trim, name-trimmed-<50pct|1200w|900h>. Keeps the format unless `to` is given. No side over 16384 px, no more than 100 MP."),sharpen:H().optional().describe("Images only: sharpen at the same size with the optional boost extension, writing name-sharp. `to` is then the output format. Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),boost:W([O(2),O(3),O(4)]).optional().describe("Images only: enlarge 2, 3 or 4 times with the optional boost extension, writing name-2x / name-3x / name-4x. `to` is then the output format (png keeps transparency). Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`. 3 needs boost 1.1.0 or later: an older install fails with extension-outdated, fixed by the same command; while no released boost makes 3 it fails with invalid-arguments naming the factors that work."),removeBackground:H().optional().describe("Images only: cut out the subject with the optional remove-background extension, writing name-cutout. `to` must carry transparency (png, webp, avif, tiff). Fails with extension-missing when it is not installed; the fix is `forge extensions add remove-background`.")}),j_=P({paths:rc.describe("Absolute paths of files to compress."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb" or "2mb".'),dpi:L().int().min(36).max(600).optional().describe("For a PDF: image resolution."),output:tc.optional().describe("A folder or file to write to."),overwrite:H().optional().describe("Replace existing outputs. Default false.")}).refine(e=>e.quality===void 0!=(e.maxSize===void 0),{message:"Give exactly one of quality or maxSize."}),x_=P({op:ce(K0).describe("The page operation."),paths:rc.describe("Absolute PDF paths. merge takes two or more, in order; the others take one."),pages:l().optional().describe('extract / delete: which pages, e.g. "3-7,12".'),separate:H().optional().describe("extract: one file per page."),degrees:O(G0).optional().describe("rotate: degrees clockwise."),split:W0.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Dn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),Y0=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),oc=Me({forge:l(),ok:H(),results:I(Y0),failures:I(Dn)}),A_=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:ce(["image","document"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),targets:I(l()),actions:I(l())})),failures:I(Dn)}),q_=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Dn)}),M_=l().describe("A hex colour: #RRGGBB, #RGB, or without the #"),L_=P({path:tc.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:M_.optional().describe("Show the shades of the palette colour nearest this one")}),D_=P({colour:M_}),Z_=Me({forge:l(),ok:H(),palette:Me({source:l(),inside:l().optional(),colours:I(Me({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Dn)}),U_=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Dn)});import{Writable as X0}from"node:stream";function V_(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new X0({write(o,n,s){r(o,n,s)}})}import{basename as Q0}from"node:path";import{pathToFileURL as eR}from"node:url";var F_={interactive:!1},H_=Promise.resolve();function tR(e){let t=H_.then(e,e);return H_=t.catch(()=>{}),t}var Zn=(e,t)=>tR(()=>Rd(e,t===void 0?F_:{...F_,signal:t}));function J_(e){let t=e.path===void 0?"":` (${e.path})`,r=e.hint===void 0?"":` ${e.hint}`;return`\u2715 ${e.title}${t}: ${e.detail}${r}`}function B_(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(J_));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:eR(o).href,name:Q0(o)}));return{content:[{type:"text",text:t.join(`
|
|
68
|
+
deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,d]=s(a);i(a,u),c(a,d)}};function s({schema:a}){let u={},d={};for(let m in a){if(m==="__proto__")continue;let g=Array.isArray(a[m])?u:d;g[m]=a[m]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:m,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let p in u){let _=u[p];if(_.length===0)continue;let h=(0,o.propertyInData)(d,m,p,g.opts.ownProperties);a.setParams({property:p,depsCount:_.length,deps:_.join(", ")}),g.allErrors?d.if(h,()=>{for(let f of _)(0,o.checkReportMissingProp)(a,f)}):(d.if((0,t._)`${h} && (${(0,o.checkMissingProp)(a,_,v)})`),(0,o.reportMissingProp)(a,v),d.else())}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:d,data:m,keyword:g,it:v}=a,p=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,m,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},p);a.mergeValidEvaluated(h,p)},()=>d.var(p,!0)),a.ok(p))}e.validateSchemaDeps=c,e.default=n})),kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),a.allErrors||s.break()})}),n.ok(u)}};e.default=o})),s_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=dt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:c,schema:a,parentSchema:u,data:d,errsCount:m,it:g}=i;if(!m)throw new Error("ajv implementation error");let{allErrors:v,opts:p}=g;if(g.props=!0,p.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(g,a))return;let _=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${m} === ${o.default.errors}`);function f(){c.forIn("key",d,b=>{!_.length&&!h.length?R(b):c.if(z(b),()=>R(b))})}function z(b){let S;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");S=(0,t.isOwnProperty)(c,E,b)}else _.length?S=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):S=r.nil;return h.length&&(S=(0,r.or)(S,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(S)}function y(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(p.removeAdditional==="all"||p.removeAdditional&&a===!1){y(b);return}if(a===!1){i.setParams({additionalProperty:b}),i.error(),v||c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(g,a)){let S=c.name("valid");p.removeAdditional==="failing"?(w(b,S,!1),c.if((0,r.not)(S),()=>{i.reset(),y(b)})):(w(b,S),v||c.if((0,r.not)(S),()=>c.break()))}}function w(b,S,E){let j={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(j,S)}}};e.default=s})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=pt(),o=_e(),n=s_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:m}=i;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)m.definedProperties.add(f);m.opts.unevaluated&&g.length&&m.props!==!0&&(m.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),m.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(m,a[f]));if(v.length===0)return;let p=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,m.opts.ownProperties)),h(f),m.allErrors||c.else().var(p,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(p);function _(f){return m.opts.useDefaults&&!m.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},p)}}};e.default=s})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:d,it:m}=i,{opts:g}=m,v=(0,t.allSchemaProperties)(a),p=v.filter(w=>(0,o.alwaysValidSchema)(m,a[w]));if(v.length===0||p.length===v.length&&(!m.opts.unevaluated||m.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");m.props!==!0&&!(m.props instanceof r.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));let{props:f}=m;z();function z(){for(let w of v)_&&y(w),m.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function y(w){for(let b in _)new RegExp(w).test(b)&&(0,o.checkStrictMode)(m,`property ${b} matches pattern ${w} (use allowMatchingProperties)`)}function R(w){c.forIn("key",u,b=>{c.if((0,r._)`${(0,t.usePattern)(i,w)}.test(${b})`,()=>{let S=p.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),m.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!m.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),Oz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:c,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,d=s.let("valid",!1),m=s.let("passing",null),g=s.name("_valid");n.setParams({passing:m}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((p,_)=>{let h;(0,r.alwaysValidSchema)(a,p)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(m,(0,t._)`[${m}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(m,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let d=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(d)})}};e.default=r})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:c,it:a}=s;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),d=n(a,"else");if(!u&&!d)return;let m=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,p("then",_),p("else",_))}else u?i.if(g,p("then")):i.if((0,t.not)(g),p("else"));s.pass(m,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function p(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(m,g),s.mergeValidEvaluated(f,m),h?i.assign(h,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r})),i_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=o_(),r=Pz(),o=n_(),n=Ez(),s=Tz(),i=td(),c=kz(),a=s_(),u=Cz(),d=Iz(),m=Oz(),g=Nz(),v=jz(),p=xz(),_=Az(),h=qz();function f(z=!1){let y=[m.default,g.default,v.default,p.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?y.push(r.default,n.default):y.push(t.default,o.default),y.push(s.default),y}e.default=f})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:c,schema:a,schemaCode:u,it:d}=o,{opts:m,errSchemaPath:g,schemaEnv:v,self:p}=d;if(!m.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:p.formats,code:m.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),y=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(y,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(y,(0,t._)`"string"`).assign(R,z)),o.fail$data((0,t.or)(w(),b()));function w(){return m.strictSchema===!1?t.nil:(0,t._)`${u} && !${R}`}function b(){let S=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${S} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${y} === ${n} && !${E}`}}function h(){let f=p.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(m.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let j=E instanceof RegExp?(0,t.regexpCode)(E):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:j});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${F}.validate`]:["string",E,F]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!v.$async)throw new Error("async format in sync schema");return(0,t._)`await ${R}(${i})`}return typeof y=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),a_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Mz().default];e.default=t})),c_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),u_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=a_(),s=c_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Lz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),rd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Lz(),o=Xa(),n=ao(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>(0,t._)`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:d,parentSchema:m,it:g}=c,{oneOf:v}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let p=d.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");let _=a.let("valid",!1),h=a.const("tag",(0,t._)`${u}${(0,t.getProperty)(p)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),c.ok(_);function f(){let R=y();a.if(!1);for(let w in R)a.elseIf((0,t._)`${h} === ${w}`),a.assign(_,z(R[w]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),a.endIf()}function z(R){let w=a.name("valid"),b=c.subschema({keyword:"oneOf",schemaProp:R},w);return c.mergeEvaluated(b,t.Name),w}function y(){var R;let w={},b=E(m),S=!0;for(let M=0;M<v.length;M++){let Z=v[M];if(Z?.$ref&&!(0,s.schemaHasRulesButRef)(Z,g.self.RULES)){let G=Z.$ref;if(Z=o.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,G),Z instanceof o.SchemaEnv&&(Z=Z.schema),Z===void 0)throw new n.default(g.opts.uriResolver,g.baseId,G)}let Y=(R=Z?.properties)===null||R===void 0?void 0:R[p];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);S=S&&(b||E(Z)),j(Y,M)}if(!S)throw new Error(`discriminator: "${p}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(p)}function j(M,Z){if(M.const)F(M.const,Z);else if(M.enum)for(let Y of M.enum)F(Y,Z);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[M]=Z}}}};e.default=i})),Dz=U(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),l_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Xl(),o=u_(),n=rd(),s=Dz(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var m=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),d_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=dt(),o=Xa(),n=Ql(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:m}=a;m.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=m.errSchemaPath==="#"?m.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:m}=a.it,{root:g,baseId:v,localRefs:p,meta:_}=u.root,{schemaId:h}=m.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:p,meta:_});return o.compileSchema.call(m,f),(0,n.getValidate)(a,f)}e.default=s})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=dt(),o=Ql(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:d}=i;if(c[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let m=c.slice(1);if(d.allErrors)g();else{let p=a.let("valid",!1);g(p),i.ok(p)}function g(p){if(d.schemaEnv.root.dynamicAnchors[m]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(m)}`);a.if(_,v(_,p),v(d.validateName,p))}else v(d.validateName,p)()}function v(p,_){return _?()=>a.block(()=>{(0,o.callRef)(i,p),a.let(_,!0)}):()=>(0,o.callRef)(i,p)}}e.dynamicRef=s,e.default=n})),Zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=p_(),o=Zz(),n=Uz(),s=[t.default,r.default,o.default,n.default];e.default=s})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),Fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vz(),r=Fz(),o=Hz(),n=[t.default,r.default,o.default];e.default=n})),Jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=dt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:c,data:a,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:m,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(p(g,h),()=>v(h)))):g!==!0&&i.forIn("key",a,h=>g===void 0?v(h):i.if(_(g,h),()=>v(h))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function v(h){if(c===!1){s.setParams({unevaluatedProperty:h}),s.error(),m||i.break();return}if(!(0,r.alwaysValidSchema)(d,c)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),m||i.if((0,t.not)(f),()=>i.break())}}function p(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function _(h,f){let z=[];for(let y in h)h[y]===!0&&z.push((0,t._)`${f} !== ${y}`);return(0,t.and)(...z)}}};e.default=n})),Bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n,u=a.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let g=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(g),()=>m(g,u)),n.ok(g)}a.items=!0;function m(g,v){s.forRange("i",v,d,p=>{n.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),h_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Jz(),r=Bz(),o=[t.default,r.default];e.default=o})),Kz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),Gz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),Wz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),Yz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),Xz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),Qz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),e0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),t0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Kz(),r=Gz(),o=Wz(),n=Yz(),s=Xz(),i=Qz(),c=e0(),a=["/properties"];function u(d){return[t,r,o,n,m(this,s),i,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),r0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Xl(),o=u_(),n=m_(),s=f_(),i=h_(),c=rd(),a=t0(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:h}=this.opts;h&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var m=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var g=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var v=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var p=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),o0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=m_(),s=f_(),i=h_(),c=a_(),a=c_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),n0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),s0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),i0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),a0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),c0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),u0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),l0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),d0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),p0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n0(),r=s0(),o=i0(),n=a0(),s=c0(),i=u0(),c=l0(),a=d0(),u=["/properties"];function d(m){return[t,r,o,n,s,g(this,i),c,g(this,a)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function g(v,p){return m?v.$dataMetaSchema(p,u):p}}e.default=d})),m0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Xl(),o=o0(),n=rd(),s=p0(),i="https://json-schema.org/draft/2020-12/schema";var c=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:v}=this.opts;v&&(s.default.call(this,g),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),f0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Z){return{validate:M,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(g(!0),v),"iso-time":t(a(),d),"iso-date-time":t(g(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:b},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(M){return M%4===0&&(M%100!==0||M%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(M){let Z=o.exec(M);if(!Z)return!1;let Y=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(Y)?29:n[G])}function i(M,Z){if(M&&Z)return M>Z?1:M<Z?-1:0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(M){return function(Y){let G=c.exec(Y);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),x=+(G[7]||0);if(C>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-C*he-(V<0?1:0);return($===23||$===-1)&&(V===59||V===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let Y=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(Y&&G)return Y-G}function d(M,Z){if(!(M&&Z))return;let Y=c.exec(M),G=c.exec(Z);if(Y&&G)return M=Y[1]+Y[2]+Y[3],Z=G[1]+G[2]+G[3],M>Z?1:M<Z?-1:0}let m=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(m);return fe.length===2&&s(fe[0])&&Z(fe[1])}}function v(M,Z){if(!(M&&Z))return;let Y=new Date(M).valueOf(),G=new Date(Z).valueOf();if(Y&&G)return Y-G}function p(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(m),[fe,$e]=Z.split(m),be=i(Y,fe);if(be!==void 0)return be||u(G,$e)}let _=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(M){return _.test(M)&&h.test(M)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(M){return z.lastIndex=0,z.test(M)}let R=-(2**31),w=2**31-1;function b(M){return Number.isInteger(M)&&M<=w&&M>=R}function S(M){return Number.isInteger(M)}function E(){return!0}let j=/[^\\]\\Z/;function F(M){if(j.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=l_(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword:m,it:g}=c,{opts:v,self:p}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,p.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:p.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${y}[${_.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${R} != "object"`,(0,r._)`${R} instanceof RegExp`,(0,r._)`typeof ${R}.compare != "function"`,z(R)))}function f(){let y=_.schema,R=p.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${m}": format "${y}" does not define "compare" function`);let w=a.scopeValue("formats",{key:y,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(y)}`:void 0});c.fail$data(z(w))}function z(y){return(0,r._)`${y}.compare(${u}, ${d}) ${n[m].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),g0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=f0(),o=h0(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,d={keywords:!0})=>{if(Array.isArray(d))return a(u,d,r.fullFormats,s),u;let[m,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,m,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let m=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function a(u,d,m,g){var v,p;(v=(p=u.opts.code).formats)!==null&&v!==void 0||(p.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,m[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),g_=l_(),_0=r0(),S0=m0(),y0=is(g0(),1),v0=y0.default;function Yl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return v0(t),t}var Qa=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Yl(S0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Ed(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=Yl(_0.Ajv2019):this._ajvDraft7??=Yl(g_.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},Hw=g_.Ajv;import od from"node:process";var $_=Symbol.for("mcp.completable");function sd(e){return!!e&&typeof e=="object"&&$_ in e}function R0(e){return e[$_]?.complete}var AP=2**31-1;function $0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var w0=8,P0=6e5;function E0(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??w0,roundTimeoutMs:e?.roundTimeoutMs??P0,legacyShim:e?.legacyShim??!0}}function w_(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new oe(B.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=vg(o);if(n===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function T0(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function nd(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var k0=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,c=o.mcpReq.signal,a=n,u=0;for(;;){if(u+=1,u>s)return nd(e,Zg(e,s));let d=a.inputRequests,m=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!m&&g===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let v;if(m){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=w_(e,y,R);if(w.method!=="roots/list"&&w.params===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${y}' of kind '${w.method}' without params`);if(Za(b,h)!==void 0)return nd(e,`Cannot request input '${y}' (${w.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([y,w])}let z=Vg(c);try{let y={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},R=await Promise.all(f.map(async([w,b])=>{try{return[w,await this._dispatchLeg(b,y)]}catch(S){throw z.abort(S),S}}));v=Object.fromEntries(R)}catch(y){if(c.aborted)throw y;return nd(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Ug(Dg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:qn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Hl(p,h))}let _=await t(r,p);if(!Tt(_))return _;a=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:T0()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},C0=new Set(["tools/call","prompts/get","resources/read"]),I0,O0,N0;var P_=class extends Jl{_clientCapabilities;_clientVersion;static{I0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},O0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},N0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new k0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Qa,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=E0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Nl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),El(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ue(me.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Ha(Bt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Zt],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Bl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=C0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(Tt(i))throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Tt(i)){if(!o)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Ua(i,r)}}return async(r,o)=>{let n=no(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new oe(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Tt(i))return i;let c=Tl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new oe(a.reason==="not-in-era"?B.InternalError:B.InvalidParams,a.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${a.message}`);return a.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&An(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let m=await this._verifyRequestState(s,o,e);m!==void 0&&(i=Hl(o,m))}let c;try{c=await t(r,i)}catch(m){throw m instanceof oe&&m.code===B.UrlElicitationRequired&&n?new oe(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):m}if(!Tt(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??pr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,c)}let a=c.inputRequests,u=a!=null&&Object.keys(a).length>0,d=typeof c.requestState=="string";if(!u&&!d)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:p,required:_}=w_(e,g,v),h=Za(_,m);if(h!==void 0)throw new Fa({requiredCapabilities:h},`Cannot request input '${g}' (${p.method}): the request's client capabilities do not declare the required capability`)}}return c}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Pt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=bg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??pr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:El(this._supportedProtocolVersions),capabilities:j0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],c=i.some(m=>m.type==="tool_result"),a=e.messages.length>1?e.messages.at(-2):void 0,u=a?Array.isArray(a.content)?a.content:[a.content]:[],d=u.some(m=>m.type==="tool_use");if(c){if(i.some(m=>m.type!=="tool_result"))throw new oe(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new oe(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter(v=>v.type==="tool_use").map(v=>v.id)),g=new Set(i.filter(v=>v.type==="tool_result").map(v=>v.toolUseId));if(m.size!==g.size||![...m].every(v=>g.has(v)))throw new oe(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!c.valid)throw new oe(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof oe?c:new oe(B.InternalError,`Error validating elicitation response: ${c instanceof Error?c.message:String(c)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function j0(e){return{...e}}function x0(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let s of n){if(++r>t)return r;s!==null&&typeof s=="object"&&o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];i!==null&&typeof i=="object"&&o.push(i)}}return r}function A0(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var ec=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return S_;try{let r=_r(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new P_(e,t),this._maxToolInputElements=A0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return $0(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?q0(e,t.inputSchema):S_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=_r(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new oe(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Tt(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof oe&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&x0(t,this._maxToolInputElements)>this._maxToolInputElements)throw new oe(B.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await gr(e.inputSchema,t??{});if(!o.success)throw new oe(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Tt(t)||t.isError)return;if(t.structuredContent===void 0)throw new oe(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await gr(e.outputSchema,t.structuredContent);if(!o.success)throw new oe(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Zl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ul(e),this.handleResourceCompletion(e,e.params.ref);default:throw new oe(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ln;let o=R_(z_(r.argsSchema)?.[e.params.argument.name]);if(!sd(o))return Ln;let n=R0(o);return n?b_(await n(e.params.argument.value,e.params.context)):Ln}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ln;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?b_(await o(e.params.argument.value,e.params.context)):Ln}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new oe(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new oe(B.InvalidParams,`Resource ${r} disabled`);return Ua(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new oe(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Ua(await n.readCallback(r,s,t),n.cacheHint)}}throw new Va(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Lg(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,c=i;if(n!==void 0&&Nl(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{c.uri!==void 0&&c.uri!==r&&(delete this._registeredResources[r],c.uri&&(this._registeredResources[c.uri]=i)),c.name!==void 0&&(i.name=c.name),c.title!==void 0&&(i.title=c.title),c.metadata!==void 0&&(i.metadata=c.metadata),c.callback!==void 0&&(i.readCallback=c.callback),c.scopeChallenge!==void 0&&(i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=i)),a.title!==void 0&&(i.title=a.title),a.template!==void 0&&(i.resourceTemplate=a.template),a.metadata!==void 0&&(i.metadata=a.metadata),a.callback!==void 0&&(i.readCallback=a.callback),a.scopeChallenge!==void 0&&(i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge),a.enabled!==void 0&&(i.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=r.uriTemplate.variableNames;return Array.isArray(c)&&c.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,o,n,s,i,c){let a=o,u=n,d={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:c,handler:v_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(delete this._registeredPrompts[e],m.name&&(this._registeredPrompts[m.name]=d)),m.title!==void 0&&(d.title=m.title),m.description!==void 0&&(d.description=m.description),m.icons!==void 0&&(d.icons=m.icons),m.scopeChallenge!==void 0&&(d.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(d._meta=m._meta);let g=!1;m.argsSchema!==void 0&&(d.argsSchema=m.argsSchema,a=m.argsSchema,g=!0),m.callback!==void 0&&(u=m.callback,g=!0),g&&(d.handler=v_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=z_(o);m&&Object.values(m).some(g=>sd(R_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){Wl(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=y_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:__(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Wl(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=v,e=p.name)),p.title!==void 0&&(v.title=p.title),p.description!==void 0&&(v.description=p.description);let _=!1;p.paramsSchema!==void 0&&(v.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),p.callback!==void 0&&(v.handler=p.callback,m=p.callback,_=!0),_&&(v.executor=__(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=y_(p.outputSchema)),p.annotations!==void 0&&(v.annotations=p.annotations),p.icons!==void 0&&(v.icons=p.icons),p.scopeChallenge!==void 0&&(v.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(v._meta=p._meta),p.enabled!==void 0&&(v.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:c,icons:a,scopeChallenge:u,_meta:d}=t;return this._createRegisteredTool(e,o,n,Ja(s),Ja(i),c,a,void 0,u,d,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:c,_meta:a}=t,u=this._createRegisteredPrompt(e,o,n,Ja(s),r,i,c,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function __(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var S_={type:"object",properties:{}};function q0(e,t){let r=_r(t,"input"),o=Vl(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function y_(e){if(e!==void 0)try{return _r(e,"output")}catch{return}}function v_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await gr(t,n??{});if(!i.success)throw new oe(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function b_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Ln={completion:{values:[],hasMore:!1}};function z_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function M0(e){return e?.type==="optional"}function R_(e){return M0(e)?e.def?.innerType??e:e}var CE=4*1024*1024;var E_=Symbol("swallowsErrorsAfterClose"),T_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=od.stdin,t=od.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Kl({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[E_]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[E_]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Gl(e),n=!1,s=c=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(c))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}};import{isAbsolute as J0}from"node:path";function k_(e,t){let r=e.find(o=>o.id===t);if(r?.kind!=="select")throw new Error(`no select option "${t}"`);return r.choices.map(o=>o.value)}var C_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},B0=dd(),K0=vd.map(e=>e.id),G0=k_(Sd.options([C_],{},cc),"degrees").map(Number),KE=k_(yd.options([C_],{},cc),"mode");var tc=l().refine(J0,"must be an absolute path").describe("An absolute path."),rc=I(tc).min(1),W0=Lt("mode",[P({mode:O("every-page")}),P({mode:O("every-n"),n:L().int().min(1)}),P({mode:O("points"),after:I(L().int().min(1)).min(1).describe("Cut after these pages (1-based).")})]).describe("How to split: every page, every N pages, or after the given pages."),I_=P({paths:rc.describe("Absolute paths of files (or folders) to inspect.")}),O_=P({}),N_=P({paths:rc.describe("Absolute paths of files, folders or globs to convert."),to:ce(B0).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim or resize, which keep each image's own format when it is omitted.`),output:tc.optional().describe("A folder (or, for one input, a file) to write to. Default: beside each source."),quality:L().int().min(1).max(100).optional().describe("For lossy targets, 1-100."),dpi:L().int().min(36).max(600).optional().describe("PDF \u2192 image resolution. Default 150."),pages:l().optional().describe('PDF \u2192 image page selection, e.g. "3-7,12". Default all.'),background:l().optional().describe("Fill colour when transparency must be flattened. Default #ffffff."),keepMetadata:H().optional().describe("Keep EXIF and GPS data. Default false."),password:l().optional().describe("Password for an encrypted PDF. Never echoed back."),overwrite:H().optional().describe("Replace existing outputs. Default false \u2014 only when the user asked."),recursive:H().optional().describe("Descend into subfolders of a folder input."),trim:H().optional().describe("Images only: cut transparent or solid-colour edges, writing name-trimmed. Keeps the format unless `to` is given. Refused for animated images and when nothing would be trimmed (unless also resizing)."),resize:W([Me({percent:L().min(1).max(md)}),Me({width:L().int().min(1)}),Me({height:L().int().min(1)})]).optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following. Writes name-<W>x<H>; with trim, name-trimmed-<50pct|1200w|900h>. Keeps the format unless `to` is given. No side over 16384 px, no more than 100 MP."),sharpen:H().optional().describe("Images only: sharpen at the same size with the optional boost extension, writing name-sharp. `to` is then the output format. Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),boost:W([O(2),O(3),O(4)]).optional().describe("Images only: enlarge 2, 3 or 4 times with the optional boost extension, writing name-2x / name-3x / name-4x. `to` is then the output format (png keeps transparency). Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`. 3 needs boost 1.1.0 or later: an older install fails with extension-outdated, fixed by the same command; while no released boost makes 3 it fails with invalid-arguments naming the factors that work."),removeBackground:H().optional().describe("Images only: cut out the subject with the optional remove-background extension, writing name-cutout. `to` must carry transparency (png, webp, avif, tiff). Fails with extension-missing when it is not installed; the fix is `forge extensions add remove-background`.")}),j_=P({paths:rc.describe("Absolute paths of files to compress."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb" or "2mb".'),dpi:L().int().min(36).max(600).optional().describe("For a PDF: image resolution."),output:tc.optional().describe("A folder or file to write to."),overwrite:H().optional().describe("Replace existing outputs. Default false.")}).refine(e=>e.quality===void 0!=(e.maxSize===void 0),{message:"Give exactly one of quality or maxSize."}),x_=P({op:ce(K0).describe("The page operation."),paths:rc.describe("Absolute PDF paths. merge takes two or more, in order; the others take one."),pages:l().optional().describe('extract / delete: which pages, e.g. "3-7,12".'),separate:H().optional().describe("extract: one file per page."),degrees:O(G0).optional().describe("rotate: degrees clockwise."),split:W0.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Dn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),Y0=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),oc=Me({forge:l(),ok:H(),results:I(Y0),failures:I(Dn)}),A_=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:ce(["image","document"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),targets:I(l()),actions:I(l())})),failures:I(Dn)}),q_=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Dn)}),M_=l().describe("A hex colour: #RRGGBB, #RGB, or without the #"),L_=P({path:tc.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:M_.optional().describe("Show the shades of the palette colour nearest this one")}),D_=P({colour:M_}),Z_=Me({forge:l(),ok:H(),palette:Me({source:l(),inside:l().optional(),colours:I(Me({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Dn)}),U_=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Dn)});import{Writable as X0}from"node:stream";function V_(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new X0({write(o,n,s){r(o,n,s)}})}import{basename as Q0}from"node:path";import{pathToFileURL as eR}from"node:url";var F_={interactive:!1},H_=Promise.resolve();function tR(e){let t=H_.then(e,e);return H_=t.catch(()=>{}),t}var Zn=(e,t)=>tR(()=>Rd(e,t===void 0?F_:{...F_,signal:t}));function J_(e){let t=e.path===void 0?"":` (${e.path})`,r=e.hint===void 0?"":` ${e.hint}`;return`\u2715 ${e.title}${t}: ${e.detail}${r}`}function B_(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(J_));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:eR(o).href,name:Q0(o)}));return{content:[{type:"text",text:t.join(`
|
|
69
69
|
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var Un=e=>B_(fd(ir,e)),Sr=e=>B_(hd(ir,e));async function K_(e){let t=_d(ir,await bd(e.paths)),r=t.probes.map(o=>{let n=o.pages===void 0?`${o.width}\xD7${o.height}`:`${o.pages} pages`;return`${o.path}: ${o.format}, ${o.bytes} bytes, ${n}${o.encrypted?", password-protected":""}. Can become: ${o.targets.join(", ")}. Actions: ${o.actions.join(", ")}.`});return r.push(...t.failures.map(J_)),{content:[{type:"text",text:r.join(`
|
|
70
70
|
`)}],structuredContent:{...t},isError:!t.ok}}function G_(){let e=gd(ir,pd());return{content:[{type:"text",text:e.formats.map(r=>{let o=r.read&&r.write?"read and write":r.read?"read only":"write only";return`${r.id} (${r.extensions.join(" ")}): ${o}`}).join(`
|
|
71
|
-
`)}],structuredContent:{...e}}}async function W_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.resize!==void 0){if(r.length>0)return Sr(mt(`${e.trim===!0?"trim":"resize"} cannot be combined with ${r[0]}.`,"Run them one after the other."));let i={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(i))}if(e.to===void 0)return Sr(mt("forge_convert needs `to`, the target format.","Only trim and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Sr(mt(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function Y_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ud(e.maxSize);if(r===void 0)return Sr(mt(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function X_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Sr(mt(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Sr(mt("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Sr(mt("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function id(e){return{content:[{type:"text",text:e}],isError:!0}}async function Q_(e){let t=e.inside===void 0?void 0:ac(e.inside);if(e.inside!==void 0&&!t)return id(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-
|
|
72
|
-
`)}],structuredContent:{...n}}}catch(r){if(ld(r))return id(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function eS(e){let t=ac(e.colour);if(!t)return id(`${e.colour} is not a colour. Try #RRGGBB.`);let{runScale:r}=await import("./colour-
|
|
73
|
-
`)}],structuredContent:{...n}}}
|
|
71
|
+
`)}],structuredContent:{...e}}}async function W_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.resize!==void 0){if(r.length>0)return Sr(mt(`${e.trim===!0?"trim":"resize"} cannot be combined with ${r[0]}.`,"Run them one after the other."));let i={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(i))}if(e.to===void 0)return Sr(mt("forge_convert needs `to`, the target format.","Only trim and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Sr(mt(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function Y_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ud(e.maxSize);if(r===void 0)return Sr(mt(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function X_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Sr(mt(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Sr(mt("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Sr(mt("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function id(e){return{content:[{type:"text",text:e}],isError:!0}}async function Q_(e){let t=e.inside===void 0?void 0:ac(e.inside);if(e.inside!==void 0&&!t)return id(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-6YGDI44N.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=zd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
|
|
72
|
+
`)}],structuredContent:{...n}}}catch(r){if(ld(r))return id(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function eS(e){let t=ac(e.colour);if(!t)return id(`${e.colour} is not a colour. Try #RRGGBB.`);let{runScale:r}=await import("./colour-6YGDI44N.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
|
|
73
|
+
`)}],structuredContent:{...n}}}function rR(e=process.platform){return[`Forge converts, compresses and edits files on this ${e==="win32"?"PC":"Mac"}, locally.`,"Every path must be absolute.","Call forge_probe first: it says what a file is, every format it can become, and every action that applies.","Nothing is overwritten unless you pass overwrite: true \u2014 only do that when the user asked to replace a file.","A failure hint that mentions --force means overwrite: true here; --output means the output argument; --password-stdin means the password argument."].join(" ")}var oR=rR(),nc={readOnlyHint:!0,openWorldHint:!1},ad={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function nR(){let e=new ec({name:"forge",version:ir},{instructions:oR});return e.registerTool("forge_probe",{title:"Inspect files",description:"What each file is and what Forge can do with it: format (read from content, not the extension), size, pages or dimensions, whether it is password-protected, every format it can become, and every action that applies. Writes nothing.",inputSchema:I_,outputSchema:A_,annotations:nc},t=>K_(t)),e.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:O_,outputSchema:q_,annotations:nc},()=>G_()),e.registerTool("forge_convert",{title:"Convert files",description:"Convert files to another format, beside each source unless output is given. A PDF becomes one image per page (choose pages and dpi); Word documents become PDF; images convert between formats; with trim or resize they keep their format unless `to` is given. Returns every output path and a file:// link to each.",inputSchema:N_,outputSchema:oc,annotations:ad},(t,r)=>W_(t,r.mcpReq.signal)),e.registerTool("forge_compress",{title:"Compress files",description:'Make files smaller without changing their format: by quality (1-100) or to fit a size such as "500kb". Writes <name>-small.<ext> beside the source unless output is given. A lossless format such as PNG cannot be compressed; convert it instead.',inputSchema:j_,outputSchema:oc,annotations:ad},t=>Y_(t)),e.registerTool("forge_pdf",{title:"PDF page operations",description:"merge (two or more PDFs, in order), split, extract, delete or rotate pages. Writes new files beside the source and never edits the original. Password-protected PDFs are refused.",inputSchema:x_,outputSchema:oc,annotations:ad},t=>X_(t)),e.registerTool("forge_palette",{title:"Colours of an image",description:"An image's main colours, most of the image first, each as hex, rgb and OKLCH with its share. With inside, the shades that one colour is made of. Writes nothing.",inputSchema:L_,outputSchema:Z_,annotations:nc},t=>Q_(t)),e.registerTool("forge_scale",{title:"Tonal scale",description:"A 50\u2013950 tonal scale built in OKLCH with the given colour at 500, each step with its contrast against white and black text. Writes nothing.",inputSchema:D_,outputSchema:U_,annotations:nc},t=>eS(t)),e}async function _T(e){if(e.length>0)throw mt(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=V_();await nR().connect(new T_(process.stdin,t))}export{oR as INSTRUCTIONS,nR as createForgeServer,rR as instructionsFor,_T as runMcpServer};
|