forge-terminal 0.6.0 → 0.7.0

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.
Files changed (121) hide show
  1. package/README.md +38 -7
  2. package/dist/chunks/{about-credits-XL2AIGQ7.js → about-credits-PWTKZG3Y.js} +1 -1
  3. package/dist/chunks/args-RHIBM3R3.js +3 -0
  4. package/dist/chunks/{available-TNMISSBA.js → available-FPBRQ3LS.js} +1 -1
  5. package/dist/chunks/{boot-QRKC4QBA.js → boot-PHDTJAFT.js} +1 -1
  6. package/dist/chunks/{catalog-FMHWWMUX.js → catalog-G44MXIAF.js} +1 -1
  7. package/dist/chunks/{check-HOITNMJX.js → check-BFHBPCGW.js} +1 -1
  8. package/dist/chunks/{chunk-EIPMQFIF.js → chunk-2YU4EI24.js} +1 -1
  9. package/dist/chunks/chunk-3IAJTXYM.js +3 -0
  10. package/dist/chunks/{chunk-ECA4PW5T.js → chunk-3OCPO5V6.js} +1 -1
  11. package/dist/chunks/chunk-42IEPG2K.js +3 -0
  12. package/dist/chunks/{chunk-BYUOU2Q2.js → chunk-4AL5QJLM.js} +1 -1
  13. package/dist/chunks/{chunk-UUTBDIFR.js → chunk-56B3VZCM.js} +1 -1
  14. package/dist/chunks/{chunk-QIMSNTKL.js → chunk-56QHX7QR.js} +1 -1
  15. package/dist/chunks/{chunk-HXKLYK3M.js → chunk-6NCN7OJ5.js} +1 -1
  16. package/dist/chunks/{chunk-YBA6DJQ4.js → chunk-6PUV4HSU.js} +1 -1
  17. package/dist/chunks/{chunk-2OSM4W4D.js → chunk-72UR37EG.js} +1 -1
  18. package/dist/chunks/{chunk-3IX3QA76.js → chunk-7NP76V4U.js} +1 -1
  19. package/dist/chunks/{chunk-5FJT4BNY.js → chunk-AETM2PCZ.js} +1 -1
  20. package/dist/chunks/{chunk-GIG4I2IC.js → chunk-BQV3DSUZ.js} +2 -2
  21. package/dist/chunks/chunk-DC2DHMXO.js +3 -0
  22. package/dist/chunks/{chunk-6HUYBVQA.js → chunk-DKHBJ52G.js} +1 -1
  23. package/dist/chunks/chunk-E5VPEBUQ.js +3 -0
  24. package/dist/chunks/chunk-F4TUCI6D.js +3 -0
  25. package/dist/chunks/{chunk-MF3KKEFB.js → chunk-FEJSM3E4.js} +1 -1
  26. package/dist/chunks/{chunk-JUA63KQK.js → chunk-G2V33TMN.js} +1 -1
  27. package/dist/chunks/{chunk-FXA45V4B.js → chunk-G4M2XYFJ.js} +1 -1
  28. package/dist/chunks/{chunk-WID72ZII.js → chunk-H332YFSO.js} +1 -1
  29. package/dist/chunks/chunk-HAOKWLD3.js +4 -0
  30. package/dist/chunks/{chunk-S7BZPV5T.js → chunk-I3C3SRF2.js} +1 -1
  31. package/dist/chunks/{chunk-NUTTDNTG.js → chunk-ID4GJZJ6.js} +1 -1
  32. package/dist/chunks/{chunk-X4QI2EYV.js → chunk-ID75X37Z.js} +1 -1
  33. package/dist/chunks/{chunk-FWVE3GNA.js → chunk-JPASVE56.js} +1 -1
  34. package/dist/chunks/{chunk-UN5DSJE2.js → chunk-JZM37DG2.js} +1 -1
  35. package/dist/chunks/{chunk-G6L5NIJ5.js → chunk-KPUKMAYK.js} +1 -1
  36. package/dist/chunks/{chunk-UEAZTRTL.js → chunk-M7HB4L6L.js} +1 -1
  37. package/dist/chunks/{chunk-NLM2SP3F.js → chunk-OK56WDPA.js} +1 -1
  38. package/dist/chunks/{chunk-I25E2XDH.js → chunk-OLKPV4WO.js} +1 -1
  39. package/dist/chunks/chunk-OPDC577C.js +3 -0
  40. package/dist/chunks/chunk-OQ6DTE56.js +3 -0
  41. package/dist/chunks/chunk-PNPAHKJR.js +3 -0
  42. package/dist/chunks/{chunk-3HG7RXC2.js → chunk-PXCEMDOY.js} +2 -2
  43. package/dist/chunks/{chunk-YJZEHJ6U.js → chunk-QMNERJL2.js} +1 -1
  44. package/dist/chunks/{chunk-TNIPRV6K.js → chunk-R6QVLPGC.js} +1 -1
  45. package/dist/chunks/{chunk-65Y7YCZZ.js → chunk-S44LAUHZ.js} +1 -1
  46. package/dist/chunks/{chunk-YYZYZWF5.js → chunk-SCJ2QXZF.js} +22 -22
  47. package/dist/chunks/{chunk-QO4JUY6B.js → chunk-SJIDFYPT.js} +1 -1
  48. package/dist/chunks/{chunk-PISCJKIG.js → chunk-TQEGSODD.js} +1 -1
  49. package/dist/chunks/chunk-ULX4ZD2Y.js +3 -0
  50. package/dist/chunks/{chunk-BWJNZT75.js → chunk-W6QOV4RP.js} +1 -1
  51. package/dist/chunks/chunk-WWWWXOM4.js +3 -0
  52. package/dist/chunks/{chunk-2JU3YZQU.js → chunk-XIR3VWQY.js} +1 -1
  53. package/dist/chunks/chunk-XUJLUOGD.js +6 -0
  54. package/dist/chunks/chunk-Y3DMALHT.js +66 -0
  55. package/dist/chunks/chunk-YXV3PYVI.js +3 -0
  56. package/dist/chunks/{chunk-QPUKPSPZ.js → chunk-Z3PQ5TMU.js} +1 -1
  57. package/dist/chunks/chunk-ZL7E7PZN.js +4 -0
  58. package/dist/chunks/clip-command-6Q7BTXR5.js +3 -0
  59. package/dist/chunks/{clipboard-W67Q22JG.js → clipboard-QWNPA3GM.js} +1 -1
  60. package/dist/chunks/colour-7HPH6KTY.js +3 -0
  61. package/dist/chunks/{command-ZX3L5VFO.js → command-JTK4IOS7.js} +1 -1
  62. package/dist/chunks/{config-command-VEGQPXVB.js → config-command-DIQTU7DM.js} +1 -1
  63. package/dist/chunks/{continue-editing-LTMIEFRD.js → continue-editing-FTUY6UFG.js} +1 -1
  64. package/dist/chunks/{decoded-SK6W44WW.js → decoded-IXLPWTGZ.js} +1 -1
  65. package/dist/chunks/{entry-3R2GK3IW.js → entry-ZF7D32ZI.js} +2 -2
  66. package/dist/chunks/execute-RP7ZMWLZ.js +3 -0
  67. package/dist/chunks/extensions-YOZ4IF4E.js +3 -0
  68. package/dist/chunks/{extensions-command-RNAPQYWV.js → extensions-command-O7UHUJ3Y.js} +1 -1
  69. package/dist/chunks/{ffmpeg-G4TRWUTV.js → ffmpeg-2ZP3GXJX.js} +1 -1
  70. package/dist/chunks/{image-67XO45NW.js → image-6A7FXKIR.js} +1 -1
  71. package/dist/chunks/{install-X7EEH5CQ.js → install-4L7JGP3X.js} +1 -1
  72. package/dist/chunks/{install-UN3YGSJW.js → install-XJAPLIH2.js} +1 -1
  73. package/dist/chunks/launch-2KSJ4GGN.js +18 -0
  74. package/dist/chunks/link-inputs-GTEW6ZH4.js +3 -0
  75. package/dist/chunks/{lock-5ZO5PCZP.js → lock-KNR7XS7Q.js} +1 -1
  76. package/dist/chunks/manager-YH5XAMZA.js +4 -0
  77. package/dist/chunks/{needed-7IUPDEJB.js → needed-TB3OC76N.js} +1 -1
  78. package/dist/chunks/{own-5BD5BVE7.js → own-KUGTZ3BV.js} +1 -1
  79. package/dist/chunks/{paths-6OENILJ4.js → paths-BBUKTDDP.js} +1 -1
  80. package/dist/chunks/pdfium-MJ65YOXW.js +3 -0
  81. package/dist/chunks/{preferences-E2CH2YSG.js → preferences-7S7YZOFK.js} +1 -1
  82. package/dist/chunks/preset-command-KMKR6KMG.js +3 -0
  83. package/dist/chunks/registry-657JRJR5.js +3 -0
  84. package/dist/chunks/{run-3DX3SROY.js → run-VJDF5WRF.js} +1 -1
  85. package/dist/chunks/{server-TF32DQEO.js → server-6PH2DSFW.js} +20 -20
  86. package/dist/chunks/{signals-QSXY3F2A.js → signals-VY2XE3LV.js} +1 -1
  87. package/dist/chunks/{theme-4Y66DDAO.js → theme-FVQOSLPB.js} +1 -1
  88. package/dist/chunks/{transcribe-HH5P3PV4.js → transcribe-FUN2SKRN.js} +1 -1
  89. package/dist/chunks/transcribe-command-KNSUHROE.js +3 -0
  90. package/dist/chunks/{update-command-6VVDG75Y.js → update-command-X4OSYETA.js} +1 -1
  91. package/dist/chunks/{update-note-XV2T2NNG.js → update-note-LV7G4CHE.js} +1 -1
  92. package/dist/chunks/video-link-CF7GUA6V.js +3 -0
  93. package/dist/chunks/watch-command-3C4AWM7A.js +3 -0
  94. package/dist/index.js +7 -7
  95. package/package.json +9 -13
  96. package/skills/forge/SKILL.md +7 -3
  97. package/dist/chunks/args-PS5SVBZY.js +0 -3
  98. package/dist/chunks/chunk-2L66A2X6.js +0 -3
  99. package/dist/chunks/chunk-3SVHRKQH.js +0 -6
  100. package/dist/chunks/chunk-4MZV4SRU.js +0 -4
  101. package/dist/chunks/chunk-4NDZTK22.js +0 -3
  102. package/dist/chunks/chunk-5XJCMMCM.js +0 -3
  103. package/dist/chunks/chunk-CCNRNCRU.js +0 -3
  104. package/dist/chunks/chunk-EEQSUBBL.js +0 -3
  105. package/dist/chunks/chunk-EJWTYDBJ.js +0 -3
  106. package/dist/chunks/chunk-JD3RB6IV.js +0 -66
  107. package/dist/chunks/chunk-NMGQGYVM.js +0 -3
  108. package/dist/chunks/chunk-SFN3LBB6.js +0 -3
  109. package/dist/chunks/chunk-UI4EUC3S.js +0 -3
  110. package/dist/chunks/chunk-X2YUHPOU.js +0 -4
  111. package/dist/chunks/clip-command-4ON3Q57W.js +0 -3
  112. package/dist/chunks/colour-2BGK2BFR.js +0 -3
  113. package/dist/chunks/execute-TC3QZ6GL.js +0 -3
  114. package/dist/chunks/extensions-3SG2LW7R.js +0 -3
  115. package/dist/chunks/launch-EGFNGHLN.js +0 -18
  116. package/dist/chunks/manager-272REVNF.js +0 -4
  117. package/dist/chunks/pdfium-MHPBLZY5.js +0 -3
  118. package/dist/chunks/preset-command-5I3NZ2OP.js +0 -3
  119. package/dist/chunks/registry-DWFV4GBG.js +0 -3
  120. package/dist/chunks/transcribe-command-VY5HYNXV.js +0 -3
  121. package/dist/chunks/watch-command-BMSMGIHK.js +0 -3
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __forgeCreateRequire } from 'node:module';
2
2
  const require = __forgeCreateRequire(import.meta.url);
3
- import{c as Yd,d as Xd}from"./chunk-EIPMQFIF.js";import{a as Kd}from"./chunk-SFN3LBB6.js";import{c as Bd}from"./chunk-YBA6DJQ4.js";import{a as Ld,b as Dd,c as Zd}from"./chunk-YJZEHJ6U.js";import"./chunk-JUA63KQK.js";import{a as qd,c as Md}from"./chunk-NUTTDNTG.js";import{a as xd,d as Gd}from"./chunk-X2YUHPOU.js";import{c as kd,d as Id,h as Od}from"./chunk-EJWTYDBJ.js";import"./chunk-UI4EUC3S.js";import"./chunk-2L66A2X6.js";import{g as Vd,i as Hd}from"./chunk-G6L5NIJ5.js";import{i as Fd,o as Jd}from"./chunk-5FJT4BNY.js";import"./chunk-6RMRWBMB.js";import"./chunk-X4QI2EYV.js";import"./chunk-QIMSNTKL.js";import"./chunk-ECA4PW5T.js";import{b as Wd}from"./chunk-QPUKPSPZ.js";import{d as Td,f as Cd}from"./chunk-PISCJKIG.js";import{b as Ud}from"./chunk-HZDYZ5RD.js";import{b as wd,j as ms,k as Pd}from"./chunk-EYOO35US.js";import{f as fs,g as Nd,h as jd,i as Ad}from"./chunk-YJ6XLDRA.js";import"./chunk-63XCSYHM.js";import{a as _t}from"./chunk-WID72ZII.js";import"./chunk-O7DK3GJT.js";import"./chunk-65Y7YCZZ.js";import"./chunk-NMGQGYVM.js";import"./chunk-EEQSUBBL.js";import"./chunk-BSFBZBAI.js";import"./chunk-BWJNZT75.js";import"./chunk-3IX3QA76.js";import"./chunk-PON65UTS.js";import"./chunk-FWVE3GNA.js";import{m as Ed}from"./chunk-QO4JUY6B.js";import"./chunk-UN5DSJE2.js";import"./chunk-6HUYBVQA.js";import"./chunk-KXKQDFHX.js";import{b as gc}from"./chunk-4MZV4SRU.js";import"./chunk-BYUOU2Q2.js";import"./chunk-NUCGWLOY.js";import"./chunk-I2LPGKUU.js";import"./chunk-HON4OV7M.js";import{P as st,R as Rd,f as Zo,ma as $d}from"./chunk-CCNRNCRU.js";import{e as hc}from"./chunk-FGR6QCG5.js";import"./chunk-VLVNA4T3.js";import{d as fc}from"./chunk-TMUK2DD3.js";var KS=Object.create,hs=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,WS=Object.getOwnPropertyNames,YS=Object.getPrototypeOf,XS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qd=(e,t)=>{let r={};for(var o in e)hs(r,o,{get:e[o],enumerable:!0});return t&&hs(r,Symbol.toStringTag,{value:"Module"}),r},QS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=WS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!XS.call(e,c)&&c!==r&&hs(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=GS(t,c))||o.enumerable});return e},gs=(e,t,r)=>(r=e!=null?KS(YS(e)):{},QS(t||!e||!e.__esModule?hs(r,"default",{value:e,enumerable:!0}):r,e));var ey=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),ep=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),ty=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),ry=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function tp(e){return typeof e=="string"&&ep.has(e.replace(/#$/,""))}function rp(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(ey.has(r))return"2020-12";if(ep.has(r))return"2019-09";if(ty.has(r)||ry.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={};fc(ce,{BIGINT_FORMAT_RANGES:()=>vs,CONSTANT_CATCH:()=>mp,Class:()=>yc,NUMBER_FORMAT_RANGES:()=>Fo,aborted:()=>ut,allowsEval:()=>wc,assert:()=>ay,assertEqual:()=>oy,assertIs:()=>sy,assertNever:()=>iy,assertNotEqual:()=>ny,assignProp:()=>Ye,attachSchema:()=>Vo,base64ToUint8Array:()=>dp,base64urlToUint8Array:()=>Py,cached:()=>Nr,captureStackTrace:()=>Ss,cleanEnum:()=>wy,cleanRegex:()=>Uo,clone:()=>it,cloneDef:()=>ly,codePointLength:()=>Ho,constantCatch:()=>fp,createTransparentProxy:()=>gy,defineLazy:()=>zc,defineLazyInternal:()=>ge,derived:()=>ky,esc:()=>Rc,escapeRegex:()=>vt,explicitlyAborted:()=>Tc,extend:()=>yy,finalizeIssue:()=>lt,floatSafeRemainder:()=>bc,getElementAtPath:()=>dy,getEnumValues:()=>Or,getLengthableOrigin:()=>Jo,getParsedType:()=>hy,getSizableOrigin:()=>lp,hexToUint8Array:()=>Ty,hide:()=>Rs,installLazyProp:()=>Ny,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>Ar,joinValues:()=>_s,jsonStringifyReplacer:()=>xr,members:()=>kc,merge:()=>by,mergeDefs:()=>yt,normalizeParams:()=>re,nullish:()=>vc,numKeys:()=>fy,objectClone:()=>cy,omit:()=>Sy,optionalKeys:()=>Ec,own:()=>qt,parsedType:()=>Cc,partial:()=>zy,pick:()=>_y,prefixIssues:()=>bt,primitiveTypes:()=>cp,promiseAllObject:()=>py,propertyKeyTypes:()=>Pc,randomString:()=>my,rawShape:()=>jr,required:()=>Ry,safeExtend:()=>vy,shallowClone:()=>ap,sizeCaps:()=>zs,slugify:()=>$c,stringifyPrimitive:()=>ys,toZod:()=>np,uint8ArrayToBase64:()=>pp,uint8ArrayToBase64url:()=>Ey,uint8ArrayToHex:()=>Cy,unwrapMessage:()=>Ir});function oy(e){return e}function ny(e){return e}function np(){return e=>e}function sy(e){}function iy(e){throw new Error("Unexpected value in exhaustive check")}function ay(e){}function Or(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 _s(e,t="|"){return e.map(r=>ys(r)).join(t)}function xr(e,t){return typeof t=="bigint"?t.toString():t}var Sc=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 Sc(e)}function vc(e){return e==null}function Uo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function bc(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 op=Symbol("evaluating");function zc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==op)return o===void 0&&(o=op,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function cy(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 sp(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function ip(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?sp(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):ip(e,s,o?o(i.value,s):i.value))}}function uy(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?sp(e,r,()=>t[r]):ip(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 ly(e){return yt(e._zod.def)}function dy(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function py(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 my(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Rc(e){return JSON.stringify(e)}function $c(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wc=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 ap(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function fy(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var hy=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}`)}},Pc=new Set(["string","number","symbol"]),cp=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 re(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 gy(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 ys(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ec(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Fo={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]},vs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _y(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,bs(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function bs(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 Sy(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(bs(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function yy(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:up(e,t)}))}function up(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),uy(r,t),r}function vy(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:up(e,t)}))}function by(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 zy(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(bs(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 Ry(e,t,r){let o=r?new Set(bs(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 Tc(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 Ir(e){return typeof e=="string"?e:e?.message}function zs(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 Vo(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:Ir(e.inst?._zod.def?.error?.(e))??Ir(s?.(e))??Ir(t?.error?.(e))??Ir(r.customError?.(e))??Ir(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 lp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var $y=/[\uD800-\uDBFF]/;function Ho(e){let t=e.length;if(!$y.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 Jo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cc(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 Ar(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function wy(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function dp(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 pp(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Py(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return dp(t+r)}function Ey(e){return pp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ty(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 Cy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var yc=class{constructor(...t){}};function kc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):Iy(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 Rs(e,t,r){return qt(e,t,r,!1)}function ky(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 Iy(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 Oy(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var _c,At=!1,xy={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&_c!==e._zod){_c=void 0;return}_c=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,xy);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 Ny(e,t,r,o){let n=Oy(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 mp="~constantCatch";function fp(e){let t=()=>e;return t[mp]=!0,t}var hp,Oc=Object.freeze({status:"aborted"}),Ic={value:void 0,enumerable:!1},gp="captureStackTrace"in Error?Error:null;function jy(e){let t=gp;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return gp=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{Ic.value=new s(v);try{Object.defineProperty(g,"_zod",Ic)}finally{Ic.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),kc(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?jy(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.")}},qr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(hp=globalThis).__zod_globalConfig??(hp.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function Ay(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,xr,2)),e.message}function qy(e){this._zod.message=e}var My={get:Ay,set:qy,enumerable:!0,configurable:!0},Nc={value:void 0,enumerable:!1},_p=new WeakSet([Object.prototype,Error.prototype]),Sp=(e,t)=>{e.name="$ZodError",Nc.value=t,Object.defineProperty(e,"issues",Nc),Nc.value=void 0,Object.defineProperty(e,"message",My);let r=Object.getPrototypeOf(e);_p.has(r)||(_p.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})}}))},yp=q("$ZodError",Sp),l$=q("$ZodError",Sp,void 0,{Parent:Error});function Ly(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 jc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?Ly(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ac(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 $s(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ws=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 Ss(a,s?.callee??t),a}return c.value};return t};var Ps=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 Ss(a,s?.callee??t),a}return c.value};return t};var Es=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?vp(e,s.issues,n):{success:!0,data:s.value}};function vp(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 Ts=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?vp(e,s.issues,n):{success:!0,data:s.value}};var Dy=Symbol.for("zod.compile.invalid"),Zy=Symbol.for("zod.compile.fallback"),qc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==Dy)return!0;if(o.definite===!0&&r===void 0)return!1}return Uy(e,t,r)});function Uy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[Zy]=!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 Mc=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},bp=e=>{let t=ws(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,$s(r,i))};return r};var zp=e=>{let t=ws(e),r=(o,n,s,i)=>t(o,n,s,$s(r,i));return r};var Rp=e=>{let t=Ps(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,$s(r,i))};return r};var $p=e=>{let t=Ps(e),r=async(o,n,s,i)=>await t(o,n,s,$s(r,i));return r};var wp=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Es(e)(t,r,n)};var Pp=e=>(t,r,o)=>Es(e)(t,r,o);var Ep=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ts(e)(t,r,n)};var Tp=e=>async(t,r,o)=>Ts(e)(t,r,o);var Cp=/^[cC][0-9a-z]{6,}$/,kp=/^[0-9a-z]+$/,Ip=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Op=/^[0-9a-vA-V]{20}$/,xp=/^[A-Za-z0-9]{27}$/,Np=/^[a-zA-Z0-9_-]{21}$/;function jp(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ap=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var qp=/^([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})$/,Dc=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 Mp=/^(?:[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 Fy="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Lp(){return new RegExp(Fy,"u")}var Dp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,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}|:))$/;var Up=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Fp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Jp=/^https?$/,Bp=/^\+[1-9]\d{6,14}$/;var Kp="(?:(?:\\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 Gp=Vy(Kp);function Lc(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 Wp(e){return new RegExp(`^${Lc(e)}$`)}function Yp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Lc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Lc({precision:e.precision})}`:r;return new RegExp(`^${Kp}T(?:${o})$`)}var Xp=/^[\s\S]{0,}$/;var Qp=/^-?\d+n?$/,Zc=/^-?\d+$/,Bo=/^-?\d+(?:\.\d+)?$/,em=/^(?:true|false)$/i,tm=/^null$/i;var rm=/^[^A-Z]*$/,om=/^[^a-z]*$/;var De=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Uc=e=>{let t=e.value;return!vc(t)&&t.length!==void 0},Cs={number:"number",bigint:"bigint",object:"date"},Fc=q("$ZodCheckLessThan",(e,t)=>{De.init(e,t);let r=Cs[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Cs[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})}}),Vc=q("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);let r=Cs[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Cs[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})}}),nm=q("$ZodCheckMultipleOf",(e,t)=>{De.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):bc(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})}}),sm=q("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Fo[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 im=q("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Uc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Ho(n):s)<=t.maximum)return;let c=Jo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),am=q("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Uc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Ho(n):s)>=t.minimum)return;let c=Jo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cm=q("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Uc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Ho(n):s;if(i===t.length)return;let c=Jo(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})}}),Ko=q("$ZodCheckStringFormat",(e,t)=>{var r,o;De.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=()=>{})}),um=q("$ZodCheckRegex",(e,t)=>{Ko.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})}}),lm=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rm),Ko.init(e,t)}),dm=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=om),Ko.init(e,t)}),pm=q("$ZodCheckIncludes",(e,t)=>{De.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})}}),mm=q("$ZodCheckStartsWith",(e,t)=>{De.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})}}),fm=q("$ZodCheckEndsWith",(e,t)=>{De.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 hm=q("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ks=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{c as Xd,d as Qd}from"./chunk-2YU4EI24.js";import{g as Jd,i as Bd}from"./chunk-KPUKMAYK.js";import{i as Hd,o as Kd}from"./chunk-AETM2PCZ.js";import{c as Gd}from"./chunk-6PUV4HSU.js";import{a as Zd,b as Ud,c as Fd}from"./chunk-QMNERJL2.js";import"./chunk-G2V33TMN.js";import{a as Ld,c as Dd}from"./chunk-ID4GJZJ6.js";import{a as Nd,d as Wd}from"./chunk-HAOKWLD3.js";import{c as Id,d as Od,h as xd}from"./chunk-E5VPEBUQ.js";import"./chunk-42IEPG2K.js";import"./chunk-YXV3PYVI.js";import"./chunk-ID75X37Z.js";import"./chunk-56QHX7QR.js";import"./chunk-3OCPO5V6.js";import"./chunk-6RMRWBMB.js";import{b as Pd,j as ms,k as Ed}from"./chunk-EYOO35US.js";import{b as Yd}from"./chunk-Z3PQ5TMU.js";import{f as fs,g as jd,h as Ad,i as qd}from"./chunk-YJ6XLDRA.js";import"./chunk-63XCSYHM.js";import{d as kd,f as Cd}from"./chunk-TQEGSODD.js";import"./chunk-O7DK3GJT.js";import"./chunk-S44LAUHZ.js";import"./chunk-ULX4ZD2Y.js";import{b as Vd}from"./chunk-HZDYZ5RD.js";import"./chunk-BSFBZBAI.js";import"./chunk-W6QOV4RP.js";import{a as _t}from"./chunk-H332YFSO.js";import"./chunk-7NP76V4U.js";import"./chunk-OQ6DTE56.js";import{b as Md}from"./chunk-DC2DHMXO.js";import"./chunk-PON65UTS.js";import"./chunk-JPASVE56.js";import{m as Td}from"./chunk-SJIDFYPT.js";import"./chunk-JZM37DG2.js";import"./chunk-DKHBJ52G.js";import"./chunk-KXKQDFHX.js";import{a as wd,b as hc}from"./chunk-ZL7E7PZN.js";import"./chunk-4AL5QJLM.js";import"./chunk-NUCGWLOY.js";import"./chunk-I2LPGKUU.js";import"./chunk-HON4OV7M.js";import{S as st,U as Rd,i as Zo,pa as $d}from"./chunk-PNPAHKJR.js";import{e as fc}from"./chunk-FGR6QCG5.js";import"./chunk-VLVNA4T3.js";import{d as mc}from"./chunk-TMUK2DD3.js";var YS=Object.create,hs=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,QS=Object.getOwnPropertyNames,ey=Object.getPrototypeOf,ty=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ep=(e,t)=>{let r={};for(var o in e)hs(r,o,{get:e[o],enumerable:!0});return t&&hs(r,Symbol.toStringTag,{value:"Module"}),r},ry=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=QS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!ty.call(e,c)&&c!==r&&hs(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=XS(t,c))||o.enumerable});return e},gs=(e,t,r)=>(r=e!=null?YS(ey(e)):{},ry(t||!e||!e.__esModule?hs(r,"default",{value:e,enumerable:!0}):r,e));var oy=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),tp=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),ny=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),sy=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function rp(e){return typeof e=="string"&&tp.has(e.replace(/#$/,""))}function op(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(oy.has(r))return"2020-12";if(tp.has(r))return"2019-09";if(ny.has(r)||sy.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={};mc(ce,{BIGINT_FORMAT_RANGES:()=>vs,CONSTANT_CATCH:()=>fp,Class:()=>Sc,NUMBER_FORMAT_RANGES:()=>Fo,aborted:()=>ut,allowsEval:()=>$c,assert:()=>ly,assertEqual:()=>iy,assertIs:()=>cy,assertNever:()=>uy,assertNotEqual:()=>ay,assignProp:()=>Ye,attachSchema:()=>Vo,base64ToUint8Array:()=>pp,base64urlToUint8Array:()=>ky,cached:()=>Nr,captureStackTrace:()=>Ss,cleanEnum:()=>Ty,cleanRegex:()=>Uo,clone:()=>it,cloneDef:()=>my,codePointLength:()=>Ho,constantCatch:()=>hp,createTransparentProxy:()=>yy,defineLazy:()=>bc,defineLazyInternal:()=>ge,derived:()=>xy,esc:()=>zc,escapeRegex:()=>vt,explicitlyAborted:()=>Ec,extend:()=>zy,finalizeIssue:()=>lt,floatSafeRemainder:()=>vc,getElementAtPath:()=>fy,getEnumValues:()=>Or,getLengthableOrigin:()=>Jo,getParsedType:()=>Sy,getSizableOrigin:()=>dp,hexToUint8Array:()=>Iy,hide:()=>Rs,installLazyProp:()=>qy,isObject:()=>ur,isPlainObject:()=>Mt,issue:()=>Ar,joinValues:()=>_s,jsonStringifyReplacer:()=>xr,members:()=>kc,merge:()=>$y,mergeDefs:()=>yt,normalizeParams:()=>re,nullish:()=>yc,numKeys:()=>_y,objectClone:()=>dy,omit:()=>by,optionalKeys:()=>Pc,own:()=>qt,parsedType:()=>Tc,partial:()=>wy,pick:()=>vy,prefixIssues:()=>bt,primitiveTypes:()=>up,promiseAllObject:()=>hy,propertyKeyTypes:()=>wc,randomString:()=>gy,rawShape:()=>jr,required:()=>Py,safeExtend:()=>Ry,shallowClone:()=>cp,sizeCaps:()=>zs,slugify:()=>Rc,stringifyPrimitive:()=>ys,toZod:()=>sp,uint8ArrayToBase64:()=>mp,uint8ArrayToBase64url:()=>Cy,uint8ArrayToHex:()=>Oy,unwrapMessage:()=>Ir});function iy(e){return e}function ay(e){return e}function sp(){return e=>e}function cy(e){}function uy(e){throw new Error("Unexpected value in exhaustive check")}function ly(e){}function Or(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 _s(e,t="|"){return e.map(r=>ys(r)).join(t)}function xr(e,t){return typeof t=="bigint"?t.toString():t}var _c=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 _c(e)}function yc(e){return e==null}function Uo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function vc(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 np=Symbol("evaluating");function bc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==np)return o===void 0&&(o=np,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dy(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 ip(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function ap(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?ip(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):ap(e,s,o?o(i.value,s):i.value))}}function py(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?ip(e,r,()=>t[r]):ap(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 my(e){return yt(e._zod.def)}function fy(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function hy(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 gy(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function zc(e){return JSON.stringify(e)}function Rc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var $c=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function 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 cp(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function _y(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Sy=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}`)}},wc=new Set(["string","number","symbol"]),up=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 re(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 yy(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 ys(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Pc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Fo={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]},vs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vy(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,bs(e,t)),it(e,yt(r,{shape:s,checks:[]}))}function bs(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 by(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(bs(e,t)),i={};return cr(i,e,Reflect.ownKeys(St(e)).filter(c=>!s.has(c))),it(e,yt(r,{shape:i,checks:[]}))}function zy(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:lp(e,t)}))}function lp(e,t){let r={};return cr(r,e,Reflect.ownKeys(St(e))),py(r,t),r}function Ry(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,yt(e._zod.def,{shape:lp(e,t)}))}function $y(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 wy(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(bs(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 Py(e,t,r){let o=r?new Set(bs(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 Ec(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 Ir(e){return typeof e=="string"?e:e?.message}function zs(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 Vo(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:Ir(e.inst?._zod.def?.error?.(e))??Ir(s?.(e))??Ir(t?.error?.(e))??Ir(r.customError?.(e))??Ir(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 dp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Ey=/[\uD800-\uDBFF]/;function Ho(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 Jo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tc(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 Ar(...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 pp(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 mp(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ky(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return pp(t+r)}function Cy(e){return mp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Iy(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 Oy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Sc=class{constructor(...t){}};function kc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):Ny(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 Rs(e,t,r){return qt(e,t,r,!1)}function xy(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 Ny(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 jy(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var gc,At=!1,Ay={configurable:!0,get(){At=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&gc!==e._zod){gc=void 0;return}gc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Ay);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 qy(e,t,r,o){let n=jy(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 fp="~constantCatch";function hp(e){let t=()=>e;return t[fp]=!0,t}var gp,Ic=Object.freeze({status:"aborted"}),Cc={value:void 0,enumerable:!1},_p="captureStackTrace"in Error?Error:null;function My(e){let t=_p;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return _p=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{Cc.value=new s(v);try{Object.defineProperty(g,"_zod",Cc)}finally{Cc.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),kc(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?My(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.")}},qr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(gp=globalThis).__zod_globalConfig??(gp.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function Ly(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,xr,2)),e.message}function Dy(e){this._zod.message=e}var Zy={get:Ly,set:Dy,enumerable:!0,configurable:!0},xc={value:void 0,enumerable:!1},Sp=new WeakSet([Object.prototype,Error.prototype]),yp=(e,t)=>{e.name="$ZodError",xc.value=t,Object.defineProperty(e,"issues",xc),xc.value=void 0,Object.defineProperty(e,"message",Zy);let r=Object.getPrototypeOf(e);Sp.has(r)||(Sp.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})}}))},vp=q("$ZodError",yp),p$=q("$ZodError",yp,void 0,{Parent:Error});function Uy(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 Nc(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?Uy(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function jc(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 $s(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ws=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 Ss(a,s?.callee??t),a}return c.value};return t};var Ps=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 Ss(a,s?.callee??t),a}return c.value};return t};var Es=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?bp(e,s.issues,n):{success:!0,data:s.value}};function bp(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 Ts=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?bp(e,s.issues,n):{success:!0,data:s.value}};var Fy=Symbol.for("zod.compile.invalid"),Vy=Symbol.for("zod.compile.fallback"),Ac=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==Fy)return!0;if(o.definite===!0&&r===void 0)return!1}return Hy(e,t,r)});function Hy(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[Vy]=!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 qc=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},zp=e=>{let t=ws(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,$s(r,i))};return r};var Rp=e=>{let t=ws(e),r=(o,n,s,i)=>t(o,n,s,$s(r,i));return r};var $p=e=>{let t=Ps(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,$s(r,i))};return r};var wp=e=>{let t=Ps(e),r=async(o,n,s,i)=>await t(o,n,s,$s(r,i));return r};var Pp=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Es(e)(t,r,n)};var Ep=e=>(t,r,o)=>Es(e)(t,r,o);var Tp=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ts(e)(t,r,n)};var kp=e=>async(t,r,o)=>Ts(e)(t,r,o);var Cp=/^[cC][0-9a-z]{6,}$/,Ip=/^[0-9a-z]+$/,Op=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xp=/^[0-9a-vA-V]{20}$/,Np=/^[A-Za-z0-9]{27}$/,jp=/^[a-zA-Z0-9_-]{21}$/;function Ap(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var qp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Mp=/^([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})$/,Lc=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 Lp=/^(?:[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 Jy="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Dp(){return new RegExp(Jy,"u")}var Zp=/^(?:(?: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])$/,Up=/^(([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 Fp=/^((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])$/,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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Bp=/^https?$/,Kp=/^\+[1-9]\d{6,14}$/;var Gp="(?:(?:\\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 By(e){return new RegExp(`^${e}$`)}var Wp=By(Gp);function Mc(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 Yp(e){return new RegExp(`^${Mc(e)}$`)}function Xp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Mc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Mc({precision:e.precision})}`:r;return new RegExp(`^${Gp}T(?:${o})$`)}var Qp=/^[\s\S]{0,}$/;var em=/^-?\d+n?$/,Dc=/^-?\d+$/,Bo=/^-?\d+(?:\.\d+)?$/,tm=/^(?:true|false)$/i,rm=/^null$/i;var om=/^[^A-Z]*$/,nm=/^[^a-z]*$/;var De=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Zc=e=>{let t=e.value;return!yc(t)&&t.length!==void 0},ks={number:"number",bigint:"bigint",object:"date"},Uc=q("$ZodCheckLessThan",(e,t)=>{De.init(e,t);let r=ks[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ks[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})}}),Fc=q("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);let r=ks[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ks[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})}}),sm=q("$ZodCheckMultipleOf",(e,t)=>{De.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):vc(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})}}),im=q("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Fo[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 am=q("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Zc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Ho(n):s)<=t.maximum)return;let c=Jo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cm=q("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Zc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Ho(n):s)>=t.minimum)return;let c=Jo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),um=q("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=Zc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Ho(n):s;if(i===t.length)return;let c=Jo(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})}}),Ko=q("$ZodCheckStringFormat",(e,t)=>{var r,o;De.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=()=>{})}),lm=q("$ZodCheckRegex",(e,t)=>{Ko.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})}}),dm=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=om),Ko.init(e,t)}),pm=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nm),Ko.init(e,t)}),mm=q("$ZodCheckIncludes",(e,t)=>{De.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})}}),fm=q("$ZodCheckStartsWith",(e,t)=>{De.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})}}),hm=q("$ZodCheckEndsWith",(e,t)=>{De.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 gm=q("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Cs=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 _m={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=_m;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(Tc(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&&(Vo(c.issues,v,e),d||(d=ut(c,v)))});else{if(c.issues.length===v)continue;Vo(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 Rs(this,"~standard",Jc(this))},set"~standard"(e){qt(this,"~standard",e)}}),Tm=(e,t)=>e.issues.length?{issues:e.issues.map(r=>lt(r,t,Qe()))}:{value:e.value};async function Hy(e,t){let r={async:!0};return Tm(await e._zod.run({value:t,issues:[]},r),r)}function Jc(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Tm(o,r)}catch{}return Hy(e,t)},vendor:"zod",version:1}}var Ns=q("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=t.pattern??Xp,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)=>{Ko.init(e,t),Ns.init(e,t)}),Cm=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qp),Re.init(e,t)}),km=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=Dc(o))}else t.pattern??(t.pattern=Dc());Re.init(e,t)}),Im=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Mp),Re.init(e,t)}),Om=1,Os=2;function xm(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Jy(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?xm(e)||Os:By(e,t)}function By(e,t){if(!t.normalize&&t.protocol?.source===Jp.source&&!/^https?:\/\//i.test(e))return Om;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Os}return new URL(e)}catch{return Os}}var Ky=/[\t\n\r]/g;function Sm(e){return e.replace(Ky,"")}function Gy(e,t){return t.lastIndex=0,t.test(e.hostname)}function Wy(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Nm=q("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=Jy(o,t);if(n===Om){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Os){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Sm(o);return}t.hostname&&!Gy(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&&!Wy(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:Sm(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),jm=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Lp()),Re.init(e,t)}),Am=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?Np:jp(t.length)),Re.init(e,t)}),qm=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Cp),Re.init(e,t)}),Mm=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kp),Re.init(e,t)}),Lm=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ip),Re.init(e,t)}),Dm=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Op),Re.init(e,t)}),Zm=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xp),Re.init(e,t)}),Um=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Yp(t)),Re.init(e,t)}),Fm=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Gp),Re.init(e,t)}),Vm=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wp(t)),Re.init(e,t)}),Hm=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ap),Re.init(e,t)}),Jm=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dp),Re.init(e,t)}),Yy=/^[0-9a-fA-F:.]+$/;function Bm(e){return Yy.test(e)?xm(`http://[${e}]`):!1}var Km=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zp),Re.init(e,t),e._zod.check=r=>{Bm(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Gm=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Up),Re.init(e,t)});function Xy(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:Bm(r)}var Wm=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Fp),Re.init(e,t),e._zod.check=r=>{Xy(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Ym(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Bc=/^[0-9a-zA-Z+/]*={0,2}$/,Xm=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bc),Re.init(e,t),e._zod.check=r=>{Ym(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),js=/^[A-Za-z0-9_-]*$/;function Qy(e){if(!js.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ym(r)}var Qm=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=js),Re.init(e,t),e._zod.check=r=>{Qy(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ef=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Bp),Re.init(e,t)});function ev(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 tf=q("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{ev(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Kc=q("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=Bo,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}}),rf=q("$ZodNumberFormat",(e,t)=>{sm.init(e,t),Kc.init(e,t)}),of=q("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=em,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}}),nf=q("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=Qp,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 sf=q("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=tm,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}}),af=q("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),cf=q("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),uf=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 lf=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 tv(e,t){let r=zs(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 zs(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,Vo(s.issues,d,e),s}}return n(s,i)}}var rv=e=>Array.isArray(e)?e.length:-1;function ym(e,t,r){e.issues.length&&t.issues.push(...bt(r,e.issues)),t.value[r]=e.value}var df=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=>ym(p,o,a)));else if(ym(d,o,a),c&&d.issues.length!==0&&ut(d))break}return i.length?Promise.all(i).then(()=>o):o},tv(e,rv)});function xs(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 ov=[];function pf(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:ov,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=Ec(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function mf(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=>xs(h,r,m,t,p,g))):xs(_,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 nv=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(()=>pf(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,S=f._zod.optout,R=f._zod.run({value:p[h],issues:[]},d);R instanceof Promise?g.push(R.then(w=>xs(w,u,h,p,z,S))):xs(R,u,h,p,z,S)}return i?mf(g,p,u,d,n.value,e,m===!0):g.length?Promise.all(g).then(()=>u):u}}),ff=q("$ZodObjectJIT",(e,t)=>{nv.init(e,t);let r=e._zod.parse,o=Nr(()=>pf(t)),n=Xe.memoizer,s=v=>{let m=o.value,_=m.symbolKeys,h=new ks(["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 Sm={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=Sm;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(Ec(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&&(Vo(c.issues,v,e),d||(d=ut(c,v)))});else{if(c.issues.length===v)continue;Vo(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 Rs(this,"~standard",Hc(this))},set"~standard"(e){qt(this,"~standard",e)}}),km=(e,t)=>e.issues.length?{issues:e.issues.map(r=>lt(r,t,Qe()))}:{value:e.value};async function Ky(e,t){let r={async:!0};return km(await e._zod.run({value:t,issues:[]},r),r)}function Hc(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return km(o,r)}catch{}return Ky(e,t)},vendor:"zod",version:1}}var Ns=q("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=t.pattern??Qp,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)=>{Ko.init(e,t),Ns.init(e,t)}),Cm=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Mp),Re.init(e,t)}),Im=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=Lc(o))}else t.pattern??(t.pattern=Lc());Re.init(e,t)}),Om=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lp),Re.init(e,t)}),xm=1,Os=2;function Nm(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Gy(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Nm(e)||Os:Wy(e,t)}function Wy(e,t){if(!t.normalize&&t.protocol?.source===Bp.source&&!/^https?:\/\//i.test(e))return xm;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Os}return new URL(e)}catch{return Os}}var Yy=/[\t\n\r]/g;function ym(e){return e.replace(Yy,"")}function Xy(e,t){return t.lastIndex=0,t.test(e.hostname)}function Qy(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var jm=q("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=Gy(o,t);if(n===xm){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Os){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=ym(o);return}t.hostname&&!Xy(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&&!Qy(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:ym(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Am=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Dp()),Re.init(e,t)}),qm=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?jp:Ap(t.length)),Re.init(e,t)}),Mm=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Cp),Re.init(e,t)}),Lm=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ip),Re.init(e,t)}),Dm=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Op),Re.init(e,t)}),Zm=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xp),Re.init(e,t)}),Um=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Np),Re.init(e,t)}),Fm=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xp(t)),Re.init(e,t)}),Vm=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wp),Re.init(e,t)}),Hm=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yp(t)),Re.init(e,t)}),Jm=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qp),Re.init(e,t)}),Bm=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zp),Re.init(e,t)}),ev=/^[0-9a-fA-F:.]+$/;function Km(e){return ev.test(e)?Nm(`http://[${e}]`):!1}var Gm=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Up),Re.init(e,t),e._zod.check=r=>{Km(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Wm=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fp),Re.init(e,t)});function tv(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:Km(r)}var Ym=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Vp),Re.init(e,t),e._zod.check=r=>{tv(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Xm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Jc=/^[0-9a-zA-Z+/]*={0,2}$/,Qm=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Jc),Re.init(e,t),e._zod.check=r=>{Xm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),js=/^[A-Za-z0-9_-]*$/;function rv(e){if(!js.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Xm(r)}var ef=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=js),Re.init(e,t),e._zod.check=r=>{rv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tf=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kp),Re.init(e,t)});function ov(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 rf=q("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{ov(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Bc=q("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=Bo,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}}),of=q("$ZodNumberFormat",(e,t)=>{im.init(e,t),Bc.init(e,t)}),nf=q("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=tm,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}}),sf=q("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=em,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 af=q("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=rm,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}}),cf=q("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),uf=q("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),lf=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 df=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 nv(e,t){let r=zs(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 zs(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,Vo(s.issues,d,e),s}}return n(s,i)}}var sv=e=>Array.isArray(e)?e.length:-1;function vm(e,t,r){e.issues.length&&t.issues.push(...bt(r,e.issues)),t.value[r]=e.value}var pf=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=>vm(p,o,a)));else if(vm(d,o,a),c&&d.issues.length!==0&&ut(d))break}return i.length?Promise.all(i).then(()=>o):o},nv(e,sv)});function xs(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 iv=[];function mf(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:iv,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=Pc(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function ff(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=>xs(h,r,m,t,p,g))):xs(_,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 av=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(()=>mf(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,S=f._zod.optout,R=f._zod.run({value:p[h],issues:[]},d);R instanceof Promise?g.push(R.then(w=>xs(w,u,h,p,z,S))):xs(R,u,h,p,z,S)}return i?ff(g,p,u,d,n.value,e,m===!0):g.length?Promise.all(g).then(()=>u):u}}),hf=q("$ZodObjectJIT",(e,t)=>{av.init(e,t);let r=e._zod.parse,o=Nr(()=>mf(t)),n=Xe.memoizer,s=v=>{let m=o.value,_=m.symbolKeys,h=new Cs(["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 S=Object.create(null),R=0;for(let w of m.allKeys)S[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=S[w],y=typeof w=="symbol"?`syms[${_.indexOf(w)}]`:Rc(w),E=`${y} in input`,N=v[w],V=N?._zod?.optin,M=V!==void 0,Z=N?._zod?.optout==="optional";if(h.write(`const ${b} = ${f(y)};`),M&&Z){let W=V==="optional"?`${b}_present`:`${b}.value !== undefined || ${b}_present`;h.write(`
18
+ }`;h.write("const input = payload.value;");let S=Object.create(null),R=0;for(let w of m.allKeys)S[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=S[w],y=typeof w=="symbol"?`syms[${_.indexOf(w)}]`:zc(w),E=`${y} in input`,N=v[w],V=N?._zod?.optin,M=V!==void 0,Z=N?._zod?.optout==="optional";if(h.write(`const ${b} = ${f(y)};`),M&&Z){let W=V==="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,y)}
@@ -54,28 +54,28 @@ ${r.join(`
54
54
  newResult[${y}] = ${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&&wc.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?mf([],_,v,m,g,e,m?.abortEarly===!0):v):r(v,m):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function vm(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 Gc=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=>Uo(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=>vm(c,o,e,n)):vm(i,o,e,n)}});function sv(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 hf=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Gc.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=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(()=>sv(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)}}),gf=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])=>bm(r,a,u)):bm(r,s,i)}});function Hc(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=Hc(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=Hc(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 bm(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=Hc(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 _f=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"&&Bo.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 Sf=q("$ZodEnum",(e,t)=>{Se.init(e,t);let r=Or(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",n=>{let s=Or(n.def.entries).filter(i=>Pc.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}}),yf=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 vf=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 qr(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 zm(e,t){return e.value=t.issues.length?void 0:t.value,e}var Wc=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(`^(${Uo(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=>zm(r,s)):zm(r,n)}return t.innerType._zod.run(r,o)}}),bf=q("$ZodExactOptional",(e,t)=>{Wc.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)}),zf=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(`^(${Uo(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)}),Rf=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 $f=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))}),wf=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=>$m(s,e)):$m(n,e)}});function $m(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 wm(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 Pf=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=>wm(r,s,t,o)):wm(r,n,t,o)}});var Yc=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=>Is(i,t.in,o)):Is(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Is(s,t.out,o)):Is(n,t.out,o)}});function Is(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 Ef=q("$ZodPreprocess",(e,t)=>{Yc.init(e,t)}),Tf=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(Pm):Pm(n)}});function Pm(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Cf=q("$ZodLazy",(e,t)=>{Se.init(e,t),zc(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)}),kf=q("$ZodCustom",(e,t)=>{De.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=>Em(s,r,o,e));Em(n,r,o,e)}});function Em(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(Ar(n))}}var Qc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},eu="~memo",If=[];function Of(e){return e!==null&&typeof e=="object"}function Xc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var xf=new WeakMap,Go=0,Ms=1,Wo=2;function Ls(e,t,r){let o=xf.get(e);if(o!==void 0)return o?Wo:Go;if(t.has(e))return Wo;t.add(e);let n=Go,s=d=>{if(n!==Wo&&d?._zod){let p=Ls(d,t,r);p>n&&(n=p)}},i=(d,p)=>{let g=Go;for(let v of Reflect.ownKeys(d)){let m=Object.getOwnPropertyDescriptor(d,v);if(p&&!m.enumerable)continue;let _=m.get?Ms:m.value?._zod?Ls(m.value,t,r):Go;_>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):Ms),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?Ls(d,t,!1):Ms);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),iv(e,n)}function iv(e,t){return t!==Ms&&xf.set(e,t===Wo),t}function av(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var As,qs=[],cv={alloc(e,t,r){let o=As;if(!o)return r;As=void 0;let n={value:r,issues:null};return o.set(t.value,n),qs.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"&&uv(s,n.value))throw new Qc;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=Ls(e,new Set,!1);if(f===Go)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Wo||o?r=!0:o=!0}let d=a.value;if(!Of(d))return i(a,u);let p=u[eu];p||(p={buckets:new WeakMap,backEdges:void 0},u[eu]=p);let g;n===u?g=s:(g=av(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(...Xc(v.issues)):(a.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(v.value)),a;As=g;let m=qs.length,_=i(a,u);As=void 0;let h=qs.length>m?qs.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Xc(f.issues):If),f)):(h&&(h.issues=_.issues.length?Xc(_.issues):If),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function tu(){return cv}function uv(e,t){let r=e[eu]?.backEdges;return r!==void 0&&Of(t)&&r.has(t)}var lv=()=>{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=Cc(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 ${ys(s.values[0])}`:`Invalid option: expected one of ${_s(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":""}: ${_s(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`'${c}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Nf(){return{localeError:lv()}}var jf;var ru=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Af(){return new ru}(jf=globalThis).__zod_globalRegistry??(jf.__zod_globalRegistry=Af());var Lt=globalThis.__zod_globalRegistry;function Ds(e){return e.checks&&(e.checks=[...e.checks]),e}function qf(e,t){return new e(Ds({type:"string",...re(t)}))}function Mf(e,t){return new e(Ds({type:"string",coerce:!0,...re(t)}))}function ou(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function Lf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function Df(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Zf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function Uf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function Ff(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function nu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Vf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Hf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Jf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Bf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Kf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Gf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Wf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Yf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Xf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function Qf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function eh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function th(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function rh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function oh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function nh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function Zs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function Us(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function Fs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function Vs(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function sh(e,t){return new e(Ds({type:"number",checks:[],...re(t)}))}function ih(e,t){return new e(Ds({type:"number",coerce:!0,checks:[],...re(t)}))}function ah(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function ch(e,t){return new e({type:"boolean",...re(t)})}function uh(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function lh(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function dh(e,t){return new e({type:"null",...re(t)})}function ph(e){return new e({type:"any"})}function mh(e){return new e({type:"unknown"})}function fh(e,t){return new e({type:"never",...re(t)})}function hh(e,t){return new e({type:"date",coerce:!0,...re(t)})}function Lr(e,t){return new Fc({check:"less_than",...re(t),value:e,inclusive:!1})}function zt(e,t){return new Fc({check:"less_than",...re(t),value:e,inclusive:!0})}function Dr(e,t){return new Vc({check:"greater_than",...re(t),value:e,inclusive:!1})}function Rt(e,t){return new Vc({check:"greater_than",...re(t),value:e,inclusive:!0})}function Yo(e,t){return new nm({check:"multiple_of",...re(t),value:e})}function Hs(e,t){return new im({check:"max_length",...re(t),maximum:e})}function Zr(e,t){return new am({check:"min_length",...re(t),minimum:e})}function Js(e,t){return new cm({check:"length_equals",...re(t),length:e})}function su(e,t){return new um({check:"string_format",format:"regex",...re(t),pattern:e})}function iu(e){return new lm({check:"string_format",format:"lowercase",...re(e)})}function au(e){return new dm({check:"string_format",format:"uppercase",...re(e)})}function cu(e,t){return new pm({check:"string_format",format:"includes",...re(t),includes:e})}function uu(e,t){return new mm({check:"string_format",format:"starts_with",...re(t),prefix:e})}function lu(e,t){return new fm({check:"string_format",format:"ends_with",...re(t),suffix:e})}function Dt(e){return new hm({check:"overwrite",tx:e})}function du(e){return Dt(t=>t.normalize(e))}function pu(){return Dt(e=>e.trim())}function mu(){return Dt(e=>e.toLowerCase())}function fu(){return Dt(e=>e.toUpperCase())}function hu(){return Dt(e=>$c(e))}function gh(e,t,r){return new e({type:"array",element:t,...re(r)})}function _h(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function Sh(e,t){let r=dv(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Ar(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(Ar(s))}},e(o.value,o)),t);return r}function dv(e,t){let r=new De({check:"custom",...re(t)});return r._zod.check=e,r}function Xo(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 en(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&&Xo(i.schema,a),t.io==="input"&&Ke(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 yh(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function tn(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}/${yh(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+yh(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>
57
+ `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,c=ur,a=!Xe.jitless,d=a&&$c.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?ff([],_,v,m,g,e,m?.abortEarly===!0):v):r(v,m):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function bm(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 Kc=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=>Uo(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=>bm(c,o,e,n)):bm(i,o,e,n)}});function cv(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 gf=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kc.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=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(()=>cv(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)}}),_f=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])=>zm(r,a,u)):zm(r,s,i)}});function Vc(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=Vc(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=Vc(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 zm(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=Vc(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"&&Bo.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 yf=q("$ZodEnum",(e,t)=>{Se.init(e,t);let r=Or(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",n=>{let s=Or(n.def.entries).filter(i=>wc.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}}),vf=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 bf=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 qr(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 Rm(e,t){return e.value=t.issues.length?void 0:t.value,e}var Gc=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(`^(${Uo(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=>Rm(r,s)):Rm(r,n)}return t.innerType._zod.run(r,o)}}),zf=q("$ZodExactOptional",(e,t)=>{Gc.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)}),Rf=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(`^(${Uo(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)}),$f=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=>$m(s,t)):$m(n,t)}});function $m(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wf=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))}),Pf=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=>wm(s,e)):wm(n,e)}});function wm(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 Pm(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 Ef=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=>Pm(r,s,t,o)):Pm(r,n,t,o)}});var Wc=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=>Is(i,t.in,o)):Is(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Is(s,t.out,o)):Is(n,t.out,o)}});function Is(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 Tf=q("$ZodPreprocess",(e,t)=>{Wc.init(e,t)}),kf=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(Em):Em(n)}});function Em(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Cf=q("$ZodLazy",(e,t)=>{Se.init(e,t),bc(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)}),If=q("$ZodCustom",(e,t)=>{De.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=>Tm(s,r,o,e));Tm(n,r,o,e)}});function Tm(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(Ar(n))}}var Xc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Qc="~memo",Of=[];function xf(e){return e!==null&&typeof e=="object"}function Yc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Nf=new WeakMap,Go=0,Ms=1,Wo=2;function Ls(e,t,r){let o=Nf.get(e);if(o!==void 0)return o?Wo:Go;if(t.has(e))return Wo;t.add(e);let n=Go,s=d=>{if(n!==Wo&&d?._zod){let p=Ls(d,t,r);p>n&&(n=p)}},i=(d,p)=>{let g=Go;for(let v of Reflect.ownKeys(d)){let m=Object.getOwnPropertyDescriptor(d,v);if(p&&!m.enumerable)continue;let _=m.get?Ms:m.value?._zod?Ls(m.value,t,r):Go;_>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):Ms),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?Ls(d,t,!1):Ms);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),uv(e,n)}function uv(e,t){return t!==Ms&&Nf.set(e,t===Wo),t}function lv(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var As,qs=[],dv={alloc(e,t,r){let o=As;if(!o)return r;As=void 0;let n={value:r,issues:null};return o.set(t.value,n),qs.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"&&pv(s,n.value))throw new Xc;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=Ls(e,new Set,!1);if(f===Go)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Wo||o?r=!0:o=!0}let d=a.value;if(!xf(d))return i(a,u);let p=u[Qc];p||(p={buckets:new WeakMap,backEdges:void 0},u[Qc]=p);let g;n===u?g=s:(g=lv(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(...Yc(v.issues)):(a.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(v.value)),a;As=g;let m=qs.length,_=i(a,u);As=void 0;let h=qs.length>m?qs.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Yc(f.issues):Of),f)):(h&&(h.issues=_.issues.length?Yc(_.issues):Of),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function eu(){return dv}function pv(e,t){let r=e[Qc]?.backEdges;return r!==void 0&&xf(t)&&r.has(t)}var mv=()=>{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=Tc(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 ${ys(s.values[0])}`:`Invalid option: expected one of ${_s(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":""}: ${_s(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 jf(){return{localeError:mv()}}var Af;var tu=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 qf(){return new tu}(Af=globalThis).__zod_globalRegistry??(Af.__zod_globalRegistry=qf());var Lt=globalThis.__zod_globalRegistry;function Ds(e){return e.checks&&(e.checks=[...e.checks]),e}function Mf(e,t){return new e(Ds({type:"string",...re(t)}))}function Lf(e,t){return new e(Ds({type:"string",coerce:!0,...re(t)}))}function ru(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function Df(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function Zf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Uf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function Ff(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function Vf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function ou(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Hf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Jf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Bf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Kf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Gf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Wf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Yf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Xf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Qf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function eh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function th(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function rh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function oh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function nh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function sh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function Zs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function Us(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function Fs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function Vs(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function ih(e,t){return new e(Ds({type:"number",checks:[],...re(t)}))}function ah(e,t){return new e(Ds({type:"number",coerce:!0,checks:[],...re(t)}))}function ch(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function uh(e,t){return new e({type:"boolean",...re(t)})}function lh(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function dh(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function ph(e,t){return new e({type:"null",...re(t)})}function mh(e){return new e({type:"any"})}function fh(e){return new e({type:"unknown"})}function hh(e,t){return new e({type:"never",...re(t)})}function gh(e,t){return new e({type:"date",coerce:!0,...re(t)})}function Lr(e,t){return new Uc({check:"less_than",...re(t),value:e,inclusive:!1})}function zt(e,t){return new Uc({check:"less_than",...re(t),value:e,inclusive:!0})}function Dr(e,t){return new Fc({check:"greater_than",...re(t),value:e,inclusive:!1})}function Rt(e,t){return new Fc({check:"greater_than",...re(t),value:e,inclusive:!0})}function Yo(e,t){return new sm({check:"multiple_of",...re(t),value:e})}function Hs(e,t){return new am({check:"max_length",...re(t),maximum:e})}function Zr(e,t){return new cm({check:"min_length",...re(t),minimum:e})}function Js(e,t){return new um({check:"length_equals",...re(t),length:e})}function nu(e,t){return new lm({check:"string_format",format:"regex",...re(t),pattern:e})}function su(e){return new dm({check:"string_format",format:"lowercase",...re(e)})}function iu(e){return new pm({check:"string_format",format:"uppercase",...re(e)})}function au(e,t){return new mm({check:"string_format",format:"includes",...re(t),includes:e})}function cu(e,t){return new fm({check:"string_format",format:"starts_with",...re(t),prefix:e})}function uu(e,t){return new hm({check:"string_format",format:"ends_with",...re(t),suffix:e})}function Dt(e){return new gm({check:"overwrite",tx:e})}function lu(e){return Dt(t=>t.normalize(e))}function du(){return Dt(e=>e.trim())}function pu(){return Dt(e=>e.toLowerCase())}function mu(){return Dt(e=>e.toUpperCase())}function fu(){return Dt(e=>Rc(e))}function _h(e,t,r){return new e({type:"array",element:t,...re(r)})}function Sh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function yh(e,t){let r=fv(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Ar(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(Ar(s))}},e(o.value,o)),t);return r}function fv(e,t){let r=new De({check:"custom",...re(t)});return r._zod.check=e,r}function Xo(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 en(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&&Xo(i.schema,a),t.io==="input"&&Ke(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 vh(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function tn(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}/${vh(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+vh(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 zh(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;zh(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"]),vh=["oneOf","anyOf"];function bh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function gu(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]??bh(u);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:gu(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=bh(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 pv(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=>vh.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=gu(t);else{let n=r[0],s=vh.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=>gu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Xo(e,o))}function rn(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)):Xo(u,m),Xo(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())zh(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)??[])pv(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)}Xo(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:Qo(t,"input",e.processors),output:Qo(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ke(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 Ke(o.element,r);if(o.type==="set")return Ke(o.valueType,r);if(o.type==="lazy")return Ke(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 Ke(o.innerType,r);if(o.type==="intersection")return Ke(o.left,r)||Ke(o.right,r);if(o.type==="record"||o.type==="map")return Ke(o.keyType,r)||Ke(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ke(o.in,r)||Ke(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ke(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ke(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ke(n,r))return!0;return!!(o.rest&&Ke(o.rest,r))}return!1}var $h=(e,t={})=>r=>{let o=en({...r,processors:t});return ve(e,o),tn(o,e),rn(o,e)},Qo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=en({...n??{},target:s,io:t,processors:r});return ve(e,i),tn(i,e),rn(i,e)};var Ur=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Fr=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},wh=(e,t)=>{Ur(e,"minimum",t),Fr(e,"maximum",t)},kh=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Ih=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Oh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},xh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Ph=(e,t)=>Ur(e,"minimum",t.minimum),Eh=(e,t)=>Fr(e,"maximum",t.maximum),Th=e=>(t,r)=>{xh(t,r.format);let[o,n]=e[r.format];Ur(t,"minimum",o),Fr(t,"maximum",n)},mv={greater_than:(e,t)=>Ur(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Fr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>kh(e,t.value),number_format:Th(Fo),bigint_format:Th(vs),min_length:Ph,max_length:Eh,length_equals:(e,t)=>wh(e,t.length),min_size:Ph,max_size:Eh,size_equals:(e,t)=>wh(e,t.size),string_format:(e,t)=>{xh(e,t.format),t.pattern&&Ih(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Oh(e,t.mime)};function je(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)mv[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Ur(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Ur(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Fr(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Fr(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&kh(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&Oh(t,n.mime);for(let s of n.patterns??[])Ih(t,s);return t}var fv={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hv=new Map([[Bc,Vp],[js,Hp]]),Nh=e=>hv.get(e)??e,yu=(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=fv[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(Nh);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}))])}},vu=(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}))])}},bu=(e,t,r,o)=>{r.type="boolean"},zu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},jh=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ah=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},qh=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},$u=(e,t,r,o)=>{r.not={}},wu=(e,t,r,o)=>{},Pu=(e,t,r,o)=>{},Eu=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},Tu=(e,t,r,o)=>{let n=e._zod.def,s=Or(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},Cu=(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},Mh=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},Lh=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},Dh=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=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})))},Zh=(e,t,r,o)=>{r.type="boolean"},ku=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Uh=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Iu=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Fh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},Vh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},Ou=(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 on(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?on(t.out):t.type==="catch"?on(t.innerType):e._zod.optin}var xu=(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"?on(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)},Nu=(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},ju=(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)},Hh=(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"?on(_)!==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 _u(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 _=_u(e,m,r);return _===m?t:_}for(let m of["anyOf","oneOf"]){let _=t[m];if(!Array.isArray(_))continue;let h=_.map(f=>_u(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")?Bo:Zc).source)),v}var Su=new WeakMap;function gv(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 Su.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=_u(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 Au=(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,Nh(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=Su.get(t);d||(d=[],Su.set(t,d),t.deferred.push(()=>gv(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&on(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))}},qu=(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"}]},Mu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Lu=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"),Lu):JSON.parse(i)}var Du=(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!==Lu&&(r.default=i)},Zu=(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!==Lu&&(r._prefault=i)},Uu=(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},Fu=(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},Vu=(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},Bh=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Bs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Hu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},Ch={string:yu,number:vu,boolean:bu,bigint:zu,symbol:jh,null:Ru,undefined:Ah,void:qh,never:$u,any:wu,unknown:Pu,date:Eu,enum:Tu,literal:Cu,nan:Mh,template_literal:Lh,file:Dh,success:Zh,custom:ku,function:Uh,transform:Iu,map:Fh,set:Vh,array:Ou,object:xu,union:Nu,intersection:ju,tuple:Hh,record:Au,nullable:qu,nonoptional:Mu,default:Du,prefault:Zu,catch:Uu,pipe:Fu,readonly:Vu,promise:Bh,optional:Bs,lazy:Hu};function Ks(e,t){if("_idmap"in e){let o=e,n=en({...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;tn(n,d),Ye(i,u,rn(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=en({...t,processors:Ch});return ve(e,r),tn(r,e),rn(r,e)}var Kh=new WeakSet([Object.prototype,Error.prototype]);function Gs(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 wv=(e,t)=>{yp.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Kh.has(r)||(Kh.add(r),Gs(r,"format",o=>n=>Ac(o,n)),Gs(r,"flatten",o=>n=>jc(o,n)),Gs(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,xr,2)}),Gs(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,xr,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var rt=q("ZodError",wv,void 0,{Parent:Error});var Gh=ws(rt),Wh=Ps(rt),Ws=Es(rt),Yh=Ts(rt),Xh=bp(rt),Qh=zp(rt),eg=Rp(rt),tg=$p(rt),rg=wp(rt),og=Pp(rt),ng=Ep(rt),sg=Tp(rt);function Ev(){Xe.localeError||Qe(Nf())}function Xs(){Xe.memoizer||Qe({memoizer:tu()})}var ye=q("ZodType",(e,t)=>(Ev(),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(fb(e,t))},superRefine(e,t){return this.check(hb(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return X(this)},exactOptional(){return eb(this)},nullable(){return cg(this)},nullish(){return X(cg(this))},nonoptional(e){return ib(this,e)},array(){return I(this)},or(e){return Y([this,e])},and(e){return $t(this,e)},transform(e){return ug(this,yg(e))},default(e){return ob(this,e)},prefault(e){return sb(this,e)},catch(e){return cb(this,e)},pipe(e){return ug(this,e)},readonly(){return db(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",{...Jc(this),jsonSchema:{input:Qo(this,"input"),output:Qo(this,"output")}})},set"~standard"(e){ce.own(this,"~standard",e)},parse:function e(t,r){return Gh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Wh(this,t,r,{callee:e})},safeParse(e,t){return Ws(this,e,t)},async safeParseAsync(e,t){return Yh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ce.own(this,"spa",e)},validate(e,t){return qc(this,e,t)},validateAsync(e,t){return Mc(this,e,t)},encode:function e(t,r){return Xh(this,t,r,{callee:e})},decode:function e(t,r){return Qh(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await eg(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await tg(this,t,r,{callee:e})},safeEncode(e,t){return rg(this,e,t)},safeDecode(e,t){return og(this,e,t)},async safeEncodeAsync(e,t){return ng(this,e,t)},async safeDecodeAsync(e,t){return sg(this,e,t)},toJSONSchema(e){return $h(this,{})(e)},get description(){return Lt.get(this)?.description},get _def(){return this._zod.def}}),lg=q("_ZodString",(e,t)=>{Ns.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(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(su(...e))},includes(...e){return this.check(cu(...e))},startsWith(...e){return this.check(uu(...e))},endsWith(...e){return this.check(lu(...e))},min(...e){return this.check(Zr(...e))},max(...e){return this.check(Hs(...e))},length(...e){return this.check(Js(...e))},nonempty(...e){return this.check(Zr(1,...e))},lowercase(e){return this.check(iu(e))},uppercase(e){return this.check(au(e))},trim(){return this.check(pu())},normalize(...e){return this.check(du(...e))},toLowerCase(){return this.check(mu())},toUpperCase(){return this.check(fu())},slugify(){return this.check(hu())}})),Bu=q("ZodString",(e,t)=>{Ns.init(e,t),lg.init(e,t)},{email(e){return this.check(ou(dg,e))},url(e){return this.check(nu(mg,e))},jwt(e){return this.check(nh(Fv,e))},emoji(e){return this.check(Vf(Cv,e))},guid(e){return this.check(Lf(Tv,e))},uuid(e){return this.check(Df(Ys,e))},uuidv4(e){return this.check(Zf(Ys,e))},uuidv6(e){return this.check(Uf(Ys,e))},uuidv7(e){return this.check(Ff(Ys,e))},nanoid(e){return this.check(Hf(kv,e))},cuid(e){return this.check(Jf(Iv,e))},cuid2(e){return this.check(Bf(Ov,e))},ulid(e){return this.check(Kf(xv,e))},base64(e){return this.check(th(Dv,e))},base64url(e){return this.check(rh(Zv,e))},xid(e){return this.check(Gf(Nv,e))},ksuid(e){return this.check(Wf(jv,e))},ipv4(e){return this.check(Yf(Av,e))},ipv6(e){return this.check(Xf(qv,e))},cidrv4(e){return this.check(Qf(Mv,e))},cidrv6(e){return this.check(eh(Lv,e))},e164(e){return this.check(oh(Uv,e))},datetime(e){return this.check(Zs(nn,e))},date(e){return this.check(Us(sn,e))},time(e){return this.check(Fs(an,e))},duration(e){return this.check(Vs(cn,e))}});function l(e){return qf(Bu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),lg.init(e,t)}),nn=q("ZodISODateTime",(e,t)=>{Um.init(e,t),Pe.init(e,t)}),sn=q("ZodISODate",(e,t)=>{Fm.init(e,t),Pe.init(e,t)}),an=q("ZodISOTime",(e,t)=>{Vm.init(e,t),Pe.init(e,t)}),cn=q("ZodISODuration",(e,t)=>{Hm.init(e,t),Pe.init(e,t)}),dg=q("ZodEmail",(e,t)=>{Im.init(e,t),Pe.init(e,t)});function pg(e){return ou(dg,e)}var Tv=q("ZodGUID",(e,t)=>{Cm.init(e,t),Pe.init(e,t)});var Ys=q("ZodUUID",(e,t)=>{km.init(e,t),Pe.init(e,t)});var mg=q("ZodURL",(e,t)=>{Nm.init(e,t),Pe.init(e,t)});function Qs(e){return nu(mg,e)}var Cv=q("ZodEmoji",(e,t)=>{jm.init(e,t),Pe.init(e,t)});var kv=q("ZodNanoID",(e,t)=>{Am.init(e,t),Pe.init(e,t)});var Iv=q("ZodCUID",(e,t)=>{qm.init(e,t),Pe.init(e,t)});var Ov=q("ZodCUID2",(e,t)=>{Mm.init(e,t),Pe.init(e,t)});var xv=q("ZodULID",(e,t)=>{Lm.init(e,t),Pe.init(e,t)});var Nv=q("ZodXID",(e,t)=>{Dm.init(e,t),Pe.init(e,t)});var jv=q("ZodKSUID",(e,t)=>{Zm.init(e,t),Pe.init(e,t)});var Av=q("ZodIPv4",(e,t)=>{Jm.init(e,t),Pe.init(e,t)});var qv=q("ZodIPv6",(e,t)=>{Km.init(e,t),Pe.init(e,t)});var Mv=q("ZodCIDRv4",(e,t)=>{Gm.init(e,t),Pe.init(e,t)});var Lv=q("ZodCIDRv6",(e,t)=>{Wm.init(e,t),Pe.init(e,t)});var Dv=q("ZodBase64",(e,t)=>{Xm.init(e,t),Pe.init(e,t)});var Zv=q("ZodBase64URL",(e,t)=>{Qm.init(e,t),Pe.init(e,t)});var Uv=q("ZodE164",(e,t)=>{ef.init(e,t),Pe.init(e,t)});var Fv=q("ZodJWT",(e,t)=>{tf.init(e,t),Pe.init(e,t)});var ei=q("ZodNumber",(e,t)=>{Kc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(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(Dr(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(Lr(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(ig(e))},safe(e){return this.check(ig(e))},positive(e){return this.check(Dr(0,e))},nonnegative(e){return this.check(Rt(0,e))},negative(e){return this.check(Lr(0,e))},nonpositive(e){return this.check(zt(0,e))},multipleOf(e,t){return this.check(Yo(e,t))},step(e,t){return this.check(Yo(e,t))},finite(){return this}}));function L(e){return sh(ei,e)}var Vv=q("ZodNumberFormat",(e,t)=>{rf.init(e,t),ei.init(e,t)});function ig(e){return ah(Vv,e)}var Ku=q("ZodBoolean",(e,t)=>{of.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n)});function H(e){return ch(Ku,e)}var fg=q("ZodBigInt",(e,t)=>{nf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(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(Dr(e,t))},lt(e,t){return this.check(Lr(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(Dr(BigInt(0),e))},negative(e){return this.check(Lr(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(Yo(e,t))}}));var Hv=q("ZodNull",(e,t)=>{sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});function lr(e){return dh(Hv,e)}var Jv=q("ZodAny",(e,t)=>{af.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n)});function hg(){return ph(Jv)}var Bv=q("ZodUnknown",(e,t)=>{cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n)});function Q(){return mh(Bv)}var Kv=q("ZodNever",(e,t)=>{uf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n)});function gg(e){return fh(Kv,e)}var _g=q("ZodDate",(e,t)=>{lf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(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 Gv=q("ZodArray",(e,t)=>{Xs(),df.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Zr(e,t))},nonempty(e){return this.check(Zr(1,e))},max(e,t){return this.check(Hs(e,t))},length(e,t){return this.check(Js(e,t))},unwrap(){return this.element}});function I(e,t){return gh(Gv,e,t)}var Gu=q("ZodObject",(e,t)=>{Xs(),ff.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),ce.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return te(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:gg()}))},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(vg,this,e[0])},exactPartial(...e){return ce.partial(bg,this,e[0],"exactPartial")},required(...e){return ce.required(zg,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ce.normalizeParams(t)};return new Gu(r)}function Ge(e,t){return new Gu({type:"object",shape:e,catchall:gg(),...ce.normalizeParams(t)})}function oe(e,t){return new Gu({type:"object",shape:e,catchall:Q(),...ce.normalizeParams(t)})}var Sg=q("ZodUnion",(e,t)=>{Gc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.options=t.options});function Y(e,t){return new Sg({type:"union",options:e,...ce.normalizeParams(t)})}var Wv=q("ZodDiscriminatedUnion",(e,t)=>{Sg.init(e,t),hf.init(e,t)});function Hr(e,t,r){return new Wv({type:"union",options:t,discriminator:e,...ce.normalizeParams(r)})}var Yv=q("ZodIntersection",(e,t)=>{gf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n)});function $t(e,t){return new Yv({type:"intersection",left:e,right:t})}var ag=q("ZodRecord",(e,t)=>{Xs(),_f.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new ag({type:"record",keyType:l(),valueType:e,...ce.normalizeParams(t)}):new ag({type:"record",keyType:e,valueType:t,...ce.normalizeParams(r)})}var Ju=q("ZodEnum",(e,t)=>{Sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Tu(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 Ju({...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 Ju({...t,checks:[],...ce.normalizeParams(n),entries:s})}});function te(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ju({type:"enum",entries:r,...ce.normalizeParams(t)})}var Xv=q("ZodLiteral",(e,t)=>{yf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(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 Xv({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var Qv=q("ZodTransform",(e,t)=>{Xs(),vf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qr(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 yg(e){return new Qv({type:"transform",transform:e})}var vg=q("ZodOptional",(e,t)=>{Wc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new vg({type:"optional",innerType:e})}var bg=q("ZodExactOptional",(e,t)=>{bf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function eb(e){return new bg({type:"optional",innerType:e})}var tb=q("ZodNullable",(e,t)=>{zf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cg(e){return new tb({type:"nullable",innerType:e})}var rb=q("ZodDefault",(e,t)=>{Rf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ob(e,t){return new rb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var nb=q("ZodPrefault",(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 sb(e,t){return new nb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var zg=q("ZodNonOptional",(e,t)=>{wf.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 ib(e,t){return new zg({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var ab=q("ZodCatch",(e,t)=>{Pf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cb(e,t){return new ab({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ce.constantCatch(t)})}var Rg=q("ZodPipe",(e,t)=>{Yc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fu(e,r,o,n),e.in=t.in,e.out=t.out});function ug(e,t){return new Rg({type:"pipe",in:e,out:t})}var ub=q("ZodPreprocess",(e,t)=>{Rg.init(e,t),Ef.init(e,t)}),lb=q("ZodReadonly",(e,t)=>{Tf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function db(e){return new lb({type:"readonly",innerType:e})}var pb=q("ZodLazy",(e,t)=>{Cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function un(e){return new pb({type:"lazy",getter:e})}var mb=q("ZodCustom",(e,t)=>{kf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n)});function fb(e,t={}){return _h(mb,e,t)}function hb(e,t){return Sh(e,t)}function dr(e,t){return new ub({type:"pipe",in:yg(e),out:t})}var wg={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 $g;$g||($g={});var wt={};fc(wt,{ZodISODate:()=>sn,ZodISODateTime:()=>nn,ZodISODuration:()=>cn,ZodISOTime:()=>an,date:()=>Sb,datetime:()=>_b,duration:()=>vb,time:()=>yb});function _b(e){return Zs(nn,e)}function Sb(e){return Us(sn,e)}function yb(e){return Fs(an,e)}function vb(e){return Vs(cn,e)}var ti={};fc(ti,{bigint:()=>$b,boolean:()=>Rb,date:()=>wb,number:()=>zb,string:()=>bb});function bb(e){return Mf(Bu,e)}function zb(e){return ih(ei,e)}function Rb(e){return uh(Ku,e)}function $b(e){return lh(fg,e)}function wb(e){return hh(_g,e)}var mr="2025-11-25";var ri=[mr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],oi="io.modelcontextprotocol/related-task",fr="io.modelcontextprotocol/protocolVersion",Jr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",Tt="io.modelcontextprotocol/clientCapabilities",ln="io.modelcontextprotocol/subscriptionId",Ut="io.modelcontextprotocol/logLevel";var hr="2.0";var Zt=un(()=>Y([l(),L(),H(),lr(),K(l(),Zt),I(Zt)])),Ee=K(l(),Zt),Yu=I(Zt),dn=Y([l(),L().int()]),pn=l(),ni=P({ttl:L().optional()}),si=P({taskId:l()}),mn=oe({progressToken:dn.optional(),[oi]:si.optional()}),Le=P({_meta:mn.optional()}),gr=Le.extend({task:ni.optional()}),Te=P({method:l(),params:Le.loose().optional()}),Ve=P({_meta:mn.optional()}),He=P({method:l(),params:Ve.loose().optional()}),fn=oe({get[Et](){return Gr.optional().catch(void 0)}}),Ce=oe({_meta:fn.optional()}),Ft=Y([l(),L().int()]),hn=P({jsonrpc:O(hr),id:Ft,...Te.shape}).strict(),gn=P({jsonrpc:O(hr),...He.shape}).strict(),Br=P({jsonrpc:O(hr),id:Ft,result:Ce}).strict(),Kr=P({jsonrpc:O(hr),id:Ft.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),_n=Y([hn,gn,Br,Kr]),ii=Y([Br,Kr]),Sn=Ce.strict(),ai=Ve.extend({requestId:Ft.optional(),reason:l().optional()}),yn=He.extend({method:O("notifications/cancelled"),params:ai}),ci=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:te(["light","dark"]).optional()}),Vt=P({icons:I(ci).optional()}),Pt=P({name:l(),title:l().optional()}),Gr=Pt.extend({...Pt.shape,...Vt.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Eb=$t(P({applyDefaults:H().optional()}),Ee),Tb=dr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$t(P({form:Eb.optional(),url:Ee.optional()}),Ee.optional())),ui=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({sampling:oe({createMessage:Ee.optional()}).optional(),elicitation:oe({create:Ee.optional()}).optional()}).optional()}),li=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({tools:oe({call:Ee.optional()}).optional()}).optional()}),di=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:Tb.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:ui.optional(),extensions:K(l(),Ee).optional()}),pi=Le.extend({protocolVersion:l(),capabilities:di,clientInfo:Gr}),mi=Te.extend({method:O("initialize"),params:pi}),vn=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:li.optional(),extensions:K(l(),Ee).optional()}),fi=Ce.extend({protocolVersion:l(),capabilities:vn,serverInfo:Gr,instructions:l().optional()}),hi=He.extend({method:O("notifications/initialized"),params:Ve.optional()}),gi=Te.extend({method:O("server/discover"),params:Le.optional()}),_i=Ce.extend({supportedVersions:I(l()),capabilities:vn,instructions:l().optional()}),bn=Te.extend({method:O("ping"),params:Le.optional()}),Si=P({progress:L(),total:X(L()),message:X(l())}),yi=P({...Ve.shape,...Si.shape,progressToken:dn}),zn=He.extend({method:O("notifications/progress"),params:yi}),vi=Le.extend({cursor:pn.optional()}),Ht=Te.extend({params:vi.optional()}),Jt=Ce.extend({nextCursor:pn.optional()}),Rn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$n=Rn.extend({text:l()}),Xu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),wn=Rn.extend({blob:Xu}),Bt=te(["user","assistant"]),Ct=P({audience:I(Bt).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),Pn=P({...Pt.shape,...Vt.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Ct.optional(),_meta:X(oe({}))}),bi=P({...Pt.shape,...Vt.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Ct.optional(),_meta:X(oe({}))}),zi=Ht.extend({method:O("resources/list")}),Ri=Jt.extend({resources:I(Pn)}),$i=Ht.extend({method:O("resources/templates/list")}),wi=Jt.extend({resourceTemplates:I(bi)}),Wr=Le.extend({uri:l()}),Pi=Wr,Ei=Te.extend({method:O("resources/read"),params:Pi}),Ti=Ce.extend({contents:I(Y([$n,wn]))}),Ci=He.extend({method:O("notifications/resources/list_changed"),params:Ve.optional()}),ki=Wr,Ii=Te.extend({method:O("resources/subscribe"),params:ki}),Oi=Wr,xi=Te.extend({method:O("resources/unsubscribe"),params:Oi}),En=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ni=Le.extend({notifications:En}),ji=Te.extend({method:O("subscriptions/listen"),params:Ni}),Ai=Ve.extend({notifications:En}),qi=He.extend({method:O("notifications/subscriptions/acknowledged"),params:Ai}),Mi=fn.extend({[ln]:Ft}),Li=Ce.extend({_meta:Mi}),Di=Ve.extend({uri:l()}),Zi=He.extend({method:O("notifications/resources/updated"),params:Di}),Ui=P({name:l(),description:X(l()),required:X(H())}),Fi=P({...Pt.shape,...Vt.shape,description:X(l()),arguments:X(I(Ui)),_meta:X(oe({}))}),Vi=Ht.extend({method:O("prompts/list")}),Hi=Jt.extend({prompts:I(Fi)}),Ji=Le.extend({name:l(),arguments:K(l(),l()).optional()}),Bi=Te.extend({method:O("prompts/get"),params:Ji}),Yr=P({type:O("text"),text:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Xr=P({type:O("image"),data:Xu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Qr=P({type:O("audio"),data:Xu,mimeType:l(),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Ki=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Gi=P({type:O("resource"),resource:Y([$n,wn]),annotations:Ct.optional(),_meta:K(l(),Q()).optional()}),Wi=Pn.extend({type:O("resource_link")}),eo=Y([Yr,Xr,Qr,Wi,Gi]),Yi=P({role:Bt,content:eo}),Xi=Ce.extend({description:l().optional(),messages:I(Yi)}),Qi=He.extend({method:O("notifications/prompts/list_changed"),params:Ve.optional()}),ea=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),ta=P({taskSupport:te(["required","optional","forbidden"]).optional()}),Tn=P({...Pt.shape,...Vt.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Zt).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:oe({$schema:l().optional()}).optional(),annotations:ea.optional(),execution:ta.optional(),_meta:K(l(),Q()).optional()}),ra=Ht.extend({method:O("tools/list")}),oa=Jt.extend({tools:I(Tn)}),Cn=Ce.extend({content:I(eo).default([]),structuredContent:Q().optional(),isError:H().optional()}),Qu=Cn.or(Ce.extend({toolResult:Q()})),na=gr.extend({name:l(),arguments:K(l(),Q()).optional()}),sa=Te.extend({method:O("tools/call"),params:na}),ia=He.extend({method:O("notifications/tools/list_changed"),params:Ve.optional()}),el=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Kt=te(["debug","info","notice","warning","error","critical","alert","emergency"]),aa=Le.extend({level:Kt}),ca=Te.extend({method:O("logging/setLevel"),params:aa}),ua=Ve.extend({level:Kt,logger:l().optional(),data:Q()}),la=He.extend({method:O("notifications/message"),params:ua}),da=P({name:l().optional()}),pa=P({hints:I(da).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ma=P({mode:te(["auto","required","none"]).optional()}),fa=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(eo),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),ha=Hr("type",[Yr,Xr,Qr]),pr=Hr("type",[Yr,Xr,Qr,Ki,fa]),ga=P({role:Bt,content:Y([pr,I(pr)]),_meta:K(l(),Q()).optional()}),_a=gr.extend({messages:I(ga),modelPreferences:pa.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(Tn).optional(),toolChoice:ma.optional()}),Sa=Te.extend({method:O("sampling/createMessage"),params:_a}),ya=Ce.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens"]).or(l())),role:Bt,content:ha}),va=Ce.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Bt,content:Y([pr,I(pr)])}),kn=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:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),ro=P({type:te(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),In=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),On=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),xn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ba=Y([In,On]),Nn=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()}),jn=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()}),za=Y([Nn,jn]),Ra=Y([xn,ba,za]),An=Y([Ra,kn,to,ro]),oo=gr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),An),required:I(l()).optional()}).catchall(Q())}),$a=gr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),wa=Y([oo,$a]),Pa=Te.extend({method:O("elicitation/create"),params:wa}),Ea=Ve.extend({elicitationId:l()}),Ta=He.extend({method:O("notifications/elicitation/complete"),params:Ea}),Ca=Ce.extend({action:te(["accept","decline","cancel"]),content:dr(e=>e===null?void 0:e,K(l(),Y([l(),L(),H(),I(l())])).optional())}),ka=P({type:O("ref/resource"),uri:l()}),Ia=P({type:O("ref/prompt"),name:l()}),Oa=Le.extend({ref:Y([Ia,ka]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),xa=Te.extend({method:O("completion/complete"),params:Oa}),Na=Ce.extend({completion:oe({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),ja=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Aa=Te.extend({method:O("roots/list"),params:Le.optional()}),qa=Ce.extend({roots:I(ja)}),Ma=He.extend({method:O("notifications/roots/list_changed"),params:Ve.optional()}),tl=oe({ttl:L().optional(),pollInterval:L().optional()}),La=te(["working","input_required","completed","failed","cancelled"]),Gt=P({taskId:l(),status:La,ttl:Y([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),rl=Ce.extend({task:Gt}),Da=Ve.merge(Gt),ol=He.extend({method:O("notifications/tasks/status"),params:Da}),nl=Te.extend({method:O("tasks/get"),params:Le.extend({taskId:l()})}),sl=Ce.merge(Gt),il=Te.extend({method:O("tasks/result"),params:Le.extend({taskId:l()})}),al=Ce.loose(),cl=Ht.extend({method:O("tasks/list")}),ul=Jt.extend({tasks:I(Gt)}),ll=Te.extend({method:O("tasks/cancel"),params:Le.extend({taskId:l()})}),dl=Ce.merge(Gt),pl=Y([bn,mi,gi,xa,ca,Bi,Vi,zi,$i,Ei,Ii,xi,ji,sa,ra]),ml=Y([yn,zn,hi,Ma]),fl=Y([Sn,ya,va,Ca,qa]),hl=Y([bn,Sa,Pa,Aa]),gl=Y([yn,zn,la,Zi,Ci,ia,Qi,qi,Ta]),_l=Y([Sn,fi,_i,Na,Xi,Hi,Ri,wi,Ti,Cn,oa,Li]),Me=Qs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:wg.custom,message:"URL must be parseable",fatal:!0}),Oc}).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"}),Sl=oe({resource:l().url(),authorization_servers:I(Me).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()}),Za=oe({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,registration_endpoint:Me.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:Me.optional(),revocation_endpoint:Me.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()}),Ua=oe({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,userinfo_endpoint:Me.optional(),jwks_uri:Me,registration_endpoint:Me.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:Me.optional(),op_tos_uri:Me.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),yl=P({...Ua.shape,...Za.pick({code_challenge_methods_supported:!0}).shape}),vl=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:ti.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),bl=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(),zl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Wu=Me.optional().or(O("").transform(()=>{})),Fa=P({redirect_uris:I(Me),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:Me.optional(),logo_uri:Wu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Wu,policy_uri:l().optional(),jwks_uri:Me.optional(),jwks:hg().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Va=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(),Rl=Fa.merge(Va),$l=P({error:l(),error_description:l().optional()}).strip(),wl=P({token:l(),token_type_hint:l().optional()}).strip();var Cl=Symbol.for("mcp.sdk.errorBrands");function xl(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,Cl,{value:r,enumerable:!1,configurable:!0})}function so(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Cl)){let r=t[Cl];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Bg=class Kg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return so(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 so(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",xl(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 Kg(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 so(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 so(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",xl(this,new.target)}},Cb=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 jg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function kb(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Gg(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 Xa(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(jg(n)&&jg(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!kb(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var Ib="2026-07-28";function Un(e){return e>=Ib}function Wg(e){return e.filter(t=>!Un(t))}function Nl(e){return e.filter(t=>Un(t))}function Yg(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 Xg=["task","inputRequests","requestState"];function jl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Xg.some(t=>t in e)?e:{...e,content:[]}}function Ob(){let e=un(()=>Y([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=Y([l(),L().int()]),o=l(),n=P({ttl:L().optional()}),s=P({taskId:l()}),i=oe({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=oe({_meta:i.optional()}),v=Y([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:te(["light","dark"]).optional()}),z=P({icons:I(f).optional()}),S=P({name:l(),title:l().optional()}),R=S.extend({...S.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())),y=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),E=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),N=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:y.optional(),extensions:K(l(),t).optional()}),V=c.extend({protocolVersion:l(),capabilities:N,clientInfo:R}),M=u.extend({method:O("initialize"),params:V}),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()}),W=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()}),F=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=F.extend({text:l()}),C=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),x=F.extend({blob:C}),J=te(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),pe=P({...S.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:ee.optional(),_meta:X(oe({}))}),ae=P({...S.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(oe({}))}),ze=k.extend({method:O("resources/list")}),Je=j.extend({resources:I(pe)}),T=k.extend({method:O("resources/templates/list")}),A=j.extend({resourceTemplates:I(ae)}),D=c.extend({uri:l()}),se=D,ie=u.extend({method:O("resources/read"),params:se}),de=g.extend({contents:I(Y([$,x]))}),ke=p.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),Ne=D,Ze=u.extend({method:O("resources/subscribe"),params:Ne}),xe=D,we=u.extend({method:O("resources/unsubscribe"),params:xe}),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({...S.shape,...z.shape,description:X(l()),arguments:X(I(ht)),_meta:X(oe({}))}),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()}),mo=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),xt=P({type:O("resource"),resource:Y([$,x]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),fo=pe.extend({type:O("resource_link")}),nt=Y([Qt,er,tr,fo,xt]),vr=P({role:J,content:nt}),br=g.extend({description:l().optional(),messages:I(vr)}),rr=p.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),ho=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),zr=P({taskSupport:te(["required","optional","forbidden"]).optional()}),or=P({...S.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:ho.optional(),execution:zr.optional(),_meta:K(l(),Q()).optional()}),Rr=k.extend({method:O("tools/list")}),$r=j.extend({tools:I(or)}),wr=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ue=a.extend({name:l(),arguments:K(l(),Q()).optional()}),go=u.extend({method:O("tools/call"),params:Ue}),Yn=p.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),Pr=te(["debug","info","notice","warning","error","critical","alert","emergency"]),_o=c.extend({level:Pr}),So=u.extend({method:O("logging/setLevel"),params:_o}),yo=d.extend({level:Pr,logger:l().optional(),data:Q()}),vo=p.extend({method:O("notifications/message"),params:yo}),bo=P({name:l().optional()}),zo=P({hints:I(bo).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Ro=P({mode:te(["auto","required","none"]).optional()}),Xn=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()}),$o=Hr("type",[Qt,er,tr]),Nt=Hr("type",[Qt,er,tr,mo,Xn]),wo=P({role:J,content:Y([Nt,I(Nt)]),_meta:K(l(),Q()).optional()}),Po=a.extend({messages:I(wo),modelPreferences:zo.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(or).optional(),toolChoice:Ro.optional()}),Eo=u.extend({method:O("sampling/createMessage"),params:Po}),To=g.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:$o}),Co=g.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:Y([Nt,I(Nt)])}),ko=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),Oo=P({type:te(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),xo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),No=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),jo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),Ao=Y([xo,No]),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()}),Qn=Y([nr,sr]),es=Y([jo,Ao,Qn]),et=Y([es,ko,Io,Oo]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),qo=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ct=Y([tt,qo]),ts=u.extend({method:O("elicitation/create"),params:ct}),rs=d.extend({elicitationId:l()}),os=p.extend({method:O("notifications/elicitation/complete"),params:rs}),ns=g.extend({action:te(["accept","decline","cancel"]),content:dr(Fe=>Fe===null?void 0:Fe,K(l(),Y([l(),L(),H(),I(l())])).optional())}),ss=P({type:O("ref/resource"),uri:l()}),is=P({type:O("ref/prompt"),name:l()}),as=c.extend({ref:Y([is,ss]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Mo=u.extend({method:O("completion/complete"),params:as}),cs=g.extend({completion:oe({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),us=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Er=u.extend({method:O("roots/list"),params:c.optional()}),Lo=g.extend({roots:I(us)}),ls=p.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),ds=oe({ttl:L().optional(),pollInterval:L().optional()}),Do=te(["working","input_required","completed","failed","cancelled"]),jt=P({taskId:l(),status:Do,ttl:Y([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:jt}),ps=d.merge(jt),ir=p.extend({method:O("notifications/tasks/status"),params:ps}),Tr=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Cr=g.merge(jt),kr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),mc=g.loose(),Be=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:S,ImplementationSchema:R,ClientTasksCapabilitySchema:y,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:N,InitializeRequestParamsSchema:V,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:W,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:k,PaginatedResultSchema:j,ResourceContentsSchema:F,TextResourceContentsSchema:$,BlobResourceContentsSchema:x,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ae,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Je,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:se,ReadResourceRequestSchema:ie,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:ke,SubscribeRequestParamsSchema:Ne,SubscribeRequestSchema:Ze,UnsubscribeRequestParamsSchema:xe,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:mo,EmbeddedResourceSchema:xt,ResourceLinkSchema:fo,ContentBlockSchema:nt,PromptMessageSchema:vr,GetPromptResultSchema:br,PromptListChangedNotificationSchema:rr,ToolAnnotationsSchema:ho,ToolExecutionSchema:zr,ToolSchema:or,ListToolsRequestSchema:Rr,ListToolsResultSchema:$r,CallToolResultSchema:wr,CallToolRequestParamsSchema:Ue,CallToolRequestSchema:go,ToolListChangedNotificationSchema:Yn,LoggingLevelSchema:Pr,SetLevelRequestParamsSchema:_o,SetLevelRequestSchema:So,LoggingMessageNotificationParamsSchema:yo,LoggingMessageNotificationSchema:vo,ModelHintSchema:bo,ModelPreferencesSchema:zo,ToolChoiceSchema:Ro,ToolResultContentSchema:Xn,SamplingContentSchema:$o,SamplingMessageContentBlockSchema:Nt,SamplingMessageSchema:wo,CreateMessageRequestParamsSchema:Po,CreateMessageRequestSchema:Eo,CreateMessageResultSchema:To,CreateMessageResultWithToolsSchema:Co,BooleanSchemaSchema:ko,StringSchemaSchema:Io,NumberSchemaSchema:Oo,UntitledSingleSelectEnumSchemaSchema:xo,TitledSingleSelectEnumSchemaSchema:No,LegacyTitledEnumSchemaSchema:jo,SingleSelectEnumSchemaSchema:Ao,UntitledMultiSelectEnumSchemaSchema:nr,TitledMultiSelectEnumSchemaSchema:sr,MultiSelectEnumSchemaSchema:Qn,EnumSchemaSchema:es,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:qo,ElicitRequestParamsSchema:ct,ElicitRequestSchema:ts,ElicitationCompleteNotificationParamsSchema:rs,ElicitationCompleteNotificationSchema:os,ElicitResultSchema:ns,ResourceTemplateReferenceSchema:ss,PromptReferenceSchema:is,CompleteRequestParamsSchema:as,CompleteRequestSchema:Mo,CompleteResultSchema:cs,RootSchema:us,ListRootsRequestSchema:Er,ListRootsResultSchema:Lo,RootsListChangedNotificationSchema:ls,TaskCreationParamsSchema:ds,TaskStatusSchema:Do,TaskSchema:jt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:ps,TaskStatusNotificationSchema:ir,GetTaskRequestSchema:Tr,GetTaskResultSchema:Cr,GetTaskPayloadRequestSchema:kr,GetTaskPayloadResultSchema:mc,ListTasksRequestSchema:Be,ListTasksResultSchema:Ie,CancelTaskRequestSchema:ar,CancelTaskResultSchema:g.merge(jt),ClientRequestSchema:Y([fe,M,Mo,So,Xt,gt,ze,T,ie,Ze,we,go,Rr,Tr,kr,Be,ar]),ClientNotificationSchema:Y([h,Oe,G,ls,ir]),ClientResultSchema:Y([m,To,Co,ns,Lo,Cr,Ie,We]),ServerRequestSchema:Y([fe,Eo,ts,Er,Tr,kr,Be,ar]),ServerNotificationSchema:Y([h,Oe,vo,Ae,ke,Yn,rr,ir,os]),ServerResultSchema:Y([m,W,cs,br,It,Je,A,de,wr,$r,Cr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,BS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let zd of Xg)if(zd in Fe){BS.addIssue({code:"custom",message:`content is required when the body carries '${zd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(jl).pipe(wr)}}var xb;function Qg(){return xb??=Ob()}function e_(e){return e.type!=="object"}var Nb=new Set(["const","enum","default","examples"]),jb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Ag(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Ab(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(Ag(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=tp(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(a=>o(a,!1));if(n===null||typeof n!="object"||!s&&Ag(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))s?i[a]=o(u,!1):(a==="$ref"||a==="$dynamicRef")&&typeof u=="string"?i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:a==="$recursiveRef"&&u==="#"&&r?c=!0:Nb.has(a)?i[a]=u:jb.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 t_={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},r_={"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},qb={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},Ha;function Al(){if(Ha)return Ha;let e=Qg();return Ha={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}},Ha}function o_(e){return Object.prototype.hasOwnProperty.call(t_,e)}function n_(e){return Object.prototype.hasOwnProperty.call(r_,e)}function Mb(e){return Object.prototype.hasOwnProperty.call(qb,e)}function Lb(e){return Mb(e)?Al().resultSchemas[e]:void 0}function Db(e){return o_(e)?Al().requestSchemas[e]:void 0}function Zb(e){return n_(e)?Al().notificationSchemas[e]:void 0}var TP=Object.keys(t_),CP=Object.keys(r_);function kl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ja(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 qg={ok:!1,reason:"not-in-era"};function Mg(e){return kl(e)&&kl(e.outputSchema)&&e_(e.outputSchema)}var ql={era:"2025-11-25",hasRequestMethod:o_,hasNotificationMethod:n_,validateRequest:(e,t)=>Ja(Db(e),t),validateResult:(e,t)=>Ja(Lb(e),t),validateNotification:(e,t)=>Ja(Zb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>qg,validateInputResponse:()=>qg,samplingResultVariant:((e,t)=>{let r=Qg();return Ja(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=Yg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&e_(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(kl(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=>Mg(o))?t:{...t,tools:r.map(o=>Mg(o)?{...o,outputSchema:Ab(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Ub(){let e=un(()=>Y([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=Y([l(),L().int()]),o=l(),n=Y([l(),L().int()]),s=te(["user","assistant"]),i=te(["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=oe({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:te(["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()}),S=$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:S.optional(),url:t.optional()}),t.optional())),w=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),b=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),y=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()}),N=P({progress:L(),total:X(L()),message:X(l())}),V=P({...v.shape,...N.shape,progressToken:r}),M=m.extend({method:O("notifications/progress"),params:V}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),W=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(oe({}))}),he=P({...f.shape,...h.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(oe({}))}),k=m.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),j=v.extend({uri:l()}),F=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(oe({}))}),x=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:Y([fe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Je=Oe.extend({type:O("resource_link")}),T=Y([J,ee,pe,Je,ze]),A=P({role:s,content:T}),D=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),se=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:te(["auto","required","none"]).optional()}),Ne=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Ze=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),xe=P({type:te(["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=Y([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=Y([at,gt]),Ot=Y([Ae,ht,It]),Xt=Y([Ot,Ne,Ze,xe]),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()}),mo=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),xt=y.shape,fo=P({experimental:xt.experimental,sampling:xt.sampling,elicitation:xt.elicitation,roots:xt.roots,extensions:xt.extensions}),nt=E.shape,vr=P({experimental:nt.experimental,logging:nt.logging,completions:nt.completions,prompts:nt.prompts,resources:nt.resources,tools:nt.tools,extensions:nt.extensions}),br=oe({progressToken:r.optional(),[fr]:l(),[Jr]:z.optional(),[Tt]:fo,[Ut]:i.optional()}),rr=P({...f.shape,...h.shape,description:l().optional(),inputSchema:oe({$schema:l().optional(),type:O("object")}),outputSchema:oe({$schema:l().optional()}).optional(),annotations:D.optional(),_meta:K(l(),Q()).optional()}),ho=P({type:O("tool_result"),toolUseId:l(),content:I(T),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),zr=Y([J,ee,pe,ae,ho]),or=P({role:s,content:Y([zr,I(zr)]),_meta:K(l(),Q()).optional()}),Rr=l(),$r=oe({[Et]:z.optional().catch(void 0)}),wr=$r.optional();function Ue(Ie){return oe({_meta:wr,resultType:Rr.default("complete"),...Ie})}let go=Ue({}),Yn=Ue({nextCursor:o.optional()}),Pr=Ue({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),_o=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),tools:I(rr),nextCursor:o.optional()}),So=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),prompts:I(C),nextCursor:o.optional()}),yo=Ue({description:l().optional(),messages:I(A)}),vo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),bo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),zo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),contents:I(Y([fe,$e]))}),Ro=Ue({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Xn=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"])}),$o=Ue({ttlMs:L().int().min(0).catch(0),cacheScope:te(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:vr,instructions:l().optional()}),Nt=P({messages:I(or),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(rr).optional(),toolChoice:ke.optional()}),wo=P({method:O("sampling/createMessage"),params:Nt}),Po=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),Eo=P({...or.shape,model:l(),stopReason:l().optional()}),To=P({roots:I(mo)}),Co=P({action:te(["accept","decline","cancel"]),content:K(l(),Y([l(),L(),H(),I(l())])).optional()}),ko=P({mode:O("url"),message:l(),url:l().url()}),Io=Y([Qt,ko]),Oo=P({method:O("elicitation/create"),params:Io}),xo=Y([wo,Po,Oo]),No=Y([Eo,To,Co]),jo=K(l(),xo),Ao=K(l(),No),nr=Ue({inputRequests:jo.optional(),requestState:l().optional()}),sr={inputResponses:Ao.optional(),requestState:l().optional()},Qn=P({_meta:br,...sr}),es=oe({progressToken:r.optional()});function et(Ie,ar){return P({method:O(Ie),params:P({_meta:br,...ar})})}function tt(Ie,ar){return P({method:O(Ie),params:P({_meta:es.optional(),...ar}).optional()})}let qo={name:l(),arguments:K(l(),Q()).optional(),...sr},ct={cursor:o.optional()},ts=et("tools/call",qo),rs=et("tools/list",ct),os=et("prompts/list",ct),ns=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...sr}),ss=et("resources/list",ct),is=et("resources/templates/list",ct),as=et("resources/read",{uri:l(),...sr}),Mo={ref:Y([tr,er]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},cs=et("completion/complete",Mo),us=et("server/discover",{}),Er=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Lo={notifications:Er},ls=et("subscriptions/listen",Lo),ds=$r.extend({"io.modelcontextprotocol/subscriptionId":n}),Do=oe({_meta:ds,resultType:Rr.default("complete")}),jt={"tools/call":tt("tools/call",qo),"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",Mo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",Lo)};function We(Ie){return oe({_meta:wr,...Ie})}let ps={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:te(["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:te(["public","private"]),prompts:I(C),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),contents:I(Y([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:te(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:vr,instructions:l().optional()}),"subscriptions/listen":We({})},ir=oe({"io.modelcontextprotocol/subscriptionId":n.optional()}),Tr=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:ir.optional(),notifications:Er})}),Cr=P({_meta:ir.optional(),requestId:n,reason:l().optional()}),kr=P({method:O("notifications/cancelled"),params:Cr}),mc={"notifications/cancelled":kr,"notifications/progress":M,"notifications/message":W,"notifications/resources/updated":F,"notifications/resources/list_changed":k,"notifications/tools/list_changed":se,"notifications/prompts/list_changed":x,"notifications/subscriptions/acknowledged":Tr},Be=Ie=>P({jsonrpc:O("2.0"),id:Y([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:y,ServerCapabilitiesSchema:E,ProgressSchema:N,ProgressNotificationParamsSchema:V,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:W,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:k,ResourceUpdatedNotificationParamsSchema:j,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:$,PromptSchema:C,PromptListChangedNotificationSchema:x,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ae,EmbeddedResourceSchema:ze,ResourceLinkSchema:Je,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:se,ModelHintSchema:ie,ModelPreferencesSchema:de,ToolChoiceSchema:ke,BooleanSchemaSchema:Ne,StringSchemaSchema:Ze,NumberSchemaSchema:xe,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:mo,ClientCapabilities2026Schema:fo,ServerCapabilities2026Schema:vr,RequestMetaEnvelopeSchema:br,ToolSchema:rr,ToolResultContentSchema:ho,SamplingMessageContentBlockSchema:zr,SamplingMessageSchema:or,ResultTypeSchema:Rr,ResultMetaSchema:$r,ResultSchema:go,PaginatedResultSchema:Yn,CallToolResultSchema:Pr,ListToolsResultSchema:_o,ListPromptsResultSchema:So,GetPromptResultSchema:yo,ListResourcesResultSchema:vo,ListResourceTemplatesResultSchema:bo,ReadResourceResultSchema:zo,CompleteResultSchema:Ro,CacheableResultSchema:Xn,DiscoverResultSchema:$o,CreateMessageRequestParamsSchema:Nt,CreateMessageRequestSchema:wo,ListRootsRequestSchema:Po,CreateMessageResultSchema:Eo,ListRootsResultSchema:To,ElicitResultSchema:Co,ElicitRequestURLParamsSchema:ko,ElicitRequestParamsSchema:Io,ElicitRequestSchema:Oo,InputRequestSchema:xo,InputResponseSchema:No,InputRequestsSchema:jo,InputResponsesSchema:Ao,InputRequiredResultSchema:nr,InputResponseRequestParamsSchema:Qn,CallToolRequestSchema:ts,ListToolsRequestSchema:rs,ListPromptsRequestSchema:os,GetPromptRequestSchema:ns,ListResourcesRequestSchema:ss,ListResourceTemplatesRequestSchema:is,ReadResourceRequestSchema:as,CompleteRequestSchema:cs,DiscoverRequestSchema:us,SubscriptionFilterSchema:Er,SubscriptionsListenRequestSchema:ls,SubscriptionsListenResultMetaSchema:ds,SubscriptionsListenResultSchema:Do,dispatchRequestSchemas:jt,dispatchResultSchemas:ps,NotificationMetaSchema:ir,SubscriptionsAcknowledgedNotificationSchema:Tr,CancelledNotificationParamsSchema:Cr,CancelledNotificationSchema:kr,notificationSchemas2026:mc,JSONRPCResultResponseSchema:Be(go),CallToolResultResponseSchema:Be(Y([Pr,nr])),ListToolsResultResponseSchema:Be(_o),ListPromptsResultResponseSchema:Be(So),GetPromptResultResponseSchema:Be(Y([yo,nr])),ListResourcesResultResponseSchema:Be(vo),ListResourceTemplatesResultResponseSchema:Be(bo),ReadResourceResultResponseSchema:Be(Y([zo,nr])),CompleteResultResponseSchema:Be(Ro),DiscoverResultResponseSchema:Be($o),SubscriptionsListenResultResponseSchema:Be(Do)}}var Fb;function Wt(){return Fb??=Ub()}var Vb=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Hb(e){return Vb.includes(e)}var no=Symbol("modelcontextprotocol.resultCacheHintFallback");function Qa(e,t){if(t===void 0)return e;let r=e[no];if(r===void 0)return{...e,[no]: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,[no]:o}}function Jb(e){return e[no]}function Ml(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ll(e){return e==="public"||e==="private"}function Dl(e,t){if(e.ttlMs!==void 0&&!Ml(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&&!Ll(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})({}),ne=class s_ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return so(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 so(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",xl(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new i_(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Zl({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 ec(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 tc({requiredCapabilities:n.requiredCapabilities},r)}return new s_(t,r,o)}},ec=class extends ne{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}},i_=class extends ne{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??[]}},Zl=class extends ne{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}},tc=class extends ne{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}},Bb=0,Kb="private",Gb=["tools/call","prompts/get","resources/read"];function Wb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||Gb.includes(e))return t;throw new ne(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Yb(e,t){let r=Jb(t);if(t.resultType!=="complete"||!Hb(e))return r===void 0?t:rz(t);let o=t,n=Ml(o.ttlMs)?o.ttlMs:ez(r),s=Ll(o.cacheScope)?o.cacheScope:tz(r),i={...o,ttlMs:n,cacheScope:s};return delete i[no],i}function Xb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qb(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Et]:t}}:!Xb(r)||r[Et]!==void 0?e:{...e,_meta:{...r,[Et]:t}}}function ez(e){return e!==void 0&&Ml(e.ttlMs)?e.ttlMs:Bb}function tz(e){return e!==void 0&&Ll(e.cacheScope)?e.cacheScope:Kb}function rz(e){let t={...e};return delete t[no],t}var oz=["elicitation/create","sampling/createMessage","roots/list"],Ba;function a_(){if(Ba)return Ba;let e=Wt();return Ba={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:oe({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Ba}function c_(e){return oz.includes(e)}function Pl(e){return c_(e)?a_().request[e]:void 0}function nz(e){return c_(e)?a_().response[e]:void 0}var Ul={"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},u_={"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 l_(e){return Object.prototype.hasOwnProperty.call(Ul,e)}function d_(e){return Object.prototype.hasOwnProperty.call(u_,e)}function sz(e){return Object.prototype.hasOwnProperty.call(Ul,e)}function iz(e){return l_(e)?Wt().dispatchRequestSchemas[e]:void 0}function az(e){return sz(e)?Wt().dispatchResultSchemas[e]:void 0}function cz(e){return d_(e)?Wt().notificationSchemas2026[e]:void 0}var kP=Object.keys(Ul),IP=Object.keys(u_);function Ln(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qn(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 uz={ok:!1,reason:"not-in-era"},lz=[fr,Tt];function dz(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=>Ln(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!Ln(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(Ln(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Fl={era:"2026-07-28",hasRequestMethod:l_,hasNotificationMethod:d_,hasInputRequestMethod:e=>Pl(e)!==void 0,validateRequest:(e,t)=>qn(iz(e),t),validateResult:(e,t)=>qn(az(e),t),validateNotification:(e,t)=>qn(cz(e),t),validateInputRequest:(e,t)=>qn(Pl(e),t),validateInputResponse:(e,t)=>qn(nz(e),t),samplingResultVariant:()=>uz,outboundEnvelope(e){return{[fr]:e.protocolVersion,[Jr]:e.clientInfo,[Tt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ut]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of lz)o in e||t.push({key:o,problem:"missing"});let r=Wt().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=>Yg(e),inputRequestSchema:Pl,decodeResult(e,t){if(!Ln(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=Ln(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Wt().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=pz(),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 Qb(Yb(e,Wb(e,dz(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=Wt().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("; ")}`}},Ka;function pz(){if(Ka)return Ka;let e=Wt();return Ka={"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},Ka}var Vl="2026-07-28";function io(e){return e!==void 0&&Un(e)?Fl:ql}function Lg(e){return e.revision!==void 0?io(e.revision).era:e.era==="modern"?Fl.era:ql.era}function El(e){return p_.some(t=>t.hasRequestMethod(e))}function Tl(e){return p_.some(t=>t.hasNotificationMethod(e))}function Dg(e){return e==="tasks/get"||e==="tasks/cancel"}var p_=[ql,Fl];var mz=Qd({AnnotationsSchema:()=>Ct,AudioContentSchema:()=>Qr,BaseMetadataSchema:()=>Pt,BaseRequestParamsSchema:()=>Le,BlobResourceContentsSchema:()=>wn,BooleanSchemaSchema:()=>kn,CallToolRequestParamsSchema:()=>na,CallToolRequestSchema:()=>sa,CallToolResultSchema:()=>Cn,CancelTaskRequestSchema:()=>ll,CancelTaskResultSchema:()=>dl,CancelledNotificationParamsSchema:()=>ai,CancelledNotificationSchema:()=>yn,ClientCapabilitiesSchema:()=>di,ClientNotificationSchema:()=>ml,ClientRequestSchema:()=>pl,ClientResultSchema:()=>fl,ClientTasksCapabilitySchema:()=>ui,CompatibilityCallToolResultSchema:()=>Qu,CompleteRequestParamsSchema:()=>Oa,CompleteRequestSchema:()=>xa,CompleteResultSchema:()=>Na,ContentBlockSchema:()=>eo,CreateMessageRequestParamsSchema:()=>_a,CreateMessageRequestSchema:()=>Sa,CreateMessageResultSchema:()=>ya,CreateMessageResultWithToolsSchema:()=>va,CreateTaskResultSchema:()=>rl,CursorSchema:()=>pn,DiscoverRequestSchema:()=>gi,DiscoverResultSchema:()=>_i,ElicitRequestFormParamsSchema:()=>oo,ElicitRequestParamsSchema:()=>wa,ElicitRequestSchema:()=>Pa,ElicitRequestURLParamsSchema:()=>$a,ElicitResultSchema:()=>Ca,ElicitationCompleteNotificationParamsSchema:()=>Ea,ElicitationCompleteNotificationSchema:()=>Ta,EmbeddedResourceSchema:()=>Gi,EmptyResultSchema:()=>Sn,EnumSchemaSchema:()=>Ra,GetPromptRequestParamsSchema:()=>Ji,GetPromptRequestSchema:()=>Bi,GetPromptResultSchema:()=>Xi,GetTaskPayloadRequestSchema:()=>il,GetTaskPayloadResultSchema:()=>al,GetTaskRequestSchema:()=>nl,GetTaskResultSchema:()=>sl,IconSchema:()=>ci,IconsSchema:()=>Vt,ImageContentSchema:()=>Xr,ImplementationSchema:()=>Gr,InitializeRequestParamsSchema:()=>pi,InitializeRequestSchema:()=>mi,InitializeResultSchema:()=>fi,InitializedNotificationSchema:()=>hi,JSONArraySchema:()=>Yu,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Kr,JSONRPCMessageSchema:()=>_n,JSONRPCNotificationSchema:()=>gn,JSONRPCRequestSchema:()=>hn,JSONRPCResponseSchema:()=>ii,JSONRPCResultResponseSchema:()=>Br,JSONValueSchema:()=>Zt,LegacyTitledEnumSchemaSchema:()=>xn,ListChangedOptionsBaseSchema:()=>el,ListPromptsRequestSchema:()=>Vi,ListPromptsResultSchema:()=>Hi,ListResourceTemplatesRequestSchema:()=>$i,ListResourceTemplatesResultSchema:()=>wi,ListResourcesRequestSchema:()=>zi,ListResourcesResultSchema:()=>Ri,ListRootsRequestSchema:()=>Aa,ListRootsResultSchema:()=>qa,ListTasksRequestSchema:()=>cl,ListTasksResultSchema:()=>ul,ListToolsRequestSchema:()=>ra,ListToolsResultSchema:()=>oa,LoggingLevelSchema:()=>Kt,LoggingMessageNotificationParamsSchema:()=>ua,LoggingMessageNotificationSchema:()=>la,ModelHintSchema:()=>da,ModelPreferencesSchema:()=>pa,MultiSelectEnumSchemaSchema:()=>za,NotificationSchema:()=>He,NotificationsParamsSchema:()=>Ve,NumberSchemaSchema:()=>ro,PaginatedRequestParamsSchema:()=>vi,PaginatedRequestSchema:()=>Ht,PaginatedResultSchema:()=>Jt,PingRequestSchema:()=>bn,PrimitiveSchemaDefinitionSchema:()=>An,ProgressNotificationParamsSchema:()=>yi,ProgressNotificationSchema:()=>zn,ProgressSchema:()=>Si,ProgressTokenSchema:()=>dn,PromptArgumentSchema:()=>Ui,PromptListChangedNotificationSchema:()=>Qi,PromptMessageSchema:()=>Yi,PromptReferenceSchema:()=>Ia,PromptSchema:()=>Fi,ReadResourceRequestParamsSchema:()=>Pi,ReadResourceRequestSchema:()=>Ei,ReadResourceResultSchema:()=>Ti,RelatedTaskMetadataSchema:()=>si,RequestIdSchema:()=>Ft,RequestMetaSchema:()=>mn,RequestSchema:()=>Te,ResourceContentsSchema:()=>Rn,ResourceLinkSchema:()=>Wi,ResourceListChangedNotificationSchema:()=>Ci,ResourceRequestParamsSchema:()=>Wr,ResourceSchema:()=>Pn,ResourceTemplateReferenceSchema:()=>ka,ResourceTemplateSchema:()=>bi,ResourceUpdatedNotificationParamsSchema:()=>Di,ResourceUpdatedNotificationSchema:()=>Zi,ResultMetaObjectSchema:()=>fn,ResultSchema:()=>Ce,RoleSchema:()=>Bt,RootSchema:()=>ja,RootsListChangedNotificationSchema:()=>Ma,SamplingContentSchema:()=>ha,SamplingMessageContentBlockSchema:()=>pr,SamplingMessageSchema:()=>ga,ServerCapabilitiesSchema:()=>vn,ServerNotificationSchema:()=>gl,ServerRequestSchema:()=>hl,ServerResultSchema:()=>_l,ServerTasksCapabilitySchema:()=>li,SetLevelRequestParamsSchema:()=>aa,SetLevelRequestSchema:()=>ca,SingleSelectEnumSchemaSchema:()=>ba,StringSchemaSchema:()=>to,SubscribeRequestParamsSchema:()=>ki,SubscribeRequestSchema:()=>Ii,SubscriptionFilterSchema:()=>En,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ai,SubscriptionsAcknowledgedNotificationSchema:()=>qi,SubscriptionsListenRequestParamsSchema:()=>Ni,SubscriptionsListenRequestSchema:()=>ji,SubscriptionsListenResultMetaSchema:()=>Mi,SubscriptionsListenResultSchema:()=>Li,TaskAugmentedRequestParamsSchema:()=>gr,TaskCreationParamsSchema:()=>tl,TaskMetadataSchema:()=>ni,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Da,TaskStatusNotificationSchema:()=>ol,TaskStatusSchema:()=>La,TextContentSchema:()=>Yr,TextResourceContentsSchema:()=>$n,TitledMultiSelectEnumSchemaSchema:()=>jn,TitledSingleSelectEnumSchemaSchema:()=>On,ToolAnnotationsSchema:()=>ea,ToolChoiceSchema:()=>ma,ToolExecutionSchema:()=>ta,ToolListChangedNotificationSchema:()=>ia,ToolResultContentSchema:()=>fa,ToolSchema:()=>Tn,ToolUseContentSchema:()=>Ki,UnsubscribeRequestParamsSchema:()=>Oi,UnsubscribeRequestSchema:()=>xi,UntitledMultiSelectEnumSchemaSchema:()=>Nn,UntitledSingleSelectEnumSchemaSchema:()=>In});var Fn=e=>hn.safeParse(e).success,Vn=e=>gn.safeParse(e).success,Ya=e=>Br.safeParse(e).success,Hl=e=>Kr.safeParse(e).success,Jl=e=>ii.safeParse(e).success;var kt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Bl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Kl(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var Zg="x-mcp-header",fz=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,hz=new Set(["string","integer","boolean","number"]);function Gl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(Zg in a){if(!c||i.length===0)return`${Ga(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[Zg];if(typeof d!="string"||d.length===0)return`${Ga(i)}: x-mcp-header MUST be a non-empty string`;if(!fz.test(d))return`${Ga(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||!hz.has(p))return`${Ga(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 gz){let p=a[d];if(p===void 0)continue;let g=Array.isArray(p)?p:p!==null&&typeof p=="object"&&_z.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 gz=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],_z=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Ga(e){return e.length===0?"<root>":e.join(".")}var Wa=-32020,OP=[{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:[Wa,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:[Wa],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:[Wa],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."}],Sz={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[Wa]:400};function rc(e,t){return Ws(e,t)}function Mn(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function ao(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 Ug=!1,Il="draft-2020-12";function Sr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Il});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().");Ug||(Ug=!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=Ks(e,{target:Il,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:m_(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 m_(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"||m_(o)))}return!1}function yz(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=>yz(o)).join(", ")}:{success:!0,data:r.value}}function vz(e){let t=Ks(e,{target:Il,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var bz=/\\\.\\d\{(\d+)\}/;function zz(e){let t=bz.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 Rz(e,t){let r;switch(e){case"email":r=[pg()];break;case"uri":r=[Qs()];break;case"date":r=[wt.date()];break;case"date-time":r=zz(t);break}return new Set(r.map(o=>vz(o)).filter(o=>o!==void 0))}function $z(e,t,r){return r!=="zod"?!0:Rz(e,t).has(t)}function f_(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 Zn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wz(e){try{return Sr(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ne(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Pz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Wl(e){return Pz.has(e)||e.startsWith("x-")}var Ez=new Set(["$schema",...Object.keys(oo.shape.requestedSchema.shape)]),Fg={string:Mn([to,In,On,xn]),number:Mn([ro]),integer:Mn([ro]),boolean:Mn([kn]),array:Mn([Nn,jn])},Tz=new Set(to.shape.format.unwrap().options);function Cz(e,t,r,o){if(!Zn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(Fg,e.type)?Fg[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Wl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Tz.has(e.format)?(typeof c!="string"||!$z(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function kz(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&Zn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Cz(c,`properties.${i}`,t,o)])):Ez.has(n)?r[n]=s:Wl(n)||o.push(n);if(o.length>0)throw new ne(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Iz(e,t){if(!Zn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!rc(An,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Ol(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>Ol(o,t[n],`${r}[${n}]`)):!Zn(e)||!Zn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?Ol(n,t[o],s):Wl(o)?[]:[s]})}function Oz(e){if(!ao(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=kz(wz(e.requestedSchema),t),o=rc(oo.shape.requestedSchema,r);if(!o.success)throw new ne(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Iz(r,o.error.message)}`);let n=Ol(r,o.data);if(n.length>0)throw new ne(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 ne(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function xz(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 Nz=Object.assign(xz,{elicit(e){try{return{method:"elicitation/create",params:Oz(e)}}catch(t){throw t instanceof ne?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 h_=250;function g_(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function __(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 S_(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 jz=["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"],Az={IdJagTokenExchangeResponseSchema:bl,OAuthClientInformationFullSchema:Rl,OAuthClientInformationSchema:Va,OAuthClientMetadataSchema:Fa,OAuthClientRegistrationErrorSchema:$l,OAuthErrorResponseSchema:zl,OAuthMetadataSchema:Za,OAuthProtectedResourceMetadataSchema:Sl,OAuthTokenRevocationRequestSchema:wl,OAuthTokensSchema:vl,OpenIdProviderDiscoveryMetadataSchema:yl,OpenIdProviderMetadataSchema:Ua},y_={},v_={};function b_(e,t){let r=e.slice(0,-6);y_[r]=t,v_[r]=o=>t.safeParse(o).success}for(let e of jz)b_(e,mz[e]);for(let[e,t]of Object.entries(Az))b_(e,t);var qz=Object.freeze(y_),Mz=Object.freeze(v_);function Lz(e){switch(e){case"initialize":case"notifications/initialized":return io(void 0);case"server/discover":return io(Vl);default:return}}var z_=6e4,Dz=[fr,Jr,Tt,Ut],Zz=["inputResponses","requestState"];function Vg(e,t){let r=e.params;if(!Dn(r))return{message:e,lifted:{}};let o=r._meta,n=Dn(o)?Dz.filter(a=>a in o):[],s=t==="request"?Zz.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&Dn(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 Hg(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 Hn(e){return()=>e}var Uz=Hn(void 0);function Yl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Hn(t)}}}var Fz;var Xl=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{Fz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ri,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),Ya(n)||Hl(n)?this._onresponse(n):Fn(n)?this._onrequest(n,s):Vn(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}=Vg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Lg(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(Tl(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}=Vg(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(S=>this._onerror(new Error(`Failed to send an error response: ${S}`)))};if(t?.classification!==void 0){let _=Lg(t.classification);if(_!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${_} but this instance serves ${n.era}`));let h=t.classification.revision??_;i(B.UnsupportedProtocolVersion,`Unsupported protocol version: ${h}`,{supported:this._supportedProtocolVersions,requested:h});return}}if(El(r.method)&&!n.hasRequestMethod(r.method)&&!(Dg(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(B.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(B.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(B.InvalidParams,a);return}let u=(_,h)=>this._notificationViaCodec(this._resolveOutboundCodec(_.method),_,{...h,relatedRequestId:r.id}),d=(_,h,f)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(_.method),_,h,{...f,relatedRequestId:r.id}),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?Uz:Hn(o.requestState),signal:p.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),ao(h))return d(_,h,f);let S=Hg(z,_.method);if(S===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(_,S,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),Ya(e)?r(e):r(ne.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(ao(t))return Dg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=Hg(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 io(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Lz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(El(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===Vl&&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,S=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(y=>this._onerror(new Error(`Failed to send cancellation: ${y}`))):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 y;try{y=e.decodeResult(t.method,b.result)}catch(N){return g(N instanceof Error?N:new Error(String(N)))}if(y.kind==="invalid")return g(y.error);if(y.kind==="input_required"){if(o?.allowInputRequired===!0)return p(Hz(y));let N={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(V,M)=>this._requestWithSchemaViaCodec(e,V===void 0?{method:t.method}:{method:t.method,params:V},r,M)};return p(this._resolveNonCompleteResult(y,N))}let E=y.result;_r(r,E).then(N=>{N.success?p(N.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${N.error}`))},g)}),u=()=>S(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??z_,w=()=>S(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(Tl(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(!El(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 ne(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 ne(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(!Tl(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 ne(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 ne(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Dn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ql(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]=Dn(i)&&Dn(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 Hz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Jz=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}})),xP=gs(Jz(),1);var R_=10*1024*1024,ed=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 $_(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function $_(e){return _n.parse(JSON.parse(e))}function td(e){return JSON.stringify(e)+`
61
- `}var Bz=/^[A-Za-z0-9._-]{1,128}$/;function Kz(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"),!Bz.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 Gz(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 rd(e){let t=Kz(e);return Gz(e,t.warnings),t.isValid}function Wz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function Yz(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function Xz(e){if(typeof e!="object"||e===null||ao(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>Wz(r))}function oc(e){if(e!==void 0){if(Xz(e))return P(e);if(typeof e=="object"&&e!==null&&!ao(e)&&Object.values(e).some(t=>Yz(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(!ao(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 sc=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,S)=>`${z}${S}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((z,S)=>(S instanceof r&&(z[S.str]=(z[S.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(f,...z){let S=[f[0]],R=0;for(;R<z.length;)c(S,z[R]),S.push(f[++R]);return new o(S)}e._=n;let s=new o("+");function i(f,...z){let S=[v(f[0])],R=0;for(;R<z.length;)S.push(s),c(S,z[R]),S.push(s,v(f[++R]));return a(S),new o(S)}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 S=u(f[z-1],f[z+1]);if(S!==void 0){f.splice(z-1,3,S);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})),w_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=sc();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=sc(),r=w_();var o=sc();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=w_();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,x){super(),this.varKind=$,this.name=C,this.rhs=x}render({es5:$,_n:C}){let x=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${x} ${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,x){super(),this.lhs=$,this.rhs=C,this.sideEffects=x}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 W(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,C,x,J){super($,x,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,x)=>C+x.render($),"")}optimizeNodes(){let{nodes:$}=this,C=$.length;for(;C--;){let x=$[C].optimizeNodes();Array.isArray(x)?$.splice(C,1,...x):x?$[C]=x:$.splice(C,1)}return $.length>0?this:void 0}optimizeNames($,C){let{nodes:x}=this,J=x.length;for(;J--;){let ee=x[J];ee.optimizeNames($,C)||(fe($,ee.names),x.splice(J,1))}return x.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 nc extends m{constructor(C,x){super(x),this.condition=C}render(C){let x=`if(${this.condition})`+super.render(C);return this.else&&(x+="else "+this.else.render(C)),x}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!0)return this.nodes;let x=this.else;if(x){let J=x.optimizeNodes();x=this.else=Array.isArray(J)?new h(J):J}if(x)return C===!1?x instanceof nc?x:x.nodes:this.nodes.length?this:new nc($e(C),x instanceof nc?[x]:x.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,x){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,x),!!(super.optimizeNames(C,x)||this.else))return this.condition=G(this.condition,C,x),this}get names(){let C=super.names;return W(C,this.condition),this.else&&Z(C,this.else.names),C}};f.kind="if";var z=class extends m{};z.kind="for";var S=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,x,J){super(),this.varKind=$,this.name=C,this.from=x,this.to=J}render($){let C=$.es5?r.varKinds.var:this.varKind,{name:x,from:J,to:ee}=this;return`for(${C} ${x}=${J}; ${x}<${ee}; ${x}++)`+super.render($)}get names(){return W(W(super.names,this.from),this.to)}},w=class extends z{constructor($,C,x,J){super(),this.loop=$,this.varKind=C,this.name=x,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,x){super(),this.name=$,this.args=C,this.async=x}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}};b.kind="func";var y=class extends v{render($){return"return "+super.render($)}};y.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 x,J;return super.optimizeNames($,C),(x=this.catch)===null||x===void 0||x.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),$}},N=class extends m{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};N.kind="catch";var V=class extends m{render($){return"finally"+super.render($)}};V.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 x=this._extScope.value($,C);return(this._values[x.prefix]||(this._values[x.prefix]=new Set)).add(x),x}getScopeValue($,C){return this._extScope.getValue($,C)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,C,x,J){let ee=this._scope.toName(C);return x!==void 0&&J&&(this._constants[ee.str]=x),this._leafNode(new i($,ee,x)),ee}const($,C,x){return this._def(r.varKinds.const,$,C,x)}let($,C,x){return this._def(r.varKinds.let,$,C,x)}var($,C,x){return this._def(r.varKinds.var,$,C,x)}assign($,C,x){return this._leafNode(new c($,C,x))}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[x,J]of $)C.length>1&&C.push(","),C.push(x),(x!==J||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,J));return C.push("}"),new t._Code(C)}if($,C,x){if(this._blockNode(new f($)),C&&x)this.code(C).else().code(x).endIf();else if(C)this.code(C).endIf();else if(x)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 S($),C)}forRange($,C,x,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,C,x),()=>J(pe))}forOf($,C,x,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}]`),x(ee)})}return this._for(new w("of",J,ee,C),()=>x(ee))}forIn($,C,x,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${C})`,x);let ee=this._scope.toName($);return this._for(new w("in",J,ee,C),()=>x(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let C=new y;if(this._blockNode(C),this.code($),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(y)}try($,C,x){if(!C&&!x)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 N(ee),C(ee)}return x&&(this._currNode=J.finally=new V,this.code(x)),this._endBlockNode(N,V)}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 x=this._nodes.length-C;if(x<0||$!==void 0&&x!==$)throw new Error(`CodeGen: wrong number of nodes: ${x} vs ${$} expected`);return this._nodes.length=C,this}func($,C=t.nil,x,J){return this._blockNode(new b($,C,x)),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 x=this._currNode;if(x instanceof $||C&&x 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 x in C)$[x]=($[x]||0)+(C[x]||0);return $}function W($,C){return C instanceof t._CodeOrName?Z($,C.names):$}function G($,C,x){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=x[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&&x[ae.str]!==void 0)}}function fe($,C){for(let x in C)$[x]=($[x]||0)-(C[x]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${F($)}`}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,x)=>C===t.nil?x:x===t.nil?C:(0,t._)`${F(C)} ${$} ${F(x)}`}function F($){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=sc();function o(b){let y={};for(let E of b)y[E]=!0;return y}e.toHash=o;function n(b,y){return typeof y=="boolean"?y:Object.keys(y).length===0?!0:(s(b,y),!i(y,b.self.RULES.all))}e.alwaysValidSchema=n;function s(b,y=b.schema){let{opts:E,self:N}=b;if(!E.strictSchema||typeof y=="boolean")return;let V=N.RULES.keywords;for(let M in y)V[M]||w(b,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function i(b,y){if(typeof b=="boolean")return!b;for(let E in b)if(y[E])return!0;return!1}e.schemaHasRules=i;function c(b,y){if(typeof b=="boolean")return!b;for(let E in b)if(E!=="$ref"&&y.all[E])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:b,schemaPath:y},E,N,V){if(!V){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${b}${y}${(0,t.getProperty)(N)}`}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,y){if(Array.isArray(b))for(let E of b)y(E);else y(b)}e.eachItem=v;function m({mergeNames:b,mergeToName:y,mergeValues:E,resultToName:N}){return(V,M,Z,W)=>{let G=Z===void 0?M:Z instanceof t.Name?(M instanceof t.Name?b(V,M,Z):y(V,M,Z),Z):M instanceof t.Name?(y(V,Z,M),M):E(M,Z);return W===t.Name&&!(G instanceof t.Name)?N(V,G):G}}e.mergeEvaluated={props:m({mergeNames:(b,y,E)=>b.if((0,t._)`${E} !== true && ${y} !== undefined`,()=>{b.if((0,t._)`${y} === true`,()=>b.assign(E,!0),()=>b.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${y})`))}),mergeToName:(b,y,E)=>b.if((0,t._)`${E} !== true`,()=>{y===!0?b.assign(E,!0):(b.assign(E,(0,t._)`${E} || {}`),h(b,E,y))}),mergeValues:(b,y)=>b===!0?!0:{...b,...y},resultToName:_}),items:m({mergeNames:(b,y,E)=>b.if((0,t._)`${E} !== true && ${y} !== undefined`,()=>b.assign(E,(0,t._)`${y} === true ? true : ${E} > ${y} ? ${E} : ${y}`)),mergeToName:(b,y,E)=>b.if((0,t._)`${E} !== true`,()=>b.assign(E,y===!0?!0:(0,t._)`${E} > ${y} ? ${E} : ${y}`)),mergeValues:(b,y)=>b===!0?!0:Math.max(b,y),resultToName:(b,y)=>b.var("items",y)})};function _(b,y){if(y===!0)return b.var("props",!0);let E=b.var("props",(0,t._)`{}`);return y!==void 0&&h(b,E,y),E}e.evaluatedPropsToName=_;function h(b,y,E){Object.keys(E).forEach(N=>b.assign((0,t._)`${y}${(0,t.getProperty)(N)}`,!0))}e.setEvaluated=h;let f={};function z(b,y){return b.scopeValue("func",{ref:y,code:f[y.code]||(f[y.code]=new r._Code(y.code))})}e.useFunc=z;var S;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(S||(e.Type=S={}));function R(b,y,E){if(b instanceof t.Name){let N=y===S.Num;return E?N?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:N?(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,y,E=b.opts.strictSchema){if(E){if(y=`strict mode: ${y}`,E===!0)throw new Error(y);b.self.logger.warn(y)}}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})),ac=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,S){let{it:R}=h,{gen:w,compositeRule:b,allErrors:y}=R,E=p(h,f,z);S??(b||y)?a(w,E):u(R,(0,t._)`[${E}]`)}e.reportError=n;function s(h,f=e.keywordError,z){let{it:S}=h,{gen:R,compositeRule:w,allErrors:b}=S;a(R,p(h,f,z)),w||b||u(S,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:S,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,y=>{h.const(b,(0,t._)`${o.default.vErrors}[${y}]`),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`,S))})}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:S,schemaEnv:R}=h;R.$async?z.throw((0,t._)`new ${h.ValidationError}(${f})`):(z.assign((0,t._)`${S}.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:S}=h.it;return S===!1?(0,t._)`{}`:g(h,f,z)}function g(h,f,z={}){let{gen:S,it:R}=h,w=[v(R,z),m(h,z)];return _(h,f,w),S.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:S}){let R=S?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},S){let{keyword:R,data:w,schemaValue:b,it:y}=h,{opts:E,propertyName:N,topSchemaRef:V,schemaPath:M}=y;S.push([d.keyword,R],[d.params,typeof f=="function"?f(h):f||(0,t._)`{}`]),E.messages&&S.push([d.message,typeof z=="function"?z(h):z]),E.verbose&&S.push([d.schema,b],[d.parentSchema,(0,t._)`${V}${M}`],[o.default.data,w]),N&&S.push([d.propertyName,N])}})),Qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=ac(),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)}})),P_=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})),E_=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})),ic=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=P_(),r=E_(),o=ac(),n=le(),s=_e();var i;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(S){let R=a(S.type);if(R.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!R.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&R.push("null")}return R}e.getSchemaTypes=c;function a(S){let R=Array.isArray(S)?S:S?[S]:[];if(R.every(t.isJSONType))return R;throw new Error("type must be JSONType or JSONType[]: "+R.join(","))}e.getJSONTypes=a;function u(S,R){let{gen:w,data:b,opts:y}=S,E=p(R,y.coerceTypes),N=R.length>0&&!(E.length===0&&R.length===1&&(0,r.schemaHasRulesForType)(S,R[0]));if(N){let V=_(R,b,y.strictNumbers,i.Wrong);w.if(V,()=>{E.length?g(S,R,E):f(S)})}return N}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function p(S,R){return R?S.filter(w=>d.has(w)||R==="array"&&w==="array"):[]}function g(S,R,w){let{gen:b,data:y,opts:E}=S,N=b.let("dataType",(0,n._)`typeof ${y}`),V=b.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&b.if((0,n._)`${N} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>b.assign(y,(0,n._)`${y}[0]`).assign(N,(0,n._)`typeof ${y}`).if(_(R,y,E.strictNumbers),()=>b.assign(V,y))),b.if((0,n._)`${V} !== undefined`);for(let Z of w)(d.has(Z)||Z==="array"&&E.coerceTypes==="array")&&M(Z);b.else(),f(S),b.endIf(),b.if((0,n._)`${V} !== undefined`,()=>{b.assign(y,V),v(S,V)});function M(Z){switch(Z){case"string":b.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(V,(0,n._)`"" + ${y}`).elseIf((0,n._)`${y} === null`).assign(V,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${N} == "boolean" || ${y} === null
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 Rh(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;Rh(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 $h=new Set(["type","properties","required","additionalProperties"]),bh=["oneOf","anyOf"];function zh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function hu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!$h.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]??zh(u);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:hu(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=zh(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 hv(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of $h)if(n in e)return;let r=t.filter(n=>bh.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=hu(t);else{let n=r[0],s=bh.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=>hu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Xo(e,o))}function rn(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)):Xo(u,m),Xo(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())Rh(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)??[])hv(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)}Xo(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:Qo(t,"input",e.processors),output:Qo(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ke(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 Ke(o.element,r);if(o.type==="set")return Ke(o.valueType,r);if(o.type==="lazy")return Ke(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 Ke(o.innerType,r);if(o.type==="intersection")return Ke(o.left,r)||Ke(o.right,r);if(o.type==="record"||o.type==="map")return Ke(o.keyType,r)||Ke(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ke(o.in,r)||Ke(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ke(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ke(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ke(n,r))return!0;return!!(o.rest&&Ke(o.rest,r))}return!1}var wh=(e,t={})=>r=>{let o=en({...r,processors:t});return ve(e,o),tn(o,e),rn(o,e)},Qo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=en({...n??{},target:s,io:t,processors:r});return ve(e,i),tn(i,e),rn(i,e)};var Ur=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Fr=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Ph=(e,t)=>{Ur(e,"minimum",t),Fr(e,"maximum",t)},Ih=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Oh=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},xh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Nh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Eh=(e,t)=>Ur(e,"minimum",t.minimum),Th=(e,t)=>Fr(e,"maximum",t.maximum),kh=e=>(t,r)=>{Nh(t,r.format);let[o,n]=e[r.format];Ur(t,"minimum",o),Fr(t,"maximum",n)},gv={greater_than:(e,t)=>Ur(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Fr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ih(e,t.value),number_format:kh(Fo),bigint_format:kh(vs),min_length:Eh,max_length:Th,length_equals:(e,t)=>Ph(e,t.length),min_size:Eh,max_size:Th,size_equals:(e,t)=>Ph(e,t.size),string_format:(e,t)=>{Nh(e,t.format),t.pattern&&Oh(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)=>xh(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)gv[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Ur(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Ur(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Fr(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Fr(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&Ih(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&xh(t,n.mime);for(let s of n.patterns??[])Oh(t,s);return t}var _v={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sv=new Map([[Jc,Hp],[js,Jp]]),jh=e=>Sv.get(e)??e,Su=(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=_v[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(jh);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}))])}},yu=(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}))])}},vu=(e,t,r,o)=>{r.type="boolean"},bu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Ah=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},zu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},qh=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Mh=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{r.not={}},$u=(e,t,r,o)=>{},wu=(e,t,r,o)=>{},Pu=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},Eu=(e,t,r,o)=>{let n=e._zod.def,s=Or(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},Tu=(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},Lh=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},Dh=(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},Zh=(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})))},Uh=(e,t,r,o)=>{r.type="boolean"},ku=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Fh=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Cu=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Vh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},Hh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},Iu=(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 on(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?on(t.out):t.type==="catch"?on(t.innerType):e._zod.optin}var Ou=(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"?on(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)},xu=(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},Nu=(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)},Jh=(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"?on(_)!==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 gu(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 _=gu(e,m,r);return _===m?t:_}for(let m of["anyOf","oneOf"]){let _=t[m];if(!Array.isArray(_))continue;let h=_.map(f=>gu(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")?Bo:Dc).source)),v}var _u=new WeakMap;function yv(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 _u.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=gu(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 ju=(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,jh(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=_u.get(t);d||(d=[],_u.set(t,d),t.deferred.push(()=>yv(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&on(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))}},Au=(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"}]},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},Mu=Symbol();function Bh(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"),Mu):JSON.parse(i)}var 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=Bh(n.defaultValue,e,t,r,o);i!==Mu&&(r.default=i)},Du=(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=Bh(n.defaultValue,e,t,r,o);i!==Mu&&(r._prefault=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;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},Uu=(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},Fu=(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},Kh=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Bs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Vu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},Ch={string:Su,number:yu,boolean:vu,bigint:bu,symbol:Ah,null:zu,undefined:qh,void:Mh,never:Ru,any:$u,unknown:wu,date:Pu,enum:Eu,literal:Tu,nan:Lh,template_literal:Dh,file:Zh,success:Uh,custom:ku,function:Fh,transform:Cu,map:Vh,set:Hh,array:Iu,object:Ou,union:xu,intersection:Nu,tuple:Jh,record:ju,nullable:Au,nonoptional:qu,default:Lu,prefault:Du,catch:Zu,pipe:Uu,readonly:Fu,promise:Kh,optional:Bs,lazy:Vu};function Ks(e,t){if("_idmap"in e){let o=e,n=en({...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;tn(n,d),Ye(i,u,rn(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=en({...t,processors:Ch});return ve(e,r),tn(r,e),rn(r,e)}var Gh=new WeakSet([Object.prototype,Error.prototype]);function Gs(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)=>{vp.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Gh.has(r)||(Gh.add(r),Gs(r,"format",o=>n=>jc(o,n)),Gs(r,"flatten",o=>n=>Nc(o,n)),Gs(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,xr,2)}),Gs(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,xr,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 Wh=ws(rt),Yh=Ps(rt),Ws=Es(rt),Xh=Ts(rt),Qh=zp(rt),eg=Rp(rt),tg=$p(rt),rg=wp(rt),og=Pp(rt),ng=Ep(rt),sg=Tp(rt),ig=kp(rt);function Cv(){Xe.localeError||Qe(jf())}function Xs(){Xe.memoizer||Qe({memoizer:eu()})}var ye=q("ZodType",(e,t)=>(Cv(),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(_b(e,t))},superRefine(e,t){return this.check(Sb(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return X(this)},exactOptional(){return ob(this)},nullable(){return ug(this)},nullish(){return X(ug(this))},nonoptional(e){return ub(this,e)},array(){return I(this)},or(e){return Y([this,e])},and(e){return $t(this,e)},transform(e){return lg(this,vg(e))},default(e){return ib(this,e)},prefault(e){return cb(this,e)},catch(e){return db(this,e)},pipe(e){return lg(this,e)},readonly(){return fb(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",{...Hc(this),jsonSchema:{input:Qo(this,"input"),output:Qo(this,"output")}})},set"~standard"(e){ce.own(this,"~standard",e)},parse:function e(t,r){return Wh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Yh(this,t,r,{callee:e})},safeParse(e,t){return Ws(this,e,t)},async safeParseAsync(e,t){return Xh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ce.own(this,"spa",e)},validate(e,t){return Ac(this,e,t)},validateAsync(e,t){return qc(this,e,t)},encode:function e(t,r){return Qh(this,t,r,{callee:e})},decode:function e(t,r){return eg(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await tg(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await rg(this,t,r,{callee:e})},safeEncode(e,t){return og(this,e,t)},safeDecode(e,t){return ng(this,e,t)},async safeEncodeAsync(e,t){return sg(this,e,t)},async safeDecodeAsync(e,t){return ig(this,e,t)},toJSONSchema(e){return wh(this,{})(e)},get description(){return Lt.get(this)?.description},get _def(){return this._zod.def}}),dg=q("_ZodString",(e,t)=>{Ns.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(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(nu(...e))},includes(...e){return this.check(au(...e))},startsWith(...e){return this.check(cu(...e))},endsWith(...e){return this.check(uu(...e))},min(...e){return this.check(Zr(...e))},max(...e){return this.check(Hs(...e))},length(...e){return this.check(Js(...e))},nonempty(...e){return this.check(Zr(1,...e))},lowercase(e){return this.check(su(e))},uppercase(e){return this.check(iu(e))},trim(){return this.check(du())},normalize(...e){return this.check(lu(...e))},toLowerCase(){return this.check(pu())},toUpperCase(){return this.check(mu())},slugify(){return this.check(fu())}})),Ju=q("ZodString",(e,t)=>{Ns.init(e,t),dg.init(e,t)},{email(e){return this.check(ru(pg,e))},url(e){return this.check(ou(fg,e))},jwt(e){return this.check(sh(Jv,e))},emoji(e){return this.check(Hf(Ov,e))},guid(e){return this.check(Df(Iv,e))},uuid(e){return this.check(Zf(Ys,e))},uuidv4(e){return this.check(Uf(Ys,e))},uuidv6(e){return this.check(Ff(Ys,e))},uuidv7(e){return this.check(Vf(Ys,e))},nanoid(e){return this.check(Jf(xv,e))},cuid(e){return this.check(Bf(Nv,e))},cuid2(e){return this.check(Kf(jv,e))},ulid(e){return this.check(Gf(Av,e))},base64(e){return this.check(rh(Fv,e))},base64url(e){return this.check(oh(Vv,e))},xid(e){return this.check(Wf(qv,e))},ksuid(e){return this.check(Yf(Mv,e))},ipv4(e){return this.check(Xf(Lv,e))},ipv6(e){return this.check(Qf(Dv,e))},cidrv4(e){return this.check(eh(Zv,e))},cidrv6(e){return this.check(th(Uv,e))},e164(e){return this.check(nh(Hv,e))},datetime(e){return this.check(Zs(nn,e))},date(e){return this.check(Us(sn,e))},time(e){return this.check(Fs(an,e))},duration(e){return this.check(Vs(cn,e))}});function l(e){return Mf(Ju,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),dg.init(e,t)}),nn=q("ZodISODateTime",(e,t)=>{Fm.init(e,t),Pe.init(e,t)}),sn=q("ZodISODate",(e,t)=>{Vm.init(e,t),Pe.init(e,t)}),an=q("ZodISOTime",(e,t)=>{Hm.init(e,t),Pe.init(e,t)}),cn=q("ZodISODuration",(e,t)=>{Jm.init(e,t),Pe.init(e,t)}),pg=q("ZodEmail",(e,t)=>{Om.init(e,t),Pe.init(e,t)});function mg(e){return ru(pg,e)}var Iv=q("ZodGUID",(e,t)=>{Cm.init(e,t),Pe.init(e,t)});var Ys=q("ZodUUID",(e,t)=>{Im.init(e,t),Pe.init(e,t)});var fg=q("ZodURL",(e,t)=>{jm.init(e,t),Pe.init(e,t)});function Qs(e){return ou(fg,e)}var Ov=q("ZodEmoji",(e,t)=>{Am.init(e,t),Pe.init(e,t)});var xv=q("ZodNanoID",(e,t)=>{qm.init(e,t),Pe.init(e,t)});var Nv=q("ZodCUID",(e,t)=>{Mm.init(e,t),Pe.init(e,t)});var jv=q("ZodCUID2",(e,t)=>{Lm.init(e,t),Pe.init(e,t)});var Av=q("ZodULID",(e,t)=>{Dm.init(e,t),Pe.init(e,t)});var qv=q("ZodXID",(e,t)=>{Zm.init(e,t),Pe.init(e,t)});var Mv=q("ZodKSUID",(e,t)=>{Um.init(e,t),Pe.init(e,t)});var Lv=q("ZodIPv4",(e,t)=>{Bm.init(e,t),Pe.init(e,t)});var Dv=q("ZodIPv6",(e,t)=>{Gm.init(e,t),Pe.init(e,t)});var Zv=q("ZodCIDRv4",(e,t)=>{Wm.init(e,t),Pe.init(e,t)});var Uv=q("ZodCIDRv6",(e,t)=>{Ym.init(e,t),Pe.init(e,t)});var Fv=q("ZodBase64",(e,t)=>{Qm.init(e,t),Pe.init(e,t)});var Vv=q("ZodBase64URL",(e,t)=>{ef.init(e,t),Pe.init(e,t)});var Hv=q("ZodE164",(e,t)=>{tf.init(e,t),Pe.init(e,t)});var Jv=q("ZodJWT",(e,t)=>{rf.init(e,t),Pe.init(e,t)});var ei=q("ZodNumber",(e,t)=>{Bc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(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(Dr(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(Lr(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(ag(e))},safe(e){return this.check(ag(e))},positive(e){return this.check(Dr(0,e))},nonnegative(e){return this.check(Rt(0,e))},negative(e){return this.check(Lr(0,e))},nonpositive(e){return this.check(zt(0,e))},multipleOf(e,t){return this.check(Yo(e,t))},step(e,t){return this.check(Yo(e,t))},finite(){return this}}));function L(e){return ih(ei,e)}var Bv=q("ZodNumberFormat",(e,t)=>{of.init(e,t),ei.init(e,t)});function ag(e){return ch(Bv,e)}var Bu=q("ZodBoolean",(e,t)=>{nf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vu(e,r,o,n)});function H(e){return uh(Bu,e)}var hg=q("ZodBigInt",(e,t)=>{sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(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(Dr(e,t))},lt(e,t){return this.check(Lr(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(Dr(BigInt(0),e))},negative(e){return this.check(Lr(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(Yo(e,t))}}));var Kv=q("ZodNull",(e,t)=>{af.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function lr(e){return ph(Kv,e)}var Gv=q("ZodAny",(e,t)=>{cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n)});function gg(){return mh(Gv)}var Wv=q("ZodUnknown",(e,t)=>{uf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n)});function Q(){return fh(Wv)}var Yv=q("ZodNever",(e,t)=>{lf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n)});function _g(e){return hh(Yv,e)}var Sg=q("ZodDate",(e,t)=>{df.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(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 Xv=q("ZodArray",(e,t)=>{Xs(),pf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iu(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Zr(e,t))},nonempty(e){return this.check(Zr(1,e))},max(e,t){return this.check(Hs(e,t))},length(e,t){return this.check(Js(e,t))},unwrap(){return this.element}});function I(e,t){return _h(Xv,e,t)}var Ku=q("ZodObject",(e,t)=>{Xs(),hf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),ce.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return te(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:_g()}))},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(bg,this,e[0])},exactPartial(...e){return ce.partial(zg,this,e[0],"exactPartial")},required(...e){return ce.required(Rg,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ce.normalizeParams(t)};return new Ku(r)}function Ge(e,t){return new Ku({type:"object",shape:e,catchall:_g(),...ce.normalizeParams(t)})}function oe(e,t){return new Ku({type:"object",shape:e,catchall:Q(),...ce.normalizeParams(t)})}var yg=q("ZodUnion",(e,t)=>{Kc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.options=t.options});function Y(e,t){return new yg({type:"union",options:e,...ce.normalizeParams(t)})}var Qv=q("ZodDiscriminatedUnion",(e,t)=>{yg.init(e,t),gf.init(e,t)});function Hr(e,t,r){return new Qv({type:"union",options:t,discriminator:e,...ce.normalizeParams(r)})}var eb=q("ZodIntersection",(e,t)=>{_f.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n)});function $t(e,t){return new eb({type:"intersection",left:e,right:t})}var cg=q("ZodRecord",(e,t)=>{Xs(),Sf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new cg({type:"record",keyType:l(),valueType:e,...ce.normalizeParams(t)}):new cg({type:"record",keyType:e,valueType:t,...ce.normalizeParams(r)})}var Hu=q("ZodEnum",(e,t)=>{yf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Eu(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 Hu({...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 Hu({...t,checks:[],...ce.normalizeParams(n),entries:s})}});function te(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Hu({type:"enum",entries:r,...ce.normalizeParams(t)})}var tb=q("ZodLiteral",(e,t)=>{vf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(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 tb({type:"literal",values:Array.isArray(e)?e:[e],...ce.normalizeParams(t)})}var rb=q("ZodTransform",(e,t)=>{Xs(),bf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qr(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 vg(e){return new rb({type:"transform",transform:e})}var bg=q("ZodOptional",(e,t)=>{Gc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new bg({type:"optional",innerType:e})}var zg=q("ZodExactOptional",(e,t)=>{zf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ob(e){return new zg({type:"optional",innerType:e})}var nb=q("ZodNullable",(e,t)=>{Rf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ug(e){return new nb({type:"nullable",innerType:e})}var sb=q("ZodDefault",(e,t)=>{$f.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.removeDefault=e.unwrap});function ib(e,t){return new sb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var ab=q("ZodPrefault",(e,t)=>{wf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Du(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cb(e,t){return new ab({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ce.shallowClone(t)}})}var Rg=q("ZodNonOptional",(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});function ub(e,t){return new Rg({type:"nonoptional",innerType:e,...ce.normalizeParams(t)})}var lb=q("ZodCatch",(e,t)=>{Ef.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function db(e,t){return new lb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ce.constantCatch(t)})}var $g=q("ZodPipe",(e,t)=>{Wc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uu(e,r,o,n),e.in=t.in,e.out=t.out});function lg(e,t){return new $g({type:"pipe",in:e,out:t})}var pb=q("ZodPreprocess",(e,t)=>{$g.init(e,t),Tf.init(e,t)}),mb=q("ZodReadonly",(e,t)=>{kf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function fb(e){return new mb({type:"readonly",innerType:e})}var hb=q("ZodLazy",(e,t)=>{Cf.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function un(e){return new hb({type:"lazy",getter:e})}var gb=q("ZodCustom",(e,t)=>{If.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n)});function _b(e,t={}){return Sh(gb,e,t)}function Sb(e,t){return yh(e,t)}function dr(e,t){return new pb({type:"pipe",in:vg(e),out:t})}var Pg={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 wg;wg||(wg={});var wt={};mc(wt,{ZodISODate:()=>sn,ZodISODateTime:()=>nn,ZodISODuration:()=>cn,ZodISOTime:()=>an,date:()=>bb,datetime:()=>vb,duration:()=>Rb,time:()=>zb});function vb(e){return Zs(nn,e)}function bb(e){return Us(sn,e)}function zb(e){return Fs(an,e)}function Rb(e){return Vs(cn,e)}var ti={};mc(ti,{bigint:()=>Eb,boolean:()=>Pb,date:()=>Tb,number:()=>wb,string:()=>$b});function $b(e){return Lf(Ju,e)}function wb(e){return ah(ei,e)}function Pb(e){return lh(Bu,e)}function Eb(e){return dh(hg,e)}function Tb(e){return gh(Sg,e)}var mr="2025-11-25";var ri=[mr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],oi="io.modelcontextprotocol/related-task",fr="io.modelcontextprotocol/protocolVersion",Jr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",Tt="io.modelcontextprotocol/clientCapabilities",ln="io.modelcontextprotocol/subscriptionId",Ut="io.modelcontextprotocol/logLevel";var hr="2.0";var Zt=un(()=>Y([l(),L(),H(),lr(),K(l(),Zt),I(Zt)])),Ee=K(l(),Zt),Wu=I(Zt),dn=Y([l(),L().int()]),pn=l(),ni=P({ttl:L().optional()}),si=P({taskId:l()}),mn=oe({progressToken:dn.optional(),[oi]:si.optional()}),Le=P({_meta:mn.optional()}),gr=Le.extend({task:ni.optional()}),Te=P({method:l(),params:Le.loose().optional()}),Ve=P({_meta:mn.optional()}),He=P({method:l(),params:Ve.loose().optional()}),fn=oe({get[Et](){return Gr.optional().catch(void 0)}}),ke=oe({_meta:fn.optional()}),Ft=Y([l(),L().int()]),hn=P({jsonrpc:O(hr),id:Ft,...Te.shape}).strict(),gn=P({jsonrpc:O(hr),...He.shape}).strict(),Br=P({jsonrpc:O(hr),id:Ft,result:ke}).strict(),Kr=P({jsonrpc:O(hr),id:Ft.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),_n=Y([hn,gn,Br,Kr]),ii=Y([Br,Kr]),Sn=ke.strict(),ai=Ve.extend({requestId:Ft.optional(),reason:l().optional()}),yn=He.extend({method:O("notifications/cancelled"),params:ai}),ci=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:te(["light","dark"]).optional()}),Vt=P({icons:I(ci).optional()}),Pt=P({name:l(),title:l().optional()}),Gr=Pt.extend({...Pt.shape,...Vt.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Cb=$t(P({applyDefaults:H().optional()}),Ee),Ib=dr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$t(P({form:Cb.optional(),url:Ee.optional()}),Ee.optional())),ui=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({sampling:oe({createMessage:Ee.optional()}).optional(),elicitation:oe({create:Ee.optional()}).optional()}).optional()}),li=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({tools:oe({call:Ee.optional()}).optional()}).optional()}),di=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:Ib.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:ui.optional(),extensions:K(l(),Ee).optional()}),pi=Le.extend({protocolVersion:l(),capabilities:di,clientInfo:Gr}),mi=Te.extend({method:O("initialize"),params:pi}),vn=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:li.optional(),extensions:K(l(),Ee).optional()}),fi=ke.extend({protocolVersion:l(),capabilities:vn,serverInfo:Gr,instructions:l().optional()}),hi=He.extend({method:O("notifications/initialized"),params:Ve.optional()}),gi=Te.extend({method:O("server/discover"),params:Le.optional()}),_i=ke.extend({supportedVersions:I(l()),capabilities:vn,instructions:l().optional()}),bn=Te.extend({method:O("ping"),params:Le.optional()}),Si=P({progress:L(),total:X(L()),message:X(l())}),yi=P({...Ve.shape,...Si.shape,progressToken:dn}),zn=He.extend({method:O("notifications/progress"),params:yi}),vi=Le.extend({cursor:pn.optional()}),Ht=Te.extend({params:vi.optional()}),Jt=ke.extend({nextCursor:pn.optional()}),Rn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$n=Rn.extend({text:l()}),Yu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),wn=Rn.extend({blob:Yu}),Bt=te(["user","assistant"]),kt=P({audience:I(Bt).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),Pn=P({...Pt.shape,...Vt.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:kt.optional(),_meta:X(oe({}))}),bi=P({...Pt.shape,...Vt.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:kt.optional(),_meta:X(oe({}))}),zi=Ht.extend({method:O("resources/list")}),Ri=Jt.extend({resources:I(Pn)}),$i=Ht.extend({method:O("resources/templates/list")}),wi=Jt.extend({resourceTemplates:I(bi)}),Wr=Le.extend({uri:l()}),Pi=Wr,Ei=Te.extend({method:O("resources/read"),params:Pi}),Ti=ke.extend({contents:I(Y([$n,wn]))}),ki=He.extend({method:O("notifications/resources/list_changed"),params:Ve.optional()}),Ci=Wr,Ii=Te.extend({method:O("resources/subscribe"),params:Ci}),Oi=Wr,xi=Te.extend({method:O("resources/unsubscribe"),params:Oi}),En=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Ni=Le.extend({notifications:En}),ji=Te.extend({method:O("subscriptions/listen"),params:Ni}),Ai=Ve.extend({notifications:En}),qi=He.extend({method:O("notifications/subscriptions/acknowledged"),params:Ai}),Mi=fn.extend({[ln]:Ft}),Li=ke.extend({_meta:Mi}),Di=Ve.extend({uri:l()}),Zi=He.extend({method:O("notifications/resources/updated"),params:Di}),Ui=P({name:l(),description:X(l()),required:X(H())}),Fi=P({...Pt.shape,...Vt.shape,description:X(l()),arguments:X(I(Ui)),_meta:X(oe({}))}),Vi=Ht.extend({method:O("prompts/list")}),Hi=Jt.extend({prompts:I(Fi)}),Ji=Le.extend({name:l(),arguments:K(l(),l()).optional()}),Bi=Te.extend({method:O("prompts/get"),params:Ji}),Yr=P({type:O("text"),text:l(),annotations:kt.optional(),_meta:K(l(),Q()).optional()}),Xr=P({type:O("image"),data:Yu,mimeType:l(),annotations:kt.optional(),_meta:K(l(),Q()).optional()}),Qr=P({type:O("audio"),data:Yu,mimeType:l(),annotations:kt.optional(),_meta:K(l(),Q()).optional()}),Ki=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Gi=P({type:O("resource"),resource:Y([$n,wn]),annotations:kt.optional(),_meta:K(l(),Q()).optional()}),Wi=Pn.extend({type:O("resource_link")}),eo=Y([Yr,Xr,Qr,Wi,Gi]),Yi=P({role:Bt,content:eo}),Xi=ke.extend({description:l().optional(),messages:I(Yi)}),Qi=He.extend({method:O("notifications/prompts/list_changed"),params:Ve.optional()}),ea=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),ta=P({taskSupport:te(["required","optional","forbidden"]).optional()}),Tn=P({...Pt.shape,...Vt.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Zt).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:oe({$schema:l().optional()}).optional(),annotations:ea.optional(),execution:ta.optional(),_meta:K(l(),Q()).optional()}),ra=Ht.extend({method:O("tools/list")}),oa=Jt.extend({tools:I(Tn)}),kn=ke.extend({content:I(eo).default([]),structuredContent:Q().optional(),isError:H().optional()}),Xu=kn.or(ke.extend({toolResult:Q()})),na=gr.extend({name:l(),arguments:K(l(),Q()).optional()}),sa=Te.extend({method:O("tools/call"),params:na}),ia=He.extend({method:O("notifications/tools/list_changed"),params:Ve.optional()}),Qu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Kt=te(["debug","info","notice","warning","error","critical","alert","emergency"]),aa=Le.extend({level:Kt}),ca=Te.extend({method:O("logging/setLevel"),params:aa}),ua=Ve.extend({level:Kt,logger:l().optional(),data:Q()}),la=He.extend({method:O("notifications/message"),params:ua}),da=P({name:l().optional()}),pa=P({hints:I(da).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ma=P({mode:te(["auto","required","none"]).optional()}),fa=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(eo),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),ha=Hr("type",[Yr,Xr,Qr]),pr=Hr("type",[Yr,Xr,Qr,Ki,fa]),ga=P({role:Bt,content:Y([pr,I(pr)]),_meta:K(l(),Q()).optional()}),_a=gr.extend({messages:I(ga),modelPreferences:pa.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(Tn).optional(),toolChoice:ma.optional()}),Sa=Te.extend({method:O("sampling/createMessage"),params:_a}),ya=ke.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens"]).or(l())),role:Bt,content:ha}),va=ke.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Bt,content:Y([pr,I(pr)])}),Cn=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:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),ro=P({type:te(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),In=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),On=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),xn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ba=Y([In,On]),Nn=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()}),jn=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()}),za=Y([Nn,jn]),Ra=Y([xn,ba,za]),An=Y([Ra,Cn,to,ro]),oo=gr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),An),required:I(l()).optional()}).catchall(Q())}),$a=gr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),wa=Y([oo,$a]),Pa=Te.extend({method:O("elicitation/create"),params:wa}),Ea=Ve.extend({elicitationId:l()}),Ta=He.extend({method:O("notifications/elicitation/complete"),params:Ea}),ka=ke.extend({action:te(["accept","decline","cancel"]),content:dr(e=>e===null?void 0:e,K(l(),Y([l(),L(),H(),I(l())])).optional())}),Ca=P({type:O("ref/resource"),uri:l()}),Ia=P({type:O("ref/prompt"),name:l()}),Oa=Le.extend({ref:Y([Ia,Ca]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),xa=Te.extend({method:O("completion/complete"),params:Oa}),Na=ke.extend({completion:oe({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),ja=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Aa=Te.extend({method:O("roots/list"),params:Le.optional()}),qa=ke.extend({roots:I(ja)}),Ma=He.extend({method:O("notifications/roots/list_changed"),params:Ve.optional()}),el=oe({ttl:L().optional(),pollInterval:L().optional()}),La=te(["working","input_required","completed","failed","cancelled"]),Gt=P({taskId:l(),status:La,ttl:Y([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),tl=ke.extend({task:Gt}),Da=Ve.merge(Gt),rl=He.extend({method:O("notifications/tasks/status"),params:Da}),ol=Te.extend({method:O("tasks/get"),params:Le.extend({taskId:l()})}),nl=ke.merge(Gt),sl=Te.extend({method:O("tasks/result"),params:Le.extend({taskId:l()})}),il=ke.loose(),al=Ht.extend({method:O("tasks/list")}),cl=Jt.extend({tasks:I(Gt)}),ul=Te.extend({method:O("tasks/cancel"),params:Le.extend({taskId:l()})}),ll=ke.merge(Gt),dl=Y([bn,mi,gi,xa,ca,Bi,Vi,zi,$i,Ei,Ii,xi,ji,sa,ra]),pl=Y([yn,zn,hi,Ma]),ml=Y([Sn,ya,va,ka,qa]),fl=Y([bn,Sa,Pa,Aa]),hl=Y([yn,zn,la,Zi,ki,ia,Qi,qi,Ta]),gl=Y([Sn,fi,_i,Na,Xi,Hi,Ri,wi,Ti,kn,oa,Li]),Me=Qs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Pg.custom,message:"URL must be parseable",fatal:!0}),Ic}).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"}),_l=oe({resource:l().url(),authorization_servers:I(Me).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()}),Za=oe({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,registration_endpoint:Me.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:Me.optional(),revocation_endpoint:Me.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()}),Ua=oe({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,userinfo_endpoint:Me.optional(),jwks_uri:Me,registration_endpoint:Me.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:Me.optional(),op_tos_uri:Me.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),Sl=P({...Ua.shape,...Za.pick({code_challenge_methods_supported:!0}).shape}),yl=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:ti.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),vl=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(),bl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Gu=Me.optional().or(O("").transform(()=>{})),Fa=P({redirect_uris:I(Me),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:Me.optional(),logo_uri:Gu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Gu,policy_uri:l().optional(),jwks_uri:Me.optional(),jwks:gg().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Va=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(),zl=Fa.merge(Va),Rl=P({error:l(),error_description:l().optional()}).strip(),$l=P({token:l(),token_type_hint:l().optional()}).strip();var Tl=Symbol.for("mcp.sdk.errorBrands");function Ol(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,Tl,{value:r,enumerable:!1,configurable:!0})}function so(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Tl)){let r=t[Tl];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Kg=class Gg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return so(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 so(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Ol(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 Gg(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 so(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 so(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",Ol(this,new.target)}},Ob=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 Ag(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xb(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Wg(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 Xa(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(Ag(n)&&Ag(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!xb(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var Nb="2026-07-28";function Un(e){return e>=Nb}function Yg(e){return e.filter(t=>!Un(t))}function xl(e){return e.filter(t=>Un(t))}function Xg(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 Qg=["task","inputRequests","requestState"];function Nl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Qg.some(t=>t in e)?e:{...e,content:[]}}function jb(){let e=un(()=>Y([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=Y([l(),L().int()]),o=l(),n=P({ttl:L().optional()}),s=P({taskId:l()}),i=oe({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=oe({_meta:i.optional()}),v=Y([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:te(["light","dark"]).optional()}),z=P({icons:I(f).optional()}),S=P({name:l(),title:l().optional()}),R=S.extend({...S.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())),y=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),E=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),N=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:y.optional(),extensions:K(l(),t).optional()}),V=c.extend({protocolVersion:l(),capabilities:N,clientInfo:R}),M=u.extend({method:O("initialize"),params:V}),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()}),W=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()}),C=u.extend({params:he.optional()}),j=g.extend({nextCursor:o.optional()}),F=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=F.extend({text:l()}),k=l().refine(Fe=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),x=F.extend({blob:k}),J=te(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:wt.datetime({offset:!0}).optional()}),pe=P({...S.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:ee.optional(),_meta:X(oe({}))}),ae=P({...S.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(oe({}))}),ze=C.extend({method:O("resources/list")}),Je=j.extend({resources:I(pe)}),T=C.extend({method:O("resources/templates/list")}),A=j.extend({resourceTemplates:I(ae)}),D=c.extend({uri:l()}),se=D,ie=u.extend({method:O("resources/read"),params:se}),de=g.extend({contents:I(Y([$,x]))}),Ce=p.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),Ne=D,Ze=u.extend({method:O("resources/subscribe"),params:Ne}),xe=D,we=u.extend({method:O("resources/unsubscribe"),params:xe}),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({...S.shape,...z.shape,description:X(l()),arguments:X(I(ht)),_meta:X(oe({}))}),gt=C.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:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),tr=P({type:O("audio"),data:k,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),mo=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),xt=P({type:O("resource"),resource:Y([$,x]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),fo=pe.extend({type:O("resource_link")}),nt=Y([Qt,er,tr,fo,xt]),vr=P({role:J,content:nt}),br=g.extend({description:l().optional(),messages:I(vr)}),rr=p.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),ho=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),zr=P({taskSupport:te(["required","optional","forbidden"]).optional()}),or=P({...S.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:ho.optional(),execution:zr.optional(),_meta:K(l(),Q()).optional()}),Rr=C.extend({method:O("tools/list")}),$r=j.extend({tools:I(or)}),wr=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ue=a.extend({name:l(),arguments:K(l(),Q()).optional()}),go=u.extend({method:O("tools/call"),params:Ue}),Yn=p.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),Pr=te(["debug","info","notice","warning","error","critical","alert","emergency"]),_o=c.extend({level:Pr}),So=u.extend({method:O("logging/setLevel"),params:_o}),yo=d.extend({level:Pr,logger:l().optional(),data:Q()}),vo=p.extend({method:O("notifications/message"),params:yo}),bo=P({name:l().optional()}),zo=P({hints:I(bo).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Ro=P({mode:te(["auto","required","none"]).optional()}),Xn=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()}),$o=Hr("type",[Qt,er,tr]),Nt=Hr("type",[Qt,er,tr,mo,Xn]),wo=P({role:J,content:Y([Nt,I(Nt)]),_meta:K(l(),Q()).optional()}),Po=a.extend({messages:I(wo),modelPreferences:zo.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(or).optional(),toolChoice:Ro.optional()}),Eo=u.extend({method:O("sampling/createMessage"),params:Po}),To=g.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:$o}),ko=g.extend({model:l(),stopReason:X(te(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:Y([Nt,I(Nt)])}),Co=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Io=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),Oo=P({type:te(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),xo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),No=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),jo=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),Ao=Y([xo,No]),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()}),Qn=Y([nr,sr]),es=Y([jo,Ao,Qn]),et=Y([es,Co,Io,Oo]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),qo=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),ct=Y([tt,qo]),ts=u.extend({method:O("elicitation/create"),params:ct}),rs=d.extend({elicitationId:l()}),os=p.extend({method:O("notifications/elicitation/complete"),params:rs}),ns=g.extend({action:te(["accept","decline","cancel"]),content:dr(Fe=>Fe===null?void 0:Fe,K(l(),Y([l(),L(),H(),I(l())])).optional())}),ss=P({type:O("ref/resource"),uri:l()}),is=P({type:O("ref/prompt"),name:l()}),as=c.extend({ref:Y([is,ss]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Mo=u.extend({method:O("completion/complete"),params:as}),cs=g.extend({completion:oe({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),us=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Er=u.extend({method:O("roots/list"),params:c.optional()}),Lo=g.extend({roots:I(us)}),ls=p.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),ds=oe({ttl:L().optional(),pollInterval:L().optional()}),Do=te(["working","input_required","completed","failed","cancelled"]),jt=P({taskId:l(),status:Do,ttl:Y([L(),lr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:jt}),ps=d.merge(jt),ir=p.extend({method:O("notifications/tasks/status"),params:ps}),Tr=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),kr=g.merge(jt),Cr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),pc=g.loose(),Be=C.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:S,ImplementationSchema:R,ClientTasksCapabilitySchema:y,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:N,InitializeRequestParamsSchema:V,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:W,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:C,PaginatedResultSchema:j,ResourceContentsSchema:F,TextResourceContentsSchema:$,BlobResourceContentsSchema:x,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ae,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Je,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:se,ReadResourceRequestSchema:ie,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:Ce,SubscribeRequestParamsSchema:Ne,SubscribeRequestSchema:Ze,UnsubscribeRequestParamsSchema:xe,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:mo,EmbeddedResourceSchema:xt,ResourceLinkSchema:fo,ContentBlockSchema:nt,PromptMessageSchema:vr,GetPromptResultSchema:br,PromptListChangedNotificationSchema:rr,ToolAnnotationsSchema:ho,ToolExecutionSchema:zr,ToolSchema:or,ListToolsRequestSchema:Rr,ListToolsResultSchema:$r,CallToolResultSchema:wr,CallToolRequestParamsSchema:Ue,CallToolRequestSchema:go,ToolListChangedNotificationSchema:Yn,LoggingLevelSchema:Pr,SetLevelRequestParamsSchema:_o,SetLevelRequestSchema:So,LoggingMessageNotificationParamsSchema:yo,LoggingMessageNotificationSchema:vo,ModelHintSchema:bo,ModelPreferencesSchema:zo,ToolChoiceSchema:Ro,ToolResultContentSchema:Xn,SamplingContentSchema:$o,SamplingMessageContentBlockSchema:Nt,SamplingMessageSchema:wo,CreateMessageRequestParamsSchema:Po,CreateMessageRequestSchema:Eo,CreateMessageResultSchema:To,CreateMessageResultWithToolsSchema:ko,BooleanSchemaSchema:Co,StringSchemaSchema:Io,NumberSchemaSchema:Oo,UntitledSingleSelectEnumSchemaSchema:xo,TitledSingleSelectEnumSchemaSchema:No,LegacyTitledEnumSchemaSchema:jo,SingleSelectEnumSchemaSchema:Ao,UntitledMultiSelectEnumSchemaSchema:nr,TitledMultiSelectEnumSchemaSchema:sr,MultiSelectEnumSchemaSchema:Qn,EnumSchemaSchema:es,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:qo,ElicitRequestParamsSchema:ct,ElicitRequestSchema:ts,ElicitationCompleteNotificationParamsSchema:rs,ElicitationCompleteNotificationSchema:os,ElicitResultSchema:ns,ResourceTemplateReferenceSchema:ss,PromptReferenceSchema:is,CompleteRequestParamsSchema:as,CompleteRequestSchema:Mo,CompleteResultSchema:cs,RootSchema:us,ListRootsRequestSchema:Er,ListRootsResultSchema:Lo,RootsListChangedNotificationSchema:ls,TaskCreationParamsSchema:ds,TaskStatusSchema:Do,TaskSchema:jt,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:ps,TaskStatusNotificationSchema:ir,GetTaskRequestSchema:Tr,GetTaskResultSchema:kr,GetTaskPayloadRequestSchema:Cr,GetTaskPayloadResultSchema:pc,ListTasksRequestSchema:Be,ListTasksResultSchema:Ie,CancelTaskRequestSchema:ar,CancelTaskResultSchema:g.merge(jt),ClientRequestSchema:Y([fe,M,Mo,So,Xt,gt,ze,T,ie,Ze,we,go,Rr,Tr,Cr,Be,ar]),ClientNotificationSchema:Y([h,Oe,G,ls,ir]),ClientResultSchema:Y([m,To,ko,ns,Lo,kr,Ie,We]),ServerRequestSchema:Y([fe,Eo,ts,Er,Tr,Cr,Be,ar]),ServerNotificationSchema:Y([h,Oe,vo,Ae,Ce,Yn,rr,ir,os]),ServerResultSchema:Y([m,W,cs,br,It,Je,A,de,wr,$r,kr,Ie,We]),CallToolResultWireSchema:Q().superRefine((Fe,WS)=>{if(!(typeof Fe!="object"||Fe===null||Array.isArray(Fe)||Fe.content!==void 0)){for(let zd of Qg)if(zd in Fe){WS.addIssue({code:"custom",message:`content is required when the body carries '${zd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Nl).pipe(wr)}}var Ab;function e_(){return Ab??=jb()}function t_(e){return e.type!=="object"}var qb=new Set(["const","enum","default","examples"]),Mb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function qg(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Lb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(qg(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=rp(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&&qg(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:qb.has(a)?i[a]=u:Mb.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 r_={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},o_={"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},Db={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},Ha;function jl(){if(Ha)return Ha;let e=e_();return Ha={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}},Ha}function n_(e){return Object.prototype.hasOwnProperty.call(r_,e)}function s_(e){return Object.prototype.hasOwnProperty.call(o_,e)}function Zb(e){return Object.prototype.hasOwnProperty.call(Db,e)}function Ub(e){return Zb(e)?jl().resultSchemas[e]:void 0}function Fb(e){return n_(e)?jl().requestSchemas[e]:void 0}function Vb(e){return s_(e)?jl().notificationSchemas[e]:void 0}var CP=Object.keys(r_),IP=Object.keys(o_);function kl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ja(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 Mg={ok:!1,reason:"not-in-era"};function Lg(e){return kl(e)&&kl(e.outputSchema)&&t_(e.outputSchema)}var Al={era:"2025-11-25",hasRequestMethod:n_,hasNotificationMethod:s_,validateRequest:(e,t)=>Ja(Fb(e),t),validateResult:(e,t)=>Ja(Ub(e),t),validateNotification:(e,t)=>Ja(Vb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Mg,validateInputResponse:()=>Mg,samplingResultVariant:((e,t)=>{let r=e_();return Ja(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=Xg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&t_(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(kl(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=>Lg(o))?t:{...t,tools:r.map(o=>Lg(o)?{...o,outputSchema:Lb(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Hb(){let e=un(()=>Y([l(),L(),H(),lr(),K(l(),e),I(e)])),t=K(l(),e),r=Y([l(),L().int()]),o=l(),n=Y([l(),L().int()]),s=te(["user","assistant"]),i=te(["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=oe({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:te(["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()}),S=$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:S.optional(),url:t.optional()}),t.optional())),w=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),b=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),y=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()}),N=P({progress:L(),total:X(L()),message:X(l())}),V=P({...v.shape,...N.shape,progressToken:r}),M=m.extend({method:O("notifications/progress"),params:V}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),W=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(oe({}))}),he=P({...f.shape,...h.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(oe({}))}),C=m.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),j=v.extend({uri:l()}),F=m.extend({method:O("notifications/resources/updated"),params:j}),$=P({name:l(),description:X(l()),required:X(H())}),k=P({...f.shape,...h.shape,description:X(l()),arguments:X(I($)),_meta:X(oe({}))}),x=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:Y([fe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Je=Oe.extend({type:O("resource_link")}),T=Y([J,ee,pe,Je,ze]),A=P({role:s,content:T}),D=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),se=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()}),Ce=P({mode:te(["auto","required","none"]).optional()}),Ne=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Ze=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:te(["email","uri","date","date-time"]).optional(),default:l().optional()}),xe=P({type:te(["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=Y([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=Y([at,gt]),Ot=Y([Ae,ht,It]),Xt=Y([Ot,Ne,Ze,xe]),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()}),mo=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),xt=y.shape,fo=P({experimental:xt.experimental,sampling:xt.sampling,elicitation:xt.elicitation,roots:xt.roots,extensions:xt.extensions}),nt=E.shape,vr=P({experimental:nt.experimental,logging:nt.logging,completions:nt.completions,prompts:nt.prompts,resources:nt.resources,tools:nt.tools,extensions:nt.extensions}),br=oe({progressToken:r.optional(),[fr]:l(),[Jr]:z.optional(),[Tt]:fo,[Ut]:i.optional()}),rr=P({...f.shape,...h.shape,description:l().optional(),inputSchema:oe({$schema:l().optional(),type:O("object")}),outputSchema:oe({$schema:l().optional()}).optional(),annotations:D.optional(),_meta:K(l(),Q()).optional()}),ho=P({type:O("tool_result"),toolUseId:l(),content:I(T),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),zr=Y([J,ee,pe,ae,ho]),or=P({role:s,content:Y([zr,I(zr)]),_meta:K(l(),Q()).optional()}),Rr=l(),$r=oe({[Et]:z.optional().catch(void 0)}),wr=$r.optional();function Ue(Ie){return oe({_meta:wr,resultType:Rr.default("complete"),...Ie})}let go=Ue({}),Yn=Ue({nextCursor:o.optional()}),Pr=Ue({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),_o=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),tools:I(rr),nextCursor:o.optional()}),So=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),prompts:I(k),nextCursor:o.optional()}),yo=Ue({description:l().optional(),messages:I(A)}),vo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),bo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),zo=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),contents:I(Y([fe,$e]))}),Ro=Ue({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Xn=Ue({ttlMs:L().int().min(0),cacheScope:te(["public","private"])}),$o=Ue({ttlMs:L().int().min(0).catch(0),cacheScope:te(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:vr,instructions:l().optional()}),Nt=P({messages:I(or),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:te(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(rr).optional(),toolChoice:Ce.optional()}),wo=P({method:O("sampling/createMessage"),params:Nt}),Po=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),Eo=P({...or.shape,model:l(),stopReason:l().optional()}),To=P({roots:I(mo)}),ko=P({action:te(["accept","decline","cancel"]),content:K(l(),Y([l(),L(),H(),I(l())])).optional()}),Co=P({mode:O("url"),message:l(),url:l().url()}),Io=Y([Qt,Co]),Oo=P({method:O("elicitation/create"),params:Io}),xo=Y([wo,Po,Oo]),No=Y([Eo,To,ko]),jo=K(l(),xo),Ao=K(l(),No),nr=Ue({inputRequests:jo.optional(),requestState:l().optional()}),sr={inputResponses:Ao.optional(),requestState:l().optional()},Qn=P({_meta:br,...sr}),es=oe({progressToken:r.optional()});function et(Ie,ar){return P({method:O(Ie),params:P({_meta:br,...ar})})}function tt(Ie,ar){return P({method:O(Ie),params:P({_meta:es.optional(),...ar}).optional()})}let qo={name:l(),arguments:K(l(),Q()).optional(),...sr},ct={cursor:o.optional()},ts=et("tools/call",qo),rs=et("tools/list",ct),os=et("prompts/list",ct),ns=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...sr}),ss=et("resources/list",ct),is=et("resources/templates/list",ct),as=et("resources/read",{uri:l(),...sr}),Mo={ref:Y([tr,er]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},cs=et("completion/complete",Mo),us=et("server/discover",{}),Er=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),Lo={notifications:Er},ls=et("subscriptions/listen",Lo),ds=$r.extend({"io.modelcontextprotocol/subscriptionId":n}),Do=oe({_meta:ds,resultType:Rr.default("complete")}),jt={"tools/call":tt("tools/call",qo),"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",Mo),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",Lo)};function We(Ie){return oe({_meta:wr,...Ie})}let ps={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:te(["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:te(["public","private"]),prompts:I(k),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:te(["public","private"]),contents:I(Y([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:te(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:vr,instructions:l().optional()}),"subscriptions/listen":We({})},ir=oe({"io.modelcontextprotocol/subscriptionId":n.optional()}),Tr=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:ir.optional(),notifications:Er})}),kr=P({_meta:ir.optional(),requestId:n,reason:l().optional()}),Cr=P({method:O("notifications/cancelled"),params:kr}),pc={"notifications/cancelled":Cr,"notifications/progress":M,"notifications/message":W,"notifications/resources/updated":F,"notifications/resources/list_changed":C,"notifications/tools/list_changed":se,"notifications/prompts/list_changed":x,"notifications/subscriptions/acknowledged":Tr},Be=Ie=>P({jsonrpc:O("2.0"),id:Y([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:y,ServerCapabilitiesSchema:E,ProgressSchema:N,ProgressNotificationParamsSchema:V,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:W,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:C,ResourceUpdatedNotificationParamsSchema:j,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:$,PromptSchema:k,PromptListChangedNotificationSchema:x,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ae,EmbeddedResourceSchema:ze,ResourceLinkSchema:Je,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:se,ModelHintSchema:ie,ModelPreferencesSchema:de,ToolChoiceSchema:Ce,BooleanSchemaSchema:Ne,StringSchemaSchema:Ze,NumberSchemaSchema:xe,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:mo,ClientCapabilities2026Schema:fo,ServerCapabilities2026Schema:vr,RequestMetaEnvelopeSchema:br,ToolSchema:rr,ToolResultContentSchema:ho,SamplingMessageContentBlockSchema:zr,SamplingMessageSchema:or,ResultTypeSchema:Rr,ResultMetaSchema:$r,ResultSchema:go,PaginatedResultSchema:Yn,CallToolResultSchema:Pr,ListToolsResultSchema:_o,ListPromptsResultSchema:So,GetPromptResultSchema:yo,ListResourcesResultSchema:vo,ListResourceTemplatesResultSchema:bo,ReadResourceResultSchema:zo,CompleteResultSchema:Ro,CacheableResultSchema:Xn,DiscoverResultSchema:$o,CreateMessageRequestParamsSchema:Nt,CreateMessageRequestSchema:wo,ListRootsRequestSchema:Po,CreateMessageResultSchema:Eo,ListRootsResultSchema:To,ElicitResultSchema:ko,ElicitRequestURLParamsSchema:Co,ElicitRequestParamsSchema:Io,ElicitRequestSchema:Oo,InputRequestSchema:xo,InputResponseSchema:No,InputRequestsSchema:jo,InputResponsesSchema:Ao,InputRequiredResultSchema:nr,InputResponseRequestParamsSchema:Qn,CallToolRequestSchema:ts,ListToolsRequestSchema:rs,ListPromptsRequestSchema:os,GetPromptRequestSchema:ns,ListResourcesRequestSchema:ss,ListResourceTemplatesRequestSchema:is,ReadResourceRequestSchema:as,CompleteRequestSchema:cs,DiscoverRequestSchema:us,SubscriptionFilterSchema:Er,SubscriptionsListenRequestSchema:ls,SubscriptionsListenResultMetaSchema:ds,SubscriptionsListenResultSchema:Do,dispatchRequestSchemas:jt,dispatchResultSchemas:ps,NotificationMetaSchema:ir,SubscriptionsAcknowledgedNotificationSchema:Tr,CancelledNotificationParamsSchema:kr,CancelledNotificationSchema:Cr,notificationSchemas2026:pc,JSONRPCResultResponseSchema:Be(go),CallToolResultResponseSchema:Be(Y([Pr,nr])),ListToolsResultResponseSchema:Be(_o),ListPromptsResultResponseSchema:Be(So),GetPromptResultResponseSchema:Be(Y([yo,nr])),ListResourcesResultResponseSchema:Be(vo),ListResourceTemplatesResultResponseSchema:Be(bo),ReadResourceResultResponseSchema:Be(Y([zo,nr])),CompleteResultResponseSchema:Be(Ro),DiscoverResultResponseSchema:Be($o),SubscriptionsListenResultResponseSchema:Be(Do)}}var Jb;function Wt(){return Jb??=Hb()}var Bb=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Kb(e){return Bb.includes(e)}var no=Symbol("modelcontextprotocol.resultCacheHintFallback");function Qa(e,t){if(t===void 0)return e;let r=e[no];if(r===void 0)return{...e,[no]: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,[no]:o}}function Gb(e){return e[no]}function ql(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ml(e){return e==="public"||e==="private"}function Ll(e,t){if(e.ttlMs!==void 0&&!ql(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&&!Ml(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})({}),ne=class i_ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return so(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 so(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Ol(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new a_(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Dl({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 ec(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 tc({requiredCapabilities:n.requiredCapabilities},r)}return new i_(t,r,o)}},ec=class extends ne{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}},a_=class extends ne{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??[]}},Dl=class extends ne{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}},tc=class extends ne{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}},Wb=0,Yb="private",Xb=["tools/call","prompts/get","resources/read"];function Qb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||Xb.includes(e))return t;throw new ne(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ez(e,t){let r=Gb(t);if(t.resultType!=="complete"||!Kb(e))return r===void 0?t:sz(t);let o=t,n=ql(o.ttlMs)?o.ttlMs:oz(r),s=Ml(o.cacheScope)?o.cacheScope:nz(r),i={...o,ttlMs:n,cacheScope:s};return delete i[no],i}function tz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function rz(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Et]:t}}:!tz(r)||r[Et]!==void 0?e:{...e,_meta:{...r,[Et]:t}}}function oz(e){return e!==void 0&&ql(e.ttlMs)?e.ttlMs:Wb}function nz(e){return e!==void 0&&Ml(e.cacheScope)?e.cacheScope:Yb}function sz(e){let t={...e};return delete t[no],t}var iz=["elicitation/create","sampling/createMessage","roots/list"],Ba;function c_(){if(Ba)return Ba;let e=Wt();return Ba={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:oe({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Ba}function u_(e){return iz.includes(e)}function wl(e){return u_(e)?c_().request[e]:void 0}function az(e){return u_(e)?c_().response[e]:void 0}var Zl={"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},l_={"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 d_(e){return Object.prototype.hasOwnProperty.call(Zl,e)}function p_(e){return Object.prototype.hasOwnProperty.call(l_,e)}function cz(e){return Object.prototype.hasOwnProperty.call(Zl,e)}function uz(e){return d_(e)?Wt().dispatchRequestSchemas[e]:void 0}function lz(e){return cz(e)?Wt().dispatchResultSchemas[e]:void 0}function dz(e){return p_(e)?Wt().notificationSchemas2026[e]:void 0}var OP=Object.keys(Zl),xP=Object.keys(l_);function Ln(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qn(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 pz={ok:!1,reason:"not-in-era"},mz=[fr,Tt];function fz(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=>Ln(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!Ln(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(Ln(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Ul={era:"2026-07-28",hasRequestMethod:d_,hasNotificationMethod:p_,hasInputRequestMethod:e=>wl(e)!==void 0,validateRequest:(e,t)=>qn(uz(e),t),validateResult:(e,t)=>qn(lz(e),t),validateNotification:(e,t)=>qn(dz(e),t),validateInputRequest:(e,t)=>qn(wl(e),t),validateInputResponse:(e,t)=>qn(az(e),t),samplingResultVariant:()=>pz,outboundEnvelope(e){return{[fr]:e.protocolVersion,[Jr]:e.clientInfo,[Tt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ut]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of mz)o in e||t.push({key:o,problem:"missing"});let r=Wt().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=>Xg(e),inputRequestSchema:wl,decodeResult(e,t){if(!Ln(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=Ln(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Wt().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=hz(),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 rz(ez(e,Qb(e,fz(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=Wt().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("; ")}`}},Ka;function hz(){if(Ka)return Ka;let e=Wt();return Ka={"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},Ka}var Fl="2026-07-28";function io(e){return e!==void 0&&Un(e)?Ul:Al}function Dg(e){return e.revision!==void 0?io(e.revision).era:e.era==="modern"?Ul.era:Al.era}function Pl(e){return m_.some(t=>t.hasRequestMethod(e))}function El(e){return m_.some(t=>t.hasNotificationMethod(e))}function Zg(e){return e==="tasks/get"||e==="tasks/cancel"}var m_=[Al,Ul];var gz=ep({AnnotationsSchema:()=>kt,AudioContentSchema:()=>Qr,BaseMetadataSchema:()=>Pt,BaseRequestParamsSchema:()=>Le,BlobResourceContentsSchema:()=>wn,BooleanSchemaSchema:()=>Cn,CallToolRequestParamsSchema:()=>na,CallToolRequestSchema:()=>sa,CallToolResultSchema:()=>kn,CancelTaskRequestSchema:()=>ul,CancelTaskResultSchema:()=>ll,CancelledNotificationParamsSchema:()=>ai,CancelledNotificationSchema:()=>yn,ClientCapabilitiesSchema:()=>di,ClientNotificationSchema:()=>pl,ClientRequestSchema:()=>dl,ClientResultSchema:()=>ml,ClientTasksCapabilitySchema:()=>ui,CompatibilityCallToolResultSchema:()=>Xu,CompleteRequestParamsSchema:()=>Oa,CompleteRequestSchema:()=>xa,CompleteResultSchema:()=>Na,ContentBlockSchema:()=>eo,CreateMessageRequestParamsSchema:()=>_a,CreateMessageRequestSchema:()=>Sa,CreateMessageResultSchema:()=>ya,CreateMessageResultWithToolsSchema:()=>va,CreateTaskResultSchema:()=>tl,CursorSchema:()=>pn,DiscoverRequestSchema:()=>gi,DiscoverResultSchema:()=>_i,ElicitRequestFormParamsSchema:()=>oo,ElicitRequestParamsSchema:()=>wa,ElicitRequestSchema:()=>Pa,ElicitRequestURLParamsSchema:()=>$a,ElicitResultSchema:()=>ka,ElicitationCompleteNotificationParamsSchema:()=>Ea,ElicitationCompleteNotificationSchema:()=>Ta,EmbeddedResourceSchema:()=>Gi,EmptyResultSchema:()=>Sn,EnumSchemaSchema:()=>Ra,GetPromptRequestParamsSchema:()=>Ji,GetPromptRequestSchema:()=>Bi,GetPromptResultSchema:()=>Xi,GetTaskPayloadRequestSchema:()=>sl,GetTaskPayloadResultSchema:()=>il,GetTaskRequestSchema:()=>ol,GetTaskResultSchema:()=>nl,IconSchema:()=>ci,IconsSchema:()=>Vt,ImageContentSchema:()=>Xr,ImplementationSchema:()=>Gr,InitializeRequestParamsSchema:()=>pi,InitializeRequestSchema:()=>mi,InitializeResultSchema:()=>fi,InitializedNotificationSchema:()=>hi,JSONArraySchema:()=>Wu,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Kr,JSONRPCMessageSchema:()=>_n,JSONRPCNotificationSchema:()=>gn,JSONRPCRequestSchema:()=>hn,JSONRPCResponseSchema:()=>ii,JSONRPCResultResponseSchema:()=>Br,JSONValueSchema:()=>Zt,LegacyTitledEnumSchemaSchema:()=>xn,ListChangedOptionsBaseSchema:()=>Qu,ListPromptsRequestSchema:()=>Vi,ListPromptsResultSchema:()=>Hi,ListResourceTemplatesRequestSchema:()=>$i,ListResourceTemplatesResultSchema:()=>wi,ListResourcesRequestSchema:()=>zi,ListResourcesResultSchema:()=>Ri,ListRootsRequestSchema:()=>Aa,ListRootsResultSchema:()=>qa,ListTasksRequestSchema:()=>al,ListTasksResultSchema:()=>cl,ListToolsRequestSchema:()=>ra,ListToolsResultSchema:()=>oa,LoggingLevelSchema:()=>Kt,LoggingMessageNotificationParamsSchema:()=>ua,LoggingMessageNotificationSchema:()=>la,ModelHintSchema:()=>da,ModelPreferencesSchema:()=>pa,MultiSelectEnumSchemaSchema:()=>za,NotificationSchema:()=>He,NotificationsParamsSchema:()=>Ve,NumberSchemaSchema:()=>ro,PaginatedRequestParamsSchema:()=>vi,PaginatedRequestSchema:()=>Ht,PaginatedResultSchema:()=>Jt,PingRequestSchema:()=>bn,PrimitiveSchemaDefinitionSchema:()=>An,ProgressNotificationParamsSchema:()=>yi,ProgressNotificationSchema:()=>zn,ProgressSchema:()=>Si,ProgressTokenSchema:()=>dn,PromptArgumentSchema:()=>Ui,PromptListChangedNotificationSchema:()=>Qi,PromptMessageSchema:()=>Yi,PromptReferenceSchema:()=>Ia,PromptSchema:()=>Fi,ReadResourceRequestParamsSchema:()=>Pi,ReadResourceRequestSchema:()=>Ei,ReadResourceResultSchema:()=>Ti,RelatedTaskMetadataSchema:()=>si,RequestIdSchema:()=>Ft,RequestMetaSchema:()=>mn,RequestSchema:()=>Te,ResourceContentsSchema:()=>Rn,ResourceLinkSchema:()=>Wi,ResourceListChangedNotificationSchema:()=>ki,ResourceRequestParamsSchema:()=>Wr,ResourceSchema:()=>Pn,ResourceTemplateReferenceSchema:()=>Ca,ResourceTemplateSchema:()=>bi,ResourceUpdatedNotificationParamsSchema:()=>Di,ResourceUpdatedNotificationSchema:()=>Zi,ResultMetaObjectSchema:()=>fn,ResultSchema:()=>ke,RoleSchema:()=>Bt,RootSchema:()=>ja,RootsListChangedNotificationSchema:()=>Ma,SamplingContentSchema:()=>ha,SamplingMessageContentBlockSchema:()=>pr,SamplingMessageSchema:()=>ga,ServerCapabilitiesSchema:()=>vn,ServerNotificationSchema:()=>hl,ServerRequestSchema:()=>fl,ServerResultSchema:()=>gl,ServerTasksCapabilitySchema:()=>li,SetLevelRequestParamsSchema:()=>aa,SetLevelRequestSchema:()=>ca,SingleSelectEnumSchemaSchema:()=>ba,StringSchemaSchema:()=>to,SubscribeRequestParamsSchema:()=>Ci,SubscribeRequestSchema:()=>Ii,SubscriptionFilterSchema:()=>En,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ai,SubscriptionsAcknowledgedNotificationSchema:()=>qi,SubscriptionsListenRequestParamsSchema:()=>Ni,SubscriptionsListenRequestSchema:()=>ji,SubscriptionsListenResultMetaSchema:()=>Mi,SubscriptionsListenResultSchema:()=>Li,TaskAugmentedRequestParamsSchema:()=>gr,TaskCreationParamsSchema:()=>el,TaskMetadataSchema:()=>ni,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Da,TaskStatusNotificationSchema:()=>rl,TaskStatusSchema:()=>La,TextContentSchema:()=>Yr,TextResourceContentsSchema:()=>$n,TitledMultiSelectEnumSchemaSchema:()=>jn,TitledSingleSelectEnumSchemaSchema:()=>On,ToolAnnotationsSchema:()=>ea,ToolChoiceSchema:()=>ma,ToolExecutionSchema:()=>ta,ToolListChangedNotificationSchema:()=>ia,ToolResultContentSchema:()=>fa,ToolSchema:()=>Tn,ToolUseContentSchema:()=>Ki,UnsubscribeRequestParamsSchema:()=>Oi,UnsubscribeRequestSchema:()=>xi,UntitledMultiSelectEnumSchemaSchema:()=>Nn,UntitledSingleSelectEnumSchemaSchema:()=>In});var Fn=e=>hn.safeParse(e).success,Vn=e=>gn.safeParse(e).success,Ya=e=>Br.safeParse(e).success,Vl=e=>Kr.safeParse(e).success,Hl=e=>ii.safeParse(e).success;var Ct=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 Ug="x-mcp-header",_z=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Sz=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(Ug in a){if(!c||i.length===0)return`${Ga(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[Ug];if(typeof d!="string"||d.length===0)return`${Ga(i)}: x-mcp-header MUST be a non-empty string`;if(!_z.test(d))return`${Ga(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||!Sz.has(p))return`${Ga(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 yz){let p=a[d];if(p===void 0)continue;let g=Array.isArray(p)?p:p!==null&&typeof p=="object"&&vz.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 yz=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],vz=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Ga(e){return e.length===0?"<root>":e.join(".")}var Wa=-32020,NP=[{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:[Wa,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:[Wa],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:[Wa],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."}],bz={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[Wa]:400};function rc(e,t){return Ws(e,t)}function Mn(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function ao(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 Fg=!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().");Fg||(Fg=!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=Ks(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:f_(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 f_(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"||f_(o)))}return!1}function zz(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=>zz(o)).join(", ")}:{success:!0,data:r.value}}function Rz(e){let t=Ks(e,{target:Cl,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var $z=/\\\.\\d\{(\d+)\}/;function wz(e){let t=$z.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 Pz(e,t){let r;switch(e){case"email":r=[mg()];break;case"uri":r=[Qs()];break;case"date":r=[wt.date()];break;case"date-time":r=wz(t);break}return new Set(r.map(o=>Rz(o)).filter(o=>o!==void 0))}function Ez(e,t,r){return r!=="zod"?!0:Pz(e,t).has(t)}function h_(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 Zn(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 ne(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var kz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Gl(e){return kz.has(e)||e.startsWith("x-")}var Cz=new Set(["$schema",...Object.keys(oo.shape.requestedSchema.shape)]),Vg={string:Mn([to,In,On,xn]),number:Mn([ro]),integer:Mn([ro]),boolean:Mn([Cn]),array:Mn([Nn,jn])},Iz=new Set(to.shape.format.unwrap().options);function Oz(e,t,r,o){if(!Zn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(Vg,e.type)?Vg[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"?Iz.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 xz(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&Zn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Oz(c,`properties.${i}`,t,o)])):Cz.has(n)?r[n]=s:Gl(n)||o.push(n);if(o.length>0)throw new ne(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Nz(e,t){if(!Zn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!rc(An,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Il(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>Il(o,t[n],`${r}[${n}]`)):!Zn(e)||!Zn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?Il(n,t[o],s):Gl(o)?[]:[s]})}function jz(e){if(!ao(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=xz(Tz(e.requestedSchema),t),o=rc(oo.shape.requestedSchema,r);if(!o.success)throw new ne(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Nz(r,o.error.message)}`);let n=Il(r,o.data);if(n.length>0)throw new ne(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 ne(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Az(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 qz=Object.assign(Az,{elicit(e){try{return{method:"elicitation/create",params:jz(e)}}catch(t){throw t instanceof ne?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 g_=250;function __(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function S_(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 y_(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 Mz=["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"],Lz={IdJagTokenExchangeResponseSchema:vl,OAuthClientInformationFullSchema:zl,OAuthClientInformationSchema:Va,OAuthClientMetadataSchema:Fa,OAuthClientRegistrationErrorSchema:Rl,OAuthErrorResponseSchema:bl,OAuthMetadataSchema:Za,OAuthProtectedResourceMetadataSchema:_l,OAuthTokenRevocationRequestSchema:$l,OAuthTokensSchema:yl,OpenIdProviderDiscoveryMetadataSchema:Sl,OpenIdProviderMetadataSchema:Ua},v_={},b_={};function z_(e,t){let r=e.slice(0,-6);v_[r]=t,b_[r]=o=>t.safeParse(o).success}for(let e of Mz)z_(e,gz[e]);for(let[e,t]of Object.entries(Lz))z_(e,t);var Dz=Object.freeze(v_),Zz=Object.freeze(b_);function Uz(e){switch(e){case"initialize":case"notifications/initialized":return io(void 0);case"server/discover":return io(Fl);default:return}}var R_=6e4,Fz=[fr,Jr,Tt,Ut],Vz=["inputResponses","requestState"];function Hg(e,t){let r=e.params;if(!Dn(r))return{message:e,lifted:{}};let o=r._meta,n=Dn(o)?Fz.filter(a=>a in o):[],s=t==="request"?Vz.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&Dn(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 Jg(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 Hn(e){return()=>e}var Hz=Hn(void 0);function Wl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Hn(t)}}}var Jz;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{Jz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ri,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),Ya(n)||Vl(n)?this._onresponse(n):Fn(n)?this._onrequest(n,s):Vn(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=Hg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Dg(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(El(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=Hg(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(_,h,f)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:_,message:h,...f!==void 0&&{data:f}}};s?.send(z).catch(S=>this._onerror(new Error(`Failed to send an error response: ${S}`)))};if(t?.classification!==void 0){let _=Dg(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(Pl(r.method)&&!n.hasRequestMethod(r.method)&&!(Zg(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:Bz(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?Hz:Hn(o.requestState),signal:p.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),ao(h))return d(_,h,f);let S=Jg(z,_.method);if(S===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(_,S,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),Ya(e)?r(e):r(ne.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(ao(t))return Zg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=Jg(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 io(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Uz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Pl(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===Fl&&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,S=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(y=>this._onerror(new Error(`Failed to send cancellation: ${y}`))):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 y;try{y=e.decodeResult(t.method,b.result)}catch(N){return g(N instanceof Error?N:new Error(String(N)))}if(y.kind==="invalid")return g(y.error);if(y.kind==="input_required"){if(o?.allowInputRequired===!0)return p(Kz(y));let N={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(V,M)=>this._requestWithSchemaViaCodec(e,V===void 0?{method:t.method}:{method:t.method,params:V},r,M)};return p(this._resolveNonCompleteResult(y,N))}let E=y.result;_r(r,E).then(N=>{N.success?p(N.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${N.error}`))},g)}),u=()=>S(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??R_,w=()=>S(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(El(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(!Pl(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 ne(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 ne(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(!El(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 ne(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 ne(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Dn(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]=Dn(i)&&Dn(s)?{...i,...s}:s}return r}function Bg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bz(e){let t={},r=[];if(!Bg(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!Bg(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Kz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Gz=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}})),jP=gs(Gz(),1);var $_=10*1024*1024,Ql=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??$_}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 w_(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function w_(e){return _n.parse(JSON.parse(e))}function ed(e){return JSON.stringify(e)+`
61
+ `}var Wz=/^[A-Za-z0-9._-]{1,128}$/;function Yz(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"),!Wz.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 Xz(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=Yz(e);return Xz(e,t.warnings),t.isValid}function Qz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function e0(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function t0(e){if(typeof e!="object"||e===null||ao(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>Qz(r))}function oc(e){if(e!==void 0){if(t0(e))return P(e);if(typeof e=="object"&&e!==null&&!ao(e)&&Object.values(e).some(t=>e0(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(!ao(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 sc=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,S)=>`${z}${S}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((z,S)=>(S instanceof r&&(z[S.str]=(z[S.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(f,...z){let S=[f[0]],R=0;for(;R<z.length;)c(S,z[R]),S.push(f[++R]);return new o(S)}e._=n;let s=new o("+");function i(f,...z){let S=[v(f[0])],R=0;for(;R<z.length;)S.push(s),c(S,z[R]),S.push(s,v(f[++R]));return a(S),new o(S)}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 S=u(f[z-1],f[z+1]);if(S!==void 0){f.splice(z-1,3,S);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})),P_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=sc();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=sc(),r=P_();var o=sc();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=P_();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames($,k){return this}},i=class extends s{constructor($,k,x){super(),this.varKind=$,this.name=k,this.rhs=x}render({es5:$,_n:k}){let x=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${x} ${this.name}${J};`+k}optimizeNames($,k){if($[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,$,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor($,k,x){super(),this.lhs=$,this.rhs=k,this.sideEffects=x}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,k){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,$,k),this}get names(){return W(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,k,x,J){super($,x,J),this.op=k}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}},u=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}},d=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}},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($,k){return this.code=G(this.code,$,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},v=class extends s{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((k,x)=>k+x.render($),"")}optimizeNodes(){let{nodes:$}=this,k=$.length;for(;k--;){let x=$[k].optimizeNodes();Array.isArray(x)?$.splice(k,1,...x):x?$[k]=x:$.splice(k,1)}return $.length>0?this:void 0}optimizeNames($,k){let{nodes:x}=this,J=x.length;for(;J--;){let ee=x[J];ee.optimizeNames($,k)||(fe($,ee.names),x.splice(J,1))}return x.length>0?this:void 0}get names(){return this.nodes.reduce(($,k)=>Z($,k.names),{})}},m=class extends v{render($){return"{"+$._n+super.render($)+"}"+$._n}},_=class extends v{},h=class extends m{};h.kind="else";var f=class nc extends m{constructor(k,x){super(x),this.condition=k}render(k){let x=`if(${this.condition})`+super.render(k);return this.else&&(x+="else "+this.else.render(k)),x}optimizeNodes(){super.optimizeNodes();let k=this.condition;if(k===!0)return this.nodes;let x=this.else;if(x){let J=x.optimizeNodes();x=this.else=Array.isArray(J)?new h(J):J}if(x)return k===!1?x instanceof nc?x:x.nodes:this.nodes.length?this:new nc($e(k),x instanceof nc?[x]:x.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,x){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(k,x),!!(super.optimizeNames(k,x)||this.else))return this.condition=G(this.condition,k,x),this}get names(){let k=super.names;return W(k,this.condition),this.else&&Z(k,this.else.names),k}};f.kind="if";var z=class extends m{};z.kind="for";var S=class extends z{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iteration=G(this.iteration,$,k),this}get names(){return Z(super.names,this.iteration.names)}},R=class extends z{constructor($,k,x,J){super(),this.varKind=$,this.name=k,this.from=x,this.to=J}render($){let k=$.es5?r.varKinds.var:this.varKind,{name:x,from:J,to:ee}=this;return`for(${k} ${x}=${J}; ${x}<${ee}; ${x}++)`+super.render($)}get names(){return W(W(super.names,this.from),this.to)}},w=class extends z{constructor($,k,x,J){super(),this.loop=$,this.varKind=k,this.name=x,this.iterable=J}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iterable=G(this.iterable,$,k),this}get names(){return Z(super.names,this.iterable.names)}},b=class extends m{constructor($,k,x){super(),this.name=$,this.args=k,this.async=x}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}};b.kind="func";var y=class extends v{render($){return"return "+super.render($)}};y.kind="return";var E=class extends m{render($){let k="try"+super.render($);return this.catch&&(k+=this.catch.render($)),this.finally&&(k+=this.finally.render($)),k}optimizeNodes(){var $,k;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames($,k){var x,J;return super.optimizeNames($,k),(x=this.catch)===null||x===void 0||x.optimizeNames($,k),(J=this.finally)===null||J===void 0||J.optimizeNames($,k),this}get names(){let $=super.names;return this.catch&&Z($,this.catch.names),this.finally&&Z($,this.finally.names),$}},N=class extends m{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};N.kind="catch";var V=class extends m{render($){return"finally"+super.render($)}};V.kind="finally";var M=class{constructor($,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.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($,k){let x=this._extScope.value($,k);return(this._values[x.prefix]||(this._values[x.prefix]=new Set)).add(x),x}getScopeValue($,k){return this._extScope.getValue($,k)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,k,x,J){let ee=this._scope.toName(k);return x!==void 0&&J&&(this._constants[ee.str]=x),this._leafNode(new i($,ee,x)),ee}const($,k,x){return this._def(r.varKinds.const,$,k,x)}let($,k,x){return this._def(r.varKinds.let,$,k,x)}var($,k,x){return this._def(r.varKinds.var,$,k,x)}assign($,k,x){return this._leafNode(new c($,k,x))}add($,k){return this._leafNode(new a($,e.operators.ADD,k))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){let k=["{"];for(let[x,J]of $)k.length>1&&k.push(","),k.push(x),(x!==J||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,J));return k.push("}"),new t._Code(k)}if($,k,x){if(this._blockNode(new f($)),k&&x)this.code(k).else().code(x).endIf();else if(k)this.code(k).endIf();else if(x)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new f($))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(f,h)}_for($,k){return this._blockNode($),k&&this.code(k).endFor(),this}for($,k){return this._for(new S($),k)}forRange($,k,x,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,k,x),()=>J(pe))}forOf($,k,x,J=r.varKinds.const){let ee=this._scope.toName($);if(this.opts.es5){let pe=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${pe}.length`,ae=>{this.var(ee,(0,t._)`${pe}[${ae}]`),x(ee)})}return this._for(new w("of",J,ee,k),()=>x(ee))}forIn($,k,x,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${k})`,x);let ee=this._scope.toName($);return this._for(new w("in",J,ee,k),()=>x(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let k=new y;if(this._blockNode(k),this.code($),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(y)}try($,k,x){if(!k&&!x)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code($),k){let ee=this.name("e");this._currNode=J.catch=new N(ee),k(ee)}return x&&(this._currNode=J.finally=new V,this.code(x)),this._endBlockNode(N,V)}throw($){return this._leafNode(new p($))}block($,k){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(k),this}endBlock($){let k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");let x=this._nodes.length-k;if(x<0||$!==void 0&&x!==$)throw new Error(`CodeGen: wrong number of nodes: ${x} vs ${$} expected`);return this._nodes.length=k,this}func($,k=t.nil,x,J){return this._blockNode(new b($,k,x)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,k){let x=this._currNode;if(x instanceof $||k&&x instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${$.kind}/${k.kind}`:$.kind}"`)}_elseNode($){let k=this._currNode;if(!(k instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let k=this._nodes;k[k.length-1]=$}};e.CodeGen=M;function Z($,k){for(let x in k)$[x]=($[x]||0)+(k[x]||0);return $}function W($,k){return k instanceof t._CodeOrName?Z($,k.names):$}function G($,k,x){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=x[pe.str];return ae===void 0||k[pe.str]!==1?pe:(delete k[pe.str],ae)}function ee(pe){return pe instanceof t._Code&&pe._items.some(ae=>ae instanceof t.Name&&k[ae.str]===1&&x[ae.str]!==void 0)}}function fe($,k){for(let x in k)$[x]=($[x]||0)-(k[x]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${F($)}`}e.not=$e;let be=j(e.operators.AND);function Oe(...$){return $.reduce(be)}e.and=Oe;let he=j(e.operators.OR);function C(...$){return $.reduce(he)}e.or=C;function j($){return(k,x)=>k===t.nil?x:x===t.nil?k:(0,t._)`${F(k)} ${$} ${F(x)}`}function F($){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=sc();function o(b){let y={};for(let E of b)y[E]=!0;return y}e.toHash=o;function n(b,y){return typeof y=="boolean"?y:Object.keys(y).length===0?!0:(s(b,y),!i(y,b.self.RULES.all))}e.alwaysValidSchema=n;function s(b,y=b.schema){let{opts:E,self:N}=b;if(!E.strictSchema||typeof y=="boolean")return;let V=N.RULES.keywords;for(let M in y)V[M]||w(b,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function i(b,y){if(typeof b=="boolean")return!b;for(let E in b)if(y[E])return!0;return!1}e.schemaHasRules=i;function c(b,y){if(typeof b=="boolean")return!b;for(let E in b)if(E!=="$ref"&&y.all[E])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:b,schemaPath:y},E,N,V){if(!V){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${b}${y}${(0,t.getProperty)(N)}`}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,y){if(Array.isArray(b))for(let E of b)y(E);else y(b)}e.eachItem=v;function m({mergeNames:b,mergeToName:y,mergeValues:E,resultToName:N}){return(V,M,Z,W)=>{let G=Z===void 0?M:Z instanceof t.Name?(M instanceof t.Name?b(V,M,Z):y(V,M,Z),Z):M instanceof t.Name?(y(V,Z,M),M):E(M,Z);return W===t.Name&&!(G instanceof t.Name)?N(V,G):G}}e.mergeEvaluated={props:m({mergeNames:(b,y,E)=>b.if((0,t._)`${E} !== true && ${y} !== undefined`,()=>{b.if((0,t._)`${y} === true`,()=>b.assign(E,!0),()=>b.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${y})`))}),mergeToName:(b,y,E)=>b.if((0,t._)`${E} !== true`,()=>{y===!0?b.assign(E,!0):(b.assign(E,(0,t._)`${E} || {}`),h(b,E,y))}),mergeValues:(b,y)=>b===!0?!0:{...b,...y},resultToName:_}),items:m({mergeNames:(b,y,E)=>b.if((0,t._)`${E} !== true && ${y} !== undefined`,()=>b.assign(E,(0,t._)`${y} === true ? true : ${E} > ${y} ? ${E} : ${y}`)),mergeToName:(b,y,E)=>b.if((0,t._)`${E} !== true`,()=>b.assign(E,y===!0?!0:(0,t._)`${E} > ${y} ? ${E} : ${y}`)),mergeValues:(b,y)=>b===!0?!0:Math.max(b,y),resultToName:(b,y)=>b.var("items",y)})};function _(b,y){if(y===!0)return b.var("props",!0);let E=b.var("props",(0,t._)`{}`);return y!==void 0&&h(b,E,y),E}e.evaluatedPropsToName=_;function h(b,y,E){Object.keys(E).forEach(N=>b.assign((0,t._)`${y}${(0,t.getProperty)(N)}`,!0))}e.setEvaluated=h;let f={};function z(b,y){return b.scopeValue("func",{ref:y,code:f[y.code]||(f[y.code]=new r._Code(y.code))})}e.useFunc=z;var S;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(S||(e.Type=S={}));function R(b,y,E){if(b instanceof t.Name){let N=y===S.Num;return E?N?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:N?(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,y,E=b.opts.strictSchema){if(E){if(y=`strict mode: ${y}`,E===!0)throw new Error(y);b.self.logger.warn(y)}}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})),ac=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,S){let{it:R}=h,{gen:w,compositeRule:b,allErrors:y}=R,E=p(h,f,z);S??(b||y)?a(w,E):u(R,(0,t._)`[${E}]`)}e.reportError=n;function s(h,f=e.keywordError,z){let{it:S}=h,{gen:R,compositeRule:w,allErrors:b}=S;a(R,p(h,f,z)),w||b||u(S,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:S,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,y=>{h.const(b,(0,t._)`${o.default.vErrors}[${y}]`),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`,S))})}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:S,schemaEnv:R}=h;R.$async?z.throw((0,t._)`new ${h.ValidationError}(${f})`):(z.assign((0,t._)`${S}.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:S}=h.it;return S===!1?(0,t._)`{}`:g(h,f,z)}function g(h,f,z={}){let{gen:S,it:R}=h,w=[v(R,z),m(h,z)];return _(h,f,w),S.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:S}){let R=S?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},S){let{keyword:R,data:w,schemaValue:b,it:y}=h,{opts:E,propertyName:N,topSchemaRef:V,schemaPath:M}=y;S.push([d.keyword,R],[d.params,typeof f=="function"?f(h):f||(0,t._)`{}`]),E.messages&&S.push([d.message,typeof z=="function"?z(h):z]),E.verbose&&S.push([d.schema,b],[d.parentSchema,(0,t._)`${V}${M}`],[o.default.data,w]),N&&S.push([d.propertyName,N])}})),r0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=ac(),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)}})),E_=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})),T_=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})),ic=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=E_(),r=T_(),o=ac(),n=le(),s=_e();var i;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(S){let R=a(S.type);if(R.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!R.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&R.push("null")}return R}e.getSchemaTypes=c;function a(S){let R=Array.isArray(S)?S:S?[S]:[];if(R.every(t.isJSONType))return R;throw new Error("type must be JSONType or JSONType[]: "+R.join(","))}e.getJSONTypes=a;function u(S,R){let{gen:w,data:b,opts:y}=S,E=p(R,y.coerceTypes),N=R.length>0&&!(E.length===0&&R.length===1&&(0,r.schemaHasRulesForType)(S,R[0]));if(N){let V=_(R,b,y.strictNumbers,i.Wrong);w.if(V,()=>{E.length?g(S,R,E):f(S)})}return N}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function p(S,R){return R?S.filter(w=>d.has(w)||R==="array"&&w==="array"):[]}function g(S,R,w){let{gen:b,data:y,opts:E}=S,N=b.let("dataType",(0,n._)`typeof ${y}`),V=b.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&b.if((0,n._)`${N} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>b.assign(y,(0,n._)`${y}[0]`).assign(N,(0,n._)`typeof ${y}`).if(_(R,y,E.strictNumbers),()=>b.assign(V,y))),b.if((0,n._)`${V} !== undefined`);for(let Z of w)(d.has(Z)||Z==="array"&&E.coerceTypes==="array")&&M(Z);b.else(),f(S),b.endIf(),b.if((0,n._)`${V} !== undefined`,()=>{b.assign(y,V),v(S,V)});function M(Z){switch(Z){case"string":b.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(V,(0,n._)`"" + ${y}`).elseIf((0,n._)`${y} === null`).assign(V,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${N} == "boolean" || ${y} === null
63
63
  || (${N} == "string" && ${y} && ${y} == +${y})`).assign(V,(0,n._)`+${y}`);return;case"integer":b.elseIf((0,n._)`${N} === "boolean" || ${y} === null
64
64
  || (${N} === "string" && ${y} && ${y} == +${y} && !(${y} % 1))`).assign(V,(0,n._)`+${y}`);return;case"boolean":b.elseIf((0,n._)`${y} === "false" || ${y} === 0 || ${y} === null`).assign(V,!1).elseIf((0,n._)`${y} === "true" || ${y} === 1`).assign(V,!0);return;case"null":b.elseIf((0,n._)`${y} === "" || ${y} === 0 || ${y} === false`),b.assign(V,null);return;case"array":b.elseIf((0,n._)`${N} === "string" || ${N} === "number"
65
- || ${N} === "boolean" || ${y} === null`).assign(V,(0,n._)`[${y}]`)}}}function v({gen:S,parentData:R,parentDataProperty:w},b){S.if((0,n._)`${R} !== undefined`,()=>S.assign((0,n._)`${R}[${w}]`,b))}function m(S,R,w,b=i.Correct){let y=b===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(S){case"null":return(0,n._)`${R} ${y} 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=N((0,n._)`!(${R} % 1) && !isNaN(${R})`);break;case"number":E=N();break;default:return(0,n._)`typeof ${R} ${y} ${S}`}return b===i.Correct?E:(0,n.not)(E);function N(V=n.nil){return(0,n.and)((0,n._)`typeof ${R} == "number"`,V,w?(0,n._)`isFinite(${R})`:n.nil)}}e.checkDataType=m;function _(S,R,w,b){if(S.length===1)return m(S[0],R,w,b);let y,E=(0,s.toHash)(S);if(E.array&&E.object){let N=(0,n._)`typeof ${R} != "object"`;y=E.null?N:(0,n._)`!${R} || ${N}`,delete E.null,delete E.array,delete E.object}else y=n.nil;E.number&&delete E.integer;for(let N in E)y=(0,n.and)(y,m(N,R,w,b));return y}e.checkDataTypes=_;let h={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:R})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${R}}`};function f(S){let R=z(S);(0,o.reportError)(R,h)}e.reportTypeError=f;function z(S){let{gen:R,data:w,schema:b}=S,y=(0,s.schemaRefOrVal)(S,b,"type");return{gen:R,keyword:"type",data:w,schema:b.type,schemaCode:y,schemaValue:y,parentSchema:b,params:{},it:S}}})),e0=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(S,R){let{gen:w,data:b,it:y}=S;w.if(p(w,b,R,y.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${R}`},!0),S.error()})}e.checkReportMissingProp=s;function i({gen:S,data:R,it:{opts:w}},b,y){return(0,t.or)(...b.map(E=>(0,t.and)(p(S,R,E,w.ownProperties),(0,t._)`${y} = ${E}`)))}e.checkMissingProp=i;function c(S,R){S.setParams({missingProperty:R},!0),S.error()}e.reportMissingProp=c;function a(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(S,R,w){return(0,t._)`${a(S)}.call(${R}, ${w})`}e.isOwnProperty=u;function d(S,R,w,b){let y=(0,t._)`${R}${(0,t.getProperty)(w)} !== undefined`;return b?(0,t._)`${y} && ${u(S,R,w)}`:y}e.propertyInData=d;function p(S,R,w,b){let y=(0,t._)`${R}${(0,t.getProperty)(w)} === undefined`;return b?(0,t.or)(y,(0,t.not)(u(S,R,w))):y}e.noPropertyInData=p;function g(S){return S?Object.keys(S).filter(R=>R!=="__proto__"):[]}e.allSchemaProperties=g;function v(S,R){return g(R).filter(w=>!(0,r.alwaysValidSchema)(S,R[w]))}e.schemaProperties=v;function m({schemaCode:S,data:R,it:{gen:w,topSchemaRef:b,schemaPath:y,errorPath:E},it:N},V,M,Z){let W=Z?(0,t._)`${S}, ${R}, ${b}${y}`:R,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,N.parentData],[o.default.parentDataProperty,N.parentDataProperty],[o.default.rootData,o.default.rootData]];N.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let fe=(0,t._)`${W}, ${w.object(...G)}`;return M!==t.nil?(0,t._)`${V}.call(${M}, ${fe})`:(0,t._)`${V}(${fe})`}e.callValidateCode=m;let _=(0,t._)`new RegExp`;function h({gen:S,it:{opts:R}},w){let b=R.unicodeRegExp?"u":"",{regExp:y}=R.code,E=y(w,b);return S.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,t._)`${y.code==="new RegExp"?_:(0,n.useFunc)(S,y)}(${w}, ${b})`})}e.usePattern=h;function f(S){let{gen:R,data:w,keyword:b,it:y}=S,E=R.name("valid");if(y.allErrors){let V=R.let("valid",!0);return N(()=>R.assign(V,!1)),V}return R.var(E,!0),N(()=>R.break()),E;function N(V){let M=R.const("len",(0,t._)`${w}.length`);R.forRange("i",0,M,Z=>{S.subschema({keyword:b,dataProp:Z,dataPropType:r.Type.Num},E),R.if((0,t.not)(E),V)})}}e.validateArray=f;function z(S){let{gen:R,schema:w,keyword:b,it:y}=S;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(V=>(0,r.alwaysValidSchema)(y,V))&&!y.opts.unevaluated)return;let E=R.let("valid",!1),N=R.name("_valid");R.block(()=>w.forEach((V,M)=>{let Z=S.subschema({keyword:b,schemaProp:M,compositeRule:!0},N);R.assign(E,(0,t._)`${E} || ${N}`),S.mergeValidEvaluated(Z,N)||R.if((0,t.not)(E))})),S.result(E,()=>S.reset(),()=>S.error(!0))}e.validateUnion=z})),t0=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=ac();function s(v,m){let{gen:_,keyword:h,schema:f,parentSchema:z,it:S}=v,R=m.macro.call(S.self,f,z,S),w=d(_,h,R);S.opts.validateSchema!==!1&&S.self.validateSchema(R,!0);let b=_.name("valid");v.subschema({schema:R,schemaPath:t.nil,errSchemaPath:`${S.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:S,$data:R,it:w}=v;u(w,m);let b=d(h,f,!R&&m.compile?m.compile.call(w.self,z,S,w):m.validate),y=h.let("valid");v.block$data(y,E),v.ok((_=m.valid)!==null&&_!==void 0?_:y);function E(){if(m.errors===!1)M(),m.modifying&&c(v),Z(()=>v.error());else{let W=m.async?N():V();m.modifying&&c(v),Z(()=>a(v,W))}}function N(){let W=h.let("ruleErrs",null);return h.try(()=>M((0,t._)`await `),G=>h.assign(y,!1).if((0,t._)`${G} instanceof ${w.ValidationError}`,()=>h.assign(W,(0,t._)`${G}.errors`),()=>h.throw(G))),W}function V(){let W=(0,t._)`${b}.errors`;return h.assign(W,null),M(t.nil),W}function M(W=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(y,(0,t._)`${W}${(0,o.callValidateCode)(v,b,G,fe)}`,m.modifying)}function Z(W){var G;h.if((0,t.not)((G=m.valid)!==null&&G!==void 0?G:y),W)}}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 S=f.dependencies;if(S?.some(R=>!Object.prototype.hasOwnProperty.call(v,R)))throw new Error(`parent schema must have dependencies of ${z}: ${S.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})),r0=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})),T_=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}})),o0=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")}})),cc=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=T_(),o=o0(),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],S=>f+=a(S)),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:S}=this.opts,R=g(h[z]||f),w={"":R},b=u(S,R,!1),y={},E=new Set;return o(h,{allKeys:!0},(M,Z,W,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 V(he);E.add(he);let j=this.refs[he];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?N(M,j.schema,he):he!==g(fe)&&(he[0]==="#"?(N(M,y[he],he),y[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}`)}}}),y;function N(M,Z,W){if(Z!==void 0&&!r(M,Z))throw V(W)}function V(M){return new Error(`reference "${M}" resolves to more than one schema`)}}e.getSchemaRefs=_})),co=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=Qz(),r=ic(),o=E_(),n=ic(),s=e0(),i=t0(),c=r0(),a=le(),u=pt(),d=cc(),p=_e(),g=ac();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:se,opts:ie},de){ie.code.es5?T.func(A,(0,a._)`${u.default.data}, ${u.default.valCxt}`,se.$async,()=>{T.code((0,a._)`"use strict"; ${S(D,ie)}`),h(T,ie),T.code(de)}):T.func(A,(0,a._)`${u.default.data}, ${_(ie)}`,se.$async,()=>T.code(S(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:se}=T;m(T,()=>{D.$comment&&A.$comment&&G(T),M(T),se.let(u.default.vErrors,null),se.let(u.default.errors,0),D.unevaluated&&z(T),N(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 S(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))){y(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 y(T,A){let{schema:D,gen:se,opts:ie}=T;ie.$comment&&D.$comment&&G(T),Z(T),W(T);let de=se.const("_errs",u.default.errors);N(T,de),se.var(A,(0,a._)`${de} === ${u.default.errors}`)}function E(T){(0,p.checkUnknownRules)(T),V(T)}function N(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 V(T){let{schema:A,errSchemaPath:D,opts:se,self:ie}=T;A.$ref&&se.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 W(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:se,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)`${se}/$comment`,Ne=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${ke}, ${Ne}.schema)`)}}function fe(T){let{gen:A,schemaEnv:D,validateName:se,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._)`${se}.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:se}){D instanceof a.Name&&T.assign((0,a._)`${A}.props`,D),se instanceof a.Name&&T.assign((0,a._)`${A}.items`,se)}function be(T,A,D,se){let{gen:ie,schema:de,data:ke,allErrors:Ne,opts:Ze,self:xe}=T,{RULES:we}=xe;if(de.$ref&&(Ze.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(de,we))){ie.block(()=>pe(T,"$ref",we.all.$ref.definition));return}Ze.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,Ze.strictNumbers)),Oe(T,Ae),A.length===1&&A[0]===Ae.type&&D&&(ie.else(),(0,n.reportTypeError)(T)),ie.endIf()):Oe(T,Ae),Ne||ie.if((0,a._)`${u.default.errors} === ${se||0}`))}}function Oe(T,A){let{gen:D,schema:se,opts:{useDefaults:ie}}=T;ie&&(0,s.assignDefaults)(T,A.type),D.block(()=>{for(let de of A.rules)(0,o.shouldUseRule)(se,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),F(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(",")}"`)}),x(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 F(T,A){let D=T.self.RULES.all;for(let se in D){let ie=D[se];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 "${se}"`)}}}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 x(T,A){let D=[];for(let se of T.dataTypes)C(A,se)?D.push(se):A.includes("integer")&&se==="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",Je(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:se,schemaType:ie,def:de}=this;D.if((0,a.or)((0,a._)`${se} === 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:se,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 Ne=Array.isArray(D)?D:[D];return(0,a._)`${(0,n.checkDataTypes)(Ne,A,ie.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function ke(){if(se.validateSchema){let Ne=T.scopeValue("validate$data",{ref:se.validateSchema});return(0,a._)`!${Ne}(${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 se={...this.it,...D,items:void 0,props:void 0};return R(se,A),se}mergeEvaluated(T,A){let{it:D,gen:se}=this;D.opts.unevaluated&&(D.props!==!0&&T.props!==void 0&&(D.props=p.mergeEvaluated.props(se,T.props,D.props,A)),D.items!==!0&&T.items!==void 0&&(D.items=p.mergeEvaluated.items(se,T.items,D.items,A)))}mergeValidEvaluated(T,A){let{it:D,gen:se}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return se.if(A,()=>this.mergeEvaluated(T,a.Name)),!0}};e.KeywordCxt=ee;function pe(T,A,D,se){let ie=new ee(T,D,A);"code"in D?D.code(ie,se):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 Je(T,{dataLevel:A,dataNames:D,dataPathArr:se}){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 xe=ze.exec(T);if(!xe)throw new Error(`Invalid JSON-pointer: ${T}`);let we=+xe[1];if(ie=xe[2],ie==="#"){if(we>=A)throw new Error(Ze("property/index",we));return se[A-we]}if(we>A)throw new Error(Ze("data",we));if(de=D[A-we],!ie)return de}let ke=de,Ne=ie.split("/");for(let xe of Ne)xe&&(de=(0,a._)`${de}${(0,a.getProperty)((0,p.unescapeJsonPointer)(xe))}`,ke=(0,a._)`${ke} && ${de}`);return ke;function Ze(xe,we){return`Cannot access ${xe} ${we} levels up, current level is ${A}`}}e.getData=Je})),Jn=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})),uo=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cc();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})),uc=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Jn(),o=pt(),n=cc(),s=_e(),i=co();var c=class{constructor(f){var z;this.refs={},this.dynamicAnchors={};let S;typeof f.schema=="object"&&(S=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)(S?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=S?.$async,this.refs={}}};e.SchemaEnv=c;function a(f){let z=p.call(this,f);if(z)return z;let S=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:R,lines:w}=this.opts.code,{ownProperties:b}=this.opts,y=new t.CodeGen(this.scope,{es5:R,lines:w,ownProperties:b}),E;f.$async&&(E=y.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let N=y.scopeName("validate");f.validateName=N;let V={gen:y,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:y.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:N,ValidationError:E,schema:f.schema,schemaEnv:f,rootId:S,baseId:f.baseId||S,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)(V),y.optimize(this.opts.code.optimize);let Z=y.toString();M=`${y.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process&&(M=this.opts.code.process(M,f));let W=new Function(`${o.default.self}`,`${o.default.scope}`,M)(this,this.scope.get());if(this.scope.value(N,{ref:W}),W.errors=null,W.schema=f.schema,W.schemaEnv=f,f.$async&&(W.$async=!0),this.opts.code.source===!0&&(W.source={validateName:N,validateCode:Z,scopeValues:y._values}),this.opts.unevaluated){let{props:G,items:fe}=V;W.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},W.source&&(W.source.evaluated=(0,t.stringify)(W.evaluated))}return f.validate=W,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,S){var R;S=(0,n.resolveUrl)(this.opts.uriResolver,z,S);let w=f.refs[S];if(w)return w;let b=v.call(this,f,S);if(b===void 0){let y=(R=f.localRefs)===null||R===void 0?void 0:R[S],{schemaId:E}=this.opts;y&&(b=new c({schema:y,schemaId:E,root:f,baseId:z}))}if(b!==void 0)return f.refs[S]=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 S;for(;typeof(S=this.refs[z])=="string";)z=S;return S||this.schemas[z]||m.call(this,f,z)}function m(f,z){let S=this.opts.uriResolver.parse(z),R=(0,n._getFullPath)(this.opts.uriResolver,S),w=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&R===w)return h.call(this,S,f);let b=(0,n.normalizeId)(R),y=this.refs[b]||this.schemas[b];if(typeof y=="string"){let E=m.call(this,f,y);return typeof E?.schema!="object"?void 0:h.call(this,S,E)}if(typeof y?.schema=="object"){if(y.validate||a.call(this,y),b===(0,n.normalizeId)(z)){let{schema:E}=y,{schemaId:N}=this.opts,V=E[N];return V&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,V)),new c({schema:E,schemaId:N,root:f,baseId:w})}return h.call(this,S,y)}}e.resolveSchema=m;let _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(f,{baseId:z,schema:S,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 S=="boolean")return;let N=S[(0,s.unescapeFragment)(E)];if(N===void 0)return;S=N;let V=typeof S=="object"&&S[this.opts.schemaId];!_.has(E)&&V&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,V))}let b;if(typeof S!="boolean"&&S.$ref&&!(0,s.schemaHasRulesButRef)(S,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,z,S.$ref);b=m.call(this,R,E)}let{schemaId:y}=this.opts;if(b=b||new c({schema:S,schemaId:y,root:R,baseId:z}),b.schema!==b.root.schema)return b}})),n0=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(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=[],S=!1,R=!1,w=c;for(let b=0;b<m.length;b++){let y=m[b];if(!(y==="["||y==="]"))if(y===":"){if(S===!0&&(R=!0),!w(z,f,h))break;if(++_>7){h.error=!0;break}b>0&&m[b-1]===":"&&(S=!0),f.push(":");continue}else if(y==="%"){if(!w(z,f,h))break;w=i}else{z.push(y);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}})),s0=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(y){return n.indexOf(y)!==-1}function i(y){return y.secure===!0?!0:y.secure===!1?!1:y.scheme?y.scheme.length===3&&(y.scheme[0]==="w"||y.scheme[0]==="W")&&(y.scheme[1]==="s"||y.scheme[1]==="S")&&(y.scheme[2]==="s"||y.scheme[2]==="S"):!1}function c(y){return y.host||(y.error=y.error||"HTTP URIs must have a host."),y}function a(y){let E=String(y.scheme).toLowerCase()==="https";return(y.port===(E?443:80)||y.port==="")&&(y.port=void 0),y.path||(y.path="/"),y}function u(y){return y.secure=i(y),y.resourceName=(y.path||"/")+(y.query?"?"+y.query:""),y.path=void 0,y.query=void 0,y}function d(y){if((y.port===(i(y)?443:80)||y.port==="")&&(y.port=void 0),typeof y.secure=="boolean"&&(y.scheme=y.secure?"wss":"ws",y.secure=void 0),y.resourceName){let[E,N]=y.resourceName.split("?");y.path=E&&E!=="/"?E:void 0,y.query=N,y.resourceName=void 0}return y.fragment=void 0,y}function p(y,E){if(!y.path)return y.error="URN can not be parsed",y;let N=y.path.match(o);if(N){let V=E.scheme||y.scheme||"urn";y.nid=N[1].toLowerCase(),y.nss=N[2];let M=b(`${V}:${E.nid||y.nid}`);y.path=void 0,M&&(y=M.parse(y,E))}else y.error=y.error||"URN can not be parsed.";return y}function g(y,E){if(y.nid===void 0)throw new Error("URN without nid cannot be serialized");let N=E.scheme||y.scheme||"urn",V=y.nid.toLowerCase(),M=b(`${N}:${E.nid||V}`);M&&(y=M.serialize(y,E));let Z=y,W=y.nss;return Z.path=`${V||E.nid}:${W}`,E.skipEscape=!0,Z}function v(y,E){let N=y;return N.uuid=N.nss,N.nss=void 0,!E.tolerant&&(!N.uuid||!r(N.uuid))&&(N.error=N.error||"UUID is not valid."),N}function m(y){let E=y;return E.nss=(y.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(y){return y&&(w[y]||w[y.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:b}})),i0=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=C_(),{SCHEMES:a,getSchemeHandler:u}=s0();function d(z,S){return typeof z=="string"?z=m(h(z,S),S):typeof z=="object"&&(z=h(m(z,S),S)),z}function p(z,S,R){let w=R?Object.assign({scheme:"null"},R):{scheme:"null"},b=g(h(z,w),h(S,w),w,!0);return w.skipEscape=!0,m(b,w)}function g(z,S,R,w){let b={};return w||(z=h(m(z,R),R),S=h(m(S,R),R)),R=R||{},!R.tolerant&&S.scheme?(b.scheme=S.scheme,b.userinfo=S.userinfo,b.host=S.host,b.port=S.port,b.path=o(S.path||""),b.query=S.query):(S.userinfo!==void 0||S.host!==void 0||S.port!==void 0?(b.userinfo=S.userinfo,b.host=S.host,b.port=S.port,b.path=o(S.path||""),b.query=S.query):(S.path?(S.path[0]==="/"?b.path=o(S.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?b.path="/"+S.path:z.path?b.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+S.path:b.path=S.path,b.path=o(b.path)),b.query=S.query):(b.path=z.path,S.query!==void 0?b.query=S.query:b.query=z.query),b.userinfo=z.userinfo,b.host=z.host,b.port=z.port),b.scheme=z.scheme),b.fragment=S.fragment,b}function v(z,S,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 S=="string"?(S=unescape(S),S=m(s(h(S,R),!0),{...R,skipEscape:!0})):typeof S=="object"&&(S=m(s(S,!0),{...R,skipEscape:!0})),z.toLowerCase()===S.toLowerCase()}function m(z,S){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({},S),b=[],y=u(w.scheme||R.scheme);y&&y.serialize&&y.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 N=R.path;!w.absolutePath&&(!y||!y.absolutePath)&&(N=o(N)),E===void 0&&N[0]==="/"&&N[1]==="/"&&(N="/%2F"+N.slice(2)),b.push(N)}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,S){let R=Object.assign({},S),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 y=z.match(_);if(y){if(w.scheme=y[1],w.userinfo=y[3],w.host=y[4],w.port=parseInt(y[5],10),w.path=y[6]||"",w.query=y[7],w.fragment=y[8],isNaN(w.port)&&(w.port=y[5]),w.host)if(i(w.host)===!1){let N=r(w.host);w.host=N.host.toLowerCase(),b=N.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(N){w.error=w.error||"Host's domain name can not be converted to ASCII: "+N}(!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})),a0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=i0();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),nd=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=co();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=Jn(),n=uo(),s=P_(),i=uc(),c=le(),a=cc(),u=ic(),d=_e(),p=n0(),g=a0(),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 S(k){var j,F,$,C,x,J,ee,pe,ae,ze,Je,T,A,D,se,ie,de,ke,Ne,Ze,xe,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=($=(F=k.code)===null||F===void 0?void 0:F.regExp)!==null&&$!==void 0?$:v,Xt=(C=k.uriResolver)!==null&&C!==void 0?C:g.default;return{strictSchema:(J=(x=k.strictSchema)!==null&&x!==void 0?x: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=(Je=k.strictTuples)!==null&&Je!==void 0?Je: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:(se=k.loopRequired)!==null&&se!==void 0?se: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:(Ne=k.inlineRefs)!==null&&Ne!==void 0?Ne:!0,schemaId:(Ze=k.schemaId)!==null&&Ze!==void 0?Ze:"$id",addUsedSchema:(xe=k.addUsedSchema)!==null&&xe!==void 0?xe:!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,...S(k)};let{es5:j,lines:F}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:j,lines:F}),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=V.call(this),k.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&N.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),y.call(this),k.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:k,meta:j,schemaId:F}=this.opts,$=p;F==="id"&&($={...p},$.id=$.$id,delete $.$id),j&&k&&this.addMetaSchema($,$[F],!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 F;if(typeof k=="string"){if(F=this.getSchema(k),!F)throw new Error(`no schema with key or ref "${k}"`)}else F=this.compile(k);let $=F(j);return"$async"in F||(this.errors=F.errors),$}compile(k,j){let F=this._addSchema(k,j);return F.validate||this._compileSchemaEnv(F)}compileAsync(k,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:F}=this.opts;return $.call(this,k,j);async function $(ae,ze){await C.call(this,ae.$schema);let Je=this._addSchema(ae,ze);return Je.validate||x.call(this,Je)}async function C(ae){ae&&!this.getSchema(ae)&&await $.call(this,{$ref:ae},!0)}async function x(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),x.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]=F(ae))}finally{delete this._loading[ae]}}}addSchema(k,j,F,$=this.opts.validateSchema){if(Array.isArray(k)){for(let x of k)this.addSchema(x,void 0,F,$);return this}let C;if(typeof k=="object"){let{schemaId:x}=this.opts;if(C=k[x],C!==void 0&&typeof C!="string")throw new Error(`schema ${x} must be string`)}return j=(0,a.normalizeId)(j||C),this._checkUnique(j),this.schemas[j]=this._addSchema(k,F,j,$,!0),this}addMetaSchema(k,j,F=this.opts.validateSchema){return this.addSchema(k,j,!0,F),this}validateSchema(k,j){if(typeof k=="boolean")return!0;let F;if(F=k.$schema,F!==void 0&&typeof F!="string")throw new Error("$schema must be a string");if(F=F||this.opts.defaultMeta||this.defaultMeta(),!F)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let $=this.validate(F,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:F}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:F});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 F=k[this.opts.schemaId];return F&&(F=(0,a.normalizeId)(F),delete this.schemas[F],delete this.refs[F]),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 F;if(typeof k=="string")F=k,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=F);else if(typeof k=="object"&&j===void 0){if(j=k,F=j.keyword,Array.isArray(F)&&!F.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,F,j),!j)return(0,d.eachItem)(F,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)(F,$.type.length===0?C=>fe.call(this,C,$):C=>$.type.forEach(x=>fe.call(this,C,$,x))),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 F of j.rules){let $=F.rules.findIndex(C=>C.keyword===k);$>=0&&F.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:F="data"}={}){return!k||k.length===0?"No errors":k.map($=>`${F}${$.instancePath} ${$.message}`).reduce(($,C)=>$+j+C)}$dataMetaSchema(k,j){let F=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(let $ of j){let C=$.split("/").slice(1),x=k;for(let J of C)x=x[J];for(let J in F){let ee=F[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ae=x[J];pe&&ae&&(x[J]=he(ae))}}return k}_removeAllSchemas(k,j){for(let F in k){let $=k[F];(!j||j.test(F))&&(typeof $=="string"?delete k[F]:$&&!$.meta&&(this._cache.delete($.schema),delete k[F]))}}_addSchema(k,j,F,$=this.opts.validateSchema,C=this.opts.addUsedSchema){let x,{schemaId:J}=this.opts;if(typeof k=="object")x=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;F=(0,a.normalizeId)(x||F);let pe=a.getSchemaRefs.call(this,k,F);return ee=new i.SchemaEnv({schema:k,schemaId:J,meta:j,baseId:F,localRefs:pe}),this._cache.set(ee.schema,ee),C&&!F.startsWith("#")&&(F&&this._checkUnique(F),this.refs[F]=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,F,$="error"){for(let C in k){let x=C;x in j&&this.logger[$](`${F}: option ${C}. ${k[x]}`)}}function b(k){return k=(0,a.normalizeId)(k),this.schemas[k]||this.refs[k]}function y(){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 N(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 F=k[j];F.keyword||(F.keyword=j),this.addKeyword(F)}}function V(){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 W=/^[a-z_$][a-z0-9_$:-]*$/i;function G(k,j){let{RULES:F}=this;if((0,d.eachItem)(k,$=>{if(F.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!W.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,F){var $;let C=j?.post;if(F&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:x}=this,J=C?x.post:x.rules.find(({type:pe})=>pe===F);if(J||(J={type:F,rules:[]},x.rules.push(J)),x.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),x.all[k]=ee,($=j.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(k,j,F){let $=k.rules.findIndex(C=>C.keyword===F);$>=0?k.rules.splice($,0,j):(k.rules.push(j),this.logger.warn(`rule ${F} 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]}}})),c0=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})),sd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=uo(),r=mt(),o=le(),n=pt(),s=uc(),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:S}=_;if((g==="#"||g==="#/")&&m===S.baseId)return w();let R=s.resolveRef.call(z,S,m,g);if(R===void 0)throw new t.default(v.opts.uriResolver,m,g);if(R instanceof s.SchemaEnv)return b(R);return y(R);function w(){if(_===S)return u(d,h,_,_.$async);let E=p.scopeValue("root",{ref:S});return u(d,(0,o._)`${E}.validate`,S,S.$async)}function b(E){u(d,a(d,E),E,E.$async)}function y(E){let N=p.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),V=p.name("valid"),M=d.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:N,errSchemaPath:g},V);d.mergeEvaluated(M),d.ok(V)}}};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}=_,S=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,S)}`),y(p),h||m.assign(E,!0)},N=>{m.if((0,o._)`!(${N} instanceof ${_.ValidationError})`,()=>m.throw(N)),b(N),h||m.assign(E,!1)}),d.ok(E)}function w(){d.result((0,r.callValidateCode)(d,p,S),()=>y(p),()=>b(p))}function b(E){let N=(0,o._)`${E}.errors`;m.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),m.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function y(E){var N;if(!_.opts.unevaluated)return;let V=(N=g?.validate)===null||N===void 0?void 0:N.evaluated;if(_.props!==!0)if(V&&!V.dynamicProps)V.props!==void 0&&(_.props=i.mergeEvaluated.props(m,V.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(V&&!V.dynamicItems)V.items!==void 0&&(_.items=i.mergeEvaluated.items(m,V.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})),k_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=c0(),r=sd(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),u0=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})),l0=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})),d0=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'})),p0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=d0(),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})),m0=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})),f0=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})),h0=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:S}=s.it;for(let R of c)if(z?.[R]===void 0&&!S.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 S=i.let("valid",!0);s.block$data(S,()=>f(z,S)),s.ok(S)}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,S){s.setParams({missingProperty:z}),i.forOf(z,a,()=>{i.assign(S,(0,t.propertyInData)(i,u,z,g.ownProperties)),i.if((0,r.not)(S),()=>{s.error(),i.break()})},r.nil)}}};e.default=n})),g0=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})),id=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=T_();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),_0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ic(),r=le(),o=_e(),n=id(),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:S)(R,w))}function f(){return _.length>0&&!_.some(R=>R==="object"||R==="array")}function z(R,w){let b=c.name("item"),y=(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(y,(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 S(R,w){let b=(0,o.useFunc)(c,n.default),y=c.name("outer");c.label(y).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(y)})))}}};e.default=s})),S0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=id(),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})),y0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=id(),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((S,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,S){let R=u[S];return typeof R=="object"&&R!==null?(0,t._)`${m()}(${c}, ${z}[${S}])`:(0,t._)`${c} === ${R}`}}};e.default=n})),I_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=u0(),r=l0(),o=p0(),n=m0(),s=f0(),i=h0(),c=g0(),a=_0(),u=S0(),d=y0(),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})),O_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=le(),r=_e(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:i,it:c}=s,{items:a}=i;if(!Array.isArray(a)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,a)}};function n(s,i){let{gen:c,schema:a,data:u,keyword:d,it: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})),x_=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:S}=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 "${S}"`;(0,r.checkStrictMode)(v,b,z.strictTuples)}}}e.validateTuple=s,e.default=n})),v0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=x_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),b0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=mt(),n=O_(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{schema:c,parentSchema:a,it:u}=i,{prefixItems:d}=a;u.items=!0,!(0,r.alwaysValidSchema)(u,c)&&(d?(0,n.validateAdditionalItems)(i,d):i.ok((0,o.validateArray)(i)))}};e.default=s})),z0=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 S=(0,t._)`${m} >= ${d}`;p!==void 0&&(S=(0,t._)`${S} && ${m} <= ${p}`),n.pass(S);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 S=s.name("_valid"),R=s.let("count",0);f(S,()=>s.if(S,()=>z(R)))}function f(S,R){s.forRange("i",0,m,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:r.Type.Num,compositeRule:!0},S),R()})}function z(S){s.code((0,t._)`${S}++`),p===void 0?s.if((0,t._)`${S} >= ${d}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${S} > ${p}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if((0,t._)`${S} >= ${d}`,()=>s.assign(_,!0)))}}};e.default=o})),ad=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},
65
+ || ${N} === "boolean" || ${y} === null`).assign(V,(0,n._)`[${y}]`)}}}function v({gen:S,parentData:R,parentDataProperty:w},b){S.if((0,n._)`${R} !== undefined`,()=>S.assign((0,n._)`${R}[${w}]`,b))}function m(S,R,w,b=i.Correct){let y=b===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(S){case"null":return(0,n._)`${R} ${y} 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=N((0,n._)`!(${R} % 1) && !isNaN(${R})`);break;case"number":E=N();break;default:return(0,n._)`typeof ${R} ${y} ${S}`}return b===i.Correct?E:(0,n.not)(E);function N(V=n.nil){return(0,n.and)((0,n._)`typeof ${R} == "number"`,V,w?(0,n._)`isFinite(${R})`:n.nil)}}e.checkDataType=m;function _(S,R,w,b){if(S.length===1)return m(S[0],R,w,b);let y,E=(0,s.toHash)(S);if(E.array&&E.object){let N=(0,n._)`typeof ${R} != "object"`;y=E.null?N:(0,n._)`!${R} || ${N}`,delete E.null,delete E.array,delete E.object}else y=n.nil;E.number&&delete E.integer;for(let N in E)y=(0,n.and)(y,m(N,R,w,b));return y}e.checkDataTypes=_;let h={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:R})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${R}}`};function f(S){let R=z(S);(0,o.reportError)(R,h)}e.reportTypeError=f;function z(S){let{gen:R,data:w,schema:b}=S,y=(0,s.schemaRefOrVal)(S,b,"type");return{gen:R,keyword:"type",data:w,schema:b.type,schemaCode:y,schemaValue:y,parentSchema:b,params:{},it:S}}})),o0=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(S,R){let{gen:w,data:b,it:y}=S;w.if(p(w,b,R,y.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${R}`},!0),S.error()})}e.checkReportMissingProp=s;function i({gen:S,data:R,it:{opts:w}},b,y){return(0,t.or)(...b.map(E=>(0,t.and)(p(S,R,E,w.ownProperties),(0,t._)`${y} = ${E}`)))}e.checkMissingProp=i;function c(S,R){S.setParams({missingProperty:R},!0),S.error()}e.reportMissingProp=c;function a(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(S,R,w){return(0,t._)`${a(S)}.call(${R}, ${w})`}e.isOwnProperty=u;function d(S,R,w,b){let y=(0,t._)`${R}${(0,t.getProperty)(w)} !== undefined`;return b?(0,t._)`${y} && ${u(S,R,w)}`:y}e.propertyInData=d;function p(S,R,w,b){let y=(0,t._)`${R}${(0,t.getProperty)(w)} === undefined`;return b?(0,t.or)(y,(0,t.not)(u(S,R,w))):y}e.noPropertyInData=p;function g(S){return S?Object.keys(S).filter(R=>R!=="__proto__"):[]}e.allSchemaProperties=g;function v(S,R){return g(R).filter(w=>!(0,r.alwaysValidSchema)(S,R[w]))}e.schemaProperties=v;function m({schemaCode:S,data:R,it:{gen:w,topSchemaRef:b,schemaPath:y,errorPath:E},it:N},V,M,Z){let W=Z?(0,t._)`${S}, ${R}, ${b}${y}`:R,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,N.parentData],[o.default.parentDataProperty,N.parentDataProperty],[o.default.rootData,o.default.rootData]];N.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let fe=(0,t._)`${W}, ${w.object(...G)}`;return M!==t.nil?(0,t._)`${V}.call(${M}, ${fe})`:(0,t._)`${V}(${fe})`}e.callValidateCode=m;let _=(0,t._)`new RegExp`;function h({gen:S,it:{opts:R}},w){let b=R.unicodeRegExp?"u":"",{regExp:y}=R.code,E=y(w,b);return S.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,t._)`${y.code==="new RegExp"?_:(0,n.useFunc)(S,y)}(${w}, ${b})`})}e.usePattern=h;function f(S){let{gen:R,data:w,keyword:b,it:y}=S,E=R.name("valid");if(y.allErrors){let V=R.let("valid",!0);return N(()=>R.assign(V,!1)),V}return R.var(E,!0),N(()=>R.break()),E;function N(V){let M=R.const("len",(0,t._)`${w}.length`);R.forRange("i",0,M,Z=>{S.subschema({keyword:b,dataProp:Z,dataPropType:r.Type.Num},E),R.if((0,t.not)(E),V)})}}e.validateArray=f;function z(S){let{gen:R,schema:w,keyword:b,it:y}=S;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(V=>(0,r.alwaysValidSchema)(y,V))&&!y.opts.unevaluated)return;let E=R.let("valid",!1),N=R.name("_valid");R.block(()=>w.forEach((V,M)=>{let Z=S.subschema({keyword:b,schemaProp:M,compositeRule:!0},N);R.assign(E,(0,t._)`${E} || ${N}`),S.mergeValidEvaluated(Z,N)||R.if((0,t.not)(E))})),S.result(E,()=>S.reset(),()=>S.error(!0))}e.validateUnion=z})),n0=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=ac();function s(v,m){let{gen:_,keyword:h,schema:f,parentSchema:z,it:S}=v,R=m.macro.call(S.self,f,z,S),w=d(_,h,R);S.opts.validateSchema!==!1&&S.self.validateSchema(R,!0);let b=_.name("valid");v.subschema({schema:R,schemaPath:t.nil,errSchemaPath:`${S.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:S,$data:R,it:w}=v;u(w,m);let b=d(h,f,!R&&m.compile?m.compile.call(w.self,z,S,w):m.validate),y=h.let("valid");v.block$data(y,E),v.ok((_=m.valid)!==null&&_!==void 0?_:y);function E(){if(m.errors===!1)M(),m.modifying&&c(v),Z(()=>v.error());else{let W=m.async?N():V();m.modifying&&c(v),Z(()=>a(v,W))}}function N(){let W=h.let("ruleErrs",null);return h.try(()=>M((0,t._)`await `),G=>h.assign(y,!1).if((0,t._)`${G} instanceof ${w.ValidationError}`,()=>h.assign(W,(0,t._)`${G}.errors`),()=>h.throw(G))),W}function V(){let W=(0,t._)`${b}.errors`;return h.assign(W,null),M(t.nil),W}function M(W=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(y,(0,t._)`${W}${(0,o.callValidateCode)(v,b,G,fe)}`,m.modifying)}function Z(W){var G;h.if((0,t.not)((G=m.valid)!==null&&G!==void 0?G:y),W)}}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 S=f.dependencies;if(S?.some(R=>!Object.prototype.hasOwnProperty.call(v,R)))throw new Error(`parent schema must have dependencies of ${z}: ${S.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})),s0=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})),k_=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}})),i0=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")}})),cc=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=k_(),o=i0(),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],S=>f+=a(S)),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:S}=this.opts,R=g(h[z]||f),w={"":R},b=u(S,R,!1),y={},E=new Set;return o(h,{allKeys:!0},(M,Z,W,G)=>{if(G===void 0)return;let fe=b+Z,$e=w[G];typeof M[z]=="string"&&($e=be.call(this,M[z])),Oe.call(this,M.$anchor),Oe.call(this,M.$dynamicAnchor),w[Z]=$e;function be(he){let C=this.opts.uriResolver.resolve;if(he=g($e?C($e,he):he),E.has(he))throw V(he);E.add(he);let j=this.refs[he];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?N(M,j.schema,he):he!==g(fe)&&(he[0]==="#"?(N(M,y[he],he),y[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}`)}}}),y;function N(M,Z,W){if(Z!==void 0&&!r(M,Z))throw V(W)}function V(M){return new Error(`reference "${M}" resolves to more than one schema`)}}e.getSchemaRefs=_})),co=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=r0(),r=ic(),o=T_(),n=ic(),s=o0(),i=n0(),c=s0(),a=le(),u=pt(),d=cc(),p=_e(),g=ac();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:se,opts:ie},de){ie.code.es5?T.func(A,(0,a._)`${u.default.data}, ${u.default.valCxt}`,se.$async,()=>{T.code((0,a._)`"use strict"; ${S(D,ie)}`),h(T,ie),T.code(de)}):T.func(A,(0,a._)`${u.default.data}, ${_(ie)}`,se.$async,()=>T.code(S(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:se}=T;m(T,()=>{D.$comment&&A.$comment&&G(T),M(T),se.let(u.default.vErrors,null),se.let(u.default.errors,0),D.unevaluated&&z(T),N(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 S(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))){y(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 y(T,A){let{schema:D,gen:se,opts:ie}=T;ie.$comment&&D.$comment&&G(T),Z(T),W(T);let de=se.const("_errs",u.default.errors);N(T,de),se.var(A,(0,a._)`${de} === ${u.default.errors}`)}function E(T){(0,p.checkUnknownRules)(T),V(T)}function N(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 V(T){let{schema:A,errSchemaPath:D,opts:se,self:ie}=T;A.$ref&&se.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 W(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:se,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 Ce=(0,a.str)`${se}/$comment`,Ne=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${Ce}, ${Ne}.schema)`)}}function fe(T){let{gen:A,schemaEnv:D,validateName:se,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._)`${se}.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:se}){D instanceof a.Name&&T.assign((0,a._)`${A}.props`,D),se instanceof a.Name&&T.assign((0,a._)`${A}.items`,se)}function be(T,A,D,se){let{gen:ie,schema:de,data:Ce,allErrors:Ne,opts:Ze,self:xe}=T,{RULES:we}=xe;if(de.$ref&&(Ze.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(de,we))){ie.block(()=>pe(T,"$ref",we.all.$ref.definition));return}Ze.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,Ce,Ze.strictNumbers)),Oe(T,Ae),A.length===1&&A[0]===Ae.type&&D&&(ie.else(),(0,n.reportTypeError)(T)),ie.endIf()):Oe(T,Ae),Ne||ie.if((0,a._)`${u.default.errors} === ${se||0}`))}}function Oe(T,A){let{gen:D,schema:se,opts:{useDefaults:ie}}=T;ie&&(0,s.assignDefaults)(T,A.type),D.block(()=>{for(let de of A.rules)(0,o.shouldUseRule)(se,de)&&pe(T,de.keyword,de.definition,A.type)})}function he(T,A){T.schemaEnv.meta||!T.opts.strictTypes||(C(T,A),T.opts.allowUnionTypes||j(T,A),F(T,T.dataTypes))}function C(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(D=>{k(T.dataTypes,D)||J(T,`type "${D}" not allowed by context "${T.dataTypes.join(",")}"`)}),x(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 F(T,A){let D=T.self.RULES.all;for(let se in D){let ie=D[se];if(typeof ie=="object"&&(0,o.shouldUseRule)(T.schema,ie)){let{type:de}=ie.definition;de.length&&!de.some(Ce=>$(A,Ce))&&J(T,`missing type "${de.join(",")}" for keyword "${se}"`)}}}function $(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function k(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function x(T,A){let D=[];for(let se of T.dataTypes)k(A,se)?D.push(se):A.includes("integer")&&se==="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",Je(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:se,schemaType:ie,def:de}=this;D.if((0,a.or)((0,a._)`${se} === 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:se,it:ie}=this;return(0,a.or)(de(),Ce());function de(){if(D.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");let Ne=Array.isArray(D)?D:[D];return(0,a._)`${(0,n.checkDataTypes)(Ne,A,ie.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Ce(){if(se.validateSchema){let Ne=T.scopeValue("validate$data",{ref:se.validateSchema});return(0,a._)`!${Ne}(${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 se={...this.it,...D,items:void 0,props:void 0};return R(se,A),se}mergeEvaluated(T,A){let{it:D,gen:se}=this;D.opts.unevaluated&&(D.props!==!0&&T.props!==void 0&&(D.props=p.mergeEvaluated.props(se,T.props,D.props,A)),D.items!==!0&&T.items!==void 0&&(D.items=p.mergeEvaluated.items(se,T.items,D.items,A)))}mergeValidEvaluated(T,A){let{it:D,gen:se}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return se.if(A,()=>this.mergeEvaluated(T,a.Name)),!0}};e.KeywordCxt=ee;function pe(T,A,D,se){let ie=new ee(T,D,A);"code"in D?D.code(ie,se):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 Je(T,{dataLevel:A,dataNames:D,dataPathArr:se}){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 xe=ze.exec(T);if(!xe)throw new Error(`Invalid JSON-pointer: ${T}`);let we=+xe[1];if(ie=xe[2],ie==="#"){if(we>=A)throw new Error(Ze("property/index",we));return se[A-we]}if(we>A)throw new Error(Ze("data",we));if(de=D[A-we],!ie)return de}let Ce=de,Ne=ie.split("/");for(let xe of Ne)xe&&(de=(0,a._)`${de}${(0,a.getProperty)((0,p.unescapeJsonPointer)(xe))}`,Ce=(0,a._)`${Ce} && ${de}`);return Ce;function Ze(xe,we){return`Cannot access ${xe} ${we} levels up, current level is ${A}`}}e.getData=Je})),Jn=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})),uo=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cc();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})),uc=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Jn(),o=pt(),n=cc(),s=_e(),i=co();var c=class{constructor(f){var z;this.refs={},this.dynamicAnchors={};let S;typeof f.schema=="object"&&(S=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)(S?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=S?.$async,this.refs={}}};e.SchemaEnv=c;function a(f){let z=p.call(this,f);if(z)return z;let S=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:R,lines:w}=this.opts.code,{ownProperties:b}=this.opts,y=new t.CodeGen(this.scope,{es5:R,lines:w,ownProperties:b}),E;f.$async&&(E=y.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let N=y.scopeName("validate");f.validateName=N;let V={gen:y,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:y.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:N,ValidationError:E,schema:f.schema,schemaEnv:f,rootId:S,baseId:f.baseId||S,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)(V),y.optimize(this.opts.code.optimize);let Z=y.toString();M=`${y.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process&&(M=this.opts.code.process(M,f));let W=new Function(`${o.default.self}`,`${o.default.scope}`,M)(this,this.scope.get());if(this.scope.value(N,{ref:W}),W.errors=null,W.schema=f.schema,W.schemaEnv=f,f.$async&&(W.$async=!0),this.opts.code.source===!0&&(W.source={validateName:N,validateCode:Z,scopeValues:y._values}),this.opts.unevaluated){let{props:G,items:fe}=V;W.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},W.source&&(W.source.evaluated=(0,t.stringify)(W.evaluated))}return f.validate=W,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,S){var R;S=(0,n.resolveUrl)(this.opts.uriResolver,z,S);let w=f.refs[S];if(w)return w;let b=v.call(this,f,S);if(b===void 0){let y=(R=f.localRefs)===null||R===void 0?void 0:R[S],{schemaId:E}=this.opts;y&&(b=new c({schema:y,schemaId:E,root:f,baseId:z}))}if(b!==void 0)return f.refs[S]=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 S;for(;typeof(S=this.refs[z])=="string";)z=S;return S||this.schemas[z]||m.call(this,f,z)}function m(f,z){let S=this.opts.uriResolver.parse(z),R=(0,n._getFullPath)(this.opts.uriResolver,S),w=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&R===w)return h.call(this,S,f);let b=(0,n.normalizeId)(R),y=this.refs[b]||this.schemas[b];if(typeof y=="string"){let E=m.call(this,f,y);return typeof E?.schema!="object"?void 0:h.call(this,S,E)}if(typeof y?.schema=="object"){if(y.validate||a.call(this,y),b===(0,n.normalizeId)(z)){let{schema:E}=y,{schemaId:N}=this.opts,V=E[N];return V&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,V)),new c({schema:E,schemaId:N,root:f,baseId:w})}return h.call(this,S,y)}}e.resolveSchema=m;let _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(f,{baseId:z,schema:S,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 S=="boolean")return;let N=S[(0,s.unescapeFragment)(E)];if(N===void 0)return;S=N;let V=typeof S=="object"&&S[this.opts.schemaId];!_.has(E)&&V&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,V))}let b;if(typeof S!="boolean"&&S.$ref&&!(0,s.schemaHasRulesButRef)(S,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,z,S.$ref);b=m.call(this,R,E)}let{schemaId:y}=this.opts;if(b=b||new c({schema:S,schemaId:y,root:R,baseId:z}),b.schema!==b.root.schema)return b}})),a0=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(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=[],S=!1,R=!1,w=c;for(let b=0;b<m.length;b++){let y=m[b];if(!(y==="["||y==="]"))if(y===":"){if(S===!0&&(R=!0),!w(z,f,h))break;if(++_>7){h.error=!0;break}b>0&&m[b-1]===":"&&(S=!0),f.push(":");continue}else if(y==="%"){if(!w(z,f,h))break;w=i}else{z.push(y);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}})),c0=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(y){return n.indexOf(y)!==-1}function i(y){return y.secure===!0?!0:y.secure===!1?!1:y.scheme?y.scheme.length===3&&(y.scheme[0]==="w"||y.scheme[0]==="W")&&(y.scheme[1]==="s"||y.scheme[1]==="S")&&(y.scheme[2]==="s"||y.scheme[2]==="S"):!1}function c(y){return y.host||(y.error=y.error||"HTTP URIs must have a host."),y}function a(y){let E=String(y.scheme).toLowerCase()==="https";return(y.port===(E?443:80)||y.port==="")&&(y.port=void 0),y.path||(y.path="/"),y}function u(y){return y.secure=i(y),y.resourceName=(y.path||"/")+(y.query?"?"+y.query:""),y.path=void 0,y.query=void 0,y}function d(y){if((y.port===(i(y)?443:80)||y.port==="")&&(y.port=void 0),typeof y.secure=="boolean"&&(y.scheme=y.secure?"wss":"ws",y.secure=void 0),y.resourceName){let[E,N]=y.resourceName.split("?");y.path=E&&E!=="/"?E:void 0,y.query=N,y.resourceName=void 0}return y.fragment=void 0,y}function p(y,E){if(!y.path)return y.error="URN can not be parsed",y;let N=y.path.match(o);if(N){let V=E.scheme||y.scheme||"urn";y.nid=N[1].toLowerCase(),y.nss=N[2];let M=b(`${V}:${E.nid||y.nid}`);y.path=void 0,M&&(y=M.parse(y,E))}else y.error=y.error||"URN can not be parsed.";return y}function g(y,E){if(y.nid===void 0)throw new Error("URN without nid cannot be serialized");let N=E.scheme||y.scheme||"urn",V=y.nid.toLowerCase(),M=b(`${N}:${E.nid||V}`);M&&(y=M.serialize(y,E));let Z=y,W=y.nss;return Z.path=`${V||E.nid}:${W}`,E.skipEscape=!0,Z}function v(y,E){let N=y;return N.uuid=N.nss,N.nss=void 0,!E.tolerant&&(!N.uuid||!r(N.uuid))&&(N.error=N.error||"UUID is not valid."),N}function m(y){let E=y;return E.nss=(y.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(y){return y&&(w[y]||w[y.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:b}})),u0=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=C_(),{SCHEMES:a,getSchemeHandler:u}=c0();function d(z,S){return typeof z=="string"?z=m(h(z,S),S):typeof z=="object"&&(z=h(m(z,S),S)),z}function p(z,S,R){let w=R?Object.assign({scheme:"null"},R):{scheme:"null"},b=g(h(z,w),h(S,w),w,!0);return w.skipEscape=!0,m(b,w)}function g(z,S,R,w){let b={};return w||(z=h(m(z,R),R),S=h(m(S,R),R)),R=R||{},!R.tolerant&&S.scheme?(b.scheme=S.scheme,b.userinfo=S.userinfo,b.host=S.host,b.port=S.port,b.path=o(S.path||""),b.query=S.query):(S.userinfo!==void 0||S.host!==void 0||S.port!==void 0?(b.userinfo=S.userinfo,b.host=S.host,b.port=S.port,b.path=o(S.path||""),b.query=S.query):(S.path?(S.path[0]==="/"?b.path=o(S.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?b.path="/"+S.path:z.path?b.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+S.path:b.path=S.path,b.path=o(b.path)),b.query=S.query):(b.path=z.path,S.query!==void 0?b.query=S.query:b.query=z.query),b.userinfo=z.userinfo,b.host=z.host,b.port=z.port),b.scheme=z.scheme),b.fragment=S.fragment,b}function v(z,S,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 S=="string"?(S=unescape(S),S=m(s(h(S,R),!0),{...R,skipEscape:!0})):typeof S=="object"&&(S=m(s(S,!0),{...R,skipEscape:!0})),z.toLowerCase()===S.toLowerCase()}function m(z,S){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({},S),b=[],y=u(w.scheme||R.scheme);y&&y.serialize&&y.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 N=R.path;!w.absolutePath&&(!y||!y.absolutePath)&&(N=o(N)),E===void 0&&N[0]==="/"&&N[1]==="/"&&(N="/%2F"+N.slice(2)),b.push(N)}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,S){let R=Object.assign({},S),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 y=z.match(_);if(y){if(w.scheme=y[1],w.userinfo=y[3],w.host=y[4],w.port=parseInt(y[5],10),w.path=y[6]||"",w.query=y[7],w.fragment=y[8],isNaN(w.port)&&(w.port=y[5]),w.host)if(i(w.host)===!1){let N=r(w.host);w.host=N.host.toLowerCase(),b=N.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(N){w.error=w.error||"Host's domain name can not be converted to ASCII: "+N}(!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})),l0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=u0();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=co();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=Jn(),n=uo(),s=E_(),i=uc(),c=le(),a=cc(),u=ic(),d=_e(),p=a0(),g=l0(),v=(C,j)=>new RegExp(C,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 S(C){var j,F,$,k,x,J,ee,pe,ae,ze,Je,T,A,D,se,ie,de,Ce,Ne,Ze,xe,we,ot,Ae,ht;let at=C.strict,gt=(j=C.code)===null||j===void 0?void 0:j.optimize,It=gt===!0||gt===void 0?1:gt||0,Ot=($=(F=C.code)===null||F===void 0?void 0:F.regExp)!==null&&$!==void 0?$:v,Xt=(k=C.uriResolver)!==null&&k!==void 0?k:g.default;return{strictSchema:(J=(x=C.strictSchema)!==null&&x!==void 0?x:at)!==null&&J!==void 0?J:!0,strictNumbers:(pe=(ee=C.strictNumbers)!==null&&ee!==void 0?ee:at)!==null&&pe!==void 0?pe:!0,strictTypes:(ze=(ae=C.strictTypes)!==null&&ae!==void 0?ae:at)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Je=C.strictTuples)!==null&&Je!==void 0?Je:at)!==null&&T!==void 0?T:"log",strictRequired:(D=(A=C.strictRequired)!==null&&A!==void 0?A:at)!==null&&D!==void 0?D:!1,code:C.code?{...C.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(se=C.loopRequired)!==null&&se!==void 0?se:z,loopEnum:(ie=C.loopEnum)!==null&&ie!==void 0?ie:z,meta:(de=C.meta)!==null&&de!==void 0?de:!0,messages:(Ce=C.messages)!==null&&Ce!==void 0?Ce:!0,inlineRefs:(Ne=C.inlineRefs)!==null&&Ne!==void 0?Ne:!0,schemaId:(Ze=C.schemaId)!==null&&Ze!==void 0?Ze:"$id",addUsedSchema:(xe=C.addUsedSchema)!==null&&xe!==void 0?xe:!0,validateSchema:(we=C.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(ot=C.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(Ae=C.unicodeRegExp)!==null&&Ae!==void 0?Ae:!0,int32range:(ht=C.int32range)!==null&&ht!==void 0?ht:!0,uriResolver:Xt}}var R=class{constructor(C={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,...S(C)};let{es5:j,lines:F}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:j,lines:F}),this.logger=Z(C.logger);let $=C.validateFormats;C.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,h,C,"NOT SUPPORTED"),w.call(this,f,C,"DEPRECATED","warn"),this._metaOpts=V.call(this),C.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&N.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),y.call(this),C.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:C,meta:j,schemaId:F}=this.opts,$=p;F==="id"&&($={...p},$.id=$.$id,delete $.$id),j&&C&&this.addMetaSchema($,$[F],!1)}defaultMeta(){let{meta:C,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof C=="object"?C[j]||C:void 0}validate(C,j){let F;if(typeof C=="string"){if(F=this.getSchema(C),!F)throw new Error(`no schema with key or ref "${C}"`)}else F=this.compile(C);let $=F(j);return"$async"in F||(this.errors=F.errors),$}compile(C,j){let F=this._addSchema(C,j);return F.validate||this._compileSchemaEnv(F)}compileAsync(C,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:F}=this.opts;return $.call(this,C,j);async function $(ae,ze){await k.call(this,ae.$schema);let Je=this._addSchema(ae,ze);return Je.validate||x.call(this,Je)}async function k(ae){ae&&!this.getSchema(ae)&&await $.call(this,{$ref:ae},!0)}async function x(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),x.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 k.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]=F(ae))}finally{delete this._loading[ae]}}}addSchema(C,j,F,$=this.opts.validateSchema){if(Array.isArray(C)){for(let x of C)this.addSchema(x,void 0,F,$);return this}let k;if(typeof C=="object"){let{schemaId:x}=this.opts;if(k=C[x],k!==void 0&&typeof k!="string")throw new Error(`schema ${x} must be string`)}return j=(0,a.normalizeId)(j||k),this._checkUnique(j),this.schemas[j]=this._addSchema(C,F,j,$,!0),this}addMetaSchema(C,j,F=this.opts.validateSchema){return this.addSchema(C,j,!0,F),this}validateSchema(C,j){if(typeof C=="boolean")return!0;let F;if(F=C.$schema,F!==void 0&&typeof F!="string")throw new Error("$schema must be a string");if(F=F||this.opts.defaultMeta||this.defaultMeta(),!F)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let $=this.validate(F,C);if(!$&&j){let k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return $}getSchema(C){let j;for(;typeof(j=b.call(this,C))=="string";)C=j;if(j===void 0){let{schemaId:F}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:F});if(j=i.resolveSchema.call(this,$,C),!j)return;this.refs[C]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let j=b.call(this,C);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{let j=C;this._cache.delete(j);let F=C[this.opts.schemaId];return F&&(F=(0,a.normalizeId)(F),delete this.schemas[F],delete this.refs[F]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(C){for(let j of C)this.addKeyword(j);return this}addKeyword(C,j){let F;if(typeof C=="string")F=C,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=F);else if(typeof C=="object"&&j===void 0){if(j=C,F=j.keyword,Array.isArray(F)&&!F.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,F,j),!j)return(0,d.eachItem)(F,k=>fe.call(this,k)),this;be.call(this,j);let $={...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(F,$.type.length===0?k=>fe.call(this,k,$):k=>$.type.forEach(x=>fe.call(this,k,$,x))),this}getKeyword(C){let j=this.RULES.all[C];return typeof j=="object"?j.definition:!!j}removeKeyword(C){let{RULES:j}=this;delete j.keywords[C],delete j.all[C];for(let F of j.rules){let $=F.rules.findIndex(k=>k.keyword===C);$>=0&&F.rules.splice($,1)}return this}addFormat(C,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[C]=j,this}errorsText(C=this.errors,{separator:j=", ",dataVar:F="data"}={}){return!C||C.length===0?"No errors":C.map($=>`${F}${$.instancePath} ${$.message}`).reduce(($,k)=>$+j+k)}$dataMetaSchema(C,j){let F=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(let $ of j){let k=$.split("/").slice(1),x=C;for(let J of k)x=x[J];for(let J in F){let ee=F[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ae=x[J];pe&&ae&&(x[J]=he(ae))}}return C}_removeAllSchemas(C,j){for(let F in C){let $=C[F];(!j||j.test(F))&&(typeof $=="string"?delete C[F]:$&&!$.meta&&(this._cache.delete($.schema),delete C[F]))}}_addSchema(C,j,F,$=this.opts.validateSchema,k=this.opts.addUsedSchema){let x,{schemaId:J}=this.opts;if(typeof C=="object")x=C[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(C);if(ee!==void 0)return ee;F=(0,a.normalizeId)(x||F);let pe=a.getSchemaRefs.call(this,C,F);return ee=new i.SchemaEnv({schema:C,schemaId:J,meta:j,baseId:F,localRefs:pe}),this._cache.set(ee.schema,ee),k&&!F.startsWith("#")&&(F&&this._checkUnique(F),this.refs[F]=ee),$&&this.validateSchema(C,!0),ee}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):i.compileSchema.call(this,C),!C.validate)throw new Error("ajv implementation error");return C.validate}_compileMetaSchema(C){let j=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,C)}finally{this.opts=j}}};R.ValidationError=o.default,R.MissingRefError=n.default,e.default=R;function w(C,j,F,$="error"){for(let k in C){let x=k;x in j&&this.logger[$](`${F}: option ${k}. ${C[x]}`)}}function b(C){return C=(0,a.normalizeId)(C),this.schemas[C]||this.refs[C]}function y(){let C=this.opts.schemas;if(C)if(Array.isArray(C))this.addSchema(C);else for(let j in C)this.addSchema(C[j],j)}function E(){for(let C in this.opts.formats){let j=this.opts.formats[C];j&&this.addFormat(C,j)}}function N(C){if(Array.isArray(C)){this.addVocabulary(C);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let j in C){let F=C[j];F.keyword||(F.keyword=j),this.addKeyword(F)}}function V(){let C={...this.opts};for(let j of m)delete C[j];return C}let M={log(){},warn(){},error(){}};function Z(C){if(C===!1)return M;if(C===void 0)return console;if(C.log&&C.warn&&C.error)return C;throw new Error("logger must implement log, warn and error methods")}let W=/^[a-z_$][a-z0-9_$:-]*$/i;function G(C,j){let{RULES:F}=this;if((0,d.eachItem)(C,$=>{if(F.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!W.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(C,j,F){var $;let k=j?.post;if(F&&k)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:x}=this,J=k?x.post:x.rules.find(({type:pe})=>pe===F);if(J||(J={type:F,rules:[]},x.rules.push(J)),x.keywords[C]=!0,!j)return;let ee={keyword:C,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),x.all[C]=ee,($=j.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(C,j,F){let $=C.rules.findIndex(k=>k.keyword===F);$>=0?C.rules.splice($,0,j):(C.rules.push(j),this.logger.warn(`rule ${F} is not defined`))}function be(C){let{metaSchema:j}=C;j!==void 0&&(C.$data&&this.opts.$data&&(j=he(j)),C.validateSchema=this.compile(j,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(C){return{anyOf:[C,Oe]}}})),d0=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=uo(),r=mt(),o=le(),n=pt(),s=uc(),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:S}=_;if((g==="#"||g==="#/")&&m===S.baseId)return w();let R=s.resolveRef.call(z,S,m,g);if(R===void 0)throw new t.default(v.opts.uriResolver,m,g);if(R instanceof s.SchemaEnv)return b(R);return y(R);function w(){if(_===S)return u(d,h,_,_.$async);let E=p.scopeValue("root",{ref:S});return u(d,(0,o._)`${E}.validate`,S,S.$async)}function b(E){u(d,a(d,E),E,E.$async)}function y(E){let N=p.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),V=p.name("valid"),M=d.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:N,errSchemaPath:g},V);d.mergeEvaluated(M),d.ok(V)}}};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}=_,S=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,S)}`),y(p),h||m.assign(E,!0)},N=>{m.if((0,o._)`!(${N} instanceof ${_.ValidationError})`,()=>m.throw(N)),b(N),h||m.assign(E,!1)}),d.ok(E)}function w(){d.result((0,r.callValidateCode)(d,p,S),()=>y(p),()=>b(p))}function b(E){let N=(0,o._)`${E}.errors`;m.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),m.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function y(E){var N;if(!_.opts.unevaluated)return;let V=(N=g?.validate)===null||N===void 0?void 0:N.evaluated;if(_.props!==!0)if(V&&!V.dynamicProps)V.props!==void 0&&(_.props=i.mergeEvaluated.props(m,V.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(V&&!V.dynamicItems)V.items!==void 0&&(_.items=i.mergeEvaluated.items(m,V.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})),I_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d0(),r=nd(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),p0=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})),m0=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})),f0=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'})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=f0(),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})),g0=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})),_0=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})),S0=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:S}=s.it;for(let R of c)if(z?.[R]===void 0&&!S.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 S=i.let("valid",!0);s.block$data(S,()=>f(z,S)),s.ok(S)}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,S){s.setParams({missingProperty:z}),i.forOf(z,a,()=>{i.assign(S,(0,t.propertyInData)(i,u,z,g.ownProperties)),i.if((0,r.not)(S),()=>{s.error(),i.break()})},r.nil)}}};e.default=n})),y0=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=k_();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),v0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ic(),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:S)(R,w))}function f(){return _.length>0&&!_.some(R=>R==="object"||R==="array")}function z(R,w){let b=c.name("item"),y=(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(y,(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 S(R,w){let b=(0,o.useFunc)(c,n.default),y=c.name("outer");c.label(y).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(y)})))}}};e.default=s})),b0=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})),z0=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((S,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,S){let R=u[S];return typeof R=="object"&&R!==null?(0,t._)`${m()}(${c}, ${z}[${S}])`:(0,t._)`${c} === ${R}`}}};e.default=n})),O_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p0(),r=m0(),o=h0(),n=g0(),s=_0(),i=S0(),c=y0(),a=v0(),u=b0(),d=z0(),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})),x_=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})),N_=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:S}=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 "${S}"`;(0,r.checkStrictMode)(v,b,z.strictTuples)}}}e.validateTuple=s,e.default=n})),R0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=N_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),$0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=mt(),n=x_(),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})),w0=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 S=(0,t._)`${m} >= ${d}`;p!==void 0&&(S=(0,t._)`${S} && ${m} <= ${p}`),n.pass(S);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 S=s.name("_valid"),R=s.let("count",0);f(S,()=>s.if(S,()=>z(R)))}function f(S,R){s.forRange("i",0,m,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:r.Type.Num,compositeRule:!0},S),R()})}function z(S){s.code((0,t._)`${S}++`),p===void 0?s.if((0,t._)`${S} >= ${d}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${S} > ${p}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if((0,t._)`${S} >= ${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
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 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})),R0=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})),N_=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 y;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");y=(0,t.isOwnProperty)(c,E,b)}else _.length?y=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):y=r.nil;return h.length&&(y=(0,r.or)(y,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(y)}function S(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(m.removeAdditional==="all"||m.removeAdditional&&a===!1){S(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 y=c.name("valid");m.removeAdditional==="failing"?(w(b,y,!1),c.if((0,r.not)(y),()=>{i.reset(),S(b)})):(w(b,y),v||c.if((0,r.not)(y),()=>c.break()))}}function w(b,y,E){let N={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(N,y)}}};e.default=s})),$0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=co(),r=mt(),o=_e(),n=N_(),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})),w0=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)_&&S(w),p.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function S(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 y=m.includes(w);y||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):!y&&!p.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),P0=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})),E0=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})),T0=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})),C0=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})),k0=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})),I0=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})),j_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=O_(),r=v0(),o=x_(),n=b0(),s=z0(),i=ad(),c=R0(),a=N_(),u=$0(),d=w0(),p=P0(),g=E0(),v=T0(),m=C0(),_=k0(),h=I0();function f(z=!1){let S=[p.default,g.default,v.default,m.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?S.push(r.default,n.default):S.push(t.default,o.default),S.push(s.default),S}e.default=f})),O0=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}]`),S=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(S,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(S,(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 y=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${y} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${S} === ${n} && !${E}`}}function h(){let f=m.formats[a];if(!f){w();return}if(f===!0)return;let[z,S,R]=b(f);z===n&&o.pass(y());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 N=E instanceof RegExp?(0,t.regexpCode)(E):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(a)}`:void 0,V=s.scopeValue("formats",{key:a,ref:E,code:N});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${V}.validate`]:["string",E,V]}function y(){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 S=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),A_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[O0().default];e.default=t})),q_=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"]})),M_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=k_(),r=I_(),o=j_(),n=A_(),s=q_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),x0=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={}))})),cd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=x0(),o=uc(),n=uo(),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=S();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 S(){var R;let w={},b=E(p),y=!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 W=(R=Z?.properties)===null||R===void 0?void 0:R[m];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${m}"`);y=y&&(b||E(Z)),N(W,M)}if(!y)throw new Error(`discriminator: "${m}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(m)}function N(M,Z){if(M.const)V(M.const,Z);else if(M.enum)for(let W of M.enum)V(W,Z);else throw new Error(`discriminator: "properties/${m}" must have "const" or "enum"`)}function V(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})),N0=U(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),L_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=nd(),o=M_(),n=cd(),s=N0(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var g=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),D_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=pt(),o=uc(),n=sd(),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})),Z_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=pt(),o=sd(),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})),j0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=D_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),A0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),U_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=D_(),r=Z_(),o=j0(),n=A0(),s=[t.default,r.default,o.default,n.default];e.default=s})),q0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ad(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),M0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ad(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),L0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),F_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=q0(),r=M0(),o=L0(),n=[t.default,r.default,o.default];e.default=n})),D0=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 S in h)h[S]===!0&&z.push((0,t._)`${f} !== ${S}`);return(0,t.and)(...z)}}};e.default=n})),Z0=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})),V_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=D0(),r=Z0(),o=[t.default,r.default];e.default=o})),U0=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"}]}}}}})),F0=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:"#"}}}})),H0=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:{}}}}})),J0=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"}}}})),B0=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}}}})),K0=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:[]}}}})),G0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U0(),r=F0(),o=V0(),n=H0(),s=J0(),i=B0(),c=K0(),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})),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.Ajv2019=void 0;let r=nd(),o=M_(),n=U_(),s=F_(),i=V_(),c=cd(),a=G0(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var m=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),Y0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=k_(),r=I_(),o=j_(),n=U_(),s=F_(),i=V_(),c=A_(),a=q_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),X0=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}}}})),Q0=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"}}}}})),eR=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"}}}})),tR=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"}}}})),rR=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"}}}})),oR=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"}}}})),nR=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}}}})),sR=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:[]}}}})),iR=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=X0(),r=Q0(),o=eR(),n=tR(),s=rR(),i=oR(),c=nR(),a=sR(),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})),aR=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=nd(),o=Y0(),n=cd(),s=iR(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),cR=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:V,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:S,int32:{type:"number",validate:b},int64:{type:"number",validate:y},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 W=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(W)?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(W){let G=c.exec(W);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 F=$e-j*he,$=fe-k*he-(F<0?1:0);return($===23||$===-1)&&(F===59||F===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let W=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(W&&G)return W-G}function d(M,Z){if(!(M&&Z))return;let W=c.exec(M),G=c.exec(Z);if(W&&G)return M=W[1]+W[2]+W[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 W=new Date(M).valueOf(),G=new Date(Z).valueOf();if(W&&G)return W-G}function m(M,Z){if(!(M&&Z))return;let[W,G]=M.split(p),[fe,$e]=Z.split(p),be=i(W,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 S(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 y(M){return Number.isInteger(M)}function E(){return!0}let N=/[^\\]\\Z/;function V(M){if(N.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),uR=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=L_(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword: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 S=a.scopeValue("formats",{ref:m.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${S}[${_.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 S=_.schema,R=m.formats[S];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${p}": format "${S}" does not define "compare" function`);let w=a.scopeValue("formats",{key:S,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(S)}`:void 0});c.fail$data(z(w))}function z(S){return(0,r._)`${S}.compare(${u}, ${d}) ${n[p].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),lR=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=cR(),o=uR(),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})),H_=L_(),dR=W0(),pR=aR(),mR=gs(lR(),1),fR=mR.default;function od(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return fR(t),t}var lc=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=od(pR.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=rp(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??=od(dR.Ajv2019):this._ajvDraft7??=od(H_.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=H_.Ajv;import ud from"node:process";var Q_=Symbol.for("mcp.completable");function dd(e){return!!e&&typeof e=="object"&&Q_ in e}function _R(e){return e[Q_]?.complete}var AE=2**31-1;function SR(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var yR=8,vR=6e5;function bR(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??yR,roundTimeoutMs:e?.roundTimeoutMs??vR,legacyShim:e?.legacyShim??!0}}function eS(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new ne(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=Gg(o);if(n===void 0)throw new ne(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 zR(){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 ld(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ne(B.InternalError,t)}var RR=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 ld(e,g_(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 ne(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[S,R]of Object.entries(d)){let{embedded:w,required:b}=eS(e,S,R);if(w.method!=="roots/list"&&w.params===void 0)throw new ne(B.InternalError,`Handler for ${e} returned an input request '${S}' of kind '${w.method}' without params`);if(Xa(b,h)!==void 0)return ld(e,`Cannot request input '${S}' (${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([S,w])}let z=S_(c);try{let S={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,S)]}catch(y){throw z.abort(y),y}}));v=Object.fromEntries(R)}catch(S){if(c.aborted)throw S;return ld(e,`Fulfilling input required by '${e}' failed: ${S instanceof Error?S.message:String(S)}`)}finally{z.dispose()}}else await __(h_,c);let m={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:Hn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,m,e);h!==void 0&&(m=Yl(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:zR()}),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)}}},$R=new Set(["tools/call","prompts/get","resources/read"]),wR,PR,ER;var tS=class extends Xl{_clientCapabilities;_clientVersion;static{wR=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},PR=(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())},ER=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new RR({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 lc,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=bR(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Dl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Nl(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=rc(Kt,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?.[Ut],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(Kt.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=Ql(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=$R.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(kt(i))throw new ne(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 ne(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:Qa(i,r)}}return async(r,o)=>{let n=io(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ne(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=jl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new ne(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&&Un(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 ne(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=Yl(o,p))}let c;try{c=await t(r,i)}catch(p){throw p instanceof ne&&p.code===B.UrlElicitationRequired&&n?new ne(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 ne(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 ne(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:_}=eS(e,g,v),h=Xa(_,p);if(h!==void 0)throw new tc({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 ne(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=Wg(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:Nl(this._supportedProtocolVersions),capabilities:TR(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 ne(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new ne(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 ne(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 ne(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof ne?c:new ne(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 TR(e){return{...e}}function CR(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 kR(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 dc=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 B_;try{let r=Sr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new tS(e,t),this._maxToolInputElements=kR(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return SR(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?IR(e,t.inputSchema):B_,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 ne(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ne(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 ne&&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&&CR(t,this._maxToolInputElements)>this._maxToolInputElements)throw new ne(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 ne(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 ne(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 ne(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 Bl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Kl(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ne(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 ne(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ne(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Bn;let o=X_(Y_(r.argsSchema)?.[e.params.argument.name]);if(!dd(o))return Bn;let n=_R(o);return n?W_(await n(e.params.argument.value,e.params.context)):Bn}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 Bn;throw new ne(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?W_(await o(e.params.argument.value,e.params.context)):Bn}_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 ne(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 ne(B.InvalidParams,`Resource ${r} disabled`);return Qa(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 ne(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Qa(await n.readCallback(r,s,t),n.cacheHint)}}throw new ec(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?f_(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 ne(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ne(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&&Dl(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:G_(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=G_(e,a,u)),p.enabled!==void 0&&(d.enabled=p.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let p=Y_(o);p&&Object.values(p).some(g=>dd(X_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){rd(e);let p=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=K_(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"&&rd(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=K_(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,oc(s),oc(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,oc(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 B_={type:"object",properties:{}};function IR(e,t){let r=Sr(t,"input"),o=Gl(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 K_(e){if(e!==void 0)try{return Sr(e,"output")}catch{return}}function G_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await _r(t,n??{});if(!i.success)throw new ne(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 W_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Bn={completion:{values:[],hasMore:!1}};function Y_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function OR(e){return e?.type==="optional"}function X_(e){return OR(e)?e.def?.innerType??e:e}var CT=4*1024*1024;var rS=Symbol("swallowsErrorsAfterClose"),oS=class{_readBuffer;_started=!1;_closed=!1;constructor(e=ud.stdin,t=ud.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new ed({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[rS]&&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[rS]=!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=td(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{Transform as DR}from"node:stream";import{StringDecoder as ZR}from"node:string_decoder";function UR(e){let t;try{t=JSON.parse(e)}catch{return nS(null,B.ParseError,"Parse error")}if(Fn(t)||Vn(t)||Jl(t))return null;let r=t?.id;return nS(typeof r=="string"||typeof r=="number"?r:null,B.InvalidRequest,"Invalid Request")}function nS(e,t,r){return`${JSON.stringify({jsonrpc:"2.0",id:e,error:{code:t,message:r}})}
69
- `}function sS(e){let t=new ZR("utf8"),r="",o=(n,s)=>{if(n.trim()==="")return;let i=UR(n);i===null?s(`${n}
70
- `):e(i)};return new DR({transform(n,s,i){r+=typeof n=="string"?n:t.write(n);let c=r.indexOf(`
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})),P0=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})),j_=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 y;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");y=(0,t.isOwnProperty)(c,E,b)}else _.length?y=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):y=r.nil;return h.length&&(y=(0,r.or)(y,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(y)}function S(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(m.removeAdditional==="all"||m.removeAdditional&&a===!1){S(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 y=c.name("valid");m.removeAdditional==="failing"?(w(b,y,!1),c.if((0,r.not)(y),()=>{i.reset(),S(b)})):(w(b,y),v||c.if((0,r.not)(y),()=>c.break()))}}function w(b,y,E){let N={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(N,y)}}};e.default=s})),E0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=co(),r=mt(),o=_e(),n=j_(),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)_&&S(w),p.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function S(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 y=m.includes(w);y||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):!y&&!p.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),k0=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})),C0=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})),I0=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})),O0=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})),x0=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})),N0=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})),A_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=x_(),r=R0(),o=N_(),n=$0(),s=w0(),i=id(),c=P0(),a=j_(),u=E0(),d=T0(),p=k0(),g=C0(),v=I0(),m=O0(),_=x0(),h=N0();function f(z=!1){let S=[p.default,g.default,v.default,m.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?S.push(r.default,n.default):S.push(t.default,o.default),S.push(s.default),S}e.default=f})),j0=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}]`),S=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(S,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(S,(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 y=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${y} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${S} === ${n} && !${E}`}}function h(){let f=m.formats[a];if(!f){w();return}if(f===!0)return;let[z,S,R]=b(f);z===n&&o.pass(y());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 N=E instanceof RegExp?(0,t.regexpCode)(E):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(a)}`:void 0,V=s.scopeValue("formats",{key:a,ref:E,code:N});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${V}.validate`]:["string",E,V]}function y(){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 S=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),q_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[j0().default];e.default=t})),M_=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"]})),L_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=I_(),r=O_(),o=A_(),n=q_(),s=M_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),A0=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=A0(),o=uc(),n=uo(),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=S();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 S(){var R;let w={},b=E(p),y=!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 W=(R=Z?.properties)===null||R===void 0?void 0:R[m];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${m}"`);y=y&&(b||E(Z)),N(W,M)}if(!y)throw new Error(`discriminator: "${m}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(m)}function N(M,Z){if(M.const)V(M.const,Z);else if(M.enum)for(let W of M.enum)V(W,Z);else throw new Error(`discriminator: "properties/${m}" must have "const" or "enum"`)}function V(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})),q0=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}})),D_=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=L_(),n=ad(),s=q0(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var g=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),Z_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=pt(),o=uc(),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})),U_=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})),M0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z_(),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})),L0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),F_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z_(),r=U_(),o=M0(),n=L0(),s=[t.default,r.default,o.default,n.default];e.default=s})),D0=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})),Z0=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})),U0=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})),V_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=D0(),r=Z0(),o=U0(),n=[t.default,r.default,o.default];e.default=n})),F0=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 S in h)h[S]===!0&&z.push((0,t._)`${f} !== ${S}`);return(0,t.and)(...z)}}};e.default=n})),V0=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})),H_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=F0(),r=V0(),o=[t.default,r.default];e.default=o})),H0=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"}]}}}}})),J0=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:"#"}}}}})),B0=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:"#"}}}})),K0=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:{}}}}})),G0=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"}}}})),W0=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}}}})),Y0=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:[]}}}})),X0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=H0(),r=J0(),o=B0(),n=K0(),s=G0(),i=W0(),c=Y0(),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})),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.Ajv2019=void 0;let r=od(),o=L_(),n=F_(),s=V_(),i=H_(),c=ad(),a=X0(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var m=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),eR=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=I_(),r=O_(),o=A_(),n=F_(),s=V_(),i=H_(),c=q_(),a=M_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),tR=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}}}})),rR=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"}}}}})),oR=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"}}}})),nR=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"}}}})),sR=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"}}}})),iR=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"}}}})),aR=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}}}})),cR=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:[]}}}})),uR=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tR(),r=rR(),o=oR(),n=nR(),s=sR(),i=iR(),c=aR(),a=cR(),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})),lR=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=eR(),n=ad(),s=uR(),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=co();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=Jn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=uo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),dR=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:V,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:S,int32:{type:"number",validate:b},int64:{type:"number",validate:y},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 W=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(W)?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(W){let G=c.exec(W);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),j=+(G[7]||0);if(C>23||j>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let F=$e-j*he,$=fe-C*he-(F<0?1:0);return($===23||$===-1)&&(F===59||F===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let W=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(W&&G)return W-G}function d(M,Z){if(!(M&&Z))return;let W=c.exec(M),G=c.exec(Z);if(W&&G)return M=W[1]+W[2]+W[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 W=new Date(M).valueOf(),G=new Date(Z).valueOf();if(W&&G)return W-G}function m(M,Z){if(!(M&&Z))return;let[W,G]=M.split(p),[fe,$e]=Z.split(p),be=i(W,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 S(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 y(M){return Number.isInteger(M)}function E(){return!0}let N=/[^\\]\\Z/;function V(M){if(N.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),pR=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=D_(),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 S=a.scopeValue("formats",{ref:m.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${S}[${_.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 S=_.schema,R=m.formats[S];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${p}": format "${S}" does not define "compare" function`);let w=a.scopeValue("formats",{key:S,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(S)}`:void 0});c.fail$data(z(w))}function z(S){return(0,r._)`${S}.compare(${u}, ${d}) ${n[p].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),mR=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=dR(),o=pR(),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})),J_=D_(),fR=Q0(),hR=lR(),gR=gs(mR(),1),_R=gR.default;function rd(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return _R(t),t}var lc=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=rd(hR.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=op(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(fR.Ajv2019):this._ajvDraft7??=rd(J_.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)}}},BP=J_.Ajv;import cd from"node:process";var eS=Symbol.for("mcp.completable");function ld(e){return!!e&&typeof e=="object"&&eS in e}function vR(e){return e[eS]?.complete}var ME=2**31-1;function bR(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var zR=8,RR=6e5;function $R(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??zR,roundTimeoutMs:e?.roundTimeoutMs??RR,legacyShim:e?.legacyShim??!0}}function tS(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new ne(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=Wg(o);if(n===void 0)throw new ne(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 wR(){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 ne(B.InternalError,t)}var PR=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,__(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 ne(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[S,R]of Object.entries(d)){let{embedded:w,required:b}=tS(e,S,R);if(w.method!=="roots/list"&&w.params===void 0)throw new ne(B.InternalError,`Handler for ${e} returned an input request '${S}' of kind '${w.method}' without params`);if(Xa(b,h)!==void 0)return ud(e,`Cannot request input '${S}' (${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([S,w])}let z=y_(c);try{let S={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,S)]}catch(y){throw z.abort(y),y}}));v=Object.fromEntries(R)}catch(S){if(c.aborted)throw S;return ud(e,`Fulfilling input required by '${e}' failed: ${S instanceof Error?S.message:String(S)}`)}finally{z.dispose()}}else await S_(g_,c);let m={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:Hn(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(!Ct(_))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:wR()}),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,kR,CR;var rS=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)},kR=(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())},CR=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new PR({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 lc,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=$R(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Ll(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),xl(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=rc(Kt,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?.[Ut],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(Kt.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(Ct(i))throw new ne(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(Ct(i)){if(!o)throw new ne(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:Qa(i,r)}}return async(r,o)=>{let n=io(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ne(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(Ct(i))return i;let c=Nl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new ne(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&&Un(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 ne(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 ne&&p.code===B.UrlElicitationRequired&&n?new ne(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(!Ct(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new ne(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 ne(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:_}=tS(e,g,v),h=Xa(_,p);if(h!==void 0)throw new tc({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 ne(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=Yg(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:xl(this._supportedProtocolVersions),capabilities:IR(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 ne(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new ne(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 ne(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 ne(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof ne?c:new ne(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 IR(e){return{...e}}function OR(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 xR(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 dc=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 K_;try{let r=Sr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new rS(e,t),this._maxToolInputElements=xR(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return bR(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?NR(e,t.inputSchema):K_,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 ne(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ne(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),Ct(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof ne&&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&&OR(t,this._maxToolInputElements)>this._maxToolInputElements)throw new ne(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 ne(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Ct(t)||t.isError)return;if(t.structuredContent===void 0)throw new ne(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 ne(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 ne(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 ne(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ne(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Bn;let o=Q_(X_(r.argsSchema)?.[e.params.argument.name]);if(!ld(o))return Bn;let n=vR(o);return n?Y_(await n(e.params.argument.value,e.params.context)):Bn}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 Bn;throw new ne(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?Y_(await o(e.params.argument.value,e.params.context)):Bn}_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 ne(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 ne(B.InvalidParams,`Resource ${r} disabled`);return Qa(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 ne(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Qa(await n.readCallback(r,s,t),n.cacheHint)}}throw new ec(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?h_(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 ne(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ne(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&&Ll(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:W_(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=W_(e,a,u)),p.enabled!==void 0&&(d.enabled=p.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let p=X_(o);p&&Object.values(p).some(g=>ld(Q_(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??=G_(v.outputSchema)},set outputSchemaJson(m){g=m},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:B_(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=B_(v.inputSchema,p)),m.outputSchema!==void 0&&(v.outputSchema=m.outputSchema,v.outputSchemaJson=G_(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,oc(s),oc(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,oc(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 B_(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var K_={type:"object",properties:{}};function NR(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 G_(e){if(e!==void 0)try{return Sr(e,"output")}catch{return}}function W_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await _r(t,n??{});if(!i.success)throw new ne(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 Y_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Bn={completion:{values:[],hasMore:!1}};function X_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function jR(e){return e?.type==="optional"}function Q_(e){return jR(e)?e.def?.innerType??e:e}var IT=4*1024*1024;var oS=Symbol("swallowsErrorsAfterClose"),nS=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[oS]&&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[oS]=!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{Transform as FR}from"node:stream";import{StringDecoder as VR}from"node:string_decoder";function HR(e){let t;try{t=JSON.parse(e)}catch{return sS(null,B.ParseError,"Parse error")}if(Fn(t)||Vn(t)||Hl(t))return null;let r=t?.id;return sS(typeof r=="string"||typeof r=="number"?r:null,B.InvalidRequest,"Invalid Request")}function sS(e,t,r){return`${JSON.stringify({jsonrpc:"2.0",id:e,error:{code:t,message:r}})}
69
+ `}function iS(e){let t=new VR("utf8"),r="",o=(n,s)=>{if(n.trim()==="")return;let i=HR(n);i===null?s(`${n}
70
+ `):e(i)};return new FR({transform(n,s,i){r+=typeof n=="string"?n:t.write(n);let c=r.indexOf(`
71
71
  `);for(;c!==-1;)o(r.slice(0,c).replace(/\r$/,""),a=>this.push(a)),r=r.slice(c+1),c=r.indexOf(`
72
- `);i()},flush(n){n()}})}import{isAbsolute as iS}from"node:path";function aS(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 cS={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},uS=Td(),FR=Od.map(e=>e.id),pd=aS(kd.options([cS],{},gc),"degrees").map(Number),YT=aS(Id.options([cS],{},gc),"mode"),VR=["every-page","every-n","points"],yr=l().refine(iS,"must be an absolute path").describe("An absolute path."),pc=I(yr).min(1),HR=P({mode:te(VR).describe("every-page, every-n or points."),n:L().int().min(1).optional().describe("every-n only: pages per file."),after:I(L().int().min(1)).min(1).optional().describe("points only: cut after these pages (1-based).")}).superRefine((e,t)=>{let r={"every-page":[],"every-n":["n"],points:["after"]}[e.mode];for(let o of["n","after"]){let n=e[o]!==void 0;n!==r.includes(o)&&t.addIssue({code:"custom",path:[o],message:n?`${o} does not go with mode ${e.mode}.`:`mode ${e.mode} needs ${o}.`})}}).describe('How to split: { mode: "every-page" }, { mode: "every-n", n } or { mode: "points", after: [pages] }.');function lS(e){return e.mode==="every-n"?{mode:"every-n",n:e.n??1}:e.mode==="points"?{mode:"points",after:e.after??[]}:{mode:"every-page"}}var JR=P({percent:L().min(1).max(Wd).optional(),width:L().int().min(1).optional(),height:L().int().min(1).optional()}).refine(e=>[e.percent,e.width,e.height].filter(t=>t!==void 0).length===1,{message:"Give exactly one of percent, width or height."});function dS(e){return e.percent!==void 0?{percent:e.percent}:e.width!==void 0?{width:e.width}:{height:e.height??1}}var pS=P({paths:pc.describe("Absolute paths of files (or folders) to inspect.")}),mS=P({}),fS=P({paths:pc.describe("Absolute paths of files, folders or globs to convert."),to:te(uS).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:yr.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:JR.optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following; exactly one of the three. 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:L().int().min(2).max(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`.")}),hS=P({paths:pc.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:yr.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."}),gS=P({to:te(uS).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:yr.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."}),_S=P({op:te(FR).describe("The page operation."),paths:pc.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:L().int().refine(e=>pd.includes(e),{message:`degrees must be ${pd.join(", ")}.`}).optional().describe(`rotate: degrees clockwise, one of ${pd.join(", ")}.`),split:HR.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Kn=Ge({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),BR=Ge({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Ge({code:l(),message:l()}))}),Gn=Ge({forge:l(),ok:H(),results:I(BR),failures:I(Kn)}),SS=Gn.extend({clipboard:te(["placed","changed","restored"]).optional(),saved:l().optional()}),yS=Ge({forge:l(),ok:H(),probes:I(Ge({path:l(),kind:te(["image","document","media"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),duration:L().optional(),fps:L().optional(),targets:I(l()),actions:I(l())})),failures:I(Kn)}),vS=Ge({forge:l(),ok:H(),formats:I(Ge({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Kn)}),md=l().describe("A colour: #RRGGBB, #RGB (or without the #), rgb(), hsl(), oklch(), or a CSS or common colour name"),fd={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")},bS=P({path:yr.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:md.optional().describe("Show the shades of the palette colour nearest this one"),...fd}),zS=P({colour:md,...fd}),RS=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:md})).min(1).describe("The colours, in the order they should appear"),theme:te(["light","dark"]).optional().describe("The card's background. Default: light"),copy:fd.copy}),$S=Ge({forge:l(),ok:H(),palette:Ge({source:l(),inside:l().optional(),colours:I(Ge({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Kn)}),wS=Ge({forge:l(),ok:H(),scale:Ge({reference:l(),steps:I(Ge({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Kn)}),KR=l().refine(e=>iS(e)||/^https?:\/\//i.test(e),"must be an absolute path or a link"),PS={language:l().optional().describe("The language, when it is not this computer's own: hi, fr-FR"),format:te(["md","docx","pdf","txt"]).optional().describe("The file written: Markdown (default), Word, PDF or text. The reply is Markdown either way"),output:yr.optional().describe("A folder (ending in /) or a file to write. Default: beside the source; for a link, Forge's default folder"),overwrite:H().optional().describe("Replace a file of that name. Default: refuse")},ES=P({source:KR.describe("A video or sound file (absolute path) or a YouTube link. A picture or PDF is read for its text instead"),to:te(["all","notes","transcript"]).optional().describe("all (default): summary, notes and transcript; notes: no transcript; transcript: no notes. Notes need Apple Intelligence"),detail:te(["brief","standard","detailed"]).optional().describe("How much the notes say. Default: standard"),...PS}),TS=P({path:yr.describe("A picture, screenshot, scan or PDF (absolute path)"),...PS});import{Writable as GR}from"node:stream";function CS(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new GR({write(o,n,s){r(o,n,s)}})}import{basename as _d,sep as WR}from"node:path";import{pathToFileURL as xS}from"node:url";var hd={interactive:!1},kS=Promise.resolve();function gd(e){let t=kS.then(e,e);return kS=t.catch(()=>{}),t}var Wn=(e,t)=>gd(()=>Gd(e,t===void 0?hd:{...hd,signal:t}));function NS(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 Sd(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(NS));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:xS(o).href,name:_d(o)}));return{content:[{type:"text",text:t.join(`
73
- `)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var lo=e=>Sd(fs(_t,e)),ft=e=>Sd(Nd(_t,e));async function jS(e){let t=Ad(_t,await xd(e.paths)),r=t.probes.map(o=>{let n=o.pages!==void 0?`, ${o.pages} pages`:o.width!==void 0?`, ${o.width}\xD7${o.height}`:"";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(NS)),{content:[{type:"text",text:r.join(`
74
- `)}],structuredContent:{...t},isError:!t.ok}}function AS(){let e=jd(_t,Cd());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(`
75
- `)}],structuredContent:{...e}}}async function qS(e,t){let r=Pd(e.background??"#ffffff");if(r===void 0)return ft(Rd(e.background??"","background"));let o=[...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 c=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",a=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...o,...e.pages!==void 0?["pages"]:[]][0];if(a!==void 0)return ft(st(`${c} cannot be combined with ${a}.`,"Run them one after the other."));let u;if(e.crop!==void 0)try{u={aspect:Ed(e.crop)}}catch(p){if(!Zo(p))throw p;return ft(st(p.detail,'Try crop "1:1" or "16:9".'))}let d={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:r,keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...u===void 0?{}:{crop:u},...e.resize===void 0?{}:{resize:dS(e.resize)},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return lo(await Wn(d))}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 s=e.to;if(o.length>0){if(o.length>1)return ft(st(`Use one operation at a time \u2014 got ${o.join(" and ")}.`));let c=e.sharpen===!0?1:e.boost,a={kind:"extension-op",op:c!==void 0?"boost":"remove-background",inputs:e.paths,target:s,options:{background:r,keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...c===void 0?{}:{scale:c},...e.output===void 0?{}:{output:e.output}};return lo(await Wn(a,t))}let i={kind:"convert",inputs:e.paths,target:s,options:{background:r,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 lo(await Wn(i))}async function MS(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=hc(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),lo(await Wn(t))}async function LS(e,t={}){try{if(e.undo)return await gd(()=>Zd(t)),{content:[{type:"text",text:"\u2713 The original is back on the clipboard"}],structuredContent:{...fs(_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=hc(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 gd(()=>Ld(r,{...hd,clip:t}));if(o.status==="failed")return lo(o.report);let n=fs(_t,o.report),s=Sd(n);return{...s,content:[{type:"text",text:Dd(o).join(`
76
- `)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!Zo(r))throw r;return ft(r)}}async function DS(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=lS(e.split)}return lo(await Wn(t))}function Yt(e){return{content:[{type:"text",text:e}],isError:!0}}function YR(e){if(e.pasteboard)return e.pasteboard;if(!qd())throw $d();return Md()}var XR=process.platform==="darwin"?"\u2318V":"Ctrl+V";async function yd(e,t,r,o){if(!r.svg&&!r.copy)return e;let n=t(),s=[...e.content];if(r.copy){try{await YR(o).writeText(n,"")}catch(c){let a=Zo(c)?c.detail:c instanceof Error?c.message:String(c);return Yt(`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 ${XR}: one layer per colour.`})}return r.svg&&s.push({type:"text",text:n}),{...e,content:s}}async function ZS(e,t={}){let r=e.inside===void 0?void 0:ms(e.inside)?.rgb;if(e.inside!==void 0&&!r)return Yt(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{readPalette:o}=await import("./colour-2BGK2BFR.js"),n=await o({kind:"palette",input:e.path,svg:!1,...r?{inside:r}:{}}),s=n.doc,i=Jd(s.palette.colours.map(u=>u.share)),a={content:[{type:"text",text:s.palette.colours.map((u,d)=>`${u.hex} ${i[d]}%`).join(`
77
- `)}],structuredContent:{...s}};return await yd(a,n.svg,{svg:e.svg,copy:e.copy,swatches:s.palette.colours.length},t)}catch(o){if(Zo(o))return Yt(`${o.title}: ${o.detail}${o.hint?` ${o.hint}`:""}`);throw o}}async function US(e,t={}){let r=ms(e.colour)?.rgb;if(!r)return Yt(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:o}=await import("./colour-2BGK2BFR.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(`
78
- `)}],structuredContent:{...s}};return yd(c,()=>Hd(r,Fd(r)),{svg:e.svg,copy:e.copy,swatches:s.scale.steps.length},t)}async function FS(e,t={}){let r=[],o=[];for(let{name:c,colour:a}of e.colours){let u=ms(a);if(!u){o.push(`${c}: ${a}`);continue}let d=wd(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 Yt(`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=()=>Vd(e.title,s,r,e.theme,{perRow:8});return e.copy?yd({content:[]},i,{copy:!0,swatches:n},t):{content:[{type:"text",text:i()}]}}var IS=Promise.resolve();function QR(e){let t=IS.then(e,e);return IS=t.catch(()=>{}),t}var OS=2e5;async function e$(e){if(e.folder!==void 0)return e.folder;let{loadPreferences:t,expandTilde:r}=await import("./preferences-E2CH2YSG.js");return r((await t()).prefs.defaultOutput)}var t$=600*1e3;async function vd(e,t={},r={}){let n=Kd(e.source)?.kind==="video"&&e.output===void 0?await e$(r):void 0,s={kind:"transcribe",input:e.source,notes:e.to!=="transcript",transcript:e.to!=="notes",...e.to===void 0?{}:{to:e.to},detail:e.detail??Ud,...e.language===void 0?{}:{language:e.language},...e.format===void 0?{}:{format:e.format},...n!==void 0?{output:`${n}${WR}`}:e.output===void 0?{}:{output:e.output},force:e.overwrite===!0,debug:!1},i=[],c=[],a,u=new AbortController,d=()=>u.abort(t.signal?.reason);t.signal?.aborted?d():t.signal?.addEventListener("abort",d,{once:!0});let p,g=!1,{runTranscribeCommand:v,transcribeFact:m}=await import("./transcribe-command-VY5HYNXV.js"),_=await QR(()=>v(s,{out:w=>i.push(w),err:w=>c.push(w),signal:u.signal,onStart:w=>{w==="read"&&(p=setTimeout(()=>{g=!0,u.abort()},r.readLimitMs??t$))},...t.report?{onProgress:w=>t.report?.(w.kind==="page"?`reading ${m(w)}`:m(w))}:{},document:w=>{a=w}})).finally(()=>{clearTimeout(p),t.signal?.removeEventListener("abort",d)});if(g)return Yt("Reading text stopped after 10 minutes.");let h=w=>w.map(b=>b.trim()).filter(Boolean).join(" ");if(_!==0||a===void 0)return Yt(h(c)||"Transcribe failed.");let{path:f,markdown:z,notesSkipped:S}=a,R=z.length>OS?`${z.slice(0,OS)}
72
+ `);i()},flush(n){n()}})}import{isAbsolute as pd}from"node:path";function aS(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 cS={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},uS=kd(),JR=xd.map(e=>e.id),dd=aS(Id.options([cS],{},hc),"degrees").map(Number),QT=aS(Od.options([cS],{},hc),"mode"),BR=["every-page","every-n","points"],yr=l().refine(pd,"must be an absolute path").describe("An absolute path."),lS=I(yr).min(1),dS=I(l().refine(e=>pd(e)||/^https?:\/\//i.test(e),"must be an absolute path or a link")).min(1),KR=P({mode:te(BR).describe("every-page, every-n or points."),n:L().int().min(1).optional().describe("every-n only: pages per file."),after:I(L().int().min(1)).min(1).optional().describe("points only: cut after these pages (1-based).")}).superRefine((e,t)=>{let r={"every-page":[],"every-n":["n"],points:["after"]}[e.mode];for(let o of["n","after"]){let n=e[o]!==void 0;n!==r.includes(o)&&t.addIssue({code:"custom",path:[o],message:n?`${o} does not go with mode ${e.mode}.`:`mode ${e.mode} needs ${o}.`})}}).describe('How to split: { mode: "every-page" }, { mode: "every-n", n } or { mode: "points", after: [pages] }.');function pS(e){return e.mode==="every-n"?{mode:"every-n",n:e.n??1}:e.mode==="points"?{mode:"points",after:e.after??[]}:{mode:"every-page"}}var GR=P({percent:L().min(1).max(Yd).optional(),width:L().int().min(1).optional(),height:L().int().min(1).optional()}).refine(e=>[e.percent,e.width,e.height].filter(t=>t!==void 0).length===1,{message:"Give exactly one of percent, width or height."});function mS(e){return e.percent!==void 0?{percent:e.percent}:e.width!==void 0?{width:e.width}:{height:e.height??1}}var fS=P({paths:lS.describe("Absolute paths of files (or folders) to inspect.")}),hS=P({}),gS=P({paths:dS.describe("Absolute paths of files, folders or globs to convert, or video links (YouTube, Instagram, TikTok\u2026), downloaded first; a link\u2019s result is saved to Downloads."),to:te(uS).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:yr.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:GR.optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following; exactly one of the three. 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:L().int().min(2).max(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`.")}),_S=P({paths:dS.describe("Absolute paths of files to compress, or video links, downloaded first; a link\u2019s result is saved to Downloads."),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:yr.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."}),SS=P({to:te(uS).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:yr.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."}),yS=P({op:te(JR).describe("The page operation."),paths:lS.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:L().int().refine(e=>dd.includes(e),{message:`degrees must be ${dd.join(", ")}.`}).optional().describe(`rotate: degrees clockwise, one of ${dd.join(", ")}.`),split:KR.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Kn=Ge({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),WR=Ge({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Ge({code:l(),message:l()}))}),Gn=Ge({forge:l(),ok:H(),results:I(WR),failures:I(Kn)}),vS=Gn.extend({clipboard:te(["placed","changed","restored"]).optional(),saved:l().optional()}),bS=Ge({forge:l(),ok:H(),probes:I(Ge({path:l(),kind:te(["image","document","media"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),duration:L().optional(),fps:L().optional(),targets:I(l()),actions:I(l())})),failures:I(Kn)}),zS=Ge({forge:l(),ok:H(),formats:I(Ge({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Kn)}),md=l().describe("A colour: #RRGGBB, #RGB (or without the #), rgb(), hsl(), oklch(), or a CSS or common colour name"),fd={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")},RS=P({path:yr.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:md.optional().describe("Show the shades of the palette colour nearest this one"),...fd}),$S=P({colour:md,...fd}),wS=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:md})).min(1).describe("The colours, in the order they should appear"),theme:te(["light","dark"]).optional().describe("The card's background. Default: light"),copy:fd.copy}),PS=Ge({forge:l(),ok:H(),palette:Ge({source:l(),inside:l().optional(),colours:I(Ge({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Kn)}),ES=Ge({forge:l(),ok:H(),scale:Ge({reference:l(),steps:I(Ge({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Kn)}),YR=l().refine(e=>pd(e)||/^https?:\/\//i.test(e),"must be an absolute path or a link"),TS={language:l().optional().describe("The language, when it is not this computer's own: hi, fr-FR"),format:te(["md","docx","pdf","txt"]).optional().describe("The file written: Markdown (default), Word, PDF or text. The reply is Markdown either way"),output:yr.optional().describe("A folder (ending in /) or a file to write. Default: beside the source; for a link, Forge's default folder"),overwrite:H().optional().describe("Replace a file of that name. Default: refuse")},kS=P({source:YR.describe("A video or sound file (absolute path) or a video link (YouTube, Instagram, TikTok\u2026). A picture or PDF is read for its text instead"),to:te(["all","notes","transcript"]).optional().describe("all (default): summary, notes and transcript; notes: no transcript; transcript: no notes. Notes need Apple Intelligence"),detail:te(["brief","standard","detailed"]).optional().describe("How much the notes say. Default: standard"),...TS}),CS=P({path:yr.describe("A picture, screenshot, scan or PDF (absolute path)"),...TS});import{Writable as XR}from"node:stream";function IS(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new XR({write(o,n,s){r(o,n,s)}})}import{basename as _d,sep as jS}from"node:path";import{pathToFileURL as AS}from"node:url";var hd={interactive:!1,linkOutput:`${wd("Downloads")}${jS}`},OS=Promise.resolve();function gd(e){let t=OS.then(e,e);return OS=t.catch(()=>{}),t}var Wn=(e,t)=>gd(()=>Wd(e,t===void 0?hd:{...hd,signal:t}));function qS(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 Sd(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(qS));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:AS(o).href,name:_d(o)}));return{content:[{type:"text",text:t.join(`
73
+ `)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var lo=e=>Sd(fs(_t,e)),ft=e=>Sd(jd(_t,e));async function MS(e){let t=qd(_t,await Nd(e.paths)),r=t.probes.map(o=>{let n=o.pages!==void 0?`, ${o.pages} pages`:o.width!==void 0?`, ${o.width}\xD7${o.height}`:"";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(qS)),{content:[{type:"text",text:r.join(`
74
+ `)}],structuredContent:{...t},isError:!t.ok}}function LS(){let e=Ad(_t,Cd());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(`
75
+ `)}],structuredContent:{...e}}}async function DS(e,t){let r=Ed(e.background??"#ffffff");if(r===void 0)return ft(Rd(e.background??"","background"));let o=[...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 c=e.crop!==void 0?"crop":e.trim===!0?"trim":"resize",a=[...e.crop!==void 0&&e.trim===!0?["trim"]:[],...o,...e.pages!==void 0?["pages"]:[]][0];if(a!==void 0)return ft(st(`${c} cannot be combined with ${a}.`,"Run them one after the other."));let u;if(e.crop!==void 0)try{u={aspect:Td(e.crop)}}catch(p){if(!Zo(p))throw p;return ft(st(p.detail,'Try crop "1:1" or "16:9".'))}let d={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:r,keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...u===void 0?{}:{crop:u},...e.resize===void 0?{}:{resize:mS(e.resize)},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return lo(await Wn(d))}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 s=e.to;if(o.length>0){if(o.length>1)return ft(st(`Use one operation at a time \u2014 got ${o.join(" and ")}.`));let c=e.sharpen===!0?1:e.boost,a={kind:"extension-op",op:c!==void 0?"boost":"remove-background",inputs:e.paths,target:s,options:{background:r,keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...c===void 0?{}:{scale:c},...e.output===void 0?{}:{output:e.output}};return lo(await Wn(a,t))}let i={kind:"convert",inputs:e.paths,target:s,options:{background:r,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 lo(await Wn(i))}async function ZS(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=fc(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),lo(await Wn(t))}async function US(e,t={}){try{if(e.undo)return await gd(()=>Fd(t)),{content:[{type:"text",text:"\u2713 The original is back on the clipboard"}],structuredContent:{...fs(_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=fc(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 gd(()=>Zd(r,{...hd,clip:t}));if(o.status==="failed")return lo(o.report);let n=fs(_t,o.report),s=Sd(n);return{...s,content:[{type:"text",text:Ud(o).join(`
76
+ `)},...(s.content??[]).slice(1)],structuredContent:{...n,clipboard:o.status,...o.saved===void 0?{}:{saved:o.saved}}}}catch(r){if(!Zo(r))throw r;return ft(r)}}async function FS(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=pS(e.split)}return lo(await Wn(t))}function Yt(e){return{content:[{type:"text",text:e}],isError:!0}}function QR(e){if(e.pasteboard)return e.pasteboard;if(!Ld())throw $d();return Dd()}var e$=process.platform==="darwin"?"\u2318V":"Ctrl+V";async function yd(e,t,r,o){if(!r.svg&&!r.copy)return e;let n=t(),s=[...e.content];if(r.copy){try{await QR(o).writeText(n,"")}catch(c){let a=Zo(c)?c.detail:c instanceof Error?c.message:String(c);return Yt(`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 ${e$}: one layer per colour.`})}return r.svg&&s.push({type:"text",text:n}),{...e,content:s}}async function VS(e,t={}){let r=e.inside===void 0?void 0:ms(e.inside)?.rgb;if(e.inside!==void 0&&!r)return Yt(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{readPalette:o}=await import("./colour-7HPH6KTY.js"),n=await o({kind:"palette",input:e.path,svg:!1,...r?{inside:r}:{}}),s=n.doc,i=Kd(s.palette.colours.map(u=>u.share)),a={content:[{type:"text",text:s.palette.colours.map((u,d)=>`${u.hex} ${i[d]}%`).join(`
77
+ `)}],structuredContent:{...s}};return await yd(a,n.svg,{svg:e.svg,copy:e.copy,swatches:s.palette.colours.length},t)}catch(o){if(Zo(o))return Yt(`${o.title}: ${o.detail}${o.hint?` ${o.hint}`:""}`);throw o}}async function HS(e,t={}){let r=ms(e.colour)?.rgb;if(!r)return Yt(`${e.colour} is not a colour. Try #RRGGBB, rgb(), hsl(), oklch() or a colour name.`);let{runScale:o}=await import("./colour-7HPH6KTY.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(`
78
+ `)}],structuredContent:{...s}};return yd(c,()=>Bd(r,Hd(r)),{svg:e.svg,copy:e.copy,swatches:s.scale.steps.length},t)}async function JS(e,t={}){let r=[],o=[];for(let{name:c,colour:a}of e.colours){let u=ms(a);if(!u){o.push(`${c}: ${a}`);continue}let d=Pd(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 Yt(`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=()=>Jd(e.title,s,r,e.theme,{perRow:8});return e.copy?yd({content:[]},i,{copy:!0,swatches:n},t):{content:[{type:"text",text:i()}]}}var xS=Promise.resolve();function t$(e){let t=xS.then(e,e);return xS=t.catch(()=>{}),t}var NS=2e5;async function r$(e){if(e.folder!==void 0)return e.folder;let{loadPreferences:t,expandTilde:r}=await import("./preferences-7S7YZOFK.js");return r((await t()).prefs.defaultOutput)}var o$=600*1e3;async function vd(e,t={},r={}){let n=Md(e.source)?.kind==="video"&&e.output===void 0?await r$(r):void 0,s={kind:"transcribe",input:e.source,notes:e.to!=="transcript",transcript:e.to!=="notes",...e.to===void 0?{}:{to:e.to},detail:e.detail??Vd,...e.language===void 0?{}:{language:e.language},...e.format===void 0?{}:{format:e.format},...n!==void 0?{output:`${n}${jS}`}:e.output===void 0?{}:{output:e.output},force:e.overwrite===!0,debug:!1},i=[],c=[],a,u=new AbortController,d=()=>u.abort(t.signal?.reason);t.signal?.aborted?d():t.signal?.addEventListener("abort",d,{once:!0});let p,g=!1,{runTranscribeCommand:v,transcribeFact:m}=await import("./transcribe-command-KNSUHROE.js"),_=await t$(()=>v(s,{out:w=>i.push(w),err:w=>c.push(w),signal:u.signal,onStart:w=>{w==="read"&&(p=setTimeout(()=>{g=!0,u.abort()},r.readLimitMs??o$))},...t.report?{onProgress:w=>t.report?.(w.kind==="page"?`reading ${m(w)}`:m(w))}:{},document:w=>{a=w}})).finally(()=>{clearTimeout(p),t.signal?.removeEventListener("abort",d)});if(g)return Yt("Reading text stopped after 10 minutes.");let h=w=>w.map(b=>b.trim()).filter(Boolean).join(" ");if(_!==0||a===void 0)return Yt(h(c)||"Transcribe failed.");let{path:f,markdown:z,notesSkipped:S}=a,R=z.length>NS?`${z.slice(0,NS)}
79
79
 
80
80
  [The rest is in ${f}]`:z;return{content:[{type:"text",text:[...i,...c].join(`
81
- `)},{type:"resource_link",uri:xS(f).href,name:_d(f)},{type:"text",text:R}],...S?{structuredContent:{path:f,notes:null,notesSkipped:S}}:{}}}async function VS(e,t={},r={}){let o=await Bd(e.path).catch(()=>{});if(o==="video"||o==="audio")return Yt(`${_d(e.path)} is a recording, not a picture or PDF. Use forge_transcribe for what is said in it.`);let{path:n,...s}=e;return vd({source:n,...s},t,r)}function HS(e){let t=e.mcpReq._meta?.progressToken;if(t===void 0)return{signal:e.mcpReq.signal};let r=0;return{signal:e.mcpReq.signal,report:o=>{r+=1,e.mcpReq.notify({method:"notifications/progress",params:{progressToken:t,progress:r,message:o}}).catch(()=>{})}}}function r$(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.","Reach for Forge when a file must fit a limit (an upload under 5 MB: forge_compress with maxSize; a set width: forge_convert with resize);","when a file is in a format you cannot open (HEIC, camera RAW, Word): forge_convert it to PNG, JPEG or PDF and read that;","when you need what a recording, meeting or YouTube video says: forge_transcribe;","when you need the text in a picture, screenshot, scan or PDF: forge_read_text;","and when the user wants colours in Figma: forge_card, forge_scale or forge_palette with copy: true put a card of swatches on their clipboard to paste.","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 o$=r$(),JS={readOnlyHint:!0,openWorldHint:!1},bd={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},po={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function n$(e={}){let t=new dc({name:"forge",version:_t},{instructions:o$});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:pS,outputSchema:yS,annotations:JS},r=>jS(r)),t.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:mS,outputSchema:vS,annotations:JS},()=>AS()),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. Use it to open a format you cannot read (HEIC, camera RAW, Word): convert to PNG, JPEG or PDF. Returns every output path and a file:// link to each.",inputSchema:fS,outputSchema:Gn,annotations:po},(r,o)=>qS(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" \u2014 use maxSize when an upload, email or form has a size limit. 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:hS,outputSchema:Gn,annotations:po},r=>MS(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:gS,outputSchema:SS,annotations:{...po,destructiveHint:!0}},r=>LS(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:_S,outputSchema:Gn,annotations:po},r=>DS(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:bS,outputSchema:$S,annotations:bd},r=>ZS(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:zS,outputSchema:wS,annotations:bd},r=>US(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:RS,annotations:bd},r=>FS(r,e.clip)),t.registerTool("forge_transcribe",{title:"Transcribe a recording",description:"What is said in a video or sound file, or a YouTube link, on this computer: a summary and notes (where Apple Intelligence is on) and the transcript. Use it whenever you need to know what a recording, meeting, lecture or video says, since you cannot listen to it. Writes a Markdown file beside the source (Word, PDF or text with format) and returns its text. A long recording takes minutes; progress says how far it has heard. Nothing is overwritten unless overwrite: true.",inputSchema:ES,annotations:{...po,openWorldHint:!0}},(r,o)=>vd(r,HS(o),{...e.folder?{folder:e.folder}:{},...e.readLimitMs?{readLimitMs:e.readLimitMs}:{}})),t.registerTool("forge_read_text",{title:"Read the text in a picture or PDF",description:"The text in a picture, screenshot, scan, photo of a page or whiteboard, or PDF, read on this computer, with headings, lists and tables kept, in Latin, Cyrillic, Chinese, Japanese, Korean, Arabic, Devanagari or Thai script. Use it when you cannot read an image's text yourself or a PDF is scanned. Writes a Markdown file beside it (Word, PDF or text with format) and returns its text. Nothing is overwritten unless overwrite: true.",inputSchema:TS,annotations:po},(r,o)=>VS(r,HS(o),{...e.readLimitMs?{readLimitMs:e.readLimitMs}:{}})),t}async function OC(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=CS();Yd(()=>{},{graceful:[]}),process.stdin.once("end",()=>{Xd()});let r=process.stdin.pipe(sS(o=>t.write(o)));await n$().connect(new oS(r,t))}export{o$ as INSTRUCTIONS,n$ as createForgeServer,r$ as instructionsFor,OC as runMcpServer};
81
+ `)},{type:"resource_link",uri:AS(f).href,name:_d(f)},{type:"text",text:R}],...S?{structuredContent:{path:f,notes:null,notesSkipped:S}}:{}}}async function BS(e,t={},r={}){let o=await Gd(e.path).catch(()=>{});if(o==="video"||o==="audio")return Yt(`${_d(e.path)} is a recording, not a picture or PDF. Use forge_transcribe for what is said in it.`);let{path:n,...s}=e;return vd({source:n,...s},t,r)}function KS(e){let t=e.mcpReq._meta?.progressToken;if(t===void 0)return{signal:e.mcpReq.signal};let r=0;return{signal:e.mcpReq.signal,report:o=>{r+=1,e.mcpReq.notify({method:"notifications/progress",params:{progressToken:t,progress:r,message:o}}).catch(()=>{})}}}function n$(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.","Reach for Forge when a file must fit a limit (an upload under 5 MB: forge_compress with maxSize; a set width: forge_convert with resize);","when a file is in a format you cannot open (HEIC, camera RAW, Word): forge_convert it to PNG, JPEG or PDF and read that;","when you need what a recording, meeting or online video says: forge_transcribe;","when you need the text in a picture, screenshot, scan or PDF: forge_read_text;","and when the user wants colours in Figma: forge_card, forge_scale or forge_palette with copy: true put a card of swatches on their clipboard to paste.","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 s$=n$(),GS={readOnlyHint:!0,openWorldHint:!1},bd={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},po={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function i$(e={}){let t=new dc({name:"forge",version:_t},{instructions:s$});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:fS,outputSchema:bS,annotations:GS},r=>MS(r)),t.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:hS,outputSchema:zS,annotations:GS},()=>LS()),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. Use it to open a format you cannot read (HEIC, camera RAW, Word): convert to PNG, JPEG or PDF. Returns every output path and a file:// link to each.",inputSchema:gS,outputSchema:Gn,annotations:po},(r,o)=>DS(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" \u2014 use maxSize when an upload, email or form has a size limit. 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:_S,outputSchema:Gn,annotations:po},r=>ZS(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:SS,outputSchema:vS,annotations:{...po,destructiveHint:!0}},r=>US(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:yS,outputSchema:Gn,annotations:po},r=>FS(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:RS,outputSchema:PS,annotations:bd},r=>VS(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:$S,outputSchema:ES,annotations:bd},r=>HS(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:wS,annotations:bd},r=>JS(r,e.clip)),t.registerTool("forge_transcribe",{title:"Transcribe a recording",description:"What is said in a video or sound file, or a video link (YouTube, Instagram, TikTok\u2026), on this computer: a summary and notes (where Apple Intelligence is on) and the transcript. Use it whenever you need to know what a recording, meeting, lecture or video says, since you cannot listen to it. Writes a Markdown file beside the source (Word, PDF or text with format) and returns its text. A long recording takes minutes; progress says how far it has heard. Nothing is overwritten unless overwrite: true.",inputSchema:kS,annotations:{...po,openWorldHint:!0}},(r,o)=>vd(r,KS(o),{...e.folder?{folder:e.folder}:{},...e.readLimitMs?{readLimitMs:e.readLimitMs}:{}})),t.registerTool("forge_read_text",{title:"Read the text in a picture or PDF",description:"The text in a picture, screenshot, scan, photo of a page or whiteboard, or PDF, read on this computer, with headings, lists and tables kept, in Latin, Cyrillic, Chinese, Japanese, Korean, Arabic, Devanagari or Thai script. Use it when you cannot read an image's text yourself or a PDF is scanned. Writes a Markdown file beside it (Word, PDF or text with format) and returns its text. Nothing is overwritten unless overwrite: true.",inputSchema:CS,annotations:po},(r,o)=>BS(r,KS(o),{...e.readLimitMs?{readLimitMs:e.readLimitMs}:{}})),t}async function jk(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=IS();Xd(()=>{},{graceful:[]}),process.stdin.once("end",()=>{Qd()});let r=process.stdin.pipe(iS(o=>t.write(o)));await i$().connect(new nS(r,t))}export{s$ as INSTRUCTIONS,i$ as createForgeServer,n$ as instructionsFor,jk as runMcpServer};