@kaeawc/auto-mobile 0.0.93 → 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.
- package/dist/build-info.json +12 -12
- package/dist/src/ble-peripheral.py +153 -0
- package/dist/src/{chunk-r6z1eztj.js → chunk-026y62r9.js} +11 -11
- package/dist/src/chunk-0jyfg947.js +4 -0
- package/dist/src/{chunk-8g1922rp.js → chunk-0zfpp1wh.js} +4 -4
- package/dist/src/{chunk-qf6nynk6.js → chunk-13qxf7ym.js} +5 -5
- package/dist/src/chunk-1scenrk7.js +4 -0
- package/dist/src/chunk-1vb5ph1k.js +4 -0
- package/dist/src/{chunk-710rxz9y.js → chunk-20g565q7.js} +3 -3
- package/dist/src/chunk-21h6dhdm.js +5 -0
- package/dist/src/chunk-25mfpthk.js +78 -0
- package/dist/src/{chunk-rbpdk7m0.js → chunk-2b39zyxc.js} +3 -3
- package/dist/src/chunk-2gzd6wbd.js +4 -0
- package/dist/src/{chunk-xgan0qqp.js → chunk-3dntffy9.js} +1 -1
- package/dist/src/chunk-3gfczcsn.js +4 -0
- package/dist/src/{chunk-dgrbdpb7.js → chunk-3h5jz1vb.js} +6 -6
- package/dist/src/{chunk-t6c8akcm.js → chunk-41zcy6b3.js} +3 -3
- package/dist/src/chunk-47n9m2de.js +4 -0
- package/dist/src/chunk-4vxeq0vd.js +58 -0
- package/dist/src/chunk-59dx6qaf.js +4 -0
- package/dist/src/chunk-5sdf9y92.js +4 -0
- package/dist/src/{chunk-58wzr3mt.js → chunk-5wk1t46v.js} +3 -3
- package/dist/src/{chunk-vy3bwm1d.js → chunk-661c50hh.js} +5 -5
- package/dist/src/chunk-68n6bjjd.js +21 -0
- package/dist/src/{chunk-v6pya0dm.js → chunk-69pmjdf2.js} +3 -3
- package/dist/src/{chunk-e98dqnc9.js → chunk-6hrj3jt6.js} +20 -20
- package/dist/src/{chunk-wbh8spm5.js → chunk-6myr26wx.js} +8 -8
- package/dist/src/chunk-6n96k09n.js +4 -0
- package/dist/src/chunk-6vwrbkre.js +4 -0
- package/dist/src/chunk-6wk0yrab.js +4 -0
- package/dist/src/chunk-6yhm9een.js +4 -0
- package/dist/src/{chunk-mjrps0ac.js → chunk-7k7gjg2t.js} +5 -5
- package/dist/src/chunk-7n5fz68h.js +4 -0
- package/dist/src/chunk-8cvnpnbp.js +4 -0
- package/dist/src/chunk-8kzv7rk7.js +4 -0
- package/dist/src/chunk-8nj68t1v.js +167 -0
- package/dist/src/{chunk-g7tmjbkt.js → chunk-96r3bpg7.js} +3 -3
- package/dist/src/chunk-97x887te.js +4 -0
- package/dist/src/{chunk-8ph29g99.js → chunk-99a6tbvd.js} +1 -1
- package/dist/src/chunk-9p5d2994.js +5 -0
- package/dist/src/{chunk-aabchzxk.js → chunk-9q265er0.js} +4 -4
- package/dist/src/{chunk-jh6vhqzx.js → chunk-9xgnrv5w.js} +3 -3
- package/dist/src/chunk-9xgsmshb.js +5 -0
- package/dist/src/chunk-a02d1wgv.js +4 -0
- package/dist/src/{chunk-ndt1ccxm.js → chunk-a9ps00a1.js} +10 -10
- package/dist/src/{chunk-5d2hft6c.js → chunk-aewdveet.js} +3 -3
- package/dist/src/{chunk-ycaj2sgf.js → chunk-b3tdtq7r.js} +6 -6
- package/dist/src/chunk-bn7jx7a2.js +4 -0
- package/dist/src/{chunk-3y6eykz9.js → chunk-bnyw27ja.js} +2 -2
- package/dist/src/{chunk-rqc9ap3x.js → chunk-bpwsg76p.js} +2 -2
- package/dist/src/chunk-bvranw3g.js +4 -0
- package/dist/src/chunk-c25a84zb.js +4 -0
- package/dist/src/chunk-c27yv1dx.js +5 -0
- package/dist/src/chunk-c3ewxm4x.js +5 -0
- package/dist/src/{chunk-rvvy1bte.js → chunk-cb1ga9rd.js} +5 -5
- package/dist/src/chunk-cn7fwy7k.js +4 -0
- package/dist/src/chunk-cnvy4a64.js +4 -0
- package/dist/src/{chunk-7rz9898k.js → chunk-cqhw4yr6.js} +3 -3
- package/dist/src/{chunk-g04bwyj3.js → chunk-ctmfshjc.js} +2 -2
- package/dist/src/chunk-ctwmhz13.js +4 -0
- package/dist/src/{chunk-waqwcjyn.js → chunk-d3jx9bz5.js} +2 -2
- package/dist/src/{chunk-ayp07wbb.js → chunk-d6rb08ga.js} +1 -1
- package/dist/src/chunk-ddqhj4eg.js +5 -0
- package/dist/src/{chunk-r7bpkgff.js → chunk-ddrhs1c3.js} +2 -2
- package/dist/src/chunk-dnjnh9p6.js +4 -0
- package/dist/src/{chunk-wyrkw6hw.js → chunk-dw5rwgya.js} +3 -3
- package/dist/src/{chunk-3xkpk44w.js → chunk-e0870khr.js} +3 -3
- package/dist/src/chunk-ea3k10kj.js +4 -0
- package/dist/src/chunk-emv82m1w.js +7 -0
- package/dist/src/chunk-f3m6pdnx.js +4 -0
- package/dist/src/chunk-f84z32cb.js +4 -0
- package/dist/src/chunk-fpczgf0z.js +4 -0
- package/dist/src/{chunk-2tqzq5qh.js → chunk-g2js4c2v.js} +18 -18
- package/dist/src/chunk-g3af2qbk.js +5 -0
- package/dist/src/{chunk-3qwrzxh0.js → chunk-gadtna7s.js} +6 -6
- package/dist/src/{chunk-ybbtagbt.js → chunk-gcyx407v.js} +3 -3
- package/dist/src/{chunk-bfw6125s.js → chunk-gfpntwc1.js} +3 -3
- package/dist/src/chunk-gmnm5e3e.js +4 -0
- package/dist/src/chunk-gp6vb5gf.js +4 -0
- package/dist/src/chunk-gppgy7pa.js +4 -0
- package/dist/src/chunk-hegfz0ae.js +5 -0
- package/dist/src/chunk-hpzxdp1k.js +17 -0
- package/dist/src/{chunk-qcxzr2my.js → chunk-j69g8b50.js} +3 -3
- package/dist/src/chunk-jvstjnqm.js +19 -0
- package/dist/src/chunk-jzqrv78s.js +4 -0
- package/dist/src/chunk-k2948b8d.js +4 -0
- package/dist/src/chunk-k4ftd40d.js +4 -0
- package/dist/src/{chunk-bxmsax22.js → chunk-kd9vfaxh.js} +3 -3
- package/dist/src/{chunk-s3jc6cwp.js → chunk-kdczmgwk.js} +3 -3
- package/dist/src/{chunk-t6bfvfkg.js → chunk-ke3wn14v.js} +1 -1
- package/dist/src/chunk-kh5n7m6w.js +4 -0
- package/dist/src/{chunk-6wt9rgjf.js → chunk-khejfph4.js} +3 -3
- package/dist/src/chunk-kny2xemh.js +4 -0
- package/dist/src/chunk-knyzw9md.js +4 -0
- package/dist/src/chunk-mbzpt2hp.js +4 -0
- package/dist/src/chunk-mm8rcxad.js +4 -0
- package/dist/src/chunk-nc4516tx.js +4 -0
- package/dist/src/{chunk-6bznss4t.js → chunk-ntfrqrqn.js} +5 -5
- package/dist/src/chunk-nz5h2j52.js +4 -0
- package/dist/src/chunk-p22s97qy.js +4 -0
- package/dist/src/chunk-p9kt1sgr.js +6 -0
- package/dist/src/{chunk-yb97j25b.js → chunk-pf282r5g.js} +4 -4
- package/dist/src/chunk-pnd4mrxy.js +4 -0
- package/dist/src/chunk-pqqteyj6.js +4 -0
- package/dist/src/{chunk-6xmss8er.js → chunk-qj1tbnv2.js} +6 -6
- package/dist/src/chunk-qnh9egwr.js +4 -0
- package/dist/src/chunk-qy3khhf8.js +8 -0
- package/dist/src/{chunk-z637nqg8.js → chunk-r0vp315h.js} +6 -6
- package/dist/src/chunk-r4j43b9s.js +237 -0
- package/dist/src/{chunk-1p7xf5kb.js → chunk-r54cxxze.js} +3 -3
- package/dist/src/{chunk-yf7ympyz.js → chunk-r6pvhj33.js} +92 -92
- package/dist/src/chunk-rb7aa5gr.js +54 -0
- package/dist/src/chunk-rdj50kb4.js +4 -0
- package/dist/src/chunk-rnd4vcas.js +4 -0
- package/dist/src/{chunk-w5b2jwk3.js → chunk-s3y3zfcx.js} +8 -8
- package/dist/src/chunk-s4g43k75.js +5 -0
- package/dist/src/chunk-sfqe223f.js +311 -0
- package/dist/src/{chunk-284ptqa4.js → chunk-sqdrxjw5.js} +5 -5
- package/dist/src/{chunk-zgja5f3p.js → chunk-t54k47em.js} +4 -4
- package/dist/src/{chunk-3sy6ahhz.js → chunk-tek4pnvv.js} +10 -10
- package/dist/src/chunk-tn74y7af.js +4 -0
- package/dist/src/{chunk-thbh3jew.js → chunk-tvq0nzam.js} +3 -3
- package/dist/src/{chunk-0jrrsnc9.js → chunk-tx4f0h9c.js} +4 -4
- package/dist/src/chunk-vdqag3fj.js +5 -0
- package/dist/src/chunk-vz5zzs57.js +4 -0
- package/dist/src/chunk-w4s2vfpj.js +4 -0
- package/dist/src/{chunk-4hw3665t.js → chunk-w5yypt53.js} +11 -11
- package/dist/src/{chunk-8037tzzj.js → chunk-w68v64vh.js} +3 -3
- package/dist/src/chunk-whwj0pdk.js +5 -0
- package/dist/src/chunk-wnmqt1dc.js +4 -0
- package/dist/src/{chunk-cyy71ggq.js → chunk-wpe46vsa.js} +3 -3
- package/dist/src/{chunk-w3vs79ex.js → chunk-wxdjeb4k.js} +19 -19
- package/dist/src/chunk-xcqzwf9j.js +247 -0
- package/dist/src/chunk-xezekwwn.js +5 -0
- package/dist/src/chunk-xf19m15s.js +4 -0
- package/dist/src/chunk-xghbxha4.js +4 -0
- package/dist/src/{chunk-00167wan.js → chunk-xn9m3xc2.js} +5 -5
- package/dist/src/{chunk-26k317v5.js → chunk-yqfz4vts.js} +3 -3
- package/dist/src/chunk-z8tvs8nk.js +5 -0
- package/dist/src/chunk-zm2rehqb.js +5 -0
- package/dist/src/chunk-zs6dqm35.js +4 -0
- package/dist/src/daemon/processEntry.js +2 -2
- package/dist/src/index.js +4 -4
- package/dist/src/runtime/bunRuntimeGuard.js +2 -2
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
- package/package.json +2 -2
- package/dist/src/chunk-0n6swkwg.js +0 -5
- package/dist/src/chunk-0qsy1qsx.js +0 -57
- package/dist/src/chunk-11m8wj8j.js +0 -237
- package/dist/src/chunk-23p5f095.js +0 -4
- package/dist/src/chunk-28re4xrg.js +0 -4
- package/dist/src/chunk-2f9rkmhx.js +0 -5
- package/dist/src/chunk-2fxdh48t.js +0 -4
- package/dist/src/chunk-2tbdrbt6.js +0 -4
- package/dist/src/chunk-32gvv9b4.js +0 -21
- package/dist/src/chunk-3f3t1x97.js +0 -8
- package/dist/src/chunk-3fspkbc7.js +0 -4
- package/dist/src/chunk-3vg455e6.js +0 -4
- package/dist/src/chunk-49bsqdx3.js +0 -4
- package/dist/src/chunk-5snsn9cf.js +0 -4
- package/dist/src/chunk-5tm9mn47.js +0 -54
- package/dist/src/chunk-5zc77a5t.js +0 -4
- package/dist/src/chunk-64j0majr.js +0 -19
- package/dist/src/chunk-65y8v4td.js +0 -17
- package/dist/src/chunk-6awz7vhq.js +0 -5
- package/dist/src/chunk-6ep7f5ge.js +0 -4
- package/dist/src/chunk-7cs2da62.js +0 -5
- package/dist/src/chunk-7g103b54.js +0 -4
- package/dist/src/chunk-7j5vj4pa.js +0 -4
- package/dist/src/chunk-7tw8x05v.js +0 -4
- package/dist/src/chunk-7zy586cb.js +0 -4
- package/dist/src/chunk-84nanf8s.js +0 -5
- package/dist/src/chunk-8gvwcv2p.js +0 -4
- package/dist/src/chunk-8thrmfat.js +0 -4
- package/dist/src/chunk-8zgzzs7k.js +0 -78
- package/dist/src/chunk-97b1zmaq.js +0 -4
- package/dist/src/chunk-9fth9ayh.js +0 -4
- package/dist/src/chunk-9j6anhjr.js +0 -4
- package/dist/src/chunk-bfjwqk8q.js +0 -4
- package/dist/src/chunk-bnhscm2n.js +0 -4
- package/dist/src/chunk-c1vs4g1n.js +0 -4
- package/dist/src/chunk-ct3e7yng.js +0 -4
- package/dist/src/chunk-ddzkz92z.js +0 -4
- package/dist/src/chunk-drdz8hee.js +0 -5
- package/dist/src/chunk-eersndy7.js +0 -5
- package/dist/src/chunk-eggq53ks.js +0 -4
- package/dist/src/chunk-f2dya7cs.js +0 -4
- package/dist/src/chunk-fbakd6cw.js +0 -4
- package/dist/src/chunk-fgb98zjj.js +0 -5
- package/dist/src/chunk-fmpad823.js +0 -5
- package/dist/src/chunk-g0xr8zw0.js +0 -4
- package/dist/src/chunk-g3rjs80x.js +0 -4
- package/dist/src/chunk-g78rtrfv.js +0 -4
- package/dist/src/chunk-gabgv3y5.js +0 -4
- package/dist/src/chunk-gmr45m8f.js +0 -4
- package/dist/src/chunk-gsyfebqj.js +0 -4
- package/dist/src/chunk-h5rpn9wr.js +0 -247
- package/dist/src/chunk-hb1x7v55.js +0 -4
- package/dist/src/chunk-hrfytkxh.js +0 -168
- package/dist/src/chunk-j4yjzbak.js +0 -4
- package/dist/src/chunk-jd6a5v6p.js +0 -5
- package/dist/src/chunk-kn5spq15.js +0 -4
- package/dist/src/chunk-m94qs0f0.js +0 -4
- package/dist/src/chunk-n03dmn5q.js +0 -5
- package/dist/src/chunk-n72qhwd9.js +0 -4
- package/dist/src/chunk-nr6y0n4y.js +0 -5
- package/dist/src/chunk-pcsen2vs.js +0 -4
- package/dist/src/chunk-ppfr0b8h.js +0 -4
- package/dist/src/chunk-q10bdnat.js +0 -4
- package/dist/src/chunk-q9xmq595.js +0 -4
- package/dist/src/chunk-qyqypn28.js +0 -5
- package/dist/src/chunk-r2epb56s.js +0 -4
- package/dist/src/chunk-r5bxavdx.js +0 -311
- package/dist/src/chunk-r8jf3d92.js +0 -4
- package/dist/src/chunk-rc0dbypm.js +0 -4
- package/dist/src/chunk-rhcty4ms.js +0 -4
- package/dist/src/chunk-rpvckv3p.js +0 -4
- package/dist/src/chunk-ry0mz41y.js +0 -4
- package/dist/src/chunk-sfv61xjb.js +0 -6
- package/dist/src/chunk-t7w8rctc.js +0 -4
- package/dist/src/chunk-v2wd4n3e.js +0 -5
- package/dist/src/chunk-w4zga19f.js +0 -4
- package/dist/src/chunk-w7hkv422.js +0 -5
- package/dist/src/chunk-xa73x2cx.js +0 -5
- package/dist/src/chunk-y2vs6jwg.js +0 -4
- package/dist/src/chunk-yattm52s.js +0 -4
- package/dist/src/chunk-yjawdzk8.js +0 -4
- package/dist/src/chunk-zs1sghs9.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{iv,ss,iu,_a,Tr,Rh,Qu,Ph,Hi,Y0,qA,VA,S_,w_,WA,to,ov,qi,Zs,Qs,zA,Zn,Ah,KS,GS,sv,av,ep,J0,jA,R_,KA,P_,Th,gm,YS,A_,T_,k_,E_,GA,YA,I_,__,x_,cv,JA,C_,D_,XA,ym,kh,tl,ZA,QA,eT,Eh,vm,Ih,O_,M_,N_,F_,L_,JS,B_,$_,U_,H_,q_,V_,W_,z_,tT,j_,K_,G_,Y_,J_,X_,Z_,Q_,ex,tx,rx,nx,ix,ox,XS,ZS,QS,sx,ax,cx,ew,dx,lx,ux,px,mx,rT,fx,hx,nT,X0,gx,yx,vx,iT,_h,bx,Sx,wx,Rx,Px,Ax,Tx,kx,Ex,dv,Ix,_x,xx,Cx,Dx,tw,xh,Ch,rw,nw,iw,Ox,ow,sw,Mx,Nx,aw,Dh,Fx,Lx,Bx,$x,Ux,Hx,qx,Vx,Wx,zx,jx,Kx,Gx,Yx,Jx,Z0,Xx,Oh,Q0,Zx,eF,tF,rF,nF,iF,oF,sF,aF,cF,dF,lF,uF,pF,mF,fF,Qx,oT,eC,tC,sT,rC,aT,nC,iC,oC,hF,gF}from"./chunk-e98dqnc9.js";import{ZX}from"./chunk-h5rpn9wr.js";var{create:Qf,defineProperty:Io,getOwnPropertyDescriptor:eh,getOwnPropertyNames:th,getPrototypeOf:rh}=Object,oh=Object.prototype.hasOwnProperty,V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vi=(e,t)=>{let r={};for(var o in e)Io(r,o,{get:e[o],enumerable:!0});if(t)Io(r,Symbol.toStringTag,{value:"Module"});return r},nh=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=th(t),s=0,i=n.length,c;s<i;s++)if(c=n[s],!oh.call(e,c)&&c!==r)Io(e,c,{get:((a)=>t[a]).bind(null,c),enumerable:!(o=eh(t,c))||o.enumerable})}return e},Oo=(e,t,r)=>(r=e!=null?Qf(rh(e)):{},nh(t||!e||!e.__esModule?Io(r,"default",{value:e,enumerable:!0}):r,e));var sh=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Fi=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),ih=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),ah=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Ji(e){return typeof e==="string"&&Fi.has(e.replace(/#$/,""))}function Bi(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(sh.has(r))return"2020-12";if(Fi.has(r))return"2019-09";if(ih.has(r)||ah.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 jr(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 Mn(e,t="|"){return e.map((r)=>Ln(r)).join(t)}function qr(e,t){if(typeof t==="bigint")return t.toString();return t}class Gi{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 Lr(e){return new Gi(e)}function Wi(e){return e===null||e===void 0}function No(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Yi(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 Ki=Symbol("evaluating");function Xi(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Ki)return;if(o===void 0)o=Ki,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Be(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Dr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function lt(e){return Dr(e._zod.def)??e._zod.def.shape}function Qi(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Be(this,t,o),o},enumerable:!0,configurable:!0})}function ea(e,t,r){if(t in e)Be(e,t,r);else e[t]=r}function At(e,t,r,o){let n=lt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)Qi(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c});else ea(e,s,o?o(i.value,s):i.value)}}function ch(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)Qi(e,r,()=>t[r]);else ea(e,r,o.value)}}function Ke(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function ta(e){return JSON.stringify(e)}function ra(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var jn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var oa=Lr(()=>{if(Ze.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Mt(e){if(Yt(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(Yt(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function qn(e){if(Mt(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 na=new Set(["string","number","symbol"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function re(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 Ln(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function sa(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xo=(()=>({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]}))(),Dn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uh(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 At(s,e,Ao(e,t)),nt(e,Ke(r,{shape:s,checks:[]}))}function Ao(e,t){let r=lt(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 lh(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(Ao(e,t)),i={};return At(i,e,Reflect.ownKeys(lt(e)).filter((c)=>!s.has(c))),nt(e,Ke(r,{shape:i,checks:[]}))}function dh(e,t){if(!Mt(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=lt(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 nt(e,Ke(e._zod.def,{shape:ia(e,t)}))}function ia(e,t){let r={};return At(r,e,Reflect.ownKeys(lt(e))),ch(r,t),r}function fh(e,t){if(!Mt(t))throw Error("Invalid input to safeExtend: expected a plain object");return nt(e,Ke(e._zod.def,{shape:ia(e,t)}))}function hh(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={};At(r,e,Reflect.ownKeys(lt(e))),At(r,t,Reflect.ownKeys(lt(t)));let o=Ke(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return nt(e,o)}function aa(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 c=r?new Set(Ao(t,r)):void 0,a={};return At(a,t,Reflect.ownKeys(lt(t)),e&&((u,l)=>c&&!c.has(l)?u:new e({type:"optional",innerType:u}))),nt(t,Ke(t._zod.def,{shape:a,checks:[]}))}function ph(e,t,r){let o=r?new Set(Ao(t,r)):void 0,n={};return At(n,t,Reflect.ownKeys(lt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),nt(t,Ke(t._zod.def,{shape:n}))}function st(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 ca(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function bt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Mr(e){return typeof e==="string"?e:e?.message}function Un(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 Mo(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function it(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:Mr(e.inst?._zod.def?.error?.(e))??Mr(s?.(e))??Mr(t?.error?.(e))??Mr(r.customError?.(e))??Mr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=i,t?.reportInput)c.input=e.input;return c}var mh=/[\uD800-\uDBFF]/;function jo(e){let t=e.length;if(!mh.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 qo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ua(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 jt(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function la(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else gh(e,r,o.value)}}function dt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Lo(e,t,r){return dt(e,t,r,!1)}function da(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return dt(this,r,o(this))},set(n){dt(this,r,n)}})}return t}function gh(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:dt(this,t,r.bind(this))},set(o){dt(this,t,o)}})}function yh(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var An,vt=!1,vh={configurable:!0,get(){vt=!0;return}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&An!==e._zod){An=void 0;return}An=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,vh);let n=vt;vt=!1;try{let s=r(this);if(vt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return vt=vt||n,s}catch(s){throw delete this[t],vt=vt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Sh(e,t,r,o){let n=yh(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 bh="~constantCatch";function fa(e){let t=()=>e;return t[bh]=!0,t}var ha;var Vn={value:void 0,enumerable:!1},pa="captureStackTrace"in Error?Error:null;function wh(e){let t=pa;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return pa=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=f,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(m,v){if(!m._zod){Vn.value=new s(v);try{Object.defineProperty(m,"_zod",Vn)}finally{Vn.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,v),c){let b=Object.getPrototypeOf(m),R=m._zod.constr.prototype,p=b;while(p&&p!==R)p=Object.getPrototypeOf(p);let T=p??b;if(!c.has(T))c.add(T),la(T,i)}let g=f.prototype;for(let b in g){if(!Object.prototype.hasOwnProperty.call(g,b))continue;if(!(b in m))m[b]=g[b].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(m){let v=o?.Parent?wh(l):this;a(v,m);let g=v._zod.deferred;if(g){for(let R of g)R();v._zod.deferred=void 0}let b=globalThis.__zod_globalConfig?.postProcessor;if(b)b(v);return v}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class at extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ur extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(ha=globalThis).__zod_globalConfig??(ha.__zod_globalConfig={});var Ze=globalThis.__zod_globalConfig;function Ge(e){if(e)Object.assign(Ze,e);return Ze}function $h(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,qr,2)),e.message}function zh(e){this._zod.message=e}var Nh={get:$h,set:zh,enumerable:!0,configurable:!0},Hn={value:void 0,enumerable:!1},ma=new WeakSet([Object.prototype,Error.prototype]),ga=(e,t)=>{e.name="$ZodError",Hn.value=t,Object.defineProperty(e,"issues",Hn),Hn.value=void 0,Object.defineProperty(e,"message",Nh);let r=Object.getPrototypeOf(e);if(!ma.has(r))ma.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})}})},ya=L("$ZodError",ga),eS=L("$ZodError",ga,void 0,{Parent:Error});function Mh(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 va(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)Mh(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Sa(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((c)=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;while(u<c.length){let l=c[u],f=u===c.length-1;if(l==="_errors"){if(f)a._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,l))Object.defineProperty(a,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=a[l];if(f)m._errors.push(t(i));a=m,u++}}}};return o(e),r}function Do(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Uo=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new at;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map((u)=>it(u,i,Ge())));throw jn(a,s?.callee??t),a}return c.value};return t};var Zo=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map((u)=>it(u,i,Ge())));throw jn(a,s?.callee??t),a}return c.value};return t};var Vo=(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?ba(e,s.issues,n):{success:!0,data:s.value}};function ba(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>it(n,r,Ge()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Fo=(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?ba(e,s.issues,n):{success:!0,data:s.value}};var jh=Symbol.for("zod.compile.invalid"),qh=Symbol.for("zod.compile.fallback"),Jn=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==jh)return!0;if(o.definite===!0&&r===void 0)return!1}return Lh(e,t,r)};function Lh(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[qh]=!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 Bn=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},wa=(e)=>{let t=Uo(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,Do(r,i))};return r};var $a=(e)=>{let t=Uo(e),r=(o,n,s,i)=>t(o,n,s,Do(r,i));return r};var Ra=(e)=>{let t=Zo(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Do(r,i))};return r};var za=(e)=>{let t=Zo(e),r=async(o,n,s,i)=>await t(o,n,s,Do(r,i));return r};var Pa=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Vo(e)(t,r,n)};var Ea=(e)=>(t,r,o)=>Vo(e)(t,r,o);var Ta=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Fo(e)(t,r,n)};var ka=(e)=>async(t,r,o)=>Fo(e)(t,r,o);var Ca=/^[cC][0-9a-z]{6,}$/,Ia=/^[0-9a-z]+$/,Oa=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Na=/^[0-9a-vA-V]{20}$/,xa=/^[A-Za-z0-9]{27}$/,Aa=/^[a-zA-Z0-9_-]{21}$/;function Ma(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ja=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var qa=/^([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})$/,Gn=(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 La=/^(?:[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 Uh="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Da(){return new RegExp(Uh,"u")}var Ua=/^(?:(?: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])$/,Za=/^(([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 Va=/^((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])$/,Fa=/^(([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])$/,Ha=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ja=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Ba=/^https?$/,Ka=/^\+[1-9]\d{6,14}$/;var Ga="(?:(?:\\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 Zh(e){return new RegExp(`^${e}$`)}var Wa=Zh(Ga);function Kn(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 Ya(e){return new RegExp(`^${Kn(e)}$`)}function Xa(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Kn({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Kn({precision:e.precision})}`:r;return new RegExp(`^${Ga}T(?:${o})$`)}var Qa=/^[\s\S]{0,}$/;var Wn=/^-?\d+$/,Zr=/^-?\d+(?:\.\d+)?$/,ec=/^(?:true|false)$/i,tc=/^null$/i;var rc=/^[^A-Z]*$/,oc=/^[^a-z]*$/;var Me=L("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Yn=(e)=>{let t=e.value;return!Wi(t)&&t.length!==void 0},Ho={number:"number",bigint:"bigint",object:"date"},Xn=L("$ZodCheckLessThan",(e,t)=>{Me.init(e,t);let r=Ho[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ho[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})}}),Qn=L("$ZodCheckGreaterThan",(e,t)=>{Me.init(e,t);let r=Ho[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ho[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})}}),nc=L("$ZodCheckMultipleOf",(e,t)=>{Me.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):Yi(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})}}),sc=L("$ZodCheckNumberFormat",(e,t)=>{Me.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=xo[t.format];e._zod.check=(i)=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>s)i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var ic=L("$ZodCheckMaxLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Yn),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?jo(n):s)<=t.maximum)return;let c=qo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ac=L("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Yn),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?jo(n):s)>=t.minimum)return;let c=qo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cc=L("$ZodCheckLengthEquals",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Yn),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?jo(n):s;if(i===t.length)return;let c=qo(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Fr=L("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Me.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=()=>{})}),uc=L("$ZodCheckRegex",(e,t)=>{Fr.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})}}),lc=L("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rc),Fr.init(e,t)}),dc=L("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oc),Fr.init(e,t)}),fc=L("$ZodCheckIncludes",(e,t)=>{Me.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{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})}}),hc=L("$ZodCheckStartsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`^${St(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})}}),pc=L("$ZodCheckEndsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`.*${St(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 mc=L("$ZodCheckOverwrite",(e,t)=>{Me.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class es{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(`
|
|
2
|
+
import{Sv,cs,fu,Oa,Ir,Mh,mp,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}from"./chunk-6hrj3jt6.js";import{R7}from"./chunk-xcqzwf9j.js";var{create:Xf,defineProperty:Io,getOwnPropertyDescriptor:Qf,getOwnPropertyNames:eh,getPrototypeOf:th}=Object,rh=Object.prototype.hasOwnProperty,V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Di=(e,t)=>{let r={};for(var o in e)Io(r,o,{get:e[o],enumerable:!0});if(t)Io(r,Symbol.toStringTag,{value:"Module"});return r},oh=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=eh(t),s=0,i=n.length,c;s<i;s++)if(c=n[s],!rh.call(e,c)&&c!==r)Io(e,c,{get:((a)=>t[a]).bind(null,c),enumerable:!(o=Qf(t,c))||o.enumerable})}return e},Oo=(e,t,r)=>(r=e!=null?Xf(th(e)):{},oh(t||!e||!e.__esModule?Io(r,"default",{value:e,enumerable:!0}):r,e));var nh=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ui=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),sh=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),ih=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Zi(e){return typeof e==="string"&&Ui.has(e.replace(/#$/,""))}function Fi(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(nh.has(r))return"2020-12";if(Ui.has(r))return"2019-09";if(sh.has(r)||ih.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 jr(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 Mn(e,t="|"){return e.map((r)=>Ln(r)).join(t)}function qr(e,t){if(typeof t==="bigint")return t.toString();return t}class Ji{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 Lr(e){return new Ji(e)}function Bi(e){return e===null||e===void 0}function No(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ki(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 Hi=Symbol("evaluating");function Gi(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Hi)return;if(o===void 0)o=Hi,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Be(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Dr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function lt(e){return Dr(e._zod.def)??e._zod.def.shape}function Yi(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Be(this,t,o),o},enumerable:!0,configurable:!0})}function Xi(e,t,r){if(t in e)Be(e,t,r);else e[t]=r}function At(e,t,r,o){let n=lt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)Yi(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c});else Xi(e,s,o?o(i.value,s):i.value)}}function ah(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)Yi(e,r,()=>t[r]);else Xi(e,r,o.value)}}function Ke(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Qi(e){return JSON.stringify(e)}function ea(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var jn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ta=Lr(()=>{if(Ze.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Mt(e){if(Yt(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(Yt(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function qn(e){if(Mt(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 ra=new Set(["string","number","symbol"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function re(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 Ln(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function na(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xo=(()=>({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]}))(),Dn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ch(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 At(s,e,Ao(e,t)),nt(e,Ke(r,{shape:s,checks:[]}))}function Ao(e,t){let r=lt(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 uh(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(Ao(e,t)),i={};return At(i,e,Reflect.ownKeys(lt(e)).filter((c)=>!s.has(c))),nt(e,Ke(r,{shape:i,checks:[]}))}function lh(e,t){if(!Mt(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=lt(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 nt(e,Ke(e._zod.def,{shape:ia(e,t)}))}function ia(e,t){let r={};return At(r,e,Reflect.ownKeys(lt(e))),ah(r,t),r}function dh(e,t){if(!Mt(t))throw Error("Invalid input to safeExtend: expected a plain object");return nt(e,Ke(e._zod.def,{shape:ia(e,t)}))}function fh(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={};At(r,e,Reflect.ownKeys(lt(e))),At(r,t,Reflect.ownKeys(lt(t)));let o=Ke(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return nt(e,o)}function aa(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 c=r?new Set(Ao(t,r)):void 0,a={};return At(a,t,Reflect.ownKeys(lt(t)),e&&((u,l)=>c&&!c.has(l)?u:new e({type:"optional",innerType:u}))),nt(t,Ke(t._zod.def,{shape:a,checks:[]}))}function hh(e,t,r){let o=r?new Set(Ao(t,r)):void 0,n={};return At(n,t,Reflect.ownKeys(lt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),nt(t,Ke(t._zod.def,{shape:n}))}function st(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 ca(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function bt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Mr(e){return typeof e==="string"?e:e?.message}function Un(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 Mo(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function it(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:Mr(e.inst?._zod.def?.error?.(e))??Mr(s?.(e))??Mr(t?.error?.(e))??Mr(r.customError?.(e))??Mr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=i,t?.reportInput)c.input=e.input;return c}var ph=/[\uD800-\uDBFF]/;function jo(e){let t=e.length;if(!ph.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 qo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ua(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 jt(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function la(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else mh(e,r,o.value)}}function dt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Lo(e,t,r){return dt(e,t,r,!1)}function da(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return dt(this,r,o(this))},set(n){dt(this,r,n)}})}return t}function mh(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:dt(this,t,r.bind(this))},set(o){dt(this,t,o)}})}function gh(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var An,vt=!1,_h={configurable:!0,get(){vt=!0;return}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&An!==e._zod){An=void 0;return}An=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,_h);let n=vt;vt=!1;try{let s=r(this);if(vt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return vt=vt||n,s}catch(s){throw delete this[t],vt=vt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function yh(e,t,r,o){let n=gh(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 vh="~constantCatch";function fa(e){let t=()=>e;return t[vh]=!0,t}var ha;var Zn={value:void 0,enumerable:!1},pa="captureStackTrace"in Error?Error:null;function Sh(e){let t=pa;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return pa=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=f,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(m,v){if(!m._zod){Zn.value=new s(v);try{Object.defineProperty(m,"_zod",Zn)}finally{Zn.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,v),c){let b=Object.getPrototypeOf(m),R=m._zod.constr.prototype,p=b;while(p&&p!==R)p=Object.getPrototypeOf(p);let T=p??b;if(!c.has(T))c.add(T),la(T,i)}let g=f.prototype;for(let b in g){if(!Object.prototype.hasOwnProperty.call(g,b))continue;if(!(b in m))m[b]=g[b].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(m){let v=o?.Parent?Sh(l):this;a(v,m);let g=v._zod.deferred;if(g){for(let R of g)R();v._zod.deferred=void 0}let b=globalThis.__zod_globalConfig?.postProcessor;if(b)b(v);return v}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class at extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ur extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(ha=globalThis).__zod_globalConfig??(ha.__zod_globalConfig={});var Ze=globalThis.__zod_globalConfig;function Ge(e){if(e)Object.assign(Ze,e);return Ze}function bh(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,qr,2)),e.message}function wh(e){this._zod.message=e}var Rh={get:bh,set:wh,enumerable:!0,configurable:!0},Fn={value:void 0,enumerable:!1},ma=new WeakSet([Object.prototype,Error.prototype]),ga=(e,t)=>{e.name="$ZodError",Fn.value=t,Object.defineProperty(e,"issues",Fn),Fn.value=void 0,Object.defineProperty(e,"message",Rh);let r=Object.getPrototypeOf(e);if(!ma.has(r))ma.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})}})},_a=L("$ZodError",ga),Fv=L("$ZodError",ga,void 0,{Parent:Error});function Ph(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 ya(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)Ph(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function va(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((c)=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;while(u<c.length){let l=c[u],f=u===c.length-1;if(l==="_errors"){if(f)a._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,l))Object.defineProperty(a,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=a[l];if(f)m._errors.push(t(i));a=m,u++}}}};return o(e),r}function Do(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Uo=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new at;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map((u)=>it(u,i,Ge())));throw jn(a,s?.callee??t),a}return c.value};return t};var Zo=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map((u)=>it(u,i,Ge())));throw jn(a,s?.callee??t),a}return c.value};return t};var Vo=(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?Sa(e,s.issues,n):{success:!0,data:s.value}};function Sa(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>it(n,r,Ge()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Fo=(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?Sa(e,s.issues,n):{success:!0,data:s.value}};var Eh=Symbol.for("zod.compile.invalid"),Th=Symbol.for("zod.compile.fallback"),Hn=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==Eh)return!0;if(o.definite===!0&&r===void 0)return!1}return kh(e,t,r)};function kh(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[Th]=!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 Jn=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},ba=(e)=>{let t=Uo(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,Do(r,i))};return r};var wa=(e)=>{let t=Uo(e),r=(o,n,s,i)=>t(o,n,s,Do(r,i));return r};var $a=(e)=>{let t=Zo(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Do(r,i))};return r};var Ra=(e)=>{let t=Zo(e),r=async(o,n,s,i)=>await t(o,n,s,Do(r,i));return r};var za=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Vo(e)(t,r,n)};var Pa=(e)=>(t,r,o)=>Vo(e)(t,r,o);var Ea=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Fo(e)(t,r,n)};var Ta=(e)=>async(t,r,o)=>Fo(e)(t,r,o);var ka=/^[cC][0-9a-z]{6,}$/,Ca=/^[0-9a-z]+$/,Ia=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Na=/^[0-9a-vA-V]{20}$/,xa=/^[A-Za-z0-9]{27}$/,Aa=/^[a-zA-Z0-9_-]{21}$/;function Ma(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ja=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var qa=/^([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})$/,Kn=(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 La=/^(?:[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 Ch="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Da(){return new RegExp(Ch,"u")}var Ua=/^(?:(?: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])$/,Za=/^(([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 Va=/^((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])$/,Fa=/^(([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])$/,Ha=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ja=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Ba=/^https?$/,Ka=/^\+[1-9]\d{6,14}$/;var Ga="(?:(?:\\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 Ih(e){return new RegExp(`^${e}$`)}var Wa=Ih(Ga);function Bn(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 Ya(e){return new RegExp(`^${Bn(e)}$`)}function Xa(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Bn({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Bn({precision:e.precision})}`:r;return new RegExp(`^${Ga}T(?:${o})$`)}var Qa=/^[\s\S]{0,}$/;var Gn=/^-?\d+$/,Zr=/^-?\d+(?:\.\d+)?$/,ec=/^(?:true|false)$/i,tc=/^null$/i;var rc=/^[^A-Z]*$/,oc=/^[^a-z]*$/;var Me=L("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Wn=(e)=>{let t=e.value;return!Bi(t)&&t.length!==void 0},Ho={number:"number",bigint:"bigint",object:"date"},Yn=L("$ZodCheckLessThan",(e,t)=>{Me.init(e,t);let r=Ho[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ho[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})}}),Xn=L("$ZodCheckGreaterThan",(e,t)=>{Me.init(e,t);let r=Ho[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ho[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})}}),nc=L("$ZodCheckMultipleOf",(e,t)=>{Me.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):Ki(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})}}),sc=L("$ZodCheckNumberFormat",(e,t)=>{Me.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=xo[t.format];e._zod.check=(i)=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(c<n)i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>s)i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var ic=L("$ZodCheckMaxLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Wn),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?jo(n):s)<=t.maximum)return;let c=qo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ac=L("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Wn),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?jo(n):s)>=t.minimum)return;let c=qo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cc=L("$ZodCheckLengthEquals",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=Wn),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?jo(n):s;if(i===t.length)return;let c=qo(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Fr=L("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Me.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=()=>{})}),uc=L("$ZodCheckRegex",(e,t)=>{Fr.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})}}),lc=L("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rc),Fr.init(e,t)}),dc=L("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oc),Fr.init(e,t)}),fc=L("$ZodCheckIncludes",(e,t)=>{Me.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{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})}}),hc=L("$ZodCheckStartsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`^${St(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})}}),pc=L("$ZodCheckEndsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`.*${St(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 mc=L("$ZodCheckOverwrite",(e,t)=>{Me.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Qn{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
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
4
|
${t.join(`
|
|
5
5
|
`)}
|
|
6
|
-
};`)(...Object.values(this.closed))}}var _c={major:4,minor:6,patch:7};var ze=L("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_c;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(c,a,u)=>{if(c.memo)return c;let l=st(c),f;for(let m of a){if(m._zod.def.when){if(ca(c))continue;if(!m._zod.def.when(c))continue}else if(l)continue;let v=c.issues.length,g=m._zod.check(c);if(g instanceof Promise&&u?.async===!1)throw new at;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await g,c.issues.length===v)return;if(Mo(c.issues,v,e),!l)l=st(c,v)});else{if(c.issues.length===v)continue;if(Mo(c.issues,v,e),!l)l=st(c,v)}}if(f)return f.then(()=>c);return c},i=(c,a,u)=>{if(st(c))return c.aborted=!0,c;let l=s(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new at;return l.then((f)=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>i(f,c,a));return i(l,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new at;return u.then((l)=>s(l,n,a))}return s(u,n,a)}}},{get "~standard"(){return Lo(this,"~standard",rs(this))},set "~standard"(e){dt(this,"~standard",e)}}),Tc=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>it(r,t,Ge()))}:{value:e.value};async function Vh(e,t){let r={async:!0};return Tc(await e._zod.run({value:t,issues:[]},r),r)}function rs(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Tc(o,r)}catch(o){}return Vh(e,t)},vendor:"zod",version:1}}var Go=L("$ZodString",(e,t)=>{ze.init(e,t),e._zod.pattern=t.pattern??Qa,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}}),Te=L("$ZodStringFormat",(e,t)=>{Fr.init(e,t),Go.init(e,t)}),kc=L("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qa),Te.init(e,t)}),Cc=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=Gn(o))}else t.pattern??(t.pattern=Gn());Te.init(e,t)}),Ic=L("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=La),Te.init(e,t)}),Oc=1,Bo=2;function Nc(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Fh(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Nc(e)||Bo;return Hh(e,t)}function Hh(e,t){if(!t.normalize&&t.protocol?.source===Ba.source&&!/^https?:\/\//i.test(e))return Oc;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Bo}return new URL(e)}catch{return Bo}}var Jh=/[\t\n\r]/g;function yc(e){return e.replace(Jh,"")}function Bh(e,t){return t.lastIndex=0,t.test(e.hostname)}function Kh(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var xc=L("$ZodURL",(e,t)=>{Te.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=Fh(o,t);if(n===Oc){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Bo){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=yc(o);return}if(t.hostname&&!Bh(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&&!Kh(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:yc(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ac=L("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Da()),Te.init(e,t)}),Mc=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?Aa:Ma(t.length)),Te.init(e,t)}),jc=L("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ca),Te.init(e,t)}),qc=L("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ia),Te.init(e,t)}),Lc=L("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Oa),Te.init(e,t)}),Dc=L("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Na),Te.init(e,t)}),Uc=L("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xa),Te.init(e,t)}),Zc=L("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xa(t)),Te.init(e,t)}),Vc=L("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wa),Te.init(e,t)}),Fc=L("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ya(t)),Te.init(e,t)}),Hc=L("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ja),Te.init(e,t)}),Jc=L("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ua),Te.init(e,t)}),Gh=/^[0-9a-fA-F:.]+$/;function Bc(e){if(!Gh.test(e))return!1;return Nc(`http://[${e}]`)}var Kc=L("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Za),Te.init(e,t),e._zod.check=(r)=>{if(!Bc(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Gc=L("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Va),Te.init(e,t)});function Wh(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 Bc(r)}var Wc=L("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Fa),Te.init(e,t),e._zod.check=(r)=>{if(!Wh(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Yc(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 os=/^[0-9a-zA-Z+/]*={0,2}$/,Xc=L("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=os),Te.init(e,t),e._zod.check=(r)=>{if(Yc(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Wo=/^[A-Za-z0-9_-]*$/;function Yh(e){if(!Wo.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yc(r)}var Qc=L("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wo),Te.init(e,t),e._zod.check=(r)=>{if(Yh(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),eu=L("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ka),Te.init(e,t)});function Xh(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 tu=L("$ZodJWT",(e,t)=>{Te.init(e,t),e._zod.check=(r)=>{if(Xh(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var ns=L("$ZodNumber",(e,t)=>{ze.init(e,t),e._zod.pattern=Zr,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}}),ru=L("$ZodNumberFormat",(e,t)=>{sc.init(e,t),ns.init(e,t)}),ou=L("$ZodBoolean",(e,t)=>{ze.init(e,t),e._zod.pattern=ec,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 nu=L("$ZodNull",(e,t)=>{ze.init(e,t),e._zod.pattern=tc,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 su=L("$ZodUnknown",(e,t)=>{ze.init(e,t),e._zod.parse=(r)=>r}),au=L("$ZodNever",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Qh(e,t){let r=Un(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let c=t(s.value);if(c>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[a,u]of Un(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Mo(s.issues,l,e),s}}return n(s,i)}}var tp=(e)=>Array.isArray(e)?e.length:-1;function vc(e,t,r){if(e.issues.length)t.issues.push(...bt(r,e.issues));t.value[r]=e.value}var cu=L("$ZodArray",(e,t)=>{ze.init(e,t);let r=Ze.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],c=n?.abortEarly;for(let a=0;a<s.length;a++){let u=s[a],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((f)=>vc(f,o,a)));else if(vc(l,o,a),c&&l.issues.length!==0&&st(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},Qh(e,tp)});function Ko(e,t,r,o,n,s){let i=r in o,c=s==="optional";if(!i&&c&&n==="optional")return;if(e.issues.length){if(n!==void 0&&c&&!i)return;t.issues.push(...bt(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"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var rp=[];function uu(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:rp,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=sa(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function lu(e,t,r,o,n,s,i){let c=[],a=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:f,optout:m}=u,v=0;for(let g in t){if(i&&r.issues.length!==v){if(st(r,v))break;v=r.issues.length}if(a.has(g))continue;if(g==="__proto__"){if(l==="never")c.push(g);continue}if(l==="never"){c.push(g);continue}let b=u.run({value:t[g],issues:[]},o);if(b instanceof Promise)e.push(b.then((R)=>Ko(R,r,g,t,f,m)));else Ko(b,r,g,t,f,m)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var op=L("$ZodObject",(e,t)=>{ze.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=Lr(()=>uu(t));ge(e,"propValues",(u)=>{let l=u.def.shape,f={};for(let m in l){let v=l[m]._zod;if(v.values){if(!Object.prototype.hasOwnProperty.call(f,m))Be(f,m,new Set);for(let g of v.values)f[m].add(g);if(v.optin!==void 0)f[m].add(void 0)}}return f});let s=Yt,i=t.catchall,c,a=Ze.memoizer;a?.attach(e),e._zod.parse=(u,l)=>{c??(c=n.value);let f=u.value;if(!s(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},l):{};let m=[],v=c.shape,g=l?.abortEarly,b=u.issues.length;for(let R of c.allKeys){if(g&&u.issues.length!==b){if(st(u,b))break;b=u.issues.length}if(R==="__proto__")continue;let p=v[R],T=p._zod.optin,w=p._zod.optout,E=p._zod.run({value:f[R],issues:[]},l);if(E instanceof Promise)m.push(E.then((N)=>Ko(N,u,R,f,T,w)));else Ko(E,u,R,f,T,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return lu(m,f,u,l,n.value,e,g===!0)}}),du=L("$ZodObjectJIT",(e,t)=>{op.init(e,t);let r=e._zod.parse,o=Lr(()=>uu(t)),n=Ze.memoizer,s=(v)=>{let g=o.value,b=g.symbolKeys,R=new es(["payload","ctx"],{shape:v,inst:e,memo:n,syms:b}),p=(N)=>`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`,T=(N,z)=>`
|
|
6
|
+
};`)(...Object.values(this.closed))}}var _c={major:4,minor:6,patch:7};var ze=L("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_c;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(c,a,u)=>{if(c.memo)return c;let l=st(c),f;for(let m of a){if(m._zod.def.when){if(ca(c))continue;if(!m._zod.def.when(c))continue}else if(l)continue;let v=c.issues.length,g=m._zod.check(c);if(g instanceof Promise&&u?.async===!1)throw new at;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await g,c.issues.length===v)return;if(Mo(c.issues,v,e),!l)l=st(c,v)});else{if(c.issues.length===v)continue;if(Mo(c.issues,v,e),!l)l=st(c,v)}}if(f)return f.then(()=>c);return c},i=(c,a,u)=>{if(st(c))return c.aborted=!0,c;let l=s(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new at;return l.then((f)=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>i(f,c,a));return i(l,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new at;return u.then((l)=>s(l,n,a))}return s(u,n,a)}}},{get "~standard"(){return Lo(this,"~standard",ts(this))},set "~standard"(e){dt(this,"~standard",e)}}),Tc=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>it(r,t,Ge()))}:{value:e.value};async function Oh(e,t){let r={async:!0};return Tc(await e._zod.run({value:t,issues:[]},r),r)}function ts(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Tc(o,r)}catch(o){}return Oh(e,t)},vendor:"zod",version:1}}var Go=L("$ZodString",(e,t)=>{ze.init(e,t),e._zod.pattern=t.pattern??Qa,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}}),Te=L("$ZodStringFormat",(e,t)=>{Fr.init(e,t),Go.init(e,t)}),kc=L("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qa),Te.init(e,t)}),Cc=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=Kn(o))}else t.pattern??(t.pattern=Kn());Te.init(e,t)}),Ic=L("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=La),Te.init(e,t)}),Oc=1,Bo=2;function Nc(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function xh(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Nc(e)||Bo;return Ah(e,t)}function Ah(e,t){if(!t.normalize&&t.protocol?.source===Ba.source&&!/^https?:\/\//i.test(e))return Oc;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Bo}return new URL(e)}catch{return Bo}}var jh=/[\t\n\r]/g;function yc(e){return e.replace(jh,"")}function Dh(e,t){return t.lastIndex=0,t.test(e.hostname)}function Zh(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var xc=L("$ZodURL",(e,t)=>{Te.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=xh(o,t);if(n===Oc){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Bo){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=yc(o);return}if(t.hostname&&!Dh(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&&!Zh(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:yc(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ac=L("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Da()),Te.init(e,t)}),Mc=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?Aa:Ma(t.length)),Te.init(e,t)}),jc=L("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ka),Te.init(e,t)}),qc=L("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ca),Te.init(e,t)}),Lc=L("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ia),Te.init(e,t)}),Dc=L("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Na),Te.init(e,t)}),Uc=L("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xa),Te.init(e,t)}),Zc=L("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xa(t)),Te.init(e,t)}),Vc=L("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wa),Te.init(e,t)}),Fc=L("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ya(t)),Te.init(e,t)}),Hc=L("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ja),Te.init(e,t)}),Jc=L("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ua),Te.init(e,t)}),Jh=/^[0-9a-fA-F:.]+$/;function Bc(e){if(!Jh.test(e))return!1;return Nc(`http://[${e}]`)}var Kc=L("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Za),Te.init(e,t),e._zod.check=(r)=>{if(!Bc(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Gc=L("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Va),Te.init(e,t)});function Kh(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 Bc(r)}var Wc=L("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Fa),Te.init(e,t),e._zod.check=(r)=>{if(!Kh(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Yc(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 rs=/^[0-9a-zA-Z+/]*={0,2}$/,Xc=L("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rs),Te.init(e,t),e._zod.check=(r)=>{if(Yc(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Wo=/^[A-Za-z0-9_-]*$/;function Gh(e){if(!Wo.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yc(r)}var Qc=L("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wo),Te.init(e,t),e._zod.check=(r)=>{if(Gh(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),eu=L("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ka),Te.init(e,t)});function Yh(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 tu=L("$ZodJWT",(e,t)=>{Te.init(e,t),e._zod.check=(r)=>{if(Yh(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var os=L("$ZodNumber",(e,t)=>{ze.init(e,t),e._zod.pattern=Zr,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}}),ru=L("$ZodNumberFormat",(e,t)=>{sc.init(e,t),os.init(e,t)}),ou=L("$ZodBoolean",(e,t)=>{ze.init(e,t),e._zod.pattern=ec,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 nu=L("$ZodNull",(e,t)=>{ze.init(e,t),e._zod.pattern=tc,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 su=L("$ZodUnknown",(e,t)=>{ze.init(e,t),e._zod.parse=(r)=>r}),iu=L("$ZodNever",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Xh(e,t){let r=Un(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let c=t(s.value);if(c>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[a,u]of Un(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Mo(s.issues,l,e),s}}return n(s,i)}}var Qh=(e)=>Array.isArray(e)?e.length:-1;function vc(e,t,r){if(e.issues.length)t.issues.push(...bt(r,e.issues));t.value[r]=e.value}var au=L("$ZodArray",(e,t)=>{ze.init(e,t);let r=Ze.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],c=n?.abortEarly;for(let a=0;a<s.length;a++){let u=s[a],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((f)=>vc(f,o,a)));else if(vc(l,o,a),c&&l.issues.length!==0&&st(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},Xh(e,Qh)});function Ko(e,t,r,o,n,s){let i=r in o,c=s==="optional";if(!i&&c&&n==="optional")return;if(e.issues.length){if(n!==void 0&&c&&!i)return;t.issues.push(...bt(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"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var ep=[];function cu(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:ep,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=na(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function uu(e,t,r,o,n,s,i){let c=[],a=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:f,optout:m}=u,v=0;for(let g in t){if(i&&r.issues.length!==v){if(st(r,v))break;v=r.issues.length}if(a.has(g))continue;if(g==="__proto__"){if(l==="never")c.push(g);continue}if(l==="never"){c.push(g);continue}let b=u.run({value:t[g],issues:[]},o);if(b instanceof Promise)e.push(b.then((R)=>Ko(R,r,g,t,f,m)));else Ko(b,r,g,t,f,m)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var tp=L("$ZodObject",(e,t)=>{ze.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=Lr(()=>cu(t));ge(e,"propValues",(u)=>{let l=u.def.shape,f={};for(let m in l){let v=l[m]._zod;if(v.values){if(!Object.prototype.hasOwnProperty.call(f,m))Be(f,m,new Set);for(let g of v.values)f[m].add(g);if(v.optin!==void 0)f[m].add(void 0)}}return f});let s=Yt,i=t.catchall,c,a=Ze.memoizer;a?.attach(e),e._zod.parse=(u,l)=>{c??(c=n.value);let f=u.value;if(!s(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},l):{};let m=[],v=c.shape,g=l?.abortEarly,b=u.issues.length;for(let R of c.allKeys){if(g&&u.issues.length!==b){if(st(u,b))break;b=u.issues.length}if(R==="__proto__")continue;let p=v[R],T=p._zod.optin,w=p._zod.optout,E=p._zod.run({value:f[R],issues:[]},l);if(E instanceof Promise)m.push(E.then((N)=>Ko(N,u,R,f,T,w)));else Ko(E,u,R,f,T,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return uu(m,f,u,l,n.value,e,g===!0)}}),lu=L("$ZodObjectJIT",(e,t)=>{tp.init(e,t);let r=e._zod.parse,o=Lr(()=>cu(t)),n=Ze.memoizer,s=(v)=>{let g=o.value,b=g.symbolKeys,R=new Qn(["payload","ctx"],{shape:v,inst:e,memo:n,syms:b}),p=(N)=>`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`,T=(N,z)=>`
|
|
7
7
|
let ${N}_ab = false;
|
|
8
8
|
for (let i = 0; i < ${N}.issues.length; i++) {
|
|
9
9
|
const iss = ${N}.issues[i];
|
|
@@ -14,7 +14,7 @@ ${t.join(`
|
|
|
14
14
|
if (${N}_ab && ctx && ctx.abortEarly) {
|
|
15
15
|
payload.value = newResult;
|
|
16
16
|
return payload;
|
|
17
|
-
}`;R.write("const input = payload.value;");let w=Object.create(null),E=0;for(let N of g.allKeys)w[N]=`key_${E++}`;R.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let N of g.allKeys){if(N==="__proto__")continue;let z=w[N],_=typeof N==="symbol"?`syms[${b.indexOf(N)}]`:
|
|
17
|
+
}`;R.write("const input = payload.value;");let w=Object.create(null),E=0;for(let N of g.allKeys)w[N]=`key_${E++}`;R.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let N of g.allKeys){if(N==="__proto__")continue;let z=w[N],_=typeof N==="symbol"?`syms[${b.indexOf(N)}]`:Qi(N),C=`${_} in input`,q=v[N],F=q?._zod?.optin,j=F!==void 0,Z=q?._zod?.optout==="optional";if(R.write(`const ${z} = ${p(_)};`),j&&Z){let G=F==="optional"?`${z}_present`:`${z}.value !== undefined || ${z}_present`;R.write(`
|
|
18
18
|
const ${z}_present = ${C};
|
|
19
19
|
if (!${z}.issues.length || ${z}_present) {
|
|
20
20
|
if (${z}.issues.length) {${T(z,_)}
|
|
@@ -53,19 +53,19 @@ ${t.join(`
|
|
|
53
53
|
if (${z}.value !== undefined || ${C}) {
|
|
54
54
|
newResult[${_}] = ${z}.value;
|
|
55
55
|
}
|
|
56
|
-
`)}return R.write("payload.value = newResult;"),R.write("return payload;"),R.compile()},i,c=Yt,a=!Ze.jitless,l=a&&oa.value,f=t.catchall,m;e._zod.parse=(v,g)=>{m??(m=o.value);let b=v.value;if(!c(b))return v.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),v;if(a&&l&&g?.async===!1&&g.jitless!==!0){if(!i)i=s(t.shape);if(v=i(v,g),!f)return v;return lu([],b,v,g,m,e,g?.abortEarly===!0)}return r(v,g)}});function Sc(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)=>!st(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)=>it(i,o,Ge())))}),t}var is=L("$ZodUnion",(e,t)=>{ze.init(e,t),ge(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),ge(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),ge(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),ge(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>No(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 c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}if(!s)return Sc(i,o,e,n);return Promise.all(i).then((c)=>Sc(c,o,e,n))}});function np(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 fu=L("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,is.init(e,t);let r=e._zod.parse;ge(e,"propValues",(n)=>{let s={},i=0;for(let c of n.def.options){let a=c._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(c)}"`);if(a[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(a)){if(!Object.prototype.hasOwnProperty.call(s,u))Be(s,u,new Set);for(let f of l)s[u].add(f)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=Dr(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Lr(()=>np(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Yt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=i?.[t.discriminator],a=o.value.get(c);if(a&&(c!==void 0||s.direction!=="backward"))return a._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}}),hu=L("$ZodIntersection",(e,t)=>{ze.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(([a,u])=>bc(r,a,u));return bc(r,s,i)}});function ts(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Mt(e)&&Mt(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=ts(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=ts(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 bc(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),f=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);f=[m]}else return!1;for(let m of f){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 c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of c)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let a=ts(t.value,r.value);if(!a.valid){if(st(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var pu=L("$ZodRecord",(e,t)=>{ze.init(e,t);let r=Ze.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Mt(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],c=t.keyType._zod.values;if(c&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let a=new Set;for(let l of c)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(a.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map((g)=>it(g,n,Ge())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let v=t.valueType._zod.run({value:s[l],issues:[]},n);if(v instanceof Promise)i.push(v.then((g)=>{if(g.issues.length)o.issues.push(...bt(l,g.issues));o.value[m]=g.value}));else{if(v.issues.length)o.issues.push(...bt(l,v.issues));o.value[m]=v.value}}let u;for(let l in s)if(!a.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 a;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"&&Zr.test(u)&&l.issues.length){let g=t.keyType._zod.run({value:Number(u),issues:[]},n);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)l=g}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(c)a=a??[],a.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((g)=>it(g,n,Ge())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let v=t.valueType._zod.run({value:s[u],issues:[]},n);if(v instanceof Promise)i.push(v.then((g)=>{if(g.issues.length)o.issues.push(...bt(u,g.issues));o.value[m]=g.value}));else{if(v.issues.length)o.issues.push(...bt(u,v.issues));o.value[m]=v.value}}if(a&&a.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var mu=L("$ZodEnum",(e,t)=>{ze.init(e,t);let r=jr(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",(n)=>{let s=jr(n.def.entries).filter((i)=>na.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>St(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),gu=L("$ZodLiteral",(e,t)=>{ze.init(e,t);let r=new Set(t.values);e._zod.values=r,ge(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?St(s):s?St(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var _u=L("$ZodTransform",(e,t)=>{ze.init(e,t),e._zod.optin="optional",Ze.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ur(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 wc(e,t){return e.value=t.issues.length?void 0:t.value,e}var as=L("$ZodOptional",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ge(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ge(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${No(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)=>wc(r,s));return wc(r,n)}return t.innerType._zod.run(r,o)}}),yu=L("$ZodExactOptional",(e,t)=>{as.init(e,t),ge(e,"values",(r)=>r.def.innerType._zod.values),ge(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),vu=L("$ZodNullable",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin),ge(e,"optout",(r)=>r.def.innerType._zod.optout),ge(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${No(o.source)}|null)$`):void 0}),ge(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Su=L("$ZodDefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>$c(s,t));return $c(n,t)}});function $c(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var bu=L("$ZodPrefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),wu=L("$ZodNonOptional",(e,t)=>{ze.init(e,t),ge(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Rc(s,e));return Rc(n,e)}});function Rc(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 zc(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)=>it(n,o,Ge()))},input:e.value}),e}var $u=L("$ZodCatch",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ge(e,"optout",(r)=>r.def.innerType._zod.optout),ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>zc(r,s,t,o));return zc(r,n,t,o)}});var cs=L("$ZodPipe",(e,t)=>{ze.init(e,t),ge(e,"values",(r)=>r.def.in._zod.values),ge(e,"optin",(r)=>r.def.in._zod.optin),ge(e,"optout",(r)=>r.def.out._zod.optout),ge(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>Jo(i,t.in,o));return Jo(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Jo(s,t.out,o));return Jo(n,t.out,o)}});function Jo(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 Ru=L("$ZodPreprocess",(e,t)=>{cs.init(e,t)}),zu=L("$ZodReadonly",(e,t)=>{ze.init(e,t),ge(e,"propValues",(r)=>r.def.innerType._zod.propValues),ge(e,"values",(r)=>r.def.innerType._zod.values),ge(e,"optin",(r)=>r.def.innerType?._zod?.optin),ge(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Pc);return Pc(n)}});function Pc(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Pu=L("$ZodLazy",(e,t)=>{ze.init(e,t),Xi(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),ge(e,"pattern",(r)=>r.innerType?._zod?.pattern),ge(e,"propValues",(r)=>r.innerType?._zod?.propValues),ge(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),ge(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Eu=L("$ZodCustom",(e,t)=>{Me.init(e,t),ze.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)=>Ec(s,r,o,e));Ec(n,r,o,e);return}});function Ec(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(jt(n))}}class ku extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var ls="~memo",Tu=[];function Cu(e){return e!==null&&typeof e==="object"}function us(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Iu=new WeakMap,Hr=0,Qo=1,Jr=2;function en(e,t,r){let o=Iu.get(e);if(o!==void 0)return o?Jr:Hr;if(t.has(e))return Jr;t.add(e);let n=Hr,s=(l)=>{if(n!==Jr&&l?._zod){let f=en(l,t,r);if(f>n)n=f}},i=(l,f)=>{let m=Hr;for(let v of Reflect.ownKeys(l)){let g=Object.getOwnPropertyDescriptor(l,v);if(f&&!g.enumerable)continue;let b=g.get?Qo:g.value?._zod?en(g.value,t,r):Hr;if(b>m)m=b}return m},c=(l)=>{if(l>n)n=l},a=e._zod.def,u=a.type;switch(u){case"object":{let l=Dr(a);c(l?i(l,!0):Qo),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(let l of a.items)s(l);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(let l of a.options)s(l);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{let l=a._cachedInner??(r?e._zod.innerType:void 0);c(l?en(l,t,!1):Qo);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 a){let f=Object.getOwnPropertyDescriptor(a,l);if(!f||f.get)continue;let m=f.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let v of m)s(v)}}return t.delete(e),sp(e,n)}function sp(e,t){if(t!==Qo)Iu.set(e,t===Jr);return t}function ip(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Yo,Xo=[],ap={alloc(e,t,r){let o=Yo;if(!o)return r;Yo=void 0;let n={value:r,issues:null};return o.set(t.value,n),Xo.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"&&cp(s,n.value))throw new ku;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,c=(a,u)=>{if(r===void 0){let p=en(e,new Set,!1);if(p===Hr){if(e._zod.parse=i,e._zod.run===c)e._zod.run=i;return i(a,u)}if(p===Jr||o)r=!0;else o=!0}let l=a.value;if(!Cu(l))return i(a,u);let f=u[ls];if(!f)f={buckets:new WeakMap,backEdges:void 0},u[ls]=f;let m;if(n===u)m=s;else m=ip(f,e),n=u,s=m;let v=m.get(l);if(v){if(a.value=v.value,v.issues){if(v.issues.length)a.issues.push(...us(v.issues))}else a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(v.value);return a}Yo=m;let g=Xo.length,b=i(a,u);Yo=void 0;let R=Xo.length>g?Xo.pop():void 0;if(b instanceof Promise)return b.then((p)=>{if(R)R.issues=p.issues.length?us(p.issues):Tu;return p});if(R)R.issues=b.issues.length?us(b.issues):Tu;return b};if(e._zod.parse=c,e._zod.run===i)e._zod.run=c})}};function Ou(){return ap}function cp(e,t){let r=e[ls]?.backEdges;return r!==void 0&&Cu(t)&&r.has(t)}var up=()=>{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),c=ua(s.input),a=n(c,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Ln(s.values[0])}`;return`Invalid option: expected one of ${Mn(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);if(c)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${c.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?">=":">",c=t(s.origin);if(c)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${c.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":""}: ${Mn(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((c)=>`'${c}'`).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 ds(){return{localeError:up()}}var Nu;class xu{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 xu}(Nu=globalThis).__zod_globalRegistry??(Nu.__zod_globalRegistry=lp());var qt=globalThis.__zod_globalRegistry;function Au(e){if(e.checks)e.checks=[...e.checks];return e}function Mu(e,t){return new e(Au({type:"string",...re(t)}))}function fs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function ju(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function qu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Lu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function Du(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function Uu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function hs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Zu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Vu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Fu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Hu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Ju(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Bu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Ku(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Gu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Wu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function Yu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function Xu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function el(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function rl(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function ol(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function nl(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function tn(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function rn(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function ps(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function ms(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function sl(e,t){return new e(Au({type:"number",checks:[],...re(t)}))}function il(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function al(e,t){return new e({type:"boolean",...re(t)})}function cl(e,t){return new e({type:"null",...re(t)})}function ul(e){return new e({type:"unknown"})}function ll(e,t){return new e({type:"never",...re(t)})}function on(e,t){return new Xn({check:"less_than",...re(t),value:e,inclusive:!1})}function Br(e,t){return new Xn({check:"less_than",...re(t),value:e,inclusive:!0})}function nn(e,t){return new Qn({check:"greater_than",...re(t),value:e,inclusive:!1})}function Kr(e,t){return new Qn({check:"greater_than",...re(t),value:e,inclusive:!0})}function sn(e,t){return new nc({check:"multiple_of",...re(t),value:e})}function an(e,t){return new ic({check:"max_length",...re(t),maximum:e})}function Xt(e,t){return new ac({check:"min_length",...re(t),minimum:e})}function cn(e,t){return new cc({check:"length_equals",...re(t),length:e})}function gs(e,t){return new uc({check:"string_format",format:"regex",...re(t),pattern:e})}function _s(e){return new lc({check:"string_format",format:"lowercase",...re(e)})}function ys(e){return new dc({check:"string_format",format:"uppercase",...re(e)})}function vs(e,t){return new fc({check:"string_format",format:"includes",...re(t),includes:e})}function Ss(e,t){return new hc({check:"string_format",format:"starts_with",...re(t),prefix:e})}function bs(e,t){return new pc({check:"string_format",format:"ends_with",...re(t),suffix:e})}function wt(e){return new mc({check:"overwrite",tx:e})}function ws(e){return wt((t)=>t.normalize(e))}function $s(){return wt((e)=>e.trim())}function Rs(){return wt((e)=>e.toLowerCase())}function zs(){return wt((e)=>e.toUpperCase())}function Ps(){return wt((e)=>ra(e))}function dl(e,t,r){return new e({type:"array",element:t,...re(r)})}function fl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function hl(e,t){let r=dp((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(jt(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(jt(s))}},e(o.value,o)),t);return r}function dp(e,t){let r=new Me({check:"custom",...re(t)});return r._zod.check=e,r}function Gr(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))Be(e,o,r[o]);return e}function Yr(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??qt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ae(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 Re(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 c=e._zod.toJSONSchema?.();if(c)i.schema=c;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,v=t.processors[n.type];if(!v)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);v(e,t,m,l)}let f=e._zod.parent;if(f){if(!i.ref)i.ref=f;Re(f,t,l),t.seen.get(f).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)Gr(i.schema,a);if(t.io==="input"&&De(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 pl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Xr(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 c=e.metadataRegistry.get(i[0])?.id;if(c){let a=o.get(c);if(a&&a!==i[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,i[0])}}let n=(i)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(i[0])?.id,m=e.external.uri??((g)=>g);if(f)return{ref:m(f)};let v=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=v,{defId:v,ref:`${m("__shared")}#/${c}/${pl(v)}`}}let a="#",u=`${a}/${c}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+pl(l)}},s=(i)=>{if(i[1].schema.$ref)return;let c=i[1],{ref:a,defId:u}=n(i);if(c.def={...c.schema},u)c.defId=u;let l=c.schema;for(let f in l)delete l[f];l.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
56
|
+
`)}return R.write("payload.value = newResult;"),R.write("return payload;"),R.compile()},i,c=Yt,a=!Ze.jitless,l=a&&ta.value,f=t.catchall,m;e._zod.parse=(v,g)=>{m??(m=o.value);let b=v.value;if(!c(b))return v.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),v;if(a&&l&&g?.async===!1&&g.jitless!==!0){if(!i)i=s(t.shape);if(v=i(v,g),!f)return v;return uu([],b,v,g,m,e,g?.abortEarly===!0)}return r(v,g)}});function Sc(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)=>!st(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)=>it(i,o,Ge())))}),t}var ns=L("$ZodUnion",(e,t)=>{ze.init(e,t),ge(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),ge(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),ge(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),ge(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>No(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 c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}if(!s)return Sc(i,o,e,n);return Promise.all(i).then((c)=>Sc(c,o,e,n))}});function rp(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 du=L("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ns.init(e,t);let r=e._zod.parse;ge(e,"propValues",(n)=>{let s={},i=0;for(let c of n.def.options){let a=c._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(c)}"`);if(a[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(a)){if(!Object.prototype.hasOwnProperty.call(s,u))Be(s,u,new Set);for(let f of l)s[u].add(f)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=Dr(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Lr(()=>rp(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Yt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=i?.[t.discriminator],a=o.value.get(c);if(a&&(c!==void 0||s.direction!=="backward"))return a._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}}),hu=L("$ZodIntersection",(e,t)=>{ze.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(([a,u])=>bc(r,a,u));return bc(r,s,i)}});function es(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Mt(e)&&Mt(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=es(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=es(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 bc(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),f=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);f=[m]}else return!1;for(let m of f){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 c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of c)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let a=es(t.value,r.value);if(!a.valid){if(st(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var pu=L("$ZodRecord",(e,t)=>{ze.init(e,t);let r=Ze.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Mt(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],c=t.keyType._zod.values;if(c&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let a=new Set;for(let l of c)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(a.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map((g)=>it(g,n,Ge())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let v=t.valueType._zod.run({value:s[l],issues:[]},n);if(v instanceof Promise)i.push(v.then((g)=>{if(g.issues.length)o.issues.push(...bt(l,g.issues));o.value[m]=g.value}));else{if(v.issues.length)o.issues.push(...bt(l,v.issues));o.value[m]=v.value}}let u;for(let l in s)if(!a.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 a;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"&&Zr.test(u)&&l.issues.length){let g=t.keyType._zod.run({value:Number(u),issues:[]},n);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)l=g}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(c)a=a??[],a.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((g)=>it(g,n,Ge())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let v=t.valueType._zod.run({value:s[u],issues:[]},n);if(v instanceof Promise)i.push(v.then((g)=>{if(g.issues.length)o.issues.push(...bt(u,g.issues));o.value[m]=g.value}));else{if(v.issues.length)o.issues.push(...bt(u,v.issues));o.value[m]=v.value}}if(a&&a.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var mu=L("$ZodEnum",(e,t)=>{ze.init(e,t);let r=jr(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",(n)=>{let s=jr(n.def.entries).filter((i)=>ra.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>St(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),gu=L("$ZodLiteral",(e,t)=>{ze.init(e,t);let r=new Set(t.values);e._zod.values=r,ge(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?St(s):s?St(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var _u=L("$ZodTransform",(e,t)=>{ze.init(e,t),e._zod.optin="optional",Ze.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ur(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 wc(e,t){return e.value=t.issues.length?void 0:t.value,e}var ss=L("$ZodOptional",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ge(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ge(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${No(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)=>wc(r,s));return wc(r,n)}return t.innerType._zod.run(r,o)}}),yu=L("$ZodExactOptional",(e,t)=>{ss.init(e,t),ge(e,"values",(r)=>r.def.innerType._zod.values),ge(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),vu=L("$ZodNullable",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin),ge(e,"optout",(r)=>r.def.innerType._zod.optout),ge(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${No(o.source)}|null)$`):void 0}),ge(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Su=L("$ZodDefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>$c(s,t));return $c(n,t)}});function $c(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var bu=L("$ZodPrefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),wu=L("$ZodNonOptional",(e,t)=>{ze.init(e,t),ge(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Rc(s,e));return Rc(n,e)}});function Rc(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 zc(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)=>it(n,o,Ge()))},input:e.value}),e}var $u=L("$ZodCatch",(e,t)=>{ze.init(e,t),ge(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ge(e,"optout",(r)=>r.def.innerType._zod.optout),ge(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>zc(r,s,t,o));return zc(r,n,t,o)}});var is=L("$ZodPipe",(e,t)=>{ze.init(e,t),ge(e,"values",(r)=>r.def.in._zod.values),ge(e,"optin",(r)=>r.def.in._zod.optin),ge(e,"optout",(r)=>r.def.out._zod.optout),ge(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>Jo(i,t.in,o));return Jo(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Jo(s,t.out,o));return Jo(n,t.out,o)}});function Jo(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 Ru=L("$ZodPreprocess",(e,t)=>{is.init(e,t)}),zu=L("$ZodReadonly",(e,t)=>{ze.init(e,t),ge(e,"propValues",(r)=>r.def.innerType._zod.propValues),ge(e,"values",(r)=>r.def.innerType._zod.values),ge(e,"optin",(r)=>r.def.innerType?._zod?.optin),ge(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Pc);return Pc(n)}});function Pc(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Pu=L("$ZodLazy",(e,t)=>{ze.init(e,t),Gi(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),ge(e,"pattern",(r)=>r.innerType?._zod?.pattern),ge(e,"propValues",(r)=>r.innerType?._zod?.propValues),ge(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),ge(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Eu=L("$ZodCustom",(e,t)=>{Me.init(e,t),ze.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)=>Ec(s,r,o,e));Ec(n,r,o,e);return}});function Ec(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(jt(n))}}class ku extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var us="~memo",Tu=[];function Cu(e){return e!==null&&typeof e==="object"}function as(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Iu=new WeakMap,Hr=0,Qo=1,Jr=2;function en(e,t,r){let o=Iu.get(e);if(o!==void 0)return o?Jr:Hr;if(t.has(e))return Jr;t.add(e);let n=Hr,s=(l)=>{if(n!==Jr&&l?._zod){let f=en(l,t,r);if(f>n)n=f}},i=(l,f)=>{let m=Hr;for(let v of Reflect.ownKeys(l)){let g=Object.getOwnPropertyDescriptor(l,v);if(f&&!g.enumerable)continue;let b=g.get?Qo:g.value?._zod?en(g.value,t,r):Hr;if(b>m)m=b}return m},c=(l)=>{if(l>n)n=l},a=e._zod.def,u=a.type;switch(u){case"object":{let l=Dr(a);c(l?i(l,!0):Qo),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(let l of a.items)s(l);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(let l of a.options)s(l);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{let l=a._cachedInner??(r?e._zod.innerType:void 0);c(l?en(l,t,!1):Qo);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 a){let f=Object.getOwnPropertyDescriptor(a,l);if(!f||f.get)continue;let m=f.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let v of m)s(v)}}return t.delete(e),op(e,n)}function op(e,t){if(t!==Qo)Iu.set(e,t===Jr);return t}function np(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Yo,Xo=[],sp={alloc(e,t,r){let o=Yo;if(!o)return r;Yo=void 0;let n={value:r,issues:null};return o.set(t.value,n),Xo.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"&&ip(s,n.value))throw new ku;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,c=(a,u)=>{if(r===void 0){let p=en(e,new Set,!1);if(p===Hr){if(e._zod.parse=i,e._zod.run===c)e._zod.run=i;return i(a,u)}if(p===Jr||o)r=!0;else o=!0}let l=a.value;if(!Cu(l))return i(a,u);let f=u[us];if(!f)f={buckets:new WeakMap,backEdges:void 0},u[us]=f;let m;if(n===u)m=s;else m=np(f,e),n=u,s=m;let v=m.get(l);if(v){if(a.value=v.value,v.issues){if(v.issues.length)a.issues.push(...as(v.issues))}else a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(v.value);return a}Yo=m;let g=Xo.length,b=i(a,u);Yo=void 0;let R=Xo.length>g?Xo.pop():void 0;if(b instanceof Promise)return b.then((p)=>{if(R)R.issues=p.issues.length?as(p.issues):Tu;return p});if(R)R.issues=b.issues.length?as(b.issues):Tu;return b};if(e._zod.parse=c,e._zod.run===i)e._zod.run=c})}};function Ou(){return sp}function ip(e,t){let r=e[us]?.backEdges;return r!==void 0&&Cu(t)&&r.has(t)}var ap=()=>{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),c=ua(s.input),a=n(c,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Ln(s.values[0])}`;return`Invalid option: expected one of ${Mn(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);if(c)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${c.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?">=":">",c=t(s.origin);if(c)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${c.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":""}: ${Mn(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((c)=>`'${c}'`).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 ls(){return{localeError:ap()}}var Nu;class xu{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 cp(){return new xu}(Nu=globalThis).__zod_globalRegistry??(Nu.__zod_globalRegistry=cp());var qt=globalThis.__zod_globalRegistry;function Au(e){if(e.checks)e.checks=[...e.checks];return e}function Mu(e,t){return new e(Au({type:"string",...re(t)}))}function ds(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function ju(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function qu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Lu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function Du(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function Uu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function fs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Zu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Vu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Fu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Hu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Ju(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Bu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Ku(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Gu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Wu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function Yu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function Xu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function Qu(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function el(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function tl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function rl(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function tn(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function rn(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function hs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function ps(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function ol(e,t){return new e(Au({type:"number",checks:[],...re(t)}))}function nl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function sl(e,t){return new e({type:"boolean",...re(t)})}function il(e,t){return new e({type:"null",...re(t)})}function al(e){return new e({type:"unknown"})}function ul(e,t){return new e({type:"never",...re(t)})}function on(e,t){return new Yn({check:"less_than",...re(t),value:e,inclusive:!1})}function Br(e,t){return new Yn({check:"less_than",...re(t),value:e,inclusive:!0})}function nn(e,t){return new Xn({check:"greater_than",...re(t),value:e,inclusive:!1})}function Kr(e,t){return new Xn({check:"greater_than",...re(t),value:e,inclusive:!0})}function sn(e,t){return new nc({check:"multiple_of",...re(t),value:e})}function an(e,t){return new ic({check:"max_length",...re(t),maximum:e})}function Xt(e,t){return new ac({check:"min_length",...re(t),minimum:e})}function cn(e,t){return new cc({check:"length_equals",...re(t),length:e})}function ms(e,t){return new uc({check:"string_format",format:"regex",...re(t),pattern:e})}function gs(e){return new lc({check:"string_format",format:"lowercase",...re(e)})}function _s(e){return new dc({check:"string_format",format:"uppercase",...re(e)})}function ys(e,t){return new fc({check:"string_format",format:"includes",...re(t),includes:e})}function vs(e,t){return new hc({check:"string_format",format:"starts_with",...re(t),prefix:e})}function Ss(e,t){return new pc({check:"string_format",format:"ends_with",...re(t),suffix:e})}function wt(e){return new mc({check:"overwrite",tx:e})}function bs(e){return wt((t)=>t.normalize(e))}function ws(){return wt((e)=>e.trim())}function $s(){return wt((e)=>e.toLowerCase())}function Rs(){return wt((e)=>e.toUpperCase())}function zs(){return wt((e)=>ea(e))}function ll(e,t,r){return new e({type:"array",element:t,...re(r)})}function dl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function fl(e,t){let r=up((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(jt(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(jt(s))}},e(o.value,o)),t);return r}function up(e,t){let r=new Me({check:"custom",...re(t)});return r._zod.check=e,r}function Gr(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))Be(e,o,r[o]);return e}function Yr(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??qt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ae(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 Re(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 c=e._zod.toJSONSchema?.();if(c)i.schema=c;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,v=t.processors[n.type];if(!v)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);v(e,t,m,l)}let f=e._zod.parent;if(f){if(!i.ref)i.ref=f;Re(f,t,l),t.seen.get(f).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)Gr(i.schema,a);if(t.io==="input"&&De(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 hl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Xr(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 c=e.metadataRegistry.get(i[0])?.id;if(c){let a=o.get(c);if(a&&a!==i[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,i[0])}}let n=(i)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(i[0])?.id,m=e.external.uri??((g)=>g);if(f)return{ref:m(f)};let v=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=v,{defId:v,ref:`${m("__shared")}#/${c}/${hl(v)}`}}let a="#",u=`${a}/${c}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+hl(l)}},s=(i)=>{if(i[1].schema.$ref)return;let c=i[1],{ref:a,defId:u}=n(i);if(c.def={...c.schema},u)c.defId=u;let l=c.schema;for(let f in l)delete l[f];l.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
57
57
|
|
|
58
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function _l(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;_l(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 yl=new Set(["type","properties","required","additionalProperties"]),ml=["oneOf","anyOf"];function gl(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 Es(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!yl.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let c=[];for(let u of t){let l=u.properties?.[i]??gl(u);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let a=c.length===1?c[0]:Es(c)??{allOf:c};Be(r,i,a)}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 c=gl(i);if(c&&!s.some((a)=>JSON.stringify(a)===JSON.stringify(c)))s.push(c)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function fp(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of yl)if(n in e)return;let r=t.filter((n)=>ml.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=Es(t);else{let n=r[0],s=ml.find((a)=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let i=t.filter((a)=>a!==n),c=n[s].map((a)=>Es([...i,a]));if(c.some((a)=>!a))return;o={[s]:c}}if(!o)return;delete e.allOf,Gr(e,o)}function Qr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(c)=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,l={...u},f=a.ref;if(a.ref=null,f){o(f);let v=e.seen.get(f),g=v.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(g);else Gr(u,g);if(Gr(u,l),c._zod.parent===f)for(let R in u){if(R==="$ref"||R==="allOf")continue;if(!(R in l))delete u[R]}if(g.$ref&&v.def)for(let R in u){if(R==="$ref"||R==="allOf")continue;if(R in v.def&&JSON.stringify(u[R])===JSON.stringify(v.def[R]))delete u[R]}}let m=c._zod.parent;if(m&&m!==f){o(m);let v=e.seen.get(m);if(v?.schema.$ref){if(u.$ref=v.schema.$ref,v.def)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(g in v.def&&JSON.stringify(u[g])===JSON.stringify(v.def[g]))delete u[g]}}}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())_l(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(u);else c.set(l,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])fp(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 c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Gr(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 c of e.seen.entries()){let a=c[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;Be(i,a.defId,a.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 c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Wr(t,"input",e.processors),output:Wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function De(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 De(o.element,r);if(o.type==="set")return De(o.valueType,r);if(o.type==="lazy")return De(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 De(o.innerType,r);if(o.type==="intersection")return De(o.left,r)||De(o.right,r);if(o.type==="record"||o.type==="map")return De(o.keyType,r)||De(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return De(o.in,r)||De(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(De(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(De(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(De(n,r))return!0;if(o.rest&&De(o.rest,r))return!0;return!1}return!1}var vl=(e,t={})=>(r)=>{let o=Yr({...r,processors:t});return Re(e,o),Xr(o,e),Qr(o,e)},Wr=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=Yr({...n??{},target:s,io:t,processors:r});return Re(e,i),Xr(i,e),Qr(i,e)};var Qt=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},er=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Sl=(e,t)=>{Qt(e,"minimum",t),er(e,"maximum",t)},zl=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Pl=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},El=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Tl=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},bl=(e,t)=>Qt(e,"minimum",t.minimum),wl=(e,t)=>er(e,"maximum",t.maximum),$l=(e)=>(t,r)=>{Tl(t,r.format);let[o,n]=e[r.format];Qt(t,"minimum",o),er(t,"maximum",n)},hp={greater_than:(e,t)=>Qt(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>er(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>zl(e,t.value),number_format:$l(xo),bigint_format:$l(Dn),min_length:bl,max_length:wl,length_equals:(e,t)=>Sl(e,t.length),min_size:bl,max_size:wl,size_equals:(e,t)=>Sl(e,t.size),string_format:(e,t)=>{if(Tl(e,t.format),t.pattern)Pl(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)=>El(e,t.mime)};function Ve(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)hp[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Qt(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Qt(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)er(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)er(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)zl(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)El(t,n.mime);for(let s of n.patterns??[])Pl(t,s);return t}var pp={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mp=new Map([[os,Ha],[Wo,Ja]]),kl=(e)=>mp.get(e)??e,Cs=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:l}=Ve(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(c){if(n.format=pp[c]??c,n.format==="")delete n.format;if(c==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(a&&a.size>0){let f=[...a].map(kl);if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Is=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:l}=Ve(e);n.type=l?"integer":"number";let f=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof a==="number"&&a<=(i??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(v)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(v)n.maximum=a,n.exclusiveMaximum=!0;else n.exclusiveMaximum=a;else if(typeof i==="number")n.maximum=i;if(c){let g=new Set;for(let p of c)if(Number.isFinite(p)&&p!==0)g.add(Math.abs(p));else Ae(e,t,n,o,`A multipleOf divisor of ${p} cannot be represented in JSON Schema`);let[b,...R]=g;if(b!==void 0)n.multipleOf=b;if(R.length)n.allOf=[...n.allOf??[],...R.map((p)=>({multipleOf:p}))]}},Os=(e,t,r,o)=>{r.type="boolean"},Cl=(e,t,r,o)=>{Ae(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Il=(e,t,r,o)=>{Ae(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Ns=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Ol=(e,t,r,o)=>{Ae(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Nl=(e,t,r,o)=>{Ae(e,t,r,o,"Void cannot be represented in JSON Schema")},xs=(e,t,r,o)=>{r.not={}},xl=(e,t,r,o)=>{},As=(e,t,r,o)=>{},Al=(e,t,r,o)=>{Ae(e,t,r,o,"Date cannot be represented in JSON Schema")},Ms=(e,t,r,o)=>{let n=e._zod.def,s=jr(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},js=(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(Ae(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Ae(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}},Ml=(e,t,r,o)=>{Ae(e,t,r,o,"NaN cannot be represented in JSON Schema")},jl=(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},ql=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=Ve(e);if(s!==void 0)n.minLength=s;if(i!==void 0)n.maxLength=i;if(!c)return;if(c.length===0)n.not={};else if(c.length===1)n.contentMediaType=c[0];else n.anyOf=c.map((a)=>({contentMediaType:a}))},Ll=(e,t,r,o)=>{r.type="boolean"},qs=(e,t,r,o)=>{Ae(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Dl=(e,t,r,o)=>{Ae(e,t,r,o,"Function types cannot be represented in JSON Schema")},Ls=(e,t,r,o)=>{Ae(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Ul=(e,t,r,o)=>{Ae(e,t,r,o,"Map cannot be represented in JSON Schema")},Zl=(e,t,r,o)=>{Ae(e,t,r,o,"Set cannot be represented in JSON Schema")},Ds=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=Ve(e);if(typeof i==="number")n.minItems=i;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=Re(s.element,t,{...o,path:[...o.path,"items"]})};function eo(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return eo(t.out);if(t.type==="catch")return eo(t.innerType);return e._zod.optin}var Us=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Ae(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)Be(n.properties,u,Re(i[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?eo(l)===void 0:l._zod.optout===void 0)a.push(u)}if(a.length>0)n.required=a;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=Re(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Vs=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,a)=>Re(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",a]}));if(s)r.oneOf=i;else r.anyOf=i},Fs=(e,t,r,o)=>{let n=e._zod.def,s=Re(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Re(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)},Vl=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((b,R)=>Re(b,t,{...o,path:[...o.path,i,R]})),u=s.rest?Re(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,l=s.items.length;while(l>0){let b=s.items[l-1];if(!(t.io==="input"?eo(b)!==void 0:b._zod.optout==="optional"))break;l--}let f=s.items.length,m=!s.rest;if(t.target==="draft-2020-12"){if(n.prefixItems=a,m)n.items=!1;else if(u)n.items=u;if(l>0)n.minItems=l;if(m)n.maxItems=f}else if(t.target==="openapi-3.0"){if(n.items={anyOf:a},u)n.items.anyOf.push(u);if(l>0)n.minItems=l;if(m)n.maxItems=f}else{if(n.items=a,m)n.additionalItems=!1;else if(u)n.additionalItems=u;if(l>0)n.minItems=l;if(m)n.maxItems=f}let{minimum:v,maximum:g}=Ve(e);if(typeof v==="number")n.minItems=v;if(typeof g==="number")n.maxItems=g};function Ts(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let b=Ts(e,g,r);return b===g?t:b}for(let g of["anyOf","oneOf"]){let b=t[g];if(!Array.isArray(b))continue;let R=b.map((p)=>Ts(e,p,r));if(R.some((p,T)=>p!==b[T]))t={...t,[g]:R}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((g)=>g==="number"||g==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((g)=>typeof g==="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:l,format:f,id:m,...v}=t;if(v.enum)v.enum=v.enum.map((g)=>typeof g==="number"?String(g):g);else if(typeof v.const==="number")v.const=String(v.const);if(!n)return v;if(v.type="string",!s)v.pattern=(o.includes("number")?Zr:Wn).source;return v}var ks=new WeakMap;function gp(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 ks.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Ts(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 Hs=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=Ve(i).patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Re(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of c)Be(n.patternProperties,kl(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Re(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=ks.get(t);if(!l)l=[],ks.set(t,l),t.deferred.push(()=>gp(t));l.push(e)}n.additionalProperties=Re(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&eo(s.valueType)!==void 0;if(a&&!s.partial&&!u){let l=[...a].filter((f)=>typeof f==="string"||typeof f==="number");if(l.length>0)n.required=l.map(String)}},Js=(e,t,r,o)=>{let n=e._zod.def,s=Re(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"}]},Bs=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Ks=Symbol();function Fl(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(c,a)=>{if(typeof a!=="bigint")return a;return s=!0,null});if(!s)return JSON.parse(i);return Ae(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Ks}var Gs=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=Fl(n.defaultValue,e,t,r,o);if(i!==Ks)r.default=i},Ws=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=Fl(n.defaultValue,e,t,r,o);if(i!==Ks)r._prefault=i},Ys=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Ae(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},Xs=(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;Re(i,t,o);let c=t.seen.get(e);c.ref=i},ei=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Hl=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},un=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},ti=(e,t,r,o)=>{let n=e._zod.innerType;Re(n,t,o);let s=t.seen.get(e);s.ref=n},Rl={string:Cs,number:Is,boolean:Os,bigint:Cl,symbol:Il,null:Ns,undefined:Ol,void:Nl,never:xs,any:xl,unknown:As,date:Al,enum:Ms,literal:js,nan:Ml,template_literal:jl,file:ql,success:Ll,custom:qs,function:Dl,transform:Ls,map:Ul,set:Zl,array:Ds,object:Us,union:Vs,intersection:Fs,tuple:Vl,record:Hs,nullable:Js,nonoptional:Bs,default:Gs,prefault:Ws,catch:Ys,pipe:Xs,readonly:ei,promise:Hl,optional:un,lazy:ti};function ln(e,t){if("_idmap"in e){let o=e,n=Yr({...t,processors:Rl}),s={};for(let a of o._idmap.entries()){let[u,l]=a;Re(l,n)}let i={},c={registry:o,uri:t?.uri,defs:s};n.external=c;for(let a of o._idmap.entries()){let[u,l]=a;Xr(n,l),Be(i,u,Qr(n,l))}if(Object.keys(s).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:s}}return{schemas:i}}let r=Yr({...t,processors:Rl});return Re(e,r),Xr(r,e),Qr(r,e)}var Jl=new WeakSet([Object.prototype,Error.prototype]);function dn(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 zp=(e,t)=>{ya.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Jl.has(r))return;Jl.add(r),dn(r,"format",(o)=>(n)=>Sa(o,n)),dn(r,"flatten",(o)=>(n)=>va(o,n)),dn(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,qr,2)}),dn(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,qr,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var We=L("ZodError",zp,void 0,{Parent:Error});var Bl=Uo(We),Kl=Zo(We),fn=Vo(We),Gl=Fo(We),Wl=wa(We),Yl=$a(We),Xl=Ra(We),Ql=za(We),ed=Pa(We),td=Ea(We),rd=Ta(We),od=ka(We);function Ep(){if(!Ze.localeError)Ge(ds())}function pn(){if(!Ze.memoizer)Ge({memoizer:Ou()})}var ke=L("ZodType",(e,t)=>(Ep(),ze.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ke(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 nt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_m(e,t))},superRefine(e,t){return this.check(Sm(e,t))},overwrite(e){return this.check(wt(e))},optional(){return he(this)},exactOptional(){return rm(this)},nullable(){return id(this)},nullish(){return he(id(this))},nonoptional(e){return cm(this,e)},array(){return W(this)},or(e){return ae([this,e])},and(e){return tr(this,e)},transform(e){return ad(this,yd(e))},default(e){return sm(this,e)},prefault(e){return am(this,e)},catch(e){return lm(this,e)},pipe(e){return ad(this,e)},readonly(){return hm(this)},describe(e){let t=this.clone();return qt.add(t,{description:e}),t},meta(...e){if(e.length===0)return qt.get(this);let t=this.clone();return qt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Lo(this,"~standard",{...rs(this),jsonSchema:{input:Wr(this,"input"),output:Wr(this,"output")}})},set "~standard"(e){dt(this,"~standard",e)},parse:function e(t,r){return Bl(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Kl(this,t,r,{callee:e})},safeParse(e,t){return fn(this,e,t)},async safeParseAsync(e,t){return Gl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){dt(this,"spa",e)},validate(e,t){return Jn(this,e,t)},validateAsync(e,t){return Bn(this,e,t)},encode:function e(t,r){return Wl(this,t,r,{callee:e})},decode:function e(t,r){return Yl(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Xl(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Ql(this,t,r,{callee:e})},safeEncode(e,t){return ed(this,e,t)},safeDecode(e,t){return td(this,e,t)},async safeEncodeAsync(e,t){return rd(this,e,t)},async safeDecodeAsync(e,t){return od(this,e,t)},toJSONSchema(e){return vl(this,{})(e)},get description(){return qt.get(this)?.description},get _def(){return this._zod.def}}),cd=L("_ZodString",(e,t)=>{Go.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n)},da({format:(e)=>Ve(e).format??null,minLength:(e)=>Ve(e).minimum??null,maxLength:(e)=>Ve(e).maximum??null},{regex(...e){return this.check(gs(...e))},includes(...e){return this.check(vs(...e))},startsWith(...e){return this.check(Ss(...e))},endsWith(...e){return this.check(bs(...e))},min(...e){return this.check(Xt(...e))},max(...e){return this.check(an(...e))},length(...e){return this.check(cn(...e))},nonempty(...e){return this.check(Xt(1,...e))},lowercase(e){return this.check(_s(e))},uppercase(e){return this.check(ys(e))},trim(){return this.check($s())},normalize(...e){return this.check(ws(...e))},toLowerCase(){return this.check(Rs())},toUpperCase(){return this.check(zs())},slugify(){return this.check(Ps())}})),Tp=L("ZodString",(e,t)=>{Go.init(e,t),cd.init(e,t)},{email(e){return this.check(fs(dd,e))},url(e){return this.check(hs(hd,e))},jwt(e){return this.check(nl(Fp,e))},emoji(e){return this.check(Zu(Cp,e))},guid(e){return this.check(ju(kp,e))},uuid(e){return this.check(qu(hn,e))},uuidv4(e){return this.check(Lu(hn,e))},uuidv6(e){return this.check(Du(hn,e))},uuidv7(e){return this.check(Uu(hn,e))},nanoid(e){return this.check(Vu(Ip,e))},cuid(e){return this.check(Fu(Op,e))},cuid2(e){return this.check(Hu(Np,e))},ulid(e){return this.check(Ju(xp,e))},base64(e){return this.check(el(Up,e))},base64url(e){return this.check(rl(Zp,e))},xid(e){return this.check(Bu(Ap,e))},ksuid(e){return this.check(Ku(Mp,e))},ipv4(e){return this.check(Gu(jp,e))},ipv6(e){return this.check(Wu(qp,e))},cidrv4(e){return this.check(Yu(Lp,e))},cidrv6(e){return this.check(Xu(Dp,e))},e164(e){return this.check(ol(Vp,e))},datetime(e){return this.check(tn(oi,e))},date(e){return this.check(rn(ni,e))},time(e){return this.check(ps(ud,e))},duration(e){return this.check(ms(ld,e))}});function P(e){return Mu(Tp,e)}var Ie=L("ZodStringFormat",(e,t)=>{Te.init(e,t),cd.init(e,t)}),oi=L("ZodISODateTime",(e,t)=>{Zc.init(e,t),Ie.init(e,t)}),ni=L("ZodISODate",(e,t)=>{Vc.init(e,t),Ie.init(e,t)}),ud=L("ZodISOTime",(e,t)=>{Fc.init(e,t),Ie.init(e,t)}),ld=L("ZodISODuration",(e,t)=>{Hc.init(e,t),Ie.init(e,t)}),dd=L("ZodEmail",(e,t)=>{Ic.init(e,t),Ie.init(e,t)});function fd(e){return fs(dd,e)}var kp=L("ZodGUID",(e,t)=>{kc.init(e,t),Ie.init(e,t)});var hn=L("ZodUUID",(e,t)=>{Cc.init(e,t),Ie.init(e,t)});var hd=L("ZodURL",(e,t)=>{xc.init(e,t),Ie.init(e,t)});function pd(e){return hs(hd,e)}var Cp=L("ZodEmoji",(e,t)=>{Ac.init(e,t),Ie.init(e,t)});var Ip=L("ZodNanoID",(e,t)=>{Mc.init(e,t),Ie.init(e,t)});var Op=L("ZodCUID",(e,t)=>{jc.init(e,t),Ie.init(e,t)});var Np=L("ZodCUID2",(e,t)=>{qc.init(e,t),Ie.init(e,t)});var xp=L("ZodULID",(e,t)=>{Lc.init(e,t),Ie.init(e,t)});var Ap=L("ZodXID",(e,t)=>{Dc.init(e,t),Ie.init(e,t)});var Mp=L("ZodKSUID",(e,t)=>{Uc.init(e,t),Ie.init(e,t)});var jp=L("ZodIPv4",(e,t)=>{Jc.init(e,t),Ie.init(e,t)});var qp=L("ZodIPv6",(e,t)=>{Kc.init(e,t),Ie.init(e,t)});var Lp=L("ZodCIDRv4",(e,t)=>{Gc.init(e,t),Ie.init(e,t)});var Dp=L("ZodCIDRv6",(e,t)=>{Wc.init(e,t),Ie.init(e,t)});var Up=L("ZodBase64",(e,t)=>{Xc.init(e,t),Ie.init(e,t)});var Zp=L("ZodBase64URL",(e,t)=>{Qc.init(e,t),Ie.init(e,t)});var Vp=L("ZodE164",(e,t)=>{eu.init(e,t),Ie.init(e,t)});var Fp=L("ZodJWT",(e,t)=>{tu.init(e,t),Ie.init(e,t)});var md=L("ZodNumber",(e,t)=>{ns.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n),e.isFinite=!0},da({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=Ve(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=Ve(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=Ve(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>Ve(e).format??null},{gt(e,t){return this.check(nn(e,t))},gte(e,t){return this.check(Kr(e,t))},min(e,t){return this.check(Kr(e,t))},lt(e,t){return this.check(on(e,t))},lte(e,t){return this.check(Br(e,t))},max(e,t){return this.check(Br(e,t))},int(e){return this.check(nd(e))},safe(e){return this.check(nd(e))},positive(e){return this.check(nn(0,e))},nonnegative(e){return this.check(Kr(0,e))},negative(e){return this.check(on(0,e))},nonpositive(e){return this.check(Br(0,e))},multipleOf(e,t){return this.check(sn(e,t))},step(e,t){return this.check(sn(e,t))},finite(){return this}}));function Q(e){return sl(md,e)}var Hp=L("ZodNumberFormat",(e,t)=>{ru.init(e,t),md.init(e,t)});function nd(e){return il(Hp,e)}var Jp=L("ZodBoolean",(e,t)=>{ou.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Os(e,r,o,n)});function fe(e){return al(Jp,e)}var Bp=L("ZodNull",(e,t)=>{nu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ns(e,r,o,n)});function mn(e){return cl(Bp,e)}var Kp=L("ZodUnknown",(e,t)=>{su.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>As(e,r,o,n)});function de(){return ul(Kp)}var Gp=L("ZodNever",(e,t)=>{au.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xs(e,r,o,n)});function Wp(e){return ll(Gp,e)}var Yp=L("ZodArray",(e,t)=>{pn(),cu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ds(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Xt(e,t))},nonempty(e){return this.check(Xt(1,e))},max(e,t){return this.check(an(e,t))},length(e,t){return this.check(cn(e,t))},unwrap(){return this.element}});function W(e,t){return dl(Yp,e,t)}var gd=L("ZodObject",(e,t)=>{pn(),du.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),Sh(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ye(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ke(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ke(this._zod.def,{catchall:de()}))},loose(){return this.clone(Ke(this._zod.def,{catchall:de()}))},strict(){return this.clone(Ke(this._zod.def,{catchall:Wp()}))},strip(){return this.clone(Ke(this._zod.def,{catchall:void 0}))},extend(e){return dh(this,e)},safeExtend(e){return fh(this,e)},merge(e){return hh(this,e)},pick(e){return uh(this,e)},omit(e){return lh(this,e)},partial(...e){return aa(vd,this,e[0])},exactPartial(...e){return aa(Sd,this,e[0],"exactPartial")},required(...e){return ph(bd,this,e[0])}});function M(e,t){let r={type:"object",shape:e??{},...re(t)};return new gd(r)}function _e(e,t){return new gd({type:"object",shape:e,catchall:de(),...re(t)})}var _d=L("ZodUnion",(e,t)=>{is.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vs(e,r,o,n),e.options=t.options});function ae(e,t){return new _d({type:"union",options:e,...re(t)})}var Xp=L("ZodDiscriminatedUnion",(e,t)=>{_d.init(e,t),fu.init(e,t)});function si(e,t,r){return new Xp({type:"union",options:t,discriminator:e,...re(r)})}var Qp=L("ZodIntersection",(e,t)=>{hu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fs(e,r,o,n)});function tr(e,t){return new Qp({type:"intersection",left:e,right:t})}var sd=L("ZodRecord",(e,t)=>{pn(),pu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hs(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function se(e,t,r){if(!t||!t._zod)return new sd({type:"record",keyType:P(),valueType:e,...re(t)});return new sd({type:"record",keyType:e,valueType:t,...re(r)})}var ri=L("ZodEnum",(e,t)=>{mu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ms(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 ri({...t,checks:[],...re(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 ri({...t,checks:[],...re(n),entries:s})}});function ye(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new ri({type:"enum",entries:r,...re(t)})}var em=L("ZodLiteral",(e,t)=>{gu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>js(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 H(e,t){return new em({type:"literal",values:Array.isArray(e)?e:[e],...re(t)})}var tm=L("ZodTransform",(e,t)=>{pn(),_u.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ls(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ur(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(jt(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(jt(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 yd(e){return new tm({type:"transform",transform:e})}var vd=L("ZodOptional",(e,t)=>{as.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>un(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function he(e){return new vd({type:"optional",innerType:e})}var Sd=L("ZodExactOptional",(e,t)=>{yu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>un(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new Sd({type:"optional",innerType:e})}var om=L("ZodNullable",(e,t)=>{vu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Js(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function id(e){return new om({type:"nullable",innerType:e})}var nm=L("ZodDefault",(e,t)=>{Su.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sm(e,t){return new nm({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():qn(t)}})}var im=L("ZodPrefault",(e,t)=>{bu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ws(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function am(e,t){return new im({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():qn(t)}})}var bd=L("ZodNonOptional",(e,t)=>{wu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cm(e,t){return new bd({type:"nonoptional",innerType:e,...re(t)})}var um=L("ZodCatch",(e,t)=>{$u.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ys(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lm(e,t){return new um({type:"catch",innerType:e,catchValue:typeof t==="function"?t:fa(t)})}var wd=L("ZodPipe",(e,t)=>{cs.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xs(e,r,o,n),e.in=t.in,e.out=t.out});function ad(e,t){return new wd({type:"pipe",in:e,out:t})}var dm=L("ZodPreprocess",(e,t)=>{wd.init(e,t),Ru.init(e,t)}),fm=L("ZodReadonly",(e,t)=>{zu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ei(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function hm(e){return new fm({type:"readonly",innerType:e})}var pm=L("ZodLazy",(e,t)=>{Pu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ti(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function ii(e){return new pm({type:"lazy",getter:e})}var mm=L("ZodCustom",(e,t)=>{Eu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n)});function _m(e,t={}){return fl(mm,e,t)}function Sm(e,t){return hl(e,t)}function gn(e,t){return new dm({type:"pipe",in:yd(e),out:t})}function ai(e){return tn(oi,e)}function bm(e){return rn(ni,e)}var fi=Symbol.for("mcp.sdk.errorBrands");function Rt(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,fi,{value:r,enumerable:!1,configurable:!0})}function Fe(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,fi)){let r=t[fi];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var jd=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Fe(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 Fe(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",Rt(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)}},ee=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}({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e,t,r,o){super(t,o);this.code=e,this.data=r,this.name="SdkError",Rt(this,new.target)}},co=class extends X{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 qd="2026-07-28",_i=[qd];function ht(e){return e>=qd}function yi(e){return e.filter((t)=>!ht(t))}function uo(e){return e.filter((t)=>ht(t))}function Ld(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 Dd=["task","inputRequests","requestState"];function Nm(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||Dd.some((t)=>(t in e)))return e;return{...e,content:[]}}function xm(){let e=ii(()=>ae([P(),Q(),fe(),mn(),se(P(),e),W(e)])),t=se(P(),e),r=ae([P(),Q().int()]),o=P(),n=M({ttl:Q().optional()}),s=M({taskId:P()}),i=_e({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=M({_meta:i.optional()}),a=c.extend({task:n.optional()}),u=M({method:P(),params:c.loose().optional()}),l=M({_meta:i.optional()}),f=M({method:P(),params:l.loose().optional()}),m=_e({_meta:i.optional()}),v=ae([P(),Q().int()]),g=m.strict(),b=l.extend({requestId:v.optional(),reason:P().optional()}),R=f.extend({method:H("notifications/cancelled"),params:b}),p=M({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:ye(["light","dark"]).optional()}),T=M({icons:W(p).optional()}),w=M({name:P(),title:P().optional()}),E=w.extend({...w.shape,...T.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),N=tr(M({applyDefaults:fe().optional()}),t),z=gn((qe)=>{if(qe&&typeof qe==="object"&&!Array.isArray(qe)&&Object.keys(qe).length===0)return{form:{}};return qe},tr(M({form:N.optional(),url:t.optional()}),t.optional())),_=_e({list:t.optional(),cancel:t.optional(),requests:_e({sampling:_e({createMessage:t.optional()}).optional(),elicitation:_e({create:t.optional()}).optional()}).optional()}),C=_e({list:t.optional(),cancel:t.optional(),requests:_e({tools:_e({call:t.optional()}).optional()}).optional()}),q=M({experimental:se(P(),t).optional(),sampling:M({context:t.optional(),tools:t.optional()}).optional(),elicitation:z.optional(),roots:M({listChanged:fe().optional()}).optional(),tasks:_.optional(),extensions:se(P(),t).optional()}),F=c.extend({protocolVersion:P(),capabilities:q,clientInfo:E}),j=u.extend({method:H("initialize"),params:F}),Z=M({experimental:se(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:M({listChanged:fe().optional()}).optional(),resources:M({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:M({listChanged:fe().optional()}).optional(),tasks:C.optional(),extensions:se(P(),t).optional()}),G=m.extend({protocolVersion:P(),capabilities:Z,serverInfo:E,instructions:P().optional()}),K=f.extend({method:H("notifications/initialized"),params:l.optional()}),ie=u.extend({method:H("ping"),params:c.optional()}),Se=M({progress:Q(),total:he(Q()),message:he(P())}),ve=M({...l.shape,...Se.shape,progressToken:r}),Pe=f.extend({method:H("notifications/progress"),params:ve}),le=c.extend({cursor:o.optional()}),O=u.extend({params:le.optional()}),x=m.extend({nextCursor:o.optional()}),y=M({uri:P(),mimeType:he(P()),_meta:se(P(),de()).optional()}),d=y.extend({text:P()}),h=P().refine((qe)=>{try{return atob(qe),!0}catch{return!1}},{message:"Invalid Base64 string"}),S=y.extend({blob:h}),I=ye(["user","assistant"]),D=M({audience:W(I).optional(),priority:Q().min(0).max(1).optional(),lastModified:ai({offset:!0}).optional()}),B=M({...w.shape,...T.shape,uri:P(),description:he(P()),mimeType:he(P()),size:he(Q()),annotations:D.optional(),_meta:he(_e({}))}),J=M({...w.shape,...T.shape,uriTemplate:P(),description:he(P()),mimeType:he(P()),annotations:D.optional(),_meta:he(_e({}))}),ce=O.extend({method:H("resources/list")}),we=x.extend({resources:W(B)}),k=O.extend({method:H("resources/templates/list")}),A=x.extend({resourceTemplates:W(J)}),U=c.extend({uri:P()}),Y=U,te=u.extend({method:H("resources/read"),params:Y}),oe=m.extend({contents:W(ae([d,S]))}),pe=f.extend({method:H("notifications/resources/list_changed"),params:l.optional()}),Ce=U,$e=u.extend({method:H("resources/subscribe"),params:Ce}),Oe=U,Ee=u.extend({method:H("resources/unsubscribe"),params:Oe}),Ye=l.extend({uri:P()}),xe=f.extend({method:H("notifications/resources/updated"),params:Ye}),ct=M({name:P(),description:he(P()),required:he(fe())}),Qe=M({...w.shape,...T.shape,description:he(P()),arguments:he(W(ct)),_meta:he(_e({}))}),ut=O.extend({method:H("prompts/list")}),pt=x.extend({prompts:W(Qe)}),mt=c.extend({name:P(),arguments:se(P(),P()).optional()}),zt=u.extend({method:H("prompts/get"),params:mt}),Pt=M({type:H("text"),text:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),Et=M({type:H("image"),data:h,mimeType:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),Tt=M({type:H("audio"),data:h,mimeType:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),ar=M({type:H("tool_use"),name:P(),id:P(),input:se(P(),de()),_meta:se(P(),de()).optional()}),gt=M({type:H("resource"),resource:ae([d,S]),annotations:D.optional(),_meta:se(P(),de()).optional()}),cr=B.extend({type:H("resource_link")}),Xe=ae([Pt,Et,Tt,cr,gt]),Dt=M({role:I,content:Xe}),Ut=m.extend({description:P().optional(),messages:W(Dt)}),kt=f.extend({method:H("notifications/prompts/list_changed"),params:l.optional()}),ur=M({title:P().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),Zt=M({taskSupport:ye(["required","optional","forbidden"]).optional()}),Ct=M({...w.shape,...T.shape,description:P().optional(),inputSchema:M({type:H("object"),properties:se(P(),e).optional(),required:W(P()).optional()}).catchall(de()),outputSchema:M({type:H("object"),properties:se(P(),e).optional(),required:W(P()).optional()}).catchall(de()).optional(),annotations:ur.optional(),execution:Zt.optional(),_meta:se(P(),de()).optional()}),Vt=O.extend({method:H("tools/list")}),Ft=x.extend({tools:W(Ct)}),Ht=m.extend({content:W(Xe),structuredContent:se(P(),de()).optional(),isError:fe().optional()}),je=a.extend({name:P(),arguments:se(P(),de()).optional()}),lr=u.extend({method:H("tools/call"),params:je}),mo=f.extend({method:H("notifications/tools/list_changed"),params:l.optional()}),Jt=ye(["debug","info","notice","warning","error","critical","alert","emergency"]),dr=c.extend({level:Jt}),fr=u.extend({method:H("logging/setLevel"),params:dr}),hr=l.extend({level:Jt,logger:P().optional(),data:de()}),pr=f.extend({method:H("notifications/message"),params:hr}),mr=M({name:P().optional()}),gr=M({hints:W(mr).optional(),costPriority:Q().min(0).max(1).optional(),speedPriority:Q().min(0).max(1).optional(),intelligencePriority:Q().min(0).max(1).optional()}),_r=M({mode:ye(["auto","required","none"]).optional()}),go=M({type:H("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:W(Xe),structuredContent:M({}).loose().optional(),isError:fe().optional(),_meta:se(P(),de()).optional()}),yr=si("type",[Pt,Et,Tt]),_t=si("type",[Pt,Et,Tt,ar,go]),vr=M({role:I,content:ae([_t,W(_t)]),_meta:se(P(),de()).optional()}),Sr=a.extend({messages:W(vr),modelPreferences:gr.optional(),systemPrompt:P().optional(),includeContext:ye(["none","thisServer","allServers"]).optional(),temperature:Q().optional(),maxTokens:Q().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(Ct).optional(),toolChoice:_r.optional()}),br=u.extend({method:H("sampling/createMessage"),params:Sr}),wr=m.extend({model:P(),stopReason:he(ye(["endTurn","stopSequence","maxTokens"]).or(P())),role:I,content:yr}),$r=m.extend({model:P(),stopReason:he(ye(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:I,content:ae([_t,W(_t)])}),Rr=M({type:H("boolean"),title:P().optional(),description:P().optional(),default:fe().optional()}),zr=M({type:H("string"),title:P().optional(),description:P().optional(),minLength:Q().optional(),maxLength:Q().optional(),format:ye(["email","uri","date","date-time"]).optional(),default:P().optional()}),Pr=M({type:ye(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Q().optional(),maximum:Q().optional(),default:Q().optional()}),Er=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),kr=M({type:H("string"),title:P().optional(),description:P().optional(),oneOf:W(M({const:P(),title:P()})),default:P().optional()}),Cr=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),Ir=ae([Er,kr]),It=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({type:H("string"),enum:W(P())}),default:W(P()).optional()}),Ot=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({anyOf:W(M({const:P(),title:P()}))}),default:W(P()).optional()}),_o=ae([It,Ot]),yo=ae([Cr,Ir,_o]),He=ae([yo,Rr,zr,Pr]),Je=a.extend({mode:H("form").optional(),message:P(),requestedSchema:M({type:H("object"),properties:se(P(),He),required:W(P()).optional()}).catchall(de())}),Or=a.extend({mode:H("url"),message:P(),elicitationId:P(),url:P().url()}),et=ae([Je,Or]),vo=u.extend({method:H("elicitation/create"),params:et}),So=l.extend({elicitationId:P()}),bo=f.extend({method:H("notifications/elicitation/complete"),params:So}),wo=m.extend({action:ye(["accept","decline","cancel"]),content:gn((qe)=>qe===null?void 0:qe,se(P(),ae([P(),Q(),fe(),W(P())])).optional())}),$o=M({type:H("ref/resource"),uri:P()}),Ro=M({type:H("ref/prompt"),name:P()}),zo=c.extend({ref:ae([Ro,$o]),argument:M({name:P(),value:P()}),context:M({arguments:se(P(),P()).optional()}).optional()}),Nr=u.extend({method:H("completion/complete"),params:zo}),Po=m.extend({completion:_e({values:W(P()).max(100),total:he(Q().int()),hasMore:he(fe())})}),Eo=M({uri:P().startsWith("file://"),name:P().optional(),_meta:se(P(),de()).optional()}),Bt=u.extend({method:H("roots/list"),params:c.optional()}),xr=m.extend({roots:W(Eo)}),To=f.extend({method:H("notifications/roots/list_changed"),params:l.optional()}),ko=_e({ttl:Q().optional(),pollInterval:Q().optional()}),Ar=ye(["working","input_required","completed","failed","cancelled"]),yt=M({taskId:P(),status:Ar,ttl:ae([Q(),mn()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:he(Q()),statusMessage:he(P())}),Ue=m.extend({task:yt}),Co=l.merge(yt),Nt=f.extend({method:H("notifications/tasks/status"),params:Co}),Kt=u.extend({method:H("tasks/get"),params:c.extend({taskId:P()})}),Gt=m.merge(yt),Wt=u.extend({method:H("tasks/result"),params:c.extend({taskId:P()})}),xn=m.loose(),Le=O.extend({method:H("tasks/list")}),Ne=x.extend({tasks:W(yt)}),xt=u.extend({method:H("tasks/cancel"),params:c.extend({taskId:P()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:a,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:f,ResultSchema:m,RequestIdSchema:v,EmptyResultSchema:g,CancelledNotificationParamsSchema:b,CancelledNotificationSchema:R,IconSchema:p,IconsSchema:T,BaseMetadataSchema:w,ImplementationSchema:E,ClientTasksCapabilitySchema:_,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:q,InitializeRequestParamsSchema:F,InitializeRequestSchema:j,ServerCapabilitiesSchema:Z,InitializeResultSchema:G,InitializedNotificationSchema:K,PingRequestSchema:ie,ProgressSchema:Se,ProgressNotificationParamsSchema:ve,ProgressNotificationSchema:Pe,PaginatedRequestParamsSchema:le,PaginatedRequestSchema:O,PaginatedResultSchema:x,ResourceContentsSchema:y,TextResourceContentsSchema:d,BlobResourceContentsSchema:S,RoleSchema:I,AnnotationsSchema:D,ResourceSchema:B,ResourceTemplateSchema:J,ListResourcesRequestSchema:ce,ListResourcesResultSchema:we,ListResourceTemplatesRequestSchema:k,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:U,ReadResourceRequestParamsSchema:Y,ReadResourceRequestSchema:te,ReadResourceResultSchema:oe,ResourceListChangedNotificationSchema:pe,SubscribeRequestParamsSchema:Ce,SubscribeRequestSchema:$e,UnsubscribeRequestParamsSchema:Oe,UnsubscribeRequestSchema:Ee,ResourceUpdatedNotificationParamsSchema:Ye,ResourceUpdatedNotificationSchema:xe,PromptArgumentSchema:ct,PromptSchema:Qe,ListPromptsRequestSchema:ut,ListPromptsResultSchema:pt,GetPromptRequestParamsSchema:mt,GetPromptRequestSchema:zt,TextContentSchema:Pt,ImageContentSchema:Et,AudioContentSchema:Tt,ToolUseContentSchema:ar,EmbeddedResourceSchema:gt,ResourceLinkSchema:cr,ContentBlockSchema:Xe,PromptMessageSchema:Dt,GetPromptResultSchema:Ut,PromptListChangedNotificationSchema:kt,ToolAnnotationsSchema:ur,ToolExecutionSchema:Zt,ToolSchema:Ct,ListToolsRequestSchema:Vt,ListToolsResultSchema:Ft,CallToolResultSchema:Ht,CallToolRequestParamsSchema:je,CallToolRequestSchema:lr,ToolListChangedNotificationSchema:mo,LoggingLevelSchema:Jt,SetLevelRequestParamsSchema:dr,SetLevelRequestSchema:fr,LoggingMessageNotificationParamsSchema:hr,LoggingMessageNotificationSchema:pr,ModelHintSchema:mr,ModelPreferencesSchema:gr,ToolChoiceSchema:_r,ToolResultContentSchema:go,SamplingContentSchema:yr,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vr,CreateMessageRequestParamsSchema:Sr,CreateMessageRequestSchema:br,CreateMessageResultSchema:wr,CreateMessageResultWithToolsSchema:$r,BooleanSchemaSchema:Rr,StringSchemaSchema:zr,NumberSchemaSchema:Pr,UntitledSingleSelectEnumSchemaSchema:Er,TitledSingleSelectEnumSchemaSchema:kr,LegacyTitledEnumSchemaSchema:Cr,SingleSelectEnumSchemaSchema:Ir,UntitledMultiSelectEnumSchemaSchema:It,TitledMultiSelectEnumSchemaSchema:Ot,MultiSelectEnumSchemaSchema:_o,EnumSchemaSchema:yo,PrimitiveSchemaDefinitionSchema:He,ElicitRequestFormParamsSchema:Je,ElicitRequestURLParamsSchema:Or,ElicitRequestParamsSchema:et,ElicitRequestSchema:vo,ElicitationCompleteNotificationParamsSchema:So,ElicitationCompleteNotificationSchema:bo,ElicitResultSchema:wo,ResourceTemplateReferenceSchema:$o,PromptReferenceSchema:Ro,CompleteRequestParamsSchema:zo,CompleteRequestSchema:Nr,CompleteResultSchema:Po,RootSchema:Eo,ListRootsRequestSchema:Bt,ListRootsResultSchema:xr,RootsListChangedNotificationSchema:To,TaskCreationParamsSchema:ko,TaskStatusSchema:Ar,TaskSchema:yt,CreateTaskResultSchema:Ue,TaskStatusNotificationParamsSchema:Co,TaskStatusNotificationSchema:Nt,GetTaskRequestSchema:Kt,GetTaskResultSchema:Gt,GetTaskPayloadRequestSchema:Wt,GetTaskPayloadResultSchema:xn,ListTasksRequestSchema:Le,ListTasksResultSchema:Ne,CancelTaskRequestSchema:xt,CancelTaskResultSchema:m.merge(yt),ClientRequestSchema:ae([ie,j,Nr,fr,zt,ut,ce,k,te,$e,Ee,lr,Vt,Kt,Wt,Le,xt]),ClientNotificationSchema:ae([R,Pe,K,To,Nt]),ClientResultSchema:ae([g,wr,$r,wo,xr,Gt,Ne,Ue]),ServerRequestSchema:ae([ie,br,vo,Bt,Kt,Wt,Le,xt]),ServerNotificationSchema:ae([R,Pe,pr,xe,pe,mo,kt,Nt,bo]),ServerResultSchema:ae([g,G,Po,Ut,pt,we,A,oe,Ht,Ft,Gt,Ne,Ue]),CallToolResultWireSchema:de().superRefine((qe,Xf)=>{if(typeof qe!=="object"||qe===null||Array.isArray(qe)||qe.content!==void 0)return;for(let Zi of Dd)if(Zi in qe){Xf.addIssue({code:"custom",message:`content is required when the body carries '${Zi}' \u2014 another result family cannot default into an empty tools/call success`});return}}).transform(Nm).pipe(Ht)}}var Am;function Ud(){return Am??=xm()}function Zd(e){return e.type!=="object"}var Mm=new Set(["const","enum","default","examples"]),jm=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Rd(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function qm(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(Rd(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Ji(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((a)=>o(a,!1));if(n===null||typeof n!=="object")return n;if(!s&&Rd(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))if(s)i[a]=o(u,!1);else if((a==="$ref"||a==="$dynamicRef")&&typeof u==="string")i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(a==="$recursiveRef"&&u==="#"&&r)c=!0;else if(Mm.has(a))i[a]=u;else if(jm.has(a))i[a]=o(u,!0);else i[a]=o(u,!1);if(c)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 Vd={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},Fd={"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},Lm={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},_n;function vi(){if(_n)return _n;let e=Ud();return _n={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}},_n}function Hd(e){return Object.prototype.hasOwnProperty.call(Vd,e)}function Jd(e){return Object.prototype.hasOwnProperty.call(Fd,e)}function Dm(e){return Object.prototype.hasOwnProperty.call(Lm,e)}function Um(e){return Dm(e)?vi().resultSchemas[e]:void 0}function Zm(e){return Hd(e)?vi().requestSchemas[e]:void 0}function Vm(e){return Jd(e)?vi().notificationSchemas[e]:void 0}var _0=Object.keys(Vd),y0=Object.keys(Fd);function hi(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function yn(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 zd={ok:!1,reason:"not-in-era"};function Pd(e){return hi(e)&&hi(e.outputSchema)&&Zd(e.outputSchema)}function Ed(e){return e}var Si={era:"2025-11-25",hasRequestMethod:Hd,hasNotificationMethod:Jd,validateRequest:(e,t)=>yn(Zm(e),t),validateResult:(e,t)=>yn(Um(e),t),validateNotification:(e,t)=>yn(Vm(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>zd,validateInputResponse:()=>zd,samplingResultVariant:(e,t)=>{let r=Ud();return yn(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=Ld(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&Zd(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(hi(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:Ed(r)}}return{kind:"complete",result:Ed(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>Pd(o)))return t;return{...t,tools:r.map((o)=>Pd(o)?{...o,outputSchema:qm(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function Fm(){let e=ii(()=>ae([P(),Q(),fe(),mn(),se(P(),e),W(e)])),t=se(P(),e),r=ae([P(),Q().int()]),o=P(),n=ae([P(),Q().int()]),s=ye(["user","assistant"]),i=ye(["debug","info","notice","warning","error","critical","alert","emergency"]),c=P().refine((Ne)=>{try{return atob(Ne),!0}catch{return!1}},{message:"Invalid Base64 string"}),a=M({ttl:Q().optional()}),u=M({taskId:P()}),l=_e({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=M({_meta:l.optional()}),m=f.extend({task:a.optional()}),v=M({_meta:l.optional()}),g=M({method:P(),params:v.loose().optional()}),b=M({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:ye(["light","dark"]).optional()}),R=M({icons:W(b).optional()}),p=M({name:P(),title:P().optional()}),T=p.extend({...p.shape,...R.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),w=tr(M({applyDefaults:fe().optional()}),t),E=gn((Ne)=>{if(Ne&&typeof Ne==="object"&&!Array.isArray(Ne)&&Object.keys(Ne).length===0)return{form:{}};return Ne},tr(M({form:w.optional(),url:t.optional()}),t.optional())),N=_e({list:t.optional(),cancel:t.optional(),requests:_e({sampling:_e({createMessage:t.optional()}).optional(),elicitation:_e({create:t.optional()}).optional()}).optional()}),z=_e({list:t.optional(),cancel:t.optional(),requests:_e({tools:_e({call:t.optional()}).optional()}).optional()}),_=M({experimental:se(P(),t).optional(),sampling:M({context:t.optional(),tools:t.optional()}).optional(),elicitation:E.optional(),roots:M({listChanged:fe().optional()}).optional(),tasks:N.optional(),extensions:se(P(),t).optional()}),C=M({experimental:se(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:M({listChanged:fe().optional()}).optional(),resources:M({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:M({listChanged:fe().optional()}).optional(),tasks:z.optional(),extensions:se(P(),t).optional()}),q=M({progress:Q(),total:he(Q()),message:he(P())}),F=M({...v.shape,...q.shape,progressToken:r}),j=g.extend({method:H("notifications/progress"),params:F}),Z=v.extend({level:i,logger:P().optional(),data:de()}),G=g.extend({method:H("notifications/message"),params:Z}),K=M({uri:P(),mimeType:he(P()),_meta:se(P(),de()).optional()}),ie=K.extend({text:P()}),Se=K.extend({blob:c}),ve=M({audience:W(s).optional(),priority:Q().min(0).max(1).optional(),lastModified:ai({offset:!0}).optional()}),Pe=M({...p.shape,...R.shape,uri:P(),description:he(P()),mimeType:he(P()),size:he(Q()),annotations:ve.optional(),_meta:he(_e({}))}),le=M({...p.shape,...R.shape,uriTemplate:P(),description:he(P()),mimeType:he(P()),annotations:ve.optional(),_meta:he(_e({}))}),O=g.extend({method:H("notifications/resources/list_changed"),params:v.optional()}),x=v.extend({uri:P()}),y=g.extend({method:H("notifications/resources/updated"),params:x}),d=M({name:P(),description:he(P()),required:he(fe())}),h=M({...p.shape,...R.shape,description:he(P()),arguments:he(W(d)),_meta:he(_e({}))}),S=g.extend({method:H("notifications/prompts/list_changed"),params:v.optional()}),I=M({type:H("text"),text:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),D=M({type:H("image"),data:c,mimeType:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),B=M({type:H("audio"),data:c,mimeType:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),J=M({type:H("tool_use"),name:P(),id:P(),input:se(P(),de()),_meta:se(P(),de()).optional()}),ce=M({type:H("resource"),resource:ae([ie,Se]),annotations:ve.optional(),_meta:se(P(),de()).optional()}),we=Pe.extend({type:H("resource_link")}),k=ae([I,D,B,we,ce]),A=M({role:s,content:k}),U=M({title:P().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),Y=g.extend({method:H("notifications/tools/list_changed"),params:v.optional()}),te=M({name:P().optional()}),oe=M({hints:W(te).optional(),costPriority:Q().min(0).max(1).optional(),speedPriority:Q().min(0).max(1).optional(),intelligencePriority:Q().min(0).max(1).optional()}),pe=M({mode:ye(["auto","required","none"]).optional()}),Ce=M({type:H("boolean"),title:P().optional(),description:P().optional(),default:fe().optional()}),$e=M({type:H("string"),title:P().optional(),description:P().optional(),minLength:Q().optional(),maxLength:Q().optional(),format:ye(["email","uri","date","date-time"]).optional(),default:P().optional()}),Oe=M({type:ye(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Q().optional(),maximum:Q().optional(),default:Q().optional()}),Ee=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),Ye=M({type:H("string"),title:P().optional(),description:P().optional(),oneOf:W(M({const:P(),title:P()})),default:P().optional()}),xe=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),ct=ae([Ee,Ye]),Qe=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({type:H("string"),enum:W(P())}),default:W(P()).optional()}),ut=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({anyOf:W(M({const:P(),title:P()}))}),default:W(P()).optional()}),pt=ae([Qe,ut]),mt=ae([xe,ct,pt]),zt=ae([mt,Ce,$e,Oe]),Pt=m.extend({mode:H("form").optional(),message:P(),requestedSchema:M({type:H("object"),properties:se(P(),zt),required:W(P()).optional()}).catchall(de())}),Et=M({type:H("ref/resource"),uri:P()}),Tt=M({type:H("ref/prompt"),name:P()}),ar=M({uri:P().startsWith("file://"),name:P().optional(),_meta:se(P(),de()).optional()}),gt=_.shape,cr=M({experimental:gt.experimental,sampling:gt.sampling,elicitation:gt.elicitation,roots:gt.roots,extensions:gt.extensions}),Xe=C.shape,Dt=M({experimental:Xe.experimental,logging:Xe.logging,completions:Xe.completions,prompts:Xe.prompts,resources:Xe.resources,tools:Xe.tools,extensions:Xe.extensions}),Ut=_e({progressToken:r.optional(),[ss]:P(),[iu]:T.optional(),[Tr]:cr,[Qu]:i.optional()}),kt=M({...p.shape,...R.shape,description:P().optional(),inputSchema:_e({$schema:P().optional(),type:H("object")}),outputSchema:_e({$schema:P().optional()}).optional(),annotations:U.optional(),_meta:se(P(),de()).optional()}),ur=M({type:H("tool_result"),toolUseId:P(),content:W(k),structuredContent:de().optional(),isError:fe().optional(),_meta:se(P(),de()).optional()}),Zt=ae([I,D,B,J,ur]),Ct=M({role:s,content:ae([Zt,W(Zt)]),_meta:se(P(),de()).optional()}),Vt=P(),Ft=_e({[_a]:T.optional().catch(void 0)}),Ht=Ft.optional();function je(Ne){return _e({_meta:Ht,resultType:Vt.default("complete"),...Ne})}let lr=je({}),mo=je({nextCursor:o.optional()}),Jt=je({content:W(k),structuredContent:de().optional(),isError:fe().optional()}),dr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),tools:W(kt),nextCursor:o.optional()}),fr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),prompts:W(h),nextCursor:o.optional()}),hr=je({description:P().optional(),messages:W(A)}),pr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resources:W(Pe),nextCursor:o.optional()}),mr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resourceTemplates:W(le),nextCursor:o.optional()}),gr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),contents:W(ae([ie,Se]))}),_r=je({completion:M({values:W(P()).max(100),total:Q().int().optional(),hasMore:fe().optional()}).loose()}),go=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"])}),yr=je({ttlMs:Q().int().min(0).catch(0),cacheScope:ye(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:Dt,instructions:P().optional()}),_t=M({messages:W(Ct),modelPreferences:oe.optional(),systemPrompt:P().optional(),includeContext:ye(["none","thisServer","allServers"]).optional(),temperature:Q().optional(),maxTokens:Q().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(kt).optional(),toolChoice:pe.optional()}),vr=M({method:H("sampling/createMessage"),params:_t}),Sr=M({method:H("roots/list"),params:M({_meta:se(P(),de()).optional()}).optional()}),br=M({...Ct.shape,model:P(),stopReason:P().optional()}),wr=M({roots:W(ar)}),$r=M({action:ye(["accept","decline","cancel"]),content:se(P(),ae([P(),Q(),fe(),W(P())])).optional()}),Rr=M({mode:H("url"),message:P(),url:P().url()}),zr=ae([Pt,Rr]),Pr=M({method:H("elicitation/create"),params:zr}),Er=ae([vr,Sr,Pr]),kr=ae([br,wr,$r]),Cr=se(P(),Er),Ir=se(P(),kr),It=je({inputRequests:Cr.optional(),requestState:P().optional()}),Ot={inputResponses:Ir.optional(),requestState:P().optional()},_o=M({_meta:Ut,...Ot}),yo=_e({progressToken:r.optional()});function He(Ne,xt){return M({method:H(Ne),params:M({_meta:Ut,...xt})})}function Je(Ne,xt){return M({method:H(Ne),params:M({_meta:yo.optional(),...xt}).optional()})}let Or={name:P(),arguments:se(P(),de()).optional(),...Ot},et={cursor:o.optional()},vo=He("tools/call",Or),So=He("tools/list",et),bo=He("prompts/list",et),wo=He("prompts/get",{name:P(),arguments:se(P(),P()).optional(),...Ot}),$o=He("resources/list",et),Ro=He("resources/templates/list",et),zo=He("resources/read",{uri:P(),...Ot}),Nr={ref:ae([Tt,Et]),argument:M({name:P(),value:P()}),context:M({arguments:se(P(),P()).optional()}).optional()},Po=He("completion/complete",Nr),Eo=He("server/discover",{}),Bt=M({toolsListChanged:fe().optional(),promptsListChanged:fe().optional(),resourcesListChanged:fe().optional(),resourceSubscriptions:W(P()).optional()}),xr={notifications:Bt},To=He("subscriptions/listen",xr),ko=Ft.extend({"io.modelcontextprotocol/subscriptionId":n}),Ar=_e({_meta:ko,resultType:Vt.default("complete")}),yt={"tools/call":Je("tools/call",Or),"tools/list":Je("tools/list",et),"prompts/get":Je("prompts/get",{name:P(),arguments:se(P(),P()).optional()}),"prompts/list":Je("prompts/list",et),"resources/list":Je("resources/list",et),"resources/templates/list":Je("resources/templates/list",et),"resources/read":Je("resources/read",{uri:P()}),"completion/complete":Je("completion/complete",Nr),"server/discover":Je("server/discover",{}),"subscriptions/listen":Je("subscriptions/listen",xr)};function Ue(Ne){return _e({_meta:Ht,...Ne})}let Co={"tools/call":Ue({content:W(k),structuredContent:de().optional(),isError:fe().optional()}),"tools/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),tools:W(kt),nextCursor:o.optional()}),"prompts/get":Ue({description:P().optional(),messages:W(A)}),"prompts/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),prompts:W(h),nextCursor:o.optional()}),"resources/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resources:W(Pe),nextCursor:o.optional()}),"resources/templates/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resourceTemplates:W(le),nextCursor:o.optional()}),"resources/read":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),contents:W(ae([ie,Se]))}),"completion/complete":Ue({completion:M({values:W(P()).max(100),total:Q().int().optional(),hasMore:fe().optional()}).loose()}),"server/discover":Ue({ttlMs:Q().int().min(0).catch(0),cacheScope:ye(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:Dt,instructions:P().optional()}),"subscriptions/listen":Ue({})},Nt=_e({"io.modelcontextprotocol/subscriptionId":n.optional()}),Kt=M({method:H("notifications/subscriptions/acknowledged"),params:M({_meta:Nt.optional(),notifications:Bt})}),Gt=M({_meta:Nt.optional(),requestId:n,reason:P().optional()}),Wt=M({method:H("notifications/cancelled"),params:Gt}),xn={"notifications/cancelled":Wt,"notifications/progress":j,"notifications/message":G,"notifications/resources/updated":y,"notifications/resources/list_changed":O,"notifications/tools/list_changed":Y,"notifications/prompts/list_changed":S,"notifications/subscriptions/acknowledged":Kt},Le=(Ne)=>M({jsonrpc:H("2.0"),id:ae([P(),Q().int()]),result:Ne}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:a,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:v,NotificationSchema:g,IconSchema:b,IconsSchema:R,BaseMetadataSchema:p,ImplementationSchema:T,ClientTasksCapabilitySchema:N,ServerTasksCapabilitySchema:z,ClientCapabilitiesSchema:_,ServerCapabilitiesSchema:C,ProgressSchema:q,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:j,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:G,ResourceContentsSchema:K,TextResourceContentsSchema:ie,BlobResourceContentsSchema:Se,AnnotationsSchema:ve,ResourceSchema:Pe,ResourceTemplateSchema:le,ResourceListChangedNotificationSchema:O,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:y,PromptArgumentSchema:d,PromptSchema:h,PromptListChangedNotificationSchema:S,TextContentSchema:I,ImageContentSchema:D,AudioContentSchema:B,ToolUseContentSchema:J,EmbeddedResourceSchema:ce,ResourceLinkSchema:we,ContentBlockSchema:k,PromptMessageSchema:A,ToolAnnotationsSchema:U,ToolListChangedNotificationSchema:Y,ModelHintSchema:te,ModelPreferencesSchema:oe,ToolChoiceSchema:pe,BooleanSchemaSchema:Ce,StringSchemaSchema:$e,NumberSchemaSchema:Oe,UntitledSingleSelectEnumSchemaSchema:Ee,TitledSingleSelectEnumSchemaSchema:Ye,LegacyTitledEnumSchemaSchema:xe,SingleSelectEnumSchemaSchema:ct,UntitledMultiSelectEnumSchemaSchema:Qe,TitledMultiSelectEnumSchemaSchema:ut,MultiSelectEnumSchemaSchema:pt,EnumSchemaSchema:mt,PrimitiveSchemaDefinitionSchema:zt,ElicitRequestFormParamsSchema:Pt,ResourceTemplateReferenceSchema:Et,PromptReferenceSchema:Tt,RootSchema:ar,ClientCapabilities2026Schema:cr,ServerCapabilities2026Schema:Dt,RequestMetaEnvelopeSchema:Ut,ToolSchema:kt,ToolResultContentSchema:ur,SamplingMessageContentBlockSchema:Zt,SamplingMessageSchema:Ct,ResultTypeSchema:Vt,ResultMetaSchema:Ft,ResultSchema:lr,PaginatedResultSchema:mo,CallToolResultSchema:Jt,ListToolsResultSchema:dr,ListPromptsResultSchema:fr,GetPromptResultSchema:hr,ListResourcesResultSchema:pr,ListResourceTemplatesResultSchema:mr,ReadResourceResultSchema:gr,CompleteResultSchema:_r,CacheableResultSchema:go,DiscoverResultSchema:yr,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vr,ListRootsRequestSchema:Sr,CreateMessageResultSchema:br,ListRootsResultSchema:wr,ElicitResultSchema:$r,ElicitRequestURLParamsSchema:Rr,ElicitRequestParamsSchema:zr,ElicitRequestSchema:Pr,InputRequestSchema:Er,InputResponseSchema:kr,InputRequestsSchema:Cr,InputResponsesSchema:Ir,InputRequiredResultSchema:It,InputResponseRequestParamsSchema:_o,CallToolRequestSchema:vo,ListToolsRequestSchema:So,ListPromptsRequestSchema:bo,GetPromptRequestSchema:wo,ListResourcesRequestSchema:$o,ListResourceTemplatesRequestSchema:Ro,ReadResourceRequestSchema:zo,CompleteRequestSchema:Po,DiscoverRequestSchema:Eo,SubscriptionFilterSchema:Bt,SubscriptionsListenRequestSchema:To,SubscriptionsListenResultMetaSchema:ko,SubscriptionsListenResultSchema:Ar,dispatchRequestSchemas:yt,dispatchResultSchemas:Co,NotificationMetaSchema:Nt,SubscriptionsAcknowledgedNotificationSchema:Kt,CancelledNotificationParamsSchema:Gt,CancelledNotificationSchema:Wt,notificationSchemas2026:xn,JSONRPCResultResponseSchema:Le(lr),CallToolResultResponseSchema:Le(ae([Jt,It])),ListToolsResultResponseSchema:Le(dr),ListPromptsResultResponseSchema:Le(fr),GetPromptResultResponseSchema:Le(ae([hr,It])),ListResourcesResultResponseSchema:Le(pr),ListResourceTemplatesResultResponseSchema:Le(mr),ReadResourceResultResponseSchema:Le(ae([gr,It])),CompleteResultResponseSchema:Le(_r),DiscoverResultResponseSchema:Le(yr),SubscriptionsListenResultResponseSchema:Le(Ar)}}var Hm;function $t(){return Hm??=Fm()}var Jm=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Bm(e){return Jm.includes(e)}var bi=Symbol("modelcontextprotocol.resultCacheHintFallback");function Km(e){return e[bi]}function Bd(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Kd(e){return e==="public"||e==="private"}var ne=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}({}),be=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Fe(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 Fe(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",Rt(this,new.target)}static fromError(t,r,o){if(t===ne.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Wd(n.elicitations,r)}if(t===ne.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new lo({supported:n.supported,requested:n.requested},r)}if(t===ne.InvalidParams||t===ne.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===ne.ResourceNotFound||Object.keys(n).length===1))return new Gd(n.uri,r)}if(t===ne.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new Yd({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Gd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ne.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Wd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ne.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},lo=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ne.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Yd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ne.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Gm=0,Wm="private",Ym=["tools/call","prompts/get","resources/read"];function Xm(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Ym.includes(e))return t;throw new be(ne.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Qm(e,t){let r=Km(t);if(t.resultType!=="complete"||!Bm(e))return r===void 0?t:ng(t);let o=t,n=Bd(o.ttlMs)?o.ttlMs:rg(r),s=Kd(o.cacheScope)?o.cacheScope:og(r),i={...o,ttlMs:n,cacheScope:s};return delete i[bi],i}function eg(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function tg(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[_a]:t}};if(!eg(r))return e;if(r[_a]!==void 0)return e;return{...e,_meta:{...r,[_a]:t}}}function rg(e){return e!==void 0&&Bd(e.ttlMs)?e.ttlMs:Gm}function og(e){return e!==void 0&&Kd(e.cacheScope)?e.cacheScope:Wm}function ng(e){let t={...e};return delete t[bi],t}var sg=["elicitation/create","sampling/createMessage","roots/list"],vn;function Xd(){if(vn)return vn;let e=$t();return vn={request:{"elicitation/create":M({method:H("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":M({method:H("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":M({method:H("roots/list"),params:_e({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},vn}function Qd(e){return sg.includes(e)}function ci(e){return Qd(e)?Xd().request[e]:void 0}function ig(e){return Qd(e)?Xd().response[e]:void 0}var wi={"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},ef={"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 tf(e){return Object.prototype.hasOwnProperty.call(wi,e)}function rf(e){return Object.prototype.hasOwnProperty.call(ef,e)}function ag(e){return Object.prototype.hasOwnProperty.call(wi,e)}function cg(e){return tf(e)?$t().dispatchRequestSchemas[e]:void 0}function ug(e){return ag(e)?$t().dispatchResultSchemas[e]:void 0}function lg(e){return rf(e)?$t().notificationSchemas2026[e]:void 0}var v0=Object.keys(wi),S0=Object.keys(ef);function so(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function oo(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 dg={ok:!1,reason:"not-in-era"},fg=[ss,Tr];function hg(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((c)=>so(c)&&("execution"in c)))n().tools=s.map((c)=>{if(!so(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a});let i=t.capabilities;if(so(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var $i={era:"2026-07-28",hasRequestMethod:tf,hasNotificationMethod:rf,hasInputRequestMethod:(e)=>ci(e)!==void 0,validateRequest:(e,t)=>oo(cg(e),t),validateResult:(e,t)=>oo(ug(e),t),validateNotification:(e,t)=>oo(lg(e),t),validateInputRequest:(e,t)=>oo(ci(e),t),validateInputResponse:(e,t)=>oo(ig(e),t),samplingResultVariant:()=>dg,outboundEnvelope(e){return{[ss]:e.protocolVersion,[iu]:e.clientInfo,[Tr]:e.clientCapabilities,...e.logLevel!==void 0&&{[Qu]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of fg)if(!(o in e))t.push({key:o,problem:"missing"});let r=$t().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)=>Ld(e),inputRequestSchema:ci,decodeResult(e,t){if(!so(t))return{kind:"invalid",error:new X(ee.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new X(ee.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 X(ee.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,c=so(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:$t().ResultMetaSchema.safeParse(t._meta),l=u?.success?u.data:void 0;if(Object.keys(c).length===0&&typeof a!=="string")return{kind:"invalid",error:new X(ee.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:c,...typeof a==="string"&&{requestState:a},...l!==void 0&&{_meta:l}}}if(r!=="complete")return{kind:"invalid",error:new X(ee.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=pg(),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 X(ee.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 tg(Qm(e,Xm(e,hg(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=$t().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("; ")}`}},Sn;function pg(){if(Sn)return Sn;let e=$t();return Sn={"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},Sn}var $n="2026-07-28";function ft(e){return e!==void 0&&ht(e)?$i:Si}function Td(e){if(e.revision!==void 0)return ft(e.revision).era;return e.era==="modern"?$i.era:Si.era}function ui(e){return of.some((t)=>t.hasRequestMethod(e))}function li(e){return of.some((t)=>t.hasNotificationMethod(e))}function kd(e){return e==="tasks/get"||e==="tasks/cancel"}var of=[Si,$i],mg=Vi({AnnotationsSchema:()=>vm,AudioContentSchema:()=>QS,BaseMetadataSchema:()=>gm,BaseRequestParamsSchema:()=>to,BlobResourceContentsSchema:()=>eT,BooleanSchemaSchema:()=>tw,CallToolRequestParamsSchema:()=>gx,CallToolRequestSchema:()=>yx,CallToolResultSchema:()=>nT,CancelTaskRequestSchema:()=>aF,CancelTaskResultSchema:()=>cF,CancelledNotificationParamsSchema:()=>R_,CancelledNotificationSchema:()=>KA,ClientCapabilitiesSchema:()=>k_,ClientNotificationSchema:()=>lF,ClientRequestSchema:()=>dF,ClientResultSchema:()=>uF,ClientTasksCapabilitySchema:()=>A_,CompatibilityCallToolResultSchema:()=>X0,CompleteRequestParamsSchema:()=>Wx,CompleteRequestSchema:()=>zx,CompleteResultSchema:()=>jx,ContentBlockSchema:()=>ew,CreateMessageRequestParamsSchema:()=>_x,CreateMessageRequestSchema:()=>xx,CreateMessageResultSchema:()=>Cx,CreateMessageResultWithToolsSchema:()=>Dx,CreateTaskResultSchema:()=>Q0,CursorSchema:()=>VA,DiscoverRequestSchema:()=>x_,DiscoverResultSchema:()=>cv,ElicitRequestFormParamsSchema:()=>Dh,ElicitRequestParamsSchema:()=>Lx,ElicitRequestSchema:()=>Bx,ElicitRequestURLParamsSchema:()=>Fx,ElicitResultSchema:()=>Hx,ElicitationCompleteNotificationParamsSchema:()=>$x,ElicitationCompleteNotificationSchema:()=>Ux,EmbeddedResourceSchema:()=>ax,EmptyResultSchema:()=>jA,EnumSchemaSchema:()=>Nx,GetPromptRequestParamsSchema:()=>ix,GetPromptRequestSchema:()=>ox,GetPromptResultSchema:()=>lx,GetTaskPayloadRequestSchema:()=>nF,GetTaskPayloadResultSchema:()=>iF,GetTaskRequestSchema:()=>tF,GetTaskResultSchema:()=>rF,IconSchema:()=>P_,IconsSchema:()=>Th,ImageContentSchema:()=>ZS,ImplementationSchema:()=>YS,InitializeRequestParamsSchema:()=>E_,InitializeRequestSchema:()=>GA,InitializeResultSchema:()=>I_,InitializedNotificationSchema:()=>__,JSONArraySchema:()=>Y0,JSONObjectSchema:()=>Hi,JSONRPCErrorResponseSchema:()=>av,JSONRPCMessageSchema:()=>ep,JSONRPCNotificationSchema:()=>GS,JSONRPCRequestSchema:()=>KS,JSONRPCResponseSchema:()=>J0,JSONRPCResultResponseSchema:()=>sv,JSONValueSchema:()=>Ph,LegacyTitledEnumSchemaSchema:()=>iw,ListChangedOptionsBaseSchema:()=>iT,ListPromptsRequestSchema:()=>rx,ListPromptsResultSchema:()=>nx,ListResourceTemplatesRequestSchema:()=>F_,ListResourceTemplatesResultSchema:()=>L_,ListResourcesRequestSchema:()=>M_,ListResourcesResultSchema:()=>N_,ListRootsRequestSchema:()=>Gx,ListRootsResultSchema:()=>Yx,ListTasksRequestSchema:()=>oF,ListTasksResultSchema:()=>sF,ListToolsRequestSchema:()=>fx,ListToolsResultSchema:()=>hx,LoggingLevelSchema:()=>_h,LoggingMessageNotificationParamsSchema:()=>wx,LoggingMessageNotificationSchema:()=>Rx,ModelHintSchema:()=>Px,ModelPreferencesSchema:()=>Ax,MultiSelectEnumSchemaSchema:()=>Mx,NotificationSchema:()=>Qs,NotificationsParamsSchema:()=>Zs,NumberSchemaSchema:()=>Ch,PaginatedRequestParamsSchema:()=>ym,PaginatedRequestSchema:()=>kh,PaginatedResultSchema:()=>tl,PingRequestSchema:()=>JA,PrimitiveSchemaDefinitionSchema:()=>aw,ProgressNotificationParamsSchema:()=>D_,ProgressNotificationSchema:()=>XA,ProgressSchema:()=>C_,ProgressTokenSchema:()=>qA,PromptArgumentSchema:()=>ex,PromptListChangedNotificationSchema:()=>ux,PromptMessageSchema:()=>dx,PromptReferenceSchema:()=>Vx,PromptSchema:()=>tx,ReadResourceRequestParamsSchema:()=>B_,ReadResourceRequestSchema:()=>$_,ReadResourceResultSchema:()=>U_,RelatedTaskMetadataSchema:()=>w_,RequestIdSchema:()=>Ah,RequestMetaSchema:()=>WA,RequestSchema:()=>qi,ResourceContentsSchema:()=>ZA,ResourceLinkSchema:()=>cx,ResourceListChangedNotificationSchema:()=>H_,ResourceRequestParamsSchema:()=>JS,ResourceSchema:()=>Ih,ResourceTemplateReferenceSchema:()=>qx,ResourceTemplateSchema:()=>O_,ResourceUpdatedNotificationParamsSchema:()=>Z_,ResourceUpdatedNotificationSchema:()=>Q_,ResultMetaObjectSchema:()=>zA,ResultSchema:()=>Zn,RoleSchema:()=>Eh,RootSchema:()=>Kx,RootsListChangedNotificationSchema:()=>Jx,SamplingContentSchema:()=>Ex,SamplingMessageContentBlockSchema:()=>dv,SamplingMessageSchema:()=>Ix,ServerCapabilitiesSchema:()=>YA,ServerNotificationSchema:()=>mF,ServerRequestSchema:()=>pF,ServerResultSchema:()=>fF,ServerTasksCapabilitySchema:()=>T_,SetLevelRequestParamsSchema:()=>bx,SetLevelRequestSchema:()=>Sx,SingleSelectEnumSchemaSchema:()=>Ox,StringSchemaSchema:()=>xh,SubscribeRequestParamsSchema:()=>q_,SubscribeRequestSchema:()=>V_,SubscriptionFilterSchema:()=>tT,SubscriptionsAcknowledgedNotificationParamsSchema:()=>G_,SubscriptionsAcknowledgedNotificationSchema:()=>Y_,SubscriptionsListenRequestParamsSchema:()=>j_,SubscriptionsListenRequestSchema:()=>K_,SubscriptionsListenResultMetaSchema:()=>J_,SubscriptionsListenResultSchema:()=>X_,TaskAugmentedRequestParamsSchema:()=>ov,TaskCreationParamsSchema:()=>Z0,TaskMetadataSchema:()=>S_,TaskSchema:()=>Oh,TaskStatusNotificationParamsSchema:()=>Zx,TaskStatusNotificationSchema:()=>eF,TaskStatusSchema:()=>Xx,TextContentSchema:()=>XS,TextResourceContentsSchema:()=>QA,TitledMultiSelectEnumSchemaSchema:()=>sw,TitledSingleSelectEnumSchemaSchema:()=>nw,ToolAnnotationsSchema:()=>px,ToolChoiceSchema:()=>Tx,ToolExecutionSchema:()=>mx,ToolListChangedNotificationSchema:()=>vx,ToolResultContentSchema:()=>kx,ToolSchema:()=>rT,ToolUseContentSchema:()=>sx,UnsubscribeRequestParamsSchema:()=>W_,UnsubscribeRequestSchema:()=>z_,UntitledMultiSelectEnumSchemaSchema:()=>ow,UntitledSingleSelectEnumSchemaSchema:()=>rw});var Rn=(e)=>KS.safeParse(e).success,nf=(e)=>GS.safeParse(e).success,or=(e)=>sv.safeParse(e).success,fo=(e)=>av.safeParse(e).success;var sf=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var gg="Mcp-Param-",Cd="x-mcp-header",_g=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,yg=new Set(["string","integer","boolean"]);function Ri(e){let t=[],r=new Map,o,n=(i,c,a)=>{if(i===null||typeof i!=="object")return;let u=i;if(Cd in u){if(!a||c.length===0)return`${bn(c)}: 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 f=u[Cd];if(typeof f!=="string"||f.length===0)return`${bn(c)}: x-mcp-header MUST be a non-empty string`;if(!_g.test(f))return`${bn(c)}: x-mcp-header '${f}' 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||!yg.has(m)){let b=`${bn(c)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return b;o??=b}let v=f.toLowerCase(),g=r.get(v);if(g!==void 0)return`x-mcp-header '${f}' is not case-insensitively unique (also declared as '${g}')`;r.set(v,f),t.push({path:c,headerName:f,type:m})}let l=u.properties;if(l!==null&&typeof l==="object")for(let[f,m]of Object.entries(l)){let v=n(m,[...c,f],a);if(v!==void 0)return v}for(let f of vg){let m=u[f];if(m===void 0)continue;let v=Array.isArray(m)?m:m!==null&&typeof m==="object"&&Sg.has(f)?Object.values(m):[m];for(let g of v){let b=n(g,[...c,`<${f}>`],!1);if(b!==void 0)return b}}},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 vg=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Sg=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function bn(e){return e.length===0?"<root>":e.join(".")}var af="=?base64?",cf="?=";function bg(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 wg(e){if(e.length===0)return!0;if(e.startsWith(af)&&e.endsWith(cf))return!0;if(e!==e.trim())return!0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);if(r===9||r>=32&&r<=126)continue;return!0}return!1}function $g(e){let t=new TextEncoder().encode(e),r="";for(let o of t)r+=String.fromCodePoint(o);return btoa(r)}function uf(e){return wg(e)?`${af}${$g(e)}${cf}`:e}function Rg(e,t){let r=e;for(let o of t){if(r===null||typeof r!=="object")return;r=r[o]}return r}function lf(e,t){let r={};for(let o of e){let n=Rg(t,o.path);if(n===void 0||n===null)continue;let s=bg(n);if(s===void 0)continue;r[`${gg}${o.headerName}`]=uf(s)}return r}var rr=-32020,b0=[{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:[ne.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:[rr,ne.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:[ne.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:[ne.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:[ne.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:[rr],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:[ne.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:[rr],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."}],w0={[ne.ParseError]:400,[ne.InvalidRequest]:400,[ne.MethodNotFound]:404,[ne.UnsupportedProtocolVersion]:400,[ne.MissingRequiredClientCapability]:400,[rr]:400};function zn(e,t){return fn(e,t)}function no(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function pi(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 Id=!1,mi="draft-2020-12";function zg(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:mi});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(!Id)Id=!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=ln(e,{target:mi,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 df(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 Pg=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function df(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref==="string"&&Pg.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"||df(s,"$id"in s?{}:t)))}return!1}function Eg(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 di(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>Eg(o)).join(", ")};return{success:!0,data:r.value}}function Tg(e){let t=ln(e,{target:mi,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var kg=/\\\.\\d\{(\d+)\}/;function Cg(e){let t=kg.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)=>ai({local:o,offset:n,precision:s}))))}function Ig(e,t){let r;switch(e){case"email":r=[fd()];break;case"uri":r=[pd()];break;case"date":r=[bm()];break;case"date-time":r=Cg(t);break}return new Set(r.map((o)=>Tg(o)).filter((o)=>o!==void 0))}function Og(e,t,r){if(r!=="zod")return!0;return Ig(e,t).has(t)}function ao(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ng(e){try{return zg(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new be(ne.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var xg=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function zi(e){return xg.has(e)||e.startsWith("x-")}var Ag=new Set(["$schema",...Object.keys(Dh.shape.requestedSchema.shape)]),Od={string:no([xh,rw,nw,iw]),number:no([Ch]),integer:no([Ch]),boolean:no([tw]),array:no([ow,sw])},Mg=new Set(xh.shape.format.unwrap().options);function jg(e,t,r,o){if(!ao(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(Od,e.type)?Od[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))if(n.has(i)||zi(i))s[i]=c;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Mg.has(e.format))s[i]=c;else if(typeof c!=="string"||!Og(e.format,c,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function qg(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&ao(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,jg(c,`properties.${i}`,t,o)]));else if(Ag.has(n))r[n]=s;else if(!zi(n))o.push(n);if(o.length>0)throw new be(ne.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Lg(e,t){if(!ao(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!zn(aw,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function gi(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>gi(o,t[n],`${r}[${n}]`));if(!ao(e)||!ao(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return zi(o)?[]:[s];return gi(n,t[o],s)})}function Dg(e){if(!pi(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=qg(Ng(e.requestedSchema),t),o=zn(Dh.shape.requestedSchema,r);if(!o.success)throw new be(ne.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Lg(r,o.error.message)}`);let n=gi(r,o.data);if(n.length>0)throw new be(ne.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 be(ne.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Ug(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 $0=Object.assign(Ug,{elicit(e){try{return{method:"elicitation/create",params:Dg(e)}}catch(t){throw t instanceof be?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Zg=!0,Vg=10,Fg=250;function ff(e){return{autoFulfill:e?.autoFulfill??Zg,maxRounds:e?.maxRounds??Vg}}function Hg(e,t,r){let o=t!==void 0&&Object.keys(t).length>0;if(!o&&r===void 0)return e;return{...e,...o&&{inputResponses:t},...r!==void 0&&{requestState:r}}}function Jg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Bg(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof X?t.reason:new X(ee.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof X?t.reason:new X(ee.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Kg(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)}}async function Gg(e){let{config:t,method:r,originalParams:o,requestOptions:n,hooks:s,signal:i}=e,c=e.flowStartedAt??Date.now(),a=e.firstPayload,u=0;while(!0){if(u+=1,u>t.maxRounds)throw new X(ee.InputRequiredRoundsExceeded,Jg(r,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:a.inputRequests,...a.requestState!==void 0&&{requestState:a.requestState}}});n.onprogress?.({progress:u,message:`Fulfilling input required by '${r}' (round ${u})`});let l=Object.entries(a.inputRequests??{}),f;if(l.length>0){let g=Kg(i);try{let b=await Promise.all(l.map(async([R,p])=>{try{return[R,await s.dispatchInputRequest(R,p,g.signal)]}catch(T){throw g.abort(T),T}}));f=Object.fromEntries(b)}finally{g.dispose()}}else await Bg(Fg,i);let m={...n.timeout!==void 0&&{timeout:n.timeout}};if(n.maxTotalTimeout!==void 0){let g=Date.now()-c,b=n.maxTotalTimeout-g;if(b<=0)throw new X(ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:g});m.maxTotalTimeout=b}let v=await s.retry(Hg(o,f,a.requestState),m);if(sf(v)){a={inputRequests:v.inputRequests??{},...v.requestState!==void 0&&{requestState:v.requestState}};continue}return v}}var Wg=["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"],Yg={IdJagTokenExchangeResponseSchema:rC,OAuthClientInformationFullSchema:oC,OAuthClientInformationSchema:iC,OAuthClientMetadataSchema:nC,OAuthClientRegistrationErrorSchema:hF,OAuthErrorResponseSchema:aT,OAuthMetadataSchema:oT,OAuthProtectedResourceMetadataSchema:Qx,OAuthTokenRevocationRequestSchema:gF,OAuthTokensSchema:sT,OpenIdProviderDiscoveryMetadataSchema:tC,OpenIdProviderMetadataSchema:eC},hf={},pf={};function mf(e,t){let r=e.slice(0,-6);hf[r]=t,pf[r]=(o)=>t.safeParse(o).success}for(let e of Wg)mf(e,mg[e]);for(let[e,t]of Object.entries(Yg))mf(e,t);var Xg=Object.freeze(hf),Pi=Object.freeze(pf);function Qg(e){switch(e){case"initialize":case"notifications/initialized":return ft(void 0);case"server/discover":return ft($n);default:return}}var ho=60000,e_=[ss,iu,Tr,Qu],t_=["inputResponses","requestState"];function Nd(e,t){let r=e.params;if(!io(r))return{message:e,lifted:{}};let o=r._meta,n=io(o)?e_.filter((a)=>(a in o)):[],s=t==="request"?t_.filter((a)=>(a in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&io(o)){let a={},u={...o};for(let l of n)a[l]=o[l],delete u[l];if(i.envelope=a,Object.keys(u).length>0)c._meta=u;else delete c._meta}for(let a of s){if(a==="inputResponses")i.inputResponses=c[a];if(a==="requestState")i.requestState=c[a];delete c[a]}return{message:{...e,params:c},lifted:i}}function xd(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 Ei(e){return()=>e}var r_=Ei(void 0),o_,Ti=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{o_=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??iv,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 X(ee.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 X(ee.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),or(n)||fo(n))this._onresponse(n);else if(Rn(n))this._onrequest(n,s);else if(nf(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 X(ee.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}=Nd(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Td(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(li(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}=Nd(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=(b,R,p)=>{let T={jsonrpc:"2.0",id:r.id,error:{code:b,message:R,...p!==void 0&&{data:p}}};s?.send(T).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(t?.classification!==void 0){let b=Td(t.classification);if(b!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${b} but this instance serves ${n.era}`));let R=t.classification.revision??b;i(ne.UnsupportedProtocolVersion,`Unsupported protocol version: ${R}`,{supported:this._supportedProtocolVersions,requested:R});return}}if(ui(r.method)&&!n.hasRequestMethod(r.method)&&!(kd(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(ne.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(ne.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(ne.InvalidParams,a);return}let u=(b,R)=>this._notificationViaCodec(this._resolveOutboundCodec(b.method),b,{...R,relatedRequestId:r.id}),l=(b,R,p)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(b.method),b,R,{...p,relatedRequestId:r.id}),f=new AbortController;this._requestHandlerAbortControllers.set(r.id,f);let m=o.inputResponses===void 0?void 0:n_(o.inputResponses),v={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?r_:Ei(o.requestState),signal:f.signal,send:(b,R,p)=>{let T=this._resolveOutboundCodec(b.method);if(this._assertOutboundRequestInEra(T,b.method),pi(R))return l(b,R,p);let w=xd(T,b.method);if(w===void 0)throw TypeError(`'${b.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(b,w,R)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},g=this.buildContext(v,t);Promise.resolve().then(()=>c(r,g)).then(async(b)=>{if(f.signal.aborted)return;let R;try{R=n.encodeResult(r.method,b,this._outboundServerInfo())}catch(T){this._onerror(Error(`Failed to encode result for ${r.method}: ${T}`)),i(ne.InternalError,"Internal error");return}let p={result:R,jsonrpc:"2.0",id:r.id};await s?.send(p)},async(b)=>{if(f.signal.aborted)return;let R=Number.isSafeInteger(b.code)?b.code:ne.InternalError,p={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(R),message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};await s?.send(p)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===f)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(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(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),or(e))r(e);else r(be.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(pi(t)){if(!kd(e.method))this._assertOutboundRequestInEra(o,e.method);return this._requestWithSchemaViaCodec(o,e,t,r)}this._assertOutboundRequestInEra(o,e.method);let n=xd(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=Qg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ui(t)&&!e.hasRequestMethod(t))throw new X(ee.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=o??{},a=Date.now(),u,l;return new Promise((f,m)=>{let v=(z)=>{m(z)};if(!this._transport){v(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(z){v(z);return}if(o?.signal?.aborted){let z=o.signal.reason;throw z instanceof X?z:new X(ee.RequestTimeout,String(z))}let g=e.era===$n&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,b=this._requestMessageId++;l=b;let R={...t,jsonrpc:"2.0",id:b};if(o?.onprogress)this._progressHandlers.set(b,o.onprogress),R.params={...t.params,_meta:{...t.params?._meta,progressToken:b}};let p=this._envelopeOutbound(R),T=!1,w=(z)=>{if(T)return;if(this._progressHandlers.delete(b),g===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(z)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((_)=>this._onerror(Error(`Failed to send cancellation: ${_}`)))}else g.abort();m(z instanceof X?z:new X(ee.RequestTimeout,String(z)))};this._responseHandlers.set(b,(z)=>{if(o?.signal?.aborted)return;if(T=!0,z instanceof Error)return m(z);let _;try{_=e.decodeResult(t.method,z.result)}catch(q){return m(q instanceof Error?q:Error(String(q)))}if(_.kind==="invalid")return m(_.error);if(_.kind==="input_required"){if(o?.allowInputRequired===!0)return f(c_(_));let q={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(F,j)=>this._requestWithSchemaViaCodec(e,F===void 0?{method:t.method}:{method:t.method,params:F},r,j)};return f(this._resolveNonCompleteResult(_,q))}let C=_.result;di(r,C).then((q)=>{if(q.success)f(q.data);else m(new X(ee.InvalidResult,`Invalid result for ${t.method}: ${q.error}`))},m)}),u=()=>w(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let E=o?.timeout??ho,N=()=>w(new X(ee.RequestTimeout,"Request timed out",{timeout:E}));this._setupTimeout(b,E,o?.maxTotalTimeout,N,o?.resetTimeoutOnProgress??!1),this._transport.send(p,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:g?.signal}).catch((z)=>{this._progressHandlers.delete(b),m(z)})}).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 X(ee.NotConnected,"Not connected");if(li(t.method)&&!e.hasNotificationMethod(t.method))throw new X(ee.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(!ui(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(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era")c=i.validateInputRequest(e,n);if(!c.ok){if(c.reason==="not-in-era")throw new be(ne.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(c.message)}return Promise.resolve(t(c.value,s))}}else if(r)o=async(n,s)=>{let i=await di(t.params,{...n.params});if(!i.success)throw new be(ne.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(!li(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 be(ne.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 di(t.params,{...o.params});if(!n.success)throw new be(ne.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function io(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ki(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]=io(i)&&io(s)?{...i,...s}:s}return r}function wn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function n_(e){let t={},r=[];if(!wn(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!wn(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Ad(e){throw new X(ee.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function s_(e,t,r,o,n){return{sessionId:n,mcpReq:{id:e,method:t,_meta:r?._meta,requestState:Ei(void 0),signal:o,send:()=>Ad("send"),notify:()=>Ad("notify")}}}async function i_(e,t,r,o,n){if(!wn(o)||typeof o.method!=="string")throw new X(ee.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let s=o.method;if(!t.hasInputRequestMethod(s))throw new X(ee.InvalidResult,`Invalid input request '${r}': '${s}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:s});let i=e.getRequestHandler(s);if(i===void 0)throw new X(ee.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${s}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:s});let c=wn(o.params)?o.params:void 0;return await i({jsonrpc:"2.0",id:r,method:s,...c!==void 0&&{params:c}},e.buildContext(s_(r,s,c,n,e.sessionId)))}function a_(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function gf(e,t,r,o){let{codec:n,request:s,options:i,flowStartedAt:c}=o,a={inputRequests:r.inputRequests,...r.requestState!==void 0&&{requestState:r.requestState}},u={dispatchInputRequest:(l,f,m)=>i_(e,n,l,f,m),retry:(l,f)=>o.retry(l,a_(i,f))};return Gg({config:t,method:s.method,originalParams:s.params,firstPayload:a,flowStartedAt:c,signal:i?.signal,requestOptions:{...i?.timeout!==void 0&&{timeout:i.timeout},...i?.maxTotalTimeout!==void 0&&{maxTotalTimeout:i.maxTotalTimeout},...i?.onprogress!==void 0&&{onprogress:i.onprogress}},hooks:u})}function c_(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function gl(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;gl(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 _l=new Set(["type","properties","required","additionalProperties"]),pl=["oneOf","anyOf"];function ml(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 Ps(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!_l.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let c=[];for(let u of t){let l=u.properties?.[i]??ml(u);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let a=c.length===1?c[0]:Ps(c)??{allOf:c};Be(r,i,a)}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 c=ml(i);if(c&&!s.some((a)=>JSON.stringify(a)===JSON.stringify(c)))s.push(c)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function lp(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of _l)if(n in e)return;let r=t.filter((n)=>pl.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=Ps(t);else{let n=r[0],s=pl.find((a)=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let i=t.filter((a)=>a!==n),c=n[s].map((a)=>Ps([...i,a]));if(c.some((a)=>!a))return;o={[s]:c}}if(!o)return;delete e.allOf,Gr(e,o)}function Qr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(c)=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,l={...u},f=a.ref;if(a.ref=null,f){o(f);let v=e.seen.get(f),g=v.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(g);else Gr(u,g);if(Gr(u,l),c._zod.parent===f)for(let R in u){if(R==="$ref"||R==="allOf")continue;if(!(R in l))delete u[R]}if(g.$ref&&v.def)for(let R in u){if(R==="$ref"||R==="allOf")continue;if(R in v.def&&JSON.stringify(u[R])===JSON.stringify(v.def[R]))delete u[R]}}let m=c._zod.parent;if(m&&m!==f){o(m);let v=e.seen.get(m);if(v?.schema.$ref){if(u.$ref=v.schema.$ref,v.def)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(g in v.def&&JSON.stringify(u[g])===JSON.stringify(v.def[g]))delete u[g]}}}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())gl(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(u);else c.set(l,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])lp(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 c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Gr(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 c of e.seen.entries()){let a=c[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;Be(i,a.defId,a.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 c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Wr(t,"input",e.processors),output:Wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function De(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 De(o.element,r);if(o.type==="set")return De(o.valueType,r);if(o.type==="lazy")return De(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 De(o.innerType,r);if(o.type==="intersection")return De(o.left,r)||De(o.right,r);if(o.type==="record"||o.type==="map")return De(o.keyType,r)||De(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return De(o.in,r)||De(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(De(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(De(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(De(n,r))return!0;if(o.rest&&De(o.rest,r))return!0;return!1}return!1}var yl=(e,t={})=>(r)=>{let o=Yr({...r,processors:t});return Re(e,o),Xr(o,e),Qr(o,e)},Wr=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=Yr({...n??{},target:s,io:t,processors:r});return Re(e,i),Xr(i,e),Qr(i,e)};var Qt=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},er=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},vl=(e,t)=>{Qt(e,"minimum",t),er(e,"maximum",t)},Rl=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},zl=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Pl=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},El=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Sl=(e,t)=>Qt(e,"minimum",t.minimum),bl=(e,t)=>er(e,"maximum",t.maximum),wl=(e)=>(t,r)=>{El(t,r.format);let[o,n]=e[r.format];Qt(t,"minimum",o),er(t,"maximum",n)},dp={greater_than:(e,t)=>Qt(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>er(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Rl(e,t.value),number_format:wl(xo),bigint_format:wl(Dn),min_length:Sl,max_length:bl,length_equals:(e,t)=>vl(e,t.length),min_size:Sl,max_size:bl,size_equals:(e,t)=>vl(e,t.size),string_format:(e,t)=>{if(El(e,t.format),t.pattern)zl(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)=>Pl(e,t.mime)};function Ve(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)dp[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Qt(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Qt(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)er(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)er(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Rl(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)Pl(t,n.mime);for(let s of n.patterns??[])zl(t,s);return t}var hp={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pp=new Map([[rs,Ha],[Wo,Ja]]),Tl=(e)=>pp.get(e)??e,ks=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:l}=Ve(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(c){if(n.format=hp[c]??c,n.format==="")delete n.format;if(c==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(a&&a.size>0){let f=[...a].map(Tl);if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Cs=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:l}=Ve(e);n.type=l?"integer":"number";let f=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof a==="number"&&a<=(i??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(v)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(v)n.maximum=a,n.exclusiveMaximum=!0;else n.exclusiveMaximum=a;else if(typeof i==="number")n.maximum=i;if(c){let g=new Set;for(let p of c)if(Number.isFinite(p)&&p!==0)g.add(Math.abs(p));else Ae(e,t,n,o,`A multipleOf divisor of ${p} cannot be represented in JSON Schema`);let[b,...R]=g;if(b!==void 0)n.multipleOf=b;if(R.length)n.allOf=[...n.allOf??[],...R.map((p)=>({multipleOf:p}))]}},Is=(e,t,r,o)=>{r.type="boolean"},kl=(e,t,r,o)=>{Ae(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Cl=(e,t,r,o)=>{Ae(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Os=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Il=(e,t,r,o)=>{Ae(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Ol=(e,t,r,o)=>{Ae(e,t,r,o,"Void cannot be represented in JSON Schema")},Ns=(e,t,r,o)=>{r.not={}},Nl=(e,t,r,o)=>{},xs=(e,t,r,o)=>{},xl=(e,t,r,o)=>{Ae(e,t,r,o,"Date cannot be represented in JSON Schema")},As=(e,t,r,o)=>{let n=e._zod.def,s=jr(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},Ms=(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(Ae(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Ae(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}},Al=(e,t,r,o)=>{Ae(e,t,r,o,"NaN cannot be represented in JSON Schema")},Ml=(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},jl=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=Ve(e);if(s!==void 0)n.minLength=s;if(i!==void 0)n.maxLength=i;if(!c)return;if(c.length===0)n.not={};else if(c.length===1)n.contentMediaType=c[0];else n.anyOf=c.map((a)=>({contentMediaType:a}))},ql=(e,t,r,o)=>{r.type="boolean"},js=(e,t,r,o)=>{Ae(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Ll=(e,t,r,o)=>{Ae(e,t,r,o,"Function types cannot be represented in JSON Schema")},qs=(e,t,r,o)=>{Ae(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Dl=(e,t,r,o)=>{Ae(e,t,r,o,"Map cannot be represented in JSON Schema")},Ul=(e,t,r,o)=>{Ae(e,t,r,o,"Set cannot be represented in JSON Schema")},Ls=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=Ve(e);if(typeof i==="number")n.minItems=i;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=Re(s.element,t,{...o,path:[...o.path,"items"]})};function eo(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return eo(t.out);if(t.type==="catch")return eo(t.innerType);return e._zod.optin}var Ds=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Ae(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)Be(n.properties,u,Re(i[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?eo(l)===void 0:l._zod.optout===void 0)a.push(u)}if(a.length>0)n.required=a;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=Re(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Us=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,a)=>Re(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",a]}));if(s)r.oneOf=i;else r.anyOf=i},Zs=(e,t,r,o)=>{let n=e._zod.def,s=Re(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Re(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)},Zl=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((b,R)=>Re(b,t,{...o,path:[...o.path,i,R]})),u=s.rest?Re(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,l=s.items.length;while(l>0){let b=s.items[l-1];if(!(t.io==="input"?eo(b)!==void 0:b._zod.optout==="optional"))break;l--}let f=s.items.length,m=!s.rest;if(t.target==="draft-2020-12"){if(n.prefixItems=a,m)n.items=!1;else if(u)n.items=u;if(l>0)n.minItems=l;if(m)n.maxItems=f}else if(t.target==="openapi-3.0"){if(n.items={anyOf:a},u)n.items.anyOf.push(u);if(l>0)n.minItems=l;if(m)n.maxItems=f}else{if(n.items=a,m)n.additionalItems=!1;else if(u)n.additionalItems=u;if(l>0)n.minItems=l;if(m)n.maxItems=f}let{minimum:v,maximum:g}=Ve(e);if(typeof v==="number")n.minItems=v;if(typeof g==="number")n.maxItems=g};function Es(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let b=Es(e,g,r);return b===g?t:b}for(let g of["anyOf","oneOf"]){let b=t[g];if(!Array.isArray(b))continue;let R=b.map((p)=>Es(e,p,r));if(R.some((p,T)=>p!==b[T]))t={...t,[g]:R}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((g)=>g==="number"||g==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((g)=>typeof g==="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:l,format:f,id:m,...v}=t;if(v.enum)v.enum=v.enum.map((g)=>typeof g==="number"?String(g):g);else if(typeof v.const==="number")v.const=String(v.const);if(!n)return v;if(v.type="string",!s)v.pattern=(o.includes("number")?Zr:Gn).source;return v}var Ts=new WeakMap;function gp(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 Ts.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Es(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 Vs=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=Ve(i).patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Re(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of c)Be(n.patternProperties,Tl(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Re(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Ts.get(t);if(!l)l=[],Ts.set(t,l),t.deferred.push(()=>gp(t));l.push(e)}n.additionalProperties=Re(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&eo(s.valueType)!==void 0;if(a&&!s.partial&&!u){let l=[...a].filter((f)=>typeof f==="string"||typeof f==="number");if(l.length>0)n.required=l.map(String)}},Fs=(e,t,r,o)=>{let n=e._zod.def,s=Re(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"}]},Hs=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Js=Symbol();function Vl(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(c,a)=>{if(typeof a!=="bigint")return a;return s=!0,null});if(!s)return JSON.parse(i);return Ae(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Js}var Bs=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=Vl(n.defaultValue,e,t,r,o);if(i!==Js)r.default=i},Ks=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=Vl(n.defaultValue,e,t,r,o);if(i!==Js)r._prefault=i},Gs=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Ae(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},Ws=(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;Re(i,t,o);let c=t.seen.get(e);c.ref=i},Ys=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Fl=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},un=(e,t,r,o)=>{let n=e._zod.def;Re(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Xs=(e,t,r,o)=>{let n=e._zod.innerType;Re(n,t,o);let s=t.seen.get(e);s.ref=n},$l={string:ks,number:Cs,boolean:Is,bigint:kl,symbol:Cl,null:Os,undefined:Il,void:Ol,never:Ns,any:Nl,unknown:xs,date:xl,enum:As,literal:Ms,nan:Al,template_literal:Ml,file:jl,success:ql,custom:js,function:Ll,transform:qs,map:Dl,set:Ul,array:Ls,object:Ds,union:Us,intersection:Zs,tuple:Zl,record:Vs,nullable:Fs,nonoptional:Hs,default:Bs,prefault:Ks,catch:Gs,pipe:Ws,readonly:Ys,promise:Fl,optional:un,lazy:Xs};function ln(e,t){if("_idmap"in e){let o=e,n=Yr({...t,processors:$l}),s={};for(let a of o._idmap.entries()){let[u,l]=a;Re(l,n)}let i={},c={registry:o,uri:t?.uri,defs:s};n.external=c;for(let a of o._idmap.entries()){let[u,l]=a;Xr(n,l),Be(i,u,Qr(n,l))}if(Object.keys(s).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:s}}return{schemas:i}}let r=Yr({...t,processors:$l});return Re(e,r),Xr(r,e),Qr(r,e)}var Hl=new WeakSet([Object.prototype,Error.prototype]);function dn(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 zp=(e,t)=>{_a.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Hl.has(r))return;Hl.add(r),dn(r,"format",(o)=>(n)=>va(o,n)),dn(r,"flatten",(o)=>(n)=>ya(o,n)),dn(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,qr,2)}),dn(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,qr,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var We=L("ZodError",zp,void 0,{Parent:Error});var Jl=Uo(We),Bl=Zo(We),fn=Vo(We),Kl=Fo(We),Gl=ba(We),Wl=wa(We),Yl=$a(We),Xl=Ra(We),Ql=za(We),ed=Pa(We),td=Ea(We),rd=Ta(We);function Ep(){if(!Ze.localeError)Ge(ls())}function pn(){if(!Ze.memoizer)Ge({memoizer:Ou()})}var ke=L("ZodType",(e,t)=>(Ep(),ze.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ke(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 nt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gm(e,t))},superRefine(e,t){return this.check(ym(e,t))},overwrite(e){return this.check(wt(e))},optional(){return he(this)},exactOptional(){return rm(this)},nullable(){return sd(this)},nullish(){return he(sd(this))},nonoptional(e){return cm(this,e)},array(){return W(this)},or(e){return ae([this,e])},and(e){return tr(this,e)},transform(e){return id(this,_d(e))},default(e){return sm(this,e)},prefault(e){return am(this,e)},catch(e){return lm(this,e)},pipe(e){return id(this,e)},readonly(){return hm(this)},describe(e){let t=this.clone();return qt.add(t,{description:e}),t},meta(...e){if(e.length===0)return qt.get(this);let t=this.clone();return qt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Lo(this,"~standard",{...ts(this),jsonSchema:{input:Wr(this,"input"),output:Wr(this,"output")}})},set "~standard"(e){dt(this,"~standard",e)},parse:function e(t,r){return Jl(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Bl(this,t,r,{callee:e})},safeParse(e,t){return fn(this,e,t)},async safeParseAsync(e,t){return Kl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){dt(this,"spa",e)},validate(e,t){return Hn(this,e,t)},validateAsync(e,t){return Jn(this,e,t)},encode:function e(t,r){return Gl(this,t,r,{callee:e})},decode:function e(t,r){return Wl(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Yl(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Xl(this,t,r,{callee:e})},safeEncode(e,t){return Ql(this,e,t)},safeDecode(e,t){return ed(this,e,t)},async safeEncodeAsync(e,t){return td(this,e,t)},async safeDecodeAsync(e,t){return rd(this,e,t)},toJSONSchema(e){return yl(this,{})(e)},get description(){return qt.get(this)?.description},get _def(){return this._zod.def}}),ad=L("_ZodString",(e,t)=>{Go.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ks(e,r,o,n)},da({format:(e)=>Ve(e).format??null,minLength:(e)=>Ve(e).minimum??null,maxLength:(e)=>Ve(e).maximum??null},{regex(...e){return this.check(ms(...e))},includes(...e){return this.check(ys(...e))},startsWith(...e){return this.check(vs(...e))},endsWith(...e){return this.check(Ss(...e))},min(...e){return this.check(Xt(...e))},max(...e){return this.check(an(...e))},length(...e){return this.check(cn(...e))},nonempty(...e){return this.check(Xt(1,...e))},lowercase(e){return this.check(gs(e))},uppercase(e){return this.check(_s(e))},trim(){return this.check(ws())},normalize(...e){return this.check(bs(...e))},toLowerCase(){return this.check($s())},toUpperCase(){return this.check(Rs())},slugify(){return this.check(zs())}})),Tp=L("ZodString",(e,t)=>{Go.init(e,t),ad.init(e,t)},{email(e){return this.check(ds(ld,e))},url(e){return this.check(fs(fd,e))},jwt(e){return this.check(rl(Fp,e))},emoji(e){return this.check(Zu(Cp,e))},guid(e){return this.check(ju(kp,e))},uuid(e){return this.check(qu(hn,e))},uuidv4(e){return this.check(Lu(hn,e))},uuidv6(e){return this.check(Du(hn,e))},uuidv7(e){return this.check(Uu(hn,e))},nanoid(e){return this.check(Vu(Ip,e))},cuid(e){return this.check(Fu(Op,e))},cuid2(e){return this.check(Hu(Np,e))},ulid(e){return this.check(Ju(xp,e))},base64(e){return this.check(Qu(Up,e))},base64url(e){return this.check(el(Zp,e))},xid(e){return this.check(Bu(Ap,e))},ksuid(e){return this.check(Ku(Mp,e))},ipv4(e){return this.check(Gu(jp,e))},ipv6(e){return this.check(Wu(qp,e))},cidrv4(e){return this.check(Yu(Lp,e))},cidrv6(e){return this.check(Xu(Dp,e))},e164(e){return this.check(tl(Vp,e))},datetime(e){return this.check(tn(ei,e))},date(e){return this.check(rn(ti,e))},time(e){return this.check(hs(cd,e))},duration(e){return this.check(ps(ud,e))}});function P(e){return Mu(Tp,e)}var Ie=L("ZodStringFormat",(e,t)=>{Te.init(e,t),ad.init(e,t)}),ei=L("ZodISODateTime",(e,t)=>{Zc.init(e,t),Ie.init(e,t)}),ti=L("ZodISODate",(e,t)=>{Vc.init(e,t),Ie.init(e,t)}),cd=L("ZodISOTime",(e,t)=>{Fc.init(e,t),Ie.init(e,t)}),ud=L("ZodISODuration",(e,t)=>{Hc.init(e,t),Ie.init(e,t)}),ld=L("ZodEmail",(e,t)=>{Ic.init(e,t),Ie.init(e,t)});function dd(e){return ds(ld,e)}var kp=L("ZodGUID",(e,t)=>{kc.init(e,t),Ie.init(e,t)});var hn=L("ZodUUID",(e,t)=>{Cc.init(e,t),Ie.init(e,t)});var fd=L("ZodURL",(e,t)=>{xc.init(e,t),Ie.init(e,t)});function hd(e){return fs(fd,e)}var Cp=L("ZodEmoji",(e,t)=>{Ac.init(e,t),Ie.init(e,t)});var Ip=L("ZodNanoID",(e,t)=>{Mc.init(e,t),Ie.init(e,t)});var Op=L("ZodCUID",(e,t)=>{jc.init(e,t),Ie.init(e,t)});var Np=L("ZodCUID2",(e,t)=>{qc.init(e,t),Ie.init(e,t)});var xp=L("ZodULID",(e,t)=>{Lc.init(e,t),Ie.init(e,t)});var Ap=L("ZodXID",(e,t)=>{Dc.init(e,t),Ie.init(e,t)});var Mp=L("ZodKSUID",(e,t)=>{Uc.init(e,t),Ie.init(e,t)});var jp=L("ZodIPv4",(e,t)=>{Jc.init(e,t),Ie.init(e,t)});var qp=L("ZodIPv6",(e,t)=>{Kc.init(e,t),Ie.init(e,t)});var Lp=L("ZodCIDRv4",(e,t)=>{Gc.init(e,t),Ie.init(e,t)});var Dp=L("ZodCIDRv6",(e,t)=>{Wc.init(e,t),Ie.init(e,t)});var Up=L("ZodBase64",(e,t)=>{Xc.init(e,t),Ie.init(e,t)});var Zp=L("ZodBase64URL",(e,t)=>{Qc.init(e,t),Ie.init(e,t)});var Vp=L("ZodE164",(e,t)=>{eu.init(e,t),Ie.init(e,t)});var Fp=L("ZodJWT",(e,t)=>{tu.init(e,t),Ie.init(e,t)});var pd=L("ZodNumber",(e,t)=>{os.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n),e.isFinite=!0},da({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=Ve(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=Ve(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=Ve(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>Ve(e).format??null},{gt(e,t){return this.check(nn(e,t))},gte(e,t){return this.check(Kr(e,t))},min(e,t){return this.check(Kr(e,t))},lt(e,t){return this.check(on(e,t))},lte(e,t){return this.check(Br(e,t))},max(e,t){return this.check(Br(e,t))},int(e){return this.check(od(e))},safe(e){return this.check(od(e))},positive(e){return this.check(nn(0,e))},nonnegative(e){return this.check(Kr(0,e))},negative(e){return this.check(on(0,e))},nonpositive(e){return this.check(Br(0,e))},multipleOf(e,t){return this.check(sn(e,t))},step(e,t){return this.check(sn(e,t))},finite(){return this}}));function Q(e){return ol(pd,e)}var Hp=L("ZodNumberFormat",(e,t)=>{ru.init(e,t),pd.init(e,t)});function od(e){return nl(Hp,e)}var Jp=L("ZodBoolean",(e,t)=>{ou.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n)});function fe(e){return sl(Jp,e)}var Bp=L("ZodNull",(e,t)=>{nu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Os(e,r,o,n)});function mn(e){return il(Bp,e)}var Kp=L("ZodUnknown",(e,t)=>{su.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xs(e,r,o,n)});function de(){return al(Kp)}var Gp=L("ZodNever",(e,t)=>{iu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ns(e,r,o,n)});function Wp(e){return ul(Gp,e)}var Yp=L("ZodArray",(e,t)=>{pn(),au.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ls(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Xt(e,t))},nonempty(e){return this.check(Xt(1,e))},max(e,t){return this.check(an(e,t))},length(e,t){return this.check(cn(e,t))},unwrap(){return this.element}});function W(e,t){return ll(Yp,e,t)}var md=L("ZodObject",(e,t)=>{pn(),lu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ds(e,r,o,n),yh(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ye(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ke(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ke(this._zod.def,{catchall:de()}))},loose(){return this.clone(Ke(this._zod.def,{catchall:de()}))},strict(){return this.clone(Ke(this._zod.def,{catchall:Wp()}))},strip(){return this.clone(Ke(this._zod.def,{catchall:void 0}))},extend(e){return lh(this,e)},safeExtend(e){return dh(this,e)},merge(e){return fh(this,e)},pick(e){return ch(this,e)},omit(e){return uh(this,e)},partial(...e){return aa(yd,this,e[0])},exactPartial(...e){return aa(vd,this,e[0],"exactPartial")},required(...e){return hh(Sd,this,e[0])}});function M(e,t){let r={type:"object",shape:e??{},...re(t)};return new md(r)}function _e(e,t){return new md({type:"object",shape:e,catchall:de(),...re(t)})}var gd=L("ZodUnion",(e,t)=>{ns.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.options=t.options});function ae(e,t){return new gd({type:"union",options:e,...re(t)})}var Xp=L("ZodDiscriminatedUnion",(e,t)=>{gd.init(e,t),du.init(e,t)});function ri(e,t,r){return new Xp({type:"union",options:t,discriminator:e,...re(r)})}var Qp=L("ZodIntersection",(e,t)=>{hu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zs(e,r,o,n)});function tr(e,t){return new Qp({type:"intersection",left:e,right:t})}var nd=L("ZodRecord",(e,t)=>{pn(),pu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vs(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function se(e,t,r){if(!t||!t._zod)return new nd({type:"record",keyType:P(),valueType:e,...re(t)});return new nd({type:"record",keyType:e,valueType:t,...re(r)})}var Qs=L("ZodEnum",(e,t)=>{mu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(o,n,s)=>As(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 Qs({...t,checks:[],...re(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 Qs({...t,checks:[],...re(n),entries:s})}});function ye(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Qs({type:"enum",entries:r,...re(t)})}var em=L("ZodLiteral",(e,t)=>{gu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ms(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 H(e,t){return new em({type:"literal",values:Array.isArray(e)?e:[e],...re(t)})}var tm=L("ZodTransform",(e,t)=>{pn(),_u.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qs(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ur(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(jt(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(jt(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 _d(e){return new tm({type:"transform",transform:e})}var yd=L("ZodOptional",(e,t)=>{ss.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>un(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function he(e){return new yd({type:"optional",innerType:e})}var vd=L("ZodExactOptional",(e,t)=>{yu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>un(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new vd({type:"optional",innerType:e})}var om=L("ZodNullable",(e,t)=>{vu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function sd(e){return new om({type:"nullable",innerType:e})}var nm=L("ZodDefault",(e,t)=>{Su.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sm(e,t){return new nm({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():qn(t)}})}var im=L("ZodPrefault",(e,t)=>{bu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ks(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function am(e,t){return new im({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():qn(t)}})}var Sd=L("ZodNonOptional",(e,t)=>{wu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cm(e,t){return new Sd({type:"nonoptional",innerType:e,...re(t)})}var um=L("ZodCatch",(e,t)=>{$u.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lm(e,t){return new um({type:"catch",innerType:e,catchValue:typeof t==="function"?t:fa(t)})}var bd=L("ZodPipe",(e,t)=>{is.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ws(e,r,o,n),e.in=t.in,e.out=t.out});function id(e,t){return new bd({type:"pipe",in:e,out:t})}var dm=L("ZodPreprocess",(e,t)=>{bd.init(e,t),Ru.init(e,t)}),fm=L("ZodReadonly",(e,t)=>{zu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ys(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function hm(e){return new fm({type:"readonly",innerType:e})}var pm=L("ZodLazy",(e,t)=>{Pu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xs(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function oi(e){return new pm({type:"lazy",getter:e})}var mm=L("ZodCustom",(e,t)=>{Eu.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,n)=>js(e,r,o,n)});function gm(e,t={}){return dl(mm,e,t)}function ym(e,t){return fl(e,t)}function gn(e,t){return new dm({type:"pipe",in:_d(e),out:t})}function ni(e){return tn(ei,e)}function vm(e){return rn(ti,e)}var li=Symbol.for("mcp.sdk.errorBrands");function Rt(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,li,{value:r,enumerable:!1,configurable:!0})}function Fe(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,li)){let r=t[li];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Md=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Fe(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 Fe(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",Rt(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)}},ee=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}({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e,t,r,o){super(t,o);this.code=e,this.data=r,this.name="SdkError",Rt(this,new.target)}},co=class extends X{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 jd="2026-07-28",mi=[jd];function ht(e){return e>=jd}function gi(e){return e.filter((t)=>!ht(t))}function uo(e){return e.filter((t)=>ht(t))}function qd(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 Ld=["task","inputRequests","requestState"];function Om(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||Ld.some((t)=>(t in e)))return e;return{...e,content:[]}}function Nm(){let e=oi(()=>ae([P(),Q(),fe(),mn(),se(P(),e),W(e)])),t=se(P(),e),r=ae([P(),Q().int()]),o=P(),n=M({ttl:Q().optional()}),s=M({taskId:P()}),i=_e({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=M({_meta:i.optional()}),a=c.extend({task:n.optional()}),u=M({method:P(),params:c.loose().optional()}),l=M({_meta:i.optional()}),f=M({method:P(),params:l.loose().optional()}),m=_e({_meta:i.optional()}),v=ae([P(),Q().int()]),g=m.strict(),b=l.extend({requestId:v.optional(),reason:P().optional()}),R=f.extend({method:H("notifications/cancelled"),params:b}),p=M({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:ye(["light","dark"]).optional()}),T=M({icons:W(p).optional()}),w=M({name:P(),title:P().optional()}),E=w.extend({...w.shape,...T.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),N=tr(M({applyDefaults:fe().optional()}),t),z=gn((qe)=>{if(qe&&typeof qe==="object"&&!Array.isArray(qe)&&Object.keys(qe).length===0)return{form:{}};return qe},tr(M({form:N.optional(),url:t.optional()}),t.optional())),_=_e({list:t.optional(),cancel:t.optional(),requests:_e({sampling:_e({createMessage:t.optional()}).optional(),elicitation:_e({create:t.optional()}).optional()}).optional()}),C=_e({list:t.optional(),cancel:t.optional(),requests:_e({tools:_e({call:t.optional()}).optional()}).optional()}),q=M({experimental:se(P(),t).optional(),sampling:M({context:t.optional(),tools:t.optional()}).optional(),elicitation:z.optional(),roots:M({listChanged:fe().optional()}).optional(),tasks:_.optional(),extensions:se(P(),t).optional()}),F=c.extend({protocolVersion:P(),capabilities:q,clientInfo:E}),j=u.extend({method:H("initialize"),params:F}),Z=M({experimental:se(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:M({listChanged:fe().optional()}).optional(),resources:M({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:M({listChanged:fe().optional()}).optional(),tasks:C.optional(),extensions:se(P(),t).optional()}),G=m.extend({protocolVersion:P(),capabilities:Z,serverInfo:E,instructions:P().optional()}),K=f.extend({method:H("notifications/initialized"),params:l.optional()}),ie=u.extend({method:H("ping"),params:c.optional()}),Se=M({progress:Q(),total:he(Q()),message:he(P())}),ve=M({...l.shape,...Se.shape,progressToken:r}),Pe=f.extend({method:H("notifications/progress"),params:ve}),le=c.extend({cursor:o.optional()}),O=u.extend({params:le.optional()}),x=m.extend({nextCursor:o.optional()}),y=M({uri:P(),mimeType:he(P()),_meta:se(P(),de()).optional()}),d=y.extend({text:P()}),h=P().refine((qe)=>{try{return atob(qe),!0}catch{return!1}},{message:"Invalid Base64 string"}),S=y.extend({blob:h}),I=ye(["user","assistant"]),D=M({audience:W(I).optional(),priority:Q().min(0).max(1).optional(),lastModified:ni({offset:!0}).optional()}),B=M({...w.shape,...T.shape,uri:P(),description:he(P()),mimeType:he(P()),size:he(Q()),annotations:D.optional(),_meta:he(_e({}))}),J=M({...w.shape,...T.shape,uriTemplate:P(),description:he(P()),mimeType:he(P()),annotations:D.optional(),_meta:he(_e({}))}),ce=O.extend({method:H("resources/list")}),we=x.extend({resources:W(B)}),k=O.extend({method:H("resources/templates/list")}),A=x.extend({resourceTemplates:W(J)}),U=c.extend({uri:P()}),Y=U,te=u.extend({method:H("resources/read"),params:Y}),oe=m.extend({contents:W(ae([d,S]))}),pe=f.extend({method:H("notifications/resources/list_changed"),params:l.optional()}),Ce=U,$e=u.extend({method:H("resources/subscribe"),params:Ce}),Oe=U,Ee=u.extend({method:H("resources/unsubscribe"),params:Oe}),Ye=l.extend({uri:P()}),xe=f.extend({method:H("notifications/resources/updated"),params:Ye}),ct=M({name:P(),description:he(P()),required:he(fe())}),Qe=M({...w.shape,...T.shape,description:he(P()),arguments:he(W(ct)),_meta:he(_e({}))}),ut=O.extend({method:H("prompts/list")}),pt=x.extend({prompts:W(Qe)}),mt=c.extend({name:P(),arguments:se(P(),P()).optional()}),zt=u.extend({method:H("prompts/get"),params:mt}),Pt=M({type:H("text"),text:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),Et=M({type:H("image"),data:h,mimeType:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),Tt=M({type:H("audio"),data:h,mimeType:P(),annotations:D.optional(),_meta:se(P(),de()).optional()}),ar=M({type:H("tool_use"),name:P(),id:P(),input:se(P(),de()),_meta:se(P(),de()).optional()}),gt=M({type:H("resource"),resource:ae([d,S]),annotations:D.optional(),_meta:se(P(),de()).optional()}),cr=B.extend({type:H("resource_link")}),Xe=ae([Pt,Et,Tt,cr,gt]),Dt=M({role:I,content:Xe}),Ut=m.extend({description:P().optional(),messages:W(Dt)}),kt=f.extend({method:H("notifications/prompts/list_changed"),params:l.optional()}),ur=M({title:P().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),Zt=M({taskSupport:ye(["required","optional","forbidden"]).optional()}),Ct=M({...w.shape,...T.shape,description:P().optional(),inputSchema:M({type:H("object"),properties:se(P(),e).optional(),required:W(P()).optional()}).catchall(de()),outputSchema:M({type:H("object"),properties:se(P(),e).optional(),required:W(P()).optional()}).catchall(de()).optional(),annotations:ur.optional(),execution:Zt.optional(),_meta:se(P(),de()).optional()}),Vt=O.extend({method:H("tools/list")}),Ft=x.extend({tools:W(Ct)}),Ht=m.extend({content:W(Xe),structuredContent:se(P(),de()).optional(),isError:fe().optional()}),je=a.extend({name:P(),arguments:se(P(),de()).optional()}),lr=u.extend({method:H("tools/call"),params:je}),mo=f.extend({method:H("notifications/tools/list_changed"),params:l.optional()}),Jt=ye(["debug","info","notice","warning","error","critical","alert","emergency"]),dr=c.extend({level:Jt}),fr=u.extend({method:H("logging/setLevel"),params:dr}),hr=l.extend({level:Jt,logger:P().optional(),data:de()}),pr=f.extend({method:H("notifications/message"),params:hr}),mr=M({name:P().optional()}),gr=M({hints:W(mr).optional(),costPriority:Q().min(0).max(1).optional(),speedPriority:Q().min(0).max(1).optional(),intelligencePriority:Q().min(0).max(1).optional()}),_r=M({mode:ye(["auto","required","none"]).optional()}),go=M({type:H("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:W(Xe),structuredContent:M({}).loose().optional(),isError:fe().optional(),_meta:se(P(),de()).optional()}),yr=ri("type",[Pt,Et,Tt]),_t=ri("type",[Pt,Et,Tt,ar,go]),vr=M({role:I,content:ae([_t,W(_t)]),_meta:se(P(),de()).optional()}),Sr=a.extend({messages:W(vr),modelPreferences:gr.optional(),systemPrompt:P().optional(),includeContext:ye(["none","thisServer","allServers"]).optional(),temperature:Q().optional(),maxTokens:Q().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(Ct).optional(),toolChoice:_r.optional()}),br=u.extend({method:H("sampling/createMessage"),params:Sr}),wr=m.extend({model:P(),stopReason:he(ye(["endTurn","stopSequence","maxTokens"]).or(P())),role:I,content:yr}),$r=m.extend({model:P(),stopReason:he(ye(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:I,content:ae([_t,W(_t)])}),Rr=M({type:H("boolean"),title:P().optional(),description:P().optional(),default:fe().optional()}),zr=M({type:H("string"),title:P().optional(),description:P().optional(),minLength:Q().optional(),maxLength:Q().optional(),format:ye(["email","uri","date","date-time"]).optional(),default:P().optional()}),Pr=M({type:ye(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Q().optional(),maximum:Q().optional(),default:Q().optional()}),Er=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),Tr=M({type:H("string"),title:P().optional(),description:P().optional(),oneOf:W(M({const:P(),title:P()})),default:P().optional()}),kr=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),Cr=ae([Er,Tr]),It=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({type:H("string"),enum:W(P())}),default:W(P()).optional()}),Ot=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({anyOf:W(M({const:P(),title:P()}))}),default:W(P()).optional()}),_o=ae([It,Ot]),yo=ae([kr,Cr,_o]),He=ae([yo,Rr,zr,Pr]),Je=a.extend({mode:H("form").optional(),message:P(),requestedSchema:M({type:H("object"),properties:se(P(),He),required:W(P()).optional()}).catchall(de())}),Or=a.extend({mode:H("url"),message:P(),elicitationId:P(),url:P().url()}),et=ae([Je,Or]),vo=u.extend({method:H("elicitation/create"),params:et}),So=l.extend({elicitationId:P()}),bo=f.extend({method:H("notifications/elicitation/complete"),params:So}),wo=m.extend({action:ye(["accept","decline","cancel"]),content:gn((qe)=>qe===null?void 0:qe,se(P(),ae([P(),Q(),fe(),W(P())])).optional())}),$o=M({type:H("ref/resource"),uri:P()}),Ro=M({type:H("ref/prompt"),name:P()}),zo=c.extend({ref:ae([Ro,$o]),argument:M({name:P(),value:P()}),context:M({arguments:se(P(),P()).optional()}).optional()}),Nr=u.extend({method:H("completion/complete"),params:zo}),Po=m.extend({completion:_e({values:W(P()).max(100),total:he(Q().int()),hasMore:he(fe())})}),Eo=M({uri:P().startsWith("file://"),name:P().optional(),_meta:se(P(),de()).optional()}),Bt=u.extend({method:H("roots/list"),params:c.optional()}),xr=m.extend({roots:W(Eo)}),To=f.extend({method:H("notifications/roots/list_changed"),params:l.optional()}),ko=_e({ttl:Q().optional(),pollInterval:Q().optional()}),Ar=ye(["working","input_required","completed","failed","cancelled"]),yt=M({taskId:P(),status:Ar,ttl:ae([Q(),mn()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:he(Q()),statusMessage:he(P())}),Ue=m.extend({task:yt}),Co=l.merge(yt),Nt=f.extend({method:H("notifications/tasks/status"),params:Co}),Kt=u.extend({method:H("tasks/get"),params:c.extend({taskId:P()})}),Gt=m.merge(yt),Wt=u.extend({method:H("tasks/result"),params:c.extend({taskId:P()})}),xn=m.loose(),Le=O.extend({method:H("tasks/list")}),Ne=x.extend({tasks:W(yt)}),xt=u.extend({method:H("tasks/cancel"),params:c.extend({taskId:P()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:a,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:f,ResultSchema:m,RequestIdSchema:v,EmptyResultSchema:g,CancelledNotificationParamsSchema:b,CancelledNotificationSchema:R,IconSchema:p,IconsSchema:T,BaseMetadataSchema:w,ImplementationSchema:E,ClientTasksCapabilitySchema:_,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:q,InitializeRequestParamsSchema:F,InitializeRequestSchema:j,ServerCapabilitiesSchema:Z,InitializeResultSchema:G,InitializedNotificationSchema:K,PingRequestSchema:ie,ProgressSchema:Se,ProgressNotificationParamsSchema:ve,ProgressNotificationSchema:Pe,PaginatedRequestParamsSchema:le,PaginatedRequestSchema:O,PaginatedResultSchema:x,ResourceContentsSchema:y,TextResourceContentsSchema:d,BlobResourceContentsSchema:S,RoleSchema:I,AnnotationsSchema:D,ResourceSchema:B,ResourceTemplateSchema:J,ListResourcesRequestSchema:ce,ListResourcesResultSchema:we,ListResourceTemplatesRequestSchema:k,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:U,ReadResourceRequestParamsSchema:Y,ReadResourceRequestSchema:te,ReadResourceResultSchema:oe,ResourceListChangedNotificationSchema:pe,SubscribeRequestParamsSchema:Ce,SubscribeRequestSchema:$e,UnsubscribeRequestParamsSchema:Oe,UnsubscribeRequestSchema:Ee,ResourceUpdatedNotificationParamsSchema:Ye,ResourceUpdatedNotificationSchema:xe,PromptArgumentSchema:ct,PromptSchema:Qe,ListPromptsRequestSchema:ut,ListPromptsResultSchema:pt,GetPromptRequestParamsSchema:mt,GetPromptRequestSchema:zt,TextContentSchema:Pt,ImageContentSchema:Et,AudioContentSchema:Tt,ToolUseContentSchema:ar,EmbeddedResourceSchema:gt,ResourceLinkSchema:cr,ContentBlockSchema:Xe,PromptMessageSchema:Dt,GetPromptResultSchema:Ut,PromptListChangedNotificationSchema:kt,ToolAnnotationsSchema:ur,ToolExecutionSchema:Zt,ToolSchema:Ct,ListToolsRequestSchema:Vt,ListToolsResultSchema:Ft,CallToolResultSchema:Ht,CallToolRequestParamsSchema:je,CallToolRequestSchema:lr,ToolListChangedNotificationSchema:mo,LoggingLevelSchema:Jt,SetLevelRequestParamsSchema:dr,SetLevelRequestSchema:fr,LoggingMessageNotificationParamsSchema:hr,LoggingMessageNotificationSchema:pr,ModelHintSchema:mr,ModelPreferencesSchema:gr,ToolChoiceSchema:_r,ToolResultContentSchema:go,SamplingContentSchema:yr,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vr,CreateMessageRequestParamsSchema:Sr,CreateMessageRequestSchema:br,CreateMessageResultSchema:wr,CreateMessageResultWithToolsSchema:$r,BooleanSchemaSchema:Rr,StringSchemaSchema:zr,NumberSchemaSchema:Pr,UntitledSingleSelectEnumSchemaSchema:Er,TitledSingleSelectEnumSchemaSchema:Tr,LegacyTitledEnumSchemaSchema:kr,SingleSelectEnumSchemaSchema:Cr,UntitledMultiSelectEnumSchemaSchema:It,TitledMultiSelectEnumSchemaSchema:Ot,MultiSelectEnumSchemaSchema:_o,EnumSchemaSchema:yo,PrimitiveSchemaDefinitionSchema:He,ElicitRequestFormParamsSchema:Je,ElicitRequestURLParamsSchema:Or,ElicitRequestParamsSchema:et,ElicitRequestSchema:vo,ElicitationCompleteNotificationParamsSchema:So,ElicitationCompleteNotificationSchema:bo,ElicitResultSchema:wo,ResourceTemplateReferenceSchema:$o,PromptReferenceSchema:Ro,CompleteRequestParamsSchema:zo,CompleteRequestSchema:Nr,CompleteResultSchema:Po,RootSchema:Eo,ListRootsRequestSchema:Bt,ListRootsResultSchema:xr,RootsListChangedNotificationSchema:To,TaskCreationParamsSchema:ko,TaskStatusSchema:Ar,TaskSchema:yt,CreateTaskResultSchema:Ue,TaskStatusNotificationParamsSchema:Co,TaskStatusNotificationSchema:Nt,GetTaskRequestSchema:Kt,GetTaskResultSchema:Gt,GetTaskPayloadRequestSchema:Wt,GetTaskPayloadResultSchema:xn,ListTasksRequestSchema:Le,ListTasksResultSchema:Ne,CancelTaskRequestSchema:xt,CancelTaskResultSchema:m.merge(yt),ClientRequestSchema:ae([ie,j,Nr,fr,zt,ut,ce,k,te,$e,Ee,lr,Vt,Kt,Wt,Le,xt]),ClientNotificationSchema:ae([R,Pe,K,To,Nt]),ClientResultSchema:ae([g,wr,$r,wo,xr,Gt,Ne,Ue]),ServerRequestSchema:ae([ie,br,vo,Bt,Kt,Wt,Le,xt]),ServerNotificationSchema:ae([R,Pe,pr,xe,pe,mo,kt,Nt,bo]),ServerResultSchema:ae([g,G,Po,Ut,pt,we,A,oe,Ht,Ft,Gt,Ne,Ue]),CallToolResultWireSchema:de().superRefine((qe,Yf)=>{if(typeof qe!=="object"||qe===null||Array.isArray(qe)||qe.content!==void 0)return;for(let Li of Ld)if(Li in qe){Yf.addIssue({code:"custom",message:`content is required when the body carries '${Li}' \u2014 another result family cannot default into an empty tools/call success`});return}}).transform(Om).pipe(Ht)}}var Am;function Dd(){return Am??=Nm()}function Ud(e){return e.type!=="object"}var Mm=new Set(["const","enum","default","examples"]),jm=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function $d(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function qm(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if($d(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Zi(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((a)=>o(a,!1));if(n===null||typeof n!=="object")return n;if(!s&&$d(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))if(s)i[a]=o(u,!1);else if((a==="$ref"||a==="$dynamicRef")&&typeof u==="string")i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(a==="$recursiveRef"&&u==="#"&&r)c=!0;else if(Mm.has(a))i[a]=u;else if(jm.has(a))i[a]=o(u,!0);else i[a]=o(u,!1);if(c)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 Zd={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},Vd={"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},Lm={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},_n;function _i(){if(_n)return _n;let e=Dd();return _n={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}},_n}function Fd(e){return Object.prototype.hasOwnProperty.call(Zd,e)}function Hd(e){return Object.prototype.hasOwnProperty.call(Vd,e)}function Dm(e){return Object.prototype.hasOwnProperty.call(Lm,e)}function Um(e){return Dm(e)?_i().resultSchemas[e]:void 0}function Zm(e){return Fd(e)?_i().requestSchemas[e]:void 0}function Vm(e){return Hd(e)?_i().notificationSchemas[e]:void 0}var e0=Object.keys(Zd),t0=Object.keys(Vd);function di(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function yn(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 Rd={ok:!1,reason:"not-in-era"};function zd(e){return di(e)&&di(e.outputSchema)&&Ud(e.outputSchema)}function Pd(e){return e}var yi={era:"2025-11-25",hasRequestMethod:Fd,hasNotificationMethod:Hd,validateRequest:(e,t)=>yn(Zm(e),t),validateResult:(e,t)=>yn(Um(e),t),validateNotification:(e,t)=>yn(Vm(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Rd,validateInputResponse:()=>Rd,samplingResultVariant:(e,t)=>{let r=Dd();return yn(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=qd(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&Ud(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(di(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:Pd(r)}}return{kind:"complete",result:Pd(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>zd(o)))return t;return{...t,tools:r.map((o)=>zd(o)?{...o,outputSchema:qm(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function Fm(){let e=oi(()=>ae([P(),Q(),fe(),mn(),se(P(),e),W(e)])),t=se(P(),e),r=ae([P(),Q().int()]),o=P(),n=ae([P(),Q().int()]),s=ye(["user","assistant"]),i=ye(["debug","info","notice","warning","error","critical","alert","emergency"]),c=P().refine((Ne)=>{try{return atob(Ne),!0}catch{return!1}},{message:"Invalid Base64 string"}),a=M({ttl:Q().optional()}),u=M({taskId:P()}),l=_e({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=M({_meta:l.optional()}),m=f.extend({task:a.optional()}),v=M({_meta:l.optional()}),g=M({method:P(),params:v.loose().optional()}),b=M({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:ye(["light","dark"]).optional()}),R=M({icons:W(b).optional()}),p=M({name:P(),title:P().optional()}),T=p.extend({...p.shape,...R.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),w=tr(M({applyDefaults:fe().optional()}),t),E=gn((Ne)=>{if(Ne&&typeof Ne==="object"&&!Array.isArray(Ne)&&Object.keys(Ne).length===0)return{form:{}};return Ne},tr(M({form:w.optional(),url:t.optional()}),t.optional())),N=_e({list:t.optional(),cancel:t.optional(),requests:_e({sampling:_e({createMessage:t.optional()}).optional(),elicitation:_e({create:t.optional()}).optional()}).optional()}),z=_e({list:t.optional(),cancel:t.optional(),requests:_e({tools:_e({call:t.optional()}).optional()}).optional()}),_=M({experimental:se(P(),t).optional(),sampling:M({context:t.optional(),tools:t.optional()}).optional(),elicitation:E.optional(),roots:M({listChanged:fe().optional()}).optional(),tasks:N.optional(),extensions:se(P(),t).optional()}),C=M({experimental:se(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:M({listChanged:fe().optional()}).optional(),resources:M({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:M({listChanged:fe().optional()}).optional(),tasks:z.optional(),extensions:se(P(),t).optional()}),q=M({progress:Q(),total:he(Q()),message:he(P())}),F=M({...v.shape,...q.shape,progressToken:r}),j=g.extend({method:H("notifications/progress"),params:F}),Z=v.extend({level:i,logger:P().optional(),data:de()}),G=g.extend({method:H("notifications/message"),params:Z}),K=M({uri:P(),mimeType:he(P()),_meta:se(P(),de()).optional()}),ie=K.extend({text:P()}),Se=K.extend({blob:c}),ve=M({audience:W(s).optional(),priority:Q().min(0).max(1).optional(),lastModified:ni({offset:!0}).optional()}),Pe=M({...p.shape,...R.shape,uri:P(),description:he(P()),mimeType:he(P()),size:he(Q()),annotations:ve.optional(),_meta:he(_e({}))}),le=M({...p.shape,...R.shape,uriTemplate:P(),description:he(P()),mimeType:he(P()),annotations:ve.optional(),_meta:he(_e({}))}),O=g.extend({method:H("notifications/resources/list_changed"),params:v.optional()}),x=v.extend({uri:P()}),y=g.extend({method:H("notifications/resources/updated"),params:x}),d=M({name:P(),description:he(P()),required:he(fe())}),h=M({...p.shape,...R.shape,description:he(P()),arguments:he(W(d)),_meta:he(_e({}))}),S=g.extend({method:H("notifications/prompts/list_changed"),params:v.optional()}),I=M({type:H("text"),text:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),D=M({type:H("image"),data:c,mimeType:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),B=M({type:H("audio"),data:c,mimeType:P(),annotations:ve.optional(),_meta:se(P(),de()).optional()}),J=M({type:H("tool_use"),name:P(),id:P(),input:se(P(),de()),_meta:se(P(),de()).optional()}),ce=M({type:H("resource"),resource:ae([ie,Se]),annotations:ve.optional(),_meta:se(P(),de()).optional()}),we=Pe.extend({type:H("resource_link")}),k=ae([I,D,B,we,ce]),A=M({role:s,content:k}),U=M({title:P().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),Y=g.extend({method:H("notifications/tools/list_changed"),params:v.optional()}),te=M({name:P().optional()}),oe=M({hints:W(te).optional(),costPriority:Q().min(0).max(1).optional(),speedPriority:Q().min(0).max(1).optional(),intelligencePriority:Q().min(0).max(1).optional()}),pe=M({mode:ye(["auto","required","none"]).optional()}),Ce=M({type:H("boolean"),title:P().optional(),description:P().optional(),default:fe().optional()}),$e=M({type:H("string"),title:P().optional(),description:P().optional(),minLength:Q().optional(),maxLength:Q().optional(),format:ye(["email","uri","date","date-time"]).optional(),default:P().optional()}),Oe=M({type:ye(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Q().optional(),maximum:Q().optional(),default:Q().optional()}),Ee=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),Ye=M({type:H("string"),title:P().optional(),description:P().optional(),oneOf:W(M({const:P(),title:P()})),default:P().optional()}),xe=M({type:H("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),ct=ae([Ee,Ye]),Qe=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({type:H("string"),enum:W(P())}),default:W(P()).optional()}),ut=M({type:H("array"),title:P().optional(),description:P().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:M({anyOf:W(M({const:P(),title:P()}))}),default:W(P()).optional()}),pt=ae([Qe,ut]),mt=ae([xe,ct,pt]),zt=ae([mt,Ce,$e,Oe]),Pt=m.extend({mode:H("form").optional(),message:P(),requestedSchema:M({type:H("object"),properties:se(P(),zt),required:W(P()).optional()}).catchall(de())}),Et=M({type:H("ref/resource"),uri:P()}),Tt=M({type:H("ref/prompt"),name:P()}),ar=M({uri:P().startsWith("file://"),name:P().optional(),_meta:se(P(),de()).optional()}),gt=_.shape,cr=M({experimental:gt.experimental,sampling:gt.sampling,elicitation:gt.elicitation,roots:gt.roots,extensions:gt.extensions}),Xe=C.shape,Dt=M({experimental:Xe.experimental,logging:Xe.logging,completions:Xe.completions,prompts:Xe.prompts,resources:Xe.resources,tools:Xe.tools,extensions:Xe.extensions}),Ut=_e({progressToken:r.optional(),[cs]:P(),[fu]:T.optional(),[Ir]:cr,[mp]:i.optional()}),kt=M({...p.shape,...R.shape,description:P().optional(),inputSchema:_e({$schema:P().optional(),type:H("object")}),outputSchema:_e({$schema:P().optional()}).optional(),annotations:U.optional(),_meta:se(P(),de()).optional()}),ur=M({type:H("tool_result"),toolUseId:P(),content:W(k),structuredContent:de().optional(),isError:fe().optional(),_meta:se(P(),de()).optional()}),Zt=ae([I,D,B,J,ur]),Ct=M({role:s,content:ae([Zt,W(Zt)]),_meta:se(P(),de()).optional()}),Vt=P(),Ft=_e({[Oa]:T.optional().catch(void 0)}),Ht=Ft.optional();function je(Ne){return _e({_meta:Ht,resultType:Vt.default("complete"),...Ne})}let lr=je({}),mo=je({nextCursor:o.optional()}),Jt=je({content:W(k),structuredContent:de().optional(),isError:fe().optional()}),dr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),tools:W(kt),nextCursor:o.optional()}),fr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),prompts:W(h),nextCursor:o.optional()}),hr=je({description:P().optional(),messages:W(A)}),pr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resources:W(Pe),nextCursor:o.optional()}),mr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resourceTemplates:W(le),nextCursor:o.optional()}),gr=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),contents:W(ae([ie,Se]))}),_r=je({completion:M({values:W(P()).max(100),total:Q().int().optional(),hasMore:fe().optional()}).loose()}),go=je({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"])}),yr=je({ttlMs:Q().int().min(0).catch(0),cacheScope:ye(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:Dt,instructions:P().optional()}),_t=M({messages:W(Ct),modelPreferences:oe.optional(),systemPrompt:P().optional(),includeContext:ye(["none","thisServer","allServers"]).optional(),temperature:Q().optional(),maxTokens:Q().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(kt).optional(),toolChoice:pe.optional()}),vr=M({method:H("sampling/createMessage"),params:_t}),Sr=M({method:H("roots/list"),params:M({_meta:se(P(),de()).optional()}).optional()}),br=M({...Ct.shape,model:P(),stopReason:P().optional()}),wr=M({roots:W(ar)}),$r=M({action:ye(["accept","decline","cancel"]),content:se(P(),ae([P(),Q(),fe(),W(P())])).optional()}),Rr=M({mode:H("url"),message:P(),url:P().url()}),zr=ae([Pt,Rr]),Pr=M({method:H("elicitation/create"),params:zr}),Er=ae([vr,Sr,Pr]),Tr=ae([br,wr,$r]),kr=se(P(),Er),Cr=se(P(),Tr),It=je({inputRequests:kr.optional(),requestState:P().optional()}),Ot={inputResponses:Cr.optional(),requestState:P().optional()},_o=M({_meta:Ut,...Ot}),yo=_e({progressToken:r.optional()});function He(Ne,xt){return M({method:H(Ne),params:M({_meta:Ut,...xt})})}function Je(Ne,xt){return M({method:H(Ne),params:M({_meta:yo.optional(),...xt}).optional()})}let Or={name:P(),arguments:se(P(),de()).optional(),...Ot},et={cursor:o.optional()},vo=He("tools/call",Or),So=He("tools/list",et),bo=He("prompts/list",et),wo=He("prompts/get",{name:P(),arguments:se(P(),P()).optional(),...Ot}),$o=He("resources/list",et),Ro=He("resources/templates/list",et),zo=He("resources/read",{uri:P(),...Ot}),Nr={ref:ae([Tt,Et]),argument:M({name:P(),value:P()}),context:M({arguments:se(P(),P()).optional()}).optional()},Po=He("completion/complete",Nr),Eo=He("server/discover",{}),Bt=M({toolsListChanged:fe().optional(),promptsListChanged:fe().optional(),resourcesListChanged:fe().optional(),resourceSubscriptions:W(P()).optional()}),xr={notifications:Bt},To=He("subscriptions/listen",xr),ko=Ft.extend({"io.modelcontextprotocol/subscriptionId":n}),Ar=_e({_meta:ko,resultType:Vt.default("complete")}),yt={"tools/call":Je("tools/call",Or),"tools/list":Je("tools/list",et),"prompts/get":Je("prompts/get",{name:P(),arguments:se(P(),P()).optional()}),"prompts/list":Je("prompts/list",et),"resources/list":Je("resources/list",et),"resources/templates/list":Je("resources/templates/list",et),"resources/read":Je("resources/read",{uri:P()}),"completion/complete":Je("completion/complete",Nr),"server/discover":Je("server/discover",{}),"subscriptions/listen":Je("subscriptions/listen",xr)};function Ue(Ne){return _e({_meta:Ht,...Ne})}let Co={"tools/call":Ue({content:W(k),structuredContent:de().optional(),isError:fe().optional()}),"tools/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),tools:W(kt),nextCursor:o.optional()}),"prompts/get":Ue({description:P().optional(),messages:W(A)}),"prompts/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),prompts:W(h),nextCursor:o.optional()}),"resources/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resources:W(Pe),nextCursor:o.optional()}),"resources/templates/list":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),resourceTemplates:W(le),nextCursor:o.optional()}),"resources/read":Ue({ttlMs:Q().int().min(0),cacheScope:ye(["public","private"]),contents:W(ae([ie,Se]))}),"completion/complete":Ue({completion:M({values:W(P()).max(100),total:Q().int().optional(),hasMore:fe().optional()}).loose()}),"server/discover":Ue({ttlMs:Q().int().min(0).catch(0),cacheScope:ye(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:Dt,instructions:P().optional()}),"subscriptions/listen":Ue({})},Nt=_e({"io.modelcontextprotocol/subscriptionId":n.optional()}),Kt=M({method:H("notifications/subscriptions/acknowledged"),params:M({_meta:Nt.optional(),notifications:Bt})}),Gt=M({_meta:Nt.optional(),requestId:n,reason:P().optional()}),Wt=M({method:H("notifications/cancelled"),params:Gt}),xn={"notifications/cancelled":Wt,"notifications/progress":j,"notifications/message":G,"notifications/resources/updated":y,"notifications/resources/list_changed":O,"notifications/tools/list_changed":Y,"notifications/prompts/list_changed":S,"notifications/subscriptions/acknowledged":Kt},Le=(Ne)=>M({jsonrpc:H("2.0"),id:ae([P(),Q().int()]),result:Ne}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:a,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:v,NotificationSchema:g,IconSchema:b,IconsSchema:R,BaseMetadataSchema:p,ImplementationSchema:T,ClientTasksCapabilitySchema:N,ServerTasksCapabilitySchema:z,ClientCapabilitiesSchema:_,ServerCapabilitiesSchema:C,ProgressSchema:q,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:j,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:G,ResourceContentsSchema:K,TextResourceContentsSchema:ie,BlobResourceContentsSchema:Se,AnnotationsSchema:ve,ResourceSchema:Pe,ResourceTemplateSchema:le,ResourceListChangedNotificationSchema:O,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:y,PromptArgumentSchema:d,PromptSchema:h,PromptListChangedNotificationSchema:S,TextContentSchema:I,ImageContentSchema:D,AudioContentSchema:B,ToolUseContentSchema:J,EmbeddedResourceSchema:ce,ResourceLinkSchema:we,ContentBlockSchema:k,PromptMessageSchema:A,ToolAnnotationsSchema:U,ToolListChangedNotificationSchema:Y,ModelHintSchema:te,ModelPreferencesSchema:oe,ToolChoiceSchema:pe,BooleanSchemaSchema:Ce,StringSchemaSchema:$e,NumberSchemaSchema:Oe,UntitledSingleSelectEnumSchemaSchema:Ee,TitledSingleSelectEnumSchemaSchema:Ye,LegacyTitledEnumSchemaSchema:xe,SingleSelectEnumSchemaSchema:ct,UntitledMultiSelectEnumSchemaSchema:Qe,TitledMultiSelectEnumSchemaSchema:ut,MultiSelectEnumSchemaSchema:pt,EnumSchemaSchema:mt,PrimitiveSchemaDefinitionSchema:zt,ElicitRequestFormParamsSchema:Pt,ResourceTemplateReferenceSchema:Et,PromptReferenceSchema:Tt,RootSchema:ar,ClientCapabilities2026Schema:cr,ServerCapabilities2026Schema:Dt,RequestMetaEnvelopeSchema:Ut,ToolSchema:kt,ToolResultContentSchema:ur,SamplingMessageContentBlockSchema:Zt,SamplingMessageSchema:Ct,ResultTypeSchema:Vt,ResultMetaSchema:Ft,ResultSchema:lr,PaginatedResultSchema:mo,CallToolResultSchema:Jt,ListToolsResultSchema:dr,ListPromptsResultSchema:fr,GetPromptResultSchema:hr,ListResourcesResultSchema:pr,ListResourceTemplatesResultSchema:mr,ReadResourceResultSchema:gr,CompleteResultSchema:_r,CacheableResultSchema:go,DiscoverResultSchema:yr,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vr,ListRootsRequestSchema:Sr,CreateMessageResultSchema:br,ListRootsResultSchema:wr,ElicitResultSchema:$r,ElicitRequestURLParamsSchema:Rr,ElicitRequestParamsSchema:zr,ElicitRequestSchema:Pr,InputRequestSchema:Er,InputResponseSchema:Tr,InputRequestsSchema:kr,InputResponsesSchema:Cr,InputRequiredResultSchema:It,InputResponseRequestParamsSchema:_o,CallToolRequestSchema:vo,ListToolsRequestSchema:So,ListPromptsRequestSchema:bo,GetPromptRequestSchema:wo,ListResourcesRequestSchema:$o,ListResourceTemplatesRequestSchema:Ro,ReadResourceRequestSchema:zo,CompleteRequestSchema:Po,DiscoverRequestSchema:Eo,SubscriptionFilterSchema:Bt,SubscriptionsListenRequestSchema:To,SubscriptionsListenResultMetaSchema:ko,SubscriptionsListenResultSchema:Ar,dispatchRequestSchemas:yt,dispatchResultSchemas:Co,NotificationMetaSchema:Nt,SubscriptionsAcknowledgedNotificationSchema:Kt,CancelledNotificationParamsSchema:Gt,CancelledNotificationSchema:Wt,notificationSchemas2026:xn,JSONRPCResultResponseSchema:Le(lr),CallToolResultResponseSchema:Le(ae([Jt,It])),ListToolsResultResponseSchema:Le(dr),ListPromptsResultResponseSchema:Le(fr),GetPromptResultResponseSchema:Le(ae([hr,It])),ListResourcesResultResponseSchema:Le(pr),ListResourceTemplatesResultResponseSchema:Le(mr),ReadResourceResultResponseSchema:Le(ae([gr,It])),CompleteResultResponseSchema:Le(_r),DiscoverResultResponseSchema:Le(yr),SubscriptionsListenResultResponseSchema:Le(Ar)}}var Hm;function $t(){return Hm??=Fm()}var Jm=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Bm(e){return Jm.includes(e)}var vi=Symbol("modelcontextprotocol.resultCacheHintFallback");function Km(e){return e[vi]}function Jd(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Bd(e){return e==="public"||e==="private"}var ne=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}({}),be=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Fe(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 Fe(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",Rt(this,new.target)}static fromError(t,r,o){if(t===ne.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Gd(n.elicitations,r)}if(t===ne.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new lo({supported:n.supported,requested:n.requested},r)}if(t===ne.InvalidParams||t===ne.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===ne.ResourceNotFound||Object.keys(n).length===1))return new Kd(n.uri,r)}if(t===ne.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new Wd({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Kd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ne.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Gd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ne.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},lo=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ne.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Wd=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ne.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Gm=0,Wm="private",Ym=["tools/call","prompts/get","resources/read"];function Xm(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Ym.includes(e))return t;throw new be(ne.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Qm(e,t){let r=Km(t);if(t.resultType!=="complete"||!Bm(e))return r===void 0?t:ng(t);let o=t,n=Jd(o.ttlMs)?o.ttlMs:rg(r),s=Bd(o.cacheScope)?o.cacheScope:og(r),i={...o,ttlMs:n,cacheScope:s};return delete i[vi],i}function eg(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function tg(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Oa]:t}};if(!eg(r))return e;if(r[Oa]!==void 0)return e;return{...e,_meta:{...r,[Oa]:t}}}function rg(e){return e!==void 0&&Jd(e.ttlMs)?e.ttlMs:Gm}function og(e){return e!==void 0&&Bd(e.cacheScope)?e.cacheScope:Wm}function ng(e){let t={...e};return delete t[vi],t}var sg=["elicitation/create","sampling/createMessage","roots/list"],vn;function Yd(){if(vn)return vn;let e=$t();return vn={request:{"elicitation/create":M({method:H("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":M({method:H("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":M({method:H("roots/list"),params:_e({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},vn}function Xd(e){return sg.includes(e)}function si(e){return Xd(e)?Yd().request[e]:void 0}function ig(e){return Xd(e)?Yd().response[e]:void 0}var Si={"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},Qd={"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 ef(e){return Object.prototype.hasOwnProperty.call(Si,e)}function tf(e){return Object.prototype.hasOwnProperty.call(Qd,e)}function ag(e){return Object.prototype.hasOwnProperty.call(Si,e)}function cg(e){return ef(e)?$t().dispatchRequestSchemas[e]:void 0}function ug(e){return ag(e)?$t().dispatchResultSchemas[e]:void 0}function lg(e){return tf(e)?$t().notificationSchemas2026[e]:void 0}var r0=Object.keys(Si),o0=Object.keys(Qd);function so(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ro(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 dg={ok:!1,reason:"not-in-era"},fg=[cs,Ir];function hg(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((c)=>so(c)&&("execution"in c)))n().tools=s.map((c)=>{if(!so(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a});let i=t.capabilities;if(so(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var bi={era:"2026-07-28",hasRequestMethod:ef,hasNotificationMethod:tf,hasInputRequestMethod:(e)=>si(e)!==void 0,validateRequest:(e,t)=>ro(cg(e),t),validateResult:(e,t)=>ro(ug(e),t),validateNotification:(e,t)=>ro(lg(e),t),validateInputRequest:(e,t)=>ro(si(e),t),validateInputResponse:(e,t)=>ro(ig(e),t),samplingResultVariant:()=>dg,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 fg)if(!(o in e))t.push({key:o,problem:"missing"});let r=$t().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)=>qd(e),inputRequestSchema:si,decodeResult(e,t){if(!so(t))return{kind:"invalid",error:new X(ee.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new X(ee.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 X(ee.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,c=so(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:$t().ResultMetaSchema.safeParse(t._meta),l=u?.success?u.data:void 0;if(Object.keys(c).length===0&&typeof a!=="string")return{kind:"invalid",error:new X(ee.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:c,...typeof a==="string"&&{requestState:a},...l!==void 0&&{_meta:l}}}if(r!=="complete")return{kind:"invalid",error:new X(ee.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=pg(),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 X(ee.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 tg(Qm(e,Xm(e,hg(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=$t().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("; ")}`}},Sn;function pg(){if(Sn)return Sn;let e=$t();return Sn={"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},Sn}var $n="2026-07-28";function ft(e){return e!==void 0&&ht(e)?bi:yi}function Ed(e){if(e.revision!==void 0)return ft(e.revision).era;return e.era==="modern"?bi.era:yi.era}function ai(e){return rf.some((t)=>t.hasRequestMethod(e))}function ci(e){return rf.some((t)=>t.hasNotificationMethod(e))}function Td(e){return e==="tasks/get"||e==="tasks/cancel"}var rf=[yi,bi],mg=Di({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});var Rn=(e)=>sw.safeParse(e).success,of=(e)=>aw.safeParse(e).success,or=(e)=>Rv.safeParse(e).success,fo=(e)=>Pv.safeParse(e).success;var nf=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var gg="Mcp-Param-",kd="x-mcp-header",_g=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,yg=new Set(["string","integer","boolean"]);function wi(e){let t=[],r=new Map,o,n=(i,c,a)=>{if(i===null||typeof i!=="object")return;let u=i;if(kd in u){if(!a||c.length===0)return`${bn(c)}: 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 f=u[kd];if(typeof f!=="string"||f.length===0)return`${bn(c)}: x-mcp-header MUST be a non-empty string`;if(!_g.test(f))return`${bn(c)}: x-mcp-header '${f}' 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||!yg.has(m)){let b=`${bn(c)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return b;o??=b}let v=f.toLowerCase(),g=r.get(v);if(g!==void 0)return`x-mcp-header '${f}' is not case-insensitively unique (also declared as '${g}')`;r.set(v,f),t.push({path:c,headerName:f,type:m})}let l=u.properties;if(l!==null&&typeof l==="object")for(let[f,m]of Object.entries(l)){let v=n(m,[...c,f],a);if(v!==void 0)return v}for(let f of vg){let m=u[f];if(m===void 0)continue;let v=Array.isArray(m)?m:m!==null&&typeof m==="object"&&Sg.has(f)?Object.values(m):[m];for(let g of v){let b=n(g,[...c,`<${f}>`],!1);if(b!==void 0)return b}}},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 vg=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Sg=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function bn(e){return e.length===0?"<root>":e.join(".")}var sf="=?base64?",af="?=";function bg(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 wg(e){if(e.length===0)return!0;if(e.startsWith(sf)&&e.endsWith(af))return!0;if(e!==e.trim())return!0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);if(r===9||r>=32&&r<=126)continue;return!0}return!1}function $g(e){let t=new TextEncoder().encode(e),r="";for(let o of t)r+=String.fromCodePoint(o);return btoa(r)}function cf(e){return wg(e)?`${sf}${$g(e)}${af}`:e}function Rg(e,t){let r=e;for(let o of t){if(r===null||typeof r!=="object")return;r=r[o]}return r}function uf(e,t){let r={};for(let o of e){let n=Rg(t,o.path);if(n===void 0||n===null)continue;let s=bg(n);if(s===void 0)continue;r[`${gg}${o.headerName}`]=cf(s)}return r}var rr=-32020,n0=[{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:[ne.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:[rr,ne.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:[ne.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:[ne.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:[ne.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:[rr],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:[ne.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:[rr],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."}],s0={[ne.ParseError]:400,[ne.InvalidRequest]:400,[ne.MethodNotFound]:404,[ne.UnsupportedProtocolVersion]:400,[ne.MissingRequiredClientCapability]:400,[rr]:400};function zn(e,t){return fn(e,t)}function oo(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function fi(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 Cd=!1,hi="draft-2020-12";function zg(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:hi});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(!Cd)Cd=!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=ln(e,{target:hi,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 lf(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 Pg=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function lf(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref==="string"&&Pg.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"||lf(s,"$id"in s?{}:t)))}return!1}function Eg(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 ui(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>Eg(o)).join(", ")};return{success:!0,data:r.value}}function Tg(e){let t=ln(e,{target:hi,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var kg=/\\\.\\d\{(\d+)\}/;function Cg(e){let t=kg.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)=>ni({local:o,offset:n,precision:s}))))}function Ig(e,t){let r;switch(e){case"email":r=[dd()];break;case"uri":r=[hd()];break;case"date":r=[vm()];break;case"date-time":r=Cg(t);break}return new Set(r.map((o)=>Tg(o)).filter((o)=>o!==void 0))}function Og(e,t,r){if(r!=="zod")return!0;return Ig(e,t).has(t)}function ao(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ng(e){try{return zg(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new be(ne.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var xg=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function $i(e){return xg.has(e)||e.startsWith("x-")}var Ag=new Set(["$schema",...Object.keys(Wh.shape.requestedSchema.shape)]),Id={string:oo([qh,hw,gw,yw]),number:oo([Vh]),integer:oo([Vh]),boolean:oo([fw]),array:oo([vw,bw])},Mg=new Set(qh.shape.format.unwrap().options);function jg(e,t,r,o){if(!ao(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(Id,e.type)?Id[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))if(n.has(i)||$i(i))s[i]=c;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Mg.has(e.format))s[i]=c;else if(typeof c!=="string"||!Og(e.format,c,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function qg(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&ao(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,jg(c,`properties.${i}`,t,o)]));else if(Ag.has(n))r[n]=s;else if(!$i(n))o.push(n);if(o.length>0)throw new be(ne.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Lg(e,t){if(!ao(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!zn(Sw,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function pi(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>pi(o,t[n],`${r}[${n}]`));if(!ao(e)||!ao(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return $i(o)?[]:[s];return pi(n,t[o],s)})}function Dg(e){if(!fi(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=qg(Ng(e.requestedSchema),t),o=zn(Wh.shape.requestedSchema,r);if(!o.success)throw new be(ne.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Lg(r,o.error.message)}`);let n=pi(r,o.data);if(n.length>0)throw new be(ne.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 be(ne.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Ug(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 i0=Object.assign(Ug,{elicit(e){try{return{method:"elicitation/create",params:Dg(e)}}catch(t){throw t instanceof be?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Zg=!0,Vg=10,Fg=250;function df(e){return{autoFulfill:e?.autoFulfill??Zg,maxRounds:e?.maxRounds??Vg}}function Hg(e,t,r){let o=t!==void 0&&Object.keys(t).length>0;if(!o&&r===void 0)return e;return{...e,...o&&{inputResponses:t},...r!==void 0&&{requestState:r}}}function Jg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Bg(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof X?t.reason:new X(ee.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof X?t.reason:new X(ee.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Kg(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)}}async function Gg(e){let{config:t,method:r,originalParams:o,requestOptions:n,hooks:s,signal:i}=e,c=e.flowStartedAt??Date.now(),a=e.firstPayload,u=0;while(!0){if(u+=1,u>t.maxRounds)throw new X(ee.InputRequiredRoundsExceeded,Jg(r,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:a.inputRequests,...a.requestState!==void 0&&{requestState:a.requestState}}});n.onprogress?.({progress:u,message:`Fulfilling input required by '${r}' (round ${u})`});let l=Object.entries(a.inputRequests??{}),f;if(l.length>0){let g=Kg(i);try{let b=await Promise.all(l.map(async([R,p])=>{try{return[R,await s.dispatchInputRequest(R,p,g.signal)]}catch(T){throw g.abort(T),T}}));f=Object.fromEntries(b)}finally{g.dispose()}}else await Bg(Fg,i);let m={...n.timeout!==void 0&&{timeout:n.timeout}};if(n.maxTotalTimeout!==void 0){let g=Date.now()-c,b=n.maxTotalTimeout-g;if(b<=0)throw new X(ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:g});m.maxTotalTimeout=b}let v=await s.retry(Hg(o,f,a.requestState),m);if(nf(v)){a={inputRequests:v.inputRequests??{},...v.requestState!==void 0&&{requestState:v.requestState}};continue}return v}}var Wg=["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"],Yg={IdJagTokenExchangeResponseSchema:pC,OAuthClientInformationFullSchema:hC,OAuthClientInformationSchema:fC,OAuthClientMetadataSchema:mC,OAuthClientRegistrationErrorSchema:IF,OAuthErrorResponseSchema:vT,OAuthMetadataSchema:gT,OAuthProtectedResourceMetadataSchema:dC,OAuthTokenRevocationRequestSchema:_F,OAuthTokensSchema:yT,OpenIdProviderDiscoveryMetadataSchema:uC,OpenIdProviderMetadataSchema:lC},ff={},hf={};function pf(e,t){let r=e.slice(0,-6);ff[r]=t,hf[r]=(o)=>t.safeParse(o).success}for(let e of Wg)pf(e,mg[e]);for(let[e,t]of Object.entries(Yg))pf(e,t);var Xg=Object.freeze(ff),Ri=Object.freeze(hf);function Qg(e){switch(e){case"initialize":case"notifications/initialized":return ft(void 0);case"server/discover":return ft($n);default:return}}var ho=60000,e_=[cs,fu,Ir,mp],t_=["inputResponses","requestState"];function Od(e,t){let r=e.params;if(!io(r))return{message:e,lifted:{}};let o=r._meta,n=io(o)?e_.filter((a)=>(a in o)):[],s=t==="request"?t_.filter((a)=>(a in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&io(o)){let a={},u={...o};for(let l of n)a[l]=o[l],delete u[l];if(i.envelope=a,Object.keys(u).length>0)c._meta=u;else delete c._meta}for(let a of s){if(a==="inputResponses")i.inputResponses=c[a];if(a==="requestState")i.requestState=c[a];delete c[a]}return{message:{...e,params:c},lifted:i}}function Nd(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 zi(e){return()=>e}var r_=zi(void 0),o_,Pi=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{o_=(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 X(ee.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 X(ee.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),or(n)||fo(n))this._onresponse(n);else if(Rn(n))this._onrequest(n,s);else if(of(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 X(ee.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}=Od(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=Ed(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(ci(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}=Od(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=(b,R,p)=>{let T={jsonrpc:"2.0",id:r.id,error:{code:b,message:R,...p!==void 0&&{data:p}}};s?.send(T).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(t?.classification!==void 0){let b=Ed(t.classification);if(b!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${b} but this instance serves ${n.era}`));let R=t.classification.revision??b;i(ne.UnsupportedProtocolVersion,`Unsupported protocol version: ${R}`,{supported:this._supportedProtocolVersions,requested:R});return}}if(ai(r.method)&&!n.hasRequestMethod(r.method)&&!(Td(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(ne.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(ne.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(ne.InvalidParams,a);return}let u=(b,R)=>this._notificationViaCodec(this._resolveOutboundCodec(b.method),b,{...R,relatedRequestId:r.id}),l=(b,R,p)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(b.method),b,R,{...p,relatedRequestId:r.id}),f=new AbortController;this._requestHandlerAbortControllers.set(r.id,f);let m=o.inputResponses===void 0?void 0:n_(o.inputResponses),v={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?r_:zi(o.requestState),signal:f.signal,send:(b,R,p)=>{let T=this._resolveOutboundCodec(b.method);if(this._assertOutboundRequestInEra(T,b.method),fi(R))return l(b,R,p);let w=Nd(T,b.method);if(w===void 0)throw TypeError(`'${b.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(b,w,R)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},g=this.buildContext(v,t);Promise.resolve().then(()=>c(r,g)).then(async(b)=>{if(f.signal.aborted)return;let R;try{R=n.encodeResult(r.method,b,this._outboundServerInfo())}catch(T){this._onerror(Error(`Failed to encode result for ${r.method}: ${T}`)),i(ne.InternalError,"Internal error");return}let p={result:R,jsonrpc:"2.0",id:r.id};await s?.send(p)},async(b)=>{if(f.signal.aborted)return;let R=Number.isSafeInteger(b.code)?b.code:ne.InternalError,p={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(R),message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};await s?.send(p)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===f)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(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(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),or(e))r(e);else r(be.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(fi(t)){if(!Td(e.method))this._assertOutboundRequestInEra(o,e.method);return this._requestWithSchemaViaCodec(o,e,t,r)}this._assertOutboundRequestInEra(o,e.method);let n=Nd(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=Qg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ai(t)&&!e.hasRequestMethod(t))throw new X(ee.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=o??{},a=Date.now(),u,l;return new Promise((f,m)=>{let v=(z)=>{m(z)};if(!this._transport){v(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(z){v(z);return}if(o?.signal?.aborted){let z=o.signal.reason;throw z instanceof X?z:new X(ee.RequestTimeout,String(z))}let g=e.era===$n&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,b=this._requestMessageId++;l=b;let R={...t,jsonrpc:"2.0",id:b};if(o?.onprogress)this._progressHandlers.set(b,o.onprogress),R.params={...t.params,_meta:{...t.params?._meta,progressToken:b}};let p=this._envelopeOutbound(R),T=!1,w=(z)=>{if(T)return;if(this._progressHandlers.delete(b),g===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(z)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((_)=>this._onerror(Error(`Failed to send cancellation: ${_}`)))}else g.abort();m(z instanceof X?z:new X(ee.RequestTimeout,String(z)))};this._responseHandlers.set(b,(z)=>{if(o?.signal?.aborted)return;if(T=!0,z instanceof Error)return m(z);let _;try{_=e.decodeResult(t.method,z.result)}catch(q){return m(q instanceof Error?q:Error(String(q)))}if(_.kind==="invalid")return m(_.error);if(_.kind==="input_required"){if(o?.allowInputRequired===!0)return f(c_(_));let q={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(F,j)=>this._requestWithSchemaViaCodec(e,F===void 0?{method:t.method}:{method:t.method,params:F},r,j)};return f(this._resolveNonCompleteResult(_,q))}let C=_.result;ui(r,C).then((q)=>{if(q.success)f(q.data);else m(new X(ee.InvalidResult,`Invalid result for ${t.method}: ${q.error}`))},m)}),u=()=>w(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let E=o?.timeout??ho,N=()=>w(new X(ee.RequestTimeout,"Request timed out",{timeout:E}));this._setupTimeout(b,E,o?.maxTotalTimeout,N,o?.resetTimeoutOnProgress??!1),this._transport.send(p,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:g?.signal}).catch((z)=>{this._progressHandlers.delete(b),m(z)})}).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 X(ee.NotConnected,"Not connected");if(ci(t.method)&&!e.hasNotificationMethod(t.method))throw new X(ee.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(!ai(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(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era")c=i.validateInputRequest(e,n);if(!c.ok){if(c.reason==="not-in-era")throw new be(ne.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(c.message)}return Promise.resolve(t(c.value,s))}}else if(r)o=async(n,s)=>{let i=await ui(t.params,{...n.params});if(!i.success)throw new be(ne.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(!ci(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 be(ne.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 ui(t.params,{...o.params});if(!n.success)throw new be(ne.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function io(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Ei(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]=io(i)&&io(s)?{...i,...s}:s}return r}function wn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function n_(e){let t={},r=[];if(!wn(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!wn(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function xd(e){throw new X(ee.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function s_(e,t,r,o,n){return{sessionId:n,mcpReq:{id:e,method:t,_meta:r?._meta,requestState:zi(void 0),signal:o,send:()=>xd("send"),notify:()=>xd("notify")}}}async function i_(e,t,r,o,n){if(!wn(o)||typeof o.method!=="string")throw new X(ee.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let s=o.method;if(!t.hasInputRequestMethod(s))throw new X(ee.InvalidResult,`Invalid input request '${r}': '${s}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:s});let i=e.getRequestHandler(s);if(i===void 0)throw new X(ee.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${s}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:s});let c=wn(o.params)?o.params:void 0;return await i({jsonrpc:"2.0",id:r,method:s,...c!==void 0&&{params:c}},e.buildContext(s_(r,s,c,n,e.sessionId)))}function a_(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function mf(e,t,r,o){let{codec:n,request:s,options:i,flowStartedAt:c}=o,a={inputRequests:r.inputRequests,...r.requestState!==void 0&&{requestState:r.requestState}},u={dispatchInputRequest:(l,f,m)=>i_(e,n,l,f,m),retry:(l,f)=>o.retry(l,a_(i,f))};return Gg({config:t,method:s.method,originalParams:s.params,firstPayload:a,flowStartedAt:c,signal:i?.signal,requestOptions:{...i?.timeout!==void 0&&{timeout:i.timeout},...i?.maxTotalTimeout!==void 0&&{maxTotalTimeout:i.maxTotalTimeout},...i?.onprogress!==void 0&&{onprogress:i.onprogress}},hooks:u})}function c_(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
|
|
59
59
|
* content-type
|
|
60
60
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
61
61
|
* MIT Licensed
|
|
62
|
-
*/var u_=V((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw TypeError("argument string is required");var a=typeof c==="object"?s(c):c;if(typeof a!=="string")throw TypeError("argument string is required to be a string");var u=a.indexOf(";"),l=u!==-1?a.slice(0,u).trim():a.trim();if(!o.test(l))throw TypeError("invalid media type");var f=new i(l.toLowerCase());if(u!==-1){var m,v,g;t.lastIndex=u;while(v=t.exec(a)){if(v.index!==u)throw TypeError("invalid parameter format");if(u+=v[0].length,m=v[1].toLowerCase(),g=v[2],g.charCodeAt(0)===34){if(g=g.slice(1,-1),g.indexOf("\\")!==-1)g=g.replace(r,"$1")}f.parameters[m]=g}if(u!==a.length)throw TypeError("invalid parameter format")}return f}function s(c){var a;if(typeof c.getHeader==="function")a=c.getHeader("content-type");else if(typeof c.headers==="object")a=c.headers&&c.headers["content-type"];if(typeof a!=="string")throw TypeError("content-type header is missing from object");return a}function i(c){this.parameters=Object.create(null),this.type=c}}),R0=Oo(u_(),1);var Pn=V((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(p){super();if(!e.IDENTIFIER.test(p))throw Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(p){super();this._items=typeof p==="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((T,w)=>`${T}${w}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((T,w)=>{if(w instanceof r)T[w.str]=(T[w.str]||0)+1;return T},{})}};e._Code=o,e.nil=new o("");function n(p,...T){let w=[p[0]],E=0;while(E<T.length)c(w,T[E]),w.push(p[++E]);return new o(w)}e._=n;let s=new o("+");function i(p,...T){let w=[v(p[0])],E=0;while(E<T.length)w.push(s),c(w,T[E]),w.push(s,v(p[++E]));return a(w),new o(w)}e.str=i;function c(p,T){if(T instanceof o)p.push(...T._items);else if(T instanceof r)p.push(T);else p.push(f(T))}e.addCodeArg=c;function a(p){let T=1;while(T<p.length-1){if(p[T]===s){let w=u(p[T-1],p[T+1]);if(w!==void 0){p.splice(T-1,3,w);continue}p[T++]="+"}T++}}function u(p,T){if(T==='""')return p;if(p==='""')return T;if(typeof p=="string"){if(T instanceof r||p[p.length-1]!=='"')return;if(typeof T!="string")return`${p.slice(0,-1)}${T}"`;if(T[0]==='"')return p.slice(0,-1)+T.slice(1);return}if(typeof T=="string"&&T[0]==='"'&&!(p instanceof r))return`"${p}${T.slice(1)}`}function l(p,T){return T.emptyStr()?p:p.emptyStr()?T:i`${p}${T}`}e.strConcat=l;function f(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:v(Array.isArray(p)?p.join(","):p)}function m(p){return new o(v(p))}e.stringify=m;function v(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function g(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new o(`.${p}`):n`[${p}]`}e.getProperty=g;function b(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new o(`${p}`);throw Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=b;function R(p){return new o(p.toString())}e.regexpCode=R}),_f=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Pn();var r=class extends Error{constructor(a){super(`CodeGen: "code" for ${a} not defined`);this.value=a.value}},o;(function(a){a[a.Started=0]="Started",a[a.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:a,parent:u}={}){this._names={},this._prefixes=a,this._parent=u}toName(a){return a instanceof t.Name?a:this.name(a)}name(a){return new t.Name(this._newName(a))}_newName(a){let u=this._names[a]||this._nameGroup(a);return`${a}${u.index++}`}_nameGroup(a){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(a))||this._prefixes&&!this._prefixes.has(a))throw Error(`CodeGen: prefix "${a}" is not allowed in this scope`);return this._names[a]={prefix:a,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(a,u){super(u);this.prefix=a}setValue(a,{property:u,itemIndex:l}){this.value=a,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var c=class extends n{constructor(a){super(a);this._values={},this._scope=a.scope,this.opts={...a,_n:a.lines?i:t.nil}}get(){return this._scope}name(a){return new s(a,this._newName(a))}value(a,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let f=this.toName(a),{prefix:m}=f,v=(l=u.key)!==null&&l!==void 0?l:u.ref,g=this._values[m];if(g){let p=g.get(v);if(p)return p}else g=this._values[m]=new Map;g.set(v,f);let b=this._scope[m]||(this._scope[m]=[]),R=b.length;return b[R]=u.ref,f.setValue(u,{property:m,itemIndex:R}),f}getValue(a,u){let l=this._values[a];if(!l)return;return l.get(u)}scopeRefs(a,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${a}${l.scopePath}`})}scopeCode(a=this._values,u,l){return this._reduceValues(a,(f)=>{if(f.value===void 0)throw Error(`CodeGen: name "${f}" has no value`);return f.value.code},u,l)}_reduceValues(a,u,l={},f){let m=t.nil;for(let v in a){let g=a[v];if(!g)continue;let b=l[v]=l[v]||new Map;g.forEach((R)=>{if(b.has(R))return;b.set(R,o.Started);let p=u(R);if(p){let T=this.opts.es5?e.varKinds.var:e.varKinds.const;m=t._`${m}${T} ${R} = ${p};${this.opts._n}`}else if(p=f===null||f===void 0?void 0:f(R))m=t._`${m}${p}${this.opts._n}`;else throw new r(R);b.set(R,o.Completed)})}return m}};e.ValueScope=c}),ue=V((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=Pn(),r=_f();var o=Pn();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=_f();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(d,h){return this}},i=class extends s{constructor(d,h,S){super();this.varKind=d,this.name=h,this.rhs=S}render({es5:d,_n:h}){let S=d?r.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${S} ${this.name}${I};`+h}optimizeNames(d,h){if(!d[this.name.str])return;if(this.rhs)this.rhs=K(this.rhs,d,h);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor(d,h,S){super();this.lhs=d,this.rhs=h,this.sideEffects=S}render({_n:d}){return`${this.lhs} = ${this.rhs};`+d}optimizeNames(d,h){if(this.lhs instanceof t.Name&&!d[this.lhs.str]&&!this.sideEffects)return;return this.rhs=K(this.rhs,d,h),this}get names(){return G(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor(d,h,S,I){super(d,S,I);this.op=h}render({_n:d}){return`${this.lhs} ${this.op}= ${this.rhs};`+d}},u=class extends s{constructor(d){super();this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}},l=class extends s{constructor(d){super();this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}},f=class extends s{constructor(d){super();this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}},m=class extends s{constructor(d){super();this.code=d}render({_n:d}){return`${this.code};`+d}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(d,h){return this.code=K(this.code,d,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},v=class extends s{constructor(d=[]){super();this.nodes=d}render(d){return this.nodes.reduce((h,S)=>h+S.render(d),"")}optimizeNodes(){let{nodes:d}=this,h=d.length;while(h--){let S=d[h].optimizeNodes();if(Array.isArray(S))d.splice(h,1,...S);else if(S)d[h]=S;else d.splice(h,1)}return d.length>0?this:void 0}optimizeNames(d,h){let{nodes:S}=this,I=S.length;while(I--){let D=S[I];if(D.optimizeNames(d,h))continue;ie(d,D.names),S.splice(I,1)}return S.length>0?this:void 0}get names(){return this.nodes.reduce((d,h)=>Z(d,h.names),{})}},g=class extends v{render(d){return"{"+d._n+super.render(d)+"}"+d._n}},b=class extends v{},R=class extends g{};R.kind="else";var p=class d extends g{constructor(h,S){super(S);this.condition=h}render(h){let S=`if(${this.condition})`+super.render(h);if(this.else)S+="else "+this.else.render(h);return S}optimizeNodes(){super.optimizeNodes();let h=this.condition;if(h===!0)return this.nodes;let S=this.else;if(S){let I=S.optimizeNodes();S=this.else=Array.isArray(I)?new R(I):I}if(S){if(h===!1)return S instanceof d?S:S.nodes;if(this.nodes.length)return this;return new d(Se(h),S instanceof d?[S]:S.nodes)}if(h===!1||!this.nodes.length)return;return this}optimizeNames(h,S){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(h,S),!(super.optimizeNames(h,S)||this.else))return;return this.condition=K(this.condition,h,S),this}get names(){let h=super.names;if(G(h,this.condition),this.else)Z(h,this.else.names);return h}};p.kind="if";var T=class extends g{};T.kind="for";var w=class extends T{constructor(d){super();this.iteration=d}render(d){return`for(${this.iteration})`+super.render(d)}optimizeNames(d,h){if(!super.optimizeNames(d,h))return;return this.iteration=K(this.iteration,d,h),this}get names(){return Z(super.names,this.iteration.names)}},E=class extends T{constructor(d,h,S,I){super();this.varKind=d,this.name=h,this.from=S,this.to=I}render(d){let h=d.es5?r.varKinds.var:this.varKind,{name:S,from:I,to:D}=this;return`for(${h} ${S}=${I}; ${S}<${D}; ${S}++)`+super.render(d)}get names(){return G(G(super.names,this.from),this.to)}},N=class extends T{constructor(d,h,S,I){super();this.loop=d,this.varKind=h,this.name=S,this.iterable=I}render(d){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(d)}optimizeNames(d,h){if(!super.optimizeNames(d,h))return;return this.iterable=K(this.iterable,d,h),this}get names(){return Z(super.names,this.iterable.names)}},z=class extends g{constructor(d,h,S){super();this.name=d,this.args=h,this.async=S}render(d){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(d)}};z.kind="func";var _=class extends v{render(d){return"return "+super.render(d)}};_.kind="return";var C=class extends g{render(d){let h="try"+super.render(d);if(this.catch)h+=this.catch.render(d);if(this.finally)h+=this.finally.render(d);return h}optimizeNodes(){var d,h;return super.optimizeNodes(),(d=this.catch)===null||d===void 0||d.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(d,h){var S,I;return super.optimizeNames(d,h),(S=this.catch)===null||S===void 0||S.optimizeNames(d,h),(I=this.finally)===null||I===void 0||I.optimizeNames(d,h),this}get names(){let d=super.names;if(this.catch)Z(d,this.catch.names);if(this.finally)Z(d,this.finally.names);return d}},q=class extends g{constructor(d){super();this.error=d}render(d){return`catch(${this.error})`+super.render(d)}};q.kind="catch";var F=class extends g{render(d){return"finally"+super.render(d)}};F.kind="finally";var j=class{constructor(d,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
63
|
-
`:""},this._extScope=d,this._scope=new r.Scope({parent:d}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(d){return this._scope.name(d)}scopeName(d){return this._extScope.name(d)}scopeValue(d,h){let S=this._extScope.value(d,h);return(this._values[S.prefix]||(this._values[S.prefix]=new Set)).add(S),S}getScopeValue(d,h){return this._extScope.getValue(d,h)}scopeRefs(d){return this._extScope.scopeRefs(d,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(d,h,S,I){let D=this._scope.toName(h);if(S!==void 0&&I)this._constants[D.str]=S;return this._leafNode(new i(d,D,S)),D}const(d,h,S){return this._def(r.varKinds.const,d,h,S)}let(d,h,S){return this._def(r.varKinds.let,d,h,S)}var(d,h,S){return this._def(r.varKinds.var,d,h,S)}assign(d,h,S){return this._leafNode(new c(d,h,S))}add(d,h){return this._leafNode(new a(d,e.operators.ADD,h))}code(d){if(typeof d=="function")d();else if(d!==t.nil)this._leafNode(new m(d));return this}object(...d){let h=["{"];for(let[S,I]of d){if(h.length>1)h.push(",");if(h.push(S),S!==I||this.opts.es5)h.push(":"),(0,t.addCodeArg)(h,I)}return h.push("}"),new t._Code(h)}if(d,h,S){if(this._blockNode(new p(d)),h&&S)this.code(h).else().code(S).endIf();else if(h)this.code(h).endIf();else if(S)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(d){return this._elseNode(new p(d))}else(){return this._elseNode(new R)}endIf(){return this._endBlockNode(p,R)}_for(d,h){if(this._blockNode(d),h)this.code(h).endFor();return this}for(d,h){return this._for(new w(d),h)}forRange(d,h,S,I,D=this.opts.es5?r.varKinds.var:r.varKinds.let){let B=this._scope.toName(d);return this._for(new E(D,B,h,S),()=>I(B))}forOf(d,h,S,I=r.varKinds.const){let D=this._scope.toName(d);if(this.opts.es5){let B=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,t._`${B}.length`,(J)=>{this.var(D,t._`${B}[${J}]`),S(D)})}return this._for(new N("of",I,D,h),()=>S(D))}forIn(d,h,S,I=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(d,t._`Object.keys(${h})`,S);let D=this._scope.toName(d);return this._for(new N("in",I,D,h),()=>S(D))}endFor(){return this._endBlockNode(T)}label(d){return this._leafNode(new u(d))}break(d){return this._leafNode(new l(d))}return(d){let h=new _;if(this._blockNode(h),this.code(d),h.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(_)}try(d,h,S){if(!h&&!S)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new C;if(this._blockNode(I),this.code(d),h){let D=this.name("e");this._currNode=I.catch=new q(D),h(D)}if(S)this._currNode=I.finally=new F,this.code(S);return this._endBlockNode(q,F)}throw(d){return this._leafNode(new f(d))}block(d,h){if(this._blockStarts.push(this._nodes.length),d)this.code(d).endBlock(h);return this}endBlock(d){let h=this._blockStarts.pop();if(h===void 0)throw Error("CodeGen: not in self-balancing block");let S=this._nodes.length-h;if(S<0||d!==void 0&&S!==d)throw Error(`CodeGen: wrong number of nodes: ${S} vs ${d} expected`);return this._nodes.length=h,this}func(d,h=t.nil,S,I){if(this._blockNode(new z(d,h,S)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(z)}optimize(d=1){while(d-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(d){return this._currNode.nodes.push(d),this}_blockNode(d){this._currNode.nodes.push(d),this._nodes.push(d)}_endBlockNode(d,h){let S=this._currNode;if(S instanceof d||h&&S instanceof h)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${h?`${d.kind}/${h.kind}`:d.kind}"`)}_elseNode(d){let h=this._currNode;if(!(h instanceof p))throw Error('CodeGen: "else" without "if"');return this._currNode=h.else=d,this}get _root(){return this._nodes[0]}get _currNode(){let d=this._nodes;return d[d.length-1]}set _currNode(d){let h=this._nodes;h[h.length-1]=d}};e.CodeGen=j;function Z(d,h){for(let S in h)d[S]=(d[S]||0)+(h[S]||0);return d}function G(d,h){return h instanceof t._CodeOrName?Z(d,h.names):d}function K(d,h,S){if(d instanceof t.Name)return I(d);if(!D(d))return d;return new t._Code(d._items.reduce((B,J)=>{if(J instanceof t.Name)J=I(J);if(J instanceof t._Code)B.push(...J._items);else B.push(J);return B},[]));function I(B){let J=S[B.str];if(J===void 0||h[B.str]!==1)return B;return delete h[B.str],J}function D(B){return B instanceof t._Code&&B._items.some((J)=>J instanceof t.Name&&h[J.str]===1&&S[J.str]!==void 0)}}function ie(d,h){for(let S in h)d[S]=(d[S]||0)-(h[S]||0)}function Se(d){return typeof d=="boolean"||typeof d=="number"||d===null?!d:t._`!${y(d)}`}e.not=Se;let ve=x(e.operators.AND);function Pe(...d){return d.reduce(ve)}e.and=Pe;let le=x(e.operators.OR);function O(...d){return d.reduce(le)}e.or=O;function x(d){return(h,S)=>h===t.nil?S:S===t.nil?h:t._`${y(h)} ${d} ${y(S)}`}function y(d){return d instanceof t.Name?d:t._`(${d})`}}),me=V((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=ue(),r=Pn();function o(z){let _={};for(let C of z)_[C]=!0;return _}e.toHash=o;function n(z,_){if(typeof _=="boolean")return _;if(Object.keys(_).length===0)return!0;return s(z,_),!i(_,z.self.RULES.all)}e.alwaysValidSchema=n;function s(z,_=z.schema){let{opts:C,self:q}=z;if(!C.strictSchema)return;if(typeof _==="boolean")return;let F=q.RULES.keywords;for(let j in _)if(!F[j])N(z,`unknown keyword: "${j}"`)}e.checkUnknownRules=s;function i(z,_){if(typeof z=="boolean")return!z;for(let C in z)if(_[C])return!0;return!1}e.schemaHasRules=i;function c(z,_){if(typeof z=="boolean")return!z;for(let C in z)if(C!=="$ref"&&_.all[C])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:z,schemaPath:_},C,q,F){if(!F){if(typeof C=="number"||typeof C=="boolean")return C;if(typeof C=="string")return t._`${C}`}return t._`${z}${_}${(0,t.getProperty)(q)}`}e.schemaRefOrVal=a;function u(z){return m(decodeURIComponent(z))}e.unescapeFragment=u;function l(z){return encodeURIComponent(f(z))}e.escapeFragment=l;function f(z){if(typeof z=="number")return`${z}`;return z.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=f;function m(z){return z.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function v(z,_){if(Array.isArray(z))for(let C of z)_(C);else _(z)}e.eachItem=v;function g({mergeNames:z,mergeToName:_,mergeValues:C,resultToName:q}){return(F,j,Z,G)=>{let K=Z===void 0?j:Z instanceof t.Name?(j instanceof t.Name?z(F,j,Z):_(F,j,Z),Z):j instanceof t.Name?(_(F,Z,j),j):C(j,Z);return G===t.Name&&!(K instanceof t.Name)?q(F,K):K}}e.mergeEvaluated={props:g({mergeNames:(z,_,C)=>z.if(t._`${C} !== true && ${_} !== undefined`,()=>{z.if(t._`${_} === true`,()=>z.assign(C,!0),()=>z.assign(C,t._`${C} || {}`).code(t._`Object.assign(${C}, ${_})`))}),mergeToName:(z,_,C)=>z.if(t._`${C} !== true`,()=>{if(_===!0)z.assign(C,!0);else z.assign(C,t._`${C} || {}`),R(z,C,_)}),mergeValues:(z,_)=>z===!0?!0:{...z,..._},resultToName:b}),items:g({mergeNames:(z,_,C)=>z.if(t._`${C} !== true && ${_} !== undefined`,()=>z.assign(C,t._`${_} === true ? true : ${C} > ${_} ? ${C} : ${_}`)),mergeToName:(z,_,C)=>z.if(t._`${C} !== true`,()=>z.assign(C,_===!0?!0:t._`${C} > ${_} ? ${C} : ${_}`)),mergeValues:(z,_)=>z===!0?!0:Math.max(z,_),resultToName:(z,_)=>z.var("items",_)})};function b(z,_){if(_===!0)return z.var("props",!0);let C=z.var("props",t._`{}`);if(_!==void 0)R(z,C,_);return C}e.evaluatedPropsToName=b;function R(z,_,C){Object.keys(C).forEach((q)=>z.assign(t._`${_}${(0,t.getProperty)(q)}`,!0))}e.setEvaluated=R;let p={};function T(z,_){return z.scopeValue("func",{ref:_,code:p[_.code]||(p[_.code]=new r._Code(_.code))})}e.useFunc=T;var w;(function(z){z[z.Num=0]="Num",z[z.Str=1]="Str"})(w||(e.Type=w={}));function E(z,_,C){if(z instanceof t.Name){let q=_===w.Num;return C?q?t._`"[" + ${z} + "]"`:t._`"['" + ${z} + "']"`:q?t._`"/" + ${z}`:t._`"/" + ${z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return C?(0,t.getProperty)(z).toString():"/"+f(z)}e.getErrorPath=E;function N(z,_,C=z.opts.strictSchema){if(!C)return;if(_=`strict mode: ${_}`,C===!0)throw Error(_);z.self.logger.warn(_)}e.checkStrictMode=N}),rt=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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}),Tn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=ue(),r=me(),o=rt();e.keywordError={message:({keyword:R})=>t.str`must pass "${R}" keyword validation`},e.keyword$DataError={message:({keyword:R,schemaType:p})=>p?t.str`"${R}" keyword must be ${p} ($data)`:t.str`"${R}" keyword is invalid ($data)`};function n(R,p=e.keywordError,T,w){let{it:E}=R,{gen:N,compositeRule:z,allErrors:_}=E,C=f(R,p,T);if(w!==null&&w!==void 0?w:z||_)a(N,C);else u(E,t._`[${C}]`)}e.reportError=n;function s(R,p=e.keywordError,T){let{it:w}=R,{gen:E,compositeRule:N,allErrors:z}=w;if(a(E,f(R,p,T)),!(N||z))u(w,o.default.vErrors)}e.reportExtraError=s;function i(R,p){R.assign(o.default.errors,p),R.if(t._`${o.default.vErrors} !== null`,()=>R.if(p,()=>R.assign(t._`${o.default.vErrors}.length`,p),()=>R.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function c({gen:R,keyword:p,schemaValue:T,data:w,errsCount:E,it:N}){if(E===void 0)throw Error("ajv implementation error");let z=R.name("err");R.forRange("i",E,o.default.errors,(_)=>{if(R.const(z,t._`${o.default.vErrors}[${_}]`),R.if(t._`${z}.instancePath === undefined`,()=>R.assign(t._`${z}.instancePath`,(0,t.strConcat)(o.default.instancePath,N.errorPath))),R.assign(t._`${z}.schemaPath`,t.str`${N.errSchemaPath}/${p}`),N.opts.verbose)R.assign(t._`${z}.schema`,T),R.assign(t._`${z}.data`,w)})}e.extendErrors=c;function a(R,p){let T=R.const("err",p);R.if(t._`${o.default.vErrors} === null`,()=>R.assign(o.default.vErrors,t._`[${T}]`),t._`${o.default.vErrors}.push(${T})`),R.code(t._`${o.default.errors}++`)}function u(R,p){let{gen:T,validateName:w,schemaEnv:E}=R;if(E.$async)T.throw(t._`new ${R.ValidationError}(${p})`);else T.assign(t._`${w}.errors`,p),T.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 f(R,p,T){let{createErrors:w}=R.it;if(w===!1)return t._`{}`;return m(R,p,T)}function m(R,p,T={}){let{gen:w,it:E}=R,N=[v(E,T),g(R,T)];return b(R,p,N),w.object(...N)}function v({errorPath:R},{instancePath:p}){let T=p?t.str`${R}${(0,r.getErrorPath)(p,r.Type.Str)}`:R;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,T)]}function g({keyword:R,it:{errSchemaPath:p}},{schemaPath:T,parentSchema:w}){let E=w?p:t.str`${p}/${R}`;if(T)E=t.str`${E}${(0,r.getErrorPath)(T,r.Type.Str)}`;return[l.schemaPath,E]}function b(R,{params:p,message:T},w){let{keyword:E,data:N,schemaValue:z,it:_}=R,{opts:C,propertyName:q,topSchemaRef:F,schemaPath:j}=_;if(w.push([l.keyword,E],[l.params,typeof p=="function"?p(R):p||t._`{}`]),C.messages)w.push([l.message,typeof T=="function"?T(R):T]);if(C.verbose)w.push([l.schema,z],[l.parentSchema,t._`${F}${j}`],[o.default.data,N]);if(q)w.push([l.propertyName,q])}}),l_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Tn(),r=ue(),o=rt(),n={message:"boolean schema is false"};function s(a){let{gen:u,schema:l,validateName:f}=a;if(l===!1)c(a,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${f}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(a,u){let{gen:l,schema:f}=a;if(f===!1)l.var(u,!1),c(a);else l.var(u,!0)}e.boolOrEmptySchema=i;function c(a,u){let{gen:l,data:f}=a,m={gen:l,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(m,n,void 0,u)}}),yf=V((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}),vf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let c=s.RULES.types[i];return c&&c!==!0&&r(n,c)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((i)=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some((c)=>n[c]!==void 0))}e.shouldUseRule=o}),En=V((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=yf(),r=vf(),o=Tn(),n=ue(),s=me();var i;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(w){let E=a(w.type);if(E.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!E.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)E.push("null")}return E}e.getSchemaTypes=c;function a(w){let E=Array.isArray(w)?w:w?[w]:[];if(E.every(t.isJSONType))return E;throw Error("type must be JSONType or JSONType[]: "+E.join(","))}e.getJSONTypes=a;function u(w,E){let{gen:N,data:z,opts:_}=w,C=f(E,_.coerceTypes),q=E.length>0&&!(C.length===0&&E.length===1&&(0,r.schemaHasRulesForType)(w,E[0]));if(q){let F=b(E,z,_.strictNumbers,i.Wrong);N.if(F,()=>{if(C.length)m(w,E,C);else p(w)})}return q}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function f(w,E){return E?w.filter((N)=>l.has(N)||E==="array"&&N==="array"):[]}function m(w,E,N){let{gen:z,data:_,opts:C}=w,q=z.let("dataType",n._`typeof ${_}`),F=z.let("coerced",n._`undefined`);if(C.coerceTypes==="array")z.if(n._`${q} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>z.assign(_,n._`${_}[0]`).assign(q,n._`typeof ${_}`).if(b(E,_,C.strictNumbers),()=>z.assign(F,_)));z.if(n._`${F} !== undefined`);for(let Z of N)if(l.has(Z)||Z==="array"&&C.coerceTypes==="array")j(Z);z.else(),p(w),z.endIf(),z.if(n._`${F} !== undefined`,()=>{z.assign(_,F),v(w,F)});function j(Z){switch(Z){case"string":z.elseIf(n._`${q} == "number" || ${q} == "boolean"`).assign(F,n._`"" + ${_}`).elseIf(n._`${_} === null`).assign(F,n._`""`);return;case"number":z.elseIf(n._`${q} == "boolean" || ${_} === null
|
|
62
|
+
*/var u_=V((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw TypeError("argument string is required");var a=typeof c==="object"?s(c):c;if(typeof a!=="string")throw TypeError("argument string is required to be a string");var u=a.indexOf(";"),l=u!==-1?a.slice(0,u).trim():a.trim();if(!o.test(l))throw TypeError("invalid media type");var f=new i(l.toLowerCase());if(u!==-1){var m,v,g;t.lastIndex=u;while(v=t.exec(a)){if(v.index!==u)throw TypeError("invalid parameter format");if(u+=v[0].length,m=v[1].toLowerCase(),g=v[2],g.charCodeAt(0)===34){if(g=g.slice(1,-1),g.indexOf("\\")!==-1)g=g.replace(r,"$1")}f.parameters[m]=g}if(u!==a.length)throw TypeError("invalid parameter format")}return f}function s(c){var a;if(typeof c.getHeader==="function")a=c.getHeader("content-type");else if(typeof c.headers==="object")a=c.headers&&c.headers["content-type"];if(typeof a!=="string")throw TypeError("content-type header is missing from object");return a}function i(c){this.parameters=Object.create(null),this.type=c}}),a0=Oo(u_(),1);var Pn=V((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(p){super();if(!e.IDENTIFIER.test(p))throw Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(p){super();this._items=typeof p==="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((T,w)=>`${T}${w}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((T,w)=>{if(w instanceof r)T[w.str]=(T[w.str]||0)+1;return T},{})}};e._Code=o,e.nil=new o("");function n(p,...T){let w=[p[0]],E=0;while(E<T.length)c(w,T[E]),w.push(p[++E]);return new o(w)}e._=n;let s=new o("+");function i(p,...T){let w=[v(p[0])],E=0;while(E<T.length)w.push(s),c(w,T[E]),w.push(s,v(p[++E]));return a(w),new o(w)}e.str=i;function c(p,T){if(T instanceof o)p.push(...T._items);else if(T instanceof r)p.push(T);else p.push(f(T))}e.addCodeArg=c;function a(p){let T=1;while(T<p.length-1){if(p[T]===s){let w=u(p[T-1],p[T+1]);if(w!==void 0){p.splice(T-1,3,w);continue}p[T++]="+"}T++}}function u(p,T){if(T==='""')return p;if(p==='""')return T;if(typeof p=="string"){if(T instanceof r||p[p.length-1]!=='"')return;if(typeof T!="string")return`${p.slice(0,-1)}${T}"`;if(T[0]==='"')return p.slice(0,-1)+T.slice(1);return}if(typeof T=="string"&&T[0]==='"'&&!(p instanceof r))return`"${p}${T.slice(1)}`}function l(p,T){return T.emptyStr()?p:p.emptyStr()?T:i`${p}${T}`}e.strConcat=l;function f(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:v(Array.isArray(p)?p.join(","):p)}function m(p){return new o(v(p))}e.stringify=m;function v(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function g(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new o(`.${p}`):n`[${p}]`}e.getProperty=g;function b(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new o(`${p}`);throw Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=b;function R(p){return new o(p.toString())}e.regexpCode=R}),gf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Pn();var r=class extends Error{constructor(a){super(`CodeGen: "code" for ${a} not defined`);this.value=a.value}},o;(function(a){a[a.Started=0]="Started",a[a.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:a,parent:u}={}){this._names={},this._prefixes=a,this._parent=u}toName(a){return a instanceof t.Name?a:this.name(a)}name(a){return new t.Name(this._newName(a))}_newName(a){let u=this._names[a]||this._nameGroup(a);return`${a}${u.index++}`}_nameGroup(a){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(a))||this._prefixes&&!this._prefixes.has(a))throw Error(`CodeGen: prefix "${a}" is not allowed in this scope`);return this._names[a]={prefix:a,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(a,u){super(u);this.prefix=a}setValue(a,{property:u,itemIndex:l}){this.value=a,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var c=class extends n{constructor(a){super(a);this._values={},this._scope=a.scope,this.opts={...a,_n:a.lines?i:t.nil}}get(){return this._scope}name(a){return new s(a,this._newName(a))}value(a,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let f=this.toName(a),{prefix:m}=f,v=(l=u.key)!==null&&l!==void 0?l:u.ref,g=this._values[m];if(g){let p=g.get(v);if(p)return p}else g=this._values[m]=new Map;g.set(v,f);let b=this._scope[m]||(this._scope[m]=[]),R=b.length;return b[R]=u.ref,f.setValue(u,{property:m,itemIndex:R}),f}getValue(a,u){let l=this._values[a];if(!l)return;return l.get(u)}scopeRefs(a,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${a}${l.scopePath}`})}scopeCode(a=this._values,u,l){return this._reduceValues(a,(f)=>{if(f.value===void 0)throw Error(`CodeGen: name "${f}" has no value`);return f.value.code},u,l)}_reduceValues(a,u,l={},f){let m=t.nil;for(let v in a){let g=a[v];if(!g)continue;let b=l[v]=l[v]||new Map;g.forEach((R)=>{if(b.has(R))return;b.set(R,o.Started);let p=u(R);if(p){let T=this.opts.es5?e.varKinds.var:e.varKinds.const;m=t._`${m}${T} ${R} = ${p};${this.opts._n}`}else if(p=f===null||f===void 0?void 0:f(R))m=t._`${m}${p}${this.opts._n}`;else throw new r(R);b.set(R,o.Completed)})}return m}};e.ValueScope=c}),ue=V((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=Pn(),r=gf();var o=Pn();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=gf();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(d,h){return this}},i=class extends s{constructor(d,h,S){super();this.varKind=d,this.name=h,this.rhs=S}render({es5:d,_n:h}){let S=d?r.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${S} ${this.name}${I};`+h}optimizeNames(d,h){if(!d[this.name.str])return;if(this.rhs)this.rhs=K(this.rhs,d,h);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor(d,h,S){super();this.lhs=d,this.rhs=h,this.sideEffects=S}render({_n:d}){return`${this.lhs} = ${this.rhs};`+d}optimizeNames(d,h){if(this.lhs instanceof t.Name&&!d[this.lhs.str]&&!this.sideEffects)return;return this.rhs=K(this.rhs,d,h),this}get names(){return G(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor(d,h,S,I){super(d,S,I);this.op=h}render({_n:d}){return`${this.lhs} ${this.op}= ${this.rhs};`+d}},u=class extends s{constructor(d){super();this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}},l=class extends s{constructor(d){super();this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}},f=class extends s{constructor(d){super();this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}},m=class extends s{constructor(d){super();this.code=d}render({_n:d}){return`${this.code};`+d}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(d,h){return this.code=K(this.code,d,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},v=class extends s{constructor(d=[]){super();this.nodes=d}render(d){return this.nodes.reduce((h,S)=>h+S.render(d),"")}optimizeNodes(){let{nodes:d}=this,h=d.length;while(h--){let S=d[h].optimizeNodes();if(Array.isArray(S))d.splice(h,1,...S);else if(S)d[h]=S;else d.splice(h,1)}return d.length>0?this:void 0}optimizeNames(d,h){let{nodes:S}=this,I=S.length;while(I--){let D=S[I];if(D.optimizeNames(d,h))continue;ie(d,D.names),S.splice(I,1)}return S.length>0?this:void 0}get names(){return this.nodes.reduce((d,h)=>Z(d,h.names),{})}},g=class extends v{render(d){return"{"+d._n+super.render(d)+"}"+d._n}},b=class extends v{},R=class extends g{};R.kind="else";var p=class d extends g{constructor(h,S){super(S);this.condition=h}render(h){let S=`if(${this.condition})`+super.render(h);if(this.else)S+="else "+this.else.render(h);return S}optimizeNodes(){super.optimizeNodes();let h=this.condition;if(h===!0)return this.nodes;let S=this.else;if(S){let I=S.optimizeNodes();S=this.else=Array.isArray(I)?new R(I):I}if(S){if(h===!1)return S instanceof d?S:S.nodes;if(this.nodes.length)return this;return new d(Se(h),S instanceof d?[S]:S.nodes)}if(h===!1||!this.nodes.length)return;return this}optimizeNames(h,S){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(h,S),!(super.optimizeNames(h,S)||this.else))return;return this.condition=K(this.condition,h,S),this}get names(){let h=super.names;if(G(h,this.condition),this.else)Z(h,this.else.names);return h}};p.kind="if";var T=class extends g{};T.kind="for";var w=class extends T{constructor(d){super();this.iteration=d}render(d){return`for(${this.iteration})`+super.render(d)}optimizeNames(d,h){if(!super.optimizeNames(d,h))return;return this.iteration=K(this.iteration,d,h),this}get names(){return Z(super.names,this.iteration.names)}},E=class extends T{constructor(d,h,S,I){super();this.varKind=d,this.name=h,this.from=S,this.to=I}render(d){let h=d.es5?r.varKinds.var:this.varKind,{name:S,from:I,to:D}=this;return`for(${h} ${S}=${I}; ${S}<${D}; ${S}++)`+super.render(d)}get names(){return G(G(super.names,this.from),this.to)}},N=class extends T{constructor(d,h,S,I){super();this.loop=d,this.varKind=h,this.name=S,this.iterable=I}render(d){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(d)}optimizeNames(d,h){if(!super.optimizeNames(d,h))return;return this.iterable=K(this.iterable,d,h),this}get names(){return Z(super.names,this.iterable.names)}},z=class extends g{constructor(d,h,S){super();this.name=d,this.args=h,this.async=S}render(d){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(d)}};z.kind="func";var _=class extends v{render(d){return"return "+super.render(d)}};_.kind="return";var C=class extends g{render(d){let h="try"+super.render(d);if(this.catch)h+=this.catch.render(d);if(this.finally)h+=this.finally.render(d);return h}optimizeNodes(){var d,h;return super.optimizeNodes(),(d=this.catch)===null||d===void 0||d.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(d,h){var S,I;return super.optimizeNames(d,h),(S=this.catch)===null||S===void 0||S.optimizeNames(d,h),(I=this.finally)===null||I===void 0||I.optimizeNames(d,h),this}get names(){let d=super.names;if(this.catch)Z(d,this.catch.names);if(this.finally)Z(d,this.finally.names);return d}},q=class extends g{constructor(d){super();this.error=d}render(d){return`catch(${this.error})`+super.render(d)}};q.kind="catch";var F=class extends g{render(d){return"finally"+super.render(d)}};F.kind="finally";var j=class{constructor(d,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
|
|
63
|
+
`:""},this._extScope=d,this._scope=new r.Scope({parent:d}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(d){return this._scope.name(d)}scopeName(d){return this._extScope.name(d)}scopeValue(d,h){let S=this._extScope.value(d,h);return(this._values[S.prefix]||(this._values[S.prefix]=new Set)).add(S),S}getScopeValue(d,h){return this._extScope.getValue(d,h)}scopeRefs(d){return this._extScope.scopeRefs(d,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(d,h,S,I){let D=this._scope.toName(h);if(S!==void 0&&I)this._constants[D.str]=S;return this._leafNode(new i(d,D,S)),D}const(d,h,S){return this._def(r.varKinds.const,d,h,S)}let(d,h,S){return this._def(r.varKinds.let,d,h,S)}var(d,h,S){return this._def(r.varKinds.var,d,h,S)}assign(d,h,S){return this._leafNode(new c(d,h,S))}add(d,h){return this._leafNode(new a(d,e.operators.ADD,h))}code(d){if(typeof d=="function")d();else if(d!==t.nil)this._leafNode(new m(d));return this}object(...d){let h=["{"];for(let[S,I]of d){if(h.length>1)h.push(",");if(h.push(S),S!==I||this.opts.es5)h.push(":"),(0,t.addCodeArg)(h,I)}return h.push("}"),new t._Code(h)}if(d,h,S){if(this._blockNode(new p(d)),h&&S)this.code(h).else().code(S).endIf();else if(h)this.code(h).endIf();else if(S)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(d){return this._elseNode(new p(d))}else(){return this._elseNode(new R)}endIf(){return this._endBlockNode(p,R)}_for(d,h){if(this._blockNode(d),h)this.code(h).endFor();return this}for(d,h){return this._for(new w(d),h)}forRange(d,h,S,I,D=this.opts.es5?r.varKinds.var:r.varKinds.let){let B=this._scope.toName(d);return this._for(new E(D,B,h,S),()=>I(B))}forOf(d,h,S,I=r.varKinds.const){let D=this._scope.toName(d);if(this.opts.es5){let B=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,t._`${B}.length`,(J)=>{this.var(D,t._`${B}[${J}]`),S(D)})}return this._for(new N("of",I,D,h),()=>S(D))}forIn(d,h,S,I=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(d,t._`Object.keys(${h})`,S);let D=this._scope.toName(d);return this._for(new N("in",I,D,h),()=>S(D))}endFor(){return this._endBlockNode(T)}label(d){return this._leafNode(new u(d))}break(d){return this._leafNode(new l(d))}return(d){let h=new _;if(this._blockNode(h),this.code(d),h.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(_)}try(d,h,S){if(!h&&!S)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new C;if(this._blockNode(I),this.code(d),h){let D=this.name("e");this._currNode=I.catch=new q(D),h(D)}if(S)this._currNode=I.finally=new F,this.code(S);return this._endBlockNode(q,F)}throw(d){return this._leafNode(new f(d))}block(d,h){if(this._blockStarts.push(this._nodes.length),d)this.code(d).endBlock(h);return this}endBlock(d){let h=this._blockStarts.pop();if(h===void 0)throw Error("CodeGen: not in self-balancing block");let S=this._nodes.length-h;if(S<0||d!==void 0&&S!==d)throw Error(`CodeGen: wrong number of nodes: ${S} vs ${d} expected`);return this._nodes.length=h,this}func(d,h=t.nil,S,I){if(this._blockNode(new z(d,h,S)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(z)}optimize(d=1){while(d-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(d){return this._currNode.nodes.push(d),this}_blockNode(d){this._currNode.nodes.push(d),this._nodes.push(d)}_endBlockNode(d,h){let S=this._currNode;if(S instanceof d||h&&S instanceof h)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${h?`${d.kind}/${h.kind}`:d.kind}"`)}_elseNode(d){let h=this._currNode;if(!(h instanceof p))throw Error('CodeGen: "else" without "if"');return this._currNode=h.else=d,this}get _root(){return this._nodes[0]}get _currNode(){let d=this._nodes;return d[d.length-1]}set _currNode(d){let h=this._nodes;h[h.length-1]=d}};e.CodeGen=j;function Z(d,h){for(let S in h)d[S]=(d[S]||0)+(h[S]||0);return d}function G(d,h){return h instanceof t._CodeOrName?Z(d,h.names):d}function K(d,h,S){if(d instanceof t.Name)return I(d);if(!D(d))return d;return new t._Code(d._items.reduce((B,J)=>{if(J instanceof t.Name)J=I(J);if(J instanceof t._Code)B.push(...J._items);else B.push(J);return B},[]));function I(B){let J=S[B.str];if(J===void 0||h[B.str]!==1)return B;return delete h[B.str],J}function D(B){return B instanceof t._Code&&B._items.some((J)=>J instanceof t.Name&&h[J.str]===1&&S[J.str]!==void 0)}}function ie(d,h){for(let S in h)d[S]=(d[S]||0)-(h[S]||0)}function Se(d){return typeof d=="boolean"||typeof d=="number"||d===null?!d:t._`!${y(d)}`}e.not=Se;let ve=x(e.operators.AND);function Pe(...d){return d.reduce(ve)}e.and=Pe;let le=x(e.operators.OR);function O(...d){return d.reduce(le)}e.or=O;function x(d){return(h,S)=>h===t.nil?S:S===t.nil?h:t._`${y(h)} ${d} ${y(S)}`}function y(d){return d instanceof t.Name?d:t._`(${d})`}}),me=V((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=ue(),r=Pn();function o(z){let _={};for(let C of z)_[C]=!0;return _}e.toHash=o;function n(z,_){if(typeof _=="boolean")return _;if(Object.keys(_).length===0)return!0;return s(z,_),!i(_,z.self.RULES.all)}e.alwaysValidSchema=n;function s(z,_=z.schema){let{opts:C,self:q}=z;if(!C.strictSchema)return;if(typeof _==="boolean")return;let F=q.RULES.keywords;for(let j in _)if(!F[j])N(z,`unknown keyword: "${j}"`)}e.checkUnknownRules=s;function i(z,_){if(typeof z=="boolean")return!z;for(let C in z)if(_[C])return!0;return!1}e.schemaHasRules=i;function c(z,_){if(typeof z=="boolean")return!z;for(let C in z)if(C!=="$ref"&&_.all[C])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:z,schemaPath:_},C,q,F){if(!F){if(typeof C=="number"||typeof C=="boolean")return C;if(typeof C=="string")return t._`${C}`}return t._`${z}${_}${(0,t.getProperty)(q)}`}e.schemaRefOrVal=a;function u(z){return m(decodeURIComponent(z))}e.unescapeFragment=u;function l(z){return encodeURIComponent(f(z))}e.escapeFragment=l;function f(z){if(typeof z=="number")return`${z}`;return z.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=f;function m(z){return z.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function v(z,_){if(Array.isArray(z))for(let C of z)_(C);else _(z)}e.eachItem=v;function g({mergeNames:z,mergeToName:_,mergeValues:C,resultToName:q}){return(F,j,Z,G)=>{let K=Z===void 0?j:Z instanceof t.Name?(j instanceof t.Name?z(F,j,Z):_(F,j,Z),Z):j instanceof t.Name?(_(F,Z,j),j):C(j,Z);return G===t.Name&&!(K instanceof t.Name)?q(F,K):K}}e.mergeEvaluated={props:g({mergeNames:(z,_,C)=>z.if(t._`${C} !== true && ${_} !== undefined`,()=>{z.if(t._`${_} === true`,()=>z.assign(C,!0),()=>z.assign(C,t._`${C} || {}`).code(t._`Object.assign(${C}, ${_})`))}),mergeToName:(z,_,C)=>z.if(t._`${C} !== true`,()=>{if(_===!0)z.assign(C,!0);else z.assign(C,t._`${C} || {}`),R(z,C,_)}),mergeValues:(z,_)=>z===!0?!0:{...z,..._},resultToName:b}),items:g({mergeNames:(z,_,C)=>z.if(t._`${C} !== true && ${_} !== undefined`,()=>z.assign(C,t._`${_} === true ? true : ${C} > ${_} ? ${C} : ${_}`)),mergeToName:(z,_,C)=>z.if(t._`${C} !== true`,()=>z.assign(C,_===!0?!0:t._`${C} > ${_} ? ${C} : ${_}`)),mergeValues:(z,_)=>z===!0?!0:Math.max(z,_),resultToName:(z,_)=>z.var("items",_)})};function b(z,_){if(_===!0)return z.var("props",!0);let C=z.var("props",t._`{}`);if(_!==void 0)R(z,C,_);return C}e.evaluatedPropsToName=b;function R(z,_,C){Object.keys(C).forEach((q)=>z.assign(t._`${_}${(0,t.getProperty)(q)}`,!0))}e.setEvaluated=R;let p={};function T(z,_){return z.scopeValue("func",{ref:_,code:p[_.code]||(p[_.code]=new r._Code(_.code))})}e.useFunc=T;var w;(function(z){z[z.Num=0]="Num",z[z.Str=1]="Str"})(w||(e.Type=w={}));function E(z,_,C){if(z instanceof t.Name){let q=_===w.Num;return C?q?t._`"[" + ${z} + "]"`:t._`"['" + ${z} + "']"`:q?t._`"/" + ${z}`:t._`"/" + ${z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return C?(0,t.getProperty)(z).toString():"/"+f(z)}e.getErrorPath=E;function N(z,_,C=z.opts.strictSchema){if(!C)return;if(_=`strict mode: ${_}`,C===!0)throw Error(_);z.self.logger.warn(_)}e.checkStrictMode=N}),rt=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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}),Tn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=ue(),r=me(),o=rt();e.keywordError={message:({keyword:R})=>t.str`must pass "${R}" keyword validation`},e.keyword$DataError={message:({keyword:R,schemaType:p})=>p?t.str`"${R}" keyword must be ${p} ($data)`:t.str`"${R}" keyword is invalid ($data)`};function n(R,p=e.keywordError,T,w){let{it:E}=R,{gen:N,compositeRule:z,allErrors:_}=E,C=f(R,p,T);if(w!==null&&w!==void 0?w:z||_)a(N,C);else u(E,t._`[${C}]`)}e.reportError=n;function s(R,p=e.keywordError,T){let{it:w}=R,{gen:E,compositeRule:N,allErrors:z}=w;if(a(E,f(R,p,T)),!(N||z))u(w,o.default.vErrors)}e.reportExtraError=s;function i(R,p){R.assign(o.default.errors,p),R.if(t._`${o.default.vErrors} !== null`,()=>R.if(p,()=>R.assign(t._`${o.default.vErrors}.length`,p),()=>R.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function c({gen:R,keyword:p,schemaValue:T,data:w,errsCount:E,it:N}){if(E===void 0)throw Error("ajv implementation error");let z=R.name("err");R.forRange("i",E,o.default.errors,(_)=>{if(R.const(z,t._`${o.default.vErrors}[${_}]`),R.if(t._`${z}.instancePath === undefined`,()=>R.assign(t._`${z}.instancePath`,(0,t.strConcat)(o.default.instancePath,N.errorPath))),R.assign(t._`${z}.schemaPath`,t.str`${N.errSchemaPath}/${p}`),N.opts.verbose)R.assign(t._`${z}.schema`,T),R.assign(t._`${z}.data`,w)})}e.extendErrors=c;function a(R,p){let T=R.const("err",p);R.if(t._`${o.default.vErrors} === null`,()=>R.assign(o.default.vErrors,t._`[${T}]`),t._`${o.default.vErrors}.push(${T})`),R.code(t._`${o.default.errors}++`)}function u(R,p){let{gen:T,validateName:w,schemaEnv:E}=R;if(E.$async)T.throw(t._`new ${R.ValidationError}(${p})`);else T.assign(t._`${w}.errors`,p),T.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 f(R,p,T){let{createErrors:w}=R.it;if(w===!1)return t._`{}`;return m(R,p,T)}function m(R,p,T={}){let{gen:w,it:E}=R,N=[v(E,T),g(R,T)];return b(R,p,N),w.object(...N)}function v({errorPath:R},{instancePath:p}){let T=p?t.str`${R}${(0,r.getErrorPath)(p,r.Type.Str)}`:R;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,T)]}function g({keyword:R,it:{errSchemaPath:p}},{schemaPath:T,parentSchema:w}){let E=w?p:t.str`${p}/${R}`;if(T)E=t.str`${E}${(0,r.getErrorPath)(T,r.Type.Str)}`;return[l.schemaPath,E]}function b(R,{params:p,message:T},w){let{keyword:E,data:N,schemaValue:z,it:_}=R,{opts:C,propertyName:q,topSchemaRef:F,schemaPath:j}=_;if(w.push([l.keyword,E],[l.params,typeof p=="function"?p(R):p||t._`{}`]),C.messages)w.push([l.message,typeof T=="function"?T(R):T]);if(C.verbose)w.push([l.schema,z],[l.parentSchema,t._`${F}${j}`],[o.default.data,N]);if(q)w.push([l.propertyName,q])}}),l_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Tn(),r=ue(),o=rt(),n={message:"boolean schema is false"};function s(a){let{gen:u,schema:l,validateName:f}=a;if(l===!1)c(a,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${f}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(a,u){let{gen:l,schema:f}=a;if(f===!1)l.var(u,!1),c(a);else l.var(u,!0)}e.boolOrEmptySchema=i;function c(a,u){let{gen:l,data:f}=a,m={gen:l,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(m,n,void 0,u)}}),_f=V((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}),yf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let c=s.RULES.types[i];return c&&c!==!0&&r(n,c)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((i)=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some((c)=>n[c]!==void 0))}e.shouldUseRule=o}),En=V((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=_f(),r=yf(),o=Tn(),n=ue(),s=me();var i;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(w){let E=a(w.type);if(E.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!E.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)E.push("null")}return E}e.getSchemaTypes=c;function a(w){let E=Array.isArray(w)?w:w?[w]:[];if(E.every(t.isJSONType))return E;throw Error("type must be JSONType or JSONType[]: "+E.join(","))}e.getJSONTypes=a;function u(w,E){let{gen:N,data:z,opts:_}=w,C=f(E,_.coerceTypes),q=E.length>0&&!(C.length===0&&E.length===1&&(0,r.schemaHasRulesForType)(w,E[0]));if(q){let F=b(E,z,_.strictNumbers,i.Wrong);N.if(F,()=>{if(C.length)m(w,E,C);else p(w)})}return q}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function f(w,E){return E?w.filter((N)=>l.has(N)||E==="array"&&N==="array"):[]}function m(w,E,N){let{gen:z,data:_,opts:C}=w,q=z.let("dataType",n._`typeof ${_}`),F=z.let("coerced",n._`undefined`);if(C.coerceTypes==="array")z.if(n._`${q} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>z.assign(_,n._`${_}[0]`).assign(q,n._`typeof ${_}`).if(b(E,_,C.strictNumbers),()=>z.assign(F,_)));z.if(n._`${F} !== undefined`);for(let Z of N)if(l.has(Z)||Z==="array"&&C.coerceTypes==="array")j(Z);z.else(),p(w),z.endIf(),z.if(n._`${F} !== undefined`,()=>{z.assign(_,F),v(w,F)});function j(Z){switch(Z){case"string":z.elseIf(n._`${q} == "number" || ${q} == "boolean"`).assign(F,n._`"" + ${_}`).elseIf(n._`${_} === null`).assign(F,n._`""`);return;case"number":z.elseIf(n._`${q} == "boolean" || ${_} === null
|
|
64
64
|
|| (${q} == "string" && ${_} && ${_} == +${_})`).assign(F,n._`+${_}`);return;case"integer":z.elseIf(n._`${q} === "boolean" || ${_} === null
|
|
65
65
|
|| (${q} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(F,n._`+${_}`);return;case"boolean":z.elseIf(n._`${_} === "false" || ${_} === 0 || ${_} === null`).assign(F,!1).elseIf(n._`${_} === "true" || ${_} === 1`).assign(F,!0);return;case"null":z.elseIf(n._`${_} === "" || ${_} === 0 || ${_} === false`),z.assign(F,null);return;case"array":z.elseIf(n._`${q} === "string" || ${q} === "number"
|
|
66
|
-
|| ${q} === "boolean" || ${_} === null`).assign(F,n._`[${_}]`)}}}function v({gen:w,parentData:E,parentDataProperty:N},z){w.if(n._`${E} !== undefined`,()=>w.assign(n._`${E}[${N}]`,z))}function g(w,E,N,z=i.Correct){let _=z===i.Correct?n.operators.EQ:n.operators.NEQ,C;switch(w){case"null":return n._`${E} ${_} null`;case"array":C=n._`Array.isArray(${E})`;break;case"object":C=n._`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":C=q(n._`!(${E} % 1) && !isNaN(${E})`);break;case"number":C=q();break;default:return n._`typeof ${E} ${_} ${w}`}return z===i.Correct?C:(0,n.not)(C);function q(F=n.nil){return(0,n.and)(n._`typeof ${E} == "number"`,F,N?n._`isFinite(${E})`:n.nil)}}e.checkDataType=g;function b(w,E,N,z){if(w.length===1)return g(w[0],E,N,z);let _,C=(0,s.toHash)(w);if(C.array&&C.object){let q=n._`typeof ${E} != "object"`;_=C.null?q:n._`!${E} || ${q}`,delete C.null,delete C.array,delete C.object}else _=n.nil;if(C.number)delete C.integer;for(let q in C)_=(0,n.and)(_,g(q,E,N,z));return _}e.checkDataTypes=b;let R={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:E})=>typeof w=="string"?n._`{type: ${w}}`:n._`{type: ${E}}`};function p(w){let E=T(w);(0,o.reportError)(E,R)}e.reportTypeError=p;function T(w){let{gen:E,data:N,schema:z}=w,_=(0,s.schemaRefOrVal)(w,z,"type");return{gen:E,keyword:"type",data:N,schema:z.type,schemaCode:_,schemaValue:_,parentSchema:z,params:{},it:w}}}),d_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=ue(),r=me();function o(s,i){let{properties:c,items:a}=s.schema;if(i==="object"&&c)for(let u in c)n(s,u,c[u].default);else if(i==="array"&&Array.isArray(a))a.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,c){let{gen:a,compositeRule:u,data:l,opts:f}=s;if(c===void 0)return;let m=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let v=t._`${m} === undefined`;if(f.useDefaults==="empty")v=t._`${v} || ${m} === null || ${m} === ""`;a.if(v,t._`${m} = ${(0,t.stringify)(c)}`)}}),ot=V((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=ue(),r=me(),o=rt(),n=me();function s(w,E){let{gen:N,data:z,it:_}=w;N.if(f(N,z,E,_.opts.ownProperties),()=>{w.setParams({missingProperty:t._`${E}`},!0),w.error()})}e.checkReportMissingProp=s;function i({gen:w,data:E,it:{opts:N}},z,_){return(0,t.or)(...z.map((C)=>(0,t.and)(f(w,E,C,N.ownProperties),t._`${_} = ${C}`)))}e.checkMissingProp=i;function c(w,E){w.setParams({missingProperty:E},!0),w.error()}e.reportMissingProp=c;function a(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(w,E,N){return t._`${a(w)}.call(${E}, ${N})`}e.isOwnProperty=u;function l(w,E,N,z){let _=t._`${E}${(0,t.getProperty)(N)} !== undefined`;return z?t._`${_} && ${u(w,E,N)}`:_}e.propertyInData=l;function f(w,E,N,z){let _=t._`${E}${(0,t.getProperty)(N)} === undefined`;return z?(0,t.or)(_,(0,t.not)(u(w,E,N))):_}e.noPropertyInData=f;function m(w){return w?Object.keys(w).filter((E)=>E!=="__proto__"):[]}e.allSchemaProperties=m;function v(w,E){return m(E).filter((N)=>!(0,r.alwaysValidSchema)(w,E[N]))}e.schemaProperties=v;function g({schemaCode:w,data:E,it:{gen:N,topSchemaRef:z,schemaPath:_,errorPath:C},it:q},F,j,Z){let G=Z?t._`${w}, ${E}, ${z}${_}`:E,K=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,C)],[o.default.parentData,q.parentData],[o.default.parentDataProperty,q.parentDataProperty],[o.default.rootData,o.default.rootData]];if(q.opts.dynamicRef)K.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ie=t._`${G}, ${N.object(...K)}`;return j!==t.nil?t._`${F}.call(${j}, ${ie})`:t._`${F}(${ie})`}e.callValidateCode=g;let b=t._`new RegExp`;function R({gen:w,it:{opts:E}},N){let z=E.unicodeRegExp?"u":"",{regExp:_}=E.code,C=_(N,z);return w.scopeValue("pattern",{key:C.toString(),ref:C,code:t._`${_.code==="new RegExp"?b:(0,n.useFunc)(w,_)}(${N}, ${z})`})}e.usePattern=R;function p(w){let{gen:E,data:N,keyword:z,it:_}=w,C=E.name("valid");if(_.allErrors){let F=E.let("valid",!0);return q(()=>E.assign(F,!1)),F}return E.var(C,!0),q(()=>E.break()),C;function q(F){let j=E.const("len",t._`${N}.length`);E.forRange("i",0,j,(Z)=>{w.subschema({keyword:z,dataProp:Z,dataPropType:r.Type.Num},C),E.if((0,t.not)(C),F)})}}e.validateArray=p;function T(w){let{gen:E,schema:N,keyword:z,it:_}=w;if(!Array.isArray(N))throw Error("ajv implementation error");if(N.some((F)=>(0,r.alwaysValidSchema)(_,F))&&!_.opts.unevaluated)return;let C=E.let("valid",!1),q=E.name("_valid");E.block(()=>N.forEach((F,j)=>{let Z=w.subschema({keyword:z,schemaProp:j,compositeRule:!0},q);if(E.assign(C,t._`${C} || ${q}`),!w.mergeValidEvaluated(Z,q))E.if((0,t.not)(C))})),w.result(C,()=>w.reset(),()=>w.error(!0))}e.validateUnion=T}),f_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=ue(),r=rt(),o=ot(),n=Tn();function s(v,g){let{gen:b,keyword:R,schema:p,parentSchema:T,it:w}=v,E=g.macro.call(w.self,p,T,w),N=l(b,R,E);if(w.opts.validateSchema!==!1)w.self.validateSchema(E,!0);let z=b.name("valid");v.subschema({schema:E,schemaPath:t.nil,errSchemaPath:`${w.errSchemaPath}/${R}`,topSchemaRef:N,compositeRule:!0},z),v.pass(z,()=>v.error(!0))}e.macroKeywordCode=s;function i(v,g){var b;let{gen:R,keyword:p,schema:T,parentSchema:w,$data:E,it:N}=v;u(N,g);let z=l(R,p,!E&&g.compile?g.compile.call(N.self,T,w,N):g.validate),_=R.let("valid");v.block$data(_,C),v.ok((b=g.valid)!==null&&b!==void 0?b:_);function C(){if(g.errors===!1){if(j(),g.modifying)c(v);Z(()=>v.error())}else{let G=g.async?q():F();if(g.modifying)c(v);Z(()=>a(v,G))}}function q(){let G=R.let("ruleErrs",null);return R.try(()=>j(t._`await `),(K)=>R.assign(_,!1).if(t._`${K} instanceof ${N.ValidationError}`,()=>R.assign(G,t._`${K}.errors`),()=>R.throw(K))),G}function F(){let G=t._`${z}.errors`;return R.assign(G,null),j(t.nil),G}function j(G=g.async?t._`await `:t.nil){let K=N.opts.passContext?r.default.this:r.default.self,ie=!(("compile"in g)&&!E||g.schema===!1);R.assign(_,t._`${G}${(0,o.callValidateCode)(v,z,K,ie)}`,g.modifying)}function Z(G){var K;R.if((0,t.not)((K=g.valid)!==null&&K!==void 0?K:_),G)}}e.funcKeywordCode=i;function c(v){let{gen:g,data:b,it:R}=v;g.if(R.parentData,()=>g.assign(b,t._`${R.parentData}[${R.parentDataProperty}]`))}function a(v,g){let{gen:b}=v;b.if(t._`Array.isArray(${g})`,()=>{b.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${g} : ${r.default.vErrors}.concat(${g})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(v)},()=>v.error())}function u({schemaEnv:v},g){if(g.async&&!v.$async)throw Error("async keyword in sync schema")}function l(v,g,b){if(b===void 0)throw Error(`keyword "${g}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function f(v,g,b=!1){return!g.length||g.some((R)=>R==="array"?Array.isArray(v):R==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==R||b&&typeof v>"u")}e.validSchemaType=f;function m({schema:v,opts:g,self:b,errSchemaPath:R},p,T){if(Array.isArray(p.keyword)?!p.keyword.includes(T):p.keyword!==T)throw Error("ajv implementation error");let w=p.dependencies;if(w===null||w===void 0?void 0:w.some((E)=>!Object.prototype.hasOwnProperty.call(v,E)))throw Error(`parent schema must have dependencies of ${T}: ${w.join(",")}`);if(p.validateSchema){if(!p.validateSchema(v[T])){let E=`keyword "${T}" value is invalid at path "${R}": `+b.errorsText(p.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(E);else throw Error(E)}}}e.validateKeywordUsage=m}),h_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=ue(),r=me();function o(i,{keyword:c,schemaProp:a,schema:u,schemaPath:l,errSchemaPath:f,topSchemaRef:m}){if(c!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){let v=i.schema[c];return a===void 0?{schema:v,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${c}`}:{schema:v[a],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(c)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${c}/${(0,r.escapeFragment)(a)}`}}if(u!==void 0){if(l===void 0||f===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:m,errSchemaPath:f}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,c,{dataProp:a,dataPropType:u,data:l,dataTypes:f,propertyName:m}){if(l!==void 0&&a!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:v}=c;if(a!==void 0){let{errorPath:b,dataPathArr:R,opts:p}=c;g(v.let("data",t._`${c.data}${(0,t.getProperty)(a)}`,!0)),i.errorPath=t.str`${b}${(0,r.getErrorPath)(a,u,p.jsPropertySyntax)}`,i.parentDataProperty=t._`${a}`,i.dataPathArr=[...R,i.parentDataProperty]}if(l!==void 0){if(g(l instanceof t.Name?l:v.let("data",l,!0)),m!==void 0)i.propertyName=m}if(f)i.dataTypes=f;function g(b){i.data=b,i.dataLevel=c.dataLevel+1,i.dataTypes=[],c.definedProperties=new Set,i.parentData=c.data,i.dataNames=[...c.dataNames,b]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:c,jtdMetadata:a,compositeRule:u,createErrors:l,allErrors:f}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(f!==void 0)i.allErrors=f;i.jtdDiscriminator=c,i.jtdMetadata=a}e.extendSubschemaMode=s}),Sf=V((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,c;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(c=Object.keys(o),s=c.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[i]))return!1;for(i=s;i--!==0;){var a=c[i];if(!r(o[a],n[a]))return!1}return!0}return o!==o&&n!==n}}),p_=V((e,t)=>{var r=t.exports=function(s,i,c){if(typeof i=="function")c=i,i={};c=i.cb||c;var a=typeof c=="function"?c:c.pre||function(){},u=c.post||function(){};o(i,a,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,c,a,u,l,f,m,v,g){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,u,l,f,m,v,g);for(var b in a){var R=a[b];if(Array.isArray(R)){if(b in r.arrayKeywords)for(var p=0;p<R.length;p++)o(s,i,c,R[p],u+"/"+b+"/"+p,l,u,b,a,p)}else if(b in r.propsKeywords){if(R&&typeof R=="object")for(var T in R)o(s,i,c,R[T],u+"/"+b+"/"+n(T),l,u,b,a,T)}else if(b in r.keywords||s.allKeys&&!(b in r.skipKeywords))o(s,i,c,R,u+"/"+b,l,u,b,a)}c(a,u,l,f,m,v,g)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),kn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=me(),r=Sf(),o=p_(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(R,p=!0){if(typeof R=="boolean")return!0;if(p===!0)return!c(R);if(!p)return!1;return a(R)<=p}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(R){for(let p in R){if(i.has(p))return!0;let T=R[p];if(Array.isArray(T)&&T.some(c))return!0;if(typeof T=="object"&&c(T))return!0}return!1}function a(R){let p=0;for(let T in R){if(T==="$ref")return 1/0;if(p++,n.has(T))continue;if(typeof R[T]=="object")(0,t.eachItem)(R[T],(w)=>p+=a(w));if(p===1/0)return 1/0}return p}function u(R,p="",T){if(T!==!1)p=m(p);return l(R,R.parse(p))}e.getFullPath=u;function l(R,p){return R.serialize(p).split("#")[0]+"#"}e._getFullPath=l;let f=/#\/?$/;function m(R){return R?R.replace(f,""):""}e.normalizeId=m;function v(R,p,T){return T=m(T),R.resolve(p,T)}e.resolveUrl=v;let g=/^[a-z_][-a-z0-9._]*$/i;function b(R,p){if(typeof R=="boolean")return{};let{schemaId:T,uriResolver:w}=this.opts,E=m(R[T]||p),N={"":E},z=u(w,E,!1),_={},C=new Set;return o(R,{allKeys:!0},(j,Z,G,K)=>{if(K===void 0)return;let ie=z+Z,Se=N[K];if(typeof j[T]=="string")Se=ve.call(this,j[T]);Pe.call(this,j.$anchor),Pe.call(this,j.$dynamicAnchor),N[Z]=Se;function ve(le){let O=this.opts.uriResolver.resolve;if(le=m(Se?O(Se,le):le),C.has(le))throw F(le);C.add(le);let x=this.refs[le];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")q(j,x.schema,le);else if(le!==m(ie))if(le[0]==="#")q(j,_[le],le),_[le]=j;else this.refs[le]=ie;return le}function Pe(le){if(typeof le=="string"){if(!g.test(le))throw Error(`invalid anchor "${le}"`);ve.call(this,`#${le}`)}}}),_;function q(j,Z,G){if(Z!==void 0&&!r(j,Z))throw F(G)}function F(j){return Error(`reference "${j}" resolves to more than one schema`)}}e.getSchemaRefs=b}),nr=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=l_(),r=En(),o=vf(),n=En(),s=d_(),i=f_(),c=h_(),a=ue(),u=rt(),l=kn(),f=me(),m=Tn();function v(k){if(z(k)){if(C(k),N(k)){p(k);return}}g(k,()=>(0,t.topBoolOrEmptySchema)(k))}e.validateFunctionCode=v;function g({gen:k,validateName:A,schema:U,schemaEnv:Y,opts:te},oe){if(te.code.es5)k.func(A,a._`${u.default.data}, ${u.default.valCxt}`,Y.$async,()=>{k.code(a._`"use strict"; ${w(U,te)}`),R(k,te),k.code(oe)});else k.func(A,a._`${u.default.data}, ${b(te)}`,Y.$async,()=>k.code(w(U,te)).code(oe))}function b(k){return a._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?a._`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function R(k,A){k.if(u.default.valCxt,()=>{if(k.var(u.default.instancePath,a._`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,a._`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,a._`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,a._`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef)k.var(u.default.dynamicAnchors,a._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(k.var(u.default.instancePath,a._`""`),k.var(u.default.parentData,a._`undefined`),k.var(u.default.parentDataProperty,a._`undefined`),k.var(u.default.rootData,u.default.data),A.dynamicRef)k.var(u.default.dynamicAnchors,a._`{}`)})}function p(k){let{schema:A,opts:U,gen:Y}=k;g(k,()=>{if(U.$comment&&A.$comment)K(k);if(j(k),Y.let(u.default.vErrors,null),Y.let(u.default.errors,0),U.unevaluated)T(k);q(k),ie(k)})}function T(k){let{gen:A,validateName:U}=k;k.evaluated=A.const("evaluated",a._`${U}.evaluated`),A.if(a._`${k.evaluated}.dynamicProps`,()=>A.assign(a._`${k.evaluated}.props`,a._`undefined`)),A.if(a._`${k.evaluated}.dynamicItems`,()=>A.assign(a._`${k.evaluated}.items`,a._`undefined`))}function w(k,A){let U=typeof k=="object"&&k[A.schemaId];return U&&(A.code.source||A.code.process)?a._`/*# sourceURL=${U} */`:a.nil}function E(k,A){if(z(k)){if(C(k),N(k)){_(k,A);return}}(0,t.boolOrEmptySchema)(k,A)}function N({schema:k,self:A}){if(typeof k=="boolean")return!k;for(let U in k)if(A.RULES.all[U])return!0;return!1}function z(k){return typeof k.schema!="boolean"}function _(k,A){let{schema:U,gen:Y,opts:te}=k;if(te.$comment&&U.$comment)K(k);Z(k),G(k);let oe=Y.const("_errs",u.default.errors);q(k,oe),Y.var(A,a._`${oe} === ${u.default.errors}`)}function C(k){(0,f.checkUnknownRules)(k),F(k)}function q(k,A){if(k.opts.jtd)return ve(k,[],!1,A);let U=(0,r.getSchemaTypes)(k.schema);ve(k,U,!(0,r.coerceAndCheckDataType)(k,U),A)}function F(k){let{schema:A,errSchemaPath:U,opts:Y,self:te}=k;if(A.$ref&&Y.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(A,te.RULES))te.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function j(k){let{schema:A,opts:U}=k;if(A.default!==void 0&&U.useDefaults&&U.strictSchema)(0,f.checkStrictMode)(k,"default is ignored in the schema root")}function Z(k){let A=k.schema[k.opts.schemaId];if(A)k.baseId=(0,l.resolveUrl)(k.opts.uriResolver,k.baseId,A)}function G(k){if(k.schema.$async&&!k.schemaEnv.$async)throw Error("async schema in sync schema")}function K({gen:k,schemaEnv:A,schema:U,errSchemaPath:Y,opts:te}){let oe=U.$comment;if(te.$comment===!0)k.code(a._`${u.default.self}.logger.log(${oe})`);else if(typeof te.$comment=="function"){let pe=a.str`${Y}/$comment`,Ce=k.scopeValue("root",{ref:A.root});k.code(a._`${u.default.self}.opts.$comment(${oe}, ${pe}, ${Ce}.schema)`)}}function ie(k){let{gen:A,schemaEnv:U,validateName:Y,ValidationError:te,opts:oe}=k;if(U.$async)A.if(a._`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw(a._`new ${te}(${u.default.vErrors})`));else{if(A.assign(a._`${Y}.errors`,u.default.vErrors),oe.unevaluated)Se(k);A.return(a._`${u.default.errors} === 0`)}}function Se({gen:k,evaluated:A,props:U,items:Y}){if(U instanceof a.Name)k.assign(a._`${A}.props`,U);if(Y instanceof a.Name)k.assign(a._`${A}.items`,Y)}function ve(k,A,U,Y){let{gen:te,schema:oe,data:pe,allErrors:Ce,opts:$e,self:Oe}=k,{RULES:Ee}=Oe;if(oe.$ref&&($e.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(oe,Ee))){te.block(()=>B(k,"$ref",Ee.all.$ref.definition));return}if(!$e.jtd)le(k,A);te.block(()=>{for(let xe of Ee.rules)Ye(xe);Ye(Ee.post)});function Ye(xe){if(!(0,o.shouldUseGroup)(oe,xe))return;if(xe.type){if(te.if((0,n.checkDataType)(xe.type,pe,$e.strictNumbers)),Pe(k,xe),A.length===1&&A[0]===xe.type&&U)te.else(),(0,n.reportTypeError)(k);te.endIf()}else Pe(k,xe);if(!Ce)te.if(a._`${u.default.errors} === ${Y||0}`)}}function Pe(k,A){let{gen:U,schema:Y,opts:{useDefaults:te}}=k;if(te)(0,s.assignDefaults)(k,A.type);U.block(()=>{for(let oe of A.rules)if((0,o.shouldUseRule)(Y,oe))B(k,oe.keyword,oe.definition,A.type)})}function le(k,A){if(k.schemaEnv.meta||!k.opts.strictTypes)return;if(O(k,A),!k.opts.allowUnionTypes)x(k,A);y(k,k.dataTypes)}function O(k,A){if(!A.length)return;if(!k.dataTypes.length){k.dataTypes=A;return}A.forEach((U)=>{if(!h(k.dataTypes,U))I(k,`type "${U}" not allowed by context "${k.dataTypes.join(",")}"`)}),S(k,A)}function x(k,A){if(A.length>1&&!(A.length===2&&A.includes("null")))I(k,"use allowUnionTypes to allow union type keyword")}function y(k,A){let U=k.self.RULES.all;for(let Y in U){let te=U[Y];if(typeof te=="object"&&(0,o.shouldUseRule)(k.schema,te)){let{type:oe}=te.definition;if(oe.length&&!oe.some((pe)=>d(A,pe)))I(k,`missing type "${oe.join(",")}" for keyword "${Y}"`)}}}function d(k,A){return k.includes(A)||A==="number"&&k.includes("integer")}function h(k,A){return k.includes(A)||A==="integer"&&k.includes("number")}function S(k,A){let U=[];for(let Y of k.dataTypes)if(h(A,Y))U.push(Y);else if(A.includes("integer")&&Y==="number")U.push("integer");k.dataTypes=U}function I(k,A){let U=k.schemaEnv.baseId+k.errSchemaPath;A+=` at "${U}" (strictTypes)`,(0,f.checkStrictMode)(k,A,k.opts.strictTypes)}var D=class{constructor(k,A,U){if((0,i.validateKeywordUsage)(k,A,U),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=U,this.data=k.data,this.schema=k.schema[U],this.$data=A.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(k,this.schema,U,this.$data),this.schemaType=A.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=A,this.$data)this.schemaCode=k.gen.const("vSchema",we(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw Error(`${U} value must be ${JSON.stringify(A.schemaType)}`);if("code"in A?A.trackErrors:A.errors!==!1)this.errsCount=k.gen.const("_errs",u.default.errors)}result(k,A,U){this.failResult((0,a.not)(k),A,U)}failResult(k,A,U){if(this.gen.if(k),U)U();else this.error();if(A){if(this.gen.else(),A(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(k,A){this.failResult((0,a.not)(k),void 0,A)}fail(k){if(k===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(k),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);let{schemaCode:A}=this;this.fail(a._`${A} !== undefined && (${(0,a.or)(this.invalid$data(),k)})`)}error(k,A,U){if(A){this.setParams(A),this._error(k,U),this.setParams({});return}this._error(k,U)}_error(k,A){(k?m.reportExtraError:m.reportError)(this,this.def.error,A)}$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(k){if(!this.allErrors)this.gen.if(k)}setParams(k,A){if(A)Object.assign(this.params,k);else this.params=k}block$data(k,A,U=a.nil){this.gen.block(()=>{this.check$data(k,U),A()})}check$data(k=a.nil,A=a.nil){if(!this.$data)return;let{gen:U,schemaCode:Y,schemaType:te,def:oe}=this;if(U.if((0,a.or)(a._`${Y} === undefined`,A)),k!==a.nil)U.assign(k,!0);if(te.length||oe.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),k!==a.nil)U.assign(k,!1)}U.else()}invalid$data(){let{gen:k,schemaCode:A,schemaType:U,def:Y,it:te}=this;return(0,a.or)(oe(),pe());function oe(){if(U.length){if(!(A instanceof a.Name))throw Error("ajv implementation error");let Ce=Array.isArray(U)?U:[U];return a._`${(0,n.checkDataTypes)(Ce,A,te.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function pe(){if(Y.validateSchema){let Ce=k.scopeValue("validate$data",{ref:Y.validateSchema});return a._`!${Ce}(${A})`}return a.nil}}subschema(k,A){let U=(0,c.getSubschema)(this.it,k);(0,c.extendSubschemaData)(U,this.it,k),(0,c.extendSubschemaMode)(U,k);let Y={...this.it,...U,items:void 0,props:void 0};return E(Y,A),Y}mergeEvaluated(k,A){let{it:U,gen:Y}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&k.props!==void 0)U.props=f.mergeEvaluated.props(Y,k.props,U.props,A);if(U.items!==!0&&k.items!==void 0)U.items=f.mergeEvaluated.items(Y,k.items,U.items,A)}mergeValidEvaluated(k,A){let{it:U,gen:Y}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return Y.if(A,()=>this.mergeEvaluated(k,a.Name)),!0}};e.KeywordCxt=D;function B(k,A,U,Y){let te=new D(k,U,A);if("code"in U)U.code(te,Y);else if(te.$data&&U.validate)(0,i.funcKeywordCode)(te,U);else if("macro"in U)(0,i.macroKeywordCode)(te,U);else if(U.compile||U.validate)(0,i.funcKeywordCode)(te,U)}let J=/^\/(?:[^~]|~0|~1)*$/,ce=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function we(k,{dataLevel:A,dataNames:U,dataPathArr:Y}){let te,oe;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!J.test(k))throw Error(`Invalid JSON-pointer: ${k}`);te=k,oe=u.default.rootData}else{let Oe=ce.exec(k);if(!Oe)throw Error(`Invalid JSON-pointer: ${k}`);let Ee=+Oe[1];if(te=Oe[2],te==="#"){if(Ee>=A)throw Error($e("property/index",Ee));return Y[A-Ee]}if(Ee>A)throw Error($e("data",Ee));if(oe=U[A-Ee],!te)return oe}let pe=oe,Ce=te.split("/");for(let Oe of Ce)if(Oe)oe=a._`${oe}${(0,a.getProperty)((0,f.unescapeJsonPointer)(Oe))}`,pe=a._`${pe} && ${oe}`;return pe;function $e(Oe,Ee){return`Cannot access ${Oe} ${Ee} levels up, current level is ${A}`}}e.getData=we}),po=V((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}),sr=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=kn();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}),Cn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=ue(),r=po(),o=rt(),n=kn(),s=me(),i=nr();var c=class{constructor(p){var T;this.refs={},this.dynamicAnchors={};let w;if(typeof p.schema=="object")w=p.schema;this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(T=p.baseId)!==null&&T!==void 0?T:(0,n.normalizeId)(w===null||w===void 0?void 0:w[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};e.SchemaEnv=c;function a(p){let T=f.call(this,p);if(T)return T;let w=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:E,lines:N}=this.opts.code,{ownProperties:z}=this.opts,_=new t.CodeGen(this.scope,{es5:E,lines:N,ownProperties:z}),C;if(p.$async)C=_.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let q=_.scopeName("validate");p.validateName=q;let F={gen:_,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:_.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,t.stringify)(p.schema)}:{ref:p.schema}),validateName:q,ValidationError:C,schema:p.schema,schemaEnv:p,rootId:w,baseId:p.baseId||w,schemaPath:t.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},j;try{this._compilations.add(p),(0,i.validateFunctionCode)(F),_.optimize(this.opts.code.optimize);let Z=_.toString();if(j=`${_.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process)j=this.opts.code.process(j,p);let G=Function(`${o.default.self}`,`${o.default.scope}`,j)(this,this.scope.get());if(this.scope.value(q,{ref:G}),G.errors=null,G.schema=p.schema,G.schemaEnv=p,p.$async)G.$async=!0;if(this.opts.code.source===!0)G.source={validateName:q,validateCode:Z,scopeValues:_._values};if(this.opts.unevaluated){let{props:K,items:ie}=F;if(G.evaluated={props:K instanceof t.Name?void 0:K,items:ie instanceof t.Name?void 0:ie,dynamicProps:K instanceof t.Name,dynamicItems:ie instanceof t.Name},G.source)G.source.evaluated=(0,t.stringify)(G.evaluated)}return p.validate=G,p}catch(Z){if(delete p.validate,delete p.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw Z}finally{this._compilations.delete(p)}}e.compileSchema=a;function u(p,T,w){var E;w=(0,n.resolveUrl)(this.opts.uriResolver,T,w);let N=p.refs[w];if(N)return N;let z=v.call(this,p,w);if(z===void 0){let _=(E=p.localRefs)===null||E===void 0?void 0:E[w],{schemaId:C}=this.opts;if(_)z=new c({schema:_,schemaId:C,root:p,baseId:T})}if(z===void 0)return;return p.refs[w]=l.call(this,z)}e.resolveRef=u;function l(p){if((0,n.inlineRef)(p.schema,this.opts.inlineRefs))return p.schema;return p.validate?p:a.call(this,p)}function f(p){for(let T of this._compilations)if(m(T,p))return T}e.getCompilingSchema=f;function m(p,T){return p.schema===T.schema&&p.root===T.root&&p.baseId===T.baseId}function v(p,T){let w;while(typeof(w=this.refs[T])=="string")T=w;return w||this.schemas[T]||g.call(this,p,T)}function g(p,T){let w=this.opts.uriResolver.parse(T),E=(0,n._getFullPath)(this.opts.uriResolver,w),N=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&E===N)return R.call(this,w,p);let z=(0,n.normalizeId)(E),_=this.refs[z]||this.schemas[z];if(typeof _=="string"){let C=g.call(this,p,_);if(typeof(C===null||C===void 0?void 0:C.schema)!=="object")return;return R.call(this,w,C)}if(typeof(_===null||_===void 0?void 0:_.schema)!=="object")return;if(!_.validate)a.call(this,_);if(z===(0,n.normalizeId)(T)){let{schema:C}=_,{schemaId:q}=this.opts,F=C[q];if(F)N=(0,n.resolveUrl)(this.opts.uriResolver,N,F);return new c({schema:C,schemaId:q,root:p,baseId:N})}return R.call(this,w,_)}e.resolveSchema=g;let b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function R(p,{baseId:T,schema:w,root:E}){var N;if(((N=p.fragment)===null||N===void 0?void 0:N[0])!=="/")return;for(let C of p.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let q=w[(0,s.unescapeFragment)(C)];if(q===void 0)return;w=q;let F=typeof w==="object"&&w[this.opts.schemaId];if(!b.has(C)&&F)T=(0,n.resolveUrl)(this.opts.uriResolver,T,F)}let z;if(typeof w!="boolean"&&w.$ref&&!(0,s.schemaHasRulesButRef)(w,this.RULES)){let C=(0,n.resolveUrl)(this.opts.uriResolver,T,w.$ref);z=g.call(this,E,C)}let{schemaId:_}=this.opts;if(z=z||new c({schema:w,schemaId:_,root:E,baseId:T}),z.schema!==z.root.schema)return z}}),m_=V((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}}),bf=V((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),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),u=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),l=Array(256);for(let d=0;d<256;d++)l[d]="%"+"0123456789ABCDEF"[d>>4]+"0123456789ABCDEF"[d&15];function f(y){if(y<2048)return l[192|y>>6]+l[128|y&63];if(y<65536)return l[224|y>>12]+l[128|y>>6&63]+l[128|y&63];return l[240|y>>18]+l[128|y>>12&63]+l[128|y>>6&63]+l[128|y&63]}function m(y){let d="",h=0,S=0;for(S=0;S<y.length;S++){if(h=y[S].charCodeAt(0),h===48)continue;if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";d+=y[S];break}for(S+=1;S<y.length;S++){if(h=y[S].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";d+=y[S]}return d}let v=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),g=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),b=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),R=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function p(y){if(y.length===0)return!1;for(let d=0;d<y.length;d++){if(b(y[d]))continue;if(y[d]==="%"&&d+2<y.length&&s(y.slice(d+1,d+3))){d+=2;continue}return!1}return!0}function T(y){let d=-1,h=0,S=-1,I=0;for(let J=0;J<y.length;J++)if(y[J]==="0"){if(S===-1)S=J;if(I++,I>h)h=I,d=S}else S=-1,I=0;if(h<2)return y.join(":");let D=y.slice(0,d).join(":"),B=y.slice(d+h).join(":");return D+"::"+B}function w(y){let d=y.indexOf("::");if(d!==-1&&y.indexOf("::",d+1)!==-1)return;let h=d===-1?y.split(":"):y.slice(0,d).split(":"),S=d===-1?[]:y.slice(d+2).split(":");if(d!==-1){if(h.length===1&&h[0]==="")h.length=0;if(S.length===1&&S[0]==="")S.length=0}let I=h.concat(S),D=0;for(let J=0;J<I.length;J++){let ce=I[J];if(ce==="")return;if(ce.indexOf(".")!==-1){if(J!==I.length-1||d!==-1&&S.length===0||!o(ce))return;D+=2;continue}if(!v(ce))return;I[J]=parseInt(ce,16).toString(16),D++}if(d===-1){if(D!==8)return;return T(I)}if(D>=8)return;let B=I.slice(0,h.length);for(let J=D;J<8;J++)B.push("0");for(let J=h.length;J<I.length;J++)B.push(I[J]);return T(B)}function E(y){let d=y[0]==="["&&y[y.length-1]==="]";if((y[0]==="["||y[y.length-1]==="]")&&!d)return{host:y,isIPV6:!1,error:!0};let h=d?y.slice(1,-1):y;if(d&&g(h))return h=h.toLowerCase(),{host:`[${h}]`,escapedHost:h,isIPV6:!1,isIPVFuture:!0};if(N(h,":")<2)return{host:y,isIPV6:!1,error:d};let S="",I=h.indexOf("%");if(I!==-1){let B=h.slice(I,I+3).toLowerCase()==="%25"?3:1;if(S=h.slice(I+B),!p(S))return{host:y,isIPV6:!1,error:!0};h=h.slice(0,I)}let D=w(h);if(D===void 0)return{host:y,isIPV6:!1,error:!0};return{host:D+(S?"%"+S:""),escapedHost:D+(S?"%25"+S:""),isIPV6:!0}}function N(y,d){let h=0;for(let S=0;S<y.length;S++)if(y[S]===d)h++;return h}function z(y){let d=y,h=[],S=-1,I=0;while(I=d.length){if(I===1)if(d===".")break;else if(d==="/"){h.push("/");break}else{h.push(d);break}else if(I===2){if(d[0]==="."){if(d[1]===".")break;else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"){if(d[1]==="."||d[1]==="/"){h.push("/");break}}}else if(I===3){if(d==="/.."){if(h.length!==0)h.pop();h.push("/");break}}if(d[0]==="."){if(d[1]==="."){if(d[2]==="/"){d=d.slice(3);continue}}else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"){if(d[1]==="."){if(d[2]==="/"){d=d.slice(2);continue}else if(d[2]==="."){if(d[3]==="/"){if(d=d.slice(3),h.length!==0)h.pop();continue}}}}if((S=d.indexOf("/",1))===-1){h.push(d);break}else h.push(d.slice(0,S)),d=d.slice(S)}return h.join("")}let _={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},C=/[@/?#:]/g,q=/[@/?#]/g;function F(y,d){let h=d?q:C;return h.lastIndex=0,y.replace(h,(S)=>_[S])}function j(y,d=!1){if(y.indexOf("%")===-1)return y;let h="";for(let S=0;S<y.length;S++){if(y[S]==="%"&&S+2<y.length){let I=y.slice(S+1,S+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(d&&i(B))h+=B;else h+="%"+D;S+=2;continue}}h+=y[S]}return h}function Z(y){let d="";for(let h=0;h<y.length;h++){let S=y[h];if(S==="%"&&h+2<y.length){let I=y.slice(h+1,h+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(B!=="."&&i(B))d+=B;else d+="%"+D;h+=2;continue}}if(c(S))d+=S;else{let I=y.charCodeAt(h);if(I<128)d+=Pe(I)?S:l[I];else if(I<55296||I>57343)d+=f(I);else if(I<=56319&&h+1<y.length){let D=y.charCodeAt(h+1);if(D>=56320&&D<=57343)d+=f(65536+(I-55296<<10)+(D-56320)),h++;else d+=f(65533)}else d+=f(65533)}}return d}function G(y,d=!1){let h="",S=d&&y[0]!=="/";for(let I=0;I<y.length;I++){let D=y[I];if(D==="%"&&I+2<y.length){let B=y.slice(I+1,I+3);if(s(B)){h+="%"+B.toUpperCase(),I+=2;continue}}if(D==="/")S=!1;if(c(D)&&(D!==":"||!S))h+=D;else{let B=y.charCodeAt(I);if(B<128)h+=l[B];else if(B<55296||B>57343)h+=f(B);else if(B<=56319&&I+1<y.length){let J=y.charCodeAt(I+1);if(J>=56320&&J<=57343)h+=f(65536+(B-55296<<10)+(J-56320)),I++;else h+=f(65533)}else h+=f(65533)}}return h}function K(y,d){let h="";for(let S=0;S<y.length;S++){let I=y[S];if(I==="%"&&S+2<y.length){let D=y.slice(S+1,S+3);if(s(D)){h+="%"+D.toUpperCase(),S+=2;continue}}if(d(I))h+=I;else{let D=y.charCodeAt(S);if(D<128)h+=l[D];else if(D<55296||D>57343)h+=f(D);else if(D<=56319&&S+1<y.length){let B=y.charCodeAt(S+1);if(B>=56320&&B<=57343)h+=f(65536+(D-55296<<10)+(B-56320)),S++;else h+=f(65533)}else h+=f(65533)}}return h}function ie(y){return K(y,u)}function Se(y){return K(y,a)}function ve(y){return K(y,a)}function Pe(y){return y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||y===42||y===43||y===45||y===46||y===47||y===64||y===95}function le(y){let d="";for(let h=0;h<y.length;h++){let S=y[h];if(S==="%"&&h+2<y.length){let I=y.slice(h+1,h+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(i(B))d+=B;else d+="%"+D;h+=2;continue}}if(a(S))d+=S;else{let I=y.charCodeAt(h);if(I<128)d+=Pe(I)?S:l[I];else if(I<55296||I>57343)d+=f(I);else if(I<=56319&&h+1<y.length){let D=y.charCodeAt(h+1);if(D>=56320&&D<=57343)d+=f(65536+(I-55296<<10)+(D-56320)),h++;else d+=f(65533)}else d+=f(65533)}}return d}function O(y){let d="";for(let h=0;h<y.length;h++){if(y[h]==="%"&&h+2<y.length){let S=y.slice(h+1,h+3);if(s(S)){d+="%"+S.toUpperCase(),h+=2;continue}}d+=escape(y[h])}return d}function x(y){let d=[];if(y.userinfo!==void 0)d.push(ie(y.userinfo)),d.push("@");if(y.host!==void 0){let h=y.host;if(!o(h)){let S=E(h);if(S.isIPV6!==!0&&S.isIPVFuture!==!0)h=j(h,!0),S=E(h);if(S.isIPV6===!0||S.isIPVFuture===!0)h=`[${S.escapedHost}]`;else h=F(h,!1)}d.push(h)}if(typeof y.port==="number"||typeof y.port==="string"){let h=String(y.port);if(!n(h))throw TypeError("URI port is malformed.");d.push(":"),d.push(h)}return d.length?d.join(""):void 0}t.exports={nonSimpleDomain:R,recomposeAuthority:x,reescapeHostDelimiters:F,normalizePercentEncoding:j,normalizePathEncoding:Z,serializePathEncoding:G,normalizeQueryFragmentEncoding:le,encodeUserinfo:ie,encodeQuery:Se,encodeFragment:ve,escapePreservingEscapes:O,removeDotSegments:z,isIPv4:o,isUUID:r,normalizeIPv6:E,stringArrayToHexStripped:m}}),g_=V((e,t)=>{let{isUUID:r}=bf(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(_){return n.indexOf(_)!==-1}function i(_){if(_.secure===!0)return!0;else if(_.secure===!1)return!1;else if(_.scheme)return _.scheme.length===3&&(_.scheme[0]==="w"||_.scheme[0]==="W")&&(_.scheme[1]==="s"||_.scheme[1]==="S")&&(_.scheme[2]==="s"||_.scheme[2]==="S");else return!1}function c(_){if(!_.host)_.error=_.error||"HTTP URIs must have a host.";return _}function a(_){let C=String(_.scheme).toLowerCase()==="https";if(_.port===(C?443:80)||_.port==="")_.port=void 0;if(!_.path)_.path="/";return _}function u(_){return _.secure=i(_),_.resourceName=(_.path||"/")+(_.query?"?"+_.query:""),_.path=void 0,_.query=void 0,_}function l(_){if(_.port===(i(_)?443:80)||_.port==="")_.port=void 0;if(typeof _.secure==="boolean")_.scheme=_.secure?"wss":"ws",_.secure=void 0;if(_.resourceName){let C=_.resourceName.indexOf("?"),q=C===-1?_.resourceName:_.resourceName.slice(0,C);_.path=q&&q!=="/"?q:void 0,_.query=C===-1?void 0:_.resourceName.slice(C+1),_.resourceName=void 0}return _.fragment=void 0,_}function f(_,C){if(!_.path)return _.error="URN can not be parsed",_;let q=_.path.match(o);if(q&&q[0]===_.path){let F=C.scheme||_.scheme||"urn";_.nid=q[1].toLowerCase(),_.nss=q[2];let j=z(`${F}:${C.nid||_.nid}`);if(_.path=void 0,j)_=j.parse(_,C)}else _.error=_.error||"URN can not be parsed.";return _}function m(_,C){if(_.nid===void 0)throw Error("URN without nid cannot be serialized");let q=C.scheme||_.scheme||"urn",F=_.nid.toLowerCase(),j=z(`${q}:${C.nid||F}`);if(j)_=j.serialize(_,C);let Z=_,G=_.nss;return Z.path=`${F||C.nid}:${G}`,C.skipEscape=!0,Z}function v(_,C){let q=_;if(q.uuid=q.nss,q.nss=void 0,!C.tolerant&&(!q.uuid||!r(q.uuid)))q.error=q.error||"UUID is not valid.";return q}function g(_){let C=_;return C.nss=(_.uuid||"").toLowerCase(),C}let b={scheme:"http",domainHost:!0,parse:c,serialize:a},R={scheme:"https",domainHost:b.domainHost,parse:c,serialize:a},p={scheme:"ws",domainHost:!0,parse:u,serialize:l},T={scheme:"wss",domainHost:p.domainHost,parse:p.parse,serialize:p.serialize},N={http:b,https:R,ws:p,wss:T,urn:{scheme:"urn",parse:f,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(N,null);function z(_){return _&&(N[_]||N[_.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:N,isValidSchemeName:s,getSchemeHandler:z}}),y_=V((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:s,normalizePathEncoding:i,serializePathEncoding:c,normalizeQueryFragmentEncoding:a,encodeQuery:u,encodeFragment:l,reescapeHostDelimiters:f,isIPv4:m,nonSimpleDomain:v}=bf(),{SCHEMES:g,getSchemeHandler:b}=g_(),R=/^[A-Za-z][A-Za-z0-9+.-]*$/u,p="URI scheme is malformed.";function T(y){let d=unescape(String(y));if(!R.test(d))throw TypeError("URI scheme is malformed.");return d}function w(y,d){if(typeof y==="string")y=Pe(y,d);else if(typeof y==="object")y=ve(_(y,d),d);return y}function E(y,d,h){let S=h?Object.assign({scheme:"null"},h):{scheme:"null"},{parsed:I,malformedAuthorityOrPort:D,malformedPercentEncoding:B,malformedSchemeSpecific:J,malformedHost:ce,malformedScheme:we}=Se(y,S),{parsed:k,malformedAuthorityOrPort:A,malformedPercentEncoding:U,malformedSchemeSpecific:Y,malformedHost:te,malformedScheme:oe}=Se(d,S);if(D||A||B||U||J||Y||ce||te||we||oe)throw Error(I.error||k.error||"URI is malformed.");let pe=N(I,k,S,!0),Ce=b(h&&h.scheme||pe.scheme),$e=pe.host,Oe=$e!==void 0&&$e!==""&&(m($e)||r($e).isIPV6);ie(pe,h||{},Ce,Oe);let Ee=$e&&$e.indexOf("%")!==-1&&!/\P{ASCII}/u.test($e);if(pe.error&&!Ee)throw Error(pe.error);return S.skipEscape=!0,_(pe,S)}function N(y,d,h,S){let I={};if(!S)y=ve(_(y,h),h),d=ve(_(d,h),h);if(h=h||{},!h.tolerant&&d.scheme)I.scheme=d.scheme,I.userinfo=d.userinfo,I.host=d.host,I.port=d.port,I.path=o(d.path||""),I.query=d.query;else{if(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)I.userinfo=d.userinfo,I.host=d.host,I.port=d.port,I.path=o(d.path||""),I.query=d.query;else{if(!d.path)if(I.path=y.path,d.query!==void 0)I.query=d.query;else I.query=y.query;else{if(d.path[0]==="/")I.path=o(d.path);else{if((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path)I.path="/"+d.path;else if(!y.path)I.path=d.path;else I.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+d.path;I.path=o(I.path)}I.query=d.query}I.userinfo=y.userinfo,I.host=y.host,I.port=y.port}I.scheme=y.scheme}return I.fragment=d.fragment,I}function z(y,d,h){let S=O(y,h),I=O(d,h);return S!==void 0&&I!==void 0&&S===I}function _(y,d){let h={host:y.host,scheme:y.scheme,userinfo:y.userinfo,port:y.port,path:y.path,query:y.query,nid:y.nid,nss:y.nss,uuid:y.uuid,fragment:y.fragment,reference:y.reference,resourceName:y.resourceName,secure:y.secure,error:""},S=Object.assign({},d),I=[];if(h.scheme)h.scheme=T(h.scheme);let D=b(S.scheme||h.scheme);if(D&&D.serialize)D.serialize(h,S);let B=h.userinfo!==void 0||h.host!==void 0||h.port!==void 0,J=!S.skipEscape&&h.scheme===void 0&&!B;if(h.path!==void 0)if(!S.skipEscape)h.path=c(h.path,J);else h.path=s(h.path);if(S.reference!=="suffix"&&h.scheme)h.scheme=T(h.scheme),I.push(h.scheme,":");let ce=n(h);if(ce!==void 0){if(S.reference!=="suffix")I.push("//");if(I.push(ce),h.path&&h.path[0]!=="/")I.push("/")}if(h.path!==void 0){let we=h.path;if(!S.absolutePath&&(!D||!D.absolutePath))we=o(we);if(J)we=c(we,!0);if(ce===void 0&&we[0]==="/"&&we[1]==="/")we="/%2F"+we.slice(2);I.push(we)}if(h.query!==void 0)I.push("?",u(h.query));if(h.fragment!==void 0)I.push("#",l(h.fragment));return I.join("")}let C=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,q=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,F=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j(y,d){if(d[2]!==void 0&&y.path&&y.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof y.port==="number"&&(y.port<0||y.port>65535))return"URI port is malformed."}function Z(y){if(y===void 0)return!1;let d=y.indexOf("%");while(d!==-1){if(d+2>=y.length||!/^[\da-f]{2}$/iu.test(y.slice(d+1,d+3)))return!0;d=y.indexOf("%",d+3)}return!1}function G(y){return y[0]==="["&&y[y.length-1]==="]"}function K(y){let d=y[4];return Z(y[3])||d!==void 0&&!G(d)&&Z(d)||Z(y[6])||Z(y[7])||Z(y[8])}function ie(y,d,h,S){if(!d.unicodeSupport&&(!h||!h.unicodeSupport)&&y.host&&!G(y.host)&&(d.domainHost||h&&h.domainHost)&&S===!1&&v(y.host))try{y.host=new URL("http://"+y.host).hostname}catch(I){return y.error=y.error||"Host's domain name can not be converted to ASCII: "+I,!0}return!1}function Se(y,d){let h=Object.assign({},d),S={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=!1,D=!1,B=!1,J=!1,ce=!1,we=!1,k=!1;if(h.reference==="suffix")if(h.scheme)y=h.scheme+":"+y;else y="//"+y;let A=y.match(q);if(A!==null&&A[1].indexOf("\\")!==-1)S.error="URI authority must not contain a literal backslash.",I=!0;let U=y.match(F);if(U!==null){let te=U[1],oe=te.replace(/[\t\n\r]/g,"");if(oe.length>=2){if(oe.slice(0,2)!=="//")S.error=S.error||"URI authority must not contain a literal backslash.",I=!0;else if(te.length!==oe.length)S.error=S.error||"URI authority introducer must not contain whitespace.",I=!0}}let Y=y.match(C);if(Y){if(S.scheme=Y[1],S.userinfo=Y[3],S.host=Y[4],S.port=parseInt(Y[5],10),S.path=Y[6]||"",S.query=Y[7],S.fragment=Y[8],S.scheme!==void 0){let pe=unescape(S.scheme);if(R.test(pe))S.scheme=pe.toLowerCase();else S.error=S.error||"URI scheme is malformed.",we=!0}if(D=K(Y),D)S.error=S.error||"URI contains malformed percent-encoding.";if(isNaN(S.port))S.port=Y[5];let te=j(S,Y);if(te!==void 0)S.error=S.error||te,I=!0;if(S.host)if(m(S.host)===!1){let pe=G(S.host),Ce=S.host.indexOf("[")!==-1||S.host.indexOf("]")!==-1,$e=r(S.host);if(k=$e.isIPV6||$e.isIPVFuture===!0,ce=Ce&&(!pe||$e.error===!0),S.host=k?$e.host:$e.host.toLowerCase(),ce)S.error=S.error||"URI host is malformed.",I=!0}else k=!0;if(S.scheme===void 0&&S.userinfo===void 0&&S.host===void 0&&S.port===void 0&&S.query===void 0&&!S.path)S.reference="same-document";else if(S.scheme===void 0)S.reference="relative";else if(S.fragment===void 0)S.reference="absolute";else S.reference="uri";if(h.reference&&h.reference!=="suffix"&&h.reference!==S.reference)S.error=S.error||"URI is not a "+h.reference+" reference.";let oe=b(h.scheme||S.scheme);if(!ce)J=ie(S,h,oe,k);if(y.indexOf("%")!==-1&&S.host!==void 0&&!ce){let pe=k?S.host:s(S.host,!0);if(!k)pe=s(pe.toLowerCase());S.host=f(pe,k)}if(!oe||oe&&!oe.skipNormalize){if(S.path)S.path=i(S.path);if(S.query)S.query=a(S.query);if(S.fragment)S.fragment=a(S.fragment)}if(oe&&oe.parse){if(oe.parse(S,h),oe===g.urn&&S.nid===void 0)B=!0}}else S.error=S.error||"URI can not be parsed.";return{parsed:S,malformedAuthorityOrPort:I,malformedPercentEncoding:D,malformedSchemeSpecific:B,malformedHost:J,malformedScheme:we}}function ve(y,d){return Se(y,d).parsed}function Pe(y,d){return le(y,d).normalized}function le(y,d){let{parsed:h,malformedAuthorityOrPort:S,malformedPercentEncoding:I,malformedSchemeSpecific:D,malformedHost:B,malformedScheme:J}=Se(y,d);return{normalized:S||I||D||B||J?y:_(h,d),malformedAuthorityOrPort:S,malformedPercentEncoding:I,malformedSchemeSpecific:D,malformedHost:B,malformedScheme:J}}function O(y,d){if(typeof y!=="string"&&typeof y!=="object")return;let h;try{h=typeof y==="string"?y:_(y,d)}catch{return}let{normalized:S,malformedAuthorityOrPort:I,malformedPercentEncoding:D,malformedSchemeSpecific:B,malformedHost:J,malformedScheme:ce}=le(h,d);return I||D||B||J||ce?void 0:S}let x={SCHEMES:g,normalize:w,resolve:E,resolveComponent:N,equal:z,serialize:_,parse:ve};t.exports=x,t.exports.default=x,t.exports.fastUri=x});var v_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=y_();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),Ii=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ue();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=po(),n=sr(),s=yf(),i=Cn(),c=ue(),a=kn(),u=En(),l=me(),f=m_(),m=v_(),v=(O,x)=>new RegExp(O,x);v.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),R={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function w(O){var x,y,d,h,S,I,D,B,J,ce,we,k,A,U,Y,te,oe,pe,Ce,$e,Oe,Ee,Ye,xe,ct;let Qe=O.strict,ut=(x=O.code)===null||x===void 0?void 0:x.optimize,pt=ut===!0||ut===void 0?1:ut||0,mt=(d=(y=O.code)===null||y===void 0?void 0:y.regExp)!==null&&d!==void 0?d:v,zt=(h=O.uriResolver)!==null&&h!==void 0?h:m.default;return{strictSchema:(I=(S=O.strictSchema)!==null&&S!==void 0?S:Qe)!==null&&I!==void 0?I:!0,strictNumbers:(B=(D=O.strictNumbers)!==null&&D!==void 0?D:Qe)!==null&&B!==void 0?B:!0,strictTypes:(ce=(J=O.strictTypes)!==null&&J!==void 0?J:Qe)!==null&&ce!==void 0?ce:"log",strictTuples:(k=(we=O.strictTuples)!==null&&we!==void 0?we:Qe)!==null&&k!==void 0?k:"log",strictRequired:(U=(A=O.strictRequired)!==null&&A!==void 0?A:Qe)!==null&&U!==void 0?U:!1,code:O.code?{...O.code,optimize:pt,regExp:mt}:{optimize:pt,regExp:mt},loopRequired:(Y=O.loopRequired)!==null&&Y!==void 0?Y:T,loopEnum:(te=O.loopEnum)!==null&&te!==void 0?te:T,meta:(oe=O.meta)!==null&&oe!==void 0?oe:!0,messages:(pe=O.messages)!==null&&pe!==void 0?pe:!0,inlineRefs:(Ce=O.inlineRefs)!==null&&Ce!==void 0?Ce:!0,schemaId:($e=O.schemaId)!==null&&$e!==void 0?$e:"$id",addUsedSchema:(Oe=O.addUsedSchema)!==null&&Oe!==void 0?Oe:!0,validateSchema:(Ee=O.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Ye=O.validateFormats)!==null&&Ye!==void 0?Ye:!0,unicodeRegExp:(xe=O.unicodeRegExp)!==null&&xe!==void 0?xe:!0,int32range:(ct=O.int32range)!==null&&ct!==void 0?ct:!0,uriResolver:zt}}var E=class{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...w(O)};let{es5:x,lines:y}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:x,lines:y}),this.logger=Z(O.logger);let d=O.validateFormats;if(O.validateFormats=!1,this.RULES=(0,s.getRules)(),N.call(this,R,O,"NOT SUPPORTED"),N.call(this,p,O,"DEPRECATED","warn"),this._metaOpts=F.call(this),O.formats)C.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords)q.call(this,O.keywords);if(typeof O.meta=="object")this.addMetaSchema(O.meta);_.call(this),O.validateFormats=d}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:O,meta:x,schemaId:y}=this.opts,d=f;if(y==="id")d={...f},d.id=d.$id,delete d.$id;if(x&&O)this.addMetaSchema(d,d[y],!1)}defaultMeta(){let{meta:O,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[x]||O:void 0}validate(O,x){let y;if(typeof O=="string"){if(y=this.getSchema(O),!y)throw Error(`no schema with key or ref "${O}"`)}else y=this.compile(O);let d=y(x);if(!("$async"in y))this.errors=y.errors;return d}compile(O,x){let y=this._addSchema(O,x);return y.validate||this._compileSchemaEnv(y)}compileAsync(O,x){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:y}=this.opts;return d.call(this,O,x);async function d(J,ce){await h.call(this,J.$schema);let we=this._addSchema(J,ce);return we.validate||S.call(this,we)}async function h(J){if(J&&!this.getSchema(J))await d.call(this,{$ref:J},!0)}async function S(J){try{return this._compileSchemaEnv(J)}catch(ce){if(!(ce instanceof n.default))throw ce;return I.call(this,ce),await D.call(this,ce.missingSchema),S.call(this,J)}}function I({missingSchema:J,missingRef:ce}){if(this.refs[J])throw Error(`AnySchema ${J} is loaded but ${ce} cannot be resolved`)}async function D(J){let ce=await B.call(this,J);if(!this.refs[J])await h.call(this,ce.$schema);if(!this.refs[J])this.addSchema(ce,J,x)}async function B(J){let ce=this._loading[J];if(ce)return ce;try{return await(this._loading[J]=y(J))}finally{delete this._loading[J]}}}addSchema(O,x,y,d=this.opts.validateSchema){if(Array.isArray(O)){for(let S of O)this.addSchema(S,void 0,y,d);return this}let h;if(typeof O==="object"){let{schemaId:S}=this.opts;if(h=O[S],h!==void 0&&typeof h!="string")throw Error(`schema ${S} must be string`)}return x=(0,a.normalizeId)(x||h),this._checkUnique(x),this.schemas[x]=this._addSchema(O,y,x,d,!0),this}addMetaSchema(O,x,y=this.opts.validateSchema){return this.addSchema(O,x,!0,y),this}validateSchema(O,x){if(typeof O=="boolean")return!0;let y;if(y=O.$schema,y!==void 0&&typeof y!="string")throw Error("$schema must be a string");if(y=y||this.opts.defaultMeta||this.defaultMeta(),!y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let d=this.validate(y,O);if(!d&&x){let h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw Error(h)}return d}getSchema(O){let x;while(typeof(x=z.call(this,O))=="string")O=x;if(x===void 0){let{schemaId:y}=this.opts,d=new i.SchemaEnv({schema:{},schemaId:y});if(x=i.resolveSchema.call(this,d,O),!x)return;this.refs[O]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=z.call(this,O);if(typeof x=="object")this._cache.delete(x.schema);return delete this.schemas[O],delete this.refs[O],this}case"object":{let x=O;this._cache.delete(x);let y=O[this.opts.schemaId];if(y)y=(0,a.normalizeId)(y),delete this.schemas[y],delete this.refs[y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(let x of O)this.addKeyword(x);return this}addKeyword(O,x){let y;if(typeof O=="string"){if(y=O,typeof x=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=y}else if(typeof O=="object"&&x===void 0){if(x=O,y=x.keyword,Array.isArray(y)&&!y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(K.call(this,y,x),!x)return(0,l.eachItem)(y,(h)=>ie.call(this,h)),this;ve.call(this,x);let d={...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)};return(0,l.eachItem)(y,d.type.length===0?(h)=>ie.call(this,h,d):(h)=>d.type.forEach((S)=>ie.call(this,h,d,S))),this}getKeyword(O){let x=this.RULES.all[O];return typeof x=="object"?x.definition:!!x}removeKeyword(O){let{RULES:x}=this;delete x.keywords[O],delete x.all[O];for(let y of x.rules){let d=y.rules.findIndex((h)=>h.keyword===O);if(d>=0)y.rules.splice(d,1)}return this}addFormat(O,x){if(typeof x=="string")x=new RegExp(x);return this.formats[O]=x,this}errorsText(O=this.errors,{separator:x=", ",dataVar:y="data"}={}){if(!O||O.length===0)return"No errors";return O.map((d)=>`${y}${d.instancePath} ${d.message}`).reduce((d,h)=>d+x+h)}$dataMetaSchema(O,x){let y=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(let d of x){let h=d.split("/").slice(1),S=O;for(let I of h)S=S[I];for(let I in y){let D=y[I];if(typeof D!="object")continue;let{$data:B}=D.definition,J=S[I];if(B&&J)S[I]=le(J)}}return O}_removeAllSchemas(O,x){for(let y in O){let d=O[y];if(!x||x.test(y)){if(typeof d=="string")delete O[y];else if(d&&!d.meta)this._cache.delete(d.schema),delete O[y]}}}_addSchema(O,x,y,d=this.opts.validateSchema,h=this.opts.addUsedSchema){let S,{schemaId:I}=this.opts;if(typeof O=="object")S=O[I];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof O!="boolean")throw Error("schema must be object or boolean");let D=this._cache.get(O);if(D!==void 0)return D;y=(0,a.normalizeId)(S||y);let B=a.getSchemaRefs.call(this,O,y);if(D=new i.SchemaEnv({schema:O,schemaId:I,meta:x,baseId:y,localRefs:B}),this._cache.set(D.schema,D),h&&!y.startsWith("#")){if(y)this._checkUnique(y);this.refs[y]=D}if(d)this.validateSchema(O,!0);return D}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta)this._compileMetaSchema(O);else i.compileSchema.call(this,O);if(!O.validate)throw Error("ajv implementation error");return O.validate}_compileMetaSchema(O){let x=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=x}}};E.ValidationError=o.default,E.MissingRefError=n.default,e.default=E;function N(O,x,y,d="error"){for(let h in O){let S=h;if(S in x)this.logger[d](`${y}: option ${h}. ${O[S]}`)}}function z(O){return O=(0,a.normalizeId)(O),this.schemas[O]||this.refs[O]}function _(){let O=this.opts.schemas;if(!O)return;if(Array.isArray(O))this.addSchema(O);else for(let x in O)this.addSchema(O[x],x)}function C(){for(let O in this.opts.formats){let x=this.opts.formats[O];if(x)this.addFormat(O,x)}}function q(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in O){let y=O[x];if(!y.keyword)y.keyword=x;this.addKeyword(y)}}function F(){let O={...this.opts};for(let x of g)delete O[x];return O}let j={log(){},warn(){},error(){}};function Z(O){if(O===!1)return j;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw Error("logger must implement log, warn and error methods")}let G=/^[a-z_$][a-z0-9_$:-]*$/i;function K(O,x){let{RULES:y}=this;if((0,l.eachItem)(O,(d)=>{if(y.keywords[d])throw Error(`Keyword ${d} is already defined`);if(!G.test(d))throw Error(`Keyword ${d} has invalid name`)}),!x)return;if(x.$data&&!(("code"in x)||("validate"in x)))throw Error('$data keyword must have "code" or "validate" function')}function ie(O,x,y){var d;let h=x===null||x===void 0?void 0:x.post;if(y&&h)throw Error('keyword with "post" flag cannot have "type"');let{RULES:S}=this,I=h?S.post:S.rules.find(({type:B})=>B===y);if(!I)I={type:y,rules:[]},S.rules.push(I);if(S.keywords[O]=!0,!x)return;let D={keyword:O,definition:{...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)}};if(x.before)Se.call(this,I,D,x.before);else I.rules.push(D);S.all[O]=D,(d=x.implements)===null||d===void 0||d.forEach((B)=>this.addKeyword(B))}function Se(O,x,y){let d=O.rules.findIndex((h)=>h.keyword===y);if(d>=0)O.rules.splice(d,0,x);else O.rules.push(x),this.logger.warn(`rule ${y} is not defined`)}function ve(O){let{metaSchema:x}=O;if(x===void 0)return;if(O.$data&&this.opts.$data)x=le(x);O.validateSchema=this.compile(x,!0)}let Pe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(O){return{anyOf:[O,Pe]}}}),b_=V((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}),Oi=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=sr(),r=ot(),o=ue(),n=rt(),s=Cn(),i=me(),c={keyword:"$ref",schemaType:"string",code(l){let{gen:f,schema:m,it:v}=l,{baseId:g,schemaEnv:b,validateName:R,opts:p,self:T}=v,{root:w}=b;if((m==="#"||m==="#/")&&g===w.baseId)return N();let E=s.resolveRef.call(T,w,g,m);if(E===void 0)throw new t.default(v.opts.uriResolver,g,m);if(E instanceof s.SchemaEnv)return z(E);return _(E);function N(){if(b===w)return u(l,R,b,b.$async);let C=f.scopeValue("root",{ref:w});return u(l,o._`${C}.validate`,w,w.$async)}function z(C){u(l,a(l,C),C,C.$async)}function _(C){let q=f.scopeValue("schema",p.code.source===!0?{ref:C,code:(0,o.stringify)(C)}:{ref:C}),F=f.name("valid"),j=l.subschema({schema:C,dataTypes:[],schemaPath:o.nil,topSchemaRef:q,errSchemaPath:m},F);l.mergeEvaluated(j),l.ok(F)}}};function a(l,f){let{gen:m}=l;return f.validate?m.scopeValue("validate",{ref:f.validate}):o._`${m.scopeValue("wrapper",{ref:f})}.validate`}e.getValidate=a;function u(l,f,m,v){let{gen:g,it:b}=l,{allErrors:R,schemaEnv:p,opts:T}=b,w=T.passContext?n.default.this:o.nil;if(v)E();else N();function E(){if(!p.$async)throw Error("async schema referenced by sync schema");let C=g.let("valid");g.try(()=>{if(g.code(o._`await ${(0,r.callValidateCode)(l,f,w)}`),_(f),!R)g.assign(C,!0)},(q)=>{if(g.if(o._`!(${q} instanceof ${b.ValidationError})`,()=>g.throw(q)),z(q),!R)g.assign(C,!1)}),l.ok(C)}function N(){l.result((0,r.callValidateCode)(l,f,w),()=>_(f),()=>z(f))}function z(C){let q=o._`${C}.errors`;g.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${q} : ${n.default.vErrors}.concat(${q})`),g.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function _(C){var q;if(!b.opts.unevaluated)return;let F=(q=m===null||m===void 0?void 0:m.validate)===null||q===void 0?void 0:q.evaluated;if(b.props!==!0)if(F&&!F.dynamicProps){if(F.props!==void 0)b.props=i.mergeEvaluated.props(g,F.props,b.props)}else{let j=g.var("props",o._`${C}.evaluated.props`);b.props=i.mergeEvaluated.props(g,j,b.props,o.Name)}if(b.items!==!0)if(F&&!F.dynamicItems){if(F.items!==void 0)b.items=i.mergeEvaluated.items(g,F.items,b.items)}else{let j=g.var("items",o._`${C}.evaluated.items`);b.items=i.mergeEvaluated.items(g,j,b.items,o.Name)}}}e.callRef=u,e.default=c}),wf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=b_(),r=Oi(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),ey=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c,schemaCode:a}=s;s.fail$data(t._`${c} ${o[i].fail} ${a} || isNaN(${c})`)}};e.default=n}),ty=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c}=o,a=c.opts.multipleOfPrecision,u=n.let("res"),l=a?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${a}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),ry=V((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'}),oy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=ry(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let c=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${c} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:c,schemaCode:a,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,f=u.opts.unicode===!1?t._`${c}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${c})`;s.fail$data(t._`${f} ${l} ${a}`)}};e.default=n}),ny=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=me(),o=ue(),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:c,$data:a,schema:u,schemaCode:l,it:f}=s,m=f.opts.unicodeRegExp?"u":"";if(a){let{regExp:v}=f.opts.code,g=v.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,v),b=i.let("valid");i.try(()=>i.assign(b,o._`${g}(${l}, ${m}).test(${c})`),()=>i.assign(b,!1)),s.fail$data(o._`!${b}`)}else{let v=(0,t.usePattern)(s,u);s.fail$data(o._`!${v}.test(${c})`)}}};e.default=n}),sy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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,c=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${c} ${i}`)}};e.default=r}),iy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=me(),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:c,schemaCode:a,data:u,$data:l,it:f}=s,{opts:m}=f;if(!l&&c.length===0)return;let v=c.length>=m.loopRequired;if(f.allErrors)g();else b();if(m.strictRequired){let T=s.parentSchema.properties,{definedProperties:w}=s.it;for(let E of c)if((T===null||T===void 0?void 0:T[E])===void 0&&!w.has(E)){let N=`required property "${E}" is not defined at "${f.schemaEnv.baseId+f.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(f,N,f.opts.strictRequired)}}function g(){if(v||l)s.block$data(r.nil,R);else for(let T of c)(0,t.checkReportMissingProp)(s,T)}function b(){let T=i.let("missing");if(v||l){let w=i.let("valid",!0);s.block$data(w,()=>p(T,w)),s.ok(w)}else i.if((0,t.checkMissingProp)(s,c,T)),(0,t.reportMissingProp)(s,T),i.else()}function R(){i.forOf("prop",a,(T)=>{s.setParams({missingProperty:T}),i.if((0,t.noPropertyInData)(i,u,T,m.ownProperties),()=>s.error())})}function p(T,w){s.setParams({missingProperty:T}),i.forOf(T,a,()=>{i.assign(w,(0,t.propertyInData)(i,u,T,m.ownProperties)),i.if((0,r.not)(w),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),ay=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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,c=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${c} ${i}`)}};e.default=r}),Ni=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Sf();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),cy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=En(),r=ue(),o=me(),n=Ni(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:c}})=>r.str`must NOT have duplicate items (items ## ${c} and ${i} are identical)`,params:({params:{i,j:c}})=>r._`{i: ${i}, j: ${c}}`},code(i){let{gen:c,data:a,$data:u,schema:l,parentSchema:f,schemaCode:m,it:v}=i;if(!u&&!l)return;let g=c.let("valid"),b=f.items?(0,t.getSchemaTypes)(f.items):[];i.block$data(g,R,r._`${m} === false`),i.ok(g);function R(){let E=c.let("i",r._`${a}.length`),N=c.let("j");i.setParams({i:E,j:N}),c.assign(g,!0),c.if(r._`${E} > 1`,()=>(p()?T:w)(E,N))}function p(){return b.length>0&&!b.some((E)=>E==="object"||E==="array")}function T(E,N){let z=c.name("item"),_=(0,t.checkDataTypes)(b,z,v.opts.strictNumbers,t.DataType.Wrong),C=c.const("indices",r._`{}`);c.for(r._`;${E}--;`,()=>{if(c.let(z,r._`${a}[${E}]`),c.if(_,r._`continue`),b.length>1)c.if(r._`typeof ${z} == "string"`,r._`${z} += "_"`);c.if(r._`typeof ${C}[${z}] == "number"`,()=>{c.assign(N,r._`${C}[${z}]`),i.error(),c.assign(g,!1).break()}).code(r._`${C}[${z}] = ${E}`)})}function w(E,N){let z=(0,o.useFunc)(c,n.default),_=c.name("outer");c.label(_).for(r._`;${E}--;`,()=>c.for(r._`${N} = ${E}; ${N}--;`,()=>c.if(r._`${z}(${a}[${E}], ${a}[${N}])`,()=>{i.error(),c.assign(g,!1).break(_)})))}}};e.default=s}),uy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=Ni(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:c,$data:a,schemaCode:u,schema:l}=s;if(a||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${c}, ${u})`);else s.fail(t._`${l} !== ${c}`)}};e.default=n}),ly=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=Ni(),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:c,$data:a,schema:u,schemaCode:l,it:f}=s;if(!a&&u.length===0)throw Error("enum must have non-empty array");let m=u.length>=f.opts.loopEnum,v,g=()=>v!==null&&v!==void 0?v:v=(0,r.useFunc)(i,o.default),b;if(m||a)b=i.let("valid"),s.block$data(b,R);else{if(!Array.isArray(u))throw Error("ajv implementation error");let T=i.const("vSchema",l);b=(0,t.or)(...u.map((w,E)=>p(T,E)))}s.pass(b);function R(){i.assign(b,!1),i.forOf("v",l,(T)=>i.if(t._`${g()}(${c}, ${T})`,()=>i.assign(b,!0).break()))}function p(T,w){let E=u[w];return typeof E==="object"&&E!==null?t._`${g()}(${c}, ${T}[${w}])`:t._`${c} === ${E}`}}};e.default=n}),$f=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ey(),r=ty(),o=oy(),n=ny(),s=sy(),i=iy(),c=ay(),a=cy(),u=uy(),l=ly(),f=[t.default,r.default,o.default,n.default,s.default,i.default,c.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=f}),Rf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=ue(),r=me(),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:c}=s,{items:a}=i;if(!Array.isArray(a)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,a)}};function n(s,i){let{gen:c,schema:a,data:u,keyword:l,it:f}=s;f.items=!0;let m=c.const("len",t._`${u}.length`);if(a===!1)s.setParams({len:i.length}),s.pass(t._`${m} <= ${i.length}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(f,a)){let g=c.var("valid",t._`${m} <= ${i.length}`);c.if((0,t.not)(g),()=>v(g)),s.ok(g)}function v(g){c.forRange("i",i.length,m,(b)=>{if(s.subschema({keyword:l,dataProp:b,dataPropType:r.Type.Num},g),!f.allErrors)c.if((0,t.not)(g),()=>c.break())})}}e.validateAdditionalItems=n,e.default=o}),zf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=ue(),r=me(),o=ot(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:c,it:a}=i;if(Array.isArray(c))return s(i,"additionalItems",c);if(a.items=!0,(0,r.alwaysValidSchema)(a,c))return;i.ok((0,o.validateArray)(i))}};function s(i,c,a=i.schema){let{gen:u,parentSchema:l,data:f,keyword:m,it:v}=i;if(R(l),v.opts.unevaluated&&a.length&&v.items!==!0)v.items=r.mergeEvaluated.items(u,a.length,v.items);let g=u.name("valid"),b=u.const("len",t._`${f}.length`);a.forEach((p,T)=>{if((0,r.alwaysValidSchema)(v,p))return;u.if(t._`${b} > ${T}`,()=>i.subschema({keyword:m,schemaProp:T,dataProp:T},g)),i.ok(g)});function R(p){let{opts:T,errSchemaPath:w}=v,E=a.length,N=E===p.minItems&&(E===p.maxItems||p[c]===!1);if(T.strictTuples&&!N){let z=`"${m}" is ${E}-tuple, but minItems or maxItems/${c} are not specified or different at path "${w}"`;(0,r.checkStrictMode)(v,z,T.strictTuples)}}}e.validateTuple=s,e.default=n}),dy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zf(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),fy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=ot(),n=Rf(),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:c,parentSchema:a,it:u}=i,{prefixItems:l}=a;if(u.items=!0,(0,r.alwaysValidSchema)(u,c))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),hy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,data:a,it:u}=n,l,f,{minContains:m,maxContains:v}=c;if(u.opts.next)l=m===void 0?1:m,f=v;else l=1;let g=s.const("len",t._`${a}.length`);if(n.setParams({min:l,max:f}),f===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&l>f){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let w=t._`${g} >= ${l}`;if(f!==void 0)w=t._`${w} && ${g} <= ${f}`;n.pass(w);return}u.items=!0;let b=s.name("valid");if(f===void 0&&l===1)p(b,()=>s.if(b,()=>s.break()));else if(l===0){if(s.let(b,!0),f!==void 0)s.if(t._`${a}.length > 0`,R)}else s.let(b,!1),R();n.result(b,()=>n.reset());function R(){let w=s.name("_valid"),E=s.let("count",0);p(w,()=>s.if(w,()=>T(E)))}function p(w,E){s.forRange("i",0,g,(N)=>{n.subschema({keyword:"contains",dataProp:N,dataPropType:r.Type.Num,compositeRule:!0},w),E()})}function T(w){if(s.code(t._`${w}++`),f===void 0)s.if(t._`${w} >= ${l}`,()=>s.assign(b,!0).break());else if(s.if(t._`${w} > ${f}`,()=>s.assign(b,!1).break()),l===1)s.assign(b,!0);else s.if(t._`${w} >= ${l}`,()=>s.assign(b,!0))}}};e.default=o}),xi=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=ue(),r=me(),o=ot();e.error={message:({params:{property:a,depsCount:u,deps:l}})=>{let f=u===1?"property":"properties";return t.str`must have ${f} ${l} when property ${a} is present`},params:({params:{property:a,depsCount:u,deps:l,missingProperty:f}})=>t._`{property: ${a},
|
|
66
|
+
|| ${q} === "boolean" || ${_} === null`).assign(F,n._`[${_}]`)}}}function v({gen:w,parentData:E,parentDataProperty:N},z){w.if(n._`${E} !== undefined`,()=>w.assign(n._`${E}[${N}]`,z))}function g(w,E,N,z=i.Correct){let _=z===i.Correct?n.operators.EQ:n.operators.NEQ,C;switch(w){case"null":return n._`${E} ${_} null`;case"array":C=n._`Array.isArray(${E})`;break;case"object":C=n._`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":C=q(n._`!(${E} % 1) && !isNaN(${E})`);break;case"number":C=q();break;default:return n._`typeof ${E} ${_} ${w}`}return z===i.Correct?C:(0,n.not)(C);function q(F=n.nil){return(0,n.and)(n._`typeof ${E} == "number"`,F,N?n._`isFinite(${E})`:n.nil)}}e.checkDataType=g;function b(w,E,N,z){if(w.length===1)return g(w[0],E,N,z);let _,C=(0,s.toHash)(w);if(C.array&&C.object){let q=n._`typeof ${E} != "object"`;_=C.null?q:n._`!${E} || ${q}`,delete C.null,delete C.array,delete C.object}else _=n.nil;if(C.number)delete C.integer;for(let q in C)_=(0,n.and)(_,g(q,E,N,z));return _}e.checkDataTypes=b;let R={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:E})=>typeof w=="string"?n._`{type: ${w}}`:n._`{type: ${E}}`};function p(w){let E=T(w);(0,o.reportError)(E,R)}e.reportTypeError=p;function T(w){let{gen:E,data:N,schema:z}=w,_=(0,s.schemaRefOrVal)(w,z,"type");return{gen:E,keyword:"type",data:N,schema:z.type,schemaCode:_,schemaValue:_,parentSchema:z,params:{},it:w}}}),d_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=ue(),r=me();function o(s,i){let{properties:c,items:a}=s.schema;if(i==="object"&&c)for(let u in c)n(s,u,c[u].default);else if(i==="array"&&Array.isArray(a))a.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,c){let{gen:a,compositeRule:u,data:l,opts:f}=s;if(c===void 0)return;let m=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let v=t._`${m} === undefined`;if(f.useDefaults==="empty")v=t._`${v} || ${m} === null || ${m} === ""`;a.if(v,t._`${m} = ${(0,t.stringify)(c)}`)}}),ot=V((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=ue(),r=me(),o=rt(),n=me();function s(w,E){let{gen:N,data:z,it:_}=w;N.if(f(N,z,E,_.opts.ownProperties),()=>{w.setParams({missingProperty:t._`${E}`},!0),w.error()})}e.checkReportMissingProp=s;function i({gen:w,data:E,it:{opts:N}},z,_){return(0,t.or)(...z.map((C)=>(0,t.and)(f(w,E,C,N.ownProperties),t._`${_} = ${C}`)))}e.checkMissingProp=i;function c(w,E){w.setParams({missingProperty:E},!0),w.error()}e.reportMissingProp=c;function a(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(w,E,N){return t._`${a(w)}.call(${E}, ${N})`}e.isOwnProperty=u;function l(w,E,N,z){let _=t._`${E}${(0,t.getProperty)(N)} !== undefined`;return z?t._`${_} && ${u(w,E,N)}`:_}e.propertyInData=l;function f(w,E,N,z){let _=t._`${E}${(0,t.getProperty)(N)} === undefined`;return z?(0,t.or)(_,(0,t.not)(u(w,E,N))):_}e.noPropertyInData=f;function m(w){return w?Object.keys(w).filter((E)=>E!=="__proto__"):[]}e.allSchemaProperties=m;function v(w,E){return m(E).filter((N)=>!(0,r.alwaysValidSchema)(w,E[N]))}e.schemaProperties=v;function g({schemaCode:w,data:E,it:{gen:N,topSchemaRef:z,schemaPath:_,errorPath:C},it:q},F,j,Z){let G=Z?t._`${w}, ${E}, ${z}${_}`:E,K=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,C)],[o.default.parentData,q.parentData],[o.default.parentDataProperty,q.parentDataProperty],[o.default.rootData,o.default.rootData]];if(q.opts.dynamicRef)K.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ie=t._`${G}, ${N.object(...K)}`;return j!==t.nil?t._`${F}.call(${j}, ${ie})`:t._`${F}(${ie})`}e.callValidateCode=g;let b=t._`new RegExp`;function R({gen:w,it:{opts:E}},N){let z=E.unicodeRegExp?"u":"",{regExp:_}=E.code,C=_(N,z);return w.scopeValue("pattern",{key:C.toString(),ref:C,code:t._`${_.code==="new RegExp"?b:(0,n.useFunc)(w,_)}(${N}, ${z})`})}e.usePattern=R;function p(w){let{gen:E,data:N,keyword:z,it:_}=w,C=E.name("valid");if(_.allErrors){let F=E.let("valid",!0);return q(()=>E.assign(F,!1)),F}return E.var(C,!0),q(()=>E.break()),C;function q(F){let j=E.const("len",t._`${N}.length`);E.forRange("i",0,j,(Z)=>{w.subschema({keyword:z,dataProp:Z,dataPropType:r.Type.Num},C),E.if((0,t.not)(C),F)})}}e.validateArray=p;function T(w){let{gen:E,schema:N,keyword:z,it:_}=w;if(!Array.isArray(N))throw Error("ajv implementation error");if(N.some((F)=>(0,r.alwaysValidSchema)(_,F))&&!_.opts.unevaluated)return;let C=E.let("valid",!1),q=E.name("_valid");E.block(()=>N.forEach((F,j)=>{let Z=w.subschema({keyword:z,schemaProp:j,compositeRule:!0},q);if(E.assign(C,t._`${C} || ${q}`),!w.mergeValidEvaluated(Z,q))E.if((0,t.not)(C))})),w.result(C,()=>w.reset(),()=>w.error(!0))}e.validateUnion=T}),f_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=ue(),r=rt(),o=ot(),n=Tn();function s(v,g){let{gen:b,keyword:R,schema:p,parentSchema:T,it:w}=v,E=g.macro.call(w.self,p,T,w),N=l(b,R,E);if(w.opts.validateSchema!==!1)w.self.validateSchema(E,!0);let z=b.name("valid");v.subschema({schema:E,schemaPath:t.nil,errSchemaPath:`${w.errSchemaPath}/${R}`,topSchemaRef:N,compositeRule:!0},z),v.pass(z,()=>v.error(!0))}e.macroKeywordCode=s;function i(v,g){var b;let{gen:R,keyword:p,schema:T,parentSchema:w,$data:E,it:N}=v;u(N,g);let z=l(R,p,!E&&g.compile?g.compile.call(N.self,T,w,N):g.validate),_=R.let("valid");v.block$data(_,C),v.ok((b=g.valid)!==null&&b!==void 0?b:_);function C(){if(g.errors===!1){if(j(),g.modifying)c(v);Z(()=>v.error())}else{let G=g.async?q():F();if(g.modifying)c(v);Z(()=>a(v,G))}}function q(){let G=R.let("ruleErrs",null);return R.try(()=>j(t._`await `),(K)=>R.assign(_,!1).if(t._`${K} instanceof ${N.ValidationError}`,()=>R.assign(G,t._`${K}.errors`),()=>R.throw(K))),G}function F(){let G=t._`${z}.errors`;return R.assign(G,null),j(t.nil),G}function j(G=g.async?t._`await `:t.nil){let K=N.opts.passContext?r.default.this:r.default.self,ie=!(("compile"in g)&&!E||g.schema===!1);R.assign(_,t._`${G}${(0,o.callValidateCode)(v,z,K,ie)}`,g.modifying)}function Z(G){var K;R.if((0,t.not)((K=g.valid)!==null&&K!==void 0?K:_),G)}}e.funcKeywordCode=i;function c(v){let{gen:g,data:b,it:R}=v;g.if(R.parentData,()=>g.assign(b,t._`${R.parentData}[${R.parentDataProperty}]`))}function a(v,g){let{gen:b}=v;b.if(t._`Array.isArray(${g})`,()=>{b.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${g} : ${r.default.vErrors}.concat(${g})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(v)},()=>v.error())}function u({schemaEnv:v},g){if(g.async&&!v.$async)throw Error("async keyword in sync schema")}function l(v,g,b){if(b===void 0)throw Error(`keyword "${g}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function f(v,g,b=!1){return!g.length||g.some((R)=>R==="array"?Array.isArray(v):R==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==R||b&&typeof v>"u")}e.validSchemaType=f;function m({schema:v,opts:g,self:b,errSchemaPath:R},p,T){if(Array.isArray(p.keyword)?!p.keyword.includes(T):p.keyword!==T)throw Error("ajv implementation error");let w=p.dependencies;if(w===null||w===void 0?void 0:w.some((E)=>!Object.prototype.hasOwnProperty.call(v,E)))throw Error(`parent schema must have dependencies of ${T}: ${w.join(",")}`);if(p.validateSchema){if(!p.validateSchema(v[T])){let E=`keyword "${T}" value is invalid at path "${R}": `+b.errorsText(p.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(E);else throw Error(E)}}}e.validateKeywordUsage=m}),h_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=ue(),r=me();function o(i,{keyword:c,schemaProp:a,schema:u,schemaPath:l,errSchemaPath:f,topSchemaRef:m}){if(c!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){let v=i.schema[c];return a===void 0?{schema:v,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${c}`}:{schema:v[a],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(c)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${c}/${(0,r.escapeFragment)(a)}`}}if(u!==void 0){if(l===void 0||f===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:m,errSchemaPath:f}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,c,{dataProp:a,dataPropType:u,data:l,dataTypes:f,propertyName:m}){if(l!==void 0&&a!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:v}=c;if(a!==void 0){let{errorPath:b,dataPathArr:R,opts:p}=c;g(v.let("data",t._`${c.data}${(0,t.getProperty)(a)}`,!0)),i.errorPath=t.str`${b}${(0,r.getErrorPath)(a,u,p.jsPropertySyntax)}`,i.parentDataProperty=t._`${a}`,i.dataPathArr=[...R,i.parentDataProperty]}if(l!==void 0){if(g(l instanceof t.Name?l:v.let("data",l,!0)),m!==void 0)i.propertyName=m}if(f)i.dataTypes=f;function g(b){i.data=b,i.dataLevel=c.dataLevel+1,i.dataTypes=[],c.definedProperties=new Set,i.parentData=c.data,i.dataNames=[...c.dataNames,b]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:c,jtdMetadata:a,compositeRule:u,createErrors:l,allErrors:f}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(f!==void 0)i.allErrors=f;i.jtdDiscriminator=c,i.jtdMetadata=a}e.extendSubschemaMode=s}),vf=V((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,c;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(c=Object.keys(o),s=c.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[i]))return!1;for(i=s;i--!==0;){var a=c[i];if(!r(o[a],n[a]))return!1}return!0}return o!==o&&n!==n}}),p_=V((e,t)=>{var r=t.exports=function(s,i,c){if(typeof i=="function")c=i,i={};c=i.cb||c;var a=typeof c=="function"?c:c.pre||function(){},u=c.post||function(){};o(i,a,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,c,a,u,l,f,m,v,g){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,u,l,f,m,v,g);for(var b in a){var R=a[b];if(Array.isArray(R)){if(b in r.arrayKeywords)for(var p=0;p<R.length;p++)o(s,i,c,R[p],u+"/"+b+"/"+p,l,u,b,a,p)}else if(b in r.propsKeywords){if(R&&typeof R=="object")for(var T in R)o(s,i,c,R[T],u+"/"+b+"/"+n(T),l,u,b,a,T)}else if(b in r.keywords||s.allKeys&&!(b in r.skipKeywords))o(s,i,c,R,u+"/"+b,l,u,b,a)}c(a,u,l,f,m,v,g)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),kn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=me(),r=vf(),o=p_(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(R,p=!0){if(typeof R=="boolean")return!0;if(p===!0)return!c(R);if(!p)return!1;return a(R)<=p}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(R){for(let p in R){if(i.has(p))return!0;let T=R[p];if(Array.isArray(T)&&T.some(c))return!0;if(typeof T=="object"&&c(T))return!0}return!1}function a(R){let p=0;for(let T in R){if(T==="$ref")return 1/0;if(p++,n.has(T))continue;if(typeof R[T]=="object")(0,t.eachItem)(R[T],(w)=>p+=a(w));if(p===1/0)return 1/0}return p}function u(R,p="",T){if(T!==!1)p=m(p);return l(R,R.parse(p))}e.getFullPath=u;function l(R,p){return R.serialize(p).split("#")[0]+"#"}e._getFullPath=l;let f=/#\/?$/;function m(R){return R?R.replace(f,""):""}e.normalizeId=m;function v(R,p,T){return T=m(T),R.resolve(p,T)}e.resolveUrl=v;let g=/^[a-z_][-a-z0-9._]*$/i;function b(R,p){if(typeof R=="boolean")return{};let{schemaId:T,uriResolver:w}=this.opts,E=m(R[T]||p),N={"":E},z=u(w,E,!1),_={},C=new Set;return o(R,{allKeys:!0},(j,Z,G,K)=>{if(K===void 0)return;let ie=z+Z,Se=N[K];if(typeof j[T]=="string")Se=ve.call(this,j[T]);Pe.call(this,j.$anchor),Pe.call(this,j.$dynamicAnchor),N[Z]=Se;function ve(le){let O=this.opts.uriResolver.resolve;if(le=m(Se?O(Se,le):le),C.has(le))throw F(le);C.add(le);let x=this.refs[le];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")q(j,x.schema,le);else if(le!==m(ie))if(le[0]==="#")q(j,_[le],le),_[le]=j;else this.refs[le]=ie;return le}function Pe(le){if(typeof le=="string"){if(!g.test(le))throw Error(`invalid anchor "${le}"`);ve.call(this,`#${le}`)}}}),_;function q(j,Z,G){if(Z!==void 0&&!r(j,Z))throw F(G)}function F(j){return Error(`reference "${j}" resolves to more than one schema`)}}e.getSchemaRefs=b}),nr=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=l_(),r=En(),o=yf(),n=En(),s=d_(),i=f_(),c=h_(),a=ue(),u=rt(),l=kn(),f=me(),m=Tn();function v(k){if(z(k)){if(C(k),N(k)){p(k);return}}g(k,()=>(0,t.topBoolOrEmptySchema)(k))}e.validateFunctionCode=v;function g({gen:k,validateName:A,schema:U,schemaEnv:Y,opts:te},oe){if(te.code.es5)k.func(A,a._`${u.default.data}, ${u.default.valCxt}`,Y.$async,()=>{k.code(a._`"use strict"; ${w(U,te)}`),R(k,te),k.code(oe)});else k.func(A,a._`${u.default.data}, ${b(te)}`,Y.$async,()=>k.code(w(U,te)).code(oe))}function b(k){return a._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?a._`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function R(k,A){k.if(u.default.valCxt,()=>{if(k.var(u.default.instancePath,a._`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,a._`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,a._`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,a._`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef)k.var(u.default.dynamicAnchors,a._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(k.var(u.default.instancePath,a._`""`),k.var(u.default.parentData,a._`undefined`),k.var(u.default.parentDataProperty,a._`undefined`),k.var(u.default.rootData,u.default.data),A.dynamicRef)k.var(u.default.dynamicAnchors,a._`{}`)})}function p(k){let{schema:A,opts:U,gen:Y}=k;g(k,()=>{if(U.$comment&&A.$comment)K(k);if(j(k),Y.let(u.default.vErrors,null),Y.let(u.default.errors,0),U.unevaluated)T(k);q(k),ie(k)})}function T(k){let{gen:A,validateName:U}=k;k.evaluated=A.const("evaluated",a._`${U}.evaluated`),A.if(a._`${k.evaluated}.dynamicProps`,()=>A.assign(a._`${k.evaluated}.props`,a._`undefined`)),A.if(a._`${k.evaluated}.dynamicItems`,()=>A.assign(a._`${k.evaluated}.items`,a._`undefined`))}function w(k,A){let U=typeof k=="object"&&k[A.schemaId];return U&&(A.code.source||A.code.process)?a._`/*# sourceURL=${U} */`:a.nil}function E(k,A){if(z(k)){if(C(k),N(k)){_(k,A);return}}(0,t.boolOrEmptySchema)(k,A)}function N({schema:k,self:A}){if(typeof k=="boolean")return!k;for(let U in k)if(A.RULES.all[U])return!0;return!1}function z(k){return typeof k.schema!="boolean"}function _(k,A){let{schema:U,gen:Y,opts:te}=k;if(te.$comment&&U.$comment)K(k);Z(k),G(k);let oe=Y.const("_errs",u.default.errors);q(k,oe),Y.var(A,a._`${oe} === ${u.default.errors}`)}function C(k){(0,f.checkUnknownRules)(k),F(k)}function q(k,A){if(k.opts.jtd)return ve(k,[],!1,A);let U=(0,r.getSchemaTypes)(k.schema);ve(k,U,!(0,r.coerceAndCheckDataType)(k,U),A)}function F(k){let{schema:A,errSchemaPath:U,opts:Y,self:te}=k;if(A.$ref&&Y.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(A,te.RULES))te.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function j(k){let{schema:A,opts:U}=k;if(A.default!==void 0&&U.useDefaults&&U.strictSchema)(0,f.checkStrictMode)(k,"default is ignored in the schema root")}function Z(k){let A=k.schema[k.opts.schemaId];if(A)k.baseId=(0,l.resolveUrl)(k.opts.uriResolver,k.baseId,A)}function G(k){if(k.schema.$async&&!k.schemaEnv.$async)throw Error("async schema in sync schema")}function K({gen:k,schemaEnv:A,schema:U,errSchemaPath:Y,opts:te}){let oe=U.$comment;if(te.$comment===!0)k.code(a._`${u.default.self}.logger.log(${oe})`);else if(typeof te.$comment=="function"){let pe=a.str`${Y}/$comment`,Ce=k.scopeValue("root",{ref:A.root});k.code(a._`${u.default.self}.opts.$comment(${oe}, ${pe}, ${Ce}.schema)`)}}function ie(k){let{gen:A,schemaEnv:U,validateName:Y,ValidationError:te,opts:oe}=k;if(U.$async)A.if(a._`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw(a._`new ${te}(${u.default.vErrors})`));else{if(A.assign(a._`${Y}.errors`,u.default.vErrors),oe.unevaluated)Se(k);A.return(a._`${u.default.errors} === 0`)}}function Se({gen:k,evaluated:A,props:U,items:Y}){if(U instanceof a.Name)k.assign(a._`${A}.props`,U);if(Y instanceof a.Name)k.assign(a._`${A}.items`,Y)}function ve(k,A,U,Y){let{gen:te,schema:oe,data:pe,allErrors:Ce,opts:$e,self:Oe}=k,{RULES:Ee}=Oe;if(oe.$ref&&($e.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(oe,Ee))){te.block(()=>B(k,"$ref",Ee.all.$ref.definition));return}if(!$e.jtd)le(k,A);te.block(()=>{for(let xe of Ee.rules)Ye(xe);Ye(Ee.post)});function Ye(xe){if(!(0,o.shouldUseGroup)(oe,xe))return;if(xe.type){if(te.if((0,n.checkDataType)(xe.type,pe,$e.strictNumbers)),Pe(k,xe),A.length===1&&A[0]===xe.type&&U)te.else(),(0,n.reportTypeError)(k);te.endIf()}else Pe(k,xe);if(!Ce)te.if(a._`${u.default.errors} === ${Y||0}`)}}function Pe(k,A){let{gen:U,schema:Y,opts:{useDefaults:te}}=k;if(te)(0,s.assignDefaults)(k,A.type);U.block(()=>{for(let oe of A.rules)if((0,o.shouldUseRule)(Y,oe))B(k,oe.keyword,oe.definition,A.type)})}function le(k,A){if(k.schemaEnv.meta||!k.opts.strictTypes)return;if(O(k,A),!k.opts.allowUnionTypes)x(k,A);y(k,k.dataTypes)}function O(k,A){if(!A.length)return;if(!k.dataTypes.length){k.dataTypes=A;return}A.forEach((U)=>{if(!h(k.dataTypes,U))I(k,`type "${U}" not allowed by context "${k.dataTypes.join(",")}"`)}),S(k,A)}function x(k,A){if(A.length>1&&!(A.length===2&&A.includes("null")))I(k,"use allowUnionTypes to allow union type keyword")}function y(k,A){let U=k.self.RULES.all;for(let Y in U){let te=U[Y];if(typeof te=="object"&&(0,o.shouldUseRule)(k.schema,te)){let{type:oe}=te.definition;if(oe.length&&!oe.some((pe)=>d(A,pe)))I(k,`missing type "${oe.join(",")}" for keyword "${Y}"`)}}}function d(k,A){return k.includes(A)||A==="number"&&k.includes("integer")}function h(k,A){return k.includes(A)||A==="integer"&&k.includes("number")}function S(k,A){let U=[];for(let Y of k.dataTypes)if(h(A,Y))U.push(Y);else if(A.includes("integer")&&Y==="number")U.push("integer");k.dataTypes=U}function I(k,A){let U=k.schemaEnv.baseId+k.errSchemaPath;A+=` at "${U}" (strictTypes)`,(0,f.checkStrictMode)(k,A,k.opts.strictTypes)}var D=class{constructor(k,A,U){if((0,i.validateKeywordUsage)(k,A,U),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=U,this.data=k.data,this.schema=k.schema[U],this.$data=A.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(k,this.schema,U,this.$data),this.schemaType=A.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=A,this.$data)this.schemaCode=k.gen.const("vSchema",we(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw Error(`${U} value must be ${JSON.stringify(A.schemaType)}`);if("code"in A?A.trackErrors:A.errors!==!1)this.errsCount=k.gen.const("_errs",u.default.errors)}result(k,A,U){this.failResult((0,a.not)(k),A,U)}failResult(k,A,U){if(this.gen.if(k),U)U();else this.error();if(A){if(this.gen.else(),A(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(k,A){this.failResult((0,a.not)(k),void 0,A)}fail(k){if(k===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(k),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);let{schemaCode:A}=this;this.fail(a._`${A} !== undefined && (${(0,a.or)(this.invalid$data(),k)})`)}error(k,A,U){if(A){this.setParams(A),this._error(k,U),this.setParams({});return}this._error(k,U)}_error(k,A){(k?m.reportExtraError:m.reportError)(this,this.def.error,A)}$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(k){if(!this.allErrors)this.gen.if(k)}setParams(k,A){if(A)Object.assign(this.params,k);else this.params=k}block$data(k,A,U=a.nil){this.gen.block(()=>{this.check$data(k,U),A()})}check$data(k=a.nil,A=a.nil){if(!this.$data)return;let{gen:U,schemaCode:Y,schemaType:te,def:oe}=this;if(U.if((0,a.or)(a._`${Y} === undefined`,A)),k!==a.nil)U.assign(k,!0);if(te.length||oe.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),k!==a.nil)U.assign(k,!1)}U.else()}invalid$data(){let{gen:k,schemaCode:A,schemaType:U,def:Y,it:te}=this;return(0,a.or)(oe(),pe());function oe(){if(U.length){if(!(A instanceof a.Name))throw Error("ajv implementation error");let Ce=Array.isArray(U)?U:[U];return a._`${(0,n.checkDataTypes)(Ce,A,te.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function pe(){if(Y.validateSchema){let Ce=k.scopeValue("validate$data",{ref:Y.validateSchema});return a._`!${Ce}(${A})`}return a.nil}}subschema(k,A){let U=(0,c.getSubschema)(this.it,k);(0,c.extendSubschemaData)(U,this.it,k),(0,c.extendSubschemaMode)(U,k);let Y={...this.it,...U,items:void 0,props:void 0};return E(Y,A),Y}mergeEvaluated(k,A){let{it:U,gen:Y}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&k.props!==void 0)U.props=f.mergeEvaluated.props(Y,k.props,U.props,A);if(U.items!==!0&&k.items!==void 0)U.items=f.mergeEvaluated.items(Y,k.items,U.items,A)}mergeValidEvaluated(k,A){let{it:U,gen:Y}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return Y.if(A,()=>this.mergeEvaluated(k,a.Name)),!0}};e.KeywordCxt=D;function B(k,A,U,Y){let te=new D(k,U,A);if("code"in U)U.code(te,Y);else if(te.$data&&U.validate)(0,i.funcKeywordCode)(te,U);else if("macro"in U)(0,i.macroKeywordCode)(te,U);else if(U.compile||U.validate)(0,i.funcKeywordCode)(te,U)}let J=/^\/(?:[^~]|~0|~1)*$/,ce=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function we(k,{dataLevel:A,dataNames:U,dataPathArr:Y}){let te,oe;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!J.test(k))throw Error(`Invalid JSON-pointer: ${k}`);te=k,oe=u.default.rootData}else{let Oe=ce.exec(k);if(!Oe)throw Error(`Invalid JSON-pointer: ${k}`);let Ee=+Oe[1];if(te=Oe[2],te==="#"){if(Ee>=A)throw Error($e("property/index",Ee));return Y[A-Ee]}if(Ee>A)throw Error($e("data",Ee));if(oe=U[A-Ee],!te)return oe}let pe=oe,Ce=te.split("/");for(let Oe of Ce)if(Oe)oe=a._`${oe}${(0,a.getProperty)((0,f.unescapeJsonPointer)(Oe))}`,pe=a._`${pe} && ${oe}`;return pe;function $e(Oe,Ee){return`Cannot access ${Oe} ${Ee} levels up, current level is ${A}`}}e.getData=we}),po=V((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}),sr=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=kn();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}),Cn=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=ue(),r=po(),o=rt(),n=kn(),s=me(),i=nr();var c=class{constructor(p){var T;this.refs={},this.dynamicAnchors={};let w;if(typeof p.schema=="object")w=p.schema;this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(T=p.baseId)!==null&&T!==void 0?T:(0,n.normalizeId)(w===null||w===void 0?void 0:w[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};e.SchemaEnv=c;function a(p){let T=f.call(this,p);if(T)return T;let w=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:E,lines:N}=this.opts.code,{ownProperties:z}=this.opts,_=new t.CodeGen(this.scope,{es5:E,lines:N,ownProperties:z}),C;if(p.$async)C=_.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let q=_.scopeName("validate");p.validateName=q;let F={gen:_,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:_.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,t.stringify)(p.schema)}:{ref:p.schema}),validateName:q,ValidationError:C,schema:p.schema,schemaEnv:p,rootId:w,baseId:p.baseId||w,schemaPath:t.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},j;try{this._compilations.add(p),(0,i.validateFunctionCode)(F),_.optimize(this.opts.code.optimize);let Z=_.toString();if(j=`${_.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process)j=this.opts.code.process(j,p);let G=Function(`${o.default.self}`,`${o.default.scope}`,j)(this,this.scope.get());if(this.scope.value(q,{ref:G}),G.errors=null,G.schema=p.schema,G.schemaEnv=p,p.$async)G.$async=!0;if(this.opts.code.source===!0)G.source={validateName:q,validateCode:Z,scopeValues:_._values};if(this.opts.unevaluated){let{props:K,items:ie}=F;if(G.evaluated={props:K instanceof t.Name?void 0:K,items:ie instanceof t.Name?void 0:ie,dynamicProps:K instanceof t.Name,dynamicItems:ie instanceof t.Name},G.source)G.source.evaluated=(0,t.stringify)(G.evaluated)}return p.validate=G,p}catch(Z){if(delete p.validate,delete p.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw Z}finally{this._compilations.delete(p)}}e.compileSchema=a;function u(p,T,w){var E;w=(0,n.resolveUrl)(this.opts.uriResolver,T,w);let N=p.refs[w];if(N)return N;let z=v.call(this,p,w);if(z===void 0){let _=(E=p.localRefs)===null||E===void 0?void 0:E[w],{schemaId:C}=this.opts;if(_)z=new c({schema:_,schemaId:C,root:p,baseId:T})}if(z===void 0)return;return p.refs[w]=l.call(this,z)}e.resolveRef=u;function l(p){if((0,n.inlineRef)(p.schema,this.opts.inlineRefs))return p.schema;return p.validate?p:a.call(this,p)}function f(p){for(let T of this._compilations)if(m(T,p))return T}e.getCompilingSchema=f;function m(p,T){return p.schema===T.schema&&p.root===T.root&&p.baseId===T.baseId}function v(p,T){let w;while(typeof(w=this.refs[T])=="string")T=w;return w||this.schemas[T]||g.call(this,p,T)}function g(p,T){let w=this.opts.uriResolver.parse(T),E=(0,n._getFullPath)(this.opts.uriResolver,w),N=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&E===N)return R.call(this,w,p);let z=(0,n.normalizeId)(E),_=this.refs[z]||this.schemas[z];if(typeof _=="string"){let C=g.call(this,p,_);if(typeof(C===null||C===void 0?void 0:C.schema)!=="object")return;return R.call(this,w,C)}if(typeof(_===null||_===void 0?void 0:_.schema)!=="object")return;if(!_.validate)a.call(this,_);if(z===(0,n.normalizeId)(T)){let{schema:C}=_,{schemaId:q}=this.opts,F=C[q];if(F)N=(0,n.resolveUrl)(this.opts.uriResolver,N,F);return new c({schema:C,schemaId:q,root:p,baseId:N})}return R.call(this,w,_)}e.resolveSchema=g;let b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function R(p,{baseId:T,schema:w,root:E}){var N;if(((N=p.fragment)===null||N===void 0?void 0:N[0])!=="/")return;for(let C of p.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let q=w[(0,s.unescapeFragment)(C)];if(q===void 0)return;w=q;let F=typeof w==="object"&&w[this.opts.schemaId];if(!b.has(C)&&F)T=(0,n.resolveUrl)(this.opts.uriResolver,T,F)}let z;if(typeof w!="boolean"&&w.$ref&&!(0,s.schemaHasRulesButRef)(w,this.RULES)){let C=(0,n.resolveUrl)(this.opts.uriResolver,T,w.$ref);z=g.call(this,E,C)}let{schemaId:_}=this.opts;if(z=z||new c({schema:w,schemaId:_,root:E,baseId:T}),z.schema!==z.root.schema)return z}}),m_=V((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}}),Sf=V((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),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),u=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),l=Array(256);for(let d=0;d<256;d++)l[d]="%"+"0123456789ABCDEF"[d>>4]+"0123456789ABCDEF"[d&15];function f(y){if(y<2048)return l[192|y>>6]+l[128|y&63];if(y<65536)return l[224|y>>12]+l[128|y>>6&63]+l[128|y&63];return l[240|y>>18]+l[128|y>>12&63]+l[128|y>>6&63]+l[128|y&63]}function m(y){let d="",h=0,S=0;for(S=0;S<y.length;S++){if(h=y[S].charCodeAt(0),h===48)continue;if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";d+=y[S];break}for(S+=1;S<y.length;S++){if(h=y[S].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";d+=y[S]}return d}let v=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),g=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),b=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),R=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function p(y){if(y.length===0)return!1;for(let d=0;d<y.length;d++){if(b(y[d]))continue;if(y[d]==="%"&&d+2<y.length&&s(y.slice(d+1,d+3))){d+=2;continue}return!1}return!0}function T(y){let d=-1,h=0,S=-1,I=0;for(let J=0;J<y.length;J++)if(y[J]==="0"){if(S===-1)S=J;if(I++,I>h)h=I,d=S}else S=-1,I=0;if(h<2)return y.join(":");let D=y.slice(0,d).join(":"),B=y.slice(d+h).join(":");return D+"::"+B}function w(y){let d=y.indexOf("::");if(d!==-1&&y.indexOf("::",d+1)!==-1)return;let h=d===-1?y.split(":"):y.slice(0,d).split(":"),S=d===-1?[]:y.slice(d+2).split(":");if(d!==-1){if(h.length===1&&h[0]==="")h.length=0;if(S.length===1&&S[0]==="")S.length=0}let I=h.concat(S),D=0;for(let J=0;J<I.length;J++){let ce=I[J];if(ce==="")return;if(ce.indexOf(".")!==-1){if(J!==I.length-1||d!==-1&&S.length===0||!o(ce))return;D+=2;continue}if(!v(ce))return;I[J]=parseInt(ce,16).toString(16),D++}if(d===-1){if(D!==8)return;return T(I)}if(D>=8)return;let B=I.slice(0,h.length);for(let J=D;J<8;J++)B.push("0");for(let J=h.length;J<I.length;J++)B.push(I[J]);return T(B)}function E(y){let d=y[0]==="["&&y[y.length-1]==="]";if((y[0]==="["||y[y.length-1]==="]")&&!d)return{host:y,isIPV6:!1,error:!0};let h=d?y.slice(1,-1):y;if(d&&g(h))return h=h.toLowerCase(),{host:`[${h}]`,escapedHost:h,isIPV6:!1,isIPVFuture:!0};if(N(h,":")<2)return{host:y,isIPV6:!1,error:d};let S="",I=h.indexOf("%");if(I!==-1){let B=h.slice(I,I+3).toLowerCase()==="%25"?3:1;if(S=h.slice(I+B),!p(S))return{host:y,isIPV6:!1,error:!0};h=h.slice(0,I)}let D=w(h);if(D===void 0)return{host:y,isIPV6:!1,error:!0};return{host:D+(S?"%"+S:""),escapedHost:D+(S?"%25"+S:""),isIPV6:!0}}function N(y,d){let h=0;for(let S=0;S<y.length;S++)if(y[S]===d)h++;return h}function z(y){let d=y,h=[],S=-1,I=0;while(I=d.length){if(I===1)if(d===".")break;else if(d==="/"){h.push("/");break}else{h.push(d);break}else if(I===2){if(d[0]==="."){if(d[1]===".")break;else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"){if(d[1]==="."||d[1]==="/"){h.push("/");break}}}else if(I===3){if(d==="/.."){if(h.length!==0)h.pop();h.push("/");break}}if(d[0]==="."){if(d[1]==="."){if(d[2]==="/"){d=d.slice(3);continue}}else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"){if(d[1]==="."){if(d[2]==="/"){d=d.slice(2);continue}else if(d[2]==="."){if(d[3]==="/"){if(d=d.slice(3),h.length!==0)h.pop();continue}}}}if((S=d.indexOf("/",1))===-1){h.push(d);break}else h.push(d.slice(0,S)),d=d.slice(S)}return h.join("")}let _={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},C=/[@/?#:]/g,q=/[@/?#]/g;function F(y,d){let h=d?q:C;return h.lastIndex=0,y.replace(h,(S)=>_[S])}function j(y,d=!1){if(y.indexOf("%")===-1)return y;let h="";for(let S=0;S<y.length;S++){if(y[S]==="%"&&S+2<y.length){let I=y.slice(S+1,S+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(d&&i(B))h+=B;else h+="%"+D;S+=2;continue}}h+=y[S]}return h}function Z(y){let d="";for(let h=0;h<y.length;h++){let S=y[h];if(S==="%"&&h+2<y.length){let I=y.slice(h+1,h+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(B!=="."&&i(B))d+=B;else d+="%"+D;h+=2;continue}}if(c(S))d+=S;else{let I=y.charCodeAt(h);if(I<128)d+=Pe(I)?S:l[I];else if(I<55296||I>57343)d+=f(I);else if(I<=56319&&h+1<y.length){let D=y.charCodeAt(h+1);if(D>=56320&&D<=57343)d+=f(65536+(I-55296<<10)+(D-56320)),h++;else d+=f(65533)}else d+=f(65533)}}return d}function G(y,d=!1){let h="",S=d&&y[0]!=="/";for(let I=0;I<y.length;I++){let D=y[I];if(D==="%"&&I+2<y.length){let B=y.slice(I+1,I+3);if(s(B)){h+="%"+B.toUpperCase(),I+=2;continue}}if(D==="/")S=!1;if(c(D)&&(D!==":"||!S))h+=D;else{let B=y.charCodeAt(I);if(B<128)h+=l[B];else if(B<55296||B>57343)h+=f(B);else if(B<=56319&&I+1<y.length){let J=y.charCodeAt(I+1);if(J>=56320&&J<=57343)h+=f(65536+(B-55296<<10)+(J-56320)),I++;else h+=f(65533)}else h+=f(65533)}}return h}function K(y,d){let h="";for(let S=0;S<y.length;S++){let I=y[S];if(I==="%"&&S+2<y.length){let D=y.slice(S+1,S+3);if(s(D)){h+="%"+D.toUpperCase(),S+=2;continue}}if(d(I))h+=I;else{let D=y.charCodeAt(S);if(D<128)h+=l[D];else if(D<55296||D>57343)h+=f(D);else if(D<=56319&&S+1<y.length){let B=y.charCodeAt(S+1);if(B>=56320&&B<=57343)h+=f(65536+(D-55296<<10)+(B-56320)),S++;else h+=f(65533)}else h+=f(65533)}}return h}function ie(y){return K(y,u)}function Se(y){return K(y,a)}function ve(y){return K(y,a)}function Pe(y){return y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||y===42||y===43||y===45||y===46||y===47||y===64||y===95}function le(y){let d="";for(let h=0;h<y.length;h++){let S=y[h];if(S==="%"&&h+2<y.length){let I=y.slice(h+1,h+3);if(s(I)){let D=I.toUpperCase(),B=String.fromCharCode(parseInt(D,16));if(i(B))d+=B;else d+="%"+D;h+=2;continue}}if(a(S))d+=S;else{let I=y.charCodeAt(h);if(I<128)d+=Pe(I)?S:l[I];else if(I<55296||I>57343)d+=f(I);else if(I<=56319&&h+1<y.length){let D=y.charCodeAt(h+1);if(D>=56320&&D<=57343)d+=f(65536+(I-55296<<10)+(D-56320)),h++;else d+=f(65533)}else d+=f(65533)}}return d}function O(y){let d="";for(let h=0;h<y.length;h++){if(y[h]==="%"&&h+2<y.length){let S=y.slice(h+1,h+3);if(s(S)){d+="%"+S.toUpperCase(),h+=2;continue}}d+=escape(y[h])}return d}function x(y){let d=[];if(y.userinfo!==void 0)d.push(ie(y.userinfo)),d.push("@");if(y.host!==void 0){let h=y.host;if(!o(h)){let S=E(h);if(S.isIPV6!==!0&&S.isIPVFuture!==!0)h=j(h,!0),S=E(h);if(S.isIPV6===!0||S.isIPVFuture===!0)h=`[${S.escapedHost}]`;else h=F(h,!1)}d.push(h)}if(typeof y.port==="number"||typeof y.port==="string"){let h=String(y.port);if(!n(h))throw TypeError("URI port is malformed.");d.push(":"),d.push(h)}return d.length?d.join(""):void 0}t.exports={nonSimpleDomain:R,recomposeAuthority:x,reescapeHostDelimiters:F,normalizePercentEncoding:j,normalizePathEncoding:Z,serializePathEncoding:G,normalizeQueryFragmentEncoding:le,encodeUserinfo:ie,encodeQuery:Se,encodeFragment:ve,escapePreservingEscapes:O,removeDotSegments:z,isIPv4:o,isUUID:r,normalizeIPv6:E,stringArrayToHexStripped:m}}),g_=V((e,t)=>{let{isUUID:r}=Sf(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(_){return n.indexOf(_)!==-1}function i(_){if(_.secure===!0)return!0;else if(_.secure===!1)return!1;else if(_.scheme)return _.scheme.length===3&&(_.scheme[0]==="w"||_.scheme[0]==="W")&&(_.scheme[1]==="s"||_.scheme[1]==="S")&&(_.scheme[2]==="s"||_.scheme[2]==="S");else return!1}function c(_){if(!_.host)_.error=_.error||"HTTP URIs must have a host.";return _}function a(_){let C=String(_.scheme).toLowerCase()==="https";if(_.port===(C?443:80)||_.port==="")_.port=void 0;if(!_.path)_.path="/";return _}function u(_){return _.secure=i(_),_.resourceName=(_.path||"/")+(_.query?"?"+_.query:""),_.path=void 0,_.query=void 0,_}function l(_){if(_.port===(i(_)?443:80)||_.port==="")_.port=void 0;if(typeof _.secure==="boolean")_.scheme=_.secure?"wss":"ws",_.secure=void 0;if(_.resourceName){let C=_.resourceName.indexOf("?"),q=C===-1?_.resourceName:_.resourceName.slice(0,C);_.path=q&&q!=="/"?q:void 0,_.query=C===-1?void 0:_.resourceName.slice(C+1),_.resourceName=void 0}return _.fragment=void 0,_}function f(_,C){if(!_.path)return _.error="URN can not be parsed",_;let q=_.path.match(o);if(q&&q[0]===_.path){let F=C.scheme||_.scheme||"urn";_.nid=q[1].toLowerCase(),_.nss=q[2];let j=z(`${F}:${C.nid||_.nid}`);if(_.path=void 0,j)_=j.parse(_,C)}else _.error=_.error||"URN can not be parsed.";return _}function m(_,C){if(_.nid===void 0)throw Error("URN without nid cannot be serialized");let q=C.scheme||_.scheme||"urn",F=_.nid.toLowerCase(),j=z(`${q}:${C.nid||F}`);if(j)_=j.serialize(_,C);let Z=_,G=_.nss;return Z.path=`${F||C.nid}:${G}`,C.skipEscape=!0,Z}function v(_,C){let q=_;if(q.uuid=q.nss,q.nss=void 0,!C.tolerant&&(!q.uuid||!r(q.uuid)))q.error=q.error||"UUID is not valid.";return q}function g(_){let C=_;return C.nss=(_.uuid||"").toLowerCase(),C}let b={scheme:"http",domainHost:!0,parse:c,serialize:a},R={scheme:"https",domainHost:b.domainHost,parse:c,serialize:a},p={scheme:"ws",domainHost:!0,parse:u,serialize:l},T={scheme:"wss",domainHost:p.domainHost,parse:p.parse,serialize:p.serialize},N={http:b,https:R,ws:p,wss:T,urn:{scheme:"urn",parse:f,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(N,null);function z(_){return _&&(N[_]||N[_.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:N,isValidSchemeName:s,getSchemeHandler:z}}),__=V((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:s,normalizePathEncoding:i,serializePathEncoding:c,normalizeQueryFragmentEncoding:a,encodeQuery:u,encodeFragment:l,reescapeHostDelimiters:f,isIPv4:m,nonSimpleDomain:v}=Sf(),{SCHEMES:g,getSchemeHandler:b}=g_(),R=/^[A-Za-z][A-Za-z0-9+.-]*$/u,p="URI scheme is malformed.";function T(y){let d=unescape(String(y));if(!R.test(d))throw TypeError("URI scheme is malformed.");return d}function w(y,d){if(typeof y==="string")y=Pe(y,d);else if(typeof y==="object")y=ve(_(y,d),d);return y}function E(y,d,h){let S=h?Object.assign({scheme:"null"},h):{scheme:"null"},{parsed:I,malformedAuthorityOrPort:D,malformedPercentEncoding:B,malformedSchemeSpecific:J,malformedHost:ce,malformedScheme:we}=Se(y,S),{parsed:k,malformedAuthorityOrPort:A,malformedPercentEncoding:U,malformedSchemeSpecific:Y,malformedHost:te,malformedScheme:oe}=Se(d,S);if(D||A||B||U||J||Y||ce||te||we||oe)throw Error(I.error||k.error||"URI is malformed.");let pe=N(I,k,S,!0),Ce=b(h&&h.scheme||pe.scheme),$e=pe.host,Oe=$e!==void 0&&$e!==""&&(m($e)||r($e).isIPV6);ie(pe,h||{},Ce,Oe);let Ee=$e&&$e.indexOf("%")!==-1&&!/\P{ASCII}/u.test($e);if(pe.error&&!Ee)throw Error(pe.error);return S.skipEscape=!0,_(pe,S)}function N(y,d,h,S){let I={};if(!S)y=ve(_(y,h),h),d=ve(_(d,h),h);if(h=h||{},!h.tolerant&&d.scheme)I.scheme=d.scheme,I.userinfo=d.userinfo,I.host=d.host,I.port=d.port,I.path=o(d.path||""),I.query=d.query;else{if(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)I.userinfo=d.userinfo,I.host=d.host,I.port=d.port,I.path=o(d.path||""),I.query=d.query;else{if(!d.path)if(I.path=y.path,d.query!==void 0)I.query=d.query;else I.query=y.query;else{if(d.path[0]==="/")I.path=o(d.path);else{if((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path)I.path="/"+d.path;else if(!y.path)I.path=d.path;else I.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+d.path;I.path=o(I.path)}I.query=d.query}I.userinfo=y.userinfo,I.host=y.host,I.port=y.port}I.scheme=y.scheme}return I.fragment=d.fragment,I}function z(y,d,h){let S=O(y,h),I=O(d,h);return S!==void 0&&I!==void 0&&S===I}function _(y,d){let h={host:y.host,scheme:y.scheme,userinfo:y.userinfo,port:y.port,path:y.path,query:y.query,nid:y.nid,nss:y.nss,uuid:y.uuid,fragment:y.fragment,reference:y.reference,resourceName:y.resourceName,secure:y.secure,error:""},S=Object.assign({},d),I=[];if(h.scheme)h.scheme=T(h.scheme);let D=b(S.scheme||h.scheme);if(D&&D.serialize)D.serialize(h,S);let B=h.userinfo!==void 0||h.host!==void 0||h.port!==void 0,J=!S.skipEscape&&h.scheme===void 0&&!B;if(h.path!==void 0)if(!S.skipEscape)h.path=c(h.path,J);else h.path=s(h.path);if(S.reference!=="suffix"&&h.scheme)h.scheme=T(h.scheme),I.push(h.scheme,":");let ce=n(h);if(ce!==void 0){if(S.reference!=="suffix")I.push("//");if(I.push(ce),h.path&&h.path[0]!=="/")I.push("/")}if(h.path!==void 0){let we=h.path;if(!S.absolutePath&&(!D||!D.absolutePath))we=o(we);if(J)we=c(we,!0);if(ce===void 0&&we[0]==="/"&&we[1]==="/")we="/%2F"+we.slice(2);I.push(we)}if(h.query!==void 0)I.push("?",u(h.query));if(h.fragment!==void 0)I.push("#",l(h.fragment));return I.join("")}let C=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,q=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,F=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j(y,d){if(d[2]!==void 0&&y.path&&y.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof y.port==="number"&&(y.port<0||y.port>65535))return"URI port is malformed."}function Z(y){if(y===void 0)return!1;let d=y.indexOf("%");while(d!==-1){if(d+2>=y.length||!/^[\da-f]{2}$/iu.test(y.slice(d+1,d+3)))return!0;d=y.indexOf("%",d+3)}return!1}function G(y){return y[0]==="["&&y[y.length-1]==="]"}function K(y){let d=y[4];return Z(y[3])||d!==void 0&&!G(d)&&Z(d)||Z(y[6])||Z(y[7])||Z(y[8])}function ie(y,d,h,S){if(!d.unicodeSupport&&(!h||!h.unicodeSupport)&&y.host&&!G(y.host)&&(d.domainHost||h&&h.domainHost)&&S===!1&&v(y.host))try{y.host=new URL("http://"+y.host).hostname}catch(I){return y.error=y.error||"Host's domain name can not be converted to ASCII: "+I,!0}return!1}function Se(y,d){let h=Object.assign({},d),S={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=!1,D=!1,B=!1,J=!1,ce=!1,we=!1,k=!1;if(h.reference==="suffix")if(h.scheme)y=h.scheme+":"+y;else y="//"+y;let A=y.match(q);if(A!==null&&A[1].indexOf("\\")!==-1)S.error="URI authority must not contain a literal backslash.",I=!0;let U=y.match(F);if(U!==null){let te=U[1],oe=te.replace(/[\t\n\r]/g,"");if(oe.length>=2){if(oe.slice(0,2)!=="//")S.error=S.error||"URI authority must not contain a literal backslash.",I=!0;else if(te.length!==oe.length)S.error=S.error||"URI authority introducer must not contain whitespace.",I=!0}}let Y=y.match(C);if(Y){if(S.scheme=Y[1],S.userinfo=Y[3],S.host=Y[4],S.port=parseInt(Y[5],10),S.path=Y[6]||"",S.query=Y[7],S.fragment=Y[8],S.scheme!==void 0){let pe=unescape(S.scheme);if(R.test(pe))S.scheme=pe.toLowerCase();else S.error=S.error||"URI scheme is malformed.",we=!0}if(D=K(Y),D)S.error=S.error||"URI contains malformed percent-encoding.";if(isNaN(S.port))S.port=Y[5];let te=j(S,Y);if(te!==void 0)S.error=S.error||te,I=!0;if(S.host)if(m(S.host)===!1){let pe=G(S.host),Ce=S.host.indexOf("[")!==-1||S.host.indexOf("]")!==-1,$e=r(S.host);if(k=$e.isIPV6||$e.isIPVFuture===!0,ce=Ce&&(!pe||$e.error===!0),S.host=k?$e.host:$e.host.toLowerCase(),ce)S.error=S.error||"URI host is malformed.",I=!0}else k=!0;if(S.scheme===void 0&&S.userinfo===void 0&&S.host===void 0&&S.port===void 0&&S.query===void 0&&!S.path)S.reference="same-document";else if(S.scheme===void 0)S.reference="relative";else if(S.fragment===void 0)S.reference="absolute";else S.reference="uri";if(h.reference&&h.reference!=="suffix"&&h.reference!==S.reference)S.error=S.error||"URI is not a "+h.reference+" reference.";let oe=b(h.scheme||S.scheme);if(!ce)J=ie(S,h,oe,k);if(y.indexOf("%")!==-1&&S.host!==void 0&&!ce){let pe=k?S.host:s(S.host,!0);if(!k)pe=s(pe.toLowerCase());S.host=f(pe,k)}if(!oe||oe&&!oe.skipNormalize){if(S.path)S.path=i(S.path);if(S.query)S.query=a(S.query);if(S.fragment)S.fragment=a(S.fragment)}if(oe&&oe.parse){if(oe.parse(S,h),oe===g.urn&&S.nid===void 0)B=!0}}else S.error=S.error||"URI can not be parsed.";return{parsed:S,malformedAuthorityOrPort:I,malformedPercentEncoding:D,malformedSchemeSpecific:B,malformedHost:J,malformedScheme:we}}function ve(y,d){return Se(y,d).parsed}function Pe(y,d){return le(y,d).normalized}function le(y,d){let{parsed:h,malformedAuthorityOrPort:S,malformedPercentEncoding:I,malformedSchemeSpecific:D,malformedHost:B,malformedScheme:J}=Se(y,d);return{normalized:S||I||D||B||J?y:_(h,d),malformedAuthorityOrPort:S,malformedPercentEncoding:I,malformedSchemeSpecific:D,malformedHost:B,malformedScheme:J}}function O(y,d){if(typeof y!=="string"&&typeof y!=="object")return;let h;try{h=typeof y==="string"?y:_(y,d)}catch{return}let{normalized:S,malformedAuthorityOrPort:I,malformedPercentEncoding:D,malformedSchemeSpecific:B,malformedHost:J,malformedScheme:ce}=le(h,d);return I||D||B||J||ce?void 0:S}let x={SCHEMES:g,normalize:w,resolve:E,resolveComponent:N,equal:z,serialize:_,parse:ve};t.exports=x,t.exports.default=x,t.exports.fastUri=x});var y_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=__();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),ki=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ue();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=po(),n=sr(),s=_f(),i=Cn(),c=ue(),a=kn(),u=En(),l=me(),f=m_(),m=y_(),v=(O,x)=>new RegExp(O,x);v.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),R={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function w(O){var x,y,d,h,S,I,D,B,J,ce,we,k,A,U,Y,te,oe,pe,Ce,$e,Oe,Ee,Ye,xe,ct;let Qe=O.strict,ut=(x=O.code)===null||x===void 0?void 0:x.optimize,pt=ut===!0||ut===void 0?1:ut||0,mt=(d=(y=O.code)===null||y===void 0?void 0:y.regExp)!==null&&d!==void 0?d:v,zt=(h=O.uriResolver)!==null&&h!==void 0?h:m.default;return{strictSchema:(I=(S=O.strictSchema)!==null&&S!==void 0?S:Qe)!==null&&I!==void 0?I:!0,strictNumbers:(B=(D=O.strictNumbers)!==null&&D!==void 0?D:Qe)!==null&&B!==void 0?B:!0,strictTypes:(ce=(J=O.strictTypes)!==null&&J!==void 0?J:Qe)!==null&&ce!==void 0?ce:"log",strictTuples:(k=(we=O.strictTuples)!==null&&we!==void 0?we:Qe)!==null&&k!==void 0?k:"log",strictRequired:(U=(A=O.strictRequired)!==null&&A!==void 0?A:Qe)!==null&&U!==void 0?U:!1,code:O.code?{...O.code,optimize:pt,regExp:mt}:{optimize:pt,regExp:mt},loopRequired:(Y=O.loopRequired)!==null&&Y!==void 0?Y:T,loopEnum:(te=O.loopEnum)!==null&&te!==void 0?te:T,meta:(oe=O.meta)!==null&&oe!==void 0?oe:!0,messages:(pe=O.messages)!==null&&pe!==void 0?pe:!0,inlineRefs:(Ce=O.inlineRefs)!==null&&Ce!==void 0?Ce:!0,schemaId:($e=O.schemaId)!==null&&$e!==void 0?$e:"$id",addUsedSchema:(Oe=O.addUsedSchema)!==null&&Oe!==void 0?Oe:!0,validateSchema:(Ee=O.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Ye=O.validateFormats)!==null&&Ye!==void 0?Ye:!0,unicodeRegExp:(xe=O.unicodeRegExp)!==null&&xe!==void 0?xe:!0,int32range:(ct=O.int32range)!==null&&ct!==void 0?ct:!0,uriResolver:zt}}var E=class{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...w(O)};let{es5:x,lines:y}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:x,lines:y}),this.logger=Z(O.logger);let d=O.validateFormats;if(O.validateFormats=!1,this.RULES=(0,s.getRules)(),N.call(this,R,O,"NOT SUPPORTED"),N.call(this,p,O,"DEPRECATED","warn"),this._metaOpts=F.call(this),O.formats)C.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords)q.call(this,O.keywords);if(typeof O.meta=="object")this.addMetaSchema(O.meta);_.call(this),O.validateFormats=d}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:O,meta:x,schemaId:y}=this.opts,d=f;if(y==="id")d={...f},d.id=d.$id,delete d.$id;if(x&&O)this.addMetaSchema(d,d[y],!1)}defaultMeta(){let{meta:O,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[x]||O:void 0}validate(O,x){let y;if(typeof O=="string"){if(y=this.getSchema(O),!y)throw Error(`no schema with key or ref "${O}"`)}else y=this.compile(O);let d=y(x);if(!("$async"in y))this.errors=y.errors;return d}compile(O,x){let y=this._addSchema(O,x);return y.validate||this._compileSchemaEnv(y)}compileAsync(O,x){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:y}=this.opts;return d.call(this,O,x);async function d(J,ce){await h.call(this,J.$schema);let we=this._addSchema(J,ce);return we.validate||S.call(this,we)}async function h(J){if(J&&!this.getSchema(J))await d.call(this,{$ref:J},!0)}async function S(J){try{return this._compileSchemaEnv(J)}catch(ce){if(!(ce instanceof n.default))throw ce;return I.call(this,ce),await D.call(this,ce.missingSchema),S.call(this,J)}}function I({missingSchema:J,missingRef:ce}){if(this.refs[J])throw Error(`AnySchema ${J} is loaded but ${ce} cannot be resolved`)}async function D(J){let ce=await B.call(this,J);if(!this.refs[J])await h.call(this,ce.$schema);if(!this.refs[J])this.addSchema(ce,J,x)}async function B(J){let ce=this._loading[J];if(ce)return ce;try{return await(this._loading[J]=y(J))}finally{delete this._loading[J]}}}addSchema(O,x,y,d=this.opts.validateSchema){if(Array.isArray(O)){for(let S of O)this.addSchema(S,void 0,y,d);return this}let h;if(typeof O==="object"){let{schemaId:S}=this.opts;if(h=O[S],h!==void 0&&typeof h!="string")throw Error(`schema ${S} must be string`)}return x=(0,a.normalizeId)(x||h),this._checkUnique(x),this.schemas[x]=this._addSchema(O,y,x,d,!0),this}addMetaSchema(O,x,y=this.opts.validateSchema){return this.addSchema(O,x,!0,y),this}validateSchema(O,x){if(typeof O=="boolean")return!0;let y;if(y=O.$schema,y!==void 0&&typeof y!="string")throw Error("$schema must be a string");if(y=y||this.opts.defaultMeta||this.defaultMeta(),!y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let d=this.validate(y,O);if(!d&&x){let h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw Error(h)}return d}getSchema(O){let x;while(typeof(x=z.call(this,O))=="string")O=x;if(x===void 0){let{schemaId:y}=this.opts,d=new i.SchemaEnv({schema:{},schemaId:y});if(x=i.resolveSchema.call(this,d,O),!x)return;this.refs[O]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=z.call(this,O);if(typeof x=="object")this._cache.delete(x.schema);return delete this.schemas[O],delete this.refs[O],this}case"object":{let x=O;this._cache.delete(x);let y=O[this.opts.schemaId];if(y)y=(0,a.normalizeId)(y),delete this.schemas[y],delete this.refs[y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(let x of O)this.addKeyword(x);return this}addKeyword(O,x){let y;if(typeof O=="string"){if(y=O,typeof x=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=y}else if(typeof O=="object"&&x===void 0){if(x=O,y=x.keyword,Array.isArray(y)&&!y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(K.call(this,y,x),!x)return(0,l.eachItem)(y,(h)=>ie.call(this,h)),this;ve.call(this,x);let d={...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)};return(0,l.eachItem)(y,d.type.length===0?(h)=>ie.call(this,h,d):(h)=>d.type.forEach((S)=>ie.call(this,h,d,S))),this}getKeyword(O){let x=this.RULES.all[O];return typeof x=="object"?x.definition:!!x}removeKeyword(O){let{RULES:x}=this;delete x.keywords[O],delete x.all[O];for(let y of x.rules){let d=y.rules.findIndex((h)=>h.keyword===O);if(d>=0)y.rules.splice(d,1)}return this}addFormat(O,x){if(typeof x=="string")x=new RegExp(x);return this.formats[O]=x,this}errorsText(O=this.errors,{separator:x=", ",dataVar:y="data"}={}){if(!O||O.length===0)return"No errors";return O.map((d)=>`${y}${d.instancePath} ${d.message}`).reduce((d,h)=>d+x+h)}$dataMetaSchema(O,x){let y=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(let d of x){let h=d.split("/").slice(1),S=O;for(let I of h)S=S[I];for(let I in y){let D=y[I];if(typeof D!="object")continue;let{$data:B}=D.definition,J=S[I];if(B&&J)S[I]=le(J)}}return O}_removeAllSchemas(O,x){for(let y in O){let d=O[y];if(!x||x.test(y)){if(typeof d=="string")delete O[y];else if(d&&!d.meta)this._cache.delete(d.schema),delete O[y]}}}_addSchema(O,x,y,d=this.opts.validateSchema,h=this.opts.addUsedSchema){let S,{schemaId:I}=this.opts;if(typeof O=="object")S=O[I];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof O!="boolean")throw Error("schema must be object or boolean");let D=this._cache.get(O);if(D!==void 0)return D;y=(0,a.normalizeId)(S||y);let B=a.getSchemaRefs.call(this,O,y);if(D=new i.SchemaEnv({schema:O,schemaId:I,meta:x,baseId:y,localRefs:B}),this._cache.set(D.schema,D),h&&!y.startsWith("#")){if(y)this._checkUnique(y);this.refs[y]=D}if(d)this.validateSchema(O,!0);return D}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta)this._compileMetaSchema(O);else i.compileSchema.call(this,O);if(!O.validate)throw Error("ajv implementation error");return O.validate}_compileMetaSchema(O){let x=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=x}}};E.ValidationError=o.default,E.MissingRefError=n.default,e.default=E;function N(O,x,y,d="error"){for(let h in O){let S=h;if(S in x)this.logger[d](`${y}: option ${h}. ${O[S]}`)}}function z(O){return O=(0,a.normalizeId)(O),this.schemas[O]||this.refs[O]}function _(){let O=this.opts.schemas;if(!O)return;if(Array.isArray(O))this.addSchema(O);else for(let x in O)this.addSchema(O[x],x)}function C(){for(let O in this.opts.formats){let x=this.opts.formats[O];if(x)this.addFormat(O,x)}}function q(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in O){let y=O[x];if(!y.keyword)y.keyword=x;this.addKeyword(y)}}function F(){let O={...this.opts};for(let x of g)delete O[x];return O}let j={log(){},warn(){},error(){}};function Z(O){if(O===!1)return j;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw Error("logger must implement log, warn and error methods")}let G=/^[a-z_$][a-z0-9_$:-]*$/i;function K(O,x){let{RULES:y}=this;if((0,l.eachItem)(O,(d)=>{if(y.keywords[d])throw Error(`Keyword ${d} is already defined`);if(!G.test(d))throw Error(`Keyword ${d} has invalid name`)}),!x)return;if(x.$data&&!(("code"in x)||("validate"in x)))throw Error('$data keyword must have "code" or "validate" function')}function ie(O,x,y){var d;let h=x===null||x===void 0?void 0:x.post;if(y&&h)throw Error('keyword with "post" flag cannot have "type"');let{RULES:S}=this,I=h?S.post:S.rules.find(({type:B})=>B===y);if(!I)I={type:y,rules:[]},S.rules.push(I);if(S.keywords[O]=!0,!x)return;let D={keyword:O,definition:{...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)}};if(x.before)Se.call(this,I,D,x.before);else I.rules.push(D);S.all[O]=D,(d=x.implements)===null||d===void 0||d.forEach((B)=>this.addKeyword(B))}function Se(O,x,y){let d=O.rules.findIndex((h)=>h.keyword===y);if(d>=0)O.rules.splice(d,0,x);else O.rules.push(x),this.logger.warn(`rule ${y} is not defined`)}function ve(O){let{metaSchema:x}=O;if(x===void 0)return;if(O.$data&&this.opts.$data)x=le(x);O.validateSchema=this.compile(x,!0)}let Pe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(O){return{anyOf:[O,Pe]}}}),v_=V((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}),Ci=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=sr(),r=ot(),o=ue(),n=rt(),s=Cn(),i=me(),c={keyword:"$ref",schemaType:"string",code(l){let{gen:f,schema:m,it:v}=l,{baseId:g,schemaEnv:b,validateName:R,opts:p,self:T}=v,{root:w}=b;if((m==="#"||m==="#/")&&g===w.baseId)return N();let E=s.resolveRef.call(T,w,g,m);if(E===void 0)throw new t.default(v.opts.uriResolver,g,m);if(E instanceof s.SchemaEnv)return z(E);return _(E);function N(){if(b===w)return u(l,R,b,b.$async);let C=f.scopeValue("root",{ref:w});return u(l,o._`${C}.validate`,w,w.$async)}function z(C){u(l,a(l,C),C,C.$async)}function _(C){let q=f.scopeValue("schema",p.code.source===!0?{ref:C,code:(0,o.stringify)(C)}:{ref:C}),F=f.name("valid"),j=l.subschema({schema:C,dataTypes:[],schemaPath:o.nil,topSchemaRef:q,errSchemaPath:m},F);l.mergeEvaluated(j),l.ok(F)}}};function a(l,f){let{gen:m}=l;return f.validate?m.scopeValue("validate",{ref:f.validate}):o._`${m.scopeValue("wrapper",{ref:f})}.validate`}e.getValidate=a;function u(l,f,m,v){let{gen:g,it:b}=l,{allErrors:R,schemaEnv:p,opts:T}=b,w=T.passContext?n.default.this:o.nil;if(v)E();else N();function E(){if(!p.$async)throw Error("async schema referenced by sync schema");let C=g.let("valid");g.try(()=>{if(g.code(o._`await ${(0,r.callValidateCode)(l,f,w)}`),_(f),!R)g.assign(C,!0)},(q)=>{if(g.if(o._`!(${q} instanceof ${b.ValidationError})`,()=>g.throw(q)),z(q),!R)g.assign(C,!1)}),l.ok(C)}function N(){l.result((0,r.callValidateCode)(l,f,w),()=>_(f),()=>z(f))}function z(C){let q=o._`${C}.errors`;g.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${q} : ${n.default.vErrors}.concat(${q})`),g.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function _(C){var q;if(!b.opts.unevaluated)return;let F=(q=m===null||m===void 0?void 0:m.validate)===null||q===void 0?void 0:q.evaluated;if(b.props!==!0)if(F&&!F.dynamicProps){if(F.props!==void 0)b.props=i.mergeEvaluated.props(g,F.props,b.props)}else{let j=g.var("props",o._`${C}.evaluated.props`);b.props=i.mergeEvaluated.props(g,j,b.props,o.Name)}if(b.items!==!0)if(F&&!F.dynamicItems){if(F.items!==void 0)b.items=i.mergeEvaluated.items(g,F.items,b.items)}else{let j=g.var("items",o._`${C}.evaluated.items`);b.items=i.mergeEvaluated.items(g,j,b.items,o.Name)}}}e.callRef=u,e.default=c}),bf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=v_(),r=Ci(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),S_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c,schemaCode:a}=s;s.fail$data(t._`${c} ${o[i].fail} ${a} || isNaN(${c})`)}};e.default=n}),b_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c}=o,a=c.opts.multipleOfPrecision,u=n.let("res"),l=a?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${a}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),w_=V((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'}),R_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=w_(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let c=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${c} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:c,schemaCode:a,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,f=u.opts.unicode===!1?t._`${c}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${c})`;s.fail$data(t._`${f} ${l} ${a}`)}};e.default=n}),P_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=me(),o=ue(),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:c,$data:a,schema:u,schemaCode:l,it:f}=s,m=f.opts.unicodeRegExp?"u":"";if(a){let{regExp:v}=f.opts.code,g=v.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,v),b=i.let("valid");i.try(()=>i.assign(b,o._`${g}(${l}, ${m}).test(${c})`),()=>i.assign(b,!1)),s.fail$data(o._`!${b}`)}else{let v=(0,t.usePattern)(s,u);s.fail$data(o._`!${v}.test(${c})`)}}};e.default=n}),E_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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,c=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${c} ${i}`)}};e.default=r}),T_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=me(),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:c,schemaCode:a,data:u,$data:l,it:f}=s,{opts:m}=f;if(!l&&c.length===0)return;let v=c.length>=m.loopRequired;if(f.allErrors)g();else b();if(m.strictRequired){let T=s.parentSchema.properties,{definedProperties:w}=s.it;for(let E of c)if((T===null||T===void 0?void 0:T[E])===void 0&&!w.has(E)){let N=`required property "${E}" is not defined at "${f.schemaEnv.baseId+f.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(f,N,f.opts.strictRequired)}}function g(){if(v||l)s.block$data(r.nil,R);else for(let T of c)(0,t.checkReportMissingProp)(s,T)}function b(){let T=i.let("missing");if(v||l){let w=i.let("valid",!0);s.block$data(w,()=>p(T,w)),s.ok(w)}else i.if((0,t.checkMissingProp)(s,c,T)),(0,t.reportMissingProp)(s,T),i.else()}function R(){i.forOf("prop",a,(T)=>{s.setParams({missingProperty:T}),i.if((0,t.noPropertyInData)(i,u,T,m.ownProperties),()=>s.error())})}function p(T,w){s.setParams({missingProperty:T}),i.forOf(T,a,()=>{i.assign(w,(0,t.propertyInData)(i,u,T,m.ownProperties)),i.if((0,r.not)(w),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),k_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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,c=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${c} ${i}`)}};e.default=r}),Ii=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=vf();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),I_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=En(),r=ue(),o=me(),n=Ii(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:c}})=>r.str`must NOT have duplicate items (items ## ${c} and ${i} are identical)`,params:({params:{i,j:c}})=>r._`{i: ${i}, j: ${c}}`},code(i){let{gen:c,data:a,$data:u,schema:l,parentSchema:f,schemaCode:m,it:v}=i;if(!u&&!l)return;let g=c.let("valid"),b=f.items?(0,t.getSchemaTypes)(f.items):[];i.block$data(g,R,r._`${m} === false`),i.ok(g);function R(){let E=c.let("i",r._`${a}.length`),N=c.let("j");i.setParams({i:E,j:N}),c.assign(g,!0),c.if(r._`${E} > 1`,()=>(p()?T:w)(E,N))}function p(){return b.length>0&&!b.some((E)=>E==="object"||E==="array")}function T(E,N){let z=c.name("item"),_=(0,t.checkDataTypes)(b,z,v.opts.strictNumbers,t.DataType.Wrong),C=c.const("indices",r._`{}`);c.for(r._`;${E}--;`,()=>{if(c.let(z,r._`${a}[${E}]`),c.if(_,r._`continue`),b.length>1)c.if(r._`typeof ${z} == "string"`,r._`${z} += "_"`);c.if(r._`typeof ${C}[${z}] == "number"`,()=>{c.assign(N,r._`${C}[${z}]`),i.error(),c.assign(g,!1).break()}).code(r._`${C}[${z}] = ${E}`)})}function w(E,N){let z=(0,o.useFunc)(c,n.default),_=c.name("outer");c.label(_).for(r._`;${E}--;`,()=>c.for(r._`${N} = ${E}; ${N}--;`,()=>c.if(r._`${z}(${a}[${E}], ${a}[${N}])`,()=>{i.error(),c.assign(g,!1).break(_)})))}}};e.default=s}),A_=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=Ii(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:c,$data:a,schemaCode:u,schema:l}=s;if(a||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${c}, ${u})`);else s.fail(t._`${l} !== ${c}`)}};e.default=n}),ey=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=Ii(),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:c,$data:a,schema:u,schemaCode:l,it:f}=s;if(!a&&u.length===0)throw Error("enum must have non-empty array");let m=u.length>=f.opts.loopEnum,v,g=()=>v!==null&&v!==void 0?v:v=(0,r.useFunc)(i,o.default),b;if(m||a)b=i.let("valid"),s.block$data(b,R);else{if(!Array.isArray(u))throw Error("ajv implementation error");let T=i.const("vSchema",l);b=(0,t.or)(...u.map((w,E)=>p(T,E)))}s.pass(b);function R(){i.assign(b,!1),i.forOf("v",l,(T)=>i.if(t._`${g()}(${c}, ${T})`,()=>i.assign(b,!0).break()))}function p(T,w){let E=u[w];return typeof E==="object"&&E!==null?t._`${g()}(${c}, ${T}[${w}])`:t._`${c} === ${E}`}}};e.default=n}),wf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=S_(),r=b_(),o=R_(),n=P_(),s=E_(),i=T_(),c=k_(),a=I_(),u=A_(),l=ey(),f=[t.default,r.default,o.default,n.default,s.default,i.default,c.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=f}),$f=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=ue(),r=me(),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:c}=s,{items:a}=i;if(!Array.isArray(a)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,a)}};function n(s,i){let{gen:c,schema:a,data:u,keyword:l,it:f}=s;f.items=!0;let m=c.const("len",t._`${u}.length`);if(a===!1)s.setParams({len:i.length}),s.pass(t._`${m} <= ${i.length}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(f,a)){let g=c.var("valid",t._`${m} <= ${i.length}`);c.if((0,t.not)(g),()=>v(g)),s.ok(g)}function v(g){c.forRange("i",i.length,m,(b)=>{if(s.subschema({keyword:l,dataProp:b,dataPropType:r.Type.Num},g),!f.allErrors)c.if((0,t.not)(g),()=>c.break())})}}e.validateAdditionalItems=n,e.default=o}),Rf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=ue(),r=me(),o=ot(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:c,it:a}=i;if(Array.isArray(c))return s(i,"additionalItems",c);if(a.items=!0,(0,r.alwaysValidSchema)(a,c))return;i.ok((0,o.validateArray)(i))}};function s(i,c,a=i.schema){let{gen:u,parentSchema:l,data:f,keyword:m,it:v}=i;if(R(l),v.opts.unevaluated&&a.length&&v.items!==!0)v.items=r.mergeEvaluated.items(u,a.length,v.items);let g=u.name("valid"),b=u.const("len",t._`${f}.length`);a.forEach((p,T)=>{if((0,r.alwaysValidSchema)(v,p))return;u.if(t._`${b} > ${T}`,()=>i.subschema({keyword:m,schemaProp:T,dataProp:T},g)),i.ok(g)});function R(p){let{opts:T,errSchemaPath:w}=v,E=a.length,N=E===p.minItems&&(E===p.maxItems||p[c]===!1);if(T.strictTuples&&!N){let z=`"${m}" is ${E}-tuple, but minItems or maxItems/${c} are not specified or different at path "${w}"`;(0,r.checkStrictMode)(v,z,T.strictTuples)}}}e.validateTuple=s,e.default=n}),ty=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Rf(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),ry=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=ot(),n=$f(),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:c,parentSchema:a,it:u}=i,{prefixItems:l}=a;if(u.items=!0,(0,r.alwaysValidSchema)(u,c))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),oy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,data:a,it:u}=n,l,f,{minContains:m,maxContains:v}=c;if(u.opts.next)l=m===void 0?1:m,f=v;else l=1;let g=s.const("len",t._`${a}.length`);if(n.setParams({min:l,max:f}),f===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&l>f){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let w=t._`${g} >= ${l}`;if(f!==void 0)w=t._`${w} && ${g} <= ${f}`;n.pass(w);return}u.items=!0;let b=s.name("valid");if(f===void 0&&l===1)p(b,()=>s.if(b,()=>s.break()));else if(l===0){if(s.let(b,!0),f!==void 0)s.if(t._`${a}.length > 0`,R)}else s.let(b,!1),R();n.result(b,()=>n.reset());function R(){let w=s.name("_valid"),E=s.let("count",0);p(w,()=>s.if(w,()=>T(E)))}function p(w,E){s.forRange("i",0,g,(N)=>{n.subschema({keyword:"contains",dataProp:N,dataPropType:r.Type.Num,compositeRule:!0},w),E()})}function T(w){if(s.code(t._`${w}++`),f===void 0)s.if(t._`${w} >= ${l}`,()=>s.assign(b,!0).break());else if(s.if(t._`${w} > ${f}`,()=>s.assign(b,!1).break()),l===1)s.assign(b,!0);else s.if(t._`${w} >= ${l}`,()=>s.assign(b,!0))}}};e.default=o}),Oi=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=ue(),r=me(),o=ot();e.error={message:({params:{property:a,depsCount:u,deps:l}})=>{let f=u===1?"property":"properties";return t.str`must have ${f} ${l} when property ${a} is present`},params:({params:{property:a,depsCount:u,deps:l,missingProperty:f}})=>t._`{property: ${a},
|
|
67
67
|
missingProperty: ${f},
|
|
68
68
|
depsCount: ${u},
|
|
69
|
-
deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,l]=s(a);i(a,u),c(a,l)}};function s({schema:a}){let u={},l={};for(let f in a){if(f==="__proto__")continue;let m=Array.isArray(a[f])?u:l;m[f]=a[f]}return[u,l]}function i(a,u=a.schema){let{gen:l,data:f,it:m}=a;if(Object.keys(u).length===0)return;let v=l.let("missing");for(let g in u){let b=u[g];if(b.length===0)continue;let R=(0,o.propertyInData)(l,f,g,m.opts.ownProperties);if(a.setParams({property:g,depsCount:b.length,deps:b.join(", ")}),m.allErrors)l.if(R,()=>{for(let p of b)(0,o.checkReportMissingProp)(a,p)});else l.if(t._`${R} && (${(0,o.checkMissingProp)(a,b,v)})`),(0,o.reportMissingProp)(a,v),l.else()}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:l,data:f,keyword:m,it:v}=a,g=l.name("valid");for(let b in u){if((0,r.alwaysValidSchema)(v,u[b]))continue;l.if((0,o.propertyInData)(l,f,b,v.opts.ownProperties),()=>{let R=a.subschema({keyword:m,schemaProp:b},g);a.mergeValidEvaluated(R,g)},()=>l.var(g,!0)),a.ok(g)}}e.validateSchemaDeps=c,e.default=n}),py=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,(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),!a.allErrors)s.break()})}),n.ok(u)}};e.default=o}),Pf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=rt(),n=me(),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:c,schema:a,parentSchema:u,data:l,errsCount:f,it:m}=i;if(!f)throw Error("ajv implementation error");let{allErrors:v,opts:g}=m;if(m.props=!0,g.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,a))return;let b=(0,t.allSchemaProperties)(u.properties),R=(0,t.allSchemaProperties)(u.patternProperties);p(),i.ok(r._`${f} === ${o.default.errors}`);function p(){c.forIn("key",l,(z)=>{if(!b.length&&!R.length)E(z);else c.if(T(z),()=>E(z))})}function T(z){let _;if(b.length>8){let C=(0,n.schemaRefOrVal)(m,u.properties,"properties");_=(0,t.isOwnProperty)(c,C,z)}else if(b.length)_=(0,r.or)(...b.map((C)=>r._`${z} === ${C}`));else _=r.nil;if(R.length)_=(0,r.or)(_,...R.map((C)=>r._`${(0,t.usePattern)(i,C)}.test(${z})`));return(0,r.not)(_)}function w(z){c.code(r._`delete ${l}[${z}]`)}function E(z){if(g.removeAdditional==="all"||g.removeAdditional&&a===!1){w(z);return}if(a===!1){if(i.setParams({additionalProperty:z}),i.error(),!v)c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(m,a)){let _=c.name("valid");if(g.removeAdditional==="failing")N(z,_,!1),c.if((0,r.not)(_),()=>{i.reset(),w(z)});else if(N(z,_),!v)c.if((0,r.not)(_),()=>c.break())}}function N(z,_,C){let q={keyword:"additionalProperties",dataProp:z,dataPropType:n.Type.Str};if(C===!1)Object.assign(q,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(q,_)}}};e.default=s}),my=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=nr(),r=ot(),o=me(),n=Pf(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:l,it:f}=i;if(f.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(f,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(a);for(let p of m)f.definedProperties.add(p);if(f.opts.unevaluated&&m.length&&f.props!==!0)f.props=o.mergeEvaluated.props(c,(0,o.toHash)(m),f.props);let v=m.filter((p)=>!(0,o.alwaysValidSchema)(f,a[p]));if(v.length===0)return;let g=c.name("valid");for(let p of v){if(b(p))R(p);else{if(c.if((0,r.propertyInData)(c,l,p,f.opts.ownProperties)),R(p),!f.allErrors)c.else().var(g,!0);c.endIf()}i.it.definedProperties.add(p),i.ok(g)}function b(p){return f.opts.useDefaults&&!f.compositeRule&&a[p].default!==void 0}function R(p){i.subschema({keyword:"properties",schemaProp:p,dataProp:p},g)}}};e.default=s}),gy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=me(),n=me(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:l,it:f}=i,{opts:m}=f,v=(0,t.allSchemaProperties)(a),g=v.filter((N)=>(0,o.alwaysValidSchema)(f,a[N]));if(v.length===0||g.length===v.length&&(!f.opts.unevaluated||f.props===!0))return;let b=m.strictSchema&&!m.allowMatchingProperties&&l.properties,R=c.name("valid");if(f.props!==!0&&!(f.props instanceof r.Name))f.props=(0,n.evaluatedPropsToName)(c,f.props);let{props:p}=f;T();function T(){for(let N of v){if(b)w(N);if(f.allErrors)E(N);else c.var(R,!0),E(N),c.if(R)}}function w(N){for(let z in b)if(new RegExp(N).test(z))(0,o.checkStrictMode)(f,`property ${z} matches pattern ${N} (use allowMatchingProperties)`)}function E(N){c.forIn("key",u,(z)=>{c.if(r._`${(0,t.usePattern)(i,N)}.test(${z})`,()=>{let _=g.includes(N);if(!_)i.subschema({keyword:"patternProperties",schemaProp:N,dataProp:z,dataPropType:n.Type.Str},R);if(f.opts.unevaluated&&p!==!0)c.assign(r._`${p}[${z}]`,!0);else if(!_&&!f.allErrors)c.if((0,r.not)(R),()=>c.break())})})}}};e.default=s}),_y=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),yy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ot().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),vy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,l=s.let("valid",!1),f=s.let("passing",null),m=s.name("_valid");n.setParams({passing:f}),s.block(v),n.result(l,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((g,b)=>{let R;if((0,r.alwaysValidSchema)(a,g))s.var(m,!0);else R=n.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},m);if(b>0)s.if(t._`${m} && ${l}`).assign(l,!1).assign(f,t._`[${f}, ${b}]`).else();s.if(m,()=>{if(s.assign(l,!0),s.assign(f,b),R)n.mergeEvaluated(R,t.Name)})})}}};e.default=o}),Sy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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 c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let l=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(l)})}};e.default=r}),by=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=s;if(c.then===void 0&&c.else===void 0)(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),l=n(a,"else");if(!u&&!l)return;let f=i.let("valid",!0),m=i.name("_valid");if(v(),s.reset(),u&&l){let b=i.let("ifClause");s.setParams({ifClause:b}),i.if(m,g("then",b),g("else",b))}else if(u)i.if(m,g("then"));else i.if((0,t.not)(m),g("else"));s.pass(f,()=>s.error(!0));function v(){let b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(b)}function g(b,R){return()=>{let p=s.subschema({keyword:b},m);if(i.assign(f,m),s.mergeValidEvaluated(p,f),R)i.assign(R,t._`${b}`);else s.setParams({ifClause:b})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o}),wy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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}),Ef=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Rf(),r=dy(),o=zf(),n=fy(),s=hy(),i=xi(),c=py(),a=Pf(),u=my(),l=gy(),f=_y(),m=yy(),v=vy(),g=Sy(),b=by(),R=wy();function p(T=!1){let w=[f.default,m.default,v.default,g.default,b.default,R.default,c.default,a.default,i.default,u.default,l.default];if(T)w.push(r.default,n.default);else w.push(t.default,o.default);return w.push(s.default),w}e.default=p}),$y=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c,schema:a,schemaCode:u,it:l}=o,{opts:f,errSchemaPath:m,schemaEnv:v,self:g}=l;if(!f.validateFormats)return;if(c)b();else R();function b(){let p=s.scopeValue("formats",{ref:g.formats,code:f.code.formats}),T=s.const("fDef",t._`${p}[${u}]`),w=s.let("fType"),E=s.let("format");s.if(t._`typeof ${T} == "object" && !(${T} instanceof RegExp)`,()=>s.assign(w,t._`${T}.type || "string"`).assign(E,t._`${T}.validate`),()=>s.assign(w,t._`"string"`).assign(E,T)),o.fail$data((0,t.or)(N(),z()));function N(){if(f.strictSchema===!1)return t.nil;return t._`${u} && !${E}`}function z(){let _=v.$async?t._`(${T}.async ? await ${E}(${i}) : ${E}(${i}))`:t._`${E}(${i})`,C=t._`(typeof ${E} == "function" ? ${_} : ${E}.test(${i}))`;return t._`${E} && ${E} !== true && ${w} === ${n} && !${C}`}}function R(){let p=g.formats[a];if(!p){N();return}if(p===!0)return;let[T,w,E]=z(p);if(T===n)o.pass(_());function N(){if(f.strictSchema===!1){g.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${a}" ignored in schema at path "${m}"`}}function z(C){let q=C instanceof RegExp?(0,t.regexpCode)(C):f.code.formats?t._`${f.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:C,code:q});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,t._`${F}.validate`];return["string",C,F]}function _(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!v.$async)throw Error("async format in sync schema");return t._`await ${E}(${i})`}return typeof w=="function"?t._`${E}(${i})`:t._`${E}.test(${i})`}}}};e.default=r}),Tf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[$y().default];e.default=t}),kf=V((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"]}),Cf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wf(),r=$f(),o=Ef(),n=Tf(),s=kf(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),Ry=V((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={}))}),Ai=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=Ry(),o=Cn(),n=sr(),s=me(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>t._`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:l,parentSchema:f,it:m}=c,{oneOf:v}=f;if(!m.opts.discriminator)throw Error("discriminator: requires discriminator option");let g=l.propertyName;if(typeof g!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!v)throw Error("discriminator: requires oneOf keyword");let b=a.let("valid",!1),R=a.const("tag",t._`${u}${(0,t.getProperty)(g)}`);a.if(t._`typeof ${R} == "string"`,()=>p(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:R,tagName:g})),c.ok(b);function p(){let E=w();a.if(!1);for(let N in E)a.elseIf(t._`${R} === ${N}`),a.assign(b,T(E[N]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:R,tagName:g}),a.endIf()}function T(E){let N=a.name("valid"),z=c.subschema({keyword:"oneOf",schemaProp:E},N);return c.mergeEvaluated(z,t.Name),N}function w(){var E;let N={},z=C(f),_=!0;for(let j=0;j<v.length;j++){let Z=v[j];if((Z===null||Z===void 0?void 0:Z.$ref)&&!(0,s.schemaHasRulesButRef)(Z,m.self.RULES)){let K=Z.$ref;if(Z=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,K),Z instanceof o.SchemaEnv)Z=Z.schema;if(Z===void 0)throw new n.default(m.opts.uriResolver,m.baseId,K)}let G=(E=Z===null||Z===void 0?void 0:Z.properties)===null||E===void 0?void 0:E[g];if(typeof G!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);_=_&&(z||C(Z)),q(G,j)}if(!_)throw Error(`discriminator: "${g}" must be required`);return N;function C({required:j}){return Array.isArray(j)&&j.includes(g)}function q(j,Z){if(j.const)F(j.const,Z);else if(j.enum)for(let G of j.enum)F(G,Z);else throw Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function F(j,Z){if(typeof j!="string"||j in N)throw Error(`discriminator: "${g}" values must be unique strings`);N[j]=Z}}}};e.default=i}),zy=V((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}}),If=V((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=Ii(),o=Cf(),n=Ai(),s=zy(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((v)=>this.addVocabulary(v)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=ue();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 f=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),Of=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ue(),r=rt(),o=Cn(),n=Oi(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(a)=>i(a,a.schema)};function i(a,u){let{gen:l,it:f}=a;f.schemaEnv.root.dynamicAnchors[u]=!0;let m=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=f.errSchemaPath==="#"?f.validateName:c(a);l.if(t._`!${m}`,()=>l.assign(m,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:l,self:f}=a.it,{root:m,baseId:v,localRefs:g,meta:b}=u.root,{schemaId:R}=f.opts,p=new o.SchemaEnv({schema:l,schemaId:R,root:m,baseId:v,localRefs:g,meta:b});return o.compileSchema.call(f,p),(0,n.getValidate)(a,p)}e.default=s}),Nf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ue(),r=rt(),o=Oi(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:l}=i;if(c[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let f=c.slice(1);if(l.allErrors)m();else{let g=a.let("valid",!1);m(g),i.ok(g)}function m(g){if(l.schemaEnv.root.dynamicAnchors[f]){let b=a.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(f)}`);a.if(b,v(b,g),v(l.validateName,g))}else v(l.validateName,g)()}function v(g,b){return b?()=>a.block(()=>{(0,o.callRef)(i,g),a.let(b,!0)}):()=>(0,o.callRef)(i,g)}}e.dynamicRef=s,e.default=n}),Py=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Of(),r=me(),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}),Ey=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Nf(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),xf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Of(),r=Nf(),o=Py(),n=Ey(),s=[t.default,r.default,o.default,n.default];e.default=s}),Ty=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xi(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),ky=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xi(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),Cy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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}),Af=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ty(),r=ky(),o=Cy(),n=[t.default,r.default,o.default];e.default=n}),Iy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=rt(),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:c,data:a,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:f,props:m}=l;if(m instanceof t.Name)i.if(t._`${m} !== true`,()=>i.forIn("key",a,(R)=>i.if(g(m,R),()=>v(R))));else if(m!==!0)i.forIn("key",a,(R)=>m===void 0?v(R):i.if(b(m,R),()=>v(R)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function v(R){if(c===!1){if(s.setParams({unevaluatedProperty:R}),s.error(),!f)i.break();return}if(!(0,r.alwaysValidSchema)(l,c)){let p=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:R,dataPropType:r.Type.Str},p),!f)i.if((0,t.not)(p),()=>i.break())}}function g(R,p){return t._`!${R} || !${R}[${p}]`}function b(R,p){let T=[];for(let w in R)if(R[w]===!0)T.push(t._`${p} !== ${w}`);return(0,t.and)(...T)}}};e.default=n}),Oy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n,u=a.items||0;if(u===!0)return;let l=s.const("len",t._`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let m=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(m),()=>f(m,u)),n.ok(m)}a.items=!0;function f(m,v){s.forRange("i",v,l,(g)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:g,dataPropType:r.Type.Num},m),!a.allErrors)s.if((0,t.not)(m),()=>s.break())})}}};e.default=o}),Mf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Iy(),r=Oy(),o=[t.default,r.default];e.default=o}),Ny=V((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"}]}}}}}),xy=V((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:"#"}}}}}),Ay=V((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:"#"}}}}),My=V((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:{}}}}}),jy=V((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"}}}}),qy=V((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}}}}),Ly=V((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:[]}}}}),Dy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ny(),r=xy(),o=Ay(),n=My(),s=jy(),i=qy(),c=Ly(),a=["/properties"];function u(l){return[t,r,o,n,f(this,s),i,f(this,c)].forEach((m)=>this.addMetaSchema(m,void 0,!1)),this;function f(m,v){return l?m.$dataMetaSchema(v,a):v}}e.default=u}),Uy=V((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=Ii(),o=Cf(),n=xf(),s=Af(),i=Mf(),c=Ai(),a=Dy(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(b={}){super({...b,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((b)=>this.addVocabulary(b)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:b,meta:R}=this.opts;if(!R)return;a.default.call(this,b),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 f=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var m=ue();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 v=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var g=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})}),Zy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wf(),r=$f(),o=Ef(),n=xf(),s=Af(),i=Mf(),c=Tf(),a=kf(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u}),Vy=V((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}}}}),Fy=V((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"}}}}}),Hy=V((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"}}}}),Jy=V((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"}}}}),By=V((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"}}}}),Ky=V((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"}}}}),Gy=V((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}}}}),Wy=V((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:[]}}}}),Yy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vy(),r=Fy(),o=Hy(),n=Jy(),s=By(),i=Ky(),c=Gy(),a=Wy(),u=["/properties"];function l(f){return[t,r,o,n,s,m(this,i),c,m(this,a)].forEach((v)=>this.addMetaSchema(v,void 0,!1)),this;function m(v,g){return f?v.$dataMetaSchema(g,u):g}}e.default=l}),Xy=V((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=Ii(),o=Zy(),n=Ai(),s=Yy(),i="https://json-schema.org/draft/2020-12/schema";var c=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:v}=this.opts;if(!v)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=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=ue();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=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var f=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),Qy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,Z){return{validate:j,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(m(!0),v),"iso-time":t(a(),l),"iso-date-time":t(m(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:z},int64:{type:"number",validate:_},float:{type:"number",validate:C},double:{type:"number",validate:C},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,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,g),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 Z=o.exec(j);if(!Z)return!1;let G=+Z[1],K=+Z[2],ie=+Z[3];return K>=1&&K<=12&&ie>=1&&ie<=(K===2&&r(G)?29:n[K])}function i(j,Z){if(!(j&&Z))return;if(j>Z)return 1;if(j<Z)return-1;return 0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(j){return function(G){let K=c.exec(G);if(!K)return!1;let ie=+K[1],Se=+K[2],ve=+K[3],Pe=K[4],le=K[5]==="-"?-1:1,O=+(K[6]||0),x=+(K[7]||0);if(O>23||x>59||j&&!Pe)return!1;if(ie<=23&&Se<=59&&ve<60)return!0;let y=Se-x*le,d=ie-O*le-(y<0?1:0);return(d===23||d===-1)&&(y===59||y===-1)&&ve<61}}function u(j,Z){if(!(j&&Z))return;let G=new Date("2020-01-01T"+j).valueOf(),K=new Date("2020-01-01T"+Z).valueOf();if(!(G&&K))return;return G-K}function l(j,Z){if(!(j&&Z))return;let G=c.exec(j),K=c.exec(Z);if(!(G&&K))return;if(j=G[1]+G[2]+G[3],Z=K[1]+K[2]+K[3],j>Z)return 1;if(j<Z)return-1;return 0}let f=/t|\s/i;function m(j){let Z=a(j);return function(K){let ie=K.split(f);return ie.length===2&&s(ie[0])&&Z(ie[1])}}function v(j,Z){if(!(j&&Z))return;let G=new Date(j).valueOf(),K=new Date(Z).valueOf();if(!(G&&K))return;return G-K}function g(j,Z){if(!(j&&Z))return;let[G,K]=j.split(f),[ie,Se]=Z.split(f),ve=i(G,ie);if(ve===void 0)return;return ve||u(K,Se)}let b=/\/|:/,R=/^(?:[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 p(j){return b.test(j)&&R.test(j)}let T=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return T.lastIndex=0,T.test(j)}let E=-2147483648,N=2147483647;function z(j){return Number.isInteger(j)&&j<=N&&j>=E}function _(j){return Number.isInteger(j)}function C(){return!0}let q=/[^\\]\\Z/;function F(j){if(q.test(j))return!1;try{return new RegExp(j),!0}catch(Z){return!1}}});var ev=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=If(),r=ue(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>r.str`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>r._`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:l,keyword:f,it:m}=c,{opts:v,self:g}=m;if(!v.validateFormats)return;let b=new t.KeywordCxt(m,g.RULES.all.format.definition,"format");if(b.$data)R();else p();function R(){let w=a.scopeValue("formats",{ref:g.formats,code:v.code.formats}),E=a.const("fmt",r._`${w}[${b.schemaCode}]`);c.fail$data((0,r.or)(r._`typeof ${E} != "object"`,r._`${E} instanceof RegExp`,r._`typeof ${E}.compare != "function"`,T(E)))}function p(){let w=b.schema,E=g.formats[w];if(!E||E===!0)return;if(typeof E!="object"||E instanceof RegExp||typeof E.compare!="function")throw Error(`"${f}": format "${w}" does not define "compare" function`);let N=a.scopeValue("formats",{key:w,ref:E,code:v.code.formats?r._`${v.code.formats}${(0,r.getProperty)(w)}`:void 0});c.fail$data(T(N))}function T(w){return r._`${w}.compare(${u}, ${l}) ${n[f].fail} 0`}},dependencies:["format"]};let i=(c)=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i}),tv=V((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=Qy(),o=ev(),n=ue(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,l={keywords:!0})=>{if(Array.isArray(l))return a(u,l,r.fullFormats,s),u;let[f,m]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(a(u,l.formats||r.formatNames,f,m),l.keywords)(0,o.default)(u);return u};c.get=(u,l="full")=>{let f=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw Error(`Unknown format "${u}"`);return f};function a(u,l,f,m){var v,g;(v=(g=u.opts.code).formats)!==null&&v!==void 0||(g.formats=n._`require("ajv-formats/dist/formats").${m}`);for(let b of l)u.addFormat(b,f[b])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c}),jf=If(),rv=Uy(),nv=Xy(),uv=Oo(tv(),1),lv=uv.default;function Ci(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return lv(t),t}var In=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Ci(nv.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Bi(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??=Ci(rv.Ajv2019);return this._ajvDraft7??=Ci(jf.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)}}},A0=jf.Ajv;var fv;fv=globalThis.crypto?.webcrypto??globalThis.crypto??import("crypto").then((e)=>e.webcrypto);var ir=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e){super(e);this.name=new.target.name,Rt(this,new.target)}},yv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,r){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 \xA73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(r)}`);this.kind=e,this.expected=t,this.received=r}},vv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`);this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},Sv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=e}},bv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`);this.recordedIssuer=e,this.currentIssuer=t}},wv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`);this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var Hf=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e){super(e??"Unauthorized");this.name="UnauthorizedError",Rt(this,new.target)}};var On=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]),Jf=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(Mi(e))}set(e,t){let r=Mi(e),o=On.has(e.method),n=!this._entries.has(r);if(!o&&n&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let i of this._entries.keys())if(!On.has(i.slice(0,i.indexOf("\x00")))){this._entries.delete(i),this._cappedSize--;break}}let s=++this._stamp;if(this._entries.set(r,{...t,stamp:s}),n&&!o)this._cappedSize++;return s}delete(e){if(this._entries.delete(Mi(e))&&!On.has(e.method))this._cappedSize--}evict(e){let t=`${e}\x00`,r=On.has(e);for(let o of this._entries.keys())if(o.startsWith(t)){if(this._entries.delete(o),!r)this._cappedSize--}}clear(){this._entries.clear(),this._cappedSize=0}};function Mi(e){return`${e.method}\x00${JSON.stringify([e.partition??"",e.params??""])}`}function ji(e,t){return t===void 0?e:`${e}\x00${t}`}var Bf=86400000,$v=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity="";constructor(e,t,r=()=>{},o="",n=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=r,this._cachePartition=o,this._now=n}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e==="public"?"":this._cachePartition])}async _probe(e,t){let r={method:e,params:t??""},o=this._partitionFor("private"),n=await this._store.get({...r,partition:o});if(n!==void 0)return n;let s=this._partitionFor("public");if(s===o)return;let i=await this._store.get({...r,partition:s});return i?.scope==="public"?i:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,"")}async _deleteBoth(e,t){let r=this._partitionFor("private"),o=this._partitionFor("public");try{await this._store.delete({method:e,params:t,partition:r})}catch(n){this._reportError(n)}if(o!==r)try{await this._store.delete({method:e,params:t,partition:o})}catch(n){this._reportError(n)}}async evictKey(e,t){let r=ji(e,t),o=this._evictionGeneration.get(r);if(o!==void 0)this._evictionGeneration.set(r,o+1);await this._deleteBoth(e,t)}captureGeneration(e,t){let r=ji(e,t),o=this._evictionGeneration.get(r)??0;return this._evictionGeneration.set(r,o),o}async write(e,t,r,o){if((this._evictionGeneration.get(ji(e,o?.params))??0)!==r)return;let n=o?.params??"",s=this._partitionFor("private"),i=this._partitionFor("public"),c=(o?.scope??"private")==="public"?i:s;try{await this._store.set({method:e,params:n,partition:c},{value:Rv(t),expiresAt:o?.expiresAt,scope:o?.scope})}catch(a){this._reportError(a)}if(i!==s)try{await this._store.delete({method:e,params:n,partition:c===s?i:s})}catch(a){this._reportError(a)}}async read(e,t){let r=await this._probe(e,t);if(r?.expiresAt===void 0||!(r.expiresAt>this.now()))return;try{let o=JSON.parse(r.value);if(typeof o!=="object"||o===null||Array.isArray(o))throw TypeError("cached document is not an object");return{value:o}}catch(o){this._reportError(o),await this._deleteBoth(e,t??"");return}}resetForReconnect(){if(!this._isUserSupplied)this._store.clear();this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=""}async toolDefinition(e){let t=await this._probe("tools/list");if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let r=this._decodeListTools(t),o=new Map;if(r!==void 0)for(let n of r.tools)o.set(n.name,n);this._toolIndex={stamp:t.stamp,byName:o}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let r=await this._probe("tools/list");if(r===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==r.stamp){let o=this._decodeListTools(r)??{tools:[]},n=new Map;for(let s of o.tools){let i=t(s);if(i!==void 0)n.set(s.name,i)}this._toolOutputValidatorIndex={stamp:r.stamp,byName:n}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every((r)=>r!==null&&typeof r==="object"))throw TypeError("cached tools/list document has a malformed tools array");return t}catch(t){this._reportError(t);return}}};function Rv(e){let t;try{t=JSON.stringify(e)}catch(r){throw TypeError(`cache value is not JSON-serializable: ${r instanceof Error?r.message:String(r)}`)}if(typeof t!=="string")throw TypeError("cache value is not JSON-serializable: it has no JSON representation");return t}var zv=Symbol.for("mcp.authSeamEscape");function Pv(e){return(typeof e==="object"&&e!==null||typeof e==="function")&&e[zv]===!0}var Ev=-32022,Tv=new Set([-32001,-32020,-32021]);function kv(e,t){switch(e.kind){case"result":return Cv(e.result,t);case"rpc-error":return Kf(e,t);case"http-error":return Iv(e,t);case"network-error":return qf(e.error,t);case"unusable-reply":return{kind:"error",error:new X(ee.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${Gf(e.error)})`,{cause:e.error},{cause:e.error})};case"auth-required":return{kind:"error",error:e.error};case"closed":if(t.transportKind==="stdio")return{kind:"legacy"};return qf(Error("Connection closed during the version negotiation probe"),t);case"timeout":if(t.transportKind==="stdio")return{kind:"legacy"};return{kind:"error",error:new X(ee.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function Cv(e,t){let r=ft($n).validateResult("server/discover",e);if(!r.ok)return{kind:"legacy"};let o=r.value.supportedVersions,n=t.clientModernVersions.find((s)=>o.includes(s));if(n!==void 0)return{kind:"modern",version:n,discover:r.value};if(t.fallbackAvailable)return{kind:"legacy"};return{kind:"error",error:new lo({supported:[...o],requested:t.requestedVersion})}}function Kf(e,t){let{code:r,message:o,data:n}=e;if(r===Ev){let s=Nv(n);if(s===void 0)return{kind:"legacy"};let i=new lo({supported:s,requested:xv(n)??t.requestedVersion},o),c=uo(s),a=t.clientModernVersions.find((u)=>c.includes(u));if(a!==void 0)return{kind:"corrective",version:a,error:i};if(c.length>0)return{kind:"error",error:i};return t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:i}}if(Tv.has(r))return{kind:"legacy"};return{kind:"legacy"}}function Iv(e,t){if(e.status===401||e.status===403){let o=e.status===403;return{kind:"error",error:new co(o?ee.ClientHttpForbidden:ee.ClientHttpAuthentication,`Version negotiation failed: ${o?"the server denied access (HTTP 403)":"the server requires authorization (HTTP 401)"}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:"error",error:new co(ee.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let r=Av(e.body);if(r!==void 0)return Kf(r,t);return{kind:"legacy"}}function qf(e,t){if(t.environment==="browser"&&Ov(e))return{kind:"legacy"};return{kind:"error",error:new X(ee.EraNegotiationFailed,`Version negotiation probe failed: ${Gf(e)}`,{cause:e},{cause:e})}}function Ov(e){return e instanceof TypeError||e instanceof Error&&e.name==="TypeError"}function Gf(e){return e instanceof Error?e.message:String(e)}function Nv(e){if(typeof e!=="object"||e===null)return;let t=e.supported;if(!Array.isArray(t)||t.length===0||!t.every((r)=>typeof r==="string"))return;return t}function xv(e){if(typeof e!=="object"||e===null)return;let t=e.requested;return typeof t==="string"?t:void 0}function Av(e){if(e===void 0||e==="")return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=="object"||t===null)return;let r=t.error;if(typeof r!=="object"||r===null)return;let{code:o,message:n,data:s}=r;if(typeof o!=="number")return;return{code:o,message:typeof n==="string"?n:"",data:s}}var Mv="legacy";function jv(e,t){let r=e?.mode??Mv;if(r==="legacy")return{kind:"legacy"};let o=e?.probe??{};if(typeof r==="object"){if(!ht(r.pin))throw TypeError(`versionNegotiation: { pin: '${r.pin}' } is not a modern protocol revision \u2014 pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:"pin",version:r.pin,probe:o}}let n=t?uo(t):[];return{kind:"auto",modernVersions:n.length>0?n:[..._i],fallbackAvailable:t?yi(t).length>0:!0,probe:o}}function Lf(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?"browser":"node"}function Df(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var qv=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(t){this._transport=t,this._savedOnMessage=t.onmessage,this._savedOnError=t.onerror,this._savedOnClose=t.onclose}static async open(t){let r=new e(t);t.onmessage=(o)=>{let n=r._pending;if(n!==void 0&&(or(o)||fo(o))&&o.id===n.id){if(r._pending=void 0,or(o))n.resolve({kind:"response",result:o.result});else n.resolve({kind:"response",error:o.error});return}},t.onerror=(o)=>{r._savedOnError?.(o)},t.onclose=()=>{let o=r._pending;if(o!==void 0)r._pending=void 0,o.resolve({kind:"closed"});r._closeDelivered=!0,r._savedOnClose?.()};try{await t.start()}catch(o){throw r.detach(),o}return r}async exchange(t,r){let o=`server-discover-probe-${++this._probeCounter}`;return new Promise((n)=>{let s=!1,i=(a)=>{if(s)return;if(s=!0,clearTimeout(c),this._pending?.id===o)this._pending=void 0;n(a)},c=setTimeout(()=>i({kind:"timeout"}),r);this._pending={id:o,resolve:i},this._transport.send(t(o)).catch((a)=>i({kind:"send-error",error:a}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let t=this._savedOnClose,r=this._transport,o=!1,n=()=>{if(!o){o=!0;return}t()};r.onclose=n,Di.set(r,()=>{if(r.onclose===n)r.onclose=t})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let t=this._transport,r=t.start,o=!0;t.start=async function(){if(o){o=!1,t.start=r;return}return r.call(t)}}},Di=new WeakMap;function Uf(e){let t=Di.get(e);Di.delete(e),t?.()}function Lv(e,t,r,o){return{jsonrpc:"2.0",id:e,method:"server/discover",params:{_meta:ft(t).outboundEnvelope({protocolVersion:t,clientInfo:r,clientCapabilities:o})}}}function Dv(e){if(e instanceof X&&e.code===ee.ClientHttpUnexpectedContent)return!0;return e instanceof Error&&e.name==="SyntaxError"}function Uv(e,t){switch(e.kind){case"response":return e.error===void 0?{kind:"result",result:e.result}:{kind:"rpc-error",...e.error};case"send-error":{let r=e.error;if(Pv(r)||r instanceof Hf||r instanceof Error&&r.name==="UnauthorizedError")return{kind:"auth-required",error:r};if(r instanceof co){let o=r.data?.text;return{kind:"http-error",status:r.data.status,body:typeof o==="string"?o:void 0,statusText:r.data.statusText}}if(Dv(r))return{kind:"unusable-reply",error:r};return{kind:"network-error",error:r}}case"closed":return{kind:"closed"};case"timeout":return{kind:"timeout",timeoutMs:t}}}async function Wf(e,t){let r=e.probe.timeoutMs??t.defaultTimeoutMs,o=Math.max(0,e.probe.maxRetries??0),n=e.kind==="pin"?[e.version]:e.modernVersions,s=e.kind==="auto"&&e.fallbackAvailable,i=await qv.open(t.transport),c=async()=>{let u=n[0],l=!1,f=o;for(;;){let m=await i.exchange((b)=>Lv(b,u,t.clientInfo,t.capabilities),r);if(m.kind==="timeout"&&f>0){f--;continue}let v=Uv(m,r),g=kv(v,{clientModernVersions:n,requestedVersion:u,fallbackAvailable:s,environment:t.environment,transportKind:t.transportKind});switch(g.kind){case"modern":return{era:"modern",version:g.version,discover:g.discover};case"corrective":if(l)throw g.error;l=!0,u=g.version;continue;case"legacy":{let b=v.kind==="closed"?"the connection closed during the server/discover probe":void 0;if(e.kind==="pin")throw new X(ee.EraNegotiationFailed,b===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${b} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new X(ee.EraNegotiationFailed,b===void 0?"Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to":`Version negotiation failed: ${b} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(b!==void 0&&t.disposableProbe!==!0)throw new X(ee.EraNegotiationFailed,`Version negotiation failed: ${b} (this transport probed in place \u2014 the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:"legacy"}}case"error":throw g.error}}},a;try{a=await c()}catch(u){throw i.detach(),u}return i.release(),a}function Zv(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,"_dispose"))return;let r=e._serverParams;return typeof r==="object"&&r!==null&&typeof r.command==="string"?r:void 0}async function Vv(e,t,r,o){let s=new t.constructor({...r,stderr:"ignore"}),i=t.close,c=!1,a,u=new Promise((f,m)=>{a=()=>m(Zf())});t.close=async function(){return c=!0,a?.(),i.call(t)};let l;try{let f=Wf(e,{...o,transport:s,transportKind:"stdio",disposableProbe:!0});f.catch(()=>{}),l=await Promise.race([f,u])}finally{await Fv(s),t.close=i}if(c)throw Zf();return l}function Zf(){return new X(ee.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}async function Fv(e){try{let t=e._dispose;await(typeof t==="function"?t.call(e):e.close())}catch{}}function Vf(e){let t=e._meta?.[_a];return Pi.Implementation(t)?t:void 0}function Nn(e,t){if(!e||t===null||typeof t!=="object")return;if(e.type==="object"&&e.properties&&typeof e.properties==="object"){let r=t,o=e.properties;for(let n of Object.keys(o)){let s=o[n];if(r[n]===void 0&&Object.prototype.hasOwnProperty.call(s,"default"))r[n]=s.default;if(r[n]!==void 0)Nn(s,r[n])}}if(Array.isArray(e.anyOf)){for(let r of e.anyOf)if(typeof r!=="boolean")Nn(r,t)}if(Array.isArray(e.oneOf)){for(let r of e.oneOf)if(typeof r!=="boolean")Nn(r,t)}}function Yf(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}function Hv(e){if(typeof e==="object"&&e!==null){if(e.kind==="legacy"&&!("supportedVersions"in e)&&!("discover"in e))return e;if(e.kind==="modern"&&cv.safeParse(e.discover).success)return e}throw new X(ee.EraNegotiationFailed,"connect({ prior }): unrecognized prior \u2014 expected { kind: 'modern', discover } or { kind: 'legacy' }")}var Ff={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]},Jv=64,Li={},Ui=class extends Ti{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;static{Li.enforceStrictCapabilities=(e)=>e._enforceStrictCapabilities,Li.walkPages=(e,t,r,o)=>e._walkPages(t,r,o),Li.readResource=(e,t,r)=>e._readResource(t,r)}_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new X(ee.ConnectionClosed,"subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");for(let t of this._listenState.values())t.settle({cause:"remote",error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t);if(this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new In,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=ff(t?.inputRequired),this._cache=new $v(t?.responseCacheStore??new Jf,t?.responseCacheStore!==void 0,(r)=>this._reportStoreError(r),t?.cachePartition??""),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??Jv,t?.listChanged)this._listChangedConfig=t.listChanged}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&ht(this._negotiatedProtocolVersion)&&Rn(e))return"drop"}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e===void 0)return;return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){if(!this._inputRequiredDriverConfig.autoFulfill)return Promise.reject(new X(ee.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance \u2014 pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:"input_required",method:t.request.method}));return gf({getRequestHandler:(r)=>this._getRequestHandler(r),buildContext:(r)=>this.buildContext(r,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t)}_setupListChangedHandlers(e){if(e.tools&&this._serverCapabilities?.tools?.listChanged)this._setupListChangedHandler("tools","notifications/tools/list_changed",e.tools,async()=>(await this.listTools(void 0,{cacheMode:"refresh"})).tools);if(e.prompts&&this._serverCapabilities?.prompts?.listChanged)this._setupListChangedHandler("prompts","notifications/prompts/list_changed",e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:"refresh"})).prompts);if(e.resources&&this._serverCapabilities?.resources?.listChanged)this._setupListChangedHandler("resources","notifications/resources/list_changed",e.resources,async()=>(await this.listResources(void 0,{cacheMode:"refresh"})).resources)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=ki(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error("Cannot configure version negotiation after connecting to transport");this._versionNegotiation=e}_wrapHandler(e,t){if(e==="elicitation/create")return async(r,o)=>{let n=ft(this._negotiatedProtocolVersion),s=n.validateRequest("elicitation/create",r);if(!s.ok&&s.reason==="not-in-era")s=n.validateInputRequest("elicitation/create",r);if(!s.ok)throw new be(s.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,s.reason==="not-in-era"?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation request: ${s.message}`);let{params:i}=s.value;i.mode=i.mode??"form";let{supportsFormMode:c,supportsUrlMode:a}=Yf(this._capabilities.elicitation);if(i.mode==="form"&&!c)throw new be(ne.InvalidParams,"Client does not support form-mode elicitation requests");if(i.mode==="url"&&!a)throw new be(ne.InvalidParams,"Client does not support URL-mode elicitation requests");let u=await t(r,o),l=n.validateResult("elicitation/create",u);if(!l.ok&&l.reason==="not-in-era")l=n.validateInputResponse("elicitation/create",u);if(!l.ok)throw new be(l.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,l.reason==="not-in-era"?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation result: ${l.message}`);let f=l.value,m=i.mode==="form"?i.requestedSchema:void 0;if(i.mode==="form"&&f.action==="accept"&&f.content&&m&&this._capabilities.elicitation?.form?.applyDefaults)try{Nn(m,f.content)}catch{}return f};if(e==="sampling/createMessage")return async(r,o)=>{let n=ft(this._negotiatedProtocolVersion),s=n.validateRequest("sampling/createMessage",r);if(!s.ok&&s.reason==="not-in-era")s=n.validateInputRequest("sampling/createMessage",r);if(!s.ok)throw new be(s.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,s.reason==="not-in-era"?"No wire schema for sampling/createMessage in the resolved era":`Invalid sampling request: ${s.message}`);let{params:i}=s.value,c=await t(r,o),a=Boolean(i.tools||i.toolChoice),u=n.samplingResultVariant(a,c);if(!u.ok&&u.reason==="not-in-era")u=n.validateInputResponse("sampling/createMessage",c);if(!u.ok)throw new be(u.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,u.reason==="not-in-era"?"No result schema for sampling/createMessage in the resolved era":`Invalid sampling result: ${u.message}`);return u.value};return t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new X(ee.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,Hv(t.prior),t);let r=jv(this._versionNegotiation,this._supportedProtocolVersionsOption);if(r.kind!=="legacy")return this._connectNegotiated(e,r,t);return this._connectPlainLegacy(e,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let r=this._negotiatedProtocolVersion;if(r!==void 0)e.setProtocolVersion?.(r);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let r=yi(this._supportedProtocolVersions);try{let o=r[0];if(o===void 0)throw new X(ee.EraNegotiationFailed,"Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");let n=await this.request({method:"initialize",params:{protocolVersion:o,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);if(!r.includes(n.protocolVersion))throw Error(`Server's protocol version is not supported: ${n.protocolVersion}`);if(this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion)e.setProtocolVersion(n.protocolVersion);if(this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._negotiatedProtocolVersion=n.protocolVersion,this._listChangedConfig)this._setupListChangedHandlers(this._listChangedConfig)}catch(o){throw this.close(),o}}async _connectNegotiated(e,t,r){if(e.sessionId!==void 0){await super.connect(e);let n=this._negotiatedProtocolVersion;if(n!==void 0&&e.setProtocolVersion)e.setProtocolVersion(n);return}this._resetConnectionState();let o;try{let n=Df(e),s={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:Lf(),defaultTimeoutMs:r?.timeout??ho},i=n==="stdio"?Zv(e):void 0;o=i===void 0?await Wf(t,{...s,transport:e,transportKind:n}):await Vv(t,e,i,s)}catch(n){throw await e.close().catch(()=>{}),Uf(e),n}if(Uf(e),await super.connect(e),o.era==="legacy"){await this._legacyHandshake(e,r);return}if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=Vf(o.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.discover.instructions,this._discoverResult=o.discover,this._negotiatedProtocolVersion=o.version,e.setProtocolVersion)e.setProtocolVersion(o.version);if(this._listChangedConfig){let n=this._listChangedConfig,s=this._serverCapabilities,i={...n.tools&&s?.tools?.listChanged&&{tools:n.tools},...n.prompts&&s?.prompts?.listChanged&&{prompts:n.prompts},...n.resources&&s?.resources?.listChanged&&{resources:n.resources}},c=!0;try{this._setupListChangedHandlers(i)}catch(u){c=!1,this.onerror?.(u instanceof Error?u:Error(String(u)))}let a=c?{...i.tools&&{toolsListChanged:!0},...i.prompts&&{promptsListChanged:!0},...i.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let u=new AbortController,l=()=>u.abort(r?.signal?.reason);if(r?.signal?.aborted)l();r?.signal?.addEventListener("abort",l);try{this._autoOpenedSubscription=await this.listen(a,{timeout:r?.timeout,signal:u.signal})}catch(f){if(r?.signal?.aborted)throw await this.close().catch(()=>{}),f;this.onerror?.(f instanceof Error?f:Error(String(f)))}finally{r?.signal?.removeEventListener("abort",l)}}}}async _connectFromPrior(e,t,r){if(t.kind==="legacy")return this._connectPlainLegacy(e,r);let o=t.discover;this._resetConnectionState();let n=this._supportedProtocolVersionsOption,s=(n&&uo(n).length>0?uo(n):_i).find((i)=>o.supportedVersions.includes(i));if(s===void 0)throw new X(ee.EraNegotiationFailed,"connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");if(await super.connect(e),this._discoverResult=o,this._serverCapabilities=o.capabilities,this._serverVersion=Vf(o),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.instructions,this._negotiatedProtocolVersion=s,e.setProtocolVersion?.(s),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(i){this.onerror?.(i instanceof Error?i:Error(String(i)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;if(t!==void 0)return`${t.name}@${t.version}`;return e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e===void 0)return;return ht(e)?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new X(ee.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new X(ee.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new X(ee.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new X(ee.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new X(ee.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new X(ee.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"initialize":break;case"server/discover":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new X(ee.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new X(ee.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new X(ee.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new X(ee.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},e)}async discover(e){let t=await this._requestWithSchema({method:"server/discover"},cv,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:"completion/complete",params:e},t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list"),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:"prompts/list",params:e},t);let r=await this._serveFromCache("prompts/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("prompts/list",e,t,(o)=>o.prompts)}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list"),{resources:[]};if(e?.cursor!==void 0)return this.request({method:"resources/list",params:e},t);let r=await this._serveFromCache("resources/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("resources/list",e,t,(o)=>o.resources)}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list"),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:"resources/templates/list",params:e},t);let r=await this._serveFromCache("resources/templates/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("resources/templates/list",e,t,(o)=>o.resourceTemplates)}async _listAllPages(e,t,r,o,n){let s=r?.cacheMode==="bypass",i=this._cache.captureGeneration(e),c=(u)=>{let l=u===void 0?t&&{...t}:{...t,cursor:u};return this.request({method:e,...l&&{params:l}},r)},a=await this._walkPages(e,c,o);if(delete a.nextCursor,n?.(a),s)return a;return await this._cache.write(e,a,i,this._freshness(a)),a}async _walkPages(e,t,r){let o=await t(void 0),n=o.nextCursor,s=o,i=1;while(n!==void 0){if(this._listMaxPages!==0&&i>=this._listMaxPages)throw new X(ee.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let c=await t(n);if(c.nextCursor===n&&JSON.stringify(r(c))===JSON.stringify(r(s)))break;r(o).push(...r(c)),s=c,n=c.nextCursor,i++}return o}_freshness(e,t){let r=e,o=typeof r.ttlMs==="number"?r.ttlMs:this._defaultCacheTtlMs,n=r.cacheScope==="public"?"public":"private";return{expiresAt:this._cache.now()+Math.min(Math.max(0,o),Bf),scope:n,params:t}}async _serveFromCache(e,t,r){if(r?.cacheMode==="bypass"||r?.cacheMode==="refresh")return;let o=await this._cache.read(e,t).catch((n)=>void this._reportStoreError(n));if(o!==void 0){if(r?.signal?.aborted){let n=r.signal.reason;throw n instanceof X?n:new X(ee.RequestTimeout,String(n))}return o.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(!e.outputSchema)return;try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(t){return{ok:!1,compileError:t}}}async _resolveXMcpHeaderScan(e,t){let r=t??await this._cache.toolDefinition(e);return r===void 0?void 0:Ri(r.inputSchema)}async readResource(e,t){let{result:r}=await this._readResource(e,t);return r}async _readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(r!==void 0)return{result:r,cached:!0};let o=this._cache.captureGeneration("resources/read",e.uri),n=await this.request({method:"resources/read",params:e},t);if(t?.cacheMode!=="bypass"){let s=this._freshness(n,e.uri);if(s.expiresAt>this._cache.now())await this._cache.write("resources/read",n,o,s);else if(t?.cacheMode==="refresh")await this._cache.evictKey("resources/read",e.uri)}return{result:n,cached:!1}}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},t)}async listen(e,t){if(this.transport===void 0)throw new X(ee.NotConnected,"Not connected");let r=this._negotiatedProtocolVersion;if(r===void 0||!ht(r))throw new X(ee.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${r??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:r});if(t?.signal?.aborted){let w=t.signal.reason;throw w instanceof X?w:new X(ee.RequestTimeout,String(w))}let o=new AbortController,n=`listen:${this._nextListenId++}`,s="opening",i,c,a,u,l=new Promise((w,E)=>{a=w,u=E}),f,m=new Promise((w)=>{f=w}),v=(w)=>{if(s==="closed")return;let E=s==="opening";if(i!==void 0)clearTimeout(i),i=void 0;if("ack"in w){s="open",a(w.ack);return}if(s="closed",c!==void 0)t?.signal?.removeEventListener("abort",c);if(this._listenState.delete(n),o.abort(),f(w.cause),E)u(w.error??new X(ee.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},g=async()=>{o.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:n}}).catch(()=>{})},b=async()=>{if(s==="closed")return;v({cause:"local"}),await g()};this._listenState.set(n,{settle:v});let R=t?.timeout??ho;if(i=setTimeout(()=>{v({cause:"remote",error:new X(ee.RequestTimeout,"subscriptions/listen ack timed out",{timeout:R})}),g().catch(()=>{})},R),t?.signal){let w=t.signal;c=()=>{if(s==="closed")return;let E=w.reason;v({cause:"local",error:E instanceof Error?E:Error(String(E??"Aborted"))}),g().catch(()=>{})},w.addEventListener("abort",c,{once:!0})}let p={jsonrpc:"2.0",id:n,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},T=(w)=>{v({cause:"remote",error:w instanceof Error?w:Error(String(w))})};try{this.transport.send(p,{requestSignal:o.signal,onRequestStreamEnd:()=>v({cause:"remote",error:Error("subscriptions/listen: stream ended")})}).catch(T)}catch(w){T(w)}return{honoredFilter:await l,close:b,closed:m}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(Ff,e.method)?Ff[e.method]:void 0;if(e.method==="notifications/resources/updated"){let o=e.params?.uri;if(typeof o==="string")this._cache.evictKey("resources/read",o)}else if(r!==void 0)for(let o of r)this._cache.evict(o);if(e.method==="notifications/subscriptions/acknowledged"){let o=e.params?._meta?.[Rh],n=typeof o==="string"?this._listenState.get(o):void 0;if(n!==void 0){let s=this._wireCodec().validateNotification("notifications/subscriptions/acknowledged",e);n.settle({ack:s.ok?s.value.params.notifications:{}});return}}if(e.method==="notifications/cancelled"){let o=e.params?.requestId,n=typeof o==="string"?this._listenState.get(o):void 0;if(n!==void 0){n.settle({cause:"remote",error:Error("subscriptions/listen: server cancelled the subscription")});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,r=typeof t==="string"?this._listenState.get(t):void 0;if(r!==void 0){if(fo(e))r.settle({cause:"remote",error:be.fromError(e.error.code,e.error.message,e.error.data)});else r.settle({cause:"graceful",error:new X(ee.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new X(ee.ConnectionClosed,"Connection closed");for(let t of this._listenState.values())t.settle({cause:"remote",error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let r=this.getProtocolEra()==="modern"&&Lf()!=="browser",o=async()=>{if(!r)return t;let a;try{a=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(l){this._reportStoreError(l)}if(!a?.valid||a.declarations.length===0)return t;let u=lf(a.declarations,e.arguments);return Object.keys(u).length===0?t:{...t,headers:{...t?.headers,...u}}},n=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,(a)=>this._compileOutputValidator(a)).catch((a)=>void this._reportStoreError(a)):this._compileOutputValidator(t.toolDefinition),s=()=>{if(n===void 0||n.ok)return;let a=n.compileError,u=(a instanceof Error?a.message:String(a)).slice(0,200);throw new be(ne.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${u}`)};s();let i;try{i=await this.request({method:"tools/call",params:e},await o())}catch(a){let u=a instanceof be&&a.code===rr;if(!r||!u||t?.toolDefinition!==void 0)throw a;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:"refresh"};await this._cache.evict("tools/list"),await this.listTools(void 0,l).catch((f)=>this._reportStoreError(f)),n=await this._cache.outputValidator(e.name,(f)=>this._compileOutputValidator(f)).catch((f)=>void this._reportStoreError(f)),s(),i=await this.request({method:"tools/call",params:e},await o())}let c=n!==void 0&&n.ok?n.validator:void 0;if(c){if(i.structuredContent===void 0&&!i.isError)throw new be(ne.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent!==void 0&&!i.isError)try{let a=c(i.structuredContent);if(!a.valid)throw new be(ne.InvalidParams,`Structured content does not match the tool's output schema: ${a.errorMessage}`)}catch(a){if(a instanceof be)throw a;throw new be(ne.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return i}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list"),{tools:[]};if(e?.cursor!==void 0){let o=await this.request({method:"tools/list",params:e},t);return this._excludeInvalidXMcpHeaderTools(o),o}let r=await this._serveFromCache("tools/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("tools/list",e,t,(o)=>o.tools,(o)=>this._excludeInvalidXMcpHeaderTools(o))}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!=="modern"||!this.transport||Df(this.transport)==="stdio")return;let t=e.tools.filter((r)=>{let o=Ri(r.inputSchema);if(!o.valid)return console.warn(`[mcp-sdk] excluding tool '${r.name}' from tools/list: invalid x-mcp-header declaration \u2014 ${o.reason}`),!1;return!0});if(t.length!==e.tools.length)e.tools=t}_setupListChangedHandler(e,t,r,o){let n=zn(iT,r);if(!n.success)throw Error(`Invalid ${e} listChanged options: ${n.error.message}`);if(typeof r.onChanged!=="function")throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:i}=n.data,{onChanged:c}=r,a=async()=>{if(!s){c(null,null);return}try{c(null,await o())}catch(l){c(l instanceof Error?l:Error(String(l)),null)}},u=()=>{if(i){let l=this._listChangedDebounceTimers.get(e);if(l)clearTimeout(l);let f=setTimeout(a,i);this._listChangedDebounceTimers.set(e,f)}else a()};this.setNotificationHandler(t,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var tR=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e,t,r){super(`SSE error: ${t}`);this.code=e,this.event=r,Rt(this,new.target)}};class Bv extends Ui{async request(e,t,r){if(Kv(t))return await Lt(r?.signal,()=>super.request(e,t,r));return await Lt(t?.signal,()=>super.request(e,t))}async callTool(...e){return await Lt(e[1]?.signal,()=>super.callTool(...e))}async listTools(...e){return await Lt(e[1]?.signal,()=>super.listTools(...e))}async listResources(...e){return await Lt(e[1]?.signal,()=>super.listResources(...e))}async listResourceTemplates(...e){return await Lt(e[1]?.signal,()=>super.listResourceTemplates(...e))}async readResource(...e){return await Lt(e[1]?.signal,()=>super.readResource(...e))}}function Kv(e){return e!==void 0&&"~standard"in e}async function Lt(e,t){try{return await t()}catch(r){if(e?.aborted&&r instanceof X&&r.code===ee.RequestTimeout&&!(e.reason instanceof X))throw e.reason;throw ZX(r)}}export{Bv as LoopbackMcpClient};
|
|
69
|
+
deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,l]=s(a);i(a,u),c(a,l)}};function s({schema:a}){let u={},l={};for(let f in a){if(f==="__proto__")continue;let m=Array.isArray(a[f])?u:l;m[f]=a[f]}return[u,l]}function i(a,u=a.schema){let{gen:l,data:f,it:m}=a;if(Object.keys(u).length===0)return;let v=l.let("missing");for(let g in u){let b=u[g];if(b.length===0)continue;let R=(0,o.propertyInData)(l,f,g,m.opts.ownProperties);if(a.setParams({property:g,depsCount:b.length,deps:b.join(", ")}),m.allErrors)l.if(R,()=>{for(let p of b)(0,o.checkReportMissingProp)(a,p)});else l.if(t._`${R} && (${(0,o.checkMissingProp)(a,b,v)})`),(0,o.reportMissingProp)(a,v),l.else()}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:l,data:f,keyword:m,it:v}=a,g=l.name("valid");for(let b in u){if((0,r.alwaysValidSchema)(v,u[b]))continue;l.if((0,o.propertyInData)(l,f,b,v.opts.ownProperties),()=>{let R=a.subschema({keyword:m,schemaProp:b},g);a.mergeValidEvaluated(R,g)},()=>l.var(g,!0)),a.ok(g)}}e.validateSchemaDeps=c,e.default=n}),ny=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,(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),!a.allErrors)s.break()})}),n.ok(u)}};e.default=o}),zf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=rt(),n=me(),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:c,schema:a,parentSchema:u,data:l,errsCount:f,it:m}=i;if(!f)throw Error("ajv implementation error");let{allErrors:v,opts:g}=m;if(m.props=!0,g.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,a))return;let b=(0,t.allSchemaProperties)(u.properties),R=(0,t.allSchemaProperties)(u.patternProperties);p(),i.ok(r._`${f} === ${o.default.errors}`);function p(){c.forIn("key",l,(z)=>{if(!b.length&&!R.length)E(z);else c.if(T(z),()=>E(z))})}function T(z){let _;if(b.length>8){let C=(0,n.schemaRefOrVal)(m,u.properties,"properties");_=(0,t.isOwnProperty)(c,C,z)}else if(b.length)_=(0,r.or)(...b.map((C)=>r._`${z} === ${C}`));else _=r.nil;if(R.length)_=(0,r.or)(_,...R.map((C)=>r._`${(0,t.usePattern)(i,C)}.test(${z})`));return(0,r.not)(_)}function w(z){c.code(r._`delete ${l}[${z}]`)}function E(z){if(g.removeAdditional==="all"||g.removeAdditional&&a===!1){w(z);return}if(a===!1){if(i.setParams({additionalProperty:z}),i.error(),!v)c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(m,a)){let _=c.name("valid");if(g.removeAdditional==="failing")N(z,_,!1),c.if((0,r.not)(_),()=>{i.reset(),w(z)});else if(N(z,_),!v)c.if((0,r.not)(_),()=>c.break())}}function N(z,_,C){let q={keyword:"additionalProperties",dataProp:z,dataPropType:n.Type.Str};if(C===!1)Object.assign(q,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(q,_)}}};e.default=s}),sy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=nr(),r=ot(),o=me(),n=zf(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:l,it:f}=i;if(f.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(f,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(a);for(let p of m)f.definedProperties.add(p);if(f.opts.unevaluated&&m.length&&f.props!==!0)f.props=o.mergeEvaluated.props(c,(0,o.toHash)(m),f.props);let v=m.filter((p)=>!(0,o.alwaysValidSchema)(f,a[p]));if(v.length===0)return;let g=c.name("valid");for(let p of v){if(b(p))R(p);else{if(c.if((0,r.propertyInData)(c,l,p,f.opts.ownProperties)),R(p),!f.allErrors)c.else().var(g,!0);c.endIf()}i.it.definedProperties.add(p),i.ok(g)}function b(p){return f.opts.useDefaults&&!f.compositeRule&&a[p].default!==void 0}function R(p){i.subschema({keyword:"properties",schemaProp:p,dataProp:p},g)}}};e.default=s}),iy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ot(),r=ue(),o=me(),n=me(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:l,it:f}=i,{opts:m}=f,v=(0,t.allSchemaProperties)(a),g=v.filter((N)=>(0,o.alwaysValidSchema)(f,a[N]));if(v.length===0||g.length===v.length&&(!f.opts.unevaluated||f.props===!0))return;let b=m.strictSchema&&!m.allowMatchingProperties&&l.properties,R=c.name("valid");if(f.props!==!0&&!(f.props instanceof r.Name))f.props=(0,n.evaluatedPropsToName)(c,f.props);let{props:p}=f;T();function T(){for(let N of v){if(b)w(N);if(f.allErrors)E(N);else c.var(R,!0),E(N),c.if(R)}}function w(N){for(let z in b)if(new RegExp(N).test(z))(0,o.checkStrictMode)(f,`property ${z} matches pattern ${N} (use allowMatchingProperties)`)}function E(N){c.forIn("key",u,(z)=>{c.if(r._`${(0,t.usePattern)(i,N)}.test(${z})`,()=>{let _=g.includes(N);if(!_)i.subschema({keyword:"patternProperties",schemaProp:N,dataProp:z,dataPropType:n.Type.Str},R);if(f.opts.unevaluated&&p!==!0)c.assign(r._`${p}[${z}]`,!0);else if(!_&&!f.allErrors)c.if((0,r.not)(R),()=>c.break())})})}}};e.default=s}),ay=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),cy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ot().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),uy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,l=s.let("valid",!1),f=s.let("passing",null),m=s.name("_valid");n.setParams({passing:f}),s.block(v),n.result(l,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((g,b)=>{let R;if((0,r.alwaysValidSchema)(a,g))s.var(m,!0);else R=n.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},m);if(b>0)s.if(t._`${m} && ${l}`).assign(l,!1).assign(f,t._`[${f}, ${b}]`).else();s.if(m,()=>{if(s.assign(l,!0),s.assign(f,b),R)n.mergeEvaluated(R,t.Name)})})}}};e.default=o}),ly=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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 c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let l=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(l)})}};e.default=r}),dy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=s;if(c.then===void 0&&c.else===void 0)(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),l=n(a,"else");if(!u&&!l)return;let f=i.let("valid",!0),m=i.name("_valid");if(v(),s.reset(),u&&l){let b=i.let("ifClause");s.setParams({ifClause:b}),i.if(m,g("then",b),g("else",b))}else if(u)i.if(m,g("then"));else i.if((0,t.not)(m),g("else"));s.pass(f,()=>s.error(!0));function v(){let b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(b)}function g(b,R){return()=>{let p=s.subschema({keyword:b},m);if(i.assign(f,m),s.mergeValidEvaluated(p,f),R)i.assign(R,t._`${b}`);else s.setParams({ifClause:b})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o}),fy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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}),Pf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$f(),r=ty(),o=Rf(),n=ry(),s=oy(),i=Oi(),c=ny(),a=zf(),u=sy(),l=iy(),f=ay(),m=cy(),v=uy(),g=ly(),b=dy(),R=fy();function p(T=!1){let w=[f.default,m.default,v.default,g.default,b.default,R.default,c.default,a.default,i.default,u.default,l.default];if(T)w.push(r.default,n.default);else w.push(t.default,o.default);return w.push(s.default),w}e.default=p}),hy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),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:c,schema:a,schemaCode:u,it:l}=o,{opts:f,errSchemaPath:m,schemaEnv:v,self:g}=l;if(!f.validateFormats)return;if(c)b();else R();function b(){let p=s.scopeValue("formats",{ref:g.formats,code:f.code.formats}),T=s.const("fDef",t._`${p}[${u}]`),w=s.let("fType"),E=s.let("format");s.if(t._`typeof ${T} == "object" && !(${T} instanceof RegExp)`,()=>s.assign(w,t._`${T}.type || "string"`).assign(E,t._`${T}.validate`),()=>s.assign(w,t._`"string"`).assign(E,T)),o.fail$data((0,t.or)(N(),z()));function N(){if(f.strictSchema===!1)return t.nil;return t._`${u} && !${E}`}function z(){let _=v.$async?t._`(${T}.async ? await ${E}(${i}) : ${E}(${i}))`:t._`${E}(${i})`,C=t._`(typeof ${E} == "function" ? ${_} : ${E}.test(${i}))`;return t._`${E} && ${E} !== true && ${w} === ${n} && !${C}`}}function R(){let p=g.formats[a];if(!p){N();return}if(p===!0)return;let[T,w,E]=z(p);if(T===n)o.pass(_());function N(){if(f.strictSchema===!1){g.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${a}" ignored in schema at path "${m}"`}}function z(C){let q=C instanceof RegExp?(0,t.regexpCode)(C):f.code.formats?t._`${f.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:C,code:q});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,t._`${F}.validate`];return["string",C,F]}function _(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!v.$async)throw Error("async format in sync schema");return t._`await ${E}(${i})`}return typeof w=="function"?t._`${E}(${i})`:t._`${E}.test(${i})`}}}};e.default=r}),Ef=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[hy().default];e.default=t}),Tf=V((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"]}),kf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bf(),r=wf(),o=Pf(),n=Ef(),s=Tf(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),py=V((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={}))}),Ni=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=py(),o=Cn(),n=sr(),s=me(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>t._`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:l,parentSchema:f,it:m}=c,{oneOf:v}=f;if(!m.opts.discriminator)throw Error("discriminator: requires discriminator option");let g=l.propertyName;if(typeof g!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!v)throw Error("discriminator: requires oneOf keyword");let b=a.let("valid",!1),R=a.const("tag",t._`${u}${(0,t.getProperty)(g)}`);a.if(t._`typeof ${R} == "string"`,()=>p(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:R,tagName:g})),c.ok(b);function p(){let E=w();a.if(!1);for(let N in E)a.elseIf(t._`${R} === ${N}`),a.assign(b,T(E[N]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:R,tagName:g}),a.endIf()}function T(E){let N=a.name("valid"),z=c.subschema({keyword:"oneOf",schemaProp:E},N);return c.mergeEvaluated(z,t.Name),N}function w(){var E;let N={},z=C(f),_=!0;for(let j=0;j<v.length;j++){let Z=v[j];if((Z===null||Z===void 0?void 0:Z.$ref)&&!(0,s.schemaHasRulesButRef)(Z,m.self.RULES)){let K=Z.$ref;if(Z=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,K),Z instanceof o.SchemaEnv)Z=Z.schema;if(Z===void 0)throw new n.default(m.opts.uriResolver,m.baseId,K)}let G=(E=Z===null||Z===void 0?void 0:Z.properties)===null||E===void 0?void 0:E[g];if(typeof G!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);_=_&&(z||C(Z)),q(G,j)}if(!_)throw Error(`discriminator: "${g}" must be required`);return N;function C({required:j}){return Array.isArray(j)&&j.includes(g)}function q(j,Z){if(j.const)F(j.const,Z);else if(j.enum)for(let G of j.enum)F(G,Z);else throw Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function F(j,Z){if(typeof j!="string"||j in N)throw Error(`discriminator: "${g}" values must be unique strings`);N[j]=Z}}}};e.default=i}),my=V((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}}),Cf=V((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=ki(),o=kf(),n=Ni(),s=my(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((v)=>this.addVocabulary(v)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=ue();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 f=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),If=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ue(),r=rt(),o=Cn(),n=Ci(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(a)=>i(a,a.schema)};function i(a,u){let{gen:l,it:f}=a;f.schemaEnv.root.dynamicAnchors[u]=!0;let m=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=f.errSchemaPath==="#"?f.validateName:c(a);l.if(t._`!${m}`,()=>l.assign(m,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:l,self:f}=a.it,{root:m,baseId:v,localRefs:g,meta:b}=u.root,{schemaId:R}=f.opts,p=new o.SchemaEnv({schema:l,schemaId:R,root:m,baseId:v,localRefs:g,meta:b});return o.compileSchema.call(f,p),(0,n.getValidate)(a,p)}e.default=s}),Of=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ue(),r=rt(),o=Ci(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:l}=i;if(c[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let f=c.slice(1);if(l.allErrors)m();else{let g=a.let("valid",!1);m(g),i.ok(g)}function m(g){if(l.schemaEnv.root.dynamicAnchors[f]){let b=a.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(f)}`);a.if(b,v(b,g),v(l.validateName,g))}else v(l.validateName,g)()}function v(g,b){return b?()=>a.block(()=>{(0,o.callRef)(i,g),a.let(b,!0)}):()=>(0,o.callRef)(i,g)}}e.dynamicRef=s,e.default=n}),gy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=If(),r=me(),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}),_y=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Of(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),Nf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=If(),r=Of(),o=gy(),n=_y(),s=[t.default,r.default,o.default,n.default];e.default=s}),yy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Oi(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),vy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Oi(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),Sy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me(),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}),xf=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yy(),r=vy(),o=Sy(),n=[t.default,r.default,o.default];e.default=n}),by=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),o=rt(),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:c,data:a,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:f,props:m}=l;if(m instanceof t.Name)i.if(t._`${m} !== true`,()=>i.forIn("key",a,(R)=>i.if(g(m,R),()=>v(R))));else if(m!==!0)i.forIn("key",a,(R)=>m===void 0?v(R):i.if(b(m,R),()=>v(R)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function v(R){if(c===!1){if(s.setParams({unevaluatedProperty:R}),s.error(),!f)i.break();return}if(!(0,r.alwaysValidSchema)(l,c)){let p=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:R,dataPropType:r.Type.Str},p),!f)i.if((0,t.not)(p),()=>i.break())}}function g(R,p){return t._`!${R} || !${R}[${p}]`}function b(R,p){let T=[];for(let w in R)if(R[w]===!0)T.push(t._`${p} !== ${w}`);return(0,t.and)(...T)}}};e.default=n}),wy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=me(),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:c,it:a}=n,u=a.items||0;if(u===!0)return;let l=s.const("len",t._`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let m=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(m),()=>f(m,u)),n.ok(m)}a.items=!0;function f(m,v){s.forRange("i",v,l,(g)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:g,dataPropType:r.Type.Num},m),!a.allErrors)s.if((0,t.not)(m),()=>s.break())})}}};e.default=o}),Af=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=by(),r=wy(),o=[t.default,r.default];e.default=o}),$y=V((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"}]}}}}}),Ry=V((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:"#"}}}}}),zy=V((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:"#"}}}}),Py=V((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:{}}}}}),Ey=V((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"}}}}),Ty=V((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}}}}),ky=V((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:[]}}}}),Cy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$y(),r=Ry(),o=zy(),n=Py(),s=Ey(),i=Ty(),c=ky(),a=["/properties"];function u(l){return[t,r,o,n,f(this,s),i,f(this,c)].forEach((m)=>this.addMetaSchema(m,void 0,!1)),this;function f(m,v){return l?m.$dataMetaSchema(v,a):v}}e.default=u}),Iy=V((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=ki(),o=kf(),n=Nf(),s=xf(),i=Af(),c=Ni(),a=Cy(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(b={}){super({...b,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((b)=>this.addVocabulary(b)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:b,meta:R}=this.opts;if(!R)return;a.default.call(this,b),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 f=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var m=ue();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 v=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var g=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})}),Oy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bf(),r=wf(),o=Pf(),n=Nf(),s=xf(),i=Af(),c=Ef(),a=Tf(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u}),Ny=V((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}}}}),xy=V((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"}}}}}),Ay=V((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"}}}}),My=V((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"}}}}),jy=V((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"}}}}),qy=V((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"}}}}),Ly=V((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}}}}),Dy=V((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:[]}}}}),Uy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ny(),r=xy(),o=Ay(),n=My(),s=jy(),i=qy(),c=Ly(),a=Dy(),u=["/properties"];function l(f){return[t,r,o,n,s,m(this,i),c,m(this,a)].forEach((v)=>this.addMetaSchema(v,void 0,!1)),this;function m(v,g){return f?v.$dataMetaSchema(g,u):g}}e.default=l}),Zy=V((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=ki(),o=Oy(),n=Ni(),s=Uy(),i="https://json-schema.org/draft/2020-12/schema";var c=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:v}=this.opts;if(!v)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=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=nr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=ue();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=po();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var f=sr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),Vy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,Z){return{validate:j,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(m(!0),v),"iso-time":t(a(),l),"iso-date-time":t(m(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:z},int64:{type:"number",validate:_},float:{type:"number",validate:C},double:{type:"number",validate:C},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,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,g),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 Z=o.exec(j);if(!Z)return!1;let G=+Z[1],K=+Z[2],ie=+Z[3];return K>=1&&K<=12&&ie>=1&&ie<=(K===2&&r(G)?29:n[K])}function i(j,Z){if(!(j&&Z))return;if(j>Z)return 1;if(j<Z)return-1;return 0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(j){return function(G){let K=c.exec(G);if(!K)return!1;let ie=+K[1],Se=+K[2],ve=+K[3],Pe=K[4],le=K[5]==="-"?-1:1,O=+(K[6]||0),x=+(K[7]||0);if(O>23||x>59||j&&!Pe)return!1;if(ie<=23&&Se<=59&&ve<60)return!0;let y=Se-x*le,d=ie-O*le-(y<0?1:0);return(d===23||d===-1)&&(y===59||y===-1)&&ve<61}}function u(j,Z){if(!(j&&Z))return;let G=new Date("2020-01-01T"+j).valueOf(),K=new Date("2020-01-01T"+Z).valueOf();if(!(G&&K))return;return G-K}function l(j,Z){if(!(j&&Z))return;let G=c.exec(j),K=c.exec(Z);if(!(G&&K))return;if(j=G[1]+G[2]+G[3],Z=K[1]+K[2]+K[3],j>Z)return 1;if(j<Z)return-1;return 0}let f=/t|\s/i;function m(j){let Z=a(j);return function(K){let ie=K.split(f);return ie.length===2&&s(ie[0])&&Z(ie[1])}}function v(j,Z){if(!(j&&Z))return;let G=new Date(j).valueOf(),K=new Date(Z).valueOf();if(!(G&&K))return;return G-K}function g(j,Z){if(!(j&&Z))return;let[G,K]=j.split(f),[ie,Se]=Z.split(f),ve=i(G,ie);if(ve===void 0)return;return ve||u(K,Se)}let b=/\/|:/,R=/^(?:[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 p(j){return b.test(j)&&R.test(j)}let T=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return T.lastIndex=0,T.test(j)}let E=-2147483648,N=2147483647;function z(j){return Number.isInteger(j)&&j<=N&&j>=E}function _(j){return Number.isInteger(j)}function C(){return!0}let q=/[^\\]\\Z/;function F(j){if(q.test(j))return!1;try{return new RegExp(j),!0}catch(Z){return!1}}});var Fy=V((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=Cf(),r=ue(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>r.str`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>r._`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:l,keyword:f,it:m}=c,{opts:v,self:g}=m;if(!v.validateFormats)return;let b=new t.KeywordCxt(m,g.RULES.all.format.definition,"format");if(b.$data)R();else p();function R(){let w=a.scopeValue("formats",{ref:g.formats,code:v.code.formats}),E=a.const("fmt",r._`${w}[${b.schemaCode}]`);c.fail$data((0,r.or)(r._`typeof ${E} != "object"`,r._`${E} instanceof RegExp`,r._`typeof ${E}.compare != "function"`,T(E)))}function p(){let w=b.schema,E=g.formats[w];if(!E||E===!0)return;if(typeof E!="object"||E instanceof RegExp||typeof E.compare!="function")throw Error(`"${f}": format "${w}" does not define "compare" function`);let N=a.scopeValue("formats",{key:w,ref:E,code:v.code.formats?r._`${v.code.formats}${(0,r.getProperty)(w)}`:void 0});c.fail$data(T(N))}function T(w){return r._`${w}.compare(${u}, ${l}) ${n[f].fail} 0`}},dependencies:["format"]};let i=(c)=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i}),Hy=V((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=Vy(),o=Fy(),n=ue(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,l={keywords:!0})=>{if(Array.isArray(l))return a(u,l,r.fullFormats,s),u;let[f,m]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(a(u,l.formats||r.formatNames,f,m),l.keywords)(0,o.default)(u);return u};c.get=(u,l="full")=>{let f=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw Error(`Unknown format "${u}"`);return f};function a(u,l,f,m){var v,g;(v=(g=u.opts.code).formats)!==null&&v!==void 0||(g.formats=n._`require("ajv-formats/dist/formats").${m}`);for(let b of l)u.addFormat(b,f[b])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c}),Mf=Cf(),Jy=Iy(),By=Zy(),Ky=Oo(Hy(),1),Gy=Ky.default;function Ti(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Gy(t),t}var In=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Ti(By.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Fi(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??=Ti(Jy.Ajv2019);return this._ajvDraft7??=Ti(Mf.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)}}},y0=Mf.Ajv;var Wy;Wy=globalThis.crypto?.webcrypto??globalThis.crypto??import("crypto").then((e)=>e.webcrypto);var ir=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e){super(e);this.name=new.target.name,Rt(this,new.target)}},rv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,r){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 \xA73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(r)}`);this.kind=e,this.expected=t,this.received=r}},ov=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`);this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},nv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=e}},sv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`);this.recordedIssuer=e,this.currentIssuer=t}},iv=class extends ir{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`);this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var Ff=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e){super(e??"Unauthorized");this.name="UnauthorizedError",Rt(this,new.target)}};var On=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]),Hf=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(xi(e))}set(e,t){let r=xi(e),o=On.has(e.method),n=!this._entries.has(r);if(!o&&n&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let i of this._entries.keys())if(!On.has(i.slice(0,i.indexOf("\x00")))){this._entries.delete(i),this._cappedSize--;break}}let s=++this._stamp;if(this._entries.set(r,{...t,stamp:s}),n&&!o)this._cappedSize++;return s}delete(e){if(this._entries.delete(xi(e))&&!On.has(e.method))this._cappedSize--}evict(e){let t=`${e}\x00`,r=On.has(e);for(let o of this._entries.keys())if(o.startsWith(t)){if(this._entries.delete(o),!r)this._cappedSize--}}clear(){this._entries.clear(),this._cappedSize=0}};function xi(e){return`${e.method}\x00${JSON.stringify([e.partition??"",e.params??""])}`}function Ai(e,t){return t===void 0?e:`${e}\x00${t}`}var Jf=86400000,av=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity="";constructor(e,t,r=()=>{},o="",n=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=r,this._cachePartition=o,this._now=n}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e==="public"?"":this._cachePartition])}async _probe(e,t){let r={method:e,params:t??""},o=this._partitionFor("private"),n=await this._store.get({...r,partition:o});if(n!==void 0)return n;let s=this._partitionFor("public");if(s===o)return;let i=await this._store.get({...r,partition:s});return i?.scope==="public"?i:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,"")}async _deleteBoth(e,t){let r=this._partitionFor("private"),o=this._partitionFor("public");try{await this._store.delete({method:e,params:t,partition:r})}catch(n){this._reportError(n)}if(o!==r)try{await this._store.delete({method:e,params:t,partition:o})}catch(n){this._reportError(n)}}async evictKey(e,t){let r=Ai(e,t),o=this._evictionGeneration.get(r);if(o!==void 0)this._evictionGeneration.set(r,o+1);await this._deleteBoth(e,t)}captureGeneration(e,t){let r=Ai(e,t),o=this._evictionGeneration.get(r)??0;return this._evictionGeneration.set(r,o),o}async write(e,t,r,o){if((this._evictionGeneration.get(Ai(e,o?.params))??0)!==r)return;let n=o?.params??"",s=this._partitionFor("private"),i=this._partitionFor("public"),c=(o?.scope??"private")==="public"?i:s;try{await this._store.set({method:e,params:n,partition:c},{value:cv(t),expiresAt:o?.expiresAt,scope:o?.scope})}catch(a){this._reportError(a)}if(i!==s)try{await this._store.delete({method:e,params:n,partition:c===s?i:s})}catch(a){this._reportError(a)}}async read(e,t){let r=await this._probe(e,t);if(r?.expiresAt===void 0||!(r.expiresAt>this.now()))return;try{let o=JSON.parse(r.value);if(typeof o!=="object"||o===null||Array.isArray(o))throw TypeError("cached document is not an object");return{value:o}}catch(o){this._reportError(o),await this._deleteBoth(e,t??"");return}}resetForReconnect(){if(!this._isUserSupplied)this._store.clear();this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=""}async toolDefinition(e){let t=await this._probe("tools/list");if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let r=this._decodeListTools(t),o=new Map;if(r!==void 0)for(let n of r.tools)o.set(n.name,n);this._toolIndex={stamp:t.stamp,byName:o}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let r=await this._probe("tools/list");if(r===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==r.stamp){let o=this._decodeListTools(r)??{tools:[]},n=new Map;for(let s of o.tools){let i=t(s);if(i!==void 0)n.set(s.name,i)}this._toolOutputValidatorIndex={stamp:r.stamp,byName:n}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every((r)=>r!==null&&typeof r==="object"))throw TypeError("cached tools/list document has a malformed tools array");return t}catch(t){this._reportError(t);return}}};function cv(e){let t;try{t=JSON.stringify(e)}catch(r){throw TypeError(`cache value is not JSON-serializable: ${r instanceof Error?r.message:String(r)}`)}if(typeof t!=="string")throw TypeError("cache value is not JSON-serializable: it has no JSON representation");return t}var uv=Symbol.for("mcp.authSeamEscape");function lv(e){return(typeof e==="object"&&e!==null||typeof e==="function")&&e[uv]===!0}var dv=-32022,fv=new Set([-32001,-32020,-32021]);function hv(e,t){switch(e.kind){case"result":return pv(e.result,t);case"rpc-error":return Bf(e,t);case"http-error":return mv(e,t);case"network-error":return jf(e.error,t);case"unusable-reply":return{kind:"error",error:new X(ee.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${Kf(e.error)})`,{cause:e.error},{cause:e.error})};case"auth-required":return{kind:"error",error:e.error};case"closed":if(t.transportKind==="stdio")return{kind:"legacy"};return jf(Error("Connection closed during the version negotiation probe"),t);case"timeout":if(t.transportKind==="stdio")return{kind:"legacy"};return{kind:"error",error:new X(ee.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function pv(e,t){let r=ft($n).validateResult("server/discover",e);if(!r.ok)return{kind:"legacy"};let o=r.value.supportedVersions,n=t.clientModernVersions.find((s)=>o.includes(s));if(n!==void 0)return{kind:"modern",version:n,discover:r.value};if(t.fallbackAvailable)return{kind:"legacy"};return{kind:"error",error:new lo({supported:[...o],requested:t.requestedVersion})}}function Bf(e,t){let{code:r,message:o,data:n}=e;if(r===dv){let s=_v(n);if(s===void 0)return{kind:"legacy"};let i=new lo({supported:s,requested:yv(n)??t.requestedVersion},o),c=uo(s),a=t.clientModernVersions.find((u)=>c.includes(u));if(a!==void 0)return{kind:"corrective",version:a,error:i};if(c.length>0)return{kind:"error",error:i};return t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:i}}if(fv.has(r))return{kind:"legacy"};return{kind:"legacy"}}function mv(e,t){if(e.status===401||e.status===403){let o=e.status===403;return{kind:"error",error:new co(o?ee.ClientHttpForbidden:ee.ClientHttpAuthentication,`Version negotiation failed: ${o?"the server denied access (HTTP 403)":"the server requires authorization (HTTP 401)"}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:"error",error:new co(ee.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let r=vv(e.body);if(r!==void 0)return Bf(r,t);return{kind:"legacy"}}function jf(e,t){if(t.environment==="browser"&&gv(e))return{kind:"legacy"};return{kind:"error",error:new X(ee.EraNegotiationFailed,`Version negotiation probe failed: ${Kf(e)}`,{cause:e},{cause:e})}}function gv(e){return e instanceof TypeError||e instanceof Error&&e.name==="TypeError"}function Kf(e){return e instanceof Error?e.message:String(e)}function _v(e){if(typeof e!=="object"||e===null)return;let t=e.supported;if(!Array.isArray(t)||t.length===0||!t.every((r)=>typeof r==="string"))return;return t}function yv(e){if(typeof e!=="object"||e===null)return;let t=e.requested;return typeof t==="string"?t:void 0}function vv(e){if(e===void 0||e==="")return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=="object"||t===null)return;let r=t.error;if(typeof r!=="object"||r===null)return;let{code:o,message:n,data:s}=r;if(typeof o!=="number")return;return{code:o,message:typeof n==="string"?n:"",data:s}}var bv="legacy";function $v(e,t){let r=e?.mode??bv;if(r==="legacy")return{kind:"legacy"};let o=e?.probe??{};if(typeof r==="object"){if(!ht(r.pin))throw TypeError(`versionNegotiation: { pin: '${r.pin}' } is not a modern protocol revision \u2014 pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:"pin",version:r.pin,probe:o}}let n=t?uo(t):[];return{kind:"auto",modernVersions:n.length>0?n:[...mi],fallbackAvailable:t?gi(t).length>0:!0,probe:o}}function qf(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?"browser":"node"}function Lf(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var zv=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(t){this._transport=t,this._savedOnMessage=t.onmessage,this._savedOnError=t.onerror,this._savedOnClose=t.onclose}static async open(t){let r=new e(t);t.onmessage=(o)=>{let n=r._pending;if(n!==void 0&&(or(o)||fo(o))&&o.id===n.id){if(r._pending=void 0,or(o))n.resolve({kind:"response",result:o.result});else n.resolve({kind:"response",error:o.error});return}},t.onerror=(o)=>{r._savedOnError?.(o)},t.onclose=()=>{let o=r._pending;if(o!==void 0)r._pending=void 0,o.resolve({kind:"closed"});r._closeDelivered=!0,r._savedOnClose?.()};try{await t.start()}catch(o){throw r.detach(),o}return r}async exchange(t,r){let o=`server-discover-probe-${++this._probeCounter}`;return new Promise((n)=>{let s=!1,i=(a)=>{if(s)return;if(s=!0,clearTimeout(c),this._pending?.id===o)this._pending=void 0;n(a)},c=setTimeout(()=>i({kind:"timeout"}),r);this._pending={id:o,resolve:i},this._transport.send(t(o)).catch((a)=>i({kind:"send-error",error:a}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let t=this._savedOnClose,r=this._transport,o=!1,n=()=>{if(!o){o=!0;return}t()};r.onclose=n,ji.set(r,()=>{if(r.onclose===n)r.onclose=t})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let t=this._transport,r=t.start,o=!0;t.start=async function(){if(o){o=!1,t.start=r;return}return r.call(t)}}},ji=new WeakMap;function Df(e){let t=ji.get(e);ji.delete(e),t?.()}function Ev(e,t,r,o){return{jsonrpc:"2.0",id:e,method:"server/discover",params:{_meta:ft(t).outboundEnvelope({protocolVersion:t,clientInfo:r,clientCapabilities:o})}}}function kv(e){if(e instanceof X&&e.code===ee.ClientHttpUnexpectedContent)return!0;return e instanceof Error&&e.name==="SyntaxError"}function Cv(e,t){switch(e.kind){case"response":return e.error===void 0?{kind:"result",result:e.result}:{kind:"rpc-error",...e.error};case"send-error":{let r=e.error;if(lv(r)||r instanceof Ff||r instanceof Error&&r.name==="UnauthorizedError")return{kind:"auth-required",error:r};if(r instanceof co){let o=r.data?.text;return{kind:"http-error",status:r.data.status,body:typeof o==="string"?o:void 0,statusText:r.data.statusText}}if(kv(r))return{kind:"unusable-reply",error:r};return{kind:"network-error",error:r}}case"closed":return{kind:"closed"};case"timeout":return{kind:"timeout",timeoutMs:t}}}async function Gf(e,t){let r=e.probe.timeoutMs??t.defaultTimeoutMs,o=Math.max(0,e.probe.maxRetries??0),n=e.kind==="pin"?[e.version]:e.modernVersions,s=e.kind==="auto"&&e.fallbackAvailable,i=await zv.open(t.transport),c=async()=>{let u=n[0],l=!1,f=o;for(;;){let m=await i.exchange((b)=>Ev(b,u,t.clientInfo,t.capabilities),r);if(m.kind==="timeout"&&f>0){f--;continue}let v=Cv(m,r),g=hv(v,{clientModernVersions:n,requestedVersion:u,fallbackAvailable:s,environment:t.environment,transportKind:t.transportKind});switch(g.kind){case"modern":return{era:"modern",version:g.version,discover:g.discover};case"corrective":if(l)throw g.error;l=!0,u=g.version;continue;case"legacy":{let b=v.kind==="closed"?"the connection closed during the server/discover probe":void 0;if(e.kind==="pin")throw new X(ee.EraNegotiationFailed,b===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${b} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new X(ee.EraNegotiationFailed,b===void 0?"Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to":`Version negotiation failed: ${b} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(b!==void 0&&t.disposableProbe!==!0)throw new X(ee.EraNegotiationFailed,`Version negotiation failed: ${b} (this transport probed in place \u2014 the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:"legacy"}}case"error":throw g.error}}},a;try{a=await c()}catch(u){throw i.detach(),u}return i.release(),a}function Iv(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,"_dispose"))return;let r=e._serverParams;return typeof r==="object"&&r!==null&&typeof r.command==="string"?r:void 0}async function Ov(e,t,r,o){let s=new t.constructor({...r,stderr:"ignore"}),i=t.close,c=!1,a,u=new Promise((f,m)=>{a=()=>m(Uf())});t.close=async function(){return c=!0,a?.(),i.call(t)};let l;try{let f=Gf(e,{...o,transport:s,transportKind:"stdio",disposableProbe:!0});f.catch(()=>{}),l=await Promise.race([f,u])}finally{await Nv(s),t.close=i}if(c)throw Uf();return l}function Uf(){return new X(ee.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}async function Nv(e){try{let t=e._dispose;await(typeof t==="function"?t.call(e):e.close())}catch{}}function Zf(e){let t=e._meta?.[Oa];return Ri.Implementation(t)?t:void 0}function Nn(e,t){if(!e||t===null||typeof t!=="object")return;if(e.type==="object"&&e.properties&&typeof e.properties==="object"){let r=t,o=e.properties;for(let n of Object.keys(o)){let s=o[n];if(r[n]===void 0&&Object.prototype.hasOwnProperty.call(s,"default"))r[n]=s.default;if(r[n]!==void 0)Nn(s,r[n])}}if(Array.isArray(e.anyOf)){for(let r of e.anyOf)if(typeof r!=="boolean")Nn(r,t)}if(Array.isArray(e.oneOf)){for(let r of e.oneOf)if(typeof r!=="boolean")Nn(r,t)}}function Wf(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}function xv(e){if(typeof e==="object"&&e!==null){if(e.kind==="legacy"&&!("supportedVersions"in e)&&!("discover"in e))return e;if(e.kind==="modern"&&Av.safeParse(e.discover).success)return e}throw new X(ee.EraNegotiationFailed,"connect({ prior }): unrecognized prior \u2014 expected { kind: 'modern', discover } or { kind: 'legacy' }")}var Vf={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]},Mv=64,Mi={},qi=class extends Pi{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;static{Mi.enforceStrictCapabilities=(e)=>e._enforceStrictCapabilities,Mi.walkPages=(e,t,r,o)=>e._walkPages(t,r,o),Mi.readResource=(e,t,r)=>e._readResource(t,r)}_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new X(ee.ConnectionClosed,"subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");for(let t of this._listenState.values())t.settle({cause:"remote",error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t);if(this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new In,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=df(t?.inputRequired),this._cache=new av(t?.responseCacheStore??new Hf,t?.responseCacheStore!==void 0,(r)=>this._reportStoreError(r),t?.cachePartition??""),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??Mv,t?.listChanged)this._listChangedConfig=t.listChanged}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&ht(this._negotiatedProtocolVersion)&&Rn(e))return"drop"}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e===void 0)return;return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){if(!this._inputRequiredDriverConfig.autoFulfill)return Promise.reject(new X(ee.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance \u2014 pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:"input_required",method:t.request.method}));return mf({getRequestHandler:(r)=>this._getRequestHandler(r),buildContext:(r)=>this.buildContext(r,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t)}_setupListChangedHandlers(e){if(e.tools&&this._serverCapabilities?.tools?.listChanged)this._setupListChangedHandler("tools","notifications/tools/list_changed",e.tools,async()=>(await this.listTools(void 0,{cacheMode:"refresh"})).tools);if(e.prompts&&this._serverCapabilities?.prompts?.listChanged)this._setupListChangedHandler("prompts","notifications/prompts/list_changed",e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:"refresh"})).prompts);if(e.resources&&this._serverCapabilities?.resources?.listChanged)this._setupListChangedHandler("resources","notifications/resources/list_changed",e.resources,async()=>(await this.listResources(void 0,{cacheMode:"refresh"})).resources)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=Ei(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error("Cannot configure version negotiation after connecting to transport");this._versionNegotiation=e}_wrapHandler(e,t){if(e==="elicitation/create")return async(r,o)=>{let n=ft(this._negotiatedProtocolVersion),s=n.validateRequest("elicitation/create",r);if(!s.ok&&s.reason==="not-in-era")s=n.validateInputRequest("elicitation/create",r);if(!s.ok)throw new be(s.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,s.reason==="not-in-era"?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation request: ${s.message}`);let{params:i}=s.value;i.mode=i.mode??"form";let{supportsFormMode:c,supportsUrlMode:a}=Wf(this._capabilities.elicitation);if(i.mode==="form"&&!c)throw new be(ne.InvalidParams,"Client does not support form-mode elicitation requests");if(i.mode==="url"&&!a)throw new be(ne.InvalidParams,"Client does not support URL-mode elicitation requests");let u=await t(r,o),l=n.validateResult("elicitation/create",u);if(!l.ok&&l.reason==="not-in-era")l=n.validateInputResponse("elicitation/create",u);if(!l.ok)throw new be(l.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,l.reason==="not-in-era"?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation result: ${l.message}`);let f=l.value,m=i.mode==="form"?i.requestedSchema:void 0;if(i.mode==="form"&&f.action==="accept"&&f.content&&m&&this._capabilities.elicitation?.form?.applyDefaults)try{Nn(m,f.content)}catch{}return f};if(e==="sampling/createMessage")return async(r,o)=>{let n=ft(this._negotiatedProtocolVersion),s=n.validateRequest("sampling/createMessage",r);if(!s.ok&&s.reason==="not-in-era")s=n.validateInputRequest("sampling/createMessage",r);if(!s.ok)throw new be(s.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,s.reason==="not-in-era"?"No wire schema for sampling/createMessage in the resolved era":`Invalid sampling request: ${s.message}`);let{params:i}=s.value,c=await t(r,o),a=Boolean(i.tools||i.toolChoice),u=n.samplingResultVariant(a,c);if(!u.ok&&u.reason==="not-in-era")u=n.validateInputResponse("sampling/createMessage",c);if(!u.ok)throw new be(u.reason==="not-in-era"?ne.InternalError:ne.InvalidParams,u.reason==="not-in-era"?"No result schema for sampling/createMessage in the resolved era":`Invalid sampling result: ${u.message}`);return u.value};return t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new X(ee.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,xv(t.prior),t);let r=$v(this._versionNegotiation,this._supportedProtocolVersionsOption);if(r.kind!=="legacy")return this._connectNegotiated(e,r,t);return this._connectPlainLegacy(e,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let r=this._negotiatedProtocolVersion;if(r!==void 0)e.setProtocolVersion?.(r);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let r=gi(this._supportedProtocolVersions);try{let o=r[0];if(o===void 0)throw new X(ee.EraNegotiationFailed,"Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");let n=await this.request({method:"initialize",params:{protocolVersion:o,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);if(!r.includes(n.protocolVersion))throw Error(`Server's protocol version is not supported: ${n.protocolVersion}`);if(this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion)e.setProtocolVersion(n.protocolVersion);if(this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._negotiatedProtocolVersion=n.protocolVersion,this._listChangedConfig)this._setupListChangedHandlers(this._listChangedConfig)}catch(o){throw this.close(),o}}async _connectNegotiated(e,t,r){if(e.sessionId!==void 0){await super.connect(e);let n=this._negotiatedProtocolVersion;if(n!==void 0&&e.setProtocolVersion)e.setProtocolVersion(n);return}this._resetConnectionState();let o;try{let n=Lf(e),s={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:qf(),defaultTimeoutMs:r?.timeout??ho},i=n==="stdio"?Iv(e):void 0;o=i===void 0?await Gf(t,{...s,transport:e,transportKind:n}):await Ov(t,e,i,s)}catch(n){throw await e.close().catch(()=>{}),Df(e),n}if(Df(e),await super.connect(e),o.era==="legacy"){await this._legacyHandshake(e,r);return}if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=Zf(o.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.discover.instructions,this._discoverResult=o.discover,this._negotiatedProtocolVersion=o.version,e.setProtocolVersion)e.setProtocolVersion(o.version);if(this._listChangedConfig){let n=this._listChangedConfig,s=this._serverCapabilities,i={...n.tools&&s?.tools?.listChanged&&{tools:n.tools},...n.prompts&&s?.prompts?.listChanged&&{prompts:n.prompts},...n.resources&&s?.resources?.listChanged&&{resources:n.resources}},c=!0;try{this._setupListChangedHandlers(i)}catch(u){c=!1,this.onerror?.(u instanceof Error?u:Error(String(u)))}let a=c?{...i.tools&&{toolsListChanged:!0},...i.prompts&&{promptsListChanged:!0},...i.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let u=new AbortController,l=()=>u.abort(r?.signal?.reason);if(r?.signal?.aborted)l();r?.signal?.addEventListener("abort",l);try{this._autoOpenedSubscription=await this.listen(a,{timeout:r?.timeout,signal:u.signal})}catch(f){if(r?.signal?.aborted)throw await this.close().catch(()=>{}),f;this.onerror?.(f instanceof Error?f:Error(String(f)))}finally{r?.signal?.removeEventListener("abort",l)}}}}async _connectFromPrior(e,t,r){if(t.kind==="legacy")return this._connectPlainLegacy(e,r);let o=t.discover;this._resetConnectionState();let n=this._supportedProtocolVersionsOption,s=(n&&uo(n).length>0?uo(n):mi).find((i)=>o.supportedVersions.includes(i));if(s===void 0)throw new X(ee.EraNegotiationFailed,"connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");if(await super.connect(e),this._discoverResult=o,this._serverCapabilities=o.capabilities,this._serverVersion=Zf(o),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.instructions,this._negotiatedProtocolVersion=s,e.setProtocolVersion?.(s),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(i){this.onerror?.(i instanceof Error?i:Error(String(i)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;if(t!==void 0)return`${t.name}@${t.version}`;return e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e===void 0)return;return ht(e)?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new X(ee.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new X(ee.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new X(ee.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new X(ee.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new X(ee.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new X(ee.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"initialize":break;case"server/discover":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new X(ee.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new X(ee.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new X(ee.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new X(ee.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},e)}async discover(e){let t=await this._requestWithSchema({method:"server/discover"},Av,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:"completion/complete",params:e},t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list"),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:"prompts/list",params:e},t);let r=await this._serveFromCache("prompts/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("prompts/list",e,t,(o)=>o.prompts)}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list"),{resources:[]};if(e?.cursor!==void 0)return this.request({method:"resources/list",params:e},t);let r=await this._serveFromCache("resources/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("resources/list",e,t,(o)=>o.resources)}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list"),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:"resources/templates/list",params:e},t);let r=await this._serveFromCache("resources/templates/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("resources/templates/list",e,t,(o)=>o.resourceTemplates)}async _listAllPages(e,t,r,o,n){let s=r?.cacheMode==="bypass",i=this._cache.captureGeneration(e),c=(u)=>{let l=u===void 0?t&&{...t}:{...t,cursor:u};return this.request({method:e,...l&&{params:l}},r)},a=await this._walkPages(e,c,o);if(delete a.nextCursor,n?.(a),s)return a;return await this._cache.write(e,a,i,this._freshness(a)),a}async _walkPages(e,t,r){let o=await t(void 0),n=o.nextCursor,s=o,i=1;while(n!==void 0){if(this._listMaxPages!==0&&i>=this._listMaxPages)throw new X(ee.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let c=await t(n);if(c.nextCursor===n&&JSON.stringify(r(c))===JSON.stringify(r(s)))break;r(o).push(...r(c)),s=c,n=c.nextCursor,i++}return o}_freshness(e,t){let r=e,o=typeof r.ttlMs==="number"?r.ttlMs:this._defaultCacheTtlMs,n=r.cacheScope==="public"?"public":"private";return{expiresAt:this._cache.now()+Math.min(Math.max(0,o),Jf),scope:n,params:t}}async _serveFromCache(e,t,r){if(r?.cacheMode==="bypass"||r?.cacheMode==="refresh")return;let o=await this._cache.read(e,t).catch((n)=>void this._reportStoreError(n));if(o!==void 0){if(r?.signal?.aborted){let n=r.signal.reason;throw n instanceof X?n:new X(ee.RequestTimeout,String(n))}return o.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(!e.outputSchema)return;try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(t){return{ok:!1,compileError:t}}}async _resolveXMcpHeaderScan(e,t){let r=t??await this._cache.toolDefinition(e);return r===void 0?void 0:wi(r.inputSchema)}async readResource(e,t){let{result:r}=await this._readResource(e,t);return r}async _readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(r!==void 0)return{result:r,cached:!0};let o=this._cache.captureGeneration("resources/read",e.uri),n=await this.request({method:"resources/read",params:e},t);if(t?.cacheMode!=="bypass"){let s=this._freshness(n,e.uri);if(s.expiresAt>this._cache.now())await this._cache.write("resources/read",n,o,s);else if(t?.cacheMode==="refresh")await this._cache.evictKey("resources/read",e.uri)}return{result:n,cached:!1}}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},t)}async listen(e,t){if(this.transport===void 0)throw new X(ee.NotConnected,"Not connected");let r=this._negotiatedProtocolVersion;if(r===void 0||!ht(r))throw new X(ee.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${r??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:r});if(t?.signal?.aborted){let w=t.signal.reason;throw w instanceof X?w:new X(ee.RequestTimeout,String(w))}let o=new AbortController,n=`listen:${this._nextListenId++}`,s="opening",i,c,a,u,l=new Promise((w,E)=>{a=w,u=E}),f,m=new Promise((w)=>{f=w}),v=(w)=>{if(s==="closed")return;let E=s==="opening";if(i!==void 0)clearTimeout(i),i=void 0;if("ack"in w){s="open",a(w.ack);return}if(s="closed",c!==void 0)t?.signal?.removeEventListener("abort",c);if(this._listenState.delete(n),o.abort(),f(w.cause),E)u(w.error??new X(ee.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},g=async()=>{o.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:n}}).catch(()=>{})},b=async()=>{if(s==="closed")return;v({cause:"local"}),await g()};this._listenState.set(n,{settle:v});let R=t?.timeout??ho;if(i=setTimeout(()=>{v({cause:"remote",error:new X(ee.RequestTimeout,"subscriptions/listen ack timed out",{timeout:R})}),g().catch(()=>{})},R),t?.signal){let w=t.signal;c=()=>{if(s==="closed")return;let E=w.reason;v({cause:"local",error:E instanceof Error?E:Error(String(E??"Aborted"))}),g().catch(()=>{})},w.addEventListener("abort",c,{once:!0})}let p={jsonrpc:"2.0",id:n,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},T=(w)=>{v({cause:"remote",error:w instanceof Error?w:Error(String(w))})};try{this.transport.send(p,{requestSignal:o.signal,onRequestStreamEnd:()=>v({cause:"remote",error:Error("subscriptions/listen: stream ended")})}).catch(T)}catch(w){T(w)}return{honoredFilter:await l,close:b,closed:m}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(Vf,e.method)?Vf[e.method]:void 0;if(e.method==="notifications/resources/updated"){let o=e.params?.uri;if(typeof o==="string")this._cache.evictKey("resources/read",o)}else if(r!==void 0)for(let o of r)this._cache.evict(o);if(e.method==="notifications/subscriptions/acknowledged"){let o=e.params?._meta?.[Mh],n=typeof o==="string"?this._listenState.get(o):void 0;if(n!==void 0){let s=this._wireCodec().validateNotification("notifications/subscriptions/acknowledged",e);n.settle({ack:s.ok?s.value.params.notifications:{}});return}}if(e.method==="notifications/cancelled"){let o=e.params?.requestId,n=typeof o==="string"?this._listenState.get(o):void 0;if(n!==void 0){n.settle({cause:"remote",error:Error("subscriptions/listen: server cancelled the subscription")});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,r=typeof t==="string"?this._listenState.get(t):void 0;if(r!==void 0){if(fo(e))r.settle({cause:"remote",error:be.fromError(e.error.code,e.error.message,e.error.data)});else r.settle({cause:"graceful",error:new X(ee.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new X(ee.ConnectionClosed,"Connection closed");for(let t of this._listenState.values())t.settle({cause:"remote",error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let r=this.getProtocolEra()==="modern"&&qf()!=="browser",o=async()=>{if(!r)return t;let a;try{a=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(l){this._reportStoreError(l)}if(!a?.valid||a.declarations.length===0)return t;let u=uf(a.declarations,e.arguments);return Object.keys(u).length===0?t:{...t,headers:{...t?.headers,...u}}},n=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,(a)=>this._compileOutputValidator(a)).catch((a)=>void this._reportStoreError(a)):this._compileOutputValidator(t.toolDefinition),s=()=>{if(n===void 0||n.ok)return;let a=n.compileError,u=(a instanceof Error?a.message:String(a)).slice(0,200);throw new be(ne.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${u}`)};s();let i;try{i=await this.request({method:"tools/call",params:e},await o())}catch(a){let u=a instanceof be&&a.code===rr;if(!r||!u||t?.toolDefinition!==void 0)throw a;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:"refresh"};await this._cache.evict("tools/list"),await this.listTools(void 0,l).catch((f)=>this._reportStoreError(f)),n=await this._cache.outputValidator(e.name,(f)=>this._compileOutputValidator(f)).catch((f)=>void this._reportStoreError(f)),s(),i=await this.request({method:"tools/call",params:e},await o())}let c=n!==void 0&&n.ok?n.validator:void 0;if(c){if(i.structuredContent===void 0&&!i.isError)throw new be(ne.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent!==void 0&&!i.isError)try{let a=c(i.structuredContent);if(!a.valid)throw new be(ne.InvalidParams,`Structured content does not match the tool's output schema: ${a.errorMessage}`)}catch(a){if(a instanceof be)throw a;throw new be(ne.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return i}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list"),{tools:[]};if(e?.cursor!==void 0){let o=await this.request({method:"tools/list",params:e},t);return this._excludeInvalidXMcpHeaderTools(o),o}let r=await this._serveFromCache("tools/list",void 0,t);if(r!==void 0)return r;return this._listAllPages("tools/list",e,t,(o)=>o.tools,(o)=>this._excludeInvalidXMcpHeaderTools(o))}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!=="modern"||!this.transport||Lf(this.transport)==="stdio")return;let t=e.tools.filter((r)=>{let o=wi(r.inputSchema);if(!o.valid)return console.warn(`[mcp-sdk] excluding tool '${r.name}' from tools/list: invalid x-mcp-header declaration \u2014 ${o.reason}`),!1;return!0});if(t.length!==e.tools.length)e.tools=t}_setupListChangedHandler(e,t,r,o){let n=zn(hT,r);if(!n.success)throw Error(`Invalid ${e} listChanged options: ${n.error.message}`);if(typeof r.onChanged!=="function")throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:i}=n.data,{onChanged:c}=r,a=async()=>{if(!s){c(null,null);return}try{c(null,await o())}catch(l){c(l instanceof Error?l:Error(String(l)),null)}},u=()=>{if(i){let l=this._listChangedDebounceTimers.get(e);if(l)clearTimeout(l);let f=setTimeout(a,i);this._listChangedDebounceTimers.set(e,f)}else a()};this.setNotificationHandler(t,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var D$=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Fe(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 Fe(this,e)}constructor(e,t,r){super(`SSE error: ${t}`);this.code=e,this.event=r,Rt(this,new.target)}};class jv extends qi{async request(e,t,r){if(qv(t))return await Lt(r?.signal,()=>super.request(e,t,r));return await Lt(t?.signal,()=>super.request(e,t))}async callTool(...e){return await Lt(e[1]?.signal,()=>super.callTool(...e))}async listTools(...e){return await Lt(e[1]?.signal,()=>super.listTools(...e))}async listResources(...e){return await Lt(e[1]?.signal,()=>super.listResources(...e))}async listResourceTemplates(...e){return await Lt(e[1]?.signal,()=>super.listResourceTemplates(...e))}async readResource(...e){return await Lt(e[1]?.signal,()=>super.readResource(...e))}}function qv(e){return e!==void 0&&"~standard"in e}async function Lt(e,t){try{return await t()}catch(r){if(e?.aborted&&r instanceof X&&r.code===ee.RequestTimeout&&!(e.reason instanceof X))throw e.reason;throw R7(r)}}export{jv as LoopbackMcpClient};
|
|
70
70
|
|
|
71
|
-
//# debugId=
|
|
71
|
+
//# debugId=850CE1674C37066364756E2164756E21
|