@kaeawc/auto-mobile 0.0.92 → 0.0.94

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 (257) hide show
  1. package/dist/build-info.json +12 -12
  2. package/dist/schemas/test-plan.schema.json +370 -52
  3. package/dist/src/ble-peripheral.py +153 -0
  4. package/dist/src/{chunk-r14wwk37.js → chunk-026y62r9.js} +12 -12
  5. package/dist/src/chunk-0jyfg947.js +4 -0
  6. package/dist/src/{chunk-950qcq1e.js → chunk-0zfpp1wh.js} +4 -4
  7. package/dist/src/chunk-13qxf7ym.js +7 -0
  8. package/dist/src/chunk-1scenrk7.js +4 -0
  9. package/dist/src/chunk-1vb5ph1k.js +4 -0
  10. package/dist/src/chunk-20g565q7.js +5 -0
  11. package/dist/src/chunk-21h6dhdm.js +5 -0
  12. package/dist/src/{chunk-2e6s75qv.js → chunk-25mfpthk.js} +8 -8
  13. package/dist/src/{chunk-9rkfyt6q.js → chunk-2b39zyxc.js} +3 -3
  14. package/dist/src/chunk-2gzd6wbd.js +4 -0
  15. package/dist/src/{chunk-eka89q3k.js → chunk-3dntffy9.js} +1 -1
  16. package/dist/src/chunk-3gfczcsn.js +4 -0
  17. package/dist/src/chunk-3h5jz1vb.js +9 -0
  18. package/dist/src/chunk-41zcy6b3.js +5 -0
  19. package/dist/src/chunk-47n9m2de.js +4 -0
  20. package/dist/src/chunk-4vxeq0vd.js +58 -0
  21. package/dist/src/chunk-59dx6qaf.js +4 -0
  22. package/dist/src/chunk-5sdf9y92.js +4 -0
  23. package/dist/src/chunk-5wk1t46v.js +5 -0
  24. package/dist/src/chunk-661c50hh.js +17 -0
  25. package/dist/src/chunk-68n6bjjd.js +21 -0
  26. package/dist/src/{chunk-zg67wjkh.js → chunk-69pmjdf2.js} +3 -3
  27. package/dist/src/chunk-6hrj3jt6.js +145 -0
  28. package/dist/src/{chunk-b4cxdzwy.js → chunk-6myr26wx.js} +8 -8
  29. package/dist/src/chunk-6n96k09n.js +4 -0
  30. package/dist/src/chunk-6vwrbkre.js +4 -0
  31. package/dist/src/chunk-6wk0yrab.js +4 -0
  32. package/dist/src/chunk-6yhm9een.js +4 -0
  33. package/dist/src/chunk-7k7gjg2t.js +7 -0
  34. package/dist/src/chunk-7n5fz68h.js +4 -0
  35. package/dist/src/chunk-8cvnpnbp.js +4 -0
  36. package/dist/src/chunk-8kzv7rk7.js +4 -0
  37. package/dist/src/chunk-8nj68t1v.js +167 -0
  38. package/dist/src/{chunk-r20pe1nv.js → chunk-96r3bpg7.js} +3 -3
  39. package/dist/src/chunk-97x887te.js +4 -0
  40. package/dist/src/{chunk-sz1a7p43.js → chunk-99a6tbvd.js} +1 -1
  41. package/dist/src/chunk-9p5d2994.js +5 -0
  42. package/dist/src/{chunk-w7zsh13a.js → chunk-9q265er0.js} +4 -4
  43. package/dist/src/chunk-9xgnrv5w.js +5 -0
  44. package/dist/src/chunk-9xgsmshb.js +5 -0
  45. package/dist/src/chunk-a02d1wgv.js +4 -0
  46. package/dist/src/{chunk-km0dy5vc.js → chunk-a9ps00a1.js} +10 -10
  47. package/dist/src/chunk-aewdveet.js +5 -0
  48. package/dist/src/chunk-b3tdtq7r.js +9 -0
  49. package/dist/src/chunk-bn7jx7a2.js +4 -0
  50. package/dist/src/chunk-bnyw27ja.js +4 -0
  51. package/dist/src/{chunk-s1zq65ny.js → chunk-bpwsg76p.js} +2 -2
  52. package/dist/src/chunk-bvranw3g.js +4 -0
  53. package/dist/src/chunk-c25a84zb.js +4 -0
  54. package/dist/src/chunk-c27yv1dx.js +5 -0
  55. package/dist/src/chunk-c3ewxm4x.js +5 -0
  56. package/dist/src/chunk-cb1ga9rd.js +7 -0
  57. package/dist/src/chunk-cn7fwy7k.js +4 -0
  58. package/dist/src/chunk-cnvy4a64.js +4 -0
  59. package/dist/src/chunk-cqhw4yr6.js +5 -0
  60. package/dist/src/{chunk-v90es00d.js → chunk-ctmfshjc.js} +2 -2
  61. package/dist/src/chunk-ctwmhz13.js +4 -0
  62. package/dist/src/{chunk-qv2918jt.js → chunk-d3jx9bz5.js} +2 -2
  63. package/dist/src/{chunk-wry6skrm.js → chunk-d6rb08ga.js} +1 -1
  64. package/dist/src/chunk-ddqhj4eg.js +5 -0
  65. package/dist/src/{chunk-d57432wq.js → chunk-ddrhs1c3.js} +2 -2
  66. package/dist/src/chunk-dnjnh9p6.js +4 -0
  67. package/dist/src/{chunk-ajsrz473.js → chunk-dw5rwgya.js} +3 -3
  68. package/dist/src/chunk-e0870khr.js +5 -0
  69. package/dist/src/chunk-ea3k10kj.js +4 -0
  70. package/dist/src/chunk-emv82m1w.js +7 -0
  71. package/dist/src/chunk-f3m6pdnx.js +4 -0
  72. package/dist/src/chunk-f84z32cb.js +4 -0
  73. package/dist/src/chunk-fpczgf0z.js +4 -0
  74. package/dist/src/chunk-g2js4c2v.js +971 -0
  75. package/dist/src/chunk-g3af2qbk.js +5 -0
  76. package/dist/src/chunk-gadtna7s.js +11 -0
  77. package/dist/src/{chunk-c9nk1r78.js → chunk-gcyx407v.js} +3 -3
  78. package/dist/src/{chunk-jdqvcq0a.js → chunk-gfpntwc1.js} +3 -3
  79. package/dist/src/chunk-gmnm5e3e.js +4 -0
  80. package/dist/src/chunk-gp6vb5gf.js +4 -0
  81. package/dist/src/chunk-gppgy7pa.js +4 -0
  82. package/dist/src/chunk-hegfz0ae.js +5 -0
  83. package/dist/src/chunk-hpzxdp1k.js +17 -0
  84. package/dist/src/{chunk-2v7tw1nj.js → chunk-j69g8b50.js} +3 -3
  85. package/dist/src/chunk-jvstjnqm.js +19 -0
  86. package/dist/src/chunk-jzqrv78s.js +4 -0
  87. package/dist/src/chunk-k2948b8d.js +4 -0
  88. package/dist/src/chunk-k4ftd40d.js +4 -0
  89. package/dist/src/chunk-kd9vfaxh.js +5 -0
  90. package/dist/src/{chunk-34zxqcmq.js → chunk-kdczmgwk.js} +3 -3
  91. package/dist/src/chunk-ke3wn14v.js +4 -0
  92. package/dist/src/chunk-kh5n7m6w.js +4 -0
  93. package/dist/src/{chunk-0dfnyfkh.js → chunk-khejfph4.js} +3 -3
  94. package/dist/src/chunk-kny2xemh.js +4 -0
  95. package/dist/src/chunk-knyzw9md.js +4 -0
  96. package/dist/src/chunk-mbzpt2hp.js +4 -0
  97. package/dist/src/chunk-mm8rcxad.js +4 -0
  98. package/dist/src/chunk-nc4516tx.js +4 -0
  99. package/dist/src/{chunk-stfzjr9y.js → chunk-ntfrqrqn.js} +5 -5
  100. package/dist/src/chunk-nz5h2j52.js +4 -0
  101. package/dist/src/chunk-p22s97qy.js +4 -0
  102. package/dist/src/chunk-p9kt1sgr.js +6 -0
  103. package/dist/src/{chunk-9y5bcy28.js → chunk-pf282r5g.js} +4 -4
  104. package/dist/src/chunk-pnd4mrxy.js +4 -0
  105. package/dist/src/chunk-pqqteyj6.js +4 -0
  106. package/dist/src/chunk-qj1tbnv2.js +8 -0
  107. package/dist/src/chunk-qnh9egwr.js +4 -0
  108. package/dist/src/chunk-qy3khhf8.js +8 -0
  109. package/dist/src/chunk-r0vp315h.js +11 -0
  110. package/dist/src/chunk-r4j43b9s.js +237 -0
  111. package/dist/src/{chunk-4pfftt07.js → chunk-r54cxxze.js} +3 -3
  112. package/dist/src/chunk-r6pvhj33.js +325 -0
  113. package/dist/src/chunk-rb7aa5gr.js +54 -0
  114. package/dist/src/chunk-rdj50kb4.js +4 -0
  115. package/dist/src/chunk-rnd4vcas.js +4 -0
  116. package/dist/src/chunk-s3y3zfcx.js +14 -0
  117. package/dist/src/chunk-s4g43k75.js +5 -0
  118. package/dist/src/chunk-sfqe223f.js +311 -0
  119. package/dist/src/chunk-sqdrxjw5.js +7 -0
  120. package/dist/src/{chunk-0w1spptt.js → chunk-t54k47em.js} +4 -4
  121. package/dist/src/chunk-tek4pnvv.js +26 -0
  122. package/dist/src/chunk-tn74y7af.js +4 -0
  123. package/dist/src/chunk-tvq0nzam.js +5 -0
  124. package/dist/src/chunk-tx4f0h9c.js +6 -0
  125. package/dist/src/chunk-vdqag3fj.js +5 -0
  126. package/dist/src/chunk-vz5zzs57.js +4 -0
  127. package/dist/src/chunk-w4s2vfpj.js +4 -0
  128. package/dist/src/chunk-w5yypt53.js +42 -0
  129. package/dist/src/{chunk-r0f1q783.js → chunk-w68v64vh.js} +3 -3
  130. package/dist/src/chunk-whwj0pdk.js +5 -0
  131. package/dist/src/chunk-wnmqt1dc.js +4 -0
  132. package/dist/src/{chunk-8en08r7q.js → chunk-wpe46vsa.js} +3 -3
  133. package/dist/src/chunk-wxdjeb4k.js +27 -0
  134. package/dist/src/chunk-xcqzwf9j.js +247 -0
  135. package/dist/src/chunk-xezekwwn.js +5 -0
  136. package/dist/src/chunk-xf19m15s.js +4 -0
  137. package/dist/src/chunk-xghbxha4.js +4 -0
  138. package/dist/src/{chunk-jhnbfj19.js → chunk-xn9m3xc2.js} +5 -5
  139. package/dist/src/{chunk-a4k9rt7z.js → chunk-yqfz4vts.js} +3 -3
  140. package/dist/src/chunk-z8tvs8nk.js +5 -0
  141. package/dist/src/chunk-zm2rehqb.js +5 -0
  142. package/dist/src/chunk-zs6dqm35.js +4 -0
  143. package/dist/src/daemon/processEntry.js +2 -2
  144. package/dist/src/index.js +4 -4
  145. package/dist/src/runtime/bunRuntimeGuard.js +2 -2
  146. package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
  147. package/ios/CameraPosterInjection/Injection/CameraPosterInjection.m +466 -0
  148. package/package.json +4 -3
  149. package/schemas/test-plan.schema.json +370 -52
  150. package/dist/src/chunk-09442h7v.js +0 -4
  151. package/dist/src/chunk-0e4gm1kj.js +0 -5
  152. package/dist/src/chunk-0eb8576f.js +0 -4
  153. package/dist/src/chunk-0rjm4nx7.js +0 -5
  154. package/dist/src/chunk-1zmh2eak.js +0 -4
  155. package/dist/src/chunk-28k63ha3.js +0 -5
  156. package/dist/src/chunk-2d4wmp8b.js +0 -4
  157. package/dist/src/chunk-32jpxz2y.js +0 -323
  158. package/dist/src/chunk-3jmvqygr.js +0 -238
  159. package/dist/src/chunk-3swvfhqt.js +0 -5
  160. package/dist/src/chunk-44bt78m9.js +0 -5
  161. package/dist/src/chunk-488vt2bp.js +0 -4
  162. package/dist/src/chunk-4fgdhcwx.js +0 -5
  163. package/dist/src/chunk-4jp2se4w.js +0 -4
  164. package/dist/src/chunk-4vhr9e4t.js +0 -4
  165. package/dist/src/chunk-4xd6zs3y.js +0 -15
  166. package/dist/src/chunk-51567pg8.js +0 -4
  167. package/dist/src/chunk-5agqsfev.js +0 -4
  168. package/dist/src/chunk-5d706gmr.js +0 -4
  169. package/dist/src/chunk-5kd4rqk7.js +0 -5
  170. package/dist/src/chunk-61t538bm.js +0 -4
  171. package/dist/src/chunk-6d3mmqxt.js +0 -54
  172. package/dist/src/chunk-6hyt398x.js +0 -5
  173. package/dist/src/chunk-6mnr8kpm.js +0 -4
  174. package/dist/src/chunk-79q5xsdc.js +0 -42
  175. package/dist/src/chunk-7bdgand3.js +0 -4
  176. package/dist/src/chunk-84cp9dw5.js +0 -4
  177. package/dist/src/chunk-86f2h5ww.js +0 -5
  178. package/dist/src/chunk-8cghfzb2.js +0 -19
  179. package/dist/src/chunk-9tf2p9y9.js +0 -5
  180. package/dist/src/chunk-a2sc4jm0.js +0 -5
  181. package/dist/src/chunk-aa5ng3d1.js +0 -4
  182. package/dist/src/chunk-b3h0a6ca.js +0 -4
  183. package/dist/src/chunk-b6a737qt.js +0 -4
  184. package/dist/src/chunk-bn64x5z5.js +0 -5
  185. package/dist/src/chunk-bvh649za.js +0 -12
  186. package/dist/src/chunk-c9tyfg4j.js +0 -26
  187. package/dist/src/chunk-cfsdfqnm.js +0 -4
  188. package/dist/src/chunk-cxyf04jc.js +0 -7
  189. package/dist/src/chunk-da08tx5v.js +0 -4
  190. package/dist/src/chunk-f2tc08m2.js +0 -4
  191. package/dist/src/chunk-f8tnk179.js +0 -5
  192. package/dist/src/chunk-f9s1kkhx.js +0 -5
  193. package/dist/src/chunk-fbp8a4rx.js +0 -4
  194. package/dist/src/chunk-fd2z0sze.js +0 -4
  195. package/dist/src/chunk-fk927f4q.js +0 -54
  196. package/dist/src/chunk-fxmr3a0f.js +0 -4
  197. package/dist/src/chunk-gaqwhd44.js +0 -4
  198. package/dist/src/chunk-ggtd5x5a.js +0 -5
  199. package/dist/src/chunk-gndcfrm7.js +0 -4
  200. package/dist/src/chunk-h3n4adc6.js +0 -310
  201. package/dist/src/chunk-h5pjbb83.js +0 -4
  202. package/dist/src/chunk-hgnnh302.js +0 -4
  203. package/dist/src/chunk-hmke8nhx.js +0 -5
  204. package/dist/src/chunk-j2bx12hn.js +0 -4
  205. package/dist/src/chunk-j70y1a2g.js +0 -4
  206. package/dist/src/chunk-js1jpyxp.js +0 -6
  207. package/dist/src/chunk-kbjq0qvb.js +0 -4
  208. package/dist/src/chunk-kfwx57xd.js +0 -4
  209. package/dist/src/chunk-kzwctna2.js +0 -4
  210. package/dist/src/chunk-m9ehyehy.js +0 -4
  211. package/dist/src/chunk-mct91p1f.js +0 -4
  212. package/dist/src/chunk-mf9spd4g.js +0 -5
  213. package/dist/src/chunk-mgrcansb.js +0 -4
  214. package/dist/src/chunk-mqc1d0eb.js +0 -6
  215. package/dist/src/chunk-n1zmpk0z.js +0 -4
  216. package/dist/src/chunk-ncyjf63g.js +0 -4
  217. package/dist/src/chunk-nr64d21q.js +0 -973
  218. package/dist/src/chunk-nwm2pq5v.js +0 -168
  219. package/dist/src/chunk-pm06b05d.js +0 -9
  220. package/dist/src/chunk-q50s00ry.js +0 -4
  221. package/dist/src/chunk-qwye1958.js +0 -14
  222. package/dist/src/chunk-r8z9pfve.js +0 -5
  223. package/dist/src/chunk-rdpgkjf6.js +0 -4
  224. package/dist/src/chunk-rkr0dks9.js +0 -5
  225. package/dist/src/chunk-rn84t3sf.js +0 -11
  226. package/dist/src/chunk-s123kn7n.js +0 -4
  227. package/dist/src/chunk-s73qn3fx.js +0 -4
  228. package/dist/src/chunk-sjn0nj4p.js +0 -5
  229. package/dist/src/chunk-sns0c35v.js +0 -7
  230. package/dist/src/chunk-t4dr5c8v.js +0 -8
  231. package/dist/src/chunk-tc8k9c1j.js +0 -4
  232. package/dist/src/chunk-teznhase.js +0 -4
  233. package/dist/src/chunk-ty9xgmz4.js +0 -4
  234. package/dist/src/chunk-tyazf3sk.js +0 -145
  235. package/dist/src/chunk-v6npjrjm.js +0 -5
  236. package/dist/src/chunk-vbvtzkwz.js +0 -5
  237. package/dist/src/chunk-vefd8qee.js +0 -8
  238. package/dist/src/chunk-vs9r72ta.js +0 -17
  239. package/dist/src/chunk-w2mwa0jk.js +0 -4
  240. package/dist/src/chunk-w88k0bgr.js +0 -4
  241. package/dist/src/chunk-wzdt0enk.js +0 -4
  242. package/dist/src/chunk-xhhv854c.js +0 -4
  243. package/dist/src/chunk-y58270hd.js +0 -4
  244. package/dist/src/chunk-yk0hmbex.js +0 -4
  245. package/dist/src/chunk-ympy4fdz.js +0 -28
  246. package/dist/src/chunk-yw436axy.js +0 -4
  247. package/dist/src/chunk-z04jrpjy.js +0 -5
  248. package/dist/src/chunk-z2xznczw.js +0 -4
  249. package/dist/src/chunk-z4xnrgps.js +0 -4
  250. package/dist/src/chunk-z7csyszv.js +0 -4
  251. package/dist/src/chunk-z8t0v07j.js +0 -11
  252. package/dist/src/chunk-z916af47.js +0 -228
  253. package/dist/src/chunk-zcr8he8q.js +0 -5
  254. package/dist/src/chunk-zd9vmkzn.js +0 -9
  255. package/dist/src/chunk-zj939v0h.js +0 -5
  256. package/dist/src/chunk-zkdjwtc1.js +0 -4
  257. package/dist/src/chunk-zkv5kzt6.js +0 -4
@@ -0,0 +1,145 @@
1
+ // @bun
2
+ var{create:Xb,defineProperty:Vn,getOwnPropertyDescriptor:Qb,getOwnPropertyNames:ez,getPrototypeOf:tz}=Object,rz=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wu=(e,t)=>{let r={};for(var o in e)Vn(r,o,{get:e[o],enumerable:!0});if(t)Vn(r,Symbol.toStringTag,{value:"Module"});return r},oz=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=ez(t),s=0,i=n.length,a;s<i;s++)if(a=n[s],!rz.call(e,a)&&a!==r)Vn(e,a,{get:((c)=>t[c]).bind(null,a),enumerable:!(o=Qb(t,a))||o.enumerable})}return e},Hn=(e,t,r)=>(r=e!=null?Xb(tz(e)):{},oz(t||!e||!e.__esModule?Vn(r,"default",{value:e,enumerable:!0}):r,e));var nz=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Yu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),sz=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),iz=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Xu(e){return typeof e==="string"&&Yu.has(e.replace(/#$/,""))}function Qu(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(nz.has(r))return"2020-12";if(Yu.has(r))return"2019-09";if(sz.has(r)||iz.has(r))return"draft-7";throw 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}`)}function jo(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 Ci(e,t="|"){return e.map((r)=>Ai(r)).join(t)}function Mo(e,t){if(typeof t==="bigint")return t.toString();return t}class tl{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Zo(e){return new tl(e)}function rl(e){return e===null||e===void 0}function Bn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ol(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var el=Symbol("evaluating");function nl(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===el)return;if(o===void 0)o=el,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Zt(e){return qo(e._zod.def)??e._zod.def.shape}function sl(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return yt(this,t,o),o},enumerable:!0,configurable:!0})}function il(e,t,r){if(t in e)yt(e,t,r);else e[t]=r}function _r(e,t,r,o){let n=Zt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)sl(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else il(e,s,o?o(i.value,s):i.value)}}function az(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)sl(e,r,()=>t[r]);else il(e,r,o.value)}}function ut(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function al(e){return JSON.stringify(e)}function ul(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ii="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ll=Zo(()=>{if(rt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function yr(e){if(qr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(qr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Ni(e){if(yr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var dl=new Set(["string","number","symbol"]);function Wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function oe(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Ai(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function pl(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Jn=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),ji={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cz(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return _r(s,e,Kn(e,t)),Rt(e,ut(r,{shape:s,checks:[]}))}function Kn(e,t){let r=Zt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function uz(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Kn(e,t)),i={};return _r(i,e,Reflect.ownKeys(Zt(e)).filter((a)=>!s.has(a))),Rt(e,ut(r,{shape:i,checks:[]}))}function lz(e,t){if(!yr(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Zt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Rt(e,ut(e._zod.def,{shape:ml(e,t)}))}function ml(e,t){let r={};return _r(r,e,Reflect.ownKeys(Zt(e))),az(r,t),r}function dz(e,t){if(!yr(t))throw Error("Invalid input to safeExtend: expected a plain object");return Rt(e,ut(e._zod.def,{shape:ml(e,t)}))}function pz(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};_r(r,e,Reflect.ownKeys(Zt(e))),_r(r,t,Reflect.ownKeys(Zt(t)));let o=ut(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Rt(e,o)}function fl(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Kn(t,r)):void 0,c={};return _r(c,t,Reflect.ownKeys(Zt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Rt(t,ut(t._zod.def,{shape:c,checks:[]}))}function mz(e,t,r){let o=r?new Set(Kn(t,r)):void 0,n={};return _r(n,t,Reflect.ownKeys(Zt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Rt(t,ut(t._zod.def,{shape:n}))}function Et(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 hl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Yt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Ao(e){return typeof e==="string"?e:e?.message}function Zi(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;if(n>=0)t.push([n,r])}return t}function Gn(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Tt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Ao(e.inst?._zod.def?.error?.(e))??Ao(s?.(e))??Ao(t?.error?.(e))??Ao(r.customError?.(e))??Ao(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var fz=/[\uD800-\uDBFF]/;function Wn(e){let t=e.length;if(!fz.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Yn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function gl(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 vr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function _l(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else hz(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 Xn(e,t,r){return qt(e,t,r,!1)}function yl(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 hz(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 gz(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Oi,Gt=!1,_z={configurable:!0,get(){Gt=!0;return}};function ve(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Oi!==e._zod){Oi=void 0;return}Oi=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,_z);let n=Gt;Gt=!1;try{let s=r(this);if(Gt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return Gt=Gt||n,s}catch(s){throw delete this[t],Gt=Gt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function yz(e,t,r,o){let n=gz(e,t);if(!n)return;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 vz="~constantCatch";function vl(e){let t=()=>e;return t[vz]=!0,t}var Sl,Li=Object.freeze({status:"aborted"}),qi={value:void 0,enumerable:!1},bl="captureStackTrace"in Error?Error:null;function Sz(e){let t=bl;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return bl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function L(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){qi.value=new s(h);try{Object.defineProperty(m,"_zod",qi)}finally{qi.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),_l(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?Sz(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class Ot extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lo extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Sl=globalThis).__zod_globalConfig??(Sl.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ot(e){if(e)Object.assign(rt,e);return rt}function bz(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Mo,2)),e.message}function zz(e){this._zod.message=e}var $z={get:bz,set:zz,enumerable:!0,configurable:!0},Ui={value:void 0,enumerable:!1},zl=new WeakSet([Object.prototype,Error.prototype]),$l=(e,t)=>{e.name="$ZodError",Ui.value=t,Object.defineProperty(e,"issues",Ui),Ui.value=void 0,Object.defineProperty(e,"message",$z);let r=Object.getPrototypeOf(e);if(!zl.has(r))zl.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})}})},Rl=L("$ZodError",$l),wT=L("$ZodError",$l,void 0,{Parent:Error});function Rz(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Fi(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)Rz(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Hi(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function Qn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var es=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new Ot;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw Ii(c,s?.callee??t),c}return a.value};return t};var ts=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw Ii(c,s?.callee??t),c}return a.value};return t};var rs=(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 Ot;return s.issues.length?wl(e,s.issues,n):{success:!0,data:s.value}};function wl(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Tt(n,r,ot()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var os=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?wl(e,s.issues,n):{success:!0,data:s.value}};var wz=Symbol.for("zod.compile.invalid"),Pz=Symbol.for("zod.compile.fallback"),Bi=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==wz)return!0;if(o.definite===!0&&r===void 0)return!1}return kz(e,t,r)};function kz(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[Pz]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new Ot;return s.issues.length===0}var Ji=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Pl=(e)=>{let t=es(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,Qn(r,i))};return r};var kl=(e)=>{let t=es(e),r=(o,n,s,i)=>t(o,n,s,Qn(r,i));return r};var xl=(e)=>{let t=ts(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,Qn(r,i))};return r};var El=(e)=>{let t=ts(e),r=async(o,n,s,i)=>await t(o,n,s,Qn(r,i));return r};var Tl=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return rs(e)(t,r,n)};var Ol=(e)=>(t,r,o)=>rs(e)(t,r,o);var Cl=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return os(e)(t,r,n)};var Il=(e)=>async(t,r,o)=>os(e)(t,r,o);var Nl=/^[cC][0-9a-z]{6,}$/,Al=/^[0-9a-z]+$/,jl=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ml=/^[0-9a-vA-V]{20}$/,Zl=/^[A-Za-z0-9]{27}$/,ql=/^[a-zA-Z0-9_-]{21}$/;function Ll(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Dl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Ul=/^([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})$/,Gi=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var Fl=/^(?:[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 xz="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Vl(){return new RegExp(xz,"u")}var Hl=/^(?:(?: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])$/,Bl=/^(([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 Jl=/^((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])$/,Kl=/^(([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])$/,Gl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wl=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Yl=/^https?$/,Xl=/^\+[1-9]\d{6,14}$/;var Ql="(?:(?:\\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 Ez(e){return new RegExp(`^${e}$`)}var ed=Ez(Ql);function Ki(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function td(e){return new RegExp(`^${Ki(e)}$`)}function rd(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ki({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ki({precision:e.precision})}`:r;return new RegExp(`^${Ql}T(?:${o})$`)}var od=/^[\s\S]{0,}$/;var Yi=/^-?\d+$/,Do=/^-?\d+(?:\.\d+)?$/,nd=/^(?:true|false)$/i,sd=/^null$/i;var id=/^[^A-Z]*$/,ad=/^[^a-z]*$/;var Je=L("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Xi=(e)=>{let t=e.value;return!rl(t)&&t.length!==void 0},ns={number:"number",bigint:"bigint",object:"date"},Qi=L("$ZodCheckLessThan",(e,t)=>{Je.init(e,t);let r=ns[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:ns[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})}}),ea=L("$ZodCheckGreaterThan",(e,t)=>{Je.init(e,t);let r=ns[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:ns[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})}}),cd=L("$ZodCheckMultipleOf",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ol(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ud=L("$ZodCheckNumberFormat",(e,t)=>{Je.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Jn[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var ld=L("$ZodCheckMaxLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=Xi),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?Wn(n):s)<=t.maximum)return;let a=Yn(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dd=L("$ZodCheckMinLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=Xi),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?Wn(n):s)>=t.minimum)return;let a=Yn(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pd=L("$ZodCheckLengthEquals",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=Xi),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?Wn(n):s;if(i===t.length)return;let a=Yn(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=L("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Je.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),md=L("$ZodCheckRegex",(e,t)=>{Uo.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fd=L("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=id),Uo.init(e,t)}),hd=L("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ad),Uo.init(e,t)}),gd=L("$ZodCheckIncludes",(e,t)=>{Je.init(e,t);let r=Wt(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),_d=L("$ZodCheckStartsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`^${Wt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),yd=L("$ZodCheckEndsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`.*${Wt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var vd=L("$ZodCheckOverwrite",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class ta{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
+ `).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
+ ${t.join(`
5
+ `)}
6
+ };`)(...Object.values(this.closed))}}var bd={major:4,minor:6,patch:7};var xe=L("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bd;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=(a,c,u)=>{if(a.memo)return a;let l=Et(a),d;for(let m of c){if(m._zod.def.when){if(hl(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new Ot;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Gn(a.issues,h,e),!l)l=Et(a,h)});else{if(a.issues.length===h)continue;if(Gn(a.issues,h,e),!l)l=Et(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(Et(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new Ot;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Xn(this,"~standard",na(this))},set "~standard"(e){qt(this,"~standard",e)}}),Cd=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Tt(r,t,ot()))}:{value:e.value};async function Tz(e,t){let r={async:!0};return Cd(await e._zod.run({value:t,issues:[]},r),r)}function na(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Cd(o,r)}catch(o){}return Tz(e,t)},vendor:"zod",version:1}}var us=L("$ZodString",(e,t)=>{xe.init(e,t),e._zod.pattern=t.pattern??od,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ne=L("$ZodStringFormat",(e,t)=>{Uo.init(e,t),us.init(e,t)}),Id=L("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ul),Ne.init(e,t)}),Nd=L("$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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gi(o))}else t.pattern??(t.pattern=Gi());Ne.init(e,t)}),Ad=L("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fl),Ne.init(e,t)}),jd=1,is=2;function Md(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Oz(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Md(e)||is;return Cz(e,t)}function Cz(e,t){if(!t.normalize&&t.protocol?.source===Yl.source&&!/^https?:\/\//i.test(e))return jd;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??is}return new URL(e)}catch{return is}}var Iz=/[\t\n\r]/g;function zd(e){return e.replace(Iz,"")}function Nz(e,t){return t.lastIndex=0,t.test(e.hostname)}function Az(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Zd=L("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=Oz(o,t);if(n===jd){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===is){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=zd(o);return}if(t.hostname&&!Nz(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});if(t.protocol&&!Az(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:zd(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),qd=L("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vl()),Ne.init(e,t)}),Ld=L("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?ql:Ll(t.length)),Ne.init(e,t)}),Dd=L("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Nl),Ne.init(e,t)}),Ud=L("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Al),Ne.init(e,t)}),Fd=L("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jl),Ne.init(e,t)}),Vd=L("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ml),Ne.init(e,t)}),Hd=L("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Zl),Ne.init(e,t)}),Bd=L("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=rd(t)),Ne.init(e,t)}),Jd=L("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ed),Ne.init(e,t)}),Kd=L("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=td(t)),Ne.init(e,t)}),Gd=L("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dl),Ne.init(e,t)}),Wd=L("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Hl),Ne.init(e,t)}),jz=/^[0-9a-fA-F:.]+$/;function Yd(e){if(!jz.test(e))return!1;return Md(`http://[${e}]`)}var Xd=L("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bl),Ne.init(e,t),e._zod.check=(r)=>{if(!Yd(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Qd=L("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jl),Ne.init(e,t)});function Mz(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return Yd(r)}var ep=L("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kl),Ne.init(e,t),e._zod.check=(r)=>{if(!Mz(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function tp(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ia=/^[0-9a-zA-Z+/]*={0,2}$/,rp=L("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ia),Ne.init(e,t),e._zod.check=(r)=>{if(tp(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ls=/^[A-Za-z0-9_-]*$/;function Zz(e){if(!ls.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return tp(r)}var op=L("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ls),Ne.init(e,t),e._zod.check=(r)=>{if(Zz(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),np=L("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Xl),Ne.init(e,t)});function qz(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));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var sp=L("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{if(qz(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var aa=L("$ZodNumber",(e,t)=>{xe.init(e,t),e._zod.pattern=Do,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}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)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),ip=L("$ZodNumberFormat",(e,t)=>{ud.init(e,t),aa.init(e,t)}),ap=L("$ZodBoolean",(e,t)=>{xe.init(e,t),e._zod.pattern=nd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var cp=L("$ZodNull",(e,t)=>{xe.init(e,t),e._zod.pattern=sd,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),up=L("$ZodAny",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),lp=L("$ZodUnknown",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),dp=L("$ZodNever",(e,t)=>{xe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Lz(e,t){let r=Zi(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 a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of Zi(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Gn(s.issues,l,e),s}}return n(s,i)}}var Dz=(e)=>Array.isArray(e)?e.length:-1;function $d(e,t,r){if(e.issues.length)t.issues.push(...Yt(r,e.issues));t.value[r]=e.value}var pp=L("$ZodArray",(e,t)=>{xe.init(e,t);let r=rt.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=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>$d(d,o,c)));else if($d(l,o,c),a&&l.issues.length!==0&&Et(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},Lz(e,Dz)});function as(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...Yt(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var Uz=[];function hp(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:Uz,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=pl(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function gp(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(Et(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>as(y,r,f,t,d,m)));else as(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Fz=L("$ZodObject",(e,t)=>{xe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Zo(()=>hp(t));ve(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))yt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=qr,i=t.catchall,a,c=rt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(Et(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,x=g._zod.run({value:d[y],issues:[]},l);if(x instanceof Promise)m.push(x.then((O)=>as(O,u,y,d,P,w)));else as(x,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return gp(m,d,u,l,n.value,e,f===!0)}}),_p=L("$ZodObjectJIT",(e,t)=>{Fz.init(e,t);let r=e._zod.parse,o=Zo(()=>hp(t)),n=rt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new ta(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(O)=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,P=(O,R)=>`
7
+ let ${O}_ab = false;
8
+ for (let i = 0; i < ${O}.issues.length; i++) {
9
+ const iss = ${O}.issues[i];
10
+ iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
11
+ payload.issues.push(iss);
12
+ if (iss.continue !== true) ${O}_ab = true;
13
+ }
14
+ if (${O}_ab && ctx && ctx.abortEarly) {
15
+ payload.value = newResult;
16
+ return payload;
17
+ }`;y.write("const input = payload.value;");let w=Object.create(null),x=0;for(let O of f.allKeys)w[O]=`key_${x++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of f.allKeys){if(O==="__proto__")continue;let R=w[O],S=typeof O==="symbol"?`syms[${v.indexOf(O)}]`:al(O),E=`${S} in input`,A=h[O],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
18
+ const ${R}_present = ${E};
19
+ if (!${R}.issues.length || ${R}_present) {
20
+ if (${R}.issues.length) {${P(R,S)}
21
+ }
22
+
23
+ if (${W}) {
24
+ newResult[${S}] = ${R}.value;
25
+ }
26
+ }
27
+
28
+ `)}else if(!j)y.write(`
29
+ const ${R}_present = ${E};
30
+ if (${R}.issues.length) {${P(R,S)}
31
+ }
32
+ if (!${R}_present && !${R}.issues.length) {
33
+ payload.issues.push({
34
+ code: "invalid_type",
35
+ expected: "nonoptional",
36
+ input: undefined,
37
+ path: [${S}]
38
+ });
39
+ if (ctx && ctx.abortEarly) {
40
+ payload.value = newResult;
41
+ return payload;
42
+ }
43
+ }
44
+
45
+ if (${R}_present) {
46
+ newResult[${S}] = ${R}.value;
47
+ }
48
+
49
+ `);else if(y.write(`
50
+ if (${R}.issues.length) {${P(R,S)}
51
+ }
52
+ `),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
53
+ if (${R}.value !== undefined || ${E}) {
54
+ newResult[${S}] = ${R}.value;
55
+ }
56
+ `)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=qr,c=!rt.jitless,l=c&&ll.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return gp([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function Rd(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)=>!Et(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Tt(i,o,ot())))}),t}var ca=L("$ZodUnion",(e,t)=>{xe.init(e,t),ve(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),ve(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),ve(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)));return}),ve(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)=>Bn(s.source)).join("|")})$`)}return});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 a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return Rd(i,o,e,n);return Promise.all(i).then((a)=>Rd(a,o,e,n))}});function Vz(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw 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 Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var yp=L("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ca.init(e,t);let r=e._zod.parse;ve(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))yt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Zo(()=>Vz(t));e._zod.parse=(n,s)=>{let i=n.value;if(!qr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return 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}}),vp=L("$ZodIntersection",(e,t)=>{xe.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);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>wd(r,c,u));return wd(r,s,i)}});function ra(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(yr(e)&&yr(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=ra(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=ra(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 wd(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=ra(t.value,r.value);if(!c.valid){if(Et(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Sp=L("$ZodRecord",(e,t)=>{xe.init(e,t);let r=rt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!yr(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Tt(f,n,ot())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(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 c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&Do.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Tt(f,n,ot())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var bp=L("$ZodEnum",(e,t)=>{xe.init(e,t);let r=jo(t.entries),o=new Set(r);e._zod.values=o,ve(e,"pattern",(n)=>{let s=jo(n.def.entries).filter((i)=>dl.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>Wt(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),zp=L("$ZodLiteral",(e,t)=>{xe.init(e,t);let r=new Set(t.values);e._zod.values=r,ve(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?Wt(s):s?Wt(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var $p=L("$ZodTransform",(e,t)=>{xe.init(e,t),e._zod.optin="optional",rt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(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 Ot;return r.value=n,r}});function Pd(e,t){return e.value=t.issues.length?void 0:t.value,e}var ua=L("$ZodOptional",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ve(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ve(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Bn(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);if(n instanceof Promise)return n.then((s)=>Pd(r,s));return Pd(r,n)}return t.innerType._zod.run(r,o)}}),Rp=L("$ZodExactOptional",(e,t)=>{ua.init(e,t),ve(e,"values",(r)=>r.def.innerType._zod.values),ve(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),wp=L("$ZodNullable",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin),ve(e,"optout",(r)=>r.def.innerType._zod.optout),ve(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Bn(o.source)}|null)$`):void 0}),ve(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Pp=L("$ZodDefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",ve(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);if(n instanceof Promise)return n.then((s)=>kd(s,t));return kd(n,t)}});function kd(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var kp=L("$ZodPrefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",ve(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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),xp=L("$ZodNonOptional",(e,t)=>{xe.init(e,t),ve(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);if(n instanceof Promise)return n.then((s)=>xd(s,e));return xd(n,e)}});function xd(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Ed(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Tt(n,o,ot()))},input:e.value}),e}var Ep=L("$ZodCatch",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ve(e,"optout",(r)=>r.def.innerType._zod.optout),ve(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);if(n instanceof Promise)return n.then((s)=>Ed(r,s,t,o));return Ed(r,n,t,o)}});var la=L("$ZodPipe",(e,t)=>{xe.init(e,t),ve(e,"values",(r)=>r.def.in._zod.values),ve(e,"optin",(r)=>r.def.in._zod.optin),ve(e,"optout",(r)=>r.def.out._zod.optout),ve(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);if(s instanceof Promise)return s.then((i)=>ss(i,t.in,o));return ss(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>ss(s,t.out,o));return ss(n,t.out,o)}});function ss(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Tp=L("$ZodPreprocess",(e,t)=>{la.init(e,t)}),Op=L("$ZodReadonly",(e,t)=>{xe.init(e,t),ve(e,"propValues",(r)=>r.def.innerType._zod.propValues),ve(e,"values",(r)=>r.def.innerType._zod.values),ve(e,"optin",(r)=>r.def.innerType?._zod?.optin),ve(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);if(n instanceof Promise)return n.then(Td);return Td(n)}});function Td(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Cp=L("$ZodLazy",(e,t)=>{xe.init(e,t),nl(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),ve(e,"pattern",(r)=>r.innerType?._zod?.pattern),ve(e,"propValues",(r)=>r.innerType?._zod?.propValues),ve(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),ve(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Ip=L("$ZodCustom",(e,t)=>{Je.init(e,t),xe.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)=>Od(s,r,o,e));Od(n,r,o,e);return}});function Od(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(vr(n))}}class Ap extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var pa="~memo",Np=[];function jp(e){return e!==null&&typeof e==="object"}function da(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Mp=new WeakMap,Fo=0,ms=1,Vo=2;function fs(e,t,r){let o=Mp.get(e);if(o!==void 0)return o?Vo:Fo;if(t.has(e))return Vo;t.add(e);let n=Fo,s=(l)=>{if(n!==Vo&&l?._zod){let d=fs(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=Fo;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?ms:f.value?._zod?fs(f.value,t,r):Fo;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=qo(c);a(l?i(l,!0):ms),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?fs(l,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 l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),Hz(e,n)}function Hz(e,t){if(t!==ms)Mp.set(e,t===Vo);return t}function Bz(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var ds,ps=[],Jz={alloc(e,t,r){let o=ds;if(!o)return r;ds=void 0;let n={value:r,issues:null};return o.set(t.value,n),ps.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"&&Kz(s,n.value))throw new Ap;return r(n,s)};if(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,a=(c,u)=>{if(r===void 0){let g=fs(e,new Set,!1);if(g===Fo){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===Vo||o)r=!0;else o=!0}let l=c.value;if(!jp(l))return i(c,u);let d=u[pa];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[pa]=d;let m;if(n===u)m=s;else m=Bz(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...da(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}ds=m;let f=ps.length,v=i(c,u);ds=void 0;let y=ps.length>f?ps.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?da(g.issues):Np;return g});if(y)y.issues=v.issues.length?da(v.issues):Np;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function ma(){return Jz}function Kz(e,t){let r=e[pa]?.backEdges;return r!==void 0&&jp(t)&&r.has(t)}var Gz=()=>{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){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=gl(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Ai(s.values[0])}`;return`Invalid option: expected one of ${Ci(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`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":""}: ${Ci(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function fa(){return{localeError:Gz()}}var Zp;class qp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Lp(){return new qp}(Zp=globalThis).__zod_globalRegistry??(Zp.__zod_globalRegistry=Lp());var Xt=globalThis.__zod_globalRegistry;function ha(e){if(e.checks)e.checks=[...e.checks];return e}function Dp(e,t){return new e(ha({type:"string",...oe(t)}))}function Up(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function Fp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function Vp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function Hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function Bp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function Jp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function Kp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function Gp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function Wp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function Yp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function Xp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function Qp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function em(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function tm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function rm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function om(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function nm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function sm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function im(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function am(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function cm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function hs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function _a(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function ya(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function va(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function um(e,t){return new e(ha({type:"number",checks:[],...oe(t)}))}function lm(e,t){return new e(ha({type:"number",coerce:!0,checks:[],...oe(t)}))}function dm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function pm(e,t){return new e({type:"boolean",...oe(t)})}function mm(e,t){return new e({type:"null",...oe(t)})}function fm(e){return new e({type:"any"})}function hm(e){return new e({type:"unknown"})}function gm(e,t){return new e({type:"never",...oe(t)})}function gs(e,t){return new Qi({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ho(e,t){return new Qi({check:"less_than",...oe(t),value:e,inclusive:!0})}function _s(e,t){return new ea({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Bo(e,t){return new ea({check:"greater_than",...oe(t),value:e,inclusive:!0})}function ys(e,t){return new cd({check:"multiple_of",...oe(t),value:e})}function vs(e,t){return new ld({check:"max_length",...oe(t),maximum:e})}function Dr(e,t){return new dd({check:"min_length",...oe(t),minimum:e})}function Ss(e,t){return new pd({check:"length_equals",...oe(t),length:e})}function Sa(e,t){return new md({check:"string_format",format:"regex",...oe(t),pattern:e})}function ba(e){return new fd({check:"string_format",format:"lowercase",...oe(e)})}function za(e){return new hd({check:"string_format",format:"uppercase",...oe(e)})}function $a(e,t){return new gd({check:"string_format",format:"includes",...oe(t),includes:e})}function Ra(e,t){return new _d({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function wa(e,t){return new yd({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function Qt(e){return new vd({check:"overwrite",tx:e})}function Pa(e){return Qt((t)=>t.normalize(e))}function ka(){return Qt((e)=>e.trim())}function xa(){return Qt((e)=>e.toLowerCase())}function Ea(){return Qt((e)=>e.toUpperCase())}function Ta(){return Qt((e)=>ul(e))}function ym(e,t,r){return new e({type:"array",element:t,...oe(r)})}function vm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...oe(r)})}function Sm(e,t){let r=Wz((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(vr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(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(vr(s))}},e(o.value,o)),t);return r}function Wz(e,t){let r=new Je({check:"custom",...oe(t)});return r._zod.check=e,r}function Jo(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))yt(e,o,r[o]);return e}function Ia(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Xt,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 Lt(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 Error(n);return Object.assign(r,s),!0}function Ue(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return 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 a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ue(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Jo(i.schema,c);if(t.io==="input"&&Qe(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function bm(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Na(e,t){let r=e.seen.get(t);if(!r)throw 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 a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${bm(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+bm(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
57
+
58
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=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(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Rm(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;Rm(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;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var wm=new Set(["type","properties","required","additionalProperties"]),zm=["oneOf","anyOf"];function $m(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Ca(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!wm.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 a=[];for(let u of t){let l=u.properties?.[i]??$m(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:Ca(a)??{allOf:a};yt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=$m(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function Yz(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of wm)if(n in e)return;let r=t.filter((n)=>zm.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=Ca(t);else{let n=r[0],s=zm.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>Ca([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,Jo(e,o)}function Aa(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else Jo(u,f);if(Jo(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Rm(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])Yz(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Jo(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;yt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ko(t,"input",e.processors),output:Ko(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function Qe(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 Qe(o.element,r);if(o.type==="set")return Qe(o.valueType,r);if(o.type==="lazy")return Qe(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 Qe(o.innerType,r);if(o.type==="intersection")return Qe(o.left,r)||Qe(o.right,r);if(o.type==="record"||o.type==="map")return Qe(o.keyType,r)||Qe(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Qe(o.in,r)||Qe(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(Qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Qe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Qe(n,r))return!0;if(o.rest&&Qe(o.rest,r))return!0;return!1}return!1}var Pm=(e,t={})=>(r)=>{let o=Ia({...r,processors:t});return Ue(e,o),Na(o,e),Aa(o,e)},Ko=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=Ia({...n??{},target:s,io:t,processors:r});return Ue(e,i),Na(i,e),Aa(i,e)};var Ur=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Fr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},km=(e,t)=>{Ur(e,"minimum",t),Fr(e,"maximum",t)},Nm=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Am=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},jm=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Zm=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Em=(e,t)=>Ur(e,"minimum",t.minimum),Tm=(e,t)=>Fr(e,"maximum",t.maximum),Im=(e)=>(t,r)=>{Zm(t,r.format);let[o,n]=e[r.format];Ur(t,"minimum",o),Fr(t,"maximum",n)},Xz={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)=>Nm(e,t.value),number_format:Im(Jn),bigint_format:Im(ji),min_length:Em,max_length:Tm,length_equals:(e,t)=>km(e,t.length),min_size:Em,max_size:Tm,size_equals:(e,t)=>km(e,t.size),string_format:(e,t)=>{if(Zm(e,t.format),t.pattern)Am(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>jm(e,t.mime)};function St(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)Xz[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Ur(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Ur(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Fr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Fr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Nm(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)jm(t,n.mime);for(let s of n.patterns??[])Am(t,s);return t}var Qz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},e$=new Map([[ia,Gl],[ls,Wl]]),qm=(e)=>e$.get(e)??e,Lm=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=St(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=Qz[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(qm);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Um=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=St(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Lt(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Fm=(e,t,r,o)=>{r.type="boolean"};var Vm=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var Hm=(e,t,r,o)=>{r.not={}},Bm=(e,t,r,o)=>{},Jm=(e,t,r,o)=>{};var Km=(e,t,r,o)=>{let n=e._zod.def,s=jo(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gm=(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(Lt(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Lt(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);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}};var Wm=(e,t,r,o)=>{Lt(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Ym=(e,t,r,o)=>{Lt(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Xm=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=St(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ue(s.element,t,{...o,path:[...o.path,"items"]})};function bs(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return bs(t.out);if(t.type==="catch")return bs(t.innerType);return e._zod.optin}var Qm=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Lt(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)yt(n.properties,u,Ue(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?bs(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ue(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},ef=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ue(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tf=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ue(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)};function ja(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=ja(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>ja(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?Do:Yi).source;return h}var Ma=new WeakMap;function t$(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Ma.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=ja(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var rf=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=St(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ue(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)yt(n.patternProperties,qm(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ue(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Ma.get(t);if(!l)l=[],Ma.set(t,l),t.deferred.push(()=>t$(t));l.push(e)}n.additionalProperties=Ue(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&bs(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},of=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Za=Symbol();function sf(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Lt(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Za}var af=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r.default=i},cf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r._prefault=i},uf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Lt(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},lf=(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;Ue(i,t,o);let a=t.seen.get(e);a.ref=i},df=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0};var qa=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},pf=(e,t,r,o)=>{let n=e._zod.innerType;Ue(n,t,o);let s=t.seen.get(e);s.ref=n};var mf=new WeakSet([Object.prototype,Error.prototype]);function zs(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 l$=(e,t)=>{Rl.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(mf.has(r))return;mf.add(r),zs(r,"format",(o)=>(n)=>Hi(o,n)),zs(r,"flatten",(o)=>(n)=>Fi(o,n)),zs(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Mo,2)}),zs(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Mo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var lt=L("ZodError",l$,void 0,{Parent:Error});var ff=es(lt),hf=ts(lt),gf=rs(lt),_f=os(lt),yf=Pl(lt),vf=kl(lt),Sf=xl(lt),bf=El(lt),zf=Tl(lt),$f=Ol(lt),Rf=Cl(lt),wf=Il(lt);function p$(){if(!rt.localeError)ot(fa())}function Rs(){if(!rt.memoizer)ot({memoizer:ma()})}var Te=L("ZodType",(e,t)=>(p$(),xe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ut(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 Rt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(t0(e,t))},superRefine(e,t){return this.check(r0(e,t))},overwrite(e){return this.check(Qt(e))},optional(){return Me(this)},exactOptional(){return D$(this)},nullable(){return xf(this)},nullish(){return Me(xf(this))},nonoptional(e){return J$(this,e)},array(){return Re(this)},or(e){return zn([this,e])},and(e){return Ps(this,e)},transform(e){return Ef(this,Df(e))},default(e){return V$(this,e)},prefault(e){return B$(this,e)},catch(e){return G$(this,e)},pipe(e){return Ef(this,e)},readonly(){return X$(this)},describe(e){let t=this.clone();return Xt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xt.get(this);let t=this.clone();return Xt.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 Xn(this,"~standard",{...na(this),jsonSchema:{input:Ko(this,"input"),output:Ko(this,"output")}})},set "~standard"(e){qt(this,"~standard",e)},parse:function e(t,r){return ff(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await hf(this,t,r,{callee:e})},safeParse(e,t){return gf(this,e,t)},async safeParseAsync(e,t){return _f(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qt(this,"spa",e)},validate(e,t){return Bi(this,e,t)},validateAsync(e,t){return Ji(this,e,t)},encode:function e(t,r){return yf(this,t,r,{callee:e})},decode:function e(t,r){return vf(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Sf(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await bf(this,t,r,{callee:e})},safeEncode(e,t){return zf(this,e,t)},safeDecode(e,t){return $f(this,e,t)},async safeEncodeAsync(e,t){return Rf(this,e,t)},async safeDecodeAsync(e,t){return wf(this,e,t)},toJSONSchema(e){return Pm(this,{})(e)},get description(){return Xt.get(this)?.description},get _def(){return this._zod.def}}),Tf=L("_ZodString",(e,t)=>{us.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lm(e,r,o,n)},yl({format:(e)=>St(e).format??null,minLength:(e)=>St(e).minimum??null,maxLength:(e)=>St(e).maximum??null},{regex(...e){return this.check(Sa(...e))},includes(...e){return this.check($a(...e))},startsWith(...e){return this.check(Ra(...e))},endsWith(...e){return this.check(wa(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(vs(...e))},length(...e){return this.check(Ss(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(ba(e))},uppercase(e){return this.check(za(e))},trim(){return this.check(ka())},normalize(...e){return this.check(Pa(...e))},toLowerCase(){return this.check(xa())},toUpperCase(){return this.check(Ea())},slugify(){return this.check(Ta())}})),Of=L("ZodString",(e,t)=>{us.init(e,t),Tf.init(e,t)},{email(e){return this.check(Up(m$,e))},url(e){return this.check(ga(Af,e))},jwt(e){return this.check(cm(E$,e))},emoji(e){return this.check(Kp(h$,e))},guid(e){return this.check(Fp(f$,e))},uuid(e){return this.check(Vp($s,e))},uuidv4(e){return this.check(Hp($s,e))},uuidv6(e){return this.check(Bp($s,e))},uuidv7(e){return this.check(Jp($s,e))},nanoid(e){return this.check(Gp(g$,e))},cuid(e){return this.check(Wp(_$,e))},cuid2(e){return this.check(Yp(y$,e))},ulid(e){return this.check(Xp(v$,e))},base64(e){return this.check(sm(P$,e))},base64url(e){return this.check(im(k$,e))},xid(e){return this.check(Qp(S$,e))},ksuid(e){return this.check(em(b$,e))},ipv4(e){return this.check(tm(z$,e))},ipv6(e){return this.check(rm($$,e))},cidrv4(e){return this.check(om(R$,e))},cidrv6(e){return this.check(nm(w$,e))},e164(e){return this.check(am(x$,e))},datetime(e){return this.check(hs(Da,e))},date(e){return this.check(_a(Cf,e))},time(e){return this.check(ya(If,e))},duration(e){return this.check(va(Nf,e))}});function C(e){return Dp(Of,e)}var qe=L("ZodStringFormat",(e,t)=>{Ne.init(e,t),Tf.init(e,t)}),Da=L("ZodISODateTime",(e,t)=>{Bd.init(e,t),qe.init(e,t)}),Cf=L("ZodISODate",(e,t)=>{Jd.init(e,t),qe.init(e,t)}),If=L("ZodISOTime",(e,t)=>{Kd.init(e,t),qe.init(e,t)}),Nf=L("ZodISODuration",(e,t)=>{Gd.init(e,t),qe.init(e,t)}),m$=L("ZodEmail",(e,t)=>{Ad.init(e,t),qe.init(e,t)});var f$=L("ZodGUID",(e,t)=>{Id.init(e,t),qe.init(e,t)});var $s=L("ZodUUID",(e,t)=>{Nd.init(e,t),qe.init(e,t)});var Af=L("ZodURL",(e,t)=>{Zd.init(e,t),qe.init(e,t)});function jf(e){return ga(Af,e)}var h$=L("ZodEmoji",(e,t)=>{qd.init(e,t),qe.init(e,t)});var g$=L("ZodNanoID",(e,t)=>{Ld.init(e,t),qe.init(e,t)});var _$=L("ZodCUID",(e,t)=>{Dd.init(e,t),qe.init(e,t)});var y$=L("ZodCUID2",(e,t)=>{Ud.init(e,t),qe.init(e,t)});var v$=L("ZodULID",(e,t)=>{Fd.init(e,t),qe.init(e,t)});var S$=L("ZodXID",(e,t)=>{Vd.init(e,t),qe.init(e,t)});var b$=L("ZodKSUID",(e,t)=>{Hd.init(e,t),qe.init(e,t)});var z$=L("ZodIPv4",(e,t)=>{Wd.init(e,t),qe.init(e,t)});var $$=L("ZodIPv6",(e,t)=>{Xd.init(e,t),qe.init(e,t)});var R$=L("ZodCIDRv4",(e,t)=>{Qd.init(e,t),qe.init(e,t)});var w$=L("ZodCIDRv6",(e,t)=>{ep.init(e,t),qe.init(e,t)});var P$=L("ZodBase64",(e,t)=>{rp.init(e,t),qe.init(e,t)});var k$=L("ZodBase64URL",(e,t)=>{op.init(e,t),qe.init(e,t)});var x$=L("ZodE164",(e,t)=>{np.init(e,t),qe.init(e,t)});var E$=L("ZodJWT",(e,t)=>{sp.init(e,t),qe.init(e,t)});var ws=L("ZodNumber",(e,t)=>{aa.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.isFinite=!0},yl({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=St(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=St(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=St(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>St(e).format??null},{gt(e,t){return this.check(_s(e,t))},gte(e,t){return this.check(Bo(e,t))},min(e,t){return this.check(Bo(e,t))},lt(e,t){return this.check(gs(e,t))},lte(e,t){return this.check(Ho(e,t))},max(e,t){return this.check(Ho(e,t))},int(e){return this.check(Pf(e))},safe(e){return this.check(Pf(e))},positive(e){return this.check(_s(0,e))},nonnegative(e){return this.check(Bo(0,e))},negative(e){return this.check(gs(0,e))},nonpositive(e){return this.check(Ho(0,e))},multipleOf(e,t){return this.check(ys(e,t))},step(e,t){return this.check(ys(e,t))},finite(){return this}}));function pr(e){return um(ws,e)}var T$=L("ZodNumberFormat",(e,t)=>{ip.init(e,t),ws.init(e,t)});function Pf(e){return dm(T$,e)}var Mf=L("ZodBoolean",(e,t)=>{ap.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n)});function Er(e){return pm(Mf,e)}var O$=L("ZodNull",(e,t)=>{cp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vm(e,r,o,n)});function Ua(e){return mm(O$,e)}var C$=L("ZodAny",(e,t)=>{up.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bm(e,r,o,n)});function Zf(){return fm(C$)}var I$=L("ZodUnknown",(e,t)=>{lp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jm(e,r,o,n)});function Mi(){return hm(I$)}var N$=L("ZodNever",(e,t)=>{dp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hm(e,r,o,n)});function A$(e){return gm(N$,e)}var j$=L("ZodArray",(e,t)=>{Rs(),pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xm(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Dr(e,t))},nonempty(e){return this.check(Dr(1,e))},max(e,t){return this.check(vs(e,t))},length(e,t){return this.check(Ss(e,t))},unwrap(){return this.element}});function Re(e,t){return ym(j$,e,t)}var qf=L("ZodObject",(e,t)=>{Rs(),_p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qm(e,r,o,n),yz(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return vc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ut(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ut(this._zod.def,{catchall:Mi()}))},loose(){return this.clone(ut(this._zod.def,{catchall:Mi()}))},strict(){return this.clone(ut(this._zod.def,{catchall:A$()}))},strip(){return this.clone(ut(this._zod.def,{catchall:void 0}))},extend(e){return lz(this,e)},safeExtend(e){return dz(this,e)},merge(e){return pz(this,e)},pick(e){return cz(this,e)},omit(e){return uz(this,e)},partial(...e){return fl(Uf,this,e[0])},exactPartial(...e){return fl(Ff,this,e[0],"exactPartial")},required(...e){return mz(Vf,this,e[0])}});function X(e,t){let r={type:"object",shape:e??{},...oe(t)};return new qf(r)}function Rn(e,t){return new qf({type:"object",shape:e,catchall:Mi(),...oe(t)})}var Lf=L("ZodUnion",(e,t)=>{ca.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ef(e,r,o,n),e.options=t.options});function zn(e,t){return new Lf({type:"union",options:e,...oe(t)})}var M$=L("ZodDiscriminatedUnion",(e,t)=>{Lf.init(e,t),yp.init(e,t)});function Fa(e,t,r){return new M$({type:"union",options:t,discriminator:e,...oe(r)})}var Z$=L("ZodIntersection",(e,t)=>{vp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tf(e,r,o,n)});function Ps(e,t){return new Z$({type:"intersection",left:e,right:t})}var kf=L("ZodRecord",(e,t)=>{Rs(),Sp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function wi(e,t,r){if(!t||!t._zod)return new kf({type:"record",keyType:C(),valueType:e,...oe(t)});return new kf({type:"record",keyType:e,valueType:t,...oe(r)})}var La=L("ZodEnum",(e,t)=>{bp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Km(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 Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(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 Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(n),entries:s})}});function vc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new La({type:"enum",entries:r,...oe(t)})}var q$=L("ZodLiteral",(e,t)=>{zp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gm(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ke(e,t){return new q$({type:"literal",values:Array.isArray(e)?e:[e],...oe(t)})}var L$=L("ZodTransform",(e,t)=>{Rs(),$p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ym(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(vr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(vr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function Df(e){return new L$({type:"transform",transform:e})}var Uf=L("ZodOptional",(e,t)=>{ua.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Me(e){return new Uf({type:"optional",innerType:e})}var Ff=L("ZodExactOptional",(e,t)=>{Rp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function D$(e){return new Ff({type:"optional",innerType:e})}var U$=L("ZodNullable",(e,t)=>{wp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>of(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new U$({type:"nullable",innerType:e})}var F$=L("ZodDefault",(e,t)=>{Pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>af(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function V$(e,t){return new F$({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ni(t)}})}var H$=L("ZodPrefault",(e,t)=>{kp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function B$(e,t){return new H$({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ni(t)}})}var Vf=L("ZodNonOptional",(e,t)=>{xp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function J$(e,t){return new Vf({type:"nonoptional",innerType:e,...oe(t)})}var K$=L("ZodCatch",(e,t)=>{Ep.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G$(e,t){return new K$({type:"catch",innerType:e,catchValue:typeof t==="function"?t:vl(t)})}var Hf=L("ZodPipe",(e,t)=>{la.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lf(e,r,o,n),e.in=t.in,e.out=t.out});function Ef(e,t){return new Hf({type:"pipe",in:e,out:t})}var W$=L("ZodPreprocess",(e,t)=>{Hf.init(e,t),Tp.init(e,t)}),Y$=L("ZodReadonly",(e,t)=>{Op.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>df(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X$(e){return new Y$({type:"readonly",innerType:e})}var Q$=L("ZodLazy",(e,t)=>{Cp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Bf(e){return new Q$({type:"lazy",getter:e})}var e0=L("ZodCustom",(e,t)=>{Ip.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wm(e,r,o,n)});function t0(e,t={}){return vm(e0,e,t)}function r0(e,t){return Sm(e,t)}function Va(e,t){return new W$({type:"pipe",in:Df(e),out:t})}var Kf={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 Jf;(function(e){})(Jf||(Jf={}));function n0(e){return hs(Da,e)}function s0(e){return lm(ws,e)}var Hr="2025-11-25",RV="2025-03-26",Sv=[Hr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ha="io.modelcontextprotocol/related-task",cs="io.modelcontextprotocol/protocolVersion",fu="io.modelcontextprotocol/clientInfo",Oa="io.modelcontextprotocol/serverInfo",Ir="io.modelcontextprotocol/clientCapabilities",Mh="io.modelcontextprotocol/subscriptionId",mp="io.modelcontextprotocol/logLevel",PV="traceparent",AV="tracestate",TV="baggage",Br="2.0";var Nh=Bf(()=>zn([C(),pr(),Er(),Ua(),wi(C(),Nh),Re(Nh)])),Vi=wi(C(),Nh),cF=Re(Nh),QA=zn([C(),pr().int()]),eT=C(),x_=X({ttl:pr().optional()}),C_=X({taskId:C()}),tT=Rn({progressToken:QA.optional(),[Ha]:C_.optional()}),no=X({_meta:tT.optional()}),wv=no.extend({task:x_.optional()}),Wi=X({method:C(),params:no.loose().optional()}),oa=X({_meta:tT.optional()}),sa=X({method:C(),params:oa.loose().optional()}),rT=Rn({get[Oa](){return cw.optional().catch(void 0)}}),ii=Rn({_meta:rT.optional()}),Fh=zn([C(),pr().int()]),sw=X({jsonrpc:Ke(Br),id:Fh,...Wi.shape}).strict(),aw=X({jsonrpc:Ke(Br),...sa.shape}).strict(),Rv=X({jsonrpc:Ke(Br),id:Fh,result:ii}).strict(),Pv=X({jsonrpc:Ke(Br),id:Fh.optional(),error:X({code:pr().int(),message:C(),data:Mi().optional()})}).strict(),fp=zn([sw,aw,Rv,Pv]),dF=zn([Rv,Pv]),nT=ii.strict(),D_=oa.extend({requestId:Fh.optional(),reason:C().optional()}),iT=sa.extend({method:Ke("notifications/cancelled"),params:D_}),O_=X({src:C(),mimeType:C().optional(),sizes:Re(C()).optional(),theme:vc(["light","dark"]).optional()}),Lh=X({icons:Re(O_).optional()}),_m=X({name:C(),title:C().optional()}),cw=_m.extend({..._m.shape,...Lh.shape,version:C(),websiteUrl:C().optional(),description:C().optional()}),a0=Ps(X({applyDefaults:Er().optional()}),Vi),c0=Va((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Ps(X({form:a0.optional(),url:Vi.optional()}),Vi.optional())),M_=Rn({list:Vi.optional(),cancel:Vi.optional(),requests:Rn({sampling:Rn({createMessage:Vi.optional()}).optional(),elicitation:Rn({create:Vi.optional()}).optional()}).optional()}),N_=Rn({list:Vi.optional(),cancel:Vi.optional(),requests:Rn({tools:Rn({call:Vi.optional()}).optional()}).optional()}),F_=X({experimental:wi(C(),Vi).optional(),sampling:X({context:Vi.optional(),tools:Vi.optional()}).optional(),elicitation:c0.optional(),roots:X({listChanged:Er().optional()}).optional(),tasks:M_.optional(),extensions:wi(C(),Vi).optional()}),L_=no.extend({protocolVersion:C(),capabilities:F_,clientInfo:cw}),oT=Wi.extend({method:Ke("initialize"),params:L_}),sT=X({experimental:wi(C(),Vi).optional(),logging:Vi.optional(),completions:Vi.optional(),prompts:X({listChanged:Er().optional()}).optional(),resources:X({subscribe:Er().optional(),listChanged:Er().optional()}).optional(),tools:X({listChanged:Er().optional()}).optional(),tasks:N_.optional(),extensions:wi(C(),Vi).optional()}),B_=ii.extend({protocolVersion:C(),capabilities:sT,serverInfo:cw,instructions:C().optional()}),$_=sa.extend({method:Ke("notifications/initialized"),params:oa.optional()}),U_=Wi.extend({method:Ke("server/discover"),params:no.optional()}),Av=ii.extend({supportedVersions:Re(C()),capabilities:sT,instructions:C().optional()}),aT=Wi.extend({method:Ke("ping"),params:no.optional()}),H_=X({progress:pr(),total:Me(pr()),message:Me(C())}),q_=X({...oa.shape,...H_.shape,progressToken:QA}),cT=sa.extend({method:Ke("notifications/progress"),params:q_}),xm=no.extend({cursor:eT.optional()}),Bh=Wi.extend({params:xm.optional()}),cl=ii.extend({nextCursor:eT.optional()}),dT=X({uri:C(),mimeType:Me(C()),_meta:wi(C(),Mi()).optional()}),lT=dT.extend({text:C()}),Ba=C().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),uT=dT.extend({blob:Ba}),$h=vc(["user","assistant"]),Cm=X({audience:Re($h).optional(),priority:pr().min(0).max(1).optional(),lastModified:n0({offset:!0}).optional()}),Uh=X({..._m.shape,...Lh.shape,uri:C(),description:Me(C()),mimeType:Me(C()),size:Me(pr()),annotations:Cm.optional(),_meta:Me(Rn({}))}),V_=X({..._m.shape,...Lh.shape,uriTemplate:C(),description:Me(C()),mimeType:Me(C()),annotations:Cm.optional(),_meta:Me(Rn({}))}),W_=Bh.extend({method:Ke("resources/list")}),z_=cl.extend({resources:Re(Uh)}),j_=Bh.extend({method:Ke("resources/templates/list")}),K_=cl.extend({resourceTemplates:Re(V_)}),dw=no.extend({uri:C()}),G_=dw,Y_=Wi.extend({method:Ke("resources/read"),params:G_}),J_=ii.extend({contents:Re(zn([lT,uT]))}),X_=sa.extend({method:Ke("notifications/resources/list_changed"),params:oa.optional()}),Z_=dw,Q_=Wi.extend({method:Ke("resources/subscribe"),params:Z_}),ex=dw,tx=Wi.extend({method:Ke("resources/unsubscribe"),params:ex}),pT=X({toolsListChanged:Er().optional(),promptsListChanged:Er().optional(),resourcesListChanged:Er().optional(),resourceSubscriptions:Re(C()).optional()}),rx=no.extend({notifications:pT}),nx=Wi.extend({method:Ke("subscriptions/listen"),params:rx}),ix=oa.extend({notifications:pT}),ox=sa.extend({method:Ke("notifications/subscriptions/acknowledged"),params:ix}),sx=rT.extend({[Mh]:Fh}),ax=ii.extend({_meta:sx}),cx=oa.extend({uri:C()}),dx=sa.extend({method:Ke("notifications/resources/updated"),params:cx}),lx=X({name:C(),description:Me(C()),required:Me(Er())}),ux=X({..._m.shape,...Lh.shape,description:Me(C()),arguments:Me(Re(lx)),_meta:Me(Rn({}))}),px=Bh.extend({method:Ke("prompts/list")}),mx=cl.extend({prompts:Re(ux)}),fx=no.extend({name:C(),arguments:wi(C(),C()).optional()}),hx=Wi.extend({method:Ke("prompts/get"),params:fx}),lw=X({type:Ke("text"),text:C(),annotations:Cm.optional(),_meta:wi(C(),Mi()).optional()}),uw=X({type:Ke("image"),data:Ba,mimeType:C(),annotations:Cm.optional(),_meta:wi(C(),Mi()).optional()}),pw=X({type:Ke("audio"),data:Ba,mimeType:C(),annotations:Cm.optional(),_meta:wi(C(),Mi()).optional()}),gx=X({type:Ke("tool_use"),name:C(),id:C(),input:wi(C(),Mi()),_meta:wi(C(),Mi()).optional()}),yx=X({type:Ke("resource"),resource:zn([lT,uT]),annotations:Cm.optional(),_meta:wi(C(),Mi()).optional()}),vx=Uh.extend({type:Ke("resource_link")}),mw=zn([lw,uw,pw,vx,yx]),bx=X({role:$h,content:mw}),Sx=ii.extend({description:C().optional(),messages:Re(bx)}),wx=sa.extend({method:Ke("notifications/prompts/list_changed"),params:oa.optional()}),Rx=X({title:C().optional(),readOnlyHint:Er().optional(),destructiveHint:Er().optional(),idempotentHint:Er().optional(),openWorldHint:Er().optional()}),Px=X({taskSupport:vc(["required","optional","forbidden"]).optional()}),mT=X({..._m.shape,...Lh.shape,description:C().optional(),inputSchema:X({type:Ke("object"),properties:wi(C(),Nh).optional(),required:Re(C()).optional()}).catchall(Mi()),outputSchema:Rn({$schema:C().optional()}).optional(),annotations:Rx.optional(),execution:Px.optional(),_meta:wi(C(),Mi()).optional()}),Ax=Bh.extend({method:Ke("tools/list")}),Tx=cl.extend({tools:Re(mT)}),fT=ii.extend({content:Re(mw).default([]),structuredContent:Mi().optional(),isError:Er().optional()}),lF=fT.or(ii.extend({toolResult:Mi()})),kx=wv.extend({name:C(),arguments:wi(C(),Mi()).optional()}),Ex=Wi.extend({method:Ke("tools/call"),params:kx}),Ix=sa.extend({method:Ke("notifications/tools/list_changed"),params:oa.optional()}),hT=X({autoRefresh:Er().default(!0),debounceMs:pr().int().nonnegative().default(300)}),Hh=vc(["debug","info","notice","warning","error","critical","alert","emergency"]),_x=no.extend({level:Hh}),xx=Wi.extend({method:Ke("logging/setLevel"),params:_x}),Cx=oa.extend({level:Hh,logger:C().optional(),data:Mi()}),Dx=sa.extend({method:Ke("notifications/message"),params:Cx}),Ox=X({name:C().optional()}),Mx=X({hints:Re(Ox).optional(),costPriority:pr().min(0).max(1).optional(),speedPriority:pr().min(0).max(1).optional(),intelligencePriority:pr().min(0).max(1).optional()}),Nx=X({mode:vc(["auto","required","none"]).optional()}),Fx=X({type:Ke("tool_result"),toolUseId:C().describe("The unique identifier for the corresponding tool call."),content:Re(mw),structuredContent:Mi().optional(),isError:Er().optional(),_meta:wi(C(),Mi()).optional()}),Lx=Fa("type",[lw,uw,pw]),Tv=Fa("type",[lw,uw,pw,gx,Fx]),Bx=X({role:$h,content:zn([Tv,Re(Tv)]),_meta:wi(C(),Mi()).optional()}),$x=wv.extend({messages:Re(Bx),modelPreferences:Mx.optional(),systemPrompt:C().optional(),includeContext:vc(["none","thisServer","allServers"]).optional(),temperature:pr().optional(),maxTokens:pr().int(),stopSequences:Re(C()).optional(),metadata:Vi.optional(),tools:Re(mT).optional(),toolChoice:Nx.optional()}),Ux=Wi.extend({method:Ke("sampling/createMessage"),params:$x}),Hx=ii.extend({model:C(),stopReason:Me(vc(["endTurn","stopSequence","maxTokens"]).or(C())),role:$h,content:Lx}),qx=ii.extend({model:C(),stopReason:Me(vc(["endTurn","stopSequence","maxTokens","toolUse"]).or(C())),role:$h,content:zn([Tv,Re(Tv)])}),fw=X({type:Ke("boolean"),title:C().optional(),description:C().optional(),default:Er().optional()}),qh=X({type:Ke("string"),title:C().optional(),description:C().optional(),minLength:pr().optional(),maxLength:pr().optional(),format:vc(["email","uri","date","date-time"]).optional(),default:C().optional()}),Vh=X({type:vc(["number","integer"]),title:C().optional(),description:C().optional(),minimum:pr().optional(),maximum:pr().optional(),default:pr().optional()}),hw=X({type:Ke("string"),title:C().optional(),description:C().optional(),enum:Re(C()),default:C().optional()}),gw=X({type:Ke("string"),title:C().optional(),description:C().optional(),oneOf:Re(X({const:C(),title:C()})),default:C().optional()}),yw=X({type:Ke("string"),title:C().optional(),description:C().optional(),enum:Re(C()),enumNames:Re(C()).optional(),default:C().optional()}),Vx=zn([hw,gw]),vw=X({type:Ke("array"),title:C().optional(),description:C().optional(),minItems:pr().optional(),maxItems:pr().optional(),items:X({type:Ke("string"),enum:Re(C())}),default:Re(C()).optional()}),bw=X({type:Ke("array"),title:C().optional(),description:C().optional(),minItems:pr().optional(),maxItems:pr().optional(),items:X({anyOf:Re(X({const:C(),title:C()}))}),default:Re(C()).optional()}),Wx=zn([vw,bw]),zx=zn([yw,Vx,Wx]),Sw=zn([zx,fw,qh,Vh]),Wh=wv.extend({mode:Ke("form").optional(),message:C(),requestedSchema:X({type:Ke("object"),properties:wi(C(),Sw),required:Re(C()).optional()}).catchall(Mi())}),jx=wv.extend({mode:Ke("url"),message:C(),elicitationId:C(),url:C().url()}),Kx=zn([Wh,jx]),Gx=Wi.extend({method:Ke("elicitation/create"),params:Kx}),Yx=oa.extend({elicitationId:C()}),Jx=sa.extend({method:Ke("notifications/elicitation/complete"),params:Yx}),Xx=ii.extend({action:vc(["accept","decline","cancel"]),content:Va((e)=>e===null?void 0:e,wi(C(),zn([C(),pr(),Er(),Re(C())])).optional())}),Zx=X({type:Ke("ref/resource"),uri:C()}),Qx=X({type:Ke("ref/prompt"),name:C()}),eC=no.extend({ref:zn([Qx,Zx]),argument:X({name:C(),value:C()}),context:X({arguments:wi(C(),C()).optional()}).optional()}),tC=Wi.extend({method:Ke("completion/complete"),params:eC}),rC=ii.extend({completion:Rn({values:Re(C()).max(100),total:Me(pr().int()),hasMore:Me(Er())})}),nC=X({uri:C().startsWith("file://"),name:C().optional(),_meta:wi(C(),Mi()).optional()}),iC=Wi.extend({method:Ke("roots/list"),params:no.optional()}),oC=ii.extend({roots:Re(nC)}),sC=sa.extend({method:Ke("notifications/roots/list_changed"),params:oa.optional()}),uF=Rn({ttl:pr().optional(),pollInterval:pr().optional()}),aC=vc(["working","input_required","completed","failed","cancelled"]),zh=X({taskId:C(),status:aC,ttl:zn([pr(),Ua()]),createdAt:C(),lastUpdatedAt:C(),pollInterval:Me(pr()),statusMessage:Me(C())}),pF=ii.extend({task:zh}),cC=oa.merge(zh),mF=sa.extend({method:Ke("notifications/tasks/status"),params:cC}),fF=Wi.extend({method:Ke("tasks/get"),params:no.extend({taskId:C()})}),hF=ii.merge(zh),gF=Wi.extend({method:Ke("tasks/result"),params:no.extend({taskId:C()})}),yF=ii.loose(),vF=Bh.extend({method:Ke("tasks/list")}),bF=cl.extend({tasks:Re(zh)}),SF=Wi.extend({method:Ke("tasks/cancel"),params:no.extend({taskId:C()})}),wF=ii.merge(zh),RF=zn([aT,oT,U_,tC,xx,hx,px,W_,j_,Y_,Q_,tx,nx,Ex,Ax]),PF=zn([iT,cT,$_,sC]),AF=zn([nT,Hx,qx,Xx,oC]),TF=zn([aT,Ux,Gx,iC]),kF=zn([iT,cT,Dx,dx,X_,Ix,wx,ox,Jx]),EF=zn([nT,B_,Av,rC,Sx,mx,z_,K_,J_,fT,Tx,ax]);var He=jf().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Kf.custom,message:"URL must be parseable",fatal:!0}),Li}).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"}),dC=Rn({resource:C().url(),authorization_servers:Re(He).optional(),jwks_uri:C().url().optional(),scopes_supported:Re(C()).optional(),bearer_methods_supported:Re(C()).optional(),resource_signing_alg_values_supported:Re(C()).optional(),resource_name:C().optional(),resource_documentation:C().optional(),resource_policy_uri:C().url().optional(),resource_tos_uri:C().url().optional(),tls_client_certificate_bound_access_tokens:Er().optional(),authorization_details_types_supported:Re(C()).optional(),dpop_signing_alg_values_supported:Re(C()).optional(),dpop_bound_access_tokens_required:Er().optional()}),gT=Rn({issuer:C(),authorization_endpoint:He,token_endpoint:He,registration_endpoint:He.optional(),scopes_supported:Re(C()).optional(),response_types_supported:Re(C()),response_modes_supported:Re(C()).optional(),grant_types_supported:Re(C()).optional(),token_endpoint_auth_methods_supported:Re(C()).optional(),token_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),service_documentation:He.optional(),revocation_endpoint:He.optional(),revocation_endpoint_auth_methods_supported:Re(C()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),introspection_endpoint:C().optional(),introspection_endpoint_auth_methods_supported:Re(C()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),code_challenge_methods_supported:Re(C()).optional(),client_id_metadata_document_supported:Er().optional(),authorization_response_iss_parameter_supported:Er().optional().catch(void 0),dpop_signing_alg_values_supported:Re(C()).optional()}),lC=Rn({issuer:C(),authorization_endpoint:He,token_endpoint:He,userinfo_endpoint:He.optional(),jwks_uri:He,registration_endpoint:He.optional(),scopes_supported:Re(C()).optional(),response_types_supported:Re(C()),response_modes_supported:Re(C()).optional(),grant_types_supported:Re(C()).optional(),acr_values_supported:Re(C()).optional(),subject_types_supported:Re(C()),id_token_signing_alg_values_supported:Re(C()),id_token_encryption_alg_values_supported:Re(C()).optional(),id_token_encryption_enc_values_supported:Re(C()).optional(),userinfo_signing_alg_values_supported:Re(C()).optional(),userinfo_encryption_alg_values_supported:Re(C()).optional(),userinfo_encryption_enc_values_supported:Re(C()).optional(),request_object_signing_alg_values_supported:Re(C()).optional(),request_object_encryption_alg_values_supported:Re(C()).optional(),request_object_encryption_enc_values_supported:Re(C()).optional(),token_endpoint_auth_methods_supported:Re(C()).optional(),token_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),display_values_supported:Re(C()).optional(),claim_types_supported:Re(C()).optional(),claims_supported:Re(C()).optional(),service_documentation:C().optional(),claims_locales_supported:Re(C()).optional(),ui_locales_supported:Re(C()).optional(),claims_parameter_supported:Er().optional(),request_parameter_supported:Er().optional(),request_uri_parameter_supported:Er().optional(),require_request_uri_registration:Er().optional(),op_policy_uri:He.optional(),op_tos_uri:He.optional(),client_id_metadata_document_supported:Er().optional(),authorization_response_iss_parameter_supported:Er().optional().catch(void 0)}),uC=X({...lC.shape,...gT.pick({code_challenge_methods_supported:!0}).shape}),yT=X({access_token:C(),id_token:C().optional(),token_type:C(),expires_in:s0().optional(),scope:C().optional(),refresh_token:C().optional(),issuer:C().optional().catch(void 0)}).strip(),pC=X({issued_token_type:Ke("urn:ietf:params:oauth:token-type:id-jag"),access_token:C(),token_type:C().optional(),expires_in:pr().optional(),scope:C().optional()}).strip(),vT=X({error:C(),error_description:C().optional(),error_uri:C().optional()}),Ja=He.optional().or(Ke("").transform(()=>{return})),mC=X({redirect_uris:Re(He),token_endpoint_auth_method:C().optional(),grant_types:Re(C()).optional(),response_types:Re(C()).optional(),application_type:C().optional(),client_name:C().optional(),client_uri:He.optional(),logo_uri:Ja,scope:C().optional(),contacts:Re(C()).optional(),tos_uri:Ja,policy_uri:C().optional(),jwks_uri:He.optional(),jwks:Zf().optional(),software_id:C().optional(),software_version:C().optional(),software_statement:C().optional()}).strip(),fC=X({client_id:C(),client_secret:C().optional(),client_id_issued_at:pr().optional(),client_secret_expires_at:pr().optional(),issuer:C().optional().catch(void 0)}).strip(),hC=mC.merge(fC),IF=X({error:C(),error_description:C().optional()}).strip(),_F=X({token:C(),token_type_hint:C().optional()}).strip();function Wo(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 Ga(e,t="|"){return e.map((r)=>Xa(r)).join(t)}function Yo(e,t){if(typeof t==="bigint")return t.toString();return t}class Xf{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Xo(e){return new Xf(e)}function Qf(e){return e===null||e===void 0}function ks(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eh(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var Yf=Symbol("evaluating");function th(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Yf)return;if(o===void 0)o=Yf,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Dt(e){return Qo(e._zod.def)??e._zod.def.shape}function rh(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return dt(this,t,o),o},enumerable:!0,configurable:!0})}function oh(e,t,r){if(t in e)dt(e,t,r);else e[t]=r}function Sr(e,t,r,o){let n=Dt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)rh(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else oh(e,s,o?o(i.value,s):i.value)}}function f0(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)rh(e,r,()=>t[r]);else oh(e,r,o.value)}}function pt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function nh(e){return JSON.stringify(e)}function sh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Wa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ih=Xo(()=>{if(nt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function br(e){if(Jr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Jr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Ya(e){if(br(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var ah=new Set(["string","number","symbol"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function ne(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Xa(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ch(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xs=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),Qa={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function h0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return Sr(s,e,Es(e,t)),Ct(e,pt(r,{shape:s,checks:[]}))}function Es(e,t){let r=Dt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function g0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Es(e,t)),i={};return Sr(i,e,Reflect.ownKeys(Dt(e)).filter((a)=>!s.has(a))),Ct(e,pt(r,{shape:i,checks:[]}))}function _0(e,t){if(!br(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Dt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ct(e,pt(e._zod.def,{shape:uh(e,t)}))}function uh(e,t){let r={};return Sr(r,e,Reflect.ownKeys(Dt(e))),f0(r,t),r}function y0(e,t){if(!br(t))throw Error("Invalid input to safeExtend: expected a plain object");return Ct(e,pt(e._zod.def,{shape:uh(e,t)}))}function v0(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Sr(r,e,Reflect.ownKeys(Dt(e))),Sr(r,t,Reflect.ownKeys(Dt(t)));let o=pt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ct(e,o)}function lh(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Es(t,r)):void 0,c={};return Sr(c,t,Reflect.ownKeys(Dt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Ct(t,pt(t._zod.def,{shape:c,checks:[]}))}function S0(e,t,r){let o=r?new Set(Es(t,r)):void 0,n={};return Sr(n,t,Reflect.ownKeys(Dt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Ct(t,pt(t._zod.def,{shape:n}))}function It(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 dh(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 rr(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Go(e){return typeof e==="string"?e:e?.message}function ec(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;if(n>=0)t.push([n,r])}return t}function Ts(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Nt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Go(e.inst?._zod.def?.error?.(e))??Go(s?.(e))??Go(t?.error?.(e))??Go(r.customError?.(e))??Go(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var b0=/[\uD800-\uDBFF]/;function Os(e){let t=e.length;if(!b0.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Cs(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ph(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 zr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function mh(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else z0(e,r,o.value)}}function Ut(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Is(e,t,r){return Ut(e,t,r,!1)}function fh(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ut(this,r,o(this))},set(n){Ut(this,r,n)}})}return t}function z0(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ut(this,t,r.bind(this))},set(o){Ut(this,t,o)}})}function $0(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ka,er=!1,R0={configurable:!0,get(){er=!0;return}};function Se(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Ka!==e._zod){Ka=void 0;return}Ka=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,R0);let n=er;er=!1;try{let s=r(this);if(er)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return er=er||n,s}catch(s){throw delete this[t],er=er||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function w0(e,t,r,o){let n=$0(e,t);if(!n)return;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 P0="~constantCatch";function hh(e){let t=()=>e;return t[P0]=!0,t}var gh;var tc={value:void 0,enumerable:!1},_h="captureStackTrace"in Error?Error:null;function k0(e){let t=_h;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return _h=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function D(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){tc.value=new s(h);try{Object.defineProperty(m,"_zod",tc)}finally{tc.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),mh(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?k0(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class At extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class en extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(gh=globalThis).__zod_globalConfig??(gh.__zod_globalConfig={});var nt=globalThis.__zod_globalConfig;function mt(e){if(e)Object.assign(nt,e);return nt}function x0(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Yo,2)),e.message}function E0(e){this._zod.message=e}var T0={get:x0,set:E0,enumerable:!0,configurable:!0},oc={value:void 0,enumerable:!1},yh=new WeakSet([Object.prototype,Error.prototype]),vh=(e,t)=>{e.name="$ZodError",oc.value=t,Object.defineProperty(e,"issues",oc),oc.value=void 0,Object.defineProperty(e,"message",T0);let r=Object.getPrototypeOf(e);if(!yh.has(r))yh.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})}})},Sh=D("$ZodError",vh),CI=D("$ZodError",vh,void 0,{Parent:Error});function O0(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function bh(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)O0(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Rh(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function Ns(e,t){return{callee:t?.callee??e,Err:t?.Err}}var As=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new At;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,mt())));throw Wa(c,s?.callee??t),c}return a.value};return t};var js=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,mt())));throw Wa(c,s?.callee??t),c}return a.value};return t};var Ms=(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 At;return s.issues.length?wh(e,s.issues,n):{success:!0,data:s.value}};function wh(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Nt(n,r,mt()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Zs=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?wh(e,s.issues,n):{success:!0,data:s.value}};var C0=Symbol.for("zod.compile.invalid"),I0=Symbol.for("zod.compile.fallback"),nc=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==C0)return!0;if(o.definite===!0&&r===void 0)return!1}return N0(e,t,r)};function N0(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[I0]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new At;return s.issues.length===0}var sc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Ph=(e)=>{let t=As(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,Ns(r,i))};return r};var kh=(e)=>{let t=As(e),r=(o,n,s,i)=>t(o,n,s,Ns(r,i));return r};var xh=(e)=>{let t=js(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,Ns(r,i))};return r};var Eh=(e)=>{let t=js(e),r=async(o,n,s,i)=>await t(o,n,s,Ns(r,i));return r};var Th=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ms(e)(t,r,n)};var Oh=(e)=>(t,r,o)=>Ms(e)(t,r,o);var Ch=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Zs(e)(t,r,n)};var Ih=(e)=>async(t,r,o)=>Zs(e)(t,r,o);var Ah=/^[cC][0-9a-z]{6,}$/,Zh=/^[0-9a-z]+$/,Dh=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Jh=/^[0-9a-vA-V]{20}$/,Yh=/^[A-Za-z0-9]{27}$/,Xh=/^[a-zA-Z0-9_-]{21}$/;function Qh(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var tg=/^([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})$/,ac=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var rg=/^(?:[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 A0="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function og(){return new RegExp(A0,"u")}var ng=/^(?:(?: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])$/,sg=/^(([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 ig=/^((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])$/,ag=/^(([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])$/,cg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ug=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lg=/^https?$/,dg=/^\+[1-9]\d{6,14}$/;var pg="(?:(?:\\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 j0(e){return new RegExp(`^${e}$`)}var mg=j0(pg);function ic(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function fg(e){return new RegExp(`^${ic(e)}$`)}function hg(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${ic({precision:e.precision})}`:r;return new RegExp(`^${pg}T(?:${o})$`)}var gg=/^[\s\S]{0,}$/;var cc=/^-?\d+$/,tn=/^-?\d+(?:\.\d+)?$/,_g=/^(?:true|false)$/i,yg=/^null$/i;var vg=/^[^A-Z]*$/,Sg=/^[^a-z]*$/;var Ge=D("$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!Qf(t)&&t.length!==void 0},qs={number:"number",bigint:"bigint",object:"date"},lc=D("$ZodCheckLessThan",(e,t)=>{Ge.init(e,t);let r=qs[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:qs[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})}}),dc=D("$ZodCheckGreaterThan",(e,t)=>{Ge.init(e,t);let r=qs[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:qs[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})}}),bg=D("$ZodCheckMultipleOf",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):eh(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),zg=D("$ZodCheckNumberFormat",(e,t)=>{Ge.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=xs[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var $g=D("$ZodCheckMaxLength",(e,t)=>{var r;Ge.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?Os(n):s)<=t.maximum)return;let a=Cs(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rg=D("$ZodCheckMinLength",(e,t)=>{var r;Ge.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?Os(n):s)>=t.minimum)return;let a=Cs(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wg=D("$ZodCheckLengthEquals",(e,t)=>{var r;Ge.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?Os(n):s;if(i===t.length)return;let a=Cs(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),on=D("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Ge.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),Pg=D("$ZodCheckRegex",(e,t)=>{on.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kg=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vg),on.init(e,t)}),xg=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sg),on.init(e,t)}),Eg=D("$ZodCheckIncludes",(e,t)=>{Ge.init(e,t);let r=tr(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Tg=D("$ZodCheckStartsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`^${tr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Og=D("$ZodCheckEndsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`.*${tr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Cg=D("$ZodCheckOverwrite",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class pc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
59
+ `).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
60
+ ${t.join(`
61
+ `)}
62
+ };`)(...Object.values(this.closed))}}var Ng={major:4,minor:6,patch:7};var Oe=D("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ng;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=(a,c,u)=>{if(a.memo)return a;let l=It(a),d;for(let m of c){if(m._zod.def.when){if(dh(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new At;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Ts(a.issues,h,e),!l)l=It(a,h)});else{if(a.issues.length===h)continue;if(Ts(a.issues,h,e),!l)l=It(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(It(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new At;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new At;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Is(this,"~standard",fc(this))},set "~standard"(e){Ut(this,"~standard",e)}}),Hg=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Nt(r,t,mt()))}:{value:e.value};async function M0(e,t){let r={async:!0};return Hg(await e._zod.run({value:t,issues:[]},r),r)}function fc(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Hg(o,r)}catch(o){}return M0(e,t)},vendor:"zod",version:1}}var Fs=D("$ZodString",(e,t)=>{Oe.init(e,t),e._zod.pattern=t.pattern??gg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ae=D("$ZodStringFormat",(e,t)=>{on.init(e,t),Fs.init(e,t)}),Bg=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tg),Ae.init(e,t)}),Jg=D("$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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ac(o))}else t.pattern??(t.pattern=ac());Ae.init(e,t)}),Kg=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rg),Ae.init(e,t)}),Gg=1,Ds=2;function Wg(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Z0(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Wg(e)||Ds;return q0(e,t)}function q0(e,t){if(!t.normalize&&t.protocol?.source===lg.source&&!/^https?:\/\//i.test(e))return Gg;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Ds}return new URL(e)}catch{return Ds}}var L0=/[\t\n\r]/g;function Ag(e){return e.replace(L0,"")}function D0(e,t){return t.lastIndex=0,t.test(e.hostname)}function U0(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Yg=D("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=Z0(o,t);if(n===Gg){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Ds){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Ag(o);return}if(t.hostname&&!D0(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});if(t.protocol&&!U0(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:Ag(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Xg=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=og()),Ae.init(e,t)}),Qg=D("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Xh:Qh(t.length)),Ae.init(e,t)}),e_=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ah),Ae.init(e,t)}),t_=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Zh),Ae.init(e,t)}),r_=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dh),Ae.init(e,t)}),o_=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Jh),Ae.init(e,t)}),n_=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yh),Ae.init(e,t)}),s_=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hg(t)),Ae.init(e,t)}),i_=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mg),Ae.init(e,t)}),a_=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fg(t)),Ae.init(e,t)}),c_=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eg),Ae.init(e,t)}),u_=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ng),Ae.init(e,t)}),F0=/^[0-9a-fA-F:.]+$/;function l_(e){if(!F0.test(e))return!1;return Wg(`http://[${e}]`)}var d_=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sg),Ae.init(e,t),e._zod.check=(r)=>{if(!l_(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var p_=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ig),Ae.init(e,t)});function V0(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return l_(r)}var m_=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ag),Ae.init(e,t),e._zod.check=(r)=>{if(!V0(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function f_(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var hc=/^[0-9a-zA-Z+/]*={0,2}$/,h_=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hc),Ae.init(e,t),e._zod.check=(r)=>{if(f_(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Vs=/^[A-Za-z0-9_-]*$/;function H0(e){if(!Vs.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return f_(r)}var g_=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vs),Ae.init(e,t),e._zod.check=(r)=>{if(H0(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),__=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dg),Ae.init(e,t)});function B0(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));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var y_=D("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{if(B0(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var gc=D("$ZodNumber",(e,t)=>{Oe.init(e,t),e._zod.pattern=tn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}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)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),v_=D("$ZodNumberFormat",(e,t)=>{zg.init(e,t),gc.init(e,t)}),S_=D("$ZodBoolean",(e,t)=>{Oe.init(e,t),e._zod.pattern=_g,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var b_=D("$ZodNull",(e,t)=>{Oe.init(e,t),e._zod.pattern=yg,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}});var R_=D("$ZodUnknown",(e,t)=>{Oe.init(e,t),e._zod.parse=(r)=>r}),w_=D("$ZodNever",(e,t)=>{Oe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function J0(e,t){let r=ec(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 a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of ec(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Ts(s.issues,l,e),s}}return n(s,i)}}var K0=(e)=>Array.isArray(e)?e.length:-1;function jg(e,t,r){if(e.issues.length)t.issues.push(...rr(r,e.issues));t.value[r]=e.value}var P_=D("$ZodArray",(e,t)=>{Oe.init(e,t);let r=nt.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=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>jg(d,o,c)));else if(jg(l,o,c),a&&l.issues.length!==0&&It(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},J0(e,K0)});function Us(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...rr(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var G0=[];function k_(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:G0,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=ch(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function E_(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(It(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>Us(y,r,f,t,d,m)));else Us(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var W0=D("$ZodObject",(e,t)=>{Oe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Xo(()=>k_(t));Se(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))dt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=Jr,i=t.catchall,a,c=nt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(It(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,x=g._zod.run({value:d[y],issues:[]},l);if(x instanceof Promise)m.push(x.then((O)=>Us(O,u,y,d,P,w)));else Us(x,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return E_(m,d,u,l,n.value,e,f===!0)}}),T_=D("$ZodObjectJIT",(e,t)=>{W0.init(e,t);let r=e._zod.parse,o=Xo(()=>k_(t)),n=nt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new pc(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(O)=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,P=(O,R)=>`
63
+ let ${O}_ab = false;
64
+ for (let i = 0; i < ${O}.issues.length; i++) {
65
+ const iss = ${O}.issues[i];
66
+ iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
67
+ payload.issues.push(iss);
68
+ if (iss.continue !== true) ${O}_ab = true;
69
+ }
70
+ if (${O}_ab && ctx && ctx.abortEarly) {
71
+ payload.value = newResult;
72
+ return payload;
73
+ }`;y.write("const input = payload.value;");let w=Object.create(null),x=0;for(let O of f.allKeys)w[O]=`key_${x++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of f.allKeys){if(O==="__proto__")continue;let R=w[O],S=typeof O==="symbol"?`syms[${v.indexOf(O)}]`:nh(O),E=`${S} in input`,A=h[O],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
74
+ const ${R}_present = ${E};
75
+ if (!${R}.issues.length || ${R}_present) {
76
+ if (${R}.issues.length) {${P(R,S)}
77
+ }
78
+
79
+ if (${W}) {
80
+ newResult[${S}] = ${R}.value;
81
+ }
82
+ }
83
+
84
+ `)}else if(!j)y.write(`
85
+ const ${R}_present = ${E};
86
+ if (${R}.issues.length) {${P(R,S)}
87
+ }
88
+ if (!${R}_present && !${R}.issues.length) {
89
+ payload.issues.push({
90
+ code: "invalid_type",
91
+ expected: "nonoptional",
92
+ input: undefined,
93
+ path: [${S}]
94
+ });
95
+ if (ctx && ctx.abortEarly) {
96
+ payload.value = newResult;
97
+ return payload;
98
+ }
99
+ }
100
+
101
+ if (${R}_present) {
102
+ newResult[${S}] = ${R}.value;
103
+ }
104
+
105
+ `);else if(y.write(`
106
+ if (${R}.issues.length) {${P(R,S)}
107
+ }
108
+ `),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
109
+ if (${R}.value !== undefined || ${E}) {
110
+ newResult[${S}] = ${R}.value;
111
+ }
112
+ `)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=Jr,c=!nt.jitless,l=c&&ih.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return E_([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function Mg(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)=>!It(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Nt(i,o,mt())))}),t}var _c=D("$ZodUnion",(e,t)=>{Oe.init(e,t),Se(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),Se(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),Se(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)));return}),Se(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)=>ks(s.source)).join("|")})$`)}return});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 a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return Mg(i,o,e,n);return Promise.all(i).then((a)=>Mg(a,o,e,n))}});function Y0(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw 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 Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var I_=D("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_c.init(e,t);let r=e._zod.parse;Se(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))dt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=Qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Xo(()=>Y0(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Jr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return 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}}),A_=D("$ZodIntersection",(e,t)=>{Oe.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);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>Zg(r,c,u));return Zg(r,s,i)}});function mc(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(br(e)&&br(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=mc(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=mc(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 Zg(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=mc(t.value,r.value);if(!c.valid){if(It(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ey=D("$ZodRecord",(e,t)=>{Oe.init(e,t);let r=nt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!br(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Nt(f,n,mt())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(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 c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&tn.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Nt(f,n,mt())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var ty=D("$ZodEnum",(e,t)=>{Oe.init(e,t);let r=Wo(t.entries),o=new Set(r);e._zod.values=o,Se(e,"pattern",(n)=>{let s=Wo(n.def.entries).filter((i)=>ah.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>tr(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),ry=D("$ZodLiteral",(e,t)=>{Oe.init(e,t);let r=new Set(t.values);e._zod.values=r,Se(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?tr(s):s?tr(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var oy=D("$ZodTransform",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",nt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(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 At;return r.value=n,r}});function qg(e,t){return e.value=t.issues.length?void 0:t.value,e}var yc=D("$ZodOptional",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ks(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);if(n instanceof Promise)return n.then((s)=>qg(r,s));return qg(r,n)}return t.innerType._zod.run(r,o)}}),ny=D("$ZodExactOptional",(e,t)=>{yc.init(e,t),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),sy=D("$ZodNullable",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ks(o.source)}|null)$`):void 0}),Se(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),iy=D("$ZodDefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Se(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);if(n instanceof Promise)return n.then((s)=>Lg(s,t));return Lg(n,t)}});function Lg(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var ay=D("$ZodPrefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Se(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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),cy=D("$ZodNonOptional",(e,t)=>{Oe.init(e,t),Se(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);if(n instanceof Promise)return n.then((s)=>Dg(s,e));return Dg(n,e)}});function Dg(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Ug(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Nt(n,o,mt()))},input:e.value}),e}var uy=D("$ZodCatch",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(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);if(n instanceof Promise)return n.then((s)=>Ug(r,s,t,o));return Ug(r,n,t,o)}});var Sc=D("$ZodPipe",(e,t)=>{Oe.init(e,t),Se(e,"values",(r)=>r.def.in._zod.values),Se(e,"optin",(r)=>r.def.in._zod.optin),Se(e,"optout",(r)=>r.def.out._zod.optout),Se(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);if(s instanceof Promise)return s.then((i)=>Ls(i,t.in,o));return Ls(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Ls(s,t.out,o));return Ls(n,t.out,o)}});function Ls(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var ly=D("$ZodPreprocess",(e,t)=>{Sc.init(e,t)}),dy=D("$ZodReadonly",(e,t)=>{Oe.init(e,t),Se(e,"propValues",(r)=>r.def.innerType._zod.propValues),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"optin",(r)=>r.def.innerType?._zod?.optin),Se(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);if(n instanceof Promise)return n.then(Fg);return Fg(n)}});function Fg(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var py=D("$ZodLazy",(e,t)=>{Oe.init(e,t),th(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),Se(e,"pattern",(r)=>r.innerType?._zod?.pattern),Se(e,"propValues",(r)=>r.innerType?._zod?.propValues),Se(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),Se(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),my=D("$ZodCustom",(e,t)=>{Ge.init(e,t),Oe.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)=>Vg(s,r,o,e));Vg(n,r,o,e);return}});function Vg(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(zr(n))}}class hy extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var zc="~memo",fy=[];function gy(e){return e!==null&&typeof e==="object"}function bc(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var _y=new WeakMap,nn=0,Js=1,sn=2;function Ks(e,t,r){let o=_y.get(e);if(o!==void 0)return o?sn:nn;if(t.has(e))return sn;t.add(e);let n=nn,s=(l)=>{if(n!==sn&&l?._zod){let d=Ks(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=nn;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?Js:f.value?._zod?Ks(f.value,t,r):nn;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=Qo(c);a(l?i(l,!0):Js),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?Ks(l,t,!1):Js);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),X0(e,n)}function X0(e,t){if(t!==Js)_y.set(e,t===sn);return t}function Q0(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Hs,Bs=[],eR={alloc(e,t,r){let o=Hs;if(!o)return r;Hs=void 0;let n={value:r,issues:null};return o.set(t.value,n),Bs.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"&&tR(s,n.value))throw new hy;return r(n,s)};if(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,a=(c,u)=>{if(r===void 0){let g=Ks(e,new Set,!1);if(g===nn){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===sn||o)r=!0;else o=!0}let l=c.value;if(!gy(l))return i(c,u);let d=u[zc];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[zc]=d;let m;if(n===u)m=s;else m=Q0(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...bc(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}Hs=m;let f=Bs.length,v=i(c,u);Hs=void 0;let y=Bs.length>f?Bs.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?bc(g.issues):fy;return g});if(y)y.issues=v.issues.length?bc(v.issues):fy;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function yy(){return eR}function tR(e,t){let r=e[zc]?.backEdges;return r!==void 0&&gy(t)&&r.has(t)}var rR=()=>{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){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=ph(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Xa(s.values[0])}`;return`Invalid option: expected one of ${Ga(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`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":""}: ${Ga(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function $c(){return{localeError:rR()}}var vy;class Sy{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function oR(){return new Sy}(vy=globalThis).__zod_globalRegistry??(vy.__zod_globalRegistry=oR());var $r=globalThis.__zod_globalRegistry;function by(e){if(e.checks)e.checks=[...e.checks];return e}function zy(e,t){return new e(by({type:"string",...ne(t)}))}function Rc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function $y(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function Ry(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function wy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function Py(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function ky(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function xy(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function Ey(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function Ty(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function Oy(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function Cy(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function Iy(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function Ny(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function Ay(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function jy(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function My(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function Zy(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function qy(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function Ly(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function Dy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function Uy(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function Gs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function Ws(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function Pc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function kc(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function Fy(e,t){return new e(by({type:"number",checks:[],...ne(t)}))}function Vy(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function Hy(e,t){return new e({type:"boolean",...ne(t)})}function By(e,t){return new e({type:"null",...ne(t)})}function Jy(e){return new e({type:"unknown"})}function Ky(e,t){return new e({type:"never",...ne(t)})}function Ys(e,t){return new lc({check:"less_than",...ne(t),value:e,inclusive:!1})}function an(e,t){return new lc({check:"less_than",...ne(t),value:e,inclusive:!0})}function Xs(e,t){return new dc({check:"greater_than",...ne(t),value:e,inclusive:!1})}function cn(e,t){return new dc({check:"greater_than",...ne(t),value:e,inclusive:!0})}function Qs(e,t){return new bg({check:"multiple_of",...ne(t),value:e})}function ei(e,t){return new $g({check:"max_length",...ne(t),maximum:e})}function Kr(e,t){return new Rg({check:"min_length",...ne(t),minimum:e})}function ti(e,t){return new wg({check:"length_equals",...ne(t),length:e})}function xc(e,t){return new Pg({check:"string_format",format:"regex",...ne(t),pattern:e})}function Ec(e){return new kg({check:"string_format",format:"lowercase",...ne(e)})}function Tc(e){return new xg({check:"string_format",format:"uppercase",...ne(e)})}function Oc(e,t){return new Eg({check:"string_format",format:"includes",...ne(t),includes:e})}function Cc(e,t){return new Tg({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function Ic(e,t){return new Og({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function or(e){return new Cg({check:"overwrite",tx:e})}function Nc(e){return or((t)=>t.normalize(e))}function Ac(){return or((e)=>e.trim())}function jc(){return or((e)=>e.toLowerCase())}function Mc(){return or((e)=>e.toUpperCase())}function Zc(){return or((e)=>sh(e))}function Gy(e,t,r){return new e({type:"array",element:t,...ne(r)})}function Wy(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ne(r)})}function Yy(e,t){let r=nR((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(zr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(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(zr(s))}},e(o.value,o)),t);return r}function nR(e,t){let r=new Ge({check:"custom",...ne(t)});return r._zod.check=e,r}function un(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))dt(e,o,r[o]);return e}function dn(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??$r,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 Be(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 Error(n);return Object.assign(r,s),!0}function Ee(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return 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 a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ee(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)un(i.schema,c);if(t.io==="input"&&et(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Xy(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pn(e,t){let r=e.seen.get(t);if(!r)throw 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 a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${Xy(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Xy(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
113
+
114
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=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(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function tv(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;tv(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;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var rv=new Set(["type","properties","required","additionalProperties"]),Qy=["oneOf","anyOf"];function ev(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function qc(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!rv.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 a=[];for(let u of t){let l=u.properties?.[i]??ev(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:qc(a)??{allOf:a};dt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=ev(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function sR(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of rv)if(n in e)return;let r=t.filter((n)=>Qy.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=qc(t);else{let n=r[0],s=Qy.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>qc([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,un(e,o)}function mn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else un(u,f);if(un(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())tv(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])sR(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}un(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;dt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ln(t,"input",e.processors),output:ln(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function et(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 et(o.element,r);if(o.type==="set")return et(o.valueType,r);if(o.type==="lazy")return et(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 et(o.innerType,r);if(o.type==="intersection")return et(o.left,r)||et(o.right,r);if(o.type==="record"||o.type==="map")return et(o.keyType,r)||et(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return et(o.in,r)||et(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(et(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(et(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(et(n,r))return!0;if(o.rest&&et(o.rest,r))return!0;return!1}return!1}var ov=(e,t={})=>(r)=>{let o=dn({...r,processors:t});return Ee(e,o),pn(o,e),mn(o,e)},ln=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=dn({...n??{},target:s,io:t,processors:r});return Ee(e,i),pn(i,e),mn(i,e)};var Gr=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Wr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},nv=(e,t)=>{Gr(e,"minimum",t),Wr(e,"maximum",t)},uv=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},lv=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},dv=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},pv=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},sv=(e,t)=>Gr(e,"minimum",t.minimum),iv=(e,t)=>Wr(e,"maximum",t.maximum),av=(e)=>(t,r)=>{pv(t,r.format);let[o,n]=e[r.format];Gr(t,"minimum",o),Wr(t,"maximum",n)},iR={greater_than:(e,t)=>Gr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Wr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>uv(e,t.value),number_format:av(xs),bigint_format:av(Qa),min_length:sv,max_length:iv,length_equals:(e,t)=>nv(e,t.length),min_size:sv,max_size:iv,size_equals:(e,t)=>nv(e,t.size),string_format:(e,t)=>{if(pv(e,t.format),t.pattern)lv(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>dv(e,t.mime)};function st(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)iR[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Gr(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Gr(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Wr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Wr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)uv(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)dv(t,n.mime);for(let s of n.patterns??[])lv(t,s);return t}var aR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cR=new Map([[hc,cg],[Vs,ug]]),mv=(e)=>cR.get(e)??e,Uc=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=st(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=aR[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(mv);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Fc=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=st(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Be(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Vc=(e,t,r,o)=>{r.type="boolean"},fv=(e,t,r,o)=>{Be(e,t,r,o,"BigInt cannot be represented in JSON Schema")},hv=(e,t,r,o)=>{Be(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Hc=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},gv=(e,t,r,o)=>{Be(e,t,r,o,"Undefined cannot be represented in JSON Schema")},_v=(e,t,r,o)=>{Be(e,t,r,o,"Void cannot be represented in JSON Schema")},Bc=(e,t,r,o)=>{r.not={}},yv=(e,t,r,o)=>{},Jc=(e,t,r,o)=>{},vv=(e,t,r,o)=>{Be(e,t,r,o,"Date cannot be represented in JSON Schema")},Kc=(e,t,r,o)=>{let n=e._zod.def,s=Wo(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gc=(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(Be(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Be(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);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}},bv=(e,t,r,o)=>{Be(e,t,r,o,"NaN cannot be represented in JSON Schema")},zv=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},$v=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:a}=st(e);if(s!==void 0)n.minLength=s;if(i!==void 0)n.maxLength=i;if(!a)return;if(a.length===0)n.not={};else if(a.length===1)n.contentMediaType=a[0];else n.anyOf=a.map((c)=>({contentMediaType:c}))},xv=(e,t,r,o)=>{r.type="boolean"},Wc=(e,t,r,o)=>{Be(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Ev=(e,t,r,o)=>{Be(e,t,r,o,"Function types cannot be represented in JSON Schema")},Yc=(e,t,r,o)=>{Be(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Ov=(e,t,r,o)=>{Be(e,t,r,o,"Map cannot be represented in JSON Schema")},Cv=(e,t,r,o)=>{Be(e,t,r,o,"Set cannot be represented in JSON Schema")},Xc=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=st(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ee(s.element,t,{...o,path:[...o.path,"items"]})};function fn(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return fn(t.out);if(t.type==="catch")return fn(t.innerType);return e._zod.optin}var Qc=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Be(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)dt(n.properties,u,Ee(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?fn(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ee(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},eu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ee(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tu=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ee(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)},Iv=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((v,y)=>Ee(v,t,{...o,path:[...o.path,i,y]})),u=s.rest?Ee(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,l=s.items.length;while(l>0){let v=s.items[l-1];if(!(t.io==="input"?fn(v)!==void 0:v._zod.optout==="optional"))break;l--}let d=s.items.length,m=!s.rest;if(t.target==="draft-2020-12"){if(n.prefixItems=c,m)n.items=!1;else if(u)n.items=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(l>0)n.minItems=l;if(m)n.maxItems=d}else{if(n.items=c,m)n.additionalItems=!1;else if(u)n.additionalItems=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}let{minimum:h,maximum:f}=st(e);if(typeof h==="number")n.minItems=h;if(typeof f==="number")n.maxItems=f};function Lc(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=Lc(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>Lc(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?tn:cc).source;return h}var Dc=new WeakMap;function uR(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Dc.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Lc(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var ru=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=st(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ee(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)dt(n.patternProperties,mv(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ee(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Dc.get(t);if(!l)l=[],Dc.set(t,l),t.deferred.push(()=>uR(t));l.push(e)}n.additionalProperties=Ee(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&fn(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},ou=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},su=Symbol();function Nv(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Be(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),su}var iu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=Nv(n.defaultValue,e,t,r,o);if(i!==su)r.default=i},au=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=Nv(n.defaultValue,e,t,r,o);if(i!==su)r._prefault=i},cu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Be(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;Ee(i,t,o);let a=t.seen.get(e);a.ref=i},lu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},jv=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},ri=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},du=(e,t,r,o)=>{let n=e._zod.innerType;Ee(n,t,o);let s=t.seen.get(e);s.ref=n},cv={string:Uc,number:Fc,boolean:Vc,bigint:fv,symbol:hv,null:Hc,undefined:gv,void:_v,never:Bc,any:yv,unknown:Jc,date:vv,enum:Kc,literal:Gc,nan:bv,template_literal:zv,file:$v,success:xv,custom:Wc,function:Ev,transform:Yc,map:Ov,set:Cv,array:Xc,object:Qc,union:eu,intersection:tu,tuple:Iv,record:ru,nullable:ou,nonoptional:nu,default:iu,prefault:au,catch:cu,pipe:uu,readonly:lu,promise:jv,optional:ri,lazy:du};function oi(e,t){if("_idmap"in e){let o=e,n=dn({...t,processors:cv}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Ee(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;pn(n,l),dt(i,u,mn(n,l))}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=dn({...t,processors:cv});return Ee(e,r),pn(r,e),mn(r,e)}var Mv=new WeakSet([Object.prototype,Error.prototype]);function ni(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 yR=(e,t)=>{Sh.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Mv.has(r))return;Mv.add(r),ni(r,"format",(o)=>(n)=>Rh(o,n)),ni(r,"flatten",(o)=>(n)=>bh(o,n)),ni(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Yo,2)}),ni(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Yo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var ft=D("ZodError",yR,void 0,{Parent:Error});var Zv=As(ft),qv=js(ft),si=Ms(ft),Lv=Zs(ft),Dv=Ph(ft),Uv=kh(ft),Fv=xh(ft),Vv=Eh(ft),Hv=Th(ft),Bv=Oh(ft),Jv=Ch(ft),Kv=Ih(ft);function SR(){if(!nt.localeError)mt($c())}function ci(){if(!nt.memoizer)mt({memoizer:yy()})}var je=D("ZodType",(e,t)=>(SR(),Oe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(pt(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 Ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rw(e,t))},superRefine(e,t){return this.check(Pw(e,t))},overwrite(e){return this.check(or(e))},optional(){return he(this)},exactOptional(){return GR(this)},nullable(){return Yv(this)},nullish(){return he(Yv(this))},nonoptional(e){return tw(this,e)},array(){return Q(this)},or(e){return ce([this,e])},and(e){return Yr(this,e)},transform(e){return Xv(this,uS(e))},default(e){return XR(this,e)},prefault(e){return ew(this,e)},catch(e){return ow(this,e)},pipe(e){return Xv(this,e)},readonly(){return _w(this)},describe(e){let t=this.clone();return $r.add(t,{description:e}),t},meta(...e){if(e.length===0)return $r.get(this);let t=this.clone();return $r.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 Is(this,"~standard",{...fc(this),jsonSchema:{input:ln(this,"input"),output:ln(this,"output")}})},set "~standard"(e){Ut(this,"~standard",e)},parse:function e(t,r){return Zv(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await qv(this,t,r,{callee:e})},safeParse(e,t){return si(this,e,t)},async safeParseAsync(e,t){return Lv(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ut(this,"spa",e)},validate(e,t){return nc(this,e,t)},validateAsync(e,t){return sc(this,e,t)},encode:function e(t,r){return Dv(this,t,r,{callee:e})},decode:function e(t,r){return Uv(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Fv(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Vv(this,t,r,{callee:e})},safeEncode(e,t){return Hv(this,e,t)},safeDecode(e,t){return Bv(this,e,t)},async safeEncodeAsync(e,t){return Jv(this,e,t)},async safeDecodeAsync(e,t){return Kv(this,e,t)},toJSONSchema(e){return ov(this,{})(e)},get description(){return $r.get(this)?.description},get _def(){return this._zod.def}}),Qv=D("_ZodString",(e,t)=>{Fs.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uc(e,r,o,n)},fh({format:(e)=>st(e).format??null,minLength:(e)=>st(e).minimum??null,maxLength:(e)=>st(e).maximum??null},{regex(...e){return this.check(xc(...e))},includes(...e){return this.check(Oc(...e))},startsWith(...e){return this.check(Cc(...e))},endsWith(...e){return this.check(Ic(...e))},min(...e){return this.check(Kr(...e))},max(...e){return this.check(ei(...e))},length(...e){return this.check(ti(...e))},nonempty(...e){return this.check(Kr(1,...e))},lowercase(e){return this.check(Ec(e))},uppercase(e){return this.check(Tc(e))},trim(){return this.check(Ac())},normalize(...e){return this.check(Nc(...e))},toLowerCase(){return this.check(jc())},toUpperCase(){return this.check(Mc())},slugify(){return this.check(Zc())}})),bR=D("ZodString",(e,t)=>{Fs.init(e,t),Qv.init(e,t)},{email(e){return this.check(Rc(rS,e))},url(e){return this.check(wc(nS,e))},jwt(e){return this.check(Uy(MR,e))},emoji(e){return this.check(xy($R,e))},guid(e){return this.check($y(zR,e))},uuid(e){return this.check(Ry(ai,e))},uuidv4(e){return this.check(wy(ai,e))},uuidv6(e){return this.check(Py(ai,e))},uuidv7(e){return this.check(ky(ai,e))},nanoid(e){return this.check(Ey(RR,e))},cuid(e){return this.check(Ty(wR,e))},cuid2(e){return this.check(Oy(PR,e))},ulid(e){return this.check(Cy(kR,e))},base64(e){return this.check(qy(NR,e))},base64url(e){return this.check(Ly(AR,e))},xid(e){return this.check(Iy(xR,e))},ksuid(e){return this.check(Ny(ER,e))},ipv4(e){return this.check(Ay(TR,e))},ipv6(e){return this.check(jy(OR,e))},cidrv4(e){return this.check(My(CR,e))},cidrv6(e){return this.check(Zy(IR,e))},e164(e){return this.check(Dy(jR,e))},datetime(e){return this.check(Gs(mu,e))},date(e){return this.check(Ws(hu,e))},time(e){return this.check(Pc(eS,e))},duration(e){return this.check(kc(tS,e))}});function k(e){return zy(bR,e)}var Le=D("ZodStringFormat",(e,t)=>{Ae.init(e,t),Qv.init(e,t)}),mu=D("ZodISODateTime",(e,t)=>{s_.init(e,t),Le.init(e,t)}),hu=D("ZodISODate",(e,t)=>{i_.init(e,t),Le.init(e,t)}),eS=D("ZodISOTime",(e,t)=>{a_.init(e,t),Le.init(e,t)}),tS=D("ZodISODuration",(e,t)=>{c_.init(e,t),Le.init(e,t)}),rS=D("ZodEmail",(e,t)=>{Kg.init(e,t),Le.init(e,t)});function oS(e){return Rc(rS,e)}var zR=D("ZodGUID",(e,t)=>{Bg.init(e,t),Le.init(e,t)});var ai=D("ZodUUID",(e,t)=>{Jg.init(e,t),Le.init(e,t)});var nS=D("ZodURL",(e,t)=>{Yg.init(e,t),Le.init(e,t)});function sS(e){return wc(nS,e)}var $R=D("ZodEmoji",(e,t)=>{Xg.init(e,t),Le.init(e,t)});var RR=D("ZodNanoID",(e,t)=>{Qg.init(e,t),Le.init(e,t)});var wR=D("ZodCUID",(e,t)=>{e_.init(e,t),Le.init(e,t)});var PR=D("ZodCUID2",(e,t)=>{t_.init(e,t),Le.init(e,t)});var kR=D("ZodULID",(e,t)=>{r_.init(e,t),Le.init(e,t)});var xR=D("ZodXID",(e,t)=>{o_.init(e,t),Le.init(e,t)});var ER=D("ZodKSUID",(e,t)=>{n_.init(e,t),Le.init(e,t)});var TR=D("ZodIPv4",(e,t)=>{u_.init(e,t),Le.init(e,t)});var OR=D("ZodIPv6",(e,t)=>{d_.init(e,t),Le.init(e,t)});var CR=D("ZodCIDRv4",(e,t)=>{p_.init(e,t),Le.init(e,t)});var IR=D("ZodCIDRv6",(e,t)=>{m_.init(e,t),Le.init(e,t)});var NR=D("ZodBase64",(e,t)=>{h_.init(e,t),Le.init(e,t)});var AR=D("ZodBase64URL",(e,t)=>{g_.init(e,t),Le.init(e,t)});var jR=D("ZodE164",(e,t)=>{__.init(e,t),Le.init(e,t)});var MR=D("ZodJWT",(e,t)=>{y_.init(e,t),Le.init(e,t)});var iS=D("ZodNumber",(e,t)=>{gc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fc(e,r,o,n),e.isFinite=!0},fh({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=st(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=st(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=st(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>st(e).format??null},{gt(e,t){return this.check(Xs(e,t))},gte(e,t){return this.check(cn(e,t))},min(e,t){return this.check(cn(e,t))},lt(e,t){return this.check(Ys(e,t))},lte(e,t){return this.check(an(e,t))},max(e,t){return this.check(an(e,t))},int(e){return this.check(Gv(e))},safe(e){return this.check(Gv(e))},positive(e){return this.check(Xs(0,e))},nonnegative(e){return this.check(cn(0,e))},negative(e){return this.check(Ys(0,e))},nonpositive(e){return this.check(an(0,e))},multipleOf(e,t){return this.check(Qs(e,t))},step(e,t){return this.check(Qs(e,t))},finite(){return this}}));function te(e){return Fy(iS,e)}var ZR=D("ZodNumberFormat",(e,t)=>{v_.init(e,t),iS.init(e,t)});function Gv(e){return Vy(ZR,e)}var qR=D("ZodBoolean",(e,t)=>{S_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vc(e,r,o,n)});function fe(e){return Hy(qR,e)}var LR=D("ZodNull",(e,t)=>{b_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hc(e,r,o,n)});function ui(e){return By(LR,e)}var DR=D("ZodUnknown",(e,t)=>{R_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jc(e,r,o,n)});function me(){return Jy(DR)}var UR=D("ZodNever",(e,t)=>{w_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bc(e,r,o,n)});function FR(e){return Ky(UR,e)}var VR=D("ZodArray",(e,t)=>{ci(),P_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xc(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Kr(e,t))},nonempty(e){return this.check(Kr(1,e))},max(e,t){return this.check(ei(e,t))},length(e,t){return this.check(ti(e,t))},unwrap(){return this.element}});function Q(e,t){return Gy(VR,e,t)}var aS=D("ZodObject",(e,t)=>{ci(),T_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qc(e,r,o,n),w0(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ze(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(pt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(pt(this._zod.def,{catchall:me()}))},loose(){return this.clone(pt(this._zod.def,{catchall:me()}))},strict(){return this.clone(pt(this._zod.def,{catchall:FR()}))},strip(){return this.clone(pt(this._zod.def,{catchall:void 0}))},extend(e){return _0(this,e)},safeExtend(e){return y0(this,e)},merge(e){return v0(this,e)},pick(e){return h0(this,e)},omit(e){return g0(this,e)},partial(...e){return lh(lS,this,e[0])},exactPartial(...e){return lh(dS,this,e[0],"exactPartial")},required(...e){return S0(pS,this,e[0])}});function Z(e,t){let r={type:"object",shape:e??{},...ne(t)};return new aS(r)}function be(e,t){return new aS({type:"object",shape:e,catchall:me(),...ne(t)})}var cS=D("ZodUnion",(e,t)=>{_c.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eu(e,r,o,n),e.options=t.options});function ce(e,t){return new cS({type:"union",options:e,...ne(t)})}var HR=D("ZodDiscriminatedUnion",(e,t)=>{cS.init(e,t),I_.init(e,t)});function gu(e,t,r){return new HR({type:"union",options:t,discriminator:e,...ne(r)})}var BR=D("ZodIntersection",(e,t)=>{A_.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tu(e,r,o,n)});function Yr(e,t){return new BR({type:"intersection",left:e,right:t})}var Wv=D("ZodRecord",(e,t)=>{ci(),ey.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ru(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,r){if(!t||!t._zod)return new Wv({type:"record",keyType:k(),valueType:e,...ne(t)});return new Wv({type:"record",keyType:e,valueType:t,...ne(r)})}var pu=D("ZodEnum",(e,t)=>{ty.init(e,t),je.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kc(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 Error(`Key ${i} not found in enum`);return new pu({...t,checks:[],...ne(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 Error(`Key ${i} not found in enum`);return new pu({...t,checks:[],...ne(n),entries:s})}});function ze(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new pu({type:"enum",entries:r,...ne(t)})}var JR=D("ZodLiteral",(e,t)=>{ry.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gc(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new JR({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}var KR=D("ZodTransform",(e,t)=>{ci(),oy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yc(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(zr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(zr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function uS(e){return new KR({type:"transform",transform:e})}var lS=D("ZodOptional",(e,t)=>{yc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ri(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function he(e){return new lS({type:"optional",innerType:e})}var dS=D("ZodExactOptional",(e,t)=>{ny.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ri(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function GR(e){return new dS({type:"optional",innerType:e})}var WR=D("ZodNullable",(e,t)=>{sy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Yv(e){return new WR({type:"nullable",innerType:e})}var YR=D("ZodDefault",(e,t)=>{iy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function XR(e,t){return new YR({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var QR=D("ZodPrefault",(e,t)=>{ay.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ew(e,t){return new QR({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var pS=D("ZodNonOptional",(e,t)=>{cy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function tw(e,t){return new pS({type:"nonoptional",innerType:e,...ne(t)})}var rw=D("ZodCatch",(e,t)=>{uy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ow(e,t){return new rw({type:"catch",innerType:e,catchValue:typeof t==="function"?t:hh(t)})}var mS=D("ZodPipe",(e,t)=>{Sc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uu(e,r,o,n),e.in=t.in,e.out=t.out});function Xv(e,t){return new mS({type:"pipe",in:e,out:t})}var nw=D("ZodPreprocess",(e,t)=>{mS.init(e,t),ly.init(e,t)}),iw=D("ZodReadonly",(e,t)=>{dy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _w(e){return new iw({type:"readonly",innerType:e})}var zw=D("ZodLazy",(e,t)=>{py.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function _u(e){return new zw({type:"lazy",getter:e})}var $w=D("ZodCustom",(e,t)=>{my.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wc(e,r,o,n)});function Rw(e,t={}){return Wy($w,e,t)}function Pw(e,t){return Yy(e,t)}function li(e,t){return new nw({type:"pipe",in:uS(e),out:t})}function yu(e){return Gs(mu,e)}function kw(e){return Ws(hu,e)}var Ru=Symbol.for("mcp.sdk.errorBrands");function xF(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,Ru,{value:r,enumerable:!1,configurable:!0})}function kv(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Ru)){let r=t[Ru];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ro=function(e){return e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedGrantType="unsupported_grant_type",e.InvalidScope="invalid_scope",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedTokenType="unsupported_token_type",e.InvalidToken="invalid_token",e.MethodNotAllowed="method_not_allowed",e.TooManyRequests="too_many_requests",e.InvalidClientMetadata="invalid_client_metadata",e.InvalidRedirectUri="invalid_redirect_uri",e.InsufficientScope="insufficient_scope",e.InvalidTarget="invalid_target",e.InvalidDpopProof="invalid_dpop_proof",e.UseDpopNonce="use_dpop_nonce",e}({}),_i=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return kv(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kv(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",xF(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},gt=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}({}),ct=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return kv(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kv(this,e)}constructor(e,t,r,o){super(t,o);this.code=e,this.data=r,this.name="SdkError",xF(this,new.target)}},UA=class extends ct{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}};var hS={};function See(e){return Object.hasOwn(hS,e)?hS[e]:void 0}function gS(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function xw(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function IS(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function CF(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(gS(n)&&gS(s)){let i={};for(let[a,c]of Object.entries(n))if(c!==void 0&&s[a]===void 0&&!xw(o,a,s))i[a]=c;if(Object.keys(i).length>0)r[o]=i}}return Object.keys(r).length>0?r:void 0}var NS="2026-07-28",bT=[NS];function Dm(e){return e>=NS}function AS(e){return e.filter((t)=>!Dm(t))}function yi(e){return e.filter((t)=>Dm(t))}function jS(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var MS=["task","inputRequests","requestState"];function xu(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||MS.some((t)=>(t in e)))return e;return{...e,content:[]}}function Ew(){let e=_u(()=>ce([k(),te(),fe(),ui(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=Z({ttl:te().optional()}),s=Z({taskId:k()}),i=be({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=Z({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=Z({method:k(),params:a.loose().optional()}),l=Z({_meta:i.optional()}),d=Z({method:k(),params:l.loose().optional()}),m=be({_meta:i.optional()}),h=ce([k(),te().int()]),f=m.strict(),v=l.extend({requestId:h.optional(),reason:k().optional()}),y=d.extend({method:J("notifications/cancelled"),params:v}),g=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:ze(["light","dark"]).optional()}),P=Z({icons:Q(g).optional()}),w=Z({name:k(),title:k().optional()}),x=w.extend({...w.shape,...P.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),O=Yr(Z({applyDefaults:fe().optional()}),t),R=li((Ye)=>{if(Ye&&typeof Ye==="object"&&!Array.isArray(Ye)&&Object.keys(Ye).length===0)return{form:{}};return Ye},Yr(Z({form:O.optional(),url:t.optional()}),t.optional())),S=be({list:t.optional(),cancel:t.optional(),requests:be({sampling:be({createMessage:t.optional()}).optional(),elicitation:be({create:t.optional()}).optional()}).optional()}),E=be({list:t.optional(),cancel:t.optional(),requests:be({tools:be({call:t.optional()}).optional()}).optional()}),A=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:S.optional(),extensions:ie(k(),t).optional()}),H=a.extend({protocolVersion:k(),capabilities:A,clientInfo:x}),j=u.extend({method:J("initialize"),params:H}),V=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:E.optional(),extensions:ie(k(),t).optional()}),W=m.extend({protocolVersion:k(),capabilities:V,serverInfo:x,instructions:k().optional()}),Y=d.extend({method:J("notifications/initialized"),params:l.optional()}),ae=u.extend({method:J("ping"),params:a.optional()}),we=Z({progress:te(),total:he(te()),message:he(k())}),$e=Z({...l.shape,...we.shape,progressToken:r}),Ce=d.extend({method:J("notifications/progress"),params:$e}),de=a.extend({cursor:o.optional()}),N=u.extend({params:de.optional()}),M=m.extend({nextCursor:o.optional()}),b=Z({uri:k(),mimeType:he(k()),_meta:ie(k(),me()).optional()}),p=b.extend({text:k()}),_=k().refine((Ye)=>{try{return atob(Ye),!0}catch{return!1}},{message:"Invalid Base64 string"}),z=b.extend({blob:_}),I=ze(["user","assistant"]),U=Z({audience:Q(I).optional(),priority:te().min(0).max(1).optional(),lastModified:yu({offset:!0}).optional()}),G=Z({...w.shape,...P.shape,uri:k(),description:he(k()),mimeType:he(k()),size:he(te()),annotations:U.optional(),_meta:he(be({}))}),K=Z({...w.shape,...P.shape,uriTemplate:k(),description:he(k()),mimeType:he(k()),annotations:U.optional(),_meta:he(be({}))}),ue=N.extend({method:J("resources/list")}),Pe=M.extend({resources:Q(G)}),T=N.extend({method:J("resources/templates/list")}),q=M.extend({resourceTemplates:Q(K)}),F=a.extend({uri:k()}),ee=F,re=u.extend({method:J("resources/read"),params:ee}),se=m.extend({contents:Q(ce([p,z]))}),ge=d.extend({method:J("notifications/resources/list_changed"),params:l.optional()}),Ze=F,ke=u.extend({method:J("resources/subscribe"),params:Ze}),De=F,Ie=u.extend({method:J("resources/unsubscribe"),params:De}),ht=l.extend({uri:k()}),Ve=d.extend({method:J("notifications/resources/updated"),params:ht}),jt=Z({name:k(),description:he(k()),required:he(fe())}),zt=Z({...w.shape,...P.shape,description:he(k()),arguments:he(Q(jt)),_meta:he(be({}))}),Mt=N.extend({method:J("prompts/list")}),Vt=M.extend({prompts:Q(zt)}),Ht=a.extend({name:k(),arguments:ie(k(),k()).optional()}),ir=u.extend({method:J("prompts/get"),params:Ht}),ar=Z({type:J("text"),text:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),cr=Z({type:J("image"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),ur=Z({type:J("audio"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),io=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),Bt=Z({type:J("resource"),resource:ce([p,z]),annotations:U.optional(),_meta:ie(k(),me()).optional()}),ao=G.extend({type:J("resource_link")}),_t=ce([ar,cr,ur,ao,Bt]),Pr=Z({role:I,content:_t}),kr=m.extend({description:k().optional(),messages:Q(Pr)}),lr=d.extend({method:J("notifications/prompts/list_changed"),params:l.optional()}),co=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),xr=Z({taskSupport:ze(["required","optional","forbidden"]).optional()}),dr=Z({...w.shape,...P.shape,description:k().optional(),inputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()),outputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()).optional(),annotations:co.optional(),execution:xr.optional(),_meta:ie(k(),me()).optional()}),Tr=N.extend({method:J("tools/list")}),Or=M.extend({tools:Q(dr)}),Cr=m.extend({content:Q(_t),structuredContent:ie(k(),me()).optional(),isError:fe().optional()}),We=c.extend({name:k(),arguments:ie(k(),me()).optional()}),uo=u.extend({method:J("tools/call"),params:We}),xn=d.extend({method:J("notifications/tools/list_changed"),params:l.optional()}),Nr=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),lo=a.extend({level:Nr}),po=u.extend({method:J("logging/setLevel"),params:lo}),mo=l.extend({level:Nr,logger:k().optional(),data:me()}),fo=d.extend({method:J("notifications/message"),params:mo}),ho=Z({name:k().optional()}),go=Z({hints:Q(ho).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),_o=Z({mode:ze(["auto","required","none"]).optional()}),En=Z({type:J("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:Q(_t),structuredContent:Z({}).loose().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),yo=gu("type",[ar,cr,ur]),Jt=gu("type",[ar,cr,ur,io,En]),vo=Z({role:I,content:ce([Jt,Q(Jt)]),_meta:ie(k(),me()).optional()}),So=c.extend({messages:Q(vo),modelPreferences:go.optional(),systemPrompt:k().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(dr).optional(),toolChoice:_o.optional()}),bo=u.extend({method:J("sampling/createMessage"),params:So}),zo=m.extend({model:k(),stopReason:he(ze(["endTurn","stopSequence","maxTokens"]).or(k())),role:I,content:yo}),$o=m.extend({model:k(),stopReason:he(ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:I,content:ce([Jt,Q(Jt)])}),Ro=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),wo=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:k().optional()}),Po=Z({type:ze(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),ko=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),xo=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),Eo=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),To=ce([ko,xo]),mr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),fr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),Tn=ce([mr,fr]),On=ce([Eo,To,Tn]),it=ce([On,Ro,wo,Po]),at=c.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),it),required:Q(k()).optional()}).catchall(me())}),Oo=c.extend({mode:J("url"),message:k(),elicitationId:k(),url:k().url()}),$t=ce([at,Oo]),Cn=u.extend({method:J("elicitation/create"),params:$t}),In=l.extend({elicitationId:k()}),Nn=d.extend({method:J("notifications/elicitation/complete"),params:In}),An=m.extend({action:ze(["accept","decline","cancel"]),content:li((Ye)=>Ye===null?void 0:Ye,ie(k(),ce([k(),te(),fe(),Q(k())])).optional())}),jn=Z({type:J("ref/resource"),uri:k()}),Mn=Z({type:J("ref/prompt"),name:k()}),Zn=a.extend({ref:ce([Mn,jn]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()}),Co=u.extend({method:J("completion/complete"),params:Zn}),qn=m.extend({completion:be({values:Q(k()).max(100),total:he(te().int()),hasMore:he(fe())})}),Ln=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Ar=u.extend({method:J("roots/list"),params:a.optional()}),Io=m.extend({roots:Q(Ln)}),Dn=d.extend({method:J("notifications/roots/list_changed"),params:l.optional()}),Un=be({ttl:te().optional(),pollInterval:te().optional()}),No=ze(["working","input_required","completed","failed","cancelled"]),Kt=Z({taskId:k(),status:No,ttl:ce([te(),ui()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:he(te()),statusMessage:he(k())}),tt=m.extend({task:Kt}),Fn=l.merge(Kt),hr=d.extend({method:J("notifications/tasks/status"),params:Fn}),jr=u.extend({method:J("tasks/get"),params:a.extend({taskId:k()})}),Mr=m.merge(Kt),Zr=u.extend({method:J("tasks/result"),params:a.extend({taskId:k()})}),Ti=m.loose(),Xe=N.extend({method:J("tasks/list")}),Fe=M.extend({tasks:Q(Kt)}),gr=u.extend({method:J("tasks/cancel"),params:a.extend({taskId:k()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:m,RequestIdSchema:h,EmptyResultSchema:f,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:g,IconsSchema:P,BaseMetadataSchema:w,ImplementationSchema:x,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:H,InitializeRequestSchema:j,ServerCapabilitiesSchema:V,InitializeResultSchema:W,InitializedNotificationSchema:Y,PingRequestSchema:ae,ProgressSchema:we,ProgressNotificationParamsSchema:$e,ProgressNotificationSchema:Ce,PaginatedRequestParamsSchema:de,PaginatedRequestSchema:N,PaginatedResultSchema:M,ResourceContentsSchema:b,TextResourceContentsSchema:p,BlobResourceContentsSchema:z,RoleSchema:I,AnnotationsSchema:U,ResourceSchema:G,ResourceTemplateSchema:K,ListResourcesRequestSchema:ue,ListResourcesResultSchema:Pe,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:q,ResourceRequestParamsSchema:F,ReadResourceRequestParamsSchema:ee,ReadResourceRequestSchema:re,ReadResourceResultSchema:se,ResourceListChangedNotificationSchema:ge,SubscribeRequestParamsSchema:Ze,SubscribeRequestSchema:ke,UnsubscribeRequestParamsSchema:De,UnsubscribeRequestSchema:Ie,ResourceUpdatedNotificationParamsSchema:ht,ResourceUpdatedNotificationSchema:Ve,PromptArgumentSchema:jt,PromptSchema:zt,ListPromptsRequestSchema:Mt,ListPromptsResultSchema:Vt,GetPromptRequestParamsSchema:Ht,GetPromptRequestSchema:ir,TextContentSchema:ar,ImageContentSchema:cr,AudioContentSchema:ur,ToolUseContentSchema:io,EmbeddedResourceSchema:Bt,ResourceLinkSchema:ao,ContentBlockSchema:_t,PromptMessageSchema:Pr,GetPromptResultSchema:kr,PromptListChangedNotificationSchema:lr,ToolAnnotationsSchema:co,ToolExecutionSchema:xr,ToolSchema:dr,ListToolsRequestSchema:Tr,ListToolsResultSchema:Or,CallToolResultSchema:Cr,CallToolRequestParamsSchema:We,CallToolRequestSchema:uo,ToolListChangedNotificationSchema:xn,LoggingLevelSchema:Nr,SetLevelRequestParamsSchema:lo,SetLevelRequestSchema:po,LoggingMessageNotificationParamsSchema:mo,LoggingMessageNotificationSchema:fo,ModelHintSchema:ho,ModelPreferencesSchema:go,ToolChoiceSchema:_o,ToolResultContentSchema:En,SamplingContentSchema:yo,SamplingMessageContentBlockSchema:Jt,SamplingMessageSchema:vo,CreateMessageRequestParamsSchema:So,CreateMessageRequestSchema:bo,CreateMessageResultSchema:zo,CreateMessageResultWithToolsSchema:$o,BooleanSchemaSchema:Ro,StringSchemaSchema:wo,NumberSchemaSchema:Po,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:xo,LegacyTitledEnumSchemaSchema:Eo,SingleSelectEnumSchemaSchema:To,UntitledMultiSelectEnumSchemaSchema:mr,TitledMultiSelectEnumSchemaSchema:fr,MultiSelectEnumSchemaSchema:Tn,EnumSchemaSchema:On,PrimitiveSchemaDefinitionSchema:it,ElicitRequestFormParamsSchema:at,ElicitRequestURLParamsSchema:Oo,ElicitRequestParamsSchema:$t,ElicitRequestSchema:Cn,ElicitationCompleteNotificationParamsSchema:In,ElicitationCompleteNotificationSchema:Nn,ElicitResultSchema:An,ResourceTemplateReferenceSchema:jn,PromptReferenceSchema:Mn,CompleteRequestParamsSchema:Zn,CompleteRequestSchema:Co,CompleteResultSchema:qn,RootSchema:Ln,ListRootsRequestSchema:Ar,ListRootsResultSchema:Io,RootsListChangedNotificationSchema:Dn,TaskCreationParamsSchema:Un,TaskStatusSchema:No,TaskSchema:Kt,CreateTaskResultSchema:tt,TaskStatusNotificationParamsSchema:Fn,TaskStatusNotificationSchema:hr,GetTaskRequestSchema:jr,GetTaskResultSchema:Mr,GetTaskPayloadRequestSchema:Zr,GetTaskPayloadResultSchema:Ti,ListTasksRequestSchema:Xe,ListTasksResultSchema:Fe,CancelTaskRequestSchema:gr,CancelTaskResultSchema:m.merge(Kt),ClientRequestSchema:ce([ae,j,Co,po,ir,Mt,ue,T,re,ke,Ie,uo,Tr,jr,Zr,Xe,gr]),ClientNotificationSchema:ce([y,Ce,Y,Dn,hr]),ClientResultSchema:ce([f,zo,$o,An,Io,Mr,Fe,tt]),ServerRequestSchema:ce([ae,bo,Cn,Ar,jr,Zr,Xe,gr]),ServerNotificationSchema:ce([y,Ce,fo,Ve,ge,xn,lr,hr,Nn]),ServerResultSchema:ce([f,W,qn,kr,Vt,Pe,q,se,Cr,Or,Mr,Fe,tt]),CallToolResultWireSchema:me().superRefine((Ye,Yb)=>{if(typeof Ye!=="object"||Ye===null||Array.isArray(Ye)||Ye.content!==void 0)return;for(let Gu of MS)if(Gu in Ye){Yb.addIssue({code:"custom",message:`content is required when the body carries '${Gu}' \u2014 another result family cannot default into an empty tools/call success`});return}}).transform(xu).pipe(Cr)}}var Tw;function ZS(){return Tw??=Ew()}function qS(e){return e.type!=="object"}var Ow=new Set(["const","enum","default","examples"]),Cw=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function _S(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function Iw(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(_S(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Xu(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((c)=>o(c,!1));if(n===null||typeof n!=="object")return n;if(!s&&_S(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))if(s)i[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)a=!0;else if(Ow.has(c))i[c]=u;else if(Cw.has(c))i[c]=o(u,!0);else i[c]=o(u,!1);if(a)if("$ref"in i)i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}];else i.$ref="#/properties/result";return i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var LS={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},DS={"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},Nw={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},di;function Eu(){if(di)return di;let e=ZS();return di={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}},di}function US(e){return Object.prototype.hasOwnProperty.call(LS,e)}function FS(e){return Object.prototype.hasOwnProperty.call(DS,e)}function Aw(e){return Object.prototype.hasOwnProperty.call(Nw,e)}function jw(e){return Aw(e)?Eu().resultSchemas[e]:void 0}function Mw(e){return US(e)?Eu().requestSchemas[e]:void 0}function Zw(e){return FS(e)?Eu().notificationSchemas[e]:void 0}var FA=Object.keys(LS),VA=Object.keys(DS);function wu(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function pi(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 yS={ok:!1,reason:"not-in-era"};function vS(e){return wu(e)&&wu(e.outputSchema)&&qS(e.outputSchema)}function SS(e){return e}var Tu={era:"2025-11-25",hasRequestMethod:US,hasNotificationMethod:FS,validateRequest:(e,t)=>pi(Mw(e),t),validateResult:(e,t)=>pi(jw(e),t),validateNotification:(e,t)=>pi(Zw(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>yS,validateInputResponse:()=>yS,samplingResultVariant:(e,t)=>{let r=ZS();return pi(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=jS(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&qS(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(wu(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:SS(r)}}return{kind:"complete",result:SS(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>vS(o)))return t;return{...t,tools:r.map((o)=>vS(o)?{...o,outputSchema:Iw(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function qw(){let e=_u(()=>ce([k(),te(),fe(),ui(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=ce([k(),te().int()]),s=ze(["user","assistant"]),i=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),a=k().refine((Fe)=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=Z({ttl:te().optional()}),u=Z({taskId:k()}),l=be({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=Z({_meta:l.optional()}),m=d.extend({task:c.optional()}),h=Z({_meta:l.optional()}),f=Z({method:k(),params:h.loose().optional()}),v=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:ze(["light","dark"]).optional()}),y=Z({icons:Q(v).optional()}),g=Z({name:k(),title:k().optional()}),P=g.extend({...g.shape,...y.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),w=Yr(Z({applyDefaults:fe().optional()}),t),x=li((Fe)=>{if(Fe&&typeof Fe==="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0)return{form:{}};return Fe},Yr(Z({form:w.optional(),url:t.optional()}),t.optional())),O=be({list:t.optional(),cancel:t.optional(),requests:be({sampling:be({createMessage:t.optional()}).optional(),elicitation:be({create:t.optional()}).optional()}).optional()}),R=be({list:t.optional(),cancel:t.optional(),requests:be({tools:be({call:t.optional()}).optional()}).optional()}),S=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:O.optional(),extensions:ie(k(),t).optional()}),E=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:R.optional(),extensions:ie(k(),t).optional()}),A=Z({progress:te(),total:he(te()),message:he(k())}),H=Z({...h.shape,...A.shape,progressToken:r}),j=f.extend({method:J("notifications/progress"),params:H}),V=h.extend({level:i,logger:k().optional(),data:me()}),W=f.extend({method:J("notifications/message"),params:V}),Y=Z({uri:k(),mimeType:he(k()),_meta:ie(k(),me()).optional()}),ae=Y.extend({text:k()}),we=Y.extend({blob:a}),$e=Z({audience:Q(s).optional(),priority:te().min(0).max(1).optional(),lastModified:yu({offset:!0}).optional()}),Ce=Z({...g.shape,...y.shape,uri:k(),description:he(k()),mimeType:he(k()),size:he(te()),annotations:$e.optional(),_meta:he(be({}))}),de=Z({...g.shape,...y.shape,uriTemplate:k(),description:he(k()),mimeType:he(k()),annotations:$e.optional(),_meta:he(be({}))}),N=f.extend({method:J("notifications/resources/list_changed"),params:h.optional()}),M=h.extend({uri:k()}),b=f.extend({method:J("notifications/resources/updated"),params:M}),p=Z({name:k(),description:he(k()),required:he(fe())}),_=Z({...g.shape,...y.shape,description:he(k()),arguments:he(Q(p)),_meta:he(be({}))}),z=f.extend({method:J("notifications/prompts/list_changed"),params:h.optional()}),I=Z({type:J("text"),text:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),U=Z({type:J("image"),data:a,mimeType:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),G=Z({type:J("audio"),data:a,mimeType:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),K=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),ue=Z({type:J("resource"),resource:ce([ae,we]),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),Pe=Ce.extend({type:J("resource_link")}),T=ce([I,U,G,Pe,ue]),q=Z({role:s,content:T}),F=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),ee=f.extend({method:J("notifications/tools/list_changed"),params:h.optional()}),re=Z({name:k().optional()}),se=Z({hints:Q(re).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),ge=Z({mode:ze(["auto","required","none"]).optional()}),Ze=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),ke=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:k().optional()}),De=Z({type:ze(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),Ie=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),ht=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),Ve=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),jt=ce([Ie,ht]),zt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),Mt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),Vt=ce([zt,Mt]),Ht=ce([Ve,jt,Vt]),ir=ce([Ht,Ze,ke,De]),ar=m.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),ir),required:Q(k()).optional()}).catchall(me())}),cr=Z({type:J("ref/resource"),uri:k()}),ur=Z({type:J("ref/prompt"),name:k()}),io=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Bt=S.shape,ao=Z({experimental:Bt.experimental,sampling:Bt.sampling,elicitation:Bt.elicitation,roots:Bt.roots,extensions:Bt.extensions}),_t=E.shape,Pr=Z({experimental:_t.experimental,logging:_t.logging,completions:_t.completions,prompts:_t.prompts,resources:_t.resources,tools:_t.tools,extensions:_t.extensions}),kr=be({progressToken:r.optional(),[cs]:k(),[fu]:P.optional(),[Ir]:ao,[mp]:i.optional()}),lr=Z({...g.shape,...y.shape,description:k().optional(),inputSchema:be({$schema:k().optional(),type:J("object")}),outputSchema:be({$schema:k().optional()}).optional(),annotations:F.optional(),_meta:ie(k(),me()).optional()}),co=Z({type:J("tool_result"),toolUseId:k(),content:Q(T),structuredContent:me().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),xr=ce([I,U,G,K,co]),dr=Z({role:s,content:ce([xr,Q(xr)]),_meta:ie(k(),me()).optional()}),Tr=k(),Or=be({[Oa]:P.optional().catch(void 0)}),Cr=Or.optional();function We(Fe){return be({_meta:Cr,resultType:Tr.default("complete"),...Fe})}let uo=We({}),xn=We({nextCursor:o.optional()}),Nr=We({content:Q(T),structuredContent:me().optional(),isError:fe().optional()}),lo=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),tools:Q(lr),nextCursor:o.optional()}),po=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),mo=We({description:k().optional(),messages:Q(q)}),fo=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),ho=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resourceTemplates:Q(de),nextCursor:o.optional()}),go=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),contents:Q(ce([ae,we]))}),_o=We({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),En=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"])}),yo=We({ttlMs:te().int().min(0).catch(0),cacheScope:ze(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:Pr,instructions:k().optional()}),Jt=Z({messages:Q(dr),modelPreferences:se.optional(),systemPrompt:k().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(lr).optional(),toolChoice:ge.optional()}),vo=Z({method:J("sampling/createMessage"),params:Jt}),So=Z({method:J("roots/list"),params:Z({_meta:ie(k(),me()).optional()}).optional()}),bo=Z({...dr.shape,model:k(),stopReason:k().optional()}),zo=Z({roots:Q(io)}),$o=Z({action:ze(["accept","decline","cancel"]),content:ie(k(),ce([k(),te(),fe(),Q(k())])).optional()}),Ro=Z({mode:J("url"),message:k(),url:k().url()}),wo=ce([ar,Ro]),Po=Z({method:J("elicitation/create"),params:wo}),ko=ce([vo,So,Po]),xo=ce([bo,zo,$o]),Eo=ie(k(),ko),To=ie(k(),xo),mr=We({inputRequests:Eo.optional(),requestState:k().optional()}),fr={inputResponses:To.optional(),requestState:k().optional()},Tn=Z({_meta:kr,...fr}),On=be({progressToken:r.optional()});function it(Fe,gr){return Z({method:J(Fe),params:Z({_meta:kr,...gr})})}function at(Fe,gr){return Z({method:J(Fe),params:Z({_meta:On.optional(),...gr}).optional()})}let Oo={name:k(),arguments:ie(k(),me()).optional(),...fr},$t={cursor:o.optional()},Cn=it("tools/call",Oo),In=it("tools/list",$t),Nn=it("prompts/list",$t),An=it("prompts/get",{name:k(),arguments:ie(k(),k()).optional(),...fr}),jn=it("resources/list",$t),Mn=it("resources/templates/list",$t),Zn=it("resources/read",{uri:k(),...fr}),Co={ref:ce([ur,cr]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()},qn=it("completion/complete",Co),Ln=it("server/discover",{}),Ar=Z({toolsListChanged:fe().optional(),promptsListChanged:fe().optional(),resourcesListChanged:fe().optional(),resourceSubscriptions:Q(k()).optional()}),Io={notifications:Ar},Dn=it("subscriptions/listen",Io),Un=Or.extend({"io.modelcontextprotocol/subscriptionId":n}),No=be({_meta:Un,resultType:Tr.default("complete")}),Kt={"tools/call":at("tools/call",Oo),"tools/list":at("tools/list",$t),"prompts/get":at("prompts/get",{name:k(),arguments:ie(k(),k()).optional()}),"prompts/list":at("prompts/list",$t),"resources/list":at("resources/list",$t),"resources/templates/list":at("resources/templates/list",$t),"resources/read":at("resources/read",{uri:k()}),"completion/complete":at("completion/complete",Co),"server/discover":at("server/discover",{}),"subscriptions/listen":at("subscriptions/listen",Io)};function tt(Fe){return be({_meta:Cr,...Fe})}let Fn={"tools/call":tt({content:Q(T),structuredContent:me().optional(),isError:fe().optional()}),"tools/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),tools:Q(lr),nextCursor:o.optional()}),"prompts/get":tt({description:k().optional(),messages:Q(q)}),"prompts/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),"resources/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),"resources/templates/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resourceTemplates:Q(de),nextCursor:o.optional()}),"resources/read":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),contents:Q(ce([ae,we]))}),"completion/complete":tt({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),"server/discover":tt({ttlMs:te().int().min(0).catch(0),cacheScope:ze(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:Pr,instructions:k().optional()}),"subscriptions/listen":tt({})},hr=be({"io.modelcontextprotocol/subscriptionId":n.optional()}),jr=Z({method:J("notifications/subscriptions/acknowledged"),params:Z({_meta:hr.optional(),notifications:Ar})}),Mr=Z({_meta:hr.optional(),requestId:n,reason:k().optional()}),Zr=Z({method:J("notifications/cancelled"),params:Mr}),Ti={"notifications/cancelled":Zr,"notifications/progress":j,"notifications/message":W,"notifications/resources/updated":b,"notifications/resources/list_changed":N,"notifications/tools/list_changed":ee,"notifications/prompts/list_changed":z,"notifications/subscriptions/acknowledged":jr},Xe=(Fe)=>Z({jsonrpc:J("2.0"),id:ce([k(),te().int()]),result:Fe}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:h,NotificationSchema:f,IconSchema:v,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:P,ClientTasksCapabilitySchema:O,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:A,ProgressNotificationParamsSchema:H,ProgressNotificationSchema:j,LoggingMessageNotificationParamsSchema:V,LoggingMessageNotificationSchema:W,ResourceContentsSchema:Y,TextResourceContentsSchema:ae,BlobResourceContentsSchema:we,AnnotationsSchema:$e,ResourceSchema:Ce,ResourceTemplateSchema:de,ResourceListChangedNotificationSchema:N,ResourceUpdatedNotificationParamsSchema:M,ResourceUpdatedNotificationSchema:b,PromptArgumentSchema:p,PromptSchema:_,PromptListChangedNotificationSchema:z,TextContentSchema:I,ImageContentSchema:U,AudioContentSchema:G,ToolUseContentSchema:K,EmbeddedResourceSchema:ue,ResourceLinkSchema:Pe,ContentBlockSchema:T,PromptMessageSchema:q,ToolAnnotationsSchema:F,ToolListChangedNotificationSchema:ee,ModelHintSchema:re,ModelPreferencesSchema:se,ToolChoiceSchema:ge,BooleanSchemaSchema:Ze,StringSchemaSchema:ke,NumberSchemaSchema:De,UntitledSingleSelectEnumSchemaSchema:Ie,TitledSingleSelectEnumSchemaSchema:ht,LegacyTitledEnumSchemaSchema:Ve,SingleSelectEnumSchemaSchema:jt,UntitledMultiSelectEnumSchemaSchema:zt,TitledMultiSelectEnumSchemaSchema:Mt,MultiSelectEnumSchemaSchema:Vt,EnumSchemaSchema:Ht,PrimitiveSchemaDefinitionSchema:ir,ElicitRequestFormParamsSchema:ar,ResourceTemplateReferenceSchema:cr,PromptReferenceSchema:ur,RootSchema:io,ClientCapabilities2026Schema:ao,ServerCapabilities2026Schema:Pr,RequestMetaEnvelopeSchema:kr,ToolSchema:lr,ToolResultContentSchema:co,SamplingMessageContentBlockSchema:xr,SamplingMessageSchema:dr,ResultTypeSchema:Tr,ResultMetaSchema:Or,ResultSchema:uo,PaginatedResultSchema:xn,CallToolResultSchema:Nr,ListToolsResultSchema:lo,ListPromptsResultSchema:po,GetPromptResultSchema:mo,ListResourcesResultSchema:fo,ListResourceTemplatesResultSchema:ho,ReadResourceResultSchema:go,CompleteResultSchema:_o,CacheableResultSchema:En,DiscoverResultSchema:yo,CreateMessageRequestParamsSchema:Jt,CreateMessageRequestSchema:vo,ListRootsRequestSchema:So,CreateMessageResultSchema:bo,ListRootsResultSchema:zo,ElicitResultSchema:$o,ElicitRequestURLParamsSchema:Ro,ElicitRequestParamsSchema:wo,ElicitRequestSchema:Po,InputRequestSchema:ko,InputResponseSchema:xo,InputRequestsSchema:Eo,InputResponsesSchema:To,InputRequiredResultSchema:mr,InputResponseRequestParamsSchema:Tn,CallToolRequestSchema:Cn,ListToolsRequestSchema:In,ListPromptsRequestSchema:Nn,GetPromptRequestSchema:An,ListResourcesRequestSchema:jn,ListResourceTemplatesRequestSchema:Mn,ReadResourceRequestSchema:Zn,CompleteRequestSchema:qn,DiscoverRequestSchema:Ln,SubscriptionFilterSchema:Ar,SubscriptionsListenRequestSchema:Dn,SubscriptionsListenResultMetaSchema:Un,SubscriptionsListenResultSchema:No,dispatchRequestSchemas:Kt,dispatchResultSchemas:Fn,NotificationMetaSchema:hr,SubscriptionsAcknowledgedNotificationSchema:jr,CancelledNotificationParamsSchema:Mr,CancelledNotificationSchema:Zr,notificationSchemas2026:Ti,JSONRPCResultResponseSchema:Xe(uo),CallToolResultResponseSchema:Xe(ce([Nr,mr])),ListToolsResultResponseSchema:Xe(lo),ListPromptsResultResponseSchema:Xe(po),GetPromptResultResponseSchema:Xe(ce([mo,mr])),ListResourcesResultResponseSchema:Xe(fo),ListResourceTemplatesResultResponseSchema:Xe(ho),ReadResourceResultResponseSchema:Xe(ce([go,mr])),CompleteResultResponseSchema:Xe(_o),DiscoverResultResponseSchema:Xe(yo),SubscriptionsListenResultResponseSchema:Xe(No)}}var Lw;function nr(){return Lw??=qw()}var Dw=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Uw(e){return Dw.includes(e)}var Qr=Symbol("modelcontextprotocol.resultCacheHintFallback");function vi(e,t){if(t===void 0)return e;let r=e[Qr];if(r===void 0)return{...e,[Qr]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[Qr]:o}}function Fw(e){return e[Qr]}function Ou(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Cu(e){return e==="public"||e==="private"}function DF(e,t){if(e.ttlMs!==void 0&&!Ou(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Cu(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var pe=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}({}),ye=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return kv(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return kv(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",xF(this,new.target)}static fromError(t,r,o){if(t===pe.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Vw(n.elicitations,r)}if(t===pe.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new kV({supported:n.supported,requested:n.requested},r)}if(t===pe.InvalidParams||t===pe.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===pe.ResourceNotFound||Object.keys(n).length===1))return new Om(n.uri,r)}if(t===pe.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new OF({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Om=class extends ye{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(pe.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Vw=class extends ye{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(pe.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},kV=class extends ye{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(pe.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},OF=class extends ye{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(pe.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Hw=0,Bw="private",Jw=["tools/call","prompts/get","resources/read"];function Kw(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Jw.includes(e))return t;throw new ye(pe.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Gw(e,t){let r=Fw(t);if(t.resultType!=="complete"||!Uw(e))return r===void 0?t:eP(t);let o=t,n=Ou(o.ttlMs)?o.ttlMs:Xw(r),s=Cu(o.cacheScope)?o.cacheScope:Qw(r),i={...o,ttlMs:n,cacheScope:s};return delete i[Qr],i}function Ww(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Yw(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Oa]:t}};if(!Ww(r))return e;if(r[Oa]!==void 0)return e;return{...e,_meta:{...r,[Oa]:t}}}function Xw(e){return e!==void 0&&Ou(e.ttlMs)?e.ttlMs:Hw}function Qw(e){return e!==void 0&&Cu(e.cacheScope)?e.cacheScope:Bw}function eP(e){let t={...e};return delete t[Qr],t}var tP=["elicitation/create","sampling/createMessage","roots/list"],mi;function VS(){if(mi)return mi;let e=nr();return mi={request:{"elicitation/create":Z({method:J("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":Z({method:J("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":Z({method:J("roots/list"),params:be({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},mi}function HS(e){return tP.includes(e)}function vu(e){return HS(e)?VS().request[e]:void 0}function rP(e){return HS(e)?VS().response[e]:void 0}var Iu={"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},BS={"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 JS(e){return Object.prototype.hasOwnProperty.call(Iu,e)}function KS(e){return Object.prototype.hasOwnProperty.call(BS,e)}function oP(e){return Object.prototype.hasOwnProperty.call(Iu,e)}function nP(e){return JS(e)?nr().dispatchRequestSchemas[e]:void 0}function sP(e){return oP(e)?nr().dispatchResultSchemas[e]:void 0}function iP(e){return KS(e)?nr().notificationSchemas2026[e]:void 0}var HA=Object.keys(Iu),BA=Object.keys(BS);function yn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function gn(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 aP={ok:!1,reason:"not-in-era"},cP=[cs,Ir];function uP(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((a)=>yn(a)&&("execution"in a)))n().tools=s.map((a)=>{if(!yn(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c});let i=t.capabilities;if(yn(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var Nu={era:"2026-07-28",hasRequestMethod:JS,hasNotificationMethod:KS,hasInputRequestMethod:(e)=>vu(e)!==void 0,validateRequest:(e,t)=>gn(nP(e),t),validateResult:(e,t)=>gn(sP(e),t),validateNotification:(e,t)=>gn(iP(e),t),validateInputRequest:(e,t)=>gn(vu(e),t),validateInputResponse:(e,t)=>gn(rP(e),t),samplingResultVariant:()=>aP,outboundEnvelope(e){return{[cs]:e.protocolVersion,[fu]:e.clientInfo,[Ir]:e.clientCapabilities,...e.logLevel!==void 0&&{[mp]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of cP)if(!(o in e))t.push({key:o,problem:"missing"});let r=nr().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";if(n.length===1&&t.some((i)=>i.key===s&&i.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>jS(e),inputRequestSchema:vu,decodeResult(e,t){if(!yn(t))return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ct(gt.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 ct(gt.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=yn(i)?i:{},c=t.requestState,u=t._meta===void 0?void 0:nr().ResultMetaSchema.safeParse(t._meta),l=u?.success?u.data:void 0;if(Object.keys(a).length===0&&typeof c!=="string")return{kind:"invalid",error:new ct(gt.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"})};return{kind:"input_required",inputRequests:a,...typeof c==="string"&&{requestState:c},...l!==void 0&&{_meta:l}}}if(r!=="complete")return{kind:"invalid",error:new ct(gt.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=lP(),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 ct(gt.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 Yw(Gw(e,Kw(e,uP(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=nr().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("; ")}`}},fi;function lP(){if(fi)return fi;let e=nr();return fi={"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},fi}var $n="2026-07-28";function Ft(e){return e!==void 0&&Dm(e)?Nu:Tu}function bS(e){if(e.revision!==void 0)return Ft(e.revision).era;return e.era==="modern"?Nu.era:Tu.era}function Su(e){return GS.some((t)=>t.hasRequestMethod(e))}function bu(e){return GS.some((t)=>t.hasNotificationMethod(e))}function zS(e){return e==="tasks/get"||e==="tasks/cancel"}var GS=[Tu,Nu];function $S(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ww(e){if(!$S(e))return;let t=e._meta;return $S(t)?t:void 0}function Si(e){let t=ww(e);return t!==void 0&&cs in t}function Au(e){let t=ww(e)?.[cs];return typeof t==="string"?t:void 0}function gi(e){return Ft($n).validateEnvelopeMeta(e)}var dP=Wu({AnnotationsSchema:()=>Cm,AudioContentSchema:()=>pw,BaseMetadataSchema:()=>_m,BaseRequestParamsSchema:()=>no,BlobResourceContentsSchema:()=>uT,BooleanSchemaSchema:()=>fw,CallToolRequestParamsSchema:()=>kx,CallToolRequestSchema:()=>Ex,CallToolResultSchema:()=>fT,CancelTaskRequestSchema:()=>SF,CancelTaskResultSchema:()=>wF,CancelledNotificationParamsSchema:()=>D_,CancelledNotificationSchema:()=>iT,ClientCapabilitiesSchema:()=>F_,ClientNotificationSchema:()=>PF,ClientRequestSchema:()=>RF,ClientResultSchema:()=>AF,ClientTasksCapabilitySchema:()=>M_,CompatibilityCallToolResultSchema:()=>lF,CompleteRequestParamsSchema:()=>eC,CompleteRequestSchema:()=>tC,CompleteResultSchema:()=>rC,ContentBlockSchema:()=>mw,CreateMessageRequestParamsSchema:()=>$x,CreateMessageRequestSchema:()=>Ux,CreateMessageResultSchema:()=>Hx,CreateMessageResultWithToolsSchema:()=>qx,CreateTaskResultSchema:()=>pF,CursorSchema:()=>eT,DiscoverRequestSchema:()=>U_,DiscoverResultSchema:()=>Av,ElicitRequestFormParamsSchema:()=>Wh,ElicitRequestParamsSchema:()=>Kx,ElicitRequestSchema:()=>Gx,ElicitRequestURLParamsSchema:()=>jx,ElicitResultSchema:()=>Xx,ElicitationCompleteNotificationParamsSchema:()=>Yx,ElicitationCompleteNotificationSchema:()=>Jx,EmbeddedResourceSchema:()=>yx,EmptyResultSchema:()=>nT,EnumSchemaSchema:()=>zx,GetPromptRequestParamsSchema:()=>fx,GetPromptRequestSchema:()=>hx,GetPromptResultSchema:()=>Sx,GetTaskPayloadRequestSchema:()=>gF,GetTaskPayloadResultSchema:()=>yF,GetTaskRequestSchema:()=>fF,GetTaskResultSchema:()=>hF,IconSchema:()=>O_,IconsSchema:()=>Lh,ImageContentSchema:()=>uw,ImplementationSchema:()=>cw,InitializeRequestParamsSchema:()=>L_,InitializeRequestSchema:()=>oT,InitializeResultSchema:()=>B_,InitializedNotificationSchema:()=>$_,JSONArraySchema:()=>cF,JSONObjectSchema:()=>Vi,JSONRPCErrorResponseSchema:()=>Pv,JSONRPCMessageSchema:()=>fp,JSONRPCNotificationSchema:()=>aw,JSONRPCRequestSchema:()=>sw,JSONRPCResponseSchema:()=>dF,JSONRPCResultResponseSchema:()=>Rv,JSONValueSchema:()=>Nh,LegacyTitledEnumSchemaSchema:()=>yw,ListChangedOptionsBaseSchema:()=>hT,ListPromptsRequestSchema:()=>px,ListPromptsResultSchema:()=>mx,ListResourceTemplatesRequestSchema:()=>j_,ListResourceTemplatesResultSchema:()=>K_,ListResourcesRequestSchema:()=>W_,ListResourcesResultSchema:()=>z_,ListRootsRequestSchema:()=>iC,ListRootsResultSchema:()=>oC,ListTasksRequestSchema:()=>vF,ListTasksResultSchema:()=>bF,ListToolsRequestSchema:()=>Ax,ListToolsResultSchema:()=>Tx,LoggingLevelSchema:()=>Hh,LoggingMessageNotificationParamsSchema:()=>Cx,LoggingMessageNotificationSchema:()=>Dx,ModelHintSchema:()=>Ox,ModelPreferencesSchema:()=>Mx,MultiSelectEnumSchemaSchema:()=>Wx,NotificationSchema:()=>sa,NotificationsParamsSchema:()=>oa,NumberSchemaSchema:()=>Vh,PaginatedRequestParamsSchema:()=>xm,PaginatedRequestSchema:()=>Bh,PaginatedResultSchema:()=>cl,PingRequestSchema:()=>aT,PrimitiveSchemaDefinitionSchema:()=>Sw,ProgressNotificationParamsSchema:()=>q_,ProgressNotificationSchema:()=>cT,ProgressSchema:()=>H_,ProgressTokenSchema:()=>QA,PromptArgumentSchema:()=>lx,PromptListChangedNotificationSchema:()=>wx,PromptMessageSchema:()=>bx,PromptReferenceSchema:()=>Qx,PromptSchema:()=>ux,ReadResourceRequestParamsSchema:()=>G_,ReadResourceRequestSchema:()=>Y_,ReadResourceResultSchema:()=>J_,RelatedTaskMetadataSchema:()=>C_,RequestIdSchema:()=>Fh,RequestMetaSchema:()=>tT,RequestSchema:()=>Wi,ResourceContentsSchema:()=>dT,ResourceLinkSchema:()=>vx,ResourceListChangedNotificationSchema:()=>X_,ResourceRequestParamsSchema:()=>dw,ResourceSchema:()=>Uh,ResourceTemplateReferenceSchema:()=>Zx,ResourceTemplateSchema:()=>V_,ResourceUpdatedNotificationParamsSchema:()=>cx,ResourceUpdatedNotificationSchema:()=>dx,ResultMetaObjectSchema:()=>rT,ResultSchema:()=>ii,RoleSchema:()=>$h,RootSchema:()=>nC,RootsListChangedNotificationSchema:()=>sC,SamplingContentSchema:()=>Lx,SamplingMessageContentBlockSchema:()=>Tv,SamplingMessageSchema:()=>Bx,ServerCapabilitiesSchema:()=>sT,ServerNotificationSchema:()=>kF,ServerRequestSchema:()=>TF,ServerResultSchema:()=>EF,ServerTasksCapabilitySchema:()=>N_,SetLevelRequestParamsSchema:()=>_x,SetLevelRequestSchema:()=>xx,SingleSelectEnumSchemaSchema:()=>Vx,StringSchemaSchema:()=>qh,SubscribeRequestParamsSchema:()=>Z_,SubscribeRequestSchema:()=>Q_,SubscriptionFilterSchema:()=>pT,SubscriptionsAcknowledgedNotificationParamsSchema:()=>ix,SubscriptionsAcknowledgedNotificationSchema:()=>ox,SubscriptionsListenRequestParamsSchema:()=>rx,SubscriptionsListenRequestSchema:()=>nx,SubscriptionsListenResultMetaSchema:()=>sx,SubscriptionsListenResultSchema:()=>ax,TaskAugmentedRequestParamsSchema:()=>wv,TaskCreationParamsSchema:()=>uF,TaskMetadataSchema:()=>x_,TaskSchema:()=>zh,TaskStatusNotificationParamsSchema:()=>cC,TaskStatusNotificationSchema:()=>mF,TaskStatusSchema:()=>aC,TextContentSchema:()=>lw,TextResourceContentsSchema:()=>lT,TitledMultiSelectEnumSchemaSchema:()=>bw,TitledSingleSelectEnumSchemaSchema:()=>gw,ToolAnnotationsSchema:()=>Rx,ToolChoiceSchema:()=>Nx,ToolExecutionSchema:()=>Px,ToolListChangedNotificationSchema:()=>Ix,ToolResultContentSchema:()=>Fx,ToolSchema:()=>mT,ToolUseContentSchema:()=>gx,UnsubscribeRequestParamsSchema:()=>ex,UnsubscribeRequestSchema:()=>tx,UntitledMultiSelectEnumSchemaSchema:()=>vw,UntitledSingleSelectEnumSchemaSchema:()=>hw});function wee(e){return fp.parse(e)}var Mm=(e)=>sw.safeParse(e).success,ju=(e)=>aw.safeParse(e).success,jh=(e)=>Rv.safeParse(e).success,Kh=(e)=>Pv.safeParse(e).success;var sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var T5=(e)=>oT.safeParse(e).success;function WS(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function YS(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var pP="Mcp-Param-",RS="x-mcp-header",mP=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,fP=new Set(["string","integer","boolean"]);function EV(e){let t=[],r=new Map,o,n=(i,a,c)=>{if(i===null||typeof i!=="object")return;let u=i;if(RS in u){if(!c||a.length===0)return`${Xr(a)}: 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=u[RS];if(typeof d!=="string"||d.length===0)return`${Xr(a)}: x-mcp-header MUST be a non-empty string`;if(!mP.test(d))return`${Xr(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof u.type==="string"?u.type:void 0;if(m===void 0||!fP.has(m)){let v=`${Xr(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return v;o??=v}let h=d.toLowerCase(),f=r.get(h);if(f!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${f}')`;r.set(h,d),t.push({path:a,headerName:d,type:m})}let l=u.properties;if(l!==null&&typeof l==="object")for(let[d,m]of Object.entries(l)){let h=n(m,[...a,d],c);if(h!==void 0)return h}for(let d of hP){let m=u[d];if(m===void 0)continue;let h=Array.isArray(m)?m:m!==null&&typeof m==="object"&&gP.has(d)?Object.values(m):[m];for(let f of h){let v=n(f,[...a,`<${d}>`],!1);if(v!==void 0)return v}}},s=n(e,[],!0);if(s!==void 0)return{valid:!1,reason:o??s};return o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o,declarations:t}}var hP=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],gP=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Xr(e){return e.length===0?"<root>":e.join(".")}var _P="=?base64?",yP="?=",vP=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,SP=/^-?\d+(\.\d+)?$/;function bP(e){if(typeof e==="string")return e;if(typeof e==="boolean")return e?"true":"false";if(typeof e==="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}function zP(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(r)}function XS(e){if(!(e.startsWith(_P)&&e.endsWith(yP)))return e;let t=e.slice(9,e.length-2);if(!vP.test(t))return;try{return zP(t)}catch{return}}function $P(e,t){let r=e;for(let o of t){if(r===null||typeof r!=="object")return;r=r[o]}return r}function Ree(e,t,r){for(let o of e){let n=`${pP}${o.headerName}`,s=r.get(n),i=$P(t,o.path);if(i===void 0||i===null)continue;let a=bP(i);if(a===void 0)continue;if(s===null)return zu("param-header-missing",n,`the body carries ${Xr(o.path)}=${JSON.stringify(i)} but the ${n} header is absent`);let c=XS(s);if(c===void 0)return zu("param-header-invalid-encoding",n,`the ${n} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&SP.test(c)&&typeof i==="number"?Number(c)===i:c===a))return zu("param-header-mismatch",n,`the ${n} header decodes to ${JSON.stringify(c)} but the body carries ${Xr(o.path)}=${JSON.stringify(i)}`)}}function zu(e,t,r){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:eo,message:`Bad Request: the request headers and body disagree: ${r}`,data:{mismatch:{header:t,body:r}},settled:!0}}var eo=-32020,JA=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],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:[pe.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:[eo,pe.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:[pe.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:[pe.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:[pe.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:[eo],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:[pe.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:[eo],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."}],Mu={[pe.ParseError]:400,[pe.InvalidRequest]:400,[pe.MethodNotFound]:404,[pe.UnsupportedProtocolVersion]:400,[pe.MissingRequiredClientCapability]:400,[eo]:400};function Pee(e,t){if(t==="in-band")return e===pe.MissingRequiredClientCapability?400:200;return Mu[e]??400}function bt(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Pt(e,t,r,o="era-classification"){return bt(o,e,400,new ye(eo,`Bad Request: the request headers and body disagree: ${r}`,{mismatch:{header:t,body:r}}),!0)}var wS={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};function RP(e,t){let r=Object.hasOwn(wS,e)?wS[e]:void 0;if(r===void 0)return;let o=Sn(t)?t[r]:void 0;return{field:r,value:typeof o==="string"?o:void 0}}function hi(e){let t=0;while(t<e.length){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let r=e.length;while(r>t){let o=e.codePointAt(r-1);if(o!==9&&o!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function Aee(e,t){if(t.messageKind!=="request")return;let r=t.message.method;if(e.protocolVersionHeader===void 0){let c=t.classification.revision;return Pt("version-header-missing","(missing)",c===void 0?"the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent":`the body envelope names protocol version ${c} but the required MCP-Protocol-Version header is absent`,"standard-header-validation")}if(e.mcpMethodHeader===void 0)return Pt("method-header-missing","(missing)",`the body names method ${r} but the required Mcp-Method header is absent`,"standard-header-validation");let o=RP(r,t.message.params);if(o===void 0)return;let{field:n,value:s}=o;if(e.mcpNameHeader===void 0){if(s===void 0)return;return Pt("name-header-missing","(missing)",`the body carries params.${n}="${s}" but the required Mcp-Name header is absent`,"standard-header-validation")}let i=hi(e.mcpNameHeader),a=XS(i);if(a===void 0)return Pt("name-header-invalid-encoding",i,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(s!==void 0&&a!==s)return Pt("name-header-mismatch",i,`the body carries params.${n}="${s}" but the Mcp-Name header names "${a}"`,"standard-header-validation")}function Sn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function QS(e){if(e===void 0)return{era:"modern"};return{era:Dm(e)?"modern":"legacy",revision:e}}function wP(e){if(!Si(e))return!1;let t=Au(e);if(t===void 0||!Dm(t))return!1;let r=ww(e);return r!==void 0&&gi(r).length===0}function PP(e){if(e.length===0)return bt("jsonrpc-shape","empty-batch",400,new ye(pe.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(Si(Sn(t)?t.params:void 0))return bt("jsonrpc-shape","batch-with-modern-element",400,new ye(pe.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(Mm(t)||ju(t)||jh(t)||Kh(t)))return bt("jsonrpc-shape","batch-with-invalid-element",400,new ye(pe.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function kP(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&Dm(n);if(o==="initialize"&&!wP(r)){if(s)return Pt("initialize-with-modern-header",n,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let i=Sn(r)&&typeof r.protocolVersion==="string"?r.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...i!==void 0&&{requestedVersion:i}}}if(Si(r)){let i=ww(r),a=(i===void 0?[]:gi(i))[0];if(a!==void 0)return bt("envelope","envelope-invalid",400,new ye(pe.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${a.key}: ${a.problem}`,{envelope:a}),!0);let c=Au(r);if(n!==void 0&&c!==void 0&&n!==c)return Pt("header-body-version-mismatch",n,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${n}`);if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"request",message:t,classification:QS(c)}}if(s){let i=ww(r),a=gi(i??{}).filter((u)=>u.problem==="missing").map((u)=>u.key),c=i===void 0?["_meta"]:a.length>0?a:[cs];return bt("envelope","modern-header-without-claim",400,new ye(pe.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${n}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...n!==void 0&&{requestedVersion:n}}}function xP(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&Dm(n);if(Si(r)){let i=Au(r);if(i===void 0){let c=ww(r),u=(c===void 0?[]:gi(c)).find((l)=>l.key===cs)??{key:cs,problem:"expected a protocol version string"};return bt("envelope","notification-envelope-invalid",400,new ye(pe.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(n!==void 0&&n!==i)return Pt("notification-header-body-version-mismatch",n,`the notification envelope names protocol version ${i} but the MCP-Protocol-Version header names ${n}`);let a=QS(i);if(a.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:a}}if(s){if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:n}}}return{kind:"legacy",reason:"notification",...n!==void 0&&{requestedVersion:n}}}function MF(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:hi(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:hi(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:hi(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;if(Array.isArray(t))return PP(t);if(jh(t)||Kh(t))return{kind:"legacy",reason:"response"};if(Sn(t)&&Mm(t))return kP(e,t);if(Sn(t)&&ju(t))return xP(e,t);return bt("jsonrpc-shape","invalid-json-rpc-body",400,new ye(pe.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function Tee(e,t){switch(e.reason){case"http-method":return bt("http-method","modern-only-method-not-allowed",405,new ye(-32000,"Method not allowed."),!0);case"batch":return bt("jsonrpc-shape","modern-only-batch-not-supported",400,new ye(pe.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return bt("jsonrpc-shape","modern-only-response-post",400,new ye(pe.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return bt("era-classification","modern-only-missing-envelope",400,r===void 0?new ye(pe.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new kV({supported:[...t],requested:r}),!0)}}}function bi(e,t){return si(e,t)}function _n(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function to(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var PS=!1,Pu="draft-2020-12";function wr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Pu});else if(r.vendor==="zod"){if(!("_zod"in e))throw 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().");if(!PS)PS=!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=oi(e,{target:Pu,io:t})}else throw 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"){if(o.type!==void 0)return o;return eb(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw 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}}var EP=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function eb(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref==="string"&&EP.exec(e.$ref);if(r&&t[r[1]]?.[r[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let n=e[o];if(Array.isArray(n)&&n.length>0)return n.every((s)=>s!==null&&typeof s==="object"&&(s.type==="object"||eb(s,"$id"in s?{}:t)))}return!1}function TP(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Rr(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>TP(o)).join(", ")};return{success:!0,data:r.value}}function OP(e){let t=oi(e,{target:Pu,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var CP=/\\\.\\d\{(\d+)\}/;function IP(e){let t=CP.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>yu({local:o,offset:n,precision:s}))))}function NP(e,t){let r;switch(e){case"email":r=[oS()];break;case"uri":r=[sS()];break;case"date":r=[kw()];break;case"date-time":r=IP(t);break}return new Set(r.map((o)=>OP(o)).filter((o)=>o!==void 0))}function AP(e,t,r){if(r!=="zod")return!0;return NP(e,t).has(t)}function tb(e){let t=wr(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 bn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function jP(e){try{return wr(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ye(pe.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var MP=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Zu(e){return MP.has(e)||e.startsWith("x-")}var ZP=new Set(["$schema",...Object.keys(Wh.shape.requestedSchema.shape)]),kS={string:_n([qh,hw,gw,yw]),number:_n([Vh]),integer:_n([Vh]),boolean:_n([fw]),array:_n([vw,bw])},qP=new Set(qh.shape.format.unwrap().options);function LP(e,t,r,o){if(!bn(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(kS,e.type)?kS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))if(n.has(i)||Zu(i))s[i]=a;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!qP.has(e.format))s[i]=a;else if(typeof a!=="string"||!AP(e.format,a,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function DP(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&bn(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,LP(a,`properties.${i}`,t,o)]));else if(ZP.has(n))r[n]=s;else if(!Zu(n))o.push(n);if(o.length>0)throw new ye(pe.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function UP(e,t){if(!bn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!bi(Sw,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function ku(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>ku(o,t[n],`${r}[${n}]`));if(!bn(e)||!bn(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return Zu(o)?[]:[s];return ku(n,t[o],s)})}function FP(e){if(!to(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=DP(jP(e.requestedSchema),t),o=bi(Wh.shape.requestedSchema,r);if(!o.success)throw new ye(pe.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${UP(r,o.error.message)}`);let n=ku(r,o.data);if(n.length>0)throw new ye(pe.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 ye(pe.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function VP(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw 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 IV=Object.assign(VP,{elicit(e){try{return{method:"elicitation/create",params:FP(e)}}catch(t){throw t instanceof ye?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"}}});function kee(e,t,r){let o=HP(e,t);if(o.kind!=="elicit"||o.action!=="accept"||o.content===void 0)return;if(r===void 0)return o.content;let n=r["~standard"].validate(o.content);if(n instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return n.issues===void 0?n.value:void 0}function HP(e,t){if(e===void 0||typeof e!=="object"||e===null)return{kind:"missing"};let r=e[t];if(r===null||typeof r!=="object"||Array.isArray(r))return{kind:"missing"};let o=r;if(o.action==="accept"||o.action==="decline"||o.action==="cancel"){let n=o.content;return{kind:"elicit",action:o.action,...n!==null&&typeof n==="object"&&!Array.isArray(n)&&{content:n}}}if(Array.isArray(o.roots))return{kind:"roots",roots:o.roots};if(typeof o.role==="string"&&o.content!==void 0)return{kind:"sampling",result:o};return{kind:"missing"}}var rb=250;function ob(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function nb(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ct?t.reason:new ct(gt.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ct?t.reason:new ct(gt.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function sb(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var BP=["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"],JP={IdJagTokenExchangeResponseSchema:pC,OAuthClientInformationFullSchema:hC,OAuthClientInformationSchema:fC,OAuthClientMetadataSchema:mC,OAuthClientRegistrationErrorSchema:IF,OAuthErrorResponseSchema:vT,OAuthMetadataSchema:gT,OAuthProtectedResourceMetadataSchema:dC,OAuthTokenRevocationRequestSchema:_F,OAuthTokensSchema:yT,OpenIdProviderDiscoveryMetadataSchema:uC,OpenIdProviderMetadataSchema:lC},ib={},ab={};function cb(e,t){let r=e.slice(0,-6);ib[r]=t,ab[r]=(o)=>t.safeParse(o).success}for(let e of BP)cb(e,dP[e]);for(let[e,t]of Object.entries(JP))cb(e,t);var KA=Object.freeze(ib),GA=Object.freeze(ab);function KP(e){switch(e){case"initialize":case"notifications/initialized":return Ft(void 0);case"server/discover":return Ft($n);default:return}}var GP=60000,WP=[cs,fu,Ir,mp],YP=["inputResponses","requestState"];function xS(e,t){let r=e.params;if(!vn(r))return{message:e,lifted:{}};let o=r._meta,n=vn(o)?WP.filter((c)=>(c in o)):[],s=t==="request"?YP.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&vn(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];if(i.envelope=c,Object.keys(u).length>0)a._meta=u;else delete a._meta}for(let c of s){if(c==="inputResponses")i.inputResponses=a[c];if(c==="requestState")i.requestState=a[c];delete a[c]}return{message:{...e,params:a},lifted:i}}function ES(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function wn(e){return()=>e}var XP=wn(void 0);function qu(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:wn(t)}}}var ub;function Eee(e,t){ub(e,t)}var lb=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{ub=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Sv,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 ct(gt.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){if(e.params.requestId===void 0)return;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 ct(gt.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);if(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)=>{if(o?.(n,s),jh(n)||Kh(n))this._onresponse(n);else if(Mm(n))this._onrequest(n,s);else if(ju(n))this._onnotification(n,s);else this._onerror(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 ct(gt.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}=xS(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=bS(t.classification);if(i!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(bu(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((i)=>this._onerror(Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=xS(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(v,y,g)=>{let P={jsonrpc:"2.0",id:r.id,error:{code:v,message:y,...g!==void 0&&{data:g}}};s?.send(P).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(t?.classification!==void 0){let v=bS(t.classification);if(v!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${n.era}`));let y=t.classification.revision??v;i(pe.UnsupportedProtocolVersion,`Unsupported protocol version: ${y}`,{supported:this._supportedProtocolVersions,requested:y});return}}if(Su(r.method)&&!n.hasRequestMethod(r.method)&&!(zS(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(pe.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(pe.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(pe.InvalidParams,c);return}let u=(v,y)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...y,relatedRequestId:r.id}),l=(v,y,g)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,y,{...g,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let m=o.inputResponses===void 0?void 0:QP(o.inputResponses),h={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...m!==void 0&&{inputResponses:m.accepted},...m!==void 0&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:o.requestState===void 0?XP:wn(o.requestState),signal:d.signal,send:(v,y,g)=>{let P=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(P,v.method),to(y))return l(v,y,g);let w=ES(P,v.method);if(w===void 0)throw TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(v,w,y)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},f=this.buildContext(h,t);Promise.resolve().then(()=>a(r,f)).then(async(v)=>{if(d.signal.aborted)return;let y;try{y=n.encodeResult(r.method,v,this._outboundServerInfo())}catch(P){this._onerror(Error(`Failed to encode result for ${r.method}: ${P}`)),i(pe.InternalError,"Internal error");return}let g={result:y,jsonrpc:"2.0",id:r.id};await s?.send(g)},async(v)=>{if(d.signal.aborted)return;let y=Number.isSafeInteger(v.code)?v.code:pe.InternalError,g={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(y),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(g)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===d)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(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(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),jh(e))r(e);else r(ye.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(to(t)){if(!zS(e.method))this._assertOutboundRequestInEra(o,e.method);return this._requestWithSchemaViaCodec(o,e,t,r)}this._assertOutboundRequestInEra(o,e.method);let n=ES(o,e.method);if(n===void 0)throw 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 Ft(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=KP(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Su(t)&&!e.hasRequestMethod(t))throw new ct(gt.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:a}=o??{},c=Date.now(),u,l;return new Promise((d,m)=>{let h=(R)=>{m(R)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(R){h(R);return}if(o?.signal?.aborted){let R=o.signal.reason;throw R instanceof ct?R:new ct(gt.RequestTimeout,String(R))}let f=e.era===$n&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;l=v;let y={...t,jsonrpc:"2.0",id:v};if(o?.onprogress)this._progressHandlers.set(v,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:v}};let g=this._envelopeOutbound(y),P=!1,w=(R)=>{if(P)return;if(this._progressHandlers.delete(v),f===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(R)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((S)=>this._onerror(Error(`Failed to send cancellation: ${S}`)))}else f.abort();m(R instanceof ct?R:new ct(gt.RequestTimeout,String(R)))};this._responseHandlers.set(v,(R)=>{if(o?.signal?.aborted)return;if(P=!0,R instanceof Error)return m(R);let S;try{S=e.decodeResult(t.method,R.result)}catch(A){return m(A instanceof Error?A:Error(String(A)))}if(S.kind==="invalid")return m(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return d(ek(S));let A={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(H,j)=>this._requestWithSchemaViaCodec(e,H===void 0?{method:t.method}:{method:t.method,params:H},r,j)};return d(this._resolveNonCompleteResult(S,A))}let E=S.result;Rr(r,E).then((A)=>{if(A.success)d(A.data);else m(new ct(gt.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},m)}),u=()=>w(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let x=o?.timeout??GP,O=()=>w(new ct(gt.RequestTimeout,"Request timed out",{timeout:x}));this._setupTimeout(v,x,o?.maxTotalTimeout,O,o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:f?.signal}).catch((R)=>{this._progressHandlers.delete(v),m(R)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(l!==void 0)this._responseHandlers.delete(l),this._cleanupTimeout(l)})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ct(gt.NotConnected,"Not connected");if(bu(t.method)&&!e.hasNotificationMethod(t.method))throw new ct(gt.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(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;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(!Su(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era")a=i.validateInputRequest(e,n);if(!a.ok){if(a.reason==="not-in-era")throw new ye(pe.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await Rr(t.params,{...n.params});if(!i.success)throw new ye(pe.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw TypeError("setRequestHandler: handler is required");if(typeof t==="function")this._customSchemaRequestMethods.delete(e);else 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 Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!bu(e))throw 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){if(s.reason==="not-in-era")throw new ye(pe.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await Rr(t.params,{...o.params});if(!n.success)throw new ye(pe.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function vn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function db(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]=vn(i)&&vn(s)?{...i,...s}:s}return r}function TS(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function QP(e){let t={},r=[];if(!TS(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!TS(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function ek(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
115
+ * content-type
116
+ * Copyright(c) 2015 Douglas Christopher Wilson
117
+ * MIT Licensed
118
+ */var tk=B((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(a){if(!a)throw TypeError("argument string is required");var c=typeof a==="object"?s(a):a;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var m,h,f;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,m=h[1].toLowerCase(),f=h[2],f.charCodeAt(0)===34){if(f=f.slice(1,-1),f.indexOf("\\")!==-1)f=f.replace(r,"$1")}d.parameters[m]=f}if(u!==c.length)throw TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader==="function")c=a.getHeader("content-type");else if(typeof a.headers==="object")c=a.headers&&a.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),rk=Hn(tk(),1);function k5(e){if(!e)return;try{return rk.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(t===""||e.slice(t.length).includes(","))return;return t}}function E5(e){if(e==="application/json")return!0;return k5(e)==="application/json"}var ok=10485760,Iee=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??ok}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){while(this._buffer){let e=this._buffer.indexOf(`
119
+ `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return nk(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function nk(e){return fp.parse(JSON.parse(e))}function _ee(e){return JSON.stringify(e)+`
120
+ `}var sk=/^[A-Za-z0-9._-]{1,128}$/;function ik(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");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!sk.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 ak(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 Lu(e){let t=ik(e);return ak(e,t.warnings),t.isValid}var OS=1e6,$u=1e6,CS=1e4,ck=1e6,pb=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,o){if(t.length>r)throw Error(`${o} exceeds maximum length of ${r} characters (got ${t.length})`)}template;parts;get variableNames(){return this.parts.flatMap((t)=>typeof t==="string"?[]:t.names)}constructor(t){e.validateLength(t,OS,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],o="",n=0,s=0;while(n<t.length)if(t[n]==="{"){if(o)r.push(o),o="";let i=t.indexOf("}",n);if(i===-1)throw Error("Unclosed template expression");if(s++,s>CS)throw Error(`Template contains too many expressions (max ${CS})`);let a=t.slice(n+1,i),c=this.getOperator(a),u=a.includes("*"),l=this.getNames(a),d=l[0];for(let m of l)e.validateLength(m,$u,"Variable name");r.push({name:d,operator:c,names:l,exploded:u}),n=i+1}else o+=t[n],n++;if(o)r.push(o);return r}getOperator(t){return["+","#",".","/","?","&"].find((r)=>t.startsWith(r))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map((o)=>o.replace("*","").trim()).filter((o)=>o.length>0)}encodeValue(t,r){if(e.validateLength(t,$u,"Variable value"),r==="+"||r==="#")return encodeURI(t);return encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let s=t.names.map((i)=>{let a=r[i];if(a===void 0)return"";return`${i}=${Array.isArray(a)?a.map((c)=>this.encodeValue(c,t.operator)).join(","):this.encodeValue(a.toString(),t.operator)}`}).filter((i)=>i.length>0);if(s.length===0)return"";return(t.operator==="?"?"?":"&")+s.join("&")}if(t.names.length>1){let s=t.names.map((i)=>r[i]).filter((i)=>i!==void 0);if(s.length===0)return"";return s.map((i)=>Array.isArray(i)?i[0]:i).join(",")}let o=r[t.name];if(o===void 0)return"";let n=(Array.isArray(o)?o:[o]).map((s)=>this.encodeValue(s,t.operator));switch(t.operator){case"":return n.join(",");case"+":return n.join(",");case"#":return"#"+n.join(",");case".":return"."+n.join(".");case"/":return"/"+n.join("/");default:return n.join(",")}}expand(t){let r="",o=!1;for(let n of this.parts){if(typeof n==="string"){r+=n;continue}let s=this.expandPart(n,t);if(!s)continue;if(r+=(n.operator==="?"||n.operator==="&")&&o?s.replace("?","&"):s,n.operator==="?"||n.operator==="&")o=!0}return r}escapeRegExp(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let r=[];for(let s of t.names)e.validateLength(s,$u,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let s=0;s<t.names.length;s++){let i=t.names[s],a=s===0?"\\"+t.operator:"&";r.push({pattern:a+this.escapeRegExp(i)+"=([^&]+)",name:i})}return r}let o,n=t.name;switch(t.operator){case"":o=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":o="(.+)";break;case".":o=String.raw`\.([^/,]+)`;break;case"/":o="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:o="([^/]+)"}return r.push({pattern:o,name:n}),r}match(t){e.validateLength(t,OS,"URI");let r="^",o=[];for(let a of this.parts)if(typeof a==="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:l}of c)r+=u,o.push({name:l,exploded:a.exploded})}r+="$",e.validateLength(r,ck,"Generated regex pattern");let n=new RegExp(r),s=t.match(n);if(!s)return null;let i={};for(let[a,c]of o.entries()){let{name:u,exploded:l}=c,d=s[a+1],m=u.replace("*","");i[m]=l&&d.includes(",")?d.split(","):d}return i}},xee=class e{_otherTransport;_messageQueue=[];_closed=!1;onclose;onerror;onmessage;sessionId;static createLinkedPair(){let t=new e,r=new e;return t._otherTransport=r,r._otherTransport=t,[t,r]}async start(){while(this._messageQueue.length>0){let t=this._messageQueue.shift();this.onmessage?.(t.message,t.extra)}}async close(){if(this._closed)return;this._closed=!0;let t=this._otherTransport;this._otherTransport=void 0;try{await t?.close()}finally{this.onclose?.()}}async send(t,r){if(!this._otherTransport)throw new ct(gt.NotConnected,"Not connected");if(this._otherTransport.onmessage)this._otherTransport.onmessage(t,{authInfo:r?.authInfo});else this._otherTransport._messageQueue.push({message:t,extra:{authInfo:r?.authInfo}})}};function uk(e){return typeof e==="object"&&e!==null&&"_zod"in e}function lk(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function dk(e){if(typeof e!=="object"||e===null)return!1;if(to(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((r)=>uk(r))}function zi(e){if(e===void 0)return;if(dk(e))return Z(e);if(typeof e==="object"&&e!==null&&!to(e)&&Object.values(e).some((t)=>lk(t)))throw 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(!to(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}var $i=B((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(g){super();if(!e.IDENTIFIER.test(g))throw Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(g){super();this._items=typeof g==="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((P,w)=>`${P}${w}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((P,w)=>{if(w instanceof r)P[w.str]=(P[w.str]||0)+1;return P},{})}};e._Code=o,e.nil=new o("");function n(g,...P){let w=[g[0]],x=0;while(x<P.length)a(w,P[x]),w.push(g[++x]);return new o(w)}e._=n;let s=new o("+");function i(g,...P){let w=[h(g[0])],x=0;while(x<P.length)w.push(s),a(w,P[x]),w.push(s,h(g[++x]));return c(w),new o(w)}e.str=i;function a(g,P){if(P instanceof o)g.push(...P._items);else if(P instanceof r)g.push(P);else g.push(d(P))}e.addCodeArg=a;function c(g){let P=1;while(P<g.length-1){if(g[P]===s){let w=u(g[P-1],g[P+1]);if(w!==void 0){g.splice(P-1,3,w);continue}g[P++]="+"}P++}}function u(g,P){if(P==='""')return g;if(g==='""')return P;if(typeof g=="string"){if(P instanceof r||g[g.length-1]!=='"')return;if(typeof P!="string")return`${g.slice(0,-1)}${P}"`;if(P[0]==='"')return g.slice(0,-1)+P.slice(1);return}if(typeof P=="string"&&P[0]==='"'&&!(g instanceof r))return`"${g}${P.slice(1)}`}function l(g,P){return P.emptyStr()?g:g.emptyStr()?P:i`${g}${P}`}e.strConcat=l;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:h(Array.isArray(g)?g.join(","):g)}function m(g){return new o(h(g))}e.stringify=m;function h(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function f(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new o(`.${g}`):n`[${g}]`}e.getProperty=f;function v(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new o(`${g}`);throw Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=v;function y(g){return new o(g.toString())}e.regexpCode=y}),mb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=$i();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`);this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.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:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(c))||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u);this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var a=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:m}=d,h=(l=u.key)!==null&&l!==void 0?l:u.ref,f=this._values[m];if(f){let g=f.get(h);if(g)return g}else f=this._values[m]=new Map;f.set(h,d);let v=this._scope[m]||(this._scope[m]=[]),y=v.length;return v[y]=u.ref,d.setValue(u,{property:m,itemIndex:y}),d}getValue(c,u){let l=this._values[c];if(!l)return;return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,(d)=>{if(d.value===void 0)throw Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let m=t.nil;for(let h in c){let f=c[h];if(!f)continue;let v=l[h]=l[h]||new Map;f.forEach((y)=>{if(v.has(y))return;v.set(y,o.Started);let g=u(y);if(g){let P=this.opts.es5?e.varKinds.var:e.varKinds.const;m=t._`${m}${P} ${y} = ${g};${this.opts._n}`}else if(g=d===null||d===void 0?void 0:d(y))m=t._`${m}${g}${this.opts._n}`;else throw new r(y);v.set(y,o.Completed)})}return m}};e.ValueScope=a}),le=B((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=$i(),r=mb();var o=$i();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=mb();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(p,_){return this}},i=class extends s{constructor(p,_,z){super();this.varKind=p,this.name=_,this.rhs=z}render({es5:p,_n:_}){let z=p?r.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${z} ${this.name}${I};`+_}optimizeNames(p,_){if(!p[this.name.str])return;if(this.rhs)this.rhs=Y(this.rhs,p,_);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(p,_,z){super();this.lhs=p,this.rhs=_,this.sideEffects=z}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,_){if(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Y(this.rhs,p,_),this}get names(){return W(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(p,_,z,I){super(p,z,I);this.op=_}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}},u=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}},l=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}},d=class extends s{constructor(p){super();this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}},m=class extends s{constructor(p){super();this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,_){return this.code=Y(this.code,p,_),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends s{constructor(p=[]){super();this.nodes=p}render(p){return this.nodes.reduce((_,z)=>_+z.render(p),"")}optimizeNodes(){let{nodes:p}=this,_=p.length;while(_--){let z=p[_].optimizeNodes();if(Array.isArray(z))p.splice(_,1,...z);else if(z)p[_]=z;else p.splice(_,1)}return p.length>0?this:void 0}optimizeNames(p,_){let{nodes:z}=this,I=z.length;while(I--){let U=z[I];if(U.optimizeNames(p,_))continue;ae(p,U.names),z.splice(I,1)}return z.length>0?this:void 0}get names(){return this.nodes.reduce((p,_)=>V(p,_.names),{})}},f=class extends h{render(p){return"{"+p._n+super.render(p)+"}"+p._n}},v=class extends h{},y=class extends f{};y.kind="else";var g=class p extends f{constructor(_,z){super(z);this.condition=_}render(_){let z=`if(${this.condition})`+super.render(_);if(this.else)z+="else "+this.else.render(_);return z}optimizeNodes(){super.optimizeNodes();let _=this.condition;if(_===!0)return this.nodes;let z=this.else;if(z){let I=z.optimizeNodes();z=this.else=Array.isArray(I)?new y(I):I}if(z){if(_===!1)return z instanceof p?z:z.nodes;if(this.nodes.length)return this;return new p(we(_),z instanceof p?[z]:z.nodes)}if(_===!1||!this.nodes.length)return;return this}optimizeNames(_,z){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(_,z),!(super.optimizeNames(_,z)||this.else))return;return this.condition=Y(this.condition,_,z),this}get names(){let _=super.names;if(W(_,this.condition),this.else)V(_,this.else.names);return _}};g.kind="if";var P=class extends f{};P.kind="for";var w=class extends P{constructor(p){super();this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iteration=Y(this.iteration,p,_),this}get names(){return V(super.names,this.iteration.names)}},x=class extends P{constructor(p,_,z,I){super();this.varKind=p,this.name=_,this.from=z,this.to=I}render(p){let _=p.es5?r.varKinds.var:this.varKind,{name:z,from:I,to:U}=this;return`for(${_} ${z}=${I}; ${z}<${U}; ${z}++)`+super.render(p)}get names(){return W(W(super.names,this.from),this.to)}},O=class extends P{constructor(p,_,z,I){super();this.loop=p,this.varKind=_,this.name=z,this.iterable=I}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iterable=Y(this.iterable,p,_),this}get names(){return V(super.names,this.iterable.names)}},R=class extends f{constructor(p,_,z){super();this.name=p,this.args=_,this.async=z}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}};R.kind="func";var S=class extends h{render(p){return"return "+super.render(p)}};S.kind="return";var E=class extends f{render(p){let _="try"+super.render(p);if(this.catch)_+=this.catch.render(p);if(this.finally)_+=this.finally.render(p);return _}optimizeNodes(){var p,_;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(_=this.finally)===null||_===void 0||_.optimizeNodes(),this}optimizeNames(p,_){var z,I;return super.optimizeNames(p,_),(z=this.catch)===null||z===void 0||z.optimizeNames(p,_),(I=this.finally)===null||I===void 0||I.optimizeNames(p,_),this}get names(){let p=super.names;if(this.catch)V(p,this.catch.names);if(this.finally)V(p,this.finally.names);return p}},A=class extends f{constructor(p){super();this.error=p}render(p){return`catch(${this.error})`+super.render(p)}};A.kind="catch";var H=class extends f{render(p){return"finally"+super.render(p)}};H.kind="finally";var j=class{constructor(p,_={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._,_n:_.lines?`
121
+ `:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,_){let z=this._extScope.value(p,_);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue(p,_){return this._extScope.getValue(p,_)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,_,z,I){let U=this._scope.toName(_);if(z!==void 0&&I)this._constants[U.str]=z;return this._leafNode(new i(p,U,z)),U}const(p,_,z){return this._def(r.varKinds.const,p,_,z)}let(p,_,z){return this._def(r.varKinds.let,p,_,z)}var(p,_,z){return this._def(r.varKinds.var,p,_,z)}assign(p,_,z){return this._leafNode(new a(p,_,z))}add(p,_){return this._leafNode(new c(p,e.operators.ADD,_))}code(p){if(typeof p=="function")p();else if(p!==t.nil)this._leafNode(new m(p));return this}object(...p){let _=["{"];for(let[z,I]of p){if(_.length>1)_.push(",");if(_.push(z),z!==I||this.opts.es5)_.push(":"),(0,t.addCodeArg)(_,I)}return _.push("}"),new t._Code(_)}if(p,_,z){if(this._blockNode(new g(p)),_&&z)this.code(_).else().code(z).endIf();else if(_)this.code(_).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new g(p))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(p,_){if(this._blockNode(p),_)this.code(_).endFor();return this}for(p,_){return this._for(new w(p),_)}forRange(p,_,z,I,U=this.opts.es5?r.varKinds.var:r.varKinds.let){let G=this._scope.toName(p);return this._for(new x(U,G,_,z),()=>I(G))}forOf(p,_,z,I=r.varKinds.const){let U=this._scope.toName(p);if(this.opts.es5){let G=_ instanceof t.Name?_:this.var("_arr",_);return this.forRange("_i",0,t._`${G}.length`,(K)=>{this.var(U,t._`${G}[${K}]`),z(U)})}return this._for(new O("of",I,U,_),()=>z(U))}forIn(p,_,z,I=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,t._`Object.keys(${_})`,z);let U=this._scope.toName(p);return this._for(new O("in",I,U,_),()=>z(U))}endFor(){return this._endBlockNode(P)}label(p){return this._leafNode(new u(p))}break(p){return this._leafNode(new l(p))}return(p){let _=new S;if(this._blockNode(_),this.code(p),_.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(p,_,z){if(!_&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new E;if(this._blockNode(I),this.code(p),_){let U=this.name("e");this._currNode=I.catch=new A(U),_(U)}if(z)this._currNode=I.finally=new H,this.code(z);return this._endBlockNode(A,H)}throw(p){return this._leafNode(new d(p))}block(p,_){if(this._blockStarts.push(this._nodes.length),p)this.code(p).endBlock(_);return this}endBlock(p){let _=this._blockStarts.pop();if(_===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-_;if(z<0||p!==void 0&&z!==p)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${p} expected`);return this._nodes.length=_,this}func(p,_=t.nil,z,I){if(this._blockNode(new R(p,_,z)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(R)}optimize(p=1){while(p-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,_){let z=this._currNode;if(z instanceof p||_&&z instanceof _)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${_?`${p.kind}/${_.kind}`:p.kind}"`)}_elseNode(p){let _=this._currNode;if(!(_ instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=_.else=p,this}get _root(){return this._nodes[0]}get _currNode(){let p=this._nodes;return p[p.length-1]}set _currNode(p){let _=this._nodes;_[_.length-1]=p}};e.CodeGen=j;function V(p,_){for(let z in _)p[z]=(p[z]||0)+(_[z]||0);return p}function W(p,_){return _ instanceof t._CodeOrName?V(p,_.names):p}function Y(p,_,z){if(p instanceof t.Name)return I(p);if(!U(p))return p;return new t._Code(p._items.reduce((G,K)=>{if(K instanceof t.Name)K=I(K);if(K instanceof t._Code)G.push(...K._items);else G.push(K);return G},[]));function I(G){let K=z[G.str];if(K===void 0||_[G.str]!==1)return G;return delete _[G.str],K}function U(G){return G instanceof t._Code&&G._items.some((K)=>K instanceof t.Name&&_[K.str]===1&&z[K.str]!==void 0)}}function ae(p,_){for(let z in _)p[z]=(p[z]||0)-(_[z]||0)}function we(p){return typeof p=="boolean"||typeof p=="number"||p===null?!p:t._`!${b(p)}`}e.not=we;let $e=M(e.operators.AND);function Ce(...p){return p.reduce($e)}e.and=Ce;let de=M(e.operators.OR);function N(...p){return p.reduce(de)}e.or=N;function M(p){return(_,z)=>_===t.nil?z:z===t.nil?_:t._`${b(_)} ${p} ${b(z)}`}function b(p){return p instanceof t.Name?p:t._`(${p})`}}),_e=B((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=$i();function o(R){let S={};for(let E of R)S[E]=!0;return S}e.toHash=o;function n(R,S){if(typeof S=="boolean")return S;if(Object.keys(S).length===0)return!0;return s(R,S),!i(S,R.self.RULES.all)}e.alwaysValidSchema=n;function s(R,S=R.schema){let{opts:E,self:A}=R;if(!E.strictSchema)return;if(typeof S==="boolean")return;let H=A.RULES.keywords;for(let j in S)if(!H[j])O(R,`unknown keyword: "${j}"`)}e.checkUnknownRules=s;function i(R,S){if(typeof R=="boolean")return!R;for(let E in R)if(S[E])return!0;return!1}e.schemaHasRules=i;function a(R,S){if(typeof R=="boolean")return!R;for(let E in R)if(E!=="$ref"&&S.all[E])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:R,schemaPath:S},E,A,H){if(!H){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return t._`${E}`}return t._`${R}${S}${(0,t.getProperty)(A)}`}e.schemaRefOrVal=c;function u(R){return m(decodeURIComponent(R))}e.unescapeFragment=u;function l(R){return encodeURIComponent(d(R))}e.escapeFragment=l;function d(R){if(typeof R=="number")return`${R}`;return R.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function h(R,S){if(Array.isArray(R))for(let E of R)S(E);else S(R)}e.eachItem=h;function f({mergeNames:R,mergeToName:S,mergeValues:E,resultToName:A}){return(H,j,V,W)=>{let Y=V===void 0?j:V instanceof t.Name?(j instanceof t.Name?R(H,j,V):S(H,j,V),V):j instanceof t.Name?(S(H,V,j),j):E(j,V);return W===t.Name&&!(Y instanceof t.Name)?A(H,Y):Y}}e.mergeEvaluated={props:f({mergeNames:(R,S,E)=>R.if(t._`${E} !== true && ${S} !== undefined`,()=>{R.if(t._`${S} === true`,()=>R.assign(E,!0),()=>R.assign(E,t._`${E} || {}`).code(t._`Object.assign(${E}, ${S})`))}),mergeToName:(R,S,E)=>R.if(t._`${E} !== true`,()=>{if(S===!0)R.assign(E,!0);else R.assign(E,t._`${E} || {}`),y(R,E,S)}),mergeValues:(R,S)=>R===!0?!0:{...R,...S},resultToName:v}),items:f({mergeNames:(R,S,E)=>R.if(t._`${E} !== true && ${S} !== undefined`,()=>R.assign(E,t._`${S} === true ? true : ${E} > ${S} ? ${E} : ${S}`)),mergeToName:(R,S,E)=>R.if(t._`${E} !== true`,()=>R.assign(E,S===!0?!0:t._`${E} > ${S} ? ${E} : ${S}`)),mergeValues:(R,S)=>R===!0?!0:Math.max(R,S),resultToName:(R,S)=>R.var("items",S)})};function v(R,S){if(S===!0)return R.var("props",!0);let E=R.var("props",t._`{}`);if(S!==void 0)y(R,E,S);return E}e.evaluatedPropsToName=v;function y(R,S,E){Object.keys(E).forEach((A)=>R.assign(t._`${S}${(0,t.getProperty)(A)}`,!0))}e.setEvaluated=y;let g={};function P(R,S){return R.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new r._Code(S.code))})}e.useFunc=P;var w;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(w||(e.Type=w={}));function x(R,S,E){if(R instanceof t.Name){let A=S===w.Num;return E?A?t._`"[" + ${R} + "]"`:t._`"['" + ${R} + "']"`:A?t._`"/" + ${R}`:t._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(R).toString():"/"+d(R)}e.getErrorPath=x;function O(R,S,E=R.opts.strictSchema){if(!E)return;if(S=`strict mode: ${S}`,E===!0)throw Error(S);R.self.logger.warn(S)}e.checkStrictMode=O}),kt=B((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}),Pi=B((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=kt();e.keywordError={message:({keyword:y})=>t.str`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:g})=>g?t.str`"${y}" keyword must be ${g} ($data)`:t.str`"${y}" keyword is invalid ($data)`};function n(y,g=e.keywordError,P,w){let{it:x}=y,{gen:O,compositeRule:R,allErrors:S}=x,E=d(y,g,P);if(w!==null&&w!==void 0?w:R||S)c(O,E);else u(x,t._`[${E}]`)}e.reportError=n;function s(y,g=e.keywordError,P){let{it:w}=y,{gen:x,compositeRule:O,allErrors:R}=w;if(c(x,d(y,g,P)),!(O||R))u(w,o.default.vErrors)}e.reportExtraError=s;function i(y,g){y.assign(o.default.errors,g),y.if(t._`${o.default.vErrors} !== null`,()=>y.if(g,()=>y.assign(t._`${o.default.vErrors}.length`,g),()=>y.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:y,keyword:g,schemaValue:P,data:w,errsCount:x,it:O}){if(x===void 0)throw Error("ajv implementation error");let R=y.name("err");y.forRange("i",x,o.default.errors,(S)=>{if(y.const(R,t._`${o.default.vErrors}[${S}]`),y.if(t._`${R}.instancePath === undefined`,()=>y.assign(t._`${R}.instancePath`,(0,t.strConcat)(o.default.instancePath,O.errorPath))),y.assign(t._`${R}.schemaPath`,t.str`${O.errSchemaPath}/${g}`),O.opts.verbose)y.assign(t._`${R}.schema`,P),y.assign(t._`${R}.data`,w)})}e.extendErrors=a;function c(y,g){let P=y.const("err",g);y.if(t._`${o.default.vErrors} === null`,()=>y.assign(o.default.vErrors,t._`[${P}]`),t._`${o.default.vErrors}.push(${P})`),y.code(t._`${o.default.errors}++`)}function u(y,g){let{gen:P,validateName:w,schemaEnv:x}=y;if(x.$async)P.throw(t._`new ${y.ValidationError}(${g})`);else P.assign(t._`${w}.errors`,g),P.return(!1)}let l={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 d(y,g,P){let{createErrors:w}=y.it;if(w===!1)return t._`{}`;return m(y,g,P)}function m(y,g,P={}){let{gen:w,it:x}=y,O=[h(x,P),f(y,P)];return v(y,g,O),w.object(...O)}function h({errorPath:y},{instancePath:g}){let P=g?t.str`${y}${(0,r.getErrorPath)(g,r.Type.Str)}`:y;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,P)]}function f({keyword:y,it:{errSchemaPath:g}},{schemaPath:P,parentSchema:w}){let x=w?g:t.str`${g}/${y}`;if(P)x=t.str`${x}${(0,r.getErrorPath)(P,r.Type.Str)}`;return[l.schemaPath,x]}function v(y,{params:g,message:P},w){let{keyword:x,data:O,schemaValue:R,it:S}=y,{opts:E,propertyName:A,topSchemaRef:H,schemaPath:j}=S;if(w.push([l.keyword,x],[l.params,typeof g=="function"?g(y):g||t._`{}`]),E.messages)w.push([l.message,typeof P=="function"?P(y):P]);if(E.verbose)w.push([l.schema,R],[l.parentSchema,t._`${H}${j}`],[o.default.data,O]);if(A)w.push([l.propertyName,A])}}),pk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Pi(),r=le(),o=kt(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;if(l===!1)a(c,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${d}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;if(d===!1)l.var(u,!1),a(c);else l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,m={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(m,n,void 0,u)}}),fb=B((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}),hb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}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((a)=>n[a]!==void 0))}e.shouldUseRule=o}),Ri=B((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=fb(),r=hb(),o=Pi(),n=le(),s=_e();var i;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(w){let x=c(w.type);if(x.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!x.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)x.push("null")}return x}e.getSchemaTypes=a;function c(w){let x=Array.isArray(w)?w:w?[w]:[];if(x.every(t.isJSONType))return x;throw Error("type must be JSONType or JSONType[]: "+x.join(","))}e.getJSONTypes=c;function u(w,x){let{gen:O,data:R,opts:S}=w,E=d(x,S.coerceTypes),A=x.length>0&&!(E.length===0&&x.length===1&&(0,r.schemaHasRulesForType)(w,x[0]));if(A){let H=v(x,R,S.strictNumbers,i.Wrong);O.if(H,()=>{if(E.length)m(w,x,E);else g(w)})}return A}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(w,x){return x?w.filter((O)=>l.has(O)||x==="array"&&O==="array"):[]}function m(w,x,O){let{gen:R,data:S,opts:E}=w,A=R.let("dataType",n._`typeof ${S}`),H=R.let("coerced",n._`undefined`);if(E.coerceTypes==="array")R.if(n._`${A} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>R.assign(S,n._`${S}[0]`).assign(A,n._`typeof ${S}`).if(v(x,S,E.strictNumbers),()=>R.assign(H,S)));R.if(n._`${H} !== undefined`);for(let V of O)if(l.has(V)||V==="array"&&E.coerceTypes==="array")j(V);R.else(),g(w),R.endIf(),R.if(n._`${H} !== undefined`,()=>{R.assign(S,H),h(w,H)});function j(V){switch(V){case"string":R.elseIf(n._`${A} == "number" || ${A} == "boolean"`).assign(H,n._`"" + ${S}`).elseIf(n._`${S} === null`).assign(H,n._`""`);return;case"number":R.elseIf(n._`${A} == "boolean" || ${S} === null
122
+ || (${A} == "string" && ${S} && ${S} == +${S})`).assign(H,n._`+${S}`);return;case"integer":R.elseIf(n._`${A} === "boolean" || ${S} === null
123
+ || (${A} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(H,n._`+${S}`);return;case"boolean":R.elseIf(n._`${S} === "false" || ${S} === 0 || ${S} === null`).assign(H,!1).elseIf(n._`${S} === "true" || ${S} === 1`).assign(H,!0);return;case"null":R.elseIf(n._`${S} === "" || ${S} === 0 || ${S} === false`),R.assign(H,null);return;case"array":R.elseIf(n._`${A} === "string" || ${A} === "number"
124
+ || ${A} === "boolean" || ${S} === null`).assign(H,n._`[${S}]`)}}}function h({gen:w,parentData:x,parentDataProperty:O},R){w.if(n._`${x} !== undefined`,()=>w.assign(n._`${x}[${O}]`,R))}function f(w,x,O,R=i.Correct){let S=R===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(w){case"null":return n._`${x} ${S} null`;case"array":E=n._`Array.isArray(${x})`;break;case"object":E=n._`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":E=A(n._`!(${x} % 1) && !isNaN(${x})`);break;case"number":E=A();break;default:return n._`typeof ${x} ${S} ${w}`}return R===i.Correct?E:(0,n.not)(E);function A(H=n.nil){return(0,n.and)(n._`typeof ${x} == "number"`,H,O?n._`isFinite(${x})`:n.nil)}}e.checkDataType=f;function v(w,x,O,R){if(w.length===1)return f(w[0],x,O,R);let S,E=(0,s.toHash)(w);if(E.array&&E.object){let A=n._`typeof ${x} != "object"`;S=E.null?A:n._`!${x} || ${A}`,delete E.null,delete E.array,delete E.object}else S=n.nil;if(E.number)delete E.integer;for(let A in E)S=(0,n.and)(S,f(A,x,O,R));return S}e.checkDataTypes=v;let y={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:x})=>typeof w=="string"?n._`{type: ${w}}`:n._`{type: ${x}}`};function g(w){let x=P(w);(0,o.reportError)(x,y)}e.reportTypeError=g;function P(w){let{gen:x,data:O,schema:R}=w,S=(0,s.schemaRefOrVal)(w,R,"type");return{gen:x,keyword:"type",data:O,schema:R.type,schemaCode:S,schemaValue:S,parentSchema:R,params:{},it:w}}}),mk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=le(),r=_e();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else if(i==="array"&&Array.isArray(c))c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let m=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let h=t._`${m} === undefined`;if(d.useDefaults==="empty")h=t._`${h} || ${m} === null || ${m} === ""`;c.if(h,t._`${m} = ${(0,t.stringify)(a)}`)}}),xt=B((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=kt(),n=_e();function s(w,x){let{gen:O,data:R,it:S}=w;O.if(d(O,R,x,S.opts.ownProperties),()=>{w.setParams({missingProperty:t._`${x}`},!0),w.error()})}e.checkReportMissingProp=s;function i({gen:w,data:x,it:{opts:O}},R,S){return(0,t.or)(...R.map((E)=>(0,t.and)(d(w,x,E,O.ownProperties),t._`${S} = ${E}`)))}e.checkMissingProp=i;function a(w,x){w.setParams({missingProperty:x},!0),w.error()}e.reportMissingProp=a;function c(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(w,x,O){return t._`${c(w)}.call(${x}, ${O})`}e.isOwnProperty=u;function l(w,x,O,R){let S=t._`${x}${(0,t.getProperty)(O)} !== undefined`;return R?t._`${S} && ${u(w,x,O)}`:S}e.propertyInData=l;function d(w,x,O,R){let S=t._`${x}${(0,t.getProperty)(O)} === undefined`;return R?(0,t.or)(S,(0,t.not)(u(w,x,O))):S}e.noPropertyInData=d;function m(w){return w?Object.keys(w).filter((x)=>x!=="__proto__"):[]}e.allSchemaProperties=m;function h(w,x){return m(x).filter((O)=>!(0,r.alwaysValidSchema)(w,x[O]))}e.schemaProperties=h;function f({schemaCode:w,data:x,it:{gen:O,topSchemaRef:R,schemaPath:S,errorPath:E},it:A},H,j,V){let W=V?t._`${w}, ${x}, ${R}${S}`:x,Y=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,A.parentData],[o.default.parentDataProperty,A.parentDataProperty],[o.default.rootData,o.default.rootData]];if(A.opts.dynamicRef)Y.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ae=t._`${W}, ${O.object(...Y)}`;return j!==t.nil?t._`${H}.call(${j}, ${ae})`:t._`${H}(${ae})`}e.callValidateCode=f;let v=t._`new RegExp`;function y({gen:w,it:{opts:x}},O){let R=x.unicodeRegExp?"u":"",{regExp:S}=x.code,E=S(O,R);return w.scopeValue("pattern",{key:E.toString(),ref:E,code:t._`${S.code==="new RegExp"?v:(0,n.useFunc)(w,S)}(${O}, ${R})`})}e.usePattern=y;function g(w){let{gen:x,data:O,keyword:R,it:S}=w,E=x.name("valid");if(S.allErrors){let H=x.let("valid",!0);return A(()=>x.assign(H,!1)),H}return x.var(E,!0),A(()=>x.break()),E;function A(H){let j=x.const("len",t._`${O}.length`);x.forRange("i",0,j,(V)=>{w.subschema({keyword:R,dataProp:V,dataPropType:r.Type.Num},E),x.if((0,t.not)(E),H)})}}e.validateArray=g;function P(w){let{gen:x,schema:O,keyword:R,it:S}=w;if(!Array.isArray(O))throw Error("ajv implementation error");if(O.some((H)=>(0,r.alwaysValidSchema)(S,H))&&!S.opts.unevaluated)return;let E=x.let("valid",!1),A=x.name("_valid");x.block(()=>O.forEach((H,j)=>{let V=w.subschema({keyword:R,schemaProp:j,compositeRule:!0},A);if(x.assign(E,t._`${E} || ${A}`),!w.mergeValidEvaluated(V,A))x.if((0,t.not)(E))})),w.result(E,()=>w.reset(),()=>w.error(!0))}e.validateUnion=P}),fk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=kt(),o=xt(),n=Pi();function s(h,f){let{gen:v,keyword:y,schema:g,parentSchema:P,it:w}=h,x=f.macro.call(w.self,g,P,w),O=l(v,y,x);if(w.opts.validateSchema!==!1)w.self.validateSchema(x,!0);let R=v.name("valid");h.subschema({schema:x,schemaPath:t.nil,errSchemaPath:`${w.errSchemaPath}/${y}`,topSchemaRef:O,compositeRule:!0},R),h.pass(R,()=>h.error(!0))}e.macroKeywordCode=s;function i(h,f){var v;let{gen:y,keyword:g,schema:P,parentSchema:w,$data:x,it:O}=h;u(O,f);let R=l(y,g,!x&&f.compile?f.compile.call(O.self,P,w,O):f.validate),S=y.let("valid");h.block$data(S,E),h.ok((v=f.valid)!==null&&v!==void 0?v:S);function E(){if(f.errors===!1){if(j(),f.modifying)a(h);V(()=>h.error())}else{let W=f.async?A():H();if(f.modifying)a(h);V(()=>c(h,W))}}function A(){let W=y.let("ruleErrs",null);return y.try(()=>j(t._`await `),(Y)=>y.assign(S,!1).if(t._`${Y} instanceof ${O.ValidationError}`,()=>y.assign(W,t._`${Y}.errors`),()=>y.throw(Y))),W}function H(){let W=t._`${R}.errors`;return y.assign(W,null),j(t.nil),W}function j(W=f.async?t._`await `:t.nil){let Y=O.opts.passContext?r.default.this:r.default.self,ae=!(("compile"in f)&&!x||f.schema===!1);y.assign(S,t._`${W}${(0,o.callValidateCode)(h,R,Y,ae)}`,f.modifying)}function V(W){var Y;y.if((0,t.not)((Y=f.valid)!==null&&Y!==void 0?Y:S),W)}}e.funcKeywordCode=i;function a(h){let{gen:f,data:v,it:y}=h;f.if(y.parentData,()=>f.assign(v,t._`${y.parentData}[${y.parentDataProperty}]`))}function c(h,f){let{gen:v}=h;v.if(t._`Array.isArray(${f})`,()=>{v.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${f} : ${r.default.vErrors}.concat(${f})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function u({schemaEnv:h},f){if(f.async&&!h.$async)throw Error("async keyword in sync schema")}function l(h,f,v){if(v===void 0)throw Error(`keyword "${f}" failed to compile`);return h.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,t.stringify)(v)})}function d(h,f,v=!1){return!f.length||f.some((y)=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||v&&typeof h>"u")}e.validSchemaType=d;function m({schema:h,opts:f,self:v,errSchemaPath:y},g,P){if(Array.isArray(g.keyword)?!g.keyword.includes(P):g.keyword!==P)throw Error("ajv implementation error");let w=g.dependencies;if(w===null||w===void 0?void 0:w.some((x)=>!Object.prototype.hasOwnProperty.call(h,x)))throw Error(`parent schema must have dependencies of ${P}: ${w.join(",")}`);if(g.validateSchema){if(!g.validateSchema(h[P])){let x=`keyword "${P}" value is invalid at path "${y}": `+v.errorsText(g.validateSchema.errors);if(f.validateSchema==="log")v.logger.error(x);else throw Error(x)}}}e.validateKeywordUsage=m}),hk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=le(),r=_e();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:m}){if(a!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let h=i.schema[a];return c===void 0?{schema:h,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:h[c],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:m,errSchemaPath:d}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:m}){if(l!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=a;if(c!==void 0){let{errorPath:v,dataPathArr:y,opts:g}=a;f(h.let("data",t._`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=t.str`${v}${(0,r.getErrorPath)(c,u,g.jsPropertySyntax)}`,i.parentDataProperty=t._`${c}`,i.dataPathArr=[...y,i.parentDataProperty]}if(l!==void 0){if(f(l instanceof t.Name?l:h.let("data",l,!0)),m!==void 0)i.propertyName=m}if(d)i.dataTypes=d;function f(v){i.data=v,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,v]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(d!==void 0)i.allErrors=d;i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),gb=B((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,a;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(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),gk=B((e,t)=>{var r=t.exports=function(s,i,a){if(typeof i=="function")a=i,i={};a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,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,a,c,u,l,d,m,h,f){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,m,h,f);for(var v in c){var y=c[v];if(Array.isArray(y)){if(v in r.arrayKeywords)for(var g=0;g<y.length;g++)o(s,i,a,y[g],u+"/"+v+"/"+g,l,u,v,c,g)}else if(v in r.propsKeywords){if(y&&typeof y=="object")for(var P in y)o(s,i,a,y[P],u+"/"+v+"/"+n(P),l,u,v,c,P)}else if(v in r.keywords||s.allKeys&&!(v in r.skipKeywords))o(s,i,a,y,u+"/"+v,l,u,v,c)}a(c,u,l,d,m,h,f)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),ki=B((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=gb(),o=gk(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,g=!0){if(typeof y=="boolean")return!0;if(g===!0)return!a(y);if(!g)return!1;return c(y)<=g}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(let g in y){if(i.has(g))return!0;let P=y[g];if(Array.isArray(P)&&P.some(a))return!0;if(typeof P=="object"&&a(P))return!0}return!1}function c(y){let g=0;for(let P in y){if(P==="$ref")return 1/0;if(g++,n.has(P))continue;if(typeof y[P]=="object")(0,t.eachItem)(y[P],(w)=>g+=c(w));if(g===1/0)return 1/0}return g}function u(y,g="",P){if(P!==!1)g=m(g);return l(y,y.parse(g))}e.getFullPath=u;function l(y,g){return y.serialize(g).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function m(y){return y?y.replace(d,""):""}e.normalizeId=m;function h(y,g,P){return P=m(P),y.resolve(g,P)}e.resolveUrl=h;let f=/^[a-z_][-a-z0-9._]*$/i;function v(y,g){if(typeof y=="boolean")return{};let{schemaId:P,uriResolver:w}=this.opts,x=m(y[P]||g),O={"":x},R=u(w,x,!1),S={},E=new Set;return o(y,{allKeys:!0},(j,V,W,Y)=>{if(Y===void 0)return;let ae=R+V,we=O[Y];if(typeof j[P]=="string")we=$e.call(this,j[P]);Ce.call(this,j.$anchor),Ce.call(this,j.$dynamicAnchor),O[V]=we;function $e(de){let N=this.opts.uriResolver.resolve;if(de=m(we?N(we,de):de),E.has(de))throw H(de);E.add(de);let M=this.refs[de];if(typeof M=="string")M=this.refs[M];if(typeof M=="object")A(j,M.schema,de);else if(de!==m(ae))if(de[0]==="#")A(j,S[de],de),S[de]=j;else this.refs[de]=ae;return de}function Ce(de){if(typeof de=="string"){if(!f.test(de))throw Error(`invalid anchor "${de}"`);$e.call(this,`#${de}`)}}}),S;function A(j,V,W){if(V!==void 0&&!r(j,V))throw H(W)}function H(j){return Error(`reference "${j}" resolves to more than one schema`)}}e.getSchemaRefs=v}),oo=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=pk(),r=Ri(),o=hb(),n=Ri(),s=mk(),i=fk(),a=hk(),c=le(),u=kt(),l=ki(),d=_e(),m=Pi();function h(T){if(R(T)){if(E(T),O(T)){g(T);return}}f(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=h;function f({gen:T,validateName:q,schema:F,schemaEnv:ee,opts:re},se){if(re.code.es5)T.func(q,c._`${u.default.data}, ${u.default.valCxt}`,ee.$async,()=>{T.code(c._`"use strict"; ${w(F,re)}`),y(T,re),T.code(se)});else T.func(q,c._`${u.default.data}, ${v(re)}`,ee.$async,()=>T.code(w(F,re)).code(se))}function v(T){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function y(T,q){T.if(u.default.valCxt,()=>{if(T.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),T.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),q.dynamicRef)T.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(T.var(u.default.instancePath,c._`""`),T.var(u.default.parentData,c._`undefined`),T.var(u.default.parentDataProperty,c._`undefined`),T.var(u.default.rootData,u.default.data),q.dynamicRef)T.var(u.default.dynamicAnchors,c._`{}`)})}function g(T){let{schema:q,opts:F,gen:ee}=T;f(T,()=>{if(F.$comment&&q.$comment)Y(T);if(j(T),ee.let(u.default.vErrors,null),ee.let(u.default.errors,0),F.unevaluated)P(T);A(T),ae(T)})}function P(T){let{gen:q,validateName:F}=T;T.evaluated=q.const("evaluated",c._`${F}.evaluated`),q.if(c._`${T.evaluated}.dynamicProps`,()=>q.assign(c._`${T.evaluated}.props`,c._`undefined`)),q.if(c._`${T.evaluated}.dynamicItems`,()=>q.assign(c._`${T.evaluated}.items`,c._`undefined`))}function w(T,q){let F=typeof T=="object"&&T[q.schemaId];return F&&(q.code.source||q.code.process)?c._`/*# sourceURL=${F} */`:c.nil}function x(T,q){if(R(T)){if(E(T),O(T)){S(T,q);return}}(0,t.boolOrEmptySchema)(T,q)}function O({schema:T,self:q}){if(typeof T=="boolean")return!T;for(let F in T)if(q.RULES.all[F])return!0;return!1}function R(T){return typeof T.schema!="boolean"}function S(T,q){let{schema:F,gen:ee,opts:re}=T;if(re.$comment&&F.$comment)Y(T);V(T),W(T);let se=ee.const("_errs",u.default.errors);A(T,se),ee.var(q,c._`${se} === ${u.default.errors}`)}function E(T){(0,d.checkUnknownRules)(T),H(T)}function A(T,q){if(T.opts.jtd)return $e(T,[],!1,q);let F=(0,r.getSchemaTypes)(T.schema);$e(T,F,!(0,r.coerceAndCheckDataType)(T,F),q)}function H(T){let{schema:q,errSchemaPath:F,opts:ee,self:re}=T;if(q.$ref&&ee.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(q,re.RULES))re.logger.warn(`$ref: keywords ignored in schema at path "${F}"`)}function j(T){let{schema:q,opts:F}=T;if(q.default!==void 0&&F.useDefaults&&F.strictSchema)(0,d.checkStrictMode)(T,"default is ignored in the schema root")}function V(T){let q=T.schema[T.opts.schemaId];if(q)T.baseId=(0,l.resolveUrl)(T.opts.uriResolver,T.baseId,q)}function W(T){if(T.schema.$async&&!T.schemaEnv.$async)throw Error("async schema in sync schema")}function Y({gen:T,schemaEnv:q,schema:F,errSchemaPath:ee,opts:re}){let se=F.$comment;if(re.$comment===!0)T.code(c._`${u.default.self}.logger.log(${se})`);else if(typeof re.$comment=="function"){let ge=c.str`${ee}/$comment`,Ze=T.scopeValue("root",{ref:q.root});T.code(c._`${u.default.self}.opts.$comment(${se}, ${ge}, ${Ze}.schema)`)}}function ae(T){let{gen:q,schemaEnv:F,validateName:ee,ValidationError:re,opts:se}=T;if(F.$async)q.if(c._`${u.default.errors} === 0`,()=>q.return(u.default.data),()=>q.throw(c._`new ${re}(${u.default.vErrors})`));else{if(q.assign(c._`${ee}.errors`,u.default.vErrors),se.unevaluated)we(T);q.return(c._`${u.default.errors} === 0`)}}function we({gen:T,evaluated:q,props:F,items:ee}){if(F instanceof c.Name)T.assign(c._`${q}.props`,F);if(ee instanceof c.Name)T.assign(c._`${q}.items`,ee)}function $e(T,q,F,ee){let{gen:re,schema:se,data:ge,allErrors:Ze,opts:ke,self:De}=T,{RULES:Ie}=De;if(se.$ref&&(ke.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(se,Ie))){re.block(()=>G(T,"$ref",Ie.all.$ref.definition));return}if(!ke.jtd)de(T,q);re.block(()=>{for(let Ve of Ie.rules)ht(Ve);ht(Ie.post)});function ht(Ve){if(!(0,o.shouldUseGroup)(se,Ve))return;if(Ve.type){if(re.if((0,n.checkDataType)(Ve.type,ge,ke.strictNumbers)),Ce(T,Ve),q.length===1&&q[0]===Ve.type&&F)re.else(),(0,n.reportTypeError)(T);re.endIf()}else Ce(T,Ve);if(!Ze)re.if(c._`${u.default.errors} === ${ee||0}`)}}function Ce(T,q){let{gen:F,schema:ee,opts:{useDefaults:re}}=T;if(re)(0,s.assignDefaults)(T,q.type);F.block(()=>{for(let se of q.rules)if((0,o.shouldUseRule)(ee,se))G(T,se.keyword,se.definition,q.type)})}function de(T,q){if(T.schemaEnv.meta||!T.opts.strictTypes)return;if(N(T,q),!T.opts.allowUnionTypes)M(T,q);b(T,T.dataTypes)}function N(T,q){if(!q.length)return;if(!T.dataTypes.length){T.dataTypes=q;return}q.forEach((F)=>{if(!_(T.dataTypes,F))I(T,`type "${F}" not allowed by context "${T.dataTypes.join(",")}"`)}),z(T,q)}function M(T,q){if(q.length>1&&!(q.length===2&&q.includes("null")))I(T,"use allowUnionTypes to allow union type keyword")}function b(T,q){let F=T.self.RULES.all;for(let ee in F){let re=F[ee];if(typeof re=="object"&&(0,o.shouldUseRule)(T.schema,re)){let{type:se}=re.definition;if(se.length&&!se.some((ge)=>p(q,ge)))I(T,`missing type "${se.join(",")}" for keyword "${ee}"`)}}}function p(T,q){return T.includes(q)||q==="number"&&T.includes("integer")}function _(T,q){return T.includes(q)||q==="integer"&&T.includes("number")}function z(T,q){let F=[];for(let ee of T.dataTypes)if(_(q,ee))F.push(ee);else if(q.includes("integer")&&ee==="number")F.push("integer");T.dataTypes=F}function I(T,q){let F=T.schemaEnv.baseId+T.errSchemaPath;q+=` at "${F}" (strictTypes)`,(0,d.checkStrictMode)(T,q,T.opts.strictTypes)}var U=class{constructor(T,q,F){if((0,i.validateKeywordUsage)(T,q,F),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=F,this.data=T.data,this.schema=T.schema[F],this.$data=q.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(T,this.schema,F,this.$data),this.schemaType=q.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=q,this.$data)this.schemaCode=T.gen.const("vSchema",Pe(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw Error(`${F} value must be ${JSON.stringify(q.schemaType)}`);if("code"in q?q.trackErrors:q.errors!==!1)this.errsCount=T.gen.const("_errs",u.default.errors)}result(T,q,F){this.failResult((0,c.not)(T),q,F)}failResult(T,q,F){if(this.gen.if(T),F)F();else this.error();if(q){if(this.gen.else(),q(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(T,q){this.failResult((0,c.not)(T),void 0,q)}fail(T){if(T===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(T),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);let{schemaCode:q}=this;this.fail(c._`${q} !== undefined && (${(0,c.or)(this.invalid$data(),T)})`)}error(T,q,F){if(q){this.setParams(q),this._error(T,F),this.setParams({});return}this._error(T,F)}_error(T,q){(T?m.reportExtraError:m.reportError)(this,this.def.error,q)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(T){if(!this.allErrors)this.gen.if(T)}setParams(T,q){if(q)Object.assign(this.params,T);else this.params=T}block$data(T,q,F=c.nil){this.gen.block(()=>{this.check$data(T,F),q()})}check$data(T=c.nil,q=c.nil){if(!this.$data)return;let{gen:F,schemaCode:ee,schemaType:re,def:se}=this;if(F.if((0,c.or)(c._`${ee} === undefined`,q)),T!==c.nil)F.assign(T,!0);if(re.length||se.validateSchema){if(F.elseIf(this.invalid$data()),this.$dataError(),T!==c.nil)F.assign(T,!1)}F.else()}invalid$data(){let{gen:T,schemaCode:q,schemaType:F,def:ee,it:re}=this;return(0,c.or)(se(),ge());function se(){if(F.length){if(!(q instanceof c.Name))throw Error("ajv implementation error");let Ze=Array.isArray(F)?F:[F];return c._`${(0,n.checkDataTypes)(Ze,q,re.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function ge(){if(ee.validateSchema){let Ze=T.scopeValue("validate$data",{ref:ee.validateSchema});return c._`!${Ze}(${q})`}return c.nil}}subschema(T,q){let F=(0,a.getSubschema)(this.it,T);(0,a.extendSubschemaData)(F,this.it,T),(0,a.extendSubschemaMode)(F,T);let ee={...this.it,...F,items:void 0,props:void 0};return x(ee,q),ee}mergeEvaluated(T,q){let{it:F,gen:ee}=this;if(!F.opts.unevaluated)return;if(F.props!==!0&&T.props!==void 0)F.props=d.mergeEvaluated.props(ee,T.props,F.props,q);if(F.items!==!0&&T.items!==void 0)F.items=d.mergeEvaluated.items(ee,T.items,F.items,q)}mergeValidEvaluated(T,q){let{it:F,gen:ee}=this;if(F.opts.unevaluated&&(F.props!==!0||F.items!==!0))return ee.if(q,()=>this.mergeEvaluated(T,c.Name)),!0}};e.KeywordCxt=U;function G(T,q,F,ee){let re=new U(T,F,q);if("code"in F)F.code(re,ee);else if(re.$data&&F.validate)(0,i.funcKeywordCode)(re,F);else if("macro"in F)(0,i.macroKeywordCode)(re,F);else if(F.compile||F.validate)(0,i.funcKeywordCode)(re,F)}let K=/^\/(?:[^~]|~0|~1)*$/,ue=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Pe(T,{dataLevel:q,dataNames:F,dataPathArr:ee}){let re,se;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!K.test(T))throw Error(`Invalid JSON-pointer: ${T}`);re=T,se=u.default.rootData}else{let De=ue.exec(T);if(!De)throw Error(`Invalid JSON-pointer: ${T}`);let Ie=+De[1];if(re=De[2],re==="#"){if(Ie>=q)throw Error(ke("property/index",Ie));return ee[q-Ie]}if(Ie>q)throw Error(ke("data",Ie));if(se=F[q-Ie],!re)return se}let ge=se,Ze=re.split("/");for(let De of Ze)if(De)se=c._`${se}${(0,c.getProperty)((0,d.unescapeJsonPointer)(De))}`,ge=c._`${ge} && ${se}`;return ge;function ke(De,Ie){return`Cannot access ${De} ${Ie} levels up, current level is ${q}`}}e.getData=Pe}),Pn=B((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}),so=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ki();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}),xi=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=Pn(),o=kt(),n=ki(),s=_e(),i=oo();var a=class{constructor(g){var P;this.refs={},this.dynamicAnchors={};let w;if(typeof g.schema=="object")w=g.schema;this.schema=g.schema,this.schemaId=g.schemaId,this.root=g.root||this,this.baseId=(P=g.baseId)!==null&&P!==void 0?P:(0,n.normalizeId)(w===null||w===void 0?void 0:w[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};e.SchemaEnv=a;function c(g){let P=d.call(this,g);if(P)return P;let w=(0,n.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:x,lines:O}=this.opts.code,{ownProperties:R}=this.opts,S=new t.CodeGen(this.scope,{es5:x,lines:O,ownProperties:R}),E;if(g.$async)E=S.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let A=S.scopeName("validate");g.validateName=A;let H={gen:S,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:S.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,t.stringify)(g.schema)}:{ref:g.schema}),validateName:A,ValidationError:E,schema:g.schema,schemaEnv:g,rootId:w,baseId:g.baseId||w,schemaPath:t.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},j;try{this._compilations.add(g),(0,i.validateFunctionCode)(H),S.optimize(this.opts.code.optimize);let V=S.toString();if(j=`${S.scopeRefs(o.default.scope)}return ${V}`,this.opts.code.process)j=this.opts.code.process(j,g);let W=Function(`${o.default.self}`,`${o.default.scope}`,j)(this,this.scope.get());if(this.scope.value(A,{ref:W}),W.errors=null,W.schema=g.schema,W.schemaEnv=g,g.$async)W.$async=!0;if(this.opts.code.source===!0)W.source={validateName:A,validateCode:V,scopeValues:S._values};if(this.opts.unevaluated){let{props:Y,items:ae}=H;if(W.evaluated={props:Y instanceof t.Name?void 0:Y,items:ae instanceof t.Name?void 0:ae,dynamicProps:Y instanceof t.Name,dynamicItems:ae instanceof t.Name},W.source)W.source.evaluated=(0,t.stringify)(W.evaluated)}return g.validate=W,g}catch(V){if(delete g.validate,delete g.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw V}finally{this._compilations.delete(g)}}e.compileSchema=c;function u(g,P,w){var x;w=(0,n.resolveUrl)(this.opts.uriResolver,P,w);let O=g.refs[w];if(O)return O;let R=h.call(this,g,w);if(R===void 0){let S=(x=g.localRefs)===null||x===void 0?void 0:x[w],{schemaId:E}=this.opts;if(S)R=new a({schema:S,schemaId:E,root:g,baseId:P})}if(R===void 0)return;return g.refs[w]=l.call(this,R)}e.resolveRef=u;function l(g){if((0,n.inlineRef)(g.schema,this.opts.inlineRefs))return g.schema;return g.validate?g:c.call(this,g)}function d(g){for(let P of this._compilations)if(m(P,g))return P}e.getCompilingSchema=d;function m(g,P){return g.schema===P.schema&&g.root===P.root&&g.baseId===P.baseId}function h(g,P){let w;while(typeof(w=this.refs[P])=="string")P=w;return w||this.schemas[P]||f.call(this,g,P)}function f(g,P){let w=this.opts.uriResolver.parse(P),x=(0,n._getFullPath)(this.opts.uriResolver,w),O=(0,n.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&x===O)return y.call(this,w,g);let R=(0,n.normalizeId)(x),S=this.refs[R]||this.schemas[R];if(typeof S=="string"){let E=f.call(this,g,S);if(typeof(E===null||E===void 0?void 0:E.schema)!=="object")return;return y.call(this,w,E)}if(typeof(S===null||S===void 0?void 0:S.schema)!=="object")return;if(!S.validate)c.call(this,S);if(R===(0,n.normalizeId)(P)){let{schema:E}=S,{schemaId:A}=this.opts,H=E[A];if(H)O=(0,n.resolveUrl)(this.opts.uriResolver,O,H);return new a({schema:E,schemaId:A,root:g,baseId:O})}return y.call(this,w,S)}e.resolveSchema=f;let v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(g,{baseId:P,schema:w,root:x}){var O;if(((O=g.fragment)===null||O===void 0?void 0:O[0])!=="/")return;for(let E of g.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let A=w[(0,s.unescapeFragment)(E)];if(A===void 0)return;w=A;let H=typeof w==="object"&&w[this.opts.schemaId];if(!v.has(E)&&H)P=(0,n.resolveUrl)(this.opts.uriResolver,P,H)}let R;if(typeof w!="boolean"&&w.$ref&&!(0,s.schemaHasRulesButRef)(w,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,P,w.$ref);R=f.call(this,x,E)}let{schemaId:S}=this.opts;if(R=R||new a({schema:w,schemaId:S,root:x,baseId:P}),R.schema!==R.root.schema)return R}}),_k=B((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}}),_b=B((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),n=RegExp.prototype.test.bind(/^\d*$/u),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),u=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),l=Array(256);for(let p=0;p<256;p++)l[p]="%"+"0123456789ABCDEF"[p>>4]+"0123456789ABCDEF"[p&15];function d(b){if(b<2048)return l[192|b>>6]+l[128|b&63];if(b<65536)return l[224|b>>12]+l[128|b>>6&63]+l[128|b&63];return l[240|b>>18]+l[128|b>>12&63]+l[128|b>>6&63]+l[128|b&63]}function m(b){let p="",_=0,z=0;for(z=0;z<b.length;z++){if(_=b[z].charCodeAt(0),_===48)continue;if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z];break}for(z+=1;z<b.length;z++){if(_=b[z].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z]}return p}let h=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),v=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),y=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g(b){if(b.length===0)return!1;for(let p=0;p<b.length;p++){if(v(b[p]))continue;if(b[p]==="%"&&p+2<b.length&&s(b.slice(p+1,p+3))){p+=2;continue}return!1}return!0}function P(b){let p=-1,_=0,z=-1,I=0;for(let K=0;K<b.length;K++)if(b[K]==="0"){if(z===-1)z=K;if(I++,I>_)_=I,p=z}else z=-1,I=0;if(_<2)return b.join(":");let U=b.slice(0,p).join(":"),G=b.slice(p+_).join(":");return U+"::"+G}function w(b){let p=b.indexOf("::");if(p!==-1&&b.indexOf("::",p+1)!==-1)return;let _=p===-1?b.split(":"):b.slice(0,p).split(":"),z=p===-1?[]:b.slice(p+2).split(":");if(p!==-1){if(_.length===1&&_[0]==="")_.length=0;if(z.length===1&&z[0]==="")z.length=0}let I=_.concat(z),U=0;for(let K=0;K<I.length;K++){let ue=I[K];if(ue==="")return;if(ue.indexOf(".")!==-1){if(K!==I.length-1||p!==-1&&z.length===0||!o(ue))return;U+=2;continue}if(!h(ue))return;I[K]=parseInt(ue,16).toString(16),U++}if(p===-1){if(U!==8)return;return P(I)}if(U>=8)return;let G=I.slice(0,_.length);for(let K=U;K<8;K++)G.push("0");for(let K=_.length;K<I.length;K++)G.push(I[K]);return P(G)}function x(b){let p=b[0]==="["&&b[b.length-1]==="]";if((b[0]==="["||b[b.length-1]==="]")&&!p)return{host:b,isIPV6:!1,error:!0};let _=p?b.slice(1,-1):b;if(p&&f(_))return _=_.toLowerCase(),{host:`[${_}]`,escapedHost:_,isIPV6:!1,isIPVFuture:!0};if(O(_,":")<2)return{host:b,isIPV6:!1,error:p};let z="",I=_.indexOf("%");if(I!==-1){let G=_.slice(I,I+3).toLowerCase()==="%25"?3:1;if(z=_.slice(I+G),!g(z))return{host:b,isIPV6:!1,error:!0};_=_.slice(0,I)}let U=w(_);if(U===void 0)return{host:b,isIPV6:!1,error:!0};return{host:U+(z?"%"+z:""),escapedHost:U+(z?"%25"+z:""),isIPV6:!0}}function O(b,p){let _=0;for(let z=0;z<b.length;z++)if(b[z]===p)_++;return _}function R(b){let p=b,_=[],z=-1,I=0;while(I=p.length){if(I===1)if(p===".")break;else if(p==="/"){_.push("/");break}else{_.push(p);break}else if(I===2){if(p[0]==="."){if(p[1]===".")break;else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."||p[1]==="/"){_.push("/");break}}}else if(I===3){if(p==="/.."){if(_.length!==0)_.pop();_.push("/");break}}if(p[0]==="."){if(p[1]==="."){if(p[2]==="/"){p=p.slice(3);continue}}else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."){if(p[2]==="/"){p=p.slice(2);continue}else if(p[2]==="."){if(p[3]==="/"){if(p=p.slice(3),_.length!==0)_.pop();continue}}}}if((z=p.indexOf("/",1))===-1){_.push(p);break}else _.push(p.slice(0,z)),p=p.slice(z)}return _.join("")}let S={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},E=/[@/?#:]/g,A=/[@/?#]/g;function H(b,p){let _=p?A:E;return _.lastIndex=0,b.replace(_,(z)=>S[z])}function j(b,p=!1){if(b.indexOf("%")===-1)return b;let _="";for(let z=0;z<b.length;z++){if(b[z]==="%"&&z+2<b.length){let I=b.slice(z+1,z+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(p&&i(G))_+=G;else _+="%"+U;z+=2;continue}}_+=b[z]}return _}function V(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&i(G))p+=G;else p+="%"+U;_+=2;continue}}if(a(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function W(b,p=!1){let _="",z=p&&b[0]!=="/";for(let I=0;I<b.length;I++){let U=b[I];if(U==="%"&&I+2<b.length){let G=b.slice(I+1,I+3);if(s(G)){_+="%"+G.toUpperCase(),I+=2;continue}}if(U==="/")z=!1;if(a(U)&&(U!==":"||!z))_+=U;else{let G=b.charCodeAt(I);if(G<128)_+=l[G];else if(G<55296||G>57343)_+=d(G);else if(G<=56319&&I+1<b.length){let K=b.charCodeAt(I+1);if(K>=56320&&K<=57343)_+=d(65536+(G-55296<<10)+(K-56320)),I++;else _+=d(65533)}else _+=d(65533)}}return _}function Y(b,p){let _="";for(let z=0;z<b.length;z++){let I=b[z];if(I==="%"&&z+2<b.length){let U=b.slice(z+1,z+3);if(s(U)){_+="%"+U.toUpperCase(),z+=2;continue}}if(p(I))_+=I;else{let U=b.charCodeAt(z);if(U<128)_+=l[U];else if(U<55296||U>57343)_+=d(U);else if(U<=56319&&z+1<b.length){let G=b.charCodeAt(z+1);if(G>=56320&&G<=57343)_+=d(65536+(U-55296<<10)+(G-56320)),z++;else _+=d(65533)}else _+=d(65533)}}return _}function ae(b){return Y(b,u)}function we(b){return Y(b,c)}function $e(b){return Y(b,c)}function Ce(b){return b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||b===42||b===43||b===45||b===46||b===47||b===64||b===95}function de(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(i(G))p+=G;else p+="%"+U;_+=2;continue}}if(c(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function N(b){let p="";for(let _=0;_<b.length;_++){if(b[_]==="%"&&_+2<b.length){let z=b.slice(_+1,_+3);if(s(z)){p+="%"+z.toUpperCase(),_+=2;continue}}p+=escape(b[_])}return p}function M(b){let p=[];if(b.userinfo!==void 0)p.push(ae(b.userinfo)),p.push("@");if(b.host!==void 0){let _=b.host;if(!o(_)){let z=x(_);if(z.isIPV6!==!0&&z.isIPVFuture!==!0)_=j(_,!0),z=x(_);if(z.isIPV6===!0||z.isIPVFuture===!0)_=`[${z.escapedHost}]`;else _=H(_,!1)}p.push(_)}if(typeof b.port==="number"||typeof b.port==="string"){let _=String(b.port);if(!n(_))throw TypeError("URI port is malformed.");p.push(":"),p.push(_)}return p.length?p.join(""):void 0}t.exports={nonSimpleDomain:y,recomposeAuthority:M,reescapeHostDelimiters:H,normalizePercentEncoding:j,normalizePathEncoding:V,serializePathEncoding:W,normalizeQueryFragmentEncoding:de,encodeUserinfo:ae,encodeQuery:we,encodeFragment:$e,escapePreservingEscapes:N,removeDotSegments:R,isIPv4:o,isUUID:r,normalizeIPv6:x,stringArrayToHexStripped:m}}),yk=B((e,t)=>{let{isUUID:r}=_b(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(S){return n.indexOf(S)!==-1}function i(S){if(S.secure===!0)return!0;else if(S.secure===!1)return!1;else if(S.scheme)return S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S");else return!1}function a(S){if(!S.host)S.error=S.error||"HTTP URIs must have a host.";return S}function c(S){let E=String(S.scheme).toLowerCase()==="https";if(S.port===(E?443:80)||S.port==="")S.port=void 0;if(!S.path)S.path="/";return S}function u(S){return S.secure=i(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function l(S){if(S.port===(i(S)?443:80)||S.port==="")S.port=void 0;if(typeof S.secure==="boolean")S.scheme=S.secure?"wss":"ws",S.secure=void 0;if(S.resourceName){let E=S.resourceName.indexOf("?"),A=E===-1?S.resourceName:S.resourceName.slice(0,E);S.path=A&&A!=="/"?A:void 0,S.query=E===-1?void 0:S.resourceName.slice(E+1),S.resourceName=void 0}return S.fragment=void 0,S}function d(S,E){if(!S.path)return S.error="URN can not be parsed",S;let A=S.path.match(o);if(A&&A[0]===S.path){let H=E.scheme||S.scheme||"urn";S.nid=A[1].toLowerCase(),S.nss=A[2];let j=R(`${H}:${E.nid||S.nid}`);if(S.path=void 0,j)S=j.parse(S,E)}else S.error=S.error||"URN can not be parsed.";return S}function m(S,E){if(S.nid===void 0)throw Error("URN without nid cannot be serialized");let A=E.scheme||S.scheme||"urn",H=S.nid.toLowerCase(),j=R(`${A}:${E.nid||H}`);if(j)S=j.serialize(S,E);let V=S,W=S.nss;return V.path=`${H||E.nid}:${W}`,E.skipEscape=!0,V}function h(S,E){let A=S;if(A.uuid=A.nss,A.nss=void 0,!E.tolerant&&(!A.uuid||!r(A.uuid)))A.error=A.error||"UUID is not valid.";return A}function f(S){let E=S;return E.nss=(S.uuid||"").toLowerCase(),E}let v={scheme:"http",domainHost:!0,parse:a,serialize:c},y={scheme:"https",domainHost:v.domainHost,parse:a,serialize:c},g={scheme:"ws",domainHost:!0,parse:u,serialize:l},P={scheme:"wss",domainHost:g.domainHost,parse:g.parse,serialize:g.serialize},O={http:v,https:y,ws:g,wss:P,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(O,null);function R(S){return S&&(O[S]||O[S.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:O,isValidSchemeName:s,getSchemeHandler:R}}),vk=B((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:s,normalizePathEncoding:i,serializePathEncoding:a,normalizeQueryFragmentEncoding:c,encodeQuery:u,encodeFragment:l,reescapeHostDelimiters:d,isIPv4:m,nonSimpleDomain:h}=_b(),{SCHEMES:f,getSchemeHandler:v}=yk(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function P(b){let p=unescape(String(b));if(!y.test(p))throw TypeError("URI scheme is malformed.");return p}function w(b,p){if(typeof b==="string")b=Ce(b,p);else if(typeof b==="object")b=$e(S(b,p),p);return b}function x(b,p,_){let z=_?Object.assign({scheme:"null"},_):{scheme:"null"},{parsed:I,malformedAuthorityOrPort:U,malformedPercentEncoding:G,malformedSchemeSpecific:K,malformedHost:ue,malformedScheme:Pe}=we(b,z),{parsed:T,malformedAuthorityOrPort:q,malformedPercentEncoding:F,malformedSchemeSpecific:ee,malformedHost:re,malformedScheme:se}=we(p,z);if(U||q||G||F||K||ee||ue||re||Pe||se)throw Error(I.error||T.error||"URI is malformed.");let ge=O(I,T,z,!0),Ze=v(_&&_.scheme||ge.scheme),ke=ge.host,De=ke!==void 0&&ke!==""&&(m(ke)||r(ke).isIPV6);ae(ge,_||{},Ze,De);let Ie=ke&&ke.indexOf("%")!==-1&&!/\P{ASCII}/u.test(ke);if(ge.error&&!Ie)throw Error(ge.error);return z.skipEscape=!0,S(ge,z)}function O(b,p,_,z){let I={};if(!z)b=$e(S(b,_),_),p=$e(S(p,_),_);if(_=_||{},!_.tolerant&&p.scheme)I.scheme=p.scheme,I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(!p.path)if(I.path=b.path,p.query!==void 0)I.query=p.query;else I.query=b.query;else{if(p.path[0]==="/")I.path=o(p.path);else{if((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path)I.path="/"+p.path;else if(!b.path)I.path=p.path;else I.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+p.path;I.path=o(I.path)}I.query=p.query}I.userinfo=b.userinfo,I.host=b.host,I.port=b.port}I.scheme=b.scheme}return I.fragment=p.fragment,I}function R(b,p,_){let z=N(b,_),I=N(p,_);return z!==void 0&&I!==void 0&&z===I}function S(b,p){let _={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},z=Object.assign({},p),I=[];if(_.scheme)_.scheme=P(_.scheme);let U=v(z.scheme||_.scheme);if(U&&U.serialize)U.serialize(_,z);let G=_.userinfo!==void 0||_.host!==void 0||_.port!==void 0,K=!z.skipEscape&&_.scheme===void 0&&!G;if(_.path!==void 0)if(!z.skipEscape)_.path=a(_.path,K);else _.path=s(_.path);if(z.reference!=="suffix"&&_.scheme)_.scheme=P(_.scheme),I.push(_.scheme,":");let ue=n(_);if(ue!==void 0){if(z.reference!=="suffix")I.push("//");if(I.push(ue),_.path&&_.path[0]!=="/")I.push("/")}if(_.path!==void 0){let Pe=_.path;if(!z.absolutePath&&(!U||!U.absolutePath))Pe=o(Pe);if(K)Pe=a(Pe,!0);if(ue===void 0&&Pe[0]==="/"&&Pe[1]==="/")Pe="/%2F"+Pe.slice(2);I.push(Pe)}if(_.query!==void 0)I.push("?",u(_.query));if(_.fragment!==void 0)I.push("#",l(_.fragment));return I.join("")}let E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,A=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,H=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j(b,p){if(p[2]!==void 0&&b.path&&b.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof b.port==="number"&&(b.port<0||b.port>65535))return"URI port is malformed."}function V(b){if(b===void 0)return!1;let p=b.indexOf("%");while(p!==-1){if(p+2>=b.length||!/^[\da-f]{2}$/iu.test(b.slice(p+1,p+3)))return!0;p=b.indexOf("%",p+3)}return!1}function W(b){return b[0]==="["&&b[b.length-1]==="]"}function Y(b){let p=b[4];return V(b[3])||p!==void 0&&!W(p)&&V(p)||V(b[6])||V(b[7])||V(b[8])}function ae(b,p,_,z){if(!p.unicodeSupport&&(!_||!_.unicodeSupport)&&b.host&&!W(b.host)&&(p.domainHost||_&&_.domainHost)&&z===!1&&h(b.host))try{b.host=new URL("http://"+b.host).hostname}catch(I){return b.error=b.error||"Host's domain name can not be converted to ASCII: "+I,!0}return!1}function we(b,p){let _=Object.assign({},p),z={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=!1,U=!1,G=!1,K=!1,ue=!1,Pe=!1,T=!1;if(_.reference==="suffix")if(_.scheme)b=_.scheme+":"+b;else b="//"+b;let q=b.match(A);if(q!==null&&q[1].indexOf("\\")!==-1)z.error="URI authority must not contain a literal backslash.",I=!0;let F=b.match(H);if(F!==null){let re=F[1],se=re.replace(/[\t\n\r]/g,"");if(se.length>=2){if(se.slice(0,2)!=="//")z.error=z.error||"URI authority must not contain a literal backslash.",I=!0;else if(re.length!==se.length)z.error=z.error||"URI authority introducer must not contain whitespace.",I=!0}}let ee=b.match(E);if(ee){if(z.scheme=ee[1],z.userinfo=ee[3],z.host=ee[4],z.port=parseInt(ee[5],10),z.path=ee[6]||"",z.query=ee[7],z.fragment=ee[8],z.scheme!==void 0){let ge=unescape(z.scheme);if(y.test(ge))z.scheme=ge.toLowerCase();else z.error=z.error||"URI scheme is malformed.",Pe=!0}if(U=Y(ee),U)z.error=z.error||"URI contains malformed percent-encoding.";if(isNaN(z.port))z.port=ee[5];let re=j(z,ee);if(re!==void 0)z.error=z.error||re,I=!0;if(z.host)if(m(z.host)===!1){let ge=W(z.host),Ze=z.host.indexOf("[")!==-1||z.host.indexOf("]")!==-1,ke=r(z.host);if(T=ke.isIPV6||ke.isIPVFuture===!0,ue=Ze&&(!ge||ke.error===!0),z.host=T?ke.host:ke.host.toLowerCase(),ue)z.error=z.error||"URI host is malformed.",I=!0}else T=!0;if(z.scheme===void 0&&z.userinfo===void 0&&z.host===void 0&&z.port===void 0&&z.query===void 0&&!z.path)z.reference="same-document";else if(z.scheme===void 0)z.reference="relative";else if(z.fragment===void 0)z.reference="absolute";else z.reference="uri";if(_.reference&&_.reference!=="suffix"&&_.reference!==z.reference)z.error=z.error||"URI is not a "+_.reference+" reference.";let se=v(_.scheme||z.scheme);if(!ue)K=ae(z,_,se,T);if(b.indexOf("%")!==-1&&z.host!==void 0&&!ue){let ge=T?z.host:s(z.host,!0);if(!T)ge=s(ge.toLowerCase());z.host=d(ge,T)}if(!se||se&&!se.skipNormalize){if(z.path)z.path=i(z.path);if(z.query)z.query=c(z.query);if(z.fragment)z.fragment=c(z.fragment)}if(se&&se.parse){if(se.parse(z,_),se===f.urn&&z.nid===void 0)G=!0}}else z.error=z.error||"URI can not be parsed.";return{parsed:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:Pe}}function $e(b,p){return we(b,p).parsed}function Ce(b,p){return de(b,p).normalized}function de(b,p){let{parsed:_,malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}=we(b,p);return{normalized:z||I||U||G||K?b:S(_,p),malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}}function N(b,p){if(typeof b!=="string"&&typeof b!=="object")return;let _;try{_=typeof b==="string"?b:S(b,p)}catch{return}let{normalized:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:ue}=de(_,p);return I||U||G||K||ue?void 0:z}let M={SCHEMES:f,normalize:w,resolve:x,resolveComponent:O,equal:R,serialize:S,parse:$e};t.exports=M,t.exports.default=M,t.exports.fastUri=M});var Sk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=vk();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),Uu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=oo();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=Pn(),n=so(),s=fb(),i=xi(),a=le(),c=ki(),u=Ri(),l=_e(),d=_k(),m=Sk(),h=(N,M)=>new RegExp(N,M);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},P=200;function w(N){var M,b,p,_,z,I,U,G,K,ue,Pe,T,q,F,ee,re,se,ge,Ze,ke,De,Ie,ht,Ve,jt;let zt=N.strict,Mt=(M=N.code)===null||M===void 0?void 0:M.optimize,Vt=Mt===!0||Mt===void 0?1:Mt||0,Ht=(p=(b=N.code)===null||b===void 0?void 0:b.regExp)!==null&&p!==void 0?p:h,ir=(_=N.uriResolver)!==null&&_!==void 0?_:m.default;return{strictSchema:(I=(z=N.strictSchema)!==null&&z!==void 0?z:zt)!==null&&I!==void 0?I:!0,strictNumbers:(G=(U=N.strictNumbers)!==null&&U!==void 0?U:zt)!==null&&G!==void 0?G:!0,strictTypes:(ue=(K=N.strictTypes)!==null&&K!==void 0?K:zt)!==null&&ue!==void 0?ue:"log",strictTuples:(T=(Pe=N.strictTuples)!==null&&Pe!==void 0?Pe:zt)!==null&&T!==void 0?T:"log",strictRequired:(F=(q=N.strictRequired)!==null&&q!==void 0?q:zt)!==null&&F!==void 0?F:!1,code:N.code?{...N.code,optimize:Vt,regExp:Ht}:{optimize:Vt,regExp:Ht},loopRequired:(ee=N.loopRequired)!==null&&ee!==void 0?ee:P,loopEnum:(re=N.loopEnum)!==null&&re!==void 0?re:P,meta:(se=N.meta)!==null&&se!==void 0?se:!0,messages:(ge=N.messages)!==null&&ge!==void 0?ge:!0,inlineRefs:(Ze=N.inlineRefs)!==null&&Ze!==void 0?Ze:!0,schemaId:(ke=N.schemaId)!==null&&ke!==void 0?ke:"$id",addUsedSchema:(De=N.addUsedSchema)!==null&&De!==void 0?De:!0,validateSchema:(Ie=N.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(ht=N.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(Ve=N.unicodeRegExp)!==null&&Ve!==void 0?Ve:!0,int32range:(jt=N.int32range)!==null&&jt!==void 0?jt:!0,uriResolver:ir}}var x=class{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...w(N)};let{es5:M,lines:b}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:M,lines:b}),this.logger=V(N.logger);let p=N.validateFormats;if(N.validateFormats=!1,this.RULES=(0,s.getRules)(),O.call(this,y,N,"NOT SUPPORTED"),O.call(this,g,N,"DEPRECATED","warn"),this._metaOpts=H.call(this),N.formats)E.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords)A.call(this,N.keywords);if(typeof N.meta=="object")this.addMetaSchema(N.meta);S.call(this),N.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:N,meta:M,schemaId:b}=this.opts,p=d;if(b==="id")p={...d},p.id=p.$id,delete p.$id;if(M&&N)this.addMetaSchema(p,p[b],!1)}defaultMeta(){let{meta:N,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[M]||N:void 0}validate(N,M){let b;if(typeof N=="string"){if(b=this.getSchema(N),!b)throw Error(`no schema with key or ref "${N}"`)}else b=this.compile(N);let p=b(M);if(!("$async"in b))this.errors=b.errors;return p}compile(N,M){let b=this._addSchema(N,M);return b.validate||this._compileSchemaEnv(b)}compileAsync(N,M){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:b}=this.opts;return p.call(this,N,M);async function p(K,ue){await _.call(this,K.$schema);let Pe=this._addSchema(K,ue);return Pe.validate||z.call(this,Pe)}async function _(K){if(K&&!this.getSchema(K))await p.call(this,{$ref:K},!0)}async function z(K){try{return this._compileSchemaEnv(K)}catch(ue){if(!(ue instanceof n.default))throw ue;return I.call(this,ue),await U.call(this,ue.missingSchema),z.call(this,K)}}function I({missingSchema:K,missingRef:ue}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${ue} cannot be resolved`)}async function U(K){let ue=await G.call(this,K);if(!this.refs[K])await _.call(this,ue.$schema);if(!this.refs[K])this.addSchema(ue,K,M)}async function G(K){let ue=this._loading[K];if(ue)return ue;try{return await(this._loading[K]=b(K))}finally{delete this._loading[K]}}}addSchema(N,M,b,p=this.opts.validateSchema){if(Array.isArray(N)){for(let z of N)this.addSchema(z,void 0,b,p);return this}let _;if(typeof N==="object"){let{schemaId:z}=this.opts;if(_=N[z],_!==void 0&&typeof _!="string")throw Error(`schema ${z} must be string`)}return M=(0,c.normalizeId)(M||_),this._checkUnique(M),this.schemas[M]=this._addSchema(N,b,M,p,!0),this}addMetaSchema(N,M,b=this.opts.validateSchema){return this.addSchema(N,M,!0,b),this}validateSchema(N,M){if(typeof N=="boolean")return!0;let b;if(b=N.$schema,b!==void 0&&typeof b!="string")throw Error("$schema must be a string");if(b=b||this.opts.defaultMeta||this.defaultMeta(),!b)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let p=this.validate(b,N);if(!p&&M){let _="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_);else throw Error(_)}return p}getSchema(N){let M;while(typeof(M=R.call(this,N))=="string")N=M;if(M===void 0){let{schemaId:b}=this.opts,p=new i.SchemaEnv({schema:{},schemaId:b});if(M=i.resolveSchema.call(this,p,N),!M)return;this.refs[N]=M}return M.validate||this._compileSchemaEnv(M)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let M=R.call(this,N);if(typeof M=="object")this._cache.delete(M.schema);return delete this.schemas[N],delete this.refs[N],this}case"object":{let M=N;this._cache.delete(M);let b=N[this.opts.schemaId];if(b)b=(0,c.normalizeId)(b),delete this.schemas[b],delete this.refs[b];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(let M of N)this.addKeyword(M);return this}addKeyword(N,M){let b;if(typeof N=="string"){if(b=N,typeof M=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=b}else if(typeof N=="object"&&M===void 0){if(M=N,b=M.keyword,Array.isArray(b)&&!b.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Y.call(this,b,M),!M)return(0,l.eachItem)(b,(_)=>ae.call(this,_)),this;$e.call(this,M);let p={...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)};return(0,l.eachItem)(b,p.type.length===0?(_)=>ae.call(this,_,p):(_)=>p.type.forEach((z)=>ae.call(this,_,p,z))),this}getKeyword(N){let M=this.RULES.all[N];return typeof M=="object"?M.definition:!!M}removeKeyword(N){let{RULES:M}=this;delete M.keywords[N],delete M.all[N];for(let b of M.rules){let p=b.rules.findIndex((_)=>_.keyword===N);if(p>=0)b.rules.splice(p,1)}return this}addFormat(N,M){if(typeof M=="string")M=new RegExp(M);return this.formats[N]=M,this}errorsText(N=this.errors,{separator:M=", ",dataVar:b="data"}={}){if(!N||N.length===0)return"No errors";return N.map((p)=>`${b}${p.instancePath} ${p.message}`).reduce((p,_)=>p+M+_)}$dataMetaSchema(N,M){let b=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(let p of M){let _=p.split("/").slice(1),z=N;for(let I of _)z=z[I];for(let I in b){let U=b[I];if(typeof U!="object")continue;let{$data:G}=U.definition,K=z[I];if(G&&K)z[I]=de(K)}}return N}_removeAllSchemas(N,M){for(let b in N){let p=N[b];if(!M||M.test(b)){if(typeof p=="string")delete N[b];else if(p&&!p.meta)this._cache.delete(p.schema),delete N[b]}}}_addSchema(N,M,b,p=this.opts.validateSchema,_=this.opts.addUsedSchema){let z,{schemaId:I}=this.opts;if(typeof N=="object")z=N[I];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof N!="boolean")throw Error("schema must be object or boolean");let U=this._cache.get(N);if(U!==void 0)return U;b=(0,c.normalizeId)(z||b);let G=c.getSchemaRefs.call(this,N,b);if(U=new i.SchemaEnv({schema:N,schemaId:I,meta:M,baseId:b,localRefs:G}),this._cache.set(U.schema,U),_&&!b.startsWith("#")){if(b)this._checkUnique(b);this.refs[b]=U}if(p)this.validateSchema(N,!0);return U}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta)this._compileMetaSchema(N);else i.compileSchema.call(this,N);if(!N.validate)throw Error("ajv implementation error");return N.validate}_compileMetaSchema(N){let M=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,N)}finally{this.opts=M}}};x.ValidationError=o.default,x.MissingRefError=n.default,e.default=x;function O(N,M,b,p="error"){for(let _ in N){let z=_;if(z in M)this.logger[p](`${b}: option ${_}. ${N[z]}`)}}function R(N){return N=(0,c.normalizeId)(N),this.schemas[N]||this.refs[N]}function S(){let N=this.opts.schemas;if(!N)return;if(Array.isArray(N))this.addSchema(N);else for(let M in N)this.addSchema(N[M],M)}function E(){for(let N in this.opts.formats){let M=this.opts.formats[N];if(M)this.addFormat(N,M)}}function A(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let M in N){let b=N[M];if(!b.keyword)b.keyword=M;this.addKeyword(b)}}function H(){let N={...this.opts};for(let M of f)delete N[M];return N}let j={log(){},warn(){},error(){}};function V(N){if(N===!1)return j;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw Error("logger must implement log, warn and error methods")}let W=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(N,M){let{RULES:b}=this;if((0,l.eachItem)(N,(p)=>{if(b.keywords[p])throw Error(`Keyword ${p} is already defined`);if(!W.test(p))throw Error(`Keyword ${p} has invalid name`)}),!M)return;if(M.$data&&!(("code"in M)||("validate"in M)))throw Error('$data keyword must have "code" or "validate" function')}function ae(N,M,b){var p;let _=M===null||M===void 0?void 0:M.post;if(b&&_)throw Error('keyword with "post" flag cannot have "type"');let{RULES:z}=this,I=_?z.post:z.rules.find(({type:G})=>G===b);if(!I)I={type:b,rules:[]},z.rules.push(I);if(z.keywords[N]=!0,!M)return;let U={keyword:N,definition:{...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)}};if(M.before)we.call(this,I,U,M.before);else I.rules.push(U);z.all[N]=U,(p=M.implements)===null||p===void 0||p.forEach((G)=>this.addKeyword(G))}function we(N,M,b){let p=N.rules.findIndex((_)=>_.keyword===b);if(p>=0)N.rules.splice(p,0,M);else N.rules.push(M),this.logger.warn(`rule ${b} is not defined`)}function $e(N){let{metaSchema:M}=N;if(M===void 0)return;if(N.$data&&this.opts.$data)M=de(M);N.validateSchema=this.compile(M,!0)}let Ce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function de(N){return{anyOf:[N,Ce]}}}),bk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),Fu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=so(),r=xt(),o=le(),n=kt(),s=xi(),i=_e(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:m,it:h}=l,{baseId:f,schemaEnv:v,validateName:y,opts:g,self:P}=h,{root:w}=v;if((m==="#"||m==="#/")&&f===w.baseId)return O();let x=s.resolveRef.call(P,w,f,m);if(x===void 0)throw new t.default(h.opts.uriResolver,f,m);if(x instanceof s.SchemaEnv)return R(x);return S(x);function O(){if(v===w)return u(l,y,v,v.$async);let E=d.scopeValue("root",{ref:w});return u(l,o._`${E}.validate`,w,w.$async)}function R(E){u(l,c(l,E),E,E.$async)}function S(E){let A=d.scopeValue("schema",g.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),H=d.name("valid"),j=l.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:A,errSchemaPath:m},H);l.mergeEvaluated(j),l.ok(H)}}};function c(l,d){let{gen:m}=l;return d.validate?m.scopeValue("validate",{ref:d.validate}):o._`${m.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,m,h){let{gen:f,it:v}=l,{allErrors:y,schemaEnv:g,opts:P}=v,w=P.passContext?n.default.this:o.nil;if(h)x();else O();function x(){if(!g.$async)throw Error("async schema referenced by sync schema");let E=f.let("valid");f.try(()=>{if(f.code(o._`await ${(0,r.callValidateCode)(l,d,w)}`),S(d),!y)f.assign(E,!0)},(A)=>{if(f.if(o._`!(${A} instanceof ${v.ValidationError})`,()=>f.throw(A)),R(A),!y)f.assign(E,!1)}),l.ok(E)}function O(){l.result((0,r.callValidateCode)(l,d,w),()=>S(d),()=>R(d))}function R(E){let A=o._`${E}.errors`;f.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),f.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function S(E){var A;if(!v.opts.unevaluated)return;let H=(A=m===null||m===void 0?void 0:m.validate)===null||A===void 0?void 0:A.evaluated;if(v.props!==!0)if(H&&!H.dynamicProps){if(H.props!==void 0)v.props=i.mergeEvaluated.props(f,H.props,v.props)}else{let j=f.var("props",o._`${E}.evaluated.props`);v.props=i.mergeEvaluated.props(f,j,v.props,o.Name)}if(v.items!==!0)if(H&&!H.dynamicItems){if(H.items!==void 0)v.items=i.mergeEvaluated.items(f,H.items,v.items)}else{let j=f.var("items",o._`${E}.evaluated.items`);v.items=i.mergeEvaluated.items(f,j,v.items,o.Name)}}}e.callRef=u,e.default=a}),yb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bk(),r=Fu(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),zk=B((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})=>t.str`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>t._`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data(t._`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),$k=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),Rk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;while(s<o)if(n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o){if(i=r.charCodeAt(s),(i&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),wk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=Rk(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?t._`${a}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data(t._`${d} ${l} ${c}`)}};e.default=n}),Pk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=_e(),o=le(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,m=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:h}=d.opts.code,f=h.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,h),v=i.let("valid");i.try(()=>i.assign(v,o._`${f}(${l}, ${m}).test(${a})`),()=>i.assign(v,!1)),s.fail$data(o._`!${v}`)}else{let h=(0,t.usePattern)(s,u);s.fail$data(o._`!${h}.test(${a})`)}}};e.default=n}),kk=B((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 t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),xk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=_e(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:m}=d;if(!l&&a.length===0)return;let h=a.length>=m.loopRequired;if(d.allErrors)f();else v();if(m.strictRequired){let P=s.parentSchema.properties,{definedProperties:w}=s.it;for(let x of a)if((P===null||P===void 0?void 0:P[x])===void 0&&!w.has(x)){let O=`required property "${x}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,O,d.opts.strictRequired)}}function f(){if(h||l)s.block$data(r.nil,y);else for(let P of a)(0,t.checkReportMissingProp)(s,P)}function v(){let P=i.let("missing");if(h||l){let w=i.let("valid",!0);s.block$data(w,()=>g(P,w)),s.ok(w)}else i.if((0,t.checkMissingProp)(s,a,P)),(0,t.reportMissingProp)(s,P),i.else()}function y(){i.forOf("prop",c,(P)=>{s.setParams({missingProperty:P}),i.if((0,t.noPropertyInData)(i,u,P,m.ownProperties),()=>s.error())})}function g(P,w){s.setParams({missingProperty:P}),i.forOf(P,c,()=>{i.assign(w,(0,t.propertyInData)(i,u,P,m.ownProperties)),i.if((0,r.not)(w),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),Ek=B((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 t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${a} ${i}`)}};e.default=r}),Vu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gb();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Tk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ri(),r=le(),o=_e(),n=Vu(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>r.str`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>r._`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:m,it:h}=i;if(!u&&!l)return;let f=a.let("valid"),v=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(f,y,r._`${m} === false`),i.ok(f);function y(){let x=a.let("i",r._`${c}.length`),O=a.let("j");i.setParams({i:x,j:O}),a.assign(f,!0),a.if(r._`${x} > 1`,()=>(g()?P:w)(x,O))}function g(){return v.length>0&&!v.some((x)=>x==="object"||x==="array")}function P(x,O){let R=a.name("item"),S=(0,t.checkDataTypes)(v,R,h.opts.strictNumbers,t.DataType.Wrong),E=a.const("indices",r._`{}`);a.for(r._`;${x}--;`,()=>{if(a.let(R,r._`${c}[${x}]`),a.if(S,r._`continue`),v.length>1)a.if(r._`typeof ${R} == "string"`,r._`${R} += "_"`);a.if(r._`typeof ${E}[${R}] == "number"`,()=>{a.assign(O,r._`${E}[${R}]`),i.error(),a.assign(f,!1).break()}).code(r._`${E}[${R}] = ${x}`)})}function w(x,O){let R=(0,o.useFunc)(a,n.default),S=a.name("outer");a.label(S).for(r._`;${x}--;`,()=>a.for(r._`${O} = ${x}; ${O}--;`,()=>a.if(r._`${R}(${c}[${x}], ${c}[${O}])`,()=>{i.error(),a.assign(f,!1).break(S)})))}}};e.default=s}),Ok=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=Vu(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;if(c||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`);else s.fail(t._`${l} !== ${a}`)}};e.default=n}),Ck=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=Vu(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw Error("enum must have non-empty array");let m=u.length>=d.opts.loopEnum,h,f=()=>h!==null&&h!==void 0?h:h=(0,r.useFunc)(i,o.default),v;if(m||c)v=i.let("valid"),s.block$data(v,y);else{if(!Array.isArray(u))throw Error("ajv implementation error");let P=i.const("vSchema",l);v=(0,t.or)(...u.map((w,x)=>g(P,x)))}s.pass(v);function y(){i.assign(v,!1),i.forOf("v",l,(P)=>i.if(t._`${f()}(${a}, ${P})`,()=>i.assign(v,!0).break()))}function g(P,w){let x=u[w];return typeof x==="object"&&x!==null?t._`${f()}(${a}, ${P}[${w}])`:t._`${a} === ${x}`}}};e.default=n}),vb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zk(),r=$k(),o=wk(),n=Pk(),s=kk(),i=xk(),a=Ek(),c=Tk(),u=Ok(),l=Ck(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),Sb=B((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}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let m=a.const("len",t._`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass(t._`${m} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let f=a.var("valid",t._`${m} <= ${i.length}`);a.if((0,t.not)(f),()=>h(f)),s.ok(f)}function h(f){a.forRange("i",i.length,m,(v)=>{if(s.subschema({keyword:l,dataProp:v,dataPropType:r.Type.Num},f),!d.allErrors)a.if((0,t.not)(f),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),bb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=_e(),o=xt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);if(c.items=!0,(0,r.alwaysValidSchema)(c,a))return;i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:m,it:h}=i;if(y(l),h.opts.unevaluated&&c.length&&h.items!==!0)h.items=r.mergeEvaluated.items(u,c.length,h.items);let f=u.name("valid"),v=u.const("len",t._`${d}.length`);c.forEach((g,P)=>{if((0,r.alwaysValidSchema)(h,g))return;u.if(t._`${v} > ${P}`,()=>i.subschema({keyword:m,schemaProp:P,dataProp:P},f)),i.ok(f)});function y(g){let{opts:P,errSchemaPath:w}=h,x=c.length,O=x===g.minItems&&(x===g.maxItems||g[a]===!1);if(P.strictTuples&&!O){let R=`"${m}" is ${x}-tuple, but minItems or maxItems/${a} are not specified or different at path "${w}"`;(0,r.checkStrictMode)(h,R,P.strictTuples)}}}e.validateTuple=s,e.default=n}),Ik=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bb(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),Nk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=xt(),n=Sb(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>t.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>t._`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;if(u.items=!0,(0,r.alwaysValidSchema)(u,a))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),Ak=B((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?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:m,maxContains:h}=a;if(u.opts.next)l=m===void 0?1:m,d=h;else l=1;let f=s.const("len",t._`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let w=t._`${f} >= ${l}`;if(d!==void 0)w=t._`${w} && ${f} <= ${d}`;n.pass(w);return}u.items=!0;let v=s.name("valid");if(d===void 0&&l===1)g(v,()=>s.if(v,()=>s.break()));else if(l===0){if(s.let(v,!0),d!==void 0)s.if(t._`${c}.length > 0`,y)}else s.let(v,!1),y();n.result(v,()=>n.reset());function y(){let w=s.name("_valid"),x=s.let("count",0);g(w,()=>s.if(w,()=>P(x)))}function g(w,x){s.forRange("i",0,f,(O)=>{n.subschema({keyword:"contains",dataProp:O,dataPropType:r.Type.Num,compositeRule:!0},w),x()})}function P(w){if(s.code(t._`${w}++`),d===void 0)s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0).break());else if(s.if(t._`${w} > ${d}`,()=>s.assign(v,!1).break()),l===1)s.assign(v,!0);else s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0))}}};e.default=o}),Hu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=_e(),o=xt();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return t.str`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>t._`{property: ${c},
125
+ missingProperty: ${d},
126
+ depsCount: ${u},
127
+ deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let m=Array.isArray(c[d])?u:l;m[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:m}=c;if(Object.keys(u).length===0)return;let h=l.let("missing");for(let f in u){let v=u[f];if(v.length===0)continue;let y=(0,o.propertyInData)(l,d,f,m.opts.ownProperties);if(c.setParams({property:f,depsCount:v.length,deps:v.join(", ")}),m.allErrors)l.if(y,()=>{for(let g of v)(0,o.checkReportMissingProp)(c,g)});else l.if(t._`${y} && (${(0,o.checkMissingProp)(c,v,h)})`),(0,o.reportMissingProp)(c,h),l.else()}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:m,it:h}=c,f=l.name("valid");for(let v in u){if((0,r.alwaysValidSchema)(h,u[v]))continue;l.if((0,o.propertyInData)(l,d,v,h.opts.ownProperties),()=>{let y=c.subschema({keyword:m,schemaProp:v},f);c.mergeValidEvaluated(y,f)},()=>l.var(f,!0)),c.ok(f)}}e.validateSchemaDeps=a,e.default=n}),jk=B((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})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,(l)=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(u)}};e.default=o}),zb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=kt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>r._`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:m}=i;if(!d)throw Error("ajv implementation error");let{allErrors:h,opts:f}=m;if(m.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;let v=(0,t.allSchemaProperties)(u.properties),y=(0,t.allSchemaProperties)(u.patternProperties);g(),i.ok(r._`${d} === ${o.default.errors}`);function g(){a.forIn("key",l,(R)=>{if(!v.length&&!y.length)x(R);else a.if(P(R),()=>x(R))})}function P(R){let S;if(v.length>8){let E=(0,n.schemaRefOrVal)(m,u.properties,"properties");S=(0,t.isOwnProperty)(a,E,R)}else if(v.length)S=(0,r.or)(...v.map((E)=>r._`${R} === ${E}`));else S=r.nil;if(y.length)S=(0,r.or)(S,...y.map((E)=>r._`${(0,t.usePattern)(i,E)}.test(${R})`));return(0,r.not)(S)}function w(R){a.code(r._`delete ${l}[${R}]`)}function x(R){if(f.removeAdditional==="all"||f.removeAdditional&&c===!1){w(R);return}if(c===!1){if(i.setParams({additionalProperty:R}),i.error(),!h)a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){let S=a.name("valid");if(f.removeAdditional==="failing")O(R,S,!1),a.if((0,r.not)(S),()=>{i.reset(),w(R)});else if(O(R,S),!h)a.if((0,r.not)(S),()=>a.break())}}function O(R,S,E){let A={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};if(E===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(A,S)}}};e.default=s}),Mk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=oo(),r=xt(),o=_e(),n=zb(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;if(d.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(c);for(let g of m)d.definedProperties.add(g);if(d.opts.unevaluated&&m.length&&d.props!==!0)d.props=o.mergeEvaluated.props(a,(0,o.toHash)(m),d.props);let h=m.filter((g)=>!(0,o.alwaysValidSchema)(d,c[g]));if(h.length===0)return;let f=a.name("valid");for(let g of h){if(v(g))y(g);else{if(a.if((0,r.propertyInData)(a,l,g,d.opts.ownProperties)),y(g),!d.allErrors)a.else().var(f,!0);a.endIf()}i.it.definedProperties.add(g),i.ok(f)}function v(g){return d.opts.useDefaults&&!d.compositeRule&&c[g].default!==void 0}function y(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};e.default=s}),Zk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:m}=d,h=(0,t.allSchemaProperties)(c),f=h.filter((O)=>(0,o.alwaysValidSchema)(d,c[O]));if(h.length===0||f.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;let v=m.strictSchema&&!m.allowMatchingProperties&&l.properties,y=a.name("valid");if(d.props!==!0&&!(d.props instanceof r.Name))d.props=(0,n.evaluatedPropsToName)(a,d.props);let{props:g}=d;P();function P(){for(let O of h){if(v)w(O);if(d.allErrors)x(O);else a.var(y,!0),x(O),a.if(y)}}function w(O){for(let R in v)if(new RegExp(O).test(R))(0,o.checkStrictMode)(d,`property ${R} matches pattern ${O} (use allowMatchingProperties)`)}function x(O){a.forIn("key",u,(R)=>{a.if(r._`${(0,t.usePattern)(i,O)}.test(${R})`,()=>{let S=f.includes(O);if(!S)i.subschema({keyword:"patternProperties",schemaProp:O,dataProp:R,dataPropType:n.Type.Str},y);if(d.opts.unevaluated&&g!==!0)a.assign(r._`${g}[${R}]`,!0);else if(!S&&!d.allErrors)a.if((0,r.not)(y),()=>a.break())})})}}};e.default=s}),qk=B((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 a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),Lk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:xt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),Dk=B((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})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),m=s.name("_valid");n.setParams({passing:d}),s.block(h),n.result(l,()=>n.reset(),()=>n.error(!0));function h(){u.forEach((f,v)=>{let y;if((0,r.alwaysValidSchema)(c,f))s.var(m,!0);else y=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},m);if(v>0)s.if(t._`${m} && ${l}`).assign(l,!1).assign(d,t._`[${d}, ${v}]`).else();s.if(m,()=>{if(s.assign(l,!0),s.assign(d,v),y)n.mergeEvaluated(y,t.Name)})})}}};e.default=o}),Uk=B((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 Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),Fk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;if(a.then===void 0&&a.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),m=i.name("_valid");if(h(),s.reset(),u&&l){let v=i.let("ifClause");s.setParams({ifClause:v}),i.if(m,f("then",v),f("else",v))}else if(u)i.if(m,f("then"));else i.if((0,t.not)(m),f("else"));s.pass(d,()=>s.error(!0));function h(){let v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(v)}function f(v,y){return()=>{let g=s.subschema({keyword:v},m);if(i.assign(d,m),s.mergeValidEvaluated(g,d),y)i.assign(y,t._`${v}`);else s.setParams({ifClause:v})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),Vk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),$b=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Sb(),r=Ik(),o=bb(),n=Nk(),s=Ak(),i=Hu(),a=jk(),c=zb(),u=Mk(),l=Zk(),d=qk(),m=Lk(),h=Dk(),f=Uk(),v=Fk(),y=Vk();function g(P=!1){let w=[d.default,m.default,h.default,f.default,v.default,y.default,a.default,c.default,i.default,u.default,l.default];if(P)w.push(r.default,n.default);else w.push(t.default,o.default);return w.push(s.default),w}e.default=g}),Hk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:m,schemaEnv:h,self:f}=l;if(!d.validateFormats)return;if(a)v();else y();function v(){let g=s.scopeValue("formats",{ref:f.formats,code:d.code.formats}),P=s.const("fDef",t._`${g}[${u}]`),w=s.let("fType"),x=s.let("format");s.if(t._`typeof ${P} == "object" && !(${P} instanceof RegExp)`,()=>s.assign(w,t._`${P}.type || "string"`).assign(x,t._`${P}.validate`),()=>s.assign(w,t._`"string"`).assign(x,P)),o.fail$data((0,t.or)(O(),R()));function O(){if(d.strictSchema===!1)return t.nil;return t._`${u} && !${x}`}function R(){let S=h.$async?t._`(${P}.async ? await ${x}(${i}) : ${x}(${i}))`:t._`${x}(${i})`,E=t._`(typeof ${x} == "function" ? ${S} : ${x}.test(${i}))`;return t._`${x} && ${x} !== true && ${w} === ${n} && !${E}`}}function y(){let g=f.formats[c];if(!g){O();return}if(g===!0)return;let[P,w,x]=R(g);if(P===n)o.pass(S());function O(){if(d.strictSchema===!1){f.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function R(E){let A=E instanceof RegExp?(0,t.regexpCode)(E):d.code.formats?t._`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,H=s.scopeValue("formats",{key:c,ref:E,code:A});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,t._`${H}.validate`];return["string",E,H]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!h.$async)throw Error("async format in sync schema");return t._`await ${x}(${i})`}return typeof w=="function"?t._`${x}(${i})`:t._`${x}.test(${i})`}}}};e.default=r}),Rb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Hk().default];e.default=t}),wb=B((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"]}),Pb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yb(),r=vb(),o=$b(),n=Rb(),s=wb(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),Bk=B((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={}))}),Bu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Bk(),o=xi(),n=so(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>t._`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:m}=a,{oneOf:h}=d;if(!m.opts.discriminator)throw Error("discriminator: requires discriminator option");let f=l.propertyName;if(typeof f!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!h)throw Error("discriminator: requires oneOf keyword");let v=c.let("valid",!1),y=c.const("tag",t._`${u}${(0,t.getProperty)(f)}`);c.if(t._`typeof ${y} == "string"`,()=>g(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:y,tagName:f})),a.ok(v);function g(){let x=w();c.if(!1);for(let O in x)c.elseIf(t._`${y} === ${O}`),c.assign(v,P(x[O]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:y,tagName:f}),c.endIf()}function P(x){let O=c.name("valid"),R=a.subschema({keyword:"oneOf",schemaProp:x},O);return a.mergeEvaluated(R,t.Name),O}function w(){var x;let O={},R=E(d),S=!0;for(let j=0;j<h.length;j++){let V=h[j];if((V===null||V===void 0?void 0:V.$ref)&&!(0,s.schemaHasRulesButRef)(V,m.self.RULES)){let Y=V.$ref;if(V=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,Y),V instanceof o.SchemaEnv)V=V.schema;if(V===void 0)throw new n.default(m.opts.uriResolver,m.baseId,Y)}let W=(x=V===null||V===void 0?void 0:V.properties)===null||x===void 0?void 0:x[f];if(typeof W!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);S=S&&(R||E(V)),A(W,j)}if(!S)throw Error(`discriminator: "${f}" must be required`);return O;function E({required:j}){return Array.isArray(j)&&j.includes(f)}function A(j,V){if(j.const)H(j.const,V);else if(j.enum)for(let W of j.enum)H(W,V);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function H(j,V){if(typeof j!="string"||j in O)throw Error(`discriminator: "${f}" values must be unique strings`);O[j]=V}}}};e.default=i}),Jk=B((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}}),kb=B((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=Uu(),o=Pb(),n=Bu(),s=Jk(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((h)=>this.addVocabulary(h)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let h=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(h,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=Pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),xb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=kt(),o=xi(),n=Fu(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let m=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,h=d.errSchemaPath==="#"?d.validateName:a(c);l.if(t._`!${m}`,()=>l.assign(m,h))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:m,baseId:h,localRefs:f,meta:v}=u.root,{schemaId:y}=d.opts,g=new o.SchemaEnv({schema:l,schemaId:y,root:m,baseId:h,localRefs:f,meta:v});return o.compileSchema.call(d,g),(0,n.getValidate)(c,g)}e.default=s}),Eb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=kt(),o=Fu(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)m();else{let f=c.let("valid",!1);m(f),i.ok(f)}function m(f){if(l.schemaEnv.root.dynamicAnchors[d]){let v=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(v,h(v,f),h(l.validateName,f))}else h(l.validateName,f)()}function h(f,v){return v?()=>c.block(()=>{(0,o.callRef)(i,f),c.let(v,!0)}):()=>(0,o.callRef)(i,f)}}e.dynamicRef=s,e.default=n}),Kk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xb(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),Gk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Eb(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),Tb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xb(),r=Eb(),o=Kk(),n=Gk(),s=[t.default,r.default,o.default,n.default];e.default=s}),Wk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hu(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),Yk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hu(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),Xk=B((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}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),Ob=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Wk(),r=Yk(),o=Xk(),n=[t.default,r.default,o.default];e.default=n}),Qk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=kt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:d,props:m}=l;if(m instanceof t.Name)i.if(t._`${m} !== true`,()=>i.forIn("key",c,(y)=>i.if(f(m,y),()=>h(y))));else if(m!==!0)i.forIn("key",c,(y)=>m===void 0?h(y):i.if(v(m,y),()=>h(y)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function h(y){if(a===!1){if(s.setParams({unevaluatedProperty:y}),s.error(),!d)i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let g=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:y,dataPropType:r.Type.Str},g),!d)i.if((0,t.not)(g),()=>i.break())}}function f(y,g){return t._`!${y} || !${y}[${g}]`}function v(y,g){let P=[];for(let w in y)if(y[w]===!0)P.push(t._`${g} !== ${w}`);return(0,t.and)(...P)}}};e.default=n}),eE=B((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}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",t._`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let m=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(m),()=>d(m,u)),n.ok(m)}c.items=!0;function d(m,h){s.forRange("i",h,l,(f)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:r.Type.Num},m),!c.allErrors)s.if((0,t.not)(m),()=>s.break())})}}};e.default=o}),Cb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Qk(),r=eE(),o=[t.default,r.default];e.default=o}),tE=B((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"}]}}}}}),rE=B((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:"#"}}}}}),oE=B((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:"#"}}}}),nE=B((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:{}}}}}),sE=B((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"}}}}),iE=B((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}}}}),aE=B((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:[]}}}}),cE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tE(),r=rE(),o=oE(),n=nE(),s=sE(),i=iE(),a=aE(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach((m)=>this.addMetaSchema(m,void 0,!1)),this;function d(m,h){return l?m.$dataMetaSchema(h,c):h}}e.default=u}),uE=B((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=Uu(),o=Pb(),n=Tb(),s=Ob(),i=Cb(),a=Bu(),c=cE(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(v={}){super({...v,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((v)=>this.addVocabulary(v)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:v,meta:y}=this.opts;if(!y)return;c.default.call(this,v),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var h=Pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),lE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yb(),r=vb(),o=$b(),n=Tb(),s=Ob(),i=Cb(),a=Rb(),c=wb(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),dE=B((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}}}}),pE=B((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"}}}}}),mE=B((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"}}}}),fE=B((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"}}}}),hE=B((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"}}}}),gE=B((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"}}}}),_E=B((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}}}}),yE=B((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:[]}}}}),vE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dE(),r=pE(),o=mE(),n=fE(),s=hE(),i=gE(),a=_E(),c=yE(),u=["/properties"];function l(d){return[t,r,o,n,s,m(this,i),a,m(this,c)].forEach((h)=>this.addMetaSchema(h,void 0,!1)),this;function m(h,f){return d?h.$dataMetaSchema(f,u):f}}e.default=l}),SE=B((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=Uu(),o=lE(),n=Bu(),s=vE(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((m)=>this.addVocabulary(m)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:h}=this.opts;if(!h)return;s.default.call(this,m),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.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 l=Pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),bE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,V){return{validate:j,compare:V}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(m(!0),h),"iso-time":t(c(),l),"iso-date-time":t(m(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"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:H,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:w,int32:{type:"number",validate:R},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"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,f),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(j){return j%4===0&&(j%100!==0||j%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(j){let V=o.exec(j);if(!V)return!1;let W=+V[1],Y=+V[2],ae=+V[3];return Y>=1&&Y<=12&&ae>=1&&ae<=(Y===2&&r(W)?29:n[Y])}function i(j,V){if(!(j&&V))return;if(j>V)return 1;if(j<V)return-1;return 0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(j){return function(W){let Y=a.exec(W);if(!Y)return!1;let ae=+Y[1],we=+Y[2],$e=+Y[3],Ce=Y[4],de=Y[5]==="-"?-1:1,N=+(Y[6]||0),M=+(Y[7]||0);if(N>23||M>59||j&&!Ce)return!1;if(ae<=23&&we<=59&&$e<60)return!0;let b=we-M*de,p=ae-N*de-(b<0?1:0);return(p===23||p===-1)&&(b===59||b===-1)&&$e<61}}function u(j,V){if(!(j&&V))return;let W=new Date("2020-01-01T"+j).valueOf(),Y=new Date("2020-01-01T"+V).valueOf();if(!(W&&Y))return;return W-Y}function l(j,V){if(!(j&&V))return;let W=a.exec(j),Y=a.exec(V);if(!(W&&Y))return;if(j=W[1]+W[2]+W[3],V=Y[1]+Y[2]+Y[3],j>V)return 1;if(j<V)return-1;return 0}let d=/t|\s/i;function m(j){let V=c(j);return function(Y){let ae=Y.split(d);return ae.length===2&&s(ae[0])&&V(ae[1])}}function h(j,V){if(!(j&&V))return;let W=new Date(j).valueOf(),Y=new Date(V).valueOf();if(!(W&&Y))return;return W-Y}function f(j,V){if(!(j&&V))return;let[W,Y]=j.split(d),[ae,we]=V.split(d),$e=i(W,ae);if($e===void 0)return;return $e||u(Y,we)}let v=/\/|:/,y=/^(?:[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 g(j){return v.test(j)&&y.test(j)}let P=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return P.lastIndex=0,P.test(j)}let x=-2147483648,O=2147483647;function R(j){return Number.isInteger(j)&&j<=O&&j>=x}function S(j){return Number.isInteger(j)}function E(){return!0}let A=/[^\\]\\Z/;function H(j){if(A.test(j))return!1;try{return new RegExp(j),!0}catch(V){return!1}}});var zE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=kb(),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:a,schemaCode:c})=>r.str`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>r._`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:m}=a,{opts:h,self:f}=m;if(!h.validateFormats)return;let v=new t.KeywordCxt(m,f.RULES.all.format.definition,"format");if(v.$data)y();else g();function y(){let w=c.scopeValue("formats",{ref:f.formats,code:h.code.formats}),x=c.const("fmt",r._`${w}[${v.schemaCode}]`);a.fail$data((0,r.or)(r._`typeof ${x} != "object"`,r._`${x} instanceof RegExp`,r._`typeof ${x}.compare != "function"`,P(x)))}function g(){let w=v.schema,x=f.formats[w];if(!x||x===!0)return;if(typeof x!="object"||x instanceof RegExp||typeof x.compare!="function")throw Error(`"${d}": format "${w}" does not define "compare" function`);let O=c.scopeValue("formats",{key:w,ref:x,code:h.code.formats?r._`${h.code.formats}${(0,r.getProperty)(w)}`:void 0});a.fail$data(P(O))}function P(w){return r._`${w}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=(a)=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),$E=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=bE(),o=zE(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,m]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(c(u,l.formats||r.formatNames,d,m),l.keywords)(0,o.default)(u);return u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw Error(`Unknown format "${u}"`);return d};function c(u,l,d,m){var h,f;(h=(f=u.opts.code).formats)!==null&&h!==void 0||(f.formats=n._`require("ajv-formats/dist/formats").${m}`);for(let v of l)u.addFormat(v,d[v])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),Ib=kb(),RE=uE(),wE=SE(),PE=Hn($E(),1),kE=PE.default;function Du(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return kE(t),t}var Ju=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Du(wE.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Qu(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=Du(RE.Ajv2019);return this._ajvDraft7??=Du(Ib.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)}}},cj=Ib.Ajv;import I5 from"process";var Fb=Symbol.for("mcp.completable");function Nb(e){return!!e&&typeof e==="object"&&Fb in e}function xE(e){return e[Fb]?.complete}var gC=15000,EE=2147483647;function NF(e,t){if(!Number.isFinite(e)||e<1)return;let r=setInterval(t,Math.min(e,EE));return r.unref?.(),r}var Vb,_5=class{static{Vb=(e)=>e._classification}onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??gC}async start(){if(this._started)throw Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw Error("PerRequestHTTPServerTransport is closed");this._used=!0;let r=t?.request?.signal;if(r?.aborted)throw await this.close(),new ct(gt.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(Mm(e)){this._requestId=e.id;let n,s,i=new Promise((a,c)=>{n=a,s=c});if(this._deferredResponse={promise:i,resolve:n,reject:s,settled:!1},r!==void 0){let a=()=>void this.close();r.addEventListener("abort",a,{once:!0}),this._abortCleanup=()=>r.removeEventListener("abort",a)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}if(this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled)this.upgradeToSse();return i}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let r=jh(e)||Kh(e),o=r?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){if(r)this.onerror?.(Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(r){if(this._terminalDelivered)return;this._terminalDelivered=!0;let n=Kh(e)?e.error.code:void 0,s=n!==void 0&&(this._dispatchWindowOpen||n===pe.MissingRequiredClientCapability)?Mu[n]:void 0;if(s!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:s,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._responseMode==="json")return;if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e)}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
128
+ `).map((r)=>`: ${r}`).join(`
129
+ `);this.writeFrame(`${t}
130
+
131
+ `)}async close(){if(this._closed)return;if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}if(this._deferredResponse!==void 0&&!this._deferredResponse.settled)this._deferredResponse.settled=!0,this._deferredResponse.reject(new ct(gt.ConnectionClosed,"Connection closed before a response was produced"));this.onclose?.()}settleResponse(e){if(this._deferredResponse===void 0||this._deferredResponse.settled)return;this._deferredResponse.settled=!0,this._deferredResponse.resolve(e)}upgradeToSse(){let e,t=new ReadableStream({start:(r)=>{e=r},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=NF(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
132
+ data: ${JSON.stringify(e)}
133
+
134
+ `)}writeFrame(e){if(this._sse===void 0||this._sse.closed)return;try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(Error(`Failed to write to the response stream: ${t}`))}}};function TE(e){return e instanceof _5?Vb(e):void 0}function Ei(e){return e.replaceAll(/[\\"]/g,String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g," ")}function Ab(e,t,r,o){let n=`Bearer error="${Ei(e)}", error_description="${Ei(t)}"`;if(r.length>0)n+=`, scope="${Ei(r.join(" "))}"`;if(o)n+=`, resource_metadata="${Ei(o)}"`;return n}function OE(e,t){let{requiredScopes:r=[],resourceMetadataUrl:o}=t??{};if(!(e instanceof _i)){let n=new _i(ro.ServerError,"Internal Server Error");return Response.json(n.toResponseObject(),{status:500})}switch(e.code){case ro.InvalidToken:{let n=Ab(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:401,headers:{"WWW-Authenticate":n}})}case ro.InsufficientScope:{let n=Ab(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:403,headers:{"WWW-Authenticate":n}})}case ro.ServerError:return Response.json(e.toResponseObject(),{status:500});default:return Response.json(e.toResponseObject(),{status:400})}}function CE(e){let t=new URL(e);return t.pathname=IE(e),t.hash="",t.href}function IE(e){let t=NE(e.pathname);return`/.well-known/oauth-protected-resource${t==="/"?"":t}`}function NE(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function AE(e){return typeof e==="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver==="function"}function jE(e,t){if(typeof e!=="string"||!/^[\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e))throw TypeError(`${t} must satisfy the OAuth scope-token grammar`)}function ME(e){if(e===null||typeof e!=="object"||!Array.isArray(e.scopes)||e.scopes.length===0)throw TypeError("scope challenge must contain at least one scope");for(let[t,r]of e.scopes.entries())jE(r,`scope challenge scopes[${t}]`);if(e.errorDescription!==void 0&&typeof e.errorDescription!=="string")throw TypeError("scope challenge errorDescription must be a string");if(e.errorDescription!==void 0&&!/^[\u0020-\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e.errorDescription))throw TypeError("scope challenge errorDescription must satisfy the RFC 6750 error-description grammar");return e}async function x5(e,t,r){for(let o of e){let n=await r({request:o,...t!==void 0&&{authInfo:t}});if(n!==void 0)return ME(n)}}function C5(e){if(e?.resourceMetadataUrl!==void 0)return e.resourceMetadataUrl;if(e?.resource?.protocol==="https:"||e?.resource?.protocol==="http:")return CE(e.resource)}function D5(e,t){return OE(new _i(ro.InsufficientScope,e.errorDescription??"Insufficient scope"),{requiredScopes:[...e.scopes],resourceMetadataUrl:t})}var ZE=8,qE=600000;function LE(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??ZE,roundTimeoutMs:e?.roundTimeoutMs??qE,legacyShim:e?.legacyShim??!0}}function Hb(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new ye(pe.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=IS(o);if(n===void 0)throw new ye(pe.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 DE(){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 Ku(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ye(pe.InternalError,t)}var UE=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;while(!0){if(u+=1,u>s)return Ku(e,ob(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,m=typeof c.requestState==="string"?c.requestState:void 0;if(!d&&m===void 0)throw new ye(pe.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 h;if(d){let y=this._host.resolvedClientCapabilities(o),g=[];for(let[w,x]of Object.entries(l)){let{embedded:O,required:R}=Hb(e,w,x);if(O.method!=="roots/list"&&O.params===void 0)throw new ye(pe.InternalError,`Handler for ${e} returned an input request '${w}' of kind '${O.method}' without params`);if(CF(R,y)!==void 0)return Ku(e,`Cannot request input '${w}' (${O.method}): the client on this 2025-era connection did not declare the required capability${y===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);g.push([w,O])}let P=sb(a);try{let w={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:P.signal},x=await Promise.all(g.map(async([O,R])=>{try{return[O,await this._dispatchLeg(R,w)]}catch(S){throw P.abort(S),S}}));h=Object.fromEntries(x)}catch(w){if(a.aborted)throw w;return Ku(e,`Fulfilling input required by '${e}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{P.dispose()}}else await nb(rb,a);let f={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:wn(m)}};if(m!==void 0){let y=await this._host.verifyRequestState(m,f,e);if(y!==void 0)f=qu(f,y)}let v=await t(r,f);if(!sr(v))return v;c=v}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:DE()};return 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)}}},FE=new Set(["tools/call","prompts/get","resources/read"]),Bb,Jb,Kb;function Cee(e,t){Bb(e,t)}function Dee(e,t){Jb(e,t)}function Oee(e){return Kb(e)}var VE=class extends lb{_clientCapabilities;_clientVersion;static{Bb=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},Jb=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},Kb=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_boundFromTransport=!1;_legacyInputRequiredShim(){return this._legacyShim??=new UE({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){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ju,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=LE(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)DF(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),yi(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ct(gt.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.");if(this._boundFromTransport)this._boundFromTransport=!1,this._negotiatedProtocolVersion=void 0;let t=TE(e)?.revision;if(t!==void 0&&!this._servedModernEra()&&bT.includes(t)&&yi(this._supportedProtocolVersions).includes(t))this._negotiatedProtocolVersion=t,this._boundFromTransport=!0;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=bi(Hh,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}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?.[mp],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i))return Promise.resolve();return 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(Hh.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 ct(gt.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=db(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=FE.has(e);if(r===void 0&&!o)return async(n,s)=>{let i=await t(n,s);if(sr(i))throw new ye(pe.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 async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(sr(i)){if(!o)throw new ye(pe.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:vi(i,r)}}return async(r,o)=>{let n=Ft(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ye(s.reason==="not-in-era"?pe.InternalError:pe.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(sr(i))return i;let a=xu(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new ye(c.reason==="not-in-era"?pe.InternalError:pe.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Dm(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 ye(pe.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s==="string"){let d=await this._verifyRequestState(s,o,e);if(d!==void 0)i=qu(o,d)}let a;try{a=await t(r,i)}catch(d){if(d instanceof ye&&d.code===pe.UrlElicitationRequired){if(!n)throw d;throw new ye(pe.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.`)}throw d}if(!sr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new ye(pe.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Hr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState==="string";if(!u&&!l)throw new ye(pe.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 d=this._inputRequestCapabilityView(o);for(let[m,h]of Object.entries(c)){let{embedded:f,required:v}=Hb(e,m,h),y=CF(v,d);if(y!==void 0)throw new OF({requiredCapabilities:y},`Cannot request input '${m}' (${f.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new ye(pe.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Ir]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ct(gt.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 ct(gt.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ct(gt.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ct(gt.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 ct(gt.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 ct(gt.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ct(gt.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 ct(gt.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 ct(gt.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 ct(gt.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ct(gt.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ct(gt.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 ct(gt.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ct(gt.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=AS(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??Hr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:yi(this._supportedProtocolVersions),capabilities:HE(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 ct(gt.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],a=i.some((d)=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some((d)=>d.type==="tool_use");if(a){if(i.some((d)=>d.type!=="tool_result"))throw new ye(pe.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new ye(pe.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),m=new Set(i.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(d.size!==m.size||![...d].every((h)=>m.has(h)))throw new ye(pe.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(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 ct(gt.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 ct(gt.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ct(gt.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 a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new ye(pe.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){if(a instanceof ye)throw a;throw new ye(pe.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ct(gt.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 HE(e){return{...e}}function BE(e,t){let r=0,o=[e];while(o.length>0){let n=o.pop();if(n===null||typeof n!=="object")continue;if(Array.isArray(n))for(let s of n){if(++r>t)return r;if(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];if(i!==null&&typeof i==="object")o.push(i)}}return r}function JE(e){if(e===void 0||e===1/0)return;if(typeof e!=="number"||Number.isNaN(e)||e<1)throw RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}var Gh=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Mb;try{let r=wr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}constructor(e,t){if(this.server=new VE(e,t),this._maxToolInputElements=JE(t?.maxToolInputElements),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){if(AE(e))e.setScopeChallengeResolver((t)=>this.resolveScopeChallenge(t));return 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];if(r===void 0||!r.enabled)return;return 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];if(r===void 0||!r.enabled)return;return r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;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?KE(e,t.inputSchema):Mb,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)r.outputSchema=wr(t.outputSchema,"output");return r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new ye(pe.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ye(pe.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);if(await this.validateToolOutput(r,n,e.params.name),sr(n))return n;return this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof ye&&o.code===pe.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&&BE(t,this._maxToolInputElements)>this._maxToolInputElements)throw new ye(pe.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await Rr(e.inputSchema,t??{});if(!o.success)throw new ye(pe.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(sr(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new ye(pe.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await Rr(e.outputSchema,t.structuredContent);if(!o.success)throw new ye(pe.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(){if(this._completionHandlerInitialized)return;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 WS(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return YS(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ye(pe.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new ye(pe.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ye(pe.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return kn;let o=Ub(Db(r.argsSchema)?.[e.params.argument.name]);if(!Nb(o))return kn;let n=xE(o);if(!n)return kn;return Lb(await n(e.params.argument.value,e.params.context))}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 kn;throw new ye(pe.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return kn;return Lb(await o(e.params.argument.value,e.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;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 ye(pe.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 ye(pe.InvalidParams,`Resource ${r} disabled`);return vi(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 ye(pe.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return vi(await n.readCallback(r,s,t),n.cacheHint)}}throw new Om(e.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;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?tb(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 ye(pe.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ye(pe.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,a=i;if(n!==void 0)DF(n,`resource ${e}`);if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let c=this._createRegisteredResource(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}_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:(a)=>{if(a.uri!==void 0&&a.uri!==r){if(delete this._registeredResources[r],a.uri)this._registeredResources[a.uri]=i}if(a.name!==void 0)i.name=a.name;if(a.metadata!==void 0)i.metadata=a.metadata;if(a.title!==void 0)i.title=a.title,i.metadata={...i.metadata,title:a.title};if(a.callback!==void 0)i.readCallback=a.callback;if(a.scopeChallenge!==void 0)i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge;if(a.enabled!==void 0)i.enabled=a.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:(c)=>{if(c.name!==void 0&&c.name!==e){if(delete this._registeredResourceTemplates[e],c.name)this._registeredResourceTemplates[c.name]=i}if(c.template!==void 0)i.resourceTemplate=c.template;if(c.metadata!==void 0)i.metadata=c.metadata;if(c.title!==void 0)i.title=c.title,i.metadata={...i.metadata,title:c.title};if(c.callback!==void 0)i.readCallback=c.callback;if(c.scopeChallenge!==void 0)i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge;if(c.enabled!==void 0)i.enabled=c.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=r.uriTemplate.variableNames;if(Array.isArray(a)&&a.some((c)=>!!r.completeCallback(c)))this.setCompletionRequestHandler();return i}_createRegisteredPrompt(e,t,r,o,n,s,i,a){let c=o,u=n,l={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:a,handler:qb(e,o,n),enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:(d)=>{if(d.name!==void 0&&d.name!==e){if(delete this._registeredPrompts[e],d.name)this._registeredPrompts[d.name]=l}if(d.title!==void 0)l.title=d.title;if(d.description!==void 0)l.description=d.description;if(d.icons!==void 0)l.icons=d.icons;if(d.scopeChallenge!==void 0)l.scopeChallenge=d.scopeChallenge===null?void 0:d.scopeChallenge;if(d._meta!==void 0)l._meta=d._meta;let m=!1;if(d.argsSchema!==void 0)l.argsSchema=d.argsSchema,c=d.argsSchema,m=!0;if(d.callback!==void 0)u=d.callback,m=!0;if(m)l.handler=qb(e,c,u);if(d.enabled!==void 0)l.enabled=d.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=l,o){let d=Db(o);if(d){if(Object.values(d).some((m)=>Nb(Ub(m))))this.setCompletionRequestHandler()}}return l}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u,l){Lu(e);let d=l,m,h={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return m??=Zb(h.outputSchema)},set outputSchemaJson(f){m=f},annotations:s,icons:i,execution:a,scopeChallenge:c,_meta:u,handler:l,executor:jb(o,l),enabled:!0,disable:()=>h.update({enabled:!1}),enable:()=>h.update({enabled:!0}),remove:()=>h.update({name:null}),update:(f)=>{if(f.name!==void 0&&f.name!==e){if(typeof f.name==="string")Lu(f.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],f.name)delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=h,e=f.name}if(f.title!==void 0)h.title=f.title;if(f.description!==void 0)h.description=f.description;let v=!1;if(f.paramsSchema!==void 0)h.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[e],v=!0;if(f.callback!==void 0)h.handler=f.callback,d=f.callback,v=!0;if(v)h.executor=jb(h.inputSchema,d);if(f.outputSchema!==void 0)h.outputSchema=f.outputSchema,h.outputSchemaJson=Zb(f.outputSchema);if(f.annotations!==void 0)h.annotations=f.annotations;if(f.icons!==void 0)h.icons=f.icons;if(f.scopeChallenge!==void 0)h.scopeChallenge=f.scopeChallenge===null?void 0:f.scopeChallenge;if(f._meta!==void 0)h._meta=f._meta;if(f.enabled!==void 0)h.enabled=f.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=h,this.setToolRequestHandlers(),this.sendToolListChanged(),h}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,scopeChallenge:u,_meta:l}=t;return this._createRegisteredTool(e,o,n,zi(s),zi(i),a,c,void 0,u,l,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:a,_meta:c}=t,u=this._createRegisteredPrompt(e,o,n,zi(s),r,i,a,c);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},Mee=class{_uriTemplate;constructor(e,t){this._callbacks=t,this._uriTemplate=typeof e==="string"?new pb(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){return this._callbacks.complete?.[e]}};function jb(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var Mb={type:"object",properties:{}};function KE(e,t){let r=wr(t,"input"),o=EV(r);if(!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}`);return r}function Zb(e){if(e===void 0)return;try{return wr(e,"output")}catch{return}}function qb(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await Rr(t,n??{});if(!i.success)throw new ye(pe.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function Lb(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var kn={completion:{values:[],hasMore:!1}};function Db(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function GE(e){return e?.type==="optional"}function Ub(e){if(!GE(e))return e;return e.def?.innerType??e}var FF=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(r){this.onerror?.(r instanceof Error?r:Error(String(r)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{if(!t)return;t=!1,this._listeners.delete(e)}}get listenerCount(){return this._listeners.size}};function Nee(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:(t)=>e.publish({kind:"resource_updated",uri:t})}}function WE(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function YE(e,t){let r={},o=(n)=>t===void 0||n===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))r.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))r.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))r.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))r.resourceSubscriptions=[...e.resourceSubscriptions];return r}function XE(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed",...e.params!==void 0&&{params:e.params}};case"prompts_list_changed":return{method:"notifications/prompts/list_changed",...e.params!==void 0&&{params:e.params}};case"resources_list_changed":return{method:"notifications/resources/list_changed",...e.params!==void 0&&{params:e.params}};case"resource_updated":return{method:"notifications/resources/updated",params:{...e.params,uri:e.uri}}}}var O5=1024;function Gb(e,t,r){return Response.json({jsonrpc:"2.0",error:{code:t,message:r},id:e},{status:200})}function Wb(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Mh]:t}}}}function QE(e){let t=Ft($n).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function Fee(e){let{bus:t,onerror:r}=e,o=e.maxSubscriptions??O5,n=e.keepAliveMs??gC,s=new Set;function i(a,c,u,l){if(s.size>=o)return r?.(Error(`subscriptions/listen refused: subscription limit reached (${o})`)),Gb(a.id,-32603,"Subscription limit reached");let d=QE(a);if(d===void 0)return Gb(a.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let m=YE(d,u),h=a.id,f=new TextEncoder,v,y=!1,g,P,w,x=(E)=>{if(y)return;try{v.enqueue(f.encode(E))}catch(A){r?.(A instanceof Error?A:Error(String(A)))}},O=(E,A)=>{x(`event: message
135
+ data: ${JSON.stringify({jsonrpc:"2.0",method:E,params:A})}
136
+
137
+ `)},R=(E)=>{if(y)return;if(E)x(`event: message
138
+ data: ${JSON.stringify({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[Mh]:h,[Oa]:l}}})}
139
+
140
+ `);y=!0;try{g?.()}catch(A){r?.(A instanceof Error?A:Error(String(A)))}if(P!==void 0)clearInterval(P);w?.(),s.delete(R);try{v.close()}catch{}},S=new ReadableStream({start(E){v=E;let A=Wb({method:"notifications/subscriptions/acknowledged",params:{notifications:m}},h);if(O(A.method,A.params),Object.keys(m).length===0){R(!0);return}g=t.subscribe((H)=>{if(y||!WE(m,H))return;let j=Wb(XE(H),h);O(j.method,j.params)}),P=NF(n,()=>x(`: keepalive
141
+
142
+ `)),s.add(R)},cancel(){R(!1)}});if(c!==void 0)if(c.aborted)R(!1);else{let E=()=>R(!1);c.addEventListener("abort",E,{once:!0}),w=()=>c.removeEventListener("abort",E)}return new Response(S,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:i,closeAll(){for(let a of s)a(!0)},get openCount(){return s.size}}}
143
+ export{C,pr,Er,Mi,Re,Rn,zn,wi,vc,Ke,RV,Sv,cs,fu,Oa,Ir,Mh,mp,PV,AV,TV,Nh,Vi,cF,QA,eT,x_,C_,tT,no,wv,Wi,oa,sa,rT,ii,Fh,sw,aw,Rv,Pv,fp,dF,nT,D_,iT,O_,Lh,_m,cw,M_,N_,F_,L_,oT,sT,B_,$_,U_,Av,aT,H_,q_,cT,xm,Bh,cl,dT,lT,uT,$h,Cm,Uh,V_,W_,z_,j_,K_,dw,G_,Y_,J_,X_,Z_,Q_,ex,tx,pT,rx,nx,ix,ox,sx,ax,cx,dx,lx,ux,px,mx,fx,hx,lw,uw,pw,gx,yx,vx,mw,bx,Sx,wx,Rx,Px,mT,Ax,Tx,fT,lF,kx,Ex,Ix,hT,Hh,_x,xx,Cx,Dx,Ox,Mx,Nx,Fx,Lx,Tv,Bx,$x,Ux,Hx,qx,fw,qh,Vh,hw,gw,yw,Vx,vw,bw,Wx,zx,Sw,Wh,jx,Kx,Gx,Yx,Jx,Xx,Zx,Qx,eC,tC,rC,nC,iC,oC,sC,uF,aC,zh,pF,cC,mF,fF,hF,gF,yF,vF,bF,SF,wF,RF,PF,AF,TF,kF,EF,dC,gT,lC,uC,yT,pC,vT,mC,fC,hC,IF,_F,xF,kv,gt,ct,See,CF,bT,Dm,DF,pe,ye,Om,kV,OF,ww,wee,Mm,jh,Kh,T5,EV,Ree,Pee,Aee,MF,Tee,IV,kee,Eee,k5,E5,Iee,_ee,xee,I5,gC,NF,_5,x5,C5,D5,Cee,Dee,Oee,Gh,Mee,FF,Nee,O5,Fee};
144
+
145
+ //# debugId=FC5AB0BD7ECBD59B64756E2164756E21