forge-terminal 0.5.5 → 0.5.7
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 +28 -10
- package/dist/chunks/{about-credits-VRRE6342.js → about-credits-4DHA4HMT.js} +1 -1
- package/dist/chunks/args-5CQKOHYO.js +3 -0
- package/dist/chunks/{boot-MX7UP2M2.js → boot-XX2TLD3Q.js} +1 -1
- package/dist/chunks/{chunk-7I2OSTBX.js → chunk-4KGC5ZBZ.js} +1 -1
- package/dist/chunks/{chunk-J6AZTW62.js → chunk-4MJEEEFA.js} +1 -1
- package/dist/chunks/{chunk-YK26E3OX.js → chunk-4RNVZQRC.js} +1 -1
- package/dist/chunks/{chunk-HYMPLIHW.js → chunk-4YK4XWYS.js} +1 -1
- package/dist/chunks/{chunk-UGATQHEE.js → chunk-6FXF6ALB.js} +1 -1
- package/dist/chunks/{chunk-D4R7UACU.js → chunk-6HQKTDGG.js} +1 -1
- package/dist/chunks/{chunk-TRJXZLR6.js → chunk-6RCS3KBP.js} +1 -1
- package/dist/chunks/{chunk-OUXPGAQL.js → chunk-7MC3LDNP.js} +1 -1
- package/dist/chunks/chunk-7XFLG32B.js +3 -0
- package/dist/chunks/{chunk-R7BEV6PR.js → chunk-AET63NOB.js} +1 -1
- package/dist/chunks/{chunk-HACM3MAD.js → chunk-FAUL5L2W.js} +1 -1
- package/dist/chunks/{chunk-7IWX5VSI.js → chunk-GBA5DFEO.js} +1 -1
- package/dist/chunks/chunk-GYERZAZU.js +4 -0
- package/dist/chunks/{chunk-HWCXNKIN.js → chunk-HTA25PO2.js} +1 -1
- package/dist/chunks/{chunk-BROTSQXG.js → chunk-ILQDMVJR.js} +1 -1
- package/dist/chunks/{chunk-MMLROWBQ.js → chunk-JMIKUWLY.js} +2 -2
- package/dist/chunks/{chunk-KDBKDURW.js → chunk-L57UZTYE.js} +2 -2
- package/dist/chunks/{chunk-BONMSCKD.js → chunk-MPSLPE4C.js} +1 -1
- package/dist/chunks/chunk-N32JL4UI.js +3 -0
- package/dist/chunks/{chunk-Q7ERPAG3.js → chunk-NMECUMJD.js} +1 -1
- package/dist/chunks/{chunk-ZBETH6BR.js → chunk-NRMLO5TP.js} +33 -24
- package/dist/chunks/{chunk-BU4YYGUJ.js → chunk-OXDRJO4V.js} +1 -1
- package/dist/chunks/{chunk-HVMQTKP6.js → chunk-P6JX5ZQT.js} +1 -1
- package/dist/chunks/chunk-POM7FXIV.js +3 -0
- package/dist/chunks/chunk-PUGNBNSV.js +3 -0
- package/dist/chunks/chunk-RM3XA72H.js +3 -0
- package/dist/chunks/{chunk-MES4FVLR.js → chunk-RRVD63NF.js} +1 -1
- package/dist/chunks/chunk-SM735FG7.js +81 -0
- package/dist/chunks/{chunk-JJV2YXZQ.js → chunk-SUB2JM7G.js} +1 -1
- package/dist/chunks/chunk-TFGK7IRZ.js +19 -0
- package/dist/chunks/{chunk-OGYSMKRM.js → chunk-TLHUFIXD.js} +1 -1
- package/dist/chunks/{chunk-SZCSV3PX.js → chunk-U3D3EU33.js} +1 -1
- package/dist/chunks/{chunk-L5JBHB4G.js → chunk-UGYBXR4V.js} +1 -1
- package/dist/chunks/{chunk-RLOJSZ6W.js → chunk-V6GWPR2A.js} +1 -1
- package/dist/chunks/{chunk-BI2E72HM.js → chunk-VDQMK2B2.js} +1 -1
- package/dist/chunks/{chunk-HGJXGAGJ.js → chunk-W53XNVNH.js} +1 -1
- package/dist/chunks/{chunk-7KYO62XK.js → chunk-WBW6G4N6.js} +1 -1
- package/dist/chunks/{chunk-2ZZXIDYX.js → chunk-WMK3IKW6.js} +1 -1
- package/dist/chunks/{chunk-WCOFUMZU.js → chunk-X6PZIFFX.js} +1 -1
- package/dist/chunks/chunk-YJ6XLDRA.js +3 -0
- package/dist/chunks/chunk-ZBMJTIYR.js +3 -0
- package/dist/chunks/clip-command-3CMQ6A5D.js +3 -0
- package/dist/chunks/{clipboard-3VFHDKYE.js → clipboard-IZJTBTSW.js} +1 -1
- package/dist/chunks/colour-VBHJAKAX.js +3 -0
- package/dist/chunks/{command-BKAPI4A5.js → command-GAGAD65W.js} +1 -1
- package/dist/chunks/{config-command-6GXRV627.js → config-command-CKPJXJEE.js} +1 -1
- package/dist/chunks/{continue-editing-4W3XWWCE.js → continue-editing-M6WESEVB.js} +1 -1
- package/dist/chunks/{decoded-SMEHAVCH.js → decoded-XWKU23RG.js} +1 -1
- package/dist/chunks/{entry-7GW4RIK2.js → entry-SOHEQPXT.js} +2 -2
- package/dist/chunks/execute-KTLXJTU2.js +3 -0
- package/dist/chunks/extensions-YF2KGD66.js +3 -0
- package/dist/chunks/{extensions-command-VXZL55KR.js → extensions-command-VT4M2JQW.js} +1 -1
- package/dist/chunks/{ffmpeg-Z7JQT53Y.js → ffmpeg-Q2WJH2OP.js} +1 -1
- package/dist/chunks/{image-FYCF2AVH.js → image-R5C3AWHT.js} +1 -1
- package/dist/chunks/{install-5YXQ6YV3.js → install-KGFOAQCU.js} +1 -1
- package/dist/chunks/{install-C6XNONFF.js → install-MFYGS5TG.js} +1 -1
- package/dist/chunks/{launch-U63VZQXC.js → launch-SOQTCV2D.js} +5 -5
- package/dist/chunks/{lock-AFVXUDOM.js → lock-BG3CLOHA.js} +1 -1
- package/dist/chunks/manager-HBAXHJL4.js +4 -0
- package/dist/chunks/{needed-X5D4E5X5.js → needed-GMZEKBH4.js} +1 -1
- package/dist/chunks/{own-5JN35AUV.js → own-IICGHC4K.js} +1 -1
- package/dist/chunks/{pdfium-GKF4ES7K.js → pdfium-77L526HZ.js} +1 -1
- package/dist/chunks/{preset-command-H6G22SZD.js → preset-command-4OVFEH7Y.js} +1 -1
- package/dist/chunks/{registry-LLAHKI4G.js → registry-TO6HJQJ4.js} +1 -1
- package/dist/chunks/{run-WSETTQXP.js → run-GUFPETHF.js} +1 -1
- package/dist/chunks/{server-CIGFNW7X.js → server-6275TY3O.js} +19 -19
- package/dist/chunks/{theme-HAB66OAL.js → theme-ISNQEBTS.js} +1 -1
- package/dist/chunks/{transcribe-FVCOCTGA.js → transcribe-QC2E7ETQ.js} +1 -1
- package/dist/chunks/{transcribe-command-XCBGAQMI.js → transcribe-command-GAKYFBWQ.js} +1 -1
- package/dist/chunks/{update-command-DJLYU6AB.js → update-command-DWEBUFT5.js} +1 -1
- package/dist/chunks/{update-note-47IPWQKY.js → update-note-T4LVCD25.js} +1 -1
- package/dist/chunks/{watch-command-VL6LOERU.js → watch-command-EYEZKROF.js} +1 -1
- package/dist/index.js +6 -6
- package/package.json +5 -5
- package/dist/chunks/args-5BPKCNTL.js +0 -3
- package/dist/chunks/chunk-2NSUAERD.js +0 -3
- package/dist/chunks/chunk-3YWAVKDZ.js +0 -19
- package/dist/chunks/chunk-45BFQHJB.js +0 -80
- package/dist/chunks/chunk-57M4J2BR.js +0 -3
- package/dist/chunks/chunk-CVNYUROW.js +0 -3
- package/dist/chunks/chunk-HFQOGB4T.js +0 -4
- package/dist/chunks/chunk-PBIS2ONZ.js +0 -3
- package/dist/chunks/chunk-QVACE4IE.js +0 -3
- package/dist/chunks/chunk-U5TEGDGH.js +0 -3
- package/dist/chunks/chunk-VTA6Z45X.js +0 -3
- package/dist/chunks/clip-command-WJ5P4DTN.js +0 -3
- package/dist/chunks/colour-5YBDFXXX.js +0 -3
- package/dist/chunks/execute-LBGFY5TG.js +0 -3
- package/dist/chunks/extensions-HTBACHMC.js +0 -3
- package/dist/chunks/manager-QUTR3RYR.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as Pd,b as Ed,c as Td}from"./chunk-2NSUAERD.js";import"./chunk-HGJXGAGJ.js";import"./chunk-45BFQHJB.js";import{a as zd,d as kd}from"./chunk-HFQOGB4T.js";import{a as yd,b as vd,f as bd}from"./chunk-OUXPGAQL.js";import"./chunk-BI2E72HM.js";import"./chunk-Q6KQWJ4J.js";import{f as Cd}from"./chunk-PBIS2ONZ.js";import"./chunk-6RMRWBMB.js";import"./chunk-HYMPLIHW.js";import"./chunk-WCOFUMZU.js";import"./chunk-L5JBHB4G.js";import{a as dc}from"./chunk-U5TEGDGH.js";import{b as Id}from"./chunk-D4R7UACU.js";import{d as _d,f as Sd}from"./chunk-SZCSV3PX.js";import"./chunk-QVACE4IE.js";import{e as us,f as Rd,g as $d,h as wd}from"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import{a as _t}from"./chunk-HVMQTKP6.js";import"./chunk-O7DK3GJT.js";import"./chunk-MES4FVLR.js";import"./chunk-EEQSUBBL.js";import"./chunk-BONMSCKD.js";import"./chunk-HACM3MAD.js";import{b as mc}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-OGYSMKRM.js";import{m as gd}from"./chunk-J6AZTW62.js";import"./chunk-RLOJSZ6W.js";import"./chunk-7KYO62XK.js";import{E as st,a as cs}from"./chunk-CVNYUROW.js";import{d as pc}from"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import{d as lc}from"./chunk-TMUK2DD3.js";var pS=Object.create,ls=Object.defineProperty,mS=Object.getOwnPropertyDescriptor,fS=Object.getOwnPropertyNames,hS=Object.getPrototypeOf,gS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Od=(e,t)=>{let r={};for(var o in e)ls(r,o,{get:e[o],enumerable:!0});return t&&ls(r,Symbol.toStringTag,{value:"Module"}),r},_S=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=fS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!gS.call(e,c)&&c!==r&&ls(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=mS(t,c))||o.enumerable});return e},ds=(e,t,r)=>(r=e!=null?pS(hS(e)):{},_S(t||!e||!e.__esModule?ls(r,"default",{value:e,enumerable:!0}):r,e));var SS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Nd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),yS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),vS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function jd(e){return typeof e=="string"&&Nd.has(e.replace(/#$/,""))}function xd(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(SS.has(r))return"2020-12";if(Nd.has(r))return"2019-09";if(yS.has(r)||vS.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 ce={};lc(ce,{BIGINT_FORMAT_RANGES:()=>hs,CONSTANT_CATCH:()=>Jd,Class:()=>gc,NUMBER_FORMAT_RANGES:()=>Lo,aborted:()=>ut,allowsEval:()=>zc,assert:()=>wS,assertEqual:()=>bS,assertIs:()=>RS,assertNever:()=>$S,assertNotEqual:()=>zS,assignProp:()=>Ye,attachSchema:()=>Do,base64ToUint8Array:()=>Fd,base64urlToUint8Array:()=>FS,cached:()=>Nr,captureStackTrace:()=>ms,cleanEnum:()=>VS,cleanRegex:()=>Mo,clone:()=>it,cloneDef:()=>TS,codePointLength:()=>Zo,constantCatch:()=>Bd,createTransparentProxy:()=>jS,defineLazy:()=>yc,defineLazyInternal:()=>ge,derived:()=>KS,esc:()=>vc,escapeRegex:()=>vt,explicitlyAborted:()=>wc,extend:()=>qS,finalizeIssue:()=>lt,floatSafeRemainder:()=>Sc,getElementAtPath:()=>CS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Uo,getParsedType:()=>NS,getSizableOrigin:()=>Vd,hexToUint8Array:()=>JS,hide:()=>Ss,installLazyProp:()=>XS,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>xr,joinValues:()=>ps,jsonStringifyReplacer:()=>Or,members:()=>Ec,merge:()=>LS,mergeDefs:()=>yt,normalizeParams:()=>te,nullish:()=>_c,numKeys:()=>OS,objectClone:()=>PS,omit:()=>AS,optionalKeys:()=>$c,own:()=>qt,parsedType:()=>Pc,partial:()=>DS,pick:()=>xS,prefixIssues:()=>bt,primitiveTypes:()=>Zd,promiseAllObject:()=>kS,propertyKeyTypes:()=>Rc,randomString:()=>IS,rawShape:()=>jr,required:()=>ZS,safeExtend:()=>MS,shallowClone:()=>Dd,sizeCaps:()=>_s,slugify:()=>bc,stringifyPrimitive:()=>fs,toZod:()=>qd,uint8ArrayToBase64:()=>Hd,uint8ArrayToBase64url:()=>HS,uint8ArrayToHex:()=>BS,unwrapMessage:()=>kr});function bS(e){return e}function zS(e){return e}function qd(){return e=>e}function RS(e){}function $S(e){throw new Error("Unexpected value in exhaustive check")}function wS(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 ps(e,t="|"){return e.map(r=>fs(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var hc=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 hc(e)}function _c(e){return e==null}function Mo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Sc(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 Ad=Symbol("evaluating");function yc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ad)return o===void 0&&(o=Ad,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function PS(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 St(e){return jr(e._zod.def)??e._zod.def.shape}function Md(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Ld(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=St(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Md(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Ld(e,s,o?o(i.value,s):i.value))}}function ES(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Md(e,r,()=>t[r]):Ld(e,r,o.value))}}function yt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function TS(e){return yt(e._zod.def)}function CS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function kS(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 IS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function vc(e){return JSON.stringify(e)}function bc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ms="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zc=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 Mt(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Dd(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function OS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var NS=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}`)}},Rc=new Set(["string","number","symbol"]),Zd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(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 jS(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 fs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $c(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Lo={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]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xS(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 cr(s,e,gs(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function gs(e,t){let r=St(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 AS(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(gs(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function qS(e,t){if(!Mt(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=St(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 it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function Ud(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),ES(r,t),r}function MS(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:Ud(e,t)}))}function LS(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={};cr(r,e,Reflect.ownKeys(St(e))),cr(r,t,Reflect.ownKeys(St(t)));let o=yt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,o)}function DS(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(gs(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(St(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),it(t,yt(t._zod.def,{shape:a,checks:[]}))}function ZS(e,t,r){let o=r?new Set(gs(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(St(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),it(t,yt(t._zod.def,{shape:n}))}function ut(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 wc(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 bt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kr(e){return typeof e=="string"?e:e?.message}function _s(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Do(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(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:kr(e.inst?._zod.def?.error?.(e))??kr(s?.(e))??kr(t?.error?.(e))??kr(r.customError?.(e))??kr(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 Vd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var US=/[\uD800-\uDBFF]/;function Zo(e){let t=e.length;if(!US.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 Uo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pc(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 VS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Fd(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 Hd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function FS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Fd(t+r)}function HS(e){return Hd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JS(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 BS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gc=class{constructor(...t){}};function Ec(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):GS(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ss(e,t,r){return qt(e,t,r,!1)}function KS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function GS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function WS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var fc,At=!1,YS={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&fc!==e._zod){fc=void 0;return}fc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,YS);let n=At;At=!1;try{let s=r(this);return At?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),At=At||n,s}catch(s){throw delete this[t],At=At||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function XS(e,t,r,o){let n=WS(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 Jd="~constantCatch";function Bd(e){let t=()=>e;return t[Jd]=!0,t}var Kd,Cc=Object.freeze({status:"aborted"}),Tc={value:void 0,enumerable:!1},Gd="captureStackTrace"in Error?Error:null;function QS(e){let t=Gd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Gd=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{Tc.value=new s(v);try{Object.defineProperty(g,"_zod",Tc)}finally{Tc.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),Ec(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?QS(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 dt=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"}};(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function ey(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function ty(e){this._zod.message=e}var ry={get:ey,set:ty,enumerable:!0,configurable:!0},Ic={value:void 0,enumerable:!1},Wd=new WeakSet([Object.prototype,Error.prototype]),Yd=(e,t)=>{e.name="$ZodError",Ic.value=t,Object.defineProperty(e,"issues",Ic),Ic.value=void 0,Object.defineProperty(e,"message",ry);let r=Object.getPrototypeOf(e);Wd.has(r)||(Wd.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})}}))},Xd=q("$ZodError",Yd),vR=q("$ZodError",Yd,void 0,{Parent:Error});function oy(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 Oc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?oy(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Nc(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 ys(e,t){return{callee:t?.callee??e,Err:t?.Err}}var vs=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 dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var bs=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=>lt(u,i,Qe())));throw ms(a,s?.callee??t),a}return c.value};return t};var zs=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 dt;return s.issues.length?Qd(e,s.issues,n):{success:!0,data:s.value}};function Qd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Rs=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?Qd(e,s.issues,n):{success:!0,data:s.value}};var ny=Symbol.for("zod.compile.invalid"),sy=Symbol.for("zod.compile.fallback"),jc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==ny)return!0;if(o.definite===!0&&r===void 0)return!1}return iy(e,t,r)});function iy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[sy]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var xc=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},ep=e=>{let t=vs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,ys(r,i))};return r};var tp=e=>{let t=vs(e),r=(o,n,s,i)=>t(o,n,s,ys(r,i));return r};var rp=e=>{let t=bs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,ys(r,i))};return r};var op=e=>{let t=bs(e),r=async(o,n,s,i)=>await t(o,n,s,ys(r,i));return r};var np=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zs(e)(t,r,n)};var sp=e=>(t,r,o)=>zs(e)(t,r,o);var ip=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rs(e)(t,r,n)};var ap=e=>async(t,r,o)=>Rs(e)(t,r,o);var cp=/^[cC][0-9a-z]{6,}$/,up=/^[0-9a-z]+$/,lp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,dp=/^[0-9a-vA-V]{20}$/,pp=/^[A-Za-z0-9]{27}$/,mp=/^[a-zA-Z0-9_-]{21}$/;function fp(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gp=/^([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})$/,qc=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 _p=/^(?:[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 ay="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Sp(){return new RegExp(ay,"u")}var yp=/^(?:(?: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])$/,vp=/^(([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 bp=/^((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])$/,zp=/^(([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])$/,Rp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$p=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var wp=/^https?$/,Pp=/^\+[1-9]\d{6,14}$/;var Ep="(?:(?:\\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 cy(e){return new RegExp(`^${e}$`)}var Tp=cy(Ep);function Ac(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 Cp(e){return new RegExp(`^${Ac(e)}$`)}function kp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ac({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ac({precision:e.precision})}`:r;return new RegExp(`^${Ep}T(?:${o})$`)}var Ip=/^[\s\S]{0,}$/;var Op=/^-?\d+n?$/,Mc=/^-?\d+$/,Vo=/^-?\d+(?:\.\d+)?$/,Np=/^(?:true|false)$/i,jp=/^null$/i;var xp=/^[^A-Z]*$/,Ap=/^[^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 Lc=e=>{let t=e.value;return!_c(t)&&t.length!==void 0},$s={number:"number",bigint:"bigint",object:"date"},Dc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:$s[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})}}),Zc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=$s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:$s[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})}}),qp=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):Sc(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})}}),Mp=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]=Lo[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 Lp=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Zo(n):s)<=t.maximum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dp=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Zo(n):s)>=t.minimum)return;let c=Uo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Zo(n):s;if(i===t.length)return;let c=Uo(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})}}),Fo=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=()=>{})}),Up=q("$ZodCheckRegex",(e,t)=>{Fo.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})}}),Vp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xp),Fo.init(e,t)}),Fp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ap),Fo.init(e,t)}),Hp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=vt(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})}}),Jp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${vt(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})}}),Bp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${vt(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 Kp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ws=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{a as Nd,b as xd,c as jd}from"./chunk-PUGNBNSV.js";import"./chunk-W53XNVNH.js";import{a as Id,c as Od}from"./chunk-SM735FG7.js";import{a as Ed,d as Dd}from"./chunk-GYERZAZU.js";import{a as $d,b as wd,f as Pd}from"./chunk-7MC3LDNP.js";import"./chunk-VDQMK2B2.js";import"./chunk-Q6KQWJ4J.js";import{g as qd,i as Md}from"./chunk-TFGK7IRZ.js";import{i as Ad,o as Ld}from"./chunk-7XFLG32B.js";import"./chunk-6RMRWBMB.js";import"./chunk-4YK4XWYS.js";import"./chunk-X6PZIFFX.js";import"./chunk-UGYBXR4V.js";import{b as Zd}from"./chunk-6HQKTDGG.js";import{d as zd,f as Rd}from"./chunk-U3D3EU33.js";import{b as yd,j as ls}from"./chunk-N32JL4UI.js";import{f as ds,g as Td,h as Cd,i as kd}from"./chunk-YJ6XLDRA.js";import"./chunk-63XCSYHM.js";import{a as _t}from"./chunk-P6JX5ZQT.js";import"./chunk-O7DK3GJT.js";import"./chunk-RRVD63NF.js";import"./chunk-EEQSUBBL.js";import"./chunk-MPSLPE4C.js";import"./chunk-FAUL5L2W.js";import{b as mc}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-TLHUFIXD.js";import{m as bd}from"./chunk-4MJEEEFA.js";import"./chunk-V6GWPR2A.js";import"./chunk-WBW6G4N6.js";import{$ as vd,G as st,a as Mo}from"./chunk-ZBMJTIYR.js";import{d as pc}from"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import{d as dc}from"./chunk-TMUK2DD3.js";var $S=Object.create,ps=Object.defineProperty,wS=Object.getOwnPropertyDescriptor,PS=Object.getOwnPropertyNames,ES=Object.getPrototypeOf,TS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ud=(e,t)=>{let r={};for(var o in e)ps(r,o,{get:e[o],enumerable:!0});return t&&ps(r,Symbol.toStringTag,{value:"Module"}),r},CS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=PS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!TS.call(e,c)&&c!==r&&ps(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=wS(t,c))||o.enumerable});return e},ms=(e,t,r)=>(r=e!=null?$S(ES(e)):{},CS(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e));var kS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Vd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),IS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),OS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Fd(e){return typeof e=="string"&&Vd.has(e.replace(/#$/,""))}function Hd(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(kS.has(r))return"2020-12";if(Vd.has(r))return"2019-09";if(IS.has(r)||OS.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 ce={};dc(ce,{BIGINT_FORMAT_RANGES:()=>_s,CONSTANT_CATCH:()=>rp,Class:()=>gc,NUMBER_FORMAT_RANGES:()=>Do,aborted:()=>ut,allowsEval:()=>zc,assert:()=>qS,assertEqual:()=>NS,assertIs:()=>jS,assertNever:()=>AS,assertNotEqual:()=>xS,assignProp:()=>Ye,attachSchema:()=>Zo,base64ToUint8Array:()=>ep,base64urlToUint8Array:()=>ry,cached:()=>Nr,captureStackTrace:()=>hs,cleanEnum:()=>ty,cleanRegex:()=>Lo,clone:()=>it,cloneDef:()=>DS,codePointLength:()=>Uo,constantCatch:()=>op,createTransparentProxy:()=>JS,defineLazy:()=>yc,defineLazyInternal:()=>ge,derived:()=>iy,esc:()=>vc,escapeRegex:()=>vt,explicitlyAborted:()=>wc,extend:()=>GS,finalizeIssue:()=>lt,floatSafeRemainder:()=>Sc,getElementAtPath:()=>ZS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Vo,getParsedType:()=>HS,getSizableOrigin:()=>Qd,hexToUint8Array:()=>ny,hide:()=>vs,installLazyProp:()=>ly,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>jr,joinValues:()=>fs,jsonStringifyReplacer:()=>Or,members:()=>Ec,merge:()=>YS,mergeDefs:()=>yt,normalizeParams:()=>te,nullish:()=>_c,numKeys:()=>FS,objectClone:()=>MS,omit:()=>KS,optionalKeys:()=>$c,own:()=>qt,parsedType:()=>Pc,partial:()=>XS,pick:()=>BS,prefixIssues:()=>bt,primitiveTypes:()=>Yd,promiseAllObject:()=>US,propertyKeyTypes:()=>Rc,randomString:()=>VS,rawShape:()=>xr,required:()=>QS,safeExtend:()=>WS,shallowClone:()=>Wd,sizeCaps:()=>ys,slugify:()=>bc,stringifyPrimitive:()=>gs,toZod:()=>Bd,uint8ArrayToBase64:()=>tp,uint8ArrayToBase64url:()=>oy,uint8ArrayToHex:()=>sy,unwrapMessage:()=>kr});function NS(e){return e}function xS(e){return e}function Bd(){return e=>e}function jS(e){}function AS(e){throw new Error("Unexpected value in exhaustive check")}function qS(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 fs(e,t="|"){return e.map(r=>gs(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var hc=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 hc(e)}function _c(e){return e==null}function Lo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Sc(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 Jd=Symbol("evaluating");function yc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Jd)return o===void 0&&(o=Jd,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function MS(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 xr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function St(e){return xr(e._zod.def)??e._zod.def.shape}function Kd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Gd(e,t,r){t in e?Ye(e,t,r):e[t]=r}function cr(e,t,r,o){let n=St(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Kd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Gd(e,s,o?o(i.value,s):i.value))}}function LS(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Kd(e,r,()=>t[r]):Gd(e,r,o.value))}}function yt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function DS(e){return yt(e._zod.def)}function ZS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function US(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 VS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function vc(e){return JSON.stringify(e)}function bc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var hs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zc=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 Mt(e){if(ur(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ur(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Wd(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function FS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var HS=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}`)}},Rc=new Set(["string","number","symbol"]),Yd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(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 JS(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 gs(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $c(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Do={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_s={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function BS(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 cr(s,e,Ss(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function Ss(e,t){let r=St(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 KS(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(Ss(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function GS(e,t){if(!Mt(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=St(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 it(e,yt(e._zod.def,{shape:Xd(e,t)}))}function Xd(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),LS(r,t),r}function WS(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:Xd(e,t)}))}function YS(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={};cr(r,e,Reflect.ownKeys(St(e))),cr(r,t,Reflect.ownKeys(St(t)));let o=yt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,o)}function XS(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(Ss(t,r)):void 0,a={};return cr(a,t,Reflect.ownKeys(St(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),it(t,yt(t._zod.def,{shape:a,checks:[]}))}function QS(e,t,r){let o=r?new Set(Ss(t,r)):void 0,n={};return cr(n,t,Reflect.ownKeys(St(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),it(t,yt(t._zod.def,{shape:n}))}function ut(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 wc(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 bt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kr(e){return typeof e=="string"?e:e?.message}function ys(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Zo(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function lt(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:kr(e.inst?._zod.def?.error?.(e))??kr(s?.(e))??kr(t?.error?.(e))??kr(r.customError?.(e))??kr(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 Qd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var ey=/[\uD800-\uDBFF]/;function Uo(e){let t=e.length;if(!ey.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 Vo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pc(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 jr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function ty(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function ep(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 tp(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ry(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return ep(t+r)}function oy(e){return tp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ny(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 sy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gc=class{constructor(...t){}};function Ec(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):ay(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function vs(e,t,r){return qt(e,t,r,!1)}function iy(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function ay(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function cy(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var fc,At=!1,uy={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&fc!==e._zod){fc=void 0;return}fc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,uy);let n=At;At=!1;try{let s=r(this);return At?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),At=At||n,s}catch(s){throw delete this[t],At=At||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function ly(e,t,r,o){let n=cy(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 rp="~constantCatch";function op(e){let t=()=>e;return t[rp]=!0,t}var np,Cc=Object.freeze({status:"aborted"}),Tc={value:void 0,enumerable:!1},sp="captureStackTrace"in Error?Error:null;function dy(e){let t=sp;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return sp=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=p,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{Tc.value=new s(v);try{Object.defineProperty(g,"_zod",Tc)}finally{Tc.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),Ec(z,i))}let m=p.prototype;for(let _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(_ in g||(g[_]=m[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function p(g){let v=o?.Parent?dy(d):this;a(v,g);let m=v._zod.deferred;if(m){for(let h of m)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(p,"init",{value:a}),Object.defineProperty(p,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var dt=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"}};(np=globalThis).__zod_globalConfig??(np.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function py(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function my(e){this._zod.message=e}var fy={get:py,set:my,enumerable:!0,configurable:!0},Ic={value:void 0,enumerable:!1},ip=new WeakSet([Object.prototype,Error.prototype]),ap=(e,t)=>{e.name="$ZodError",Ic.value=t,Object.defineProperty(e,"issues",Ic),Ic.value=void 0,Object.defineProperty(e,"message",fy);let r=Object.getPrototypeOf(e);ip.has(r)||(ip.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})}}))},cp=q("$ZodError",ap),xR=q("$ZodError",ap,void 0,{Parent:Error});function hy(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 Oc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?hy(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Nc(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],p=u===c.length-1;if(d==="_errors"){p&&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];p&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function bs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var zs=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 dt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>lt(u,i,Qe())));throw hs(a,s?.callee??t),a}return c.value};return t};var Rs=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=>lt(u,i,Qe())));throw hs(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 dt;return s.issues.length?up(e,s.issues,n):{success:!0,data:s.value}};function up(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>lt(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var ws=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?up(e,s.issues,n):{success:!0,data:s.value}};var gy=Symbol.for("zod.compile.invalid"),_y=Symbol.for("zod.compile.fallback"),xc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==gy)return!0;if(o.definite===!0&&r===void 0)return!1}return Sy(e,t,r)});function Sy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[_y]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new dt;return s.issues.length===0}var jc=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},lp=e=>{let t=zs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,bs(r,i))};return r};var dp=e=>{let t=zs(e),r=(o,n,s,i)=>t(o,n,s,bs(r,i));return r};var pp=e=>{let t=Rs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,bs(r,i))};return r};var mp=e=>{let t=Rs(e),r=async(o,n,s,i)=>await t(o,n,s,bs(r,i));return r};var fp=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return $s(e)(t,r,n)};var hp=e=>(t,r,o)=>$s(e)(t,r,o);var gp=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ws(e)(t,r,n)};var _p=e=>async(t,r,o)=>ws(e)(t,r,o);var Sp=/^[cC][0-9a-z]{6,}$/,yp=/^[0-9a-z]+$/,vp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,bp=/^[0-9a-vA-V]{20}$/,zp=/^[A-Za-z0-9]{27}$/,Rp=/^[a-zA-Z0-9_-]{21}$/;function $p(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var wp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Pp=/^([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})$/,qc=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 Ep=/^(?:[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 yy="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Tp(){return new RegExp(yy,"u")}var Cp=/^(?:(?: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])$/,kp=/^(([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 Ip=/^((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])$/,Op=/^(([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])$/,Np=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var jp=/^https?$/,Ap=/^\+[1-9]\d{6,14}$/;var qp="(?:(?:\\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 vy(e){return new RegExp(`^${e}$`)}var Mp=vy(qp);function Ac(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 Lp(e){return new RegExp(`^${Ac(e)}$`)}function Dp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ac({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ac({precision:e.precision})}`:r;return new RegExp(`^${qp}T(?:${o})$`)}var Zp=/^[\s\S]{0,}$/;var Up=/^-?\d+n?$/,Mc=/^-?\d+$/,Fo=/^-?\d+(?:\.\d+)?$/,Vp=/^(?:true|false)$/i,Fp=/^null$/i;var Hp=/^[^A-Z]*$/,Jp=/^[^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 Lc=e=>{let t=e.value;return!_c(t)&&t.length!==void 0},Ps={number:"number",bigint:"bigint",object:"date"},Dc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=Ps[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Ps[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})}}),Zc=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=Ps[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Ps[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})}}),Bp=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):Sc(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})}}),Kp=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]=Do[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 Gp=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Uo(n):s)<=t.maximum)return;let c=Vo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wp=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Uo(n):s)>=t.minimum)return;let c=Vo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yp=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=Lc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Uo(n):s;if(i===t.length)return;let c=Vo(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})}}),Ho=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=()=>{})}),Xp=q("$ZodCheckRegex",(e,t)=>{Ho.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})}}),Qp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hp),Ho.init(e,t)}),em=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Jp),Ho.init(e,t)}),tm=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=vt(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})}}),rm=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${vt(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})}}),om=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${vt(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 nm=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Es=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
|
`)}
|
|
7
|
-
};`)(...Object.values(this.closed))}};var Wp={major:4,minor:6,patch:7};var Se=q("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wp;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(c,a,u)=>{if(c.memo)return c;let d=ut(c),m;for(let g of a){if(g._zod.def.when){if(wc(c)||!g._zod.def.when(c))continue}else if(d)continue;let v=c.issues.length,p=g._zod.check(c);if(p instanceof Promise&&u?.async===!1)throw new dt;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,c.issues.length!==v&&(Do(c.issues,v,e),d||(d=ut(c,v)))});else{if(c.issues.length===v)continue;Do(c.issues,v,e),d||(d=ut(c,v))}}return m?m.then(()=>c):c},i=(c,a,u)=>{if(ut(c))return c.aborted=!0,c;let d=s(a,n,u);if(d instanceof Promise){if(u.async===!1)throw new dt;return d.then(m=>e._zod.parse(m,u))}return e._zod.parse(d,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let d=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return d instanceof Promise?d.then(m=>i(m,c,a)):i(d,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new dt;return u.then(d=>s(d,n,a))}return s(u,n,a)}}},{get"~standard"(){return Ss(this,"~standard",Vc(this))},set"~standard"(e){qt(this,"~standard",e)}}),am=(e,t)=>e.issues.length?{issues:e.issues.map(r=>lt(r,t,Qe()))}:{value:e.value};async function uy(e,t){let r={async:!0};return am(await e._zod.run({value:t,issues:[]},r),r)}function Vc(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return am(o,r)}catch{}return uy(e,t)},vendor:"zod",version:1}}var Cs=q("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=t.pattern??Ip,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=q("$ZodStringFormat",(e,t)=>{Fo.init(e,t),Cs.init(e,t)}),cm=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gp),Re.init(e,t)}),um=q("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qc(o))}else t.pattern??(t.pattern=qc());Re.init(e,t)}),lm=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_p),Re.init(e,t)}),dm=1,Es=2;function pm(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ly(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?pm(e)||Es:dy(e,t)}function dy(e,t){if(!t.normalize&&t.protocol?.source===wp.source&&!/^https?:\/\//i.test(e))return dm;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Es}return new URL(e)}catch{return Es}}var py=/[\t\n\r]/g;function Yp(e){return e.replace(py,"")}function my(e,t){return t.lastIndex=0,t.test(e.hostname)}function fy(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var mm=q("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=ly(o,t);if(n===dm){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Es){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Yp(o);return}t.hostname&&!my(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!fy(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:Yp(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),fm=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Sp()),Re.init(e,t)}),hm=q("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?mp:fp(t.length)),Re.init(e,t)}),gm=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cp),Re.init(e,t)}),_m=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=up),Re.init(e,t)}),Sm=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lp),Re.init(e,t)}),ym=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dp),Re.init(e,t)}),vm=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=pp),Re.init(e,t)}),bm=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=kp(t)),Re.init(e,t)}),zm=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Tp),Re.init(e,t)}),Rm=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Cp(t)),Re.init(e,t)}),$m=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hp),Re.init(e,t)}),wm=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yp),Re.init(e,t)}),hy=/^[0-9a-fA-F:.]+$/;function Pm(e){return hy.test(e)?pm(`http://[${e}]`):!1}var Em=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=vp),Re.init(e,t),e._zod.check=r=>{Pm(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Tm=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bp),Re.init(e,t)});function gy(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:Pm(r)}var Cm=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=zp),Re.init(e,t),e._zod.check=r=>{gy(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function km(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Fc=/^[0-9a-zA-Z+/]*={0,2}$/,Im=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Fc),Re.init(e,t),e._zod.check=r=>{km(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ks=/^[A-Za-z0-9_-]*$/;function _y(e){if(!ks.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return km(r)}var Om=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ks),Re.init(e,t),e._zod.check=r=>{_y(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Nm=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pp),Re.init(e,t)});function Sy(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var jm=q("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{Sy(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Hc=q("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=Vo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),xm=q("$ZodNumberFormat",(e,t)=>{Mp.init(e,t),Hc.init(e,t)}),Am=q("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=Np,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),qm=q("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=Op,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Mm=q("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=jp,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Lm=q("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Dm=q("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Zm=q("$ZodNever",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var Um=q("$ZodDate",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function yy(e,t){let r=_s(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(s=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let c=t(s.value);if(c>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[a,u]of _s(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){let d=s.issues.length;return u._zod.check(s),s.issues[d].continue=!1,Do(s.issues,d,e),s}}return n(s,i)}}var vy=e=>Array.isArray(e)?e.length:-1;function Xp(e,t,r){e.issues.length&&t.issues.push(...bt(r,e.issues)),t.value[r]=e.value}var Vm=q("$ZodArray",(e,t)=>{Se.init(e,t);let r=Xe.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],c=n?.abortEarly;for(let a=0;a<s.length;a++){let u=s[a],d=t.element._zod.run({value:u,issues:[]},n);if(d instanceof Promise)i.push(d.then(m=>Xp(m,o,a)));else if(Xp(d,o,a),c&&d.issues.length!==0&&ut(d))break}return i.length?Promise.all(i).then(()=>o):o},yy(e,vy)});function Ts(e,t,r,o,n,s){let i=r in o,c=s==="optional";if(!(!i&&c&&n==="optional")){if(e.issues.length){if(n!==void 0&&c&&!i)return;t.issues.push(...bt(r,e.issues))}if(!i&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(i||n==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var by=[];function Fm(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:by,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=$c(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Hm(e,t,r,o,n,s,i){let c=[],a=n.keySet,u=n.catchall._zod,d=u.def.type,m=u.optin,g=u.optout,v=0;for(let p in t){if(i&&r.issues.length!==v){if(ut(r,v))break;v=r.issues.length}if(a.has(p))continue;if(p==="__proto__"){d==="never"&&c.push(p);continue}if(d==="never"){c.push(p);continue}let _=u.run({value:t[p],issues:[]},o);_ instanceof Promise?e.push(_.then(h=>Ts(h,r,p,t,m,g))):Ts(_,r,p,t,m,g)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var zy=q("$ZodObject",(e,t)=>{Se.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let d={...o};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Nr(()=>Fm(t));ge(e,"propValues",u=>{let d=u.def.shape,m={};for(let g in d){let v=d[g]._zod;if(v.values){Object.prototype.hasOwnProperty.call(m,g)||Ye(m,g,new Set);for(let p of v.values)m[g].add(p);v.optin!==void 0&&m[g].add(void 0)}}return m});let s=ur,i=t.catchall,c,a=Xe.memoizer;a?.attach(e),e._zod.parse=(u,d)=>{c??(c=n.value);let m=u.value;if(!s(m))return u.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),u;u.value=a?a.alloc(e,u,{},d):{};let g=[],v=c.shape,p=d?.abortEarly,_=u.issues.length;for(let h of c.allKeys){if(p&&u.issues.length!==_){if(ut(u,_))break;_=u.issues.length}if(h==="__proto__")continue;let f=v[h],z=f._zod.optin,y=f._zod.optout,R=f._zod.run({value:m[h],issues:[]},d);R instanceof Promise?g.push(R.then(w=>Ts(w,u,h,m,z,y))):Ts(R,u,h,m,z,y)}return i?Hm(g,m,u,d,n.value,e,p===!0):g.length?Promise.all(g).then(()=>u):u}}),Jm=q("$ZodObjectJIT",(e,t)=>{zy.init(e,t);let r=e._zod.parse,o=Nr(()=>Fm(t)),n=Xe.memoizer,s=v=>{let p=o.value,_=p.symbolKeys,h=new ws(["payload","ctx"],{shape:v,inst:e,memo:n,syms:_}),f=w=>`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`,z=(w,b)=>`
|
|
7
|
+
};`)(...Object.values(this.closed))}};var im={major:4,minor:6,patch:7};var Se=q("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=im;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(c,a,u)=>{if(c.memo)return c;let d=ut(c),p;for(let g of a){if(g._zod.def.when){if(wc(c)||!g._zod.def.when(c))continue}else if(d)continue;let v=c.issues.length,m=g._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new dt;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,c.issues.length!==v&&(Zo(c.issues,v,e),d||(d=ut(c,v)))});else{if(c.issues.length===v)continue;Zo(c.issues,v,e),d||(d=ut(c,v))}}return p?p.then(()=>c):c},i=(c,a,u)=>{if(ut(c))return c.aborted=!0,c;let d=s(a,n,u);if(d instanceof Promise){if(u.async===!1)throw new dt;return d.then(p=>e._zod.parse(p,u))}return e._zod.parse(d,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let d=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,c,a)):i(d,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new dt;return u.then(d=>s(d,n,a))}return s(u,n,a)}}},{get"~standard"(){return vs(this,"~standard",Vc(this))},set"~standard"(e){qt(this,"~standard",e)}}),_m=(e,t)=>e.issues.length?{issues:e.issues.map(r=>lt(r,t,Qe()))}:{value:e.value};async function by(e,t){let r={async:!0};return _m(await e._zod.run({value:t,issues:[]},r),r)}function Vc(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return _m(o,r)}catch{}return by(e,t)},vendor:"zod",version:1}}var Is=q("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=t.pattern??Zp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=q("$ZodStringFormat",(e,t)=>{Ho.init(e,t),Is.init(e,t)}),Sm=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Pp),Re.init(e,t)}),ym=q("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qc(o))}else t.pattern??(t.pattern=qc());Re.init(e,t)}),vm=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ep),Re.init(e,t)}),bm=1,Cs=2;function zm(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function zy(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?zm(e)||Cs:Ry(e,t)}function Ry(e,t){if(!t.normalize&&t.protocol?.source===jp.source&&!/^https?:\/\//i.test(e))return bm;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Cs}return new URL(e)}catch{return Cs}}var $y=/[\t\n\r]/g;function am(e){return e.replace($y,"")}function wy(e,t){return t.lastIndex=0,t.test(e.hostname)}function Py(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Rm=q("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=zy(o,t);if(n===bm){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Cs){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=am(o);return}t.hostname&&!wy(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Py(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:am(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),$m=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tp()),Re.init(e,t)}),wm=q("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Rp:$p(t.length)),Re.init(e,t)}),Pm=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Sp),Re.init(e,t)}),Em=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yp),Re.init(e,t)}),Tm=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vp),Re.init(e,t)}),Cm=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bp),Re.init(e,t)}),km=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=zp),Re.init(e,t)}),Im=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Dp(t)),Re.init(e,t)}),Om=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Mp),Re.init(e,t)}),Nm=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lp(t)),Re.init(e,t)}),xm=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=wp),Re.init(e,t)}),jm=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Cp),Re.init(e,t)}),Ey=/^[0-9a-fA-F:.]+$/;function Am(e){return Ey.test(e)?zm(`http://[${e}]`):!1}var qm=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kp),Re.init(e,t),e._zod.check=r=>{Am(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Mm=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ip),Re.init(e,t)});function Ty(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:Am(r)}var Lm=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Op),Re.init(e,t),e._zod.check=r=>{Ty(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Dm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Fc=/^[0-9a-zA-Z+/]*={0,2}$/,Zm=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Fc),Re.init(e,t),e._zod.check=r=>{Dm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Os=/^[A-Za-z0-9_-]*$/;function Cy(e){if(!Os.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Dm(r)}var Um=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Os),Re.init(e,t),e._zod.check=r=>{Cy(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Vm=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ap),Re.init(e,t)});function ky(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Fm=q("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{ky(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Hc=q("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=Fo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),Hm=q("$ZodNumberFormat",(e,t)=>{Kp.init(e,t),Hc.init(e,t)}),Jm=q("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=Vp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Bm=q("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=Up,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Km=q("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=Fp,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Gm=q("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Wm=q("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Ym=q("$ZodNever",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var Xm=q("$ZodDate",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Iy(e,t){let r=ys(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(s=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let c=t(s.value);if(c>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[a,u]of ys(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){let d=s.issues.length;return u._zod.check(s),s.issues[d].continue=!1,Zo(s.issues,d,e),s}}return n(s,i)}}var Oy=e=>Array.isArray(e)?e.length:-1;function cm(e,t,r){e.issues.length&&t.issues.push(...bt(r,e.issues)),t.value[r]=e.value}var Qm=q("$ZodArray",(e,t)=>{Se.init(e,t);let r=Xe.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],c=n?.abortEarly;for(let a=0;a<s.length;a++){let u=s[a],d=t.element._zod.run({value:u,issues:[]},n);if(d instanceof Promise)i.push(d.then(p=>cm(p,o,a)));else if(cm(d,o,a),c&&d.issues.length!==0&&ut(d))break}return i.length?Promise.all(i).then(()=>o):o},Iy(e,Oy)});function ks(e,t,r,o,n,s){let i=r in o,c=s==="optional";if(!(!i&&c&&n==="optional")){if(e.issues.length){if(n!==void 0&&c&&!i)return;t.issues.push(...bt(r,e.issues))}if(!i&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(i||n==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var Ny=[];function ef(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:Ny,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=$c(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function tf(e,t,r,o,n,s,i){let c=[],a=n.keySet,u=n.catchall._zod,d=u.def.type,p=u.optin,g=u.optout,v=0;for(let m in t){if(i&&r.issues.length!==v){if(ut(r,v))break;v=r.issues.length}if(a.has(m))continue;if(m==="__proto__"){d==="never"&&c.push(m);continue}if(d==="never"){c.push(m);continue}let _=u.run({value:t[m],issues:[]},o);_ instanceof Promise?e.push(_.then(h=>ks(h,r,m,t,p,g))):ks(_,r,m,t,p,g)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var xy=q("$ZodObject",(e,t)=>{Se.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let d={...o};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Nr(()=>ef(t));ge(e,"propValues",u=>{let d=u.def.shape,p={};for(let g in d){let v=d[g]._zod;if(v.values){Object.prototype.hasOwnProperty.call(p,g)||Ye(p,g,new Set);for(let m of v.values)p[g].add(m);v.optin!==void 0&&p[g].add(void 0)}}return p});let s=ur,i=t.catchall,c,a=Xe.memoizer;a?.attach(e),e._zod.parse=(u,d)=>{c??(c=n.value);let p=u.value;if(!s(p))return u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u;u.value=a?a.alloc(e,u,{},d):{};let g=[],v=c.shape,m=d?.abortEarly,_=u.issues.length;for(let h of c.allKeys){if(m&&u.issues.length!==_){if(ut(u,_))break;_=u.issues.length}if(h==="__proto__")continue;let f=v[h],z=f._zod.optin,y=f._zod.optout,R=f._zod.run({value:p[h],issues:[]},d);R instanceof Promise?g.push(R.then(w=>ks(w,u,h,p,z,y))):ks(R,u,h,p,z,y)}return i?tf(g,p,u,d,n.value,e,m===!0):g.length?Promise.all(g).then(()=>u):u}}),rf=q("$ZodObjectJIT",(e,t)=>{xy.init(e,t);let r=e._zod.parse,o=Nr(()=>ef(t)),n=Xe.memoizer,s=v=>{let m=o.value,_=m.symbolKeys,h=new Es(["payload","ctx"],{shape:v,inst:e,memo:n,syms:_}),f=w=>`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`,z=(w,b)=>`
|
|
8
8
|
let ${w}_ab = false;
|
|
9
9
|
for (let i = 0; i < ${w}.issues.length; i++) {
|
|
10
10
|
const iss = ${w}.issues[i];
|
|
@@ -15,7 +15,7 @@ ${r.join(`
|
|
|
15
15
|
if (${w}_ab && ctx && ctx.abortEarly) {
|
|
16
16
|
payload.value = newResult;
|
|
17
17
|
return payload;
|
|
18
|
-
}`;h.write("const input = payload.value;");let y=Object.create(null),R=0;for(let w of
|
|
18
|
+
}`;h.write("const input = payload.value;");let y=Object.create(null),R=0;for(let w of m.allKeys)y[w]=`key_${R++}`;h.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let w of m.allKeys){if(w==="__proto__")continue;let b=y[w],S=typeof w=="symbol"?`syms[${_.indexOf(w)}]`:vc(w),E=`${S} in input`,x=v[w],F=x?._zod?.optin,M=F!==void 0,Z=x?._zod?.optout==="optional";if(h.write(`const ${b} = ${f(S)};`),M&&Z){let Y=F==="optional"?`${b}_present`:`${b}.value !== undefined || ${b}_present`;h.write(`
|
|
19
19
|
const ${b}_present = ${E};
|
|
20
20
|
if (!${b}.issues.length || ${b}_present) {
|
|
21
21
|
if (${b}.issues.length) {${z(b,S)}
|
|
@@ -54,21 +54,21 @@ ${r.join(`
|
|
|
54
54
|
newResult[${S}] = ${b}.value;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
`)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,c=ur,a=!Xe.jitless,d=a&&zc.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?Hm([],_,v,p,g,e,p?.abortEarly===!0):v):r(v,p):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function Qp(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=>!ut(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=>lt(i,o,Qe())))}),t)}var Jc=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=>Mo(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=>Qp(c,o,e,n)):Qp(i,o,e,n)}});function Ry(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 Bm=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Jc.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(()=>Ry(t));e._zod.parse=(n,s)=>{let i=n.value;if(!ur(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)}}),Km=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])=>em(r,a,u)):em(r,s,i)}});function Uc(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(Mt(e)&&Mt(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=Uc(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=Uc(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 em(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=Uc(t.value,r.value);if(!a.valid){if(ut(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Gm=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(!Mt(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=>lt(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(...bt(d,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...bt(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"&&Vo.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=>lt(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(...bt(u,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...bt(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 Wm=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=>Rc.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>vt(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}}),Ym=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"?vt(s):s?vt(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 Xm=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 dt;return r.value=n,r}});function tm(e,t){return e.value=t.issues.length?void 0:t.value,e}var Bc=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(`^(${Mo(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=>tm(r,s)):tm(r,n)}return t.innerType._zod.run(r,o)}}),Qm=q("$ZodExactOptional",(e,t)=>{Bc.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)}),ef=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(`^(${Mo(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)}),tf=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=>rm(s,t)):rm(n,t)}});function rm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rf=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))}),of=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=>om(s,e)):om(n,e)}});function om(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 nm(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>lt(n,o,Qe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var nf=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=>nm(r,s,t,o)):nm(r,n,t,o)}});var Kc=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=>Ps(i,t.in,o)):Ps(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Ps(s,t.out,o)):Ps(n,t.out,o)}});function Ps(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 sf=q("$ZodPreprocess",(e,t)=>{Kc.init(e,t)}),af=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(sm):sm(n)}});function sm(e){return e.memo||(e.value=Object.freeze(e.value)),e}var cf=q("$ZodLazy",(e,t)=>{Se.init(e,t),yc(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)}),uf=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=>im(s,r,o,e));im(n,r,o,e)}});function im(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 Wc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Yc="~memo",lf=[];function df(e){return e!==null&&typeof e=="object"}function Gc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var pf=new WeakMap,Ho=0,Ns=1,Jo=2;function js(e,t,r){let o=pf.get(e);if(o!==void 0)return o?Jo:Ho;if(t.has(e))return Jo;t.add(e);let n=Ho,s=d=>{if(n!==Jo&&d?._zod){let m=js(d,t,r);m>n&&(n=m)}},i=(d,m)=>{let g=Ho;for(let v of Reflect.ownKeys(d)){let p=Object.getOwnPropertyDescriptor(d,v);if(m&&!p.enumerable)continue;let _=p.get?Ns:p.value?._zod?js(p.value,t,r):Ho;_>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):Ns),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?js(d,t,!1):Ns);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),$y(e,n)}function $y(e,t){return t!==Ns&&pf.set(e,t===Jo),t}function wy(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Is,Os=[],Py={alloc(e,t,r){let o=Is;if(!o)return r;Is=void 0;let n={value:r,issues:null};return o.set(t.value,n),Os.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"&&Ey(s,n.value))throw new Wc;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=js(e,new Set,!1);if(f===Ho)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Jo||o?r=!0:o=!0}let d=a.value;if(!df(d))return i(a,u);let m=u[Yc];m||(m={buckets:new WeakMap,backEdges:void 0},u[Yc]=m);let g;n===u?g=s:(g=wy(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(...Gc(v.issues)):(a.memo=!0,m.backEdges??(m.backEdges=new WeakSet),m.backEdges.add(v.value)),a;Is=g;let p=Os.length,_=i(a,u);Is=void 0;let h=Os.length>p?Os.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Gc(f.issues):lf),f)):(h&&(h.issues=_.issues.length?Gc(_.issues):lf),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function Xc(){return Py}function Ey(e,t){let r=e[Yc]?.backEdges;return r!==void 0&&df(t)&&r.has(t)}var Ty=()=>{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=Pc(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 ${fs(s.values[0])}`:`Invalid option: expected one of ${ps(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":""}: ${ps(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 mf(){return{localeError:Ty()}}var ff;var Qc=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 hf(){return new Qc}(ff=globalThis).__zod_globalRegistry??(ff.__zod_globalRegistry=hf());var Lt=globalThis.__zod_globalRegistry;function xs(e){return e.checks&&(e.checks=[...e.checks]),e}function gf(e,t){return new e(xs({type:"string",...te(t)}))}function _f(e,t){return new e(xs({type:"string",coerce:!0,...te(t)}))}function eu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Sf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function yf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function vf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function bf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function zf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function tu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function Rf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function $f(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function wf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function Pf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function Ef(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Tf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Cf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function kf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function If(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Of(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function Nf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function jf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function xf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Af(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function qf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function As(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function qs(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Ms(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Ls(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Mf(e,t){return new e(xs({type:"number",checks:[],...te(t)}))}function Lf(e,t){return new e(xs({type:"number",coerce:!0,checks:[],...te(t)}))}function Df(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Zf(e,t){return new e({type:"boolean",...te(t)})}function Uf(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function Vf(e,t){return new e({type:"bigint",coerce:!0,...te(t)})}function Ff(e,t){return new e({type:"null",...te(t)})}function Hf(e){return new e({type:"any"})}function Jf(e){return new e({type:"unknown"})}function Bf(e,t){return new e({type:"never",...te(t)})}function Kf(e,t){return new e({type:"date",coerce:!0,...te(t)})}function Mr(e,t){return new Dc({check:"less_than",...te(t),value:e,inclusive:!1})}function zt(e,t){return new Dc({check:"less_than",...te(t),value:e,inclusive:!0})}function Lr(e,t){return new Zc({check:"greater_than",...te(t),value:e,inclusive:!1})}function Rt(e,t){return new Zc({check:"greater_than",...te(t),value:e,inclusive:!0})}function Bo(e,t){return new qp({check:"multiple_of",...te(t),value:e})}function Ds(e,t){return new Lp({check:"max_length",...te(t),maximum:e})}function Dr(e,t){return new Dp({check:"min_length",...te(t),minimum:e})}function Zs(e,t){return new Zp({check:"length_equals",...te(t),length:e})}function ru(e,t){return new Up({check:"string_format",format:"regex",...te(t),pattern:e})}function ou(e){return new Vp({check:"string_format",format:"lowercase",...te(e)})}function nu(e){return new Fp({check:"string_format",format:"uppercase",...te(e)})}function su(e,t){return new Hp({check:"string_format",format:"includes",...te(t),includes:e})}function iu(e,t){return new Jp({check:"string_format",format:"starts_with",...te(t),prefix:e})}function au(e,t){return new Bp({check:"string_format",format:"ends_with",...te(t),suffix:e})}function Dt(e){return new Kp({check:"overwrite",tx:e})}function cu(e){return Dt(t=>t.normalize(e))}function uu(){return Dt(e=>e.trim())}function lu(){return Dt(e=>e.toLowerCase())}function du(){return Dt(e=>e.toUpperCase())}function pu(){return Dt(e=>bc(e))}function Gf(e,t,r){return new e({type:"array",element:t,...te(r)})}function Wf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function Yf(e,t){let r=Cy(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 Cy(e,t){let r=new Ze({check:"custom",...te(t)});return r._zod.check=e,r}function Ko(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 Wo(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??Lt,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&&Ko(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 Xf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Yo(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}/${Xf(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+Xf(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>
|
|
57
|
+
`)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,c=ur,a=!Xe.jitless,d=a&&zc.value,p=t.catchall,g;e._zod.parse=(v,m)=>{g??(g=o.value);let _=v.value;return c(_)?a&&d&&m?.async===!1&&m.jitless!==!0?(i||(i=s(t.shape)),v=i(v,m),p?tf([],_,v,m,g,e,m?.abortEarly===!0):v):r(v,m):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function um(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=>!ut(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=>lt(i,o,Qe())))}),t)}var Jc=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=>Lo(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=>um(c,o,e,n)):um(i,o,e,n)}});function jy(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 of=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Jc.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 p of d)s[u].add(p)}}return!n.def.unionFallback&&i>1&&s[n.def.discriminator]?.delete(void 0),s}),t.options.forEach((n,s)=>{let i=xr(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(()=>jy(t));e._zod.parse=(n,s)=>{let i=n.value;if(!ur(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)}}),nf=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])=>lm(r,a,u)):lm(r,s,i)}});function Uc(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(Mt(e)&&Mt(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=Uc(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=Uc(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 lm(e,t,r){let o=new Map,n,s=new Map,i=(u,d)=>{let p;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),p=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),p=[g]}else return!1;for(let g of p)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=Uc(t.value,r.value);if(!a.valid){if(ut(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var sf=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(!Mt(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 p=t.keyType._zod.run({value:d,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(m=>lt(m,n,Qe())),input:d,path:[d],inst:e});continue}let g=p.value;if(g==="__proto__")continue;let v=t.valueType._zod.run({value:s[d],issues:[]},n);v instanceof Promise?i.push(v.then(m=>{m.issues.length&&o.issues.push(...bt(d,m.issues)),o.value[g]=m.value})):(v.issues.length&&o.issues.push(...bt(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"&&Fo.test(u)&&d.issues.length){let m=t.keyType._zod.run({value:Number(u),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}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(m=>lt(m,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(m=>{m.issues.length&&o.issues.push(...bt(u,m.issues)),o.value[g]=m.value})):(v.issues.length&&o.issues.push(...bt(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 af=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=>Rc.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>vt(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}}),cf=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"?vt(s):s?vt(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 uf=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 dt;return r.value=n,r}});function dm(e,t){return e.value=t.issues.length?void 0:t.value,e}var Bc=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(`^(${Lo(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=>dm(r,s)):dm(r,n)}return t.innerType._zod.run(r,o)}}),lf=q("$ZodExactOptional",(e,t)=>{Bc.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)}),df=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(`^(${Lo(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)}),pf=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=>pm(s,t)):pm(n,t)}});function pm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var mf=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))}),ff=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=>mm(s,e)):mm(n,e)}});function mm(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 fm(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>lt(n,o,Qe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var hf=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=>fm(r,s,t,o)):fm(r,n,t,o)}});var Kc=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=>Ts(i,t.in,o)):Ts(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Ts(s,t.out,o)):Ts(n,t.out,o)}});function Ts(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 gf=q("$ZodPreprocess",(e,t)=>{Kc.init(e,t)}),_f=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(hm):hm(n)}});function hm(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Sf=q("$ZodLazy",(e,t)=>{Se.init(e,t),yc(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)}),yf=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=>gm(s,r,o,e));gm(n,r,o,e)}});function gm(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(jr(n))}}var Wc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Yc="~memo",vf=[];function bf(e){return e!==null&&typeof e=="object"}function Gc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var zf=new WeakMap,Jo=0,js=1,Bo=2;function As(e,t,r){let o=zf.get(e);if(o!==void 0)return o?Bo:Jo;if(t.has(e))return Bo;t.add(e);let n=Jo,s=d=>{if(n!==Bo&&d?._zod){let p=As(d,t,r);p>n&&(n=p)}},i=(d,p)=>{let g=Jo;for(let v of Reflect.ownKeys(d)){let m=Object.getOwnPropertyDescriptor(d,v);if(p&&!m.enumerable)continue;let _=m.get?js:m.value?._zod?As(m.value,t,r):Jo;_>g&&(g=_)}return g},c=d=>{d>n&&(n=d)},a=e._zod.def,u=a.type;switch(u){case"object":{let d=xr(a);c(d?i(d,!0):js),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?As(d,t,!1):js);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 p=Object.getOwnPropertyDescriptor(a,d);if(!p||p.get)continue;let g=p.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),Ay(e,n)}function Ay(e,t){return t!==js&&zf.set(e,t===Bo),t}function qy(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Ns,xs=[],My={alloc(e,t,r){let o=Ns;if(!o)return r;Ns=void 0;let n={value:r,issues:null};return o.set(t.value,n),xs.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"&&Ly(s,n.value))throw new Wc;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=As(e,new Set,!1);if(f===Jo)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Bo||o?r=!0:o=!0}let d=a.value;if(!bf(d))return i(a,u);let p=u[Yc];p||(p={buckets:new WeakMap,backEdges:void 0},u[Yc]=p);let g;n===u?g=s:(g=qy(p,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(...Gc(v.issues)):(a.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(v.value)),a;Ns=g;let m=xs.length,_=i(a,u);Ns=void 0;let h=xs.length>m?xs.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Gc(f.issues):vf),f)):(h&&(h.issues=_.issues.length?Gc(_.issues):vf),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function Xc(){return My}function Ly(e,t){let r=e[Yc]?.backEdges;return r!==void 0&&bf(t)&&r.has(t)}var Dy=()=>{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=Pc(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 ${gs(s.values[0])}`:`Invalid option: expected one of ${fs(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":""}: ${fs(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 Rf(){return{localeError:Dy()}}var $f;var Qc=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 wf(){return new Qc}($f=globalThis).__zod_globalRegistry??($f.__zod_globalRegistry=wf());var Lt=globalThis.__zod_globalRegistry;function qs(e){return e.checks&&(e.checks=[...e.checks]),e}function Pf(e,t){return new e(qs({type:"string",...te(t)}))}function Ef(e,t){return new e(qs({type:"string",coerce:!0,...te(t)}))}function eu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Tf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function Cf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function kf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function If(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function Of(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function tu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function Nf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function xf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function jf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function Af(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function qf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Mf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Lf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function Df(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Zf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Uf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function Vf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Ff(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Hf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Jf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Bf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Ms(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Ls(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Ds(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Zs(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Kf(e,t){return new e(qs({type:"number",checks:[],...te(t)}))}function Gf(e,t){return new e(qs({type:"number",coerce:!0,checks:[],...te(t)}))}function Wf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Yf(e,t){return new e({type:"boolean",...te(t)})}function Xf(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function Qf(e,t){return new e({type:"bigint",coerce:!0,...te(t)})}function eh(e,t){return new e({type:"null",...te(t)})}function th(e){return new e({type:"any"})}function rh(e){return new e({type:"unknown"})}function oh(e,t){return new e({type:"never",...te(t)})}function nh(e,t){return new e({type:"date",coerce:!0,...te(t)})}function Mr(e,t){return new Dc({check:"less_than",...te(t),value:e,inclusive:!1})}function zt(e,t){return new Dc({check:"less_than",...te(t),value:e,inclusive:!0})}function Lr(e,t){return new Zc({check:"greater_than",...te(t),value:e,inclusive:!1})}function Rt(e,t){return new Zc({check:"greater_than",...te(t),value:e,inclusive:!0})}function Ko(e,t){return new Bp({check:"multiple_of",...te(t),value:e})}function Us(e,t){return new Gp({check:"max_length",...te(t),maximum:e})}function Dr(e,t){return new Wp({check:"min_length",...te(t),minimum:e})}function Vs(e,t){return new Yp({check:"length_equals",...te(t),length:e})}function ru(e,t){return new Xp({check:"string_format",format:"regex",...te(t),pattern:e})}function ou(e){return new Qp({check:"string_format",format:"lowercase",...te(e)})}function nu(e){return new em({check:"string_format",format:"uppercase",...te(e)})}function su(e,t){return new tm({check:"string_format",format:"includes",...te(t),includes:e})}function iu(e,t){return new rm({check:"string_format",format:"starts_with",...te(t),prefix:e})}function au(e,t){return new om({check:"string_format",format:"ends_with",...te(t),suffix:e})}function Dt(e){return new nm({check:"overwrite",tx:e})}function cu(e){return Dt(t=>t.normalize(e))}function uu(){return Dt(e=>e.trim())}function lu(){return Dt(e=>e.toLowerCase())}function du(){return Dt(e=>e.toUpperCase())}function pu(){return Dt(e=>bc(e))}function sh(e,t,r){return new e({type:"array",element:t,...te(r)})}function ih(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function ah(e,t){let r=Zy(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(jr(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(jr(s))}},e(o.value,o)),t);return r}function Zy(e,t){let r=new Ze({check:"custom",...te(t)});return r._zod.check=e,r}function Go(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 Yo(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??Lt,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 p=e._zod.parent;p&&(i.ref||(i.ref=p),ve(p,t,d),t.seen.get(p).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Go(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 ch(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Xo(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 p=e.external.registry.get(i[0])?.id,g=e.external.uri??(m=>m);if(p)return{ref:g(p)};let v=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${ch(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+ch(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 p in d)delete d[p];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 th(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;th(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 rh=new Set(["type","properties","required","additionalProperties"]),Qf=["oneOf","anyOf"];function eh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!rh.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]??eh(u);d!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:mu(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=eh(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 ky(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of rh)if(n in e)return;let r=t.filter(n=>Qf.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=mu(t);else{let n=r[0],s=Qf.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=>mu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Ko(e,o))}function Xo(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)):Ko(u,p),Ko(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())th(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)??[])ky(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)}Ko(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:Go(t,"input",e.processors),output:Go(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 oh=(e,t={})=>r=>{let o=Wo({...r,processors:t});return ve(e,o),Yo(o,e),Xo(o,e)},Go=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Wo({...n??{},target:s,io:t,processors:r});return ve(e,i),Yo(i,e),Xo(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)},nh=(e,t)=>{Zr(e,"minimum",t),Ur(e,"maximum",t)},uh=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},lh=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},dh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},ph=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},sh=(e,t)=>Zr(e,"minimum",t.minimum),ih=(e,t)=>Ur(e,"maximum",t.maximum),ah=e=>(t,r)=>{ph(t,r.format);let[o,n]=e[r.format];Zr(t,"minimum",o),Ur(t,"maximum",n)},Iy={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)=>uh(e,t.value),number_format:ah(Lo),bigint_format:ah(hs),min_length:sh,max_length:ih,length_equals:(e,t)=>nh(e,t.length),min_size:sh,max_size:ih,size_equals:(e,t)=>nh(e,t.size),string_format:(e,t)=>{ph(e,t.format),t.pattern&&lh(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)=>dh(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)Iy[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&&uh(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&dh(t,n.mime);for(let s of n.patterns??[])lh(t,s);return t}var Oy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ny=new Map([[Fc,Rp],[ks,$p]]),mh=e=>Ny.get(e)??e,gu=(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=Oy[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(mh);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}))])}},_u=(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}))])}},Su=(e,t,r,o)=>{r.type="boolean"},yu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},fh=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},hh=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},gh=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},bu=(e,t,r,o)=>{r.not={}},zu=(e,t,r,o)=>{},Ru=(e,t,r,o)=>{},$u=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},wu=(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},Pu=(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},_h=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},Sh=(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},yh=(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})))},vh=(e,t,r,o)=>{r.type="boolean"},Eu=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},bh=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Tu=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},zh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},Rh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},Cu=(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 Qo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Qo(t.out):t.type==="catch"?Qo(t.innerType):e._zod.optin}var ku=(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"?Qo(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)},Iu=(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},Ou=(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)},$h=(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"?Qo(_)!==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 fu(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 _=fu(e,p,r);return _===p?t:_}for(let p of["anyOf","oneOf"]){let _=t[p];if(!Array.isArray(_))continue;let h=_.map(f=>fu(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")?Vo:Mc).source)),v}var hu=new WeakMap;function jy(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 hu.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=fu(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 Nu=(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,mh(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=hu.get(t);d||(d=[],hu.set(t,d),t.deferred.push(()=>jy(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&Qo(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))}},ju=(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"}]},xu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Au=Symbol();function wh(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"),Au):JSON.parse(i)}var qu=(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=wh(n.defaultValue,e,t,r,o);i!==Au&&(r.default=i)},Mu=(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=wh(n.defaultValue,e,t,r,o);i!==Au&&(r._prefault=i)},Lu=(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},Du=(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},Zu=(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},Ph=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Us=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Uu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},ch={string:gu,number:_u,boolean:Su,bigint:yu,symbol:fh,null:vu,undefined:hh,void:gh,never:bu,any:zu,unknown:Ru,date:$u,enum:wu,literal:Pu,nan:_h,template_literal:Sh,file:yh,success:vh,custom:Eu,function:bh,transform:Tu,map:zh,set:Rh,array:Cu,object:ku,union:Iu,intersection:Ou,tuple:$h,record:Nu,nullable:ju,nonoptional:xu,default:qu,prefault:Mu,catch:Lu,pipe:Du,readonly:Zu,promise:Ph,optional:Us,lazy:Uu};function Vs(e,t){if("_idmap"in e){let o=e,n=Wo({...t,processors:ch}),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;Yo(n,d),Ye(i,u,Xo(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=Wo({...t,processors:ch});return ve(e,r),Yo(r,e),Xo(r,e)}var Eh=new WeakSet([Object.prototype,Error.prototype]);function Fs(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 Vy=(e,t)=>{Xd.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Eh.has(r)||(Eh.add(r),Fs(r,"format",o=>n=>Nc(o,n)),Fs(r,"flatten",o=>n=>Oc(o,n)),Fs(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Or,2)}),Fs(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",Vy,void 0,{Parent:Error});var Th=vs(rt),Ch=bs(rt),Hs=zs(rt),kh=Rs(rt),Ih=ep(rt),Oh=tp(rt),Nh=rp(rt),jh=op(rt),xh=np(rt),Ah=sp(rt),qh=ip(rt),Mh=ap(rt);function Hy(){Xe.localeError||Qe(mf())}function Bs(){Xe.memoizer||Qe({memoizer:Xc()})}var ye=q("ZodType",(e,t)=>(Hy(),Se.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ce.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 it(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ov(e,t))},superRefine(e,t){return this.check(Nv(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return X(this)},exactOptional(){return Sv(this)},nullable(){return Zh(this)},nullish(){return X(Zh(this))},nonoptional(e){return $v(this,e)},array(){return I(this)},or(e){return W([this,e])},and(e){return $t(this,e)},transform(e){return Uh(this,Xh(e))},default(e){return bv(this,e)},prefault(e){return Rv(this,e)},catch(e){return Pv(this,e)},pipe(e){return Uh(this,e)},readonly(){return Cv(this)},describe(e){let t=this.clone();return Lt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Lt.get(this);let t=this.clone();return Lt.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 ce.hide(this,"~standard",{...Vc(this),jsonSchema:{input:Go(this,"input"),output:Go(this,"output")}})},set"~standard"(e){ce.own(this,"~standard",e)},parse:function e(t,r){return Th(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Ch(this,t,r,{callee:e})},safeParse(e,t){return Hs(this,e,t)},async safeParseAsync(e,t){return kh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ce.own(this,"spa",e)},validate(e,t){return jc(this,e,t)},validateAsync(e,t){return xc(this,e,t)},encode:function e(t,r){return Ih(this,t,r,{callee:e})},decode:function e(t,r){return Oh(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Nh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await jh(this,t,r,{callee:e})},safeEncode(e,t){return xh(this,e,t)},safeDecode(e,t){return Ah(this,e,t)},async safeEncodeAsync(e,t){return qh(this,e,t)},async safeDecodeAsync(e,t){return Mh(this,e,t)},toJSONSchema(e){return oh(this,{})(e)},get description(){return Lt.get(this)?.description},get _def(){return this._zod.def}}),Vh=q("_ZodString",(e,t)=>{Cs.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)},ce.derived({format:e=>xe(e).format??null,minLength:e=>xe(e).minimum??null,maxLength:e=>xe(e).maximum??null},{regex(...e){return this.check(ru(...e))},includes(...e){return this.check(su(...e))},startsWith(...e){return this.check(iu(...e))},endsWith(...e){return this.check(au(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(Ds(...e))},length(...e){return this.check(Zs(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(ou(e))},uppercase(e){return this.check(nu(e))},trim(){return this.check(uu())},normalize(...e){return this.check(cu(...e))},toLowerCase(){return this.check(lu())},toUpperCase(){return this.check(du())},slugify(){return this.check(pu())}})),Fu=q("ZodString",(e,t)=>{Cs.init(e,t),Vh.init(e,t)},{email(e){return this.check(eu(Fh,e))},url(e){return this.check(tu(Jh,e))},jwt(e){return this.check(qf(av,e))},emoji(e){return this.check(Rf(By,e))},guid(e){return this.check(Sf(Jy,e))},uuid(e){return this.check(yf(Js,e))},uuidv4(e){return this.check(vf(Js,e))},uuidv6(e){return this.check(bf(Js,e))},uuidv7(e){return this.check(zf(Js,e))},nanoid(e){return this.check($f(Ky,e))},cuid(e){return this.check(wf(Gy,e))},cuid2(e){return this.check(Pf(Wy,e))},ulid(e){return this.check(Ef(Yy,e))},base64(e){return this.check(jf(nv,e))},base64url(e){return this.check(xf(sv,e))},xid(e){return this.check(Tf(Xy,e))},ksuid(e){return this.check(Cf(Qy,e))},ipv4(e){return this.check(kf(ev,e))},ipv6(e){return this.check(If(tv,e))},cidrv4(e){return this.check(Of(rv,e))},cidrv6(e){return this.check(Nf(ov,e))},e164(e){return this.check(Af(iv,e))},datetime(e){return this.check(As(en,e))},date(e){return this.check(qs(tn,e))},time(e){return this.check(Ms(rn,e))},duration(e){return this.check(Ls(on,e))}});function l(e){return gf(Fu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),Vh.init(e,t)}),en=q("ZodISODateTime",(e,t)=>{bm.init(e,t),Pe.init(e,t)}),tn=q("ZodISODate",(e,t)=>{zm.init(e,t),Pe.init(e,t)}),rn=q("ZodISOTime",(e,t)=>{Rm.init(e,t),Pe.init(e,t)}),on=q("ZodISODuration",(e,t)=>{$m.init(e,t),Pe.init(e,t)}),Fh=q("ZodEmail",(e,t)=>{lm.init(e,t),Pe.init(e,t)});function Hh(e){return eu(Fh,e)}var Jy=q("ZodGUID",(e,t)=>{cm.init(e,t),Pe.init(e,t)});var Js=q("ZodUUID",(e,t)=>{um.init(e,t),Pe.init(e,t)});var Jh=q("ZodURL",(e,t)=>{mm.init(e,t),Pe.init(e,t)});function Ks(e){return tu(Jh,e)}var By=q("ZodEmoji",(e,t)=>{fm.init(e,t),Pe.init(e,t)});var Ky=q("ZodNanoID",(e,t)=>{hm.init(e,t),Pe.init(e,t)});var Gy=q("ZodCUID",(e,t)=>{gm.init(e,t),Pe.init(e,t)});var Wy=q("ZodCUID2",(e,t)=>{_m.init(e,t),Pe.init(e,t)});var Yy=q("ZodULID",(e,t)=>{Sm.init(e,t),Pe.init(e,t)});var Xy=q("ZodXID",(e,t)=>{ym.init(e,t),Pe.init(e,t)});var Qy=q("ZodKSUID",(e,t)=>{vm.init(e,t),Pe.init(e,t)});var ev=q("ZodIPv4",(e,t)=>{wm.init(e,t),Pe.init(e,t)});var tv=q("ZodIPv6",(e,t)=>{Em.init(e,t),Pe.init(e,t)});var rv=q("ZodCIDRv4",(e,t)=>{Tm.init(e,t),Pe.init(e,t)});var ov=q("ZodCIDRv6",(e,t)=>{Cm.init(e,t),Pe.init(e,t)});var nv=q("ZodBase64",(e,t)=>{Im.init(e,t),Pe.init(e,t)});var sv=q("ZodBase64URL",(e,t)=>{Om.init(e,t),Pe.init(e,t)});var iv=q("ZodE164",(e,t)=>{Nm.init(e,t),Pe.init(e,t)});var av=q("ZodJWT",(e,t)=>{jm.init(e,t),Pe.init(e,t)});var Gs=q("ZodNumber",(e,t)=>{Hc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n),e.isFinite=!0},ce.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(Rt(e,t))},min(e,t){return this.check(Rt(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(zt(e,t))},max(e,t){return this.check(zt(e,t))},int(e){return this.check(Lh(e))},safe(e){return this.check(Lh(e))},positive(e){return this.check(Lr(0,e))},nonnegative(e){return this.check(Rt(0,e))},negative(e){return this.check(Mr(0,e))},nonpositive(e){return this.check(zt(0,e))},multipleOf(e,t){return this.check(Bo(e,t))},step(e,t){return this.check(Bo(e,t))},finite(){return this}}));function L(e){return Mf(Gs,e)}var cv=q("ZodNumberFormat",(e,t)=>{xm.init(e,t),Gs.init(e,t)});function Lh(e){return Df(cv,e)}var Hu=q("ZodBoolean",(e,t)=>{Am.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function H(e){return Zf(Hu,e)}var Bh=q("ZodBigInt",(e,t)=>{qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n)},ce.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(Rt(e,t))},min(e,t){return this.check(Rt(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(zt(e,t))},max(e,t){return this.check(zt(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(zt(BigInt(0),e))},nonnegative(e){return this.check(Rt(BigInt(0),e))},multipleOf(e,t){return this.check(Bo(e,t))}}));var uv=q("ZodNull",(e,t)=>{Mm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(e,r,o,n)});function lr(e){return Ff(uv,e)}var lv=q("ZodAny",(e,t)=>{Lm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function Kh(){return Hf(lv)}var dv=q("ZodUnknown",(e,t)=>{Dm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});function Q(){return Jf(dv)}var pv=q("ZodNever",(e,t)=>{Zm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n)});function Gh(e){return Bf(pv,e)}var Wh=q("ZodDate",(e,t)=>{Um.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),e.min=(r,o)=>e.check(Rt(r,o)),e.max=(r,o)=>e.check(zt(r,o))},ce.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 mv=q("ZodArray",(e,t)=>{Bs(),Vm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(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(Ds(e,t))},length(e,t){return this.check(Zs(e,t))},unwrap(){return this.element}});function I(e,t){return Gf(mv,e,t)}var Ju=q("ZodObject",(e,t)=>{Bs(),Jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),ce.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ie(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ce.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:Q()}))},loose(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:Q()}))},strict(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:Gh()}))},strip(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ce.extend(this,e)},safeExtend(e){return ce.safeExtend(this,e)},merge(e){return ce.merge(this,e)},pick(e){return ce.pick(this,e)},omit(e){return ce.omit(this,e)},partial(...e){return ce.partial(Qh,this,e[0])},exactPartial(...e){return ce.partial(eg,this,e[0],"exactPartial")},required(...e){return ce.required(tg,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ce.normalizeParams(t)};return new Ju(r)}function Me(e,t){return new Ju({type:"object",shape:e,catchall:Gh(),...ce.normalizeParams(t)})}function re(e,t){return new Ju({type:"object",shape:e,catchall:Q(),...ce.normalizeParams(t)})}var Yh=q("ZodUnion",(e,t)=>{Jc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n),e.options=t.options});function W(e,t){return new Yh({type:"union",options:e,...ce.normalizeParams(t)})}var fv=q("ZodDiscriminatedUnion",(e,t)=>{Yh.init(e,t),Bm.init(e,t)});function Zt(e,t,r){return new fv({type:"union",options:t,discriminator:e,...ce.normalizeParams(r)})}var hv=q("ZodIntersection",(e,t)=>{Km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n)});function $t(e,t){return new hv({type:"intersection",left:e,right:t})}var Dh=q("ZodRecord",(e,t)=>{Bs(),Gm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new Dh({type:"record",keyType:l(),valueType:e,...ce.normalizeParams(t)}):new Dh({type:"record",keyType:e,valueType:t,...ce.normalizeParams(r)})}var Vu=q("ZodEnum",(e,t)=>{Wm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>wu(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 Vu({...t,checks:[],...ce.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 Vu({...t,checks:[],...ce.normalizeParams(n),entries:s})}});function ie(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Vu({type:"enum",entries:r,...ce.normalizeParams(t)})}var gv=q("ZodLiteral",(e,t)=>{Ym.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(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 gv({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var _v=q("ZodTransform",(e,t)=>{Bs(),Xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(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(ce.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(ce.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 Xh(e){return new _v({type:"transform",transform:e})}var Qh=q("ZodOptional",(e,t)=>{Bc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Qh({type:"optional",innerType:e})}var eg=q("ZodExactOptional",(e,t)=>{Qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sv(e){return new eg({type:"optional",innerType:e})}var yv=q("ZodNullable",(e,t)=>{ef.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Zh(e){return new yv({type:"nullable",innerType:e})}var vv=q("ZodDefault",(e,t)=>{tf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bv(e,t){return new vv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var zv=q("ZodPrefault",(e,t)=>{rf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Rv(e,t){return new zv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var tg=q("ZodNonOptional",(e,t)=>{of.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $v(e,t){return new tg({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var wv=q("ZodCatch",(e,t)=>{nf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pv(e,t){return new wv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ce.constantCatch(t)})}var rg=q("ZodPipe",(e,t)=>{Kc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.in=t.in,e.out=t.out});function Uh(e,t){return new rg({type:"pipe",in:e,out:t})}var Ev=q("ZodPreprocess",(e,t)=>{rg.init(e,t),sf.init(e,t)}),Tv=q("ZodReadonly",(e,t)=>{af.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Cv(e){return new Tv({type:"readonly",innerType:e})}var kv=q("ZodLazy",(e,t)=>{cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function nn(e){return new kv({type:"lazy",getter:e})}var Iv=q("ZodCustom",(e,t)=>{uf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function Ov(e,t={}){return Wf(Iv,e,t)}function Nv(e,t){return Yf(e,t)}function dr(e,t){return new Ev({type:"pipe",in:Xh(e),out:t})}var ng={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 og;og||(og={});var wt={};lc(wt,{ZodISODate:()=>tn,ZodISODateTime:()=>en,ZodISODuration:()=>on,ZodISOTime:()=>rn,date:()=>Av,datetime:()=>xv,duration:()=>Mv,time:()=>qv});function xv(e){return As(en,e)}function Av(e){return qs(tn,e)}function qv(e){return Ms(rn,e)}function Mv(e){return Ls(on,e)}var Ws={};lc(Ws,{bigint:()=>Uv,boolean:()=>Zv,date:()=>Vv,number:()=>Dv,string:()=>Lv});function Lv(e){return _f(Fu,e)}function Dv(e){return Lf(Gs,e)}function Zv(e){return Uf(Hu,e)}function Uv(e){return Vf(Bh,e)}function Vv(e){return Kf(Wh,e)}var mr="2025-11-25";var Ys=[mr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Xs="io.modelcontextprotocol/related-task",fr="io.modelcontextprotocol/protocolVersion",Fr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",Tt="io.modelcontextprotocol/clientCapabilities",sn="io.modelcontextprotocol/subscriptionId",Vt="io.modelcontextprotocol/logLevel";var hr="2.0";var Ut=nn(()=>W([l(),L(),H(),lr(),K(l(),Ut),I(Ut)])),Ee=K(l(),Ut),Ku=I(Ut),an=W([l(),L().int()]),cn=l(),Qs=P({ttl:L().optional()}),ei=P({taskId:l()}),un=re({progressToken:an.optional(),[Xs]:ei.optional()}),De=P({_meta:un.optional()}),gr=De.extend({task:Qs.optional()}),Te=P({method:l(),params:De.loose().optional()}),He=P({_meta:un.optional()}),Je=P({method:l(),params:He.loose().optional()}),ln=re({get[Et](){return Br.optional().catch(void 0)}}),Ce=re({_meta:ln.optional()}),Ft=W([l(),L().int()]),dn=P({jsonrpc:O(hr),id:Ft,...Te.shape}).strict(),pn=P({jsonrpc:O(hr),...Je.shape}).strict(),Hr=P({jsonrpc:O(hr),id:Ft,result:Ce}).strict(),Jr=P({jsonrpc:O(hr),id:Ft.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),mn=W([dn,pn,Hr,Jr]),Gu=W([Hr,Jr]),fn=Ce.strict(),ti=He.extend({requestId:Ft.optional(),reason:l().optional()}),hn=Je.extend({method:O("notifications/cancelled"),params:ti}),ri=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ie(["light","dark"]).optional()}),Ht=P({icons:I(ri).optional()}),Pt=P({name:l(),title:l().optional()}),Br=Pt.extend({...Pt.shape,...Ht.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Hv=$t(P({applyDefaults:H().optional()}),Ee),Jv=dr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$t(P({form:Hv.optional(),url:Ee.optional()}),Ee.optional())),oi=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({sampling:re({createMessage:Ee.optional()}).optional(),elicitation:re({create:Ee.optional()}).optional()}).optional()}),ni=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({tools:re({call:Ee.optional()}).optional()}).optional()}),si=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:oi.optional(),extensions:K(l(),Ee).optional()}),ii=De.extend({protocolVersion:l(),capabilities:si,clientInfo:Br}),ai=Te.extend({method:O("initialize"),params:ii}),gn=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:ni.optional(),extensions:K(l(),Ee).optional()}),ci=Ce.extend({protocolVersion:l(),capabilities:gn,serverInfo:Br,instructions:l().optional()}),ui=Je.extend({method:O("notifications/initialized"),params:He.optional()}),li=Te.extend({method:O("server/discover"),params:De.optional()}),di=Ce.extend({supportedVersions:I(l()),capabilities:gn,instructions:l().optional()}),_n=Te.extend({method:O("ping"),params:De.optional()}),pi=P({progress:L(),total:X(L()),message:X(l())}),mi=P({...He.shape,...pi.shape,progressToken:an}),Sn=Je.extend({method:O("notifications/progress"),params:mi}),fi=De.extend({cursor:cn.optional()}),Jt=Te.extend({params:fi.optional()}),Bt=Ce.extend({nextCursor:cn.optional()}),yn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),vn=yn.extend({text:l()}),Wu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),bn=yn.extend({blob:Wu}),Kt=ie(["user","assistant"]),Ct=P({audience:I(Kt).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),zn=P({...Pt.shape,...Ht.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Ct.optional(),_meta:X(re({}))}),hi=P({...Pt.shape,...Ht.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Ct.optional(),_meta:X(re({}))}),gi=Jt.extend({method:O("resources/list")}),_i=Bt.extend({resources:I(zn)}),Si=Jt.extend({method:O("resources/templates/list")}),yi=Bt.extend({resourceTemplates:I(hi)}),Kr=De.extend({uri:l()}),vi=Kr,bi=Te.extend({method:O("resources/read"),params:vi}),zi=Ce.extend({contents:I(W([vn,bn]))}),Ri=Je.extend({method:O("notifications/resources/list_changed"),params:He.optional()}),$i=Kr,wi=Te.extend({method:O("resources/subscribe"),params:$i}),Pi=Kr,Ei=Te.extend({method:O("resources/unsubscribe"),params:Pi}),Rn=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ti=De.extend({notifications:Rn}),Ci=Te.extend({method:O("subscriptions/listen"),params:Ti}),ki=He.extend({notifications:Rn}),Ii=Je.extend({method:O("notifications/subscriptions/acknowledged"),params:ki}),Oi=ln.extend({[sn]:Ft}),Ni=Ce.extend({_meta:Oi}),ji=He.extend({uri:l()}),xi=Je.extend({method:O("notifications/resources/updated"),params:ji}),Ai=P({name:l(),description:X(l()),required:X(H())}),qi=P({...Pt.shape,...Ht.shape,description:X(l()),arguments:X(I(Ai)),_meta:X(re({}))}),Mi=Jt.extend({method:O("prompts/list")}),Li=Bt.extend({prompts:I(qi)}),Di=De.extend({name:l(),arguments:K(l(),l()).optional()}),Zi=Te.extend({method:O("prompts/get"),params:Di}),Gr=P({type:O("text"),text:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Wr=P({type:O("image"),data:Wu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Yr=P({type:O("audio"),data:Wu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Ui=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Vi=P({type:O("resource"),resource:W([vn,bn]),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Fi=zn.extend({type:O("resource_link")}),Xr=W([Gr,Wr,Yr,Fi,Vi]),Hi=P({role:Kt,content:Xr}),Ji=Ce.extend({description:l().optional(),messages:I(Hi)}),Bi=Je.extend({method:O("notifications/prompts/list_changed"),params:He.optional()}),Ki=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Gi=P({taskSupport:ie(["required","optional","forbidden"]).optional()}),$n=P({...Pt.shape,...Ht.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Ut).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:re({$schema:l().optional()}).optional(),annotations:Ki.optional(),execution:Gi.optional(),_meta:K(l(),Q()).optional()}),Wi=Jt.extend({method:O("tools/list")}),Yi=Bt.extend({tools:I($n)}),wn=Ce.extend({content:I(Xr).default([]),structuredContent:Q().optional(),isError:H().optional()}),Yu=wn.or(Ce.extend({toolResult:Q()})),Xi=gr.extend({name:l(),arguments:K(l(),Q()).optional()}),Qi=Te.extend({method:O("tools/call"),params:Xi}),ea=Je.extend({method:O("notifications/tools/list_changed"),params:He.optional()}),Xu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Gt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),ta=De.extend({level:Gt}),ra=Te.extend({method:O("logging/setLevel"),params:ta}),oa=He.extend({level:Gt,logger:l().optional(),data:Q()}),na=Je.extend({method:O("notifications/message"),params:oa}),sa=P({name:l().optional()}),ia=P({hints:I(sa).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),aa=P({mode:ie(["auto","required","none"]).optional()}),ca=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()}),ua=Zt("type",[Gr,Wr,Yr]),pr=Zt("type",[Gr,Wr,Yr,Ui,ca]),la=P({role:Kt,content:W([pr,I(pr)]),_meta:K(l(),Q()).optional()}),da=gr.extend({messages:I(la),modelPreferences:ia.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I($n).optional(),toolChoice:aa.optional()}),pa=Te.extend({method:O("sampling/createMessage"),params:da}),ma=Ce.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(l())),role:Kt,content:ua}),fa=Ce.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Kt,content:W([pr,I(pr)])}),Pn=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:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),eo=P({type:ie(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),En=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Tn=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Cn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ha=W([En,Tn]),kn=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()}),In=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()}),ga=W([kn,In]),_a=W([Cn,ha,ga]),On=W([_a,Pn,Qr,eo]),to=gr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),On),required:I(l()).optional()}).catchall(Q())}),Sa=gr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ya=W([to,Sa]),va=Te.extend({method:O("elicitation/create"),params:ya}),ba=He.extend({elicitationId:l()}),za=Je.extend({method:O("notifications/elicitation/complete"),params:ba}),Ra=Ce.extend({action:ie(["accept","decline","cancel"]),content:dr(e=>e===null?void 0:e,K(l(),W([l(),L(),H(),I(l())])).optional())}),$a=P({type:O("ref/resource"),uri:l()}),wa=P({type:O("ref/prompt"),name:l()}),Pa=De.extend({ref:W([wa,$a]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Ea=Te.extend({method:O("completion/complete"),params:Pa}),Ta=Ce.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),Ca=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),ka=Te.extend({method:O("roots/list"),params:De.optional()}),Ia=Ce.extend({roots:I(Ca)}),Oa=Je.extend({method:O("notifications/roots/list_changed"),params:He.optional()}),Qu=re({ttl:L().optional(),pollInterval:L().optional()}),Na=ie(["working","input_required","completed","failed","cancelled"]),Wt=P({taskId:l(),status:Na,ttl:W([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),el=Ce.extend({task:Wt}),ja=He.merge(Wt),tl=Je.extend({method:O("notifications/tasks/status"),params:ja}),rl=Te.extend({method:O("tasks/get"),params:De.extend({taskId:l()})}),ol=Ce.merge(Wt),nl=Te.extend({method:O("tasks/result"),params:De.extend({taskId:l()})}),sl=Ce.loose(),il=Jt.extend({method:O("tasks/list")}),al=Bt.extend({tasks:I(Wt)}),cl=Te.extend({method:O("tasks/cancel"),params:De.extend({taskId:l()})}),ul=Ce.merge(Wt),ll=W([_n,ai,li,Ea,ra,Zi,Mi,gi,Si,bi,wi,Ei,Ci,Qi,Wi]),dl=W([hn,Sn,ui,Oa]),pl=W([fn,ma,fa,Ra,Ia]),ml=W([_n,pa,va,ka]),fl=W([hn,Sn,na,xi,Ri,ea,Bi,Ii,za]),hl=W([fn,ci,di,Ta,Ji,Li,_i,yi,zi,wn,Yi,Ni]),Le=Ks().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:ng.custom,message:"URL must be parseable",fatal:!0}),Cc}).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"}),gl=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()}),xa=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()}),Aa=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)}),_l=P({...Aa.shape,...xa.pick({code_challenge_methods_supported:!0}).shape}),Sl=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Ws.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),yl=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(),vl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Bu=Le.optional().or(O("").transform(()=>{})),qa=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:Bu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Bu,policy_uri:l().optional(),jwks_uri:Le.optional(),jwks:Kh().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Ma=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(),bl=qa.merge(Ma),zl=P({error:l(),error_description:l().optional()}).strip(),Rl=P({token:l(),token_type_hint:l().optional()}).strip();var El=Symbol.for("mcp.sdk.errorBrands");function Il(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,El,{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,El)){let r=t[El];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Pg=class Eg 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",Il(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 Eg(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",Il(this,new.target)}},Bv=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 fg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Kv(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Tg(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 Ja(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(fg(n)&&fg(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!Kv(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var Gv="2026-07-28";function Mn(e){return e>=Gv}function Cg(e){return e.filter(t=>!Mn(t))}function Ol(e){return e.filter(t=>Mn(t))}function kg(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 Ig=["task","inputRequests","requestState"];function Nl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Ig.some(t=>t in e)?e:{...e,content:[]}}function Wv(){let e=nn(()=>W([l(),L(),H(),lr(),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:ie(["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=$t(P({applyDefaults:H().optional()}),t),b=dr(Fe=>Fe&&typeof Fe=="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0?{form:{}}:Fe,$t(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()}),k=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()}),C=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=V.extend({blob:C}),J=ie(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.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({}))}),ae=P({...y.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(re({}))}),ze=k.extend({method:O("resources/list")}),Be=x.extend({resources:I(pe)}),T=k.extend({method:O("resources/templates/list")}),A=x.extend({resourceTemplates:I(ae)}),D=c.extend({uri:l()}),ne=D,se=u.extend({method:O("resources/read"),params:ne}),de=g.extend({contents:I(W([$,N]))}),ke=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}),ht=P({name:l(),description:X(l()),required:X(H())}),at=P({...y.shape,...z.shape,description:X(l()),arguments:X(I(ht)),_meta:X(re({}))}),gt=k.extend({method:O("prompts/list")}),It=x.extend({prompts:I(at)}),Ot=c.extend({name:l(),arguments:K(l(),l()).optional()}),Xt=u.extend({method:O("prompts/get"),params:Ot}),Qt=P({type:O("text"),text:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),er=P({type:O("image"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),tr=P({type:O("audio"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),uo=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Nt=P({type:O("resource"),resource:W([$,N]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),lo=pe.extend({type:O("resource_link")}),nt=W([Qt,er,tr,lo,Nt]),yr=P({role:J,content:nt}),vr=g.extend({description:l().optional(),messages:I(yr)}),rr=m.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),po=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),br=P({taskSupport:ie(["required","optional","forbidden"]).optional()}),or=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:po.optional(),execution:br.optional(),_meta:K(l(),Q()).optional()}),zr=k.extend({method:O("tools/list")}),Rr=x.extend({tools:I(or)}),$r=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ve=a.extend({name:l(),arguments:K(l(),Q()).optional()}),mo=u.extend({method:O("tools/call"),params:Ve}),Jn=m.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),wr=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),fo=c.extend({level:wr}),ho=u.extend({method:O("logging/setLevel"),params:fo}),go=d.extend({level:wr,logger:l().optional(),data:Q()}),_o=m.extend({method:O("notifications/message"),params:go}),So=P({name:l().optional()}),yo=P({hints:I(So).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),vo=P({mode:ie(["auto","required","none"]).optional()}),Bn=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()}),bo=Zt("type",[Qt,er,tr]),jt=Zt("type",[Qt,er,tr,uo,Bn]),zo=P({role:J,content:W([jt,I(jt)]),_meta:K(l(),Q()).optional()}),Ro=a.extend({messages:I(zo),modelPreferences:yo.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(or).optional(),toolChoice:vo.optional()}),$o=u.extend({method:O("sampling/createMessage"),params:Ro}),wo=g.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:bo}),Po=g.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:W([jt,I(jt)])}),Eo=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),To=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),Co=P({type:ie(["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()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Oo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),No=W([ko,Io]),nr=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()}),sr=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()}),Kn=W([nr,sr]),Gn=W([Oo,No,Kn]),et=W([Gn,Eo,To,Co]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),jo=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ct=W([tt,jo]),Wn=u.extend({method:O("elicitation/create"),params:ct}),Yn=d.extend({elicitationId:l()}),Xn=m.extend({method:O("notifications/elicitation/complete"),params:Yn}),Qn=g.extend({action:ie(["accept","decline","cancel"]),content:dr(Fe=>Fe===null?void 0:Fe,K(l(),W([l(),L(),H(),I(l())])).optional())}),es=P({type:O("ref/resource"),uri:l()}),ts=P({type:O("ref/prompt"),name:l()}),rs=c.extend({ref:W([ts,es]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),xo=u.extend({method:O("completion/complete"),params:rs}),os=g.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),ns=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Pr=u.extend({method:O("roots/list"),params:c.optional()}),Ao=g.extend({roots:I(ns)}),ss=m.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),is=re({ttl:L().optional(),pollInterval:L().optional()}),qo=ie(["working","input_required","completed","failed","cancelled"]),xt=P({taskId:l(),status:qo,ttl:W([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:xt}),as=d.merge(xt),ir=m.extend({method:O("notifications/tasks/status"),params:as}),Er=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Tr=g.merge(xt),Cr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),uc=g.loose(),Ke=k.extend({method:O("tasks/list")}),Ie=x.extend({tasks:I(xt)}),ar=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:k,PaginatedResultSchema:x,ResourceContentsSchema:V,TextResourceContentsSchema:$,BlobResourceContentsSchema:N,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ae,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Be,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:ke,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Ue,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:we,ResourceUpdatedNotificationParamsSchema:ot,ResourceUpdatedNotificationSchema:Ae,PromptArgumentSchema:ht,PromptSchema:at,ListPromptsRequestSchema:gt,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Xt,TextContentSchema:Qt,ImageContentSchema:er,AudioContentSchema:tr,ToolUseContentSchema:uo,EmbeddedResourceSchema:Nt,ResourceLinkSchema:lo,ContentBlockSchema:nt,PromptMessageSchema:yr,GetPromptResultSchema:vr,PromptListChangedNotificationSchema:rr,ToolAnnotationsSchema:po,ToolExecutionSchema:br,ToolSchema:or,ListToolsRequestSchema:zr,ListToolsResultSchema:Rr,CallToolResultSchema:$r,CallToolRequestParamsSchema:Ve,CallToolRequestSchema:mo,ToolListChangedNotificationSchema:Jn,LoggingLevelSchema:wr,SetLevelRequestParamsSchema:fo,SetLevelRequestSchema:ho,LoggingMessageNotificationParamsSchema:go,LoggingMessageNotificationSchema:_o,ModelHintSchema:So,ModelPreferencesSchema:yo,ToolChoiceSchema:vo,ToolResultContentSchema:Bn,SamplingContentSchema:bo,SamplingMessageContentBlockSchema:jt,SamplingMessageSchema:zo,CreateMessageRequestParamsSchema:Ro,CreateMessageRequestSchema:$o,CreateMessageResultSchema:wo,CreateMessageResultWithToolsSchema:Po,BooleanSchemaSchema:Eo,StringSchemaSchema:To,NumberSchemaSchema:Co,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:Io,LegacyTitledEnumSchemaSchema:Oo,SingleSelectEnumSchemaSchema:No,UntitledMultiSelectEnumSchemaSchema:nr,TitledMultiSelectEnumSchemaSchema:sr,MultiSelectEnumSchemaSchema:Kn,EnumSchemaSchema:Gn,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:jo,ElicitRequestParamsSchema:ct,ElicitRequestSchema:Wn,ElicitationCompleteNotificationParamsSchema:Yn,ElicitationCompleteNotificationSchema:Xn,ElicitResultSchema:Qn,ResourceTemplateReferenceSchema:es,PromptReferenceSchema:ts,CompleteRequestParamsSchema:rs,CompleteRequestSchema:xo,CompleteResultSchema:os,RootSchema:ns,ListRootsRequestSchema:Pr,ListRootsResultSchema:Ao,RootsListChangedNotificationSchema:ss,TaskCreationParamsSchema:is,TaskStatusSchema:qo,TaskSchema:xt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:as,TaskStatusNotificationSchema:ir,GetTaskRequestSchema:Er,GetTaskResultSchema:Tr,GetTaskPayloadRequestSchema:Cr,GetTaskPayloadResultSchema:uc,ListTasksRequestSchema:Ke,ListTasksResultSchema:Ie,CancelTaskRequestSchema:ar,CancelTaskResultSchema:g.merge(xt),ClientRequestSchema:W([fe,M,xo,ho,Xt,gt,ze,T,se,Ue,we,mo,zr,Er,Cr,Ke,ar]),ClientNotificationSchema:W([h,Oe,G,ss,ir]),ClientResultSchema:W([p,wo,Po,Qn,Ao,Tr,Ie,We]),ServerRequestSchema:W([fe,$o,Wn,Pr,Er,Cr,Ke,ar]),ServerNotificationSchema:W([h,Oe,_o,Ae,ke,Jn,rr,ir,Xn]),ServerResultSchema:W([p,Y,os,vr,It,Be,A,de,$r,Rr,Tr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,dS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let hd of Ig)if(hd in Fe){dS.addIssue({code:"custom",message:`content is required when the body carries '${hd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Nl).pipe($r)}}var Yv;function Og(){return Yv??=Wv()}function Ng(e){return e.type!=="object"}var Xv=new Set(["const","enum","default","examples"]),Qv=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function hg(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function eb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(hg(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=jd(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&&hg(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:Xv.has(a)?i[a]=u:Qv.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 jg={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},xg={"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},tb={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},La;function jl(){if(La)return La;let e=Og();return La={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}},La}function Ag(e){return Object.prototype.hasOwnProperty.call(jg,e)}function qg(e){return Object.prototype.hasOwnProperty.call(xg,e)}function rb(e){return Object.prototype.hasOwnProperty.call(tb,e)}function ob(e){return rb(e)?jl().resultSchemas[e]:void 0}function nb(e){return Ag(e)?jl().requestSchemas[e]:void 0}function sb(e){return qg(e)?jl().notificationSchemas[e]:void 0}var Mw=Object.keys(jg),Lw=Object.keys(xg);function Tl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Da(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 gg={ok:!1,reason:"not-in-era"};function _g(e){return Tl(e)&&Tl(e.outputSchema)&&Ng(e.outputSchema)}var xl={era:"2025-11-25",hasRequestMethod:Ag,hasNotificationMethod:qg,validateRequest:(e,t)=>Da(nb(e),t),validateResult:(e,t)=>Da(ob(e),t),validateNotification:(e,t)=>Da(sb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>gg,validateInputResponse:()=>gg,samplingResultVariant:((e,t)=>{let r=Og();return Da(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=kg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&Ng(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Tl(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=>_g(o))?t:{...t,tools:r.map(o=>_g(o)?{...o,outputSchema:eb(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function ib(){let e=nn(()=>W([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=W([l(),L().int()]),s=ie(["user","assistant"]),i=ie(["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:ie(["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=$t(P({applyDefaults:H().optional()}),t),R=dr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,$t(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:wt.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({}))}),k=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())}),C=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()}),ae=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()}),ke=P({mode:ie(["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:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:ie(["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()}),ht=W([we,ot]),at=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()}),gt=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()}),It=W([at,gt]),Ot=W([Ae,ht,It]),Xt=W([Ot,je,Ue,Ne]),Qt=g.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Xt),required:I(l()).optional()}).catchall(Q())}),er=P({type:O("ref/resource"),uri:l()}),tr=P({type:O("ref/prompt"),name:l()}),uo=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Nt=S.shape,lo=P({experimental:Nt.experimental,sampling:Nt.sampling,elicitation:Nt.elicitation,roots:Nt.roots,extensions:Nt.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(),[fr]:l(),[Fr]:z.optional(),[Tt]:lo,[Vt]:i.optional()}),rr=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()}),po=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,ae,po]),or=P({role:s,content:W([br,I(br)]),_meta:K(l(),Q()).optional()}),zr=l(),Rr=re({[Et]:z.optional().catch(void 0)}),$r=Rr.optional();function Ve(Ie){return re({_meta:$r,resultType:zr.default("complete"),...Ie})}let mo=Ve({}),Jn=Ve({nextCursor:o.optional()}),wr=Ve({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),fo=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),tools:I(rr),nextCursor:o.optional()}),ho=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),prompts:I(C),nextCursor:o.optional()}),go=Ve({description:l().optional(),messages:I(A)}),_o=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),So=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),yo=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),contents:I(W([fe,$e]))}),vo=Ve({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Bn=Ve({ttlMs:L().int().min(0),cacheScope:ie(["public","private"])}),bo=Ve({ttlMs:L().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),jt=P({messages:I(or),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(rr).optional(),toolChoice:ke.optional()}),zo=P({method:O("sampling/createMessage"),params:jt}),Ro=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),$o=P({...or.shape,model:l(),stopReason:l().optional()}),wo=P({roots:I(uo)}),Po=P({action:ie(["accept","decline","cancel"]),content:K(l(),W([l(),L(),H(),I(l())])).optional()}),Eo=P({mode:O("url"),message:l(),url:l().url()}),To=W([Qt,Eo]),Co=P({method:O("elicitation/create"),params:To}),ko=W([zo,Ro,Co]),Io=W([$o,wo,Po]),Oo=K(l(),ko),No=K(l(),Io),nr=Ve({inputRequests:Oo.optional(),requestState:l().optional()}),sr={inputResponses:No.optional(),requestState:l().optional()},Kn=P({_meta:vr,...sr}),Gn=re({progressToken:r.optional()});function et(Ie,ar){return P({method:O(Ie),params:P({_meta:vr,...ar})})}function tt(Ie,ar){return P({method:O(Ie),params:P({_meta:Gn.optional(),...ar}).optional()})}let jo={name:l(),arguments:K(l(),Q()).optional(),...sr},ct={cursor:o.optional()},Wn=et("tools/call",jo),Yn=et("tools/list",ct),Xn=et("prompts/list",ct),Qn=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...sr}),es=et("resources/list",ct),ts=et("resources/templates/list",ct),rs=et("resources/read",{uri:l(),...sr}),xo={ref:W([tr,er]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},os=et("completion/complete",xo),ns=et("server/discover",{}),Pr=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ao={notifications:Pr},ss=et("subscriptions/listen",Ao),is=Rr.extend({"io.modelcontextprotocol/subscriptionId":n}),qo=re({_meta:is,resultType:zr.default("complete")}),xt={"tools/call":tt("tools/call",jo),"tools/list":tt("tools/list",ct),"prompts/get":tt("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":tt("prompts/list",ct),"resources/list":tt("resources/list",ct),"resources/templates/list":tt("resources/templates/list",ct),"resources/read":tt("resources/read",{uri:l()}),"completion/complete":tt("completion/complete",xo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",Ao)};function We(Ie){return re({_meta:$r,...Ie})}let as={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),tools:I(rr),nextCursor:o.optional()}),"prompts/get":We({description:l().optional(),messages:I(A)}),"prompts/list":We({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),prompts:I(C),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:ie(["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:ie(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),"subscriptions/listen":We({})},ir=re({"io.modelcontextprotocol/subscriptionId":n.optional()}),Er=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:ir.optional(),notifications:Pr})}),Tr=P({_meta:ir.optional(),requestId:n,reason:l().optional()}),Cr=P({method:O("notifications/cancelled"),params:Tr}),uc={"notifications/cancelled":Cr,"notifications/progress":M,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":k,"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:k,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:$,PromptSchema:C,PromptListChangedNotificationSchema:N,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ae,EmbeddedResourceSchema:ze,ResourceLinkSchema:Be,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:de,ToolChoiceSchema:ke,BooleanSchemaSchema:je,StringSchemaSchema:Ue,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:we,TitledSingleSelectEnumSchemaSchema:ot,LegacyTitledEnumSchemaSchema:Ae,SingleSelectEnumSchemaSchema:ht,UntitledMultiSelectEnumSchemaSchema:at,TitledMultiSelectEnumSchemaSchema:gt,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Xt,ElicitRequestFormParamsSchema:Qt,ResourceTemplateReferenceSchema:er,PromptReferenceSchema:tr,RootSchema:uo,ClientCapabilities2026Schema:lo,ServerCapabilities2026Schema:yr,RequestMetaEnvelopeSchema:vr,ToolSchema:rr,ToolResultContentSchema:po,SamplingMessageContentBlockSchema:br,SamplingMessageSchema:or,ResultTypeSchema:zr,ResultMetaSchema:Rr,ResultSchema:mo,PaginatedResultSchema:Jn,CallToolResultSchema:wr,ListToolsResultSchema:fo,ListPromptsResultSchema:ho,GetPromptResultSchema:go,ListResourcesResultSchema:_o,ListResourceTemplatesResultSchema:So,ReadResourceResultSchema:yo,CompleteResultSchema:vo,CacheableResultSchema:Bn,DiscoverResultSchema:bo,CreateMessageRequestParamsSchema:jt,CreateMessageRequestSchema:zo,ListRootsRequestSchema:Ro,CreateMessageResultSchema:$o,ListRootsResultSchema:wo,ElicitResultSchema:Po,ElicitRequestURLParamsSchema:Eo,ElicitRequestParamsSchema:To,ElicitRequestSchema:Co,InputRequestSchema:ko,InputResponseSchema:Io,InputRequestsSchema:Oo,InputResponsesSchema:No,InputRequiredResultSchema:nr,InputResponseRequestParamsSchema:Kn,CallToolRequestSchema:Wn,ListToolsRequestSchema:Yn,ListPromptsRequestSchema:Xn,GetPromptRequestSchema:Qn,ListResourcesRequestSchema:es,ListResourceTemplatesRequestSchema:ts,ReadResourceRequestSchema:rs,CompleteRequestSchema:os,DiscoverRequestSchema:ns,SubscriptionFilterSchema:Pr,SubscriptionsListenRequestSchema:ss,SubscriptionsListenResultMetaSchema:is,SubscriptionsListenResultSchema:qo,dispatchRequestSchemas:xt,dispatchResultSchemas:as,NotificationMetaSchema:ir,SubscriptionsAcknowledgedNotificationSchema:Er,CancelledNotificationParamsSchema:Tr,CancelledNotificationSchema:Cr,notificationSchemas2026:uc,JSONRPCResultResponseSchema:Ke(mo),CallToolResultResponseSchema:Ke(W([wr,nr])),ListToolsResultResponseSchema:Ke(fo),ListPromptsResultResponseSchema:Ke(ho),GetPromptResultResponseSchema:Ke(W([go,nr])),ListResourcesResultResponseSchema:Ke(_o),ListResourceTemplatesResultResponseSchema:Ke(So),ReadResourceResultResponseSchema:Ke(W([yo,nr])),CompleteResultResponseSchema:Ke(vo),DiscoverResultResponseSchema:Ke(bo),SubscriptionsListenResultResponseSchema:Ke(qo)}}var ab;function Yt(){return ab??=ib()}var cb=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function ub(e){return cb.includes(e)}var ro=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ba(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 lb(e){return e[ro]}function Al(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function ql(e){return e==="public"||e==="private"}function Ml(e,t){if(e.ttlMs!==void 0&&!Al(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&&!ql(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 Mg 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",Il(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Lg(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Ll({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 Ka(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 Ga({requiredCapabilities:n.requiredCapabilities},r)}return new Mg(t,r,o)}},Ka=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}},Lg=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??[]}},Ll=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}},Ga=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}},db=0,pb="private",mb=["tools/call","prompts/get","resources/read"];function fb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||mb.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 hb(e,t){let r=lb(t);if(t.resultType!=="complete"||!ub(e))return r===void 0?t:vb(t);let o=t,n=Al(o.ttlMs)?o.ttlMs:Sb(r),s=ql(o.cacheScope)?o.cacheScope:yb(r),i={...o,ttlMs:n,cacheScope:s};return delete i[ro],i}function gb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _b(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Et]:t}}:!gb(r)||r[Et]!==void 0?e:{...e,_meta:{...r,[Et]:t}}}function Sb(e){return e!==void 0&&Al(e.ttlMs)?e.ttlMs:db}function yb(e){return e!==void 0&&ql(e.cacheScope)?e.cacheScope:pb}function vb(e){let t={...e};return delete t[ro],t}var bb=["elicitation/create","sampling/createMessage","roots/list"],Za;function Dg(){if(Za)return Za;let e=Yt();return Za={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}},Za}function Zg(e){return bb.includes(e)}function $l(e){return Zg(e)?Dg().request[e]:void 0}function zb(e){return Zg(e)?Dg().response[e]:void 0}var Dl={"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},Ug={"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 Vg(e){return Object.prototype.hasOwnProperty.call(Dl,e)}function Fg(e){return Object.prototype.hasOwnProperty.call(Ug,e)}function Rb(e){return Object.prototype.hasOwnProperty.call(Dl,e)}function $b(e){return Vg(e)?Yt().dispatchRequestSchemas[e]:void 0}function wb(e){return Rb(e)?Yt().dispatchResultSchemas[e]:void 0}function Pb(e){return Fg(e)?Yt().notificationSchemas2026[e]:void 0}var Dw=Object.keys(Dl),Zw=Object.keys(Ug);function xn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Nn(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 Eb={ok:!1,reason:"not-in-era"},Tb=[fr,Tt];function Cb(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=>xn(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!xn(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(xn(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Zl={era:"2026-07-28",hasRequestMethod:Vg,hasNotificationMethod:Fg,hasInputRequestMethod:e=>$l(e)!==void 0,validateRequest:(e,t)=>Nn($b(e),t),validateResult:(e,t)=>Nn(wb(e),t),validateNotification:(e,t)=>Nn(Pb(e),t),validateInputRequest:(e,t)=>Nn($l(e),t),validateInputResponse:(e,t)=>Nn(zb(e),t),samplingResultVariant:()=>Eb,outboundEnvelope(e){return{[fr]:e.protocolVersion,[Fr]:e.clientInfo,[Tt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Vt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of Tb)o in e||t.push({key:o,problem:"missing"});let r=Yt().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=>kg(e),inputRequestSchema:$l,decodeResult(e,t){if(!xn(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=xn(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Yt().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=kb(),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 _b(hb(e,fb(e,Cb(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=Yt().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("; ")}`}},Ua;function kb(){if(Ua)return Ua;let e=Yt();return Ua={"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},Ua}var Ul="2026-07-28";function no(e){return e!==void 0&&Mn(e)?Zl:xl}function Sg(e){return e.revision!==void 0?no(e.revision).era:e.era==="modern"?Zl.era:xl.era}function wl(e){return Hg.some(t=>t.hasRequestMethod(e))}function Pl(e){return Hg.some(t=>t.hasNotificationMethod(e))}function yg(e){return e==="tasks/get"||e==="tasks/cancel"}var Hg=[xl,Zl];var Ib=Od({AnnotationsSchema:()=>Ct,AudioContentSchema:()=>Yr,BaseMetadataSchema:()=>Pt,BaseRequestParamsSchema:()=>De,BlobResourceContentsSchema:()=>bn,BooleanSchemaSchema:()=>Pn,CallToolRequestParamsSchema:()=>Xi,CallToolRequestSchema:()=>Qi,CallToolResultSchema:()=>wn,CancelTaskRequestSchema:()=>cl,CancelTaskResultSchema:()=>ul,CancelledNotificationParamsSchema:()=>ti,CancelledNotificationSchema:()=>hn,ClientCapabilitiesSchema:()=>si,ClientNotificationSchema:()=>dl,ClientRequestSchema:()=>ll,ClientResultSchema:()=>pl,ClientTasksCapabilitySchema:()=>oi,CompatibilityCallToolResultSchema:()=>Yu,CompleteRequestParamsSchema:()=>Pa,CompleteRequestSchema:()=>Ea,CompleteResultSchema:()=>Ta,ContentBlockSchema:()=>Xr,CreateMessageRequestParamsSchema:()=>da,CreateMessageRequestSchema:()=>pa,CreateMessageResultSchema:()=>ma,CreateMessageResultWithToolsSchema:()=>fa,CreateTaskResultSchema:()=>el,CursorSchema:()=>cn,DiscoverRequestSchema:()=>li,DiscoverResultSchema:()=>di,ElicitRequestFormParamsSchema:()=>to,ElicitRequestParamsSchema:()=>ya,ElicitRequestSchema:()=>va,ElicitRequestURLParamsSchema:()=>Sa,ElicitResultSchema:()=>Ra,ElicitationCompleteNotificationParamsSchema:()=>ba,ElicitationCompleteNotificationSchema:()=>za,EmbeddedResourceSchema:()=>Vi,EmptyResultSchema:()=>fn,EnumSchemaSchema:()=>_a,GetPromptRequestParamsSchema:()=>Di,GetPromptRequestSchema:()=>Zi,GetPromptResultSchema:()=>Ji,GetTaskPayloadRequestSchema:()=>nl,GetTaskPayloadResultSchema:()=>sl,GetTaskRequestSchema:()=>rl,GetTaskResultSchema:()=>ol,IconSchema:()=>ri,IconsSchema:()=>Ht,ImageContentSchema:()=>Wr,ImplementationSchema:()=>Br,InitializeRequestParamsSchema:()=>ii,InitializeRequestSchema:()=>ai,InitializeResultSchema:()=>ci,InitializedNotificationSchema:()=>ui,JSONArraySchema:()=>Ku,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Jr,JSONRPCMessageSchema:()=>mn,JSONRPCNotificationSchema:()=>pn,JSONRPCRequestSchema:()=>dn,JSONRPCResponseSchema:()=>Gu,JSONRPCResultResponseSchema:()=>Hr,JSONValueSchema:()=>Ut,LegacyTitledEnumSchemaSchema:()=>Cn,ListChangedOptionsBaseSchema:()=>Xu,ListPromptsRequestSchema:()=>Mi,ListPromptsResultSchema:()=>Li,ListResourceTemplatesRequestSchema:()=>Si,ListResourceTemplatesResultSchema:()=>yi,ListResourcesRequestSchema:()=>gi,ListResourcesResultSchema:()=>_i,ListRootsRequestSchema:()=>ka,ListRootsResultSchema:()=>Ia,ListTasksRequestSchema:()=>il,ListTasksResultSchema:()=>al,ListToolsRequestSchema:()=>Wi,ListToolsResultSchema:()=>Yi,LoggingLevelSchema:()=>Gt,LoggingMessageNotificationParamsSchema:()=>oa,LoggingMessageNotificationSchema:()=>na,ModelHintSchema:()=>sa,ModelPreferencesSchema:()=>ia,MultiSelectEnumSchemaSchema:()=>ga,NotificationSchema:()=>Je,NotificationsParamsSchema:()=>He,NumberSchemaSchema:()=>eo,PaginatedRequestParamsSchema:()=>fi,PaginatedRequestSchema:()=>Jt,PaginatedResultSchema:()=>Bt,PingRequestSchema:()=>_n,PrimitiveSchemaDefinitionSchema:()=>On,ProgressNotificationParamsSchema:()=>mi,ProgressNotificationSchema:()=>Sn,ProgressSchema:()=>pi,ProgressTokenSchema:()=>an,PromptArgumentSchema:()=>Ai,PromptListChangedNotificationSchema:()=>Bi,PromptMessageSchema:()=>Hi,PromptReferenceSchema:()=>wa,PromptSchema:()=>qi,ReadResourceRequestParamsSchema:()=>vi,ReadResourceRequestSchema:()=>bi,ReadResourceResultSchema:()=>zi,RelatedTaskMetadataSchema:()=>ei,RequestIdSchema:()=>Ft,RequestMetaSchema:()=>un,RequestSchema:()=>Te,ResourceContentsSchema:()=>yn,ResourceLinkSchema:()=>Fi,ResourceListChangedNotificationSchema:()=>Ri,ResourceRequestParamsSchema:()=>Kr,ResourceSchema:()=>zn,ResourceTemplateReferenceSchema:()=>$a,ResourceTemplateSchema:()=>hi,ResourceUpdatedNotificationParamsSchema:()=>ji,ResourceUpdatedNotificationSchema:()=>xi,ResultMetaObjectSchema:()=>ln,ResultSchema:()=>Ce,RoleSchema:()=>Kt,RootSchema:()=>Ca,RootsListChangedNotificationSchema:()=>Oa,SamplingContentSchema:()=>ua,SamplingMessageContentBlockSchema:()=>pr,SamplingMessageSchema:()=>la,ServerCapabilitiesSchema:()=>gn,ServerNotificationSchema:()=>fl,ServerRequestSchema:()=>ml,ServerResultSchema:()=>hl,ServerTasksCapabilitySchema:()=>ni,SetLevelRequestParamsSchema:()=>ta,SetLevelRequestSchema:()=>ra,SingleSelectEnumSchemaSchema:()=>ha,StringSchemaSchema:()=>Qr,SubscribeRequestParamsSchema:()=>$i,SubscribeRequestSchema:()=>wi,SubscriptionFilterSchema:()=>Rn,SubscriptionsAcknowledgedNotificationParamsSchema:()=>ki,SubscriptionsAcknowledgedNotificationSchema:()=>Ii,SubscriptionsListenRequestParamsSchema:()=>Ti,SubscriptionsListenRequestSchema:()=>Ci,SubscriptionsListenResultMetaSchema:()=>Oi,SubscriptionsListenResultSchema:()=>Ni,TaskAugmentedRequestParamsSchema:()=>gr,TaskCreationParamsSchema:()=>Qu,TaskMetadataSchema:()=>Qs,TaskSchema:()=>Wt,TaskStatusNotificationParamsSchema:()=>ja,TaskStatusNotificationSchema:()=>tl,TaskStatusSchema:()=>Na,TextContentSchema:()=>Gr,TextResourceContentsSchema:()=>vn,TitledMultiSelectEnumSchemaSchema:()=>In,TitledSingleSelectEnumSchemaSchema:()=>Tn,ToolAnnotationsSchema:()=>Ki,ToolChoiceSchema:()=>aa,ToolExecutionSchema:()=>Gi,ToolListChangedNotificationSchema:()=>ea,ToolResultContentSchema:()=>ca,ToolSchema:()=>$n,ToolUseContentSchema:()=>Ui,UnsubscribeRequestParamsSchema:()=>Pi,UnsubscribeRequestSchema:()=>Ei,UntitledMultiSelectEnumSchemaSchema:()=>kn,UntitledSingleSelectEnumSchemaSchema:()=>En});var Vl=e=>dn.safeParse(e).success,Fl=e=>pn.safeParse(e).success,Ha=e=>Hr.safeParse(e).success,Hl=e=>Jr.safeParse(e).success;var kt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Jl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Bl(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var vg="x-mcp-header",Ob=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Nb=new Set(["string","integer","boolean","number"]);function Kl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(vg in a){if(!c||i.length===0)return`${Va(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[vg];if(typeof d!="string"||d.length===0)return`${Va(i)}: x-mcp-header MUST be a non-empty string`;if(!Ob.test(d))return`${Va(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||!Nb.has(m))return`${Va(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 jb){let m=a[d];if(m===void 0)continue;let g=Array.isArray(m)?m:m!==null&&typeof m=="object"&&xb.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 jb=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],xb=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Va(e){return e.length===0?"<root>":e.join(".")}var Fa=-32020,Uw=[{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:[Fa,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:[Fa],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:[Fa],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."}],Ab={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[Fa]:400};function Wa(e,t){return Hs(e,t)}function jn(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 bg=!1,Cl="draft-2020-12";function Sr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Cl});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().");bg||(bg=!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=Vs(e,{target:Cl,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:Jg(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 Jg(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"||Jg(o)))}return!1}function qb(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function _r(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>qb(o)).join(", ")}:{success:!0,data:r.value}}function Mb(e){let t=Vs(e,{target:Cl,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Lb=/\\\.\\d\{(\d+)\}/;function Db(e){let t=Lb.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=>wt.datetime({local:o,offset:n,precision:s}))))}function Zb(e,t){let r;switch(e){case"email":r=[Hh()];break;case"uri":r=[Ks()];break;case"date":r=[wt.date()];break;case"date-time":r=Db(t);break}return new Set(r.map(o=>Mb(o)).filter(o=>o!==void 0))}function Ub(e,t,r){return r!=="zod"?!0:Zb(e,t).has(t)}function Bg(e){let t=Sr(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 qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Vb(e){try{return Sr(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 Fb=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Gl(e){return Fb.has(e)||e.startsWith("x-")}var Hb=new Set(["$schema",...Object.keys(to.shape.requestedSchema.shape)]),zg={string:jn([Qr,En,Tn,Cn]),number:jn([eo]),integer:jn([eo]),boolean:jn([Pn]),array:jn([kn,In])},Jb=new Set(Qr.shape.format.unwrap().options);function Bb(e,t,r,o){if(!qn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(zg,e.type)?zg[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Gl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Jb.has(e.format)?(typeof c!="string"||!Ub(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function Kb(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&qn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Bb(c,`properties.${i}`,t,o)])):Hb.has(n)?r[n]=s:Gl(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 Gb(e,t){if(!qn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Wa(On,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function kl(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>kl(o,t[n],`${r}[${n}]`)):!qn(e)||!qn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?kl(n,t[o],s):Gl(o)?[]:[s]})}function Wb(e){if(!so(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=Kb(Vb(e.requestedSchema),t),o=Wa(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): ${Gb(r,o.error.message)}`);let n=kl(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 Yb(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 Xb=Object.assign(Yb,{elicit(e){try{return{method:"elicitation/create",params:Wb(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 Kg=250;function Gg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wg(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 Yg(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 Qb=["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"],ez={IdJagTokenExchangeResponseSchema:yl,OAuthClientInformationFullSchema:bl,OAuthClientInformationSchema:Ma,OAuthClientMetadataSchema:qa,OAuthClientRegistrationErrorSchema:zl,OAuthErrorResponseSchema:vl,OAuthMetadataSchema:xa,OAuthProtectedResourceMetadataSchema:gl,OAuthTokenRevocationRequestSchema:Rl,OAuthTokensSchema:Sl,OpenIdProviderDiscoveryMetadataSchema:_l,OpenIdProviderMetadataSchema:Aa},Xg={},Qg={};function e_(e,t){let r=e.slice(0,-6);Xg[r]=t,Qg[r]=o=>t.safeParse(o).success}for(let e of Qb)e_(e,Ib[e]);for(let[e,t]of Object.entries(ez))e_(e,t);var tz=Object.freeze(Xg),rz=Object.freeze(Qg);function oz(e){switch(e){case"initialize":case"notifications/initialized":return no(void 0);case"server/discover":return no(Ul);default:return}}var t_=6e4,nz=[fr,Fr,Tt,Vt],sz=["inputResponses","requestState"];function Rg(e,t){let r=e.params;if(!An(r))return{message:e,lifted:{}};let o=r._meta,n=An(o)?nz.filter(a=>a in o):[],s=t==="request"?sz.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&An(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 $g(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 Ln(e){return()=>e}var iz=Ln(void 0);function Wl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Ln(t)}}}var az;var Yl=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{az=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ys,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),Ha(n)||Hl(n)?this._onresponse(n):Vl(n)?this._onrequest(n,s):Fl(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}=Rg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Sg(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(Pl(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}=Rg(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 _=Sg(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(wl(r.method)&&!n.hasRequestMethod(r.method)&&!(yg(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:cz(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?iz:Ln(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=$g(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),Ha(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 yg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=$g(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=oz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wl(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===Ul&&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(uz(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;_r(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??t_,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(Pl(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(!wl(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 _r(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(!Pl(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 _r(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 An(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xl(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]=An(i)&&An(s)?{...i,...s}:s}return r}function wg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cz(e){let t={},r=[];if(!wg(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!wg(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function uz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var lz=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}})),Vw=ds(lz(),1);var r_=10*1024*1024,Ql=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??r_}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
|
-
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return
|
|
61
|
-
`}var dz=/^[A-Za-z0-9._-]{1,128}$/;function pz(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"),!dz.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 mz(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 td(e){let t=pz(e);return mz(e,t.warnings),t.isValid}function fz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function hz(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function gz(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=>fz(r))}function Ya(e){if(e!==void 0){if(gz(e))return P(e);if(typeof e=="object"&&e!==null&&!so(e)&&Object.values(e).some(t=>hz(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 Qa=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})),n_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Qa();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=Qa(),r=n_();var o=Qa();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=n_();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($,C){return this}},i=class extends s{constructor($,C,N){super(),this.varKind=$,this.name=C,this.rhs=N}render({es5:$,_n:C}){let N=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${J};`+C}optimizeNames($,C){if($[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,$,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor($,C,N){super(),this.lhs=$,this.rhs=C,this.sideEffects=N}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,C){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,$,C),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,C,N,J){super($,N,J),this.op=C}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($,C){return this.code=G(this.code,$,C),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((C,N)=>C+N.render($),"")}optimizeNodes(){let{nodes:$}=this,C=$.length;for(;C--;){let N=$[C].optimizeNodes();Array.isArray(N)?$.splice(C,1,...N):N?$[C]=N:$.splice(C,1)}return $.length>0?this:void 0}optimizeNames($,C){let{nodes:N}=this,J=N.length;for(;J--;){let ee=N[J];ee.optimizeNames($,C)||(fe($,ee.names),N.splice(J,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce(($,C)=>Z($,C.names),{})}},p=class extends v{render($){return"{"+$._n+super.render($)+"}"+$._n}},_=class extends v{},h=class extends p{};h.kind="else";var f=class Xa extends p{constructor(C,N){super(N),this.condition=C}render(C){let N=`if(${this.condition})`+super.render(C);return this.else&&(N+="else "+this.else.render(C)),N}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!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 C===!1?N instanceof Xa?N:N.nodes:this.nodes.length?this:new Xa($e(C),N instanceof Xa?[N]:N.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,N){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,N),!!(super.optimizeNames(C,N)||this.else))return this.condition=G(this.condition,C,N),this}get names(){let C=super.names;return Y(C,this.condition),this.else&&Z(C,this.else.names),C}};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($,C){if(super.optimizeNames($,C))return this.iteration=G(this.iteration,$,C),this}get names(){return Z(super.names,this.iteration.names)}},R=class extends z{constructor($,C,N,J){super(),this.varKind=$,this.name=C,this.from=N,this.to=J}render($){let C=$.es5?r.varKinds.var:this.varKind,{name:N,from:J,to:ee}=this;return`for(${C} ${N}=${J}; ${N}<${ee}; ${N}++)`+super.render($)}get names(){return Y(Y(super.names,this.from),this.to)}},w=class extends z{constructor($,C,N,J){super(),this.loop=$,this.varKind=C,this.name=N,this.iterable=J}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,C){if(super.optimizeNames($,C))return this.iterable=G(this.iterable,$,C),this}get names(){return Z(super.names,this.iterable.names)}},b=class extends p{constructor($,C,N){super(),this.name=$,this.args=C,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 C="try"+super.render($);return this.catch&&(C+=this.catch.render($)),this.finally&&(C+=this.finally.render($)),C}optimizeNodes(){var $,C;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames($,C){var N,J;return super.optimizeNames($,C),(N=this.catch)===null||N===void 0||N.optimizeNames($,C),(J=this.finally)===null||J===void 0||J.optimizeNames($,C),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($,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
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($,C){let N=this._extScope.value($,C);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue($,C){return this._extScope.getValue($,C)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,C,N,J){let ee=this._scope.toName(C);return N!==void 0&&J&&(this._constants[ee.str]=N),this._leafNode(new i($,ee,N)),ee}const($,C,N){return this._def(r.varKinds.const,$,C,N)}let($,C,N){return this._def(r.varKinds.let,$,C,N)}var($,C,N){return this._def(r.varKinds.var,$,C,N)}assign($,C,N){return this._leafNode(new c($,C,N))}add($,C){return this._leafNode(new a($,e.operators.ADD,C))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){let C=["{"];for(let[N,J]of $)C.length>1&&C.push(","),C.push(N),(N!==J||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,J));return C.push("}"),new t._Code(C)}if($,C,N){if(this._blockNode(new f($)),C&&N)this.code(C).else().code(N).endIf();else if(C)this.code(C).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($,C){return this._blockNode($),C&&this.code(C).endFor(),this}for($,C){return this._for(new y($),C)}forRange($,C,N,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,C,N),()=>J(pe))}forOf($,C,N,J=r.varKinds.const){let ee=this._scope.toName($);if(this.opts.es5){let pe=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${pe}.length`,ae=>{this.var(ee,(0,t._)`${pe}[${ae}]`),N(ee)})}return this._for(new w("of",J,ee,C),()=>N(ee))}forIn($,C,N,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${C})`,N);let ee=this._scope.toName($);return this._for(new w("in",J,ee,C),()=>N(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let C=new S;if(this._blockNode(C),this.code($),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try($,C,N){if(!C&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code($),C){let ee=this.name("e");this._currNode=J.catch=new j(ee),C(ee)}return N&&(this._currNode=J.finally=new F,this.code(N)),this._endBlockNode(j,F)}throw($){return this._leafNode(new m($))}block($,C){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(C),this}endBlock($){let C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");let N=this._nodes.length-C;if(N<0||$!==void 0&&N!==$)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${$} expected`);return this._nodes.length=C,this}func($,C=t.nil,N,J){return this._blockNode(new b($,C,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($,C){let N=this._currNode;if(N instanceof $||C&&N instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${$.kind}/${C.kind}`:$.kind}"`)}_elseNode($){let C=this._currNode;if(!(C instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let C=this._nodes;C[C.length-1]=$}};e.CodeGen=M;function Z($,C){for(let N in C)$[N]=($[N]||0)+(C[N]||0);return $}function Y($,C){return C instanceof t._CodeOrName?Z($,C.names):$}function G($,C,N){if($ instanceof t.Name)return J($);if(!ee($))return $;return new t._Code($._items.reduce((pe,ae)=>(ae instanceof t.Name&&(ae=J(ae)),ae instanceof t._Code?pe.push(...ae._items):pe.push(ae),pe),[]));function J(pe){let ae=N[pe.str];return ae===void 0||C[pe.str]!==1?pe:(delete C[pe.str],ae)}function ee(pe){return pe instanceof t._Code&&pe._items.some(ae=>ae instanceof t.Name&&C[ae.str]===1&&N[ae.str]!==void 0)}}function fe($,C){for(let N in C)$[N]=($[N]||0)-(C[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 k(...$){return $.reduce(he)}e.or=k;function x($){return(C,N)=>C===t.nil?N:N===t.nil?C:(0,t._)`${V(C)} ${$} ${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=Qa();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})),pt=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})),tc=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=pt();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])}})),_z=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=tc(),r=le(),o=pt(),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)}})),s_=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})),i_=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})),ec=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=s_(),r=i_(),o=tc(),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
|
|
63
|
-
|| (${
|
|
64
|
-
|| (${
|
|
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}}})),Sz=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)}`)}})),mt=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=pt(),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})),yz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=pt(),o=mt(),n=tc();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})),vz=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})),a_=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}})),bz=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")}})),rc=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=a_(),o=bz(),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 k=this.opts.uriResolver.resolve;if(he=g($e?k($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=_z(),r=ec(),o=i_(),n=ec(),s=Sz(),i=yz(),c=vz(),a=le(),u=pt(),d=rc(),m=_e(),g=tc();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 ke=(0,a.str)`${ne}/$comment`,je=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${ke}, ${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:ke,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,ke,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||(k(T,A),T.opts.allowUnionTypes||x(T,A),V(T,T.dataTypes))}function k(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(D=>{C(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(ke=>$(A,ke))&&J(T,`missing type "${de.join(",")}" for keyword "${ne}"`)}}}function $(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function C(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function N(T,A){let D=[];for(let ne of T.dataTypes)C(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(),ke());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 ke(){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 ae=/^\/(?:[^~]|~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(!ae.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 ke=de,je=se.split("/");for(let Ne of je)Ne&&(de=(0,a._)`${de}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,ke=(0,a._)`${ke} && ${de}`);return ke;function Ue(Ne,we){return`Cannot access ${Ne} ${we} levels up, current level is ${A}`}}e.getData=Be})),Dn=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=rc();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})),oc=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Dn(),o=pt(),n=rc(),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}})),zz=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}})),c_=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}})),Rz=U(((e,t)=>{let{isUUID:r}=c_(),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}})),$z=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=c_(),{SCHEMES:a,getSchemeHandler:u}=Rz();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})),wz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$z();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),od=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=Dn(),n=ao(),s=s_(),i=oc(),c=le(),a=rc(),u=ec(),d=_e(),m=zz(),g=wz(),v=(k,x)=>new RegExp(k,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(k){var x,V,$,C,N,J,ee,pe,ae,ze,Be,T,A,D,ne,se,de,ke,je,Ue,Ne,we,ot,Ae,ht;let at=k.strict,gt=(x=k.code)===null||x===void 0?void 0:x.optimize,It=gt===!0||gt===void 0?1:gt||0,Ot=($=(V=k.code)===null||V===void 0?void 0:V.regExp)!==null&&$!==void 0?$:v,Xt=(C=k.uriResolver)!==null&&C!==void 0?C:g.default;return{strictSchema:(J=(N=k.strictSchema)!==null&&N!==void 0?N:at)!==null&&J!==void 0?J:!0,strictNumbers:(pe=(ee=k.strictNumbers)!==null&&ee!==void 0?ee:at)!==null&&pe!==void 0?pe:!0,strictTypes:(ze=(ae=k.strictTypes)!==null&&ae!==void 0?ae:at)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Be=k.strictTuples)!==null&&Be!==void 0?Be:at)!==null&&T!==void 0?T:"log",strictRequired:(D=(A=k.strictRequired)!==null&&A!==void 0?A:at)!==null&&D!==void 0?D:!1,code:k.code?{...k.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(ne=k.loopRequired)!==null&&ne!==void 0?ne:z,loopEnum:(se=k.loopEnum)!==null&&se!==void 0?se:z,meta:(de=k.meta)!==null&&de!==void 0?de:!0,messages:(ke=k.messages)!==null&&ke!==void 0?ke:!0,inlineRefs:(je=k.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(Ue=k.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Ne=k.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(we=k.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(ot=k.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(Ae=k.unicodeRegExp)!==null&&Ae!==void 0?Ae:!0,int32range:(ht=k.int32range)!==null&&ht!==void 0?ht:!0,uriResolver:Xt}}var R=class{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...y(k)};let{es5:x,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:x,lines:V}),this.logger=Z(k.logger);let $=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,h,k,"NOT SUPPORTED"),w.call(this,f,k,"DEPRECATED","warn"),this._metaOpts=F.call(this),k.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&j.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),S.call(this),k.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:k,meta:x,schemaId:V}=this.opts,$=m;V==="id"&&($={...m},$.id=$.$id,delete $.$id),x&&k&&this.addMetaSchema($,$[V],!1)}defaultMeta(){let{meta:k,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[x]||k:void 0}validate(k,x){let V;if(typeof k=="string"){if(V=this.getSchema(k),!V)throw new Error(`no schema with key or ref "${k}"`)}else V=this.compile(k);let $=V(x);return"$async"in V||(this.errors=V.errors),$}compile(k,x){let V=this._addSchema(k,x);return V.validate||this._compileSchemaEnv(V)}compileAsync(k,x){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return $.call(this,k,x);async function $(ae,ze){await C.call(this,ae.$schema);let Be=this._addSchema(ae,ze);return Be.validate||N.call(this,Be)}async function C(ae){ae&&!this.getSchema(ae)&&await $.call(this,{$ref:ae},!0)}async function N(ae){try{return this._compileSchemaEnv(ae)}catch(ze){if(!(ze instanceof n.default))throw ze;return J.call(this,ze),await ee.call(this,ze.missingSchema),N.call(this,ae)}}function J({missingSchema:ae,missingRef:ze}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${ze} cannot be resolved`)}async function ee(ae){let ze=await pe.call(this,ae);this.refs[ae]||await C.call(this,ze.$schema),this.refs[ae]||this.addSchema(ze,ae,x)}async function pe(ae){let ze=this._loading[ae];if(ze)return ze;try{return await(this._loading[ae]=V(ae))}finally{delete this._loading[ae]}}}addSchema(k,x,V,$=this.opts.validateSchema){if(Array.isArray(k)){for(let N of k)this.addSchema(N,void 0,V,$);return this}let C;if(typeof k=="object"){let{schemaId:N}=this.opts;if(C=k[N],C!==void 0&&typeof C!="string")throw new Error(`schema ${N} must be string`)}return x=(0,a.normalizeId)(x||C),this._checkUnique(x),this.schemas[x]=this._addSchema(k,V,x,$,!0),this}addMetaSchema(k,x,V=this.opts.validateSchema){return this.addSchema(k,x,!0,V),this}validateSchema(k,x){if(typeof k=="boolean")return!0;let V;if(V=k.$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,k);if(!$&&x){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return $}getSchema(k){let x;for(;typeof(x=b.call(this,k))=="string";)k=x;if(x===void 0){let{schemaId:V}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:V});if(x=i.resolveSchema.call(this,$,k),!x)return;this.refs[k]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=b.call(this,k);return typeof x=="object"&&this._cache.delete(x.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{let x=k;this._cache.delete(x);let V=k[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(k){for(let x of k)this.addKeyword(x);return this}addKeyword(k,x){let V;if(typeof k=="string")V=k,typeof x=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=V);else if(typeof k=="object"&&x===void 0){if(x=k,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,C=>fe.call(this,C)),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?C=>fe.call(this,C,$):C=>$.type.forEach(N=>fe.call(this,C,$,N))),this}getKeyword(k){let x=this.RULES.all[k];return typeof x=="object"?x.definition:!!x}removeKeyword(k){let{RULES:x}=this;delete x.keywords[k],delete x.all[k];for(let V of x.rules){let $=V.rules.findIndex(C=>C.keyword===k);$>=0&&V.rules.splice($,1)}return this}addFormat(k,x){return typeof x=="string"&&(x=new RegExp(x)),this.formats[k]=x,this}errorsText(k=this.errors,{separator:x=", ",dataVar:V="data"}={}){return!k||k.length===0?"No errors":k.map($=>`${V}${$.instancePath} ${$.message}`).reduce(($,C)=>$+x+C)}$dataMetaSchema(k,x){let V=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(let $ of x){let C=$.split("/").slice(1),N=k;for(let J of C)N=N[J];for(let J in V){let ee=V[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ae=N[J];pe&&ae&&(N[J]=he(ae))}}return k}_removeAllSchemas(k,x){for(let V in k){let $=k[V];(!x||x.test(V))&&(typeof $=="string"?delete k[V]:$&&!$.meta&&(this._cache.delete($.schema),delete k[V]))}}_addSchema(k,x,V,$=this.opts.validateSchema,C=this.opts.addUsedSchema){let N,{schemaId:J}=this.opts;if(typeof k=="object")N=k[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(k);if(ee!==void 0)return ee;V=(0,a.normalizeId)(N||V);let pe=a.getSchemaRefs.call(this,k,V);return ee=new i.SchemaEnv({schema:k,schemaId:J,meta:x,baseId:V,localRefs:pe}),this._cache.set(ee.schema,ee),C&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=ee),$&&this.validateSchema(k,!0),ee}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):i.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){let x=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,k)}finally{this.opts=x}}};R.ValidationError=o.default,R.MissingRefError=n.default,e.default=R;function w(k,x,V,$="error"){for(let C in k){let N=C;N in x&&this.logger[$](`${V}: option ${C}. ${k[N]}`)}}function b(k){return k=(0,a.normalizeId)(k),this.schemas[k]||this.refs[k]}function S(){let k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(let x in k)this.addSchema(k[x],x)}function E(){for(let k in this.opts.formats){let x=this.opts.formats[k];x&&this.addFormat(k,x)}}function j(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in k){let V=k[x];V.keyword||(V.keyword=x),this.addKeyword(V)}}function F(){let k={...this.opts};for(let x of p)delete k[x];return k}let M={log(){},warn(){},error(){}};function Z(k){if(k===!1)return M;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function G(k,x){let{RULES:V}=this;if((0,d.eachItem)(k,$=>{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(k,x,V){var $;let C=x?.post;if(V&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:N}=this,J=C?N.post:N.rules.find(({type:pe})=>pe===V);if(J||(J={type:V,rules:[]},N.rules.push(J)),N.keywords[k]=!0,!x)return;let ee={keyword:k,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[k]=ee,($=x.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(k,x,V){let $=k.rules.findIndex(C=>C.keyword===V);$>=0?k.rules.splice($,0,x):(k.rules.push(x),this.logger.warn(`rule ${V} is not defined`))}function be(k){let{metaSchema:x}=k;x!==void 0&&(k.$data&&this.opts.$data&&(x=he(x)),k.validateSchema=this.compile(x,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(k){return{anyOf:[k,Oe]}}})),Pz=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})),nd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=ao(),r=mt(),o=le(),n=pt(),s=oc(),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})),u_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Pz(),r=nd(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),Ez=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})),Tz=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})),Cz=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'})),kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=Cz(),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})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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})),Oz=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})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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})),jz=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})),sd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=a_();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ec(),r=le(),o=_e(),n=sd(),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})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=sd(),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})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=sd(),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})),l_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ez(),r=Tz(),o=kz(),n=Iz(),s=Oz(),i=Nz(),c=jz(),a=xz(),u=Az(),d=qz(),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})),d_=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})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=_e(),o=mt(),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})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),Lz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=mt(),n=d_(),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})),Dz=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})),id=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=_e(),o=mt();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
|
-
missingProperty: ${
|
|
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 dh(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;dh(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 ph=new Set(["type","properties","required","additionalProperties"]),uh=["oneOf","anyOf"];function lh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!ph.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]??lh(u);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:mu(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=lh(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 Uy(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of ph)if(n in e)return;let r=t.filter(n=>uh.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=mu(t);else{let n=r[0],s=uh.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=>mu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Go(e,o))}function Qo(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},p=a.ref;if(a.ref=null,p){o(p);let v=e.seen.get(p),m=v.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Go(u,m),Go(u,d),c._zod.parent===p)for(let h in u)h==="$ref"||h==="allOf"||h in d||delete u[h];if(m.$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!==p){o(g);let v=e.seen.get(g);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(let m in u)m==="$ref"||m==="allOf"||m in v.def&&JSON.stringify(u[m])===JSON.stringify(v.def[m])&&delete u[m]}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())dh(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 p=c.get(d);p?p.push(u):c.set(d,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Uy(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)}Go(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:Wo(t,"input",e.processors),output:Wo(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 mh=(e,t={})=>r=>{let o=Yo({...r,processors:t});return ve(e,o),Xo(o,e),Qo(o,e)},Wo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Yo({...n??{},target:s,io:t,processors:r});return ve(e,i),Xo(i,e),Qo(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)},fh=(e,t)=>{Zr(e,"minimum",t),Ur(e,"maximum",t)},yh=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},vh=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},bh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},zh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},hh=(e,t)=>Zr(e,"minimum",t.minimum),gh=(e,t)=>Ur(e,"maximum",t.maximum),_h=e=>(t,r)=>{zh(t,r.format);let[o,n]=e[r.format];Zr(t,"minimum",o),Ur(t,"maximum",n)},Vy={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)=>yh(e,t.value),number_format:_h(Do),bigint_format:_h(_s),min_length:hh,max_length:gh,length_equals:(e,t)=>fh(e,t.length),min_size:hh,max_size:gh,size_equals:(e,t)=>fh(e,t.size),string_format:(e,t)=>{zh(e,t.format),t.pattern&&vh(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)=>bh(e,t.mime)};function je(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)Vy[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&&yh(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&bh(t,n.mime);for(let s of n.patterns??[])vh(t,s);return t}var Fy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hy=new Map([[Fc,Np],[Os,xp]]),Rh=e=>Hy.get(e)??e,gu=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:d}=je(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=Fy[c]??c,n.format===""&&delete n.format,(c==="time"||d)&&delete n.format),u&&(n.contentEncoding=u),a&&a.size>0){let p=[...a].map(Rh);p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},_u=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:d}=je(e);n.type=d?"integer":"number";let p=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(p?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 m=new Set;for(let f of c)Number.isFinite(f)&&f!==0?m.add(Math.abs(f)):qe(e,t,n,o,`A multipleOf divisor of ${f} cannot be represented in JSON Schema`);let[_,...h]=m;_!==void 0&&(n.multipleOf=_),h.length&&(n.allOf=[...n.allOf??[],...h.map(f=>({multipleOf:f}))])}},Su=(e,t,r,o)=>{r.type="boolean"},yu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},$h=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wh=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Ph=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},bu=(e,t,r,o)=>{r.not={}},zu=(e,t,r,o)=>{},Ru=(e,t,r,o)=>{},$u=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},wu=(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},Pu=(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},Eh=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},Th=(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},Ch=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=je(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})))},kh=(e,t,r,o)=>{r.type="boolean"},Eu=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Ih=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Tu=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Oh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},Nh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},Cu=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=je(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 en(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?en(t.out):t.type==="catch"?en(t.innerType):e._zod.optin}var ku=(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"?en(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)},Iu=(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},Ou=(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)},xh=(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"?en(_)!==void 0:_._zod.optout==="optional"))break;d--}let p=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=p)):t.target==="openapi-3.0"?(n.items={anyOf:a},u&&n.items.anyOf.push(u),d>0&&(n.minItems=d),g&&(n.maxItems=p)):(n.items=a,g?n.additionalItems=!1:u&&(n.additionalItems=u),d>0&&(n.minItems=d),g&&(n.maxItems=p));let{minimum:v,maximum:m}=je(e);typeof v=="number"&&(n.minItems=v),typeof m=="number"&&(n.maxItems=m)};function fu(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let m=e.get(t)?.def;if(!m)return t;let _=fu(e,m,r);return _===m?t:_}for(let m of["anyOf","oneOf"]){let _=t[m];if(!Array.isArray(_))continue;let h=_.map(f=>fu(e,f,r));h.some((f,z)=>f!==_[z])&&(t={...t,[m]:h})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(m=>m==="number"||m==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:d,format:p,id:g,...v}=t;return v.enum?v.enum=v.enum.map(m=>typeof m=="number"?String(m):m):typeof v.const=="number"&&(v.const=String(v.const)),n&&(v.type="string",s||(v.pattern=(o.includes("number")?Fo:Mc).source)),v}var hu=new WeakMap;function Jy(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 hu.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=fu(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 Nu=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=je(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 p of c)Ye(n.patternProperties,Rh(p).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=hu.get(t);d||(d=[],hu.set(t,d),t.deferred.push(()=>Jy(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&en(s.valueType)!==void 0;if(a&&!s.partial&&!u){let d=[...a].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d.map(String))}},xu=(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"}]},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},Au=Symbol();function jh(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"),Au):JSON.parse(i)}var qu=(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=jh(n.defaultValue,e,t,r,o);i!==Au&&(r.default=i)},Mu=(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=jh(n.defaultValue,e,t,r,o);i!==Au&&(r._prefault=i)},Lu=(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},Du=(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},Zu=(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},Ah=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Fs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Uu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},Sh={string:gu,number:_u,boolean:Su,bigint:yu,symbol:$h,null:vu,undefined:wh,void:Ph,never:bu,any:zu,unknown:Ru,date:$u,enum:wu,literal:Pu,nan:Eh,template_literal:Th,file:Ch,success:kh,custom:Eu,function:Ih,transform:Tu,map:Oh,set:Nh,array:Cu,object:ku,union:Iu,intersection:Ou,tuple:xh,record:Nu,nullable:xu,nonoptional:ju,default:qu,prefault:Mu,catch:Lu,pipe:Du,readonly:Zu,promise:Ah,optional:Fs,lazy:Uu};function Hs(e,t){if("_idmap"in e){let o=e,n=Yo({...t,processors:Sh}),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;Xo(n,d),Ye(i,u,Qo(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=Yo({...t,processors:Sh});return ve(e,r),Xo(r,e),Qo(r,e)}var qh=new WeakSet([Object.prototype,Error.prototype]);function Js(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 tv=(e,t)=>{cp.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);qh.has(r)||(qh.add(r),Js(r,"format",o=>n=>Nc(o,n)),Js(r,"flatten",o=>n=>Oc(o,n)),Js(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Or,2)}),Js(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",tv,void 0,{Parent:Error});var Mh=zs(rt),Lh=Rs(rt),Bs=$s(rt),Dh=ws(rt),Zh=lp(rt),Uh=dp(rt),Vh=pp(rt),Fh=mp(rt),Hh=fp(rt),Jh=hp(rt),Bh=gp(rt),Kh=_p(rt);function ov(){Xe.localeError||Qe(Rf())}function Gs(){Xe.memoizer||Qe({memoizer:Xc()})}var ye=q("ZodType",(e,t)=>(ov(),Se.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ce.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 it(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fv(e,t))},superRefine(e,t){return this.check(Hv(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return X(this)},exactOptional(){return kv(this)},nullable(){return Yh(this)},nullish(){return X(Yh(this))},nonoptional(e){return Av(this,e)},array(){return I(this)},or(e){return W([this,e])},and(e){return $t(this,e)},transform(e){return Xh(this,cg(e))},default(e){return Nv(this,e)},prefault(e){return jv(this,e)},catch(e){return Mv(this,e)},pipe(e){return Xh(this,e)},readonly(){return Zv(this)},describe(e){let t=this.clone();return Lt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Lt.get(this);let t=this.clone();return Lt.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 ce.hide(this,"~standard",{...Vc(this),jsonSchema:{input:Wo(this,"input"),output:Wo(this,"output")}})},set"~standard"(e){ce.own(this,"~standard",e)},parse:function e(t,r){return Mh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Lh(this,t,r,{callee:e})},safeParse(e,t){return Bs(this,e,t)},async safeParseAsync(e,t){return Dh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ce.own(this,"spa",e)},validate(e,t){return xc(this,e,t)},validateAsync(e,t){return jc(this,e,t)},encode:function e(t,r){return Zh(this,t,r,{callee:e})},decode:function e(t,r){return Uh(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Vh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Fh(this,t,r,{callee:e})},safeEncode(e,t){return Hh(this,e,t)},safeDecode(e,t){return Jh(this,e,t)},async safeEncodeAsync(e,t){return Bh(this,e,t)},async safeDecodeAsync(e,t){return Kh(this,e,t)},toJSONSchema(e){return mh(this,{})(e)},get description(){return Lt.get(this)?.description},get _def(){return this._zod.def}}),Qh=q("_ZodString",(e,t)=>{Is.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)},ce.derived({format:e=>je(e).format??null,minLength:e=>je(e).minimum??null,maxLength:e=>je(e).maximum??null},{regex(...e){return this.check(ru(...e))},includes(...e){return this.check(su(...e))},startsWith(...e){return this.check(iu(...e))},endsWith(...e){return this.check(au(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(Us(...e))},length(...e){return this.check(Vs(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(ou(e))},uppercase(e){return this.check(nu(e))},trim(){return this.check(uu())},normalize(...e){return this.check(cu(...e))},toLowerCase(){return this.check(lu())},toUpperCase(){return this.check(du())},slugify(){return this.check(pu())}})),Fu=q("ZodString",(e,t)=>{Is.init(e,t),Qh.init(e,t)},{email(e){return this.check(eu(eg,e))},url(e){return this.check(tu(rg,e))},jwt(e){return this.check(Bf(yv,e))},emoji(e){return this.check(Nf(sv,e))},guid(e){return this.check(Tf(nv,e))},uuid(e){return this.check(Cf(Ks,e))},uuidv4(e){return this.check(kf(Ks,e))},uuidv6(e){return this.check(If(Ks,e))},uuidv7(e){return this.check(Of(Ks,e))},nanoid(e){return this.check(xf(iv,e))},cuid(e){return this.check(jf(av,e))},cuid2(e){return this.check(Af(cv,e))},ulid(e){return this.check(qf(uv,e))},base64(e){return this.check(Ff(gv,e))},base64url(e){return this.check(Hf(_v,e))},xid(e){return this.check(Mf(lv,e))},ksuid(e){return this.check(Lf(dv,e))},ipv4(e){return this.check(Df(pv,e))},ipv6(e){return this.check(Zf(mv,e))},cidrv4(e){return this.check(Uf(fv,e))},cidrv6(e){return this.check(Vf(hv,e))},e164(e){return this.check(Jf(Sv,e))},datetime(e){return this.check(Ms(tn,e))},date(e){return this.check(Ls(rn,e))},time(e){return this.check(Ds(on,e))},duration(e){return this.check(Zs(nn,e))}});function l(e){return Pf(Fu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),Qh.init(e,t)}),tn=q("ZodISODateTime",(e,t)=>{Im.init(e,t),Pe.init(e,t)}),rn=q("ZodISODate",(e,t)=>{Om.init(e,t),Pe.init(e,t)}),on=q("ZodISOTime",(e,t)=>{Nm.init(e,t),Pe.init(e,t)}),nn=q("ZodISODuration",(e,t)=>{xm.init(e,t),Pe.init(e,t)}),eg=q("ZodEmail",(e,t)=>{vm.init(e,t),Pe.init(e,t)});function tg(e){return eu(eg,e)}var nv=q("ZodGUID",(e,t)=>{Sm.init(e,t),Pe.init(e,t)});var Ks=q("ZodUUID",(e,t)=>{ym.init(e,t),Pe.init(e,t)});var rg=q("ZodURL",(e,t)=>{Rm.init(e,t),Pe.init(e,t)});function Ws(e){return tu(rg,e)}var sv=q("ZodEmoji",(e,t)=>{$m.init(e,t),Pe.init(e,t)});var iv=q("ZodNanoID",(e,t)=>{wm.init(e,t),Pe.init(e,t)});var av=q("ZodCUID",(e,t)=>{Pm.init(e,t),Pe.init(e,t)});var cv=q("ZodCUID2",(e,t)=>{Em.init(e,t),Pe.init(e,t)});var uv=q("ZodULID",(e,t)=>{Tm.init(e,t),Pe.init(e,t)});var lv=q("ZodXID",(e,t)=>{Cm.init(e,t),Pe.init(e,t)});var dv=q("ZodKSUID",(e,t)=>{km.init(e,t),Pe.init(e,t)});var pv=q("ZodIPv4",(e,t)=>{jm.init(e,t),Pe.init(e,t)});var mv=q("ZodIPv6",(e,t)=>{qm.init(e,t),Pe.init(e,t)});var fv=q("ZodCIDRv4",(e,t)=>{Mm.init(e,t),Pe.init(e,t)});var hv=q("ZodCIDRv6",(e,t)=>{Lm.init(e,t),Pe.init(e,t)});var gv=q("ZodBase64",(e,t)=>{Zm.init(e,t),Pe.init(e,t)});var _v=q("ZodBase64URL",(e,t)=>{Um.init(e,t),Pe.init(e,t)});var Sv=q("ZodE164",(e,t)=>{Vm.init(e,t),Pe.init(e,t)});var yv=q("ZodJWT",(e,t)=>{Fm.init(e,t),Pe.init(e,t)});var Ys=q("ZodNumber",(e,t)=>{Hc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n),e.isFinite=!0},ce.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=je(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=je(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=je(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>je(e).format??null},{gt(e,t){return this.check(Lr(e,t))},gte(e,t){return this.check(Rt(e,t))},min(e,t){return this.check(Rt(e,t))},lt(e,t){return this.check(Mr(e,t))},lte(e,t){return this.check(zt(e,t))},max(e,t){return this.check(zt(e,t))},int(e){return this.check(Gh(e))},safe(e){return this.check(Gh(e))},positive(e){return this.check(Lr(0,e))},nonnegative(e){return this.check(Rt(0,e))},negative(e){return this.check(Mr(0,e))},nonpositive(e){return this.check(zt(0,e))},multipleOf(e,t){return this.check(Ko(e,t))},step(e,t){return this.check(Ko(e,t))},finite(){return this}}));function L(e){return Kf(Ys,e)}var vv=q("ZodNumberFormat",(e,t)=>{Hm.init(e,t),Ys.init(e,t)});function Gh(e){return Wf(vv,e)}var Hu=q("ZodBoolean",(e,t)=>{Jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function H(e){return Yf(Hu,e)}var og=q("ZodBigInt",(e,t)=>{Bm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n)},ce.derived({minValue:e=>je(e).minimum??null,maxValue:e=>je(e).maximum??null,format:e=>je(e).format??null},{gte(e,t){return this.check(Rt(e,t))},min(e,t){return this.check(Rt(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(zt(e,t))},max(e,t){return this.check(zt(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(zt(BigInt(0),e))},nonnegative(e){return this.check(Rt(BigInt(0),e))},multipleOf(e,t){return this.check(Ko(e,t))}}));var bv=q("ZodNull",(e,t)=>{Km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(e,r,o,n)});function lr(e){return eh(bv,e)}var zv=q("ZodAny",(e,t)=>{Gm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function ng(){return th(zv)}var Rv=q("ZodUnknown",(e,t)=>{Wm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});function Q(){return rh(Rv)}var $v=q("ZodNever",(e,t)=>{Ym.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n)});function sg(e){return oh($v,e)}var ig=q("ZodDate",(e,t)=>{Xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),e.min=(r,o)=>e.check(Rt(r,o)),e.max=(r,o)=>e.check(zt(r,o))},ce.derived({minDate:e=>{let{minimum:t}=je(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=je(e);return t?new Date(t):null}},{}));var wv=q("ZodArray",(e,t)=>{Gs(),Qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(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(Us(e,t))},length(e,t){return this.check(Vs(e,t))},unwrap(){return this.element}});function I(e,t){return sh(wv,e,t)}var Ju=q("ZodObject",(e,t)=>{Gs(),rf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),ce.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return se(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ce.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:Q()}))},loose(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:Q()}))},strict(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:sg()}))},strip(){return this.clone(ce.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ce.extend(this,e)},safeExtend(e){return ce.safeExtend(this,e)},merge(e){return ce.merge(this,e)},pick(e){return ce.pick(this,e)},omit(e){return ce.omit(this,e)},partial(...e){return ce.partial(ug,this,e[0])},exactPartial(...e){return ce.partial(lg,this,e[0],"exactPartial")},required(...e){return ce.required(dg,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ce.normalizeParams(t)};return new Ju(r)}function Me(e,t){return new Ju({type:"object",shape:e,catchall:sg(),...ce.normalizeParams(t)})}function re(e,t){return new Ju({type:"object",shape:e,catchall:Q(),...ce.normalizeParams(t)})}var ag=q("ZodUnion",(e,t)=>{Jc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n),e.options=t.options});function W(e,t){return new ag({type:"union",options:e,...ce.normalizeParams(t)})}var Pv=q("ZodDiscriminatedUnion",(e,t)=>{ag.init(e,t),of.init(e,t)});function Zt(e,t,r){return new Pv({type:"union",options:t,discriminator:e,...ce.normalizeParams(r)})}var Ev=q("ZodIntersection",(e,t)=>{nf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n)});function $t(e,t){return new Ev({type:"intersection",left:e,right:t})}var Wh=q("ZodRecord",(e,t)=>{Gs(),sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new Wh({type:"record",keyType:l(),valueType:e,...ce.normalizeParams(t)}):new Wh({type:"record",keyType:e,valueType:t,...ce.normalizeParams(r)})}var Vu=q("ZodEnum",(e,t)=>{af.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>wu(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 Vu({...t,checks:[],...ce.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 Vu({...t,checks:[],...ce.normalizeParams(n),entries:s})}});function se(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Vu({type:"enum",entries:r,...ce.normalizeParams(t)})}var Tv=q("ZodLiteral",(e,t)=>{cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(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 Tv({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var Cv=q("ZodTransform",(e,t)=>{Gs(),uf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(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(ce.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(ce.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 cg(e){return new Cv({type:"transform",transform:e})}var ug=q("ZodOptional",(e,t)=>{Bc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new ug({type:"optional",innerType:e})}var lg=q("ZodExactOptional",(e,t)=>{lf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function kv(e){return new lg({type:"optional",innerType:e})}var Iv=q("ZodNullable",(e,t)=>{df.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Yh(e){return new Iv({type:"nullable",innerType:e})}var Ov=q("ZodDefault",(e,t)=>{pf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nv(e,t){return new Ov({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var xv=q("ZodPrefault",(e,t)=>{mf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function jv(e,t){return new xv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var dg=q("ZodNonOptional",(e,t)=>{ff.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Av(e,t){return new dg({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var qv=q("ZodCatch",(e,t)=>{hf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mv(e,t){return new qv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ce.constantCatch(t)})}var pg=q("ZodPipe",(e,t)=>{Kc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.in=t.in,e.out=t.out});function Xh(e,t){return new pg({type:"pipe",in:e,out:t})}var Lv=q("ZodPreprocess",(e,t)=>{pg.init(e,t),gf.init(e,t)}),Dv=q("ZodReadonly",(e,t)=>{_f.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Zv(e){return new Dv({type:"readonly",innerType:e})}var Uv=q("ZodLazy",(e,t)=>{Sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function sn(e){return new Uv({type:"lazy",getter:e})}var Vv=q("ZodCustom",(e,t)=>{yf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function Fv(e,t={}){return ih(Vv,e,t)}function Hv(e,t){return ah(e,t)}function dr(e,t){return new Lv({type:"pipe",in:cg(e),out:t})}var fg={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 mg;mg||(mg={});var wt={};dc(wt,{ZodISODate:()=>rn,ZodISODateTime:()=>tn,ZodISODuration:()=>nn,ZodISOTime:()=>on,date:()=>Kv,datetime:()=>Bv,duration:()=>Wv,time:()=>Gv});function Bv(e){return Ms(tn,e)}function Kv(e){return Ls(rn,e)}function Gv(e){return Ds(on,e)}function Wv(e){return Zs(nn,e)}var Xs={};dc(Xs,{bigint:()=>eb,boolean:()=>Qv,date:()=>tb,number:()=>Xv,string:()=>Yv});function Yv(e){return Ef(Fu,e)}function Xv(e){return Gf(Ys,e)}function Qv(e){return Xf(Hu,e)}function eb(e){return Qf(og,e)}function tb(e){return nh(ig,e)}var mr="2025-11-25";var Qs=[mr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ei="io.modelcontextprotocol/related-task",fr="io.modelcontextprotocol/protocolVersion",Fr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",Tt="io.modelcontextprotocol/clientCapabilities",an="io.modelcontextprotocol/subscriptionId",Vt="io.modelcontextprotocol/logLevel";var hr="2.0";var Ut=sn(()=>W([l(),L(),H(),lr(),K(l(),Ut),I(Ut)])),Ee=K(l(),Ut),Ku=I(Ut),cn=W([l(),L().int()]),un=l(),ti=P({ttl:L().optional()}),ri=P({taskId:l()}),ln=re({progressToken:cn.optional(),[ei]:ri.optional()}),De=P({_meta:ln.optional()}),gr=De.extend({task:ti.optional()}),Te=P({method:l(),params:De.loose().optional()}),He=P({_meta:ln.optional()}),Je=P({method:l(),params:He.loose().optional()}),dn=re({get[Et](){return Br.optional().catch(void 0)}}),Ce=re({_meta:dn.optional()}),Ft=W([l(),L().int()]),pn=P({jsonrpc:O(hr),id:Ft,...Te.shape}).strict(),mn=P({jsonrpc:O(hr),...Je.shape}).strict(),Hr=P({jsonrpc:O(hr),id:Ft,result:Ce}).strict(),Jr=P({jsonrpc:O(hr),id:Ft.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),fn=W([pn,mn,Hr,Jr]),Gu=W([Hr,Jr]),hn=Ce.strict(),oi=He.extend({requestId:Ft.optional(),reason:l().optional()}),gn=Je.extend({method:O("notifications/cancelled"),params:oi}),ni=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:se(["light","dark"]).optional()}),Ht=P({icons:I(ni).optional()}),Pt=P({name:l(),title:l().optional()}),Br=Pt.extend({...Pt.shape,...Ht.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),ob=$t(P({applyDefaults:H().optional()}),Ee),nb=dr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$t(P({form:ob.optional(),url:Ee.optional()}),Ee.optional())),si=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({sampling:re({createMessage:Ee.optional()}).optional(),elicitation:re({create:Ee.optional()}).optional()}).optional()}),ii=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({tools:re({call:Ee.optional()}).optional()}).optional()}),ai=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:nb.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:si.optional(),extensions:K(l(),Ee).optional()}),ci=De.extend({protocolVersion:l(),capabilities:ai,clientInfo:Br}),ui=Te.extend({method:O("initialize"),params:ci}),_n=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:ii.optional(),extensions:K(l(),Ee).optional()}),li=Ce.extend({protocolVersion:l(),capabilities:_n,serverInfo:Br,instructions:l().optional()}),di=Je.extend({method:O("notifications/initialized"),params:He.optional()}),pi=Te.extend({method:O("server/discover"),params:De.optional()}),mi=Ce.extend({supportedVersions:I(l()),capabilities:_n,instructions:l().optional()}),Sn=Te.extend({method:O("ping"),params:De.optional()}),fi=P({progress:L(),total:X(L()),message:X(l())}),hi=P({...He.shape,...fi.shape,progressToken:cn}),yn=Je.extend({method:O("notifications/progress"),params:hi}),gi=De.extend({cursor:un.optional()}),Jt=Te.extend({params:gi.optional()}),Bt=Ce.extend({nextCursor:un.optional()}),vn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),bn=vn.extend({text:l()}),Wu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),zn=vn.extend({blob:Wu}),Kt=se(["user","assistant"]),Ct=P({audience:I(Kt).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),Rn=P({...Pt.shape,...Ht.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Ct.optional(),_meta:X(re({}))}),_i=P({...Pt.shape,...Ht.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Ct.optional(),_meta:X(re({}))}),Si=Jt.extend({method:O("resources/list")}),yi=Bt.extend({resources:I(Rn)}),vi=Jt.extend({method:O("resources/templates/list")}),bi=Bt.extend({resourceTemplates:I(_i)}),Kr=De.extend({uri:l()}),zi=Kr,Ri=Te.extend({method:O("resources/read"),params:zi}),$i=Ce.extend({contents:I(W([bn,zn]))}),wi=Je.extend({method:O("notifications/resources/list_changed"),params:He.optional()}),Pi=Kr,Ei=Te.extend({method:O("resources/subscribe"),params:Pi}),Ti=Kr,Ci=Te.extend({method:O("resources/unsubscribe"),params:Ti}),$n=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),ki=De.extend({notifications:$n}),Ii=Te.extend({method:O("subscriptions/listen"),params:ki}),Oi=He.extend({notifications:$n}),Ni=Je.extend({method:O("notifications/subscriptions/acknowledged"),params:Oi}),xi=dn.extend({[an]:Ft}),ji=Ce.extend({_meta:xi}),Ai=He.extend({uri:l()}),qi=Je.extend({method:O("notifications/resources/updated"),params:Ai}),Mi=P({name:l(),description:X(l()),required:X(H())}),Li=P({...Pt.shape,...Ht.shape,description:X(l()),arguments:X(I(Mi)),_meta:X(re({}))}),Di=Jt.extend({method:O("prompts/list")}),Zi=Bt.extend({prompts:I(Li)}),Ui=De.extend({name:l(),arguments:K(l(),l()).optional()}),Vi=Te.extend({method:O("prompts/get"),params:Ui}),Gr=P({type:O("text"),text:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Wr=P({type:O("image"),data:Wu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Yr=P({type:O("audio"),data:Wu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Fi=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Hi=P({type:O("resource"),resource:W([bn,zn]),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Ji=Rn.extend({type:O("resource_link")}),Xr=W([Gr,Wr,Yr,Ji,Hi]),Bi=P({role:Kt,content:Xr}),Ki=Ce.extend({description:l().optional(),messages:I(Bi)}),Gi=Je.extend({method:O("notifications/prompts/list_changed"),params:He.optional()}),Wi=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Yi=P({taskSupport:se(["required","optional","forbidden"]).optional()}),wn=P({...Pt.shape,...Ht.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Ut).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:re({$schema:l().optional()}).optional(),annotations:Wi.optional(),execution:Yi.optional(),_meta:K(l(),Q()).optional()}),Xi=Jt.extend({method:O("tools/list")}),Qi=Bt.extend({tools:I(wn)}),Pn=Ce.extend({content:I(Xr).default([]),structuredContent:Q().optional(),isError:H().optional()}),Yu=Pn.or(Ce.extend({toolResult:Q()})),ea=gr.extend({name:l(),arguments:K(l(),Q()).optional()}),ta=Te.extend({method:O("tools/call"),params:ea}),ra=Je.extend({method:O("notifications/tools/list_changed"),params:He.optional()}),Xu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Gt=se(["debug","info","notice","warning","error","critical","alert","emergency"]),oa=De.extend({level:Gt}),na=Te.extend({method:O("logging/setLevel"),params:oa}),sa=He.extend({level:Gt,logger:l().optional(),data:Q()}),ia=Je.extend({method:O("notifications/message"),params:sa}),aa=P({name:l().optional()}),ca=P({hints:I(aa).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ua=P({mode:se(["auto","required","none"]).optional()}),la=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()}),da=Zt("type",[Gr,Wr,Yr]),pr=Zt("type",[Gr,Wr,Yr,Fi,la]),pa=P({role:Kt,content:W([pr,I(pr)]),_meta:K(l(),Q()).optional()}),ma=gr.extend({messages:I(pa),modelPreferences:ca.optional(),systemPrompt:l().optional(),includeContext:se(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(wn).optional(),toolChoice:ua.optional()}),fa=Te.extend({method:O("sampling/createMessage"),params:ma}),ha=Ce.extend({model:l(),stopReason:X(se(["endTurn","stopSequence","maxTokens"]).or(l())),role:Kt,content:da}),ga=Ce.extend({model:l(),stopReason:X(se(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Kt,content:W([pr,I(pr)])}),En=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:se(["email","uri","date","date-time"]).optional(),default:l().optional()}),eo=P({type:se(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Tn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Cn=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),kn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),_a=W([Tn,Cn]),In=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()}),On=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()}),Sa=W([In,On]),ya=W([kn,_a,Sa]),Nn=W([ya,En,Qr,eo]),to=gr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Nn),required:I(l()).optional()}).catchall(Q())}),va=gr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ba=W([to,va]),za=Te.extend({method:O("elicitation/create"),params:ba}),Ra=He.extend({elicitationId:l()}),$a=Je.extend({method:O("notifications/elicitation/complete"),params:Ra}),wa=Ce.extend({action:se(["accept","decline","cancel"]),content:dr(e=>e===null?void 0:e,K(l(),W([l(),L(),H(),I(l())])).optional())}),Pa=P({type:O("ref/resource"),uri:l()}),Ea=P({type:O("ref/prompt"),name:l()}),Ta=De.extend({ref:W([Ea,Pa]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Ca=Te.extend({method:O("completion/complete"),params:Ta}),ka=Ce.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),Ia=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Oa=Te.extend({method:O("roots/list"),params:De.optional()}),Na=Ce.extend({roots:I(Ia)}),xa=Je.extend({method:O("notifications/roots/list_changed"),params:He.optional()}),Qu=re({ttl:L().optional(),pollInterval:L().optional()}),ja=se(["working","input_required","completed","failed","cancelled"]),Wt=P({taskId:l(),status:ja,ttl:W([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),el=Ce.extend({task:Wt}),Aa=He.merge(Wt),tl=Je.extend({method:O("notifications/tasks/status"),params:Aa}),rl=Te.extend({method:O("tasks/get"),params:De.extend({taskId:l()})}),ol=Ce.merge(Wt),nl=Te.extend({method:O("tasks/result"),params:De.extend({taskId:l()})}),sl=Ce.loose(),il=Jt.extend({method:O("tasks/list")}),al=Bt.extend({tasks:I(Wt)}),cl=Te.extend({method:O("tasks/cancel"),params:De.extend({taskId:l()})}),ul=Ce.merge(Wt),ll=W([Sn,ui,pi,Ca,na,Vi,Di,Si,vi,Ri,Ei,Ci,Ii,ta,Xi]),dl=W([gn,yn,di,xa]),pl=W([hn,ha,ga,wa,Na]),ml=W([Sn,fa,za,Oa]),fl=W([gn,yn,ia,qi,wi,ra,Gi,Ni,$a]),hl=W([hn,li,mi,ka,Ki,Zi,yi,bi,$i,Pn,Qi,ji]),Le=Ws().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:fg.custom,message:"URL must be parseable",fatal:!0}),Cc}).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"}),gl=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()}),qa=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()}),Ma=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)}),_l=P({...Ma.shape,...qa.pick({code_challenge_methods_supported:!0}).shape}),Sl=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Xs.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),yl=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(),vl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Bu=Le.optional().or(O("").transform(()=>{})),La=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:Bu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Bu,policy_uri:l().optional(),jwks_uri:Le.optional(),jwks:ng().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Da=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(),bl=La.merge(Da),zl=P({error:l(),error_description:l().optional()}).strip(),Rl=P({token:l(),token_type_hint:l().optional()}).strip();var El=Symbol.for("mcp.sdk.errorBrands");function Il(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,El,{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,El)){let r=t[El];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Ag=class qg 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",Il(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 qg(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",Il(this,new.target)}},sb=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 $g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ib(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Mg(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 Ka(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($g(n)&&$g(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!ib(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var ab="2026-07-28";function Ln(e){return e>=ab}function Lg(e){return e.filter(t=>!Ln(t))}function Ol(e){return e.filter(t=>Ln(t))}function Dg(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 Zg=["task","inputRequests","requestState"];function Nl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Zg.some(t=>t in e)?e:{...e,content:[]}}function cb(){let e=sn(()=>W([l(),L(),H(),lr(),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()}),p=P({method:l(),params:d.loose().optional()}),g=re({_meta:i.optional()}),v=W([l(),L().int()]),m=g.strict(),_=d.extend({requestId:v.optional(),reason:l().optional()}),h=p.extend({method:O("notifications/cancelled"),params:_}),f=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:se(["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=$t(P({applyDefaults:H().optional()}),t),b=dr(Fe=>Fe&&typeof Fe=="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0?{form:{}}:Fe,$t(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()}),x=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:x,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=p.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=p.extend({method:O("notifications/progress"),params:be}),he=c.extend({cursor:o.optional()}),k=u.extend({params:he.optional()}),j=g.extend({nextCursor:o.optional()}),V=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=V.extend({text:l()}),C=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=V.extend({blob:C}),J=se(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.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({}))}),ae=P({...y.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(re({}))}),ze=k.extend({method:O("resources/list")}),Be=j.extend({resources:I(pe)}),T=k.extend({method:O("resources/templates/list")}),A=j.extend({resourceTemplates:I(ae)}),D=c.extend({uri:l()}),ne=D,ie=u.extend({method:O("resources/read"),params:ne}),de=g.extend({contents:I(W([$,N]))}),ke=p.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),xe=D,Ue=u.extend({method:O("resources/subscribe"),params:xe}),Ne=D,we=u.extend({method:O("resources/unsubscribe"),params:Ne}),ot=d.extend({uri:l()}),Ae=p.extend({method:O("notifications/resources/updated"),params:ot}),ht=P({name:l(),description:X(l()),required:X(H())}),at=P({...y.shape,...z.shape,description:X(l()),arguments:X(I(ht)),_meta:X(re({}))}),gt=k.extend({method:O("prompts/list")}),It=j.extend({prompts:I(at)}),Ot=c.extend({name:l(),arguments:K(l(),l()).optional()}),Xt=u.extend({method:O("prompts/get"),params:Ot}),Qt=P({type:O("text"),text:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),er=P({type:O("image"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),tr=P({type:O("audio"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),uo=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Nt=P({type:O("resource"),resource:W([$,N]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),lo=pe.extend({type:O("resource_link")}),nt=W([Qt,er,tr,lo,Nt]),yr=P({role:J,content:nt}),vr=g.extend({description:l().optional(),messages:I(yr)}),rr=p.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),po=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),br=P({taskSupport:se(["required","optional","forbidden"]).optional()}),or=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:po.optional(),execution:br.optional(),_meta:K(l(),Q()).optional()}),zr=k.extend({method:O("tools/list")}),Rr=j.extend({tools:I(or)}),$r=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ve=a.extend({name:l(),arguments:K(l(),Q()).optional()}),mo=u.extend({method:O("tools/call"),params:Ve}),Kn=p.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),wr=se(["debug","info","notice","warning","error","critical","alert","emergency"]),fo=c.extend({level:wr}),ho=u.extend({method:O("logging/setLevel"),params:fo}),go=d.extend({level:wr,logger:l().optional(),data:Q()}),_o=p.extend({method:O("notifications/message"),params:go}),So=P({name:l().optional()}),yo=P({hints:I(So).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),vo=P({mode:se(["auto","required","none"]).optional()}),Gn=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()}),bo=Zt("type",[Qt,er,tr]),xt=Zt("type",[Qt,er,tr,uo,Gn]),zo=P({role:J,content:W([xt,I(xt)]),_meta:K(l(),Q()).optional()}),Ro=a.extend({messages:I(zo),modelPreferences:yo.optional(),systemPrompt:l().optional(),includeContext:se(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(or).optional(),toolChoice:vo.optional()}),$o=u.extend({method:O("sampling/createMessage"),params:Ro}),wo=g.extend({model:l(),stopReason:X(se(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:bo}),Po=g.extend({model:l(),stopReason:X(se(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:W([xt,I(xt)])}),Eo=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),To=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:se(["email","uri","date","date-time"]).optional(),default:l().optional()}),Co=P({type:se(["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()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Oo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),No=W([ko,Io]),nr=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()}),sr=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()}),Wn=W([nr,sr]),Yn=W([Oo,No,Wn]),et=W([Yn,Eo,To,Co]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),xo=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ct=W([tt,xo]),Xn=u.extend({method:O("elicitation/create"),params:ct}),Qn=d.extend({elicitationId:l()}),es=p.extend({method:O("notifications/elicitation/complete"),params:Qn}),ts=g.extend({action:se(["accept","decline","cancel"]),content:dr(Fe=>Fe===null?void 0:Fe,K(l(),W([l(),L(),H(),I(l())])).optional())}),rs=P({type:O("ref/resource"),uri:l()}),os=P({type:O("ref/prompt"),name:l()}),ns=c.extend({ref:W([os,rs]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),jo=u.extend({method:O("completion/complete"),params:ns}),ss=g.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),is=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Pr=u.extend({method:O("roots/list"),params:c.optional()}),Ao=g.extend({roots:I(is)}),as=p.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),cs=re({ttl:L().optional(),pollInterval:L().optional()}),qo=se(["working","input_required","completed","failed","cancelled"]),jt=P({taskId:l(),status:qo,ttl:W([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:jt}),us=d.merge(jt),ir=p.extend({method:O("notifications/tasks/status"),params:us}),Er=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Tr=g.merge(jt),Cr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),lc=g.loose(),Ke=k.extend({method:O("tasks/list")}),Ie=j.extend({tasks:I(jt)}),ar=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:p,ResultSchema:g,RequestIdSchema:v,EmptyResultSchema:m,CancelledNotificationParamsSchema:_,CancelledNotificationSchema:h,IconSchema:f,IconsSchema:z,BaseMetadataSchema:y,ImplementationSchema:R,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:x,InitializeRequestParamsSchema:F,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:Y,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:k,PaginatedResultSchema:j,ResourceContentsSchema:V,TextResourceContentsSchema:$,BlobResourceContentsSchema:N,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ae,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Be,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:ie,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:ke,SubscribeRequestParamsSchema:xe,SubscribeRequestSchema:Ue,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:we,ResourceUpdatedNotificationParamsSchema:ot,ResourceUpdatedNotificationSchema:Ae,PromptArgumentSchema:ht,PromptSchema:at,ListPromptsRequestSchema:gt,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Xt,TextContentSchema:Qt,ImageContentSchema:er,AudioContentSchema:tr,ToolUseContentSchema:uo,EmbeddedResourceSchema:Nt,ResourceLinkSchema:lo,ContentBlockSchema:nt,PromptMessageSchema:yr,GetPromptResultSchema:vr,PromptListChangedNotificationSchema:rr,ToolAnnotationsSchema:po,ToolExecutionSchema:br,ToolSchema:or,ListToolsRequestSchema:zr,ListToolsResultSchema:Rr,CallToolResultSchema:$r,CallToolRequestParamsSchema:Ve,CallToolRequestSchema:mo,ToolListChangedNotificationSchema:Kn,LoggingLevelSchema:wr,SetLevelRequestParamsSchema:fo,SetLevelRequestSchema:ho,LoggingMessageNotificationParamsSchema:go,LoggingMessageNotificationSchema:_o,ModelHintSchema:So,ModelPreferencesSchema:yo,ToolChoiceSchema:vo,ToolResultContentSchema:Gn,SamplingContentSchema:bo,SamplingMessageContentBlockSchema:xt,SamplingMessageSchema:zo,CreateMessageRequestParamsSchema:Ro,CreateMessageRequestSchema:$o,CreateMessageResultSchema:wo,CreateMessageResultWithToolsSchema:Po,BooleanSchemaSchema:Eo,StringSchemaSchema:To,NumberSchemaSchema:Co,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:Io,LegacyTitledEnumSchemaSchema:Oo,SingleSelectEnumSchemaSchema:No,UntitledMultiSelectEnumSchemaSchema:nr,TitledMultiSelectEnumSchemaSchema:sr,MultiSelectEnumSchemaSchema:Wn,EnumSchemaSchema:Yn,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:xo,ElicitRequestParamsSchema:ct,ElicitRequestSchema:Xn,ElicitationCompleteNotificationParamsSchema:Qn,ElicitationCompleteNotificationSchema:es,ElicitResultSchema:ts,ResourceTemplateReferenceSchema:rs,PromptReferenceSchema:os,CompleteRequestParamsSchema:ns,CompleteRequestSchema:jo,CompleteResultSchema:ss,RootSchema:is,ListRootsRequestSchema:Pr,ListRootsResultSchema:Ao,RootsListChangedNotificationSchema:as,TaskCreationParamsSchema:cs,TaskStatusSchema:qo,TaskSchema:jt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:us,TaskStatusNotificationSchema:ir,GetTaskRequestSchema:Er,GetTaskResultSchema:Tr,GetTaskPayloadRequestSchema:Cr,GetTaskPayloadResultSchema:lc,ListTasksRequestSchema:Ke,ListTasksResultSchema:Ie,CancelTaskRequestSchema:ar,CancelTaskResultSchema:g.merge(jt),ClientRequestSchema:W([fe,M,jo,ho,Xt,gt,ze,T,ie,Ue,we,mo,zr,Er,Cr,Ke,ar]),ClientNotificationSchema:W([h,Oe,G,as,ir]),ClientResultSchema:W([m,wo,Po,ts,Ao,Tr,Ie,We]),ServerRequestSchema:W([fe,$o,Xn,Pr,Er,Cr,Ke,ar]),ServerNotificationSchema:W([h,Oe,_o,Ae,ke,Kn,rr,ir,es]),ServerResultSchema:W([m,Y,ss,vr,It,Be,A,de,$r,Rr,Tr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,RS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let Sd of Zg)if(Sd in Fe){RS.addIssue({code:"custom",message:`content is required when the body carries '${Sd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Nl).pipe($r)}}var ub;function Ug(){return ub??=cb()}function Vg(e){return e.type!=="object"}var lb=new Set(["const","enum","default","examples"]),db=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function wg(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function pb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(wg(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Fd(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&&wg(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:lb.has(a)?i[a]=u:db.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 Fg={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},Hg={"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},mb={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},Za;function xl(){if(Za)return Za;let e=Ug();return Za={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}},Za}function Jg(e){return Object.prototype.hasOwnProperty.call(Fg,e)}function Bg(e){return Object.prototype.hasOwnProperty.call(Hg,e)}function fb(e){return Object.prototype.hasOwnProperty.call(mb,e)}function hb(e){return fb(e)?xl().resultSchemas[e]:void 0}function gb(e){return Jg(e)?xl().requestSchemas[e]:void 0}function _b(e){return Bg(e)?xl().notificationSchemas[e]:void 0}var Xw=Object.keys(Fg),Qw=Object.keys(Hg);function Tl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ua(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 Pg={ok:!1,reason:"not-in-era"};function Eg(e){return Tl(e)&&Tl(e.outputSchema)&&Vg(e.outputSchema)}var jl={era:"2025-11-25",hasRequestMethod:Jg,hasNotificationMethod:Bg,validateRequest:(e,t)=>Ua(gb(e),t),validateResult:(e,t)=>Ua(hb(e),t),validateNotification:(e,t)=>Ua(_b(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Pg,validateInputResponse:()=>Pg,samplingResultVariant:((e,t)=>{let r=Ug();return Ua(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=Dg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&Vg(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Tl(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=>Eg(o))?t:{...t,tools:r.map(o=>Eg(o)?{...o,outputSchema:pb(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Sb(){let e=sn(()=>W([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=W([l(),L().int()]),s=se(["user","assistant"]),i=se(["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()}),p=P({_meta:d.optional()}),g=p.extend({task:a.optional()}),v=P({_meta:d.optional()}),m=P({method:l(),params:v.loose().optional()}),_=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:se(["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=$t(P({applyDefaults:H().optional()}),t),R=dr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,$t(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()}),x=P({progress:L(),total:X(L()),message:X(l())}),F=P({...v.shape,...x.shape,progressToken:r}),M=m.extend({method:O("notifications/progress"),params:F}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),Y=m.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:wt.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({}))}),k=m.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),j=v.extend({uri:l()}),V=m.extend({method:O("notifications/resources/updated"),params:j}),$=P({name:l(),description:X(l()),required:X(H())}),C=P({...f.shape,...h.shape,description:X(l()),arguments:X(I($)),_meta:X(re({}))}),N=m.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()}),ae=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=m.extend({method:O("notifications/tools/list_changed"),params:v.optional()}),ie=P({name:l().optional()}),de=P({hints:I(ie).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ke=P({mode:se(["auto","required","none"]).optional()}),xe=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:se(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:se(["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()}),ht=W([we,ot]),at=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()}),gt=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()}),It=W([at,gt]),Ot=W([Ae,ht,It]),Xt=W([Ot,xe,Ue,Ne]),Qt=g.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Xt),required:I(l()).optional()}).catchall(Q())}),er=P({type:O("ref/resource"),uri:l()}),tr=P({type:O("ref/prompt"),name:l()}),uo=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Nt=S.shape,lo=P({experimental:Nt.experimental,sampling:Nt.sampling,elicitation:Nt.elicitation,roots:Nt.roots,extensions:Nt.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(),[fr]:l(),[Fr]:z.optional(),[Tt]:lo,[Vt]:i.optional()}),rr=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()}),po=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,ae,po]),or=P({role:s,content:W([br,I(br)]),_meta:K(l(),Q()).optional()}),zr=l(),Rr=re({[Et]:z.optional().catch(void 0)}),$r=Rr.optional();function Ve(Ie){return re({_meta:$r,resultType:zr.default("complete"),...Ie})}let mo=Ve({}),Kn=Ve({nextCursor:o.optional()}),wr=Ve({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),fo=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),tools:I(rr),nextCursor:o.optional()}),ho=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),prompts:I(C),nextCursor:o.optional()}),go=Ve({description:l().optional(),messages:I(A)}),_o=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),So=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),yo=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),contents:I(W([fe,$e]))}),vo=Ve({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Gn=Ve({ttlMs:L().int().min(0),cacheScope:se(["public","private"])}),bo=Ve({ttlMs:L().int().min(0).catch(0),cacheScope:se(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),xt=P({messages:I(or),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:se(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(rr).optional(),toolChoice:ke.optional()}),zo=P({method:O("sampling/createMessage"),params:xt}),Ro=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),$o=P({...or.shape,model:l(),stopReason:l().optional()}),wo=P({roots:I(uo)}),Po=P({action:se(["accept","decline","cancel"]),content:K(l(),W([l(),L(),H(),I(l())])).optional()}),Eo=P({mode:O("url"),message:l(),url:l().url()}),To=W([Qt,Eo]),Co=P({method:O("elicitation/create"),params:To}),ko=W([zo,Ro,Co]),Io=W([$o,wo,Po]),Oo=K(l(),ko),No=K(l(),Io),nr=Ve({inputRequests:Oo.optional(),requestState:l().optional()}),sr={inputResponses:No.optional(),requestState:l().optional()},Wn=P({_meta:vr,...sr}),Yn=re({progressToken:r.optional()});function et(Ie,ar){return P({method:O(Ie),params:P({_meta:vr,...ar})})}function tt(Ie,ar){return P({method:O(Ie),params:P({_meta:Yn.optional(),...ar}).optional()})}let xo={name:l(),arguments:K(l(),Q()).optional(),...sr},ct={cursor:o.optional()},Xn=et("tools/call",xo),Qn=et("tools/list",ct),es=et("prompts/list",ct),ts=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...sr}),rs=et("resources/list",ct),os=et("resources/templates/list",ct),ns=et("resources/read",{uri:l(),...sr}),jo={ref:W([tr,er]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},ss=et("completion/complete",jo),is=et("server/discover",{}),Pr=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ao={notifications:Pr},as=et("subscriptions/listen",Ao),cs=Rr.extend({"io.modelcontextprotocol/subscriptionId":n}),qo=re({_meta:cs,resultType:zr.default("complete")}),jt={"tools/call":tt("tools/call",xo),"tools/list":tt("tools/list",ct),"prompts/get":tt("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":tt("prompts/list",ct),"resources/list":tt("resources/list",ct),"resources/templates/list":tt("resources/templates/list",ct),"resources/read":tt("resources/read",{uri:l()}),"completion/complete":tt("completion/complete",jo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",Ao)};function We(Ie){return re({_meta:$r,...Ie})}let us={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),tools:I(rr),nextCursor:o.optional()}),"prompts/get":We({description:l().optional(),messages:I(A)}),"prompts/list":We({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),prompts:I(C),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:se(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:se(["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:se(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:yr,instructions:l().optional()}),"subscriptions/listen":We({})},ir=re({"io.modelcontextprotocol/subscriptionId":n.optional()}),Er=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:ir.optional(),notifications:Pr})}),Tr=P({_meta:ir.optional(),requestId:n,reason:l().optional()}),Cr=P({method:O("notifications/cancelled"),params:Tr}),lc={"notifications/cancelled":Cr,"notifications/progress":M,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":k,"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:p,TaskAugmentedRequestParamsSchema:g,NotificationsParamsSchema:v,NotificationSchema:m,IconSchema:_,IconsSchema:h,BaseMetadataSchema:f,ImplementationSchema:z,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:b,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:x,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:k,ResourceUpdatedNotificationParamsSchema:j,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:$,PromptSchema:C,PromptListChangedNotificationSchema:N,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ae,EmbeddedResourceSchema:ze,ResourceLinkSchema:Be,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:ne,ModelHintSchema:ie,ModelPreferencesSchema:de,ToolChoiceSchema:ke,BooleanSchemaSchema:xe,StringSchemaSchema:Ue,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:we,TitledSingleSelectEnumSchemaSchema:ot,LegacyTitledEnumSchemaSchema:Ae,SingleSelectEnumSchemaSchema:ht,UntitledMultiSelectEnumSchemaSchema:at,TitledMultiSelectEnumSchemaSchema:gt,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Xt,ElicitRequestFormParamsSchema:Qt,ResourceTemplateReferenceSchema:er,PromptReferenceSchema:tr,RootSchema:uo,ClientCapabilities2026Schema:lo,ServerCapabilities2026Schema:yr,RequestMetaEnvelopeSchema:vr,ToolSchema:rr,ToolResultContentSchema:po,SamplingMessageContentBlockSchema:br,SamplingMessageSchema:or,ResultTypeSchema:zr,ResultMetaSchema:Rr,ResultSchema:mo,PaginatedResultSchema:Kn,CallToolResultSchema:wr,ListToolsResultSchema:fo,ListPromptsResultSchema:ho,GetPromptResultSchema:go,ListResourcesResultSchema:_o,ListResourceTemplatesResultSchema:So,ReadResourceResultSchema:yo,CompleteResultSchema:vo,CacheableResultSchema:Gn,DiscoverResultSchema:bo,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:zo,ListRootsRequestSchema:Ro,CreateMessageResultSchema:$o,ListRootsResultSchema:wo,ElicitResultSchema:Po,ElicitRequestURLParamsSchema:Eo,ElicitRequestParamsSchema:To,ElicitRequestSchema:Co,InputRequestSchema:ko,InputResponseSchema:Io,InputRequestsSchema:Oo,InputResponsesSchema:No,InputRequiredResultSchema:nr,InputResponseRequestParamsSchema:Wn,CallToolRequestSchema:Xn,ListToolsRequestSchema:Qn,ListPromptsRequestSchema:es,GetPromptRequestSchema:ts,ListResourcesRequestSchema:rs,ListResourceTemplatesRequestSchema:os,ReadResourceRequestSchema:ns,CompleteRequestSchema:ss,DiscoverRequestSchema:is,SubscriptionFilterSchema:Pr,SubscriptionsListenRequestSchema:as,SubscriptionsListenResultMetaSchema:cs,SubscriptionsListenResultSchema:qo,dispatchRequestSchemas:jt,dispatchResultSchemas:us,NotificationMetaSchema:ir,SubscriptionsAcknowledgedNotificationSchema:Er,CancelledNotificationParamsSchema:Tr,CancelledNotificationSchema:Cr,notificationSchemas2026:lc,JSONRPCResultResponseSchema:Ke(mo),CallToolResultResponseSchema:Ke(W([wr,nr])),ListToolsResultResponseSchema:Ke(fo),ListPromptsResultResponseSchema:Ke(ho),GetPromptResultResponseSchema:Ke(W([go,nr])),ListResourcesResultResponseSchema:Ke(_o),ListResourceTemplatesResultResponseSchema:Ke(So),ReadResourceResultResponseSchema:Ke(W([yo,nr])),CompleteResultResponseSchema:Ke(vo),DiscoverResultResponseSchema:Ke(bo),SubscriptionsListenResultResponseSchema:Ke(qo)}}var yb;function Yt(){return yb??=Sb()}var vb=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function bb(e){return vb.includes(e)}var ro=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ga(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 zb(e){return e[ro]}function Al(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function ql(e){return e==="public"||e==="private"}function Ml(e,t){if(e.ttlMs!==void 0&&!Al(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&&!ql(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 Kg 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",Il(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Gg(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Ll({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 Wa(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 Ya({requiredCapabilities:n.requiredCapabilities},r)}return new Kg(t,r,o)}},Wa=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}},Gg=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??[]}},Ll=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}},Ya=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}},Rb=0,$b="private",wb=["tools/call","prompts/get","resources/read"];function Pb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||wb.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 Eb(e,t){let r=zb(t);if(t.resultType!=="complete"||!bb(e))return r===void 0?t:Ob(t);let o=t,n=Al(o.ttlMs)?o.ttlMs:kb(r),s=ql(o.cacheScope)?o.cacheScope:Ib(r),i={...o,ttlMs:n,cacheScope:s};return delete i[ro],i}function Tb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cb(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Et]:t}}:!Tb(r)||r[Et]!==void 0?e:{...e,_meta:{...r,[Et]:t}}}function kb(e){return e!==void 0&&Al(e.ttlMs)?e.ttlMs:Rb}function Ib(e){return e!==void 0&&ql(e.cacheScope)?e.cacheScope:$b}function Ob(e){let t={...e};return delete t[ro],t}var Nb=["elicitation/create","sampling/createMessage","roots/list"],Va;function Wg(){if(Va)return Va;let e=Yt();return Va={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}},Va}function Yg(e){return Nb.includes(e)}function $l(e){return Yg(e)?Wg().request[e]:void 0}function xb(e){return Yg(e)?Wg().response[e]:void 0}var Dl={"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},Xg={"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 Qg(e){return Object.prototype.hasOwnProperty.call(Dl,e)}function e_(e){return Object.prototype.hasOwnProperty.call(Xg,e)}function jb(e){return Object.prototype.hasOwnProperty.call(Dl,e)}function Ab(e){return Qg(e)?Yt().dispatchRequestSchemas[e]:void 0}function qb(e){return jb(e)?Yt().dispatchResultSchemas[e]:void 0}function Mb(e){return e_(e)?Yt().notificationSchemas2026[e]:void 0}var eP=Object.keys(Dl),tP=Object.keys(Xg);function An(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xn(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 Lb={ok:!1,reason:"not-in-era"},Db=[fr,Tt];function Zb(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=>An(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!An(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(An(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Zl={era:"2026-07-28",hasRequestMethod:Qg,hasNotificationMethod:e_,hasInputRequestMethod:e=>$l(e)!==void 0,validateRequest:(e,t)=>xn(Ab(e),t),validateResult:(e,t)=>xn(qb(e),t),validateNotification:(e,t)=>xn(Mb(e),t),validateInputRequest:(e,t)=>xn($l(e),t),validateInputResponse:(e,t)=>xn(xb(e),t),samplingResultVariant:()=>Lb,outboundEnvelope(e){return{[fr]:e.protocolVersion,[Fr]:e.clientInfo,[Tt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Vt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of Db)o in e||t.push({key:o,problem:"missing"});let r=Yt().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=>Dg(e),inputRequestSchema:$l,decodeResult(e,t){if(!An(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=An(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Yt().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=Ub(),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 Cb(Eb(e,Pb(e,Zb(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=Yt().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("; ")}`}},Fa;function Ub(){if(Fa)return Fa;let e=Yt();return Fa={"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},Fa}var Ul="2026-07-28";function no(e){return e!==void 0&&Ln(e)?Zl:jl}function Tg(e){return e.revision!==void 0?no(e.revision).era:e.era==="modern"?Zl.era:jl.era}function wl(e){return t_.some(t=>t.hasRequestMethod(e))}function Pl(e){return t_.some(t=>t.hasNotificationMethod(e))}function Cg(e){return e==="tasks/get"||e==="tasks/cancel"}var t_=[jl,Zl];var Vb=Ud({AnnotationsSchema:()=>Ct,AudioContentSchema:()=>Yr,BaseMetadataSchema:()=>Pt,BaseRequestParamsSchema:()=>De,BlobResourceContentsSchema:()=>zn,BooleanSchemaSchema:()=>En,CallToolRequestParamsSchema:()=>ea,CallToolRequestSchema:()=>ta,CallToolResultSchema:()=>Pn,CancelTaskRequestSchema:()=>cl,CancelTaskResultSchema:()=>ul,CancelledNotificationParamsSchema:()=>oi,CancelledNotificationSchema:()=>gn,ClientCapabilitiesSchema:()=>ai,ClientNotificationSchema:()=>dl,ClientRequestSchema:()=>ll,ClientResultSchema:()=>pl,ClientTasksCapabilitySchema:()=>si,CompatibilityCallToolResultSchema:()=>Yu,CompleteRequestParamsSchema:()=>Ta,CompleteRequestSchema:()=>Ca,CompleteResultSchema:()=>ka,ContentBlockSchema:()=>Xr,CreateMessageRequestParamsSchema:()=>ma,CreateMessageRequestSchema:()=>fa,CreateMessageResultSchema:()=>ha,CreateMessageResultWithToolsSchema:()=>ga,CreateTaskResultSchema:()=>el,CursorSchema:()=>un,DiscoverRequestSchema:()=>pi,DiscoverResultSchema:()=>mi,ElicitRequestFormParamsSchema:()=>to,ElicitRequestParamsSchema:()=>ba,ElicitRequestSchema:()=>za,ElicitRequestURLParamsSchema:()=>va,ElicitResultSchema:()=>wa,ElicitationCompleteNotificationParamsSchema:()=>Ra,ElicitationCompleteNotificationSchema:()=>$a,EmbeddedResourceSchema:()=>Hi,EmptyResultSchema:()=>hn,EnumSchemaSchema:()=>ya,GetPromptRequestParamsSchema:()=>Ui,GetPromptRequestSchema:()=>Vi,GetPromptResultSchema:()=>Ki,GetTaskPayloadRequestSchema:()=>nl,GetTaskPayloadResultSchema:()=>sl,GetTaskRequestSchema:()=>rl,GetTaskResultSchema:()=>ol,IconSchema:()=>ni,IconsSchema:()=>Ht,ImageContentSchema:()=>Wr,ImplementationSchema:()=>Br,InitializeRequestParamsSchema:()=>ci,InitializeRequestSchema:()=>ui,InitializeResultSchema:()=>li,InitializedNotificationSchema:()=>di,JSONArraySchema:()=>Ku,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Jr,JSONRPCMessageSchema:()=>fn,JSONRPCNotificationSchema:()=>mn,JSONRPCRequestSchema:()=>pn,JSONRPCResponseSchema:()=>Gu,JSONRPCResultResponseSchema:()=>Hr,JSONValueSchema:()=>Ut,LegacyTitledEnumSchemaSchema:()=>kn,ListChangedOptionsBaseSchema:()=>Xu,ListPromptsRequestSchema:()=>Di,ListPromptsResultSchema:()=>Zi,ListResourceTemplatesRequestSchema:()=>vi,ListResourceTemplatesResultSchema:()=>bi,ListResourcesRequestSchema:()=>Si,ListResourcesResultSchema:()=>yi,ListRootsRequestSchema:()=>Oa,ListRootsResultSchema:()=>Na,ListTasksRequestSchema:()=>il,ListTasksResultSchema:()=>al,ListToolsRequestSchema:()=>Xi,ListToolsResultSchema:()=>Qi,LoggingLevelSchema:()=>Gt,LoggingMessageNotificationParamsSchema:()=>sa,LoggingMessageNotificationSchema:()=>ia,ModelHintSchema:()=>aa,ModelPreferencesSchema:()=>ca,MultiSelectEnumSchemaSchema:()=>Sa,NotificationSchema:()=>Je,NotificationsParamsSchema:()=>He,NumberSchemaSchema:()=>eo,PaginatedRequestParamsSchema:()=>gi,PaginatedRequestSchema:()=>Jt,PaginatedResultSchema:()=>Bt,PingRequestSchema:()=>Sn,PrimitiveSchemaDefinitionSchema:()=>Nn,ProgressNotificationParamsSchema:()=>hi,ProgressNotificationSchema:()=>yn,ProgressSchema:()=>fi,ProgressTokenSchema:()=>cn,PromptArgumentSchema:()=>Mi,PromptListChangedNotificationSchema:()=>Gi,PromptMessageSchema:()=>Bi,PromptReferenceSchema:()=>Ea,PromptSchema:()=>Li,ReadResourceRequestParamsSchema:()=>zi,ReadResourceRequestSchema:()=>Ri,ReadResourceResultSchema:()=>$i,RelatedTaskMetadataSchema:()=>ri,RequestIdSchema:()=>Ft,RequestMetaSchema:()=>ln,RequestSchema:()=>Te,ResourceContentsSchema:()=>vn,ResourceLinkSchema:()=>Ji,ResourceListChangedNotificationSchema:()=>wi,ResourceRequestParamsSchema:()=>Kr,ResourceSchema:()=>Rn,ResourceTemplateReferenceSchema:()=>Pa,ResourceTemplateSchema:()=>_i,ResourceUpdatedNotificationParamsSchema:()=>Ai,ResourceUpdatedNotificationSchema:()=>qi,ResultMetaObjectSchema:()=>dn,ResultSchema:()=>Ce,RoleSchema:()=>Kt,RootSchema:()=>Ia,RootsListChangedNotificationSchema:()=>xa,SamplingContentSchema:()=>da,SamplingMessageContentBlockSchema:()=>pr,SamplingMessageSchema:()=>pa,ServerCapabilitiesSchema:()=>_n,ServerNotificationSchema:()=>fl,ServerRequestSchema:()=>ml,ServerResultSchema:()=>hl,ServerTasksCapabilitySchema:()=>ii,SetLevelRequestParamsSchema:()=>oa,SetLevelRequestSchema:()=>na,SingleSelectEnumSchemaSchema:()=>_a,StringSchemaSchema:()=>Qr,SubscribeRequestParamsSchema:()=>Pi,SubscribeRequestSchema:()=>Ei,SubscriptionFilterSchema:()=>$n,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Oi,SubscriptionsAcknowledgedNotificationSchema:()=>Ni,SubscriptionsListenRequestParamsSchema:()=>ki,SubscriptionsListenRequestSchema:()=>Ii,SubscriptionsListenResultMetaSchema:()=>xi,SubscriptionsListenResultSchema:()=>ji,TaskAugmentedRequestParamsSchema:()=>gr,TaskCreationParamsSchema:()=>Qu,TaskMetadataSchema:()=>ti,TaskSchema:()=>Wt,TaskStatusNotificationParamsSchema:()=>Aa,TaskStatusNotificationSchema:()=>tl,TaskStatusSchema:()=>ja,TextContentSchema:()=>Gr,TextResourceContentsSchema:()=>bn,TitledMultiSelectEnumSchemaSchema:()=>On,TitledSingleSelectEnumSchemaSchema:()=>Cn,ToolAnnotationsSchema:()=>Wi,ToolChoiceSchema:()=>ua,ToolExecutionSchema:()=>Yi,ToolListChangedNotificationSchema:()=>ra,ToolResultContentSchema:()=>la,ToolSchema:()=>wn,ToolUseContentSchema:()=>Fi,UnsubscribeRequestParamsSchema:()=>Ti,UnsubscribeRequestSchema:()=>Ci,UntitledMultiSelectEnumSchemaSchema:()=>In,UntitledSingleSelectEnumSchemaSchema:()=>Tn});var Vl=e=>pn.safeParse(e).success,Fl=e=>mn.safeParse(e).success,Ba=e=>Hr.safeParse(e).success,Hl=e=>Jr.safeParse(e).success;var kt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Jl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Bl(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var kg="x-mcp-header",Fb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Hb=new Set(["string","integer","boolean","number"]);function Kl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(kg in a){if(!c||i.length===0)return`${Ha(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[kg];if(typeof d!="string"||d.length===0)return`${Ha(i)}: x-mcp-header MUST be a non-empty string`;if(!Fb.test(d))return`${Ha(i)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let p=typeof a.type=="string"?a.type:void 0;if(p===void 0||!Hb.has(p))return`${Ha(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${p??"<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:p})}let u=a.properties;if(u!==null&&typeof u=="object")for(let[d,p]of Object.entries(u)){let g=o(p,[...i,d],c);if(g!==void 0)return g}for(let d of Jb){let p=a[d];if(p===void 0)continue;let g=Array.isArray(p)?p:p!==null&&typeof p=="object"&&Bb.has(d)?Object.values(p):[p];for(let v of g){let m=o(v,[...i,`<${d}>`],!1);if(m!==void 0)return m}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var Jb=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Bb=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Ha(e){return e.length===0?"<root>":e.join(".")}var Ja=-32020,rP=[{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:[Ja,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:[Ja],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:[Ja],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."}],Kb={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[Ja]:400};function Xa(e,t){return Bs(e,t)}function jn(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 Ig=!1,Cl="draft-2020-12";function Sr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Cl});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().");Ig||(Ig=!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=Hs(e,{target:Cl,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:r_(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 r_(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"||r_(o)))}return!1}function Gb(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function _r(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>Gb(o)).join(", ")}:{success:!0,data:r.value}}function Wb(e){let t=Hs(e,{target:Cl,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Yb=/\\\.\\d\{(\d+)\}/;function Xb(e){let t=Yb.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=>wt.datetime({local:o,offset:n,precision:s}))))}function Qb(e,t){let r;switch(e){case"email":r=[tg()];break;case"uri":r=[Ws()];break;case"date":r=[wt.date()];break;case"date-time":r=Xb(t);break}return new Set(r.map(o=>Wb(o)).filter(o=>o!==void 0))}function ez(e,t,r){return r!=="zod"?!0:Qb(e,t).has(t)}function o_(e){let t=Sr(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 Mn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function tz(e){try{return Sr(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 rz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Gl(e){return rz.has(e)||e.startsWith("x-")}var oz=new Set(["$schema",...Object.keys(to.shape.requestedSchema.shape)]),Og={string:jn([Qr,Tn,Cn,kn]),number:jn([eo]),integer:jn([eo]),boolean:jn([En]),array:jn([In,On])},nz=new Set(Qr.shape.format.unwrap().options);function sz(e,t,r,o){if(!Mn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(Og,e.type)?Og[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Gl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?nz.has(e.format)?(typeof c!="string"||!ez(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function iz(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&Mn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,sz(c,`properties.${i}`,t,o)])):oz.has(n)?r[n]=s:Gl(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 az(e,t){if(!Mn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Xa(Nn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function kl(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>kl(o,t[n],`${r}[${n}]`)):!Mn(e)||!Mn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?kl(n,t[o],s):Gl(o)?[]:[s]})}function cz(e){if(!so(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=iz(tz(e.requestedSchema),t),o=Xa(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): ${az(r,o.error.message)}`);let n=kl(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 uz(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 lz=Object.assign(uz,{elicit(e){try{return{method:"elicitation/create",params:cz(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 n_=250;function s_(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function i_(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 a_(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 dz=["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"],pz={IdJagTokenExchangeResponseSchema:yl,OAuthClientInformationFullSchema:bl,OAuthClientInformationSchema:Da,OAuthClientMetadataSchema:La,OAuthClientRegistrationErrorSchema:zl,OAuthErrorResponseSchema:vl,OAuthMetadataSchema:qa,OAuthProtectedResourceMetadataSchema:gl,OAuthTokenRevocationRequestSchema:Rl,OAuthTokensSchema:Sl,OpenIdProviderDiscoveryMetadataSchema:_l,OpenIdProviderMetadataSchema:Ma},c_={},u_={};function l_(e,t){let r=e.slice(0,-6);c_[r]=t,u_[r]=o=>t.safeParse(o).success}for(let e of dz)l_(e,Vb[e]);for(let[e,t]of Object.entries(pz))l_(e,t);var mz=Object.freeze(c_),fz=Object.freeze(u_);function hz(e){switch(e){case"initialize":case"notifications/initialized":return no(void 0);case"server/discover":return no(Ul);default:return}}var d_=6e4,gz=[fr,Fr,Tt,Vt],_z=["inputResponses","requestState"];function Ng(e,t){let r=e.params;if(!qn(r))return{message:e,lifted:{}};let o=r._meta,n=qn(o)?gz.filter(a=>a in o):[],s=t==="request"?_z.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&qn(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 xg(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 Dn(e){return()=>e}var Sz=Dn(void 0);function Wl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Dn(t)}}}var yz;var Yl=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{yz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Qs,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),Ba(n)||Hl(n)?this._onresponse(n):Vl(n)?this._onrequest(n,s):Fl(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}=Ng(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Tg(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(Pl(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}=Ng(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 _=Tg(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(wl(r.method)&&!n.hasRequestMethod(r.method)&&!(Cg(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}),p=new AbortController;this._requestHandlerAbortControllers.set(r.id,p);let g=o.inputResponses===void 0?void 0:vz(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?Sz:Dn(o.requestState),signal:p.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),so(h))return d(_,h,f);let y=xg(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},m=this.buildContext(v,t);Promise.resolve().then(()=>c(r,m)).then(async _=>{if(p.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(p.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)===p&&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),Ba(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 Cg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=xg(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=hz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(wl(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((p,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 m=e.era===Ul&&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(_),m===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}`))):m.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(x){return g(x instanceof Error?x:new Error(String(x)))}if(S.kind==="invalid")return g(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return p(bz(S));let x={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 p(this._resolveNonCompleteResult(S,x))}let E=S.result;_r(r,E).then(x=>{x.success?p(x.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${x.error}`))},g)}),u=()=>y(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??d_,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:m?.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(Pl(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(!wl(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 _r(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(!Pl(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 _r(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 qn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xl(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]=qn(i)&&qn(s)?{...i,...s}:s}return r}function jg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vz(e){let t={},r=[];if(!jg(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!jg(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function bz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var zz=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 p=new i(d.toLowerCase());if(u!==-1){var g,v,m;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(),m=v[2],m.charCodeAt(0)===34&&(m=m.slice(1,-1),m.indexOf("\\")!==-1&&(m=m.replace(r,"$1"))),p.parameters[g]=m}if(u!==a.length)throw new TypeError("invalid parameter format")}return p}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}})),oP=ms(zz(),1);var p_=10*1024*1024,Ql=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??p_}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
|
+
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return m_(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function m_(e){return fn.parse(JSON.parse(e))}function ed(e){return JSON.stringify(e)+`
|
|
61
|
+
`}var Rz=/^[A-Za-z0-9._-]{1,128}$/;function $z(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"),!Rz.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 wz(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 td(e){let t=$z(e);return wz(e,t.warnings),t.isValid}function Pz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function Ez(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function Tz(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=>Pz(r))}function Qa(e){if(e!==void 0){if(Tz(e))return P(e);if(typeof e=="object"&&e!==null&&!so(e)&&Object.values(e).some(t=>Ez(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 tc=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(p(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 p(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 m(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new o(`.${f}`):n`[${f}]`}e.getProperty=m;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})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=tc();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 p=this.toName(a),{prefix:g}=p,v=(d=u.key)!==null&&d!==void 0?d:u.ref,m=this._values[g];if(m){let f=m.get(v);if(f)return f}else m=this._values[g]=new Map;m.set(v,p);let _=this._scope[g]||(this._scope[g]=[]),h=_.length;return _[h]=u.ref,p.setValue(u,{property:g,itemIndex:h}),p}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,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},u,d)}_reduceValues(a,u,d={},p){let g=t.nil;for(let v in a){let m=a[v];if(!m)continue;let _=d[v]=d[v]||new Map;m.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=p?.(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=tc(),r=f_();var o=tc();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=f_();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($,C){return this}},i=class extends s{constructor($,C,N){super(),this.varKind=$,this.name=C,this.rhs=N}render({es5:$,_n:C}){let N=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${J};`+C}optimizeNames($,C){if($[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,$,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor($,C,N){super(),this.lhs=$,this.rhs=C,this.sideEffects=N}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,C){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,$,C),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,C,N,J){super($,N,J),this.op=C}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}`:""};`+$}},p=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($,C){return this.code=G(this.code,$,C),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((C,N)=>C+N.render($),"")}optimizeNodes(){let{nodes:$}=this,C=$.length;for(;C--;){let N=$[C].optimizeNodes();Array.isArray(N)?$.splice(C,1,...N):N?$[C]=N:$.splice(C,1)}return $.length>0?this:void 0}optimizeNames($,C){let{nodes:N}=this,J=N.length;for(;J--;){let ee=N[J];ee.optimizeNames($,C)||(fe($,ee.names),N.splice(J,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce(($,C)=>Z($,C.names),{})}},m=class extends v{render($){return"{"+$._n+super.render($)+"}"+$._n}},_=class extends v{},h=class extends m{};h.kind="else";var f=class ec extends m{constructor(C,N){super(N),this.condition=C}render(C){let N=`if(${this.condition})`+super.render(C);return this.else&&(N+="else "+this.else.render(C)),N}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!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 C===!1?N instanceof ec?N:N.nodes:this.nodes.length?this:new ec($e(C),N instanceof ec?[N]:N.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,N){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,N),!!(super.optimizeNames(C,N)||this.else))return this.condition=G(this.condition,C,N),this}get names(){let C=super.names;return Y(C,this.condition),this.else&&Z(C,this.else.names),C}};f.kind="if";var z=class extends m{};z.kind="for";var y=class extends z{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,C){if(super.optimizeNames($,C))return this.iteration=G(this.iteration,$,C),this}get names(){return Z(super.names,this.iteration.names)}},R=class extends z{constructor($,C,N,J){super(),this.varKind=$,this.name=C,this.from=N,this.to=J}render($){let C=$.es5?r.varKinds.var:this.varKind,{name:N,from:J,to:ee}=this;return`for(${C} ${N}=${J}; ${N}<${ee}; ${N}++)`+super.render($)}get names(){return Y(Y(super.names,this.from),this.to)}},w=class extends z{constructor($,C,N,J){super(),this.loop=$,this.varKind=C,this.name=N,this.iterable=J}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,C){if(super.optimizeNames($,C))return this.iterable=G(this.iterable,$,C),this}get names(){return Z(super.names,this.iterable.names)}},b=class extends m{constructor($,C,N){super(),this.name=$,this.args=C,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 m{render($){let C="try"+super.render($);return this.catch&&(C+=this.catch.render($)),this.finally&&(C+=this.finally.render($)),C}optimizeNodes(){var $,C;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames($,C){var N,J;return super.optimizeNames($,C),(N=this.catch)===null||N===void 0||N.optimizeNames($,C),(J=this.finally)===null||J===void 0||J.optimizeNames($,C),this}get names(){let $=super.names;return this.catch&&Z($,this.catch.names),this.finally&&Z($,this.finally.names),$}},x=class extends m{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};x.kind="catch";var F=class extends m{render($){return"finally"+super.render($)}};F.kind="finally";var M=class{constructor($,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
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($,C){let N=this._extScope.value($,C);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue($,C){return this._extScope.getValue($,C)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,C,N,J){let ee=this._scope.toName(C);return N!==void 0&&J&&(this._constants[ee.str]=N),this._leafNode(new i($,ee,N)),ee}const($,C,N){return this._def(r.varKinds.const,$,C,N)}let($,C,N){return this._def(r.varKinds.let,$,C,N)}var($,C,N){return this._def(r.varKinds.var,$,C,N)}assign($,C,N){return this._leafNode(new c($,C,N))}add($,C){return this._leafNode(new a($,e.operators.ADD,C))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){let C=["{"];for(let[N,J]of $)C.length>1&&C.push(","),C.push(N),(N!==J||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,J));return C.push("}"),new t._Code(C)}if($,C,N){if(this._blockNode(new f($)),C&&N)this.code(C).else().code(N).endIf();else if(C)this.code(C).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($,C){return this._blockNode($),C&&this.code(C).endFor(),this}for($,C){return this._for(new y($),C)}forRange($,C,N,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,C,N),()=>J(pe))}forOf($,C,N,J=r.varKinds.const){let ee=this._scope.toName($);if(this.opts.es5){let pe=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${pe}.length`,ae=>{this.var(ee,(0,t._)`${pe}[${ae}]`),N(ee)})}return this._for(new w("of",J,ee,C),()=>N(ee))}forIn($,C,N,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${C})`,N);let ee=this._scope.toName($);return this._for(new w("in",J,ee,C),()=>N(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let C=new S;if(this._blockNode(C),this.code($),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try($,C,N){if(!C&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code($),C){let ee=this.name("e");this._currNode=J.catch=new x(ee),C(ee)}return N&&(this._currNode=J.finally=new F,this.code(N)),this._endBlockNode(x,F)}throw($){return this._leafNode(new p($))}block($,C){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(C),this}endBlock($){let C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");let N=this._nodes.length-C;if(N<0||$!==void 0&&N!==$)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${$} expected`);return this._nodes.length=C,this}func($,C=t.nil,N,J){return this._blockNode(new b($,C,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($,C){let N=this._currNode;if(N instanceof $||C&&N instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${$.kind}/${C.kind}`:$.kind}"`)}_elseNode($){let C=this._currNode;if(!(C instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let C=this._nodes;C[C.length-1]=$}};e.CodeGen=M;function Z($,C){for(let N in C)$[N]=($[N]||0)+(C[N]||0);return $}function Y($,C){return C instanceof t._CodeOrName?Z($,C.names):$}function G($,C,N){if($ instanceof t.Name)return J($);if(!ee($))return $;return new t._Code($._items.reduce((pe,ae)=>(ae instanceof t.Name&&(ae=J(ae)),ae instanceof t._Code?pe.push(...ae._items):pe.push(ae),pe),[]));function J(pe){let ae=N[pe.str];return ae===void 0||C[pe.str]!==1?pe:(delete C[pe.str],ae)}function ee(pe){return pe instanceof t._Code&&pe._items.some(ae=>ae instanceof t.Name&&C[ae.str]===1&&N[ae.str]!==void 0)}}function fe($,C){for(let N in C)$[N]=($[N]||0)-(C[N]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${V($)}`}e.not=$e;let be=j(e.operators.AND);function Oe(...$){return $.reduce(be)}e.and=Oe;let he=j(e.operators.OR);function k(...$){return $.reduce(he)}e.or=k;function j($){return(C,N)=>C===t.nil?N:N===t.nil?C:(0,t._)`${V(C)} ${$} ${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=tc();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:x}=b;if(!E.strictSchema||typeof S=="boolean")return;let F=x.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,x,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)(x)}`}e.schemaRefOrVal=a;function u(b){return g(decodeURIComponent(b))}e.unescapeFragment=u;function d(b){return encodeURIComponent(p(b))}e.escapeFragment=d;function p(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=p;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 m({mergeNames:b,mergeToName:S,mergeValues:E,resultToName:x}){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)?x(F,G):G}}e.mergeEvaluated={props:m({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:m({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(x=>b.assign((0,t._)`${S}${(0,t.getProperty)(x)}`,!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 x=S===y.Num;return E?x?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:x?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(b).toString():"/"+p(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})),pt=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})),oc=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=pt();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=p(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,p(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 p(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),m(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 m({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:x,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]),x&&y.push([d.propertyName,x])}})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=oc(),r=le(),o=pt(),n={message:"boolean schema is false"};function s(a){let{gen:u,schema:d,validateName:p}=a;d===!1?c(a,!1):typeof d=="object"&&d.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${p}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function i(a,u){let{gen:d,schema:p}=a;p===!1?(d.var(u,!1),c(a)):d.var(u,!0)}e.boolOrEmptySchema=i;function c(a,u){let{gen:d,data:p}=a,g={gen:d,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(g,n,void 0,u)}})),h_=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})),g_=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})),rc=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=h_(),r=g_(),o=oc(),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=p(R,S.coerceTypes),x=R.length>0&&!(E.length===0&&R.length===1&&(0,r.schemaHasRulesForType)(y,R[0]));if(x){let F=_(R,b,S.strictNumbers,i.Wrong);w.if(F,()=>{E.length?g(y,R,E):f(y)})}return x}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function p(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,x=b.let("dataType",(0,n._)`typeof ${S}`),F=b.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&b.if((0,n._)`${x} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>b.assign(S,(0,n._)`${S}[0]`).assign(x,(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._)`${x} == "number" || ${x} == "boolean"`).assign(F,(0,n._)`"" + ${S}`).elseIf((0,n._)`${S} === null`).assign(F,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${x} == "boolean" || ${S} === null
|
|
63
|
+
|| (${x} == "string" && ${S} && ${S} == +${S})`).assign(F,(0,n._)`+${S}`);return;case"integer":b.elseIf((0,n._)`${x} === "boolean" || ${S} === null
|
|
64
|
+
|| (${x} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(F,(0,n._)`+${S}`);return;case"boolean":b.elseIf((0,n._)`${S} === "false" || ${S} === 0 || ${S} === null`).assign(F,!1).elseIf((0,n._)`${S} === "true" || ${S} === 1`).assign(F,!0);return;case"null":b.elseIf((0,n._)`${S} === "" || ${S} === 0 || ${S} === false`),b.assign(F,null);return;case"array":b.elseIf((0,n._)`${x} === "string" || ${x} === "number"
|
|
65
|
+
|| ${x} === "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 m(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=x((0,n._)`!(${R} % 1) && !isNaN(${R})`);break;case"number":E=x();break;default:return(0,n._)`typeof ${R} ${S} ${y}`}return b===i.Correct?E:(0,n.not)(E);function x(F=n.nil){return(0,n.and)((0,n._)`typeof ${R} == "number"`,F,w?(0,n._)`isFinite(${R})`:n.nil)}}e.checkDataType=m;function _(y,R,w,b){if(y.length===1)return m(y[0],R,w,b);let S,E=(0,s.toHash)(y);if(E.array&&E.object){let x=(0,n._)`typeof ${R} != "object"`;S=E.null?x:(0,n._)`!${R} || ${x}`,delete E.null,delete E.array,delete E.object}else S=n.nil;E.number&&delete E.integer;for(let x in E)S=(0,n.and)(S,m(x,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}}})),kz=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:p}=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`;p.useDefaults==="empty"&&(v=(0,t._)`${v} || ${g} === null || ${g} === ""`),a.if(v,(0,t._)`${g} = ${(0,t.stringify)(c)}`)}})),mt=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=pt(),n=_e();function s(y,R){let{gen:w,data:b,it:S}=y;w.if(p(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)(p(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 p(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=p;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 m({schemaCode:y,data:R,it:{gen:w,topSchemaRef:b,schemaPath:S,errorPath:E},it:x},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,x.parentData],[o.default.parentDataProperty,x.parentDataProperty],[o.default.rootData,o.default.rootData]];x.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=m;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 x(()=>R.assign(F,!1)),F}return R.var(E,!0),x(()=>R.break()),E;function x(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),x=R.name("_valid");R.block(()=>w.forEach((F,M)=>{let Z=y.subschema({keyword:b,schemaProp:M,compositeRule:!0},x);R.assign(E,(0,t._)`${E} || ${x}`),y.mergeValidEvaluated(Z,x)||R.if((0,t.not)(E))})),y.result(E,()=>y.reset(),()=>y.error(!0))}e.validateUnion=z})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=pt(),o=mt(),n=oc();function s(v,m){let{gen:_,keyword:h,schema:f,parentSchema:z,it:y}=v,R=m.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,m){var _;let{gen:h,keyword:f,schema:z,parentSchema:y,$data:R,it:w}=v;u(w,m);let b=d(h,f,!R&&m.compile?m.compile.call(w.self,z,y,w):m.validate),S=h.let("valid");v.block$data(S,E),v.ok((_=m.valid)!==null&&_!==void 0?_:S);function E(){if(m.errors===!1)M(),m.modifying&&c(v),Z(()=>v.error());else{let Y=m.async?x():F();m.modifying&&c(v),Z(()=>a(v,Y))}}function x(){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=m.async?(0,t._)`await `:t.nil){let G=w.opts.passContext?r.default.this:r.default.self,fe=!("compile"in m&&!R||m.schema===!1);h.assign(S,(0,t._)`${Y}${(0,o.callValidateCode)(v,b,G,fe)}`,m.modifying)}function Z(Y){var G;h.if((0,t.not)((G=m.valid)!==null&&G!==void 0?G:S),Y)}}e.funcKeywordCode=i;function c(v){let{gen:m,data:_,it:h}=v;m.if(h.parentData,()=>m.assign(_,(0,t._)`${h.parentData}[${h.parentDataProperty}]`))}function a(v,m){let{gen:_}=v;_.if((0,t._)`Array.isArray(${m})`,()=>{_.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${m} : ${r.default.vErrors}.concat(${m})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(v)},()=>v.error())}function u({schemaEnv:v},m){if(m.async&&!v.$async)throw new Error("async keyword in sync schema")}function d(v,m,_){if(_===void 0)throw new Error(`keyword "${m}" failed to compile`);return v.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,t.stringify)(_)})}function p(v,m,_=!1){return!m.length||m.some(h=>h==="array"?Array.isArray(v):h==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==h||_&&typeof v>"u")}e.validSchemaType=p;function g({schema:v,opts:m,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(m.validateSchema==="log")_.logger.error(R);else throw new Error(R)}}e.validateKeywordUsage=g})),Oz=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:p,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||p===void 0||g===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:g,errSchemaPath:p}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,c,{dataProp:a,dataPropType:u,data:d,dataTypes:p,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;m(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&&(m(d instanceof t.Name?d:v.let("data",d,!0)),g!==void 0&&(i.propertyName=g)),p&&(i.dataTypes=p);function m(_){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:p}){u!==void 0&&(i.compositeRule=u),d!==void 0&&(i.createErrors=d),p!==void 0&&(i.allErrors=p),i.jtdDiscriminator=c,i.jtdMetadata=a}e.extendSubschemaMode=s})),__=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}})),Nz=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,p,g,v,m){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,u,d,p,g,v,m);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,p,g,v,m)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}})),nc=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=__(),o=Nz(),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 p=/#\/?$/;function g(h){return h?h.replace(p,""):""}e.normalizeId=g;function v(h,f,z){return z=g(z),h.resolve(f,z)}e.resolveUrl=v;let m=/^[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 k=this.opts.uriResolver.resolve;if(he=g($e?k($e,he):he),E.has(he))throw F(he);E.add(he);let j=this.refs[he];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?x(M,j.schema,he):he!==g(fe)&&(he[0]==="#"?(x(M,S[he],he),S[he]=M):this.refs[he]=fe),he}function Oe(he){if(typeof he=="string"){if(!m.test(he))throw new Error(`invalid anchor "${he}"`);be.call(this,`#${he}`)}}}),S;function x(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=Cz(),r=rc(),o=g_(),n=rc(),s=kz(),i=Iz(),c=Oz(),a=le(),u=pt(),d=nc(),p=_e(),g=oc();function v(T){if(b(T)&&(E(T),w(T))){f(T);return}m(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=v;function m({gen:T,validateName:A,schema:D,schemaEnv:ne,opts:ie},de){ie.code.es5?T.func(A,(0,a._)`${u.default.data}, ${u.default.valCxt}`,ne.$async,()=>{T.code((0,a._)`"use strict"; ${y(D,ie)}`),h(T,ie),T.code(de)}):T.func(A,(0,a._)`${u.default.data}, ${_(ie)}`,ne.$async,()=>T.code(y(D,ie)).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;m(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),x(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:ie}=T;ie.$comment&&D.$comment&&G(T),Z(T),Y(T);let de=ne.const("_errs",u.default.errors);x(T,de),ne.var(A,(0,a._)`${de} === ${u.default.errors}`)}function E(T){(0,p.checkUnknownRules)(T),F(T)}function x(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:ie}=T;A.$ref&&ne.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(A,ie.RULES)&&ie.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,p.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:ie}){let de=D.$comment;if(ie.$comment===!0)T.code((0,a._)`${u.default.self}.logger.log(${de})`);else if(typeof ie.$comment=="function"){let ke=(0,a.str)`${ne}/$comment`,xe=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${ke}, ${xe}.schema)`)}}function fe(T){let{gen:A,schemaEnv:D,validateName:ne,ValidationError:ie,opts:de}=T;D.$async?A.if((0,a._)`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw((0,a._)`new ${ie}(${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:ie,schema:de,data:ke,allErrors:xe,opts:Ue,self:Ne}=T,{RULES:we}=Ne;if(de.$ref&&(Ue.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(de,we))){ie.block(()=>pe(T,"$ref",we.all.$ref.definition));return}Ue.jtd||he(T,A),ie.block(()=>{for(let Ae of we.rules)ot(Ae);ot(we.post)});function ot(Ae){(0,o.shouldUseGroup)(de,Ae)&&(Ae.type?(ie.if((0,n.checkDataType)(Ae.type,ke,Ue.strictNumbers)),Oe(T,Ae),A.length===1&&A[0]===Ae.type&&D&&(ie.else(),(0,n.reportTypeError)(T)),ie.endIf()):Oe(T,Ae),xe||ie.if((0,a._)`${u.default.errors} === ${ne||0}`))}}function Oe(T,A){let{gen:D,schema:ne,opts:{useDefaults:ie}}=T;ie&&(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||(k(T,A),T.opts.allowUnionTypes||j(T,A),V(T,T.dataTypes))}function k(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(D=>{C(T.dataTypes,D)||J(T,`type "${D}" not allowed by context "${T.dataTypes.join(",")}"`)}),N(T,A)}}function j(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 ie=D[ne];if(typeof ie=="object"&&(0,o.shouldUseRule)(T.schema,ie)){let{type:de}=ie.definition;de.length&&!de.some(ke=>$(A,ke))&&J(T,`missing type "${de.join(",")}" for keyword "${ne}"`)}}}function $(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function C(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function N(T,A){let D=[];for(let ne of T.dataTypes)C(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,p.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,p.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:ie,def:de}=this;D.if((0,a.or)((0,a._)`${ne} === undefined`,A)),T!==a.nil&&D.assign(T,!0),(ie.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:ie}=this;return(0,a.or)(de(),ke());function de(){if(D.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");let xe=Array.isArray(D)?D:[D];return(0,a._)`${(0,n.checkDataTypes)(xe,A,ie.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function ke(){if(ne.validateSchema){let xe=T.scopeValue("validate$data",{ref:ne.validateSchema});return(0,a._)`!${xe}(${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=p.mergeEvaluated.props(ne,T.props,D.props,A)),D.items!==!0&&T.items!==void 0&&(D.items=p.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 ie=new ee(T,D,A);"code"in D?D.code(ie,ne):ie.$data&&D.validate?(0,i.funcKeywordCode)(ie,D):"macro"in D?(0,i.macroKeywordCode)(ie,D):(D.compile||D.validate)&&(0,i.funcKeywordCode)(ie,D)}let ae=/^\/(?:[^~]|~0|~1)*$/,ze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Be(T,{dataLevel:A,dataNames:D,dataPathArr:ne}){let ie,de;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!ae.test(T))throw new Error(`Invalid JSON-pointer: ${T}`);ie=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(ie=Ne[2],ie==="#"){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],!ie)return de}let ke=de,xe=ie.split("/");for(let Ne of xe)Ne&&(de=(0,a._)`${de}${(0,a.getProperty)((0,p.unescapeJsonPointer)(Ne))}`,ke=(0,a._)`${ke} && ${de}`);return ke;function Ue(Ne,we){return`Cannot access ${Ne} ${we} levels up, current level is ${A}`}}e.getData=Be})),Zn=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=nc();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})),sc=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Zn(),o=pt(),n=nc(),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=p.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 x=S.scopeName("validate");f.validateName=x;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:x,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(x,{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:x,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 p(f){for(let z of this._compilations)if(g(z,f))return z}e.getCompilingSchema=p;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]||m.call(this,f,z)}function m(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=m.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:x}=this.opts,F=E[x];return F&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,F)),new c({schema:E,schemaId:x,root:f,baseId:w})}return h.call(this,y,S)}}e.resolveSchema=m;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 x=y[(0,s.unescapeFragment)(E)];if(x===void 0)return;y=x;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=m.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}})),xz=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}})),S_=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(m){let _="",h=0,f=0;for(f=0;f<m.length;f++)if(h=m[f].charCodeAt(0),h!==48){if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=m[f];break}for(f+=1;f<m.length;f++){if(h=m[f].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=m[f]}return _}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(m){return m.length=0,!0}function c(m,_,h){if(m.length){let f=n(m);if(f!=="")_.push(f);else return h.error=!0,!1;m.length=0}return!0}function a(m){let _=0,h={error:!1,address:"",zone:""},f=[],z=[],y=!1,R=!1,w=c;for(let b=0;b<m.length;b++){let S=m[b];if(!(S==="["||S==="]"))if(S===":"){if(y===!0&&(R=!0),!w(z,f,h))break;if(++_>7){h.error=!0;break}b>0&&m[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(m){if(d(m,":")<2)return{host:m,isIPV6:!1};let _=a(m);if(_.error)return{host:m,isIPV6:!1};{let h=_.address,f=_.address;return _.zone&&(h+="%"+_.zone,f+="%25"+_.zone),{host:h,isIPV6:!0,escapedHost:f}}}function d(m,_){let h=0;for(let f=0;f<m.length;f++)m[f]===_&&h++;return h}function p(m){let _=m,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(m,_){let h=_!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=h(m.scheme)),m.userinfo!==void 0&&(m.userinfo=h(m.userinfo)),m.host!==void 0&&(m.host=h(m.host)),m.path!==void 0&&(m.path=h(m.path)),m.query!==void 0&&(m.query=h(m.query)),m.fragment!==void 0&&(m.fragment=h(m.fragment)),m}function v(m){let _=[];if(m.userinfo!==void 0&&(_.push(m.userinfo),_.push("@")),m.host!==void 0){let h=unescape(m.host);if(!o(h)){let f=u(h);f.isIPV6===!0?h=`[${f.escapedHost}]`:h=m.host}_.push(h)}return(typeof m.port=="number"||typeof m.port=="string")&&(_.push(":"),_.push(String(m.port))),_.length?_.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:v,normalizeComponentEncoding:g,removeDotSegments:p,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}})),jz=U(((e,t)=>{let{isUUID:r}=S_(),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,x]=S.resourceName.split("?");S.path=E&&E!=="/"?E:void 0,S.query=x,S.resourceName=void 0}return S.fragment=void 0,S}function p(S,E){if(!S.path)return S.error="URN can not be parsed",S;let x=S.path.match(o);if(x){let F=E.scheme||S.scheme||"urn";S.nid=x[1].toLowerCase(),S.nss=x[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 x=E.scheme||S.scheme||"urn",F=S.nid.toLowerCase(),M=b(`${x}:${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 x=S;return x.uuid=x.nss,x.nss=void 0,!E.tolerant&&(!x.uuid||!r(x.uuid))&&(x.error=x.error||"UUID is not valid."),x}function m(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:p,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:m,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}})),Az=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=S_(),{SCHEMES:a,getSchemeHandler:u}=jz();function d(z,y){return typeof z=="string"?z=m(h(z,y),y):typeof z=="object"&&(z=h(m(z,y),y)),z}function p(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,m(b,w)}function g(z,y,R,w){let b={};return w||(z=h(m(z,R),R),y=h(m(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=m(s(h(z,R),!0),{...R,skipEscape:!0})):typeof z=="object"&&(z=m(s(z,!0),{...R,skipEscape:!0})),typeof y=="string"?(y=unescape(y),y=m(s(h(y,R),!0),{...R,skipEscape:!0})):typeof y=="object"&&(y=m(s(y,!0),{...R,skipEscape:!0})),z.toLowerCase()===y.toLowerCase()}function m(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 x=R.path;!w.absolutePath&&(!S||!S.absolutePath)&&(x=o(x)),E===void 0&&x[0]==="/"&&x[1]==="/"&&(x="/%2F"+x.slice(2)),b.push(x)}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 x=r(w.host);w.host=x.host.toLowerCase(),b=x.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(x){w.error=w.error||"Host's domain name can not be converted to ASCII: "+x}(!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:p,resolveComponent:g,equal:v,serialize:m,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Az();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),od=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=Zn(),n=ao(),s=h_(),i=sc(),c=le(),a=nc(),u=rc(),d=_e(),p=xz(),g=qz(),v=(k,j)=>new RegExp(k,j);v.code="new RegExp";let m=["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(k){var j,V,$,C,N,J,ee,pe,ae,ze,Be,T,A,D,ne,ie,de,ke,xe,Ue,Ne,we,ot,Ae,ht;let at=k.strict,gt=(j=k.code)===null||j===void 0?void 0:j.optimize,It=gt===!0||gt===void 0?1:gt||0,Ot=($=(V=k.code)===null||V===void 0?void 0:V.regExp)!==null&&$!==void 0?$:v,Xt=(C=k.uriResolver)!==null&&C!==void 0?C:g.default;return{strictSchema:(J=(N=k.strictSchema)!==null&&N!==void 0?N:at)!==null&&J!==void 0?J:!0,strictNumbers:(pe=(ee=k.strictNumbers)!==null&&ee!==void 0?ee:at)!==null&&pe!==void 0?pe:!0,strictTypes:(ze=(ae=k.strictTypes)!==null&&ae!==void 0?ae:at)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Be=k.strictTuples)!==null&&Be!==void 0?Be:at)!==null&&T!==void 0?T:"log",strictRequired:(D=(A=k.strictRequired)!==null&&A!==void 0?A:at)!==null&&D!==void 0?D:!1,code:k.code?{...k.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(ne=k.loopRequired)!==null&&ne!==void 0?ne:z,loopEnum:(ie=k.loopEnum)!==null&&ie!==void 0?ie:z,meta:(de=k.meta)!==null&&de!==void 0?de:!0,messages:(ke=k.messages)!==null&&ke!==void 0?ke:!0,inlineRefs:(xe=k.inlineRefs)!==null&&xe!==void 0?xe:!0,schemaId:(Ue=k.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Ne=k.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(we=k.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(ot=k.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(Ae=k.unicodeRegExp)!==null&&Ae!==void 0?Ae:!0,int32range:(ht=k.int32range)!==null&&ht!==void 0?ht:!0,uriResolver:Xt}}var R=class{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...y(k)};let{es5:j,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:j,lines:V}),this.logger=Z(k.logger);let $=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,h,k,"NOT SUPPORTED"),w.call(this,f,k,"DEPRECATED","warn"),this._metaOpts=F.call(this),k.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&x.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),S.call(this),k.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:k,meta:j,schemaId:V}=this.opts,$=p;V==="id"&&($={...p},$.id=$.$id,delete $.$id),j&&k&&this.addMetaSchema($,$[V],!1)}defaultMeta(){let{meta:k,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[j]||k:void 0}validate(k,j){let V;if(typeof k=="string"){if(V=this.getSchema(k),!V)throw new Error(`no schema with key or ref "${k}"`)}else V=this.compile(k);let $=V(j);return"$async"in V||(this.errors=V.errors),$}compile(k,j){let V=this._addSchema(k,j);return V.validate||this._compileSchemaEnv(V)}compileAsync(k,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return $.call(this,k,j);async function $(ae,ze){await C.call(this,ae.$schema);let Be=this._addSchema(ae,ze);return Be.validate||N.call(this,Be)}async function C(ae){ae&&!this.getSchema(ae)&&await $.call(this,{$ref:ae},!0)}async function N(ae){try{return this._compileSchemaEnv(ae)}catch(ze){if(!(ze instanceof n.default))throw ze;return J.call(this,ze),await ee.call(this,ze.missingSchema),N.call(this,ae)}}function J({missingSchema:ae,missingRef:ze}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${ze} cannot be resolved`)}async function ee(ae){let ze=await pe.call(this,ae);this.refs[ae]||await C.call(this,ze.$schema),this.refs[ae]||this.addSchema(ze,ae,j)}async function pe(ae){let ze=this._loading[ae];if(ze)return ze;try{return await(this._loading[ae]=V(ae))}finally{delete this._loading[ae]}}}addSchema(k,j,V,$=this.opts.validateSchema){if(Array.isArray(k)){for(let N of k)this.addSchema(N,void 0,V,$);return this}let C;if(typeof k=="object"){let{schemaId:N}=this.opts;if(C=k[N],C!==void 0&&typeof C!="string")throw new Error(`schema ${N} must be string`)}return j=(0,a.normalizeId)(j||C),this._checkUnique(j),this.schemas[j]=this._addSchema(k,V,j,$,!0),this}addMetaSchema(k,j,V=this.opts.validateSchema){return this.addSchema(k,j,!0,V),this}validateSchema(k,j){if(typeof k=="boolean")return!0;let V;if(V=k.$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,k);if(!$&&j){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return $}getSchema(k){let j;for(;typeof(j=b.call(this,k))=="string";)k=j;if(j===void 0){let{schemaId:V}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:V});if(j=i.resolveSchema.call(this,$,k),!j)return;this.refs[k]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let j=b.call(this,k);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{let j=k;this._cache.delete(j);let V=k[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(k){for(let j of k)this.addKeyword(j);return this}addKeyword(k,j){let V;if(typeof k=="string")V=k,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=V);else if(typeof k=="object"&&j===void 0){if(j=k,V=j.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,j),!j)return(0,d.eachItem)(V,C=>fe.call(this,C)),this;be.call(this,j);let $={...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(V,$.type.length===0?C=>fe.call(this,C,$):C=>$.type.forEach(N=>fe.call(this,C,$,N))),this}getKeyword(k){let j=this.RULES.all[k];return typeof j=="object"?j.definition:!!j}removeKeyword(k){let{RULES:j}=this;delete j.keywords[k],delete j.all[k];for(let V of j.rules){let $=V.rules.findIndex(C=>C.keyword===k);$>=0&&V.rules.splice($,1)}return this}addFormat(k,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[k]=j,this}errorsText(k=this.errors,{separator:j=", ",dataVar:V="data"}={}){return!k||k.length===0?"No errors":k.map($=>`${V}${$.instancePath} ${$.message}`).reduce(($,C)=>$+j+C)}$dataMetaSchema(k,j){let V=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(let $ of j){let C=$.split("/").slice(1),N=k;for(let J of C)N=N[J];for(let J in V){let ee=V[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ae=N[J];pe&&ae&&(N[J]=he(ae))}}return k}_removeAllSchemas(k,j){for(let V in k){let $=k[V];(!j||j.test(V))&&(typeof $=="string"?delete k[V]:$&&!$.meta&&(this._cache.delete($.schema),delete k[V]))}}_addSchema(k,j,V,$=this.opts.validateSchema,C=this.opts.addUsedSchema){let N,{schemaId:J}=this.opts;if(typeof k=="object")N=k[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(k);if(ee!==void 0)return ee;V=(0,a.normalizeId)(N||V);let pe=a.getSchemaRefs.call(this,k,V);return ee=new i.SchemaEnv({schema:k,schemaId:J,meta:j,baseId:V,localRefs:pe}),this._cache.set(ee.schema,ee),C&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=ee),$&&this.validateSchema(k,!0),ee}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):i.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){let j=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,k)}finally{this.opts=j}}};R.ValidationError=o.default,R.MissingRefError=n.default,e.default=R;function w(k,j,V,$="error"){for(let C in k){let N=C;N in j&&this.logger[$](`${V}: option ${C}. ${k[N]}`)}}function b(k){return k=(0,a.normalizeId)(k),this.schemas[k]||this.refs[k]}function S(){let k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(let j in k)this.addSchema(k[j],j)}function E(){for(let k in this.opts.formats){let j=this.opts.formats[k];j&&this.addFormat(k,j)}}function x(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let j in k){let V=k[j];V.keyword||(V.keyword=j),this.addKeyword(V)}}function F(){let k={...this.opts};for(let j of m)delete k[j];return k}let M={log(){},warn(){},error(){}};function Z(k){if(k===!1)return M;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function G(k,j){let{RULES:V}=this;if((0,d.eachItem)(k,$=>{if(V.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!Y.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function fe(k,j,V){var $;let C=j?.post;if(V&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:N}=this,J=C?N.post:N.rules.find(({type:pe})=>pe===V);if(J||(J={type:V,rules:[]},N.rules.push(J)),N.keywords[k]=!0,!j)return;let ee={keyword:k,definition:{...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)}};j.before?$e.call(this,J,ee,j.before):J.rules.push(ee),N.all[k]=ee,($=j.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(k,j,V){let $=k.rules.findIndex(C=>C.keyword===V);$>=0?k.rules.splice($,0,j):(k.rules.push(j),this.logger.warn(`rule ${V} is not defined`))}function be(k){let{metaSchema:j}=k;j!==void 0&&(k.$data&&this.opts.$data&&(j=he(j)),k.validateSchema=this.compile(j,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(k){return{anyOf:[k,Oe]}}})),Mz=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})),nd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=ao(),r=mt(),o=le(),n=pt(),s=sc(),i=_e(),c={keyword:"$ref",schemaType:"string",code(d){let{gen:p,schema:g,it:v}=d,{baseId:m,schemaEnv:_,validateName:h,opts:f,self:z}=v,{root:y}=_;if((g==="#"||g==="#/")&&m===y.baseId)return w();let R=s.resolveRef.call(z,y,m,g);if(R===void 0)throw new t.default(v.opts.uriResolver,m,g);if(R instanceof s.SchemaEnv)return b(R);return S(R);function w(){if(_===y)return u(d,h,_,_.$async);let E=p.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 x=p.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),F=p.name("valid"),M=d.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:x,errSchemaPath:g},F);d.mergeEvaluated(M),d.ok(F)}}};function a(d,p){let{gen:g}=d;return p.validate?g.scopeValue("validate",{ref:p.validate}):(0,o._)`${g.scopeValue("wrapper",{ref:p})}.validate`}e.getValidate=a;function u(d,p,g,v){let{gen:m,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=m.let("valid");m.try(()=>{m.code((0,o._)`await ${(0,r.callValidateCode)(d,p,y)}`),S(p),h||m.assign(E,!0)},x=>{m.if((0,o._)`!(${x} instanceof ${_.ValidationError})`,()=>m.throw(x)),b(x),h||m.assign(E,!1)}),d.ok(E)}function w(){d.result((0,r.callValidateCode)(d,p,y),()=>S(p),()=>b(p))}function b(E){let x=(0,o._)`${E}.errors`;m.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${x} : ${n.default.vErrors}.concat(${x})`),m.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function S(E){var x;if(!_.opts.unevaluated)return;let F=(x=g?.validate)===null||x===void 0?void 0:x.evaluated;if(_.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(_.props=i.mergeEvaluated.props(m,F.props,_.props));else{let M=m.var("props",(0,o._)`${E}.evaluated.props`);_.props=i.mergeEvaluated.props(m,M,_.props,o.Name)}if(_.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(_.items=i.mergeEvaluated.items(m,F.items,_.items));else{let M=m.var("items",(0,o._)`${E}.evaluated.items`);_.items=i.mergeEvaluated.items(m,M,_.items,o.Name)}}}e.callRef=u,e.default=c})),y_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mz(),r=nd(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),Lz=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})),Dz=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})),Zz=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'})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=Zz(),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,p=u.opts.unicode===!1?(0,t._)`${c}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${c})`;s.fail$data((0,t._)`${p} ${d} ${a}`)}};e.default=n})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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:p}=s,g=p.opts.unicodeRegExp?"u":"";if(a){let{regExp:v}=p.opts.code,m=v.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(i,v),_=i.let("valid");i.try(()=>i.assign(_,(0,o._)`${m}(${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})),Fz=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})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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:p}=s,{opts:g}=p;if(!d&&c.length===0)return;let v=c.length>=g.loopRequired;if(p.allErrors?m():_(),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 "${p.schemaEnv.baseId+p.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(p,w,p.opts.strictRequired)}}function m(){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})),Jz=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})),sd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=__();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),Bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=rc(),r=le(),o=_e(),n=sd(),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:p,schemaCode:g,it:v}=i;if(!u&&!d)return;let m=c.let("valid"),_=p.items?(0,t.getSchemaTypes)(p.items):[];i.block$data(m,h,(0,r._)`${g} === false`),i.ok(m);function h(){let R=c.let("i",(0,r._)`${a}.length`),w=c.let("j");i.setParams({i:R,j:w}),c.assign(m,!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(m,!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(m,!1).break(S)})))}}};e.default=s})),Kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=sd(),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})),Gz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=sd(),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:p}=s;if(!a&&u.length===0)throw new Error("enum must have non-empty array");let g=u.length>=p.opts.loopEnum,v,m=()=>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._)`${m()}(${c}, ${z})`,()=>i.assign(_,!0).break()))}function f(z,y){let R=u[y];return typeof R=="object"&&R!==null?(0,t._)`${m()}(${c}, ${z}[${y}])`:(0,t._)`${c} === ${R}`}}};e.default=n})),v_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Lz(),r=Dz(),o=Uz(),n=Vz(),s=Fz(),i=Hz(),c=Jz(),a=Bz(),u=Kz(),d=Gz(),p=[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=p})),b_=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:p}=s;p.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)(p,a)){let m=c.var("valid",(0,t._)`${g} <= ${i.length}`);c.if((0,t.not)(m),()=>v(m)),s.ok(m)}function v(m){c.forRange("i",i.length,g,_=>{s.subschema({keyword:d,dataProp:_,dataPropType:r.Type.Num},m),p.allErrors||c.if((0,t.not)(m),()=>c.break())})}}e.validateAdditionalItems=n,e.default=o})),z_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=_e(),o=mt(),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:p,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 m=u.name("valid"),_=u.const("len",(0,t._)`${p}.length`);a.forEach((f,z)=>{(0,r.alwaysValidSchema)(v,f)||(u.if((0,t._)`${_} > ${z}`,()=>i.subschema({keyword:g,schemaProp:z,dataProp:z},m)),i.ok(m))});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})),Wz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=z_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),Yz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=mt(),n=b_(),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})),Xz=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,p,{minContains:g,maxContains:v}=c;u.opts.next?(d=g===void 0?1:g,p=v):d=1;let m=s.const("len",(0,t._)`${a}.length`);if(n.setParams({min:d,max:p}),p===void 0&&d===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&d>p){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let y=(0,t._)`${m} >= ${d}`;p!==void 0&&(y=(0,t._)`${y} && ${m} <= ${p}`),n.pass(y);return}u.items=!0;let _=s.name("valid");p===void 0&&d===1?f(_,()=>s.if(_,()=>s.break())):d===0?(s.let(_,!0),p!==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,m,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:r.Type.Num,compositeRule:!0},y),R()})}function z(y){s.code((0,t._)`${y}++`),p===void 0?s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${y} > ${p}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0)))}}};e.default=o})),id=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=_e(),o=mt();e.error={message:({params:{property:a,depsCount:u,deps:d}})=>{let p=u===1?"property":"properties";return(0,t.str)`must have ${p} ${d} when property ${a} is present`},params:({params:{property:a,depsCount:u,deps:d,missingProperty:p}})=>(0,t._)`{property: ${a},
|
|
66
|
+
missingProperty: ${p},
|
|
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})),Zz=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})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),r=le(),o=pt(),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})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=mt(),o=_e(),n=m_(),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})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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})),Fz=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})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mt().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})),Bz=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})),Kz=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})),Gz=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})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=Mz(),o=p_(),n=Lz(),s=Dz(),i=id(),c=Zz(),a=m_(),u=Uz(),d=Vz(),m=Fz(),g=Hz(),v=Jz(),p=Bz(),_=Kz(),h=Gz();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})),Wz=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})),h_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Wz().default];e.default=t})),g_=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((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=u_(),r=l_(),o=f_(),n=h_(),s=g_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Yz=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={}))})),ad=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Yz(),o=oc(),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})),Xz=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}})),S_=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=od(),o=__(),n=ad(),s=Xz(),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=Dn();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}})})),y_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=pt(),o=oc(),n=nd(),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})),v_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=pt(),o=nd(),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})),Qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=y_(),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})),e0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=v_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),b_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=y_(),r=v_(),o=Qz(),n=e0(),s=[t.default,r.default,o.default,n.default];e.default=s})),t0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=id(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),r0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=id(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),o0=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})),z_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t0(),r=r0(),o=o0(),n=[t.default,r.default,o.default];e.default=n})),n0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=pt(),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})),s0=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})),R_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n0(),r=s0(),o=[t.default,r.default];e.default=o})),i0=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"}]}}}}})),a0=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:"#"}}}}})),c0=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:"#"}}}})),u0=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:{}}}}})),l0=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"}}}})),d0=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}}}})),p0=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:[]}}}})),m0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=i0(),r=a0(),o=c0(),n=u0(),s=l0(),i=d0(),c=p0(),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})),f0=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=od(),o=__(),n=b_(),s=z_(),i=R_(),c=ad(),a=m0(),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=Dn();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}})})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=u_(),r=l_(),o=f_(),n=b_(),s=z_(),i=R_(),c=h_(),a=g_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),g0=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}}}})),_0=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"}}}}})),S0=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"}}}})),y0=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"}}}})),v0=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"}}}})),b0=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"}}}})),z0=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}}}})),R0=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:[]}}}})),$0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=g0(),r=_0(),o=S0(),n=y0(),s=v0(),i=b0(),c=z0(),a=R0(),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})),w0=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=od(),o=h0(),n=ad(),s=$0(),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=Dn();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}})})),P0=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,k=+(G[6]||0),x=+(G[7]||0);if(k>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-k*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}}})),E0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=S_(),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})),T0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=P0(),o=E0(),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})),$_=S_(),C0=f0(),k0=w0(),I0=ds(T0(),1),O0=I0.default;function rd(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return O0(t),t}var nc=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=rd(k0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=xd(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??=rd(C0.Ajv2019):this._ajvDraft7??=rd($_.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)}}},tP=$_.Ajv;import cd from"node:process";var O_=Symbol.for("mcp.completable");function ld(e){return!!e&&typeof e=="object"&&O_ in e}function x0(e){return e[O_]?.complete}var JP=2**31-1;function A0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var q0=8,M0=6e5;function L0(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??q0,roundTimeoutMs:e?.roundTimeoutMs??M0,legacyShim:e?.legacyShim??!0}}function N_(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=Tg(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 D0(){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 ud(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var Z0=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 ud(e,Gg(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}=N_(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(Ja(b,h)!==void 0)return ud(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=Yg(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 ud(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Wg(Kg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:Ln(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Wl(p,h))}let _=await t(r,p);if(!kt(_))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:D0()}),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)}}},U0=new Set(["tools/call","prompts/get","resources/read"]),V0,F0,H0;var j_=class extends Yl{_clientCapabilities;_clientVersion;static{V0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},F0=(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())},H0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Z0({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 nc,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=L0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Ml(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Ol(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=Wa(Gt,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?.[Vt],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(Gt.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=Xl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=U0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(kt(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(kt(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:Ba(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(kt(i))return i;let c=Nl(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&&Mn(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=Wl(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(!kt(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??mr}, 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:_}=N_(e,g,v),h=Ja(_,m);if(h!==void 0)throw new Ga({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?.[Tt]: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=Cg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??mr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Ol(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 B0(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 K0(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 sc=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 P_;try{let r=Sr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new j_(e,t),this._maxToolInputElements=K0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return A0(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?G0(e,t.inputSchema):P_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Sr(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),kt(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&&B0(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 _r(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||kt(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 _r(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 Jl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Bl(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 Zn;let o=I_(k_(r.argsSchema)?.[e.params.argument.name]);if(!ld(o))return Zn;let n=x0(o);return n?C_(await n(e.params.argument.value,e.params.context)):Zn}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 Zn;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?C_(await o(e.params.argument.value,e.params.context)):Zn}_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 Ba(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 Ba(await n.readCallback(r,s,t),n.cacheHint)}}throw new Ka(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?Bg(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&&Ml(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:T_(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=T_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=k_(o);m&&Object.values(m).some(g=>ld(I_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){td(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=E_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:w_(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"&&td(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=w_(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=E_(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,Ya(s),Ya(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,Ya(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 w_(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var P_={type:"object",properties:{}};function G0(e,t){let r=Sr(t,"input"),o=Kl(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 E_(e){if(e!==void 0)try{return Sr(e,"output")}catch{return}}function T_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await _r(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 C_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Zn={completion:{values:[],hasMore:!1}};function k_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function W0(e){return e?.type==="optional"}function I_(e){return W0(e)?e.def?.innerType??e:e}var DE=4*1024*1024;var x_=Symbol("swallowsErrorsAfterClose"),A_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=cd.stdin,t=cd.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Ql({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[x_]&&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[x_]=!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=ed(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 nR}from"node:path";function q_(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 M_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},L_=_d(),sR=bd.map(e=>e.id),iR=q_(yd.options([M_],{},mc),"degrees").map(Number),nT=q_(vd.options([M_],{},mc),"mode");var Un=l().refine(nR,"must be an absolute path").describe("An absolute path."),ic=I(Un).min(1),aR=Zt("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."),D_=P({paths:ic.describe("Absolute paths of files (or folders) to inspect.")}),Z_=P({}),U_=P({paths:ic.describe("Absolute paths of files, folders or globs to convert."),to:ie(L_).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim, crop or resize, which keep each image's own format when it is omitted.`),output:Un.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)."),crop:l().optional().describe('Images only: cut to a shape W:H (e.g. "1:1", "4:5", "16:9", "9:16"; whole numbers 1-100), the largest box that fits, placed to keep the subject; writes name-cropped-1x1, or name-cropped-1x1-<W>x<H> with resize, which then applies to the cropped image. Keeps the format unless `to` is given. Refused for animated images and when the image already has that shape (unless also resizing). Not with trim.'),resize:W([Me({percent:L().min(1).max(Id)}),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`.")}),V_=P({paths:ic.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:Un.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."}),F_=P({to:ie(L_).optional().describe("Convert to this format id. Default: compress, keeping the image's own format."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb".'),save:Un.optional().describe("Also write the result into this folder."),undo:H().optional().describe("Put the last original back instead. Takes no other argument.")}).refine(e=>!(e.quality!==void 0&&e.maxSize!==void 0),{message:"Give at most one of quality or maxSize."}).refine(e=>!e.undo||Object.keys(e).every(t=>t==="undo"),{message:"undo takes no other argument."}),H_=P({op:ie(sR).describe("The page operation."),paths:ic.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(iR).optional().describe("rotate: degrees clockwise."),split:aR.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Vn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),cR=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),Fn=Me({forge:l(),ok:H(),results:I(cR),failures:I(Vn)}),J_=Fn.extend({clipboard:ie(["placed","changed","restored"]).optional(),saved:l().optional()}),B_=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:ie(["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(Vn)}),K_=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Vn)}),G_=l().describe("A colour: #RRGGBB, #RGB (or without the #), rgb(), hsl(), oklch(), or a CSS or common colour name"),W_=P({path:Un.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:G_.optional().describe("Show the shades of the palette colour nearest this one")}),Y_=P({colour:G_}),X_=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(Vn)}),Q_=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Vn)});import{Writable as uR}from"node:stream";function eS(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new uR({write(o,n,s){r(o,n,s)}})}import{basename as lR}from"node:path";import{pathToFileURL as dR}from"node:url";var dd={interactive:!1},tS=Promise.resolve();function pd(e){let t=tS.then(e,e);return tS=t.catch(()=>{}),t}var Hn=(e,t)=>pd(()=>kd(e,t===void 0?dd:{...dd,signal:t}));function rS(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 fd(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(rS));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:dR(o).href,name:lR(o)}));return{content:[{type:"text",text:t.join(`
|
|
69
|
-
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var co=e=>
|
|
70
|
-
`)}],structuredContent:{...t},isError:!t.ok}}function
|
|
71
|
-
`)}],structuredContent:{...e}}}async function
|
|
72
|
-
`)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!
|
|
73
|
-
`)}],structuredContent:{...n}}
|
|
74
|
-
`)}],structuredContent:{...n}}}function
|
|
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 p in a){if(p==="__proto__")continue;let g=Array.isArray(a[p])?u:d;g[p]=a[p]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:p,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let m in u){let _=u[m];if(_.length===0)continue;let h=(0,o.propertyInData)(d,p,m,g.opts.ownProperties);a.setParams({property:m,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:p,keyword:g,it:v}=a,m=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,p,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},m);a.mergeValidEvaluated(h,m)},()=>d.var(m,!0)),a.ok(m))}e.validateSchemaDeps=c,e.default=n})),Qz=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})),R_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),r=le(),o=pt(),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:p,it:g}=i;if(!p)throw new Error("ajv implementation error");let{allErrors:v,opts:m}=g;if(g.props=!0,m.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._)`${p} === ${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(m.removeAdditional==="all"||m.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");m.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 x={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(x,S)}}};e.default=s})),e0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=mt(),o=_e(),n=R_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:p}=i;p.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(p,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)p.definedProperties.add(f);p.opts.unevaluated&&g.length&&p.props!==!0&&(p.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),p.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(p,a[f]));if(v.length===0)return;let m=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,p.opts.ownProperties)),h(f),p.allErrors||c.else().var(m,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(m);function _(f){return p.opts.useDefaults&&!p.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},m)}}};e.default=s})),t0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mt(),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:p}=i,{opts:g}=p,v=(0,t.allSchemaProperties)(a),m=v.filter(w=>(0,o.alwaysValidSchema)(p,a[w]));if(v.length===0||m.length===v.length&&(!p.opts.unevaluated||p.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");p.props!==!0&&!(p.props instanceof r.Name)&&(p.props=(0,n.evaluatedPropsToName)(c,p.props));let{props:f}=p;z();function z(){for(let w of v)_&&y(w),p.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)(p,`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=m.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),p.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!p.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),r0=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})),o0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),n0=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),p=s.let("passing",null),g=s.name("_valid");n.setParams({passing:p}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((m,_)=>{let h;(0,r.alwaysValidSchema)(a,m)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(p,(0,t._)`[${p}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(p,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),s0=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})),i0=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 p=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,m("then",_),m("else",_))}else u?i.if(g,m("then")):i.if((0,t.not)(g),m("else"));s.pass(p,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function m(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(p,g),s.mergeValidEvaluated(f,p),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})),a0=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})),$_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=b_(),r=Wz(),o=z_(),n=Yz(),s=Xz(),i=id(),c=Qz(),a=R_(),u=e0(),d=t0(),p=r0(),g=o0(),v=n0(),m=s0(),_=i0(),h=a0();function f(z=!1){let y=[p.default,g.default,v.default,m.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})),c0=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:p,errSchemaPath:g,schemaEnv:v,self:m}=d;if(!p.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:m.formats,code:p.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 p.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=m.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(p.strictSchema===!1){m.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let x=E instanceof RegExp?(0,t.regexpCode)(E):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:x});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})),w_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[c0().default];e.default=t})),P_=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"]})),E_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=y_(),r=v_(),o=$_(),n=w_(),s=P_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),u0=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={}))})),ad=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=u0(),o=sc(),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:p,it:g}=c,{oneOf:v}=p;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let m=d.propertyName;if(typeof m!="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)(m)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:m})),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:m}),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(p),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[m];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${m}"`);S=S&&(b||E(Z)),x(Y,M)}if(!S)throw new Error(`discriminator: "${m}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(m)}function x(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/${m}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${m}" values must be unique strings`);w[M]=Z}}}};e.default=i})),l0=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}})),T_=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=od(),o=E_(),n=ad(),s=l0(),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 p=Zn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var g=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),C_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=pt(),o=sc(),n=nd(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:p}=a;p.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=p.errSchemaPath==="#"?p.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:p}=a.it,{root:g,baseId:v,localRefs:m,meta:_}=u.root,{schemaId:h}=p.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:m,meta:_});return o.compileSchema.call(p,f),(0,n.getValidate)(a,f)}e.default=s})),k_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=pt(),o=nd(),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 p=c.slice(1);if(d.allErrors)g();else{let m=a.let("valid",!1);g(m),i.ok(m)}function g(m){if(d.schemaEnv.root.dynamicAnchors[p]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(p)}`);a.if(_,v(_,m),v(d.validateName,m))}else v(d.validateName,m)()}function v(m,_){return _?()=>a.block(()=>{(0,o.callRef)(i,m),a.let(_,!0)}):()=>(0,o.callRef)(i,m)}}e.dynamicRef=s,e.default=n})),d0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=C_(),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})),p0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=k_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),I_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=C_(),r=k_(),o=d0(),n=p0(),s=[t.default,r.default,o.default,n.default];e.default=s})),m0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=id(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),f0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=id(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),h0=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})),O_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=m0(),r=f0(),o=h0(),n=[t.default,r.default,o.default];e.default=n})),g0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=pt(),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:p,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(m(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(),p||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),p||i.if((0,t.not)(f),()=>i.break())}}function m(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})),_0=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),()=>p(g,u)),n.ok(g)}a.items=!0;function p(g,v){s.forRange("i",v,d,m=>{n.subschema({keyword:"unevaluatedItems",dataProp:m,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),N_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=g0(),r=_0(),o=[t.default,r.default];e.default=o})),S0=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"}]}}}}})),y0=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:"#"}}}}})),v0=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:"#"}}}})),b0=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:{}}}}})),z0=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"}}}})),R0=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}}}})),$0=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:[]}}}})),w0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=S0(),r=y0(),o=v0(),n=b0(),s=z0(),i=R0(),c=$0(),a=["/properties"];function u(d){return[t,r,o,n,p(this,s),i,p(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function p(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),P0=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=od(),o=E_(),n=I_(),s=O_(),i=N_(),c=ad(),a=w0(),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 p=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return p.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=Zn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var m=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),E0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=y_(),r=v_(),o=$_(),n=I_(),s=O_(),i=N_(),c=w_(),a=P_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),T0=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}}}})),C0=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"}}}}})),k0=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"}}}})),I0=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"}}}})),O0=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"}}}})),N0=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"}}}})),x0=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}}}})),j0=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:[]}}}})),A0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=T0(),r=C0(),o=k0(),n=I0(),s=O0(),i=N0(),c=x0(),a=j0(),u=["/properties"];function d(p){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,m){return p?v.$dataMetaSchema(m,u):m}}e.default=d})),q0=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=od(),o=E0(),n=ad(),s=A0(),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=Zn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),M0=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(),m),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,m),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,k=+(G[6]||0),j=+(G[7]||0);if(k>23||j>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-j*he,$=fe-k*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 p=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(p);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 m(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(p),[fe,$e]=Z.split(p),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 x=/[^\\]\\Z/;function F(M){if(x.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),L0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=T_(),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:p,it:g}=c,{opts:v,self:m}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,m.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:m.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=m.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${p}": 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[p].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),D0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=M0(),o=L0(),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[p,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,p,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let p=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function a(u,d,p,g){var v,m;(v=(m=u.opts.code).formats)!==null&&v!==void 0||(m.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,p[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),x_=T_(),Z0=P0(),U0=q0(),V0=ms(D0(),1),F0=V0.default;function rd(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return F0(t),t}var ic=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=rd(U0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Hd(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??=rd(Z0.Ajv2019):this._ajvDraft7??=rd(x_.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)}}},hP=x_.Ajv;import cd from"node:process";var U_=Symbol.for("mcp.completable");function ld(e){return!!e&&typeof e=="object"&&U_ in e}function B0(e){return e[U_]?.complete}var iE=2**31-1;function K0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var G0=8,W0=6e5;function Y0(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??G0,roundTimeoutMs:e?.roundTimeoutMs??W0,legacyShim:e?.legacyShim??!0}}function V_(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=Mg(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 X0(){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 ud(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var Q0=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 ud(e,s_(e,s));let d=a.inputRequests,p=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!p&&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(p){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=V_(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(Ka(b,h)!==void 0)return ud(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=a_(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 ud(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await i_(n_,c);let m={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:Dn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,m,e);h!==void 0&&(m=Wl(m,h))}let _=await t(r,m);if(!kt(_))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:X0()}),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)}}},eR=new Set(["tools/call","prompts/get","resources/read"]),tR,rR,oR;var F_=class extends Yl{_clientCapabilities;_clientVersion;static{tR=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},rR=(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())},oR=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Q0({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 ic,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=Y0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Ml(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Ol(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=Xa(Gt,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?.[Vt],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(Gt.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=Xl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=eR.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(kt(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(kt(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:Ga(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(kt(i))return i;let c=Nl(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&&Ln(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 p=await this._verifyRequestState(s,o,e);p!==void 0&&(i=Wl(o,p))}let c;try{c=await t(r,i)}catch(p){throw p instanceof oe&&p.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.`):p}if(!kt(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??mr}, 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 p=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:m,required:_}=V_(e,g,v),h=Ka(_,p);if(h!==void 0)throw new Ya({requiredCapabilities:h},`Cannot request input '${g}' (${m.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?.[Tt]: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=Lg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??mr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Ol(this._supportedProtocolVersions),capabilities:nR(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(p=>p.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(p=>p.type==="tool_use");if(c){if(i.some(p=>p.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 p=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(p.size!==g.size||![...p].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 nR(e){return{...e}}function sR(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 iR(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 ac=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 A_;try{let r=Sr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new F_(e,t),this._maxToolInputElements=iR(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return K0(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?aR(e,t.inputSchema):A_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Sr(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),kt(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&&sR(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 _r(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||kt(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 _r(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 Jl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Bl(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 Un;let o=Z_(D_(r.argsSchema)?.[e.params.argument.name]);if(!ld(o))return Un;let n=B0(o);return n?L_(await n(e.params.argument.value,e.params.context)):Un}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 Un;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?L_(await o(e.params.argument.value,e.params.context)):Un}_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 Ga(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 Ga(await n.readCallback(r,s,t),n.cacheHint)}}throw new Wa(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?o_(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&&Ml(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:M_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(delete this._registeredPrompts[e],p.name&&(this._registeredPrompts[p.name]=d)),p.title!==void 0&&(d.title=p.title),p.description!==void 0&&(d.description=p.description),p.icons!==void 0&&(d.icons=p.icons),p.scopeChallenge!==void 0&&(d.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(d._meta=p._meta);let g=!1;p.argsSchema!==void 0&&(d.argsSchema=p.argsSchema,a=p.argsSchema,g=!0),p.callback!==void 0&&(u=p.callback,g=!0),g&&(d.handler=M_(e,a,u)),p.enabled!==void 0&&(d.enabled=p.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let p=D_(o);p&&Object.values(p).some(g=>ld(Z_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){td(e);let p=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=q_(v.outputSchema)},set outputSchemaJson(m){g=m},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:j_(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(typeof m.name=="string"&&td(m.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],m.name&&(delete this._toolInputSchemaJson[m.name],this._registeredTools[m.name]=v,e=m.name)),m.title!==void 0&&(v.title=m.title),m.description!==void 0&&(v.description=m.description);let _=!1;m.paramsSchema!==void 0&&(v.inputSchema=m.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),m.callback!==void 0&&(v.handler=m.callback,p=m.callback,_=!0),_&&(v.executor=j_(v.inputSchema,p)),m.outputSchema!==void 0&&(v.outputSchema=m.outputSchema,v.outputSchemaJson=q_(m.outputSchema)),m.annotations!==void 0&&(v.annotations=m.annotations),m.icons!==void 0&&(v.icons=m.icons),m.scopeChallenge!==void 0&&(v.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(v._meta=m._meta),m.enabled!==void 0&&(v.enabled=m.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,Qa(s),Qa(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,Qa(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 j_(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var A_={type:"object",properties:{}};function aR(e,t){let r=Sr(t,"input"),o=Kl(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 q_(e){if(e!==void 0)try{return Sr(e,"output")}catch{return}}function M_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await _r(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 L_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Un={completion:{values:[],hasMore:!1}};function D_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function cR(e){return e?.type==="optional"}function Z_(e){return cR(e)?e.def?.innerType??e:e}var eT=4*1024*1024;var H_=Symbol("swallowsErrorsAfterClose"),J_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=cd.stdin,t=cd.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Ql({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[H_]&&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[H_]=!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=ed(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 gR}from"node:path";function B_(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 K_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},G_=zd(),_R=Pd.map(e=>e.id),SR=B_($d.options([K_],{},mc),"degrees").map(Number),ST=B_(wd.options([K_],{},mc),"mode");var Vn=l().refine(gR,"must be an absolute path").describe("An absolute path."),cc=I(Vn).min(1),yR=Zt("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."),W_=P({paths:cc.describe("Absolute paths of files (or folders) to inspect.")}),Y_=P({}),X_=P({paths:cc.describe("Absolute paths of files, folders or globs to convert."),to:se(G_).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim, crop or resize, which keep each image's own format when it is omitted.`),output:Vn.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)."),crop:l().optional().describe('Images only: cut to a shape W:H (e.g. "1:1", "4:5", "16:9", "9:16"; whole numbers 1-100), the largest box that fits, placed to keep the subject; writes name-cropped-1x1, or name-cropped-1x1-<W>x<H> with resize, which then applies to the cropped image. Keeps the format unless `to` is given. Refused for animated images and when the image already has that shape (unless also resizing). Not with trim.'),resize:W([Me({percent:L().min(1).max(Zd)}),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`.")}),Q_=P({paths:cc.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:Vn.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."}),eS=P({to:se(G_).optional().describe("Convert to this format id. Default: compress, keeping the image's own format."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb".'),save:Vn.optional().describe("Also write the result into this folder."),undo:H().optional().describe("Put the last original back instead. Takes no other argument.")}).refine(e=>!(e.quality!==void 0&&e.maxSize!==void 0),{message:"Give at most one of quality or maxSize."}).refine(e=>!e.undo||Object.keys(e).every(t=>t==="undo"),{message:"undo takes no other argument."}),tS=P({op:se(_R).describe("The page operation."),paths:cc.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(SR).optional().describe("rotate: degrees clockwise."),split:yR.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Fn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),vR=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),Hn=Me({forge:l(),ok:H(),results:I(vR),failures:I(Fn)}),rS=Hn.extend({clipboard:se(["placed","changed","restored"]).optional(),saved:l().optional()}),oS=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:se(["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(Fn)}),nS=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Fn)}),dd=l().describe("A colour: #RRGGBB, #RGB (or without the #), rgb(), hsl(), oklch(), or a CSS or common colour name"),pd={svg:H().optional().describe("Also return the SVG card of swatches as text, which Figma pastes as layers"),copy:H().optional().describe("Put the SVG card on the user's clipboard, replacing what is there, ready to paste into Figma. Only when the user wants it copied")},sS=P({path:Vn.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:dd.optional().describe("Show the shades of the palette colour nearest this one"),...pd}),iS=P({colour:dd,...pd}),aS=P({title:l().min(1).describe("The card's heading, e.g. the palette's name"),subtitle:l().optional().describe('The grey line under the title. Default: "N colours"'),colours:I(P({name:l().min(1).describe("Shown under the swatch and used as its layer name, e.g. blue-600 or blue/600"),colour:dd})).min(1).describe("The colours, in the order they should appear"),theme:se(["light","dark"]).optional().describe("The card's background. Default: light"),copy:pd.copy}),cS=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(Fn)}),uS=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Fn)});import{Writable as bR}from"node:stream";function lS(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new bR({write(o,n,s){r(o,n,s)}})}import{basename as zR}from"node:path";import{pathToFileURL as RR}from"node:url";var md={interactive:!1},dS=Promise.resolve();function fd(e){let t=dS.then(e,e);return dS=t.catch(()=>{}),t}var Jn=(e,t)=>fd(()=>Dd(e,t===void 0?md:{...md,signal:t}));function pS(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 hd(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(pS));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:RR(o).href,name:zR(o)}));return{content:[{type:"text",text:t.join(`
|
|
69
|
+
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var co=e=>hd(ds(_t,e)),ft=e=>hd(Td(_t,e));async function mS(e){let t=kd(_t,await Ed(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(pS)),{content:[{type:"text",text:r.join(`
|
|
70
|
+
`)}],structuredContent:{...t},isError:!t.ok}}function fS(){let e=Cd(_t,Rd());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 hS(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.crop!==void 0||e.resize!==void 0){let i=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",c=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...r,...e.pages!==void 0?["pages"]:[]][0];if(c!==void 0)return ft(st(`${i} cannot be combined with ${c}.`,"Run them one after the other."));let a;if(e.crop!==void 0)try{a={aspect:bd(e.crop)}}catch(d){if(!Mo(d))throw d;return ft(st(d.detail,'Try crop "1:1" or "16:9".'))}let u={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,...a===void 0?{}:{crop:a},...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return co(await Jn(u))}if(e.to===void 0)return ft(st("forge_convert needs `to`, the target format.","Only trim, crop 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 ft(st(`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 co(await Jn(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 co(await Jn(s))}async function gS(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=pc(e.maxSize);if(r===void 0)return ft(st(`${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),co(await Jn(t))}async function _S(e,t={}){try{if(e.undo)return await fd(()=>jd(t)),{content:[{type:"text",text:"\u2713 The original is back on the clipboard"}],structuredContent:{...ds(_t,{results:[],failures:[]}),clipboard:"restored"},isError:!1};let r={kind:"clip",undo:!1,debug:!1};if(e.to!==void 0&&(r.target=e.to),e.quality!==void 0&&(r.quality=e.quality),e.save!==void 0&&(r.save=e.save),e.maxSize!==void 0){let i=pc(e.maxSize);if(i===void 0)return ft(st(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));r.maxBytes=i}let o=await fd(()=>Nd(r,{...md,clip:t}));if(o.status==="failed")return co(o.report);let n=ds(_t,o.report),s=hd(n);return{...s,content:[{type:"text",text:xd(o).join(`
|
|
72
|
+
`)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!Mo(r))throw r;return ft(r)}}async function SS(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 ft(st(`${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 ft(st("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return ft(st("split needs a split mode: every-page, every-n or points."));t.split=e.split}return co(await Jn(t))}function Bn(e){return{content:[{type:"text",text:e}],isError:!0}}function $R(e){if(e.pasteboard)return e.pasteboard;if(!Id())throw vd();return Od()}var wR=process.platform==="darwin"?"\u2318V":"Ctrl+V";async function gd(e,t,r,o){if(!r.svg&&!r.copy)return e;let n=t(),s=[...e.content];if(r.copy){try{await $R(o).writeText(n,"")}catch(c){let a=Mo(c)?c.detail:c instanceof Error?c.message:String(c);return Bn(`The card could not be put on the clipboard: ${a}`)}let i=r.swatches;s.push({type:"text",text:`Copied a card of ${i} swatch${i===1?"":"es"} to the clipboard. Paste it into Figma with ${wR}: one layer per colour.`})}return r.svg&&s.push({type:"text",text:n}),{...e,content:s}}async function yS(e,t={}){let r=e.inside===void 0?void 0:ls(e.inside)?.rgb;if(e.inside!==void 0&&!r)return Bn(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{readPalette:o}=await import("./colour-VBHJAKAX.js"),n=await o({kind:"palette",input:e.path,svg:!1,...r?{inside:r}:{}}),s=n.doc,i=Ld(s.palette.colours.map(u=>u.share)),a={content:[{type:"text",text:s.palette.colours.map((u,d)=>`${u.hex} ${i[d]}%`).join(`
|
|
73
|
+
`)}],structuredContent:{...s}};return await gd(a,n.svg,{svg:e.svg,copy:e.copy,swatches:s.palette.colours.length},t)}catch(o){if(Mo(o))return Bn(`${o.title}: ${o.detail}${o.hint?` ${o.hint}`:""}`);throw o}}async function vS(e,t={}){let r=ls(e.colour)?.rgb;if(!r)return Bn(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:o}=await import("./colour-VBHJAKAX.js"),n=await o({kind:"scale",colour:r,svg:!1},{json:!0,colour:!1}),s=JSON.parse(n.stdout[0]??"{}"),c={content:[{type:"text",text:s.scale.steps.map(u=>`${u.step} ${u.hex} white ${u.white} black ${u.black}`).join(`
|
|
74
|
+
`)}],structuredContent:{...s}};return gd(c,()=>Md(r,Ad(r)),{svg:e.svg,copy:e.copy,swatches:s.scale.steps.length},t)}async function bS(e,t={}){let r=[],o=[];for(let{name:c,colour:a}of e.colours){let u=ls(a);if(!u){o.push(`${c}: ${a}`);continue}let d=yd(u.rgb),p=u.alpha!==void 0&&u.alpha<1?u.alpha:void 0;r.push({id:c,name:c,value:p===void 0?d:`${d} ${Math.round(p*100)}%`,hex:d,...p===void 0?{}:{alpha:p}})}if(o.length>0)return Bn(`Not ${o.length===1?"a colour":"colours"}: ${o.join(", ")}. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let n=r.length,s=e.subtitle??`${n} colour${n===1?"":"s"}`,i=()=>qd(e.title,s,r,e.theme,{perRow:8});return e.copy?gd({content:[]},i,{copy:!0,swatches:n},t):{content:[{type:"text",text:i()}]}}function PR(e=process.platform){return[`Forge converts, compresses and edits files on this ${e==="win32"?"PC":e==="darwin"?"Mac":"computer"}, 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 ER=PR(),zS={readOnlyHint:!0,openWorldHint:!1},_d={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},uc={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function TR(e={}){let t=new ac({name:"forge",version:_t},{instructions:ER});return t.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:W_,outputSchema:oS,annotations:zS},r=>mS(r)),t.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:Y_,outputSchema:nS,annotations:zS},()=>fS()),t.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, crop (to a shape such as 1:1, keeping the subject) or resize they keep their format unless `to` is given. Returns every output path and a file:// link to each.",inputSchema:X_,outputSchema:Hn,annotations:uc},(r,o)=>hS(r,o.mcpReq.signal)),t.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. PNG and GIF are cut to fewer colours. A result no smaller than the source is never written (error code cannot-compress-more).',inputSchema:Q_,outputSchema:Hn,annotations:uc},r=>gS(r)),t.registerTool("forge_clip",{title:"Compress the copied image",description:"The image on the clipboard, made smaller (quality or maxSize) or converted (to), and put back on the clipboard, so the next paste is the result. The result is also kept as a file, linked. A newer copy is never overwritten: if something else was copied meanwhile, the result goes to the default folder instead. A compression that would come out larger is refused. undo: true puts the last original back.",inputSchema:eS,outputSchema:rS,annotations:{...uc,destructiveHint:!0}},r=>_S(r,e.clip)),t.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:tS,outputSchema:Hn,annotations:uc},r=>SS(r)),t.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. svg: true also returns them as an SVG card of swatches; copy: true puts that card on the user's clipboard to paste into Figma. Writes no file.",inputSchema:sS,outputSchema:cS,annotations:_d},r=>yS(r,e.clip)),t.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. svg: true also returns it as an SVG card of swatches; copy: true puts that card on the user's clipboard to paste into Figma. Writes no file.",inputSchema:iS,outputSchema:uS,annotations:_d},r=>vS(r,e.clip)),t.registerTool("forge_card",{title:"Colour card for Figma",description:"Named colours drawn as an SVG card of swatches, returned as text. Paste into Figma, it is one layer per colour, named as given, with its exact fill. copy: true puts it on the user's clipboard instead of returning it, so they can press \u2318V (Ctrl+V) in Figma straight away. Use it to turn a colour system written in words into something the user can paste. Writes no file.",inputSchema:aS,annotations:_d},r=>bS(r,e.clip)),t}async function BT(e){if(e.length>0)throw st(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=lS();await TR().connect(new J_(process.stdin,t))}export{ER as INSTRUCTIONS,TR as createForgeServer,PR as instructionsFor,BT as runMcpServer};
|