skill-creator 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cli.js +8896 -2614
  2. package/dist/cli.js.map +4 -4
  3. package/dist/daemon.js +6773 -2243
  4. package/dist/daemon.js.map +4 -4
  5. package/dist/package.json +1 -1
  6. package/dist/webui/_app/immutable/assets/0.Ce1ZW9xU.css +2 -0
  7. package/dist/webui/_app/immutable/assets/SettingsPage.DclbL_Wf.css +1 -0
  8. package/dist/webui/_app/immutable/chunks/{CPbfZBJo.js → 1vzbRbJ2.js} +2 -2
  9. package/dist/webui/_app/immutable/chunks/3x7J55ll.js +2 -0
  10. package/dist/webui/_app/immutable/chunks/825uWMzf.js +5 -0
  11. package/dist/webui/_app/immutable/chunks/{ByW1yjUW.js → B1KITIB4.js} +1 -1
  12. package/dist/webui/_app/immutable/chunks/{DwIX6ZFE.js → B3Ni2QLt.js} +1 -1
  13. package/dist/webui/_app/immutable/chunks/{oxP0dM6z.js → BHJkoxm8.js} +1 -1
  14. package/dist/webui/_app/immutable/chunks/BNaxFL8-.js +3 -0
  15. package/dist/webui/_app/immutable/chunks/Bbl7uOhW.js +5 -0
  16. package/dist/webui/_app/immutable/chunks/Bs7CGcv2.js +1 -0
  17. package/dist/webui/_app/immutable/chunks/{C5MrAfWf.js → C-AVEJqG.js} +1 -1
  18. package/dist/webui/_app/immutable/chunks/C67g-p2T.js +1 -0
  19. package/dist/webui/_app/immutable/chunks/{B0-OMyfG.js → C8EbtR4g.js} +1 -1
  20. package/dist/webui/_app/immutable/chunks/{CgxChsUX.js → CoasO80Q.js} +1 -1
  21. package/dist/webui/_app/immutable/chunks/{BOPkZ98B.js → CsxdqaKQ.js} +1 -1
  22. package/dist/webui/_app/immutable/chunks/{D3qCeXbe.js → D-2QBE8y.js} +1 -1
  23. package/dist/webui/_app/immutable/chunks/{j76fpbnQ.js → D8zgcaSD.js} +1 -1
  24. package/dist/webui/_app/immutable/chunks/D_Wlt2rL.js +1 -0
  25. package/dist/webui/_app/immutable/chunks/{Cr5YUwJg.js → Dga0ODor.js} +1 -1
  26. package/dist/webui/_app/immutable/chunks/DgfWqxEz.js +1 -0
  27. package/dist/webui/_app/immutable/chunks/Do5hAkYk.js +1 -0
  28. package/dist/webui/_app/immutable/chunks/DovL68qD.js +1 -0
  29. package/dist/webui/_app/immutable/chunks/HAi-5CYL.js +6 -0
  30. package/dist/webui/_app/immutable/chunks/KjcaLSMo.js +1 -0
  31. package/dist/webui/_app/immutable/chunks/N4Ne5qCB.js +1 -0
  32. package/dist/webui/_app/immutable/chunks/{8hp3I3ac.js → _g2_n9ND.js} +1 -1
  33. package/dist/webui/_app/immutable/chunks/{DiaaOubc.js → iz1cEkZC.js} +1 -1
  34. package/dist/webui/_app/immutable/chunks/{DKepoBN5.js → nznK1lJN.js} +1 -1
  35. package/dist/webui/_app/immutable/entry/{app.BQ4neDVJ.js → app.BbnICwcR.js} +2 -2
  36. package/dist/webui/_app/immutable/entry/start.BCFPuXD4.js +1 -0
  37. package/dist/webui/_app/immutable/nodes/0.C0a-_hPX.js +229 -0
  38. package/dist/webui/_app/immutable/nodes/{1.BhX-6aiQ.js → 1.CY3UBo6A.js} +1 -1
  39. package/dist/webui/_app/immutable/nodes/{2.C7Br-rQ1.js → 2.BfHkaxce.js} +1 -1
  40. package/dist/webui/_app/version.json +1 -1
  41. package/dist/webui/index.html +22 -20
  42. package/package.json +6 -5
  43. package/dist/webui/_app/immutable/assets/0.Dbnkcm0y.css +0 -2
  44. package/dist/webui/_app/immutable/chunks/B5sWuF6v.js +0 -1
  45. package/dist/webui/_app/immutable/chunks/BdXWsCWd.js +0 -3
  46. package/dist/webui/_app/immutable/chunks/BkjUgGsE.js +0 -1
  47. package/dist/webui/_app/immutable/chunks/CQD9uzpA.js +0 -1
  48. package/dist/webui/_app/immutable/chunks/DXKynIUR.js +0 -1
  49. package/dist/webui/_app/immutable/chunks/E8LHILEh.js +0 -1
  50. package/dist/webui/_app/immutable/chunks/myIHotqu.js +0 -2
  51. package/dist/webui/_app/immutable/chunks/p_ObVaZi.js +0 -5
  52. package/dist/webui/_app/immutable/entry/start.BqwTCU7F.js +0 -1
  53. package/dist/webui/_app/immutable/nodes/0.uOFdFHyI.js +0 -234
@@ -0,0 +1,229 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/3x7J55ll.js","../chunks/CmCJ0SKP.js","../chunks/_g2_n9ND.js","../chunks/xihTtKlq.js","../chunks/D_Wlt2rL.js","../chunks/BkEnd9_Z.js","../chunks/Do5hAkYk.js","../chunks/BT2vrlul.js","../chunks/CsxdqaKQ.js","../chunks/1vzbRbJ2.js","../chunks/D-2QBE8y.js","../chunks/1aUphu7Y.js","../chunks/DnPeA-9c.js","../chunks/CpRvgjpe.js","../chunks/BIfnT_mK.js","../chunks/N4Ne5qCB.js","../chunks/Bs27XW8_.js","../chunks/KjcaLSMo.js","../chunks/825uWMzf.js","../chunks/BEPs9Z9s.js","../chunks/Bl0jjuyR.js","../chunks/CI1OXbBG.js","../chunks/B1KITIB4.js","../chunks/BHJkoxm8.js","../chunks/C8EbtR4g.js","../assets/shell.U4CQV8re.css","../chunks/DOjT7y5f.js","../chunks/F_BrNiaz.js","../chunks/ChvFFUWR.js","../chunks/s48N5eaK.js","../chunks/DKQHhdJ1.js","../chunks/D8Der6oM.js","../assets/ProviderView.BKgtsfqs.css","../chunks/nznK1lJN.js","../chunks/UeEccMjN.js","../chunks/CeR4do8T.js","../chunks/B3Ni2QLt.js","../chunks/DApmS1g_.js","../chunks/HopcQwhZ.js","../chunks/BYNWtKcf.js","../chunks/BNaxFL8-.js","../chunks/C67g-p2T.js","../chunks/DovL68qD.js","../chunks/Dga0ODor.js","../chunks/CoasO80Q.js","../chunks/C-AVEJqG.js","../chunks/D8zgcaSD.js","../chunks/iz1cEkZC.js","../chunks/Bbl7uOhW.js","../chunks/DgfWqxEz.js","../chunks/HAi-5CYL.js","../chunks/Bs7CGcv2.js","../assets/SettingsPage.DclbL_Wf.css"])))=>i.map(i=>d[i]);
2
+ import{$ as e,A as t,At as n,B as r,Ct as i,D as a,Dt as o,E as s,F as c,G as l,H as u,J as d,K as f,M as p,N as m,Nt as h,O as g,Q as _,R as v,S as y,St as b,T as x,U as S,V as C,W as w,X as T,_t as E,a as D,at as O,b as k,bt as ee,c as A,ct as j,d as te,f as M,ft as N,gt as P,h as F,ht as ne,it as re,j as I,jt as L,k as ie,kt as ae,l as oe,lt as R,m as z,mt as B,n as se,nt as V,o as H,ot as U,p as ce,q as le,r as ue,rt as W,s as G,st as K,ut as de,v as q,w as fe,wt as pe,x as me,y as he,z as J}from"../chunks/CmCJ0SKP.js";import{t as ge}from"../chunks/_g2_n9ND.js";import{t as Y}from"../chunks/HclGiUj8.js";import"../chunks/xihTtKlq.js";import{t as _e}from"../chunks/C8EbtR4g.js";import"../chunks/D_Wlt2rL.js";import{t as ve}from"../chunks/BkEnd9_Z.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,t as we}from"../chunks/Do5hAkYk.js";import{a as Te,c as Ee,d as De,l as Oe,n as ke,o as Ae,s as je,t as Me,u as Ne}from"../chunks/BHJkoxm8.js";import{A as Pe,C as Fe,D as Ie,M as Le,O as Re,S as ze,T as Be,b as Ve,c as He,f as Ue,i as We,j as Ge,n as Ke,o as qe,r as Je,s as Ye,v as Xe,x as Ze}from"../chunks/1vzbRbJ2.js";import{t as Qe}from"../chunks/BT2vrlul.js";import{d as $e,f as et,r as tt,t as nt,u as rt}from"../chunks/Bs7CGcv2.js";import{a as it,c as at,n as ot,o as st,s as ct,u as lt}from"../chunks/CsxdqaKQ.js";import{a as ut,n as dt,r as ft,s as pt,t as mt}from"../chunks/D-2QBE8y.js";import{n as ht,r as gt,t as _t}from"../chunks/1aUphu7Y.js";import{A as vt,B as yt,C as bt,D as xt,E as St,F as Ct,G as wt,H as Tt,I as Et,J as Dt,K as Ot,L as kt,M as At,N as jt,O as Mt,P as Nt,R as Pt,S as Ft,T as It,U as Lt,V as Rt,W as zt,_ as Bt,a as Vt,b as Ht,c as Ut,d as Wt,f as Gt,g as Kt,h as qt,j as Jt,k as Yt,l as Xt,m as Zt,n as Qt,o as $t,p as en,q as X,r as tn,s as nn,t as rn,u as an,v as on,w as sn,x as cn,y as ln,z as un}from"../chunks/825uWMzf.js";import"../chunks/DZ_Kltd5.js";import{i as dn,n as fn,r as pn,t as mn}from"../chunks/DnPeA-9c.js";import{t as hn}from"../chunks/BEPs9Z9s.js";import{t as gn}from"../chunks/DOjT7y5f.js";import{t as _n}from"../chunks/DApmS1g_.js";import{r as vn,t as yn}from"../chunks/DgfWqxEz.js";import{n as bn,t as xn}from"../chunks/F_BrNiaz.js";import{t as Sn}from"../chunks/CpRvgjpe.js";import{t as Cn}from"../chunks/UeEccMjN.js";import{t as wn}from"../chunks/BIfnT_mK.js";import{A as Z,B as Tn,C as En,D as Dn,E as On,F as kn,L as An,M as jn,N as Mn,O as Nn,P as Pn,R as Fn,T as In,a as Ln,b as Rn,c as zn,d as Bn,f as Vn,g as Hn,h as Un,i as Q,j as Wn,k as Gn,m as Kn,n as qn,o as Jn,p as Yn,r as Xn,s as Zn,t as Qn,v as $n,w as er,y as tr,z as nr}from"../chunks/N4Ne5qCB.js";import{t as rr}from"../chunks/HopcQwhZ.js";import{n as ir,t as ar}from"../chunks/ChvFFUWR.js";import{t as or}from"../chunks/C67g-p2T.js";var sr=h({prerender:()=>!1,ssr:()=>!1,trailingSlash:()=>cr}),cr=`ignore`;je({id:`workspaces`,name:`Workspaces`,icon:Se,activities:[Ee({pattern:`/workspaces`,entry:!0,root:Oe({id:`workspaces.home`,component:()=>Y(()=>import(`../chunks/3x7J55ll.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url)})}),Ee({pattern:`/workspaces`,root:Ne({id:`workspaces.provider`,pattern:`:wsId/:providerId`,params:Ie({wsId:Ze,providerId:Ve}),search:Ie({q:Pe().optional(),skill:Pe().optional(),view:ze([`list`,`detail`]).optional()}),component:()=>Y(()=>import(`../chunks/B1KITIB4.js`),__vite__mapDeps([22,1,3,5,23,2,24,4,9,25,8,10,11,12,19,26,27,28,29,20,30,31,32]),import.meta.url)})}),Ee({pattern:`/workspaces`,root:Ne({id:`workspaces.intelligence`,pattern:`intelligence/:wsId/:providerId`,params:Ie({wsId:Ze,providerId:Ve}),search:Ie({severity:ze([`all`,`error`,`warning`,`info`]).optional()}),component:()=>Y(()=>import(`../chunks/nznK1lJN.js`),__vite__mapDeps([33,1,3,5,23,2,24,4,9,25,8,10,11,12,34,14,16,35,20,31]),import.meta.url)})})]});var lr=new Set([`$$slots`,`$$events`,`$$legacy`]);function ur(e,t){let n=H(t,lr),r=[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`}],[`path`,{d:`M8 18h1`}]];ve(e,G({name:`file-pen-line`},()=>n,{get iconNode(){return r}}))}je({id:`creator`,name:`Creator`,icon:ur,activities:[Ee({pattern:`/creator`,entry:!0,root:Oe({id:`creator.home`,component:()=>Y(()=>import(`../chunks/B3Ni2QLt.js`),__vite__mapDeps([36,1,2,3,4,5,8,9,10,11,37,38,39]),import.meta.url)})}),Ee({pattern:`/creator`,root:Ne({id:`creator.workspace`,pattern:`:mode/:wsId/:providerId`,params:Ie({mode:ze([`edit`,`new`]),wsId:Ze,providerId:Ve}),search:Ie({subview:ze([`file`,`log`,`preview`,`validate`,`test`]).optional(),template:Pe().optional()}),component:()=>Y(()=>import(`../chunks/BNaxFL8-.js`),__vite__mapDeps([40,1,2,3,24,4,5,23,9,25,8,10,11,12,26,28,41,39,42,17,18,19,16,29,35]),import.meta.url),children:[Ne({id:`creator.workspace.skill`,pattern:`:skillId`,params:Ie({skillId:Xe}),component:()=>Y(()=>import(`../chunks/BNaxFL8-.js`),__vite__mapDeps([40,1,2,3,24,4,5,23,9,25,8,10,11,12,26,28,41,39,42,17,18,19,16,29,35]),import.meta.url)})]})})]});var dr=new Set([`$$slots`,`$$events`,`$$legacy`]);function fr(e,t){let n=H(t,dr),r=[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]];ve(e,G({name:`git-branch`},()=>n,{get iconNode(){return r}}))}je({id:`repository`,name:`Repository`,icon:fr,activities:[Ee({pattern:`/repository`,entry:!0,root:Ne({id:`repository.home`,pattern:``,search:Ie({q:Pe().optional()}),component:()=>Y(()=>import(`../chunks/Dga0ODor.js`),__vite__mapDeps([43,1,2,3,4,5,23,24,9,25,11,12,17,18,19,16,44]),import.meta.url),children:[Ne({id:`repository.scan`,pattern:`scan/:sourceId`,params:Ie({sourceId:Pe().min(1).max(128).regex(/^[a-z0-9_-]+$/i)}),search:Ie({selected:Pe().optional(),targets:Pe().optional(),skill:Pe().optional()}),component:()=>Y(()=>import(`../chunks/C-AVEJqG.js`),__vite__mapDeps([45,1,2,3,24,4,23,9,25,10,44]),import.meta.url)})]})})]}),je({id:`wiki`,name:`Wiki`,icon:Qe,activities:[Ee({pattern:`/wiki`,entry:!0,root:Oe({id:`wiki.home`,component:()=>Y(()=>import(`../chunks/D8zgcaSD.js`),__vite__mapDeps([46,1,2,3,4,7,5,12,13,14,16,47,9,20,21]),import.meta.url)})}),Ee({pattern:`/wiki`,root:Ne({id:`wiki.scope`,pattern:`:wsId`,params:Ie({wsId:Ze}),component:()=>Y(()=>import(`../chunks/Bbl7uOhW.js`),__vite__mapDeps([48,1,2,3,4,23,24,9,25,7,5,8,10,11,12,19,26,49,34,14,38,16,47,20,30]),import.meta.url)})})]});var pr=new Set([`$$slots`,`$$events`,`$$legacy`]);function mr(e,t){let n=H(t,pr),r=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];ve(e,G({name:`settings`},()=>n,{get iconNode(){return r}}))}je({id:`settings`,name:`Settings`,icon:mr,activities:[Ee({pattern:`/settings`,entry:!0,root:Oe({id:`settings.home`,component:()=>Y(()=>import(`../chunks/HAi-5CYL.js`),__vite__mapDeps([50,1,2,3,4,5,23,24,9,25,51,8,10,11,12,26,15,42,17,18,19,16,52]),import.meta.url)})}),Ee({pattern:`/settings`,root:Ne({id:`settings.section`,pattern:`:section`,params:Ie({section:ze($e)}),component:()=>Y(()=>import(`../chunks/HAi-5CYL.js`),__vite__mapDeps([50,1,2,3,4,5,23,24,9,25,51,8,10,11,12,26,15,42,17,18,19,16,52]),import.meta.url)})})]});var hr=r(`<div class="drag-strip no-drag shrink-0 svelte-11tvdi8" role="banner" aria-label="window titlebar"><!> <div class="flex-1"></div> <!></div>`);function gr(e,t){i(t,!0);let r=D(t,`variant`,3,`main`),a=D(t,`left`,3,null),o=D(t,`right`,3,null),s=B(8),c=B(8),u=()=>navigator.opentrayWindow??navigator.opentray?.window??void 0;function d(e){let t=u();try{t?.startAppRegionDrag?.({x:e.clientX,y:e.clientY,pointerId:e.pointerId})?.catch?.(()=>{})}catch{}}function f(e){let t=globalThis.innerWidth,n=Math.max(0,Math.round(e.x)),r=Math.max(0,Math.round(t-e.x-e.width));N(s,n+(n>0?4:0)),N(c,r+(r>0?4:0))}ue(()=>{let e=u()?.overlay;if(!e)return;let t=null;return(async()=>{try{if(f(await e.getTitlebarAreaRect()),e.listen)t=await e.listen(`geometrychange`,e=>f(e.titlebarAreaRect));else if(e.addEventListener){let n=e=>f(e.titlebarAreaRect);e.addEventListener(`geometrychange`,n),t=()=>e.removeEventListener?.(`geometrychange`,n)}}catch{}})(),()=>{t?.()}});var p=hr(),h=U(p),_=e=>{var t=J(),n=K(t);g(n,a),v(e,t)};m(h,e=>{r()===`main`&&a()&&e(_)});var y=R(h,4),x=e=>{var t=J(),n=K(t);g(n,o),v(e,t)};m(y,e=>{r()===`main`&&o()&&e(x)}),n(p),V(()=>k(p,`padding-left: ${T(s)??``}px; padding-right: ${T(c)??``}px`)),l(`pointerdown`,p,d),v(e,p),b()}w([`pointerdown`]);var _r={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`};zt(_r);function vr(t){W(()=>e(()=>t()))}var yr=[`top`,`right`,`bottom`,`left`],br=Math.min,xr=Math.max,Sr=Math.round,Cr=Math.floor,wr=e=>({x:e,y:e}),Tr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Er(e,t,n){return xr(e,br(t,n))}function Dr(e,t){return typeof e==`function`?e(t):e}function Or(e){return e.split(`-`)[0]}function kr(e){return e.split(`-`)[1]}function Ar(e){return e===`x`?`y`:`x`}function jr(e){return e===`y`?`height`:`width`}function Mr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Nr(e){return Ar(Mr(e))}function Pr(e,t,n){n===void 0&&(n=!1);let r=kr(e),i=Nr(e),a=jr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ur(o)),[o,Ur(o)]}function Fr(e){let t=Ur(e);return[Ir(e),t,Ir(t)]}function Ir(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Lr=[`left`,`right`],Rr=[`right`,`left`],zr=[`top`,`bottom`],Br=[`bottom`,`top`];function Vr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Rr:Lr:t?Lr:Rr;case`left`:case`right`:return t?zr:Br;default:return[]}}function Hr(e,t,n,r){let i=kr(e),a=Vr(Or(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ir)))),a}function Ur(e){let t=Or(e);return Tr[t]+e.slice(t.length)}function Wr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Gr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wr(e)}function Kr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function qr(e,t,n){let{reference:r,floating:i}=e,a=Mr(t),o=Nr(t),s=jr(o),c=Or(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=kr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Jr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Dr(t,e),p=Gr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Kr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Kr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Yr=50,Xr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qr(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Yr&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zr=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Dr(e,t)||{};if(l==null)return{};let d=Gr(u),f={x:n,y:r},p=Nr(i),m=jr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=br(d[_],T),D=br(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Er(E,k,O),A=!c.arrow&&kr(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=A?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:ee,centerOffset:k-ee-j,...A&&{alignmentOffset:j}},reset:A}}}),Qr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Dr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Or(r),_=Mr(o),v=Or(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ur(o)]:Fr(o)),x=p!==`none`;!d&&x&&b.push(...Hr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Pr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Mr(t)||T.every(e=>Mr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Mr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function $r(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ei(e){return yr.some(t=>e[t]>=0)}var ti=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Dr(e,t);switch(i){case`referenceHidden`:{let e=$r(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ei(e)}}}case`escaped`:{let e=$r(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ei(e)}}}default:return{}}}}},ni=new Set([`left`,`top`]);async function ri(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Or(n),s=kr(n),c=Mr(n)===`y`,l=ni.has(o)?-1:1,u=a&&c?-1:1,d=Dr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ii=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ri(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ai=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Dr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Mr(i),p=Ar(f),m=u[p],h=u[f],g=(e,t)=>Er(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},oi=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Dr(e,t),u={x:n,y:r},d=Mr(i),f=Ar(d),p=u[f],m=u[d],h=Dr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ni.has(Or(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},si=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Dr(e,t),c=await i.detectOverflow(t,s),l=Or(n),u=kr(n),d=Mr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=br(p-c[m],g),y=br(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*xr(c.left,c.right):S=p-2*xr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ci(){return typeof window<`u`}function li(e){return fi(e)?(e.nodeName||``).toLowerCase():`#document`}function ui(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){return((fi(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fi(e){return ci()?e instanceof Node||e instanceof ui(e).Node:!1}function pi(e){return ci()?e instanceof Element||e instanceof ui(e).Element:!1}function mi(e){return ci()?e instanceof HTMLElement||e instanceof ui(e).HTMLElement:!1}function hi(e){return!ci()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ui(e).ShadowRoot}function gi(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Di(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _i(e){return/^(table|td|th)$/.test(li(e))}function vi(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var yi=/transform|translate|scale|rotate|perspective|filter/,bi=/paint|layout|strict|content/,xi=e=>!!e&&e!==`none`,Si;function Ci(e){let t=pi(e)?Di(e):e;return xi(t.transform)||xi(t.translate)||xi(t.scale)||xi(t.rotate)||xi(t.perspective)||!Ti()&&(xi(t.backdropFilter)||xi(t.filter))||yi.test(t.willChange||``)||bi.test(t.contain||``)}function wi(e){let t=ki(e);for(;mi(t)&&!Ei(t);){if(Ci(t))return t;if(vi(t))return null;t=ki(t)}return null}function Ti(){return Si??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Si}function Ei(e){return/^(html|body|#document)$/.test(li(e))}function Di(e){return ui(e).getComputedStyle(e)}function Oi(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ki(e){if(li(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hi(e)&&e.host||di(e);return hi(t)?t.host:t}function Ai(e){let t=ki(e);return Ei(t)?(e.ownerDocument||e).body:mi(t)&&gi(t)?t:Ai(t)}function ji(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ai(e),i=r===e.ownerDocument?.body,a=ui(r);if(i){let e=Mi(a);return t.concat(a,a.visualViewport||[],gi(r)?r:[],e&&n?ji(e):[])}return t.concat(r,ji(r,[],n))}function Mi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ni(e){let t=Di(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mi(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Sr(n)!==a||Sr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pi(e){return pi(e)?e:e.contextElement}function Fi(e){let t=Pi(e);if(!mi(t))return wr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ni(t),o=(a?Sr(n.width):n.width)/r,s=(a?Sr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ii=wr(0);function Li(e){let t=ui(e);return!Ti()||!t.visualViewport?Ii:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ri(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ui(e)}function zi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pi(e),o=wr(1);t&&(r?pi(r)&&(o=Fi(r)):o=Fi(e));let s=Ri(a,n,r)?Li(a):wr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ui(a),t=pi(r)?ui(r):r,n=e,i=Mi(n);for(;i&&t!==n;){let e=Fi(i),t=i.getBoundingClientRect(),r=Di(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ui(i),i=Mi(n)}}return Kr({width:u,height:d,x:c,y:l})}function Bi(e,t){let n=Oi(e).scrollLeft;return t?t.left+n:zi(di(e)).left+n}function Vi(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bi(e,n),y:n.top+t.scrollTop}}function Hi(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=di(r),s=t?vi(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=wr(1),u=wr(0),d=mi(r);if((d||!a)&&((li(r)!==`body`||gi(o))&&(c=Oi(r)),d)){let e=zi(r);l=Fi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vi(o,c):wr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ui(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Wi(e){let t=Oi(e),n=e.ownerDocument.body,r=xr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=xr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Bi(e),o=-t.scrollTop;return Di(n).direction===`rtl`&&(a+=xr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Gi=25;function Ki(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ui(e),a=di(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ti()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Bi(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Gi&&(s-=o)}return{width:s,height:c,x:l,y:u}}function qi(e,t){let n=zi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fi(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ji(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ki(e,n,t);else if(t===`document`)r=Wi(di(e));else if(pi(t))r=qi(t,n);else{let n=Li(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kr(r)}function Yi(e,t){let n=t.get(e);if(n)return n;let r=ji(e,[],!1).filter(e=>pi(e)&&li(e)!==`body`),i=null,a=Di(e).position===`fixed`,o=a?ki(e):e;for(;pi(o)&&!Ei(o);){let e=Di(o),t=Ci(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ki(o)}return t.set(e,r),r}function Xi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vi(t)?[]:Yi(t,this._c):[].concat(n),r],o=Ji(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ji(t,a[e],i);s=xr(n.top,s),c=br(n.right,c),l=br(n.bottom,l),u=xr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zi(e){let{width:t,height:n}=Ni(e);return{width:t,height:n}}function Qi(e,t,n){let r=mi(t),i=di(t),a=n===`fixed`,o=zi(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=wr(0);if((r||!a)&&((li(t)!==`body`||gi(i))&&(s=Oi(t)),r)){let e=zi(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Bi(i));let l=i&&!r&&!a?Vi(i,s):wr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function $i(e){return Di(e).position===`static`}function ea(e,t){if(!mi(e)||Di(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return di(e)===n&&(n=n.ownerDocument.body),n}function ta(e,t){let n=ui(e);if(vi(e))return n;if(!mi(e)){let t=ki(e);for(;t&&!Ei(t);){if(pi(t)&&!$i(t))return t;t=ki(t)}return n}let r=ea(e,t);for(;r&&_i(r)&&$i(r);)r=ea(r,t);return r&&Ei(r)&&$i(r)&&!Ci(r)?n:r||wi(e)||n}var na=async function(e){let t=this.getOffsetParent||ta,n=this.getDimensions,r=await n(e.floating);return{reference:Qi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ra(e){return Di(e).direction===`rtl`}var ia={convertOffsetParentRelativeRectToViewportRelativeRect:Hi,getDocumentElement:di,getClippingRect:Xi,getOffsetParent:ta,getElementRects:na,getClientRects:Ui,getDimensions:Zi,getScale:Fi,isElement:pi,isRTL:ra};function aa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oa(e,t,n){let r=null,i,a=di(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Cr(d),h=Cr(a.clientWidth-(u+f)),g=Cr(a.clientHeight-(d+p)),_=Cr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:xr(0,br(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!aa(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ui(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function sa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Pi(e),u=i||a?[...l?ji(l):[],...t?ji(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?oa(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?zi(e):null;c&&g();function g(){let t=zi(e);h&&!aa(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ca=ii,la=ai,ua=Qr,da=si,fa=ti,pa=Zr,ma=oi,ha=(e,t,n)=>{let r=new Map,i=n??{},a={...ia,...i.platform,_c:r};return Xr(e,t,{...i,platform:a})};function ga(e){return typeof e==`function`?e():e}function _a(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function va(e,t){let n=_a(e);return Math.round(t*n)/n}function ya(e){return{[`--bits-${e}-content-transform-origin`]:`var(--bits-floating-transform-origin)`,[`--bits-${e}-content-available-width`]:`var(--bits-floating-available-width)`,[`--bits-${e}-content-available-height`]:`var(--bits-floating-available-height)`,[`--bits-${e}-anchor-width`]:`var(--bits-floating-anchor-width)`,[`--bits-${e}-anchor-height`]:`var(--bits-floating-anchor-height)`}}function ba(e){let t=e.whileElementsMounted,n=P(()=>ga(e.open)??!0),r=P(()=>ga(e.middleware)),i=P(()=>ga(e.transform)??!0),a=P(()=>ga(e.placement)??`bottom`),o=P(()=>ga(e.strategy)??`absolute`),s=P(()=>ga(e.sideOffset)??0),c=P(()=>ga(e.alignOffset)??0),l=e.reference,u=B(0),d=B(0),f=Dt(null),p=B(de(T(o))),m=B(de(T(a))),h=B(de({})),g=B(!1),_=!1,v=0,y=P(()=>{let e=f.current?va(f.current,T(u)):T(u),t=f.current?va(f.current,T(d)):T(d);return T(i)?{position:T(p),left:`0`,top:`0`,transform:`translate(${e}px, ${t}px)`,...f.current&&_a(f.current)>=1.5&&{willChange:`transform`}}:{position:T(p),left:`${e}px`,top:`${t}px`}}),b;function x(){if(l.current===null||f.current===null)return;let e=l.current,t=f.current,i=++v;ha(e,t,{middleware:T(r),placement:T(a),strategy:T(o)}).then(r=>{if(i===v&&l.current===e&&f.current===t){if(xa(e)){N(h,{...T(h),hide:{...T(h).hide,referenceHidden:!0}},!0);return}if(!T(n)&&T(u)!==0&&T(d)!==0){let e=Math.max(Math.abs(T(s)),Math.abs(T(c)),15);if(r.x<=e&&r.y<=e)return}N(u,r.x,!0),N(d,r.y,!0),N(p,r.strategy,!0),N(m,r.placement,!0),N(h,r.middlewareData,!0),N(g,!0)}})}function S(){typeof b==`function`&&(b(),b=void 0),v++}function C(){if(S(),t===void 0){x();return}T(n)&&l.current!==null&&f.current!==null&&(b=t(l.current,f.current,x))}function w(){!T(n)&&f.current===null&&N(g,!1)}function E(){return[T(r),T(a),T(o),T(s),T(c),T(n)]}return W(()=>{t===void 0&&T(n)&&x()}),W(C),W(()=>{if(t!==void 0){if(E(),!T(n)){_=!1;return}if(!T(g)){_=!1;return}if(!_){_=!0;return}x()}}),W(w),W(()=>S),{floating:f,reference:l,get strategy(){return T(p)},get placement(){return T(m)},get middlewareData(){return T(h)},get isPositioned(){return T(g)},get floatingStyles(){return T(y)},get update(){return x}}}function xa(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}var Sa={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ca=new Tt(`Floating.Root`),wa=new Tt(`Floating.Content`),Ta=new Tt(`Floating.Root`),Ea=class e{static create(t=!1){return t?Ta.set(new e):Ca.set(new e)}anchorNode=Dt(null);customAnchorNode=Dt(null);triggerNode=Dt(null);constructor(){W(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current==`string`?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}},Da=class e{static create(t,n=!1){return n?wa.set(new e(t,Ta.get())):wa.set(new e(t,Ca.get()))}opts;root;contentRef=Dt(null);wrapperRef=Dt(null);arrowRef=Dt(null);contentAttachment=Ct(this.contentRef);wrapperAttachment=Ct(this.wrapperRef);arrowAttachment=Ct(this.arrowRef);arrowId=Dt(Ut());#e=P(()=>{if(typeof this.opts.style==`string`)return wt(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new yt(()=>this.arrowRef.current??void 0);#r=P(()=>this.#n?.width??0);#i=P(()=>this.#n?.height??0);#a=P(()=>this.opts.side?.current+(this.opts.align.current===`center`?``:`-${this.opts.align.current}`));#o=P(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=P(()=>T(this.#o).length>0);get hasExplicitBoundaries(){return T(this.#s)}set hasExplicitBoundaries(e){N(this.#s,e)}#c=P(()=>({padding:this.opts.collisionPadding.current,boundary:T(this.#o).filter(It),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return T(this.#c)}set detectOverflowOptions(e){N(this.#c,e)}#l=B(void 0);#u=B(void 0);#d=B(void 0);#f=B(void 0);#p=P(()=>[ca({mainAxis:this.opts.sideOffset.current+T(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&la({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current===`partial`?ma():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&ua({...this.detectOverflowOptions}),da({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:n})=>{let{width:r,height:i}=e.reference;N(this.#l,t,!0),N(this.#u,n,!0),N(this.#d,r,!0),N(this.#f,i,!0)}}),this.arrowRef.current&&pa({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),ka({arrowWidth:T(this.#r),arrowHeight:T(this.#i)}),this.opts.hideWhenDetached.current&&fa({strategy:`referenceHidden`,...this.detectOverflowOptions})].filter(Boolean));get middleware(){return T(this.#p)}set middleware(e){N(this.#p,e)}floating;#m=P(()=>ja(this.floating.placement));get placedSide(){return T(this.#m)}set placedSide(e){N(this.#m,e)}#h=P(()=>Ma(this.floating.placement));get placedAlign(){return T(this.#h)}set placedAlign(e){N(this.#h,e)}#g=P(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return T(this.#g)}set arrowX(e){N(this.#g,e)}#_=P(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return T(this.#_)}set arrowY(e){N(this.#_,e)}#v=P(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return T(this.#v)}set cannotCenterArrow(e){N(this.#v,e)}#y=B();get contentZIndex(){return T(this.#y)}set contentZIndex(e){N(this.#y,e,!0)}#b=P(()=>Sa[this.placedSide]);get arrowBaseSide(){return T(this.#b)}set arrowBaseSide(e){N(this.#b,e)}#x=P(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":``,style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${T(this.#l)}px`,"--bits-floating-available-height":`${T(this.#u)}px`,"--bits-floating-anchor-width":`${T(this.#d)}px`,"--bits-floating-anchor-height":`${T(this.#f)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:`hidden`,"pointer-events":`none`},...T(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return T(this.#x)}set wrapperProps(e){N(this.#x,e)}#S=P(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:zt({...T(this.#e)}),...this.contentAttachment}));get props(){return T(this.#S)}set props(e){N(this.#S,e)}#C=P(()=>({position:`absolute`,left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[this.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[this.placedSide],visibility:this.cannotCenterArrow?`hidden`:void 0}));get arrowStyle(){return T(this.#C)}set arrowStyle(e){N(this.#C,e)}constructor(e,t){this.opts=e,this.root=t,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),Rt(()=>e.customAnchor.current,e=>{this.root.customAnchorNode.current=e}),this.floating=ba({strategy:()=>this.opts.strategy.current,placement:()=>T(this.#a),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...e)=>sa(...e,{animationFrame:this.#t?.current===`always`}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),W(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Rt(()=>this.contentRef.current,e=>{if(!e||!this.opts.enabled.current)return;let t=Et(e),n=t.requestAnimationFrame(()=>{if(this.contentRef.current!==e||!this.opts.enabled.current)return;let n=t.getComputedStyle(e).zIndex;n!==this.contentZIndex&&(this.contentZIndex=n)});return()=>{t.cancelAnimationFrame(n)}}),W(()=>{this.floating.floating.current=this.wrapperRef.current})}},Oa=class e{static create(t,n=!1){return n?new e(t,Ta.get()):new e(t,Ca.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,t.triggerNode=e.virtualEl&&e.virtualEl.current?Ot(e.virtualEl.current):e.ref}};function ka(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Aa(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}}function Aa(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function ja(e){return Aa(e)[0]}function Ma(e){return Aa(e)[1]}function Na(e,t){i(t,!0);let n=D(t,`tooltip`,3,!1);Ea.create(n());var r=J(),a=K(r);g(a,()=>t.children??L),v(e,r),b()}function Pa(e,t){i(t,!0);let n=D(t,`tooltip`,3,!1);Oa.create({id:X(()=>t.id),virtualEl:X(()=>t.virtualEl),ref:t.ref},n());var r=J(),a=K(r);g(a,()=>t.children??L),v(e,r),b()}function Fa(e,t){i(t,!0);let n=D(t,`side`,3,`bottom`),r=D(t,`sideOffset`,3,0),a=D(t,`align`,3,`center`),o=D(t,`alignOffset`,3,0),s=D(t,`arrowPadding`,3,0),c=D(t,`avoidCollisions`,3,!0),l=D(t,`collisionBoundary`,19,()=>[]),u=D(t,`collisionPadding`,3,0),d=D(t,`hideWhenDetached`,3,!1),f=D(t,`onPlaced`,3,()=>{}),p=D(t,`sticky`,3,`partial`),m=D(t,`updatePositionStrategy`,3,`optimized`),h=D(t,`strategy`,3,`fixed`),_=D(t,`dir`,3,`ltr`),y=D(t,`style`,19,()=>({})),x=D(t,`wrapperId`,19,Ut),S=D(t,`customAnchor`,3,null),C=D(t,`tooltip`,3,!1),w=Da.create({side:X(()=>n()),sideOffset:X(()=>r()),align:X(()=>a()),alignOffset:X(()=>o()),id:X(()=>t.id),arrowPadding:X(()=>s()),avoidCollisions:X(()=>c()),collisionBoundary:X(()=>l()),collisionPadding:X(()=>u()),hideWhenDetached:X(()=>d()),onPlaced:X(()=>f()),sticky:X(()=>p()),updatePositionStrategy:X(()=>m()),strategy:X(()=>h()),dir:X(()=>_()),style:X(()=>y()),enabled:X(()=>t.enabled),wrapperId:X(()=>x()),customAnchor:X(()=>S())},C()),E=P(()=>Lt(w.wrapperProps,{style:{pointerEvents:`auto`}}));var O=J(),k=K(O);g(k,()=>t.content??L,()=>({props:w.props,wrapperProps:T(E)})),v(e,O),b()}function Ia(e,t){i(t,!0),ue(()=>{t.onPlaced?.()});var n=J(),r=K(n);g(r,()=>t.content??L,()=>({props:{},wrapperProps:{}})),v(e,n),b()}var La=new Set([`$$slots`,`$$events`,`$$legacy`,`content`,`isStatic`,`onPlaced`]);function Ra(e,t){let n=D(t,`isStatic`,3,!1),r=H(t,La);var i=J(),a=K(i),o=e=>{Ia(e,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},s=e=>{Fa(e,G({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};m(a,e=>{n()?e(o):e(s,-1)}),v(e,i)}var za=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled.ref.tooltip.contentPointerEvents`.split(`.`)),Ba=r(`<!> <!>`,1);function Va(e,t){i(t,!0);let n=D(t,`interactOutsideBehavior`,3,`close`),r=D(t,`trapFocus`,3,!0),a=D(t,`isValidEvent`,3,()=>!1),o=D(t,`customAnchor`,3,null),s=D(t,`isStatic`,3,!1),c=D(t,`tooltip`,3,!1),l=D(t,`contentPointerEvents`,3,`auto`),u=H(t,za),d=P(()=>t.preventScroll??!0),f=P(()=>t.strategy??(T(d)?`fixed`:`absolute`));Ra(e,{get isStatic(){return s()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return T(f)},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return o()},get enabled(){return t.enabled},get tooltip(){return c()},content:(e,i)=>{let o=()=>(i?.()).props,s=()=>(i?.()).wrapperProps;var c=Ba(),f=K(c),p=e=>{nn(e,{get preventScroll(){return T(d)}})},h=e=>{nn(e,{get preventScroll(){return T(d)}})};m(f,e=>{t.forceMount&&t.enabled?e(p):t.forceMount||e(h,1)});var _=R(f,2);an(_,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(e,r)=>{let i=()=>(r?.()).props;Wt(e,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,r)=>{Gt(e,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return a()},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{let r=()=>(n?.()).props;Xt(e,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{var a=J(),c=K(a);{let e=P(()=>({props:Lt(u,o(),r(),i(),{style:{pointerEvents:l()}}),wrapperProps:s()}));g(c,()=>t.popper??L,()=>T(e))}v(e,a)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),v(e,c)},$$slots:{content:!0}}),b()}var Ha=new Set(`$$slots.$$events.$$legacy.popper.open.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.ref.shouldRender`.split(`.`));function Ua(e,t){let n=D(t,`interactOutsideBehavior`,3,`close`),r=D(t,`trapFocus`,3,!0),i=D(t,`isValidEvent`,3,()=>!1),a=D(t,`customAnchor`,3,null),o=D(t,`isStatic`,3,!1),s=H(t,Ha);var c=J(),l=K(c),u=e=>{Va(e,G({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>s))};m(l,e=>{t.shouldRender&&e(u)}),v(e,c)}var Wa=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled`.split(`.`));function Ga(e,t){let n=D(t,`interactOutsideBehavior`,3,`close`),r=D(t,`trapFocus`,3,!0),i=D(t,`isValidEvent`,3,()=>!1),a=D(t,`customAnchor`,3,null),o=D(t,`isStatic`,3,!1),s=H(t,Wa);Va(e,G({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>s,{forceMount:!0}))}function Ka(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function qa(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ja(e){if(typeof CSS<`u`&&typeof CSS.escape==`function`)return CSS.escape(e);let t=e.length,n=-1,r,i=``,a=e.charCodeAt(0);if(t===1&&a===45)return`\\`+e;for(;++n<t;){if(r=e.charCodeAt(n),r===0){i+=`�`;continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&a===45){i+=`\\`+r.toString(16)+` `;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){i+=e.charAt(n);continue}i+=`\\`+e.charAt(n)}return i}var Ya=`data-value`,Xa=Nt({component:`command`,parts:[`root`,`list`,`input`,`separator`,`loading`,`empty`,`group`,`group-items`,`group-heading`,`item`,`viewport`,`input-label`]}),Za=Xa.selector(`group`),Qa=Xa.selector(`group-items`),$a=Xa.selector(`group-heading`),eo=Xa.selector(`item`),to=`${Xa.selector(`item`)}:not([aria-disabled="true"])`,no=new Tt(`Command.Root`),ro=new Tt(`Command.List`),io=new Tt(`Command.Group`),ao={search:``,value:``,filtered:{count:0,items:new Map,groups:new Set}},oo=class e{static create(t){return no.set(new e(t))}opts;attachment;#e=!1;#t=!0;sortAfterTick=!1;sortAndFilterAfterTick=!1;allItems=new Set;allGroups=new Map;allIds=new Map;#n=B(0);get key(){return T(this.#n)}set key(e){N(this.#n,e,!0)}#r=B(null);get viewportNode(){return T(this.#r)}set viewportNode(e){N(this.#r,e,!0)}#i=B(null);get inputNode(){return T(this.#i)}set inputNode(e){N(this.#i,e,!0)}#a=B(null);get labelNode(){return T(this.#a)}set labelNode(e){N(this.#a,e,!0)}#o=B(ao);get commandState(){return T(this.#o)}set commandState(e){N(this.#o,e)}#s=B(de(ao));get _commandState(){return T(this.#s)}set _commandState(e){N(this.#s,e,!0)}#c(){return o(this._commandState)}#l(){this.#e||(this.#e=!0,kt(()=>{this.#e=!1;let e=this.#c();Object.is(this.commandState,e)||(this.commandState=e,this.opts.onStateChange?.current?.(e))}))}setState(e,t,n){Object.is(this._commandState[e],t)||(this._commandState[e]=t,e===`search`?(this.#m(),this.#d()):e===`value`&&(n||this.#g()),this.#l())}constructor(e){this.opts=e,this.attachment=Ct(this.opts.ref);let t={...this._commandState,value:this.opts.value.current??``};this._commandState=t,this.commandState=t,this.onkeydown=this.onkeydown.bind(this)}#u(e,t){let n=this.opts.filter.current??ds;return e?n(e,this._commandState.search,t):0}#d(){if(!this._commandState.search||this.opts.shouldFilter.current===!1){!this._commandState.value||!this.#t?this.#f():this.#t&&this._commandState.value&&this.#p();return}let e=this._commandState.filtered.items,t=[];for(let n of this._commandState.filtered.groups){let r=this.allGroups.get(n),i=0;if(!r){t.push([n,i]);continue}for(let t of r){let n=e.get(t);i=Math.max(n??0,i)}t.push([n,i])}let n=this.viewportNode,r=this.getValidItems().sort((t,n)=>{let r=t.getAttribute(`data-value`),i=n.getAttribute(`data-value`),a=e.get(r)??0;return(e.get(i)??0)-a});for(let e of r){let t=e.closest(Qa);if(t){let n=e.parentElement===t?e:e.closest(`${Qa} > *`);n&&t.appendChild(n)}else{let t=e.parentElement===n?e:e.closest(`${Qa} > *`);t&&n?.appendChild(t)}}let i=t.sort((e,t)=>t[1]-e[1]);for(let e of i){let t=n?.querySelector(`${Za}[${Ya}="${Ja(e[0])}"]`);t?.parentElement?.appendChild(t)}this.#f()}setValue(e,t){e!==this.opts.value.current&&e===``&&kt(()=>{this.key++}),this.setState(`value`,e,t),this.opts.value.current=e}#f(){kt(()=>{let e=this.getValidItems().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Ya),t=this.#t&&this.opts.disableInitialScroll.current;this.setValue(e??``,t),this.#t=!1})}#p(){kt(()=>{this.opts.disableInitialScroll.current||this.#g(),this.#t=!1})}#m(){if(!this._commandState.search||this.opts.shouldFilter.current===!1){this._commandState.filtered.count=this.allItems.size;return}this._commandState.filtered.groups=new Set;let e=0;for(let t of this.allItems){let n=this.allIds.get(t)?.value??``,r=this.allIds.get(t)?.keywords??[],i=this.#u(n,r);this._commandState.filtered.items.set(t,i),i>0&&e++}for(let[e,t]of this.allGroups)for(let n of t){let t=this._commandState.filtered.items.get(n);if(t&&t>0){this._commandState.filtered.groups.add(e);break}}this._commandState.filtered.count=e}getValidItems(){let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(to)).filter(e=>!!e):[]}getVisibleItems(){let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(eo)).filter(e=>!!e):[]}get itemsGrid(){if(!this.isGrid)return[];let e=this.opts.columns.current??1,t=this.getVisibleItems(),n=[[]],r=t[0]?.getAttribute(`data-group`),i=0,a=0;for(let o=0;o<t.length;o++){let s=t[o],c=s?.getAttribute(`data-group`);r===c?(i++,i>e&&(a++,i=1,n.push([])),n[a]?.push({index:o,firstRowOfGroup:n[a]?.[0]?.firstRowOfGroup??o===0,ref:s})):(r=c,i=1,a++,n.push([{index:o,firstRowOfGroup:!0,ref:s}]))}return n}#h(){let e=this.opts.ref.current;if(!e)return;let t=e.querySelector(`${to}[data-selected]`);if(t)return t}#g(){kt(()=>{let e=this.#h();if(!e)return;let t=e.parentElement?.parentElement;if(t){if(this.isGrid){let t=this.#_(e);if(e.scrollIntoView({block:`nearest`}),t){(e?.closest(Za)?.querySelector($a))?.scrollIntoView({block:`nearest`});return}}else{let n=cn(t);if(n&&n.dataset?.value===e.dataset?.value){(e?.closest(Za)?.querySelector($a))?.scrollIntoView({block:`nearest`});return}}e.scrollIntoView({block:`nearest`})}})}#_(e){let t=this.itemsGrid;if(t.length===0)return!1;for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0)for(let t=0;t<r.length;t++){let n=r[t];if(n!==void 0&&n.ref===e)return n.firstRowOfGroup}}return!1}updateSelectedToIndex(e){let t=this.getValidItems()[e];t&&this.setValue(t.getAttribute(Ya)??``)}updateSelectedByItem(e){let t=this.#h(),n=this.getValidItems(),r=n.findIndex(e=>e===t),i=n[r+e];this.opts.loop.current&&(i=r+e<0?n[n.length-1]:r+e===n.length?n[0]:n[r+e]),i&&this.setValue(i.getAttribute(Ya)??``)}updateSelectedByGroup(e){let t=this.#h()?.closest(Za),n;for(;t&&!n;)t=e>0?Ka(t,Za):qa(t,Za),n=t?.querySelector(to);n?this.setValue(n.getAttribute(Ya)??``):this.updateSelectedByItem(e)}registerValue(e,t){return e&&e===this.allIds.get(e)?.value||this.allIds.set(e,{value:e,keywords:t}),this._commandState.filtered.items.set(e,this.#u(e,t)),this.sortAfterTick||(this.sortAfterTick=!0,kt(()=>{this.#d(),this.sortAfterTick=!1})),()=>{this.allIds.delete(e)}}registerItem(e,t){return this.allItems.add(e),t&&(this.allGroups.has(t)?this.allGroups.get(t).add(e):this.allGroups.set(t,new Set([e]))),this.sortAndFilterAfterTick||(this.sortAndFilterAfterTick=!0,kt(()=>{this.#m(),this.#d(),this.sortAndFilterAfterTick=!1})),this.#l(),()=>{let t=this.#h();this.allItems.delete(e),this.commandState.filtered.items.delete(e),this.#m(),t?.getAttribute(`id`)===e&&this.#f(),this.#l()}}registerGroup(e){return this.allGroups.has(e)||this.allGroups.set(e,new Set),()=>{this.allIds.delete(e),this.allGroups.delete(e)}}get isGrid(){return this.opts.columns.current!==null}#v(){return this.updateSelectedToIndex(this.getValidItems().length-1)}#y(e){e.preventDefault(),e.metaKey?this.#v():e.altKey?this.updateSelectedByGroup(1):this.updateSelectedByItem(1)}#b(e){this.opts.columns.current!==null&&(e.preventDefault(),e.metaKey?this.updateSelectedByGroup(1):this.updateSelectedByItem(this.#S(e)))}#x(e,t){if(t.length===0)return null;for(let n=0;n<t.length;n++){let r=t[n];if(r!==void 0)for(let t=0;t<r.length;t++){let i=r[t];if(i!==void 0&&i.ref===e)return{columnIndex:t,rowIndex:n}}}return null}#S(e){let t=this.itemsGrid,n=this.#h();if(!n)return 0;let r=this.#x(n,t);if(!r)return 0;let i=null,a=+!!e.altKey;if(e.altKey&&r.rowIndex===t.length-2&&!this.opts.loop.current)i=this.#C({start:t.length-1,end:t.length,expectedColumnIndex:r.columnIndex,grid:t});else if(r.rowIndex===t.length-1){if(!this.opts.loop.current)return 0;i=this.#C({start:0+a,end:r.rowIndex,expectedColumnIndex:r.columnIndex,grid:t})}else i=this.#C({start:r.rowIndex+1+a,end:t.length,expectedColumnIndex:r.columnIndex,grid:t}),i===null&&this.opts.loop.current&&(i=this.#C({start:0,end:r.rowIndex,expectedColumnIndex:r.columnIndex,grid:t}));return this.#w(n,i)}#C({start:e,end:t,grid:n,expectedColumnIndex:r}){let i=null;for(let a=e;a<t;a++){let e=n[a];if(i=e[r]?.ref??null,i!==null&&so(i)){i=null;continue}if(i===null)for(let t=e.length-1;t>=0;t--){let t=e[e.length-1];if(!(t===void 0||so(t.ref))){i=t.ref;break}}break}return i}#w(e,t){if(t===null)return 0;let n=this.getValidItems(),r=n.findIndex(t=>t===e);return n.findIndex(e=>e===t)-r}#T(e){this.opts.columns.current!==null&&(e.preventDefault(),e.metaKey?this.updateSelectedByGroup(-1):this.updateSelectedByItem(this.#E(e)))}#E(e){let t=this.itemsGrid,n=this.#h();if(n===void 0)return 0;let r=this.#x(n,t);if(r===null)return 0;let i=null,a=+!!e.altKey;if(e.altKey&&r.rowIndex===1&&this.opts.loop.current===!1)i=this.#D({start:0,end:0,expectedColumnIndex:r.columnIndex,grid:t});else if(r.rowIndex===0){if(this.opts.loop.current===!1)return 0;i=this.#D({start:t.length-1-a,end:r.rowIndex+1,expectedColumnIndex:r.columnIndex,grid:t})}else i=this.#D({start:r.rowIndex-1-a,end:0,expectedColumnIndex:r.columnIndex,grid:t}),i===null&&this.opts.loop.current&&(i=this.#D({start:t.length-1,end:r.rowIndex+1,expectedColumnIndex:r.columnIndex,grid:t}));return this.#w(n,i)}#D({start:e,end:t,grid:n,expectedColumnIndex:r}){let i=null;for(let a=e;a>=t;a--){let e=n[a];if(e!==void 0){if(i=e[r]?.ref??null,i!==null&&so(i)){i=null;continue}if(i===null)for(let t=e.length-1;t>=0;t--){let t=e[e.length-1];if(!(t===void 0||so(t.ref))){i=t.ref;break}}break}}return i}#O(e){e.preventDefault(),e.metaKey?this.updateSelectedToIndex(0):e.altKey?this.updateSelectedByGroup(-1):this.updateSelectedByItem(-1)}onkeydown(e){let t=this.opts.vimBindings.current&&e.ctrlKey;switch(e.key){case`n`:case`j`:t&&(this.isGrid?this.#b(e):this.#y(e));break;case`l`:t&&this.isGrid&&this.#y(e);break;case St:this.isGrid?this.#b(e):this.#y(e);break;case Mt:if(!this.isGrid)break;this.#y(e);break;case`p`:case`k`:t&&(this.isGrid?this.#T(e):this.#O(e));break;case`h`:t&&this.isGrid&&this.#O(e);break;case Yt:this.isGrid?this.#T(e):this.#O(e);break;case xt:if(!this.isGrid)break;this.#O(e);break;case Jt:e.preventDefault(),this.updateSelectedToIndex(0);break;case`End`:e.preventDefault(),this.#v();break;case vt:if(!e.isComposing&&e.keyCode!==229){e.preventDefault();let t=this.#h();t&&t?.click()}}}#k=P(()=>({id:this.opts.id.current,role:`application`,[Xa.root]:``,tabindex:-1,onkeydown:this.onkeydown,...this.attachment}));get props(){return T(this.#k)}set props(e){N(this.#k,e)}};function so(e){return e.getAttribute(`aria-disabled`)===`true`}var co=class e{static create(t){return new e(t,no.get())}opts;root;attachment;#e=P(()=>this.root._commandState.filtered.count===0&&this.#t===!1||this.opts.forceMount.current);get shouldRender(){return T(this.#e)}set shouldRender(e){N(this.#e,e)}#t=!0;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ct(this.opts.ref),re(()=>{this.#t=!1})}#n=P(()=>({id:this.opts.id.current,role:`presentation`,[Xa.empty]:``,...this.attachment}));get props(){return T(this.#n)}set props(e){N(this.#n,e)}},lo=class e{static create(t){return io.set(new e(t,no.get()))}opts;root;attachment;#e=P(()=>this.opts.forceMount.current||this.root.opts.shouldFilter.current===!1||!this.root.commandState.search?!0:this.root._commandState.filtered.groups.has(this.trueValue));get shouldRender(){return T(this.#e)}set shouldRender(e){N(this.#e,e)}#t=B(null);get headingNode(){return T(this.#t)}set headingNode(e){N(this.#t,e,!0)}#n=B(``);get trueValue(){return T(this.#n)}set trueValue(e){N(this.#n,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Ct(this.opts.ref),this.trueValue=e.value.current??e.id.current,Rt(()=>this.trueValue,()=>this.root.registerGroup(this.trueValue)),W(()=>this.opts.value.current?(this.trueValue=this.opts.value.current,this.root.registerValue(this.opts.value.current)):this.headingNode&&this.headingNode.textContent?(this.trueValue=this.headingNode.textContent.trim().toLowerCase(),this.root.registerValue(this.trueValue)):(this.trueValue=`-----${this.opts.id.current}`,this.root.registerValue(this.trueValue)))}#r=P(()=>({id:this.opts.id.current,role:`presentation`,hidden:!this.shouldRender||void 0,"data-value":this.trueValue,[Xa.group]:``,...this.attachment}));get props(){return T(this.#r)}set props(e){N(this.#r,e)}},uo=class e{static create(t){return new e(t,io.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Ct(this.opts.ref,e=>this.group.headingNode=e)}#e=P(()=>({id:this.opts.id.current,[Xa[`group-heading`]]:``,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},fo=class e{static create(t){return new e(t,io.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Ct(this.opts.ref)}#e=P(()=>({id:this.opts.id.current,role:`group`,[Xa[`group-items`]]:``,"aria-labelledby":this.group.headingNode?.id??void 0,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},po=class e{static create(t){return new e(t,no.get())}opts;root;attachment;#e=P(()=>{let e=this.root.viewportNode?.querySelector(`${eo}[${Ya}="${Ja(this.root.opts.value.current)}"]`);if(e!=null)return e.getAttribute(`id`)??void 0});constructor(e,t){this.opts=e,this.root=t,this.attachment=Ct(this.opts.ref,e=>this.root.inputNode=e),Rt(()=>this.opts.ref.current,()=>{let e=this.opts.ref.current;e&&this.opts.autofocus.current&&Pt(10,()=>e.focus())}),Rt(()=>this.opts.value.current,()=>{this.root.commandState.search!==this.opts.value.current&&this.root.setState(`search`,this.opts.value.current)})}#t=P(()=>({id:this.opts.id.current,type:`text`,[Xa.input]:``,autocomplete:`off`,autocorrect:`off`,spellcheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":jt(!0),"aria-controls":this.root.viewportNode?.id??void 0,"aria-labelledby":this.root.labelNode?.id??void 0,"aria-activedescendant":T(this.#e),...this.attachment}));get props(){return T(this.#t)}set props(e){N(this.#t,e)}},mo=class e{static create(t){let n=io.getOr(null);return new e({...t,group:n},no.get())}opts;root;attachment;#e=null;#t=P(()=>this.opts.forceMount.current||this.#e?.opts.forceMount.current===!0);#n=P(()=>{if(this.opts.ref.current,T(this.#t)||this.root.opts.shouldFilter.current===!1||!this.root.commandState.search)return!0;let e=this.root.commandState.filtered.items.get(this.trueValue);return e!==void 0&&e>0});get shouldRender(){return T(this.#n)}set shouldRender(e){N(this.#n,e)}#r=P(()=>this.root.opts.value.current===this.trueValue&&this.trueValue!==``);get isSelected(){return T(this.#r)}set isSelected(e){N(this.#r,e)}#i=B(``);get trueValue(){return T(this.#i)}set trueValue(e){N(this.#i,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.#e=io.getOr(null),this.trueValue=e.value.current,this.attachment=Ct(this.opts.ref),Rt([()=>this.trueValue,()=>this.#e?.trueValue,()=>this.opts.forceMount.current],()=>{if(!this.opts.forceMount.current&&this.trueValue)return this.root.registerItem(this.trueValue,this.#e?.trueValue)}),Rt([()=>this.opts.value.current,()=>this.opts.ref.current],()=>{this.opts.value.current?this.trueValue=this.opts.value.current:this.opts.ref.current?.textContent&&(this.trueValue=this.opts.ref.current.textContent.trim()),this.trueValue&&(this.root.registerValue(this.trueValue,e.keywords.current.map(e=>e.trim())),this.opts.ref.current?.setAttribute(Ya,this.trueValue))}),this.onclick=this.onclick.bind(this),this.onpointermove=this.onpointermove.bind(this)}#a(){this.opts.disabled.current||(this.#o(),this.opts.onSelect?.current())}#o(){this.opts.disabled.current||this.root.setValue(this.trueValue,!0)}onpointermove(e){this.opts.disabled.current||this.root.opts.disablePointerSelection.current||this.#o()}onclick(e){this.opts.disabled.current||this.#a()}#s=P(()=>({id:this.opts.id.current,"aria-disabled":jt(this.opts.disabled.current),"aria-selected":jt(this.isSelected),"data-disabled":At(this.opts.disabled.current),"data-selected":At(this.isSelected),"data-value":this.trueValue,"data-group":this.#e?.trueValue,[Xa.item]:``,role:`option`,onpointermove:this.onpointermove,onclick:this.onclick,...this.attachment}));get props(){return T(this.#s)}set props(e){N(this.#s,e)}},ho=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Ct(this.opts.ref)}#e=P(()=>({id:this.opts.id.current,role:`progressbar`,"aria-valuenow":this.opts.progress.current,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Loading...`,[Xa.loading]:``,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},go=class e{static create(t){return ro.set(new e(t,no.get()))}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ct(this.opts.ref)}#e=P(()=>({id:this.opts.id.current,role:`listbox`,"aria-label":this.opts.ariaLabel.current,[Xa.list]:``,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},_o=class e{static create(t){return new e(t,no.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ct(this.opts.ref,e=>this.root.labelNode=e)}#e=P(()=>({id:this.opts.id.current,[Xa[`input-label`]]:``,for:this.opts.for?.current,style:_r,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},vo=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`]),yo=r(`<label><!></label>`);function bo(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=H(t,vo),c=_o.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e))}),l=P(()=>Lt(s,c.props));var d=yo();M(d,()=>({...T(l)}));var f=U(d);g(f,()=>t.children??L),n(d),v(e,d),b()}var xo=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`onStateChange`,`loop`,`shouldFilter`,`filter`,`label`,`vimBindings`,`disablePointerSelection`,`disableInitialScroll`,`columns`,`children`,`child`]),So=r(`<!> <!>`,1),Co=r(`<div><!> <!></div>`);function wo(e,t){let r=u();i(t,!0);let a=e=>{bo(e,{children:(e,t)=>{ae();var n=S();V(()=>c(n,y())),v(e,n)},$$slots:{default:!0}})},o=D(t,`id`,19,()=>bt(r)),s=D(t,`ref`,15,null),l=D(t,`value`,15,``),d=D(t,`onValueChange`,3,sn),f=D(t,`onStateChange`,3,sn),p=D(t,`loop`,3,!1),h=D(t,`shouldFilter`,3,!0),_=D(t,`filter`,3,ds),y=D(t,`label`,3,``),x=D(t,`vimBindings`,3,!0),C=D(t,`disablePointerSelection`,3,!1),w=D(t,`disableInitialScroll`,3,!1),E=D(t,`columns`,3,null),O=H(t,xo),k=oo.create({id:X(()=>o()),ref:X(()=>s(),e=>s(e)),filter:X(()=>_()),shouldFilter:X(()=>h()),loop:X(()=>p()),value:X(()=>l(),e=>{l()!==e&&(l(e),d()(e))}),vimBindings:X(()=>x()),disablePointerSelection:X(()=>C()),disableInitialScroll:X(()=>w()),onStateChange:X(()=>f()),columns:X(()=>E())}),ee=e=>k.updateSelectedToIndex(e),A=e=>k.updateSelectedByGroup(e),j=e=>k.updateSelectedByItem(e),te=()=>k.getValidItems(),N=P(()=>Lt(O,k.props));var F={updateSelectedToIndex:ee,updateSelectedByGroup:A,updateSelectedByItem:j,getValidItems:te},ne=J(),re=K(ne),I=e=>{var n=So(),r=K(n);a(r);var i=R(r,2);g(i,()=>t.child,()=>({props:T(N)})),v(e,n)},ie=e=>{var r=Co();M(r,()=>({...T(N)}));var i=U(r);a(i);var o=R(i,2);g(o,()=>t.children??L),n(r),v(e,r)};return m(re,e=>{t.child?e(I):e(ie,-1)}),v(e,ne),b(F)}var To=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`forceMount`]),Eo=r(`<div><!></div>`);function Do(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=D(t,`forceMount`,3,!1),c=H(t,To),l=co.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e)),forceMount:X(()=>s())}),d=P(()=>Lt(l.props,c));var f=J(),p=K(f),h=e=>{var r=J(),i=K(r),a=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(d)})),v(e,n)},o=e=>{var r=Eo();M(r,()=>({...T(d)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(i,e=>{t.child?e(a):e(o,-1)}),v(e,r)};m(p,e=>{l.shouldRender&&e(h)}),v(e,f),b()}var Oo=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`forceMount`,`children`,`child`]),ko=r(`<div><!></div>`);function Ao(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=D(t,`value`,3,``),c=D(t,`forceMount`,3,!1),l=H(t,Oo),d=lo.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e)),forceMount:X(()=>c()),value:X(()=>s())}),f=P(()=>Lt(l,d.props));var p=J(),h=K(p),_=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(f)})),v(e,n)},y=e=>{var r=ko();M(r,()=>({...T(f)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(h,e=>{t.child?e(_):e(y,-1)}),v(e,p),b()}var jo=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`]),Mo=r(`<div><!></div>`);function No(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=H(t,jo),c=uo.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e))}),l=P(()=>Lt(s,c.props));var d=J(),f=K(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=Mo();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),v(e,d),b()}var Po=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`]),Fo=r(`<div><!></div>`),Io=r(`<div style="display: contents;"><!></div>`);function Lo(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=H(t,Po),c=fo.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e))}),l=P(()=>Lt(s,c.props));var d=Io(),f=U(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=Fo();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),n(d),v(e,d),b()}var Ro=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`autofocus`,`id`,`ref`,`child`]),zo=r(`<input/>`);function Bo(e,t){let n=u();i(t,!0);let r=D(t,`value`,15,``),a=D(t,`autofocus`,3,!1),o=D(t,`id`,19,()=>bt(n)),s=D(t,`ref`,15,null),c=H(t,Ro),l=po.create({id:X(()=>o()),ref:X(()=>s(),e=>s(e)),value:X(()=>r(),e=>{r(e)}),autofocus:X(()=>a()??!1)}),d=P(()=>Lt(c,l.props));var f=J(),p=K(f),h=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(d)})),v(e,n)},_=e=>{var t=zo();M(t,()=>({...T(d)}),void 0,void 0,void 0,void 0,!0),te(t,r),v(e,t)};m(p,e=>{t.child?e(h):e(_,-1)}),v(e,f),b()}var Vo=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`disabled`,`children`,`child`,`onSelect`,`forceMount`,`keywords`]),Ho=r(`<div><!></div>`),Uo=r(`<div style="display: contents;" data-item-wrapper=""><!></div>`);function Wo(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=D(t,`value`,3,``),c=D(t,`disabled`,3,!1),l=D(t,`onSelect`,3,sn),d=D(t,`forceMount`,3,!1),f=D(t,`keywords`,19,()=>[]),h=H(t,Vo),_=mo.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e)),value:X(()=>s()),disabled:X(()=>c()),onSelect:X(()=>l()),forceMount:X(()=>d()),keywords:X(()=>f())}),y=P(()=>Lt(h,_.props));var x=J(),S=K(x);p(S,()=>_.root.key,e=>{var r=Uo(),i=U(r),a=e=>{var r=J(),i=K(r),a=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(y)})),v(e,n)},o=e=>{var r=Ho();M(r,()=>({...T(y)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(i,e=>{t.child?e(a):e(o,-1)}),v(e,r)};m(i,e=>{_.shouldRender&&e(a)}),n(r),V(()=>z(r,`data-value`,_.trueValue)),v(e,r)}),v(e,x),b()}var Go=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`aria-label`]),Ko=r(`<div><!></div>`);function qo(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=H(t,Go),c=go.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e)),ariaLabel:X(()=>t[`aria-label`]??`Suggestions...`)}),l=P(()=>Lt(s,c.props));var d=J(),f=K(d);p(f,()=>c.root._commandState.search===``,e=>{var r=J(),i=K(r),a=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},o=e=>{var r=Ko();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(i,e=>{t.child?e(a):e(o,-1)}),v(e,r)}),v(e,d),b()}var Jo=new Set([`$$slots`,`$$events`,`$$legacy`,`progress`,`id`,`ref`,`children`,`child`]),Yo=r(`<div><!></div>`);function Xo(e,t){let r=u();i(t,!0);let a=D(t,`progress`,3,0),o=D(t,`id`,19,()=>bt(r)),s=D(t,`ref`,15,null),c=H(t,Jo),l=ho.create({id:X(()=>o()),ref:X(()=>s(),e=>s(e)),progress:X(()=>a())}),d=P(()=>Lt(c,l.props));var f=J(),p=K(f),h=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(d)})),v(e,n)},_=e=>{var r=Yo();M(r,()=>({...T(d)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(p,e=>{t.child?e(h):e(_,-1)}),v(e,f),b()}var Zo=1,Qo=.9,$o=.8,es=.17,ts=.1,ns=.999,rs=.9999,is=.99,as=/[\\/_+.#"@[({&]/,os=/[\\/_+.#"@[({&]/g,ss=/[\s-]/,cs=/[\s-]/g;function ls(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Zo:is;let s=`${i},${a}`;if(o[s]!==void 0)return o[s];let c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;for(;l>=0;)d=ls(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Zo:as.test(e.charAt(l-1))?(d*=$o,p=e.slice(i,l-1).match(os),p&&i>0&&(d*=ns**p.length)):ss.test(e.charAt(l-1))?(d*=Qo,m=e.slice(i,l-1).match(cs),m&&i>0&&(d*=ns**m.length)):(d*=es,i>0&&(d*=ns**(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=rs)),(d<ts&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ls(e,t,n,r,l+1,a+2,o),f*ts>d&&(d=f*ts)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function us(e){return e.toLowerCase().replace(cs,` `)}function ds(e,t,n){return e=n&&n.length>0?`${`${e} ${n?.join(` `)}`}`:e,ls(e,t,us(e),us(t),0,0,{})}var fs=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),ps=r(`<div><!></div>`);function ms(e,t){let r=u();i(t,!0);let a=D(t,`ref`,15,null),o=D(t,`id`,19,()=>bt(r)),s=D(t,`disabled`,3,!1),c=D(t,`onSelect`,3,sn),l=D(t,`closeOnSelect`,3,!0),d=H(t,fs),f=Bt.create({id:X(()=>o()),disabled:X(()=>s()),onSelect:X(()=>c()),ref:X(()=>a(),e=>a(e)),closeOnSelect:X(()=>l())}),p=P(()=>Lt(d,f.props));var h=J(),_=K(h),y=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(p)})),v(e,n)},x=e=>{var r=ps();M(r,()=>({...T(p)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(_,e=>{t.child?e(y):e(x,-1)}),v(e,h),b()}var hs=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),gs=r(`<div><!></div>`);function _s(e,t){let r=u();i(t,!0);let a=D(t,`ref`,15,null),o=D(t,`id`,19,()=>bt(r)),s=H(t,hs),c=Kt.create({id:X(()=>o()),ref:X(()=>a(),e=>a(e))}),l=P(()=>Lt(s,c.props));var d=J(),f=K(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=gs();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),v(e,d),b()}var vs=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),ys=r(`<div><!></div>`);function bs(e,t){let r=u();i(t,!0);let a=D(t,`ref`,15,null),o=D(t,`id`,19,()=>bt(r)),s=H(t,vs),c=qt.create({id:X(()=>o()),ref:X(()=>a(),e=>a(e))}),l=P(()=>Lt(s,c.props));var d=J(),f=K(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=ys();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),v(e,d),b()}var xs=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),Ss=r(`<div><!></div>`);function Cs(e,t){let r=u();i(t,!0);let a=D(t,`ref`,15,null),o=D(t,`id`,19,()=>bt(r)),s=H(t,xs),c=Ht.create({id:X(()=>o()),ref:X(()=>a(),e=>a(e))}),l=P(()=>Lt(s,c.props));var d=J(),f=K(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=Ss();M(r,()=>({...T(l)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),v(e,d),b()}function ws(e,t){i(t,!0);let n=D(t,`open`,15,!1),r=D(t,`dir`,3,`ltr`),a=D(t,`onOpenChange`,3,sn),o=D(t,`onOpenChangeComplete`,3,sn),s=D(t,`_internal_variant`,3,`dropdown-menu`),c=D(t,`_internal_should_skip_exit_animation`,3,void 0),l=ln.create({variant:X(()=>s()),dir:X(()=>r()),onClose:()=>{n(!1),a()(!1)},shouldSkipExitAnimation:()=>c()?.()??!1});on.create({open:X(()=>n(),e=>{n(e),a()(e)}),onOpenChangeComplete:X(()=>o())},l),Na(e,{children:(e,n)=>{var r=J(),i=K(r);g(i,()=>t.children??L),v(e,r)},$$slots:{default:!0}}),b()}var Ts=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Es=r(`<div><div><!></div></div>`);function Ds(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=D(t,`loop`,3,!0),c=D(t,`onInteractOutside`,3,sn),l=D(t,`onEscapeKeydown`,3,sn),d=D(t,`onCloseAutoFocus`,3,sn),f=D(t,`forceMount`,3,!1),p=D(t,`trapFocus`,3,!1),h=H(t,Ts),_=Zt.create({id:X(()=>a()),loop:X(()=>s()),ref:X(()=>o(),e=>o(e)),onCloseAutoFocus:X(()=>d())}),y=P(()=>Lt(h,_.props));function x(e){if(_.handleInteractOutside(e),!e.defaultPrevented&&(c()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}_.parentMenu.onClose()}}function S(e){l()(e),!e.defaultPrevented&&_.parentMenu.onClose()}var C=J(),w=K(C),E=e=>{Ga(e,G(()=>T(y),()=>_.popperProps,{get ref(){return _.opts.ref},get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:x,onEscapeKeydown:S,get trapFocus(){return p()},get loop(){return s()},forceMount:!0,get id(){return a()},get shouldRender(){return _.shouldRender},popper:(e,r)=>{let i=()=>(r?.()).props,a=()=>(r?.()).wrapperProps,o=P(()=>Lt(i(),{style:ya(`dropdown-menu`)},{style:t.style}));var s=J(),c=K(s),l=e=>{var n=J(),r=K(n);{let e=P(()=>({props:T(o),wrapperProps:a(),..._.snippetProps}));g(r,()=>t.child,()=>T(e))}v(e,n)},u=e=>{var r=Es();M(r,()=>({...a()}));var i=U(r);M(i,()=>({...T(o)}));var s=U(i);g(s,()=>t.children??L),n(i),n(r),v(e,r)};m(c,e=>{t.child?e(l):e(u,-1)}),v(e,s)},$$slots:{popper:!0}}))},O=e=>{Ua(e,G(()=>T(y),()=>_.popperProps,{get ref(){return _.opts.ref},get open(){return _.parentMenu.opts.open.current},onInteractOutside:x,onEscapeKeydown:S,get trapFocus(){return p()},get loop(){return s()},forceMount:!1,get id(){return a()},get shouldRender(){return _.shouldRender},popper:(e,r)=>{let i=()=>(r?.()).props,a=()=>(r?.()).wrapperProps,o=P(()=>Lt(i(),{style:ya(`dropdown-menu`)},{style:t.style}));var s=J(),c=K(s),l=e=>{var n=J(),r=K(n);{let e=P(()=>({props:T(o),wrapperProps:a(),..._.snippetProps}));g(r,()=>t.child,()=>T(e))}v(e,n)},u=e=>{var r=Es();M(r,()=>({...a()}));var i=U(r);M(i,()=>({...T(o)}));var s=U(i);g(s,()=>t.children??L),n(i),n(r),v(e,r)};m(c,e=>{t.child?e(l):e(u,-1)}),v(e,s)},$$slots:{popper:!0}}))};m(w,e=>{f()?e(E):f()||e(O,1)}),v(e,C),b()}var Os=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),ks=r(`<button><!></button>`);function As(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=D(t,`disabled`,3,!1),c=D(t,`type`,3,`button`),l=H(t,Os),d=en.create({id:X(()=>a()),disabled:X(()=>s()??!1),ref:X(()=>o(),e=>o(e))}),f=P(()=>Lt(l,d.props,{type:c()}));Pa(e,{get id(){return a()},get ref(){return d.opts.ref},children:(e,r)=>{var i=J(),a=K(i),o=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(f)})),v(e,n)},s=e=>{var r=ks();M(r,()=>({...T(f)}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(a,e=>{t.child?e(o):e(s,-1)}),v(e,i)},$$slots:{default:!0}}),b()}var js=Nt({component:`label`,parts:[`root`]}),Ms=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Ct(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#e=P(()=>({id:this.opts.id.current,[js.root]:``,onmousedown:this.onmousedown,...this.attachment}));get props(){return T(this.#e)}set props(e){N(this.#e,e)}},Ns=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`for`]),Ps=r(`<label><!></label>`);function Fs(e,t){let r=u();i(t,!0);let a=D(t,`id`,19,()=>bt(r)),o=D(t,`ref`,15,null),s=H(t,Ns),c=Ms.create({id:X(()=>a()),ref:X(()=>o(),e=>o(e))}),l=P(()=>Lt(s,c.props,{for:t.for}));var d=J(),f=K(d),p=e=>{var n=J(),r=K(n);g(r,()=>t.child,()=>({props:T(l)})),v(e,n)},h=e=>{var r=Ps();M(r,()=>({...T(l),for:t.for}));var i=U(r);g(i,()=>t.children??L),n(r),v(e,r)};m(f,e=>{t.child?e(p):e(h,-1)}),v(e,d),b()}var Is=class{#e;#t;#n=null;constructor(e,t){this.#t=e,this.#e=t,this.stop=this.stop.bind(this),this.start=this.start.bind(this),un(this.stop)}#r(){this.#n!==null&&(window.clearTimeout(this.#n),this.#n=null)}stop(){this.#r()}start(...e){this.#r(),this.#n=window.setTimeout(()=>{this.#n=null,this.#t(...e)},this.#e)}};Nt({component:`tooltip`,parts:[`content`,`trigger`]});var Ls=new Tt(`Tooltip.Provider`);new Tt(`Tooltip.Root`);var Rs=class e{static create(t){return Ls.set(new e(t))}opts;#e=B(!0);get isOpenDelayed(){return T(this.#e)}set isOpenDelayed(e){N(this.#e,e,!0)}isPointerInTransit=Dt(!1);#t;#n=B(null);constructor(e){this.opts=e,this.#t=new Is(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),vr(()=>le(window,`scroll`,e=>{let t=T(this.#n);if(!t)return;let n=t.triggerNode;if(!n)return;let r=e.target;(r instanceof Element||r instanceof Document)&&r.contains(n)&&t.handleClose()}))}#r=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}this.#t.start()};#i=()=>{this.#t.stop()};onOpen=e=>{T(this.#n)&&T(this.#n)!==e&&T(this.#n).handleClose(),this.#i(),this.isOpenDelayed=!1,N(this.#n,e,!0)};onClose=e=>{T(this.#n)===e&&(N(this.#n,null),this.#r())};isTooltipOpen=e=>T(this.#n)===e};function zs(e,t){i(t,!0);let n=D(t,`delayDuration`,3,700),r=D(t,`disableCloseOnTriggerClick`,3,!1),a=D(t,`disableHoverableContent`,3,!1),o=D(t,`disabled`,3,!1),s=D(t,`ignoreNonKeyboardFocus`,3,!1),c=D(t,`skipDelayDuration`,3,300);Rs.create({delayDuration:X(()=>n()),disableCloseOnTriggerClick:X(()=>r()),disableHoverableContent:X(()=>a()),disabled:X(()=>o()),ignoreNonKeyboardFocus:X(()=>s()),skipDelayDuration:X(()=>c())});var l=J(),u=K(l);g(u,()=>t.children??L),v(e,l),b()}var Bs=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Vs(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,Bs);var o=J(),s=K(o);{let e=P(()=>dn(`gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class));a(s,()=>Fs,(t,i)=>{i(t,G({"data-slot":`label`,get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,o),b()}var Hs=r(`<!> Import workspace`,1),Us=r(`<!> <!>`,1),Ws=r(`<div class="rounded-md border border-destructive/40 bg-destructive/10 p-2.5 text-xs text-destructive"> </div>`),Gs=r(`<!> Browse…`,1),Ks=r(`Display name <span class="text-muted-foreground">(optional)</span>`,1),qs=r(`<!> Import`,1),Js=r(`<!> <!> <div class="space-y-3"><div class="space-y-1.5"><!> <div class="flex gap-2"><!> <!></div> <p class="text-xs text-muted-foreground">Absolute path to a directory containing skill folders.</p></div> <div class="space-y-1.5"><!> <!></div> <div class="flex justify-end gap-2 pt-1"><!> <!></div></div>`,1);function Ys(e,t){i(t,!0);let r=B(!1);W(()=>{be.open=T(r)}),W(()=>{be.open&&N(r,!0)}),W(()=>{T(r)&&(N(o,``),N(s,``),N(u,null))});let o=B(``),s=B(``),l=B(!1),u=B(null),d=B(!0),f=B(!1);async function p(){N(f,!0);try{let e=await ft();if(!e.supported){N(d,!1);return}e.path!==null&&(N(o,e.path,!0),T(s).trim()||N(s,e.path.split(`/`).filter(Boolean).pop()??``,!0))}finally{N(f,!1)}}async function h(){if(!T(o).trim()){N(u,`A directory path is required.`);return}N(l,!0),N(u,null);try{let e=await mt(T(o).trim(),T(s).trim()||void 0);if(!e)return;N(r,!1),await ge(pt(e))}catch(e){N(u,e instanceof Error?e.message:String(e),!0)}finally{N(l,!1)}}var g=J(),_=K(g);a(_,()=>$t,(e,t)=>{t(e,{get open(){return T(r)},set open(e){N(r,e,!0)},children:(e,t)=>{var i=J(),g=K(i);a(g,()=>Qt,(e,t)=>{t(e,{class:`sm:max-w-[460px]`,children:(e,t)=>{var i=Js(),g=K(i);a(g,()=>tn,(e,t)=>{t(e,{children:(e,t)=>{var n=Us(),r=K(n);a(r,()=>Vt,(e,t)=>{t(e,{class:`flex items-center gap-2`,children:(e,t)=>{var n=Hs(),r=K(n);_n(r,{class:`h-4 w-4`}),ae(),v(e,n)},$$slots:{default:!0}})});var i=R(r,2);a(i,()=>rn,(e,t)=>{t(e,{children:(e,t)=>{ae();var n=S(`Import a directory as a skill workspace. Its skills will be discovered and managed here.`);v(e,n)},$$slots:{default:!0}})}),v(e,n)},$$slots:{default:!0}})});var _=R(g,2),y=e=>{var t=Ws(),n=j(t,!0);V(()=>c(n,T(u))),v(e,t)};m(_,e=>{T(u)&&e(y)});var b=R(_,2),x=U(b),C=U(x);Vs(C,{for:`ws-path`,children:(e,t)=>{ae();var n=S(`Directory path`);v(e,n)},$$slots:{default:!0}});var w=R(C,2),E=U(w);gn(E,{id:`ws-path`,placeholder:`/Users/me/.claude/skills`,class:`font-mono text-xs`,get value(){return T(o)},set value(e){N(o,e,!0)}});var D=R(E,2),O=e=>{{let t=P(()=>T(f)||T(l));fn(e,{variant:`outline`,size:`sm`,class:`h-8 shrink-0 gap-1.5`,get disabled(){return T(t)},onclick:()=>void p(),children:(e,t)=>{var n=Gs(),r=K(n),i=e=>{mn(e,{class:`h-3.5 w-3.5 animate-spin`})};m(r,e=>{T(f)&&e(i)}),ae(),v(e,n)},$$slots:{default:!0}})}};m(D,e=>{T(d)&&e(O)}),n(w),ae(2),n(x);var k=R(x,2),ee=U(k);Vs(ee,{for:`ws-label`,children:(e,t)=>{ae();var n=Ks();ae(),v(e,n)},$$slots:{default:!0}});var A=R(ee,2);gn(A,{id:`ws-label`,placeholder:`My Skills`,get value(){return T(s)},set value(e){N(s,e,!0)}}),n(k);var te=R(k,2),M=U(te);fn(M,{variant:`outline`,size:`sm`,onclick:()=>N(r,!1),children:(e,t)=>{ae();var n=S(`Cancel`);v(e,n)},$$slots:{default:!0}});var F=R(M,2);fn(F,{size:`sm`,get disabled(){return T(l)},onclick:h,children:(e,t)=>{var n=qs(),r=K(n),i=e=>{mn(e,{class:`h-3.5 w-3.5 animate-spin`})};m(r,e=>{T(l)&&e(i)}),ae(),v(e,n)},$$slots:{default:!0}}),n(te),n(b),v(e,i)},$$slots:{default:!0}})}),v(e,i)},$$slots:{default:!0}})}),v(e,g),b()}var Xs=new Set([`$$slots`,`$$events`,`$$legacy`,`api`,`ref`,`value`,`class`]);function Zs(e,t){i(t,!0);let n=D(t,`api`,15,null),r=D(t,`ref`,15,null),o=D(t,`value`,15,``),s=H(t,Xs);var c=J(),l=K(c);{let e=P(()=>dn(`bg-popover text-popover-foreground rounded-xl p-1 flex size-full flex-col overflow-hidden`,t.class));a(l,()=>wo,(t,i)=>{oe(i(t,G({"data-slot":`command`,get class(){return T(e)}},()=>s,{get value(){return o()},set value(e){o(e)},get ref(){return r()},set ref(e){r(e)}})),e=>n(e),()=>n())})}v(e,c),b()}var Qs=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function $s(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,Qs);var o=J(),s=K(o);a(s,()=>Xo,(e,t)=>{t(e,G(()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),v(e,o),b()}var ec=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`ref`,`value`,`title`,`description`,`showCloseButton`,`portalProps`,`children`,`class`]),tc=r(`<!> <!>`,1);function nc(e,t){i(t,!0);let n=D(t,`open`,15,!1),r=D(t,`ref`,15,null),o=D(t,`value`,15,``),s=D(t,`title`,3,`Command Palette`),l=D(t,`description`,3,`Search for a command to run...`),u=D(t,`showCloseButton`,3,!1),d=H(t,ec);var f=J(),p=K(f);a(p,()=>$t,(e,i)=>{i(e,G(()=>d,{get open(){return n()},set open(e){n(e)},children:(e,n)=>{var i=tc(),f=K(i);a(f,()=>tn,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{var n=tc(),r=K(n);a(r,()=>Vt,(e,t)=>{t(e,{children:(e,t)=>{ae();var n=S();V(()=>c(n,s())),v(e,n)},$$slots:{default:!0}})});var i=R(r,2);a(i,()=>rn,(e,t)=>{t(e,{children:(e,t)=>{ae();var n=S();V(()=>c(n,l())),v(e,n)},$$slots:{default:!0}})}),v(e,n)},$$slots:{default:!0}})});var p=R(f,2);{let e=P(()=>dn(`rounded-xl! p-0 top-1/3 translate-y-0 overflow-hidden p-0`,t.class));a(p,()=>Qt,(n,i)=>{i(n,{get class(){return T(e)},get showCloseButton(){return u()},get portalProps(){return t.portalProps},children:(e,n)=>{Zs(e,G(()=>d,{get children(){return t.children},get value(){return o()},set value(e){o(e)},get ref(){return r()},set ref(e){r(e)}}))},$$slots:{default:!0}})})}v(e,i)},$$slots:{default:!0}}))}),v(e,f),b()}var rc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function ic(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,rc);var o=J(),s=K(o);{let e=P(()=>dn(`py-6 text-center text-xs/relaxed`,t.class));a(s,()=>Do,(t,i)=>{i(t,G({"data-slot":`command-empty`,get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,o),b()}var ac=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`heading`,`value`]),oc=r(`<!> <!>`,1);function sc(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,ac);var o=J(),s=K(o);{let e=P(()=>dn(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,t.class)),i=P(()=>t.value??t.heading??`----${Ut()}`);a(s,()=>Ao,(o,s)=>{s(o,G({"data-slot":`command-group`,get class(){return T(e)},get value(){return T(i)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=oc(),i=K(r),o=e=>{var n=J(),r=K(n);a(r,()=>No,(e,n)=>{n(e,{class:`text-muted-foreground px-2 py-1.5 text-xs font-medium`,children:(e,n)=>{ae();var r=S();V(()=>c(r,t.heading)),v(e,r)},$$slots:{default:!0}})}),v(e,n)};m(i,e=>{t.heading&&e(o)});var s=R(i,2);a(s,()=>Lo,(e,n)=>{n(e,{get children(){return t.children}})}),v(e,r)},$$slots:{default:!0}}))})}v(e,o),b()}var cc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),lc=r(`<!> <!>`,1);function uc(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,cc);var o=J(),s=K(o);{let e=P(()=>dn(`group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t.class));a(s,()=>Wo,(i,a)=>{a(i,G({"data-slot":`command-item`,get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=lc(),i=K(r);g(i,()=>t.children??L);var a=R(i,2);vn(a,{class:`cn-command-item-indicator ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),v(e,r)},$$slots:{default:!0}}))})}v(e,o),b()}var dc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),fc=r(`<div><!></div>`);function pc(e,t){i(t,!0);let r=D(t,`ref`,15,null),a=H(t,dc);var o=fc();M(o,e=>({"data-slot":`input-group`,role:`group`,class:e,...a}),[()=>dn(`group/input-group border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-2 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,t.class)]);var s=U(o);g(s,()=>t.children??L),n(o),oe(o,e=>r(e),()=>r()),v(e,o),b()}var mc=pn({base:`text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none`,variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last`,"block-start":`px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}}),hc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`align`]),gc=r(`<div><!></div>`);function _c(e,t){i(t,!0);let r=D(t,`ref`,15,null),a=D(t,`align`,3,`inline-start`),o=H(t,hc);var s=gc(),c=e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()};M(s,e=>({role:`group`,"data-slot":`input-group-addon`,"data-align":a(),class:e,onclick:c,...o}),[()=>dn(mc({align:a()}),t.class)]);var l=U(s);g(l,()=>t.children??L),n(s),oe(s,e=>r(e),()=>r()),v(e,s),b()}pn({base:`gap-2 rounded-md text-xs/relaxed flex items-center shadow-none`,variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});var vc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`]);function yc(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=D(t,`value`,15),a=H(t,vc);{let i=P(()=>dn(`rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1`,t.class));gn(e,G({"data-slot":`input-group-control`,get class(){return T(i)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))}b()}var bc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`]),xc=r(`<!> <!>`,1),Sc=r(`<div data-slot="command-input-wrapper" class="p-1 pb-0"><!></div>`);function Cc(e,t){i(t,!0);let r=D(t,`ref`,15,null),o=D(t,`value`,15,``),s=H(t,bc);var c=Sc(),l=U(c);a(l,()=>pc,(e,n)=>{n(e,{class:`bg-input/20 dark:bg-input/30 h-8!`,children:(e,n)=>{var i=xc(),c=K(i);{let e=(e,t)=>{let n=()=>(t?.()).props;var i=J(),s=K(i);a(s,()=>yc,(e,t)=>{t(e,G(n,{get value(){return o()},set value(e){o(e)},get ref(){return r()},set ref(e){r(e)}}))}),v(e,i)},n=P(()=>dn(`w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t.class));a(c,()=>Bo,(t,r)=>{r(t,G({get value(){return o()},"data-slot":`command-input`,get class(){return T(n)}},()=>s,{child:e,$$slots:{child:!0}}))})}var l=R(c,2);a(l,()=>_c,(e,t)=>{t(e,{children:(e,t)=>{bn(e,{class:`size-3.5 shrink-0 opacity-50`})},$$slots:{default:!0}})}),v(e,i)},$$slots:{default:!0}})}),n(c),v(e,c),b()}var wc=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Tc(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,wc);var o=J(),s=K(o);{let e=P(()=>dn(`no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto`,t.class));a(s,()=>qo,(t,i)=>{i(t,G({"data-slot":`command-list`,get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,o),b()}var Ec=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dc(e,t){let n=H(t,Ec),r=[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M14 19h6`}],[`path`,{d:`M17 16v6`}]];ve(e,G({name:`file-plus-corner`},()=>n,{get iconNode(){return r}}))}var Oc=new Set([`$$slots`,`$$events`,`$$legacy`]);function kc(e,t){let n=H(t,Oc),r=[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`}]];ve(e,G({name:`layout-grid`},()=>n,{get iconNode(){return r}}))}var Ac=r(`<!> Workspaces`,1),jc=r(`<!> Creator`,1),Mc=r(`<!> Repository`,1),Nc=r(`<!> Open search config`,1),Pc=r(`<!> <!> <!> <!>`,1),Fc=r(`<!> <span class="flex-1 truncate"> </span> <span class="text-xs tabular-nums text-muted-foreground"> </span>`,1),Ic=r(`<div class="px-2.5 py-1.5 text-xs text-muted-foreground">Type to search skills across workspaces…</div>`),Lc=r(`<div class="px-2.5 py-1.5 text-xs text-destructive"> </div>`),Rc=r(`<div class="px-2.5 py-1.5 text-xs text-muted-foreground">No matching skill.</div>`),zc=r(`<span class="hidden min-w-0 max-w-[45%] truncate text-xs text-muted-foreground sm:block"> </span>`),Bc=r(`<!> <span class="min-w-0 flex-1 truncate"> </span> <!>`,1),Vc=r(`<!> <!>`,1);function Hc(e,n){i(n,!0);let r=B(!1),o=B(``);W(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),N(r,!T(r)))};return globalThis.addEventListener(`keydown`,e),()=>globalThis.removeEventListener(`keydown`,e)}),W(()=>{if(!T(r))return;let e=T(o).trim();if(!e)return;let t=setTimeout(()=>void ct(e,20),150);return()=>clearTimeout(t)}),W(()=>{T(r)||(N(o,``),st())});function s(e){N(r,!1),e()}let l=P(()=>T(o).trim()),u=P(()=>at.query===T(l)),d=P(()=>!T(u)||T(u)&&at.searching),f=P(()=>{if(!T(l)||!T(u)||at.error)return[];let e=[];for(let t of at.results)for(let n of t.installations)e.push({key:`${n.workspaceId}:${n.providerId}:${t.id}`,result:t,workspaceId:n.workspaceId,providerId:n.providerId,heading:ot(n.workspaceId,n.providerId)});return e}),p=P(()=>{let e=new Map;for(let t of T(f)){let n=`${t.workspaceId}/${t.providerId}`,r=e.get(n)??{scope:n,heading:t.heading,rows:[]};r.rows.push(t),e.set(n,r)}return[...e.values()]});var h=J(),g=K(h);a(g,()=>nc,(e,n)=>{n(e,{get open(){return T(r)},set open(e){N(r,e,!0)},children:(e,n)=>{var r=Vc(),i=K(r);a(i,()=>Cc,(e,t)=>{t(e,{placeholder:`Search navigation, workspaces and skills…`,get value(){return T(o)},set value(e){N(o,e,!0)}})});var f=R(i,2);a(f,()=>Tc,(e,n)=>{n(e,{children:(e,n)=>{var r=Pc(),i=K(r),o=e=>{var t=J(),n=K(t);a(n,()=>ic,(e,t)=>{t(e,{children:(e,t)=>{ae();var n=S(`No matching destination.`);v(e,n)},$$slots:{default:!0}})}),v(e,t)};m(i,e=>{T(l)||e(o)});var f=R(i,2);a(f,()=>sc,(e,t)=>{t(e,{heading:`Navigate`,children:(e,t)=>{var n=Pc(),r=K(n);a(r,()=>uc,(e,t)=>{t(e,{onSelect:()=>s(()=>ge(`/workspaces`)),value:`go workspaces manage locations`,children:(e,t)=>{var n=Ac();kc(K(n),{class:`h-4 w-4`}),ae(),v(e,n)},$$slots:{default:!0}})});var i=R(r,2);a(i,()=>uc,(e,t)=>{t(e,{onSelect:()=>s(()=>ge(`/creator`)),value:`go creator new skill`,children:(e,t)=>{var n=jc();Dc(K(n),{class:`h-4 w-4`}),ae(),v(e,n)},$$slots:{default:!0}})});var o=R(i,2);a(o,()=>uc,(e,t)=>{t(e,{onSelect:()=>s(()=>ge(`/repository`)),value:`go repository browse remote`,children:(e,t)=>{var n=Mc(),r=K(n);Sn(r,{class:`h-4 w-4`}),ae(),v(e,n)},$$slots:{default:!0}})});var c=R(o,2);a(c,()=>uc,(e,t)=>{t(e,{onSelect:()=>s(()=>void it()),value:`go search config toml`,children:(e,t)=>{var n=Nc(),r=K(n);xn(r,{class:`h-4 w-4`}),ae(),v(e,n)},$$slots:{default:!0}})}),v(e,n)},$$slots:{default:!0}})});var h=R(f,2),g=e=>{var n=J(),r=K(n);a(r,()=>sc,(e,n)=>{n(e,{heading:`Workspaces`,children:(e,n)=>{var r=J(),i=K(r);t(i,17,()=>ut.workspaces,e=>e.id,(e,t)=>{var n=J(),r=K(n);{let e=P(()=>`workspace ${T(t).label} ${T(t).path}`);a(r,()=>uc,(n,r)=>{r(n,{get value(){return T(e)},onSelect:()=>s(()=>ge(pt(T(t)))),children:(e,n)=>{var r=Fc(),i=K(r);_n(i,{class:`h-4 w-4`});var a=R(i,2),o=j(a,!0),s=R(a,2),l=j(s,!0);V(()=>{c(o,T(t).label),c(l,T(t).skillCount??0)}),v(e,r)},$$slots:{default:!0}})})}v(e,n)}),v(e,r)},$$slots:{default:!0}})}),v(e,n)};m(h,e=>{ut.workspaces.length>0&&e(g)});var _=R(h,2),y=e=>{var t=J(),n=K(t);a(n,()=>sc,(e,t)=>{t(e,{heading:`Skills`,value:`skills`,forceMount:!0,children:(e,t)=>{var n=Ic();v(e,n)},$$slots:{default:!0}})}),v(e,t)},b=e=>{var t=J(),n=K(t);a(n,()=>sc,(e,t)=>{t(e,{heading:`Skills`,value:`skills`,forceMount:!0,children:(e,t)=>{var n=J(),r=K(n);a(r,()=>$s,(e,t)=>{t(e,{children:(e,t)=>{ae();var n=S(`Searching skills…`);v(e,n)},$$slots:{default:!0}})}),v(e,n)},$$slots:{default:!0}})}),v(e,t)},x=e=>{var t=J(),n=K(t);a(n,()=>sc,(e,t)=>{t(e,{heading:`Skills`,value:`skills`,forceMount:!0,children:(e,t)=>{var n=Lc(),r=j(n);V(()=>c(r,`Skill search failed — ${at.error??``}`)),v(e,n)},$$slots:{default:!0}})}),v(e,t)},C=e=>{var t=J(),n=K(t);a(n,()=>sc,(e,t)=>{t(e,{heading:`Skills`,value:`skills`,forceMount:!0,children:(e,t)=>{var n=Rc();v(e,n)},$$slots:{default:!0}})}),v(e,t)},w=e=>{var n=J(),r=K(n);t(r,17,()=>T(p),e=>e.scope,(e,n)=>{var r=J(),i=K(r);a(i,()=>sc,(e,r)=>{r(e,{get heading(){return T(n).heading},get value(){return T(n).scope},forceMount:!0,children:(e,r)=>{var i=J(),o=K(i);t(o,17,()=>T(n).rows,e=>e.key,(e,t)=>{var n=J(),r=K(n);{let e=P(()=>`skill ${T(t).result.name} ${T(t).key}`);a(r,()=>uc,(n,r)=>{r(n,{get value(){return T(e)},forceMount:!0,onSelect:()=>s(()=>Te(`workspaces.provider`,{wsId:T(t).workspaceId,providerId:T(t).providerId},{skill:T(t).result.id,view:`detail`})),children:(e,n)=>{var r=Bc(),i=K(r);Cn(i,{class:`h-4 w-4 shrink-0`});var a=R(i,2),o=j(a,!0),s=R(a,2),l=e=>{var n=zc(),r=j(n,!0);V(()=>c(r,T(t).result.description)),v(e,n)};m(s,e=>{T(t).result.description&&e(l)}),V(()=>c(o,T(t).result.name)),v(e,r)},$$slots:{default:!0}})})}v(e,n)}),v(e,i)},$$slots:{default:!0}})}),v(e,r)}),v(e,n)};m(_,e=>{T(l)?T(d)?e(b,1):T(u)&&at.error?e(x,2):T(p).length===0?e(C,3):e(w,-1):e(y)}),v(e,r)},$$slots:{default:!0}})}),v(e,r)},$$slots:{default:!0}})}),v(e,h),b()}var Uc=r(`<button class="text-xs font-medium text-primary hover:underline"> </button>`),Wc=r(`<div class="pointer-events-auto flex items-center gap-3 rounded-md border border-border bg-popover px-4 py-2.5 text-sm"><span class="flex-1 text-foreground"> </span> <!> <button class="text-muted-foreground hover:text-foreground" aria-label="Dismiss notification" title="Dismiss notification"><!></button></div>`),Gc=r(`<div class="pointer-events-none fixed bottom-4 right-4 z-50 flex flex-col gap-2" aria-live="polite" aria-relevant="additions text"></div>`);function Kc(e,r){i(r,!1),A();var a=Gc();t(a,5,()=>gt,e=>e.id,(e,t)=>{var r=Wc(),i=U(r),a=j(i,!0),o=R(i,2),s=e=>{var n=Uc(),r=j(n,!0);V(()=>c(r,T(t).action.label)),l(`click`,n,()=>{T(t).action.run(),_t(T(t).id)}),v(e,n)};m(o,e=>{T(t).action&&e(s)});var u=R(o,2),d=U(u);hn(d,{class:`h-3.5 w-3.5`}),n(u),n(r),V(()=>c(a,T(t).message)),l(`click`,u,()=>_t(T(t).id)),v(e,r)}),n(a),v(e,a),b()}w([`click`]);var qc=new Set([`$$slots`,`$$events`,`$$legacy`,`delayDuration`]);function Jc(e,t){let n=D(t,`delayDuration`,3,0),r=H(t,qc);var i=J(),o=K(i);a(o,()=>zs,(e,t)=>{t(e,G({get delayDuration(){return n()}},()=>r))}),v(e,i)}var Yc=()=>navigator.opentrayWindow??navigator.opentray?.window??void 0,Xc={width:960,height:680},Zc={width:1100,height:760};async function Qc(e){let t=Yc();if(t?.resizeTo&&t.getBounds)try{let n=await t.getBounds(),r=Math.max(n.width,e.width),i=Math.max(n.height,e.height);if(r===n.width&&i===n.height)return;await t.resizeTo(r,i)}catch{}}var $c=new Set([`$$slots`,`$$events`,`$$legacy`]);function el(e,t){let n=H(t,$c),r=[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`}]];ve(e,G({name:`command`},()=>n,{get iconNode(){return r}}))}var tl=r(`<option>New session…</option>`),nl=r(`<option>No sessions</option>`),rl=r(`<option> </option>`),il=r(`<button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground" title="New session" aria-label="New session"><!></button>`),al=r(`<header class="flex h-10 shrink-0 items-center gap-1 border-b border-border px-2"><span class="px-1 text-xs font-medium text-muted-foreground">Agent</span> <select class="h-8 min-w-0 flex-1 rounded-md border border-border bg-transparent px-2 py-0 text-xs" aria-label="Session"><!><!><!></select> <!> <button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground" title="Close panel" aria-label="Close panel"><!></button></header>`);function ol(e,r){i(r,!0);let a=P(()=>{let e=Ln.sessions.find(e=>e.sessionId===Q.sessionId);return e?`${e.title||e.sessionId} (${e.status})`:void 0});var o=al(),s=R(U(o),2),u=U(s),d=e=>{var t=tl();t.value=t.__value=``,v(e,t)};m(u,e=>{Q.sessionId===null&&e(d)});var f=R(u),p=e=>{var t=nl();t.value=t.__value=``,v(e,t)};m(f,e=>{Ln.sessions.length===0&&Q.sessionId!==null&&e(p)});var h=R(f);t(h,17,()=>Ln.sessions,e=>e.sessionId,(e,t)=>{var n=rl(),r=j(n),i={};V(e=>{c(r,`${e??``}
3
+ ${T(t).status===`disposed`?`· ended`:`· ${T(t).status}`}`),i!==(i=T(t).sessionId)&&(n.value=(n.__value=i)??``)},[()=>T(t).title||T(t).sessionId.slice(0,14)]),v(e,n)}),n(s);var g;q(s);var _=R(s,2),y=e=>{var t=il(),r=U(t);rr(r,{class:`h-4 w-4`}),n(t),l(`click`,t,()=>Zn()),v(e,t)};m(_,e=>{Q.sessionId&&e(y)});var x=R(_,2),S=U(x);hn(S,{class:`h-4 w-4`}),n(x),n(o),V(()=>{z(s,`title`,T(a)),g!==(g=Q.sessionId??``)&&(s.value=(s.__value=g)??``,he(s,g))}),l(`change`,s,e=>Un(e.currentTarget.value)),l(`click`,x,()=>$n(!1)),v(e,o),b()}w([`change`,`click`]);var sl=new Set([`$$slots`,`$$events`,`$$legacy`]);function cl(e,t){let n=H(t,sl),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];ve(e,G({name:`copy`},()=>n,{get iconNode(){return r}}))}var ll=new Set([`$$slots`,`$$events`,`$$legacy`]);function ul(e,t){let n=H(t,ll),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];ve(e,G({name:`file`},()=>n,{get iconNode(){return r}}))}var dl=new Set([`$$slots`,`$$events`,`$$legacy`]);function fl(e,t){let n=H(t,dl),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}]];ve(e,G({name:`image`},()=>n,{get iconNode(){return r}}))}var pl=new Set([`$$slots`,`$$events`,`$$legacy`]);function ml(e,t){let n=H(t,pl),r=[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]];ve(e,G({name:`arrow-down`},()=>n,{get iconNode(){return r}}))}var hl=r(`<div class="text-[11px] font-medium text-muted-foreground"> </div>`),gl=r(`<div class="whitespace-pre-wrap text-[11px] text-muted-foreground"> </div>`),_l=r(`<span class="block text-[10px] text-muted-foreground"> </span>`),vl=r(`<button> <!></button>`),yl=r(`<div class="flex flex-wrap gap-1.5"></div>`),bl=r(`<div class="mb-2 space-y-1.5"><!> <div class="whitespace-pre-wrap"> </div> <!> <!> <!></div>`),xl=r(`<div class="flex justify-end"><!></div>`),Sl=r(`<div class="rounded-lg border border-amber-500/40 bg-amber-500/5 px-3 py-2.5 text-xs" role="group"><div class="mb-2 flex items-center gap-1.5 font-medium text-amber-600 dark:text-amber-400"> </div> <!> <!></div>`);function Cl(e,r){i(r,!0);let a=de({}),o=de({});function s(e,t){let n=a[e.id]??[];e.multiSelect?a[e.id]=n.includes(t)?n.filter(e=>e!==t):[...n,t]:a[e.id]=n.includes(t)?[]:[t]}function u(){return r.questions.every(e=>(a[e.id]??[]).length>0||(o[e.id]??``).trim().length>0)}function d(){Jn(r.seq,r.questions.map(e=>({id:e.id,selected:a[e.id]??[],custom:(o[e.id]??``).trim()||void 0})))}var f=Sl(),p=U(f),h=j(p,!0),g=R(p,2);t(g,17,()=>r.questions,e=>e.id,(e,i)=>{var u=bl(),d=U(u),f=e=>{var t=hl(),n=j(t,!0);V(()=>c(n,T(i).header)),v(e,t)};m(d,e=>{T(i).header&&e(f)});var p=R(d,2),h=j(p,!0),g=R(p,2),_=e=>{var t=gl(),n=j(t,!0);V(()=>c(n,T(i).detail)),v(e,t)};m(g,e=>{T(i).detail&&e(_)});var y=R(g,2),b=e=>{var o=yl();t(o,21,()=>T(i).options,e=>e.label,(e,t)=>{var o=vl(),u=U(o),d=R(u),f=e=>{var n=_l(),r=j(n,!0);V(()=>c(r,T(t).description)),v(e,n)};m(d,e=>{T(t).description&&e(f)}),n(o),V((e,n)=>{me(o,1,`rounded-md border px-2 py-1 transition-colors ${e??``}`),o.disabled=r.resolved,z(o,`aria-pressed`,n),c(u,`${T(t).label??``} `)},[()=>(a[T(i).id]??[]).includes(T(t).label)?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-muted`,()=>(a[T(i).id]??[]).includes(T(t).label)]),l(`click`,o,()=>s(T(i),T(t).label)),v(e,o)}),n(o),v(e,o)};m(y,e=>{T(i).options&&T(i).options.length>0&&e(b)});var x=R(y,2);{let e=P(()=>o[T(i).id]??``);gn(x,{placeholder:`Custom answer (optional)`,get disabled(){return r.resolved},get value(){return T(e)},onchange:e=>o[T(i).id]=e.currentTarget.value,class:`h-7 text-xs`,get"aria-label"(){return`Custom answer for ${T(i).question??``}`}})}n(u),V(()=>c(h,T(i).question)),v(e,u)});var _=R(g,2),y=e=>{var t=xl(),r=U(t);{let e=P(()=>!u());fn(r,{size:`sm`,get disabled(){return T(e)},onclick:d,children:(e,t)=>{ae();var n=S(`Submit answer`);v(e,n)},$$slots:{default:!0}})}n(t),v(e,t)};m(_,e=>{r.resolved||e(y)}),n(f),V(()=>{z(f,`aria-label`,r.resolved?`Answered question`:`Pending question`),c(h,r.resolved?`Answered`:`Your decision`)}),v(e,f),b()}w([`click`]);var wl=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tl(e,t){let n=H(t,wl),r=[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]];ve(e,G({name:`terminal`},()=>n,{get iconNode(){return r}}))}var El=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dl(e,t){let n=H(t,El),r=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]];ve(e,G({name:`wrench`},()=>n,{get iconNode(){return r}}))}var Ol=r(`<span class="h-1.5 w-1.5 shrink-0 rounded-full bg-destructive" title="Tool error" aria-label="Tool error"></span>`),kl=r(`<button type="button" class="disclosure-row"><span class="flex items-center justify-center text-muted-foreground" aria-hidden="true"><!></span> <span class="flex items-center gap-1 overflow-hidden"><span class="max-w-40 truncate text-left font-medium text-foreground"> </span> <!></span> <span class="text-center text-muted-foreground/70" aria-hidden="true">·</span> <span> </span> <!></button>`);function Al(e,t){i(t,!0);let r=D(t,`summary`,3,``),o=D(t,`open`,3,!1),s=D(t,`running`,3,!1),u=D(t,`error`,3,!1);var d=kl(),f=U(d),p=U(f);a(p,()=>t.icon,(e,t)=>{t(e,{class:`h-3.5 w-3.5`})}),n(f);var h=R(f,2),g=U(h),_=j(g,!0),y=R(g,2),x=e=>{var t=Ol();v(e,t)};m(y,e=>{u()&&e(x)}),n(h);var S=R(h,4),C=j(S,!0),w=R(S,2);or(w,{class:`disclosure-chevron h-3.5 w-3.5 shrink-0 text-muted-foreground`}),n(d),V(()=>{z(d,`data-open`,o()),z(d,`aria-expanded`,o()),z(d,`title`,r().length>0?`${t.title} · ${r()}`:t.title),c(_,t.title),me(S,1,`disclosure-summary ${s()?`sweep`:``}`),c(C,r())}),l(`click`,d,function(...e){t.onToggle?.apply(this,e)}),v(e,d),b()}w([`click`]);var jl=r(`<iframe sandbox="allow-scripts"></iframe>`),Ml=r(`<div class="px-3 py-2 text-[11px] text-muted-foreground"> </div>`),Nl=r(`<div class="px-3 py-2 text-[11px] text-muted-foreground" role="status">Loading card…</div>`),Pl=r(`<div class="my-1 overflow-hidden rounded-lg border border-border"><!></div>`);function Fl(e,t){i(t,!0);let r=B(null),a=B(!1),o=B(null),s=B(null);W(()=>{let e=t.resourceUri;N(r,null),N(a,!1),Ye().agent.card.get({uri:e}).then(e=>{if(e.html===null){N(a,!0);return}N(r,e.html,!0)}).catch(()=>{N(a,!0)})});function l(e){let t=e.data;if(typeof t==`object`&&t&&t.source===`skill-creator-card`&&T(s)!==null&&e.source===T(s).contentWindow){if(t.type===`ui/navigate`&&typeof t.intent==`string`&&t.intent.startsWith(`/`)&&!t.intent.startsWith(`//`)){ge(t.intent);return}if(t.type===`ui/resize`){let e=Number(t.height);Number.isFinite(e)&&e>0&&N(o,Math.min(400,Math.max(40,Math.ceil(e))),!0)}}}function u(e,t){return e.srcdoc=t,{update(t){e.srcdoc=t}}}var p=Pl();f(`message`,O,l);var h=U(p),g=e=>{var n=jl();oe(n,e=>N(s,e),()=>T(s)),fe(n,(e,t)=>u?.(e,t),()=>T(r)),V(()=>{z(n,`title`,t.title),me(n,1,`w-full border-0 bg-transparent ${T(o)===null?`h-44`:``}`),k(n,T(o)===null?void 0:`height:${T(o)}px`)}),d(n),v(e,n)},_=e=>{var n=Ml(),r=j(n);V(()=>c(r,`Card unavailable: ${t.title??``}`)),v(e,n)},y=e=>{var t=Nl();v(e,t)};m(h,e=>{T(r)===null?T(a)?e(_,1):e(y,-1):e(g)}),n(p),V(()=>z(p,`data-card-uri`,t.resourceUri)),v(e,p),b()}var Il=Re(Pe(),Le()),Ll=Ge([Pe(),Ie({content:Fe(Ie({text:Pe().optional()}).loose()).optional()}).loose(),Re(Pe(),Le())]),Rl=Ie({kind:Be(`proposed`),proposalId:Pe().min(1),capability:Pe().optional(),status:Pe().optional()}),zl=Ie({uiCard:Ie({resourceUri:Pe().min(1),title:Pe().optional()})}),Bl=Ie({content:Fe(Le()).optional()}),Vl=Ie({text:Pe().optional()}),Hl=Ie({status:Pe().optional()}),Ul=Ie({error:Pe().min(1).optional()});function Wl(e){if(e===void 0||e.length===0)return null;try{let t=JSON.parse(e),n=Il.safeParse(t);return n.success?n.data:null}catch{let t={};for(let n of[`command`,`description`,`file_path`,`path`,`pattern`,`url`,`query`]){let r=e.match(RegExp(`"${n}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`))??e.match(RegExp(`"${n}"\\s*:\\s*"((?:[^"\\\\]|\\.)*)$`));r&&(t[n]=r[1])}return Object.keys(t).length>0?t:null}}function Gl(e){if(e===void 0)return``;let t=Ll.safeParse(e);if(t.success){let e=t.data;if(typeof e==`string`)return e;if(Array.isArray(e.content)){let t=[];for(let n of e.content)typeof n.text==`string`&&t.push(n.text);if(t.length>0)return t.join(`
4
+ `)}}try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function Kl(e,t){if(e===void 0)return null;let n=Rl.safeParse(e);return n.success?{proposalId:n.data.proposalId,capability:n.data.capability??t,status:n.data.status??`pending`}:null}function ql(e){if(e===void 0)return null;let t=[e],n=Bl.safeParse(e);if(n.success&&n.data.content!==void 0)for(let e of n.data.content){let n=Vl.safeParse(e);n.success&&typeof n.data.text==`string`&&t.push(n.data.text)}for(let e of t)if(typeof e==`string`)try{let t=JSON.parse(e),n=zl.safeParse(t);if(n.success)return{resourceUri:n.data.uiCard.resourceUri,title:n.data.uiCard.title??`Card`}}catch{}return null}function Jl(e){if(!Array.isArray(e))return null;let t=0;for(let n of e){let e=Hl.safeParse(n);e.success&&e.data.status===`completed`&&(t+=1)}let n=e.length;return`${n} todo${n===1?``:`s`} · ${t} done`}function Yl(e,t){let n=Ul.safeParse(e);if(n.success&&n.data.error!==void 0)return(n.data.error.split(`
5
+ `,1)[0]??``).trim();let r=(t.split(`
6
+ `,1)[0]??``).trim();return r.length>80?`${r.slice(0,80)}…`:r}function Xl(e){return/^\+(?![-+])/.test(e)?`bg-emerald-500/10`:/^-(?![-+])/.test(e)?`bg-rose-500/10`:``}var Zl=r(`<div class="mt-1 rounded-lg bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive"> </div>`),Ql=r(`<span class="sweep px-1">running</span>`),$l=r(`<div class="tool-card mt-1 overflow-hidden border-border bg-[#0c1016] text-zinc-200"><div class="flex items-center justify-between px-2 py-1 text-[10px] text-zinc-400"><span> </span> <!></div> <pre class="max-h-[260px] overflow-auto border-t border-white/10 px-2 py-1.5 whitespace-pre-wrap"> </pre></div>`),eu=r(`<span> </span>`),tu=r(`<div class="tool-card mt-1 overflow-hidden"><div class="truncate border-b border-border px-2 py-1 text-[10px] text-muted-foreground"> </div> <div class="max-h-[150px] overflow-auto px-2 py-1.5 whitespace-pre-wrap"></div></div>`),nu=r(`<div class="tool-card mt-1 overflow-hidden"><div class="border-b border-border px-2 py-1 text-[10px] text-muted-foreground"> </div> <pre class="max-h-[150px] overflow-auto px-2 py-1.5 whitespace-pre-wrap"> </pre></div>`),ru=r(`<div class="tool-card max-h-[150px] overflow-auto"><div class="sticky top-0 bg-muted px-2 py-1 text-[10px] text-muted-foreground">Input</div> <pre class="px-2 py-1.5 whitespace-pre-wrap"> </pre></div>`),iu=r(`<div class="tool-card max-h-[150px] overflow-auto"><div class="sticky top-0 bg-muted px-2 py-1 text-[10px] text-muted-foreground">Output</div> <pre class="px-2 py-1.5 whitespace-pre-wrap"> </pre></div>`),au=r(`<div class="tool-card sweep px-2 py-1.5 text-muted-foreground">running…</div>`),ou=r(`<div class="mt-1 space-y-1"><!> <!></div>`),su=r(`<!> <!>`,1),cu=r(`<div class="flow-item"><!> <!> <!></div>`);function lu(e,r){i(r,!0);let a=D(r,`running`,3,!1),o=B(!1),s=P(()=>r.toolName.replace(/^mcp__[^_]+__/,``)),l=P(()=>{let e=r.toolName.toLowerCase();return e.includes(`bash`)||e.includes(`shell`)||e.includes(`terminal`)?`bash`:/read|write|edit|file|glob|grep/.test(e)?`file`:e.includes(`image`)?`image`:`generic`}),u=P(()=>T(l)===`bash`?Tl:T(l)===`file`?ir:T(l)===`image`?fl:Dl),d=P(()=>Wl(r.argsText)),f=e=>typeof e==`string`?e:``;function p(e){return(e.split(`
7
+ `,1)[0]??``).trim()}let h=P(()=>{let e=T(d);if(T(l)===`bash`){let t=f(e?.description);if(t.length>0)return t;let n=f(e?.command);return n.length>0?p(n):``}if(T(l)===`file`){let t=f(e?.file_path)||f(e?.path);if(t.length>0)return t}let t=Jl(e?.todos);if(t!==null)return t;if(e!==null){for(let t of Object.values(e))if(typeof t==`string`&&t.length>0)return t.length>64?`${t.slice(0,64)}…`:t;let t=(()=>{try{return JSON.stringify(e)}catch{return``}})();if(t.length>0)return t.length>64?`${t.slice(0,64)}…`:t}return``}),g=P(()=>Gl(r.result)),_=P(()=>r.phase===`error`?Yl(r.result,T(g)):``),x=P(()=>Kl(r.result,r.toolName)),S=P(()=>ql(r.result)),C=P(()=>{if(r.argsText===void 0||r.argsText.length===0)return``;try{let e=JSON.parse(r.argsText);return JSON.stringify(e,null,2)??r.argsText}catch{return r.argsText}}),w=P(()=>(T(g).length>0?T(g):T(C)).split(`
8
+ `)),E=P(()=>{if(r.startedAt===void 0||r.endedAt===void 0)return``;let e=Date.parse(r.endedAt)-Date.parse(r.startedAt);return!Number.isFinite(e)||e<0?``:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}),O=P(()=>{let e=[T(s)];return T(E)&&e.push(T(E)),r.phase===`error`&&e.push(`error`),e.join(` · `)});var k=cu(),ee=U(k),A=e=>{yn(e,{get proposalId(){return T(x).proposalId},get capability(){return T(x).capability},get input(){return r.result},get status(){return T(x).status}})},te=e=>{Fl(e,{get resourceUri(){return T(S).resourceUri},get title(){return T(S).title}})};m(ee,e=>{T(x)?e(A):T(S)&&e(te,1)});var M=R(ee,2);{let e=P(()=>a()&&r.phase===`calling`),t=P(()=>r.phase===`error`);Al(M,{get icon(){return T(u)},get title(){return T(s)},get summary(){return T(h)},get open(){return T(o)},get running(){return T(e)},get error(){return T(t)},onToggle:()=>N(o,!T(o))})}var F=R(M,2),ne=e=>{var i=su(),o=K(i),s=e=>{var t=Zl(),n=j(t,!0);V(()=>c(n,T(_))),v(e,t)};m(o,e=>{r.phase===`error`&&T(_).length>0&&e(s)});var u=R(o,2),p=e=>{let t=P(()=>f(T(d)?.command));var i=$l(),o=U(i),s=U(o),l=j(s,!0),u=R(s,2),p=e=>{var t=Ql();v(e,t)};m(u,e=>{a()&&r.phase===`calling`&&e(p)}),n(o);var h=R(o,2),_=j(h,!0);n(i),V(()=>{c(l,T(O)),c(_,T(t).length>0?`$ ${T(t)}${T(g).length>0?`\n\n${T(g)}`:``}`:T(g))}),v(e,i)},h=e=>{var r=tu(),i=U(r),a=j(i,!0),o=R(i,2);t(o,21,()=>T(w),I,(e,t,n)=>{var r=eu(),i=j(r);V(e=>{me(r,1,e),c(i,`${T(t)??``}${n<T(w).length-1?`
9
+ `:``}`)},[()=>y(Xl(T(t)))]),v(e,r)}),n(o),n(r),V(e=>c(a,e),[()=>f(T(d)?.file_path)||f(T(d)?.path)||T(O)]),v(e,r)},b=e=>{var t=nu(),r=U(t),i=j(r,!0),a=R(r,2),o=j(a,!0);n(t),V(()=>{c(i,T(O)),c(o,T(C)||T(g))}),v(e,t)},x=e=>{var t=ou(),i=U(t),a=e=>{var t=ru(),r=R(U(t),2),i=j(r,!0);n(t),V(()=>c(i,T(C))),v(e,t)};m(i,e=>{T(C).length>0&&e(a)});var o=R(i,2),s=e=>{var t=iu(),r=R(U(t),2),i=j(r,!0);n(t),V(()=>c(i,T(g))),v(e,t)},l=e=>{var t=au();v(e,t)};m(o,e=>{T(g).length>0?e(s):r.phase===`calling`&&e(l,1)}),n(t),v(e,t)};m(u,e=>{T(l)===`bash`?e(p):T(l)===`file`?e(h,1):T(l)===`image`?e(b,2):e(x,-1)}),v(e,i)};m(F,e=>{T(o)&&e(ne)}),n(k),v(e,k),b()}function uu(e){return Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):`0`}function du(e){return!Number.isFinite(e)||e<0?``:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}var fu=Object.create,pu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,hu=Object.getOwnPropertyNames,gu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty,vu=(e,t)=>function(){return t||(0,e[hu(e)[0]])((t={exports:{}}).exports,t),t.exports},yu=e=>{let t={};for(var n in e)pu(t,n,{get:e[n],enumerable:!0});return t},bu=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=hu(t),a=0,o=i.length,s;a<o;a++)s=i[a],!_u.call(e,s)&&s!==n&&pu(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=mu(t,s))||r.enumerable});return e},xu=(e,t,n)=>(n=e==null?{}:fu(gu(e)),bu(t||!e||!e.__esModule?pu(n,`default`,{value:e,enumerable:!0}):n,e));function Su(e,t,n,r){let i=Number(e[t].meta.id+1).toString(),a=``;return typeof r.docId==`string`&&(a=`-${r.docId}-`),a+i}function Cu(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function wu(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i),o=i.rules.footnote_caption(e,t,n,r,i),s=a;return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${a}" id="fnref${s}">${o}</a></sup>`}function Tu(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
10
+ `:`<hr class="footnotes-sep">
11
+ `)+`<section class="footnotes">
12
+ <ol class="footnotes-list">
13
+ `}function Eu(){return`</ol>
14
+ </section>
15
+ `}function Du(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),`<li id="fn${a}" class="footnote-item">`}function Ou(){return`</li>
16
+ `}function ku(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),` <a href="#fnref${a}" class="footnote-backref">\u21a9\uFE0E</a>`}function Au(e){let t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=wu,e.renderer.rules.footnote_block_open=Tu,e.renderer.rules.footnote_block_close=Eu,e.renderer.rules.footnote_open=Du,e.renderer.rules.footnote_close=Ou,e.renderer.rules.footnote_anchor=ku,e.renderer.rules.footnote_caption=Cu,e.renderer.rules.footnote_anchor_name=Su;function r(e,t,r,i){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(a+4>o||e.src.charCodeAt(a)!==91||e.src.charCodeAt(a+1)!==94)return!1;let s;for(s=a+2;s<o;s++){if(e.src.charCodeAt(s)===32)return!1;if(e.src.charCodeAt(s)===93)break}if(s===a+2||s+1>=o||e.src.charCodeAt(++s)!==58)return!1;if(i)return!0;s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={});let c=e.src.slice(a+2,s-2);e.env.footnotes.refs[`:${c}`]=-1;let l=new e.Token(`footnote_reference_open`,``,1);l.meta={label:c},l.level=e.level++,e.tokens.push(l);let u=e.bMarks[t],d=e.tShift[t],f=e.sCount[t],p=e.parentType,m=s,h=e.sCount[t]+s-(e.bMarks[t]+e.tShift[t]),g=h;for(;s<o;){let t=e.src.charCodeAt(s);if(n(t))t===9?g+=4-g%4:g++;else break;s++}e.tShift[t]=s-m,e.sCount[t]=g-h,e.bMarks[t]=m,e.blkIndent+=4,e.parentType=`footnote`,e.sCount[t]<e.blkIndent&&(e.sCount[t]+=e.blkIndent),e.md.block.tokenize(e,t,r,!0),e.parentType=p,e.blkIndent-=4,e.tShift[t]=d,e.sCount[t]=f,e.bMarks[t]=u;let _=new e.Token(`footnote_reference_close`,``,-1);return _.level=--e.level,e.tokens.push(_),!0}function i(e,n){let r=e.posMax,i=e.pos;if(i+2>=r||e.src.charCodeAt(i)!==94||e.src.charCodeAt(i+1)!==91)return!1;let a=i+2,o=t(e,i+1);if(o<0)return!1;if(!n){e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]);let t=e.env.footnotes.list.length,n=[];e.md.inline.parse(e.src.slice(a,o),e.md,e.env,n);let r=e.push(`footnote_ref`,``,0);r.meta={id:t},e.env.footnotes.list[t]={content:e.src.slice(a,o),tokens:n}}return e.pos=o+1,e.posMax=r,!0}function a(e,t){let n=e.posMax,r=e.pos;if(r+3>n||!e.env.footnotes||!e.env.footnotes.refs||e.src.charCodeAt(r)!==91||e.src.charCodeAt(r+1)!==94)return!1;let i;for(i=r+2;i<n;i++){if(e.src.charCodeAt(i)===32||e.src.charCodeAt(i)===10)return!1;if(e.src.charCodeAt(i)===93)break}if(i===r+2||i>=n)return!1;i++;let a=e.src.slice(r+2,i-1);if(e.env.footnotes.refs[`:${a}`]===void 0)return!1;if(!t){e.env.footnotes.list||(e.env.footnotes.list=[]);let t;e.env.footnotes.refs[`:${a}`]<0?(t=e.env.footnotes.list.length,e.env.footnotes.list[t]={label:a,count:0},e.env.footnotes.refs[`:${a}`]=t):t=e.env.footnotes.refs[`:${a}`];let n=e.env.footnotes.list[t].count;e.env.footnotes.list[t].count++;let r=e.push(`footnote_ref`,``,0);r.meta={id:t,subId:n,label:a}}return e.pos=i,e.posMax=n,!0}function o(e){let t,n,r,i=!1,a={};if(!e.env.footnotes||(e.tokens=e.tokens.filter(function(e){return e.type===`footnote_reference_open`?(i=!0,n=[],r=e.meta.label,!1):e.type===`footnote_reference_close`?(i=!1,a[`:`+r]=n,!1):(i&&n.push(e),!i)}),!e.env.footnotes.list))return;let o=e.env.footnotes.list;e.tokens.push(new e.Token(`footnote_block_open`,``,1));for(let n=0,r=o.length;n<r;n++){let r=new e.Token(`footnote_open`,``,1);if(r.meta={id:n,label:o[n].label},e.tokens.push(r),o[n].tokens){t=[];let r=new e.Token(`paragraph_open`,`p`,1);r.block=!0,t.push(r);let i=new e.Token(`inline`,``,0);i.children=o[n].tokens,i.content=o[n].content,t.push(i);let a=new e.Token(`paragraph_close`,`p`,-1);a.block=!0,t.push(a)}else o[n].label&&(t=a[`:${o[n].label}`]);t&&(e.tokens=e.tokens.concat(t));let i;i=e.tokens[e.tokens.length-1].type===`paragraph_close`?e.tokens.pop():null;let s=o[n].count>0?o[n].count:1;for(let t=0;t<s;t++){let r=new e.Token(`footnote_anchor`,``,0);r.meta={id:n,subId:t,label:o[n].label},e.tokens.push(r)}i&&e.tokens.push(i),e.tokens.push(new e.Token(`footnote_close`,``,-1))}e.tokens.push(new e.Token(`footnote_block_close`,``,-1))}e.block.ruler.before(`reference`,`footnote_def`,r,{alt:[`paragraph`,`reference`]}),e.inline.ruler.after(`image`,`footnote_inline`,i),e.inline.ruler.after(`footnote_inline`,`footnote_ref`,a),e.core.ruler.after(`inline`,`footnote_tail`,o)}function ju(e){function t(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==43)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;if(a%2){let t=e.push(`text`,``,0);t.content=o,a--}for(let t=0;t<a;t+=2){let n=e.push(`text`,``,0);n.content=o+o,(i.can_open||i.can_close)&&e.delimiters.push({marker:r,length:0,jump:t/2,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function n(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==43||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`ins_open`,n.tag=`ins`,n.nesting=1,n.markup=`++`,n.content=``,n=e.tokens[o.token],n.type=`ins_close`,n.tag=`ins`,n.nesting=-1,n.markup=`++`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`+`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`ins_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}e.inline.ruler.before(`emphasis`,`ins`,t),e.inline.ruler2.before(`emphasis`,`ins`,function(e){let t=e.tokens_meta,r=(e.tokens_meta||[]).length;n(e,e.delimiters);for(let i=0;i<r;i++)t[i]&&t[i].delimiters&&n(e,t[i].delimiters)})}function Mu(e){function t(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==61)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;if(a%2){let t=e.push(`text`,``,0);t.content=o,a--}for(let t=0;t<a;t+=2){let n=e.push(`text`,``,0);n.content=o+o,(i.can_open||i.can_close)&&e.delimiters.push({marker:r,length:0,jump:t/2,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function n(e,t){let n=[],r=t.length;for(let i=0;i<r;i++){let r=t[i];if(r.marker!==61||r.end===-1)continue;let a=t[r.end],o=e.tokens[r.token];o.type=`mark_open`,o.tag=`mark`,o.nesting=1,o.markup=`==`,o.content=``;let s=e.tokens[a.token];s.type=`mark_close`,s.tag=`mark`,s.nesting=-1,s.markup=`==`,s.content=``,e.tokens[a.token-1].type===`text`&&e.tokens[a.token-1].content===`=`&&n.push(a.token-1)}for(;n.length;){let t=n.pop(),r=t+1;for(;r<e.tokens.length&&e.tokens[r].type===`mark_close`;)r++;if(r--,t!==r){let n=e.tokens[r];e.tokens[r]=e.tokens[t],e.tokens[t]=n}}}e.inline.ruler.before(`emphasis`,`mark`,t),e.inline.ruler2.before(`emphasis`,`mark`,function(e){let t,r=e.tokens_meta,i=(e.tokens_meta||[]).length;for(n(e,e.delimiters),t=0;t<i;t++)r[t]&&r[t].delimiters&&n(e,r[t].delimiters)})}var Nu=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Pu(e,t){let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==94||t||r+2>=n)return!1;e.pos=r+1;let i=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){i=!0;break}e.md.inline.skipToken(e)}if(!i||r+1===e.pos)return e.pos=r,!1;let a=e.src.slice(r+1,e.pos);if(a.match(/(^|[^\\])(\\\\)*\s/))return e.pos=r,!1;e.posMax=e.pos,e.pos=r+1;let o=e.push(`sup_open`,`sup`,1);o.markup=`^`;let s=e.push(`text`,``,0);s.content=a.replace(Nu,`$1`);let c=e.push(`sup_close`,`sup`,-1);return c.markup=`^`,e.pos=e.posMax+1,e.posMax=n,!0}function Fu(e){e.inline.ruler.after(`emphasis`,`sup`,Pu)}var Iu=vu({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(e,t){t=Object.assign({},{disabled:!0,divWrap:!1,divClass:`checkbox`,idPrefix:`cbx_`,ulClass:`task-list`,liClass:`task-list-item`},t),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var o=e.tokens,s=0,c=2;c<o.length;c++)i(o,c)&&(a(o[c],s,t,e.Token),s+=1,n(o[c-2],`class`,t.liClass),n(o[r(o,c-2)],`class`,t.ulClass))})};function n(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function r(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function i(e,t){return d(e[t])&&f(e[t-1])&&p(e[t-2])&&m(e[t])}function a(e,t,n,r){var i=n.idPrefix+t;e.children[0].content=e.children[0].content.slice(3),e.children.unshift(s(i,r)),e.children.push(c(r)),e.children.unshift(o(e,i,n,r)),n.divWrap&&(e.children.unshift(l(n,r)),e.children.push(u(r)))}function o(e,t,n,r){var i=new r(`checkbox_input`,`input`,0);return i.attrs=[[`type`,`checkbox`],[`id`,t]],/^\[[xX]\][ \u00A0]/.test(e.content)===!0&&i.attrs.push([`checked`,`true`]),n.disabled===!0&&i.attrs.push([`disabled`,`true`]),i}function s(e,t){var n=new t(`label_open`,`label`,1);return n.attrs=[[`for`,e]],n}function c(e){return new e(`label_close`,`label`,-1)}function l(e,t){var n=new t(`checkbox_open`,`div`,0);return n.attrs=[[`class`,e.divClass]],n}function u(e){return new e(`checkbox_close`,`div`,-1)}function d(e){return e.type===`inline`}function f(e){return e.type===`paragraph_open`}function p(e){return e.type===`list_item_open`}function m(e){return/^\[[xX \u00A0]\][ \u00A0]/.test(e.content)}})}),Lu=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Ru(e){return e>=55296&&e<=57343||e>1114111?65533:Lu.get(e)??e}function zu(e){let t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var Bu=zu(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),Vu;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Vu||={});var Hu;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Hu||={});var Uu=32;function Wu(e){return e>=Hu.ZERO&&e<=Hu.NINE}function Gu(e){return e>=Hu.UPPER_A&&e<=Hu.UPPER_F||e>=Hu.LOWER_A&&e<=Hu.LOWER_F}function Ku(e){return e>=Hu.UPPER_A&&e<=Hu.UPPER_Z||e>=Hu.LOWER_A&&e<=Hu.LOWER_Z||Wu(e)}function qu(e){return e===Hu.EQUALS||Ku(e)}var Ju;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Ju||={});var Yu;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Yu||={});var Xu=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ju.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Yu.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ju.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ju.EntityStart:return e.charCodeAt(t)===Hu.NUM?(this.state=Ju.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ju.NamedEntity,this.stateNamedEntity(e,t));case Ju.NumericStart:return this.stateNumericStart(e,t);case Ju.NumericDecimal:return this.stateNumericDecimal(e,t);case Ju.NumericHex:return this.stateNumericHex(e,t);case Ju.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Uu)===Hu.LOWER_X?(this.state=Ju.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ju.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Wu(n)||Gu(n)){let e=n<=Hu.NINE?n-Hu.ZERO:(n|Uu)-Hu.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Wu(n))this.result=this.result*10+(n-Hu.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Hu.SEMI)this.consumed+=1;else if(this.decodeMode===Yu.Strict)return 0;return this.emitCodePoint(Ru(this.result),this.consumed),this.errors&&(e!==Hu.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Vu.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&Vu.FLAG13)!==0){let a=(r&Vu.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&Vu.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&Vu.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===Hu.SEMI&&i!==0&&(r&Vu.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=Qu(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Yu.Attribute&&(i===0||qu(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Vu.VALUE_LENGTH)>>14,i!==0){if(a===Hu.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Yu.Strict&&(r&Vu.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=(t[e]&Vu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(Vu.VALUE_LENGTH|Vu.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case Ju.NamedEntity:return this.result!==0&&(this.decodeMode!==Yu.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ju.NumericDecimal:return this.emitNumericEntity(0,2);case Ju.NumericHex:return this.emitNumericEntity(0,3);case Ju.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ju.EntityStart:return 0}}};function Zu(e){let t=``,n=new Xu(e,e=>t+=String.fromCodePoint(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Qu(e,t,n,r){let i=(t&Vu.BRANCH_LENGTH)>>7,a=t&Vu.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var $u=Zu(Bu);function ed(e,t=Yu.Legacy){return $u(e,t)}var td=xu(Iu(),1),nd={};function rd(e){let t=nd[e];if(t)return t;t=nd[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function id(e,t){typeof t!=`string`&&(t=id.defaultChars);let n=rd(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}id.defaultChars=`;/?:@&=+$,#`,id.componentChars=``;var ad=id,od={};function sd(e){let t=od[e];if(t)return t;t=od[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function cd(e,t,n){typeof t!=`string`&&(n=t,t=cd.defaultChars),n===void 0&&(n=!0);let r=sd(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}cd.defaultChars=`;/?:@&=+$,-_.!~*'()#`,cd.componentChars=`-_.!~*'()`;var ld=cd;function ud(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function dd(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var fd=/^([a-z0-9.+-]+:)/i,pd=/:[0-9]*$/,md=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,hd=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
17
+ `,` `],gd=[`/`,`?`,`#`],_d=255,vd=/^[+a-z0-9A-Z_-]{0,63}$/,yd=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,bd={javascript:!0,"javascript:":!0},xd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Sd(e,t){if(e&&e instanceof dd)return e;let n=new dd;return n.parse(e,t),n}dd.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=md.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=fd.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&bd[o])&&(a=a.substr(2),this.slashes=!0)),!bd[o]&&(i||o&&!xd[o])){let e=-1;for(let t=0;t<gd.length;t++)r=a.indexOf(gd[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<hd.length;t++)r=a.indexOf(hd[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(vd)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(vd)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(yd);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>_d&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),xd[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},dd.prototype.parseHost=function(e){let t=pd.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Cd=Sd,wd=yu({decode:()=>ad,encode:()=>ld,format:()=>ud,parse:()=>Cd}),Td=Object.defineProperty,Ed=e=>{let t={};for(var n in e)Td(t,n,{get:e[n],enumerable:!0});return t},Dd=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Od=Ed({arrayReplaceAt:()=>Hd,assign:()=>Pd,countLines:()=>of,escapeHtml:()=>tf,escapeRE:()=>rf,fromCodePoint:()=>Wd,has:()=>Nd,isMdAsciiPunct:()=>Bd,isPunctChar:()=>Ld,isPunctCode:()=>zd,isSpace:()=>Fd,isString:()=>jd,isValidEntityCode:()=>Ud,isWhiteSpace:()=>Id,lib:()=>af,mdurl:()=>wd,normalizeReference:()=>Vd,ucmicro:()=>kd,unescapeAll:()=>Xd,unescapeMd:()=>Yd}),kd={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Ad(e){return Object.prototype.toString.call(e)}function jd(e){return Ad(e)===`[object String]`}var Md=Object.prototype.hasOwnProperty;function Nd(e,t){return Md.call(e,t)}function Pd(e,...t){return t.forEach(t=>{if(t){if(typeof t!=`object`)throw TypeError(`${String(t)}must be object`);Object.keys(t).forEach(n=>{e[n]=t[n]})}}),e}function Fd(e){return e===9||e===32}function Id(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ld(e){return kd.P.test(e)||kd.S.test(e)}var Rd=new Map;function zd(e){if(Bd(e))return!0;if(e>=0&&e<128)return!1;let t=Rd.get(e);if(t!==void 0)return t;let n=Ld(String.fromCharCode(e));return Rd.set(e,n),n}function Bd(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Vd(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Hd(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ud(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Wd(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Gd=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Kd=RegExp(`${Gd.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),qd=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Jd(e,t){if(t.charCodeAt(0)===35&&qd.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ud(n)?Wd(n):e}let n=ed(e);return n===e?e:n}function Yd(e){return e.includes(`\\`)?e.replace(Gd,`$1`):e}function Xd(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(Kd,(e,t,n)=>t||Jd(e,n))}var Zd=/[&<>"]/,Qd=/[&<>"]/g,$d={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function ef(e){return $d[e]}function tf(e){return Zd.test(e)?e.replace(Qd,ef):e}var nf=/[.?*+^$[\]\\(){}|-]/g;function rf(e){return e.replace(nf,`\\$&`)}var af={mdurl:wd,ucmicro:kd};function of(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
18
+ `,n+1))!==-1;)t++;return t}var sf=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,cf=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,lf=[`references`,`footnotes`,`abbreviations`,`abbr`,`abbrs`],uf=Symbol.for(`markdown-it-ts.global-state`),df=Object.prototype.hasOwnProperty;function ff(e){let t=e.length,n=0;for(;n<t;){let r=e.indexOf(`[`,n);if(r===-1)return!1;let i=0,a=r-1;for(;a>=0&&e.charCodeAt(a)!==10;){let t=e.charCodeAt(a);if(t===32||t===9){i++,a--;continue}break}if((a<0||e.charCodeAt(a)===10)&&i<=3&&e.charCodeAt(r+1)!==94){let i=r+1;if(i>=t||e.charCodeAt(i)===93){n=r+1;continue}for(;i<t;){let n=e.charCodeAt(i);if(n===93){let n=i+1;for(;n<t&&(e.charCodeAt(n)===32||e.charCodeAt(n)===9);)n++;if(n<t&&e.charCodeAt(n)===58)return!0;break}if(n===91)break;if(n===92){i+=2;continue}i++}}n=r+1}return!1}function pf(e){return e===`reference-definition`||e===`footnote-definition`||e===`abbreviation-definition`}function mf(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function hf(e){if(Array.isArray(e))return e.map(e=>hf(e));if(mf(e)){let t={};for(let n of Object.keys(e))t[n]=hf(e[n]);return t}return e}function gf(e){return Array.isArray(e)?e.map((e,t)=>String(t)):mf(e)?Object.keys(e):[]}function _f(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_f(e[n],t[n]))return!1;return!0}if(mf(e)||mf(t)){if(!mf(e)||!mf(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!df.call(t,r)||!_f(e[r],t[r]))return!1;return!0}return Object.is(e,t)}function vf(e,t){if(Array.isArray(e))return e[Number(t)];if(mf(e))return e[t]}function yf(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=hf(t[n]);return e}if(mf(e)&&mf(t)){for(let n of Object.keys(e))df.call(t,n)||delete e[n];for(let n of Object.keys(t))e[n]=hf(t[n]);return e}return hf(t)}function bf(e,t,n){let r=n.ownedKeys??[],i=e[t];if(mf(i)||Array.isArray(i)){let a=new Set(gf(n.value));for(let e of r)n.existed&&a.has(e)?i[e]=hf(vf(n.value,e)):delete i[e];!n.existed&&gf(i).length===0&&delete e[t];return}n.existed?e[t]=hf(n.value):delete e[t]}function xf(e){let t=e[uf];return pf(t)?{reason:t,snapshot:{}}:t&&typeof t==`object`&&pf(t.reason)&&t.snapshot&&typeof t.snapshot==`object`?t:null}function Sf(e,t){Object.defineProperty(e,uf,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Cf(e){return!e||!e.includes(`]:`)&&!e.includes(`*[`)?null:sf.test(e)?`footnote-definition`:cf.test(e)?`abbreviation-definition`:ff(e)?`reference-definition`:null}function wf(e){return xf(e)?.reason??null}function Tf(e,t,n){if(wf(e)&&Of(e),!t)return n();Ef(e,t);try{let t=n();return Df(e),t}catch(t){throw Of(e),t}}function Ef(e,t){try{Of(e);let n={};for(let t of lf)n[t]=df.call(e,t)?{existed:!0,value:hf(e[t])}:{existed:!1};Sf(e,{reason:t,snapshot:n})}catch{}}function Df(e){let t=xf(e);if(t)for(let n of lf){let r=t.snapshot[n];if(!r)continue;r.ownedKeys=[];let i=e[n];if(!mf(i)&&!Array.isArray(i))continue;let a=new Set(gf(r.existed?r.value:void 0));r.ownedKeys=gf(i).filter(e=>!a.has(e)||!_f(i[e],vf(r.value,e)))}}function Of(e){let t=xf(e);if(t){for(let n of lf){let r=t.snapshot[n];if(!r){delete e[n];continue}if(r.ownedKeys){bf(e,n,r);continue}r.existed?e[n]=yf(e[n],r.value):delete e[n]}delete e[uf]}}function kf(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}var Af=Symbol.for(`markdown-it-ts.diagnostics`);function jf(e,t){if(e)try{let n=e[Af];if(n&&typeof n==`object`)return n;if(!t)return;let r={};return e[Af]=r,r}catch{return}}function Mf(e){return jf(e,!1)}function Nf(e){if(e)try{let t=e[Af];t&&typeof t==`object`&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Pf(e){Nf(e)}function Ff(e,t){let n=jf(e,!0);n&&(n.stockFast=t)}function If(e,t){let n=jf(e,!0);n&&(n.strategy=t)}function Lf(e,t){let n=jf(e,!0);n&&(n.chunk=t)}function Rf(e,t){let n=jf(e,!0);n&&(n.unbounded=t)}var zf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bf=/[\0-\x1F\x7F-\x9F]/,Vf=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,Hf=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Uf=class{src_Any=zf.source;src_Cc=Bf.source;src_Z=Hf.source;src_P=Vf.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join(`|`);src_ZCc=[this.src_Z,this.src_Cc].join(`|`);cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}nestedPairRE(e,t,n=4){let r=this.escapeRE(e),i=this.escapeRE(t),a=`(?:(?!${this.src_ZCc}|${r}|${i}).)`,o=`${r}${a}{0,1000}${i}`;for(let e=2;e<=n;e++)o=`${r}(?:${a}|${o}){0,1000}${i}`;return o}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=RegExp(`(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])`)}get_ipv6_addr(){let e=`[0-9A-Fa-f]{1,4}`,t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=RegExp(`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`)}get_host_terminator(){return this.cache.src_host_terminator??=RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=RegExp(`(?:[/?#](?:${this.nestedPairRE(`[`,`]`)}|${this.nestedPairRE(`(`,`)`)}|${this.nestedPairRE(`{`,`}`)}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts[`---`]?`\\-(?!--(?:[^-]|$))(?:-{0,19})|`:`\\-{1,20}|`)+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=RegExp(`xn--[a-z0-9\\-]{1,59}`)}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join(`|`);return this.cache.tld=RegExp(`${e||`$#none#$`}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=RegExp(`(?:`+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=RegExp(`(?:`+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=RegExp(`(?:`+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=RegExp(`(?:`+(this.opts.fuzzyIP?this.get_ipv4_addr().source+`|`:``)+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=RegExp(``)}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=RegExp(`@${this.get_fuzzy_mail_host().source}`,`ig`)}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,`ig`)}get_http_validator(){return this.cache.http_validator??=RegExp(`\\/\\/`+(this.opts.urlAuth?this.get_auth().source:``)+this.get_url_host_port().source+this.get_path().source,`iy`)}get_relative_proto_validator(){return this.cache.relative_proto_validator??=RegExp((this.opts.urlAuth?this.get_auth().source:``)+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,`iy`)}get_mail_name_validator(){return this.cache.mail_name_validator??=RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,`iy`)}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join(`|`))}get_schema_search(){return this.cache.schema_search??=RegExp(`(^|(?!_)(?:[><\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`,`ig`)}get_schema_at_start(){return this.cache.schema_at_start??=RegExp(`^${this.get_schema_search().source}`,`i`)}},Wf={validate:(e,t,n)=>{let r=n.re.get_http_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)},Gf={"http:":Wf,"https:":Wf,"ftp:":Wf,"//":{validate:function(e,t,n){let r=n.re.get_relative_proto_validator();r.lastIndex=t;let i=r.exec(e);return i?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:i[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){let r=n.re.get_mailto_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)}},Kf=`a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw`,qf=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`;function Jf(){let e=qf.split(`|`);return Kf.split(`|`).forEach(t=>{let n=t.indexOf(`:`),r=t.slice(0,n);for(let i of t.slice(n+1))e.push(r+i)}),e}var Yf={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Jf(),urlAuth:!1,maxLength:1e4},Xf=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}},Zf=class{__opts__;__schemas__;re;constructor(e={}){let{rebuilder:t,...n}=e;this.__opts__={...Yf,...n},this.__schemas__={...Gf},this.re=t||new Uf,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{let n={normalize:(e,t)=>t.normalize(e),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&e.indexOf(`@`)>=0){let n=this.re.get_fuzzy_mail_host_search(),r=this.re.get_mail_name_validator();for(n.lastIndex=0;(t=n.exec(e))!==null;){let n=e.slice(Math.max(0,t.index-65),t.index);if(r.test(n))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){let t=[],n=this.re.get_schema_search(),r,i,a,o,s,c,l=!1,u=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,a=this.re.get_mail_name_validator());;){let p=Math.max(f-1,0);if(i&&a&&!d&&(!s||s.index<f))for(i.lastIndex<p&&(i.lastIndex=p);;){let t=i.exec(e);if(!t){d=!0,s=void 0;break}let n=a.exec(e.slice(Math.max(0,t.index-65),t.index));if(n){if(s={schema:`mailto:`,index:t.index-n[1].length,lastIndex:t.index+t[0].length},s.index>=f)break;i.lastIndex<p&&(i.lastIndex=p)}}if(r&&!u&&(!o||o.index<f))for(r.lastIndex<p&&(r.lastIndex=p);;){let t=r.exec(e);if(!t){u=!0,o=void 0;break}if(o={schema:``,index:t.index+t[1].length,lastIndex:t.index+t[0].length},o.index>=f)break;r.lastIndex<p&&(r.lastIndex=p)}let m=s;(!m||o&&(o.index<m.index||o.index===m.index&&o.lastIndex>m.lastIndex))&&(m=o);let h;if(!l)for(;;){if(!c){n.lastIndex<p&&(n.lastIndex=p);let t=n.exec(e);if(!t){l=!0;break}c={schema:t[2],index:t.index+t[1].length,lastIndex:t.index+t[0].length}}if(c.index<f){c=void 0;continue}if(m&&c.index>m.index)break;let t=c;c=void 0;let r=this.testSchemaAt(e,t.schema,t.lastIndex);if(r){h={schema:t.schema,index:t.index,lastIndex:t.lastIndex+r};break}}let g=h;if((!g||s&&(s.index<g.index||s.index===g.index&&s.lastIndex>g.lastIndex))&&(g=s),(!g||o&&(o.index<g.index||o.index===g.index&&o.lastIndex>g.lastIndex))&&(g=o),!g)break;g===s?s=void 0:g===o&&(o=void 0);let _=new Xf(e,g.schema,g.index,g.lastIndex);_.schema?this.__schemas__[_.schema].normalize(_,this):this.normalize(_),t.push(_),f=g.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;let t=this.re.get_schema_at_start().exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Xf(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Qf=xu(vu({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{let n=2147483647,r=/^xn--/,i=/[^\0-\x7F]/,a=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},s=Math.floor,c=String.fromCharCode;function l(e){throw RangeError(o[e])}function u(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function d(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(a,`.`);let i=u(e.split(`.`),t).join(`.`);return r+i}function f(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}let p=e=>String.fromCodePoint(...e),m=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},h=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},g=function(e,t,n){let r=0;for(e=n?s(e/700):e>>1,e+=s(e/t);e>455;r+=36)e=s(e/35);return s(r+36*e/(e+38))},_=function(e){let t=[],r=e.length,i=0,a=128,o=72,c=e.lastIndexOf(`-`);c<0&&(c=0);for(let n=0;n<c;++n)e.charCodeAt(n)>=128&&l(`not-basic`),t.push(e.charCodeAt(n));for(let u=c>0?c+1:0;u<r;){let c=i;for(let t=1,a=36;;a+=36){u>=r&&l(`invalid-input`);let c=m(e.charCodeAt(u++));c>=36&&l(`invalid-input`),c>s((n-i)/t)&&l(`overflow`),i+=c*t;let d=a<=o?1:a>=o+26?26:a-o;if(c<d)break;let f=36-d;t>s(n/f)&&l(`overflow`),t*=f}let d=t.length+1;o=g(i-c,d,c==0),s(i/d)>n-a&&l(`overflow`),a+=s(i/d),i%=d,t.splice(i++,0,a)}return String.fromCodePoint(...t)},v=function(e){let t=[];e=f(e);let r=e.length,i=128,a=0,o=72;for(let n of e)n<128&&t.push(c(n));let u=t.length,d=u;for(u&&t.push(`-`);d<r;){let r=n;for(let t of e)t>=i&&t<r&&(r=t);let f=d+1;r-i>s((n-a)/f)&&l(`overflow`),a+=(r-i)*f,i=r;for(let r of e)if(r<i&&++a>n&&l(`overflow`),r===i){let e=a;for(let n=36;;n+=36){let r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;let i=e-r,a=36-r;t.push(c(h(r+i%a,0))),e=s(i/a)}t.push(c(h(e,0))),o=g(a,f,d===u),a=0,++d}++a,++i}return t.join(``)};t.exports={version:`2.3.1`,ucs2:{decode:f,encode:p},decode:_,encode:v,toASCII:function(e){return d(e,function(e){return i.test(e)?`xn--`+v(e):e})},toUnicode:function(e){return d(e,function(e){return r.test(e)?_(e.slice(4).toLowerCase()):e})}}})})(),1);function $f(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=Xd(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=Xd(e.slice(t,i)),a.pos=i,a.ok=!0,a)}var ep=$f,tp=-2;function np(e,t,n,r){let i=1,a=t+1;for(;a<n;){let t=e.charCodeAt(a);if(t===93){if(i--,i===0)return a;if(r){let t=a+1<n?e.charCodeAt(a+1):0;if(t===40||t===91)return tp}a++;continue}if(t===92){a+=2;continue}if(t===96||t===60||t===33&&a+1<n&&e.charCodeAt(a+1)===91)return tp;if(t===91){i++,a++;continue}a++}return-1}function rp(e,t,n){let r=1,i=!1,a,o,s=e.src,c=e.posMax,l=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;let d=s.indexOf(`]`,t+1);if(d<0||d>=c)return e.linkLabelNoCloseFrom=t+1,-1;let f=np(s,t,c,n);if(f!==tp)return f;for(e.pos=t+1;e.pos<c;){if(a=s.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=l,-1}}let p=-1;return i&&(p=e.pos),e.pos=l,p}var ip=rp;function ap(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=Xd(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Xd(e.slice(t,a)),o}var op=ap;function sp(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function cp(e,t){e.attrs||=[],e.attrs.push(t)}function lp(e,t,n){let r=sp(e,t),i=[t,n];r<0?cp(e,i):e.attrs[r]=i}function up(e,t){let n=sp(e,t);return n>=0?e.attrs[n][1]:null}function dp(e,t,n){let r=sp(e,t);r<0?cp(e,[t,n]):e.attrs[r][1]=`${e.attrs[r][1]} ${n}`}var fp=Ed({attrGet:()=>up,attrIndex:()=>sp,attrJoin:()=>dp,attrPush:()=>cp,attrSet:()=>lp,parseLinkDestination:()=>$f,parseLinkLabel:()=>rp,parseLinkTitle:()=>ap});function pp(e){return e.includes(`\r`)||e.includes(`\0`)}function mp(e){return typeof e==`string`?e:e.toString()}function hp(e){if(e.inlineMode){let t=new Dd(`inline`,``,0);t.content=mp(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}var gp=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,_p=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function vp(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==60)return!1;let i=n,a=e.posMax;for(;;){if(++n>=a)return!1;let e=r.charCodeAt(n);if(e===60)return!1;if(e===62)break}let o=r.slice(i+1,n);if(_p.test(o)){let n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(o);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=o.length+2,!0}if(gp.test(o)){let n=e.md.normalizeLink(`mailto:${o}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(o);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=o.length+2,!0}return!1}var yp=vp;function bp(e,t){let n=e.src,r=e.pos;if(n.charCodeAt(r)!==96)return!1;let i=r;r++;let a=e.posMax;for(;r<a&&n.charCodeAt(r)===96;)r++;let o=n.slice(i,r),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=r,l;for(;(l=n.indexOf("`",c))!==-1;){for(c=l+1;c<a&&n.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o;let i=n.slice(r,l);i.includes(`
19
+ `)&&(i=i.replace(/\n/g,` `)),i.length>2&&i.charCodeAt(0)===32&&i.charCodeAt(i.length-1)===32&&(i=i.slice(1,-1)),t.content=i}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}var xp=bp;function Sp(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;Object.prototype.hasOwnProperty.call(t,n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function Cp(e){let t=e.tokens_meta,n=e.tokens_meta.length;Sp(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Sp(t[e].delimiters)}var wp=Cp,Tp=`*`,Ep=`_`;function Dp(e,t){if(t)return!1;let n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;let r=e.scanDelims(e.pos,n===42);if(!r||r.length===0)return!1;let i=n===42?Tp:Ep,a=r.length,o=r.can_open,s=r.can_close,c=e.tokens,l=e.delimiters;for(let t=0;t<a;t++){let t=e.push(`text`,``,0);t.content=i,l.push({marker:n,length:a,token:c.length-1,end:-1,open:o,close:s})}return e.pos+=a,!0}function Op(e,t){let n=t.length,r=e.tokens;for(let e=n-1;e>=0;e--){let n=t[e],i=n.marker;if(i!==95&&i!==42||n.end===-1)continue;let a=t[n.end],o=n.token,s=a.token,c=e>0&&t[e-1].end===n.end+1&&t[e-1].marker===i&&t[e-1].token===o-1&&t[n.end+1].token===s+1,l=i===42?Tp:Ep,u=r[o];c?(u.type=`strong_open`,u.tag=`strong`,u.nesting=1,u.markup=l+l,u.content=``):(u.type=`em_open`,u.tag=`em`,u.nesting=1,u.markup=l,u.content=``);let d=r[s];c?(d.type=`strong_close`,d.tag=`strong`,d.nesting=-1,d.markup=l+l,d.content=``):(d.type=`em_close`,d.tag=`em`,d.nesting=-1,d.markup=l,d.content=``),c&&(r[t[e-1].token].content=``,r[t[n.end+1].token].content=``,e--)}}function kp(e){let t=e.tokens_meta,n=e.tokens_meta.length;Op(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Op(e,t[r].delimiters)}var Ap={tokenize:Dp,postProcess:kp};function jp(e){return ed(e)}function Mp(e){return e>=48&&e<=57}function Np(e){let t=e|32;return Mp(e)||t>=97&&t<=102}function Pp(e){let t=e|32;return t>=97&&t<=122}function Fp(e){return Pp(e)||Mp(e)}function Ip(e,t,n){let r=t+2;if(r>=n)return null;let i=!1,a=7,o=r;for((e.charCodeAt(r)|32)==120&&(i=!0,a=6,r++,o=r);r<n&&r-o<a;){let t=e.charCodeAt(r);if(!(i?Np(t):Mp(t)))break;r++}return r===o||r>=n||e.charCodeAt(r)!==59?null:e.slice(t,r+1)}function Lp(e,t,n){let r=t+1;if(r>=n||!Pp(e.charCodeAt(r)))return null;for(r++;r<n&&r-t-1<32&&Fp(e.charCodeAt(r));)r++;if(r-t-1<2||r>=n||e.charCodeAt(r)!==59)return null;let i=e.slice(t,r+1);return jp(i)===i?null:i}function Rp(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let i=Ip(e.src,n,r);if(i){if(!t){let t=(i.charCodeAt(2)|32)==120?Number.parseInt(i.slice(3,-1),16):Number.parseInt(i.slice(2,-1),10),n=e.push(`text_special`,``,0);n.content=Ud(t)?Wd(t):Wd(65533),n.markup=i,n.info=`entity`}return e.pos+=i.length,!0}}else{let i=Lp(e.src,n,r);if(i){let n=jp(i);if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=i,t.info=`entity`}return e.pos+=i.length,!0}}return!1}var zp=Rp,Bp=(()=>{let e=Array(256).fill(0);for(let t=0;t<32;t++)e[`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.charCodeAt(t)]=1;return e})(),Vp=Array(128),Hp=Array(128);for(let e=0;e<128;e++){let t=String.fromCharCode(e);Vp[e]=`\\${t}`,Hp[e]=Bp[e]?t:Vp[e]}function Up(e,t,n){e.pending&&e.pushPending();let r=new Dd(`text_special`,``,0);r.level=e.level,r.content=t,r.markup=n,r.info=`escape`,e.pendingLevel=e.level,e.tokens.push(r),e.tokens_meta.push(null)}function Wp(e,t){let n=e.pos,r=e.posMax,i=e.src;if(i.charCodeAt(n)!==92||(n++,n>=r))return!1;let a=i.charCodeAt(n);if(a===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(a=i.charCodeAt(n),a===9||a===32);)n++;return e.pos=n,!0}if(a<128)return t?(e.pos=n+1,!0):(Up(e,Hp[a],Vp[a]),e.pos=n+1,!0);if(t){if(a>=55296&&a<=56319&&n+1<r){let e=i.charCodeAt(n+1);e>=56320&&e<=57343&&n++}return e.pos=n+1,!0}let o=i.charAt(n);if(a>=55296&&a<=56319&&n+1<r){let e=i.charCodeAt(n+1);e>=56320&&e<=57343&&(o+=i.charAt(n+1),n++)}let s=`\\${o}`;return Up(e,a<256&&Bp[a]?o:s,s),e.pos=n+1,!0}var Gp=Wp;function Kp(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++){let e=i[t];e&&(e.nesting&&e.nesting<0&&r--,e.level=r,e.nesting&&e.nesting>0&&r++,e.type===`text`&&t+1<a&&i[t+1]?.type===`text`?i[t+1].content=e.content+i[t+1].content:(t!==n&&(i[n]=e),n++))}t!==n&&(i.length=n)}var qp=Kp,Jp=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Yp=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,Xp=RegExp(`^(?:${Jp}|${Yp}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Zp=RegExp(`^(?:${Jp}|${Yp})`);function Qp(e){return e===32||e===9||e===10||e===12||e===13}function $p(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!=97)return!1;let t=e.charCodeAt(2);return t===62||Qp(t)}function em(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!=97)return!1;for(let t=3;t<e.length;t++){let n=e.charCodeAt(t);if(n===62)return!0;if(!Qp(n))return!1}return!1}function tm(e){let t=e|32;return t>=97&&t<=122}function nm(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos,i=e.src;if(i.charCodeAt(r)!==60||r+2>=n)return!1;let a=i.charCodeAt(r+1);if(a!==33&&a!==63&&a!==47&&!tm(a))return!1;let o=i.slice(r).match(Xp);if(!o)return!1;let s=o[0];if(!t){let t=e.pushSimple(`html_inline`,``);t.content=s,$p(s)&&e.linkLevel++,em(s)&&e.linkLevel--}return e.pos+=s.length,!0}var rm=nm;function im(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=ip(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);if(a>=f)return!1;if(s=ep(e.src,a,e.posMax),s.ok){for(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``,l=a;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);if(s=op(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);else c=``}if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=ip(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Vd(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0);n.attrs=[[`src`,u],[`alt`,``]],n.children=t,n.content=r,c&&n.attrs.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var am=im;function om(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==32&&n!==10)break;t++}return t}function sm(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;let n=e.src,r=e.pos,i=e.posMax,a=e.pos+1,o=ip(e,e.pos,!0);if(o<0)return!1;let s=o+1,c=``,l=``,u=!0;if(s<i&&n.charCodeAt(s)===40){s=om(n,s+1,i);let t=ep(n,s,i);if(t.ok){let n=e.md.normalizeLink(t.str);e.md.validateLink(n)&&(c=n,s=t.pos,u=!1)}else s<i&&n.charCodeAt(s)===41&&(c=``,u=!1);if(!u){if(s=om(n,s,i),s<i&&n.charCodeAt(s)!==41){let e=op(n,s,i);e.ok&&(l=e.str,s=om(n,e.pos,i))}s<i&&n.charCodeAt(s)===41?s++:u=!0}}if(u){if(e.env.references===void 0)return!1;let t;if(s=o+1,s<i&&n.charCodeAt(s)===91){let r=s+1,i=ip(e,s);i>=0?(t=n.slice(r,i),t||=n.slice(a,o),s=i+1):t=n.slice(a,o)}else t=n.slice(a,o);let u=e.env.references[Vd(t)];if(!u)return e.pos=r,!1;c=u.href,l=u.title}if(!t){e.pos=a,e.posMax=o;let t=e.push(`link_open`,`a`,1);t.attrs=l?[[`href`,c],[`title`,l]]:[[`href`,c]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=s,e.posMax=i,!0}var cm=sm;function lm(e){let t=e|32;return t>=97&&t<=122}function um(e){return e>=48&&e<=57}function dm(e){return lm(e)||um(e)||e===43||e===45||e===46}function fm(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&dm(e.charCodeAt(t));)t--;return t++,t>=e.length||!lm(e.charCodeAt(t))?null:e.slice(t)}function pm(e,t,n){let r=t;for(;r<n;){let t=e.charCodeAt(r);if(t<=32||t===127||t===60)break;r++}return e.slice(t,r)}function mm(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=fm(e.pending);if(!i)return!1;let a=pm(e.src,n-i.length,r),o=e.md.linkify.matchAtStart(a);if(!o)return!1;let s=o.url;if(s.length<=i.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-i.length,!0}function hm(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.pushSimple(`hardbreak`,`br`)}else e.pending=e.pending.slice(0,-1),e.pushSimple(`softbreak`,`br`)}else e.pushSimple(`softbreak`,`br`)}for(n++;n<i;){let t=e.src.charCodeAt(n);if(t!==9&&t!==32)break;n++}return e.pos=n,!0}var gm=hm;function _m(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0);if(!i)return!1;let a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function vm(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function ym(e){let t=e.delimiters;vm(e,t);let n=e.tokens_meta;if(n)for(let t=0;t<n.length;t++)n[t]&&n[t].delimiters&&vm(e,n[t].delimiters)}var bm={tokenize:_m,postProcess:ym},xm=new Uint8Array(256);for(let e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])xm[e]=1;function Sm(e){return e<256&&xm[e]===1}function Cm(e,t){let n=e.src,r=e.pos,i=e.posMax;if(r>=i||Sm(n.charCodeAt(r)))return!1;let a=r+1;for(;a<i&&!Sm(n.charCodeAt(a));)a++;return t||(e.pending+=a===r+1?n.charAt(r):n.slice(r,a)),e.pos=a,!0}var wm=Cm;function Tm(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Em(e){if(e.length===0)return 0;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function Dm(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function Om(e){let t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;let n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,r={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Tm(),records:Object.create(null)};return t.__mdtsRuleProfile=r,r}function km(e,t,n,r,i,a){let o=Om(e);if(!o)return;let s=`${t}:${n}`,c=o.records[s]??(o.records[s]=Dm(t,n));c.calls++,c.inclusiveMs+=r,r>c.maxMs&&(c.maxMs=r),c.samples.push(r),a?(c.silentCalls++,i&&c.silentHits++):(c.normalCalls++,i&&c.normalHits++),i&&c.hits++,o.completedAt=Tm()}function Am(e){let t=Om(e);if(!t)return null;let n=Object.keys(t.records);for(let e=0;e<n.length;e++){let r=t.records[n[e]];r.medianMs=Em(r.samples)}return t.completedAt=Tm(),t}var jm=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){let r=this.rules.findIndex(t=>t.name===e);r>=0&&this.rules.splice(r,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(t===void 0){if(r<0)return;let e=this.rules[r];return Object.freeze({name:e.name,fn:e.fn,alt:e.alt?Object.freeze(e.alt.slice()):void 0,enabled:e.enabled})}if(r<0)throw Error(`Parser rule not found: ${e}`);this.rules[r].fn=t,n?.alt!==void 0&&(this.rules[r].alt=n.alt),this.invalidateCache()}before(e,t,n,r){let i=this.rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this.rules.findIndex(e=>e.name===t);a>=0&&this.rules.splice(a,1),this.rules.splice(i,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,r){let i=this.rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this.rules.findIndex(e=>e.name===t);a>=0&&this.rules.splice(a,1),this.rules.splice(i+1,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`);continue}r.push(e),this.rules[n].enabled||(this.rules[n].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`);continue}r.push(e),this.rules[n].enabled&&(this.rules[n].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this.rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}getRules(e){let t=e||``;return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){let t=e||``;return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){let e=new Set([``]);for(let t of this.rules)if(t.enabled&&t.alt)for(let n of t.alt)e.add(n);let t=new Map,n=new Map;for(let r of e){let e=[],i=[];for(let t of this.rules)t.enabled&&(r===``||t.alt?.includes(r))&&(e.push(t.fn),i.push({name:t.name,fn:t.fn}));t.set(r,e),n.set(r,i)}this.cache=t,this.namedCache=n}},Mm=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){let e=new Dd(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}pushSimple(e,t){this.pending&&this.pushPending();let n=new Dd(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);let r=new Dd(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let{src:n,posMax:r}=this,i=n.charCodeAt(e),a=e;for(;a<r&&n.charCodeAt(a)===i;)a++;let o=a-e,s=e>0?n.charCodeAt(e-1):32,c=a<r?n.charCodeAt(a):32,l=Id(s),u=Id(c),d=zd(s),f=zd(c),p=!u&&(!f||l||d),m=!l&&(!d||u||f);return{can_open:p&&(t||!m||d),can_close:m&&(t||!p||f),length:o}}};Mm.prototype.Token=Dd;var Nm=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Pm(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gm(e,t);case 33:return am(e,t);case 38:return zp(e,t);case 42:case 95:return Ap.tokenize(e,t);case 58:return e.md.options.linkify&&mm(e,t);case 60:return yp(e,t)||rm(e,t);case 91:return cm(e,t);case 92:return Gp(e,t);case 96:return xp(e,t);case 126:return bm.tokenize(e,t);default:return wm(e,t)}}function Fm(e){return!Nm.test(e)}var Im=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new jm,this.ruler2=new jm,this.ruler.push(`text`,wm),this.ruler.push(`linkify`,mm),this.ruler.push(`newline`,gm),this.ruler.push(`escape`,Gp),this.ruler.push(`backticks`,xp),this.ruler.push(`strikethrough`,bm.tokenize),this.ruler.push(`emphasis`,Ap.tokenize),this.ruler.push(`link`,cm),this.ruler.push(`image`,am),this.ruler.push(`autolink`,yp),this.ruler.push(`html_inline`,rm),this.ruler.push(`entity`,zp),this.ruler2.push(`balance_pairs`,wp),this.ruler2.push(`strikethrough`,bm.postProcess),this.ruler2.push(`emphasis`,Ap.postProcess),this.ruler2.push(`fragments_join`,qp),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){let t=e.pos,n=this.getRules(),r=n.length,i=e.cache,a=i[t],o=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`));if(a!==void 0){e.pos=a;return}let s=!1;if(e.level<e.maxNesting){if(o){let n=this.ruler.getNamedRules(``);for(let i=0;i<r;i++){e.level++;let r=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();s=n[i].fn(e,!0);let a=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(km(e.env,`inline`,n[i].name,a-r,!!s,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}}else if(this.isDefaultRuleset()){if(e.level++,s=Pm(e,!0),e.level--,s&&t>=e.pos)throw Error(`inline rule didn't increment state.pos`)}else for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,i[t]=e.pos}tokenize(e){let t=this.getRules(),n=t.length,r=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`)))){let i=this.isDefaultRuleset();for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<e.maxNesting){if(i)o=Pm(e,!1);else for(let r=0;r<n&&(o=t[r](e,!1),!o);r++);if(o&&a>=e.pos)throw Error(`inline rule didn't increment state.pos`)}if(o){if(e.pos>=r)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}let i=this.ruler.getNamedRules(``);for(;e.pos<r;){let t=e.pos,a=!1;if(e.level<e.maxNesting)for(let r=0;r<n;r++){let n=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();a=i[r].fn(e,!1);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(km(e.env,`inline`,i[r].name,o-n,!!a,!1),a){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,r){if(typeof e==`string`&&e.length>0&&this.isDefaultRuleset()&&Fm(e)){let t=new Dd(`text`,``,0);t.content=e,r.push(t);return}let i=new Mm(e,t,n,r);this.tokenize(i);let a=this.getRules2(),o=a.length;if(!(i.env&&(Object.prototype.hasOwnProperty.call(i.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(i.env,`__mdtsProfileRules`)))){for(let e=0;e<o;e++)a[e](i,!1);return}let s=this.ruler2.getNamedRules(``);for(let e=0;e<o;e++){let t=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();s[e].fn(i,!1);let n=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();km(i.env,`inline2`,s[e].name,n-t,!0,!1)}}parse(e,t,n,r){this.parseSource(e,t,n,r)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(``),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(``),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function Lm(e){let t=e.tokens,n=!!(e.md?.inline)?.isDefaultRuleset?.();for(let r=0,i=t.length;r<i;r++){let i=t[r];if(i.type===`inline`&&e.md){if(i.children||=[],n&&i.content.length>0&&Fm(i.content)){let e=new Dd(`text`,``,0);e.content=i.content,i.children.push(e);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}var Rm=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,zm=/[0-9a-z]/i;function Bm(e){return e.includes(`.`)||e.includes(`@`)||e.includes(`:`)}var Vm=new WeakMap;function Hm(e){let t=e.re?.get_schema_search?.();if(!t)return!1;let n=Vm.get(e);if(n&&n.schemaSearch===t)return n.safe;let r=e.__schemas__,i=!0;if(r){for(let e in r)if(e.charCodeAt(e.length-1)!==58){i=!1;break}}return Vm.set(e,{schemaSearch:t,safe:i}),i}function Um(e){return/^<a[>\s]/i.test(e)}function Wm(e){return/^<\/a\s*>/i.test(e)}function Gm(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){let r=t.raw[n-1],i=t.raw[n];if(!Rm.test(r)||!zm.test(i))continue;let a=t.raw.slice(n),o=e.match(a)?.[0];if(o&&o.index===0&&o.lastIndex===a.length)return{...o,index:t.index+n,lastIndex:t.index+n+o.lastIndex}}return t}function Km(e){let t=e.tokens;if(!e.md?.options?.linkify)return;let n=Hm(e.md.linkify),r=e=>!n||Bm(e);for(let n=0;n<t.length;n++){let i=t[n];if(i.type!==`inline`||!r(i.content))continue;let a=i.children;a||(a=[],i.children=a);let o=0;for(let t=a.length-1;t>=0;t--){let n=a[t];if(n.type===`link_close`){for(t--;t>=0&&a[t].level!==n.level&&a[t].type!==`link_open`;)t--;continue}if(n.type===`html_inline`&&(Um(n.content)&&o>0&&o--,Wm(n.content)&&o++),o>0||n.type!==`text`||!r(n.content))continue;let i=n.content,s=(e.md.linkify.match(i)||[]).map(t=>Gm(e.md.linkify,t));if(s.length===0)continue;let c=[],l=n.level,u=0;s.length>0&&s[0].index===0&&t>0&&a[t-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let a=n.text;a=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:${a}`).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://${a}`).replace(/^http:\/\//,``);let o=n.index;if(o>u){let e=new Dd(`text`,``,0);e.content=i.slice(u,o),e.level=l,c.push(e)}let d=new Dd(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new Dd(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new Dd(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=n.lastIndex}if(u!==0){if(u<i.length){let e=new Dd(`text`,``,0);e.content=i.slice(u),e.level=l,c.push(e)}a.splice(t,1,...c)}}}}var qm=/\r\n?|\n/g,Jm=/\0/g;function Ym(e){if(!e||typeof e.src!=`string`)return;let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);if(!n&&!r)return;let i=t;n&&(i=i.replace(qm,`
20
+ `)),r&&(i=i.replace(Jm,`�`)),e.src=i}var Xm=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Zm=/\((?:c|tm|r)\)/i,Qm=/\((c|tm|r)\)/gi,$m={c:`©`,r:`®`,tm:`™`};function eh(e,t){return $m[t.toLowerCase()]}function th(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(Qm,eh)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function nh(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Xm.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function rh(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];if(n.type!==`inline`)continue;let r=n.content||(Array.isArray(n.children)?n.children.map(e=>e.type===`text`?e.content:``).join(``):``);Zm.test(r)&&th(n.children||[]),Xm.test(r)&&nh(n.children||[])}}var ih=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){let n=this.rules.findIndex(t=>t.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){let n=this.rules.findIndex(t=>t.name===e);if(n<0)throw Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(r<0)throw Error(`Parser rule not found: ${e}`);let i=this.rules.findIndex(e=>e.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(r<0)throw Error(`Parser rule not found: ${e}`);let i=this.rules.findIndex(e=>e.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`);continue}r.push(e),this.rules[n].enabled||(this.rules[n].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`);continue}r.push(e),this.rules[n].enabled&&(this.rules[n].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this.rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=``){return this.cache||this.compileCache(),this.cache}getNamedRules(e=``){return this.namedCache||this.compileCache(),this.namedCache}},ah=/['"]/,oh=/['"]/g,sh=`’`;function ch(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function lh(e,t){let n,r=[],i=t.md&&t.md.options&&t.md.options.quotes||`“”‘’`;for(let t=0;t<e.length;t++){let a=e[t],o=e[t].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){oh.lastIndex=c;let u=oh.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=t-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=t+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=zd(m),_=zd(h),v=Id(m),y=Id(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=ch(a.content,u.index,sh));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=i[2]||`‘`,f=i[3]||`’`):(o=i[0]||`“`,f=i[1]||`”`),a.content=ch(a.content,u.index,f),e[d.token].content=ch(e[d.token].content,d.pos,o),c+=f.length-1,d.token===t&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:t,pos:u.index,single:p,level:o}):f&&p&&(a.content=ch(a.content,u.index,sh))}}}function uh(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];if(n.type!==`inline`)continue;let r=typeof n.content==`string`?n.content:(n.children||[]).map(e=>e.content||``).join(``);ah.test(r)&&n.children&&lh(n.children,e)}}function dh(e){let t=e.tokens||[],n=t.length;for(let e=0;e<n;e++){let n=t[e];if(n.type!==`inline`||!Array.isArray(n.children))continue;let r=n.children,i=r.length;for(let e=0;e<i;e++)r[e].type===`text_special`&&(r[e].type=`text`);let a=0,o=0;for(;o<i;o++)r[o].type===`text`&&o+1<i&&r[o+1].type===`text`?r[o+1].content=r[o].content+r[o+1].content:(o!==a&&(r[a]=r[o]),a++);o!==a&&(r.length=a)}}var fh=/^(?:vbscript|javascript|file|data):/,ph=/^data:image\/(?:gif|png|jpeg|webp);/,mh=[`http:`,`https:`,`mailto:`],hh=/[^\0-\x7F]/,gh=/xn--/,_h=/%(?![0-9a-f]{2})|[^\w;/?:@&=+$,\-.!~*'()#%]/i,vh=/%[0-9a-f]{2}/i;function yh(e){let t=e.trim().toLowerCase();return!fh.test(t)||ph.test(t)}function bh(e){let t=Cd(e,!0);if(t.hostname&&(!t.protocol||mh.includes(t.protocol))&&hh.test(t.hostname))try{t.hostname=Qf.default.toASCII(t.hostname)}catch{}let n=ud(t);return _h.test(n)?ld(n):n}function xh(e){let t=Cd(e,!0);if(t.hostname&&(!t.protocol||mh.includes(t.protocol))&&(hh.test(t.hostname)||gh.test(t.hostname)))try{t.hostname=Qf.default.toUnicode(t.hostname)}catch{}let n=ud(t);return vh.test(n)?ad(n,`${ad.defaultChars}%`):n}function Sh(e){switch(e){case 9:case 32:return!0}return!1}function Ch(e,t,n,r){let i=e.src,a=e.bMarks,o=e.eMarks,s=e.tShift,c=e.sCount,l=e.bsCount,u=a[t]+s[t],d=o[t],f=e.lineMax;if(c[t]-e.blkIndent>=4||i.charCodeAt(u)!==62)return!1;if(r)return!0;let p=[],m=[],h=[],g=[],_=e.md.block.ruler.getRulesForState(e,`blockquote`),v=e.parentType;e.parentType=`blockquote`;let y=!1,b;for(b=t;b<n;b++){let t=c[b]<e.blkIndent;if(u=a[b]+s[b],d=o[b],u>=d)break;if(i.charCodeAt(u++)===62&&!t){let e=c[b]+1,t,n;i.charCodeAt(u)===32?(u++,e++,n=!1,t=!0):i.charCodeAt(u)===9?(t=!0,(l[b]+e)%4==3?(u++,e++,n=!1):n=!0):t=!1;let r=e;for(p.push(a[b]),a[b]=u;u<d;){let e=i.charCodeAt(u);if(Sh(e))e===9?r+=4-(r+l[b]+ +!!n)%4:r++;else break;u++}y=u>=d,m.push(l[b]),l[b]=c[b]+1+ +!!t,h.push(c[b]),c[b]=r-e,g.push(s[b]),s[b]=u-a[b];continue}if(y)break;let r=!1;for(let t=0,i=_.length;t<i;t++)if(_[t](e,b,n,!0)){r=!0;break}if(r){e.lineMax=b,e.blkIndent!==0&&(p.push(a[b]),m.push(l[b]),g.push(s[b]),h.push(c[b]),c[b]-=e.blkIndent);break}p.push(a[b]),m.push(l[b]),g.push(s[b]),h.push(c[b]),c[b]=-1}let x=e.blkIndent;e.blkIndent=0;let S=e.push(`blockquote_open`,`blockquote`,1);S.markup=`>`;let C=[t,0];S.map=C,e.md.block.tokenize(e,t,b);let w=e.push(`blockquote_close`,`blockquote`,-1);w.markup=`>`,e.lineMax=f,e.parentType=v,C[1]=e.line;for(let e=0;e<g.length;e++)a[e+t]=p[e],s[e+t]=g[e],c[e+t]=h[e],l[e+t]=m[e];return e.blkIndent=x,!0}function wh(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function Th(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}var Eh=[``,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Dh=[``,`#`,`##`,`###`,`####`,`#####`,`######`];function Oh(e){switch(e){case 9:case 32:return!0}return!1}function kh(e,t,n,r){let i=e.src,a=e.bMarks,o=e.tShift,s=e.eMarks,c=a[t]+o[t],l=s[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=i.charCodeAt(c);if(u!==35||c>=l)return!1;let d=1;for(u=i.charCodeAt(++c);u===35&&c<l&&d<=6;)d++,u=i.charCodeAt(++c);if(d>6||c<l&&!Oh(u))return!1;if(r)return!0;l=e.skipSpacesBack(l,c);let f=e.skipCharsBack(l,35,c);f>c&&Oh(i.charCodeAt(f-1))&&(l=f),e.line=t+1;let p=e.push(`heading_open`,Eh[d],1);p.markup=Dh[d],p.map=[t,e.line];let m=e.push(`inline`,``,0);m.content=i.slice(c,l).trim(),m.map=[t,e.line],m.children=[];let h=e.push(`heading_close`,Eh[d],-1);return h.markup=Dh[d],!0}function Ah(e){switch(e){case 9:case 32:return!0}return!1}function jh(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!Ah(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var Mh=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${Zp.source}\\s*$`),/^$/,!1]];function Nh(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Mh.length&&!Mh[s][0].test(o);s++);if(s===Mh.length)return!1;if(r)return Mh[s][2];let c=t+1;if(!Mh[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Mh[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Ph(e){switch(e){case 9:case 32:return!0}return!1}var Fh={Pipe:1,ParagraphTerminator:2},Ih=new Uint8Array(256);for(let e of[35,42,43,45,60,62,95,96,124,126,48,49,50,51,52,53,54,55,56,57])Ih[e]=1;var Lh=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length,o=this.bMarks,s=this.eMarks,c=this.tShift,l=this.sCount,u=this.bsCount,d=this.lineFlags,f=0,p=i.indexOf(`|`);for(;f<a;){let e=f;for(;e<a&&e-f<4&&i.charCodeAt(e)!==10;)e++;if(e-f===4&&e<a){let t=i.indexOf(`
21
+ `,e);e=t===-1?a:t}let t=0,n=0,r=f;for(;r<e;){let e=i.charCodeAt(r);if(e===32){t++,n++,r++;continue}if(e===9){t++,n+=4-n%4,r++;continue}break}let m=0;r<e&&(Ih[i.charCodeAt(r)]===1&&(m|=Fh.ParagraphTerminator),p<f&&(p=i.indexOf(`|`,f)),p!==-1&&p<e&&(m|=Fh.Pipe|Fh.ParagraphTerminator),p===-1&&(p=a)),o.push(f),s.push(e),c.push(t),l.push(n),u.push(0),d.push(m),f=e+1}o.push(a),s.push(a),c.push(0),l.push(0),u.push(0),d.push(0),this.lineMax=o.length-1}push(e,t,n){if(n===0){let n=new Dd(e,t,0);return n.block=!0,n.level=this.level,this.tokens.push(n),n}let r=new Dd(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){let t=this.bMarks,n=this.tShift,r=this.eMarks;for(let i=this.lineMax;e<i&&!(t[e]+n[e]<r[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n;e++){let n=t.charCodeAt(e);if(n!==9&&n!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;){let t=n.charCodeAt(--e);if(t!==9&&t!==32)return e+1}return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;if(e+1===t){let t=e,i=this.bMarks[t],a=i,o=r?this.eMarks[t]+1:this.eMarks[t],s=0,c=this.src,l=this.bsCount,u=this.tShift;for(;a<o&&s<n;){let e=c.charCodeAt(a);if(e===9||e===32)e===9?s+=4-(s+l[t])%4:s++;else if(a-i<u[t])s++;else break;a++}return s>n?` `.repeat(s-n)+c.slice(a,o):c.slice(a,o)}let i=Array(t-e),a=this.src,o=this.bMarks,s=this.eMarks,c=this.bsCount,l=this.tShift;for(let u=0,d=e;d<t;d++,u++){let e=0,f=o[d],p=f,m;for(m=d+1<t||r?s[d]+1:s[d];p<m&&e<n;){let t=a.charCodeAt(p);if(Ph(t))t===9?e+=4-(e+c[d])%4:e++;else if(p-f<l[d])e++;else break;p++}e>n?i[u]=` `.repeat(e-n)+a.slice(p,m):i[u]=a.slice(p,m)}return i.join(``)}};Lh.prototype.Token=Dd;function Rh(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===124)return!0;return!1}function zh(e){let t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function Bh(e,t,n,r,i){if(e.lineFlags&&(e.lineFlags[t]&Fh.ParagraphTerminator)===0||r>=i)return!1;let a=n.charCodeAt(r);switch(a){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return a>=48&&a<=57||Rh(n,r,i)}var Vh=[``,`h1`,`h2`];function Hh(e,t,n){let r=e.md.block.ruler.getRulesForState(e,`paragraph`),i=e.src,a=e.bMarks,o=e.tShift,s=e.eMarks,c=e.sCount,l=e.blkIndent,u=zh(e);if(c[t]-l>=4)return!1;let d=e.parentType;e.parentType=`paragraph`;let f=0,p,m=t+1;for(;m<n;m++){let t=a[m]+o[m],d=s[m];if(t>=d)break;if(c[m]-l>3)continue;if(c[m]>=l&&(p=i.charCodeAt(t),p===45||p===61)){let e=t+1,n=e;for(;e<d&&i.charCodeAt(e)===p;)e++;for(n=e;e<d;){let t=i.charCodeAt(e);if(t!==9&&t!==32)break;e++}if(e>=d){f=p===61?1:2;break}if(n-t>1)continue}if(c[m]<0||u&&!Bh(e,m,i,t,d))continue;let h=!1;for(let t=0,i=r.length;t<i;t++)if(r[t](e,m,n,!0)){h=!0;break}if(h)break}if(!f)return!1;let h;if(m===t+1){let e=a[t]+o[t],n=s[t];for(;n>e;){let e=i.charCodeAt(n-1);if(e!==9&&e!==32)break;n--}h=i.slice(e,n)}else h=e.getLines(t,m,l,!1).trim();e.line=m+1;let g=p===61?`=`:`-`,_=e.push(`heading_open`,Vh[f],1);_.markup=g,_.map=[t,e.line];let v=e.push(`inline`,``,0);v.content=h,v.map=[t,e.line-1],v.children=[];let y=e.push(`heading_close`,Vh[f],-1);return y.markup=g,e.parentType=d,!0}function Uh(e){switch(e){case 9:case 32:return!0}return!1}function Wh(e,t){let n=e.eMarks,r=e.bMarks,i=e.tShift,a=e.src,o=n[t],s=r[t]+i[t],c=a.charCodeAt(s++);return c!==42&&c!==45&&c!==43||s<o&&!Uh(a.charCodeAt(s))?-1:s}function Gh(e,t){let n=e.bMarks,r=e.tShift,i=e.eMarks,a=e.src,o=n[t]+r[t],s=i[t],c=o;if(c+1>=s)return-1;let l=a.charCodeAt(c++);if(l<48||l>57)return-1;for(;;){if(c>=s)return-1;if(l=a.charCodeAt(c++),l>=48&&l<=57){if(c-o>=10)return-1;continue}if(l===41||l===46)break;return-1}return c<s&&(l=a.charCodeAt(c),!Uh(l))?-1:c}function Kh(e,t,n){let r=e.bMarks,i=e.tShift,a=e.src,o=r[t]+i[t],s=0;for(let e=o;e<n-1;e++)s=s*10+a.charCodeAt(e)-48;return s}var qh=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`];function Jh(e,t){let n=e.level+2,r=e.tokens;for(let e=t+2,i=r.length-2;e<i;e++){let t=r[e];if(t.level===n){if(t.type===`paragraph_open`){t.hidden=!0,r[e+2].hidden=!0,e+=2;continue}if(t.nesting===1){let t=1;for(;t>0&&++e<i;)t+=r[e].nesting}}}}function Yh(e,t,n,r){let i,a,o=0,s=t,c=!0;if(e.sCount[s]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[s]-e.listIndent>=4&&e.sCount[s]<e.blkIndent)return!1;let l=!1;r&&e.parentType===`paragraph`&&e.sCount[s]>=e.blkIndent&&(l=!0);let u,d,f,p=e.src,m=e.bMarks,h=e.tShift,g=e.eMarks,_=e.sCount,v=e.bsCount,y=m[s]+h[s];if(y>=g[s])return!1;let b=p.charCodeAt(y);if(b>=48&&b<=57){if(f=Gh(e,s),f<0||(u=!0,o=y,d=Kh(e,s,f),l&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=Wh(e,s),f<0)return!1;u=!1}else return!1;if(l&&e.skipSpaces(f)>=g[s])return!1;if(r)return!0;let x=p.charCodeAt(f-1),S=String.fromCharCode(x);if(u){let t=e.push(`ordered_list_open`,`ol`,1);d!==void 0&&d!==1&&(t.attrs=[[`start`,String(d)]])}else e.push(`bullet_list_open`,`ul`,1);let C=[s,0];e.tokens[e.tokens.length-1].map=C,e.tokens[e.tokens.length-1].markup=S;let w=!1,T=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,`list`),D=e.parentType;for(e.parentType=`list`;s<n;){a=f,i=g[s];let t=_[s]+f-(m[s]+h[s]),r=t;for(;a<i;){let e=p.charCodeAt(a);if(e===9)r+=4-(r+v[s])%4;else if(e===32)r++;else break;a++}let l=a,d;d=l>=i?1:r-t,d>4&&(d=1);let y=t+d,b=e.push(`list_item_open`,`li`,1);b.markup=S;let C=[s,0];b.map=C,u&&(b.info=f-o-1==1?qh[p.charCodeAt(o)-48]:p.slice(o,f-1));let T=e.tight,D=e.tShift[s],O=e.sCount[s],k=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=y,e.tight=!0,e.tShift[s]=l-m[s],e.sCount[s]=r,l>=i&&e.isEmpty(s+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,s,n,!0),(!e.tight||w)&&(c=!1),w=e.line-s>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=k,e.tShift[s]=D,e.sCount[s]=O,e.tight=T,e.push(`list_item_close`,`li`,-1).markup=S,s=e.line,C[1]=s,s>=n||e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)break;let ee=!1;for(let t=0,r=E.length;t<r;t++)if(E[t](e,s,n,!0)){ee=!0;break}if(ee)break;if(u){if(f=Gh(e,s),f<0)break;o=m[s]+h[s]}else if(f=Wh(e,s),f<0)break;if(x!==p.charCodeAt(f-1))break}return u?e.push(`ordered_list_close`,`ol`,-1).markup=S:e.push(`bullet_list_close`,`ul`,-1).markup=S,C[1]=s,e.line=s,e.parentType=D,c&&Jh(e,T),!0}function Xh(e){return e===9||e===32}function Zh(e,t,n){let r=e.md.block.ruler.getRulesForState(e,`paragraph`),i=e.parentType,a=e.src,o=e.bMarks,s=e.tShift,c=e.eMarks,l=e.sCount,u=e.blkIndent,d=zh(e),f=t+1;for(e.parentType=`paragraph`;f<n&&!e.isEmpty(f);f++){if(l[f]-u>3||l[f]<0)continue;if(i===`list`&&l[f]>=u){let e=o[f]+s[f],t=c[f];if(e<t){let n=a.charCodeAt(e);if(n===42||n===45||n===43){if(e+1>=t||Xh(a.charCodeAt(e+1)))break}else if(n>=48&&n<=57&&e+1<t){let n=e+1;for(;;){if(n>=t){n=-1;break}let r=a.charCodeAt(n++);if(r>=48&&r<=57){if(n-e>=10){n=-1;break}continue}if((r===41||r===46)&&(n>=t||Xh(a.charCodeAt(n))))break;n=-1;break}if(n>=0)break}}}let t=o[f]+s[f],p=c[f];if(d&&!Bh(e,f,a,t,p))continue;let m=!1;for(let t=0,i=r.length;t<i;t++)if(r[t](e,f,n,!0)){m=!0;break}if(m)break}let p=e.getLines(t,f,u,!1).trim();e.line=f;let m=e.push(`paragraph_open`,`p`,1);m.map=[t,e.line];let h=e.push(`inline`,``,0);return h.content=p,h.map=[t,e.line],h.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function Qh(e){switch(e){case 9:case 32:return!0}return!1}function $h(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1,s=e.md.block.ruler.getRulesForState(e,`reference`);if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function c(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.parentType;e.parentType=`reference`;let i=!1;for(let r=0,a=s.length;r<a;r++)if(s[r](e,t,n,!0)){i=!0;break}if(e.parentType=r,i)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let l=e.src.slice(i,a+1);a=l.length;let u=-1;for(i=1;i<a;i++){let e=l.charCodeAt(i);if(e===91)return!1;if(e===93){u=i;break}if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(e===92&&(i++,i<a&&l.charCodeAt(i)===10)){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(i=u+2;i<a;i++){let e=l.charCodeAt(i);if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(!Qh(e))break}let d=e.md.helpers.parseLinkDestination(l,i,a);if(!d.ok)return!1;let f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;i=d.pos;let p=i,m=o,h=i;for(;i<a;i++){let e=l.charCodeAt(i);if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(!Qh(e))break}let g=e.md.helpers.parseLinkTitle(l,i,a);for(;g.can_continue;){let t=c(o);if(t===null)break;l+=t,i=a,a=l.length,o++,g=e.md.helpers.parseLinkTitle(l,i,a,g)}let _;for(i<a&&h!==i&&g.ok?(_=g.str,i=g.pos):(_=``,i=p,o=m);i<a&&Qh(l.charCodeAt(i));)i++;if(i<a&&l.charCodeAt(i)!==10&&_)for(_=``,i=p,o=m;i<a&&Qh(l.charCodeAt(i));)i++;if(i<a&&l.charCodeAt(i)!==10)return!1;let v=Vd(l.slice(1,u));return v?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[v]===void 0&&(e.env.references[v]={title:_,href:f}),e.line=o,!0):!1}function eg(e){switch(e){case 9:case 32:return!0}return!1}var tg=65536;function ng(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function rg(e,t){if(e.lineFlags)return(e.lineFlags[t]&Fh.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];n<r;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function ig(e){if(!e.includes(`\\`))return e.split(`|`);let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function ag(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!eg(s)||o===45&&eg(s)||!rg(e,t))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!eg(t))return!1;a++}let c=ng(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=ng(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;l=ig(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRulesForState(e,`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=ng(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=ig(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>tg))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var og=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,r){let i=this._rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this._rules.findIndex(e=>e.name===t);a>=0&&this._rules.splice(a,1),this._rules.splice(i,0,{name:t,enabled:!0,fn:n,alt:r?.alt||[]}),this.invalidateCache()}after(e,t,n,r){let i=this._rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this._rules.findIndex(e=>e.name===t);a>=0&&this._rules.splice(a,1),this._rules.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r?.alt||[]}),this.invalidateCache()}getRules(e){let t=e||``;return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){let t=e||``;return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){let n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(n,`__mdtsProfileRules`))?this.getNamedRules(t).map(({name:e,fn:t})=>(n,r,i,a)=>{let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),s=t(n,r,i,a),c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();return km(n?.env,`block`,e,c-o,s,!!a),s}):this.getRules(t)}at(e,t,n){let r=this._rules.findIndex(t=>t.name===e);if(r===-1)throw Error(`Parser rule not found: ${e}`);this._rules[r].fn=t,n?.alt&&(this._rules[r].alt=n.alt),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;return n.forEach(e=>{let n=this._rules.findIndex(t=>t.name===e);if(n===-1){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}r.push(e),this._rules[n].enabled||(this._rules[n].enabled=!0,i=!0)}),i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;return n.forEach(e=>{let n=this._rules.findIndex(t=>t.name===e);if(n===-1){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}r.push(e),this._rules[n].enabled&&(this._rules[n].enabled=!1,i=!0)}),i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this._rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}compileCache(){let e=new Set([``]);for(let t of this._rules)if(t.enabled)for(let n of t.alt)e.add(n);let t=Object.create(null),n=Object.create(null);for(let r of e){let e=[],i=[];for(let t of this._rules)t.enabled&&(r===``||t.alt.includes(r))&&(e.push(t.fn),i.push({name:t.name,fn:t.fn}));t[r]=e,n[r]=i}this.cache=t,this.namedCache=n}},sg=[[`table`,ag,[`paragraph`,`reference`]],[`code`,wh],[`fence`,Th,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Ch,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,jh,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Yh,[`paragraph`,`reference`,`blockquote`]],[`reference`,$h],[`html_block`,Nh,[`paragraph`,`reference`,`blockquote`]],[`heading`,kh,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Hh],[`paragraph`,Zh]],cg=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new og;for(let e=0;e<sg.length;e++)this.ruler.push(sg[e][0],sg[e][1],{alt:(sg[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){let r=this.getRules(),i=r.length,a=e.md.options.maxNesting,o=e.bMarks,s=e.tShift,c=e.eMarks,l=e.sCount,u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`)))){for(;u<n;){for(;u<n&&o[u]+s[u]>=c[u];)u++;if(e.line=u,u>=n||l[u]<e.blkIndent)break;if(e.level>=a){e.line=n;break}let t=e.line,f=!1;for(let a=0;a<i;a++)if(f=r[a](e,u,n,!1),f){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!f)throw Error(`none of the block rules matched`);e.tight=!d,o[e.line-1]+s[e.line-1]>=c[e.line-1]&&(d=!0),u=e.line,u<n&&o[u]+s[u]>=c[u]&&(d=!0,u++,e.line=u)}return}let f=this.ruler.getNamedRules(``);for(;u<n;){for(;u<n&&o[u]+s[u]>=c[u];)u++;if(e.line=u,u>=n||l[u]<e.blkIndent)break;if(e.level>=a){e.line=n;break}let t=e.line,r=!1;for(let a=0;a<i;a++){let i=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();r=f[a].fn(e,u,n,!1);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(km(e.env,`block`,f[a].name,o-i,r,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}}if(!r)throw Error(`none of the block rules matched`);e.tight=!d,o[e.line-1]+s[e.line-1]>=c[e.line-1]&&(d=!0),u=e.line,u<n&&o[u]+s[u]>=c[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,r){if(!e||e.length===0)return;let i=new Lh(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(``),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},lg=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e==`string`?e||``:e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};lg.prototype.Token=Dd;var ug=[[`normalize`,Ym],[`block`,hp],[`inline`,Lm],[`linkify`,Km],[`replacements`,rh],[`smartquotes`,uh],[`text_join`,dh]],dg={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},fg={parseLinkLabel:rp,parseLinkDestination:$f,parseLinkTitle:ap};function pg(){return{...dg}}function mg(){return{...fg}}var hg=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new cg,this.inline=new Im,this.ruler=new ih;for(let e=0;e<ug.length;e++){let[t,n]=ug[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:pg(),helpers:mg(),normalizeLink:bh,normalizeLinkText:xh,validateLink:yh,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||=new Zf({fuzzyLink:!0}),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new lg(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(``),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(``),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e,t){let n=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`));if(!n&&!t){let t=this.getCoreRules();for(let n=0;n<t.length;n++)t[n](e);return}let r=this.getCoreNamedRules();for(let i=0;i<r.length;i++){let a=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();r[i].fn(e);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();n&&km(e.env,`core`,r[i].name,o-a,!0,!1),t?.(r[i],e)}n&&Am(e.env)}parseSource(e,t={},n){if(typeof e!=`string`&&pp(e))return this.parse(mp(e),t,n);let r=this.createState(e,t,n);return this.process(r),this.lastState=r,r}parse(e,t={},n){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}},gg=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function _g(e){return!gg.test(e)}function vg(e,t){let n=e.indexOf(`
22
+ `,t);return n===-1?e.length:n}function yg(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9)return!1}return!0}function bg(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function xg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Sg(e){if(e.length>3)return _g(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}var Cg=[``,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],wg=[``,`#`,`##`,`###`,`####`,`#####`,`######`],Tg=0,Eg=1,Dg=2;function Og(e,t,n,r){let i=new Dd(e,t,n);return i.level=r,i.block=!0,i}function kg(e,t,n){let r=Og(`inline`,``,0,n);r.map=[t,t+1],r.content=e;let i=new Dd(`text`,``,0);return i.content=e,r.children=[i],r}function Ag(e,t,n,r,i){let a=0,o=n;for(;o<r&&t.charCodeAt(o)===35&&a<6;)o++,a++;if(a===0||o>=r||t.charCodeAt(o)!==32)return!1;let s=o+1;for(;s<r&&t.charCodeAt(s)===32;)s++;let c=r;for(;c>s&&t.charCodeAt(c-1)===32;)c--;let l=c;for(;l>s&&t.charCodeAt(l-1)===35;)l--;if(l>s&&t.charCodeAt(l-1)===32)for(c=l-1;c>s&&t.charCodeAt(c-1)===32;)c--;let u=t.slice(s,c);if(!_g(u))return!1;let d=Cg[a],f=wg[a],p=Og(`heading_open`,d,1,0);p.map=[i,i+1],p.markup=f,e.push(p),e.push(kg(u,i,1));let m=Og(`heading_close`,d,-1,0);return m.markup=f,e.push(m),!0}function jg(e,t,n){let r=Og(`paragraph_open`,`p`,1,0);r.map=[n,n+1],e.push(r),e.push(kg(t,n,1)),e.push(Og(`paragraph_close`,`p`,-1,0))}function Mg(e,t,n){let r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function Ng(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Pg(e,t){let n=Og(`bullet_list_open`,`ul`,1,0);return n.map=[t,t],n.markup=`-`,e.push(n),n}function Fg(e,t,n){let r=Og(`list_item_open`,`li`,1,1);r.map=[n,n+1],r.markup=`-`,e.push(r);let i=Og(`paragraph_open`,`p`,1,2);i.map=[n,n+1],i.hidden=!0,e.push(i),e.push(kg(t,n,3));let a=Og(`paragraph_close`,`p`,-1,2);a.hidden=!0,e.push(a);let o=Og(`list_item_close`,`li`,-1,1);return o.markup=`-`,e.push(o),r}function Ig(e){let t=Og(`bullet_list_close`,`ul`,-1,0);t.markup=`-`,e.push(t)}function Lg(e,t,n,r){if(!bg(e,t,n))return null;let i=e.slice(t+3,n);if(i.includes("`"))return null;let a=n<e.length?n+1:n,o=a,s=a,c=r+1;for(;s<e.length;){let t=vg(e,s);if(bg(e,s,t)&&yg(e,s+3,t)){let n=Og(`fence`,`code`,0,0);return n.map=[r,c+1],n.markup="```",n.info=i,n.content=e.slice(a,o),{token:n,nextPos:t<e.length?t+1:t,nextLine:c+1}}s=t<e.length?t+1:t,o=s,c++}return null}function Rg(e,t){if(e.length===0)return t&&(t.matched=!0),[];if(e.includes(`\r`)||e.includes(`\0`))return null;let n=[],r=e.length>=1e5?Tg:Dg,i=``,a=!1,o=!1,s=0,c=0;for(;s<e.length;){let l=vg(e,s);if(s===l){s=l<e.length?l+1:l,c++;continue}let u=e.charCodeAt(s);if(u===32||u===9){if(!yg(e,s,l))return null;s=l<e.length?l+1:l,c++;continue}if(u===35){if(!Ag(n,e,s,l,c))return null;t&&(t.blocks++,t.headings++);let r=l<e.length?l+1:l;s=Ng(e,r),c+=1+s-r;continue}if(u===45){if(!xg(e,s,l))return null;let r=c,i=s,a=c,o=null,u=null;for(;i<e.length;){let t=vg(e,i);if(!xg(e,i,t))break;let s=i+2,c=t===s+1?e[s]:e.slice(s,t);if(!Sg(c))return null;o===null&&(o=Pg(n,r)),u=Fg(n,c,a),i=t<e.length?t+1:t,a++}if(o===null||u===null)return null;let d=i,f=a;for(;d<e.length;){if(e.charCodeAt(d)===10){d++,f++;continue}let t=vg(e,d);if(!yg(e,d,t)){if(xg(e,d,t))return null;break}d=t<e.length?t+1:t,f++}o.map[1]=f,u.map[1]=f,Ig(n),t&&(t.blocks++,t.lists++),s=d,c=f;continue}if(u===96){let r=Lg(e,s,l,c);if(!r)return null;n.push(r.token),t&&(t.blocks++,t.fences++),s=Ng(e,r.nextPos),c=r.nextLine+s-r.nextPos;continue}let d=Mg(e,s,l),f;if(r===Dg?(t&&t.paragraphCacheBypasses++,f=_g(d)):r===Eg&&d===i?(t&&t.paragraphCacheHits++,f=a):(t&&t.paragraphCacheMisses++,f=_g(d),r===Tg?(o&&(r=d===i?Eg:Dg),i=d,a=f,o=!0):r===Eg&&(i=d,a=f)),!f)return null;let p=l<e.length?l+1:l;if(p<e.length&&e.charCodeAt(p)!==10&&!yg(e,p,vg(e,p)))return null;jg(n,d,c),t&&(t.blocks++,t.paragraphs++),s=Ng(e,p),c+=1+s-p}return t&&(t.matched=!0),n}var zg=/[&<>"]/,Bg=/[&<>"]/g,Vg=/&/g,Hg=/[<>"]/g,Ug={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function Wg(e){return Ug[e]||e}function Gg(e){if(e.length===0)return``;if(e.length<32)return zg.test(e)?e.replace(Bg,Wg):e;let t=e.includes(`&`),n=e.includes(`<`),r=e.includes(`>`),i=e.includes(`"`);return!t&&!n&&!r&&!i?e:t&&!n&&!r&&!i?e.replace(Vg,`&amp;`):t?e.replace(Bg,Wg):e.replace(Hg,Wg)}var Kg=RegExp(`\\\\([!"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_\`{|}~])|&([a-z#][a-z0-9]{1,31});`,`gi`),qg=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Jg(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(Kg,(e,t,n)=>{if(t)return t;if(qg.test(n)){let e=n[1].toLowerCase()===`x`?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Ud(e)?Wd(e):`�`}let r=ed(e);return r===e?e:r})}var Yg=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Xg=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Zg=/"/g;function Qg(e,t){let n=e.indexOf(`
23
+ `,t);return n===-1?e.length:n}function $g(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9)return!1}return!0}function e_(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function t_(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!$g(e,t,Qg(e,t))}function n_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function r_(e,t,n){let r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function i_(e){return Xg.test(e)?Yg.test(e)?null:e.replace(Zg,`&quot;`):e}function a_(e,t,n){let r=0,i=t;for(;i<n&&e.charCodeAt(i)===35&&r<6;)i++,r++;if(r===0||i>=n||e.charCodeAt(i)!==32)return null;let a=i+1;for(;a<n&&e.charCodeAt(a)===32;)a++;let o=n;for(;o>a&&e.charCodeAt(o-1)===32;)o--;let s=o;for(;s>a&&e.charCodeAt(s-1)===35;)s--;if(s>a&&e.charCodeAt(s-1)===32)for(o=s-1;o>a&&e.charCodeAt(o-1)===32;)o--;let c=i_(e.slice(a,o));return c===null?null:`<h${r}>${c}</h${r}>\n`}function o_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}var s_=new Uint8Array(256).fill(1);for(let e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])s_[e]=0;s_[34]=0;function c_(e,t){let n=e.charCodeAt(t);return n===34?`<li>&quot;</li>
24
+ `:n<256&&s_[n]===0?null:`<li>${e[t]}</li>\n`}function l_(e,t,n){let r=t+2;if(n===r+1)return c_(e,r);let i=i_(e.slice(t+2,n));return i===null?null:`<li>${i}</li>\n`}function u_(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==32&&n!==9)break;t++}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==32&&t!==9)break;n--}let r=n;for(let i=t;i<n;i++){let t=e.charCodeAt(i);if(t===96)return null;if(t===32||t===9){r=i;break}}return e.slice(t,r)}function d_(e,t,n,r,i){if(!n_(e,t,n))return null;let a=u_(e,t+3,n);if(a===null)return null;let o=n<e.length?n+1:n,s=o,c=o;for(;c<e.length;){let t=Qg(e,c);if(n_(e,c,t)&&$g(e,c+3,t)){let n=e.slice(o,s),c;return a===r.lang?(i&&i.fenceCacheHits++,c=r.open):(i&&i.fenceCacheMisses++,c=a?`<pre><code class="language-${Gg(a)}">`:`<pre><code>`,r.lang=a,r.open=c),{html:`${c}${Gg(n)}</code></pre>\n`,nextPos:t<e.length?t+1:t}}c=t<e.length?t+1:t,s=c}return null}function f_(e,t){if(e.length===0)return t&&(t.matched=!0),``;if(e.includes(`\r`)||e.includes(`\0`))return null;let n=0,r=``,i=e.length>=25e4,a=[],o={lang:null,open:``},s=``,c=``,l=``,u=``;for(;n<e.length;){let d=Qg(e,n);if(n===d){n=d<e.length?d+1:d;continue}let f=e.charCodeAt(n);if(f===32||f===9){if(!$g(e,n,d))return null;n=d<e.length?d+1:d;continue}if(f===35){let o=a_(e,n,d);if(o===null)return null;t&&(t.blocks++,t.headings++),i?a.push(o):r+=o,n=e_(e,d<e.length?d+1:d);continue}if(f===45){let o=n;for(;o<e.length;){let t=Qg(e,o);if(!o_(e,o,t))break;o=t<e.length?t+1:t}if(o===n)return null;let l=e.slice(n,o),u;if(l===s)t&&t.listCacheHits++,u=c;else{t&&t.listCacheMisses++;let r=n;for(u=`<ul>
25
+ `;r<o;){let t=Qg(e,r),n=l_(e,r,t);if(n===null)return null;u+=n,r=t<e.length?t+1:t}u+=`</ul>
26
+ `,s=l,c=u}let d=e_(e,o);for(;d<e.length;){if(e.charCodeAt(d)===10){d++;continue}let t=Qg(e,d);if(!$g(e,d,t)){if(o_(e,d,t))return null;break}d=t<e.length?t+1:t}t&&(t.blocks++,t.lists++),i?a.push(u):r+=u,n=d;continue}if(f===96){let s=d_(e,n,d,o,t);if(!s)return null;t&&(t.blocks++,t.fences++),i?a.push(s.html):r+=s.html,n=e_(e,s.nextPos);continue}let p=r_(e,n,d),m;if(p===l)t&&t.paragraphCacheHits++,m=u;else{t&&t.paragraphCacheMisses++;let e=i_(p);if(e===null)return null;m=`<p>${e}</p>\n`,l=p,u=m}let h=d<e.length?d+1:d;if(h<e.length&&e.charCodeAt(h)!==10&&t_(e,h))return null;t&&(t.blocks++,t.paragraphs++),i?a.push(m):r+=m,n=e_(e,h)}return t&&(t.matched=!0),i?a.join(``):r}function p_(e){return f_(e)}function m_(e,t){return f_(e,t)}var h_={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function g_(e,t,n={},r){Pf(n);let i={...h_,...r||{}},a=Cf(t);if(i.fallbackOnGlobalState!==!1&&a)return Lf(n,{count:1,fallback:!0,fallbackReason:a,globalStateDetected:a,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),Tf(n,a,()=>e.core.parse(t,n,e).tokens);let o=__(t,i);if(i.maxChunks&&o.length>i.maxChunks&&(o=S_(o,i.maxChunks)),v_(t,o))return Lf(n,{count:1,fallback:!0,fallbackReason:`unsafe-chunk-boundary`,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),Tf(n,a,()=>e.core.parse(t,n,e).tokens);let s=0,c=[];return Lf(n,{count:o.length,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines,globalStateDetected:a||void 0,globalStateFallbackDisabled:i.fallbackOnGlobalState===!1&&!!a}),Tf(n,a,()=>{for(let r=0;r<o.length;r++){let i=o[r],a=t.slice(i.start,i.end),l=e.core.parse(a,n,e).tokens;s!==0&&l.length&&b_(l,s),x_(c,l),s+=i.lineCount}return c})}function __(e,t,n=!0){let r=[],i=0,a=0,o=0,s=0,c=0,l=0,u=null;function d(e){e<=o||(r.push({start:o,end:e,lineCount:s}),o=e,i=0,a=0,s=0)}for(let n=0;n<e.length;){let r=e.indexOf(`
27
+ `,n),o=r;r===-1?(r=e.length,o=e.length):o=r+1;let f=C_(e,n,r);if(t.fenceAware){let t=n;for(;t<r;){let n=e.charCodeAt(t);if(n===32||n===9)t++;else break}let i=e[t];if(i==="`"||i===`~`){let n=t;for(;n<r&&e[n]===i;)n++;let a=n-t;a>=3&&(u?u.marker===i&&a>=u.length&&(u=null):u={marker:i,length:a})}}let p=o-n;i+=p,a+=1,s+=1,f?(c=0,l=0):(c+=1,l+=p);let m=f;if((i>=t.maxChunkChars||a>=t.maxChunkLines)&&!u){if(m)d(o);else{let e=Math.max(10,Math.floor(t.maxChunkLines*.5)),n=Math.max(t.maxChunkChars,8e3);(c>=e||l>=n)&&d(o)}}n=o}return n&&d(e.length),r}function v_(e,t,n={rangesCoverWholeSource:!0}){let r=n.rangesCoverWholeSource?t.length-1:t.length;for(let n=0;n<r;n++)if(!y_(e,t[n].end))return!0;return!1}function y_(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let r=n+1;r<t-1;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}function b_(e,t){if(t===0)return;let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);for(;n.length;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}function x_(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function S_(e,t){if(e.length<=t)return e;let n=[],r=0;for(let i=0;i<t;i++){let a=t-i,o=e.length-r,s=Math.ceil(o/a),c=e.slice(r,r+s),l=0;for(let e=0;e<c.length;e++)l+=c[e].lineCount;n.push({start:c[0].start,end:c[c.length-1].end,lineCount:l}),r+=s}return n}function C_(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}var w_=4e6,T_=8e4,E_=1e4,D_=200,O_=1e4,k_=200;function A_(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function j_(e,t){if(t===0)return;let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);for(;n.length;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}function M_(e){return e.length===0?0:of(e)+(e.charCodeAt(e.length-1)===10?0:1)}function N_(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}function P_(e,t){if(!t||e.length===0)return!1;let n=null;for(let t=0;t<e.length;){let r=e.indexOf(`
28
+ `,t);r===-1&&(r=e.length);let i=t;for(;i<r;){let t=e.charCodeAt(i);if(t===32||t===9)i++;else break}let a=e[i];if(a==="`"||a===`~`){let t=i;for(;t<r&&e[t]===a;)t++;let o=t-i;o>=3&&(n?n.marker===a&&o>=n.length&&(n=null):n={marker:a,length:o})}t=r===e.length?e.length:r+1}return n!==null}function F_(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return N_(e,n+1,e.length-1)?!P_(e,t):!1}function I_(e,t,n,r={}){let i=r.mode??`full`,a=r.fenceAware??(i===`stream`?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(r.maxChunkChars!==void 0||r.maxChunkLines!==void 0||r.autoTune===!1){let t=r.maxChunkChars??(i===`stream`?e.options.streamChunkSizeChars??O_:e.options.fullChunkSizeChars??E_),n=r.maxChunkLines??(i===`stream`?e.options.streamChunkSizeLines??k_:e.options.fullChunkSizeLines??D_);return{maxChunkChars:t,maxChunkLines:n,holdBelowChars:t,holdBelowLines:n,fenceAware:a}}return i===`stream`?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:a}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:a}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:a}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:a}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:a}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:a}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:a}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:a}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:a}}var L_=class{md;options;pending=``;tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:`full`,autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw Error(`UnboundedBuffer with retainTokens=false requires onChunkTokens`)}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;let t=this.resolveWindow(),n=M_(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;let r=__(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!1);if(!r.length||v_(this.pending,r,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;let i=this.commitRanges(r,e);return this.pending=this.pending.slice(i),this.updateEnvDiagnostics(e,t,M_(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;let t=this.resolveWindow();if(!F_(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,M_(this.pending)),null;let n=__(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,M_(this.pending)),null;let r=v_(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:M_(this.pending)}]:n;return this.commitRanges(r,e),this.pending=``,this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,``);let t=this.resolveWindow();return this.updateEnvDiagnostics(e,t,0),this.tokens}let t=this.resolveWindow(),n=__(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!0);if(n.length){let t=v_(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:M_(this.pending)}]:n;this.commitRanges(t,e),this.pending=``}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending=``,this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??`full`,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:M_(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){let e=this.committedChars+this.pending.length,t=this.committedLines+M_(this.pending);return I_(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(wf(e)&&Of(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;let n=Cf(t);n&&(Ef(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let r=0;r<e.length;r++){let i=e[r],a=this.pending.slice(i.start,i.end),o=this.md.core.parse(a,t,this.md).tokens,s=this.committedChars,c=this.committedLines;c!==0&&o.length&&j_(o,c),this.options.retainTokens!==!1&&A_(this.tokens,o),this.committedChars+=a.length,this.committedLines+=i.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(o,{chunkIndex:this.parsedChunks,chunkChars:a.length,chunkLines:i.lineCount,tokenCount:o.length,startOffset:s,endOffset:this.committedChars,startLine:c,endLine:this.committedLines}),n=i.end}return this.markedGlobalStateReason&&Df(t),n}catch(e){throw this.markedGlobalStateReason&&=(Of(t),this.globalStateEnv=null,null),e}}updateEnvDiagnostics(e,t,n){Rf(e,{mode:this.options.mode??`full`,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function R_(e,t,n={},r={}){Pf(n);let i=new L_(e,{mode:`full`,...r});for(let e of t)i.feed(e),i.flushAvailable(n);return i.flushForce(n)}async function z_(e,t,n={},r={}){Pf(n);let i=new L_(e,{mode:`full`,...r});for await(let e of t)i.feed(e),i.flushAvailable(n);return i.flushForce(n)}function B_(e,t,n,r={},i={}){Pf(r);let a=new L_(e,{mode:`full`,...i,retainTokens:!1,onChunkTokens:n});for(let e of t)a.feed(e),a.flushAvailable(r);return a.flushForce(r),a.stats()}async function V_(e,t,n,r={},i={}){Pf(r);let a=new L_(e,{mode:`full`,...i,retainTokens:!1,onChunkTokens:n});for await(let e of t)a.feed(e),a.flushAvailable(r);return a.flushForce(r),a.stats()}function H_(e,t,n){if(e.options.autoUnbounded===!1)return!1;let r=e.options.autoUnboundedThresholdChars??w_,i=e.options.autoUnboundedThresholdLines??T_;return t>=r||n>=i}function U_(e,t,n){if(e.options.autoUnbounded===!1)return`no`;if(t>=(e.options.autoUnboundedThresholdChars??w_))return`yes`;let r=e.options.autoUnboundedThresholdLines??T_;return n===void 0?t<2*r-1?`no`:`need-lines`:n>=r?`yes`:`no`}function W_(e,t,n={},r={}){Pf(n);let i=Cf(t);if(wf(n)&&Of(n),r.fallbackOnGlobalState!==!1&&i)return Rf(n,{mode:`full`,fallback:!0,fallbackReason:i,committedChars:t.length,committedLines:of(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:i}),Tf(n,i,()=>e.core.parse(t,n,e).tokens);let a=[],o=new L_(e,{mode:`full`,...r,retainTokens:!1,onChunkTokens(e){A_(a,e)}});if(i&&Ef(n,i),o.feed(t),o.flushForce(n),i&&(Df(n),r.fallbackOnGlobalState===!1)){let e=Mf(n)?.unbounded;e&&(e.globalStateDetected=i,e.globalStateFallbackDisabled=!0)}return a}var G_=(e,t,n)=>e<t?t:e>n?n:e;function K_(e){return e.experimental?{...e,...e.experimental}:e}var q_=[{max:5e3,strategy:`discrete`,maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:`<=5k`},{max:2e4,strategy:`discrete`,maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:`<=20k`},{max:1e5,strategy:`plain`,notes:`<=100k plain`},{max:2e5,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:`<=200k`},{max:5e5,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:`<=500k`},{max:5e6,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:`<=5M`}],J_=[{max:5e3,strategy:`discrete`,maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:`<=5k`},{max:2e4,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:`<=20k`},{max:1e5,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:`<=100k`},{max:5e5,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:`<=500k`},{max:5e6,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:`<=5M`}];function Y_(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function X_(e,t=Math.max(0,e/40|0),n={}){let r=K_(n),i=r.fullChunkFenceAware??!0,a=r.fullChunkTargetChunks??8,o=r.fullChunkAdaptive!==!1;for(let t=0;t<q_.length;t++){let n=q_[t];if(e<=n.max){if(n.strategy!==`adaptive`)return Y_(i,n);break}}return e>5e6?{strategy:`plain`,fenceAware:i,notes:`>5M plain`}:o?{strategy:`adaptive`,maxChunkChars:G_(Math.ceil(e/a),8e3,64e3),maxChunkLines:G_(Math.ceil(t/a),150,700),maxChunks:G_(Math.ceil(e/64e3),a,16),fenceAware:i,notes:`adaptive fallback`}:{strategy:`discrete`,maxChunkChars:r.fullChunkSizeChars??1e4,maxChunkLines:r.fullChunkSizeLines??200,fenceAware:i,maxChunks:r.fullChunkMaxChunks}}function Z_(e,t=Math.max(0,e/40|0),n={}){let r=K_(n),i=r.streamChunkFenceAware??!0,a=r.streamChunkTargetChunks??8,o=r.streamChunkAdaptive!==!1;for(let t=0;t<J_.length;t++){let n=J_[t];if(e<=n.max){if(n.strategy!==`adaptive`)return Y_(i,n);break}}return e>5e6?{strategy:`plain`,fenceAware:i,notes:`>5M plain`}:o?{strategy:`adaptive`,maxChunkChars:G_(Math.ceil(e/a),8e3,64e3),maxChunkLines:G_(Math.ceil(t/a),150,700),maxChunks:G_(Math.ceil(e/64e3),a,32),fenceAware:i,notes:`adaptive fallback`}:{strategy:`discrete`,maxChunkChars:r.streamChunkSizeChars??1e4,maxChunkLines:r.streamChunkSizeLines??200,maxChunks:r.streamChunkMaxChunks,fenceAware:i}}var Q_={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`]},inline2:{rules:[`balance_pairs`,`emphasis`,`fragments_join`]}}},$_={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},ev={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`]},inline2:{rules:[`balance_pairs`,`fragments_join`]}}};function tv(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function nv(e,t){if(tv(e))throw TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}var rv=e=>tv(e)?e:Promise.resolve(e);function iv(e){switch(e){case`alt`:case`class`:case`href`:case`id`:case`lang`:case`rel`:case`src`:case`start`:case`style`:case`target`:case`title`:return e;default:return Gg(e)}}function av(e){if(!e||e.length===0)return``;let t=e[0],n=` ${iv(t[0])}="${Gg(t[1])}"`;for(let t=1;t<e.length;t++){let r=e[t];n+=` ${iv(r[0])}="${Gg(r[1])}"`}return n}function ov(e){if(!e)return{langName:``,langAttrs:``};let t=0;for(;t<e.length;){let n=e.charCodeAt(t);if(n===32||n===9||n===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:``};let n=t;for(;n<e.length;){let t=e.charCodeAt(n);if(t!==32&&t!==9&&t!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):``}}function sv(e,t,n,r,i){if(t.indexOf(`<pre`)===0)return`${t}\n`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Gg(`${i.langPrefix??`language-`}${r}`)}">${t}</code></pre>\n`;let n=e.attrIndex(`class`),a=e.attrs?e.attrs.slice():[],o=`${i.langPrefix??`language-`}${r}`;return n<0?a.push([`class`,o]):(a[n]=a[n].slice(),a[n][1]+=` ${o}`),`<pre><code${av(a)}>${t}</code></pre>\n`}return`<pre><code${av(e.attrs)}>${t}</code></pre>\n`}function cv(e){return!e.attrs||e.attrs.length===0?`<code>${Gg(e.content)}</code>`:`<code${av(e.attrs)}>${Gg(e.content)}</code>`}function lv(e){let t=Gg(e.content);return e.attrs?`<pre${av(e.attrs)}><code>${t}</code></pre>\n`:`<pre><code>${t}</code></pre>\n`}function uv(e,t){let n=e.attrs;if(!n||n.length===0)switch(e.type){case`paragraph_open`:return`${t}<p>`;case`heading_open`:return`<${e.tag}>`;case`td_open`:return`${t}<td>`;case`th_open`:return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]===`style`){if(e.type===`td_open`)return`${t}<td style="${Gg(n[0][1])}">`;if(e.type===`th_open`)return`${t}<th style="${Gg(n[0][1])}">`}return null}function dv(e){let t=e.attrs;return!t||t.length===0?`<a>`:t.length===1?`<a ${iv(t[0][0])}="${Gg(t[0][1])}">`:t.length===2?`<a ${iv(t[0][0])}="${Gg(t[0][1])}" ${iv(t[1][0])}="${Gg(t[1][1])}">`:`<a${av(t)}>`}function fv(e){switch(e.type){case`text`:case`text_special`:case`softbreak`:case`hardbreak`:case`html_inline`:case`code_inline`:case`image`:return!0;default:return!1}}function pv(e){switch(e.type){case`text`:case`text_special`:case`softbreak`:case`hardbreak`:case`html_inline`:case`code_inline`:return!0;default:return!1}}function mv(e,t){if(e.hidden)return``;let n=e.attrs,r=e.nesting,i=e.tag;if(!n||n.length===0)return r===0?t?`<${i} />`:`<${i}>`:r===-1?`</${i}>`:`<${i}>`;let a=(r===-1?`</`:`<`)+i+av(n);return r===0&&t&&(a+=` /`),`${a}>`}var hv={langPrefix:`language-`,xhtmlOut:!1,breaks:!1},gv=Object.prototype.hasOwnProperty,_v={code_inline(e,t){return cv(e[t])},code_block(e,t){return lv(e[t])},fence(e,t,n,r,i){let a=e[t],o=a.info?Jg(a.info).trim():``,{langName:s,langAttrs:c}=ov(o),l=n.highlight,u=Gg(a.content);if(!l)return sv(a,u,o,s,n);let d=l(a.content,s,c);return tv(d)?d.then(e=>sv(a,e||u,o,s,n)):sv(a,d||u,o,s,n)},image(e,t,n,r,i){let a=e[t],o=i.renderInlineAsText(a.children||[],n,r),s=a.attrIndex(`alt`);return s>=0&&a.attrs?a.attrs[s][1]=o:a.attrs?a.attrs.push([`alt`,o]):a.attrs=[[`alt`,o]],mv(a,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
29
+ `:`<br>
30
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
31
+ `:`<br>
32
+ `:`
33
+ `},text(e,t){return Gg(e[t].content)},text_special(e,t){return Gg(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function vv(e,t,n){let r=e.info?Jg(e.info).trim():``,{langName:i,langAttrs:a}=ov(r),o=t.highlight,s=Gg(e.content);if(!o)return sv(e,s,r,i,t);let c=o(e.content,i,a);if(tv(c))throw TypeError(`Renderer rule "fence" returned a Promise. Use renderAsync() instead.`);return sv(e,c||s,r,i,t)}function yv(e,t,n,r){switch(e.type){case`text`:return t.text===_v.text?e.content.length===0?``:Gg(e.content):null;case`text_special`:return t.text_special===_v.text_special?e.content.length===0?``:Gg(e.content):null;case`softbreak`:return t.softbreak===_v.softbreak?r:null;case`hardbreak`:return t.hardbreak===_v.hardbreak?n:null;case`html_inline`:return t.html_inline===_v.html_inline?e.content:null;case`code_inline`:return t.code_inline===_v.code_inline?cv(e):null;default:return null}}function bv(e,t,n,r,i){let a=e[0];switch(a.type){case`text`:if(i.text===_v.text)return a.content.length===0?``:Gg(a.content);break;case`text_special`:if(i.text_special===_v.text_special)return a.content.length===0?``:Gg(a.content);break;case`softbreak`:if(i.softbreak===_v.softbreak)return t.breaks?t.xhtmlOut?`<br />
34
+ `:`<br>
35
+ `:`
36
+ `;break;case`hardbreak`:if(i.hardbreak===_v.hardbreak)return t.xhtmlOut?`<br />
37
+ `:`<br>
38
+ `;break;case`html_inline`:if(i.html_inline===_v.html_inline)return a.content;break;case`code_inline`:if(i.code_inline===_v.code_inline)return cv(a)}let o=i[a.type];if(!o)return mv(a,t.xhtmlOut===!0);let s=o(e,0,t,n,r);return typeof s==`string`?s:nv(s,a.type)}var xv=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={..._v}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw TypeError(`render expects token array as first argument`);if(e.length===1)return this.renderSingleToken(e,e[0],t,n);let r=this.mergeOptions(t),i=n??{},a=this.rules,o=r.xhtmlOut===!0,s,c,l,u,d,f,p=``,m=``,h=!1,g=``;for(let t=0;t<e.length;t++){let n=e[t],_=n.type,v=t>0&&e[t-1].hidden?`
39
+ `:``;if(_===`list_item_open`&&(!n.attrs||n.attrs.length===0)&&t+3<e.length){let n=e[t+1],a=e[t+2],o=e[t+3];if(n.type===`paragraph_open`&&n.hidden&&a.type===`inline`&&o.type===`paragraph_close`&&o.hidden){g+=`${v}<li>${this.renderInlineTokens(a.children||[],r,i)}`,t+=3;continue}}if(t+2<e.length){let a=e[t+1],o=e[t+2];if(a.type===`inline`&&o.nesting===-1&&o.tag===n.tag&&!o.hidden){let e=uv(n,v);if(e!==null){g+=`${e+this.renderInlineTokens(a.children||[],r,i)}</${n.tag}>\n`,t+=2;continue}}}if(_===`inline`){let e=n.children||[];if(e.length===1){h||=(s=a.text,c=a.text_special,l=a.softbreak,u=a.hardbreak,d=a.html_inline,f=a.code_inline,p=r.xhtmlOut?`<br />
40
+ `:`<br>
41
+ `,m=r.breaks?p:`
42
+ `,!0);let t=e[0];switch(t.type){case`text`:if(s===_v.text){g+=Gg(t.content);continue}break;case`text_special`:if(c===_v.text_special){g+=Gg(t.content);continue}break;case`softbreak`:if(l===_v.softbreak){g+=m;continue}break;case`hardbreak`:if(u===_v.hardbreak){g+=p;continue}break;case`html_inline`:if(d===_v.html_inline){g+=t.content;continue}break;case`code_inline`:if(f===_v.code_inline){g+=cv(t);continue}}}g+=this.renderInlineTokens(e,r,i);continue}let y=a[_];if(!y){let i=n.attrs;if(!n.hidden){if(!i||i.length===0)switch(_){case`hr`:g+=o?`<hr />
43
+ `:`<hr>
44
+ `;continue;case`heading_open`:g+=`<${n.tag}>`;continue;case`heading_close`:g+=`</${n.tag}>\n`;continue;case`paragraph_open`:g+=`${v}<p>`;continue;case`paragraph_close`:g+=`</p>
45
+ `;continue;case`list_item_open`:{let n=e[t+1];g+=v+(n&&(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===`li`)?`<li>`:`<li>
46
+ `);continue}case`list_item_close`:g+=`</li>
47
+ `;continue;case`bullet_list_open`:g+=`${v}<ul>\n`;continue;case`bullet_list_close`:g+=`</ul>
48
+ `;continue;case`blockquote_open`:g+=v+(e[t+1]&&e[t+1].nesting===-1&&e[t+1].tag===`blockquote`?`<blockquote>`:`<blockquote>
49
+ `);continue;case`blockquote_close`:g+=`</blockquote>
50
+ `;continue;case`ordered_list_open`:g+=`${v}<ol>\n`;continue;case`ordered_list_close`:g+=`</ol>
51
+ `;continue;case`table_open`:g+=`${v}<table>\n`;continue;case`table_close`:g+=`</table>
52
+ `;continue;case`thead_open`:g+=`${v}<thead>\n`;continue;case`thead_close`:g+=`</thead>
53
+ `;continue;case`tbody_open`:g+=`${v}<tbody>\n`;continue;case`tbody_close`:g+=`</tbody>
54
+ `;continue;case`tr_open`:g+=`${v}<tr>\n`;continue;case`tr_close`:g+=`</tr>
55
+ `;continue;case`td_open`:g+=`${v}<td>`;continue;case`td_close`:g+=`</td>
56
+ `;continue;case`th_open`:g+=`${v}<th>`;continue;case`th_close`:g+=`</th>
57
+ `;continue}else if(i.length===1){let e=i[0];if(_===`ordered_list_open`&&e[0]===`start`){g+=`${v}<ol start="${Gg(e[1])}">\n`;continue}if(_===`td_open`&&e[0]===`style`){g+=`${v}<td style="${Gg(e[1])}">`;continue}if(_===`th_open`&&e[0]===`style`){g+=`${v}<th style="${Gg(e[1])}">`;continue}}}g+=this.renderToken(e,t,r);continue}if(_===`code_block`&&y===_v.code_block){g+=lv(n);continue}if(_===`fence`&&y===_v.fence){g+=vv(n,r,this);continue}if(_===`html_block`&&y===_v.html_block){g+=n.content;continue}let b=y(e,t,r,i,this);g+=typeof b==`string`?b:nv(b,n.type)}return g}async renderAsync(e,t,n){if(!Array.isArray(e))throw TypeError(`render expects token array as first argument`);let r=this.mergeOptions(t),i=n??{},a=this.rules,o=``;for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`inline`){o+=await this.renderInlineTokensAsync(n.children||[],r,i);continue}let s=a[n.type];o+=s?await rv(s(e,t,r,i,this)):this.renderToken(e,t,r)}return o}renderInline(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineTokens(e,r,i)}async renderInlineAsync(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineTokensAsync(e,r,i)}renderInlineAsText(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineAsTextInternal(e,r,i)}renderAttrs(e){return av(e.attrs)}renderToken(e,t,n){let r=e[t];if(r.hidden)return``;let i=r.block,a=r.nesting,o=r.tag,s=r.attrs,c=!1;if(i&&(c=!0,a===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===o)&&(c=!1)}let l=i&&a!==-1&&t>0&&e[t-1].hidden?`
58
+ `:``,u=c?`>
59
+ `:`>`;if(!s||s.length===0)return a===0?n.xhtmlOut?`${l}<${o} /${u}`:`${l}<${o}${u}`:a===-1?`${l}</${o}${u}`:`${l}<${o}${u}`;let d=l+(a===-1?`</`:`<`)+o+av(s);return a===0&&n.xhtmlOut&&(d+=` /`),d+u}mergeOptions(e){let t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null,r=()=>(n||={...t},n);if(gv.call(e,`highlight`)&&e.highlight!==t.highlight&&(r().highlight=e.highlight),gv.call(e,`langPrefix`)){let n=e.langPrefix;n!==t.langPrefix&&(r().langPrefix=n)}if(gv.call(e,`xhtmlOut`)){let n=e.xhtmlOut;n!==t.xhtmlOut&&(r().xhtmlOut=n)}if(gv.call(e,`breaks`)){let n=e.breaks;n!==t.breaks&&(r().breaks=n)}return n||t}buildNormalizedBase(){return Object.freeze({...hv,...this.baseOptions})}renderSingleToken(e,t,n,r){let i=this.rules,a=t.type;if(a===`code_block`&&i.code_block===_v.code_block)return lv(t);if(a===`html_block`&&i.html_block===_v.html_block)return t.content;let o=this.mergeOptions(n),s=r??{};if(a===`inline`)return this.renderInlineTokens(t.children||[],o,s);let c=i[a];if(!c)return t.block?this.renderToken(e,0,o):mv(t,o.xhtmlOut===!0);if(a===`fence`&&c===_v.fence)return vv(t,o,this);let l=c(e,0,o,s,this);return typeof l==`string`?l:nv(l,a)}renderInlineTokens(e,t,n){if(!e||e.length===0)return``;let r=this.rules;if(e.length===1)return bv(e,t,n,this,r);let i=t.xhtmlOut===!0,a=i?`<br />
60
+ `:`<br>
61
+ `,o=t.breaks?a:`
62
+ `,s=r.text,c=r.text_special,l=r.softbreak,u=r.hardbreak,d=r.html_inline,f=r.code_inline,p=r.link_open,m=r.link_close,h=r.em_open,g=r.em_close,_=r.strong_open,v=r.strong_close,y=``;for(let b=0;b<e.length;b++){let x=e[b];if(x.type===`link_open`&&!p&&!m&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`link_close`&&fv(t)){let n=yv(t,r,a,o);if(n!==null){let t=`${dv(x)+n}</a>`;if(l===_v.softbreak&&b+3<e.length&&e[b+3].type===`softbreak`){y+=t+o,b+=3;continue}y+=t,b+=2;continue}}}if(x.type===`link_open`&&!p&&!m&&b+1<e.length&&e[b+1].type===`link_close`){y+=`${dv(x)}</a>`,b+=1;continue}if(x.type===`em_open`&&!h&&!g&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`em_close`&&pv(t)){let e=yv(t,r,a,o);if(e!==null){y+=`<em>${e}</em>`,b+=2;continue}}}if(x.type===`strong_open`&&!_&&!v&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`strong_close`&&pv(t)){let e=yv(t,r,a,o);if(e!==null){y+=`<strong>${e}</strong>`,b+=2;continue}}}switch(x.type){case`text`:if(s===_v.text){let t=x.content.length===0?``:Gg(x.content);if(d===_v.html_inline&&b+1<e.length&&e[b+1].type===`html_inline`){for(y+=t+e[++b].content;b+1<e.length&&e[b+1].type===`html_inline`;)y+=e[++b].content;continue}y+=t;continue}break;case`text_special`:if(c===_v.text_special){x.content.length!==0&&(y+=Gg(x.content));continue}break;case`softbreak`:if(l===_v.softbreak){y+=o;continue}break;case`hardbreak`:if(u===_v.hardbreak){y+=a;continue}break;case`html_inline`:if(d===_v.html_inline){for(y+=x.content;b+1<e.length&&e[b+1].type===`html_inline`;)y+=e[++b].content;continue}break;case`code_inline`:if(f===_v.code_inline){y+=cv(x);continue}}let S=r[x.type];if(!S){y+=x.block?this.renderToken(e,b,t):mv(x,i);continue}let C=S(e,b,t,n,this);y+=typeof C==`string`?C:nv(C,x.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return``;let r=this.rules,i=``;for(let a=0;a<e.length;a++){let o=r[e[a].type];i+=o?await rv(o(e,a,t,n,this)):this.renderToken(e,a,t)}return i}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return``;let r=``;for(let i=0;i<e.length;i++){let a=e[i];switch(a.type){case`text`:case`text_special`:r+=a.content;break;case`image`:r+=this.renderInlineAsTextInternal(a.children||[],t,n);break;case`html_inline`:case`html_block`:r+=a.content;break;case`softbreak`:case`hardbreak`:r+=`
63
+ `}}return r}},Sv=[],Cv=4096;function wv(e){let t={...e};return Array.isArray(e.quotes)&&(t.quotes=[...e.quotes]),e.experimental&&(t.experimental={...e.experimental}),t}function Tv(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(n=>{if(!Object.hasOwn(e,n))return!1;let r=e[n],i=t[n];if(Array.isArray(r)&&Array.isArray(i))return r.length===i.length&&r.every((e,t)=>Object.is(e,i[t]));if(n===`experimental`&&r&&i){let e=r,t=i,n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(n=>Object.hasOwn(e,n)&&Object.is(e[n],t[n]))}return Object.is(r,i)})}function Ev(e){return{options:wv(e.options),coreVersion:e.core.ruler.version,blockVersion:e.block.ruler.version,inlineVersion:e.inline.ruler.version,inline2Version:e.inline.ruler2.version}}function Dv(e,t){return Tv(e.options,t.options)&&e.coreVersion===t.core.ruler.version&&e.blockVersion===t.block.ruler.version&&e.inlineVersion===t.inline.ruler.version&&e.inline2Version===t.inline.ruler2.version}function Ov(e){let t=e.length,n=0;for(;n<=t;){let r=e.indexOf(`
64
+ `,n);r===-1&&(r=t);let i=r<t,a=n,o=0;for(;a<r;){let t=e.charCodeAt(a);if(t===32){if(o++,a++,o>=4)return!0;continue}if(t===9){if(o+=4-o%4,a++,o>=4)return!0;continue}break}if(a<r){let t=e.charCodeAt(a);switch(t){case 35:{let t=a;for(;t<r&&e.charCodeAt(t)===35;)t++;let n=t-a;if(n>0&&n<=6){if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0}break}case 62:{let t=a+1;if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0;break}case 45:case 42:case 43:{let t=a+1;if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0;break}case 96:case 126:{let n=a;for(;n<r&&e.charCodeAt(n)===t;)n++;if(n-a>=3)return!0;break}default:if(t>=48&&t<=57){let t=a+1;for(;t<r;){let n=e.charCodeAt(t);if(n<48||n>57)break;t++}if(t<r&&e.charCodeAt(t)===46){let n=t+1;if(n<r){let t=e.charCodeAt(n);if(t===32||t===9||t===13)return!0}else if(n===r&&i)return!0}}}}if(r===t)break;n=r+1}return!1}function kv(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function Av(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!jv(e[n],t[n]))return!1;return!0}function jv(e,t){if(!e||!t||e.type!==t.type)return!1;let n=e.map,r=t.map;return!!n!=!!r||n&&r&&(n[0]!==r[0]||n[1]!==r[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!kv(e.attrs,t.attrs)||!Av(e.children,t.children)?!1:(e.content||``)===(t.content||``)}function Mv(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:`idle`}}var Nv=class{core;anchorBlock=new cg;cache=null;snapshots=new WeakSet;stats=Mv();normalizeLineEndings=!0;tokenMapsTrusted=!0;allowUntrustedTailReuse=!1;MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode=`reset`}resetStats(){let{resets:e}=this.stats;this.stats=Mv(),this.stats.resets=e}snapshot(){let e=this.cache;if(!e)return null;let t=e.snapshotState??{cache:e};e.snapshotState=t;let n={state:t,get sourceLength(){return this.state.cache.src.length},get tokenCount(){return this.state.cache.tokens.length}};return this.snapshots.add(n),n}restore(e,t){if(!this.snapshots.has(e))throw TypeError(`Invalid stream snapshot`);let n=e.state.cache;return this.cache=n,Dv(n.config,t)?n.tokens:this.parse(n.src,n.env,t)}append(e,t,n){let r=this.cache;if(!r)throw Error(`Stream append requires cached history; call stream.parse(fullSource) first`);return this.ensureBoundaryState(r),this.parse(r.src+e,t,n,e)}parse(e,t,n,r){let i=this.cache,a=i?.env,o=n.core.ruler.getNamedRules(``),s=o.findIndex(e=>e.fn===Ym),c=o.findIndex(e=>e.fn===hp),l=o.find(e=>e.name===`normalize`);this.normalizeLineEndings=s>=0&&c>=0&&s<c;let u=t,d=!!i&&!Dv(i.config,n),f=l&&l.fn!==Ym,p=l&&!this.normalizeLineEndings&&e.includes(`\r`),m=c<0||o.slice(0,c).some(e=>e.fn!==Ym);this.tokenMapsTrusted=!(c<0||o.slice(c+1).some(e=>e.fn!==Lm&&e.fn!==Km&&e.fn!==rh&&e.fn!==uh&&e.fn!==dh)),this.allowUntrustedTailReuse=this.tokenMapsTrusted||n.options?.streamTailLocalPostBlockRules===!0;let h=d||f||p||m?null:i;if(Pf(u??i?.env??a),!h||u&&u!==h.env){let t=u??i?.env??a??{},o=!!n.__explicitStreamChunkFallbackSetting,s=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy(),c=!!n.options?.streamChunkedFallback,l=!o&&s,d=c||l,f=n.options?.streamChunkAdaptive!==!1,p=n.options?.streamChunkTargetChunks??8,m=n.options?.streamChunkSizeChars,h=n.options?.streamChunkSizeLines,g=n.options?.streamChunkMaxChunks,_=!!n.__explicitStreamChunkConfig,v=n.options?.autoTuneChunks!==!1,y=n.options?.streamChunkFenceAware??!0,b=n.options?.streamLargeCachePolicy??`retain`,x=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,S=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES,C,w=!1;if(b===`skip`&&(w=e.length>=x,!w&&S!==void 0&&(C=of(e),w=C>=S)),w&&r===void 0&&!i?.snapshotState){let r=this.parseFullDocument(e,t,n,C,!1);return this.cache=null,this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,If(t,{area:`stream`,path:`stream-full`,reason:`skip-cache-large-one-shot`,unbounded:!!Mf(t)?.unbounded}),r.tokens}if(d){let r=(e,t,n)=>e<t?t:e>n?n:e;C===void 0&&(C=of(e));let i=v&&!_?Z_(e.length,C,n.options):null,a=i?.maxChunkChars??(f?r(Math.ceil(e.length/p),8e3,64e3):m??1e4),o=i?.maxChunkLines??(f?r(Math.ceil(C/p),150,700):h??200),s=i?.maxChunks??(f?r(Math.ceil(e.length/64e3),p,32):g),u=e.length>0&&e.charCodeAt(e.length-1)===10,d=l&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&i?.strategy!==`plain`;if((c||d)&&(e.length>=a*2||C>=o*2)&&u){let r=g_(n,e,t,{maxChunkChars:a,maxChunkLines:o,fenceAware:i?.fenceAware??y,maxChunks:s}),l=Mf(t)?.chunk?.globalStateDetected??null,u=this.setCache({src:e,tokens:r,env:t,lineCount:C,lastSegment:void 0,globalStateReason:l},n);return this.updateCacheLineCount(u,C),this.recordChunkedParseResult(t,c?`explicit-initial-large-doc`:`default-initial-large-doc`),r}}let T=this.parseFullDocument(e,t,n,C);C=T.lineCount;let E=this.setCache({src:e,tokens:T.tokens,env:t,lineCount:C,lastSegment:void 0,globalStateReason:T.globalStateReason},n);return this.updateCacheLineCount(E,C),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,If(t,{area:`stream`,path:`stream-full`,reason:`initial-parse`,unbounded:!!Mf(t)?.unbounded}),T.tokens}if(e===h.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode=`cache`,If(h.env,{area:`stream`,path:`stream-cache`,reason:`same-source`}),h.tokens;let g=r===void 0?e.startsWith(h.src)?e.slice(h.src.length):null:r,_=h.globalStateReason;_===void 0&&(_=Cf(h.src),h.globalStateReason=_);let v=_?null:g===null?Cf(e):this.detectGlobalStateForAppend(h,g),y=_||v;if(y){let t=u??h.env;Of(t);let r=this.parseFullDocument(e,t,n),i=r.tokens,a=r.lineCount,o=this.setCache({src:e,tokens:i,env:t,lineCount:a,lastSegment:void 0,globalStateReason:r.globalStateReason},n);return this.updateCacheLineCount(o,a),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,If(t,{area:`stream`,path:`stream-full`,reason:`global-state:${y}`,unbounded:!!Mf(t)?.unbounded}),i}let b=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(h.src.length<b&&e.length<b*1.5&&g===null){let t=u??h.env,r=this.parseFullDocument(e,t,n),i=r.tokens,a=r.lineCount,o=this.setCache({src:e,tokens:i,env:t,lineCount:a,lastSegment:void 0,globalStateReason:r.globalStateReason},n);return this.updateCacheLineCount(o,a),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,If(t,{area:`stream`,path:`stream-full`,reason:`small-non-append`,unbounded:!!Mf(t)?.unbounded}),i}let x=this.ensureLastSegment(h,r!==void 0),S=this.tokenMapsTrusted||this.allowUntrustedTailReuse&&(h.lastSegmentVerified===!0||!!(x&&this.hasVerifiedSegmentAnchor(h,x,n))),C=g!==null&&this.shouldPreferTailReparseForAppend(h,S)||!this.tokenMapsTrusted?null:this.getAppendedSegment(h,e,g);if(C){let t=h.lineCount??of(h.src),r=3;C.length>5e3?r=8:C.length>1e3?r=6:C.length>200&&(r=4),r=Math.min(r,t);let i=null,a=n.options?.streamContextParseStrategy??`chars`,o=n.options?.streamContextParseMinChars??200,s=n.options?.streamContextParseMinLines??2,c,l=()=>(c===void 0&&(c=of(C)),c),u=this.canDirectlyParseAppend(h),d=u&&this.shouldUseUnboundedAppend(e,h,C),f=!1;if(!u)switch(a){case`lines`:f=l()>=s;break;case`constructs`:if(C.length>=o){f=!0;break}if(Ov(C)){f=!0;break}f=l()>=s;break;default:f=C.length>=o}if(r>0&&f){let e=this.getTailLines(h.src,r)+C;try{let a=this.core.parse(e,h.env,n).tokens,o=a.findIndex(e=>e.map&&typeof e.map[1]==`number`&&e.map[1]>r);if(o!==-1){let e=a.slice(o),n=t-r;n!==0&&this.shiftTokenLines(e,n),i={tokens:e}}}catch{i=null}}else i=null;if(!i){let e=t;if(d)i={tokens:W_(n,C,h.env,{mode:`stream`})},e>0&&this.shiftTokenLines(i.tokens,e);else{let t=this.core.parse(C,h.env,n);e>0&&this.shiftTokenLines(t.tokens,e),i=t}}let p=0;if(h.tokens.length>0&&i.tokens.length>0){let e=h.tokens[h.tokens.length-1],t=i.tokens[0];try{e.type===`inline`&&t.type===`inline`&&(t.children&&t.children.length>0&&(e.children||=[],this.appendTokens(e.children,t.children)),e.content=(e.content||``)+(t.content||``),p=1)}catch{p=0}}let m=h.tokens.length;if(i.tokens.length>p){let e=h.tokens,t=i.tokens,n=Math.min(e.length,t.length-p),r=0;for(let i=n;i>0;i--){let n=!0;for(let r=0;r<i;r++){let a=e[e.length-i+r],o=t[p+r];if(!jv(a,o)){n=!1;break}}if(n){r=i;break}}r>0&&(p+=r),t.length>p&&this.appendTokens(h.tokens,t,p)}if(h.boundary?this.updateBoundaryStateForAppend(h,C):this.updateFenceMarkerCacheForAppend(h,C),h.src=e,h.globalStateReason=null,h.lineCount=t+(c??l()),h.tokens.length>m){let n=this.getLastSegment(h.tokens,e,m,h.tokens.length,e.length-C.length,t);if(n){h.lastSegment=n;let t=e.length-C.length;h.lastSegmentSource=C.slice(Math.max(0,n.srcOffset-t))}else h.lastSegment=void 0,h.lastSegmentSource=void 0}else h.lastSegment=void 0,h.lastSegmentSource=void 0;return h.lastSegmentVerified=void 0,this.stats.total+=1,this.stats.appendHits+=1,d&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode=`append`,If(h.env,{area:`stream`,path:d?`stream-unbounded-append`:`stream-append`,reason:d?`large-delta`:`safe-append`,unbounded:d}),h.tokens}let w=u??h.env,T=S?this.tryTailSegmentReparse(e,h,w,n,x??void 0,g??void 0):this.allowUntrustedTailReuse?this.tryUntrustedParagraphTailReparse(e,h,w,n):null;if(T)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode=`tail`,If(w,{area:`stream`,path:`stream-tail`,reason:`tail-reparse`}),T;let E=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy(),O=!!n.options?.streamChunkedFallback,k=!E&&!C&&D,ee=O||k,A=n.options?.streamChunkAdaptive!==!1,j=n.options?.streamChunkTargetChunks??8,te=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,P=!!n.__explicitStreamChunkConfig,F=n.options?.autoTuneChunks!==!1,ne=n.options?.streamChunkFenceAware??!0,re=C&&h.lineCount!==void 0?h.lineCount+of(C):void 0;if(ee){re===void 0&&(re=of(e));let t=(e,t,n)=>e<t?t:e>n?n:e,r=F&&!P?Z_(e.length,re,n.options):null,i=r?.maxChunkChars??(A?t(Math.ceil(e.length/j),8e3,64e3):te??1e4),a=r?.maxChunkLines??(A?t(Math.ceil(re/j),150,700):M??200),o=r?.maxChunks??(A?t(Math.ceil(e.length/64e3),j,32):N),s=e.length>0&&e.charCodeAt(e.length-1)===10,c=k&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&r?.strategy!==`plain`;if((O||c)&&(e.length>=i*2||re>=a*2)&&s){let t=g_(n,e,w,{maxChunkChars:i,maxChunkLines:a,fenceAware:r?.fenceAware??ne,maxChunks:o}),s=Mf(w)?.chunk?.globalStateDetected??null,c=this.setCache({src:e,tokens:t,env:w,lineCount:re,lastSegment:void 0,globalStateReason:s},n);return this.updateCacheLineCount(c,re),this.recordChunkedParseResult(w,O?`explicit-fallback-large-doc`:`default-fallback-large-doc`),t}}let I=this.parseFullDocument(e,w,n,re),L=I.tokens;re=I.lineCount;let ie=this.setCache({src:e,tokens:L,env:w,lineCount:re,lastSegment:void 0,globalStateReason:I.globalStateReason},n);return this.updateCacheLineCount(ie,re),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,If(w,{area:`stream`,path:`stream-full`,reason:`fallback-full`,unbounded:!!Mf(w)?.unbounded}),L}recordChunkedParseResult(e,t){let n=Mf(e)?.chunk,r=n?.fallback?String(n.fallbackReason||`global-state`):null;if(this.stats.total+=1,r){this.stats.fullParses+=1,this.stats.lastMode=`full`,If(e,{area:`stream`,path:`stream-full`,reason:`global-state:${r}`,unbounded:!!Mf(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode=`chunked`,If(e,{area:`stream`,path:`stream-chunked`,chunked:!0,reason:t})}parseFullDocument(e,t,n,r,i=!0){wf(t)&&Of(t);let a=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy()?U_(n,e.length,r):`no`;if(a===`yes`){let a=W_(n,e,t),o=Mf(t)?.unbounded?.globalStateDetected??null;return If(t,{area:`stream`,path:`stream-full`,reason:`auto-unbounded-char-threshold`,unbounded:!0}),{tokens:a,lineCount:r??(i?of(e):0),globalStateReason:o}}let o=r;if(a===`need-lines`&&(o=of(e),H_(n,e.length,o))){let r=W_(n,e,t),i=Mf(t)?.unbounded?.globalStateDetected??null;return If(t,{area:`stream`,path:`stream-full`,reason:`auto-unbounded-line-threshold`,unbounded:!0}),{tokens:r,lineCount:o,globalStateReason:i}}o===void 0&&(o=i?of(e):0);let s=Cf(e);return{tokens:Tf(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:o,globalStateReason:s}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS||of(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){let r=e.src;if(n===null||n===void 0&&!t.startsWith(r)||(n===void 0?!r.endsWith(`
65
+ `):!this.ensureBoundaryState(e).endsWithNewline))return null;let i=n??t.slice(r.length);if(!i)return null;let a=i.length;if(i.charCodeAt(a-1)!==10)return null;let o=0,s=-1;for(let e=0;e<a&&!(i.charCodeAt(e)===10&&(s===-1&&(s=e),o++,o>=2));e++);if(o<2)return null;let c=(s===-1?i:i.slice(0,s)).trim();if(c.length===0)return null;if(/^[-=]+$/.test(c)){let t;if(n!==void 0)t=this.ensureBoundaryState(e).previousLineNonBlank;else{let e=r.slice(0,-1),n=e.lastIndexOf(`
66
+ `);t=e.slice(n+1).trim().length>0}if(t)return null}if(n!==void 0){let t=this.ensureLastSegment(e);if(t&&this.segmentHasFence(e,t)){let n=this.tokenMapsTrusted?this.ensureSegmentSourceOffset(e,t):0;if(this.endsInsideOpenFence(r,n))return null}}else{let t=this.tokenMapsTrusted?this.ensureLastSegment(e)?.srcOffset??0:0;if((this.tokenMapsTrusted||this.cacheHasFenceMarker(e))&&this.endsInsideOpenFence(r,t))return null}return this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,r,i,a){let o=i??this.ensureLastSegment(t);if(!o)return null;let s=a!==void 0;if(s&&this.ensureSegmentSourceOffset(t,o),o.srcOffset<=0&&o.tokenStart<=0)return null;if(!s){let n=t.src.slice(0,o.srcOffset);if(!e.startsWith(n))return null}let c=s?t.lastSegmentSource??t.src.slice(o.srcOffset):t.src.slice(o.srcOffset),l=s?c+a:e.slice(o.srcOffset);if(l===c)return null;let u=s?a:e.startsWith(t.src)?e.slice(t.src.length):null,d=s&&this.tokenMapsTrusted?e:this.getNormalizedUpdatedSource(t,e,a);if(u){let i=this.tryContainerTailAppendMerge(e,t,n,r,o,u,d);if(i)return t.lastSegmentSource=s?l:void 0,i}if(this.mayContainReferenceDefinition(c)||this.mayContainReferenceDefinition(l))return null;try{let i=this.parseAtLineOffset(l,n,r,o.lineStart,d),a=i.state,c=this.getLastSegment(a.tokens,l,0,a.tokens.length,i.mapsShifted?0:void 0,i.mapsShifted?o.lineStart:void 0);return o.lineStart>0&&!i.mapsShifted&&this.shiftTokenLines(a.tokens,o.lineStart),u?s?this.updateBoundaryStateForAppend(t,u):this.updateFenceMarkerCacheForAppend(t,u):(t.boundary=void 0,t.hasFenceMarker=void 0),t.src=e,t.normalizedSrc=d,t.env=n,t.globalStateReason=null,(!s||!u)&&(t.globalStateCarry=void 0),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,a.tokens),t.lineCount=o.lineStart+of(l),c?(t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:i.mapsShifted?c.lineStart:o.lineStart+c.lineStart,lineEnd:i.mapsShifted?c.lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset},t.lastSegmentSource=s?l.slice(c.srcOffset):void 0):(t.lastSegment=null,t.lastSegmentSource=void 0),t.lastSegmentVerified=void 0,t.tokens}catch{return null}}tryUntrustedParagraphTailReparse(e,t,n,r){if(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))return null;let i=this.ensureLastSegment(t);if(!i||t.tokens[i.tokenStart]?.type!==`paragraph_open`)return null;let a=t.tokens.slice(i.tokenStart,i.tokenEnd).find(e=>e.type===`inline`);if(!a?.content)return null;let o=t.src.length;for(;o>0;){let e=t.src.charCodeAt(o-1);if(e!==10&&e!==13)break;o--}let s=t.src.lastIndexOf(a.content,o-a.content.length);return s<0||s+a.content.length!==o?null:this.tryTailSegmentReparse(e,t,n,r,{...i,lineStart:this.countSourceLineBreaks(t.src,s),srcOffset:s})}countSourceLineBreaks(e,t){let n=0;for(let r=0;r<t;r++){let t=e.charCodeAt(r);t===10?n++:this.normalizeLineEndings&&t===13&&(n++,e.charCodeAt(r+1)===10&&r++)}return n}hasVerifiedSegmentAnchor(e,t,n){t.srcOffset<0&&this.ensureSegmentSourceOffset(e,t);let r=e.lineCount??of(e.src),i=this.getDocLineCount(e.src,r);if(!(t.lineStart>=0&&t.lineStart<=t.lineEnd&&t.lineEnd<=i&&t.srcOffset<e.src.length))return!1;let a=e.src.slice(t.srcOffset);try{let r=Object.create(n);Object.defineProperty(r,"block",{value:this.anchorBlock});let i=this.core.createState(a,{},r);this.normalizeLineEndings&&Ym(i),this.anchorBlock.parse(i.src,r,i.env,i.tokens);let o=this.getLastSegment(i.tokens,a);if(!o||o.tokenStart!==0)return!1;let s=typeof i.src==`string`?i.src:a,c=i.tokens[0]?.type,l=e.tokens[t.tokenStart]?.type,u=l===`table_open`&&c===`paragraph_open`&&/^\s*\|/.test(s)||l===`inline`&&c===`html_block`||l===`math_block`&&c===`paragraph_open`&&/^\s*\$\$\s*(?:\n|$)/.test(s);if(c!==l&&!u)return!1;let d=e.tokens.slice(t.tokenStart,t.tokenEnd).map(e=>e.content).filter(Boolean),f=0;for(let e of d){if(f=s.indexOf(e,f),f<0)return!1;f+=e.length}return!0}catch{return!1}}normalizeSource(e){return e.replace(/\r\n?/g,`
67
+ `).replace(/\0/g,`�`)}cacheHasFenceMarker(e){return e.hasFenceMarker===void 0&&(e.hasFenceMarker=e.src.includes("```")||e.src.includes(`~~~`)),e.hasFenceMarker}updateFenceMarkerCacheForAppend(e,t){if(this.cacheHasFenceMarker(e))return;let n=e.src.slice(-2)+t;e.hasFenceMarker=n.includes("```")||n.includes(`~~~`)}getNormalizedUpdatedSource(e,t,n){if(!this.normalizeLineEndings)return t;if(n===void 0&&!t.startsWith(e.src))return this.normalizeSource(t);let r=e.normalizedSrc??this.normalizeSource(e.src),i=n??t.slice(e.src.length),a=this.normalizeSource(i);return e.src.endsWith(`\r`)&&i.startsWith(`
68
+ `)&&(a=a.slice(1)),r+a}parseAtLineOffset(e,t,n,r,i){if(this.tokenMapsTrusted||r<=0)return{state:this.core.parse(e,t,n),mapsShifted:!1};let a=this.core.createState(e,t,n),o=!1;return this.core.process(a,(e,t)=>{!o&&e.fn===hp&&(this.shiftTokenLines(t.tokens,r),i!==void 0&&(t.src=i),o=!0)}),{state:a,mapsShifted:o}}getTailLines(e,t){if(t<=0)return``;let n=t;for(let t=e.length-1;t>=0;t--)if(e.charCodeAt(t)===10&&(n--,n===0))return e.slice(t+1);return e}endsInsideOpenFence(e,t){let n=e.slice(t),r=n.length,i=null,a=0;for(;a<r;){let e=n.indexOf(`
69
+ `,a);if(this.normalizeLineEndings){let t=n.indexOf(`\r`,a);t>=0&&(e===-1||t<e)&&(e=t)}e===-1&&(e=r);let t=a,o=0;for(;t<e;){let e=n.charCodeAt(t);if(e===32){if(t++,o++,o>=4)break}else if(e===9){o=4;break}else break}if(o<4&&t<e){let r=n.charCodeAt(t);if(r===96||r===126){let a=t;for(;a<e&&n.charCodeAt(a)===r;)a++;let o=a-t;if(o>=3){if(!i){let t=r===96?n.indexOf("`",a):-1;t>=0&&t<e||(i={marker:r,length:o})}else if(i.marker===r&&o>=i.length){let t=a;for(;t<e;){let e=n.charCodeAt(t);if(e===32||e===9)t++;else break}t===e&&(i=null)}}}}if(e===r)break;a=e+(this.normalizeLineEndings&&n.charCodeAt(e)===13&&n.charCodeAt(e+1)===10?2:1)}return i!==null}peek(){return this.cache?.tokens??Sv}hasCache(){return this.cache!==null}getStats(){return{...this.stats}}setCache(e,t){let n=this.cache?.snapshotState,r={...e,config:Ev(t),snapshotState:n};return n&&(n.cache=r),this.cache=r,r}appendTokens(e,t,n=0,r=t.length){for(let i=n;i<r;i++)e.push(t[i])}updateCacheLineCount(e,t){e.lineCount=t??of(e.src),e.lastSegment=void 0,e.lastSegmentVerified=void 0,e.normalizedSrc=void 0,e.globalStateCarry=e.src.slice(-4096),e.boundary=void 0,e.lastSegmentSource=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;let n=(e.globalStateCarry??e.src.slice(-4096))+t,r=Cf(n);return e.globalStateCarry=n.length>Cv?n.slice(n.length-Cv):n,r&&(e.globalStateReason=r),r}ensureLastSegment(e,t=!1){return e.lastSegment===void 0&&(e.lastSegment=this.getLastSegment(e.tokens,e.src,0,e.tokens.length,void 0,void 0,t)),e.lastSegment}getLastSegment(e,t,n=0,r=e.length,i,a,o=!1){if(r<=n)return null;let s=1/0,c=-1,l=0;for(let u=r-1;u>=n;u--){let n=e[u];if(n.map&&(n.map[0]<s&&(s=n.map[0]),n.map[1]>c&&(c=n.map[1])),n.nesting<0){l+=-n.nesting;continue}if(n.nesting>0){if(l-=n.nesting,n.level===0&&l<=0){let e=Number.isFinite(s)?s:n.map?.[0]??0,l=c>=e?c:n.map?.[1]??e;return{tokenStart:u,tokenEnd:r,lineStart:e,lineEnd:l,srcOffset:o?-1:this.getLineStartOffset(t,e,i,a)}}continue}if(n.level===0&&l===0){let e=Number.isFinite(s)?s:n.map?.[0]??0,l=c>=e?c:n.map?.[1]??e;return{tokenStart:u,tokenEnd:r,lineStart:e,lineEnd:l,srcOffset:o?-1:this.getLineStartOffset(t,e,i,a)}}}return null}segmentHasFence(e,t){let n=Math.min(t.tokenEnd,e.tokens.length);for(let r=t.tokenStart;r<n;r++)if(e.tokens[r].type===`fence`)return!0;return!1}ensureSegmentSourceOffset(e,t){if(t.srcOffset<0){let n=e.lineCount;t.srcOffset=n!==void 0&&t.lineStart<=n&&t.lineEnd<=n+1?this.getLineStartOffsetFromEnd(e.src,t.lineStart,n):this.getLineStartOffset(e.src,t.lineStart)}return t.srcOffset}getLineStartOffsetFromEnd(e,t,n){if(t<=0)return 0;let r=n-t+1,i=e.length;for(;r>0;){if(i=e.lastIndexOf(`
70
+ `,i-1),i<0)return 0;r--}return i+1}getLineStartOffset(e,t,n,r){return n!==void 0&&r!==void 0&&t>=r?this.getLineStartOffsetFrom(e,n,t-r):this.getLineStartOffsetFrom(e,0,t)}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let r=n,i=t;for(;i<e.length;){let t=e.charCodeAt(i);if(t===10)i++,r--;else if(this.normalizeLineEndings&&t===13)i++,i<e.length&&e.charCodeAt(i)===10&&i++,r--;else{i++;continue}if(r===0)return i}return e.length}mayContainReferenceDefinition(e){return e.includes(`]:`)?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.tokenMapsTrusted||!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src)))return!1;let t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case`paragraph_open`:case`heading_open`:case`fence`:case`code_block`:case`html_block`:case`hr`:case`table_open`:return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,r,i,a,o){if(!a||this.mayContainReferenceDefinition(a))return null;let s=t.tokens[i.tokenStart];switch(s?.type){case`bullet_list_open`:case`ordered_list_open`:return this.tryListTailAppendMerge(e,t,n,r,i,a,s,o);case`table_open`:return this.tryTableTailAppendMerge(e,t,n,r,i,a,s,o);default:return null}}tryListTailAppendMerge(e,t,n,r,i,a,o,s){if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10))return null;this.ensureSegmentSourceOffset(t,i);let c=i.lineEnd-i.lineStart,l=t.src.length-i.srcOffset;if(c<this.MIN_LIST_LINES_FOR_MERGE&&l<this.MIN_LIST_CHARS_FOR_MERGE)return null;let u=o.type===`bullet_list_open`?`bullet_list_close`:`ordered_list_close`,d=t.lineCount??of(t.src),f,p=!1;try{let e=this.parseAtLineOffset(a,n,r,d,s);f=e.state.tokens,p=e.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(f,o.type,u,o.markup))return null;let m=f.slice(1,-1);if(m.length===0)return null;d>0&&!p&&this.shiftTokenLines(m,d);let h=this.getListParagraphMode(t.tokens,i.tokenStart,t.tokens.length,o.level),g=this.getListParagraphMode(f,0,f.length,0);(h===`loose`||g===`loose`||(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))||(f[0]?.map?.[0]??0)-(p?d:0)>0)&&(this.setListParagraphVisibility(t.tokens,i.tokenStart,t.tokens.length,o.level,!1),this.setListParagraphVisibility(m,0,m.length,o.level,!1)),t.tokens.splice(t.tokens.length-1,0,...m),t.boundary?this.updateBoundaryStateForAppend(t,a):this.updateFenceMarkerCacheForAppend(t,a),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;let _=d+of(a);t.lineCount=_;let v=this.getCachedDocLineCount(t,_);return o.map&&(o.map[1]=v),t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:v,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}tryTableTailAppendMerge(e,t,n,r,i,a,o,s){if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10)||/(?:^|\n)[ \t]*\n/.test(a))return null;this.ensureSegmentSourceOffset(t,i);let c=i.lineEnd-i.lineStart,l=t.src.length-i.srcOffset;if(c<this.MIN_TABLE_LINES_FOR_MERGE&&l<this.MIN_TABLE_CHARS_FOR_MERGE)return null;let u=this.getTableHeaderContext(t.src.slice(i.srcOffset));if(!u)return null;let d=`${u}${a}`,f=i.lineEnd-2,p,m=!1;try{let e=this.parseAtLineOffset(d,n,r,f,s);p=e.state.tokens,m=e.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(p,`table_open`,`table_close`)||(p[0]?.map?.[1]??-1)!==this.getDocLineCount(d))return null;let h=this.getTableBodySection(p,0,p.length,0),g=this.getTableBodySection(t.tokens,i.tokenStart,t.tokens.length,o.level);if(!h||!g||h.tbodyOpenIndex<0||h.tbodyCloseIndex<0)return null;let _=g.tbodyOpenIndex>=0?p.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):p.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(_.length===0)return null;f!==0&&!m&&this.shiftTokenLines(_,f);let v=g.tbodyCloseIndex>=0?g.tbodyCloseIndex:g.tableCloseIndex,y=t.lineCount??of(t.src);t.tokens.splice(v,0,..._),t.boundary?this.updateBoundaryStateForAppend(t,a):this.updateFenceMarkerCacheForAppend(t,a),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;let b=y+of(a);t.lineCount=b;let x=this.getCachedDocLineCount(t,b);if(o.map&&(o.map[1]=x),g.tbodyOpenIndex>=0){let e=t.tokens[g.tbodyOpenIndex];e?.map&&(e.map[1]=x)}return t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:x,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}getTableHeaderContext(e){let t=e.indexOf(`
71
+ `);if(t<0)return null;let n=e.indexOf(`
72
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,r){if(t<0||t>=n||e[t]?.type!==`table_open`)return null;let i=-1;for(let a=n-1;a>t;a--){let t=e[a];if(t.type===`table_close`&&t.level===r){i=a;break}}if(i<0)return null;let a=-1,o=-1;for(let n=t+1;n<i;n++){let t=e[n];if(t.type===`tbody_open`&&t.level===r+1){a=n;break}}if(a>=0){for(let t=i-1;t>a;t--){let n=e[t];if(n.type===`tbody_close`&&n.level===r+1){o=t;break}}if(o<0)return null}return{tableCloseIndex:i,tbodyOpenIndex:a,tbodyCloseIndex:o}}isSingleTopLevelContainer(e,t,n,r){if(e.length<2)return!1;let i=e[0],a=e[e.length-1];if(i.type!==t||a.type!==n||i.level!==0||a.level!==0||r!==void 0&&i.markup!==r)return!1;let o=0;for(let t=0;t<e.length;t++){let n=e[t];if(n.level===0&&t>0&&t<e.length-1&&o===0)return!1;(n.nesting>0||n.nesting<0)&&(o+=n.nesting)}return o===0}getListParagraphMode(e,t,n,r){let i=!1,a=!1,o=r+2;for(let r=t;r<n;r++){let t=e[r];if(t.type===`paragraph_open`&&t.level===o&&(t.hidden?i=!0:a=!0,i&&a))return`loose`}return a?`loose`:i?`tight`:`none`}setListParagraphVisibility(e,t,n,r,i){let a=r+2;for(let r=t;r<n;r++){let t=e[r];(t.type===`paragraph_open`||t.type===`paragraph_close`)&&t.level===a&&(t.hidden=i)}}shouldPreferTailReparseForAppend(e,t){let n=this.ensureLastSegment(e);if(!n)return!1;let r=e.tokens[n.tokenStart];if(!this.tokenMapsTrusted)return t;switch(r?.type){case`bullet_list_open`:case`ordered_list_open`:case`blockquote_open`:case`table_open`:return!0;case`paragraph_open`:case`code_block`:case`html_block`:return!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src));default:return r?.nesting===1}}endsWithBlankLine(e){let t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){let t=e.charCodeAt(n);if(t===32||t===9){n--;continue}return t===10}return!0}ensureBoundaryState(e){if(e.boundary)return e.boundary;let t=e.src,n=t.length,r=n>0&&t.charCodeAt(n-1)===10,i=r?n-1:n,a=i-1;for(;a>=0&&t.charCodeAt(a)!==10;)a--;let o=!1;for(let e=a+1;e<i;e++){let n=t.charCodeAt(e);if(n!==32&&n!==9){o=!0;break}}return e.boundary={currentLineNonBlank:!r&&o,previousLineNonBlank:r?o:!1,endsWithNewline:r,endsWithBlankLine:this.endsWithBlankLine(t)},e.boundary}updateBoundaryStateForAppend(e,t){let n=this.ensureBoundaryState(e),r=n.currentLineNonBlank,i=n.previousLineNonBlank;for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);n===10?(i=r,r=!1):n!==32&&n!==9&&(r=!0)}n.currentLineNonBlank=r,n.previousLineNonBlank=i,n.endsWithNewline=t.length>0?t.charCodeAt(t.length-1)===10:n.endsWithNewline,n.endsWithBlankLine=e.src.length+t.length>=2&&n.endsWithNewline&&!i}getDocLineCount(e,t=of(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}getCachedDocLineCount(e,t){return e.src.length===0?0:e.boundary?e.boundary.endsWithNewline?t:t+1:this.getDocLineCount(e.src,t)}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let r=0;r<e.length;r++){let i=e[r];if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children){n??=[];for(let e=i.children.length-1;e>=0;e--)n.push(i.children[e]);for(;n.length>0;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}}}},Pv={default:$_,zero:ev,commonmark:Q_};function Fv(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function Iv(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function Lv(e){return e.experimental?{...e,...e.experimental}:e}function Rv(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;let n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function zv(e,t,n){for(let r=0;r<n.length;r++){let i=n[r];if(Rv(t,i)||Rv(e,i))return!0}return!1}function Bv(e,t,n){return Rv(t,n)||Rv(e,n)}function Vv(e,t){let n=Mf(e)?.chunk;if(n?.fallback){If(e,{area:`parse`,path:`plain`,reason:`global-state:${n.fallbackReason||`unknown`}`});return}If(e,{area:`parse`,path:`full-chunk`,chunked:!0,reason:t})}function Hv(){return typeof performance<`u`?performance.now():Date.now()}function Uv(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamTailLocalPostBlockRules:!1,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:`retain`,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},r=`default`,i;!t&&typeof e!=`string`?(i=e,r=`default`):typeof e==`string`&&(r=e,i=t);let a=Pv[r];if(!a)throw Error(`Wrong \`markdown-it\` preset "${r}", check name`);if(a?.options&&(n={...n,...a.options}),i&&(n={...n,...i}),n=Lv(n),typeof n.quotes==`string`){let e=n.quotes;e.length>=4?n.quotes=[e[0],e[1],e[2],e[3]]:n.quotes=[`“`,`”`,`‘`,`’`]}let o=zv(a?.options,i,[`fullChunkSizeChars`,`fullChunkSizeLines`,`fullChunkMaxChunks`]),s=zv(a?.options,i,[`streamChunkSizeChars`,`streamChunkSizeLines`,`streamChunkMaxChunks`]),c=Bv(a?.options,i,`fullChunkedFallback`),l=Bv(a?.options,i,`streamChunkedFallback`),u=!1,d=null,f=null,p=new hg,m=null,h=()=>(m||=new xv(n),m),g=null,_=()=>(g||=new Nv(p),g),v=null,y=()=>(v||=new Zf({fuzzyLink:!0}),v),b=e=>!u&&!!d&&!Iv(e,d),x=(e,t)=>r==="default"&&!u&&m===null&&f!==null&&e.parse===f&&b(e)&&!e.stream.enabled&&t<(e.options.autoUnboundedThresholdChars??4e6)&&e.options.html===!1&&e.options.xhtmlOut===!1&&e.options.breaks===!1&&e.options.langPrefix===`language-`&&e.options.linkify===!1&&e.options.typographer===!1&&e.options.highlight===null,S=(e,t)=>r==="default"&&!u&&b(e)&&!e.stream.enabled&&!e.options.fullChunkedFallback&&t<(e.options.autoUnboundedThresholdChars??4e6)&&e.options.html===!1&&e.options.linkify===!1&&e.options.typographer===!1,C={core:p,block:p.block,inline:p.inline,get linkify(){let e=y();return Object.defineProperty(this,"linkify",{value:e,writable:!0,configurable:!0}),e},get renderer(){let e=h();return Object.defineProperty(this,"renderer",{value:e,writable:!0,configurable:!0}),e},options:n,__explicitFullChunkConfig:o,__explicitStreamChunkConfig:s,__explicitFullChunkFallbackSetting:c,__explicitStreamChunkFallbackSetting:l,__canUseImplicitLargeInputStrategy(){return b(this)},set(e){let t=Lv(e);return this.options={...this.options,...t},(Rv(e,`fullChunkSizeChars`)||Rv(e,`fullChunkSizeLines`)||Rv(e,`fullChunkMaxChunks`))&&(o=!0,this.__explicitFullChunkConfig=!0),(Rv(e,`streamChunkSizeChars`)||Rv(e,`streamChunkSizeLines`)||Rv(e,`streamChunkMaxChunks`))&&(s=!0,this.__explicitStreamChunkConfig=!0),Rv(e,`fullChunkedFallback`)&&(c=!0,this.__explicitFullChunkFallbackSetting=!0),Rv(e,`streamChunkedFallback`)&&(l=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(t),typeof t.stream==`boolean`&&(this.stream.enabled=t.stream,g&&(g.reset(),g.resetStats())),this},configure(e){let t=typeof e==`string`?Pv[e]:e;if(!t)throw Error("Wrong `markdown-it` preset, can't be empty");if(t.options&&this.set(t.options),t.components){let e=t.components;e.core?.rules&&this.core.ruler.enableOnly(e.core.rules),e.block?.rules&&this.block.ruler.enableOnly(e.block.rules),e.inline?.rules&&this.inline.ruler.enableOnly(e.inline.rules),e.inline2?.rules&&this.inline.ruler2.enableOnly(e.inline2.rules)}return this},enable(e,t){let n=Array.isArray(e)?e:[e],r=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],i=new Set;for(let e of r){if(!e)continue;let t=e.enable(n,!0);for(let e=0;e<t.length;e++)i.add(t[e])}if(!t){let e=n.filter(e=>!i.has(e));if(e.length)throw Error(`Rules manager: invalid rule name ${e.join(`, `)}`)}return this},disable(e,t){let n=Array.isArray(e)?e:[e],r=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],i=new Set;for(let e of r){if(!e)continue;let t=e.disable(n,!0);for(let e=0;e<t.length;e++)i.add(t[e])}if(!t){let e=n.filter(e=>!i.has(e));if(e.length)throw Error(`Rules manager: invalid rule name ${e.join(`, `)}`)}return this},use(e,...t){let n=typeof e==`function`?e:e&&typeof e.default==`function`?e.default:void 0;if(!n)throw TypeError(`MarkdownIt.use: plugin must be a function`);let r=[this,...t],i=e;return u=!0,n.apply(i,r),this},render(e,t){let n;if(x(this,e.length)){t!==void 0&&(Pf(t),n=kf(`render`));let r=n?Hv():0,i=n?m_(e,n):p_(e);if(n&&(n.attemptMs=Hv()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),Ff(t,n)),i!==null)return t!==void 0&&If(t,{area:`render`,path:`stock-fast`,reason:`stock-subset`}),i}let r=t??{},i=this.parse(e,r);return n&&Ff(r,n),h().render(i,this.options,r)},async renderAsync(e,t){let n;if(x(this,e.length)){t!==void 0&&(Pf(t),n=kf(`render`));let r=n?Hv():0,i=n?m_(e,n):p_(e);if(n&&(n.attemptMs=Hv()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),Ff(t,n)),i!==null)return t!==void 0&&If(t,{area:`render`,path:`stock-fast`,reason:`stock-subset`}),i}let r=t??{},i=this.parse(e,r);return n&&Ff(r,n),h().renderAsync(i,this.options,r)},renderIterable(e,t={}){let n=this.parseIterable(e,t);return h().render(n,this.options,t)},async renderAsyncIterable(e,t={}){let n=await this.parseAsyncIterable(e,t);return h().renderAsync(n,this.options,t)},renderInline(e,t={}){let n=this.parseInline(e,t);return h().render(n,this.options,t)},validateLink:yh,normalizeLink:bh,normalizeLinkText:xh,utils:Od,helpers:{...fp},parse(e,t){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);if(t!==void 0&&Pf(t),S(this,e.length)){let n=t===void 0?void 0:kf(`parse`),r=n?Hv():0,i=Rg(e,n);if(n&&(n.attemptMs=Hv()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),Ff(t,n)),i!==null)return t!==void 0&&If(t,{area:`parse`,path:`stock-fast`,reason:`stock-subset`}),i}let n=t??{},r;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){let i=U_(this,e.length);if(i===`yes`){let r=W_(this,e,n);return If(t,{area:`parse`,path:`auto-unbounded`,unbounded:!0,reason:`char-threshold`}),r}i===`need-lines`&&(r=of(e))}if(!this.stream.enabled){let i=e.length,a=this.options.autoTuneChunks!==!1,s=o,l=!c&&b(this),u=!!this.options.fullChunkedFallback,d=l&&i>=2e5,f;(u||d||r!==void 0)&&(f=r??of(e));let p=(u||d)&&a&&!s?X_(i,f,this.options):null;if(u||d){let r=f??0;if(u?i>=(this.options.fullChunkThresholdChars??2e4)||r>=(this.options.fullChunkThresholdLines??400):d){if(p&&p.strategy!==`plain`){let r=g_(this,e,n,{maxChunkChars:p.maxChunkChars,maxChunkLines:p.maxChunkLines,fenceAware:p.fenceAware,maxChunks:p.maxChunks});return t&&Vv(t,u?`explicit-full-chunk`:`default-large-string`),r}if(u){let a=(e,t,n)=>e<t?t:e>n?n:e,o=this.options.fullChunkAdaptive!==!1,s=this.options.fullChunkTargetChunks??8,c=a(Math.ceil(i/s),8e3,64e3),l=a(Math.ceil(r/s),150,700),u=o?c:this.options.fullChunkSizeChars??1e4,d=o?l:this.options.fullChunkSizeLines??200,f=o?a(Math.ceil(i/64e3),s,32):this.options.fullChunkMaxChunks,p=g_(this,e,n,{maxChunkChars:u,maxChunkLines:d,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:f});return t&&Vv(t,`explicit-full-chunk`),p}}}if(r!==void 0&&b(this)&&H_(this,i,f??r)){let r=W_(this,e,n);return If(t,{area:`parse`,path:`auto-unbounded`,unbounded:!0,reason:`line-threshold`}),r}}let i=Cf(e);return If(t,{area:`parse`,path:`plain`,reason:`default-plain`}),Tf(n,i,()=>p.parse(e,n,this).tokens)},parseIterable(e,t={}){return Pf(t),R_(this,e,t)},parseAsyncIterable(e,t={}){return Pf(t),z_(this,e,t)},parseIterableToSink(e,t,n={}){return Pf(n),B_(this,e,t,n)},parseAsyncIterableToSink(e,t,n={}){return Pf(n),V_(this,e,t,n)},parseInline(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);Pf(t),wf(t)&&Of(t);let n=p.createState(e,t,this);return n.inlineMode=!0,p.process(n),n.tokens}};if(C.stream={enabled:!!n.stream,parse(e,t){return C.stream.enabled?_().parse(e,t,C):C.parse(e,t??{})},append(e,t){if(!C.stream.enabled)throw Error(`Stream append requires stream mode`);return _().append(e,t,C)},snapshot(){return g?g.snapshot():null},restore(e){if(!C.stream.enabled)throw Error(`Stream restore requires stream mode`);return _().restore(e,C)},reset(){_().reset()},hasCache(){return g?.hasCache()??!1},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:`idle`}},resetStats(){g&&g.resetStats()}},a?.components){let e=a.components;e.core?.rules&&C.core.ruler.enableOnly(e.core.rules),e.block?.rules&&C.block.ruler.enableOnly(e.block.rules),e.inline?.rules&&C.inline.ruler.enableOnly(e.inline.rules),e.inline2?.rules&&C.inline.ruler2.enableOnly(e.inline2.rules)}return d=Fv(C),f=C.parse,C}var Wv=Uv,Gv=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Kv=`a.abbr.b.bdi.bdo.button.cite.code.data.del.dfn.em.font.i.ins.kbd.label.mark.q.s.samp.small.span.strong.sub.sup.time.u.var`.split(`.`),qv=`article.aside.blockquote.details.div.figcaption.figure.footer.header.h1.h2.h3.h4.h5.h6.li.main.nav.ol.p.pre.section.summary.table.tbody.td.th.thead.tr.ul`.split(`.`),Jv=[`svg`,`g`,`path`],Yv=`address.audio.body.canvas.caption.colgroup.datalist.dd.dialog.dl.dt.fieldset.form.head.hgroup.html.iframe.legend.map.menu.meter.noscript.object.optgroup.option.output.picture.progress.rp.rt.ruby.script.select.style.template.textarea.tfoot.title.video`.split(`.`),Xv=`onclick.onerror.onload.onmouseover.onmouseout.onmousedown.onmouseup.onkeydown.onkeyup.onfocus.onblur.onsubmit.onreset.onchange.onselect.ondblclick.ontouchstart.ontouchend.ontouchmove.ontouchcancel.onwheel.onscroll.oncopy.oncut.onpaste.oninput.oninvalid.onsearch.innerhtml.outerhtml.textcontent.innertext.srcdoc.ping`.split(`.`),Zv=[`action`,`data`,`href`,`src`,`srcset`,`poster`,`xlink:href`,`formaction`],Qv=[`script`],$v=[`pre`,`iframe`,`picture`,`script`,`style`,`table`,`tbody`,`td`,`tfoot`,`th`,`thead`,`textarea`,`tr`,`title`,`video`],ey=new Set(Gv),ty=new Set(qv),ny=new Set([...Gv,...Kv,...qv,...Jv]);[...ny,...Yv];var ry=new Set(Xv),iy=new Set(Zv),ay=new Set(Qv),oy=new Set($v);function sy(e){let t=``;for(let n of e){let e=n.charCodeAt(0);e<=31||e>=127&&e<=159||/\s/u.test(n)||(t+=n)}return t}var cy={amp:`&`,bsol:`\\`,colon:`:`,newline:`
73
+ `,sol:`/`,tab:` `};function ly(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(e,t,n,r)=>{let i=t??n;if(i){let e=Number.parseInt(i,t?10:16);try{return Number.isFinite(e)?String.fromCodePoint(e):``}catch{return``}}return cy[String(r??``).toLowerCase()]??e})}var uy=new Set([`http`,`https`,`mailto`,`tel`]),dy=new Set([`javascript`,`vbscript`,`data`,`file`,`ftp`,`blob`,`filesystem`,`intent`,`chrome`,`chrome-extension`,`moz-extension`,`ms-browser-extension`,`view-source`]),fy=new Set([`http`,`https`]);function py(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??``}var my=/^https?:\/\//i;function hy(e){if(!my.test(e))return!1;for(let t of e){let e=t.charCodeAt(0);if(t===`&`||e<=32||e>=127&&e<=159||e>127&&/\s/u.test(t))return!1}return!0}function gy(e,t,n){if(!_y(t,n)||!e.startsWith(`file:///`))return!1;let r=e.charAt(8);return r!==`/`&&r!==`\\`}function _y(e,t){return e?(e===`a`||e===`area`)&&(!t||t===`href`||t===`xlink:href`):!t||t===`href`}function vy(e,t){return t===`href`||t===`xlink:href`?_y(e,t)?uy:fy:t===`src`||t===`srcset`||t===`poster`||t===`action`||t===`formaction`||t===`data`?fy:uy}function yy(e,t={}){if(hy(e))return!1;let n=sy(ly(e)).toLowerCase(),r=String(t.tagName??``).toLowerCase(),i=String(t.attrName??``).toLowerCase();if(!n)return!1;if(n.startsWith(`data:`)){let e=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return r===`img`&&i===`src`?!e:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith(`/`)||n.startsWith(`./`)||n.startsWith(`../`)||n.startsWith(`#`)||n.startsWith(`?`))return!1;let a=py(n);return a?a===`file`?!gy(n,r,i):_y(r,i)?dy.has(a):!vy(r,i).has(a):!1}function by(e){let t=ly(String(e??``)).trim();if(!t||t.startsWith(`#`)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`?`))return!1;let n=py(sy(t).toLowerCase());return n===`http`||n===`https`}function xy(e,t={}){let n=String(e??``).trim();return n?yy(n,t)?``:n:``}function Sy(e){return xy(e,{tagName:`img`,attrName:`src`})}function Cy(e,t,n){function r(e){return e.trim().split(` `,2)[0]===t}function i(e,n,r,i,a){return e[n].nesting===1&&e[n].attrJoin(`class`,t),a.renderToken(e,n,r,i,a)}n||={};let a=n.marker||`:`,o=a.charCodeAt(0),s=a.length,c=n.validate||r,l=n.render||i;function u(e,n,r,i){let l,u=!1,d=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(o!==e.src.charCodeAt(d))return!1;for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);let p=Math.floor((l-d)/s);if(p<3)return!1;l-=(l-d)%s;let m=e.src.slice(d,l),h=e.src.slice(l,f);if(!c(h,m))return!1;if(i)return!0;let g=n;for(;g++,!(g>=r||(d=e.bMarks[g]+e.tShift[g],f=e.eMarks[g],d<f&&e.sCount[g]<e.blkIndent));)if(o===e.src.charCodeAt(d)&&!(e.sCount[g]-e.blkIndent>=4)){for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);if(!(Math.floor((l-d)/s)<p)&&(l-=(l-d)%s,l=e.skipSpaces(l),!(l<f))){u=!0;break}}let _=e.parentType,v=e.lineMax;e.parentType=`container`,e.lineMax=g;let y=e.push(`container_`+t+`_open`,`div`,1);y.markup=m,y.block=!0,y.info=h,y.map=[n,g],e.md.block.tokenize(e,n+1,g);let b=e.push(`container_`+t+`_close`,`div`,-1);return b.markup=e.src.slice(d,l),b.block=!0,e.parentType=_,e.lineMax=v,e.line=g+ +!!u,!0}e.block.ruler.before(`fence`,`container_`+t,u,{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.renderer.rules[`container_`+t+`_open`]=l,e.renderer.rules[`container_`+t+`_close`]=l}function wy(e){let t=String(e??``).trim();if(!t.startsWith(`{`)||!t.endsWith(`}`))return null;let n=t.slice(1,-1).trim();if(!n)return{};if(n.includes(`{`)||n.includes(`[`)||n.includes(`]`))return null;let r=[],i=``,a=!1,o=!1;for(let e=0;e<n.length;e++){let t=n[e];if(t===`\\`){i+=t,e+1<n.length&&(i+=n[e+1],e++);continue}if(!o&&t===`'`){a=!a,i+=t;continue}if(!a&&t===`"`){o=!o,i+=t;continue}if(!a&&!o&&t===`,`){r.push(i.trim()),i=``;continue}i+=t}i.trim()&&r.push(i.trim());let s={};for(let e of r){if(!e)continue;let t=!1,n=!1,r=-1;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`){i++;continue}if(!n&&a===`'`){t=!t;continue}if(!t&&a===`"`){n=!n;continue}if(!t&&!n&&a===`:`){r=i;break}}if(r===-1)return null;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();if(!i)return null;let o=i;if(o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`))try{o=JSON.parse(o.replace(/^'/,`"`).replace(/'$/,`"`))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(o))return null;let c;if(!a)c=``;else if(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))try{c=JSON.parse(a.replace(/^'/,`"`).replace(/'$/,`"`))}catch{c=a}else c=/^-?\d+(?:\.\d+)?$/.test(a)?Number(a):a===`true`||a===`false`?a===`true`:a===`null`?null:a;s[o]=c}return s}function Ty(e,t,n){for(let r of e){let e=r,i=e.map;if(Array.isArray(i)&&i.length>=2){let r=Number(i[0]),a=Number(i[1]);Number.isFinite(r)&&Number.isFinite(a)&&(e.map=[r+t,Math.min(a+t,n)])}Array.isArray(e.children)&&Ty(e.children,t,n)}}function Ey(e){[`admonition`,`info`,`warning`,`error`,`tip`,`danger`,`note`,`caution`].forEach(t=>{e.use(Cy,t,{render(e,n){return e[n].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
74
+ `}})}),e.block.ruler.before(`fence`,`vmr_container_fallback`,(e,t,n,r)=>{let i=e,a=i.bMarks[t]+i.tShift[t],o=i.eMarks[t],s=i.src.slice(a,o),c=s.match(/^:::\s*([^\s{]+)/);if(!c)return!1;let l=c[1];if(!l.trim())return!1;let u=s.slice(c[0].length).trim(),d,f,p=u.indexOf(`{`),m=p>=0?u.slice(p).trimStart():void 0;if(p===-1)d=u||void 0;else{if(d=u.slice(0,p).trim()||void 0,m?.startsWith(`{`)){let e=0,t=-1;for(let n=0;n<m.length;n++)if(m[n]===`{`?e++:m[n]===`}`&&e--,e===0){t=n+1;break}t>0&&(f=m.slice(0,t))}f||(d=u||void 0)}if(r)return!0;let h=!!i.env.__markstreamFinal,g=t+1,_=!1;for(;g<=n;){let e=i.bMarks[g]+i.tShift[g],t=i.eMarks[g];if(i.src.slice(e,t).trim()===`:::`){_=!0;break}g++}_||(g=n);let v=i.push(`vmr_container_open`,`div`,1);if(v.attrSet(`class`,`vmr-container vmr-container-${l}`),v.map=[t,_?g:n],v.meta={...v.meta??{},unclosed:!_&&!h},d&&v.attrSet(`data-args`,d),f)try{let e=JSON.parse(f);for(let[t,n]of Object.entries(e)){let e=typeof n==`object`&&!!n;v.attrSet(`data-${t}`,e?JSON.stringify(n):String(n))}}catch{let e=wy(f);if(e)for(let[t,n]of Object.entries(e)){let e=typeof n==`object`&&!!n;v.attrSet(`data-${t}`,e?JSON.stringify(n):String(n))}else v.attrSet(`data-attrs`,f)}let y=[];for(let e=t+1;e<g;e++){let t=i.bMarks[e]+i.tShift[e],n=i.eMarks[e];y.push(i.src.slice(t,n))}if(y.some(e=>e.trim().length>0)){let e=y.join(`
75
+ `);e.endsWith(`
76
+ `)||(e+=`
77
+ `),e.endsWith(`
78
+
79
+ `)||(e+=`
80
+ `);let n=i.tokens[i.tokens.length-1];n&&(n.raw=e);let r=[];i.md.block.parse(e,i.md,i.env,r),Ty(r,t+1,t+1+y.length),i.tokens.push(...r)}let b=i.push(`vmr_container_close`,`div`,-1);return _||(b.hidden=!0,b.map=[n,n]),i.line=_?g+1:g,!0},{alt:[`paragraph`,`reference`,`blockquote`,`list`]})}function Dy(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Oy(e,t=0){let n=!1,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`\\`){i++;continue}if(!r&&t===`'`){n=!n;continue}if(!n&&t===`"`){r=!r;continue}if(!n&&!r&&t===`>`)return i}return-1}function ky(e){let t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r;for(;(r=n.exec(e))!==null;){let e=r[1];if(!e)continue;let n=r[2]||r[3]||r[4]||``;t.push([e,n])}return t}var Ay=/^[a-z][a-z0-9_-]*$/;function jy(e){return Ay.test(String(e??``).trim().toLowerCase())}function My(e){let t=String(e??``).trim();if(!t)return``;if(!t.startsWith(`<`))return jy(t)?t.toLowerCase():``;let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]===`/`)for(n++;n<t.length&&/\s/.test(t[n]);)n++;let r=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;let i=t.slice(r,n).toLowerCase(),a=t[n]??``;return a&&!/[\s/>]/.test(a)?``:jy(i)?i:``}function Ny(e){if(!e||e.length===0)return[];let t=new Set,n=[];for(let r of e){let e=My(r);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function Py(e){return My(e)}function Fy(e,t){let n=String(e??``),r=My(t);if(!r)return!1;let i=Dy(r),a=n.match(new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?(\s*\/)?>`,`i`));return a?a[1]?!0:new RegExp(String.raw`<\s*\/\s*${i}\s*>`,`i`).test(n):!1}function Iy(e,t){let n=String(e??``),r=My(t);if(!r)return n;let i=Dy(r),a=new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?>\s*`,`i`),o=new RegExp(String.raw`\s*<\s*\/\s*${i}\s*>\s*$`,`i`);return n.replace(a,``).replace(o,``)}var Ly=ey,Ry=ny,zy=new Set(ty);zy.delete(`details`);var By=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Vy=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Hy=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,Uy=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Wy(e){return(e.match(Hy)?.[1]??``).toLowerCase()}function Gy(e){return/^\s*<\s*\//.test(e)}function Ky(e,t){return Ly.has(t)||/\/\s*>\s*$/.test(e)}function qy(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(!i||i.type!==`html_inline`)continue;let a=String(i.content??``),o=Wy(a);if(o===t){if(Gy(a)){if(n===0)return r;n--;continue}Ky(a,o)||n++}}return-1}function Jy(e,t){let n=0;for(let r of e){if(!r||r.type!==`html_inline`)continue;let e=String(r.content??``),i=Wy(e);if(i===t){if(Gy(e)){n>0&&n--;continue}Ky(e,i)||n++}}return n}function Yy(e,t,n=0){let r=new RegExp(String.raw`<\s*(\/?)\s*${Dy(t)}(?=[\s>/])[^>]*>`,`gi`);r.lastIndex=Math.max(0,n);let i=0,a;for(;(a=r.exec(e))!==null;){let e=a[0]??``,t=!!a[1],n=!t&&/\/\s*>$/.test(e);if(t){if(i===0)return{start:a.index,end:a.index+e.length};i--;continue}n||i++}return null}function Xy(e,t){let n=new RegExp(String.raw`<\s*(\/?)\s*${Dy(t)}(?=[\s>/])[^>]*>`,`gi`),r=0,i;for(;(i=n.exec(e))!==null;){let e=i[0]??``,t=!!i[1],n=!t&&/\/\s*>$/.test(e);if(t){r>0&&r--;continue}n||r++}return r}function Zy(e){let t=e;return String(t.raw??t.content??t.markup??``)}function Qy(e){let t=e;return t.meta||={},t.meta}function $y(e,t,n){let r=Qy(e);r.markstreamCustomHtmlRaw=t,r.markstreamCustomHtmlInner=n}function eb(e,t){if(!t.size)return;let n=Array.from(t,e=>new RegExp(String.raw`<\s*${Dy(e)}(?=[\s>/])`,`i`)),r=[],i=!1,a=e=>e?n.some(t=>t.test(e)):!1,o=e=>{if(e&&r.length)for(let t of r)t.raw+=e,t.inner+=e},s=()=>{r.length&&i&&(o(`
81
+ `),i=!1)},c=e=>{o(e)},l=e=>{for(let t=0;t<r.length;t++)r[t].raw+=e,t<r.length-1&&(r[t].inner+=e);let t=r.pop();$y(t.token,t.raw,t.inner)},u=e=>{let t=r[r.length-1]?.tag;if(!t)return null;let n=new RegExp(String.raw`^\s*<\s*\/\s*${Dy(t)}\s*>`,`i`);return e.match(n)?.[0]??null},d=e=>!!u(e),f=(e,n,i)=>{let a=i??(e.type===`html_inline`?Wy(n):``);if(!(a&&t.has(a))){o(n);return}let s=Gy(n),c=!s&&Ky(n,a);if(s){if(!r.length||r[r.length-1].tag!==a){o(n);return}l(n);return}if(o(n),c){$y(e,n,``);return}r.push({tag:a,token:e,raw:n,inner:``})};for(let n of e){if(n.type===`inline`&&Array.isArray(n.children)){let e=String(n.content??``);if(d(e)?i=!1:s(),!r.length&&!a(e)){i=!1;continue}let o=0,l=!0;for(let i of n.children){let n=Zy(i),a=i.type===`html_inline`?Wy(n):``,s=a&&t.has(a),u=n;if(l&&e&&n&&(r.length||s)){let t=e.indexOf(n,o);if(t!==-1)c(e.slice(o,t)),u=e.slice(t,t+n.length),o=t+n.length;else{if(r.length&&!s)continue;l=!1}}f(i,u,a)}l&&e&&o<e.length&&r.length&&c(e.slice(o)),i=r.length>0;continue}if(r.length&&typeof n.content==`string`){let e=Zy(n),t=n.type===`html_block`?u(e):null;if(t){l(`${i?`
82
+ `:``}${t}`),i=r.length>0;continue}if(!n.content)continue;s(),o(n.content),i=!0}}for(let e of r)$y(e.token,e.raw,e.inner)}function tb(e){return/^\s*<\s*[!?]/.test(e)}function nb(e){let t=new Set(Ry);if(e&&Array.isArray(e))for(let n of e){let e=String(n??``).trim();if(!e)continue;let r=e.match(/^[<\s/]*([A-Z][\w-]*)/i);r&&t.add(r[1].toLowerCase())}return t}function rb(e,t){if(t.has(e))return!0;for(let n of t)if(n.startsWith(e))return!0;return!1}function ib(e,t){let n=null;for(let r of e.matchAll(By)){let i=r.index??-1;if(i<0)continue;let a=(r[1]??``).toLowerCase();rb(a,t)&&Oy(e.slice(i))===-1&&(!n||i<n.index)&&(n={index:i,tag:a,closing:!1})}for(let r of e.matchAll(Vy)){let i=r.index??-1;if(i<0)continue;let a=(r[1]??``).toLowerCase();rb(a,t)&&Oy(e.slice(i))===-1&&(!n||i<n.index)&&(n={index:i,tag:a,closing:!0})}let r=/<\/\s*$/.exec(e);if(r&&typeof r.index==`number`){let t=r.index;!e.slice(t).includes(`>`)&&(!n||t<n.index)&&(n={index:t,tag:``,closing:!0})}let i=/<\s*$/.exec(e);if(i&&typeof i.index==`number`){let t=i.index,r=e.slice(t);!r.startsWith(`</`)&&!r.includes(`>`)&&(!n||t<n.index)&&(n={index:t,tag:``,closing:!1})}return n}function ab(e,t){let n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:`text`,content:t,raw:t})}function ob(e,t){if(!e.length)return{children:e};let n=[],r=null,i=null;function a(e,t){e&&(t?n.push(ab(t,e)):n.push({type:`text`,content:e,raw:e}))}function o(e,r){let i=0;for(;i<e.length;){let o=e.indexOf(`<`,i);if(o===-1){a(e.slice(i),r);break}a(e.slice(i,o),r);let s=e.slice(o),c=s.match(Hy);if(!c){a(`<`,r),i=o+1;continue}let l=Oy(s);if(l===-1){a(`<`,r),i=o+1;continue}let u=s.slice(0,l+1),d=(c[1]??``).toLowerCase();t.has(d)?n.push({type:`html_inline`,tag:``,content:u,raw:u}):a(u,r),i=o+u.length}}function s(e,n){if(!e)return;let a=ib(e,t);if(!a){o(e,n);return}let s=e.slice(0,a.index);s&&o(s,n),r={tag:a.tag,buffer:e.slice(a.index),closing:a.closing},i=r.buffer}for(let a of e){if(r){r.buffer+=Zy(a),i=r.buffer;let e=Oy(r.buffer);if(e===-1)continue;let t=r.buffer.slice(0,e+1),o=r.buffer.slice(e+1);n.push({type:`html_inline`,tag:``,content:t,raw:t}),r=null,i=null,o&&s(o);continue}if(a.type===`html_inline`){let e=Zy(a),n=(e.match(Hy)?.[1]??``).toLowerCase();if(n&&t.has(n)&&Oy(e)===-1){r={tag:n,buffer:e,closing:/^<\s*\//.test(e)},i=r.buffer;continue}}if(a.type===`text`){let e=String(a.content??``);if(!e.includes(`<`)){n.push(a);continue}s(e,a);continue}n.push(a)}return{children:n,pendingBuffer:i??void 0}}var sb=[`a`,`span`,`strong`,`em`,`b`,`i`,`u`];function cb(e,t={}){let n=new Set;if(t.customHtmlTags?.length)for(let e of t.customHtmlTags){let t=My(e);t&&n.add(t)}let r=e=>{let t=e,r=new Set(n),i=Array.isArray(t.env?.__markstreamCustomHtmlTags)?t.env.__markstreamCustomHtmlTags:[];for(let e of i){let t=My(String(e??``));t&&r.add(t)}let a=nb(Array.from(r)),o=new Set(sb);for(let e of r)o.add(e);return{autoCloseInlineTagSet:o,commonHtmlTags:a,customTagSet:r,shouldMergeHtmlBlockTag:e=>r.has(e)||!a.has(e)||zy.has(e)}},i=e=>{if(e.type===`html_block`)return String(e.content??``);if(e.type!==`inline`||!Array.isArray(e.children)||e.children.length!==1)return``;let t=e.children[0];return t?.type===`html_block`?String(e.content??t.content??``):``},a=(e,t)=>{e.type=`html_block`,e.content=t,e.raw=t,e.children=[]},o=e=>e.replace(/^(?:\r?\n)+/,``),s=e=>/^(?: {4}|\t)/.test(e),c=e=>e.replace(/^(?: {4}|\t)/gm,``),l=(e,t)=>{let n=o(e);if(!/\S/.test(n))return[];if(s(n))return[{type:`code_block`,content:c(n),raw:n}];let r=n.replace(/^[\t ]+/,``);if(!r)return[];if(r.startsWith(`<`))return[{type:`html_block`,content:r}];let i={type:`inline`,tag:``,nesting:0,content:r,children:[{type:`text`,content:r,raw:r}]};return t===`paragraph`?[{type:`paragraph_open`,tag:`p`,nesting:1},i,{type:`paragraph_close`,tag:`p`,nesting:-1}]:t===`text`?[{type:`text`,content:r,raw:r}]:[i]},u=(e,t,n)=>e[t-1]?.type===`paragraph_open`&&e[t+1]?.type===`paragraph_close`?`inline`:n,d=(e,t)=>{let n=o(t);return!/\S/.test(n)||e.type!==`inline`||!Array.isArray(e.children)?!1:(e.content=`${String(e.content??``)}${n}`,e.children.push({type:`text`,content:n,raw:n}),!0)};e.core.ruler.after(`inline`,`fix_html_inline_streaming`,e=>{let t=e.tokens??[],{commonHtmlTags:n,customTagSet:i}=r(e);for(let e of t){let t=e;if(t.type!==`inline`||!Array.isArray(t.children))continue;let r=String(t.content??``),i=t.children.length?t.children:r.includes(`<`)?[{type:`text`,content:r,raw:r}]:null;if(i)try{let e=ob(i,n);if(t.children=e.children,e.pendingBuffer){let n=r.lastIndexOf(e.pendingBuffer);if(n!==-1){let e=r.slice(0,n);t.content=e,typeof t.raw==`string`&&(t.raw=e)}}}catch(e){console.error(`[applyFixHtmlInlineTokens] failed to fix streaming html inline`,e)}}eb(t,i)}),e.core.ruler.push(`fix_html_inline_tokens`,e=>{let t=e.tokens??[],{autoCloseInlineTagSet:n,customTagSet:o,shouldMergeHtmlBlockTag:s}=r(e),c=[];for(let e=0;e<t.length;e++){let n=t[e];if(c.length>0){let[r,i]=c[c.length-1];if(e!==i){if(n.type===`paragraph_open`||n.type===`paragraph_close`){t.splice(e,1),e--;continue}let a=String(n.content??n.raw??``);if(a){let n=t[i],o=`${String(n.content||``)}\n${a}`,s=Oy(o),f=s===-1?null:Yy(o,r,s+1);if(f){let r=o.slice(0,f.end),i=o.slice(f.end);n.content=r,n.loading=!1,t.splice(e,1),c.pop();let a=d(n,i)?[]:l(i,u(t,e,`paragraph`));a.length&&t.splice(e,0,...a),e--;continue}n.content=o,n.loading!==!1&&(n.loading=!0)}t.splice(e,1),e--;continue}}let r=i(n);if(r){if(tb(r))continue;let i=(r.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??``).toLowerCase(),o=/^\s*<\s*\//.test(r);if(!i||!s(i))continue;if(a(n,r),!o)i&&!RegExp(`^\\s*<\\s*${i}\\b[^>]*\\/\\s*>`,`i`).test(r)&&Xy(r,i)>0&&c.push([i,e]);else if(c.length>0&&i&&c[c.length-1][0]===i){let[,n]=c[c.length-1],i=t[n];i.content=`${String(i.content||``)}\n${r}`,i.loading=!1,c.pop(),t.splice(e,1),e--}continue}if(c.length>0){if(n.type===`paragraph_open`||n.type===`paragraph_close`){t.splice(e,1),e--;continue}let r=n.content||``,i=RegExp(`<\\s*\\/\\s*${c[c.length-1][0]}\\s*>`,`i`).test(r);if(r){let[,e]=c[c.length-1],n=t[e];n.content=`${n.content||``}\n${r}`,n.loading!==!1&&(n.loading=!i)}i&&c.pop(),t.splice(e,1),e--}else continue}if(o.size>0){let e=new Map,n=new Map,r=t=>{let n=e.get(t);return n||(n=RegExp(`<\\s*${t}\\b`,`i`),e.set(t,n)),n},i=e=>{let t=n.get(e);return t||(t=RegExp(`<\\s*\\/\\s*${e}\\s*>`,`i`),n.set(e,t)),t},a=[];for(let e=0;e<t.length;e++){let n=t[e],s=String(n.content??``);if(a.length>0){let r=a[a.length-1],o=t[r.index],c=n.type===`html_block`?i(r.tag).exec(s):null;if(c){let n=c.index+c[0].length,i=s.slice(0,n),f=s.slice(n);o.content=`${String(o.content??``)}\n${i}`,Array.isArray(o.children)&&o.children.push({type:`html_inline`,content:`</${r.tag}>`,raw:`</${r.tag}>`}),a.pop();let p=d(o,f)?[]:l(f,u(t,e,`paragraph`));p.length?t.splice(e,1,...p):(t.splice(e,1),e--);continue}if(n.type!==`inline`)continue;let f=Array.isArray(n.children)?n.children:[],p=qy(f,r.tag);if(p!==-1){let n=f.slice(0,p+1),r=f.slice(p+1),i=n.map(e=>String(e?.content??e?.raw??``)).join(``);if(o.content=`${String(o.content??``)}\n${i}`,Array.isArray(o.children)&&o.children.push(...n),r.length){let n=r.map(e=>String(e.content??e.raw??``)).join(``);if(n.trim()){let r=n.replace(/^\s+/,``);if(d(o,n))t.splice(e,1),e--;else if(r.startsWith(`<`))t.splice(e,1,{type:`html_block`,content:r});else{let r=l(n,u(t,e,`paragraph`));t.splice(e,1,...r)}}else t.splice(e,1),e--}else t.splice(e,1),e--;a.pop();continue}o.content=`${String(o.content??``)}\n${s}`,Array.isArray(o.children)&&o.children.push(...f),t.splice(e,1),e--;continue}if(n.type!==`inline`)continue;let c=Array.isArray(n.children)?n.children:[];for(let t of o)if((c.length?Jy(c,t):r(t).test(s)&&!i(t).test(s)?1:0)>0){a.push({tag:t,index:e});break}}}{let e=0;for(let n=0;n<t.length;n++){let r=t[n];if(r.type===`paragraph_open`){e++;continue}r.type===`paragraph_close`&&(e>0?e--:(t.splice(n,1),n--))}}for(let e=0;e<t.length;e++){let r=t[e];if(r.type===`html_block`){let n=(r.content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase();if(n.startsWith(`!`)||n.startsWith(`?`)){r.loading=!1;continue}if(o.has(n)){let i=String(r.content??``),a=Oy(i),o=a===-1?null:Yy(i,n,a+1);r.loading=o?!1:r.loading===void 0||r.loading;let s=o?.start??-1,c=o?o.end-o.start:0;if(s!==-1){let o=i.slice(0,s+c),u=``;a!==-1&&a<s&&(u=i.slice(a+1,s)),r.children=[{type:n,content:u,raw:o,attrs:[],tag:n,loading:!1}],r.content=o,r.raw=o;let d=l(i.slice(s+c)||``,`text`);d.length&&t.splice(e+1,0,...d)}else r.children=[{type:n,content:``,raw:i,attrs:[],tag:n,loading:!0}];continue}if([`br`,`hr`,`img`,`input`,`link`,`meta`,`div`,`p`,`ul`,`li`].includes(n))continue;r.type=`inline`;let i=[],a=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,s;for(;(s=a.exec(r.content||``))!==null;){let e=s[1],t=s[2]||s[3]||s[4]||``;i.push([e,t])}let c=String(r.content??``),u=RegExp(`<\\/\\s*${n}\\s*>`,`i`).exec(c),d=u?u.index:-1,f=u?u[0].length:0;if(d!==-1){let i=c.slice(0,d+f),a=(c.slice(d+f)||``).replace(/^\s+/,``);r.children=[{type:`html_block`,content:i,tag:n,loading:!1}],r.content=i,r.raw=i,a&&t.splice(e+1,0,a.startsWith(`<`)?{type:`html_block`,content:a}:{type:`text`,content:a,raw:a})}else r.children=[{type:`html_block`,content:r.content,tag:n,loading:!0}];continue}if(!r||r.type!==`inline`)continue;if(r.children.length===2&&r.children[0].type===`html_inline`){let e=(r.children[0].content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase(),t=r.children[1],i=String(t?.content??``).match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??``;if(t?.type===`html_inline`&&i===e)continue;n.has(e)?(r.children[0].loading=!0,r.children[0].tag=e,r.children.push({type:`html_inline`,tag:e,loading:!0,content:`</${e}>`})):r.children=[{type:`html_block`,loading:!0,tag:e,content:String(r.children[0]?.content??``)+String(r.children[1]?.content??``)}];continue}if(r.children.length===3&&r.children[0].type===`html_inline`&&r.children[2].type===`html_inline`){let e=(r.children[0].content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase();if(n.has(e))continue;r.children=[{type:`html_block`,loading:!1,tag:e,content:r.children.map(e=>e.content).join(``)}];continue}if(!r.content?.startsWith(`<`)||r.children?.length!==1)continue;let i=String(r.content),a=r,s=a.children[0];if(s?.type!==`html_inline`){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(i)&&(a.children.length=0);continue}let c=String(s.content??i).match(Uy)?.[1]?.toLowerCase()??``;if(c){if(/\/\s*>\s*$/.test(i)||Ly.has(c)){a.children=[{type:`html_inline`,content:i}];continue}a.children.length=0}}})}function lb(e){let t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function ub(e,t={}){t.enabled!==!1&&e.core.ruler.after(`inline`,`fix_indented_code_block`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n.type!==`code_block`)continue;let r=String(n.content??``).trim();if(!r)continue;let i=r.split(/\r?\n/).filter(e=>e.trim().length>0);if(i.length===1&&!lb(i[0]??``)){let r=i[0]??``,a=n.level??0;t.splice(e,1,{type:`paragraph_open`,tag:`p`,nesting:1,level:a},{type:`inline`,tag:``,nesting:0,level:a,content:r,children:[{type:`text`,content:r,level:a+1,raw:r}],block:!0},{type:`paragraph_close`,tag:`p`,nesting:-1,level:a}),e+=2}}})}var db=Symbol(`markstream.parse-context`);function fb(e){return!!(e&&e[db]===!0)}function pb(e={},t={}){return{...e,[db]:!0,customHtmlBlockCursor:0,disableStreamParse:!1,disableStructuredReuse:!1,insideStrong:!1,isFragment:!1,...t}}function mb(e){return fb(e)?e:pb(e)}function hb(e,t=e,n={}){return pb(t,{runtime:e.runtime,markdownIt:e.markdownIt,...n})}var gb=/\.([a-z0-9]{1,15})$/i,_b=/[_()[\]{}<>]/u,vb=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,yb=/[?#@]/u,bb=/[\\/]/u,xb=/^[\p{L}\p{N}./\\-]+$/u,Sb=/^[A-Za-z0-9-]{1,63}$/u,Cb=/^xn--[a-z0-9-]{2,59}$/i,wb=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Tb=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Eb=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Db=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Ob=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,kb=2e3,Ab=16384,jb=512*kb,Mb={},Nb=new Set([`ai`,`md`,`py`,`rs`,`sh`,`zip`]),Pb=new Set([`as`,`bj`,`de`,`hk`,`l`,`ln`,`ny`,`pa`,`sh`,`ss`,`sz`,`t`,`us`]),Fb=new Set([...Pb,`at`,`ax`,`cn`,`co`,`it`,`jp`,`ks`,`mc`,`mx`,`nz`,`pl`,`sa`,`si`,`to`,`tw`]),Ib=new Set([`com`,`dev`,`io`,`page`,`site`]),Lb=new Set([`app`,`apk`,`dmg`,`exe`,`ipa`,`lock`,`log`,`markdown`,`webmanifest`]),Rb=new Set(`7z.ai.astro.avi.bash.bz2.c.cjs.cpp.cs.csv.doc.docx.fish.flac.gif.go.gz.h.hpp.html.java.jpeg.jpg.js.json.jsx.kt.md.mdx.mjs.mov.mp3.mp4.pdf.php.png.ppt.pptx.ps1.py.rar.rb.rs.sh.sql.svg.swift.svelte.tar.tgz.toml.ts.tsx.txt.vue.wav.webp.xls.xlsx.xml.yaml.yml.zip.zsh`.split(`.`)),zb=new Map,Bb=0;function Vb(e,t){if(!e||e.length>Ab)return t;for(zb.has(e)||(Bb+=e.length),zb.set(e,t);zb.size>kb||Bb>jb;){let e=zb.keys().next().value;if(!e)break;zb.delete(e),Bb-=e.length}return t}function Hb(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Ub(e,t){let n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Hb(n)?n:void 0}function Wb(e,t){if(!Hb(t))return e;let n=mb(e),r=n.linkifyDemotionContext;return{...n,linkifyDemotionContext:{filename:r?.filename||t?.filename,explicitFilename:r?.explicitFilename||t?.explicitFilename,marketTicker:r?.marketTicker||t?.marketTicker}}}function Gb(e){let t=nx(e);return Hb(t)?t:void 0}function Kb(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,``).replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,``)}function qb(e,t){if(!Hb(t))return;let n=String(e??``).trim().split(/\s+/u).map(Kb).filter(Boolean);if(n.length===0)return;let r={};return t?.filename&&n.every(e=>sx(e,{filename:!0,explicitFilename:t.explicitFilename}))&&(r.filename=!0),t?.explicitFilename&&r.filename&&(r.explicitFilename=!0),t?.marketTicker&&n.every(e=>sx(e,{marketTicker:!0}))&&(r.marketTicker=!0),Hb(r)?r:void 0}function Jb(e,t=!1){let n=mb(e).linkifyDemotionSeedContext;return{options(r){return t||r==null?Wb(e,n):Wb(e,Ub(Gb(r),qb(r,n)))},remember(e){let r=Gb(e);n=t?Ub(n,r):Ub(r,qb(e,n))},reset(){n=void 0},snapshot(){return n}}}function Yb(e){return Sb.test(e)&&!e.startsWith(`-`)&&!e.endsWith(`-`)}function Xb(e){let t=e.split(`.`);if(t.length<2)return!1;let n=t[t.length-1]?.toLowerCase()??``;return Yb(n)||Cb.test(n)?t.every(Yb):!1}function Zb(e){return Array.from(e).some(e=>e.charCodeAt(0)>127)}function Qb(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``).split(/[/?#]/,1)[0]??``}function $b(e){return e.split(`.`).some(e=>e.toLowerCase().startsWith(`xn--`))}function ex(e,t,n){let r=Qb(t);return Zb(e)&&$b(r)&&String(n??``).toLowerCase().includes(r.toLowerCase())}function tx(e){if(!e)return!1;if(e.includes(`文件`)||e.includes(`附件`)||e.includes(`路径`)||e.includes(`路徑`)||e.includes(`文档`)||e.includes(`文檔`)||e.includes(`档案`)||e.includes(`檔案`)||e.includes(`资料`)||e.includes(`資料`)||e.includes(`股票`)||e.includes(`证券`)||e.includes(`證券`)||e.includes(`代码`)||e.includes(`代碼`)||e.includes(`交易所`)||e.includes(`后缀`)||e.includes(`後綴`)||e.includes(`市场`)||e.includes(`市場`))return!0;let t=e.toLowerCase();return t.includes(`file`)||t.includes(`attachment`)||t.includes(`document`)||t.includes(`doc`)||t.includes(`path`)||t.includes(`ticker`)||t.includes(`symbol`)||t.includes(`exchange`)}function nx(e){let t=String(e??``);return zb.get(t)||(tx(t)?Vb(t,{explicitFilename:Eb.test(t),filename:Db.test(t),marketTicker:Ob.test(t)}):Vb(t,Mb))}function rx(e){return Xb(e.split(/[\\/]/)[0]??``)}function ix(e){let t=e.replace(/[^a-z]/gi,``);return t.length>=2&&t===t.toUpperCase()}function ax(e){if(_b.test(e)||!xb.test(e))return!0;if(bb.test(e))return!rx(e);let t=e.replace(gb,``);return Zb(t)?!0:t.split(`.`).filter(Boolean).some(ix)}function ox(e,t,n){if(!(n?Fb:Pb).has(t))return!1;let r=e.slice(0,-(t.length+1));return r===``?e.startsWith(`.`):(n?Tb:wb).test(r)}function sx(e,t={}){if(!e||vb.test(e)||yb.test(e))return!1;let n=e.match(gb);if(!n)return!1;let r=String(n[1]??``).toLowerCase();return ox(e,r,t.marketTicker===!0)?!0:Rb.has(r)?!Nb.has(r)||t.filename?!0:ax(e):!!(t.explicitFilename&&Ib.has(r)||t.filename&&Lb.has(r))}var cx=new WeakMap,lx=new WeakSet;function ux(e,t){return cx.set(e,t),e}function dx(e){return cx.get(e)}function fx(e){lx.add(e)}function px(e){return e===void 0||lx.has(e)}var mx=[`!`];function hx(e){return e===`linkify`||e===`autolink`?e:`recovery`}function gx(e){return{type:`text`,content:e,raw:e}}function _x(e,t){t===1?e.push({type:`em_open`,tag:`em`,nesting:1}):t===2?e.push({type:`strong_open`,tag:`strong`,nesting:1}):t===3&&(e.push({type:`strong_open`,tag:`strong`,nesting:1}),e.push({type:`em_open`,tag:`em`,nesting:1}))}function vx(e,t){t===1?e.push({type:`em_close`,tag:`em`,nesting:-1}):t===2?e.push({type:`strong_close`,tag:`strong`,nesting:-1}):t===3&&(e.push({type:`em_close`,tag:`em`,nesting:-1}),e.push({type:`strong_close`,tag:`strong`,nesting:-1}))}function yx(e,t,n,r=`recovery`){let i=``;if(t.includes(`"`)){let e=t.split(`"`);t=e[0].trim(),i=e[1].trim()}return ux({type:`link`,loading:n,href:t,title:i,text:e,children:[{type:`text`,content:e,raw:e}],raw:String(`[${e}](${t})`)},r)}function bx(e,t){if(e&&t&&(e.href=String(e.href??``)+t,e.text=String(e.text??``)+t,e.raw=String(`[${e.text}](${e.href})`),Array.isArray(e.children)&&e.children.length)){let n=e.children[e.children.length-1];n?.type===`text`?(n.content=String(n.content??``)+t,n.raw=String(n.raw??``)+t):e.children.push(gx(t))}}function xx(e,t){let n=-1;for(let r of t){let t=e.indexOf(r);t!==-1&&(n===-1||t<n)&&(n=t)}return n}function Sx(e){let t=e.attrs?.find(e=>e?.[0]===`href`)?.[1];return typeof t==`string`?t:``}function Cx(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];let n=e.attrs.findIndex(e=>e?.[0]===`href`);n>=0?e.attrs[n][1]=t:e.attrs.push([`href`,t])}function wx(e,t,n){let r=``;for(let i=t+1;i<n;i++){let t=e[i];if(t?.type!==`text`||typeof t.content!=`string`)return null;r+=t.content}return r||null}function Tx(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===`(`)t++;else if(r===`)`){if(t===0)return n;t--}}return-1}function Ex(e){e.core.ruler.after(`inline`,`fix_link_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=Dx(n.children,typeof n.content==`string`?n.content:void 0)}catch(e){console.error(`[applyFixLinkTokens] failed to fix inline children`,e)}}})}function Dx(e,t){if(e.length<3)return e;let n=e.some(e=>e.type===`code_inline`),r=new Map,i=0;for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`link_open`){let a=-1;for(let n=t+1;n<e.length;n++)if(e[n]?.type===`link_close`){a=n;break}if(a!==-1&&n.markup===`linkify`){r.set(n,i);let o=wx(e,t,a),s=i>0&&o?Tx(o):-1;if(s!==-1&&o)for(let e of o.slice(s))e===`(`?i++:e===`)`&&i>0&&i--}a!==-1&&(t=a);continue}if(n.type===`text`&&typeof n.content==`string`)for(let e of n.content)e===`(`?i++:e===`)`&&i>0&&i--}let a=nx(t);for(let i=0;i<=e.length-1;i++){i<0&&(i=0);let o=e[i];if(!o)break;if(o.type===`link_open`&&(o.markup===`linkify`||o.markup===`autolink`)){let s=-1;for(let t=i+1;t<e.length;t++)if(e[t]?.type===`link_close`){s=t;break}if(s!==-1){let c=wx(e,i,s),l=Sx(o);if(!n&&o.markup===`linkify`&&c&&!ex(c,l,t)&&sx(c,a)){e.splice(i,s-i+1,gx(c));continue}let u=xx(c??``,mx);if(o.markup===`linkify`&&c?.includes(`)`)&&(r.get(o)??0)>0){let e=Tx(c);e!==-1&&(u===-1||e<u)&&(u=e)}let d=xx(l,mx),f=u;for(let t=i+1;t<s;t++){let n=e[t];if(n?.type!==`text`||typeof n.content!=`string`)continue;if(f>=n.content.length){f-=n.content.length;continue}if(f<0)break;let r=n.content[f],i=n.content.slice(0,f),a=n.content.slice(f);for(let n=t+1;n<s;n++){let t=e[n];t?.type===`text`&&typeof t.content==`string`&&(a+=t.content)}n.content=i,n.raw=i;let c=s-(t+1);c>0&&(e.splice(t+1,c),s=t+1);let u=l;if(r===`!`&&d!==-1)u=l.slice(0,d);else if(a){let e=encodeURI(a);if(e&&l.endsWith(e))u=l.slice(0,l.length-e.length);else{let e=r?encodeURI(r):``,t=e?l.indexOf(e):-1;t!==-1&&(u=l.slice(0,t))}}u!==l&&Cx(o,u),a&&e.splice(s+1,0,gx(a));break}}}if(!n){if(o?.type===`em_open`&&e[i-1]?.type===`text`&&e[i-1].content?.endsWith(`*`)){let t=e[i-1].content?.replace(/(\*+)$/,``)||``;e[i-1].content=t,o.type=`strong_open`,o.tag=`strong`,o.markup=`**`;for(let t=i+1;t<e.length;t++)if(e[t]?.type===`em_close`){e[t].type=`strong_close`,e[t].tag=`strong`,e[t].markup=`**`;break}}else if(o?.type===`text`&&o.content?.endsWith(`(`)&&e[i+1]?.type===`link_open`){let t=o.content.match(/\[([^\]]+)\]/);if(t){let n=o.content.slice(0,t.index),r=n.match(/(\*+)$/),a=hx(e[i+1]?.markup),s=[];if(r){n=n.slice(0,r.index),n&&s.push(gx(n));let o=t[1],c=r[1].length;_x(s,c);let l=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(l+=e[i+4]?.content||``,e[i+4].content=``),s.push(yx(o,l,!e[i+4]?.content?.startsWith(`)`),a)),vx(s,c),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)\**/,``);t&&s.push(gx(t)),e.splice(i,5,...s)}else e.splice(i,4,...s)}else{n&&s.push(gx(n));let r=t[1],o=r.match(/^\*+/);if(o){let t=o[0].length;r=r.replace(/^\*+/,``).replace(/\*+$/,``);let n=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(n+=e[i+4]?.content||``,e[i+4].content=``),_x(s,t),s.push(yx(r,n,!e[i+4]?.content?.startsWith(`)`),a)),vx(s,t),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)/,``);t&&s.push(gx(t)),e.splice(i,5,...s)}else e.splice(i,4,...s);i===0?i=s.length-1:i-=s.length+1;continue}let c=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(c+=e[i+4]?.content||``,e[i+4].content=``),s.push(yx(r,c,!e[i+4]?.content?.startsWith(`)`),a)),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)/,``);t&&s.push(gx(t)),e.splice(i,5,...s)}else e.splice(i,4,...s)}i-=s.length+1;continue}}else if(o.type===`link_open`&&o.markup===`linkify`&&e[i-1]?.type===`text`&&e[i-1].content?.endsWith(`(`)){if(e[i-2]?.type===`link_close`){let t=[],n=e[i-3].content||``,r=o.attrs?.find(e=>e[0]===`href`)?.[1]||``;if(e[i+3]?.type===`text`){let a=(e[i+3]?.content??``).indexOf(`)`),o=a===-1;a===-1&&(r+=e[i+3]?.content?.slice(0,a)||``,e[i+3].content=``),t.push(yx(n,r,o,`linkify`));let s=e[i+3].content?.replace(/^\)\**/,``);s&&t.push(gx(s)),e.splice(i-4,8,...t)}else t.push(ux({type:`link`,loading:!0,href:r,title:``,text:n,children:[{type:`text`,content:r,raw:r}],raw:String(`[${n}](${r})`)},`linkify`)),e.splice(i-4,7,...t);continue}if(e[i-1].content===`](`&&e[i-3]?.type===`text`&&e[i-3].content?.endsWith(`)`)){if(e[i-2]?.type===`strong_open`){let[t,n]=e[i-3].content?.split(`[**`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}else if(e[i-2]?.type===`em_open`){let[t,n]=e[i-3].content?.split(`[*`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}else{let[t,n]=e[i-3].content?.split(`[`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}}}if(o.type===`link_close`&&o.nesting===-1&&e[i-2]?.type===`link_open`&&e[i+1]?.type===`text`&&e[i-1]?.type===`text`){let t=e[i-1].content||``,n=e[i-2].attrs||[],r=n.find(e=>e[0]===`href`)?.[1]||``,a=n.find(e=>e[0]===`title`)?.[1]||``,s=3,c=2,l=(e[i-3]?.content||``).match(/^(\*+)$/),u=[];if(l){c+=1;let e=l[1].length;_x(u,e)}if(o.markup!==`linkify`&&e[i+1].type===`text`&&e[i+1]?.content?.startsWith(`](`)){s+=1;for(let t=i+1;t<e.length;t++){let n=l?l[1].length:e[i-3].markup.length,r=e[t];if(n===1&&r.type===`em_close`||n===2&&r.type===`strong_close`||n===3&&(r.type===`em_close`||r.type===`strong_close`))break;s+=1}}let d=ux({type:`link`,loading:!1,href:r,title:a,text:t,children:[{type:`text`,content:t,raw:t}],raw:String(`[${t}](${r})`)},o.markup?hx(o.markup):`explicit`);if(u.push(d),l){let e=l[1].length;vx(u,e)}e.splice(i-c,s,...u),i-=u.length+1;continue}if(o.content?.startsWith(`](`)&&e[i-1].markup?.includes(`*`)&&e[i-4]?.type===`text`&&e[i-4].content?.endsWith(`[`)){let t=e[i-1].markup.length,n=[],r=e[i-4].content.slice(0,e[i-4].content.length-t);r&&n.push(gx(r)),_x(n,t);let a=e[i-2].content||``,s=o.content.slice(2),c=!0;if(e[i+1]?.type===`text`){let t=(e[i+1]?.content??``).indexOf(`)`);c=t===-1,t===-1&&(s+=e[i+1]?.content?.slice(0,t)||``,e[i+1].content=``)}if(n.push(yx(a,s,c)),vx(n,t),e[i+1]?.type===`text`){let t=e[i+1].content?.replace(/^\)\**/,``);t&&n.push(gx(t)),e.splice(i-4,8,...n)}else e[i+1]?.type===`link_open`?e.splice(i-4,10,...n):e.splice(i-4,7,...n);i-=n.length+1;continue}if(o.content?.startsWith(`](`)&&e[i-1].type===`strong_close`&&e[i-4]?.type===`text`&&e[i-4]?.content?.includes(`**[`)){let t=[],n=e[i-4].content.split(`**[`)[0];n&&t.push(gx(n)),_x(t,2);let r=e[i-2].content||``,a=o.content.slice(2),s=!0;if(e[i+1]?.type===`text`){let t=(e[i+1]?.content??``).indexOf(`)`);s=t===-1,t===-1&&(a+=e[i+1]?.content?.slice(0,t)||``,e[i+1].content=``)}if(t.push(yx(r,a,s)),vx(t,2),e[i+1]?.type===`text`){let n=e[i+1].content?.replace(/^\)\**/,``);n&&t.push(gx(n)),e.splice(i-4,8,...t)}else e[i+1]?.type===`link_open`?e.splice(i-4,10,...t):e.splice(i-4,7,...t);i-=t.length+1;continue}if(o.type===`strong_close`&&e[i+1]?.type===`text`&&e[i+1].content?.includes(`](`)&&e[i-1].type===`text`&&/\[.*$/.test(e[i-1].content||``)){let t=[],[n,r]=e[i-1].content?.split(`[`)||[``,``];n&&t.push(gx(n)),_x(t,2);let[a,s]=e[i+1].content.split(`](`);a=r+a;let c=4;if(e[i+2]?.type===`link_open`){let t=e[i+2].attrs?.find(e=>e[0]===`href`)?.[1];e[i+5]?.type===`text`&&e[i+5].content===`.`?(s=(t||s)+e[i+5].content,e[i+5].content=``):s=t||s,c+=3}let l=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,``)),e[i+2]?.type===`text`){let t=(e[i+2]?.content??``).indexOf(`)`);l=t===-1,t===-1&&(s+=e[i+2]?.content?.slice(0,t)||``,e[i+2].content=``)}t.push(yx(a,s,l)),vx(t,2),e.splice(i-2,c,...t)}if(o.type===`text`&&/\*+\[[^\]]*$/.test(o.content||``)&&e[i+1]?.type===`strong_open`&&e[i+2]?.type===`text`&&e[i+2].content===`](`&&e[i+3]?.type===`link_open`&&e[i+5]?.type===`link_close`&&e[i+6]?.type===`text`&&e[i+6].content===`)`&&e[i+7]?.type===`strong_close`){let t=(o.content||``).match(/^(\*+)\[(.*)$/);if(t){let n=(t[2]||``)+t[1],r=e[i+3]?.attrs?.find(e=>e[0]===`href`)?.[1]||``;!r&&e[i+4]?.type===`text`&&(r=e[i+4].content||``);let a=[];_x(a,2),a.push(yx(n,r,!1)),vx(a,2),e.splice(i,9,...a),i-=a.length-1;continue}}}}if(n)return e;for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n?.type!==`link`||r?.type!==`text`||typeof r.content!=`string`||!r.content.startsWith(`!`))continue;let i=String(n.href??``);if(String(n.text??``)!==i||!i.endsWith(`=`)&&!i.endsWith(`#`))continue;bx(n,`!`);let a=r.content.slice(1);a?(r.content=a,r.raw=a):e.splice(t+1,1)}return e}function Ox(e){e.core.ruler.after(`inline`,`fix_list_item_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=kx(n.children)}catch(e){console.error(`[applyFixListItem] failed to fix inline children`,e)}}})}function kx(e){let t=e[e.length-1],n=String(t?.content??``);return t?.type===`text`&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag===`br`&&e.splice(e.length-1,1),e}function Ax(e){e.core.ruler.after(`inline`,`fix_strong_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=jx(n.children)}catch(e){console.error(`[applyFixStrongTokens] failed to fix inline children`,e)}}})}function jx(e){let t=0,n=new Set,r=new Set,i=0;for(let a=0;a<e.length;a++){let o=e[a],s=o.type;if(s===`strong_open`){t++;let r=String(o.markup??``),i=a-1;for(;i>=0&&e[i].type===`text`&&e[i].content===``;)i--;let s=e[i],c=a+1;for(;c<e.length&&e[c].type===`text`&&e[c].content===``;)c++;let l=e[c];r===`__`&&(s?.content?.endsWith(`_`)||l?.content?.startsWith(`_`)||l?.markup?.includes(`_`))&&(o.type=`text`,o.tag=``,o.content=r,o.raw=r,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null,n.add(t))}else if(s===`strong_close`)n.has(t)&&o.markup===`__`&&(o.type=`text`,o.content=o.markup,o.raw=String(o.markup??``),o.tag=``,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null),t--,t<0&&(t=0);else if(s===`em_open`){i++;let t=String(o.markup??``),n=a-1;for(;n>=0&&e[n].type===`text`&&e[n].content===``;)n--;let s=e[n],c=a+1;for(;c<e.length&&e[c].type===`text`&&e[c].content===``;)c++;let l=e[c];t===`_`&&(s?.content?.endsWith(`_`)||l?.content?.startsWith(`_`)||l?.markup?.includes(`_`))&&(o.type=`text`,o.tag=``,o.content=t,o.raw=t,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null,r.add(i))}else s===`em_close`&&(r.has(i)&&o.markup===`_`&&(o.type=`text`,o.content=o.markup,o.raw=String(o.markup??``),o.tag=``,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null),i--,i<0&&(i=0))}if(e.length<5)return e;let a=e.length-4,o=e[a],s=[...e],c=e[a+1],l=String(o.content??``);if(o.type===`link_open`&&e[a-1]?.type===`em_open`&&e[a-2]?.type===`text`&&e[a-2].content?.endsWith(`*`)){let t=String(e[a-2].content??``).slice(0,-1),n=[{type:`strong_open`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``},e[a],e[a+1],e[a+2],{type:`strong_close`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``}];t&&n.unshift({type:`text`,content:t,raw:t}),s.splice(a-2,6,...n)}else if(o.type===`text`&&l.endsWith(`*`)&&c.type===`em_open`){let t=e[a+2],n=t?.type===`text`?4:3,r=[{type:`strong_open`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``},{type:`text`,content:t?.type===`text`?String(t.content??``):``,raw:t?.type===`text`?String(t.content??``):``},{type:`strong_close`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``}],i=l.slice(0,-1);i&&r.unshift({type:`text`,content:i,raw:i}),s.splice(a,n,...r)}return s=Mx(s),s}function Mx(e){if(e.length<7)return e;let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=e[n+1],a=e[n+2],o=e[n+3],s=e[n+4],c=e[n+5],l=e[n+6];if(r?.type===`strong_open`&&i?.type===`text`&&a?.type===`strong_close`&&o?.type===`strong_open`&&s?.type===`math_inline`&&c?.type===`strong_close`&&l?.type===`text`){let e=String(l.content??``),a=e.indexOf(`**`);if(a!==-1){let o=e.slice(0,a),u=e.slice(a+2);t.push(r),t.push(i),t.push(s),o&&t.push({...l,type:`text`,content:o,raw:o}),t.push(c),u&&t.push({...l,type:`text`,content:u,raw:u}),n+=6;continue}}if(r?.type===`strong_open`&&i?.type===`text`&&a?.type===`strong_close`&&o?.type===`strong_open`&&s?.type===`math_inline`&&c?.type===`strong_close`){let a=Nx(e,n+6);if(a){t.push(r),t.push(i),t.push(s);for(let r=n+6;r<a.index;r++)t.push(e[r]);a.beforeClose&&t.push({...e[a.index],type:`text`,content:a.beforeClose,raw:a.beforeClose}),t.push(c),a.afterClose&&t.push({...e[a.index],type:`text`,content:a.afterClose,raw:a.afterClose}),n=a.index;continue}}t.push(r)}return t}function Nx(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.type===`strong_open`)return null;if(t?.type!==`text`)continue;let r=String(t.content??``),i=r.indexOf(`**`);if(i!==-1)return{index:n,beforeClose:r.slice(0,i),afterClose:r.slice(i+2)}}return null}function Px(e){e.core.ruler.after(`block`,`fix_table_tokens`,e=>{let t=e;try{let e=Kx(t.tokens??[],!!t.env?.__markstreamFinal,t.src??``);Array.isArray(e)&&(t.tokens=e)}catch(e){console.error(`[applyFixTableTokens] failed to fix table tokens`,e)}})}function Fx(e){let t=Array.isArray(e)?[...e]:null,n=t?[t[0],t[0]+1]:null;return[{type:`table_open`,tag:`table`,attrs:null,map:t,children:null,content:``,markup:``,info:``,level:0,nesting:1,block:!0,loading:!0,meta:null},{type:`thead_open`,tag:`thead`,attrs:null,block:!0,level:1,map:n,nesting:1,children:null},{type:`tr_open`,tag:`tr`,attrs:null,block:!0,level:2,map:n,nesting:1,children:null}]}function Ix(){return[{type:`tr_close`,tag:`tr`,attrs:null,block:!0,level:2,map:null,nesting:-1,children:null},{type:`thead_close`,tag:`thead`,attrs:null,block:!0,level:1,map:null,nesting:-1,children:null},{type:`table_close`,tag:`table`,attrs:null,map:null,children:null,content:``,markup:``,info:``,level:0,nesting:-1,block:!0,meta:null}]}function Lx(e){return[{type:`th_open`,tag:`th`,attrs:null,block:!0,level:3,map:null,nesting:1,children:null},{type:`inline`,tag:``,children:null,content:e,level:4,attrs:null,map:null,nesting:0,block:!0},{type:`th_close`,tag:`th`,attrs:null,block:!0,level:3,map:null,nesting:-1,children:null}]}function Rx(e,t){if(!e.startsWith(`|`)||e.includes(`
83
+ `)||t&&!e.endsWith(`|`))return null;let n=e.slice(1).split(`|`);return n.at(-1)===``&&n.pop(),n.length>0&&n.every(e=>e.trim().length>0)?n:null}function zx(e){return Rx(e,!0)!==null}function Bx(e){return/^:?-+:?$/.test(e.trim())}function Vx(e){if(!e.startsWith(`|`))return!1;let t=e.slice(1).split(`|`);return t.at(-1)===``&&t.pop(),t.length>0&&t.every(Bx)}function Hx(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ux(e){if(e===``)return!0;if(!e.startsWith(`|`))return!1;let t=e.slice(1).split(`|`),n=t.at(-1)??``;return t.slice(0,-1).every(Bx)&&Hx(n)}function Wx(e){return e===`|`||e===`|:`}function Gx(e){let t=Rx(e,!0);return t!==null&&t.every(e=>!e.includes(`:`))}function Kx(e,t=!1,n=``){if(e.length<3)return e;let r=e.length-2,i=e[r];if(i.type!==`inline`)return e;let a=e[r-1]?.map,o=String(i.content??``),s=o.split(`
84
+ `)[0]??``,[c=``,l=``,...u]=o.split(`
85
+ `),d=!t&&!o.includes(`
86
+ `)&&/\r?\n$/.test(n)&&zx(o),f=null;if(!t&&(o.includes(`
87
+ `)&&u.length===0&&zx(c)&&Ux(l)||d)){let t=s.slice(1,-1).split(`|`).map(e=>e.trim()).flatMap(e=>Lx(e)),n=[...Fx(a),...t,...Ix()];f=[...e],f.splice(r-1,3,...n)}else if(o.includes(`
88
+ `)&&u.length===0&&zx(c)&&Vx(l)){let t=s.slice(1,-1).split(`|`).map(e=>e.trim()).flatMap(e=>Lx(e)),n=[...Fx(a),...t,...Ix()];f=[...e],f.splice(r-1,3,...n)}else if(o.includes(`
89
+ `)&&u.length===0&&Gx(c)&&Wx(l))return i.content=o.slice(0,-2),i.children.splice(2,1),e;return f??e}function qx(e,t,n,r){let i=e.length;if(n===`$$`&&r===`$$`){let n=t;for(;n<i-1;){if(e[n]===`$`&&e[n+1]===`$`){let t=n-1,r=0;for(;t>=0&&e[t]===`\\`;)r++,t--;if(r%2==0)return n}n++}return-1}let a=n[n.length-1],o=r,s=0,c=t;for(;c<i;){if(e.slice(c,c+o.length)===o){let t=c-1,n=0;for(;t>=0&&e[t]===`\\`;)n++,t--;if(n%2==0){if(s===0)return c;s--,c+=o.length;continue}}let t=e[c];if(t===`\\`){c+=2;continue}t===a?s++:t===o[o.length-1]&&s>0&&s--,c++}return-1}var Jx=qx,Yx=[`boldsymbol`,`mathbb`,`mathcal`,`mathfrak`,`mathrm`,`mathit`,`mathsf`,`vec`,`hat`,`bar`,`tilde`,`overline`,`underline`,`mathscr`,`mathnormal`,`operatorname`,`mathbf*`].map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,`\\$&`)).join(`|`),Xx=/\\[a-z]+/i,Zx=`(?:\\\\|\\u0008)`,Qx=new RegExp(String.raw`${Zx}(?:${Yx})\s*\{[^}]+\}`,`i`),$x=new RegExp(String.raw`(?:${Zx})?(?:${Yx})\s*\{`,`i`),eS=/\\(?:text|frac|left|right|times)/,tS=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,nS=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,rS=/[A-Z]+\s*\([^)]+\)/i,iS=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,aS=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,oS=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,sS={"\b":`\\b`,"\v":`\\v`,"\f":`\\f`};function cS(e){let t=``;for(let n of e)t+=sS[n]??n;return t}function lS(e){if(!e)return!1;let t=cS(e),n=t.trim();if(oS.test(n)||n.includes(`**`))return!1;if(n.length>2e3)return!0;let r=Xx.test(t),i=Qx.test(t),a=$x.test(t),o=eS.test(t),s=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),c=tS.test(t)&&!nS.test(t),l=rS.test(t),u=iS.test(n),d=aS.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return r||i||a||o||s||c||l||u||d||f||p}var uS=`__markstreamMathPluginApplied`,dS=80,fS=2e4,pS=24096;function mS(e){return!!e[uS]}function hS(e){e[uS]=!0}var gS=`ldots.cdots.quad.in.displaystyle.int_.lim.lim_.ce.pu.end.infty.perp.mid.operatorname.to.rightarrow.leftarrow.math.mathrm.mathit.mathbb.mathcal.mathfrak.implies.alpha.beta.gamma.delta.epsilon.lambda.sum.sum_.prod.sqrt.fbox.boxed.color.rule.edef.fcolorbox.hline.hdashline.cdot.times.pm.le.ge.neq.sin.cos.tan.log.ln.exp.frac.text.left.right`.split(`.`),_S=[`cdot`,`mathbf{`,`partial`,`mu_{`],vS=gS.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,`\\$&`)).join(`|`),yS=`[ \r\b\f\v]`,bS=RegExp(`([^\\\\])(${_S.map(e=>e).join(`|`)})+`,`g`),xS=/span\{([^}]+)\}/,SS=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,CS=/(^|[^\\])\\\r?\n/g,wS=/(^|[^\\])\\$/g,TS=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,ES=RegExp(`(${yS})|(${vS})\\b`,`g`),DS=new Map,OS=new Map;function kS(e){if(!e)return ES;let t=[...e];t.sort((e,t)=>t.length-e.length);let n=t.join(``),r=DS.get(n);if(r)return r;let i=`(?:${t.map(e=>e.replace(/[.*+?^${}()|[\\]\\"\]/g,`\\$&`)).join(`|`)})`,a=RegExp(`(${yS})|(${i})\\b`,`g`);return DS.set(n,a),a}function AS(e,t){let n=e?[]:[...t??[]];e||n.sort((e,t)=>t.length-e.length);let r=e?`__default__`:n.join(``),i=OS.get(r);if(i)return i;let a=e?[Yx,vS].filter(Boolean).join(`|`):[n.map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,`\\$&`)).join(`|`),Yx].filter(Boolean).join(`|`),o=RegExp(`(^|[^\\\\\\w])(${a})\\s*\\{`,`g`);return OS.set(r,o),o}var jS={" ":`t`,"\r":`r`,"\b":`b`,"\f":`f`,"\v":`v`};function MS(e){let t=/(^|[^\\])(__|\*\*)/g,n=0;for(;t.exec(e)!==null;)n++;return n}function NS(e){return e.replace(/(^|[^\\])!+/gu,(e,t)=>{if(t&&TS.test(t))return e;let n=t?e.slice(t.length):e;return`${t}${`\\!`.repeat(n.length)}`})}function PS(e){let t=/(^|[^\\])(__|\*\*)/g,n,r=null;for(;(n=t.exec(e))!==null;)r={marker:n[2],index:n.index+(n[1]?.length??0)};return r}function FS(e,t){let n=t?.commands??gS,r=t?.escapeExclamation??!0,i=t?.commands==null,a=kS(i?void 0:n),o=e.replace(a,(e,t,r,i,a)=>{if(t!==void 0&&jS[t]!==void 0)return`\\${jS[t]}`;if(r&&n.includes(r)){let t=a&&typeof i==`number`?a[i-1]:void 0;return t===`\\`||t&&/\w/.test(t)?e:`\\${r}`}return e});r&&(o=NS(o));let s=o,c=AS(i,i?void 0:n);return s=s.replace(c,(e,t,n)=>`${t}\\${n}{`),s=s.replace(xS,`span\\{$1\\}`).replace(SS,`\\operatorname{span}\\{$1\\}`),s=s.replace(CS,`$1\\\\
90
+ `),s=s.replace(wS,`$1\\\\`),s=s.replace(bS,`$1\\$2`),s}function IS(e){let t=e.trim();return!(!lS(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}var LS=new WeakMap;function RS(e){let t=LS.get(e);if(t)return t;let n=e.src,r=e.env?.__markstreamFinal!==!0,i=[];for(let e=0;e<n.length;e++){let t=n[e];(t===`$`||t===`\\`)&&i.push(e)}return t={codeSpanRanges:BS(n),imageRanges:HS(n,r),mathOpenerPositions:i},LS.set(e,t),t}function zS(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n<e.length}function BS(e){let t=[],n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}let r=n,i=1;for(;r+i<e.length&&e[r+i]==="`";)i++;let a=r+i,o=-1;for(;a<e.length;){if(e[a]!=="`"){a++;continue}let t=1;for(;a+t<e.length&&e[a+t]==="`";)t++;if(t===i){o=a;break}a+=t}if(o!==-1){t.push([r,o+i]),n=o+i;continue}n=r+i}return t}function VS(e,t){for(let n of e)if(t>=n[0]&&t<n[1])return n;return null}function HS(e,t=!1){let n=[],r=0;for(;r<e.length-1;){if(e[r]===`!`&&e[r+1]===`[`){let i=r,a=r+2,o=1;for(;a<e.length&&o>0;){if(e[a]===`\\`&&a+1<e.length){a+=2;continue}e[a]===`[`?o++:e[a]===`]`&&o--,a++}if(o===0&&a<e.length&&e[a]===`(`){let o=a+1,s=1;for(;o<e.length&&s>0;){if(e[o]===`\\`&&o+1<e.length){o+=2;continue}e[o]===`(`?s++:e[o]===`)`&&s--,o++}if(s===0){n.push([i,o]),r=o;continue}if(t){n.push([i,e.length]),r=e.length;continue}}}r++}return n}function US(e,t){let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function WS(e,t){let n=t;for(;n<e.length;){let t=e.indexOf(`$`,n);if(t===-1)return-1;if(US(e,t)){n=t+1;continue}return t}return-1}function GS(e,t){let n=t;for(;n<e.length;){let t=WS(e,n);if(t===-1)return-1;if(t>0&&e[t-1]===`$`||t+1<e.length&&e[t+1]===`$`){n=t+1;continue}return t}return-1}function KS(e,t,n=0){let r=Math.max(0,n);for(;r<e.length;){let n=e.indexOf(t,r);if(n===-1)return-1;if(!US(e,n))return n;r=n+Math.max(1,t.length)}return-1}function qS(e,t,n=0,r=e.length,i=[]){let a=0,o=Math.max(0,n),s=Math.min(e.length,Math.max(0,r));for(;o<s;){let n=e.indexOf(t,o);if(n===-1||n>=s)break;let r=VS(i,n);if(r){o=Math.max(n+Math.max(1,t.length),r[1]);continue}US(e,n)||a++,o=n+Math.max(1,t.length)}return a}function JS(e,t,n){let r=XS(String(e??``));if(!r.endsWith(t))return-1;let i=r.length-t.length;if(i<=0||!XS(r.slice(0,i)).trim()||US(r,i))return-1;let a=BS(r);if(VS(a,i))return-1;let o=qS(r,t,0,i,a);if(t===`$$`){if(o%2==1)return-1}else if(o>qS(r,n,0,i,a))return-1;return i}function YS(e){return e===` `||e===` `}function XS(e){let t=e.length;for(;t>0&&YS(e[t-1]);)t--;return e.slice(0,t)}function ZS(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
91
+ `&&t++;return t}function QS(e){if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function $S(e){if(e.length<3)return!1;let t=e[0];if(t!==`-`&&t!==`*`&&t!==`_`&&t!==`=`)return!1;let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i===t){n++;continue}if(!YS(i))return!1}return n>=3}function eC(e){let t=e.trim();if(!t)return!1;let n=0;t[n]===`:`&&n++;let r=0;for(;t[n]===`-`;)r++,n++;return r<3?!1:(t[n]===`:`&&n++,n===t.length)}function tC(e){if(!e.includes(`|`))return!1;let t=e[0]===`|`?e.slice(1):e;return(t.endsWith(`|`)?t.slice(0,-1):t).split(`|`).every(eC)}function nC(e){let t=0;if(!QS(e[t]))return!1;for(;QS(e[t]);)t++;return e[t]!==`.`&&e[t]!==`)`?!1:YS(e[t+1])}function rC(e){let t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith(`~~~`)||t.startsWith(`:::`)||t[0]===`>`||t[0]===`<`)return!0;if(t[0]===`#`){let e=0;for(;t[e]===`#`;)e++;if(e>=1&&e<=6&&YS(t[e]))return!0}return!!((t[0]===`-`||t[0]===`+`||t[0]===`*`)&&YS(t[1])||nC(t)||$S(t)||tC(t))}function iC(e,t){return e?t?`${e}\n${t}`:e:t}function aC(e){let t=String(e??``).trim();return t?lS(t):!1}function oC(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function sC(e,t){if(e.length<=pS)return{source:e,lineOffset:0};if(t){let n=e.length-pS,r=e.indexOf(`
92
+ `,n);r=r===-1?e.length:r+1;let i=t.lineOffset+ZS(e.slice(t.windowStart,r));return t.lineOffset=i,t.windowStart=r,{source:e.slice(r),lineOffset:i}}let n=e.length-pS,r=e.indexOf(`
93
+ `,n);n=r===-1?e.length:r+1;let i=ZS(e.slice(0,n));return{source:e.slice(n),lineOffset:i}}function cC(e,t){let n=String(e??``);if(!n||!n.includes(`$$`)&&!n.includes(`\\[`))return!1;let{source:r}=sC(n,t);if(!r)return!1;let i=r.split(/\r?\n/),a=Math.max(0,i.length-dS-2),o=[[`$$`,`$$`],[`\\[`,`\\]`]];for(let e=a;e<i.length;e++){let t=XS(i[e]);if(t&&!rC(t)){for(let[e,n]of o)if(JS(t,e,n)!==-1)return!0}}return!1}function lC(e,t){let n=String(e??``);if(!n||!n.includes(`$$`)&&!n.includes(`\\[`))return null;let{source:r,lineOffset:i}=sC(n,t);if(!r)return null;let a=r.split(/\r?\n/),o=Math.max(0,a.length-dS-2),s=[[`$$`,`$$`],[`\\[`,`\\]`]];for(let e=o;e<a.length-1;e++){let t=XS(a[e]);for(let[n,r]of s){let o=JS(t,n,r);if(o===-1)continue;let s=``,c=!1;for(let t=e+1;t<a.length;t++){if(t-e>dS){c=!0;break}let l=a[t],u=KS(l,r);if(u!==-1){let a=iC(s,l.slice(0,u));if(!aC(a)){c=!0;break}let d=l.slice(u+r.length),f=d.trim()?`suffix:${oC(d)}`:`nosuffix`;return[`closed`,n,i+e,o,i+t,u,oC(a),f].join(`:`)}if(rC(l)){c=!0;break}if(s=iC(s,l),s.length>fS){c=!0;break}}if(!c&&aC(s))return[`pending`,n,i+e,o].join(`:`)}}return null}function uC(e,t){let n=String(e??``).trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??``))}function dC(e){let t=String(e??``).trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;let r=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(r)?!1:r===``||/^[)\s,.!?;:]/.test(r)}function fC(e){let t=String(e??``).trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function pC(e,t){hS(e);let n=(e,t,n)=>{let r=String(t??``).replace(/^[\t ]+/,``).replace(/[\t ]+$/,``);if(!r)return;let i=e.push(`paragraph_open`,`p`,1);i.map=[n,n+1];let a=e.push(`inline`,``,0);a.content=r,a.map=[n,n+1],a.children=[],e.push(`paragraph_close`,`p`,-1)},r=(e,n)=>{let r=e,i=!!t?.strictDelimiters,a=!r?.env?.__markstreamFinal,o=(e,t)=>{let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;if(n===t||!(e[n]===`
94
+ `||e[n]===`\r`&&e[n+1]===`
95
+ `))return t;let i=e.slice(t,n),a=r.push(`text`,``,0);return a.content=i,n};if(/^\*[^*]+/.test(r.src))return!1;let s=String(r.pending??``),c=Math.max(0,r.pos-s.length),l=RS(r);if(!zS(l.mathOpenerPositions,c))return!1;if(r.src[r.pos]===`$`){let e=r.pos+1;for(;r.src[e]===`$`;)e++;let t=e-r.pos,n=r.src[e];if(t>=3&&(!n||/\s/.test(n))){let t=r.push(`text`,``,0);return t.content=r.src.slice(r.pos,e),r.pos=e,!0}}let u=[[`$$`,`$$`],[`$`,`$`],[`\\(`,`\\)`]],d=c,f=c,p=c,m=r.src,{codeSpanRanges:h,imageRanges:g}=l;for(let[e,s]of u){let c=!1;e===`$$`&&d!==p&&(d=p);let l=-1,u=-1,_=0,v=n=>{if((n===`undefined`||n==null)&&(n=``),n===`\\`){r.pos+=n.length,d=r.pos;return}if(n===`\\)`||n===`\\(`){let e=r.push(`text_special`,``,0);e.content=n===`\\)`?`)`:`(`,e.markup=n,r.pos+=n.length,d=r.pos;return}if(!n)return;if(e===`$$`&&n.includes(`$`)){let e=0;for(;e<n.length;){let i=WS(n,e);if(i===-1){let t=n.slice(e);if(t){let e=r.push(`text`,``,0);e.content=t,r.pos+=t.length,d=r.pos}break}if(i>0&&n[i-1]===`$`||i+1<n.length&&n[i+1]===`$`){let t=n.slice(e,i+1);if(t){let e=r.push(`text`,``,0);e.content=t,r.pos+=t.length,d=r.pos}e=i+1;continue}let a=n.slice(e,i);if(a){let e=r.push(`text`,``,0);e.content=a,r.pos+=a.length,d=r.pos}let o=GS(n,i+1);if(o===-1){let e=n.slice(i),t=r.push(`text`,``,0);t.content=e,r.pos+=e.length,d=r.pos;break}let s=n.slice(i+1,o),c=s.includes("`"),l=!s||!s.trim(),u=n[o+1],f=uC(s,u),p=fC(s);if(!c&&!l&&!f&&!p){let n=r.push(`math_inline`,`math`,0);n.content=FS(s,t),n.markup=`$`,n.raw=`$${s}$`,n.loading=!1,r.pos+=o-i+1,d=r.pos,e=o+1;continue}let m=r.push(`text`,``,0);m.content=`$`,r.pos+=1,d=r.pos,e=i+1}return}let i=n.indexOf(`![`);if(i!==-1){if(i>0){let e=n.slice(0,i),t=r.push(`text`,``,0);t.content=e,r.pos+=e.length,d=r.pos}let e=n.slice(i).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){let[,t,a]=e,o=a.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),s=o?o[1]:a,c=o&&o[2]?o[2]:null,l=r.push(`image`,`img`,0);l.attrs=[[`src`,s],[`alt`,t]],c&&l.attrs.push([`title`,c]),l.content=t,l.children=[{type:`text`,content:t,tag:``}],r.pos+=e[0].length,d=r.pos;let u=n.slice(i+e[0].length);u&&v(u);return}let t=r.push(`text`,``,0);t.content=n,r.pos+=n.length,d=r.pos;return}let a=r.push(`text`,``,0);a.content=n,r.pos+=n.length,d=r.pos};for(;!(d>=m.length);){let p=m.indexOf(e,d);if(p===-1)break;if(US(m,p)){d=p+Math.max(1,e.length);continue}let y=VS(h,p);if(y){d=y[1];continue}let b=VS(g,p);if(b){d=b[1];continue}if(p===l&&d===u){if(_++,_>2){d=p+Math.max(1,e.length);continue}}else _=0,l=p,u=d;if(e===`(`&&p>0){let t=p-1;for(;t>=0&&m[t]===` `;)t--;if(t>=0&&m[t]===`]`){d=p+e.length;continue}}if(e===`$`&&p>0&&m[p-1]===`$`){d=p+1;continue}if(e===`$`&&p<m.length-1&&m[p+1]===`$`){d=p+2;continue}let x=e===`$`?GS(m,p+e.length):Jx(m,p+e.length,e,s);if(x===-1){let o=m.slice(p+e.length);if(o.includes(e)){d=m.indexOf(e,p+e.length);continue}if(x===-1){let l=e===`$`&&dC(o);if(a&&!i&&!l&&lS(o)&&!o.includes("`")){if(d=p+e.length,c=!0,!n){r.pending=``;let n=f?m.slice(f,d):m.slice(0,d),i=MS(n)%2==1;if(f)v(m.slice(f,d));else{let t=m.slice(0,d);t.endsWith(e)&&(t=t.slice(0,t.length-e.length)),v(t)}if(i){let i=PS(n)?.marker??`**`,a=r.push(`strong_open`,``,0);a.markup=i;let c=r.push(`math_inline`,`math`,0);c.content=FS(o,t),c.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,c.raw=`${e}${o}${s}`,c.loading=!0,a.content=o,r.push(`strong_close`,``,0)}else{let n=r.push(`math_inline`,`math`,0);n.content=FS(o,t),n.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,n.raw=`${e}${o}${s}`,n.loading=!0}r.pos=m.length}d=m.length,f=d}break}}let S=m.slice(p+e.length,x),C=S.includes("`"),w=!S||!S.trim(),T=e===`$`,E=m[x+s.length],D=T&&uC(S,E),O=T&&fC(S);if(i?C||w||D||O:C||w||D||O||!T&&!lS(S)){d=x+s.length;let e=m.slice(r.pos,d);r.pending||(v(e),f=d);continue}if(c=!0,!n){let n=m.slice(r.pos-(r.pending??``).length,p),i=m.slice(0,d)?m.slice(f,p):n,a=MS(i)%2==1;p!==r.pos&&a&&(i=r.pending+m.slice(r.pos,p));let c=a?PS(i):null,l=c?.marker??`**`;if(r.pending!==i){if(r.pending=``,a){if(c){let e=i.slice(c.index+l.length);v(i.slice(0,c.index));let t=r.push(`strong_open`,``,0);t.markup=l;let n=r.push(`text`,``,0);n.content=e,r.push(`strong_close`,``,0)}else v(i)}else v(i)}if(a){let n=r.push(`strong_open`,``,0);n.markup=l;let i=r.push(`math_inline`,`math`,0);i.content=FS(S,t),i.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,i.raw=`${e}${S}${s}`,i.loading=!1;let a=m.slice(x+s.length).startsWith(l);return a&&r.push(`strong_close`,``,0),r.pos=o(m,x+s.length),d=r.pos,f=d,a||r.push(`strong_close`,``,0),!0}{let n=r.push(`math_inline`,`math`,0);n.content=FS(S,t),n.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,n.raw=`${e}${S}${s}`,n.loading=!1}}return d=o(m,x+s.length),f=d,r.pos=d,!0}if(c){if(n)r.pos=d;else{if(e===`$$`&&d<m.length&&m.slice(d).includes(`$`)){let e=d;for(;!(e>=m.length);){let n=WS(m,e);if(n===-1)break;if(n+1<m.length&&m[n+1]===`$`){e=n+2;continue}if(n>0&&m[n-1]===`$`){e=n+1;continue}let i=GS(m,n+1);if(i===-1)break;let a=m.slice(n+1,i),o=a.includes("`"),s=!a||!a.trim(),c=m[i+1],l=uC(a,c),u=fC(a);if(!o&&!s&&!l&&!u){let o=m.slice(d,n);o&&v(o);let s=r.push(`math_inline`,`math`,0);s.content=FS(a,t),s.markup=`$`,s.raw=`$${a}$`,s.loading=!1,d=i+1,e=i+1}else v(`$`),e=n+1}e<m.length&&v(m.slice(e))}else d<m.length&&v(m.slice(d));r.pos=m.length}return!0}}return!1},i=(e,r,i,a)=>{let o=e,s=!o?.env?.__markstreamFinal,c=t?.strictDelimiters,l=c?[[`\\[`,`\\]`],[`$$`,`$$`]]:[[`\\[`,`\\]`],[`[`,`]`],[`$$`,`$$`]],u=o.bMarks[r]+o.tShift[r],d=o.src.slice(u,o.eMarks[r]).trim(),f=!1,p=``,m=``,h=!1,g=``,_=!1;for(let[e,n]of l)if(d.startsWith(e)){if(e.includes(`[`)){let a=e===`\\[`?d.slice(e.length):``;if(e===`\\[`&&KS(a,n)===-1&&!/^\s*!\[/.test(a)&&!a.includes("`")&&lS(a)){f=!0,p=e,m=n;break}if(t?.strictDelimiters){if(d.replace(`\\`,``)===`[`){if(r+1<i){f=!0,p=e,m=n;break}continue}}else if(d.replace(`\\`,``)===`[`){if(r+1<i){f=!0,p=e,m=n;break}continue}else{let t=o.tokens[o.tokens.length-1];if(t&&t.type===`list_item_open`&&t.mark===`-`&&d.slice(e.length,d.indexOf(`]`)).trim()===`x`)continue;if(d.replace(`\\`,``).startsWith(`[`)&&!d.includes(`](`)){let t=d.indexOf(`]`);if(d.slice(t).trim()!==`]`)continue;let r=d.slice(e.length,t);if(e===`[`?IS(r):lS(r)){f=!0,p=e,m=n;break}continue}}}else{f=!0,p=e,m=n;break}}else if((e===`$$`||e===`\\[`)&&d.endsWith(e)&&r+1<i){let t=JS(d,e,n);if(t===-1)continue;g=XS(d.slice(0,t)),_=!0;let i=o.bMarks[r+1]+o.tShift[r+1];d=o.src.slice(i,o.eMarks[r+1]).trim(),h=!0,f=!0,p=e,m=n;break}if(!f)return!1;if(a&&!_)return!0;let v=d.indexOf(p),y=v+p.length,b=!c&&p===`[`?d.indexOf(`\\]`,y):-1,x=b>=0?`\\]`:m,S=b>=0?b:KS(d,m,y);if(!h&&S>p.length){let e=d.slice(v+p.length,S),t=o.push(`math_block`,`math`,0);t.content=FS(e),t.markup=p===`$$`?`$$`:p===`[`?`[]`:`\\[\\]`,t.map=[r,r+1],t.raw=`${p}${e}${x}`,t.block=!0,t.loading=!1,o.line=r+1;let i=d.slice(S+x.length);return i.trim()&&n(o,i,r),!0}let C=r,w=``,T=!1,E=``,D=r,O=h?d:d===p?``:d.slice(p.length),k=!c&&p===`\\[`?`]`:``,ee=KS(O,m);if(ee!==-1){let e=ee;w=O.slice(0,e),E=O.slice(e+m.length),D=h?r+1:r,T=!0,C=D}else for(O&&!h&&(w=O),C=r+1;C<i;C++){let e=o.bMarks[C]+o.tShift[C],t=o.eMarks[C],n=o.src.slice(e,t),r=n.trim();if(!c&&p===`[`&&r===`\\]`){m=`\\]`,T=!0;break}if(k&&n.trim()===k){m=k,T=!0;break}if(r===m){T=!0;break}if(!c&&p===`[`&&n.includes(`\\]`)){T=!0;let e=n.indexOf(`\\]`);m=`\\]`;let t=n.slice(0,e);t&&(w+=(w?`
96
+ `:``)+t),E=n.slice(e+m.length),D=C;break}if(KS(n,m)!==-1){T=!0;let e=KS(n,m),t=n.slice(0,e);t&&(w+=(w?`
97
+ `:``)+t),E=n.slice(e+m.length),D=C;break}w+=(w?`
98
+ `:``)+n}if((!s||c)&&!T)return!1;let A=/^\s*!\[/.test(w);if(!(_?!A&&aC(w):p===`$$`?!A:p===`[`?IS(w):lS(w)))return!1;if(a)return!0;g&&n(o,g,r);let j=o.push(`math_block`,`math`,0);return j.content=FS(w),j.markup=p===`$$`?`$$`:p===`[`?`[]`:`\\[\\]`,j.raw=`${p}${w}${w.startsWith(`
99
+ `)?`
100
+ `:``}${m}`,j.map=[r,C+1],j.block=!0,j.loading=!T,o.line=C+1,E.trim()&&n(o,E,D),!0};e.inline.ruler.before(`escape`,`math`,r),e.block.ruler.before(`lheading`,`explicit_math_block`,(e,t,n,r)=>{let a=e,o=a.bMarks[t]+a.tShift[t],s=a.src.slice(o,a.eMarks[t]).trim();return!s.startsWith(`$$`)&&!s.startsWith(`\\[`)?!1:i(e,t,n,r)},{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.block.ruler.before(`paragraph`,`math_block`,i,{alt:[`paragraph`,`reference`,`blockquote`,`list`]})}function mC(e){let t=e.renderer.rules.image||function(e,t,n,r,i){let a=e,o=i;return o.renderToken?o.renderToken(a,t,n):``};e.renderer.rules.image=(e,n,r,i,a)=>{let o=e;return o[n].attrSet?.(`loading`,`lazy`),t(o,n,r,i,a)},e.renderer.rules.fence=e.renderer.rules.fence||((t,n)=>{let r=t[n],i=String(r.info??``).trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:``}"><code>${e.utils.escapeHtml(String(r.content??``))}</code></pre>`})}var hC=/^<a[>\s]/i,gC=/^<\/a\s*>/i;function _C(e,t){if(e?.type!==`inline`)return!1;let n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??``));let r=0;for(let e=n.length-1;e>=0;e--){let i=n[e];if(i?.type===`link_close`){for(e--;e>=0&&n[e]?.level!==i.level&&n[e]?.type!==`link_open`;)e--;continue}if(i?.type===`html_inline`){let e=String(i.content??``);hC.test(e)&&r>0&&r--,gC.test(e)&&r++}if(!(r>0)&&i?.type===`text`&&t.test(String(i.content??``)))return!0}return!1}function vC(e){let t=e.core?.ruler,n=t.getNamedRules?.().find(e=>e.name===`linkify`)?.fn;typeof n==`function`&&t.at(`linkify`,e=>{if(!e.md?.options?.linkify)return;let t=Array.isArray(e.tokens)?e.tokens:[],r=e.md.linkify;if(!r)return;let i=t.filter(e=>_C(e,r));if(i.length)return n(Object.assign(Object.create(Object.getPrototypeOf(e)),e,{tokens:i}))})}function yC(e){let t=e.inline.ruler,n=t.getNamedRules?.(),r=n?.find(e=>e.name===`link`)?.fn,i=n?.find(e=>e.name===`image`)?.fn;if(typeof r!=`function`||typeof i!=`function`)return;let a=e.validateLink,o=e;o.__markstreamOriginalValidateLink=a,t.at(`link`,(...e)=>{let t=e[0].md,n=t?.validateLink===a?t.options?.validateLink:t?.validateLink;if(!t||typeof n!=`function`)return r(...e);let i=t.validateLink;t.validateLink=n;try{return r(...e)}finally{t.validateLink=i}}),t.at(`image`,(...e)=>{let t=e[0].md;if(!t)return i(...e);let n=t.validateLink;t.validateLink=a;try{return i(...e)}finally{t.validateLink=n}})}function bC(e={}){let t=e.markdownItOptions??{},n=typeof t.experimental==`object`&&t.experimental!==null?t.experimental:{},r=!Object.prototype.hasOwnProperty.call(t,`stream`)||!!t.stream,i=Object.prototype.hasOwnProperty.call(t,`validateLink`),a={stream:r,...n},o=new Wv({html:!0,linkify:!0,typographer:!0,...t,experimental:a}),s=`streamTailLocalPostBlockRules`;if(!(Object.prototype.hasOwnProperty.call(t,s)||Object.prototype.hasOwnProperty.call(n,s))&&Object.prototype.hasOwnProperty.call(o.options,s)&&(o.options[s]=!0),!i){let e=e=>!yy(e,{tagName:`a`,attrName:`href`});fx(e),o.set({validateLink:e})}return yC(o),vC(o),(e.enableMath??!0)&&pC(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Ey(o),e.enableFixIndentedCodeBlock!==!1&&ub(o),Ex(o),Ax(o),Ox(o),Px(o),mC(o),cb(o,{customHtmlTags:e.customHtmlTags}),o}var xC=new Map;function SC(e,t){let n=t?`${e}:::${t}`:e,r=xC.get(n);if(!r&&(r=new RegExp(e,t),xC.set(n,r),xC.size>200)){let e=Array.from(xC.keys()).slice(0,50);for(let t of e)xC.delete(t)}return r.lastIndex=0,r}var CC=/\S/,wC=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i,TC=/<\/html>\s*$/i,EC=/^<\s*[!?]/,DC=/^([A-Z][\w:-]*)/i,OC=/\/\s*>$/;function kC(e){let t=e.search(CC);if(t===-1||e.charCodeAt(t)!==60)return null;let n=e.trim();if(!n)return null;let r=wC.test(n),i=TC.test(n);return!r||!i?null:[{type:`html_block`,tag:`html`,raw:e,content:e,loading:!1}]}function AC(e){let t=e.raw;if(typeof t==`string`)return t;let n=e.content;return typeof n==`string`?n:``}function jC(e,t){if(e.type!==`html_block`||!t)return!1;let n=String(e.raw??e.content??``);return SC(String.raw`^\s*<\s*\/\s*${Dy(t)}\s*>\s*$`,`i`).test(n)}var MC=new Set([`iframe`,`script`,`style`,`textarea`,`title`]);function NC(e,t,n){if(!e||!t)return null;let r=t.toLowerCase(),i=t=>{if(e.startsWith(`<!--`,t)){let n=e.indexOf(`-->`,t+4);return{closing:!1,end:n===-1?e.length:n+3,selfClosing:!1,tag:``}}if(e.startsWith(`<![CDATA[`,t)){let n=e.indexOf(`]]>`,t+9);return{closing:!1,end:n===-1?e.length:n+3,selfClosing:!1,tag:``}}let n=Oy(e,t);if(n===-1)return null;let r=n+1,i=e.slice(t,r);if(EC.test(i))return{closing:!1,end:r,selfClosing:!1,tag:``};let a=i.slice(1).trimStart(),o=a.startsWith(`/`);o&&(a=a.slice(1).trimStart());let s=a.match(DC);return s?.[1]?{closing:o,end:r,selfClosing:OC.test(i),tag:s[1].toLowerCase()}:{closing:!1,end:t+1,selfClosing:!1,tag:``}},a=(t,n)=>{let r=SC(String.raw`<\s*\/\s*${Dy(t)}(?=\s|>)`,`gi`);r.lastIndex=n;let a=r.exec(e);if(!a||a.index==null)return null;let o=i(a.index);return o?{start:a.index,end:o.end}:null},o=-1,s=-1,c=Math.max(0,n);for(;c<e.length;){let t=e.indexOf(`<`,c);if(t===-1)return null;let n=i(t);if(!n)return null;if(!n.closing&&n.tag===r){o=t,s=n.end-1;break}if(!n.closing&&MC.has(n.tag)){c=a(n.tag,n.end)?.end??e.length;continue}c=n.end}if(o===-1||s===-1)return null;let l=e.slice(o,s+1);if(ey.has(r)||OC.test(l))return{raw:l,start:o,end:s+1,closed:!0};if(MC.has(r)){let t=a(r,s+1);return t?{raw:e.slice(o,t.end),start:o,end:t.end,closeStart:t.start,closed:!0}:{raw:e.slice(o),start:o,end:e.length,closed:!1}}let u=1,d=s+1;for(;d<e.length;){let t=e.indexOf(`<`,d);if(t===-1)return{raw:e.slice(o),start:o,end:e.length,closed:!1};let n=i(t);if(!n)return null;if(n.closing&&n.tag===r){u--;let r=n.end;if(u===0)return{raw:e.slice(o,r),start:o,end:r,closeStart:t,closed:!0};d=r;continue}if(!n.closing&&n.tag===r){!n.selfClosing&&!ey.has(n.tag)&&u++,d=n.end;continue}if(!n.closing&&MC.has(n.tag)){d=a(n.tag,n.end)?.end??e.length;continue}d=n.end}return{raw:e.slice(o),start:o,end:e.length,closed:!1}}function PC(e,t){if(!t)return 0;let n=0,r=0;for(;n<e.length&&r<t.length;){if(e[n]===t[r]){n++,r++;continue}if(e[n]===`\r`||e[n]===`
101
+ `){n++;continue}return-1}return r===t.length?n:-1}function FC(e,t,n){return n?e:`${e.replace(/<[^>]*$/,``)}\n</${t}>`}function IC(e){return e.replace(/\r\n/g,`
102
+ `).replace(/(^|\n)[ \t]{1,4}/g,`$1`)}function LC(e,t,n){return n?e.includes(n,t)?!0:IC(e.slice(Math.max(0,t))).includes(IC(n)):!1}function RC(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;return e[n]===`\r`?(n++,e[n]===`
103
+ `&&n++,n):e[n]===`
104
+ `?n+1:t}function zC(e,t){let n=SC(String.raw`<\s*\/\s*${Dy(t)}(?=\s|>)`,`gi`),r=-1,i;for(;(i=n.exec(e))!==null;)r=i.index;return r}var BC=/^\s*(?:<!--|<!|<\?)/,VC=/^\s*<([A-Z][\w:-]*)/i,HC=/\/\s*>$/,UC=/<[^>]*$/;function WC(e,t,n){let r=t.toLowerCase(),i=SC(String.raw`^<\s*${r}(?=\s|>|/)`,`i`),a=SC(String.raw`^<\s*\/\s*${r}(?=\s|>)`,`i`),o=0,s=Math.max(0,n);for(;s<e.length;){let t=e.indexOf(`<`,s);if(t===-1)return-1;let n=e.slice(t);if(a.test(n)){let e=Oy(n);if(e===-1)return-1;if(o===0)return t+e+1;o--,s=t+e+1;continue}if(i.test(n)){let e=Oy(n);if(e===-1)return-1;let r=n.slice(0,e+1);HC.test(r)||o++,s=t+e+1;continue}s=t+1}return-1}function GC(e){let t=String(e.content??``);if(BC.test(t))return{type:`html_block`,content:t,raw:t,tag:``,loading:!1};let n=(t.match(VC)?.[1]||``).toLowerCase();if(!n)return{type:`html_block`,content:t,raw:t,tag:``,loading:!1};let r=Oy(t),i=r===-1?t:t.slice(0,r+1),a=r!==-1&&HC.test(i),o=ey.has(n),s=ky(i),c=(r===-1?-1:WC(t,n,r+1))!==-1,l=!(o||a||c);return{type:`html_block`,content:l?`${t.replace(UC,``)}\n</${n}>`:t,raw:t,tag:n,attrs:s.length?s:void 0,loading:l}}function KC(e,t,n){let r=fb(n)?n.sourceLineMapper:void 0;if(!r)return{startLine:e,endLine:t};let i=r(e),a=t>e?r(t-1).endLine:r(t).startLine;return{startLine:i.startLine,endLine:Math.max(i.startLine,a)}}function qC(e,t){let n=Math.max(0,Math.min(e.length,Math.trunc(t))),r=0;for(let t=0;t<n;t++)e[t]===`
105
+ `&&r++;return r}function JC(e,t,n){let r=Math.max(0,Math.min(e.length,Math.trunc(t))),i=Math.max(r,Math.min(e.length,Math.trunc(n))),a=qC(e,r),o=qC(e,i);return i>r&&e[i-1]!==`
106
+ `&&o++,{startLine:a,endLine:o}}function YC(e,t,n,r){let i=JC(e,t,n);return KC(i.startLine,i.endLine,r)}function XC(e,t){let n=e?.map;if(!Array.isArray(n)||n.length<2)return null;let r=Number(n[0]),i=Number(n[1]);return!Number.isFinite(r)||!Number.isFinite(i)?null:KC(r,i,t)}function ZC(e,t,n){if(!n?.includeSourceMap)return e;let r=XC(t,n);if(!r)return e;if(e.sourceMap=r,e.type===`code_block`){let t=e;t.startLine=r.startLine,t.endLine=r.endLine}return e}function QC(e,t,n,r){if(!r?.includeSourceMap)return e;let i=t?.map;if(!Array.isArray(i)||i.length<2)return e;let a=Number(i[0]),o=Number(i[1]),s=Number(n);return!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s)||(e.sourceMap=KC(a,Math.max(o,s),r)),e}function $C(e){let t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(e=>[...e])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(e=>$C(e))),t}function ew(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function tw(e,t,n){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(!i||!(`value`in i))continue;let a=Object.getOwnPropertyDescriptor(t,r);(!a||`value`in a&&a.writable!==!1)&&(t[r]=nw(i.value,n))}}function nw(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;let n=e,r=t.get(n);if(r)return r;if(Array.isArray(e)){let r=[];t.set(n,r);for(let n of e)r.push(nw(n,t));return r}if(e instanceof Map){let r=new Map;t.set(n,r);for(let[n,i]of e)r.set(nw(n,t),nw(i,t));return r}if(e instanceof Set){let r=new Set;t.set(n,r);for(let n of e)r.add(nw(n,t));return r}if(e instanceof Date){let r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){let r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<`u`&&e instanceof URL){let r=new URL(e.href);return t.set(n,r),tw(n,r,t),r}if(typeof URLSearchParams<`u`&&e instanceof URLSearchParams){let r=new URLSearchParams(e.toString());return t.set(n,r),tw(n,r,t),r}if(e instanceof Error){let r,i=e.constructor;try{r=new i(e.message)}catch{r=Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),tw(n,r,t),r}if(typeof Promise<`u`&&e instanceof Promise||typeof Node<`u`&&e instanceof Node)return t.set(n,e),e;if(!ew(e)){let r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),tw(n,r,t),r}let i={};t.set(n,i);let a=e;for(let e of Object.keys(a))i[e]=nw(a[e],t);return i}function rw(e,t){for(let n=0;n<t.length;n++){let r=Object.getOwnPropertyDescriptor(e,t[n]);if(t[n]===`__proto__`||!r||!(`value`in r)||r.writable!==!0||r.configurable!==!0)return!1}return!0}function iw(e,t=!0){if(!t)return $C(e);let n=Reflect.ownKeys(e),r=Object.keys(e);if(n.length===r.length&&rw(e,r))try{return aw(e,r,t)}catch{return ow(e,t)}return ow(e,t)}function aw(e,t,n){let r=Object.getPrototypeOf(e),i={},a=new WeakMap,o=e.children,s=e.attrs,c=e.map,l=e;for(let e=0;e<t.length;e++){let r=t[e],u=l[r];if(r===`children`&&Array.isArray(o)){let e=Array(o.length);for(let t=0;t<o.length;t++)e[t]=iw(o[t],n);i[r]=e}else if(r===`attrs`&&Array.isArray(s)){let e=Array(s.length);for(let t=0;t<s.length;t++){let n=s[t];e[t]=[n[0],n[1]]}i[r]=e}else i[r]=r===`map`&&Array.isArray(c)?[c[0],c[1]]:n&&u&&typeof u==`object`?nw(u,a):u}return Object.setPrototypeOf(i,r),i}function ow(e,t=!0){let n=Object.create(Object.getPrototypeOf(e)),r=new WeakMap;for(let i of Reflect.ownKeys(e)){let a=Object.getOwnPropertyDescriptor(e,i);if(!a)continue;if(!(`value`in a)){Object.defineProperty(n,i,a);continue}let o=a.value,s=o;i===`attrs`&&Array.isArray(o)?s=o.map(e=>[...e]):i===`map`&&Array.isArray(o)?s=[...o]:i===`children`&&Array.isArray(o)?s=o.map(e=>iw(e,t)):t&&o&&typeof o==`object`&&(s=nw(o,r)),Object.defineProperty(n,i,{...a,value:s})}return n}function sw(e,t=!0){return e.map(e=>iw(e,t))}function cw(e,t){let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function lw(e){return e===` `||e===` `}function uw(e,t){return t===` `?e+1:e+4-e%4}function dw(e){let t=0,n=0;for(;t<e.length&&lw(e[t]);)n=uw(n,e[t]),t++;return{index:t,column:n}}function fw(e){let t=dw(e);return t.column>3?null:t}function pw(e){let t=fw(e);if(!t)return null;let n=t.index,r=e[n];if(r!=="`"&&r!==`~`)return null;let i=n;for(;i<e.length&&e[i]===r;)i++;let a=i-n;if(a<3)return null;let o=e.slice(i);return r==="`"&&o.includes("`")?null:{markerChar:r,markerLen:a,rest:o}}function mw(e){let t=fw(e);if(!t)return null;let n=e.slice(t.index),r=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!r)return null;let i=t.index+r.length,a=t.column+r.length;if(!lw(e[i]))return null;for(;i<e.length&&lw(e[i]);)a=uw(a,e[i]),i++;return{content:e.slice(i),contentIndent:a}}function hw(e){let t=e,n=!1;for(;;){let e=fw(t);if(!e)return n?t:null;let r=e.index;if(t[r]!==`>`)return n?t:null;n=!0,r++,(t[r]===` `||t[r]===` `)&&r++,t=t.slice(r)}}function gw(e){let t=pw(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};let n=hw(e),r=n==null?null:pw(n);if(r)return{...r,inBlockquote:!0,inList:!1,listIndent:0};let i=mw(e);if(!i)return null;let a=pw(i.content);return a==null?null:{...a,inBlockquote:!1,inList:!0,listIndent:i.contentIndent}}function _w(e,t,n){let r=t;for(;r<e.length&&e[r]===n;)r++;return r-t}function vw(e,t,n){let r=t;for(;r<e.length;){let t=e.indexOf("`",r);if(t===-1)return-1;let i=_w(e,t,"`");if(i===n)return t;r=t+i}return-1}var yw=[`$`,`\\[`],bw=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/;function xw(){return{fenceChar:``,fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function Sw(e){return{...e}}function Cw(e,t,n,r=Fw(t).state,i={lineOffset:0,windowStart:0}){e.tolerantMathBoundary={explicitBracketMath:r,source:t,key:n,pendingCandidate:n===null&&cC(t,i),scanWindow:i}}function ww(e){return e.endsWith(`$`)||e.endsWith(`\\`)}function Tw(e){let t=Math.max(e.lastIndexOf(`
107
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,``);return yw.some(e=>n.endsWith(e))}function Ew(e,t){return t?!!(t.includes(`$$`)||t.includes(`\\[`)||e.endsWith(`$`)&&t[0]===`$`||e.endsWith(`\\`)&&t[0]===`[`||Tw(e)&&/[\r\n]/.test(t)):!1}function Dw(e,t){let n=!1,r=``,i=0,a=!1,o=!1,s=0,c=null,l=0;for(;l<t;){let u=e.indexOf(`
108
+ `,l),d=u===-1||u>=t?t:u,f=e.slice(l,d),p=f.endsWith(`\r`)?f.slice(0,-1):f,m=dw(p),h=mw(p);n&&a&&p.trim()&&hw(p)==null&&(n=!1,r=``,i=0,a=!1,o=!1,s=0),n&&o&&p.trim()&&m.column<s&&!h&&(n=!1,r=``,i=0,a=!1,o=!1,s=0),h?c=h.contentIndent:p.trim()&&c!=null&&m.column<c&&!n&&(c=null);let g=gw(p);if(g&&(n?g.markerChar===r&&g.markerLen>=i&&/^\s*$/.test(g.rest)&&(n=!1,r=``,i=0,a=!1,o=!1,s=0):(n=!0,r=g.markerChar,i=g.markerLen,a=g.inBlockquote,o=g.inList||c!=null&&!g.inBlockquote&&m.column>=c,s=g.listIndent||c||0)),u===-1||u>=t)break;l=u+1}return n}function Ow(e,t){let n=e=>e===` `||e===` `,r=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},i=e=>{if(e[0]!==`<`)return null;let t=1;for(;t<e.length&&n(e[t]);)t++;let i=e[t]===`/`;if(i)for(t++;t<e.length&&n(e[t]);)t++;let a=t;for(;t<e.length&&r(e[t]);)t++;if(t===a)return null;let o=e.slice(a,t).toLowerCase();if(!ty.has(o))return null;let s=e[t];if(s&&s!==` `&&s!==` `&&s!==`>`&&s!==`/`)return null;let c=Oy(e);if(c===-1)return null;let l=c-1;for(;l>=0&&n(e[l]);)l--;return{closing:i,tag:o,selfClosing:!i&&e[l]===`/`,after:e.slice(c+1)}},a=(e,t)=>{let r=e.toLowerCase(),i=0;for(;i<r.length;){let e=r.indexOf(`</`,i);if(e===-1)return!1;for(i=e+2;i<r.length&&n(r[i]);)i++;if(r.startsWith(t,i)){let e=r[i+t.length];if(!e||e===` `||e===` `||e===`>`)return!0}}return!1},o=[],s=!1,c=!1,l=!1,u=0;for(;u<t;){let n=e.indexOf(`
109
+ `,u),r=n===-1||n>=t?t:n,d=e.slice(u,r),f=d.endsWith(`\r`)?d.slice(0,-1):d,p=fw(f);if(p){let e=f.slice(p.index);if(s)s=!e.includes(`-->`);else if(c)c=!e.includes(`>`);else if(l)l=!e.includes(`?>`);else if(e.startsWith(`<!--`))s=!e.includes(`-->`);else if(e.startsWith(`<?`))l=!e.includes(`?>`);else if(e.startsWith(`<!`))c=!e.includes(`>`);else{let t=i(e);if(t){if(t.closing){for(let e=o.length-1;e>=0;e--)if(o[e]===t.tag){o.length=e;break}}else t.selfClosing||a(t.after,t.tag)||o.push(t.tag)}}}if(n===-1||n>=t)break;u=n+1}return s||c||l||o.length>0}function kw(e,t,n){if(!n?.length)return!1;let r=new Set(Ny(n));if(!r.size)return!1;let i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},a=e=>e===` `||e===` `,o=e=>{if(e[0]!==`<`)return null;let t=1;for(;t<e.length&&a(e[t]);)t++;let n=e[t]===`/`;if(n)for(t++;t<e.length&&a(e[t]);)t++;let o=t;for(;t<e.length&&i(e[t]);)t++;if(t===o)return null;let s=e.slice(o,t).toLowerCase();if(!r.has(s))return null;let c=e[t];if(c&&c!==` `&&c!==` `&&c!==`>`&&c!==`/`)return null;let l=e.indexOf(`>`,t);if(l===-1)return null;let u=l-1;for(;u>=0&&a(e[u]);)u--;return{closing:n,tag:s,selfClosing:!n&&e[u]===`/`,after:e.slice(l+1)}},s=(e,t)=>{let n=e.toLowerCase(),r=0;for(;r<n.length;){let e=n.indexOf(`</`,r);if(e===-1)return!1;for(r=e+2;r<n.length&&a(n[r]);)r++;if(n.startsWith(t,r)){let e=n[r+t.length];if(!e||e===` `||e===` `||e===`>`)return!0}}return!1},c=[],l=0;for(;l<t;){let n=e.indexOf(`
110
+ `,l),r=n===-1||n>=t?t:n,i=e.slice(l,r),a=i.endsWith(`\r`)?i.slice(0,-1):i,u=fw(a);if(u){let e=o(a.slice(u.index));if(e){if(e.closing){for(let t=c.length-1;t>=0;t--)if(c[t]===e.tag){c.length=t;break}}else e.selfClosing||s(e.after,e.tag)||c.push(e.tag)}}if(n===-1||n>=t)break;l=n+1}return c.length>0}function Aw(e,t){let n=bw.exec(e);if(!n)return null;let r=n[1]??``,i=n.index+r.length,a=e.indexOf(`
111
+ `,i),o=e.slice(i,a===-1?e.length:a);return!fw(o.endsWith(`\r`)?o.slice(0,-1):o)||Dw(e,i)||Ow(e,i)||kw(e,i,t)?null:`${e.slice(0,n.index)}${r}`}function jw(e){e.inFence=!1,e.fenceChar=``,e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function Mw(e,t,n,r,i){let a=0,o=!1;for(;a<e.length;){let s=a;if(t.inMath){if(e.startsWith(`\\]`,a)&&!cw(e,s)){r!=null&&i&&n+a+2>r&&(o=!0),t.inMath=!1,t.mathOpenOffset=null,a+=2;continue}a++;continue}if(t.inDollarMath){if(e.startsWith(`$$`,a)&&!cw(e,s)){r!=null&&i&&n+a+2>r&&(o=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,a+=2;continue}a++;continue}if(e[a]==="`"&&!cw(e,s)){let t=_w(e,a,"`"),n=vw(e,a+t,t);if(n===-1)break;a=n+t;continue}if(e.startsWith(`\\[`,a)&&!cw(e,s)){t.inMath=!0,t.mathOpenOffset=n+a,a+=2;continue}if(e.startsWith(`$$`,a)&&!cw(e,s)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+a,a+=2;continue}a++}return o}function Nw(e,t,n=!0){let r=t.markdownIt;if(!mS(r))return e;let i=n?t.pendingExplicitMathTail:void 0,a=i?.source===e?i.state:i&&t.sourceExtends(i.source,e)?Iw(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Fw(e).state;n&&(t.pendingExplicitMathTail={source:e,state:a});let{context:o}=a,s=o.inMath?o.mathOpenOffset:o.inDollarMath?o.dollarMathOpenOffset:null;if(s==null)return e;let c=e.slice(s+2),l=e.lastIndexOf(`
112
+ `,s-1)+1;if(e.slice(l,s).trim()!==``&&!/^\r?\n/.test(c)||/^\s*!\[/.test(c))return e;let u=c.trim(),d=/^(?:[a-z]|pi)$/i.test(u);return lS(c)&&!d?e:e.slice(0,s)}function Pw(e,t,n,r,i){let a=dw(e),o=mw(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&hw(e)==null&&jw(t),t.inFence&&t.fenceInList&&e.trim()&&a.column<t.fenceListIndent&&!o&&jw(t),o?t.listContentIndent=o.contentIndent:e.trim()&&t.listContentIndent!=null&&a.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){let o=gw(e);if(o)t.inFence?o.markerChar===t.fenceChar&&o.markerLen>=t.fenceLen&&/^\s*$/.test(o.rest)&&jw(t):(t.inFence=!0,t.fenceChar=o.markerChar,t.fenceLen=o.markerLen,t.fenceInBlockquote=o.inBlockquote,t.fenceInList=o.inList||t.listContentIndent!=null&&!o.inBlockquote&&a.column>=t.listContentIndent,t.fenceListIndent=o.listIndent||t.listContentIndent||0);else if(!t.inFence)return Mw(e,t,n,r,i)}else return Mw(e,t,n,r,i);return!1}function Fw(e,t=xw(),n=null,r=!1,i=0){let a=Sw(t),o=Sw(t),s=``,c=!1,l=0;for(;l<e.length;){let t=e.indexOf(`
113
+ `,l),u=t!==-1,d=u&&t>l&&e[t-1]===`\r`?t-1:u?t:e.length,f=e.slice(l,d);Pw(f,a,i+l,n,r)&&(c=!0),u?(o=Sw(a),s=``):s=f,l=u?t+1:e.length}return{closedOpenMath:c,state:{committedContext:o,context:a,lineBuffer:s}}}function Iw(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&(!e.lineBuffer.endsWith(`\\`)||t[0]!==`[`&&t[0]!==`]`)?{closedOpenMath:!1,state:{committedContext:Sw(e.committedContext),context:Sw(e.context),lineBuffer:e.lineBuffer+t}}:Fw(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Lw(e,t){let n=e.markdownIt;if(!mS(n)||typeof n.stream?.reset!=`function`)return;let r=e.tolerantMathBoundary;if(r?.source===t)return;let i=r?e.sourceExtends(r.source,t):!1,a=i&&r?t.slice(r.source.length):``,o=i&&r?Iw(r.explicitBracketMath,a,r.source.length-r.explicitBracketMath.lineBuffer.length):Fw(t),s=o.state,c=i&&r?o.closedOpenMath:!1;if(r&&i&&r.key===null&&r.pendingCandidate===!1&&!c&&!Ew(r.source,a)&&!ww(t)){r.source=t,r.explicitBracketMath=s;return}let l=i&&r?r.scanWindow:{lineOffset:0,windowStart:0},u=lC(t,l);(r&&(r&&!i||r.key!==u||c)||!r&&u)&&e.resetStreamOnly(),Cw(e,t,u,s,l)}function Rw(e){let t=e.tolerantMathBoundary;return typeof t?.key==`string`&&t.key.startsWith(`pending:`)}function zw(e){let t=!1,n=``,r=0,i=!1,a=!1,o=!1,s=0,c=(e,s)=>{let c=gw(e);if(c){t?c.markerChar===n&&c.markerLen>=r&&/^\s*$/.test(c.rest)&&(t=!1,n=``,r=0):(t=!0,n=c.markerChar,r=c.markerLen);return}if(t)return;let l=0;for(;l<e.length;){if(i){e.startsWith(`$$`,l)&&!cw(e,l)?(i=!1,l+=2):l++;continue}if(a){e.startsWith(`\\]`,l)&&!cw(e,l)?(a=!1,l+=2):l++;continue}let t=e[l];if(t==="`"){let t=_w(e,l,"`"),n=vw(e,l+t,t);if(n===-1)break;l=n+t;continue}if(t===`\\`){let t=e[l+1];t===`[`&&!cw(e,l)?(a=!0,l+=2):(t===`]`&&cw(e,l),l+=2);continue}if(t===`$`){if(e[l+1]===`$`&&!cw(e,l)){i=!0,o=!1,l+=2;continue}if(o){o=!1,l++;continue}let t=e[l+1];(t===void 0||t!==` `&&t!==` `&&!/\d/.test(t))&&(o=!0),l++;continue}l++}};return{scanTo:t=>{for(;s<t;){let n=e.indexOf(`
114
+ `,s),r=n===-1||n>=t?t:n,i=r>s&&e[r-1]===`\r`?r-1:r;if(c(e.slice(s,i),s),n===-1||n>=t){s=t;break}o=!1,s=n+1}},inMath:()=>i||a||o}}function Bw(){return typeof performance<`u`?performance.now():Date.now()}function Vw(e,t){let n=t.__markstreamFinal===!0?`final`:`streaming`,r=e.streamParseEnvs.get(n);r||(r={},e.streamParseEnvs.set(n,r));for(let e of Object.keys(r))Object.prototype.hasOwnProperty.call(t,e)||delete r[e];return Object.assign(r,t),r}function Hw(e,t){let n=e.markdownIt,r=n.stream,i=t.streamParse??`auto`;return t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&(i===!0||i===`auto`&&t.final!==!0)&&r?.enabled===!0&&typeof r.parse==`function`}function Uw(e,t){let n=e.markdownIt,r=t.streamParse??`auto`,i=n.stream;return t.final===!0&&r===`auto`&&t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&i?.enabled===!0&&typeof i.reset==`function`}function Ww(e,t){return Uw(e,t)?(e.resetForFinalAutoParse(),!0):!1}function Gw(e){return typeof e.preTransformTokens==`function`||typeof e.postTransformTokens==`function`}function Kw(e,t){let n=e?.map,r=t?.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((e,t)=>e===r[t])}function qw(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&Kw(e,t)}function Jw(e,t){return e[t]?.type===`paragraph_open`&&e[t+1]?.type===`inline`&&e[t+2]?.type===`paragraph_close`}function Yw(e){for(let t=0;t+5<e.length;t++)if(Jw(e,t)&&Jw(e,t+3)&&qw(e[t],e[t+3])&&qw(e[t+1],e[t+4])&&qw(e[t+2],e[t+5]))return!0;return!1}function Xw(e,t,n){return mS(e)&&cC(t)&&Yw(n)}function Zw(e){return e.topLevelStreamParseMode}function Qw(e,t,n,r,i){let a=e.markdownIt;if(r.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=r.customHtmlTags),!Hw(e,r))return r.isFragment||(e.topLevelStreamParseMode=`sync`),a.parse(t,n);if(Lw(e,t),Rw(e))return e.topLevelStreamParseMode=`sync`,a.parse(t,n);e.markStreamParseStarted();let o=a.stream.parse(t,Vw(e,n));if(Xw(a,t,o))return e.resetStreamOnly(),e.topLevelStreamParseMode=`sync`,a.parse(t,n);if(e.topLevelStreamParseMode=a.stream?.stats?.()?.lastMode??`stream`,!Gw(r))return o;if(!i?.recordTokenCloneMs)return sw(o,!0);let s=Bw(),c=sw(o,!0);return i.recordTokenCloneMs(Bw()-s),c}var $w=new Set([`code_inline`,`em_close`,`em_open`,`emoji`,`hardbreak`,`html_block`,`html_inline`,`image`,`ins_close`,`ins_open`,`link`,`link_close`,`link_open`,`mark_close`,`mark_open`,`math_inline`,`s_close`,`s_open`,`softbreak`,`strong_close`,`strong_open`,`sub`,`sup`,`text`]),eT=new Map([[`paragraph_open`,`paragraph_close`],[`heading_open`,`heading_close`],[`bullet_list_open`,`bullet_list_close`],[`ordered_list_open`,`ordered_list_close`],[`blockquote_open`,`blockquote_close`],[`table_open`,`table_close`]]),tT=new Set([`code_block`,`fence`,`hr`,`html_block`,`inline`,`math_block`]);function nT(e,t){return e.every(e=>{if(!$w.has(e.type)||(e.type===`link`||e.type===`link_open`||e.type===`link_close`)&&!px(t))return!1;if(e.type===`link`){let t=dx(e);if(t!==`explicit`&&t!==`linkify`&&t!==`autolink`)return!1}if(e.type===`link_open`||e.type===`link_close`){let t=e.markup??``;if(t!==``&&t!==`linkify`&&t!==`autolink`)return!1}let n=e.children;return!Array.isArray(n)||nT(n,t)})}function rT(e){let t=eT.get(e);if(t)return t;let n=/^container_(.+)_open$/.exec(e);return n?`container_${n[1]}_close`:void 0}function iT(e,t,n=0){let r=[],i=!1,a=n;for(;a<e.length;){let n=e[a];if(!n||n.level!==0)return null;let o=rT(n.type),s=a+1;if(o){if(n.nesting!==1)return null;for(;s<e.length;){let t=e[s];if(t.level===0){if(t.type!==o||t.nesting!==-1)return null;s++;break}s++}if(e[s-1]?.type!==o)return null;if(n.type===`paragraph_open`||n.type===`heading_open`){if(s!==a+3||e[a+1]?.type!==`inline`)return null}else i=!0}else if(tT.has(n.type)){if(n.nesting!==0)return null;i=!0}else return null;for(let n=a;n<s;n++){let r=e[n];if(r.type!==`inline`)continue;let i=r.children;if(!Array.isArray(i)||!nT(i,t))return null}r.push(a),a=s}return{mixed:i,starts:r}}function aT(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function oT(e){return e.reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function sT(e,t){let n=e?.map,r=t?.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((e,t)=>e===r[t])}function cT(e,t){let n=e?.attrs,r=t?.attrs;if(n===r)return!0;if(!Array.isArray(n)||!Array.isArray(r)||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t[0]!==i[0]||t[1]!==i[1])return!1}return!0}function lT(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.level===t.level&&e.markup===t.markup&&e.content===t.content&&e.info===t.info&&sT(e,t)&&cT(e,t)}function uT(e,t,n,r,i,a,o,s=0,c){let l=r.starts;if(l.length===0||i.length!==l.length){e.structuredStream=void 0;return}let u=l.map((e,t)=>{let r=l[t+1]??n.length;return{firstToken:n[e],lastToken:n[r-1],tokenCount:r-e}}),d=r.mixed?Math.max(0,l.length-1):aT(t)?l.length:Math.max(0,l.length-1),f=d-s-1,p=f>=0?o?.[f]:c;e.structuredStream={groupBoundaries:u,groupStarts:l,tokenCount:n.length,tokens:n,mixed:r.mixed,source:t,nodes:i,linkifyDemotionContext:p,stableGroupCount:d,requireClosingStrong:a.requireClosingStrong,validateLink:a.validateLink}}function dT(e,t,n,r){if(e.tokens===t)return!0;let i=n.length-1;for(let a=0;a<r;a++){let r=n[a],o=n[a+1]??t.length,s=e.groupBoundaries[a];if(!s||s.tokenCount!==o-r||(s.firstToken!==t[r]||s.lastToken!==t[o-1])&&(a>=i||!lT(s.firstToken,t[r])||!lT(s.lastToken,t[o-1])))return!1}return!0}function fT(e,t,n,r,i){let a=r.disableStructuredReuse,o=Hw(e,r)&&oT(r);if(r.isFragment||(e.structuredReuseTailStart=void 0),!o)return a||(e.structuredStream=void 0),i.processTokens(n,r);if(a)return i.processTokens(n,r);let s=e.structuredStream,c=Zw(e),l=!!s&&(c===`append`||c===`tail`)&&s.tokenCount!==void 0&&s.tokenCount<=n.length&&n===s.tokens,u;if(l){let e=iT(n,r.validateLink,s.tokenCount);u=e?{starts:s.groupStarts.concat(e.starts),mixed:s.mixed||e.mixed}:iT(n,r.validateLink)}else u=iT(n,r.validateLink);if(!u)return e.structuredStream=void 0,i.processTokens(n,r);let d=u.starts,f=s&&u.mixed?Math.min(s.stableGroupCount,Math.max(0,s.groupBoundaries.length-1)):s?.stableGroupCount??0;if(s&&f>0&&s.requireClosingStrong===r.requireClosingStrong&&s.validateLink===r.validateLink&&e.sourceExtends(s.source,t)&&d.length>=f&&(c===`append`||c===`tail`)&&dT(s,n,d,f)){let a=d[f]??n.length,o={...r,linkifyDemotionSeedContext:s.linkifyDemotionContext},c=i.processTokens(n.slice(a),o),l=d.length-f;if(c.length===l){let a=s.nodes.slice(0,f).concat(c);return e.structuredReuseTailStart=f,i.recordReusedTopLevelNodes?.(f),uT(e,t,n,u,a,r,o.linkifyDemotionResultContexts,f,s.linkifyDemotionContext),a}}let p=i.processTokens(n,r);return uT(e,t,n,u,p,r,r.linkifyDemotionResultContexts),p}function pT(e){if(e.type!==`html_block`||String(e.tag??``).toLowerCase()!==`details`)return!1;let t=String(e.raw??e.content??``);return/^\s*<details\b/i.test(t)}function mT(e){if(e.type!==`html_block`)return!1;let t=String(e.raw??e.content??``);return/^\s*<\/details\b/i.test(t)}function hT(e,t){return hb(e,{final:t,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink},{disableStreamParse:!0,disableStructuredReuse:!0,isFragment:!0})}var gT=new Set([`admonition`,`blockquote`,`code_block`,`definition_list`,`footnote`,`heading`,`list`,`math_block`,`table`,`thematic_break`]),_T=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m,vT=/(?:^|\n)(?: {4}|\t)(?![ \t]*<)\S/m;function yT(e){return/\n\s*\n/.test(e)||_T.test(e)||vT.test(e)}function bT(e){if(e.length===0)return!1;if(e.some(e=>gT.has(String(e?.type??``).toLowerCase()))||e.some(e=>{if(e?.type!==`html_block`)return!1;let t=e;return Array.isArray(t.children)&&t.children.length>0})||e.length>1)return!0;let[t]=e;return!!(t&&t.type===`paragraph`)}function xT(e){let t=[],n=0;for(;n<e.length;){for(;/\s/.test(e[n]??``);)n++;if(n>=e.length)break;let r=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!r?.[1])return null;let i=NC(e,r[1],n);if(!i||i.start!==n)return null;t.push(i.raw),n=i.end}return t.length>1?t:null}function ST(e,t,n){return e.trim()?t.parseFragment(e,n):[]}function CT(e,t,n,r,i){let a=n.customHtmlTags?.join(`\0`)??``,o=n.runtime,s=i?o?.siblingHtmlChildren:void 0,c=s&&s.final===r&&s.customHtmlTags===a&&s.requireClosingStrong===n.requireClosingStrong&&s.validateLink===n.validateLink,l=e.map((e,r)=>c&&s.blocks[r]===e?s.children[r]:ST(e,t,n));return i&&o&&(o.siblingHtmlChildren={blocks:e,children:l,customHtmlTags:a,final:r,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),l.flat()}function wT(e,t,n,r){return e.map(e=>{if(e?.type!==`html_block`)return e;let i=e,a=String(i.tag??``).toLowerCase();if(!a||a===`details`||oy.has(a)||Array.isArray(i.children))return e;let o=String(e.raw??i.content??``);if(!o)return e;let s=Oy(o);if(s===-1)return e;let c=NC(o,a,0),l=c?.closeStart??-1,u=c?.closed===!0&&l>=s+1,d=u?o.slice(s+1,l):o.slice(s+1);if(!d.trim()||!yT(d))return e;let f=hT(n,r),p=u?null:xT(d),m=!n.isFragment&&typeof n.preTransformTokens!=`function`&&typeof n.postTransformTokens!=`function`&&typeof n.postTransformNodes!=`function`&&t.markdownIt.__markstreamHasCustomParserExtensions===!1&&px(n.validateLink),h=p?CT(p,t,f,r,m):ST(d,t,f);return bT(h)&&(i.children=h),e})}function TT(e,t=0){for(let n=t;n<e.length;n++)if(e[n]?.type===`html_block`)return!0;return!1}function ET(e,t,n){let r=ST(e,t,n),i=r[0];return r.length===1&&i?.type===`paragraph`&&Array.isArray(i.children)?i.children:r}function DT(e,t,n){let r=GC({content:e}),i=Oy(e),a=zC(e,`summary`);if(i!==-1&&a!==-1&&a>=i+1){let o=ET(e.slice(i+1,a),t,n);o.length>0&&(r.children=o)}return r.raw=e,r}function OT(e,t,n){let r=Oy(e);if(r===-1)return[];let i=e.slice(r+1);if(!i.trim())return[];let a=NC(i,`summary`,0);if(!a)return ST(i,t,n);let o=i.slice(0,a.start),s=i.slice(a.end);return[...ST(o,t,n),DT(a.raw,t,n),...ST(s,t,n)]}function kT(e,t,n,r,i,a=0){let o=[],s=a;for(let a=0;a<e.length;a++){let c=e[a],l=AC(c),u=-1;if(l&&(u=t.indexOf(l,s),u!==-1&&(s=u+l.length)),!pT(c)){o.push(c);continue}let d=String(c.raw??AC(c)??``),f=u===-1?t.indexOf(d,Math.max(0,s-d.length)):u;if(f===-1){o.push(c);continue}let p=1,m=-1;for(let t=a+1;t<e.length;t++){let n=e[t];if(pT(n)){p++;continue}if(mT(n)&&(p--,p===0)){m=t;break}}let h=NC(t,`details`,f),g=m===-1&&h?.closed===!0,_=g?(()=>{let e=zC(d,`details`);return e===-1?d:d.slice(0,e)})():d,v=m===-1?`</details>`:String(e[m].raw??AC(e[m])??`</details>`),y=g||m!==-1&&h?.closed===!0,b=v.replace(/[\t\r\n ]+$/,``),x=y?(()=>{let e=(h?.raw??``).lastIndexOf(b);return e===-1?t.length:f+e})():t.length,S=Oy(d),C=S===-1?f+d.length:f+S+1,w=t.slice(C,x===-1?t.length:x),T=x+b.length,E=y?Math.max(x+v.length,RC(t,T)):t.length,D=y?t.slice(x,E):v,O=y?t.slice(f,E):t.slice(f),k=oT(r)&&(r.runtime?.structuredReuseTailStart??0)>0?r.runtime?.detailsStitchCache:void 0,ee=k?.get(c);if(ee&&ee.openRaw===d&&ee.explicitClose===y&&ee.closeSliceEnd===E&&ee.middleSource===w){if(o.push(ee.node),s=y?E:t.length,m===-1&&!g)break;m!==-1&&(a=m);continue}let[A]=kT(g?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,r,i,f+d.length),j=OT(_,n,hT(r,i)),te=A,M=A[0];if(!j.some(e=>{let t=e;return t?.type===`html_block`&&String(t.tag??``).toLowerCase()===`summary`})){if(M?.type===`html_block`&&String(M.tag??``).toLowerCase()===`summary`&&!Array.isArray(M.children))te=[DT(String(M.raw??M.content??``),n,hT(r,i)),...A.slice(1)];else if(S!==-1){let e=NC(t,`summary`,f+S+1);if(e&&e.closed){let a=t.slice(f+S+1,e.start);/^[\t \r\n]*$/.test(a)&&(j=[DT(e.raw,n,hT(r,i)),...j])}}}let N=n.markdownIt.parse(w,{__markstreamFinal:i}),P=n.markdownIt.renderer.render(N,n.markdownIt.options,{__markstreamFinal:i}),F=S===-1?d:t.slice(f,f+S+1),ne={...c,tag:`details`,attrs:ky(d.slice(0,S+1)),raw:O,content:`${F}${P}${D}`,children:[...j,...te],loading:!i&&!y};if(r.includeSourceMap&&(ne.sourceMap=YC(t,f,y?E:t.length,r)),k&&y&&k.set(c,{openRaw:d,explicitClose:y,closeSliceEnd:E,middleSource:w,node:ne}),o.push(ne),s=y?E:t.length,m===-1&&!g)break;m!==-1&&(a=m)}return[o,s]}function AT(e,t,n,r,i,a=0){if(!n)return e;let o=e.slice(),s=a;for(let e=0;e<o.length;e++){let a=o[e],c=AC(a),l=c?n.indexOf(c,s):-1;if(a?.type!==`html_block`){l!==-1&&(s=l+c.length);continue}let u=String(a.tag??``).toLowerCase();if(!u)continue;if(u===`details`){l!==-1&&(s=l+c.length);continue}let d=NC(n,u,l===-1?s:l);if(!d)continue;s=d.end;let f=String(a.content??c),p=String(a.raw??f),m=l+p.length;if(l!==-1&&d.end<m&&n.slice(l,m)===p){s=m,i?.includeSourceMap&&(a.sourceMap=YC(n,l,m,i));continue}let h=FC(d.raw,u,d.closed),g=!t&&!d.closed,_=f!==h||p!==d.raw||!!a.loading!==g,v=Oy(d.raw),y=v===-1?``:d.raw.slice(0,v+1),b=y?ky(y):[];if(a.content=h,a.raw=d.raw,a.loading=g,a.attrs=b.length?b:void 0,i?.includeSourceMap&&(a.sourceMap=YC(n,d.start,d.end,i)),!_)continue;let x=PC(d.raw,p);x===-1&&(x=0);let S=e+1;for(;S<o.length;){if(d.closed&&jC(o[S],u)){o.splice(S,1);continue}let e=AC(o[S]);if(!e)break;let t=d.raw.indexOf(e,x);if(t===-1){if(LC(n,d.end,e))break;let t=r.getInternalNodeSourceRange(o[S]);if(!t)break;if(t.start>=d.start&&t.end<=d.end){o.splice(S,1);continue}break}x=t+e.length,o.splice(S,1)}}return o}function jT(e){let t=e.meta??{};return{type:`checkbox`,checked:t.checked===!0,raw:t.checked?`[x]`:`[ ]`}}function MT(e){let t=e,n=t.attrGet?t.attrGet(`checked`):void 0,r=n===``||n===`true`;return{type:`checkbox_input`,checked:r,raw:r?`[x]`:`[ ]`}}function NT(e){let t=String(e.content??``);return{type:`emoji`,name:t,markup:String(e.markup??``),raw:`:${t}:`}}function PT(e,t,n,r,i=!1){let a=``,o=t+1,s=1,c=[];for(;o<e.length;){if(e[o].type===n){if(s===1)break;s--}r&&e[o].type===r&&s++;let t=e[o];a+=String(i?e[o].content??t.text??``:e[o].content??``),c.push(e[o]),o++}return{content:a,innerTokens:c,nextIndex:o<e.length?o+1:e.length}}function FT(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`em_close`,void 0,!0);return i.push(...n(o,void 0,void 0,r)),{node:{type:`emphasis`,children:i,raw:`*${a}*`},nextIndex:s}}function IT(e){return SC(`(?:^|\\r\\n|\\n|\\r) {0,3}${e}+[ \\t]*$`)}var LT=[`diff `,`index `,`--- `,`+++ `,`@@ `],RT=/\r?\n/;function zT(e){let t=String(e??``);return t?LT.some(e=>e.startsWith(t)||t.startsWith(e)):!1}function BT(e,t,n,r){n.length>0&&e.push(...n),r.length>0&&t.push(...r),n.length=0,r.length=0}function VT(e,t){return!t&&e.startsWith(` `)&&!e.startsWith(` `)?` ${e}`:e}function HT(e,t){let n=[],r=[],i=[],a=[],o=e.split(RT),s=/\r?\n$/.test(e),c=o.some(e=>e.startsWith(`diff `)||e.startsWith(`--- `)||e.startsWith(`+++ `)||e.startsWith(`@@ `)),l=e=>{let t=e;if(!LT.some(e=>t.startsWith(e))){if(t.startsWith(`-`)){let e=t.slice(1);i.push(VT(e,c))}else if(t.startsWith(`+`)){let e=t.slice(1);a.push(VT(e,c))}else{BT(n,r,i,a);let e=c&&t.startsWith(` `)?t.slice(1):t;n.push(e),r.push(e)}}},u=s?Math.max(0,o.length-1):o.length;for(let e=0;e<u;e++){let n=o[e]??``;(t||s||e!==u-1||!zT(n))&&l(n)}(t||i.length>0||a.length>0)&&BT(n,r,i,a);let d=n.join(`
115
+ `),f=r.join(`
116
+ `);return{original:t&&s&&d?`${d}\n`:d,updated:t&&s&&f?`${f}\n`:f}}function UT(e){let t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},r=typeof n.closed==`boolean`?n.closed:void 0,i=r===!0||r!==!1&&t,a=String(e.info??``),o=a.startsWith(`diff`),s=o?(()=>{let e=a,t=e.indexOf(` `);return t===-1?``:String(e.slice(t+1)??``)})():a,c=String(e.content??``);if(!i&&e.markup){let t=e.markup[0],n=IT(t);n.test(c)&&(c=c.replace(n,``))}if(o){let{original:e,updated:n}=HT(c,i===!0);return{type:`code_block`,language:s,code:String(n??``),raw:String(c??``),diff:o,loading:r===!0?!1:r===!1||!t,originalCode:e,updatedCode:n}}return{type:`code_block`,language:s,code:String(c??``),raw:String(c??``),diff:o,loading:r===!0?!1:r===!1||!t}}function WT(e){let t=e.meta??{};return{type:`footnote_reference`,id:String(t.label??``),raw:`[^${String(t.label??``)}]`}}function GT(){return{type:`hardbreak`,raw:`\\
117
+ `}}function KT(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`mark_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`highlight`,children:i,raw:`==${a}==`},nextIndex:s}}function qT(e){let t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return ny;let n=new Set(ny);for(let e of Ny(t))e&&n.add(e);return n}var JT=null,YT=new WeakMap;function XT(){return JT||={customTagSet:null,allowedTagSet:qT()},JT}function ZT(e){let t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():``}function QT(e){return/^<\s*\//.test(e)}function $T(e,t){return/\/\s*>\s*$/.test(t)||ey.has(e)}function eE(e){if(!e||e.length===0)return XT();let t=YT.get(e);if(t)return t;let n=e.map(My).filter(Boolean);if(!n.length){let t=XT();return YT.set(e,t),t}let r={customTagSet:new Set(n),allowedTagSet:qT({customHtmlTags:e})};return YT.set(e,r),r}function tE(e){let t=e,n=t.raw??t.content??t.markup??``;return String(n??``)}function nE(e){let t=e.meta,n=t?.markstreamCustomHtmlRaw,r=t?.markstreamCustomHtmlInner;return typeof n==`string`&&typeof r==`string`?{raw:n,inner:r}:null}function rE(e,t){let n=t.toLowerCase();for(let t=e.length-1;t>=0;t--){let[r,i]=e[t];if(String(r).toLowerCase()===n)return i}}function iE(e,t,n){let r=e.slice();return rE(r,`href`)||r.push([`href`,t]),n!=null&&!rE(r,`title`)&&r.push([`title`,n]),r}function aE(e){return e.map(tE).join(``)}function oE(e){let t=[],n=e=>{let n=String(e??``);if(!n)return;let r=t[t.length-1];if(r?.type===`text`){r.content=`${r.content}${n}`,r.raw=`${r.raw}${n}`;return}t.push({type:`text`,content:n,raw:n})};for(let r of e)if(r){if(r.type===`reference`||r.type===`footnote_reference`){n(String(r.raw??``));continue}if(`children`in r&&Array.isArray(r.children)){t.push({...r,children:oE(r.children)});continue}t.push(r)}return t}function sE(e,t,n){let r=0;for(let i=t;i<e.length;i++){let t=e[i];if(t.type!==`html_inline`)continue;let a=String(t.content??``),o=ZT(a),s=QT(a),c=$T(o,a);if(!s&&!c&&o===n){r++;continue}if(s&&o===n){if(r===0)return i;r--}}return-1}function cE(e,t,n){let r=[e[t]],i=[],a=t+1,o=!1,s=n?sE(e,t+1,n):-1;return s===-1?(i=e.slice(t+1),i.length&&r.push(...i),a=e.length):(i=e.slice(t+1,s),r.push(...i,e[s]),a=s+1,o=!0),{closed:o,html:aE(r),innerTokens:i,nextIndex:a}}function lE(e,t,n,r,i,a,o){let s=String(e.content??``),c=ZT(s),{customTagSet:l,allowedTagSet:u}=eE(o?.customHtmlTags);if(!c)return[{type:`inline_code`,code:s,raw:s},n+1];if(!u.has(c)&&!cE(t,n,c).closed){let t=tE(e);return[{type:`text`,content:t,raw:t},n+1]}if(c===`br`)return[{type:`hardbreak`,raw:s},n+1];let d=QT(s),f=$T(c,s);if(d)return[{type:`html_inline`,tag:c,content:s,children:[],raw:s,loading:!1},n+1];if(c===`a`){let e=cE(t,n,c),l=ky(s),u=e.innerTokens,d=String(rE(l,`href`)??``),f=rE(l,`title`),p=f==null?null:String(f),m=iE(l,d,p),h=oE(u.length?r(u,i,a,o):[]),g=u.length?aE(u):d||``;return!h.length&&g&&h.push({type:`text`,content:g,raw:g}),[{type:`link`,href:d,title:p,text:g,attrs:m,children:h,loading:!e.closed,raw:e.html||s},e.nextIndex]}if(f)return[{type:l?.has(c)?c:`html_inline`,tag:c,content:s,children:[],raw:s,loading:!1},n+1];let p=cE(t,n,c);if(c===`p`||c===`div`)return[{type:`paragraph`,children:oE(p.innerTokens.length?r(p.innerTokens,i,a,o):[]),raw:p.html},p.nextIndex];let m=oE(p.innerTokens.length?r(p.innerTokens,i,a,o):[]),h=p.html||s,g=!p.closed,_=!1;if(!p.closed){let e=`</${c}>`;h.toLowerCase().includes(e.toLowerCase())||(h+=e),_=!0,g=!0}let v=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,b;for(;(b=y.exec(s))!==null;){let e=b[1],t=b[2]||b[3]||b[4]||``;v.push([e,t])}if(l?.has(c)){let t=nE(e);return[{type:c,tag:c,attrs:v,content:t?t.inner:p.innerTokens.length?aE(p.innerTokens):``,children:p.innerTokens.length?r(p.innerTokens,i,a,o):[],raw:t?.raw??h,loading:e.loading||g,autoClosed:_},p.nextIndex]}return[{type:`html_inline`,tag:c,attrs:v,content:h,children:m,raw:h,loading:g,autoClosed:_},p.nextIndex]}function uE(e){let t=String(e.content??``);return{type:`inline_code`,code:t,raw:t}}function dE(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`ins_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`insert`,children:i,raw:`++${String(a)}++`},nextIndex:s}}function fE(e){if(e.type===`math_inline`){if(e.raw)return String(e.raw);let t=e.markup===`$$`?`$$`:`$`;return`${t}${String(e.content??``)}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(e=>fE(e)).join(``):String(e.content??``)}function pE(e){return!e||!Array.isArray(e.children)||e.children.length===0?``:e.children.map(e=>fE(e)).join(``)}function mE(e,t=!1){let n=e.attrs??[],r=null;if((!n||n.length===0)&&Array.isArray(e.children))for(let t of e.children){let e=t.attrs;if(Array.isArray(e)&&e.length>0){n=e,r=t;break}}let i=String(n.find(e=>e[0]===`src`)?.[1]??``),a=n.find(e=>e[0]===`alt`)?.[1],o=pE(r??e),s=``;o?s=o:a!=null&&String(a).length>0?s=String(a):r?.content!=null&&String(r.content).length>0?s=String(r.content):Array.isArray(r?.children)&&r.children[0]?.content?s=String(r.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?s=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(s=String(e.content));let c=n.find(e=>e[0]===`title`)?.[1]??null,l=c===null?null:String(c),u=String(e.content??``);return{type:`image`,src:i,alt:s,title:l,raw:u,loading:t}}function hE(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){let e=n?.[0];e&&t.push([String(e),String(n?.[1]??``)])}return t}function gE(e,t){let n=t.toLowerCase();for(let t=e.length-1;t>=0;t--){let[r,i]=e[t];if(String(r).toLowerCase()===n)return i}}function _E(e,t,n){let r=e.slice();return gE(r,`href`)||r.push([`href`,t]),n!=null&&!gE(r,`title`)&&r.push([`title`,n]),r}function vE(e,t,n,r){let i=e[t],a=hE(i.attrs),o=String(gE(a,`href`)??``),s=gE(a,`title`),c=s==null?null:String(s),l=_E(a,o,c),u=t+1,d=[],f=!0;for(;u<e.length&&e[u].type!==`link_close`;)d.push(e[u]),u++;e[u]?.type===`link_close`&&(f=!1);let p=d,m=d[d.length-1];if(fb(r)&&r.insideStrong&&m?.type===`text`&&String(m.content??``).endsWith(`**`)&&!d.some(e=>e.type===`strong_open`)){let e=String(m.content??``),t=String(m.raw??e),n=$C(m);n.content=e.slice(0,-2),n.raw=t.replace(/\*\*$/,``),p=d.slice(),p[p.length-1]=n}let h=n(p,void 0,void 0,r),g=h.map(e=>{let t=e;return`content`in e?String(t.content??``):String(t.raw??``)}).join(``);return{node:{type:`link`,href:o,title:c,text:g,children:h,raw:String(`[${g}](${o}${c?` "${c}"`:``})`),loading:f,attrs:l},nextIndex:u<e.length?u+1:e.length}}var yE=/\\([\\()[\]`$|*_\-!])/g,bE=new Set([`\\`,`(`,`)`,`[`,`]`,"`",`$`,`|`,`*`,`_`,`-`,`!`]),xE=1,SE=2,CE=4,wE=8,TE=16,EE=32,DE=64,OE=128,kE=256,AE=512,jE=1024,ME=1982;function NE(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=OE;break;case 36:t|=kE;break;case 40:t|=jE;break;case 42:t|=SE;break;case 91:t|=EE;break;case 92:t|=xE;break;case 93:t|=DE;break;case 95:t|=CE;break;case 96:t|=TE;break;case 124:t|=AE;break;case 126:t|=wE}return t}function PE(e){let t=``,n=0;for(;n<e.length;){if(e[n]!==`\\`){t+=e[n],n++;continue}let r=0;for(;n+r<e.length&&e[n+r]===`\\`;)r++;let i=e[n+r];if(t+=`\\`.repeat(Math.floor(r/2)),r%2==1){if(i&&bE.has(i)){t+=i,n+=r+1;continue}t+=`\\`}n+=r}return t}function FE(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(i===`\\`&&a&&bE.has(a)){if(n===t)return r+1;n++,r++;continue}if(n===t)return r;n++}return-1}function IE(e,t,n){let r=FE(e,t);if(r===-1||n&&e[r]!==n)return!1;let i=0;for(let t=r-1;t>=0&&e[t]===`\\`;t--)i++;return i%2==1}function LE(e,t){if(!e||!t)return null;let n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function RE(e,t){return String(e.markup??``).startsWith(t)}function zE(e,t,n=NE(e)){let r=e,i=String(t.content??``);return(n&xE)!==0&&r.endsWith(`\\`)&&!RE(t,`\\\\`)&&!i.endsWith(`\\\\`)&&(r=r.slice(0,-1)),(n&jE)!==0&&r.endsWith(`(`)&&!RE(t,`\\(`)&&!i.endsWith(`\\(`)&&(r=r.slice(0,-1)),(n&SE)!==0&&/\*+$/.test(r)&&!RE(t,`\\*`)&&!i.endsWith(`\\*`)&&(r=r.replace(/\*+$/,``)),r}function BE(e,t){if(!e)return;let n=String(e);if(n&&(n===t||n.replace(yE,`$1`)===t))return n}function VE(e,t,n,r,i){let a=[],{content:o,innerTokens:s,nextIndex:c}=PT(e,t,`strong_close`,`strong_open`),l={...mb(i),insideStrong:!0};return a.push(...n(s,BE(r,o),void 0,l)),{node:{type:`strong`,children:a,raw:`**${String(o)}**`},nextIndex:c}}var HE=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,UE=/:\/\//;function WE(e){return e?HE.test(e)||UE.test(e):!1}function GE(e,t,n){if(!t)return;let r=e.parseInlineTokens([{...n,type:`text`,content:t,raw:t}],t,e.pPreToken,e.options);if(r.length===1&&r[0]?.type===`text`){let t=r[0];e.pushText(String(t.content??``),String(t.raw??t.content??``));return}for(let t of r)e.pushParsed(t)}function KE(e,t){return t.endsWith(`](`)?e.tokens[e.index+1]?.type===`link_open`&&e.tokens[e.index+1]?.markup===`linkify`&&e.tokens[e.index+2]?.type===`text`&&e.tokens[e.index+3]?.type===`link_close`&&e.tokens[e.index+4]?.type===`text`&&String(e.tokens[e.index+4]?.content??``).startsWith(`)`):!1}function qE(e,t){if(JE(e,t))return;if(aD(e)){let{node:t,nextIndex:n}=vE(e.tokens,e.index,e.parseInlineTokens,e.options),r=String(t.text||t.href||``);e.pushText(r,r),e.index=n;return}e.resetCurrentTextNode();let n=e.index,{node:r,nextIndex:i}=vE(e.tokens,e.index,e.parseInlineTokens,e.options);e.index=i;let a=r.text||r.href||``;if(t.markup===`linkify`&&!ex(a,r.href,e.raw)&&sx(a,e.options.linkifyDemotionContext)){e.pushText(a,a);return}let o=r.children.length===1&&r.children[0]?.type===`text`;if(r.loading&&e.raw&&r.text===r.href&&o){let t=LE(e.raw,r.href);t&&(r.text=t,r.children=[{type:`text`,content:t,raw:t}],r.raw=String(`[${t}](${r.href}${r.title?` "${r.title}"`:``})`))}if(e.options?.validateLink&&!e.options.validateLink(r.href)){e.pushText(r.text,r.text);return}let s=t.attrs?.find(([e])=>e===`href`)?.[1],c=String(s??``);if(e.raw&&c){let t=e.raw.indexOf(`](`);if(t!==-1){let n=e.raw.indexOf(`)`,t+2);n===-1?r.loading=!0:r.loading&&e.raw.slice(t+2,n).includes(c)&&(r.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(r.href)&&QE(e,r,n-1)||YE(e,r)||e.pushParsed(r)}function JE(e,t){if(t.markup!==`linkify`)return!1;let{node:n,nextIndex:r}=vE(e.tokens,e.index,e.parseInlineTokens,e.options);return ZE(e,n,r)?(e.index=r,!0):!1}function YE(e,t){if(t.type!==`link`)return!1;let n=e.result[e.result.length-1];if(!n||n.type!==`text`)return!1;let r=String(n.content??``).match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!r)return!1;let i=t,a=String(i.href??``),o=String(i.text??``),s=String(r[2]??``),c=a.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,``);if(!a||!(o===a||o===c||WE(o)))return!1;let l=String(r[1]??``);return l?(n.content=l,n.raw=l):e.result.pop(),e.pushParsed({...t,text:s,children:[{type:`text`,content:s,raw:s}],raw:String(`[${s}](${a}${i.title?` "${i.title}"`:``})`)}),!0}function XE(e,t){if(t.type!==`link`)return!1;let n=t,r=String(n.href??``);return r?ZE(e,{href:r,title:n.title==null||n.title===``?null:String(n.title),loading:!!n.loading},e.index+1):!1}function ZE(e,t,n){let r=e.result[e.result.length-1];if(r?.type!==`image`||r.src||!r.loading||!String(r.raw??``).endsWith(`](`))return!1;let i=e.tokens[n],a=String(i?.content??``);if(i?.type!==`text`||!a.startsWith(`)`))return!1;e.result.pop(),e.currentTextNode=null;let o=String(r.alt??``);e.pushParsed({type:`image`,src:t.href,alt:o,title:t.title,raw:String(`![${o}](${t.href}${t.title?` "${t.title}"`:``})`),loading:!!t.loading});let s=a.slice(1),c=$C(i);return c.content=s,c.raw=s,e.ensureWorkingTokens()[n]=c,!0}function QE(e,t,n=e.index-1){if(t.type!==`link`)return!1;let r=e.result[e.result.length-1],i=e.tokens[n];if(!r||r.type!==`text`||i?.type!==`text`)return!1;let a=String(r.content??``),o=String(i.content??``);if(!a.endsWith(`!`)||!o.endsWith(`!`)||RE(i,`\\!`))return!1;let s=a.slice(0,-1);s?(r.content=s,r.raw=s,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null);let c=t,l=String(c.text??c.children?.map(e=>String(e?.content??e?.raw??``)).join(``)??``),u=String(c.href??``),d=c.title==null||c.title===``?null:String(c.title);return e.pushParsed({type:`image`,src:u,alt:l,title:d,raw:String(`![${l}](${u}${d?` "${d}"`:``})`),loading:!!c.loading}),!0}function $E(e,t=``,n=null){let r=String(e.alt??e.raw??``);return{type:`link`,href:t,title:n,text:r,children:[e],raw:String(`[${r}](${t}${n?` "${n}"`:``})`),loading:!0}}function eD(e){let t=e.startsWith(`![`)?e:`![${e}`,n=t.slice(2),r=n.indexOf(`](`);return{type:`image`,src:``,alt:r===-1?n.replace(/\]$/,``):n.slice(0,r),title:null,raw:t,loading:!0}}function tD(e,t){let n=t.indexOf(`[![`);if(n===-1||typeof e.raw==`string`&&e.tokens.length===1&&IE(e.raw,n,`[`))return!1;let r=t.slice(0,n);r&&e.pushText(r,r);let i=eD(t.slice(n+1));return e.pushParsed($E(i)),e.index++,!0}function nD(e,t){if(e.options?.final)return!1;let n=e.tokens[e.index-1];if(n?.type!==`text`||!String(n.content??``).endsWith(`[`)||RE(n,`\\[`))return!1;let r=e.result[e.result.length-1];if(r?.type===`text`&&r.content.endsWith(`[`)){let t=r.content.slice(0,-1);t?(r.content=t,r.raw=t,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null)}let i=mE(t);return e.pushParsed($E(i)),e.index++,!0}function rD(e,t){if(t.type!==`link`)return!1;let n=t,r=String(n.raw??``),i=String(n.text??``);if(!r.startsWith(`[![`)&&!i.startsWith(`![`))return!1;let a=n.title==null||n.title===``?null:String(n.title),o={type:`image`,src:String(n.href??``),alt:i.replace(/^!\[/,``).replace(/\]$/,``),title:a,raw:r.startsWith(`[![`)?r.slice(1):r,loading:!0};return e.pushParsed($E(o)),!0}function iD(e,t){if(!t.startsWith(`](`))return!1;let n=e.tokens[e.index-2];if(n?.type===`text`&&String(n.content??``).endsWith(`[`)&&RE(n,`\\[`))return!1;let r=e.result[e.result.length-1];if(r?.type!==`image`&&r?.type!==`link`)return!1;let i=r,a=r?.type===`link`&&Array.isArray(i.children)&&i.children.length===1&&i.children[0]?.type===`image`?e.result.pop():null,o=a?a.children[0]:e.result.pop();if(!o||o.type!==`image`)return!1;let s=e.tokens[e.index+1],c=String(a?.href??``),l=a?.title==null?null:String(a.title),u=!0;if(s?.type===`link_open`){let{node:t,nextIndex:n}=vE(e.tokens,e.index+1,e.parseInlineTokens,e.options);c=t.href,l=t.title,u=!0,e.index=n}else{if(c=t.slice(2),c.includes(`"`)){let e=c.split(`"`);c=String(e[0]??``).trim(),l=e[1]==null?null:String(e[1]).trim()}e.index++}let d=$E(o,c,l);return d.loading=u,e.pushParsed(d),!0}function aD(e){let t=e.tokens[e.index-3];return e.tokens[e.index-2]?.type===`image`&&e.tokens[e.index-1]?.type===`text`&&String(e.tokens[e.index-1].content??``)===`](`&&t?.type===`text`&&String(t.content??``).endsWith(`[`)&&RE(t,`\\[`)}function oD(e,t,n){let r=t.indexOf(`[`);if(r===-1)return!1;let i=t.slice(0,r),a=t.indexOf(`](`,r);if(a!==-1){let o=e.tokens[e.index+2],s=t.slice(r+1,a);if(s.includes(`[`)){let e=s.indexOf(`[`);i+=t.slice(0,r+e+1);let n=r+e+1;s=t.slice(n+1,a)}let c=e.tokens[e.index+1];if(t.endsWith(`](`)&&c?.type===`link_open`&&o){let t=e.tokens[e.index+4],r=4,a=!0;if(t?.type===`text`){let n=String(t.content??``);if(n.startsWith(`)`)){a=!1;let i=n.slice(1);if(i){let n=$C(t);n.content=i,n.raw=i,e.ensureWorkingTokens()[e.index+4]=n}else r++}else n===`.`&&r++}GE(e,i,n);let c=String(o.content??``);return e.options?.validateLink&&!e.options.validateLink(c)?e.pushText(s,s):e.pushParsed({type:`link`,href:c,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:a}),e.index+=r,!0}let l=t.indexOf(`)`,a),u=l===-1?``:t.slice(a+2,l),d=l===-1,f=i.match(/\*+$/);if(f&&(i=i.replace(/\*+$/,``)),GE(e,i,n),f||=s.match(/^\*+/),!e.requireClosingStrong&&f){let t=f[0].length;s=s.replace(/^\*+/,``).replace(/\*+$/,``);let n=[];if(t===1?n.push({type:`em_open`,tag:`em`,nesting:1}):t===2?n.push({type:`strong_open`,tag:`strong`,nesting:1}):t===3&&(n.push({type:`strong_open`,tag:`strong`,nesting:1}),n.push({type:`em_open`,tag:`em`,nesting:1})),n.push({type:`link`,href:u,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:d}),t===1){n.push({type:`em_close`,tag:`em`,nesting:-1});let{node:t}=FT(n,0,e.parseInlineTokens,e.options);e.pushParsed(t)}else if(t===2){n.push({type:`strong_close`,tag:`strong`,nesting:-1});let{node:t}=VE(n,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(t)}else if(t===3){n.push({type:`em_close`,tag:`em`,nesting:-1}),n.push({type:`strong_close`,tag:`strong`,nesting:-1});let{node:t}=VE(n,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(t)}else{let{node:t}=FT(n,0,e.parseInlineTokens,e.options);e.pushParsed(t)}}else e.options?.validateLink&&!e.options.validateLink(u)?e.pushText(s,s):e.pushParsed({type:`link`,href:u,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:d});let p=l===-1?``:t.slice(l+1);return p&&(e.dispatchToken({type:`text`,content:p,raw:p}),e.index--),e.index++,!0}return!1}function sD(e,t){let n=t.indexOf(`![`);if(n===-1)return!1;let r=t.slice(0,n);return r&&!e.currentTextNode?e.currentTextNode={type:`text`,content:r,raw:r}:r&&e.currentTextNode&&(e.currentTextNode.content+=r),e.currentTextNode&&=(e.result.push(e.currentTextNode),null),e.pushParsed(eD(t.slice(n))),e.index++,!0}function cD(e,t){nD(e,t)||(e.resetCurrentTextNode(),e.pushParsed(mE(t)),e.index++)}function lD(e,t){let n=t;if(t.type===`link`&&n.href!=null&&e.options.validateLink&&!e.options.validateLink(String(n.href))){e.resetCurrentTextNode();let t=String(n.text??``);e.pushText(t,t),e.index++}else rD(e,t)||XE(e,t)||QE(e,t)||YE(e,t)||e.pushToken(t),e.index++}function uD(e){let t=e.content??``,n=e.raw===`$$`?`$${t}$`:e.raw||``;return{type:`math_inline`,content:t,loading:!!e.loading,raw:n,markup:e.markup}}function dD(e){return{type:`reference`,id:String(e.content??``),raw:String(e.markup??`[${e.content??``}]`)}}function fD(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`s_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`strikethrough`,children:i,raw:`~~${a}~~`},nextIndex:s}}function pD(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`sub_close`);i.push(...n(o,void 0,void 0,r));let c=String(e[t].content??``),l=a||c;return{node:{type:`subscript`,children:i.length>0?i:[{type:`text`,content:l,raw:l}],raw:`~${l}~`},nextIndex:s}}function mD(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=PT(e,t,`sup_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`superscript`,children:i.length>0?i:[{type:`text`,content:a||String(e[t].content??``),raw:a||String(e[t].content??``)}],raw:`^${a||String(e[t].content??``)}^`},nextIndex:s}}var hD=/\s/u,gD=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,_D=/\p{P}/u,vD=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,yD=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u;function bD(e){let t=0,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length&&e[n+1]===`*`){n+=2;continue}e[n]===`*`&&t++,n++}return t}function xD(e,t=0){if(!e)return-1;let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(i===`\\`&&a&&bE.has(a)){if(a===`*`&&n>=t){n++,r++;continue}n++,r++;continue}if(i===`*`&&n>=t)return n;n++}return-1}function SD(e){return!!e&&hD.test(e)}function CD(e){return!!e&&(gD.test(e)||_D.test(e))}function wD(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&vD.test(e)}function TD(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&yD.test(e)}function ED(e,t){let n=t>0?e[t-1]:void 0,r=e[t+1];return!r||SD(r)?!1:!(CD(r)&&!wD(r,n)&&n&&!SD(n)&&!CD(n))}function DD(e,t){let n=t>0?e[t-1]:void 0,r=e[t+1];return!n||SD(n)?!1:!(CD(n)&&!TD(n,r)&&r&&!SD(r)&&!CD(r))}function OD(e,t,n=0){let r=n,i=!1;for(;r<t.length;){let n=e?xD(e,r):t.indexOf(`*`,r);if(n===-1)break;if(DD(t,n))return{index:n,sawInvalidClose:i};i=!0,r=n+1}return{index:-1,sawInvalidClose:i}}function kD(e,t){let n=t>0?e[t-1]:void 0,r=e[t+2];return!r||SD(r)?!1:!(CD(r)&&!wD(r,n)&&n&&!SD(n)&&!CD(n))}function AD(e,t){let n=t>0?e[t-1]:void 0,r=e[t+2];return!n||SD(n)?!1:!(CD(n)&&!TD(n,r)&&r&&!SD(r)&&!CD(r))}function jD(e,t=0){let n=t,r=!1;for(;n<e.length;){let t=e.indexOf(`**`,n);if(t===-1)break;if(AD(e,t))return{index:t,sawInvalidClose:r};r=!0,n=t+2}return{index:-1,sawInvalidClose:r}}var MD=/[\p{L}\p{N}]/u,ND=/^[\p{L}\p{N}]+$/u;function PD(e){return e?MD.test(e):!1}function FD(e){return e?ND.test(e):!1}function ID(e,t){let n=t;for(;n<e.length&&e[n]===`*`;)n++;let r=t>0?e[t-1]:void 0,i=n<e.length?e[n]:void 0;return{len:n-t,prev:r,next:i,intraword:PD(r)&&PD(i)}}function LD(e){let t=[];for(let n=0;n<e.length;){if(e[n]!==`*`){n++;continue}let r=ID(e,n),i=n+r.len;r.len>=2&&r.intraword&&t.push({start:n,end:i}),n=i}for(let n=0;n<t.length-1;n++){let r=t[n],i=t[n+1];if(!FD(e.slice(r.end,i.start)))return i.end}return-1}function RD(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function zD(e,t){let n=t;for(;n<e.length;){let t=e.indexOf(`***`,n);if(t===-1)return-1;let r=ID(e,t);if(r.len>=3)return t;n=t+r.len}return-1}function BD(e){let t=String(e.content??``);return{type:`text`,content:t,raw:t}}var VD=/[^~]*~{2,}[^~]+/,HD=/\*\*/,UD=/[[_*^~]/;function WD(e,t){return t===e.tokens[e.index]}function GD(e,t,n){let r=WD(e,n)&&e.tokens.length===1?e.raw:String(n.content??``),i=[],a=LD(t);if(a!==-1){e.pushText(t.slice(0,a),t.slice(0,a));let n=t.slice(a);return n&&(e.dispatchToken({type:`text`,content:n,raw:n}),e.index--),e.index++,!0}if(VD.test(t)){let e=t.indexOf(`~~`);e!==-1&&i.push({type:`strikethrough`,index:e})}if(HD.test(t)){let e=t.indexOf(`**`);e!==-1&&i.push({type:`strong`,index:e})}if(/[^*]*\*[^*]+/.test(t)){let e=r?xD(r,0):t.indexOf(`*`);if(r&&e===-1)return!1;e!==-1&&i.push({type:`emphasis`,index:e})}i.sort((e,t)=>e.index===t.index?e.type===t.type?0:e.type===`strong`?-1:+(t.type===`strong`):e.index-t.index);let o=i[0];if(!o)return!1;if(o.type===`strikethrough`){let n=o.index,r=n>-1?t.slice(0,n):``;if(r&&e.pushText(r,r),n===-1)return e.index++,!0;let i=t.indexOf(`~~`,n+2),a=i===-1?t.slice(n+2):t.slice(n+2,i),s=i===-1?``:t.slice(i+2),{node:c}=fD([{type:`s_open`,tag:`s`,content:``,markup:`~~`,info:``,meta:null},{type:`text`,tag:``,content:a,markup:``,info:``,meta:null},{type:`s_close`,tag:`s`,content:``,markup:`~~`,info:``,meta:null}],0,e.parseInlineTokens,e.options);return e.resetCurrentTextNode(),e.pushParsed(c),s&&(e.dispatchToken({type:`text`,content:s,raw:s}),e.index--),e.index++,!0}if(o.type===`strong`){let n=o.index,r=n>-1?t.slice(0,n):``;if(r&&e.pushText(r,r),n===-1)return e.index++,!0;if(e.raw&&n===0){let n=!1,r=0;for(;r<t.length&&t[r]===`*`;)r++;if(e.raw.startsWith(`\\*`)&&(n=!0),n){let n=0,i=0;for(;i<e.raw.length&&n<r;)if(e.raw[i]===`\\`&&i+1<e.raw.length&&e.raw[i+1]===`*`)n+=1,i+=2;else if(e.raw[i]===`*`)break;else i++;if(n>=2)return e.pushText(t,t),e.index++,!0}}if(e.raw&&(t.match(/\*/g)||[]).length>bD(e.raw))return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0;let i=ID(t,n);if(i.len>=3){let r=zD(t,n+i.len);if(r!==-1){let a=t.slice(n+i.len,r);if(RD(a)){let{node:n}=VE([{type:`strong_open`,tag:`strong`,content:``,markup:`**`,info:``,meta:null},{type:`em_open`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`text`,tag:``,content:a,markup:``,info:``,meta:null},{type:`em_close`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`strong_close`,tag:`strong`,content:``,markup:`**`,info:``,meta:null}],0,e.parseInlineTokens,e.raw,e.options);e.resetCurrentTextNode(),e.pushParsed(n);let i=t.slice(r+3);return i&&(e.dispatchToken({type:`text`,content:i,raw:i}),e.index--),e.index++,!0}}}if(!kD(t,n)){let r=t.slice(n,n+i.len);e.pushText(r,r);let a=t.slice(n+i.len);return a&&(e.dispatchToken({type:`text`,content:a,raw:a}),e.index--),e.index++,!0}let a=jD(t,n+2),s=``,c=``;if(a.index!==-1){s=t.slice(n+2,a.index),c=t.slice(a.index+2);let o=a.index,l=ID(t,o);if(i.intraword&&l.intraword&&!FD(s)||!s&&i.len>=4&&i.intraword)return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0}else{if(e.requireClosingStrong||a.sawInvalidClose||i.intraword)return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0;s=t.slice(n+2),c=``}if(!s&&/^\*+$/.test(c))return e.pushText(t,t),e.index++,!0;let{node:l}=VE([{type:`strong_open`,tag:`strong`,content:``,markup:`**`,info:``,meta:null},{type:`text`,tag:``,content:s,markup:``,info:``,meta:null},{type:`strong_close`,tag:`strong`,content:``,markup:`**`,info:``,meta:null}],0,e.parseInlineTokens,e.raw,e.options);return e.resetCurrentTextNode(),e.pushParsed(l),c&&(e.dispatchToken({type:`text`,content:c,raw:c}),e.index--),e.index++,!0}if(o.type===`emphasis`){let n=o.index;n===-1&&(n=0);let i=t.slice(0,n);if(i&&e.pushText(i,i),!ED(t,n)){e.pushText(t[n],t[n]);let r=t.slice(n+1);return r&&(e.dispatchToken({type:`text`,content:r,raw:r}),e.index--),e.index++,!0}let a=ID(t,n),s=OD(r,t,n+1),c=s.index,l=e.tokens[e.index+1];if(e.options?.final&&l?.type===`em_open`&&c!==-1&&t.slice(n+1,c).trim()!==t.slice(n+1,c)||c===-1&&(s.sawInvalidClose||e.options?.final||a.intraword||!PD(t[n+1])))return e.pushText(t.slice(n),t.slice(n)),e.index++,!0;let{node:u}=FT([{type:`em_open`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`text`,tag:``,content:c>-1?t.slice(n+1,c):t.slice(n+1),markup:``,info:``,meta:null},{type:`em_close`,tag:`em`,content:``,markup:`*`,info:``,meta:null}],0,e.parseInlineTokens,e.options);if(e.resetCurrentTextNode(),e.pushParsed(u),c!==-1&&c<t.length-1){let n=t.slice(c+1);n&&(e.dispatchToken({type:`text`,content:n,raw:n}),e.index--)}return e.index++,!0}return!1}function KD(e,t,n){if(!t.includes("`"))return!1;let r=(e=>{for(let t=0;t<e.length;t++){if(e[t]!=="`")continue;let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;if(n%2==0)return t}return-1})(t);if(r===-1)return!1;let i=1;for(let e=r+1;e<t.length&&t[e]==="`";e++)i++;let a="`".repeat(i),o=r+i,s=t.indexOf(a,o);if(s===-1){if(i===1){let i=t.slice(0,r),a=t.slice(r+1);return i&&(GD(e,i,n)?e.index--:e.pushText(i,i)),e.pushParsed({type:`inline_code`,code:a,raw:String(a)}),e.index++,!0}let a=t;for(let t=e.index+1;t<e.tokens.length;t++)a+=String((e.tokens[t].content??``)+(e.tokens[t].markup??``));return e.index=e.tokens.length-1,e.pushText(a,a),e.index++,!0}e.resetCurrentTextNode();let c=t.slice(0,r),l=t.slice(r+i,s),u=t.slice(s+i);return c&&(GD(e,c,n)?e.index--:e.pushText(c,c)),e.pushParsed({type:`inline_code`,code:l,raw:String(l??``)}),u&&(e.dispatchToken({type:`text`,content:u,raw:u}),e.index--),e.index++,!0}function qD(e,t){let n=e.options.markdownIt;if(!n||e.tokens.length<=1||!e.tokens.some(e=>e?.type===`math_inline`)||!UD.test(t))return null;let r=n.parseInline(t,{__markstreamFinal:!!e.options?.final});if(!Array.isArray(r)||r.length===0)return null;let i=(r.find(e=>e?.type===`inline`)?.children??[]).filter(e=>e?.type!==`text`||String(e.content??``)!==``);if(!i.length||!i.some(e=>e?.type!==`text`)||i.length===1&&i[0]?.type===`text`&&String(i[0].content??``)===t)return null;let a=e.parseInlineTokens(i,t,e.pPreToken,e.options);return a.length?a:null}function JD(e,t,n,r,i,a=NE(t)){let o=BD({...n,content:t});if(e.currentTextNode){e.currentTextNode.content+=e.options?.final?o.content:zE(o.content,n,a),e.currentTextNode.raw+=o.raw;return}let s=r?.tag===`br`&&e.tokens[e.index-2]?.content===`[`;i||(o.content=e.options?.final?o.content:zE(o.content,n,a)),e.currentTextNode=o,e.currentTextNode.center=s,e.result.push(e.currentTextNode)}function YD(e,t){let n=String(t.content??``),r=NE(n),i=(r&xE)!==0,a=WD(e,t)&&e.tokens.length===1&&i&&typeof e.raw==`string`?String(e.raw):``,o=a?PE(a):i?n.replace(yE,`$1`):n,s=o===n?r:NE(o);if(t.content===`<`||o===`1`&&e.tokens[e.index-1]?.tag===`br`){e.index++;return}let c=(s&kE)===0?-1:o.indexOf(`$`);c!==-1&&c===o.lastIndexOf(`$`)&&o.endsWith(`$`)&&(o=o.slice(0,-1)),o.endsWith(`undefined`)&&!e.raw?.endsWith(`undefined`)&&(o=o.slice(0,-9));let l=e.result.length,u=``;for(let t=e.result.length-1;t>=0;t--){let n=e.result[t];if(n.type!==`text`)break;l=t,u=String(n.content??``)+u}l<e.result.length&&(o.startsWith(u)?(e.currentTextNode=null,e.result.length=l):e.currentTextNode=e.result[e.result.length-1]);let d=e.tokens[e.index+1];if((o==="`"||o===`|`||o===`$`)&&!RE(t,`\\${o}`)||/^\*+$/.test(o)&&!RE(t,`\\*`)){e.index++;return}if(!d&&e.options?.final!==!0&&(s&jE)!==0&&/[^\]]\s*\(\s*$/.test(o)&&(o=o.replace(/\(\s*$/,``)),!o){e.index++;return}if((s&160)==160&&tD(e,o)||(s&1088)==1088&&iD(e,o))return;if((s&ME)===0){JD(e,o,t,e.tokens[e.index-1],d,s),e.index++;return}if((s&EE)!==0&&XD(e,o))return;let f=e.tokens[e.index-1];if((s&EE)!==0&&o===`[`&&!d?.markup?.includes(`*`)&&!RE(t,`\\[`)||(s&DE)!==0&&o===`]`&&!f?.markup?.includes(`*`)&&!RE(t,`\\]`)){e.index++;return}if((s&TE)!==0&&KD(e,n,t)||(s&160)==160&&sD(e,o)||(s&EE)!==0&&(e.tokens[e.index+1]?.type!==`link_open`||KE(e,o))&&oD(e,o,t))return;let p=qD(e,n);if(p){e.resetCurrentTextNode();for(let t of p)e.pushParsed(t);e.index++;return}GD(e,o,t)||(JD(e,o,t,f,d,s),e.index++)}function XD(e,t){if(!(t?.startsWith(`[`)&&e.pPreToken?.type===`list_item_open`))return!1;let n=t.slice(1).match(/[^\s\]]/);if(n===null)return e.index++,!0;if(n&&/x/i.test(n[0])){let t=n[0]===`x`||n[0]===`X`;return e.pushParsed({type:`checkbox_input`,checked:t,raw:t?`[x]`:`[ ]`}),e.index++,!0}return!1}function ZD(e,t){if(!e.currentTextNode||t.loading!==!0||t.markup!==`\\(\\)`)return;let n=e.tokens[e.index-1];n&&n.type===`text`&&RE(n,`\\(`)&&e.currentTextNode.content.endsWith(`(`)&&(e.currentTextNode.content=e.currentTextNode.content.slice(0,-1),e.currentTextNode.raw.endsWith(`(`)&&(e.currentTextNode.raw=e.currentTextNode.raw.slice(0,-1)),!e.currentTextNode.content&&e.result[e.result.length-1]===e.currentTextNode&&(e.result.pop(),e.currentTextNode=null))}function QD(e,t){switch(t.type){case`text`:YD(e,t);break;case`softbreak`:e.currentTextNode?(e.currentTextNode.content+=`
118
+ `,e.currentTextNode.raw+=`
119
+ `):(e.currentTextNode={type:`text`,content:`
120
+ `,raw:`
121
+ `},e.result.push(e.currentTextNode)),e.index++;break;case`code_inline`:e.pushParsed(uE(t)),e.index++;break;case`html_inline`:{let[n,r]=lE(t,e.tokens,e.index,e.parseInlineTokens,e.raw,e.pPreToken,e.options);e.pushParsed(n),e.index=r;break}case`link_open`:qE(e,t);break;case`image`:cD(e,t);break;case`strong_open`:{e.resetCurrentTextNode();let{node:n,nextIndex:r}=VE(e.tokens,e.index,e.parseInlineTokens,t.content,e.options);e.pushParsed(n),e.index=r;break}case`em_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=FT(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`s_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=fD(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`mark_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=KT(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`ins_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=dE(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sub_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=pD(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sup_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=mD(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sub`:e.resetCurrentTextNode(),e.pushParsed({type:`subscript`,children:[{type:`text`,content:String(t.content??``),raw:String(t.content??``)}],raw:`~${String(t.content??``)}~`}),e.index++;break;case`sup`:e.resetCurrentTextNode(),e.pushParsed({type:`superscript`,children:[{type:`text`,content:String(t.content??``),raw:String(t.content??``)}],raw:`^${String(t.content??``)}^`}),e.index++;break;case`emoji`:{e.resetCurrentTextNode();let n=e.tokens[e.index-1];n?.type===`text`&&/\|:-+/.test(String(n.content??``))?e.pushText(``,``):e.pushParsed(NT(t)),e.index++;break}case`checkbox`:e.resetCurrentTextNode(),e.pushParsed(jT(t)),e.index++;break;case`checkbox_input`:e.resetCurrentTextNode(),e.pushParsed(MT(t)),e.index++;break;case`footnote_ref`:e.resetCurrentTextNode(),e.pushParsed(WT(t)),e.index++;break;case`footnote_anchor`:{e.resetCurrentTextNode();let n=t.meta??{},r=String(n.label??t.content??``);e.pushParsed({type:`footnote_anchor`,id:r,raw:String(t.content??``)}),e.index++;break}case`hardbreak`:e.resetCurrentTextNode(),e.pushParsed(GT()),e.index++;break;case`fence`:e.resetCurrentTextNode(),e.pushParsed(UT(e.tokens[e.index])),e.index++;break;case`math_inline`:ZD(e,t),e.resetCurrentTextNode(),!t.content&&t.markup===`$`&&e.tokens[e.index+1]?.type===`text`&&e.tokens[e.index+2]?.type===`math_inline`?(e.pushParsed(uD({...t,content:e.tokens[e.index+1].content})),e.index+=2):e.pushParsed(uD(t)),e.index++;break;case`reference`:$D(e,t);break;case`text_special`:e.pushText(String(t.content??``),String(t.content??``)),e.index++;break;default:lD(e,t)}}function $D(e,t){e.resetCurrentTextNode(),e.pushParsed(dD(t)),e.index++}var eO=/[!$(*[\\\]_`|~]/;function tO(e,t,n,r){if(!e||e.length===0)return[];if(e.length===1&&e[0].type===`text`){let t=e[0].content;if(typeof t==`string`&&t&&t!==`<`&&!t.endsWith(`undefined`)&&!eO.test(t))return[{type:`text`,content:t,raw:t,center:!1}]}let i=mb(r),a=i.linkifyDemotionContext,o=nx(t),s={filename:a?.filename||o.filename,explicitFilename:a?.explicitFilename||o.explicitFilename,marketTicker:a?.marketTicker||o.marketTicker};(s.filename||s.explicitFilename||s.marketTicker)&&(i={...i,linkifyDemotionContext:s}),r=i;let c=r?.requireClosingStrong,l=e,u={currentTextNode:null,index:0,options:i,parseInlineTokens:tO,pPreToken:n,raw:t,requireClosingStrong:c,result:[],tokens:e,dispatchToken:e=>QD(u,e),ensureWorkingTokens:d,pushParsed:p,pushText:h,pushToken:m,resetCurrentTextNode:f};function d(){return u.tokens===l&&(u.tokens=u.tokens.slice()),u.tokens}function f(){u.currentTextNode=null}function p(e){f(),u.result.push(e)}function m(e){f();let t=$C(e);u.result.push(t)}function h(e,t){u.currentTextNode?(u.currentTextNode.content+=e,u.currentTextNode.raw+=t??e):(u.currentTextNode={type:`text`,content:String(e??``),raw:String(t??e??``)},u.result.push(u.currentTextNode))}for(;u.index<u.tokens.length;){let e=u.tokens[u.index];QD(u,e)}return u.result}function nO(e){let t=new WeakSet,n=e=>{if(!e||typeof e!=`object`||t.has(e))return;if(t.add(e),Array.isArray(e)){for(let t of e)n(t);return}let r=e;r.type===`html_block`&&r.loading===!0&&(r.loading=!1);for(let e of Object.values(r))n(e)};n(e)}function rO(e,t){let n=t.postTransformNodes;if(typeof n!=`function`)return e;let r=n(e);return Array.isArray(r)?r:e}function iO(e){let t=String(e.content??``),n=t.replace(/[ \t\r\n]+$/g,``);if(n===t)return;e.content=n;let r=e.children;if(Array.isArray(r)&&r.length!==0)for(;r.length;){let e=r[r.length-1];if(!e){r.pop();continue}if(e.type===`softbreak`||e.type===`hardbreak`){r.pop();continue}if(e.type===`text`){let t=String(e.content??``),n=t.replace(/[ \t\r\n]+$/g,``);if(n===t)break;if(n){e.content=n;break}r.pop();continue}break}}function aO(e){let t=String(e.content??``),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!=`number`)return;e.content=t.slice(0,n.index);let r=e.children;if(Array.isArray(r)&&r.length!==0)for(;r.length;){let e=r[r.length-1];if(!e){r.pop();continue}if(e.type===`softbreak`||e.type===`hardbreak`){r.pop();continue}if(e.type===`text`){let t=String(e.content??``);if(/^[ \t\r\n\d.)]*$/.test(t)){r.pop();continue}let n=t.replace(/[ \t\r\n\d.)]+$/g,``);n!==t&&(n?e.content=n:r.pop())}break}}function oO(e){let t=String(e.content??``);return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function sO(e,t,n,r){let i=e[t],a=[],o=Jb(n,!0),s=t+1;for(;s<e.length&&e[s].type!==`bullet_list_close`&&e[s].type!==`ordered_list_close`;)if(e[s].type===`list_item_open`){let t=[],i=s+1;for(;i<e.length&&e[i].type!==`list_item_close`;)if(e[i].type===`paragraph_open`){let a=e[i+1],s=oO(a)?$C(a):a,c=e[i-1];s!==a&&(aO(s),iO(s));let l=String(s.content??``),u={type:`paragraph`,children:r(s.children||[],l,c,o.options()),raw:l};n?.includeSourceMap&&ZC(u,e[i],n),t.push(u),o.remember(l),i+=3}else if(e[i].type===`blockquote_open`){let[n,a]=hO(e,i,o.options(),r);t.push(n),o.remember(n.raw),i=a}else if(e[i].type===`bullet_list_open`||e[i].type===`ordered_list_open`){let[n,a]=sO(e,i,o.options(),r);t.push(n),o.remember(n.raw),i=a}else{let n=HO(e,i,o.options(),mO,r);n?(t.push(n[0]),o.remember(n[0].raw),i=n[1]):i+=1}let c={type:`list_item`,children:t,raw:t.map(e=>e.raw).join(``)};n?.includeSourceMap&&ZC(c,e[s],n),a.push(c),s=i+1}else s+=1;let c={type:`list`,ordered:i.type===`ordered_list_open`,start:(()=>{if(i.attrs&&i.attrs.length){let e=i.attrs.find(e=>e[0]===`start`);if(e){let t=Number(e[1]);return Number.isFinite(t)&&t!==0?t:1}}})(),items:a,raw:a.map(e=>e.raw).join(`
122
+ `)};return n?.includeSourceMap&&ZC(c,i,n),[c,s+1]}function cO(e,t,n,r,i){let a=String(n[1]??`note`),o=String(n[2]??a.charAt(0).toUpperCase()+a.slice(1)),s=[],c=Jb(r,!0),l=t+1;for(;l<e.length&&e[l].type!==`container_close`;)if(e[l].type===`paragraph_open`){let t=e[l+1];if(t){let n={type:`paragraph`,children:i(t.children||[],String(t.content??``),void 0,c.options()),raw:String(t.content??``)};r?.includeSourceMap&&ZC(n,e[l],r),s.push(n),c.remember(n.raw)}l+=3}else if(e[l].type===`bullet_list_open`||e[l].type===`ordered_list_open`){let[t,n]=sO(e,l,c.options(),i);r?.includeSourceMap&&ZC(t,e[l],r),s.push(t),c.remember(t.raw),l=n}else if(e[l].type===`blockquote_open`){let[t,n]=hO(e,l,c.options(),i);r?.includeSourceMap&&ZC(t,e[l],r),s.push(t),c.remember(t.raw),l=n}else{let t=VO(e,l,c.options(),i);t?(s.push(t[0]),c.remember(t[0].raw),l=t[1]):l++}return[{type:`admonition`,kind:a,title:o,children:s,raw:`:::${a} ${o}\n${s.map(e=>e.raw).join(`
123
+ `)}\n:::`},l+1]}var lO=new Set([`warning`,`info`,`note`,`tip`,`danger`,`caution`]);function uO(e){let t=0;for(;t<e.length&&t<3&&e[t]===`:`;)t++;if(t===0||e[t]===`:`)return null;let n=e.slice(t).trimStart();if(!n)return null;let r=n.search(/\s/),i=(r===-1?n:n.slice(0,r)).toLowerCase();return lO.has(i)?{kind:i,title:r===-1?``:n.slice(r).trim()}:null}function dO(e,t,n,r){let i=e[t],a=`note`,o=``,s=i.type.match(/^container_(\w+)_open$/);if(s){a=s[1];let e=String(i.info??``).trim();if(e&&!e.startsWith(`:::`)&&e.toLowerCase().startsWith(a)){let t=e.slice(a.length).trim();t&&(o=t)}}else{let e=uO(String(i.info??``).trim());e&&(a=e.kind,o=e.title)}o||=a.charAt(0).toUpperCase()+a.slice(1);let c=[],l=Jb(n,!0),u=t+1,d=RegExp(`^container_${a}_close$`);for(;u<e.length&&e[u].type!==`container_close`&&!d.test(e[u].type);)if(e[u].type===`paragraph_open`){let t=e[u+1];if(t){let i=t.children||[],a=-1;for(let e=i.length-1;e>=0;e--){let t=i[e];if(t.type===`text`&&/:+/.test(t.content)){a=e;break}}let o={type:`paragraph`,children:r((a===-1?i:i.slice(0,a))||[],void 0,void 0,l.options()),raw:String(t.content??``).replace(/\n:+$/,``).replace(/\n\s*:::\s*$/,``)};n?.includeSourceMap&&ZC(o,e[u],n),c.push(o),l.remember(o.raw)}u+=3}else if(e[u].type===`bullet_list_open`||e[u].type===`ordered_list_open`){let[t,i]=sO(e,u,l.options(),r);n?.includeSourceMap&&ZC(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else if(e[u].type===`blockquote_open`){let[t,i]=hO(e,u,l.options(),r);n?.includeSourceMap&&ZC(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else{let t=VO(e,u,l.options(),r);t?(c.push(t[0]),l.remember(t[0].raw),u=t[1]):u++}return[{type:`admonition`,kind:a,title:o,children:c,raw:`:::${a} ${o}\n${c.map(e=>e.raw).join(`
124
+ `)}\n:::`},u+1]}var fO=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function pO(e,t,n,r){let i=e[t];if(i.type!==`container_open`)return null;let a=fO.exec(String(i.info??``));return a?cO(e,t,a,n,r):null}var mO={parseContainer:(e,t,n,r)=>dO(e,t,n,r),matchAdmonition:pO};function hO(e,t,n,r){let i=[],a=Jb(n,!0),o=t+1;for(;o<e.length&&e[o].type!==`blockquote_close`;){let t=e[o];switch(t.type){case`paragraph_open`:{let s=e[o+1],c={type:`paragraph`,children:r(s.children||[],String(s.content??``),void 0,a.options()),raw:String(s.content??``)};n?.includeSourceMap&&ZC(c,t,n),i.push(c),a.remember(c.raw),o+=3;break}case`bullet_list_open`:case`ordered_list_open`:{let[t,n]=sO(e,o,a.options(),r);i.push(t),a.remember(t.raw),o=n;break}case`blockquote_open`:{let[t,n]=hO(e,o,a.options(),r);i.push(t),a.remember(t.raw),o=n;break}default:{let t=HO(e,o,a.options(),mO,r);t?(i.push(t[0]),a.remember(t[0].raw),o=t[1]):o++;break}}}let s={type:`blockquote`,children:i,raw:i.map(e=>e.raw).join(`
125
+ `)};return n?.includeSourceMap&&ZC(s,e[t],n),[s,o+1]}function gO(e){if(e.info?.startsWith(`diff`))return UT(e);let t=String(e.content??``),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/),r=t;n?.[1]&&(r=t.replace(/<antArtifact[^>]*>/g,``).replace(/<\/antArtifact>/g,``));let i=Array.isArray(e.map)&&e.map.length===2;return{type:`code_block`,language:n?n[1]:String(e.info??``),code:r,raw:r,loading:!i}}function _O(e,t,n,r){let i=[],a=t+1,o=[],s=[],c=Jb(n,!0);for(;a<e.length&&e[a].type!==`dl_close`;)if(e[a].type===`dt_open`){let t=e[a+1];o=r(t.children||[],void 0,void 0,c.options()),c.remember(o.map(e=>e.raw).join(``)),a+=3}else if(e[a].type===`dd_open`){let t=a+1;for(s=[];t<e.length&&e[t].type!==`dd_close`;)if(e[t].type===`paragraph_open`){let n=e[t+1];s.push({type:`paragraph`,children:r(n.children||[],String(n.content??``),void 0,c.options()),raw:String(n.content??``)}),c.remember(String(n.content??``)),t+=3}else t++;o.length>0&&(i.push({type:`definition_item`,term:o,definition:s,raw:`${o.map(e=>e.raw).join(``)}: ${s.map(e=>e.raw).join(`
126
+ `)}`}),o=[]),a=t+1}else a++;return[{type:`definition_list`,items:i,raw:i.map(e=>e.raw).join(`
127
+ `)},a+1]}function vO(e,t,n,r){let i=e[t].meta??{},a=String(i?.label??`0`),o=[],s=Jb(n,!0),c=t+1;for(;c<e.length&&e[c].type!==`footnote_close`;)if(e[c].type===`paragraph_open`){let t=e[c+1],n=t.children?[...t.children]:[];e[c+2].type===`footnote_anchor`&&n.push(e[c+2]);let i={type:`paragraph`,children:r(n,String(t.content??``),void 0,s.options()),raw:String(t.content??``)};o.push(i),s.remember(i.raw),c+=3}else c++;return[{type:`footnote`,id:a,children:o,raw:`[^${a}]: ${o.map(e=>e.raw).join(`
128
+ `)}`},c+1]}function yO(e,t,n,r){let i=e[t],a=i.attrs,o=Array.isArray(a)&&a.length?Object.fromEntries(a.filter(e=>Array.isArray(e)&&e.length>=1&&e[0]).map(([e,t])=>[String(e),t==null||t===``||String(t)])):void 0,s=String(i.tag?.substring(1)??`1`),c=Number.parseInt(s,10),l=e[t+1],u=String(l.content??``);return{type:`heading`,level:c,text:u,...o?{attrs:o}:{},children:r(l.children||[],u,void 0,n),raw:u}}function bO(e){let t=String(e.content??``),n=e.raw===`$$`?`$$${t}$$`:String(e.raw??``);return{type:`math_block`,content:t,loading:!!e.loading,raw:n,markup:e.markup}}function xO(e){if(!e)return`left`;for(let t of e){if(!t)continue;let[e,n]=t;if(!n)continue;let r=String(n).trim().toLowerCase();if(e===`style`){let e=/text-align\s*:\s*(left|right|center)/i.exec(r);if(e)return e[1].toLowerCase()}}return`left`}function SO(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function CO(e,t){let n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return SO(n)?n:void 0}function wO(e,t,n){let r=CO(nx(t),n);if(!SO(r))return e;let i=mb(e),a=i.linkifyDemotionContext;return{...i,linkifyDemotionContext:{filename:a?.filename||r?.filename,explicitFilename:a?.explicitFilename||r?.explicitFilename,marketTicker:a?.marketTicker||r?.marketTicker}}}function TO(e,t,n,r){let i=t+1,a=null,o=[],s=!1;for(;i<e.length&&e[i].type!==`table_close`;)if(e[i].type===`thead_open`)s=!0,i++;else if(e[i].type===`thead_close`)s=!1,i++;else if(e[i].type===`tbody_open`||e[i].type===`tbody_close`)i++;else if(e[i].type===`tr_open`){let t=[],c=i+1,l;for(;c<e.length&&e[c].type!==`tr_close`;)if(e[c].type===`th_open`||e[c].type===`td_open`){let i=e[c].type===`th_open`,o=e[c+1],u=String(o.content??``),d=xO(e[c].attrs),f=t.length,p=!i&&!s,m=p?a?.cells[f]?.raw:void 0;t.push({type:`table_cell`,header:i||s,children:r(o.children||[],u,void 0,wO(n,m,p?l:void 0)),raw:u,align:d}),p&&(l=CO(l,nx(u))),c+=3}else c++;let u={type:`table_row`,cells:t,raw:t.map(e=>e.raw).join(`|`)};s?a=u:o.push(u),i=c+1}else i++;a||={type:`table_row`,cells:[],raw:``};let c=e[t].loading===!0;return[{type:`table`,header:a,rows:o,loading:c&&!n?.final&&o.length===0,raw:[a,...o].map(e=>e.raw).join(`
129
+ `)},i+1]}function EO(){return{type:`thematic_break`,raw:`---`}}var DO=null,OO=new WeakMap;function kO(){return DO||={allowedTagSet:qT(),customTagSet:null},DO}function AO(e){if(!e||e.length===0)return kO();let t=OO.get(e);if(t)return t;let n=e.map(My).filter(Boolean);if(!n.length){let t=kO();return OO.set(e,t),t}let r={allowedTagSet:qT({customHtmlTags:e}),customTagSet:new Set(n)};return OO.set(e,r),r}function jO(e,t,n,r){let i=e[t],a=i.attrs,o=``,s={};if(a){for(let[e,t]of a)if(e===`class`){let e=t.match(/(?:\s|^)vmr-container-(\S+)/);e&&(o=e[1])}else if(e.startsWith(`data-`)){let n=e.slice(5);try{s[n]=JSON.parse(t)}catch{s[n]=t}}}let c=[],l=Jb(n,!0),u=t+1;for(;u<e.length&&e[u].type!==`vmr_container_close`;)if(e[u].type===`paragraph_open`){let t=e[u+1];if(t){let i={type:`paragraph`,children:r(t.children||[],void 0,void 0,l.options()),raw:String(t.content??``)};n?.includeSourceMap&&ZC(i,e[u],n),c.push(i),l.remember(i.raw)}u+=3}else if(e[u].type===`bullet_list_open`||e[u].type===`ordered_list_open`){let[t,i]=sO(e,u,l.options(),r);n?.includeSourceMap&&ZC(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else if(e[u].type===`blockquote_open`){let[t,i]=hO(e,u,l.options(),r);n?.includeSourceMap&&ZC(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else{let t=VO(e,u,l.options(),r);t?(c.push(t[0]),l.remember(t[0].raw),u=t[1]):u++}let d=u<e.length&&e[u].type===`vmr_container_close`,f=d&&i.meta?.unclosed!==!0||!!n?.final,p=`::: ${o}`;return Object.keys(s).length>0&&(p+=` ${JSON.stringify(s)}`),p+=`
130
+ `,c.length>0&&(p+=i.raw??c.map(e=>e.raw).join(`
131
+ `),p+=`
132
+ `),p+=`:::`,[{type:`vmr_container`,name:o,loading:!f,attrs:Object.keys(s).length>0?s:void 0,children:c,raw:p},d?u+1:u]}function MO(e,t,n,r){if(n?.type.endsWith(`_close`)){let i=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(i)||(i=Array.isArray(t.map)?Number(t.map[1])+1:NaN),QC(e,t,i,r)}return ZC(e,t,r)}function NO(e){return e.replace(/^\r?\n/,``).replace(/\r?\n$/,``)}var PO=new Map;function FO(e){let t=PO.get(e);if(t)return t;let n=Dy(e);return t={strip:RegExp(`[\\t ]*<\\s*\\/\\s*${n}[^>]*$`,`i`),search:RegExp(`<\\s*${n}(?=\\s|>|/)`,`gi`),openAny:RegExp(`<\\s*${n}(?=\\s|>|/)`,`gi`),closeAny:RegExp(`<\\s*\\/\\s*${n}(?=\\s|>)`,`gi`)},PO.set(e,t),t}function IO(e,t){if(!e||!t)return e;let n=FO(t).strip;return e.replace(n,``)}function LO(e,t,n){if(!e||!t)return null;let{openAny:r,closeAny:i}=FO(t.toLowerCase()),a=0,o=Math.max(0,n);for(;o<e.length;){let t=e.indexOf(`<`,o);if(t===-1)break;if(i.lastIndex=t,i.exec(e)?.index===t){let n=Oy(e.slice(t));if(n===-1)return null;if(a===0)return{start:t,end:t+n+1};a--,o=t+n+1;continue}if(r.lastIndex=t,r.exec(e)?.index===t){let n=Oy(e.slice(t));if(n===-1)return null;let r=e.slice(t,t+n+1);/\/\s*>$/.test(r)||a++,o=t+n+1;continue}o=t+1}return null}function RO(e,t,n){if(!e||!t)return null;let{search:r,openAny:i,closeAny:a}=FO(t.toLowerCase());r.lastIndex=Math.max(0,n||0);let o=r.exec(e);if(!o||o.index==null)return null;let s=o.index,c=e.slice(s),l=Oy(c);if(l===-1)return null;let u=s+l;if(/\/\s*>\s*$/.test(c.slice(0,l+1))){let t=u+1;return{raw:e.slice(s,t),start:s,end:t}}let d=1,f=u+1,p=t=>(i.lastIndex=t,i.exec(e)?.index===t),m=t=>(a.lastIndex=t,a.exec(e)?.index===t);for(;f<e.length;){let t=e.indexOf(`<`,f);if(t===-1)return{raw:e.slice(s),start:s,end:e.length};if(m(t)){let n=e.indexOf(`>`,t);if(n===-1)return null;if(d--,d===0){let t=n+1;return{raw:e.slice(s,t),start:s,end:t}}f=n+1;continue}if(p(t)){let n=Oy(e.slice(t));if(n===-1)return null;d++,f=t+n+1;continue}f=t+1}return{raw:e.slice(s),start:s,end:e.length}}function zO(e){return Number.isFinite(e)&&e>0?e:0}function BO(e,t){let n=zO(t);if(!e||n<=0)return 0;let r=0;for(let t=0;t<e.length;t++)if(e[t]===`
133
+ `&&(r++,r===n))return t+1;return e.length}function VO(e,t,n,r){let i=e[t],a=n?.includeSourceMap===!0;switch(i.type){case`heading_open`:{let o=yO(e,t,n,r);return a&&ZC(o,i,n),[o,t+3]}case`code_block`:{let e=gO(i);return a&&ZC(e,i,n),[e,t+1]}case`fence`:{let e=UT(i);return a&&ZC(e,i,n),[e,t+1]}case`math_block`:{let e=bO(i);return a&&ZC(e,i,n),[e,t+1]}case`html_block`:{let e=GC(i),r=e.tag?AO(n?.customHtmlTags):null;if(e.tag&&e.loading&&r&&!r.allowedTagSet.has(e.tag)){let e=String(i.content??``).replace(/\n+$/,``),r={type:`paragraph`,children:e?[{type:`text`,content:e,raw:e}]:[],raw:e};return a&&ZC(r,i,n),[r,t+1]}if(e.tag&&r?.customTagSet?.has(e.tag)){let r=e.tag,o=fb(n)?n:void 0,s=String(o?.sourceMarkdown??``),c=Number(o?.customHtmlBlockCursor??0),l=Number(i.map?.[0]??0),u=Array.isArray(i.map)?o?.sourceLineOffsets?.[l]??BO(s,l):0,d=RO(s,r,Math.max(zO(c),zO(u)));d&&o&&(o.customHtmlBlockCursor=d.end);let f=String(d?.raw??e.raw??``),p=Oy(f),m=p===-1?f:f.slice(0,p+1),h=p!==-1&&/\/\s*>\s*$/.test(m),g=p===-1?null:LO(f,r,p+1),_=g?.start??-1,v=``;p!==-1&&(v=_!==-1&&p<_?f.slice(p+1,_):f.slice(p+1)),_===-1&&(v=IO(v,r));let y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,x;for(;(x=b.exec(m))!==null;){let e=x[1];if(!e||e.toLowerCase()===r)continue;let t=x[2]||x[3]||x[4]||``;y.push([e,t])}let S=!n?.final&&!h&&g==null,C={type:r,tag:r,content:NO(v),raw:String(d?.raw??e.raw??f),loading:S,attrs:y.length?y:void 0};return a&&(d?C.sourceMap=YC(s,d.start,d.end,n):ZC(C,i,n)),[C,t+1]}return a&&ZC(e,i,n),[e,t+1]}case`table_open`:{let[o,s]=TO(e,t,n,r);return a&&ZC(o,i,n),[o,s]}case`dl_open`:{let[o,s]=_O(e,t,n,r);return a&&ZC(o,i,n),[o,s]}case`footnote_open`:{let[o,s]=vO(e,t,n,r);return a&&ZC(o,i,n),[o,s]}case`hr`:{let e=EO();return a&&ZC(e,i,n),[e,t+1]}}return null}function HO(e,t,n,r,i){let a=VO(e,t,n,i);if(a)return a;let o=e[t],s=n?.includeSourceMap===!0;switch(o.type){case`container_warning_open`:case`container_info_open`:case`container_note_open`:case`container_tip_open`:case`container_danger_open`:case`container_caution_open`:case`container_error_open`:if(r?.parseContainer){let a=r.parseContainer(e,t,n,i);return s&&MO(a[0],o,e[a[1]-1],n),a}break;case`container_open`:if(r?.matchAdmonition){let a=r.matchAdmonition(e,t,n,i);if(a)return s&&MO(a[0],o,e[a[1]-1],n),a}break;case`vmr_container_open`:{let r=jO(e,t,n,i);return s&&MO(r[0],o,e[r[1]-1],n),r}}return null}function UO(){return{type:`hardbreak`,raw:`\\
134
+ `}}function WO(e,t,n,r){let i=e[t+1],a=String(i.content??``);return{type:`paragraph`,children:r(i.children||[],a,void 0,n),raw:a}}function GO(e,t,n){let r=t?.map,i=n.sourceMarkdown,a=n.runtime;if(!Array.isArray(r)||r.length<2||typeof i!=`string`||!a)return;let o=Number(r[0]),s=Number(r[1]);if(!Number.isFinite(o)||!Number.isFinite(s))return;let c=n.sourceLineOffsets;if(!c){c=[0];for(let e=0;e<i.length;e++)i[e]===`
135
+ `&&c.push(e+1);n.sourceLineOffsets=c}a.nodeSourceRanges.set(e,{start:c[Math.max(0,Math.trunc(o))]??i.length,end:c[Math.max(0,Math.trunc(s))]??i.length})}function KO(e,t){return t.nodeSourceRanges.get(e)}function qO(e){return e}var JO=new Map;function YO(e){let t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;let n=t.join(`\0`),r=JO.get(n);if(r)return r;let i=Ny(t),a=i.length?new Set(i):null;return a&&JO.set(n,a),a}function XO(e){let t=e.raw;if(typeof t==`string`)return t;let n=qO(e).content;return typeof n==`string`?n:e.type===`hardbreak`?`<br>`:``}function ZO(e){return{type:`paragraph`,children:e,raw:e.map(XO).join(``)}}function QO(e,t){if(t.sourceMap)for(let n of e)n.sourceMap||=t.sourceMap}function $O(e,t){if(e.type!==`paragraph`)return null;let n=qO(e).children,r=Array.isArray(n)?n:[];if(r.length===0)return null;let i=YO(t);if(!i?.size)return null;let a=-1;for(let e=0;e<r.length;e++){let t=r[e];if(!i.has(String(t?.type??``).toLowerCase()))continue;let n=r.slice(0,e);if(String(qO(t).content??``).trim()&&n.some(e=>e?.type===`hardbreak`)){a=e;break}}if(a===-1)return null;let o=r.slice(0,a),s=r[a];if(!s)return null;let c=[];o.length&&c.push(ZO(o)),c.push(s);let l=r.slice(a+1);return l.length&&c.push(ZO(l)),c}function ek(e,t,n){if(!e||!Array.isArray(e))return[];let r=[],i=[],a=Jb(t),o=t?.includeSourceMap===!0,s=0;for(;s<e.length;){let c=HO(e,s,a.options(),mO,n);if(c){GO(c[0],e[s],t),r.push(c[0]),a.remember(c[0].raw),i.push(a.snapshot()),s=c[1];continue}let l=e[s];switch(l.type){case`paragraph_open`:{let i=String(e[s+1]?.content??``),c=WO(e,s,a.options(i),n);o&&ZC(c,l,t);let u=$O(c,t);if(u){o&&QO(u,c);for(let e of u)GO(e,l,t);r.push(...u)}else GO(c,l,t),r.push(c);a.remember(c.raw),s+=3;break}case`bullet_list_open`:case`ordered_list_open`:{let[i,c]=sO(e,s,a.options(),n);o&&ZC(i,l,t),GO(i,l,t),r.push(i),a.remember(i.raw),s=c;break}case`blockquote_open`:{let[i,c]=hO(e,s,a.options(),n);o&&ZC(i,l,t),GO(i,l,t),r.push(i),a.remember(i.raw),s=c;break}case`footnote_anchor`:{let e=l.meta??{},n={type:`footnote_anchor`,id:String(e.label??l.content??``),raw:String(l.content??``)};o&&ZC(n,l,t),GO(n,l,t),r.push(n),a.remember(String(l.content??``)),s++;break}case`hardbreak`:r.push(UO()),a.reset(),s++;break;case`text`:{let e=String(l.content??``),n={type:`paragraph`,raw:e,children:e?[{type:`text`,content:e,raw:e}]:[]};o&&ZC(n,l,t),GO(n,l,t),r.push(n),a.remember(e),s++;break}case`inline`:{let e=String(l.content??``),i=n(l.children||[],e,void 0,a.options(e));if(i.length!==0){if(i.every(e=>e.type===`html_block`)){if(o)for(let e of i)ZC(e,l,t);for(let e of i)GO(e,l,t);r.push(...i)}else{let n={type:`paragraph`,raw:e,children:i};o&&ZC(n,l,t);let a=$O(n,t);if(a){o&&QO(a,n);for(let e of a)GO(e,l,t);r.push(...a)}else GO(n,l,t),r.push(n)}}a.remember(e)}s+=1;break;default:s+=1}let u=a.snapshot();for(;i.length<r.length;)i.push(u)}return t.linkifyDemotionResultContexts=i,r}function tk(e,t){let n=e.sourceLineOffsets;if(n?.source===t)return n.offsets;if(n&&t.length>n.source.length&&e.sourceExtends(n.source,t)){let e=n.offsets;for(let r=n.source.length;r<t.length;r++)t.charCodeAt(r)===10&&e.push(r+1);return n.source=t,e}let r=[0];for(let e=0;e<t.length;e++)t.charCodeAt(e)===10&&r.push(e+1);return e.sourceLineOffsets={source:t,offsets:r},r}var nk=new WeakMap,rk=new WeakSet,ik=new WeakSet;function ak(e,t){return e.customHtmlTags===t.customHtmlTags&&e.hasCustomParserExtensions===t.hasCustomParserExtensions&&e.includeSourceMap===t.includeSourceMap&&e.postTransformNodes===t.postTransformNodes&&e.postTransformTokens===t.postTransformTokens&&e.preTransformTokens===t.preTransformTokens&&e.requireClosingStrong===t.requireClosingStrong&&e.reuseStableTopLevelNodes===t.reuseStableTopLevelNodes&&e.streamParse===t.streamParse&&e.validateLink===t.validateLink}var ok=class{constructor(e){this.streamParseEnvs=new Map,this.htmlPassIdentityPreserving=!1,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.finalized=!1,this.resettingStream=!1,this.streamStateActive=!1,this.streamResetInCurrentRootParse=!1,this.markdownIt=e}sourceExtends(e,t){return this.sourceRelationPrevious===e&&this.sourceRelationCurrent===t?!0:t.startsWith(e)?(this.sourceRelationPrevious=e,this.sourceRelationCurrent=t,!0):!1}beginRootParse(e,t){this.streamResetInCurrentRootParse=!1;let n=this.documentSource!==void 0&&e!==this.documentSource&&!this.sourceExtends(this.documentSource,e),r=this.semantics!==void 0&&!ak(this.semantics,t);(this.finalized||n||r)&&this.resetDocument(this.streamStateActive),this.finalized=!1,this.documentSource=e,this.semantics=t}finishRootParse(e){this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0,e&&(this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!0)}resetForFinalAutoParse(){this.streamResetInCurrentRootParse||this.resetStreamOnly(),this.clearDocumentCaches()}markStreamParseStarted(){this.streamStateActive=!0}resetDocument(e){e&&this.resetStreamOnly(),this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}resetStreamOnly(){let e=this.markdownIt.stream,t=e?.reset;if(e&&typeof t==`function`){this.resettingStream=!0;try{t.call(e),this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0}finally{this.resettingStream=!1}}}isResettingStream(){return this.resettingStream}handleExternalStreamReset(){this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0,this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}invalidateConfiguration(){this.resetDocument(!0)}dispose(){this.resetDocument(!0),nk.delete(this.markdownIt)}clearDocumentCaches(){this.safeMarkdown=void 0,this.tolerantMathBoundary=void 0,this.pendingExplicitMathTail=void 0,this.streamParseEnvs.clear(),this.topLevelStreamParseMode=void 0,this.structuredStream=void 0,this.htmlPassIdentityPreserving=!1,this.siblingHtmlChildren=void 0,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.sourceLineOffsets=void 0,this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0}};function sk(e){let t=e,n=e;if(!rk.has(t)){rk.add(t);let r=e.use;e.use=function(...e){try{return n.__markstreamHasCustomParserExtensions=!0,Reflect.apply(r,this,e)}finally{nk.get(t)?.invalidateConfiguration()}};let i=e.set;e.set=function(...e){try{return Reflect.apply(i,this,e)}finally{nk.get(t)?.invalidateConfiguration()}}}let r=e.stream;if(!r||typeof r.reset!=`function`)return;let i=r;if(ik.has(i))return;ik.add(i);let a=r.reset;r.reset=function(...e){let n=nk.get(t);try{return Reflect.apply(a,this,e)}finally{n?.isResettingStream()||n?.handleExternalStreamReset()}}}function ck(e){let t=e,n=nk.get(t);return n||(n=new ok(e),nk.set(t,n)),sk(e),n}function lk(e,t){if(e===t)return;let n=e.split(/\r?\n/),r=t.split(/\r?\n/),i=[],a=0;for(let e=0;e<r.length;e++){let t=r[e]??``;if(n[a]===t){i[e]={startLine:a,endLine:a+1},a++;continue}let o=n[a]??``;if(t!==``&&o!==t&&o.startsWith(t)){let n=t,s=-1;for(let t=e+1;t<r.length;t++){if(n+=r[t]??``,n===o){s=t;break}if(!o.startsWith(n))break}if(s!==-1){for(let t=e;t<=s;t++)i[t]={startLine:a,endLine:a+1};a++,e=s;continue}i[e]={startLine:a,endLine:a+1};continue}let s=n[a]??``,c=-1;for(let e=a+1;e<n.length;e++){if(s+=`\\n${n[e]??``}`,s===t){c=e+1;break}if(!t.startsWith(s))break}if(c!==-1){i[e]={startLine:a,endLine:c},a=c;continue}let l=-1;if(t!==``){let e=Math.min(n.length,a+80);for(let r=a;r<e;r++)if(n[r]===t){l=r;break}}if(l!==-1){i[e]={startLine:l,endLine:l+1},a=l+1;continue}let u=Math.min(Math.max(0,n.length-1),Math.max(0,a-1));i[e]={startLine:u,endLine:u+1}}return e=>{let t=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;if(t<i.length)return i[t]??{startLine:0,endLine:0};let r=i[i.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},a=Math.min(n.length,r.endLine+t-i.length);return{startLine:a,endLine:Math.min(n.length,a+1)}}}var uk=new Map;function dk(e){let t=uk.get(e);return t||(t=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${e}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,`gim`),uk.size>=64&&uk.clear(),uk.set(e,t)),t}function fk(e){let t=e=>e===` `||e===` `||e===`
136
+ `||e===`\r`,n=e=>{if(!e||e[0]!==`<`||e.includes(`>`))return!1;let n=1;if(n<e.length&&t(e[n])||e.startsWith(`<!--`)||e.startsWith(`<?`)||e.startsWith(`<!`)||e[n]===`/`&&(n++,n<e.length&&t(e[n])))return!1;let r=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122},i=e=>{let t=e.charCodeAt(0);return t>=48&&t<=57},a=e=>e===`!`||r(e),o=e=>r(e)||i(e)||e===`:`||e===`-`,s=e=>r(e)||i(e)||e===`_`||e===`.`||e===`:`||e===`-`,c=s;if(n>=e.length||!a(e[n]))return!1;for(n++;n<e.length&&o(e[n]);)n++;for(;n<e.length;){for(;n<e.length&&t(e[n]);)n++;if(n>=e.length)return!0;if(e[n]===`/`){for(n++;n<e.length&&t(e[n]);)n++;return n>=e.length}if(!s(e[n]))return!1;for(n++;n<e.length&&c(e[n]);)n++;for(;n<e.length&&t(e[n]);)n++;if(n<e.length&&e[n]===`=`){for(n++;n<e.length&&t(e[n]);)n++;if(n>=e.length)return!0;let r=e[n];if(r===`"`||r===`'`){for(n++;n<e.length&&e[n]!==r;)n++;if(n>=e.length)return!0;n++}else{for(;n<e.length;){let r=e[n];if(t(r)||r===`<`||r===`>`||r===`"`||r===`'`||r==="`")break;n++}if(n>=e.length)return!0}}}return!0},r=String(e??``),i=r.lastIndexOf(`<`);if(i===-1)return r;if(i>0){let e=r[i-1],t=e===` `||e===` `||e===`
137
+ `||e===`\r`,n=r[i-2];if(!t&&(e!==`n`&&e!==`r`||n!==`\\`))return r}let a=r.slice(i);return a.includes(`>`)||a.length>1&&(a[1]===` `||a[1]===` `||a[1]===`
138
+ `||a[1]===`\r`)||!n(a)||Dw(r,i)?r:r.slice(0,i)}function pk(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()).filter(Boolean));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},a=e=>{if(!e)return!1;if(e[0]===` `)return!0;let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===` `){if(t++,t>=4)return!0;continue}if(r===` `)return!0;break}return!1},o=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`){r++;continue}if(!n&&i===`'`){t=!t;continue}if(!t&&i===`"`){n=!n;continue}if(!t&&!n&&i===`>`)return r}return-1},s=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},c=(t,s)=>{if(a(t))return-1;let c=t.replace(/^[ \t]+/,``);if(!c||c.startsWith(`>`)||c.startsWith(`|`)||/^(?:[*+-]|\d+[.)])[\t ]+/.test(c))return-1;let l=!1,u=0;for(;u<t.length;){let a=t[u];if(a!==`<`){r(a)||(l=!0),u++;continue}let c=o(t.slice(u));if(c===-1){l=!0,u++;continue}let d=t.slice(u,u+c+1),f=1;for(;f<d.length&&r(d[f]);)f++;if(f>=d.length){l=!0,u++;continue}let p=d[f];if(p===`!`||p===`?`){l=!0,u+=c+1;continue}if(p===`/`){l=!0,u+=c+1;continue}let m=f;for(;f<d.length&&i(d[f]);)f++;if(f===m){l=!0,u++;continue}let h=d.slice(m,f).toLowerCase(),g=d[f];if(g&&g!==` `&&g!==` `&&g!==`>`&&g!==`/`){l=!0,u++;continue}let _=new RegExp(String.raw`<\s*\/\s*${h}\s*>`,`i`),v=/\/\s*>$/.test(d),y=_.test(t.slice(u+c+1)),b=_.test(e.slice(s+u+c+1)),x=/[\r\n]/.test(e.slice(s+u+c+1));if(l&&n.has(h)&&!v&&!y&&(b||x))return u;l=!0,u+=c+1}return-1},l=!1,u=``,d=0,f=``,p=0;for(;p<e.length;){let t=e.indexOf(`
139
+ `,p),n=t!==-1,r=n&&t>p&&e[t-1]===`\r`,i=n?r?t-1:t:e.length,a=e.slice(p,i),o=n?r?`\r
140
+ `:`
141
+ `:``,m=s(a),h=a;if(!l&&!m){let e=c(a,p);if(e!==-1){let t=o||`
142
+ `;h=`${a.slice(0,e).replace(/[ \t]+$/,``)}${t}${t}${a.slice(e).replace(/^[ \t]+/,``)}`}}f+=h,f+=o,m&&(l?m.markerChar===u&&m.markerLen>=d&&/^\s*$/.test(m.rest)&&(l=!1,u=``,d=0):(l=!0,u=m.markerChar,d=m.markerLen)),p=n?t+1:e.length}return f}function mk(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`},a=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;return e.slice(t)},o=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`){r++;continue}if(!n&&i===`'`){t=!t;continue}if(!t&&i===`"`){n=!n;continue}if(!t&&!n&&i===`>`)return r}return-1},s=(e,t,n)=>{let a=n.toLowerCase(),o=e.indexOf(`<`,t);for(;o!==-1;){let t=o+1;for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`/`){o=e.indexOf(`<`,o+1);continue}for(t++;t<e.length&&r(e[t]);)t++;if(t+a.length>e.length){o=e.indexOf(`<`,o+1);continue}let n=!0;for(let r=0;r<a.length;r++){let i=e[t+r];if((i>=`A`&&i<=`Z`?String.fromCharCode(i.charCodeAt(0)+32):i)!==a[r]){n=!1;break}}if(!n){o=e.indexOf(`<`,o+1);continue}let s=t+a.length;if(s<e.length&&i(e[s])){o=e.indexOf(`<`,o+1);continue}for(;s<e.length&&r(e[s]);)s++;if(s<e.length&&e[s]===`>`)return!0;o=e.indexOf(`<`,o+1)}return!1},c=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`<`)return e;for(t++;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]===`/`)return e;let c=t;for(;t<e.length&&i(e[t]);)t++;if(t===c)return e;let l=e.slice(c,t).toLowerCase();if(!n.has(l))return e;let u=o(e.slice(t));if(u===-1)return e;let d=t+u;if(s(e,d+1,l))return e;let f=a(e.slice(d+1));return f?`${e.slice(0,d+1)}\n${f}`:e},l=``,u=0;for(;u<e.length;){let t=e.indexOf(`
143
+ `,u);if(t===-1){l+=c(e.slice(u));break}let n=t>u&&e[t-1]===`\r`,r=n?t-1:t,i=e.slice(u,r);l+=c(i),l+=n?`\r
144
+ `:`
145
+ `,u=t+1}return l}function hk(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=0,n=!1,i=0;for(;t<e.length;){for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`>`)break;for(n=!0,t++;t<e.length&&r(e[t]);)t++;i=t}return n?{prefix:e.slice(0,i),content:e.slice(i)}:null},a=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},o=Array.from(n).map(e=>new RegExp(String.raw`(<\s*\/\s*${e}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,`gi`)),s=!1,c=``,l=0,u=``,d=0;for(;d<e.length;){let t=e.indexOf(`
146
+ `,d),n=t!==-1,r=n&&t>d&&e[t-1]===`\r`,f=n?r?t-1:t:e.length,p=e.slice(d,f),m=n?r?`\r
147
+ `:`
148
+ `:``,h=i(p),g=h?.prefix??``,_=h?.content??p,v=a(_);v&&(s?v.markerChar===c&&v.markerLen>=l&&/^\s*$/.test(v.rest)&&(s=!1,c=``,l=0):(s=!0,c=v.markerChar,l=v.markerLen));let y=_;if(!s&&y.includes(`</`))for(let e of o)y=y.replace(e,(e,t,n,r)=>{if(r.replace(/^[\t ]+/,``).startsWith(`|`))return e;let i=r.slice(0,n).replace(/^[\t ]+/,``);if(i.length>0){let n=t.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??``,r=i.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??``;if(!n||!r||n!==r)return e}return`${t}\n\n`});if(g){let e=g+y.split(`
149
+ `).join(`\n${g}`);u+=e}else u+=y;u+=m,d=n?t+1:e.length}return u}function gk(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{if(!e)return!1;if(e[0]===` `)return!0;let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===` `){if(t++,t>=4)return!0;continue}if(r===` `)return!0;break}return!1},a=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},o=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;return e.slice(t)},s=e=>{let t=0,n=!1,i=0;for(;t<e.length;){for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`>`)break;for(n=!0,t++;t<e.length&&r(e[t]);)t++;i=t}if(!n)return null;let a=e.slice(0,i);return{prefix:a,key:a.replace(/[ \t]+$/,``),content:e.slice(i)}},c=e=>o(e).startsWith(`<`),l=e=>{for(let t=0;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `)return!1}return!0},u=e=>{if(i(e))return``;let t=o(e);if(!t.startsWith(`<`))return``;let s=1;for(;s<t.length&&r(t[s]);)s++;if(s>=t.length||t[s]===`/`||t[s]===`!`||t[s]===`?`)return``;let c=s;for(;s<t.length&&a(t[s]);)s++;if(s===c)return``;let l=t.slice(c,s).toLowerCase();if(!n.has(l))return``;let u=t[s];return u&&u!==` `&&u!==` `&&u!==`>`&&u!==`/`?``:l},d=e=>{if(i(e))return null;let t=o(e);if(!t.startsWith(`<`))return null;let s=1;for(;s<t.length&&r(t[s]);)s++;if(s>=t.length)return null;let c=t[s]===`/`;if(c)for(s++;s<t.length&&r(t[s]);)s++;let l=t[s];if(!l||l===`!`||l===`?`)return null;let u=s;for(;s<t.length&&a(t[s]);)s++;if(s===u)return null;let d=t.slice(u,s).toLowerCase();if(!n.has(d))return null;let f=t[s];if(f&&f!==` `&&f!==` `&&f!==`>`&&f!==`/`)return null;if(c)return{type:`close`,name:d};if(/\/\s*>\s*$/.test(t))return{type:`open`,name:d,complete:!0};let p=t.indexOf(`>`,s);if(p!==-1){let e=t.slice(p+1);if(RegExp(`<\\s*\\/\\s*${d}\\s*>`,`i`).test(e))return{type:`open`,name:d,complete:!0}}return{type:`open`,name:d,complete:!1}},f=e=>{if(i(e))return null;let t=o(e).replace(/[ \t]+$/,``);if(!t.startsWith(`<`)||/^<\s*(?:!--|!doctype\b|\?)/i.test(t))return null;let n=t.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(n?.[1])return n[1].toLowerCase();let r=t.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!r?.[1]||!r[2])return null;let a=r[1].toLowerCase();return a===r[2].toLowerCase()?a:null},p=!1,m=``,h=0,g=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},_=e=>g(e),v=e=>{let t=o(e);return t?i(e)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(t):!1},y=(t,n,r)=>{let i=t,a=0;for(;i<e.length;){let t=e.indexOf(`
150
+ `,i),o=t!==-1,c=o&&t>i&&e[t-1]===`\r`,u=o?c?t-1:t:e.length,f=e.slice(i,u),p=s(f),m=p?.key??``;if(a>0&&n&&m!==n)break;let h=p?.content??f,g=d(h);if(g?.name===r){if(g.type===`open`)g.complete||a++;else if(a>0&&(a--,a===0))return!1}else if(a>0&&(l(h)||v(h)))return!0;if(o)i=t+1;else break}return!1},b=``,x=0,S=!0,C=!1,w=!1,T=`
151
+ `,E=[],D=``;for(;x<e.length;){let t=e.indexOf(`
152
+ `,x),n=t!==-1,r=n&&t>x&&e[t-1]===`\r`,i=n?r?t-1:t:e.length,a=e.slice(x,i),o=n?r?`\r
153
+ `:`
154
+ `:``,g=s(a),v=g?.key??``,O=g?.content??a,k=_(O);k&&(p?k.markerChar===m&&k.markerLen>=h&&/^\s*$/.test(k.rest)&&(p=!1,m=``,h=0):(p=!0,m=k.markerChar,h=k.markerLen));let ee=E.length>0;if(!p&&!ee){let e=u(O),t=!!e&&!S&&C&&w&&y(x,v,e);e&&!S&&(!C||t)&&(v&&D&&v===D?b+=`${v}${T}`:v||(b+=T))}if(b+=a,b+=o,o&&(T=o),!p){let e=d(O);if(e){if(e.type===`open`)e.complete||E.push(e.name);else for(let t=E.length-1;t>=0;t--)if(E[t]===e.name){E.length=t;break}}}let A=l(O);S=A,C=!A&&c(O),w=!A&&!!f(O),D=v,x=n?t+1:e.length}return b}function _k(e,t,n){let r=e;if(t?.length&&r.includes(`<`)){let e=Ny(t);if(e.length&&(r=pk(r,e),r=mk(r,e),r=gk(r,e),r=hk(r,e),r.includes(`</`)))for(let t of e)r=r.replace(dk(t),`$1$2$2`)}return n||(r=fk(r)),r}var vk=1024,yk=16;function bk(e,t,n){let r=e.replace(/([^\\])\r(ight|ho)/g,`$1\\r$2`),i=zw(r);return r=r.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(e,t,n,r)=>{i.scanTo(r+1);let a=i.inMath();return i.scanTo(r+e.length),a?`${t}\\n${n}`:e}),t||(r.endsWith(`- *`)&&(r=r.replace(/- \*$/,`- \\*`)),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,e=>e.startsWith(`
155
+ `)?`
156
+ `:``):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,e=>e.startsWith(`
157
+ `)?`
158
+ `:``):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,e=>e.startsWith(`
159
+ `)?`
160
+ `:``):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
161
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,e=>e.startsWith(`
162
+ `)?`
163
+ `:``)):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(e,t,n)=>`${t}${n.split(``).map(()=>`\\*`).join(``)}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,e=>e.startsWith(`
164
+ `)?`
165
+ `:``):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
166
+ `)),r=Aw(r,n.customHtmlTags)??r),r=_k(r,n.customHtmlTags,t),r}function xk(e,t,n,r){let i=`${n?`final`:`stream`}:${(r.customHtmlTags??[]).join(`,`)}`,a=r.isFragment?void 0:e.safeMarkdown,o;if(!n&&!r.customHtmlTags?.length&&a&&a.mode===i&&t.length>=a.source.length&&e.sourceExtends(a.source,t)){let e=Math.max(0,a.source.length-vk-yk),i=bk(t.slice(e),n,r),s=a.source.length-e;o=i.length>=s&&i.slice(0,s)===a.safeMarkdown.slice(-s)?a.safeMarkdown.slice(0,a.safeMarkdown.length-s)+i:bk(t,n,r)}else o=bk(t,n,r);return n||(o=Nw(o,e,!r.isFragment)),r.isFragment||(e.safeMarkdown={source:t,safeMarkdown:o,mode:i}),o}function Sk(){return typeof performance<`u`?performance.now():Date.now()}function Ck(e,t,n){e&&(e[t]=(e[t]??0)+n)}function wk(e){return e.parserMetrics}function Tk(e,t,n){return t&&Ck(t,`parseMarkdownToStructureTotalMs`,Sk()-n),e}function Ek(e,t,n,r){return Tk(rO(e,t),n,r)}function Dk(e,t,n){if(!n)return ek(e,t,tO);Ck(n,`processTokensInputTokens`,e.length);let r=Sk(),i=ek(e,t,tO);return Ck(n,`processTokensMs`,Sk()-r),i}function Ok(e,t){let n=e,r=typeof n.validateLink==`function`&&n.__markstreamOriginalValidateLink&&n.validateLink!==n.__markstreamOriginalValidateLink?n.validateLink:void 0;return t.validateLink??r??n.options?.validateLink??(typeof n.validateLink==`function`?n.validateLink:void 0)}function kk(e,t){let n=t.runtime,r=t.markdownIt,i={...t,customHtmlBlockCursor:0,sourceLineOffsets:void 0},a=wk(i),o=a?{recordTokenCloneMs:e=>Ck(a,`tokenCloneMs`,e)}:void 0,s=a?Sk():0,c=!!i.final,l=(e??``).toString();i.isFragment||Ww(n,i);let u=xk(n,l,c,i);a&&Ck(a,`safeMarkdownMs`,Sk()-s);let d=kC(u);if(d){if(i.includeSourceMap){let e={...i,sourceLineMapper:lk(l,u)};d[0].sourceMap=YC(u,0,u.length,e)}let e=i.preTransformTokens,t=i.postTransformTokens;if(Hw(n,i)||typeof e==`function`||typeof t==`function`){let r=Qw(n,u,{__markstreamFinal:c},i,o),a=typeof e==`function`&&e(r)||r;typeof t==`function`&&t(a)}return Ek(d,i,a,s)}let f=a?Sk():0,p=Qw(n,u,{__markstreamFinal:c},i,o);if(a&&Ck(a,`tokenizeMs`,Sk()-f),!p||!Array.isArray(p))return Ek([],i,a,s);let m=i.preTransformTokens,h=i.postTransformTokens,g=p;m&&typeof m==`function`&&(g=m(g)||g);let _={...i,sourceLineMapper:i.includeSourceMap===!0?lk(l,u):void 0,sourceMarkdown:u,sourceLineOffsets:tk(n,u),customHtmlBlockCursor:0},v=fT(n,u,g,_,{processTokens:(e,t)=>Dk(e,t,a),recordReusedTopLevelNodes:e=>Ck(a,`processTokensReusedTopLevelNodes`,e)});if(h&&typeof h==`function`){let e=h(g);if(Array.isArray(e)){let t=e[0],n=t?.type;v=t&&typeof n==`string`?Dk(e,{..._,customHtmlBlockCursor:0},a):e}}let y=n.structuredReuseTailStart,b=y&&y>0&&y<v.length?y:0;if(TT(v)){let e=a?Sk():0,t={getInternalNodeSourceRange:e=>KO(e,n),markdownIt:r,parseFragment:(e,t)=>kk(e,t)},i=b>0&&n.htmlPassIdentityPreserving,o=i?KO(v[b],n)?.start:void 0,s=!1;for(let e=i?b:0;e<v.length;e++){let t=v[e];if(t.type===`html_block`&&String(t.tag??``).toLowerCase()===`details`){s=!0;break}}let l=i&&!s&&o!=null,d=l?v.slice(0,b):[],f=l?v.slice(b):v,p=l?o:0,m=AT(f,c,u,t,_,p),h=m.length===f.length&&m.every((e,t)=>e===f[t]);s&&(m=kT(m,u,t,_,c,p)[0]),m=wT(m,t,_,c),v=l?d.concat(m):m,n.htmlPassIdentityPreserving=!s&&h,a&&Ck(a,`htmlBlockPassesMs`,Sk()-e)}else n.htmlPassIdentityPreserving=!0;return c&&nO(v),v=rO(v,i),i.debug&&console.log(`Parsed Markdown Tree Structure:`,v),Tk(v,a,s)}function Ak(e,t,n={}){let r=(e??``).toString(),i=ck(t),a=Ok(t,n),o=pb(n,{markdownIt:t,runtime:i,validateLink:a}),s=t;i.beginRootParse(r,{customHtmlTags:(n.customHtmlTags??[]).join(`\0`),hasCustomParserExtensions:s.__markstreamHasCustomParserExtensions===!0,includeSourceMap:n.includeSourceMap===!0,postTransformNodes:n.postTransformNodes,postTransformTokens:n.postTransformTokens,preTransformTokens:n.preTransformTokens,requireClosingStrong:n.requireClosingStrong,reuseStableTopLevelNodes:n.reuseStableTopLevelNodes===!0,streamParse:n.streamParse,validateLink:a});try{return kk(r,o)}finally{i.finishRootParse(n.final===!0)}}var jk=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,Mk=/\d/u,Nk=/[,.!?;:,。;、!?:]/u,Pk=/\d\p{Script=Han}{1,3}$/u;function Fk(e){return e.pos>0&&e.pos+1<e.posMax&&Mk.test(e.src[e.pos-1])&&Mk.test(e.src[e.pos+1])}function Ik(e,t,n,r,i,a={}){let o=e.charCodeAt(0);return(e,s)=>{let c=e,l=c.posMax,u=c.pos;if(c.src.charCodeAt(u)!==o||s||a.refuseDigitRange&&Fk(c))return!1;c.pos=u+1;let d=!1;for(;c.pos<l;){if(c.src.charCodeAt(c.pos)===o){d=!0;break}c.md.inline.skipToken(c)}if(!d||u+1===c.pos)return c.pos=u,!1;let f=c.src.slice(u+1,c.pos);if(!f||f.match(/(^|[^\\])(\\\\)*\s/))return c.pos=u,!1;let p=c.src[c.pos+1],m=Mk.test(f[0]),h=p!==void 0&&Mk.test(p);if(m&&h&&(Pk.test(c.src.slice(0,u))||Nk.test(f)||Mk.test(f[f.length-1])))return c.pos=u,!1;let g=c.push(n,i,1);g.markup=t;let _=c.push(`text`,``,0);_.content=f.replace(jk,`$1`);let v=c.push(r,i,-1);return v.markup=t,c.pos+=1,!0}}function Lk(e){let t=Ik(`~`,`~`,`sub_open`,`sub_close`,`sub`,{refuseDigitRange:!0});e.inline.ruler.after(`emphasis`,`sub`,t)}var Rk=new Set([...ay,`base`,`button`,`datalist`,`dialog`,`embed`,`fieldset`,`form`,`iframe`,`input`,`legend`,`link`,`meta`,`object`,`optgroup`,`option`,`output`,`param`,`select`,`style`,`template`,`textarea`,`title`]),zk=new Set(`a.abbr.b.blockquote.br.caption.code.col.colgroup.dd.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.ins.kbd.li.mark.ol.p.picture.pre.s.small.source.span.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.ul`.split(`.`));function Bk(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Vk(e){return String(e??``).trim().toLowerCase()}function Hk(e,t=`safe`){let n=Vk(e);return n?t===`escape`?!0:t===`trusted`?ay.has(n):!zk.has(n):!1}function Uk(e,t=`safe`){let n=Vk(e);return n?t===`escape`?!0:t===`trusted`?ay.has(n):Rk.has(n):!1}function Wk(e,t){let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length!==0&&n.some(e=>{let n=e.split(/\s+/,1)[0]??``;return!n||yy(n,{tagName:t,attrName:`srcset`})})}function Gk(e,t,n,r){return ry.has(e)||n===`safe`&&e===`style`?!0:e===`srcset`?Wk(t,r):!!(iy.has(e)&&t&&yy(t,{tagName:r,attrName:e}))}function Kk(e,t){let n=t.toLowerCase();return Object.keys(e).find(e=>e.toLowerCase()===n)}function qk(e,t,n,r=!1){if(t!==`safe`||Vk(n)!==`a`)return e;let i=Kk(e,`href`);if(r&&(!i||!e[i])){let t=Kk(e,`target`),n=Kk(e,`rel`);return t&&delete e[t],n&&delete e[n],e}let a=Kk(e,`target`);if((a?String(e[a]).trim():``).toLowerCase()!==`_blank`)return e;let o=Kk(e,`rel`),s=new Set(String(o?e[o]:``).split(/\s+/).map(e=>e.trim()).filter(Boolean).filter(e=>e.toLowerCase()!==`opener`));return s.add(`noopener`),s.add(`noreferrer`),o&&o!==`rel`&&delete e[o],e.rel=Array.from(s).join(` `),e}function Jk(e,t=`safe`,n){let r={};for(let[i,a]of Object.entries(e)){let e=i.trim(),o=e.toLowerCase();e&&Bk(e)&&(Gk(o,a,t,n)||(r[e]=a))}return qk(r,t,n,!!Kk(e,`href`))}var Yk=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],Xk=`http://www.w3.org/2000/svg`,Zk=new Set([`script`,`style`,`iframe`,`object`,`embed`,`link`,`meta`]),Qk=new Set([`svg`,`style`,`g`,`a`,`defs`,`marker`,`path`,`rect`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`text`,`tspan`,`title`,`desc`,`use`,`image`,`lineargradient`,`radialgradient`,`stop`,`clippath`,`mask`,`pattern`]),$k=new Set([`href`,`xlink:href`,`src`,`srcdoc`,`action`,`data`,`formaction`,`poster`]),eA=new Set([`clip-path`,`fill`,`filter`,`marker-end`,`marker-mid`,`marker-start`,`mask`,`stroke`]),tA=new Set([`circle`,`ellipse`,`image`,`line`,`path`,`polygon`,`polyline`,`rect`,`text`,`tspan`,`use`]);function nA(e){return(e.getAttribute(`href`)||e.getAttribute(`xlink:href`))?.startsWith(`#`)===!0}function rA(e){return!!(e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||e.getAttribute(`src`))}function iA(e){let t=e.nodeName.toLowerCase();return t===`use`?nA(e):t===`image`?rA(e):t===`text`||t===`tspan`?!!e.textContent?.trim():tA.has(t)}function aA(e){return e.replace(/(["'])\s*javascript:/gi,`$1#`).replace(/\bjavascript:/gi,`#`).replace(/(["'])\s*vbscript:/gi,`$1#`).replace(/\bvbscript:/gi,`#`).replace(/\bdata:text\/html/gi,`#`)}function oA(e,t,n){let r=e.toLowerCase(),i=t.toLowerCase(),a=String(n??``).trim();return a?(r===`use`||r===`marker`||r===`clippath`||r===`mask`)&&(i===`href`||i===`xlink:href`)?a.startsWith(`#`)?a:``:r===`a`&&(i===`href`||i===`xlink:href`)?yy(a,{tagName:`a`,attrName:`href`})?``:a:r===`image`&&(i===`href`||i===`xlink:href`||i===`src`)?yy(a,{tagName:`img`,attrName:`src`})?``:a:i===`href`||i===`xlink:href`?a.startsWith(`#`)?a:``:yy(a,{tagName:r,attrName:i})?``:a:``}function sA(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??``);)n++;let r=e[n];if(r===`"`||r===`'`){let t=n+1,i=e.indexOf(r,t);if(i===-1)return{next:e.length,url:``};for(n=i+1;n<e.length&&/\s/.test(e[n]??``);)n++;return{next:n<e.length&&e[n]===`)`?n+1:n,url:e.slice(t,i)}}let i=n;for(;n<e.length&&e[n]!==`)`;)n++;return{next:n<e.length?n+1:n,url:e.slice(i,n)}}function cA(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(e,t)=>{let n=t.trim();if(/^[0-9a-f]+$/i.test(n)){let e=Number.parseInt(n,16);try{return Number.isFinite(e)?String.fromCodePoint(e):``}catch{return``}}return String(t).trim()})}function lA(e){let t=cA(e),n=t.toLowerCase(),r=0;for(;r<n.length;){let e=n.indexOf(`url(`,r);if(e===-1)return!1;let i=sA(t,e);if(r=Math.max(i.next,e+4),!i.url.trim().startsWith(`#`))return!0}return!1}function uA(e){let t=cA(e);return Yk.some(e=>e.test(t))||lA(t)}function dA(e){if(e.tagName.toLowerCase()!==`a`||e.getAttribute(`target`)?.trim().toLowerCase()!==`_blank`)return;let t=new Set(String(e.getAttribute(`rel`)??``).split(/\s+/).map(e=>e.trim()).filter(Boolean).filter(e=>e.toLowerCase()!==`opener`));t.add(`noopener`),t.add(`noreferrer`),e.setAttribute(`rel`,Array.from(t).join(` `))}function fA(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)?t:0}function pA(e,t){if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??``;n&&t.push(n);return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase();if(!Zk.has(r)){if(r===`br`){t.push(`
167
+ `);return}for(let e of Array.from(n.childNodes))pA(e,t)}}function mA(e){for(let t of Array.from(e.querySelectorAll(`foreignObject`))){let n=[];pA(t,n);let r=n.join(``).split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(!r.length){t.remove();continue}let i=fA(t.getAttribute(`width`)),a=fA(t.getAttribute(`height`)),o=fA(t.getAttribute(`x`)),s=fA(t.getAttribute(`y`)),c=e.ownerDocument.createElementNS(Xk,`text`);c.setAttribute(`x`,String(o+i/2)),c.setAttribute(`y`,String(s+a/2)),c.setAttribute(`text-anchor`,`middle`),c.setAttribute(`dominant-baseline`,`central`);let l=t.querySelector(`.nodeLabel`);if(l?.getAttribute(`class`)&&c.setAttribute(`class`,l.getAttribute(`class`)),r.length===1)c.textContent=r[0];else{let t=-.6*(r.length-1);for(let[n,a]of r.entries()){let r=e.ownerDocument.createElementNS(Xk,`tspan`);r.setAttribute(`x`,String(o+i/2)),r.setAttribute(`dy`,n===0?`${t}em`:`1.2em`),r.textContent=a,c.appendChild(r)}}t.parentNode?.replaceChild(c,t)}}function hA(e){mA(e);let t=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of t){let t=e.tagName.toLowerCase();if(!Qk.has(t)){e.remove();continue}if(t===`style`&&uA(e.textContent??``)){e.remove();continue}let n=Array.from(e.attributes);for(let r of n){let n=r.name.toLowerCase();if(/^on/i.test(n)){e.removeAttribute(r.name);continue}if(n===`style`&&r.value&&uA(r.value)){e.removeAttribute(r.name);continue}if(n===`srcdoc`){e.removeAttribute(r.name);continue}if($k.has(n)&&r.value){let i=oA(t,n,r.value);if(!i){e.removeAttribute(r.name);continue}i!==r.value&&e.setAttribute(r.name,i);continue}if(eA.has(n)&&r.value&&lA(r.value)){e.removeAttribute(r.name);continue}if(r.value){let t=aA(r.value);t!==r.value&&e.setAttribute(r.name,t)}}dA(e)}}function gA(e){if(typeof DOMParser>`u`||!e)return null;try{let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.nodeName.toLowerCase()!==`svg`)return null;let n=t;return hA(n),yA(n)?null:n}catch{return null}}function _A(e){return gA(e)?.outerHTML??null}function vA(e){return _A(e)??``}function yA(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/);if(e.length===4){let t=Number.parseFloat(e[2]||``),n=Number.parseFloat(e[3]||``);if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return!0}}let n=[e,...Array.from(e.querySelectorAll(`*`))],r=!1;for(let e of n){iA(e)&&(r=!0);for(let t of Array.from(e.attributes))if(/\bNaN\b/i.test(t.value)||t.name===`style`&&/max-width:\s*0(?:px)?/i.test(t.value))return!0}return!r}var bA=[];function xA(e){return String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function SA(e){return(String(e||`text`).trim().split(/\s+/)[0]||`text`).replace(/[^\w+.#:-]/g,`-`).replace(/-+/g,`-`)||`text`}function CA(e){return e.replace(/[^\w:.+-]/g,`-`).replace(/-+/g,`-`)}function wA(e=`editor-${Date.now()}`,t={}){let n=bC(t),r=n;r.__markstreamRegisteredPluginCount=bA.length,r.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||bA.length);let i={"common.copy":`Copy`},a;if(typeof t.i18n==`function`)a=t.i18n;else if(t.i18n&&typeof t.i18n==`object`){let e=t.i18n;a=t=>e[t]??i[t]??t}else a=e=>i[e]??e;if(Array.isArray(t.plugin))for(let e of t.plugin){let t=e;if(Array.isArray(t)){let[e,...r]=t;typeof e==`function`&&n.use(e,...r)}else typeof t==`function`&&n.use(t)}if(Array.isArray(t.apply))for(let e of t.apply)try{e(n)}catch(e){console.error(`[getMarkdown] apply function threw an error`,e)}if(bA.length)for(let e of bA)if(Array.isArray(e)){let[t,...r]=e;typeof t==`function`&&n.use(t,...r)}else typeof e==`function`&&n.use(e);n.use(Lk),n.use(Fu),n.use(Mu);let o=td,s=o.default??o;n.use(s),n.use(ju),n.use(Au),n.core.ruler.after(`block`,`mark_fence_closed`,e=>{let t=e,n=t.src,r=!!t.env?.__markstreamFinal,i;for(let e of t.tokens){if(e.type!==`fence`||!e.map||!e.markup)continue;let t=e.map[0],a=e.map[1],o=e.markup,s=o[0],c=o.length,l=Math.max(0,a-1);i??=n.split(/\r?\n/);let u=i[l]??``,d=0;for(;d<u.length&&(u[d]===` `||u[d]===` `);)d++;let f=0;for(;d+f<u.length&&u[d+f]===s;)f++;let p=d+f;for(;p<u.length&&(u[p]===` `||u[p]===` `);)p++;let m=r?!0:a>t+1&&f>=c&&p===u.length,h=e;h.meta=h.meta??{},h.meta.unclosed=!m,h.meta.closed=!!m}}),n.renderer.rules.fence=(t,n)=>{let r=t[n],i=String(r.info??``).trim(),o=String(r.content??``),s=btoa(unescape(encodeURIComponent(o))),c=SA(i),l=xA(c),u=CA(`editor-${e}-${n}-${c}`),d=xA(a(`common.copy`));return`<div class="code-block" data-code="${s}" data-lang="${l}" id="${u}">
168
+ <div class="code-header">
169
+ <span class="code-lang">${xA(c.toUpperCase())}</span>
170
+ <button class="copy-button" data-code="${s}">${d}</button>
171
+ </div>
172
+ <div class="code-editor"></div>
173
+ </div>`};let c=/^\[(\d+)\]/,l=/^\[([^\]\n]+)\]/,u=e=>{if(!e.startsWith(`[`))return!1;let t=l.exec(e);if(!t)return e!==`[`&&!/^\[\d+$/.test(e);let n=String(t[1]??``);return!e.slice(t[0].length).startsWith(`(`)&&!/^\d+$/.test(n)};n.inline.ruler.before(`escape`,`reference`,(e,t)=>{let n=e;if(n.src[n.pos]!==`[`)return!1;let r=c.exec(n.src.slice(n.pos));if(!r)return!1;let i=n.src.slice(Math.max(0,n.pos-120),n.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(i))return!1;let a=n.src.slice(n.pos+r[0].length);if(a.startsWith(`](`)||a.startsWith(`(`)||u(a))return!1;if(!t){let e=r[1],t=n.push(`reference`,`span`,0);t.content=e,t.markup=r[0],t.raw=r[0]}return n.pos+=r[0].length,!0}),n.renderer.rules.reference=(e,t)=>{let n=String(e[t].content??``);return`<span class="reference-link" data-reference-id="${n}" role="button" tabindex="0" title="Click to view reference">${n}</span>`};let d=n.use.bind(n);return n.use=((...e)=>(r.__markstreamHasCustomParserExtensions=!0,d(...e))),n}var TA=/<\/?([A-Z][\w:-]*)(?:\s[^<>]*)?>/gi;function EA(e,t,n){let r=Ny(n),i=new Set(r);if(!t||i.size===0||!Array.isArray(e)||e.length===0)return Array.isArray(e)?e.slice():[];let a=DA(t,i);if(a.length===0)return e.slice();let o=0,s=e.map(e=>jA(e)),c=e=>{if(!e||typeof e!=`object`)return;let t=AA(e,i);if(t){let n=kA(a,t,()=>o,e=>o=e);n&&(e.tag=t,e.type=t,e.content=n.innerContent,e.raw=n.raw,typeof e.loading!=`boolean`&&(e.loading=n.loading))}for(let t of Object.values(e))if(Array.isArray(t))for(let e of t)e&&typeof e==`object`&&c(e)};for(let e of s)c(e);return s}function DA(e,t){let n=[],r=[],i;for(TA.lastIndex=0;(i=TA.exec(e))!==null;){let a=i[0],o=My(i[1]);if(!o||!t.has(o))continue;if(!a.startsWith(`</`)){n.push({tag:o,start:i.index,openEnd:TA.lastIndex});continue}let s=OA(n,o);if(s<0)continue;let[c]=n.splice(s,1),l=i.index,u=TA.lastIndex;r.push({tag:o,start:c.start,end:u,innerContent:e.slice(c.openEnd,l),raw:e.slice(c.start,u),loading:!1})}for(let t of n)r.push({tag:t.tag,start:t.start,end:e.length,innerContent:e.slice(t.openEnd),raw:e.slice(t.start),loading:!0});return r.sort((e,t)=>e.start===t.start?t.end-e.end:e.start-t.start)}function OA(e,t){for(let n=e.length-1;n>=0;--n)if(e[n]?.tag===t)return n;return-1}function kA(e,t,n,r){let i=n();for(;i<e.length;){let n=e[i];if(i+=1,n.tag===t)return r(i),n}return r(i),null}function AA(e,t){let n=My(e.tag);if(n&&t.has(n))return n;let r=My(e.type);return r&&t.has(r)?r:``}function jA(e){if(!e||typeof e!=`object`)return e;let t=Array.isArray(e)?e.map(e=>jA(e)):{...e};if(!Array.isArray(t))for(let[e,n]of Object.entries(t))Array.isArray(n)&&(t[e]=n.map(e=>jA(e)));return t}var MA=new Map,NA=new Set([`table`,`code_block`,`html_block`,`blockquote`,`list`,`list_item`,`definition_list`,`footnote`,`admonition`,`thematic_break`,`math_block`,`thinking`,`vmr_container`]);function PA(e,t={},n,r){let i=Ny([...e.customHtmlTags||[],...e.parseOptions?.customHtmlTags||[]]);return{customId:e.customId,isDark:e.isDark,indexKey:e.indexKey==null?void 0:String(e.indexKey),final:e.final,typewriter:e.typewriter,fade:e.fade,textStreamState:n,streamRenderVersion:r,showTooltips:e.showTooltips,codeBlockStream:e.codeBlockStream,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,allowHtml:e.allowHtml!==!1,htmlPolicy:e.htmlPolicy??`safe`,customHtmlTags:i,parseOptions:e.parseOptions,customMarkdownIt:e.customMarkdownIt,codeBlockOptions:e.codeBlockOptions,codeBlockProps:e.codeBlockProps,mermaidProps:e.mermaidProps,d2Props:e.d2Props,infographicProps:e.infographicProps,customComponents:e.customComponents,codeBlockThemes:{themes:e.themes,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:t}}function FA(e){if(Array.isArray(e.nodes))return e.nodes;let t=LA(e.content);if(!t)return[];let n=Ny([...e.customHtmlTags||[],...e.parseOptions?.customHtmlTags||[]]),r=`${e.customId||`markstream-svelte`}::${n.join(`,`)}`,i=MA.get(r);i||(i=wA(r,{customHtmlTags:n}),MA.set(r,i));let a=e.customMarkdownIt?e.customMarkdownIt(i):i,o={...e.parseOptions??{}};return typeof e.final==`boolean`&&(o.final=e.final),n.length>0&&(o.customHtmlTags=n),EA(Ak(t,a,o),t,n)}function IA(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`):[]}function LA(e){return typeof e==`string`?e:e==null?``:String(e)}function RA(e){return LA(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function zA(e){return RA(e).replace(/`/g,`&#96;`)}function BA(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)}function VA(e){let t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}function HA(e){return String(String(e??``).split(/\s+/g)[0]??``).toLowerCase().replace(/[^\w-]/g,``)||`plaintext`}function UA(e){return HA(e?.language)}function WA(e){if(!e)return``;let t=(globalThis==null?void 0:globalThis.require)?.call(globalThis,`buffer`)?.Buffer;if(t?.from)return t.from(e,`utf8`).toString(`base64`);if(typeof TextEncoder<`u`&&typeof globalThis.btoa==`function`){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return globalThis.btoa(n)}return``}function GA(e){let t=[],n=[],r=()=>{n.length&&=(t.push({kind:`inline`,nodes:n.slice()}),0)};for(let i of e)NA.has(String(i?.type||``))?(r(),t.push({kind:`block`,node:i})):n.push(i);return r(),t}function KA(e,t,n){return Jk(e,t,n)}function qA(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n);if(t!==-1){n=t+3;continue}break}let r=e.indexOf(`<`,n);if(r===-1){n<e.length&&t.push({type:`text`,content:e.slice(n)});break}if(r>n&&t.push({type:`text`,content:e.slice(n,r)}),e.startsWith(`![CDATA[`,r+1)){let i=e.indexOf(`]]>`,r);if(i!==-1){t.push({type:`text`,content:e.slice(r,i+3)}),n=i+3;continue}break}if(e.startsWith(`!`,r+1)){let t=e.indexOf(`>`,r);if(t!==-1){n=t+1;continue}break}let i=e.indexOf(`>`,r);if(i===-1)break;let a=e.slice(r+1,i).trim();if(!a){n=i+1;continue}let o=a.startsWith(`/`),s=a.endsWith(`/`);if(o){let e=a.slice(1).trim();t.push({type:`tag_close`,tagName:e}),n=i+1;continue}let c=a.indexOf(` `),l=``,u=``;c===-1?l=s?a.slice(0,-1).trim():a.trim():(l=a.slice(0,c).trim(),u=a.slice(c+1));let d={};if(u){let e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g,t;for(;(t=e.exec(u))!==null;){let e=t[1],n=t[2]??t[3]??t[4]??``;e&&!e.endsWith(`/`)&&(d[e]=n)}}t.push({type:s||ey.has(l.toLowerCase())?`self_closing`:`tag_open`,tagName:l,attrs:d}),n=i+1}return t}function JA(e){return String(e??``).trim().toLowerCase()}function YA(e){let t=Object.entries(e);return t.length===0?``:t.map(([e,t])=>t===``?` ${e}`:` ${e}="${zA(t)}"`).join(``)}function XA(e){let t=String(e.tagName??``).trim();if(!t)return``;if(e.type===`tag_close`)return`&lt;/${RA(t)}&gt;`;let n=Object.entries(e.attrs??{}).map(([e,t])=>t===``?` ${RA(e)}`:` ${RA(e)}="${zA(t)}"`).join(``);return e.type===`self_closing`?`&lt;${RA(t)}${n} /&gt;`:`&lt;${RA(t)}${n}&gt;`}function ZA(e,t=`safe`){if(!e)return``;if(t===`escape`)return RA(e);let n=qA(e),r=[],i=[],a=0;for(let e of n){if(e.type===`text`){a===0&&i.push(RA(e.content??``));continue}let n=JA(e.tagName);if(!n)continue;if(ay.has(n)||Uk(n,t)){e.type===`tag_open`?a+=1:e.type===`tag_close`&&a>0&&--a;continue}if(a>0)continue;if(t===`safe`&&Hk(n,t)){i.push(XA(e));continue}if(e.type===`self_closing`){i.push(`<${n}${YA(KA(e.attrs??{},t,n))}>`);continue}if(e.type===`tag_open`){i.push(`<${n}${YA(KA(e.attrs??{},t,n))}>`),ey.has(n)||r.push(n);continue}let o=r.lastIndexOf(n);if(o===-1)continue;for(;r.length>o+1;){let e=r.pop();e&&i.push(`</${e}>`)}let s=r.pop();s&&i.push(`</${s}>`)}for(;r.length>0;){let e=r.pop();e&&i.push(`</${e}>`)}return i.join(``)}var QA=`markstream-svelte-html`,$A=`div`,ej=new Map,tj=new Set(`admonition.blockquote.checkbox.checkbox_input.code_block.definition_item.definition_list.emoji.emphasis.footnote.footnote_reference.footnote_anchor.hardbreak.heading.highlight.html_block.html_inline.image.inline_code.insert.link.list.list_item.math_block.math_inline.paragraph.reference.strikethrough.strong.subscript.superscript.table.table_cell.table_row.text.thematic_break`.split(`.`));function nj(e,t={}){return aj(e,rj(t))}function rj(e){let t=Ny(e.customHtmlTags),n=`${e.cacheKey||QA}::${t.join(`,`)}`,r=ej.get(n);return r||(r=wA(n,{customHtmlTags:t}),ej.set(n,r)),{markdown:r,options:{allowHtml:e.allowHtml!==!1,htmlPolicy:e.htmlPolicy??`safe`,customNodeTag:My(e.customNodeTag)||$A,customNodeClass:e.customNodeClass}}}function ij(e,t){return(Array.isArray(e)?e:[]).map(e=>aj(e,t)).join(``)}function aj(e,t){if(!e||typeof e!=`object`)return``;switch(e.type){case`text`:return oj(e);case`paragraph`:return`<p>${ij(jj(e.children),t)}</p>`;case`strong`:return`<strong>${ij(jj(e.children),t)}</strong>`;case`emphasis`:return`<em>${ij(jj(e.children),t)}</em>`;case`strikethrough`:return`<del>${ij(jj(e.children),t)}</del>`;case`highlight`:return`<mark>${ij(jj(e.children),t)}</mark>`;case`insert`:return`<ins>${ij(jj(e.children),t)}</ins>`;case`subscript`:return`<sub>${ij(jj(e.children),t)}</sub>`;case`superscript`:return`<sup>${ij(jj(e.children),t)}</sup>`;case`inline_code`:return`<code>${Fj(Mj(e.code))}</code>`;case`hardbreak`:return`<br>`;case`link`:return sj(e,t);case`image`:return uj(e);case`list`:return dj(e,t);case`list_item`:return`<li>${ij(jj(e.children),t)}</li>`;case`blockquote`:return`<blockquote>${ij(jj(e.children),t)}</blockquote>`;case`heading`:return fj(e,t);case`code_block`:return pj(e);case`thematic_break`:return`<hr>`;case`table`:return mj(e,t);case`table_row`:return hj(e,t);case`table_cell`:return gj(e,t);case`definition_list`:return _j(e,t);case`definition_item`:return vj(e,t);case`footnote`:return yj(e,t);case`footnote_reference`:return bj(e);case`footnote_anchor`:return xj(e);case`admonition`:return Sj(e,t);case`checkbox`:case`checkbox_input`:return`<input type="checkbox" disabled${e.checked?` checked`:``}>`;case`emoji`:return Fj(Mj(e.raw||e.markup||e.content||e.name));case`math_inline`:return cj(e);case`math_block`:return lj(e);case`reference`:return`<span class="markstream-nested-reference">${Fj(Mj(e.id))}</span>`;case`html_inline`:case`html_block`:return Cj(e,t);default:return wj(e,t)}}function oj(e){let t=Mj(e.content),n=Fj(t),r=!!e.center;return!r&&!t.includes(`
174
+ `)?n:`<span class="${r?`markstream-svelte-text-node markstream-svelte-text--centered`:`markstream-svelte-text-node`}">${n}</span>`}function sj(e,t){let n=Mj(e.href),r=Mj(e.title),i=jj(e.children).length>0?ij(jj(e.children),t):Fj(Mj(e.text||n)),a=r?` title="${Ij(r)}"`:``,o=n&&!yy(n)?n:``;return`<a${o?` href="${Ij(o)}"`:``}${a}${by(o)?` target="_blank" rel="noreferrer noopener"`:``}>${i}</a>`}function cj(e){return`<span class="markstream-nested-math" data-display="inline"><span class="markstream-nested-math__source">${Fj(Mj(e.content||e.markup||e.raw))}</span><span class="markstream-nested-math__render" aria-hidden="true"></span></span>`}function lj(e){return`<div class="markstream-nested-math-block"><pre class="markstream-nested-math-block__source"><code>${Fj(Mj(e.content||e.markup||e.raw))}</code></pre><div class="markstream-nested-math-block__render" aria-hidden="true"></div></div>`}function uj(e){let t=Sy(e.src);if(!t)return``;let n=Mj(e.alt),r=Mj(e.title),i=r?` title="${Ij(r)}"`:``;return`<img src="${Ij(t)}" alt="${Ij(n)}"${i}>`}function dj(e,t){let n=e.ordered?`ol`:`ul`;return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:``}>${ij(jj(e.items),t)}</${n}>`}function fj(e,t){let n=Pj(e.level);return`<h${n}>${ij(jj(e.children),t)}</h${n}>`}function pj(e){let t=Mj(e.language).trim(),n=Nj(t),r=n?` class="language-${n}"`:``,i=!!e.diff,a=Mj(e.code),o=e.loading===!0;return o&&!a.trim()?``:`<pre ${[`data-markstream-code-block="1"`,t?`data-markstream-language="${Ij(t)}"`:``,o?`data-markstream-loading="1"`:``,i?`data-markstream-diff="1"`:``,i?`data-markstream-original="${Ij(Rj(Mj(e.originalCode)))}"`:``,i?`data-markstream-updated="${Ij(Rj(Mj(e.updatedCode)))}"`:``,o?`aria-busy="true"`:``].filter(Boolean).join(` `)}><code${r}>${Fj(a)}</code></pre>`}function mj(e,t){let n=e.header?hj(e.header,t,!0):``,r=ij(jj(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:``}${r?`<tbody>${r}</tbody>`:``}</table>`}function hj(e,t,n=!1){return`<tr>${jj(e.cells).map(e=>gj(e,t,n)).join(``)}</tr>`}function gj(e,t,n=!1){let r=n||e.header?`th`:`td`,i=Mj(e.align);return`<${r}${i?` style="text-align:${Ij(i)}"`:``}>${ij(jj(e.children),t)}</${r}>`}function _j(e,t){return`<dl>${jj(e.items).map(e=>vj(e,t)).join(``)}</dl>`}function vj(e,t){return`<dt>${ij(jj(e.term),t)}</dt><dd>${ij(jj(e.definition),t)}</dd>`}function yj(e,t){let n=Ij(Mj(e.id));return`<div${n?` id="fnref--${n}"`:``} class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${ij(jj(e.children),t)}</div></div>`}function bj(e){let t=Mj(e.id),n=Fj(t),r=Ij(t);return`<sup${r?` id="fnref-${r}"`:``} class="footnote-reference markstream-nested-footnote-ref"><span${r?` href="#fnref--${r}"`:``}${r?` title="查看脚注 ${r}"`:``} class="footnote-link cursor-pointer">[${n}]</span></sup>`}function xj(e){let t=Ij(Mj(e.id));return`<a class="footnote-anchor"${t?` href="#fnref-${t}"`:``}${t?` title="返回引用 ${t}"`:``} aria-label="${t?`返回引用 ${t}`:`返回引用`}">↩︎</a>`}function Sj(e,t){let n=Nj(Mj(e.kind||`note`))||`note`;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${Fj(Mj(e.title)||Lj(n))}</div><div class="markstream-nested-admonition__content">${ij(jj(e.children),t)}</div></div>`}function Cj(e,t){let n=Mj(e.content)||Mj(e.raw),r=Mj(e.tag).trim().toLowerCase(),i=jj(e.children);return!t.options.allowHtml||t.options.htmlPolicy===`escape`||e.loading&&!e.autoClosed?Fj(n):r&&i.length>0&&!oy.has(r)&&!Hk(r,t.options.htmlPolicy)?`<${r}${kj(e.attrs,``,t.options.htmlPolicy,r)}>${ij(i,t)}</${r}>`:ZA(n,t.options.htmlPolicy)}function wj(e,t){let n=Mj(e.tag||e.type);if(!n||tj.has(n))return Fj(Mj(e.content||e.raw));let r=[`markstream-nested-custom`,`markstream-nested-custom--${Nj(n)||`node`}`,Dj(e,t.options.customNodeClass)].filter(Boolean).join(` `),i=kj(e.attrs,r,t.options.htmlPolicy),a=Tj(e,t),o=t.options.customNodeTag;return`<${o}${i} data-markstream-custom-tag="${Ij(n)}">${a}</${o}>`}function Tj(e,t){let n=jj(e.children);if(n.length>0)return ij(n,t);let r=Mj(e.content);return r?Ej(r,t):Fj(Mj(e.raw))}function Ej(e,t){return e?t.markdown.render(e):``}function Dj(e,t){return t?Oj(typeof t==`function`?t(e):t):``}function Oj(e){return Array.isArray(e)?e.map(e=>Oj(e)).filter(Boolean).join(` `):typeof e==`string`?e.trim():``}function kj(e,t=``,n=`safe`,r){let i=Aj(e),a={},o=[t];for(let[e,t]of i){let n=String(e).trim();if(n){if(n.toLowerCase()===`class`){o.push(String(t));continue}a[n]=t===!0?``:String(t)}}let s=Object.entries(Jk(a,n,r)).map(([e,t])=>t===``?` ${e}`:` ${e}="${Ij(String(t))}"`),c=o.map(e=>e.trim()).filter(Boolean).join(` `);return c&&s.unshift(` class="${Ij(c)}"`),s.join(``)}function Aj(e){if(!e)return[];if(Array.isArray(e)){if(e.length===0)return[];let t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}function jj(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`):[]}function Mj(e){return typeof e==`string`?e:e==null?``:String(e)}function Nj(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Pj(e){let t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}function Fj(e){return Mj(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function Ij(e){return Fj(e).replace(/`/g,`&#96;`)}function Lj(e){return e?`${e[0].toUpperCase()}${e.slice(1)}`:``}function Rj(e){if(!e)return``;let t=(globalThis==null?void 0:globalThis.require)?.call(globalThis,`buffer`)?.Buffer;if(t?.from)return t.from(e,`utf8`).toString(`base64`);if(typeof TextEncoder<`u`&&typeof globalThis.btoa==`function`){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return globalThis.btoa(n)}return``}function zj(e,t){return nj(e,{cacheKey:t?.customId?`markstream-svelte-${t.customId}`:`markstream-svelte-node`,customHtmlTags:t?.customHtmlTags,allowHtml:t?.allowHtml!==!1,htmlPolicy:t?.htmlPolicy??`safe`})}function Bj(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}var Vj=`__global__`,Hj=`__MARKSTREAM_SVELTE_CUSTOM_COMPONENTS_STORE__`,Uj=(()=>{let e=globalThis;if(e[Hj])return e[Hj];let t={scopedComponents:{},revision:0,listeners:new Set};return e[Hj]=t,t})();function Wj(e){return Uj.listeners.add(e),()=>{Uj.listeners.delete(e)}}function Gj(e){let t=Uj.scopedComponents[Vj]||{};if(!e)return t;let n=Uj.scopedComponents[e]||{};return!t||Object.keys(t).length===0?n:!n||Object.keys(n).length===0?t:{...t,...n}}var Kj=r(`<input class="checkbox-node" type="checkbox" disabled=""/>`);function qj(e,t){i(t,!0);var n=Kj();ce(n),V(e=>F(n,e),[()=>!!t.node?.checked]),v(e,n),b()}function Jj(e){return(e.split(`.`).pop()||e).replace(/[_-]/g,` `).replace(/([A-Z])/g,` $1`).replace(/\s+/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}var Yj={"common.copy":`Copy`,"common.copied":`Copied`,"common.decrease":`Decrease`,"common.reset":`Reset`,"common.increase":`Increase`,"common.expand":`Expand`,"common.collapse":`Collapse`,"common.preview":`Preview`,"common.source":`Source`,"common.export":`Export`,"common.open":`Open`,"common.close":`Close`,"common.zoomIn":`Zoom in`,"common.zoomOut":`Zoom out`,"common.resetZoom":`Reset zoom`,"artifacts.htmlPreviewTitle":`HTML Preview`,"artifacts.svgPreviewTitle":`SVG Preview`,"image.preview":`Preview image`,"image.loadError":`Image failed to load`,"image.loading":`Loading image...`};function Xj(){return{t(e){return Yj[e]??Jj(e)}}}var Zj=null,Qj=!1,$j=null,eM=!1;function tM(e){let t=e,n=typeof t?.createCodeBlockRuntime==`function`||typeof t?.useMonaco==`function`?t:e?.default,r=n?.createCodeBlockRuntime??n?.useMonaco;return typeof r==`function`?{createCodeBlockRuntime:e=>r.call(n,e),preloadStreamDiffs:(n?.preloadStreamDiffs)?.bind(n)}:null}async function nM(e){eM||(eM=!0,typeof e?.preloadStreamDiffs==`function`&&await e.preloadStreamDiffs())}async function rM(){if(Zj)return Zj;if($j)return await $j;if(Qj)return null;$j=(async()=>{try{let e=tM(await Y(()=>import(`../chunks/BEsyQXpe.js`),[],import.meta.url));return e?(Zj=e,await nM(Zj),Zj):null}catch{return Qj=!0,null}})();try{return await $j}finally{$j=null}}var iM=null,aM=null,oM=null,sM=null,cM=null,lM=null;function uM(){sM&&=(clearTimeout(sM),null),cM&&=(clearTimeout(cM),null)}function dM(){return iM||typeof document>`u`?iM:(iM=document.createElement(`div`),iM.className=`ms-tooltip`,iM.setAttribute(`role`,`tooltip`),iM.dataset.visible=`false`,iM.style.position=`fixed`,iM.style.left=`0px`,iM.style.top=`0px`,iM.style.transform=`translate3d(0,0,0)`,document.body.appendChild(iM),iM)}function fM(e){if(typeof e==`boolean`)return e;if(typeof document<`u`)try{if(document.documentElement.classList.contains(`dark`))return!0}catch{}if(typeof window<`u`&&typeof window.matchMedia==`function`)try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches}catch{}return!1}async function pM(e){if(!iM||!aM)return;let{x:t,y:n}=await ha(aM,iM,{placement:e,middleware:[ca(8),ua(),la({padding:8})],strategy:`fixed`});iM.style.transform=`translate3d(${Math.round(t)}px, ${Math.round(n)}px, 0)`}function mM(e,t,n=`top`,r=!1,i,a){if(!e||typeof document>`u`||(dM(),!iM))return;uM();let o=async()=>{if(iM){aM=e,iM.textContent=t,iM.dataset.placement=n,iM.dataset.dark=fM(a)?`true`:`false`,iM.dataset.visible=`false`,lM=`tooltip-${Date.now()}-${Math.random().toString(36).slice(2)}`,iM.id=lM;try{e.setAttribute(`aria-describedby`,lM)}catch{}await pM(n),iM.dataset.visible=`true`,oM?.(),oM=sa(e,iM,()=>{pM(n)})}};r?o():sM=setTimeout(o,80)}function $(e=!1){if(!iM)return;uM();let t=()=>{if(iM){if(iM.dataset.visible=`false`,aM&&lM)try{aM.removeAttribute(`aria-describedby`)}catch{}aM=null,lM=null,oM&&=(oM(),null)}};e?t():cM=setTimeout(t,120)}var hM=`
175
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
176
+ <path d="M14 3h5a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" />
177
+ <path d="M8 11l-3 3l3 3" />
178
+ <path d="M16 11l3 3l-3 3" />
179
+ <path d="M13 9l-2 10" />
180
+ </svg>`,gM=`
181
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
182
+ <rect x="3" y="4" width="7" height="5" rx="1.5" />
183
+ <rect x="14" y="4" width="7" height="5" rx="1.5" />
184
+ <rect x="8.5" y="15" width="7" height="5" rx="1.5" />
185
+ <path d="M10 6.5h4" />
186
+ <path d="M12 9v2.5" />
187
+ <path d="M12 11.5l-3.5 3.5" />
188
+ <path d="M12 11.5l3.5 3.5" />
189
+ </svg>`,_M=`
190
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
191
+ <path d="M8 7l-4 5l4 5" />
192
+ <path d="M16 7l4 5l-4 5" />
193
+ <path d="M14 4l-4 16" />
194
+ </svg>`,vM=`
195
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
196
+ <rect x="3" y="4" width="18" height="16" rx="2" />
197
+ <path d="M7 15V9l3 3l3-3v6" />
198
+ <path d="M16 9v6" />
199
+ <path d="M14 13l2 2l2-2" />
200
+ </svg>`,yM=`
201
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
202
+ <path d="M9 4c-2 0-3 1.5-3 3.5v2c0 1.1-.4 1.8-1.5 2.5C5.6 12.7 6 13.4 6 14.5v2C6 18.5 7 20 9 20" />
203
+ <path d="M15 4c2 0 3 1.5 3 3.5v2c0 1.1.4 1.8 1.5 2.5c-1.1.7-1.5 1.4-1.5 2.5v2c0 2-1 3.5-3 3.5" />
204
+ </svg>`,bM=`
205
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
206
+ <path d="M5 6h14" />
207
+ <path d="M12 6v12" />
208
+ <path d="M8 18h8" />
209
+ </svg>`,xM={"":``,cjs:`javascript`,"c++":`cpp`,"c#":`csharp`,d2lang:`d2`,golang:`go`,js:`javascript`,jsx:`jsx`,kt:`kotlin`,md:`markdown`,mjs:`javascript`,"objective-c":`objectivec`,"objective-c++":`objectivecpp`,plaintext:`plain`,rb:`ruby`,rs:`rust`,py:`python`,bash:`shell`,bat:`shell`,batch:`shell`,ps1:`powershell`,sh:`shell`,shellscript:`shell`,text:`plain`,ts:`typescript`,tsx:`tsx`,yml:`yaml`,zsh:`shell`},SM={"":`Text`,css:`CSS`,c:`C`,cpp:`C++`,csharp:`C#`,d2:`D2`,go:`Go`,html:`HTML`,java:`Java`,javascript:`JavaScript`,json:`JSON`,jsx:`JSX`,markdown:`Markdown`,mermaid:`Mermaid`,php:`PHP`,plain:`Text`,plaintext:`Text`,python:`Python`,ruby:`Ruby`,rust:`Rust`,shell:`Shell`,sql:`SQL`,svg:`SVG`,tsx:`TSX`,typescript:`TypeScript`,vue:`Vue`,yaml:`YAML`},CM={"":bM,html:_M,javascript:hM,json:yM,jsx:hM,markdown:vM,mermaid:gM,plain:bM,python:hM,shell:hM,svg:_M,tsx:hM,typescript:hM},wM=Array.from(new Set([...Object.keys(xM),...Object.keys(SM),...Object.keys(CM),`bash`,`c`,`cpp`,`csharp`,`diff`,`go`,`java`,`php`,`ruby`,`rust`,`sql`,`yaml`,`zsh`]));function TM(e){if(!e)return``;let t=e.trim();if(!t)return``;let[n]=t.split(/\s+/),[r]=n.split(`:`);return r.toLowerCase()}function EM(e){let t=TM(e);return xM[t]??t}function DM(e){let t=EM(e);return!t||t===`plain`?`plaintext`:t===`shell`?`zsh`:t===`objectivec`?`objective-c`:t===`objectivecpp`?`objective-cpp`:t}function OM(e){let t=TM(e);return!t||wM.includes(t)?!1:wM.some(e=>e.startsWith(t))}function kM(e){return CM[EM(e)]||hM}var AM=SM,jM=r(`<div><div class="html-preview-frame__header"><span> </span><button type="button">Close</button></div> <iframe class="html-preview-frame__iframe"></iframe></div>`);function MM(e,t){i(t,!0);let r=D(t,`code`,3,``),a=D(t,`title`,3,`Preview`),o=D(t,`isDark`,3,!1),s=D(t,`htmlPreviewAllowScripts`,3,!1),u=P(()=>t.htmlPreviewSandbox??(s()?`allow-scripts`:``));var d=jM();let f;var p=U(d),m=U(p),h=j(m,!0),g=R(m);n(p);var _=R(p,2);n(d),V(()=>{f=me(d,1,`html-preview-frame`,null,f,{"is-dark":o()}),c(h,a()),z(_,`title`,a()),z(_,`srcdoc`,r()),z(_,`sandbox`,T(u))}),l(`click`,g,()=>t.onClose?.()),v(e,d),b()}w([`click`]);var NM=r(`<span class="markstream-pre__line-numbers" aria-hidden="true"><span class="markstream-pre__line-numbers-text"> </span></span>`),PM=r(`<pre data-markstream-pre="1"><!><code class="markstream-pre__code" translate="no"> </code></pre>`);function FM(e,t){i(t,!0);let r=D(t,`showLineNumbers`,3,!1),a=D(t,`enhanceable`,3,!0),o=D(t,`class`,3,void 0),s=D(t,`style`,3,void 0),l=P(()=>LA(t.node?.language).trim()),u=P(()=>BA(T(l))),d=P(()=>LA(t.node?.code)),f=P(()=>!!t.node?.diff),p=P(()=>t.node?.loading===!0),h=P(()=>T(p)?T(d):T(d).replace(/\r\n$|\n$|\r$/,``)),g=P(()=>r()===!0&&!T(f)),_=P(()=>w(T(h))),x=P(()=>E(T(_))),S=P(()=>T(g)?`--markstream-pre-line-number-width: ${Math.max(2,String(T(_)).length)}ch; --markstream-pre-diff-line-number-width: ${Math.max(2,String(T(_)).length)}ch; --markstream-code-padding-left: calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch));`:``),C=P(()=>[T(S),s()].filter(Boolean).join(` `));function w(e){let t=1;for(let n=0;n<e.length;n++)e[n]===`
210
+ `?t++:e[n]===`\r`&&(t++,e[n+1]===`
211
+ `&&n++);return e.length?t:1}function E(e){let t=``;for(let n=1;n<=e;n++)t+=`${t?`
212
+ `:``}${n}`;return t}var O=J(),ee=K(O),A=e=>{var r=PM();let i;var s=U(r),d=e=>{var t=NM(),r=U(t),i=j(r,!0);n(t),V(()=>c(i,T(x))),v(e,t)};m(s,e=>{T(g)&&e(d)});var _=R(s),b=j(_,!0);n(r),V((e,t,n)=>{z(r,`data-markstream-code-block`,a()?`1`:void 0),z(r,`data-markstream-language`,T(l)||void 0),z(r,`data-markstream-loading`,T(p)?`1`:void 0),z(r,`data-markstream-diff`,T(f)?`1`:void 0),z(r,`data-markstream-original`,e),z(r,`data-markstream-updated`,t),z(r,`data-markstream-line-numbers`,T(g)?`1`:void 0),z(r,`aria-busy`,T(p)?`true`:void 0),i=me(r,1,n,null,i,{"markstream-pre--line-numbers":T(g)}),k(r,T(C)||void 0),c(b,T(h))},[()=>T(f)?WA(LA(t.node?.originalCode)):void 0,()=>T(f)?WA(LA(t.node?.updatedCode)):void 0,()=>y([T(u)?`language-${T(u)}`:``,o()].filter(Boolean).join(` `)||void 0)]),v(e,r)},te=P(()=>!(T(p)&&!T(d).trim()));m(ee,e=>{T(te)&&e(A)}),v(e,O),b()}async function IM(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,`true`),t.style.position=`fixed`,t.style.opacity=`0`,t.style.pointerEvents=`none`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),!0}catch{return!1}finally{t.remove()}}function LM(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=``}}function RM(e,t){if(!e||typeof document>`u`||typeof URL>`u`)return;let n=new Blob([e],{type:`image/svg+xml;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function zM(e,t){return e==null||e===``?t??null:typeof e==`number`?`${e}px`:String(e)}var BM=C(`<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"></path></svg>`),VM=C(`<svg viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></g></svg>`),HM=r(`<button type="button" class="code-action-btn"><!></button>`),UM=r(`<button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14"></path></svg></button> <button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8m0-5v5h5"></path></svg></button> <button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7-7v14"></path></svg></button>`,1),WM=r(`<button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></g></svg></button>`),GM=r(`<button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg></button>`),KM=r(`<button type="button" class="code-action-btn"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"></path></svg></button>`),qM=r(`<div class="code-block-header"><div class="code-block-header__meta"><span class="code-block-language-icon" aria-hidden="true"></span> <span class="code-block-header__label"> </span></div> <div class="code-block-header__actions"><!> <!> <!> <!> <!></div></div>`),JM=r(`<div></div>`),YM=r(`<div><!> <div><!></div></div>`),XM=r(`<div data-markstream-code-block="1"><!> <!> <!></div>`);function ZM(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`isDark`,3,void 0),o=D(t,`loading`,3,void 0),s=D(t,`stream`,3,void 0),u=D(t,`codeBlockOptions`,3,void 0),d=D(t,`theme`,3,void 0),p=D(t,`darkTheme`,3,void 0),h=D(t,`lightTheme`,3,void 0),g=D(t,`themes`,3,void 0),y=D(t,`minWidth`,3,void 0),x=D(t,`maxWidth`,3,void 0),S=D(t,`isShowPreview`,3,!0),C=D(t,`enableFontSizeControl`,3,!0),w=D(t,`showHeader`,3,!0),E=D(t,`showCopyButton`,3,!0),O=D(t,`showExpandButton`,3,!0),ee=D(t,`showPreviewButton`,3,!0),A=D(t,`showCollapseButton`,3,!0),te=D(t,`showFontSizeButtons`,3,!0),M=D(t,`showLineNumbers`,3,void 0),F=D(t,`htmlPreviewAllowScripts`,3,!1),re=D(t,`htmlPreviewSandbox`,3,void 0),{t:I}=Xj(),L=[`javascript`,`plaintext`,`shellscript`,`typescript`];function ae(e){let t=(e instanceof Error?e.message:String(e??``)).match(/Language `([^`]+)` is not included/)?.[1];return t&&OM(t)?t:``}function H(e){let t=ae(e);if(t){N(Y,t,!0),N(ge,!1),le(t);return}N(Y,T(Ue),!0),N(ge,!0)}function ce(e){let t=e.trim().split(/\s+/)[0]?.split(`:`)[0]?.toLowerCase()||``;return t.length>=3&&L.some(e=>e!==t&&e.startsWith(t))}function le(e){if(T(Ie))return;let t=()=>{if(N(Ie,null),T(Se)){if(T(Ue)!==e&&!OM(T(Ue))&&!ce(T(Ue))&&!T(mt)&&!T(gt)){N(Y,``),Ft();return}N(Ie,setTimeout(t,50),!0)}};N(Ie,setTimeout(t,50),!0)}let G=B(null),q=B(null),fe=B(null),pe=B(null),he=B(!1),ge=B(!1),Y=B(``),_e=B(null),ve=B(null),ye=B(!1),be=B(!1),xe=B(null),Se=B(!1),Ce=B(!1),we=B(!1),Te=B(!1),Ee=B(!1),De=B(12),Oe=B(null),ke=B(0),Ae=B(null),je=B(de([])),Me=B(null),Ne=B(null),Pe=B(``),Fe,Ie=B(null),Le=B(null),Re=B(null),ze=B(``),Be=B(null),Ve=B(null),He=B(!1),Ue=P(()=>LA(t.node?.language).trim()),We=P(()=>EM(T(Ue))),Ge=P(()=>DM(T(We)||T(Ue)||`plaintext`)),Ke=P(()=>xt(t.node)),qe=P(()=>!!t.node?.diff),Je=P(()=>LA(t.node?.originalCode)),Ye=P(()=>LA(t.node?.updatedCode)),Xe=P(()=>t.node?.loading===!0),Ze=P(()=>o()??T(Xe)),Qe=P(()=>s()??r()?.codeBlockStream??!0),$e=P(()=>a()??r()?.isDark??!1),et=P(()=>r()?.codeBlockThemes),tt=P(()=>u()??r()?.codeBlockOptions),nt=P(()=>M()??T(tt)?.disableLineNumbers!==!0),rt=P(()=>{let e=T(tt)?.parseDiffOptions;return{options:{...T(tt)??{}},parseDiffOptions:e&&typeof e==`object`?{...e}:e,showLineNumbers:T(nt)}}),it=P(jt),at=P(kt),ot=P(()=>St(T(tt)?.fontSize)??12),st=P(()=>zM(y()??T(et)?.minWidth)),ct=P(()=>zM(x()??T(et)?.maxWidth)),lt=P(()=>[T(st)?`min-width: ${T(st)}`:``,T(ct)?`max-width: ${T(ct)}`:``].filter(Boolean).join(`; `)),ut=P(()=>kM(T(We)||T(Ue)||`plain`)),dt=P(()=>AM[T(We)]||(T(Ue)?T(Ue).toUpperCase():AM[``])),ft=P(()=>S()!==!1&&(T(We)===`html`||T(We)===`svg`)),pt=P(()=>T(We)===`svg`?I(`artifacts.svgPreviewTitle`):I(`artifacts.htmlPreviewTitle`)),mt=P(()=>T(Qe)===!1&&T(Ze)),ht=P(()=>r()?.final===!1||T(Ze)),gt=P(()=>T(Qe)!==!1&&T(ht)&&(OM(T(Ue))||ce(T(Ue)))),_t=P(()=>!(T(Ze)&&!T(Ke).trim())),vt=P(()=>({...t.node,code:T(Ke),loading:T(Ze)})),yt=P(Dt),bt=P(()=>T(qe)?`${T(Ge)}\0${T(Je)}\0${T(Ye)||T(Ke)}`:`${T(Ge)}\0${T(Ke)}`);W(()=>{T(ge)&&T(Y)&&T(Ue)!==T(Y)&&OM(T(Y))&&(N(ge,!1),N(Y,``))}),W(()=>{T(Se),T(Ze),T(bt),T(mt),T(gt),T(Se)&&T(Ze)===!1&&!T(mt)&&!T(gt)&&T(bt)!==T(ze)&&(N(ze,T(bt),!0),Ht())}),W(()=>{T(Se),T(G),T(_t),T(Ce),T(mt),T(gt),T(qe),T(Ke),T(Je),T(Ye),T(Ge),T(at),T(it),T(tt),T(rt),T(De),T(we),T(Se)&&(Fe!==T(rt)&&(Fe=T(rt),N(De,T(ot),!0),Wt()),Ft())}),ue(()=>{N(Se,!0),N(De,T(ot),!0)}),se(()=>{N(Se,!1),N(ke,T(ke)+1),T(Oe)&&clearTimeout(T(Oe)),T(Ie)&&clearTimeout(T(Ie)),T(Re)&&clearTimeout(T(Re)),Zt(),Wt()});function xt(e){return e?.diff?LA(e?.updatedCode??e?.code):LA(e?.code)}function St(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}function Ct(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:void 0}function wt(){return St(T(tt)?.lineHeight)??(T(De)===12?18:Math.max(12,Math.round(T(De)*1.5)))}function Tt(){let e=T(tt)?.padding,t=T(qe)?0:8,n=Ct(e)??t;return{top:n,bottom:n}}function Et(){return typeof T(tt)?.fontFamily==`string`&&T(tt).fontFamily.trim()?T(tt).fontFamily.trim():`"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace`}function Dt(){let e=Tt(),t=Et(),n=St(T(tt)?.tabSize)??4,r=wt();return[`--markstream-code-font-family: ${t}`,`--vscode-editor-font-size: ${T(De)}px`,`--vscode-editor-line-height: ${r}px`,`--markstream-code-padding-y: ${e.top}px`,`--markstream-pre-line-number-top: ${e.top}px`,`font-family: ${t}`,`font-size: ${T(De)}px`,`line-height: ${r}px`,`padding-top: ${e.top}px`,`padding-right: var(--markstream-code-padding-x, 12px)`,`padding-bottom: ${e.bottom}px`,`padding-left: var(--markstream-code-padding-left, 52px)`,`tab-size: ${n}`,`max-height: ${qt()}px`,`overflow: auto`,`white-space: ${T(tt)?.overflow===`scroll`?`pre`:`pre-wrap`}`].join(`; `)}function Ot(e){return!!e&&typeof e==`object`&&typeof e.dark==`string`&&typeof e.light==`string`}function kt(){return typeof d()==`string`&&d()?d():Ot(d())?T($e)?d().dark:d().light:(T($e)?p():h())||(g()?T($e)?g()[0]:g()[1]:(T($e)?T(et)?.darkTheme:T(et)?.lightTheme)||(T(et)?.themes?T($e)?T(et).themes[0]:T(et).themes[1]:T($e)?`vitesse-dark`:`vitesse-light`))}function At(){return[p()??g()?.[0]??T(et)?.darkTheme??T(et)?.themes?.[0]??`vitesse-dark`,h()??g()?.[1]??T(et)?.lightTheme??T(et)?.themes?.[1]??`vitesse-light`]}function jt(){let e={...T(tt)??{}};for(let t of[`maxHeight`,`padding`,`tabSize`,`theme`,`themes`,`themeType`,`language`,`languages`,`stream`,`disableFileHeader`,`onThemeChange`,`renderCustomHeader`,`renderHeaderMetadata`,`renderHeaderPrefix`])delete e[t];let t=e.parseDiffOptions&&typeof e.parseDiffOptions==`object`?e.parseDiffOptions:{},n=T(qe)?{diffStyle:`split`,expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:`line-info`,...e,parseDiffOptions:{context:2,...t}}:e,r=typeof n.unsafeCSS==`string`?n.unsafeCSS:``;return{overflow:`wrap`,...n,MAX_HEIGHT:T(we)?900:T(tt)?.maxHeight??500,fontFamily:Et(),fontSize:T(De),lineHeight:wt(),disableLineNumbers:!T(nt),unsafeCSS:`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }
213
+ ${r}`.trim(),disableFileHeader:!0,stream:!1,themes:At(),themeType:T($e)?`dark`:`light`,onThemeChange(){Kt(),Jt()}}}function Mt(){let e={...T(it),theme:T(at)};if(!T(fe))return N(fe,e,!0),T(fe);for(let t of Object.keys(T(fe)))t in e||delete T(fe)[t];return Object.assign(T(fe),e),T(fe)}async function Nt(){if(T(q)||T(ge)||typeof window>`u`)return;if(T(pe))return T(pe);let e=T(ke),t=(async()=>{let t=await rM();if(T(Se)&&T(ke)===e){if(!t||typeof t.createCodeBlockRuntime!=`function`){N(ge,!0);return}N(q,t.createCodeBlockRuntime(Mt()),!0),await Promise.resolve(T(q).setTheme?.(T(at))),T(Se)&&T(ke)===e&&N(Pe,T(at),!0)}})().finally(()=>{T(pe)===t&&N(pe,null)});return N(pe,t,!0),t}function Pt(){T(q)&&T(at)&&T(at)!==T(Pe)&&(N(Pe,T(at),!0),Promise.resolve(T(q).setTheme?.(T(at))).catch(e=>{typeof console<`u`&&console.warn(`[markstream-svelte] Failed to apply code-block theme:`,e)}))}async function Ft(){if(!T(Se)||!T(_t)||!T(G)||T(Ce)||T(mt)||T(gt))return;let e=T(ke);try{await Nt()}catch(t){T(Se)&&T(ke)===e&&H(t);return}if(!T(Se)||T(ke)!==e||T(ge)||!T(q))return;Mt();let t=T(qe)?`diff`:`single`;if((!((t===`diff`?T(q).getDiffEditorView?.():T(q).getEditorView?.())&&It(t))||T(_e)!==t||T(ve)!==!1)&&(await Bt(t),!T(Se)||T(ge)||!T(q)||!It(t)||T(_e)!==t))return;let n=T(ke);try{T(qe)&&typeof T(q).updateDiff==`function`?await Promise.resolve(T(q).updateDiff(T(Je),T(Ye)||T(Ke),T(Ge))):typeof T(q).updateCode==`function`&&(await Promise.resolve(T(q).updateCode(T(Ke),T(Ge))),Xt()),!T(he)&&await zt(t,T(ke))&&(N(ye,!0),N(be,!0),N(he,!0)),Pt(),Gt(),Jt()}catch(e){T(Se)&&T(ke)===n&&H(e)}}function It(e){if(!T(G))return!1;let t=[`diffs-container`,`.stream-diffs-shell`,`[data-stream-diffs-state]`].join(`,`);return!!T(G).querySelector(t)}function Lt(){return T(G)?.querySelector([`diffs-container`,`[data-stream-diffs-state]`,`.stream-diffs-shell`].join(`,`))??null}function Rt(e,t=!1){if(!T(G)||!It(e))return!1;if(t){let e=window.getComputedStyle(T(G));if(e.display===`none`||e.visibility===`hidden`||Number.parseFloat(e.opacity||`1`)<=.01)return!1}let n=Lt();if(!n)return!1;let r=n.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;let i=window.getComputedStyle(n);return i.display!==`none`&&i.visibility!==`hidden`&&Number.parseFloat(i.opacity||`1`)>.01}async function zt(e,t){await _();let n=Date.now()+1500,r=0;for(;Date.now()<n&&r<30;){if(r+=1,!T(Se)||!T(G)||T(ke)!==t)return!1;if(X(!0),await Ut(),Rt(e))return X(!0),await Ut(),Rt(e)}return!!(T(Se)&&T(G)&&T(ke)===t&&Rt(e))}async function Bt(e){if(!T(G)||!T(q)||T(xe))return T(xe);let t=T(q),n=ne(ke);N(he,!1);let r=(async()=>{try{if(Wt(!1),!T(Se)||!T(G)||T(ke)!==n||T(q)!==t)return;if(T(G).replaceChildren(),N(Me,null),N(Ne,null),N(ve,!1),e===`diff`&&typeof t.createDiffEditor==`function`){if(await t.createDiffEditor(T(G),T(Je),T(Ye)||T(Ke),T(Ge)),!T(Se)||T(ke)!==n||T(q)!==t||(await Promise.resolve(t.updateDiff?.(T(Je),T(Ye)||T(Ke),T(Ge))),!T(Se)||T(ke)!==n||T(q)!==t))return;N(_e,`diff`)}else{if(await t.createEditor(T(G),T(Ke),T(Ge)),!T(Se)||T(ke)!==n||T(q)!==t||(await Promise.resolve(t.updateCode?.(T(Ke),T(Ge))),!T(Se)||T(ke)!==n||T(q)!==t))return;N(_e,`single`)}if(Gt(),$t(),Pt(),!await zt(e,n))return;N(ye,!0),N(be,!0),N(he,!0),Jt()}catch(e){T(Se)&&T(ke)===n&&T(q)===t&&H(e)}})().finally(()=>{T(xe)===r&&N(xe,null)});return N(xe,r,!0),r}function Vt(){return T(Le)||N(Le,(async()=>{if(await _(),await Ut(),T(xe))try{await T(xe)}catch{}if(!T(Se)||!T(_t)||!T(G)||T(Ce)||T(mt)||T(gt)||(await Nt(),!T(Se)||T(ge)||!T(q)))return;Mt();let e=T(qe)?`diff`:`single`;if((!It(e)||T(_e)!==e)&&await Bt(e),T(Se)&&!T(ge)&&T(q)&&It(e)&&T(_e)===e){if(T(qe)){await Promise.resolve(T(q).updateDiff?.(T(Je),T(Ye)||T(Ke),T(Ge))),T(q).refreshDiffPresentation?.(),Gt(),Jt();return}await Promise.resolve(T(q).updateCode?.(T(Ke),T(Ge))),Xt(140,!0),Gt(),Jt()}})().finally(()=>{N(Le,null)}),!0),T(Le)}function Ht(){T(Re)&&clearTimeout(T(Re)),N(Re,setTimeout(()=>{N(Re,null),Vt()},80),!0)}function Ut(){return typeof window>`u`||typeof window.requestAnimationFrame!=`function`?Promise.resolve():new Promise(e=>window.requestAnimationFrame(()=>e()))}function Wt(e=!0){e&&(N(ke,T(ke)+1),N(xe,null),N(pe,null)),en(),Yt();try{e?T(q)?.cleanupEditor?.():(T(q)?.safeClean||T(q)?.cleanupEditor)?.()}catch{}N(_e,null),N(ve,null),N(ye,!1),N(be,!1),N(he,!1),N(Me,null),N(Ne,null),e&&(N(q,null),N(fe,null),N(pe,null),N(Pe,``))}function Gt(){(T(qe)?T(q)?.getDiffEditorView?.():T(q)?.getEditorView?.())?.updateOptions?.({fontSize:T(De)}),Kt(),Jt()}function Kt(){if(!T(G))return;let e=St(T(tt)?.tabSize)??4;T(G).style.setProperty(`--diffs-tab-size`,String(e)),typeof T(tt)?.padding==`number`?T(G).style.setProperty(`--diffs-gap-block`,`${Tt().top}px`):T(G).style.removeProperty(`--diffs-gap-block`)}function qt(){return T(tt)?.maxHeight??500}function Jt(){typeof window>`u`||!T(G)||!T(he)||(T(Ae)??N(Ae,window.requestAnimationFrame(()=>{N(Ae,null),window.requestAnimationFrame(()=>X())}),!0))}function Yt(){T(Ae)==null||typeof window>`u`||(window.cancelAnimationFrame(T(Ae)),N(Ae,null))}function Xt(e=140,t=!1){typeof window>`u`||(N(He,T(He)||t,!0),T(Be)&&clearTimeout(T(Be)),N(Be,setTimeout(()=>{N(Be,null),T(Ve)??N(Ve,window.requestAnimationFrame(()=>{let e=T(He);N(He,!1),N(Ve,null),Qt(e)}),!0)},e),!0))}function Zt(){T(Be)&&(clearTimeout(T(Be)),N(Be,null)),N(He,!1),!(T(Ve)==null||typeof window>`u`)&&(window.cancelAnimationFrame(T(Ve)),N(Ve,null))}function Qt(e=!1){try{let t=T(qe)?T(q)?.getDiffEditorView?.()?.getModifiedEditor?.():T(q)?.getEditorView?.(),n=t?.getModel?.(),r=n?.forceTokenization;if(e&&!T(qe)&&typeof n?.setValue==`function`){let e=Number(t?.getScrollTop?.()||0),r=Number(t?.getScrollLeft?.()||0),i=t?.getSelection?.();n.setValue(T(Ke)),i&&t?.setSelection?.(i),Number.isFinite(e)&&t?.setScrollTop?.(e),Number.isFinite(r)&&t?.setScrollLeft?.(r)}let i=Number(n?.getLineCount?.()||0);if(typeof r!=`function`||!Number.isFinite(i)||i<=0)return;for(let e=1;e<=i;e+=1)r.call(n,e);t?.render?.(!0)}catch{}}function $t(){en();let e=(e,t)=>{try{let n=e?.[t];if(typeof n!=`function`)return;let r=n.call(e,()=>Jt());r&&T(je).push(r)}catch{}};if(T(qe)){let t=T(q)?.getDiffEditorView?.(),n=t?.getOriginalEditor?.(),r=t?.getModifiedEditor?.();try{let e=t?.onDidUpdateDiff?.(()=>Jt());e&&T(je).push(e)}catch{}e(n,`onDidContentSizeChange`),e(r,`onDidContentSizeChange`),e(n,`onDidLayoutChange`),e(r,`onDidLayoutChange`);return}let t=T(q)?.getEditorView?.();e(t,`onDidContentSizeChange`),e(t,`onDidLayoutChange`)}function en(){for(let e of T(je))try{typeof e==`function`?e():e?.dispose?.()}catch{}N(je,[],!0)}function X(e=!1){if(!T(G)||!T(q)||!T(he)&&!e||T(Ce))return;let t=qt(),n=T(qe)?an(T(G))??rn():rn();if(!n||n<=0)return;let r=tn(),i=T(we)||!Number.isFinite(t)?Math.ceil(n):Math.ceil(Math.min(n,t)),a=Math.max(r,i);T(G).style.height=`${a}px`,T(G).style.minHeight=`${a}px`,T(G).style.maxHeight=T(we)||!Number.isFinite(t)?`none`:`${Math.ceil(t)}px`,T(G).style.overflow=T(qe)?`hidden`:n>a?`auto`:`hidden`,nn(a)}function tn(){if(!T(G)||typeof window>`u`)return 0;let e=[window.getComputedStyle(T(G).parentElement||T(G)).minHeight,window.getComputedStyle(T(G)).minHeight];for(let t of e){let e=Number.parseFloat(t);if(Number.isFinite(e)&&e>0)return Math.ceil(e)}return 0}function nn(e){let t=Math.max(0,T(G)?.clientWidth||0),n=Math.ceil(t),r=Math.ceil(e);if(T(Me)!==n||T(Ne)!==r){N(Me,n,!0),N(Ne,r,!0);try{T(qe)?T(q)?.getDiffEditorView?.()?.layout?.(t>0?{width:n,height:r}:void 0):T(q)?.getEditorView?.()?.layout?.(t>0?{width:n,height:r}:void 0)}catch{}}}function rn(){try{if(T(qe)){let e=T(q)?.getDiffEditorView?.(),t=e?.getOriginalEditor?.(),n=e?.getModifiedEditor?.(),r=Number(t?.getContentHeight?.()||0),i=Number(n?.getContentHeight?.()||0),a=Math.max(r,i);if(a>0)return Math.ceil(a+1)}let e=T(q)?.getEditorView?.(),t=Number(e?.getContentHeight?.()||0);if(t>0)return Math.ceil(t)}catch{}return null}function an(e){if(typeof window>`u`)return null;try{let t=e.getBoundingClientRect();if(t.height<=0)return null;let n=e.querySelector([`diffs-container`,`.stream-diffs-shell`,`[data-stream-diffs-state]`].join(`,`));if(!n)return null;let r=n.getBoundingClientRect().bottom-t.top;return r>0?Math.ceil(r+1):null}catch{return null}}async function on(){await IM(T(Ke)),r()?.events?.onCopy?.(T(Ke)),N(Te,!0),T(Oe)&&clearTimeout(T(Oe)),N(Oe,setTimeout(()=>{N(Te,!1)},1e3),!0)}function sn(){C()&&(N(De,Math.max(10,T(De)-1),!0),Gt())}function cn(){C()&&(N(De,T(ot),!0),Gt())}function ln(){C()&&(N(De,Math.min(24,T(De)+1),!0),Gt())}function un(e,t){let n=e.currentTarget;!n||n instanceof HTMLButtonElement&&n.disabled||mM(n,t,`top`,!1,void 0,T($e))}function dn(e){un(e,T(Te)?I(`common.copied`)||`Copied`:I(`common.copy`)||`Copy`)}var fn=J(),pn=K(fn),mn=e=>{var t=XM();let r;var i=U(t),a=e=>{var t=qM(),r=U(t),i=U(r);ie(i,()=>T(ut),!0),n(i);var a=R(i,2),o=j(a,!0);n(r);var s=R(r,2),u=U(s),d=e=>{var t=HM(),r=U(t),i=e=>{var t=BM();v(e,t)},a=e=>{var t=VM();v(e,t)};m(r,e=>{T(Te)?e(i):e(a,-1)}),n(t),V(e=>z(t,`aria-label`,e),[()=>T(Te)?I(`common.copied`):I(`common.copy`)]),f(`blur`,t,()=>$()),l(`click`,t,on),f(`focus`,t,dn),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,dn),v(e,t)};m(u,e=>{E()&&e(d)});var p=R(u,2),h=e=>{var t=UM(),n=K(t),r=R(n,2),i=R(r,2);V((e,t,a)=>{z(n,`aria-label`,e),z(r,`aria-label`,t),z(i,`aria-label`,a)},[()=>I(`common.decrease`),()=>I(`common.reset`),()=>I(`common.increase`)]),f(`blur`,n,()=>$()),l(`click`,n,sn),f(`focus`,n,e=>un(e,I(`common.decrease`)||`Decrease`)),f(`mouseleave`,n,()=>$()),f(`mouseenter`,n,e=>un(e,I(`common.decrease`)||`Decrease`)),f(`blur`,r,()=>$()),l(`click`,r,cn),f(`focus`,r,e=>un(e,I(`common.reset`)||`Reset`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>un(e,I(`common.reset`)||`Reset`)),f(`blur`,i,()=>$()),l(`click`,i,ln),f(`focus`,i,e=>un(e,I(`common.increase`)||`Increase`)),f(`mouseleave`,i,()=>$()),f(`mouseenter`,i,e=>un(e,I(`common.increase`)||`Increase`)),v(e,t)};m(p,e=>{te()&&C()&&e(h)});var g=R(p,2),_=e=>{var t=WM();V(e=>z(t,`aria-label`,e),[()=>I(`common.preview`)]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(Ee,!T(Ee))),f(`focus`,t,e=>un(e,I(`common.preview`)||`Preview`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>un(e,I(`common.preview`)||`Preview`)),v(e,t)};m(g,e=>{T(ft)&&ee()&&e(_)});var y=R(g,2),b=e=>{var t=GM(),r=U(t),i=j(r);n(t),V(e=>{z(t,`aria-pressed`,T(we)),z(t,`aria-label`,e),z(i,`d`,T(we)?`m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6`:`M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6`)},[()=>T(we)?I(`common.collapse`):I(`common.expand`)]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(we,!T(we))),f(`focus`,t,e=>un(e,T(we)?I(`common.collapse`)||`Collapse`:I(`common.expand`)||`Expand`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>un(e,T(we)?I(`common.collapse`)||`Collapse`:I(`common.expand`)||`Expand`)),v(e,t)};m(y,e=>{O()&&e(b)});var x=R(y,2),S=e=>{var t=KM(),r=U(t);let i;n(t),V(e=>{z(t,`aria-pressed`,T(Ce)),z(t,`aria-label`,e),i=k(r,``,i,{rotate:T(Ce)?`0deg`:`90deg`})},[()=>T(Ce)?I(`common.expand`):I(`common.collapse`)]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(Ce,!T(Ce))),f(`focus`,t,e=>un(e,T(Ce)?I(`common.expand`)||`Expand`:I(`common.collapse`)||`Collapse`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>un(e,T(Ce)?I(`common.expand`)||`Expand`:I(`common.collapse`)||`Collapse`)),v(e,t)};m(x,e=>{A()&&e(S)}),n(s),n(t),V(()=>c(o,T(qe)?`Diff / ${T(dt)}`:T(dt))),v(e,t)};m(i,e=>{w()&&e(a)});var o=R(i,2),s=e=>{var t=YM();let r;var i=U(t),a=e=>{var t=JM();let n;oe(t,e=>N(G,e),()=>T(G)),V(()=>n=me(t,1,`code-editor-container`,null,n,{"is-hidden":!T(ye)})),v(e,t)};m(i,e=>{T(mt)||e(a)});var o=R(i,2);let s;FM(U(o),{class:`code-pre-fallback`,enhanceable:!1,get node(){return T(vt)},get showLineNumbers(){return T(nt)},get style(){return T(yt)}}),n(o),n(t),V(()=>{r=me(t,1,`code-block-body`,null,r,{"code-block-body--expanded":T(we)}),s=me(o,1,`code-editor-fallback-surface`,null,s,{"is-hidden":T(be)})}),v(e,t)};m(o,e=>{T(Ce)||e(s)});var u=R(o,2),d=e=>{MM(e,{get code(){return T(Ke)},get title(){return T(pt)},get isDark(){return T($e)},get htmlPreviewAllowScripts(){return F()},get htmlPreviewSandbox(){return re()},onClose:()=>N(Ee,!1)})};m(u,e=>{T(Ee)&&T(ft)&&e(d)}),n(t),V(()=>{r=me(t,1,`code-block-container`,null,r,{"is-dark":T($e),"is-plain-text":T(Ge)===`plaintext`,"is-rendering":T(Ze),"is-diff":T(qe)}),z(t,`data-markstream-enhanced`,T(he)&&!T(ge)?`true`:`false`),k(t,T(lt))}),v(e,t)};m(pn,e=>{T(_t)&&e(mn)}),v(e,fn),b()}w([`click`]);var QM=()=>Y(()=>import(`../chunks/Y--VMh3y.js`),[],import.meta.url),$M=null,eN=QM,tN=null;function nN(e){if(!e)return e;if(e.D2&&typeof e.D2==`function`)return e.D2;if(e.default&&e.default.D2&&typeof e.default.D2==`function`)return e.default.D2;let t=e.default??e;return typeof t==`function`?t:t?.D2&&typeof t.D2==`function`?t.D2:t}async function rN(){if($M)return $M;if(tN)return await tN;let e=eN;if(!e)return null;tN=(async()=>{let t;try{t=await e()}catch(t){throw e===QM?Error(`Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.`):t}return t?($M=nN(t),$M):null})();try{return await tN}finally{tN=null}}var iN=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],aN=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function oN(e){return e.replace(/["']\s*javascript:/gi,`#`).replace(/\bjavascript:/gi,`#`).replace(/["']\s*vbscript:/gi,`#`).replace(/\bvbscript:/gi,`#`).replace(/\bdata:text\/html/gi,`#`)}function sN(e){if(!e)return``;let t=e.trim();return aN.test(t)?t:``}function cN(e){let t=new Set([`script`]),n=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of n){if(t.has(e.tagName.toLowerCase())){e.remove();continue}let n=Array.from(e.attributes);for(let t of n){let n=t.name;if(/^on/i.test(n)){e.removeAttribute(n);continue}if(n===`style`&&t.value&&iN.some(e=>e.test(t.value))){e.removeAttribute(n);continue}if((n===`href`||n===`xlink:href`)&&t.value){let r=sN(t.value);if(!r){e.removeAttribute(n);continue}r!==t.value&&e.setAttribute(n,r)}}}}function lN(e){if(typeof DOMParser>`u`||!e)return``;let t=oN(e),n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(!n||n.nodeName.toLowerCase()!==`svg`)return``;let r=n;return cN(r),r.outerHTML}function uN(e){return e?typeof e==`string`?e:typeof e.svg==`string`?e.svg:typeof e.data==`string`?e.data:``:``}var dN=r(`<div class="d2-mode-toggle"><button type="button"> </button> <button type="button"> </button></div>`),fN=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"></path></svg>`),pN=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></g></svg>`),mN=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn"><!></button>`),hN=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"></path></svg></button>`),gN=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"></path></svg></button>`),_N=r(`<div class="markstream-svelte-enhanced-block__header d2-block-header"><div class="d2-header-title"><span class="d2-label">D2</span></div> <div class="markstream-svelte-enhanced-block__actions d2-header-actions"><!> <!> <!> <!></div></div>`),vN=r(`<p class="d2-error"> </p>`),yN=r(`<div class="d2-source"><pre class="d2-code"><code> </code></pre> <!></div>`),bN=r(`<div class="d2-render"><div class="d2-svg"></div> <!></div>`),xN=r(`<div class="markstream-svelte-enhanced-block__body d2-block-body"><!></div>`),SN=r(`<div data-markstream-d2="1"><!> <!></div>`);function CN(t,r){i(r,!0);let a={N1:`#E5E7EB`,N2:`#CBD5E1`,N3:`#94A3B8`,N4:`#64748B`,N5:`#475569`,N6:`#334155`,N7:`#0B1220`,B1:`#60A5FA`,B2:`#3B82F6`,B3:`#2563EB`,B4:`#1D4ED8`,B5:`#1E40AF`,B6:`#111827`,AA2:`#22D3EE`,AA4:`#0EA5E9`,AA5:`#0284C7`,AB4:`#FBBF24`,AB5:`#F59E0B`},o=D(r,`context`,3,void 0),s=D(r,`maxHeight`,3,void 0),u=D(r,`loading`,3,void 0),d=D(r,`isDark`,3,void 0),p=D(r,`themeId`,3,void 0),h=D(r,`darkThemeId`,3,void 0),g=D(r,`showHeader`,3,!0),_=D(r,`showModeToggle`,3,!0),y=D(r,`showCopyButton`,3,!0),x=D(r,`showExportButton`,3,!0),S=D(r,`showCollapseButton`,3,!0),{t:C}=Xj(),w=B(!1),E=B(0),O=B(``),ee=B(``),A=B(``),te=B(``),M=B(!1),F=B(!1),re=B(!1),I=B(!1),L=B(!1),ae=B(!1),oe=null,H=P(()=>LA(r.node?.code)),ce=P(()=>u()??r.node?.loading===!0),le=P(()=>d()??o()?.isDark??!1),G=P(()=>!(T(ce)&&!T(H).trim())),de=P(()=>T(ae)||!T(A)),q=P(()=>s()?`max-height: ${s()}; --ms-d2-render-max-height: ${s()}`:``);ue(()=>{N(w,!0),fe(!0)}),W(()=>{T(w)&&(pe(),T(L),T(ae),e(()=>{fe()}))}),se(()=>{N(w,!1),N(E,T(E)+1),oe&&clearTimeout(oe)});async function fe(e=!1){if(!T(w)||T(L)||T(ae)||!T(H).trim())return;let t=pe();if(T(M)){(t!==T(ee)||e)&&(N(F,!0),N(re,T(re)||e,!0));return}if(!e&&t===T(O)&&(T(A)||T(te)))return;let n=ne(E);N(ee,t,!0),N(O,t,!0),N(M,!0),N(te,``);try{let e=await rN();if(!T(w)||n!==T(E))return;let t=he(e);if(!t||typeof t.compile!=`function`||typeof t.render!=`function`)throw Error(`D2 renderer is not available.`);let r=await t.compile(T(H)),i=r?.diagram??r,o=r?.renderOptions??r?.options??{},s={...o};s.themeID=T(le)&&h()!=null?h():p()??o.themeID,s.darkThemeID=null,s.darkThemeOverrides=null,T(le)&&(s.themeOverrides={...a,...o.themeOverrides||{}});let c=await t.render(i,s);if(!T(w)||n!==T(E))return;let l=lN(uN(c));if(!l)throw Error(`D2 rendered empty SVG.`);N(A,l.replace(`<svg`,`<svg class="markstream-d2-root-svg"`),!0)}catch(e){n===T(E)&&(N(A,``),N(te,e instanceof Error?e.message:String(e),!0))}finally{if(n===T(E)&&(N(M,!1),N(ee,``),T(F))){let e=T(re);N(F,!1),N(re,!1),fe(e)}}}function pe(){return`${T(H)}\n${T(le)}\n${p()}\n${h()}`}function he(e){if(typeof e==`function`){let t=new e;if(t&&typeof t.compile==`function`)return t;if(typeof e.compile==`function`)return e}return e?.D2&&typeof e.D2==`function`?new e.D2:typeof e?.compile==`function`?e:null}async function ge(){await IM(T(H)),o()?.events?.onCopy?.(T(H)),N(I,!0),oe&&clearTimeout(oe),oe=setTimeout(()=>{N(I,!1)},1e3)}function Y(){T(A)&&RM(T(A),`d2-diagram-${Date.now()}.svg`)}function _e(e){N(ae,e===`source`),T(ae)||fe(!0)}function ve(e,t){let n=e.currentTarget;!n||n instanceof HTMLButtonElement&&n.disabled||mM(n,t,`top`,!1,void 0,T(le))}function ye(e){ve(e,T(I)?C(`common.copied`)||`Copied`:C(`common.copy`)||`Copy`)}var be=J(),xe=K(be),Se=e=>{var t=SN();let r;var i=U(t),a=e=>{var t=_N(),r=R(U(t),2),i=U(r),a=e=>{var t=dN(),r=U(t);let i;var a=j(r,!0),o=R(r,2);let s;var u=j(o,!0);n(t),V((e,t)=>{i=me(r,1,`markstream-svelte-enhanced-block__action mode-btn d2-mode-btn`,null,i,{"is-active":!T(ae)}),c(a,e),s=me(o,1,`markstream-svelte-enhanced-block__action mode-btn d2-mode-btn`,null,s,{"is-active":T(ae)}),c(u,t)},[()=>C(`common.preview`),()=>C(`common.source`)]),f(`blur`,r,()=>$()),l(`click`,r,()=>_e(`preview`)),f(`focus`,r,e=>ve(e,C(`common.preview`)||`Preview`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>ve(e,C(`common.preview`)||`Preview`)),f(`blur`,o,()=>$()),l(`click`,o,()=>_e(`source`)),f(`focus`,o,e=>ve(e,C(`common.source`)||`Source`)),f(`mouseleave`,o,()=>$()),f(`mouseenter`,o,e=>ve(e,C(`common.source`)||`Source`)),v(e,t)};m(i,e=>{_()&&e(a)});var o=R(i,2),s=e=>{var t=mN(),r=U(t),i=e=>{var t=fN();v(e,t)},a=e=>{var t=pN();v(e,t)};m(r,e=>{T(I)?e(i):e(a,-1)}),n(t),V(e=>z(t,`aria-label`,e),[()=>T(I)?C(`common.copied`)||`Copied`:C(`common.copy`)||`Copy`]),f(`blur`,t,()=>$()),l(`click`,t,ge),f(`focus`,t,ye),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,ye),v(e,t)};m(o,e=>{y()&&e(s)});var u=R(o,2),d=e=>{var t=hN();V(e=>z(t,`aria-label`,e),[()=>C(`common.export`)||`Export`]),f(`blur`,t,()=>$()),l(`click`,t,Y),f(`focus`,t,e=>ve(e,C(`common.export`)||`Export`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>ve(e,C(`common.export`)||`Export`)),v(e,t)};m(u,e=>{x()&&T(A)&&e(d)});var p=R(u,2),h=e=>{var t=gN(),r=U(t);let i;n(t),V(e=>{z(t,`aria-label`,e),z(t,`aria-pressed`,T(L)),i=k(r,``,i,{transform:T(L)?`rotate(0deg)`:`rotate(90deg)`})},[()=>T(L)?C(`common.expand`)||`Expand`:C(`common.collapse`)||`Collapse`]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(L,!T(L))),f(`focus`,t,e=>ve(e,T(L)?C(`common.expand`)||`Expand`:C(`common.collapse`)||`Collapse`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>ve(e,T(L)?C(`common.expand`)||`Expand`:C(`common.collapse`)||`Collapse`)),v(e,t)};m(p,e=>{S()&&e(h)}),n(r),n(t),v(e,t)};m(i,e=>{g()&&e(a)});var o=R(i,2),s=e=>{var t=xN(),r=U(t),i=e=>{var t=yN(),r=U(t),i=U(r),a=j(i,!0);n(r);var o=R(r,2),s=e=>{var t=vN(),n=j(t,!0);V(()=>c(n,T(te))),v(e,t)};m(o,e=>{T(te)&&e(s)}),n(t),V(()=>c(a,T(H))),v(e,t)},a=e=>{var t=bN(),r=U(t);ie(r,()=>T(A),!0),n(r);var i=R(r,2),a=e=>{var t=vN(),n=j(t,!0);V(()=>c(n,T(te))),v(e,t)};m(i,e=>{T(te)&&e(a)}),n(t),V(()=>k(t,T(q))),v(e,t)};m(r,e=>{T(de)?e(i):e(a,-1)}),n(t),v(e,t)};m(o,e=>{T(L)||e(s)}),n(t),V(()=>{r=me(t,1,`markstream-svelte-enhanced-block markstream-svelte-enhanced-block--d2`,null,r,{dark:T(le),"is-rendering":T(M)||T(ce)}),z(t,`data-markstream-mode`,T(de)?`fallback`:`preview`)}),v(e,t)};m(xe,e=>{T(G)&&e(Se)}),v(t,be),b()}w([`click`]);function wN(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}var TN=r(`<span class="emoji-node"> </span>`);function EN(e,t){i(t,!0);let n=P(()=>LA(t.node?.raw||t.node?.markup||t.node?.content||t.node?.name));var r=TN(),a=j(r,!0);V(()=>c(a,T(n))),v(e,r),b()}function DN(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0),a=D(t,`tag`,3,`span`);var o=J(),c=K(o);s(c,a,!1,(e,i)=>{{let e=P(()=>IA(t.node?.children)),o=P(()=>String(r()??a())+`-`+a());NI(i,{get nodes(){return T(e)},get context(){return n()},get prefix(){return T(o)}})}}),v(e,o),b()}function ON(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`em`})}function kN(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}var AN=r(`<a class="footnote-anchor">↩︎</a>`);function jN(e,t){i(t,!0);let n=P(()=>LA(t.node?.id)),r=P(()=>T(n)?`#fnref-${T(n)}`:void 0);function a(e){e.preventDefault(),!(typeof document>`u`||!T(n))&&document.getElementById(`fnref-${T(n)}`)?.scrollIntoView({behavior:`smooth`,block:`center`})}var o=AN();V(()=>{z(o,`href`,T(r)),z(o,`title`,T(n)?`返回引用 ${T(n)}`:void 0)}),l(`click`,o,a),v(e,o),b()}w([`click`]);var MN=r(`<div class="footnote-node"><div class="footnote-node__content"><!></div></div>`);function NN(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`indexKey`,3,void 0),o=P(()=>LA(t.node?.id)),s=P(()=>IA(t.node?.children)),c=P(()=>`footnote-${a()??(T(o)||`node`)}`);var l=MN(),u=U(l);NI(U(u),{get nodes(){return T(s)},get context(){return r()},get prefix(){return T(c)}}),n(u),n(l),V(()=>z(l,`id`,T(o)?`fnref--${T(o)}`:void 0)),v(e,l),b()}var PN=r(`<sup class="footnote-reference"><span> </span></sup>`);function FN(e,t){i(t,!0);let r=P(()=>LA(t.node?.id)),a=P(()=>T(r)?`#fnref--${T(r)}`:void 0),o=P(()=>T(a)?{href:T(a)}:{});function s(e){e.preventDefault(),!(typeof document>`u`||!T(r))&&document.querySelector(T(a)||``)?.scrollIntoView({behavior:`smooth`,block:`start`})}var u=PN(),d=U(u);M(d,()=>({...T(o),title:T(r)?`查看脚注 ${T(r)}`:void 0,class:`footnote-link cursor-pointer`}));var f=j(d);n(u),V(()=>{z(u,`id`,T(r)?`fnref-${T(r)}`:void 0),c(f,`[${T(r)??``}]`)}),l(`click`,u,s),v(e,u),b()}w([`click`]);var IN=r(`<br/>`);function LN(e){var t=IN();v(e,t)}function RN(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0),a=P(()=>VA(t.node?.level)),o=P(()=>`h`+T(a));var c=J(),l=K(c);s(l,()=>T(o),!1,(e,i)=>{M(e,()=>({class:`heading-node heading-${T(a)??``}`}));{let e=P(()=>IA(t.node?.children)),a=P(()=>String(r()??`heading`)+`-heading`);NI(i,{get nodes(){return T(e)},get context(){return n()},get prefix(){return T(a)}})}}),v(e,c),b()}function zN(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`mark`})}function BN(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}function VN(e,t){i(t,!0);let n=P(()=>zj(t.node,t.context));var r=J(),a=K(r);ie(a,()=>T(n)),v(e,r),b()}var HN=r(`<img/>`),UN=r(`<span class="image-shimmer"></span>`),WN=r(`<span class="image-node__raw-text"> </span>`),GN=r(`<span class="image-placeholder"><!></span>`),KN=r(`<span class="image-error"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"></path></svg> <span> </span></span>`),qN=r(`<span class="image-node-container"><!></span>`);function JN(t,r){i(r,!0);let a=D(r,`fallbackSrc`,3,``),o=D(r,`lazy`,3,!1),s=D(r,`usePlaceholder`,3,!0),{t:l}=Xj();function u(e,t,n){return n||e?{src:e,stage:`primary`}:t?{src:t,stage:`fallback`}:{src:``,stage:`failed`}}let p=P(()=>Sy(r.node?.src)),h=P(()=>Sy(a())),g=P(()=>LA(r.node?.alt)),_=P(()=>LA(r.node?.title)),y=P(()=>LA(r.node?.raw)),x=P(()=>!!r.node?.loading),S=P(()=>!o()),C=e(()=>Sy(r.node?.src)),w=e(()=>Sy(a())),E=e(()=>!!r.node?.loading),O=u(C,w,E),k=B(de(C)),ee=B(de(w)),A=B(de(E)),te=B(de(O.src)),M=B(de(O.stage)),F=B(!1),ne=B(O.stage===`failed`);re(()=>{if(T(p)!==T(k)||T(h)!==T(ee)||T(x)!==T(A)){N(k,T(p),!0),N(ee,T(h),!0),N(A,T(x),!0);let e=u(T(p),T(h),T(x));N(te,e.src,!0),N(M,e.stage,!0),N(F,!1),N(ne,e.stage===`failed`)}});function I(){if(T(M)===`primary`&&T(h)&&T(h)!==T(te)){N(te,T(h),!0),N(M,`fallback`),N(F,!1),N(ne,!1);return}N(M,`failed`),N(ne,!0),N(F,!1)}function L(e){let t=e.currentTarget;if(t&&t.naturalWidth===0&&t.naturalHeight===0){I();return}N(F,!0),N(ne,!1)}var ie=qN(),ae=U(ie),oe=e=>{var t=HN();let n;V(e=>{n=me(t,1,`image-node__img`,null,n,{"is-loaded":T(S)||T(F),"is-loading":!T(S)&&!T(F)}),z(t,`src`,T(te)),z(t,`alt`,T(g)),z(t,`title`,T(_)||T(g)||void 0),z(t,`loading`,o()?`lazy`:void 0),z(t,`fetchpriority`,T(S)?`high`:void 0),z(t,`decoding`,T(S)?`sync`:`async`),z(t,`aria-label`,e)},[()=>T(g)||l(`image.preview`)]),f(`error`,t,I),f(`load`,t,L),d(t),v(e,t)},se=e=>{var t=GN(),r=U(t),i=e=>{var t=UN();v(e,t)},a=e=>{var t=WN(),n=j(t,!0);V(()=>c(n,T(y))),v(e,t)};m(r,e=>{s()?e(i):e(a,-1)}),n(t),v(e,t)},H=e=>{var t=KN(),r=R(U(t),2),i=j(r,!0);n(t),V(e=>c(i,e),[()=>l(`image.loadError`)]),v(e,t)};m(ae,e=>{!T(x)&&!T(ne)&&T(te)?e(oe):T(ne)?e(H,-1):e(se,1)}),n(ie),v(t,ie),b()}var YN=null,XN=null;async function ZN(){return XN||(YN||=Y(()=>import(`../chunks/C3mlWJXx.js`).then(e=>{let t=e&&e.default?e.default:e,n=t;return typeof t==`function`&&t.prototype&&t.prototype.render?n=t:e?.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),XN=n,n}),[],import.meta.url).catch(e=>(console.warn(`[markstream-svelte] Failed to load @antv/infographic`,e),null)),await YN)}function QN(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return Number.isFinite(t)&&t>0?t:null}function $N(e){for(let t of e.split(/\r?\n/)){let e=t.trim();if(e&&!e.startsWith(`%%`))return(e.match(/^([A-Z][\w-]*)\b/i)?.[1])?.toLowerCase()||``}return``}function eP(e){let t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`%%`)),n=Math.max(1,t.length),r=$N(e);return r===`gantt`?220+n*28:r===`sequencediagram`?180+n*26:r===`classdiagram`||r===`statediagram`||r===`erdiagram`?180+n*24:r===`flowchart`||r===`graph`?170+n*28:200+n*22}function tP(e){let t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+t*60:360}function nP(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function rP(e,t){return QN(e?getComputedStyle(e).getPropertyValue(`--ms-size-diagram-min-height`).trim():``)??t}var iP=r(`<div class="infographic-mode-toggle"><button type="button"><span class="markstream-svelte-enhanced-block__action-content"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></g></svg> <span> </span></span></button> <button type="button"><span class="markstream-svelte-enhanced-block__action-content"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m16 18l6-6l-6-6M8 6l-6 6l6 6"></path></svg> <span> </span></span></button></div>`),aP=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"></path></svg></button>`),oP=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"></path></svg>`),sP=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></g></svg>`),cP=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><!></button>`),lP=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10l5 5l5-5"></path></g></svg></button>`),uP=r(`<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"></path></svg></button>`),dP=r(`<div class="markstream-svelte-enhanced-block__header infographic-block-header"><div class="markstream-svelte-enhanced-block__title"><span class="markstream-svelte-enhanced-block__title-icon icon-slot action-icon" aria-hidden="true"></span> <span class="markstream-svelte-enhanced-block__title-text infographic-label">Infographic</span></div> <!> <div class="markstream-svelte-enhanced-block__actions infographic-header-actions"><!> <!> <!> <!></div></div>`),fP=r(`<div class="infographic-source"><pre class="infographic-source-code"><code> </code></pre></div>`),pP=r(`<div class="markstream-svelte-zoom-controls"><button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"></path></g></svg></button> <button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M8 11h6"></path></g></svg></button> <button type="button" class="markstream-svelte-enhanced-block__action infographic-action-btn infographic-zoom-reset"> </button></div>`),mP=r(`<pre class="infographic-source-code infographic-pending-source"><code> </code></pre>`),hP=r(`<p class="d2-error"> </p>`),gP=r(`<!> <div class="infographic-render"><!> <div></div> <!></div>`,1),_P=r(`<div class="markstream-svelte-enhanced-block__body infographic-block-body"><!></div>`),vP=r(`<div><div class="mermaid-modal-overlay infographic-modal-overlay" role="dialog" aria-modal="true" tabindex="-1"><div class="mermaid-modal-panel infographic-modal-panel"><div class="mermaid-modal-controls"><button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"></path></g></svg></button> <button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M8 11h6"></path></g></svg></button> <button type="button" class="markstream-svelte-enhanced-block__action infographic-action-btn infographic-zoom-reset"> </button> <button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon infographic-action-btn"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"></path></svg></button></div> <div class="mermaid-modal-body"><div class="mermaid-modal-content infographic-modal-content"></div></div></div></div></div>`),yP=r(`<div data-markstream-infographic="1"><!> <!> <!></div>`);function bP(t,r){i(r,!0);let a=D(r,`context`,3,void 0),o=D(r,`maxHeight`,3,`500px`),s=D(r,`estimatedPreviewHeightPx`,3,void 0),u=D(r,`loading`,3,void 0),d=D(r,`isDark`,3,void 0),p=D(r,`showHeader`,3,!0),h=D(r,`showModeToggle`,3,!0),g=D(r,`showCopyButton`,3,!0),y=D(r,`showCollapseButton`,3,!0),x=D(r,`showExportButton`,3,!0),S=D(r,`showFullscreenButton`,3,!0),C=D(r,`showZoomControls`,3,!0),{t:w}=Xj(),E=B(null),O=B(null),ee=B(!1),A=B(0),te=B(``),M=B(``),F=B(``),re=B(null),I=B(``),L=B(!1),H=B(!1),ce=B(!1),le=B(!1),G=B(!1),de=B(!1),q=B(!1),pe=B(!1),he=B(!1),ge=B(!1),Y=B(``),_e=B(1),ve=null,ye=P(()=>LA(r.node?.code)),be=P(()=>typeof r.node?.loading!=`boolean`||!!r.node?.loading),xe=P(()=>u()??T(be)),Se=P(()=>a()?.final??T(xe)===!1),Ce=P(()=>T(xe)!==!1||T(Se)===!1),we=P(()=>d()??a()?.isDark??!1),Te=P(()=>o()===`none`?null:QN(o())),Ee=P(()=>nP(QN(s())??tP(T(ye)),rP(T(O),360),T(Te)??void 0)),De=P(()=>[`min-height: ${T(Ee)}px`,o()&&o()!==`none`?`max-height: ${o()}`:``].filter(Boolean).join(`; `)),Oe=P(()=>`transform: scale(${T(_e)}); transform-origin: center center;`),ke=P(()=>!(T(xe)&&!T(ye).trim()));ue(()=>{N(ee,!0),Ae(!0)}),W(()=>{T(ee)&&(`${T(ye)}${T(we)}${T(Se)}${T(Ce)}`,T(pe),T(he),e(()=>{Ae()}))}),se(()=>{N(ee,!1),N(A,T(A)+1),Me(),N(te,``),ve&&clearTimeout(ve)});function Ae(e=!1){T(ee)&&T(E)&&!T(pe)&&!T(he)&&T(ye).trim()&&(N(G,T(G)||e,!0),!T(le)&&(N(le,!0),_().then(()=>{N(le,!1);let e=T(G);return N(G,!1),je(e)})))}async function je(e=!1){if(!T(ee)||!T(E)||T(pe)||T(he))return;if(!T(ye).trim()){Me(),T(E)&&LM(T(E)),N(de,!1),N(I,``),N(te,``),N(F,``);return}let t=T(ye),n=T(Se),r=`${t}\n${T(we)}\n${n}\n${T(Ce)}`;if(!e&&r===T(te)&&T(de)||!e&&r===T(F))return;if(T(L)){(r!==T(M)||e)&&(N(H,!0),N(ce,T(ce)||e,!0));return}let i=ne(A);N(M,r);let a=!T(Ce);N(L,!0),a&&N(I,``);let o=null,s=null;try{let e=await ZN();if(!T(ee)||i!==T(A)||T(pe)||T(he)||!T(E))return;if(!e)throw Error(`Infographic renderer is not available.`);if(!(r===`${T(ye)}\n${T(we)}\n${T(Se)}\n${T(Ce)}`||!n&&T(xe)&&T(ye).startsWith(t)))return;s=Array.from(T(E).childNodes),o=new e({container:T(E),width:`100%`,height:`100%`});let a=``,c=!1;if(o.on?.(`error`,e=>{a=(Array.isArray(e)?e:[e]).map(e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e?String(e.message??``):String(e??``)).filter(Boolean).join(`; `)}),o.on?.(`rendered`,()=>{c=!0}),o.render(t),a)throw Error(a);let l=Array.from(T(E).childNodes),u=l.length>0&&(l.length!==s.length||l.some((e,t)=>e!==s?.[t]));if(!c&&!u)throw Error(`Infographic render returned empty output.`);T(re)?.destroy?.(),N(re,o,!0),o=null,N(de,!0),N(I,``),N(te,r),N(F,``)}catch(e){if(i===T(A)){o?.destroy?.(),o=null,N(te,``);let t=`${T(ye)}\n${T(we)}\n${T(Se)}\n${T(Ce)}`;a&&r===t?(N(F,``),Me(),LM(T(E)),N(de,!1),N(I,e instanceof Error?e.message:String(e),!0)):(s&&T(E)&&T(E).replaceChildren(...s),r===t&&N(F,r))}}finally{if(o?.destroy?.(),i===T(A)&&(N(L,!1),N(M,``),T(H))){let e=T(ce);N(H,!1),N(ce,!1),Ae(e)}}}function Me(){try{T(re)?.destroy?.()}catch{}N(re,null)}function Ne(){N(A,T(A)+1),Me(),T(E)&&LM(T(E)),N(L,!1),N(H,!1),N(ce,!1),N(le,!1),N(G,!1),N(de,!1),N(I,``),N(M,``),N(te,``),N(F,``)}async function Pe(){await IM(T(ye)),a()?.events?.onCopy?.(T(ye)),N(q,!0),ve&&clearTimeout(ve),ve=setTimeout(()=>{N(q,!1)},1e3)}function Fe(){let e=T(E)?.querySelector(`svg`);return e?lN(e.outerHTML):``}function Ie(){let e=Fe();e&&RM(e,`infographic-${Date.now()}.svg`)}function Le(){N(Y,T(E)?.innerHTML||``,!0),T(Y)&&N(ge,!0)}async function Re(e){let t=e===`source`;T(he)!==t&&(N(he,t),Ne(),T(he)||(await _(),Ae(!0)))}async function ze(){N(pe,!T(pe)),Ne(),T(pe)||(await _(),Ae(!0))}function Be(){N(_e,Math.min(3,Math.round((T(_e)+.1)*10)/10),!0)}function Ve(){N(_e,Math.max(.5,Math.round((T(_e)-.1)*10)/10),!0)}function He(e,t){let n=e.currentTarget;!n||n instanceof HTMLButtonElement&&n.disabled||mM(n,t,`top`,!1,void 0,T(we))}function Ue(e){He(e,T(q)?w(`common.copied`)||`Copied`:w(`common.copy`)||`Copy`)}function We(e){return document.body.appendChild(e),{destroy(){e.remove()}}}function Ge(){N(ge,!1)}function Ke(e){e.target===e.currentTarget&&Ge()}function qe(e){e.key===`Escape`&&Ge()}var Je=J(),Ye=K(Je),Xe=e=>{var t=yP();let r;var i=U(t),a=e=>{var t=dP(),r=U(t),i=U(r);ie(i,()=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path fill="#5b8ff9" d="M5 4.25A2.25 2.25 0 0 1 7.25 2h2.5A2.25 2.25 0 0 1 12 4.25v2.5A2.25 2.25 0 0 1 9.75 9h-2.5A2.25 2.25 0 0 1 5 6.75z"/><path fill="#61d9a6" d="M12 17.25A2.25 2.25 0 0 1 14.25 15h2.5A2.25 2.25 0 0 1 19 17.25v2.5A2.25 2.25 0 0 1 16.75 22h-2.5A2.25 2.25 0 0 1 12 19.75z"/><path fill="#f6bd16" d="M12 4.25A2.25 2.25 0 0 1 14.25 2h2.5A2.25 2.25 0 0 1 19 4.25v2.5A2.25 2.25 0 0 1 16.75 9h-2.5A2.25 2.25 0 0 1 12 6.75z"/><path fill="#5ad8a6" d="M7.5 10.75h1.75a6.25 6.25 0 0 1 6.25 6.25v.25h-2V17a4.25 4.25 0 0 0-4.25-4.25H7.5z"/><path fill="#7262fd" d="M15.5 11.1l3.75 2.16v4.33l-3.75 2.16l-3.75-2.16v-4.33z"/></svg>`,!0),n(i),ae(2),n(r);var a=R(r,2),o=e=>{var t=iP(),r=U(t);let i;var a=U(r),o=R(U(a),2),s=j(o,!0);n(a),n(r);var u=R(r,2);let d;var p=U(u),m=R(U(p),2),h=j(m,!0);n(p),n(u),n(t),V((e,t)=>{i=me(r,1,`markstream-svelte-enhanced-block__action mode-btn infographic-mode-btn`,null,i,{"is-active":!T(he)}),c(s,e),d=me(u,1,`markstream-svelte-enhanced-block__action mode-btn infographic-mode-btn`,null,d,{"is-active":T(he)}),c(h,t)},[()=>w(`common.preview`),()=>w(`common.source`)]),f(`blur`,r,()=>$()),l(`click`,r,()=>Re(`preview`)),f(`focus`,r,e=>He(e,w(`common.preview`)||`Preview`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>He(e,w(`common.preview`)||`Preview`)),f(`blur`,u,()=>$()),l(`click`,u,()=>Re(`source`)),f(`focus`,u,e=>He(e,w(`common.source`)||`Source`)),f(`mouseleave`,u,()=>$()),f(`mouseenter`,u,e=>He(e,w(`common.source`)||`Source`)),v(e,t)};m(a,e=>{h()&&e(o)});var s=R(a,2),u=U(s),d=e=>{var t=aP(),r=U(t);let i;n(t),V(e=>{z(t,`aria-label`,e),z(t,`aria-pressed`,T(pe)),i=k(r,``,i,{transform:T(pe)?`rotate(0deg)`:`rotate(90deg)`})},[()=>T(pe)?w(`common.expand`)||`Expand`:w(`common.collapse`)||`Collapse`]),f(`blur`,t,()=>$()),l(`click`,t,ze),f(`focus`,t,e=>He(e,T(pe)?w(`common.expand`)||`Expand`:w(`common.collapse`)||`Collapse`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>He(e,T(pe)?w(`common.expand`)||`Expand`:w(`common.collapse`)||`Collapse`)),v(e,t)};m(u,e=>{y()&&e(d)});var p=R(u,2),_=e=>{var t=cP(),r=U(t),i=e=>{var t=oP();v(e,t)},a=e=>{var t=sP();v(e,t)};m(r,e=>{T(q)?e(i):e(a,-1)}),n(t),V(e=>z(t,`aria-label`,e),[()=>T(q)?w(`common.copied`)||`Copied`:w(`common.copy`)||`Copy`]),f(`blur`,t,()=>$()),l(`click`,t,Pe),f(`focus`,t,Ue),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,Ue),v(e,t)};m(p,e=>{g()&&e(_)});var b=R(p,2),C=e=>{var t=lP();V(e=>{z(t,`aria-label`,e),t.disabled=!T(de)||T(he)||T(pe)},[()=>w(`common.export`)||`Export`]),f(`blur`,t,()=>$()),l(`click`,t,Ie),f(`focus`,t,e=>He(e,w(`common.export`)||`Export`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>He(e,w(`common.export`)||`Export`)),v(e,t)};m(b,e=>{x()&&e(C)});var E=R(b,2),D=e=>{var t=uP();V(e=>{z(t,`aria-label`,e),t.disabled=!T(de)||T(he)||T(pe)},[()=>w(`common.open`)||`Open`]),f(`blur`,t,()=>$()),l(`click`,t,Le),f(`focus`,t,e=>He(e,w(`common.open`)||`Open`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>He(e,w(`common.open`)||`Open`)),v(e,t)};m(E,e=>{S()&&e(D)}),n(s),n(t),v(e,t)};m(i,e=>{p()&&e(a)});var o=R(i,2),s=e=>{var t=_P(),r=U(t),i=e=>{var t=fP(),r=U(t),i=U(r),a=j(i,!0);n(r),n(t),V(()=>c(a,T(ye))),v(e,t)},a=e=>{var t=gP(),r=K(t),i=e=>{var t=pP(),r=U(t),i=R(r,2),a=R(i,2),o=j(a);n(t),V((e,t,n)=>{z(r,`aria-label`,e),z(i,`aria-label`,t),c(o,`${n??``}%`)},[()=>w(`common.zoomIn`)||`Zoom in`,()=>w(`common.zoomOut`)||`Zoom out`,()=>Math.round(T(_e)*100)]),f(`blur`,r,()=>$()),l(`click`,r,Be),f(`focus`,r,e=>He(e,w(`common.zoomIn`)||`Zoom in`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>He(e,w(`common.zoomIn`)||`Zoom in`)),f(`blur`,i,()=>$()),l(`click`,i,Ve),f(`focus`,i,e=>He(e,w(`common.zoomOut`)||`Zoom out`)),f(`mouseleave`,i,()=>$()),f(`mouseenter`,i,e=>He(e,w(`common.zoomOut`)||`Zoom out`)),f(`blur`,a,()=>$()),l(`click`,a,()=>N(_e,1)),f(`focus`,a,e=>He(e,w(`common.resetZoom`)||`Reset zoom`)),f(`mouseleave`,a,()=>$()),f(`mouseenter`,a,e=>He(e,w(`common.resetZoom`)||`Reset zoom`)),v(e,t)};m(r,e=>{C()&&e(i)});var a=R(r,2),o=U(a),s=e=>{var t=mP(),r=U(t),i=j(r,!0);n(t),V(()=>c(i,T(ye))),v(e,t)};m(o,e=>{!T(de)&&!T(I)&&e(s)});var u=R(o,2);oe(u,e=>N(E,e),()=>T(E));var d=R(u,2),p=e=>{var t=hP(),n=j(t,!0);V(()=>c(n,T(I))),v(e,t)};m(d,e=>{T(I)&&e(p)}),n(a),V(()=>{k(a,T(De)),k(u,T(Oe))}),v(e,t)};m(r,e=>{T(he)?e(i):e(a,-1)}),n(t),v(e,t)};m(o,e=>{T(pe)||e(s)});var u=R(o,2),d=e=>{var t=vP();let r;var i=U(t),a=U(i),o=U(a),s=U(o),u=R(s,2),d=R(u,2),f=j(d),p=R(d,2);n(o);var m=R(o,2),h=U(m);ie(h,()=>T(Y),!0),n(h),n(m),n(a),n(i),n(t),fe(t,e=>We?.(e)),V((e,n,i,a,o)=>{r=me(t,1,`markstream-svelte markstream-svelte-modal-root`,null,r,{dark:T(we)}),z(s,`aria-label`,e),z(u,`aria-label`,n),z(d,`aria-label`,i),c(f,`${a??``}%`),z(p,`aria-label`,o),k(h,`transform: scale(${T(_e)});`)},[()=>w(`common.zoomIn`)||`Zoom in`,()=>w(`common.zoomOut`)||`Zoom out`,()=>w(`common.resetZoom`)||`Reset zoom`,()=>Math.round(T(_e)*100),()=>w(`common.close`)||`Close`]),l(`click`,i,Ke),l(`keydown`,i,qe),l(`click`,s,Be),l(`click`,u,Ve),l(`click`,d,()=>N(_e,1)),l(`click`,p,Ge),v(e,t)};m(u,e=>{T(ge)&&e(d)}),n(t),oe(t,e=>N(O,e),()=>T(O)),V(()=>{r=me(t,1,`markstream-svelte-enhanced-block markstream-svelte-enhanced-block--infographic`,null,r,{dark:T(we),"is-rendering":T(L)||T(xe)}),z(t,`data-markstream-mode`,T(he)?`source`:T(de)?`preview`:`fallback`)}),v(e,t)};m(Ye,e=>{T(ke)&&e(Xe)}),v(t,Je),b()}w([`click`,`keydown`]);function xP({nextContent:e,previousContent:t,typewriterEnabled:n}){return!n||e===t?{settledContent:e,streamedDelta:``,appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:``,appended:!1}}function SP(e,t,n=1){let r=Number(e);return Number.isFinite(r)?Math.max(n,r):t}function CP(e,t){let n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var wP=2048;function TP(){return typeof performance<`u`?performance.now():Date.now()}var EP=class{constructor(e={},t){this.source=``,this.visible=``,this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.activeFenceMarker=``,this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges=[],this.atomicRevealRangeIndex=0,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=e=>this.destroyed?()=>{}:(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.enqueue=e=>{if(this.destroyed||!e)return;this.done&&=!1;let t=this.source.length>0,n=this.pendingChars<=0,r=this.isRevealBlocked();if(this.source+=e,this.scanAppendedSource(),n||r&&!this.isRevealBlocked()){let e=TP();this.startedAt=t&&this.hasStarted?e-this.normalizedStartDelayMs:e,this.lastTick=e,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(e={})=>{if(!this.destroyed){if(this.done=!0,this.releaseTrailingFenceCandidate(),e.flush??this.flushOnFinish){this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.releaseTrailingFenceCandidate(),this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(e=``,t)=>{if(this.destroyed)return;this.cancelLoop(),t?.prefixKnown||e.startsWith(this.source)?(this.source=e,this.scanAppendedSource()):(this.resetFenceScanner(),this.source=e,this.scanAppendedSource());let n=this.getRevealableEnd();this.visible=n>=this.source.length?this.source:this.source.slice(0,n),this.discardConsumedAtomicRanges(),this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit()},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;let e=TP();this.lastTick=e,this.startedAt||=e,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=e=>{if(this.rafId=0,this.destroyed||this.paused)return;if(!this.hasRevealableChars()){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(e-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}let t=this.pendingChars;if(this.burstInitialContent&&t>=this.burstRevealThresholdChars){let e=this.getRevealableEnd();this.visible.length<e&&(this.visible=e>=this.source.length?this.source:this.source.slice(0,e),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit()),this.ensureLoop();return}let n=1e3/Math.max(1,this.maxCommitFps),r=Math.min(100,Math.max(0,e-this.lastTick));if(r<n){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=e;let i=this.pendingChars,a=i>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,o=AP(i/Math.max(.001,a/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(o-this.currentCps)*.2,this.charBudget+=this.currentCps*(r/1e3),this.charBudget<1){this.ensureLoop();return}let s=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),c=this.takeNextRevealSlice(s);c.text&&(this.visible+=c.text,this.charBudget=Math.max(0,this.charBudget-c.graphemeCount),this.emit()),this.ensureLoop()};let{minCharsPerSecond:n=40,maxCharsPerSecond:r=1e3,targetLatencyMs:i=900,catchUpLatencyMs:a=350,catchUpThreshold:o=600,maxCommitFps:s=30,startDelayMs:c=80,maxCharsPerCommit:l=80,flushOnFinish:u=!1,burstInitialContent:d=!1,burstRevealThresholdChars:f=wP}=e;this.minCharsPerSecond=SP(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,SP(r,1e3,1)),this.normalizedTargetLatencyMs=SP(i,900,1),this.normalizedCatchUpLatencyMs=SP(a,350,1),this.normalizedCatchUpThreshold=CP(o,600),this.normalizedStartDelayMs=CP(c,80),this.maxCommitFps=Math.trunc(SP(s,30,1)),this.maxCharsPerCommit=Math.trunc(SP(l,80,1)),this.flushOnFinish=u,this.burstInitialContent=d===!0,this.burstRevealThresholdChars=Math.max(1,Math.trunc(SP(f,wP,1))),this.segmenter=OP(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}resetFenceScanner(){this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.activeFenceMarker=``,this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges.length=0,this.atomicRevealRangeIndex=0}scanAppendedSource(e=!1){for(;this.fenceScanOffset<this.source.length;){let t=this.source[this.fenceScanOffset];if(t===`\r`){if(this.fenceScanOffset+1>=this.source.length&&!e)break;if(this.source[this.fenceScanOffset+1]===`
214
+ `){let e=this.fenceScanOffset+2;this.completeFenceLine(e),this.fenceScanOffset=e;continue}}if(t===`
215
+ `){let e=this.fenceScanOffset+1;this.completeFenceLine(e),this.fenceScanOffset=e;continue}this.consumeFenceCharacter(t),this.fenceScanOffset++}this.updateFenceRevealBlock()}consumeFenceCharacter(e){if(this.fenceLineState!==`normal`){if(this.fenceLineState===`opening`){this.fenceMarker==="`"&&e==="`"&&(this.fenceLineState=`normal`);return}if(this.fenceLineState===`closing`){e!==` `&&e!==` `&&(this.fenceLineState=`normal`);return}if(!this.fenceMarker){if(e===` `&&this.fenceIndent<3){this.fenceIndent++;return}if(e==="`"||e===`~`){this.fenceMarker=e,this.fenceMarkerLength=1;return}this.fenceLineState=`normal`;return}if(e===this.fenceMarker){this.fenceMarkerLength++;return}if(this.activeFenceMarker){this.fenceLineState=this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(e===` `||e===` `)?`closing`:`normal`;return}this.fenceLineState=this.fenceMarkerLength>=3?`opening`:`normal`}}completeFenceLine(e){let t=this.fenceLineState===`candidate`&&this.fenceMarkerLength>=3;!this.activeFenceMarker&&(this.fenceLineState===`opening`||t)?(this.atomicRevealRanges.push({start:this.fenceLineStart,end:e}),this.activeFenceMarker=this.fenceMarker,this.activeFenceLength=this.fenceMarkerLength):this.activeFenceMarker&&this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(this.fenceLineState===`closing`||t)&&(this.activeFenceMarker=``,this.activeFenceLength=0),this.fenceLineStart=e,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.blockedRevealEnd=0}updateFenceRevealBlock(){this.blockedRevealEnd=!this.activeFenceMarker&&(this.fenceLineState===`opening`||this.fenceLineState===`candidate`&&(this.fenceIndent>0||this.fenceMarkerLength>0))?this.fenceLineStart+1:0}releaseTrailingFenceCandidate(){this.scanAppendedSource(!0),this.blockedRevealEnd&&=((this.fenceLineState===`opening`||this.fenceLineState===`candidate`&&this.fenceMarkerLength>=3)&&this.source.length>this.fenceLineStart&&this.atomicRevealRanges.push({start:this.fenceLineStart,end:this.source.length}),this.fenceLineState=`normal`,0)}isRevealBlocked(){return this.blockedRevealEnd!==0}getRevealableEnd(){return this.blockedRevealEnd?Math.min(this.source.length,this.blockedRevealEnd-1):this.source.length}hasRevealableChars(){return this.visible.length<this.getRevealableEnd()}takeNextRevealSlice(e){this.discardConsumedAtomicRanges();let t=this.getRevealableEnd();if(this.visible.length>=t)return{text:``,graphemeCount:0};let n=this.atomicRevealRanges[this.atomicRevealRangeIndex];if(n&&this.visible.length>=n.start&&this.visible.length<n.end)return kP(this.source,this.visible.length,n.end-this.visible.length,this.segmenter,Math.min(n.end,t));let r=n&&n.start>this.visible.length?Math.min(n.start,t):t;return kP(this.source,this.visible.length,e,this.segmenter,r)}discardConsumedAtomicRanges(){for(;this.atomicRevealRangeIndex<this.atomicRevealRanges.length&&this.atomicRevealRanges[this.atomicRevealRangeIndex].end<=this.visible.length;)this.atomicRevealRangeIndex++;this.atomicRevealRangeIndex>=64&&this.atomicRevealRangeIndex*2>=this.atomicRevealRanges.length&&(this.atomicRevealRanges.splice(0,this.atomicRevealRangeIndex),this.atomicRevealRangeIndex=0)}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||!this.hasRevealableChars())){if(typeof requestAnimationFrame!=`function`){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&=(typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(this.rafId),0)}emit(){if(!this.destroyed)for(let e of this.listeners)e()}};function DP(e={},t){let n=new EP(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function OP(){if(typeof Intl>`u`)return null;let e=Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null}function kP(e,t,n,r,i=e.length){let a=Math.min(e.length,Math.max(t,i));if(t>=a||n<=0)return{text:``,graphemeCount:0};if(!r){let r=t,i=0;for(;r<a&&i<n;){let t=e.charCodeAt(r),n=e.charCodeAt(r+1);r=Math.min(a,r+(t>=55296&&t<=56319&&n>=56320&&n<=57343?2:1)),i++}return{text:e.slice(t,r),graphemeCount:i}}let o=t,s=0,c=!0;for(;s<n&&o<a;){let t=e.codePointAt(o),n=t>65535?2:1;if(o+n>a||!MP(t)){c=!1;break}o+=n,s++}if(c&&o>t&&!(o<a&&e.charCodeAt(o-1)===13&&e.charCodeAt(o)===10)){let n=e.codePointAt(o),r=n!=null&&o+(n!=null&&n>65535?2:1)<=a&&MP(n);if(o>=a||r)return{text:e.slice(t,o),graphemeCount:s}}let l=a-t,u=Math.min(l,Math.max(64,n*2));for(;;){let i=u>=l,a=e.slice(t,t+u),o=0,s=0;for(let i of r.segment(a)){if(s>=n)return{text:e.slice(t,t+o),graphemeCount:s};o+=i.segment.length,s++}if(i)return{text:e.slice(t,t+o),graphemeCount:s};u=Math.min(l,u*2)}}function AP(e,t,n){return Math.min(n,Math.max(t,e))}function jP(e){return e>=11904&&e<=12329||e>=12336&&e<=12351||e>=12352&&e<=12440||e>=12443&&e<=12543||e>=12544&&e<=12799||e>=12800&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65437||e>=65440&&e<=65519||e>=127488&&e<=127743||e>=131072&&e<=196607}function MP(e){return e<=127||jP(e)}var NP=r(`<span> </span>`),PP=r(`<code class="inline-code-node"> <!></code>`);function FP(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`indexKey`,3,void 0),o=``,s=``,l=`markstream-svelte-text__stream-delta--a`,u=P(()=>LA(t.node?.code??t.node?.content??t.node?.raw)),d=P(()=>`${String(r()?.customId??`global`)}:${String(r()?.streamRenderVersion??0)}:${String(a()??`inline-code`)}`),f=P(()=>r()?.fade!==!1),p=P(()=>{let e=r()?.textStreamState,t=T(d)===o?s:e?.get(T(d))??``,n=xP({nextContent:T(u),previousContent:t,typewriterEnabled:T(f)});return n.appended&&(l=l.endsWith(`--a`)?`markstream-svelte-text__stream-delta--b`:`markstream-svelte-text__stream-delta--a`),o=T(d),s=T(u),e?.set(T(d),T(u)),{stableCode:n.settledContent,deltaCode:n.streamedDelta,deltaClass:l}});var h=PP(),g=U(h),_=R(g),y=e=>{var t=NP(),n=j(t,!0);V(()=>{me(t,1,`markstream-svelte-text__stream-delta text-node-stream-delta ${T(p).deltaClass??``}`),c(n,T(p).deltaCode)}),v(e,t)};m(_,e=>{T(p).deltaCode&&e(y)}),n(h),V(()=>c(g,`${T(p).stableCode??``} `)),v(e,h),b()}function IP(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`ins`})}var LP=r(`<span class="link-loading-indicator"></span>`),RP=r(`<a><span class="link-text-wrapper"><span class="link-text"><!></span><!></span></a>`);function zP(e,t){i(t,!0);let r=P(()=>Jk({href:LA(t.node?.href)},`safe`,`a`).href??``),a=P(()=>LA(t.node?.title||T(r))),o=P(()=>IA(t.node?.children)),s=P(()=>t.showTooltip??t.context?.showTooltips??!0),u=P(()=>T(r).startsWith(`#`)&&T(r).length>1),d=P(()=>by(T(r)));function p(e){T(s)&&T(a)&&mM(e.currentTarget,T(a),`top`,!1,void 0,t.context?.isDark)}function h(e){if(!T(u)||typeof document>`u`)return;e.preventDefault();let t=T(r).slice(1),n=g(t);(document.getElementById(t)||(n===t?null:document.getElementById(n)))?.scrollIntoView({behavior:`smooth`,block:`start`})}function g(e){try{return decodeURIComponent(e)}catch{return e}}var _=RP();let y;var x=U(_),C=U(x),w=U(C),E=e=>{{let n=P(()=>String(t.indexKey??`link`)+`-link`);NI(e,{get nodes(){return T(o)},get context(){return t.context},get prefix(){return T(n)}})}},D=e=>{var n=S();V(e=>c(n,e),[()=>LA(t.node?.text||T(r))]),v(e,n)};m(w,e=>{T(o).length?e(E):e(D,-1)}),n(C);var O=R(C),k=e=>{var t=LP();v(e,t)};m(O,e=>{t.node?.loading&&e(k)}),n(x),n(_),V(e=>{y=me(_,1,`link-node`,null,y,{"link-loading":e}),z(_,`href`,T(r)||void 0),z(_,`title`,T(s)?void 0:T(a)),z(_,`target`,T(d)?`_blank`:void 0),z(_,`rel`,T(d)?`noreferrer noopener`:void 0)},[()=>!!t.node?.loading]),f(`blur`,_,()=>$()),l(`click`,_,h),f(`focus`,_,p),f(`mouseleave`,_,()=>$()),f(`mouseenter`,_,p),v(e,_),b()}w([`click`]);var BP=r(`<li><!></li>`);function VP(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`indexKey`,3,void 0);var o=BP(),s=U(o);{let e=P(()=>IA(t.node?.children)),n=P(()=>String(a()??`li`)+`-li`);NI(s,{get nodes(){return T(e)},get context(){return r()},get prefix(){return T(n)}})}n(o),v(e,o),b()}var HP=r(`<ol><!></ol>`),UP=r(`<ul><!></ul>`);function WP(e,t){i(t,!0);let r=P(()=>!!t.node?.ordered),a=P(()=>Number(t.node?.start));P(()=>T(r)?`ol`:`ul`);var o=J(),s=K(o),c=e=>{var r=HP(),i=U(r);{let e=P(()=>IA(t.node?.items)),n=P(()=>String(t.indexKey??`list`)+`-list`);NI(i,{get nodes(){return T(e)},get context(){return t.context},get prefix(){return T(n)}})}n(r),V(e=>z(r,`start`,e),[()=>Number.isFinite(T(a))?T(a):void 0]),v(e,r)},l=e=>{var r=UP(),i=U(r);{let e=P(()=>IA(t.node?.items)),n=P(()=>String(t.indexKey??`list`)+`-list`);NI(i,{get nodes(){return T(e)},get context(){return t.context},get prefix(){return T(n)}})}n(r),v(e,r)};m(s,e=>{T(r)?e(c):e(l,-1)}),v(e,o),b()}var GP=null,KP=!1,qP=null,JP=ZP;function YP(e){let t=e?.default??e;return t&&typeof t.renderToString==`function`?t:null}function XP(){try{return YP(globalThis?.katex)}catch{return null}}function ZP(){return(async()=>{let e=XP();if(e)return e;let t=await Y(()=>import(`../chunks/DecrR9TK.js`),[],import.meta.url);try{await Y(()=>import(`../chunks/Dnkino9G.js`),[],import.meta.url)}catch{}return YP(t)})()}function QP(){return typeof JP==`function`}async function $P(){let e=XP();if(e)return GP=e,GP;if(GP)return GP;if(qP)return await qP;if(KP)return null;let t=JP;if(!t)return KP=!0,null;qP=(async()=>{try{let e=await t(),n=YP(e)??e;if(n)return GP=n,GP}catch{}return KP=!0,null})();try{return await qP}finally{qP=null}}function eF(e){return e?e.replace(/·/g,`⋅`).replace(/℃/g,`°C`):``}var tF=`WORKER_BUSY`,nF=null,rF=new Map,iF=new Map,aF=200,oF=new Set,sF=5;function cF(){if(rF.size>=sF||oF.size===0)return;let e=Array.from(oF);oF.clear();for(let t of e)try{t()}catch{}}function lF(e,t,n){if(iF.set(`${t?`d`:`i`}:${e}`,n),iF.size>aF){let e=iF.keys().next().value;e&&iF.delete(e)}}function uF(){return nF=Error(`[markstream-svelte:katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker().`),nF.name=`WorkerInitError`,nF.code=`WORKER_INIT_ERROR`,null}async function dF(e,t=!0,n=2e3,r){let i=eF(e);if(!QP()){let e=Error(`KaTeX rendering disabled`);return e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,Promise.reject(e)}if(nF)return Promise.reject(nF);let a=`${t?`d`:`i`}:${i}`,o=iF.get(a);if(o)return o;let s=uF();if(!s)return Promise.reject(nF);if(rF.size>=sF){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=tF,e.busy=!0,e.inFlight=rF.size,e.max=sF,Promise.reject(e)}return new Promise((e,a)=>{if(r?.aborted){let e=Error(`Aborted`);e.name=`AbortError`,a(e);return}let o=Math.random().toString(36).slice(2),c=globalThis.setTimeout(()=>{rF.delete(o),cF();let e=Error(`Worker render timed out`);e.name=`WorkerTimeout`,e.code=`WORKER_TIMEOUT`,a(e)},n),l=()=>{globalThis.clearTimeout(c),rF.delete(o)&&cF();let e=Error(`Aborted`);e.name=`AbortError`,a(e)};r?.addEventListener(`abort`,l,{once:!0}),rF.set(o,{timeoutId:c,resolve:t=>{r?.removeEventListener(`abort`,l),e(t)},reject:e=>{r?.removeEventListener(`abort`,l),a(e)}}),s.postMessage({id:o,type:`render`,content:i,displayMode:t})})}function fF(e,t=!0,n){lF(eF(e),t,n)}function pF(e=2e3,t){return rF.size<sF?Promise.resolve():new Promise((n,r)=>{let i=!1,a=null,o=()=>{i||(i=!0,a&&clearTimeout(a),oF.delete(o),n())};if(oF.add(o),a=setTimeout(()=>{if(i)return;i=!0,oF.delete(o);let e=Error(`Wait for worker slot timed out`);e.name=`WorkerBusyTimeout`,e.code=`WORKER_BUSY_TIMEOUT`,r(e)},e),queueMicrotask(()=>cF()),t){let e=()=>{if(i)return;i=!0,a&&clearTimeout(a),oF.delete(o);let e=Error(`Aborted`);e.name=`AbortError`,r(e)};t.aborted?e():t.addEventListener(`abort`,e,{once:!0})}})}var mF={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1},hF=8;async function gF(e,t=!0,n={}){if(!QP()){let e=Error(`KaTeX rendering disabled`);throw e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,e}let r=n.timeout??mF.timeout,i=n.waitTimeout??mF.waitTimeout,a=n.backoffMs??mF.backoffMs,o=n.maxRetries??mF.maxRetries,s=Number.isFinite(o)?Math.max(0,Math.min(Math.floor(o),hF)):mF.maxRetries,c=0;for(;;){if(n.signal?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}try{return await dF(e,t,r,n.signal)}catch(e){if(e?.code!==`WORKER_BUSY`||c>=s)throw e;c+=1,await pF(i,n.signal).catch(()=>{}),a>0&&await new Promise(e=>globalThis.setTimeout(e,a*c))}}}var _F=r(`<div class="math-block markstream-nested-math-block" data-markstream-katex-managed="1"><div></div></div>`);function vF(e,t){i(t,!0);let r=B(null),a=B(!0),o=!1,s=0,c=!1,l=P(()=>LA(t.node?.content||t.node?.markup||t.node?.raw)),u=P(()=>LA(t.node?.raw||T(l))),d=P(()=>t.node?.loading===!0);W(()=>{T(r)&&f(T(l),T(u),T(d))}),se(()=>{o=!0,s+=1});async function f(e,t,n){let i=T(r);if(!i)return;let l=eF(e),u=++s;if(!l){i.textContent=``,N(a,!1);return}c||N(a,!0);let d=await p(l,n);o||u!==s||(d?(i.innerHTML=d,c=!0,N(a,!1)):n||(i.textContent=t||l,N(a,!1)))}async function p(e,t){try{return await gF(e,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1})}catch(e){let t=e?.code||e?.name;if(!(t===`WORKER_INIT_ERROR`||e?.fallbackToRenderer)&&t!==`WORKER_BUSY`&&t!==`WORKER_TIMEOUT`)return null}let n=await $P();if(!n)return null;try{let r=n.renderToString(e,{throwOnError:t,displayMode:!0});return fF(e,!0,r),r}catch{return null}}var m=_F(),h=U(m);let g;oe(h,e=>N(r,e),()=>T(r)),n(m),V(()=>g=me(h,1,`markstream-nested-math-block__render`,null,g,{"math-rendering":T(a)})),v(e,m),b()}var yF=r(`<span class="math-inline__loading" role="status" aria-live="polite"><span class="math-inline__spinner" aria-hidden="true"></span> <span class="sr-only">Loading</span></span>`),bF=r(`<span class="math-inline-wrapper markstream-nested-math" data-display="inline" data-markstream-katex-managed="1"><span></span> <!></span>`);function xF(e,t){i(t,!0);let r=B(null),a=B(!0),o=!1,s=0,c=!1,l=P(()=>LA(t.node?.content||t.node?.markup||t.node?.raw)),u=P(()=>LA(t.node?.raw||T(l))),d=P(()=>t.node?.loading===!0),f=P(()=>String(t.node?.markup||``)===`$$`);W(()=>{T(r)&&p(T(l),T(u),T(d),T(f))}),se(()=>{o=!0,s+=1});async function p(e,t,n,i){let l=T(r);if(!l)return;let u=eF(e),d=++s;if(!u){l.textContent=``,N(a,!1);return}c||N(a,!0);let f=await h(u,i,n);o||d!==s||(f?(l.innerHTML=f,c=!0,N(a,!1)):n||(l.textContent=t||u,N(a,!1)))}async function h(e,t,n){try{return await gF(e,t,{timeout:1500,waitTimeout:0,maxRetries:0})}catch(e){let t=e?.code||e?.name;if(!(t===`WORKER_INIT_ERROR`||e?.fallbackToRenderer)&&t!==`WORKER_BUSY`&&t!==`WORKER_TIMEOUT`)return null}let r=await $P();if(!r)return null;try{let i=r.renderToString(e,{throwOnError:n,displayMode:t});return fF(e,t,i),i}catch{return null}}var g=bF(),_=U(g);let y;oe(_,e=>N(r,e),()=>T(r));var x=R(_,2),S=e=>{var t=yF();v(e,t)};m(x,e=>{T(a)&&e(S)}),n(g),V(()=>y=me(_,1,`math-inline`,null,y,{"math-inline--hidden":T(a)})),v(e,g),b()}var SF=()=>Y(()=>import(`../chunks/J36u8XLO.js`),[],import.meta.url),CF=`__MARKSTREAM_ANGULAR_MERMAID__`,wF=null,TF=!1,EF=null,DF=null,OF=SF;function kF(e){return`${String(e?.securityLevel??`strict`)}|htmlLabels:${e?.flowchart?.htmlLabels===!1?`0`:`1`}`}function AF(e){if(!e)return e;let t=e?.default??e;if(t&&(typeof t.render==`function`||typeof t.parse==`function`||typeof t.initialize==`function`))return t;if(t?.mermaidAPI&&(typeof t.mermaidAPI.render==`function`||typeof t.mermaidAPI.parse==`function`)){let e=t.mermaidAPI;return{...t,render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>typeof t.initialize==`function`?t.initialize(n):e.initialize?e.initialize(n):void 0}}return e?.mermaid&&typeof e.mermaid.render==`function`?e.mermaid:t}function jF(e){if(e)try{let t=e?.initialize;e.initialize=n=>{let r={suppressErrorRendering:!0,...n||{}};if(typeof t==`function`)return t.call(e,r);if(e?.mermaidAPI&&typeof e.mermaidAPI.initialize==`function`)return e.mermaidAPI.initialize(r)}}catch{}}function MF(e,t){if(!e||!t)return;let n=kF(t);if(EF!==n)try{typeof e.initialize==`function`?e.initialize(t):e.mermaidAPI?.initialize&&e.mermaidAPI.initialize(t),EF=n}catch{}}function NF(){try{let e=globalThis;return AF(e?.[CF]??e?.mermaid)}catch{return null}}function PF(e){try{globalThis[CF]=e}catch{}}function FF(){return typeof OF==`function`}async function IF(e){if(wF)return MF(wF,e),wF;let t=NF();if(t)return jF(t),wF=t,PF(wF),MF(wF,e),wF;if(DF){let t=await DF;return t&&MF(t,e),t}if(TF)return null;let n=OF;if(!n)return TF=!0,null;DF=(async()=>{try{let e=AF(await n());return e?(jF(e),wF=e,PF(wF),wF):(TF=!0,null)}catch{return TF=!0,null}})();try{let t=await DF;return t&&MF(t,e),t}finally{DF=null}}var LF=null,RF=new Map,zF=5,BF=`WORKER_BUSY`,VF=`MERMAID_DISABLED`;function HF(){return LF=Error(`[markstream-svelte:mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker().`),LF.name=`WorkerInitError`,LF.code=`WORKER_INIT_ERROR`,null}function UF(e,t,n=1400){if(!FF()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=VF,Promise.reject(e)}if(LF)return Promise.reject(LF);let r=HF();if(!r)return Promise.reject(LF);if(RF.size>=zF){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=BF,e.inFlight=RF.size,e.max=zF,Promise.reject(e)}return new Promise((i,a)=>{let o=Math.random().toString(36).slice(2),s=!1,c=null,l=()=>{s||(s=!0,c!=null&&clearTimeout(c),RF.delete(o))};RF.set(o,{resolve:e=>{l(),i(e)},reject:e=>{l(),a(e)}});try{r.postMessage({id:o,action:e,payload:t})}catch(e){RF.delete(o),a(e);return}c=setTimeout(()=>{let e=Error(`Worker call timed out`);e.name=`WorkerTimeout`,e.code=`WORKER_TIMEOUT`,RF.get(o)?.reject(e)},n)})}async function WF(e,t,n=1400){return await UF(`canParse`,{code:e,theme:t},n)}async function GF(e,t,n=1400){return await UF(`findPrefix`,{code:e,theme:t},n)}var KF=r(`<div class="mermaid-toggle"><button type="button"><span class="mermaid-action-content"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></g></svg> <span> </span></span></button> <button type="button"><span class="mermaid-action-content"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m16 18l6-6l-6-6M8 6l-6 6l6 6"></path></svg> <span> </span></span></button></div>`),qF=r(`<button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"></path></svg></button>`),JF=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"></path></svg>`),YF=C(`<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></g></svg>`),XF=r(`<button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><!></button>`),ZF=r(`<button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10l5 5l5-5"></path></g></svg></button>`),QF=r(`<button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"></path></svg></button>`),$F=r(`<div class="mermaid-header"><div class="mermaid-header__title"><span class="icon-slot action-icon" aria-hidden="true"></span> <span class="mermaid-title__text">Mermaid</span></div> <!> <div class="mermaid-actions"><!> <!> <!> <!></div></div>`),eI=r(`<pre class="mermaid-source"><code> </code></pre>`),tI=r(`<div class="markstream-svelte-zoom-controls"><button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"></path></g></svg></button> <button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M8 11h6"></path></g></svg></button> <button type="button" class="mermaid-btn mermaid-action-btn mermaid-zoom-reset"> </button></div>`),nI=r(`<div class="mermaid-loading"><span class="mermaid-spinner"></span> </div>`),rI=r(`<div class="mermaid-error"> </div>`),iI=r(`<!> <div class="mermaid-preview markstream-svelte-mermaid"><!></div> <!>`,1),aI=r(`<div class="mermaid-body"><!></div>`),oI=r(`<div><div class="mermaid-modal-overlay" role="dialog" aria-modal="true" tabindex="-1"><div class="mermaid-modal-panel"><div class="mermaid-modal-controls"><button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"></path></g></svg></button> <button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21l-4.35-4.35M8 11h6"></path></g></svg></button> <button type="button" class="mermaid-btn mermaid-action-btn mermaid-zoom-reset"> </button> <button type="button" class="mermaid-btn mermaid-action-btn mermaid-btn--icon"><svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"></path></svg></button></div> <div class="mermaid-modal-body"><div class="mermaid-modal-content markstream-svelte-mermaid"></div></div></div></div></div>`),sI=r(`<div data-markstream-mermaid="1"><!> <!> <!></div>`);function cI(t,r){i(r,!0);let a=D(r,`context`,3,void 0),o=D(r,`maxHeight`,3,`500px`),s=D(r,`estimatedPreviewHeightPx`,3,void 0),u=D(r,`loading`,3,void 0),d=D(r,`isDark`,3,void 0),p=D(r,`workerTimeoutMs`,3,1400),h=D(r,`parseTimeoutMs`,3,1800),g=D(r,`renderTimeoutMs`,3,2500),y=D(r,`fullRenderTimeoutMs`,3,4e3),x=D(r,`renderDebounceMs`,3,300),S=D(r,`showHeader`,3,!0),C=D(r,`showModeToggle`,3,!0),w=D(r,`showCopyButton`,3,!0),E=D(r,`showExportButton`,3,!0),O=D(r,`showFullscreenButton`,3,!0),ee=D(r,`showCollapseButton`,3,!0),A=D(r,`showZoomControls`,3,!0),te=D(r,`isStrict`,3,!0),M=D(r,`enableMermaidInteractions`,3,!1),{t:F}=Xj(),re=kM(`mermaid`),I=B(!1),L=B(0),se=B(``),H=B(``),ce=B(``),le=B(``),G=B(de({})),q=B(``),pe=B(!1),he=B(!1),ge=B(!1),Y=B(!1),_e=B(!1),ve=B(!1),ye=B(1),be=B(null),xe=B(null),Se=B(null),Ce=B(null),we=B(null),Te=null,Ee=P(()=>Be(LA(r.node?.code))),De=P(()=>typeof r.node?.loading!=`boolean`||!!r.node?.loading),Oe=P(()=>u()??T(De)),ke=P(()=>d()??a()?.isDark??!1),Ae=P(()=>T(ke)?`dark`:`light`),je=P(()=>a()?.final??T(Oe)===!1),Me=P(()=>T(Oe)!==!1||T(je)===!1),Ne=P(()=>o()===`none`?null:QN(o())),Pe=P(()=>nP(QN(s())??eP(T(Ee)),rP(T(be),360),T(Ne)??void 0)),Fe=P(()=>[`min-height: ${T(Pe)}px`,o()&&o()!==`none`?`max-height: ${o()}`:``,`transform: scale(${T(ye)})`].filter(Boolean).join(`; `)),Ie=P(()=>!(T(Oe)&&!T(Ee).trim())),Le=P(()=>!(!T(le)||T(_e)));ue(()=>(N(I,!0),ze(!0),()=>{N(I,!1),N(L,T(L)+1),Re(),T(we)&&clearTimeout(T(we))})),W(()=>{T(I)&&(Ye(),T(_e),T(Y),e(()=>ze()))}),W(()=>{T(I)&&T(ve)&&T(le)&&T(Se)&&M()&&e(()=>void _().then(()=>Ze(T(Se))))});function Re(){T(Ce)&&(clearTimeout(T(Ce)),N(Ce,null))}function ze(e=!1){if(!T(I)||T(_e)||T(Y))return;let t=Ye();if(t===T(se)&&T(pe)||!e&&t===T(se)&&(T(le)||T(q)||T(H)===t)||(e&&Re(),T(Ce)))return;let n=e||!T(Me)?0:Math.max(0,x());N(Ce,setTimeout(()=>{N(Ce,null),He(e)},n),!0)}function Be(e){return e.replace(/\]::([^:])/g,`]:::$1`).replace(/:::subgraphNode$/gm,`::subgraphNode`)}function Ve(e,t){return e.trimStart().startsWith(`%%{`)?e:`%%{init: {"theme": "${t===`dark`?`dark`:`default`}"}}%%\n${e}`}async function He(e=!1){if(!T(I)||T(_e)||T(Y))return;if(!T(Ee).trim()){N(le,``),N(q,``),N(ce,``),N(H,``),N(he,!1),N(G,{},!0);return}let t=Je(T(Ee)),n=Ye();if(n===T(se)&&T(pe)||!e&&n===T(se)&&(T(le)||T(q)||T(H)===n))return;let r=ne(L);N(se,n,!0),N(pe,!0),T(Me)||N(q,``);try{let e=await IF({startOnLoad:!1,securityLevel:te()?`strict`:`loose`,suppressErrorRendering:!0,...te()?{flowchart:{htmlLabels:!1}}:{}});if(!T(I)||r!==T(L))return;if(!e)throw Error(`Mermaid is not available.`);let i=T(Ee),a=!0;if(T(Me)){if(T(he)&&t===T(ce)&&T(le)){N(q,``);return}let o=await We(T(Ee),T(Ae),e);if(!T(I)||r!==T(L))return;if(o.fullOk)i=T(Ee);else if(o.prefixOk&&o.prefix&&!T(he))i=o.prefix,a=!1;else{N(q,``),N(H,n,!0);let e=T(G)[T(Ae)];e&&N(le,e,!0);return}}else await Ue(T(Ee),T(Ae),e);let o=await Xe(()=>Promise.resolve(e.render(`markstream-svelte-mermaid-${r}`,Ve(i,T(Ae)))),a?y():g());if(!T(I)||r!==T(L))return;let s=vA(typeof o==`string`?o:o?.svg);if(!s)throw Error(`Mermaid rendered empty SVG.`);N(le,s,!0),Te=typeof o==`string`?null:o?.bindFunctions??null,N(q,``),N(H,``),a&&(N(he,!0),N(ce,t,!0),T(G)[T(Ae)]=s),M()&&typeof o!=`string`&&(await _(),T(I)&&r===T(L)&&(Ze(T(xe)),T(ve)&&Ze(T(Se))))}catch(e){r===T(L)&&(T(Me)?(N(q,``),N(H,n,!0)):(N(le,``),N(q,e instanceof Error?e.message:String(e),!0)))}finally{r===T(L)&&N(pe,!1)}}async function Ue(e,t,n){try{if(await WF(e,t,p()))return!0}catch{}let r=Ve(e,t);return typeof n?.parse==`function`?(await Xe(()=>Promise.resolve(n.parse(r)),h()),!0):(await Xe(()=>Promise.resolve(n.render(`markstream-svelte-mermaid-parse-${T(L)}`,r)),h()),!0)}async function We(e,t,n){if($N(e)===`gantt`){let r=qe(e);if(!r.trim())return{fullOk:!1,prefixOk:!1};try{return await Ue(r,t,n),r===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:r}}catch{return{fullOk:!1,prefixOk:!1}}}try{return await Ue(e,t,n),{fullOk:!0,prefixOk:!1}}catch{}let r=qe(e);if(!r.trim()||r===e)return{fullOk:!1,prefixOk:!1};try{let n=await GF(e,t,p());n?.trim()&&(r=n)}catch{}try{return await Ue(r,t,n),{fullOk:!1,prefixOk:!0,prefix:r}}catch{return{fullOk:!1,prefixOk:!1}}}function Ge(e){let t=e.trim();return!t||t.startsWith(`%%`)||/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)?!1:t.includes(`:`)}function Ke(e){let t=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&t.length>0&&t.pop();t.length>0;){let e=t[t.length-1]?.trim();if(!e||e.startsWith(`%%`)){t.pop();continue}if(Ge(e))break;t.pop()}return t.some(Ge)?t.join(`
216
+ `):``}function qe(e){if($N(e)===`gantt`)return Ke(e);let t=e.split(`
217
+ `);for(;t.length>0;){let e=(t[t.length-1]||``).trimEnd();if(!e){t.pop();continue}if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}return t.join(`
218
+ `).trim()||``}function Je(e){return e.replace(/\s+/g,``)}function Ye(){return`${T(Ee)}\n${T(Ae)}\n${te()}\n${M()}\n${T(je)}\n${T(Me)}`}function Xe(e,t){return!t||t<=0?e():new Promise((n,r)=>{let i=setTimeout(()=>r(Error(`Operation timed out`)),t);e().then(e=>{clearTimeout(i),n(e)}).catch(e=>{clearTimeout(i),r(e)})})}function Ze(e){if(M()&&e?.querySelector(`svg`))try{Te?.(e)}catch{}}async function Qe(){await IM(T(Ee)),a()?.events?.onCopy?.(T(Ee)),N(ge,!0),T(we)&&clearTimeout(T(we)),N(we,setTimeout(()=>{N(ge,!1)},1e3),!0)}function $e(){T(le)&&RM(T(le),`mermaid-diagram-${Date.now()}.svg`)}function et(e){N(_e,e===`source`),T(_e)||He()}function tt(){N(ye,Math.min(3,Math.round((T(ye)+.1)*10)/10),!0)}function nt(){N(ye,Math.max(.5,Math.round((T(ye)-.1)*10)/10),!0)}function rt(e,t,n=`top`){let r=e.currentTarget;!r||r instanceof HTMLButtonElement&&r.disabled||mM(r,t,n,!1,void 0,T(ke))}function it(e){rt(e,T(ge)?F(`common.copied`)||`Copied`:F(`common.copy`)||`Copy`)}function at(e){return document.body.appendChild(e),{destroy(){e.remove()}}}function ot(){N(ve,!1)}function st(e){e.target===e.currentTarget&&ot()}function ct(e){e.key===`Escape`&&ot()}var lt=J(),ut=K(lt),dt=e=>{var t=sI();let r;var i=U(t),a=e=>{var t=$F(),r=U(t),i=U(r);ie(i,()=>re,!0),n(i),ae(2),n(r);var a=R(r,2),o=e=>{var t=KF(),r=U(t);let i;var a=U(r),o=R(U(a),2),s=j(o,!0);n(a),n(r);var u=R(r,2);let d;var p=U(u),m=R(U(p),2),h=j(m,!0);n(p),n(u),n(t),V((e,t)=>{i=me(r,1,`mermaid-toggle-btn`,null,i,{"mermaid-toggle-btn--active":!T(_e)}),c(s,e),d=me(u,1,`mermaid-toggle-btn`,null,d,{"mermaid-toggle-btn--active":T(_e)}),c(h,t)},[()=>F(`common.preview`),()=>F(`common.source`)]),f(`blur`,r,()=>$()),l(`click`,r,()=>et(`preview`)),f(`focus`,r,e=>rt(e,F(`common.preview`)||`Preview`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>rt(e,F(`common.preview`)||`Preview`)),f(`blur`,u,()=>$()),l(`click`,u,()=>et(`source`)),f(`focus`,u,e=>rt(e,F(`common.source`)||`Source`)),f(`mouseleave`,u,()=>$()),f(`mouseenter`,u,e=>rt(e,F(`common.source`)||`Source`)),v(e,t)};m(a,e=>{C()&&e(o)});var s=R(a,2),u=U(s),d=e=>{var t=qF(),r=U(t);let i;n(t),V(e=>{z(t,`aria-pressed`,T(Y)),z(t,`aria-label`,e),i=k(r,``,i,{rotate:T(Y)?`0deg`:`90deg`})},[()=>T(Y)?F(`common.expand`):F(`common.collapse`)]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(Y,!T(Y))),f(`focus`,t,e=>rt(e,T(Y)?F(`common.expand`)||`Expand`:F(`common.collapse`)||`Collapse`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>rt(e,T(Y)?F(`common.expand`)||`Expand`:F(`common.collapse`)||`Collapse`)),v(e,t)};m(u,e=>{ee()&&e(d)});var p=R(u,2),h=e=>{var t=XF(),r=U(t),i=e=>{var t=JF();v(e,t)},a=e=>{var t=YF();v(e,t)};m(r,e=>{T(ge)?e(i):e(a,-1)}),n(t),V(e=>z(t,`aria-label`,e),[()=>T(ge)?F(`common.copied`):F(`common.copy`)]),f(`blur`,t,()=>$()),l(`click`,t,Qe),f(`focus`,t,it),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,it),v(e,t)};m(p,e=>{w()&&e(h)});var g=R(p,2),_=e=>{var t=ZF();V(e=>{z(t,`aria-label`,e),t.disabled=!T(le)||T(_e)||T(Y)},[()=>F(`common.export`)]),f(`blur`,t,()=>$()),l(`click`,t,$e),f(`focus`,t,e=>rt(e,F(`common.export`)||`Export`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>rt(e,F(`common.export`)||`Export`)),v(e,t)};m(g,e=>{E()&&e(_)});var y=R(g,2),b=e=>{var t=QF();V(e=>{z(t,`aria-label`,e),t.disabled=!T(le)||T(_e)||T(Y)},[()=>F(`common.open`)]),f(`blur`,t,()=>$()),l(`click`,t,()=>N(ve,!0)),f(`focus`,t,e=>rt(e,F(`common.open`)||`Open`)),f(`mouseleave`,t,()=>$()),f(`mouseenter`,t,e=>rt(e,F(`common.open`)||`Open`)),v(e,t)};m(y,e=>{O()&&e(b)}),n(s),n(t),v(e,t)};m(i,e=>{S()&&e(a)});var o=R(i,2),s=e=>{var t=aI(),r=U(t),i=e=>{var t=eI(),r=U(t),i=j(r,!0);n(t),V(()=>c(i,T(Ee))),v(e,t)},a=e=>{var t=iI(),r=K(t),i=e=>{var t=tI(),r=U(t),i=R(r,2),a=R(i,2),o=j(a);n(t),V((e,t,n,s)=>{z(r,`aria-label`,e),z(i,`aria-label`,t),z(a,`aria-label`,n),c(o,`${s??``}%`)},[()=>F(`common.zoomIn`),()=>F(`common.zoomOut`),()=>F(`common.resetZoom`),()=>Math.round(T(ye)*100)]),f(`blur`,r,()=>$()),l(`click`,r,tt),f(`focus`,r,e=>rt(e,F(`common.zoomIn`)||`Zoom in`)),f(`mouseleave`,r,()=>$()),f(`mouseenter`,r,e=>rt(e,F(`common.zoomIn`)||`Zoom in`)),f(`blur`,i,()=>$()),l(`click`,i,nt),f(`focus`,i,e=>rt(e,F(`common.zoomOut`)||`Zoom out`)),f(`mouseleave`,i,()=>$()),f(`mouseenter`,i,e=>rt(e,F(`common.zoomOut`)||`Zoom out`)),f(`blur`,a,()=>$()),l(`click`,a,()=>N(ye,1)),f(`focus`,a,e=>rt(e,F(`common.resetZoom`)||`Reset zoom`)),f(`mouseleave`,a,()=>$()),f(`mouseenter`,a,e=>rt(e,F(`common.resetZoom`)||`Reset zoom`)),v(e,t)};m(r,e=>{A()&&e(i)});var a=R(r,2),o=U(a),s=e=>{var t=J(),n=K(t);ie(n,()=>T(le)),v(e,t)},u=e=>{var t=eI(),r=U(t),i=j(r,!0);n(t),V(()=>c(i,T(Ee))),v(e,t)},d=e=>{var t=nI(),r=R(U(t));n(t),V(e=>c(r,` ${e??``}`),[()=>F(`common.preview`)]),v(e,t)};m(o,e=>{T(le)?e(s):T(q)?e(u,1):e(d,-1)}),n(a),oe(a,e=>N(xe,e),()=>T(xe));var p=R(a,2),h=e=>{var t=rI(),n=j(t,!0);V(()=>c(n,T(q))),v(e,t)};m(p,e=>{T(q)&&e(h)}),V(()=>k(a,T(Fe))),v(e,t)};m(r,e=>{T(_e)?e(i):e(a,-1)}),n(t),v(e,t)};m(o,e=>{T(Y)||e(s)});var u=R(o,2),d=e=>{var t=oI();let r;var i=U(t),a=U(i),o=U(a),s=U(o),u=R(s,2),d=R(u,2),f=j(d),p=R(d,2);n(o);var m=R(o,2),h=U(m);ie(h,()=>T(le),!0),n(h),oe(h,e=>N(Se,e),()=>T(Se)),n(m),n(a),n(i),n(t),fe(t,e=>at?.(e)),V((e,n,i,a,o)=>{r=me(t,1,`markstream-svelte markstream-svelte-modal-root`,null,r,{dark:T(ke)}),z(s,`aria-label`,e),z(u,`aria-label`,n),z(d,`aria-label`,i),c(f,`${a??``}%`),z(p,`aria-label`,o),k(h,`transform: scale(${T(ye)});`)},[()=>F(`common.zoomIn`),()=>F(`common.zoomOut`),()=>F(`common.resetZoom`),()=>Math.round(T(ye)*100),()=>F(`common.close`)]),l(`click`,i,st),l(`keydown`,i,ct),l(`click`,s,tt),l(`click`,u,nt),l(`click`,d,()=>N(ye,1)),l(`click`,p,ot),v(e,t)};m(u,e=>{T(ve)&&e(d)}),n(t),oe(t,e=>N(be,e),()=>T(be)),V(()=>{r=me(t,1,`mermaid-block`,null,r,{dark:T(ke),"is-rendering":T(Oe)||T(pe)}),z(t,`data-markstream-mode`,T(_e)?`source`:T(Le)?`preview`:`fallback`)}),v(e,t)};m(ut,e=>{T(Ie)&&e(dt)}),v(t,lt),b()}w([`click`,`keydown`]);var lI=r(`<p class="paragraph-node"><!></p>`);function uI(e,r){i(r,!0);let a=D(r,`context`,3,void 0),o=D(r,`indexKey`,3,void 0),s=P(()=>String(o()??`p`)),c=P(()=>GA(IA(r.node?.children)));var l=J(),u=K(l);t(u,19,()=>T(c),(e,t)=>T(s)+`-`+t,(e,t,r)=>{var i=J(),o=K(i),c=e=>{var i=lI(),o=U(i);{let e=P(()=>T(s)+`-`+T(r));NI(o,{get nodes(){return T(t).nodes},get context(){return a()},get prefix(){return T(e)}})}n(i),v(e,i)},l=e=>{{let n=P(()=>T(s)+`-`+T(r));MI(e,{get node(){return T(t).node},get context(){return a()},get indexKey(){return T(n)}})}};m(o,e=>{T(t).kind===`inline`?e(c):e(l,-1)}),v(e,i)}),v(e,l),b()}function dI(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}function fI(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`del`})}function pI(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`strong`})}function mI(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`sub`})}function hI(e,t){let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0);DN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},tag:`sup`})}function gI(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}var _I=r(`<span> </span>`),vI=r(`<span> <!></span>`);function yI(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`indexKey`,3,void 0);D(t,`typewriter`,3,void 0);let o=``,s=``,l=`markstream-svelte-text__stream-delta--a`,u=P(()=>LA(t.node?.content??t.node?.raw)),d=P(()=>!!t.node?.center),f=P(()=>String(r()?.customId??`global`)+`:`+String(r()?.streamRenderVersion??0)+`:`+String(a()??`node`)),p=P(()=>r()?.fade!==!1),h=P(()=>{let e=r()?.textStreamState,t=T(f)===o?s:e?.get(T(f))??``,n=xP({nextContent:T(u),previousContent:t,typewriterEnabled:T(p)});return n.appended&&(l=l.endsWith(`--a`)?`markstream-svelte-text__stream-delta--b`:`markstream-svelte-text__stream-delta--a`),o=T(f),s=T(u),e?.set(T(f),T(u)),{stableContent:n.settledContent,deltaContent:n.streamedDelta,deltaClass:l}});var g=vI();let _;var y=U(g,!0),x=R(y),S=e=>{var t=_I(),n=j(t,!0);V(()=>{me(t,1,`markstream-svelte-text__stream-delta text-node-stream-delta ${T(h).deltaClass??``}`),c(n,T(h).deltaContent)}),v(e,t)};m(x,e=>{T(h).deltaContent&&e(S)}),n(g),V(()=>{z(g,`data-typewriter`,r()?.typewriter===!0?`1`:void 0),_=me(g,1,`markstream-svelte-text-node text-node`,null,_,{"markstream-svelte-text--centered":T(d)}),c(y,T(h).stableContent)}),v(e,g),b()}var bI=r(`<hr/>`);function xI(e){var t=bI();v(e,t)}function SI(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=P(()=>zj(t.node,n()));var a=J(),o=K(a);ie(o,()=>T(r)),v(e,a),b()}function CI(e,t){if(t?.renderCodeBlocksAsPre)return`pre`;let n=UA(e);return n===`d2`||n===`d2lang`?`d2`:n===`infographic`?`infographic`:n===`mermaid`?`mermaid`:`code`}function wI(e){return String(e?.tag||``).trim().toLowerCase()||Py(e?.content)}function TI(e){let t=wI(e);return t?{...e,type:t,tag:t,content:Iy(e?.content,t)}:e}function EI(e,t){let n=wI(e);return n?{...e,type:t,tag:n}:e}function DI(e,t){if(String(e?.type||``)!==`code_block`)return null;let n=CI(e,t);return n===`mermaid`?kI(t?.mermaidProps,eP(OI(e))):n===`d2`?t?.d2Props??null:n===`infographic`?kI(t?.infographicProps,tP(OI(e))):t?.codeBlockProps??null}function OI(e){return String(e?.code??``)}function kI(e,t){let n={...e||{}};return QN(n.estimatedPreviewHeightPx)??(n.estimatedPreviewHeightPx=nP(t,void 0,n.maxHeight===`none`?null:QN(n.maxHeight)??void 0)),n}function AI(e,t,n){let r=n??t?.customComponents??null,i=String(e?.type||``);if(i===`code_block`){let n=UA(e),i=n?r?.[n]:null;if(i)return i;let a=CI(e,t);if(a===`mermaid`&&r?.mermaid)return r.mermaid;if(a===`d2`&&r?.d2)return r.d2;if(a===`infographic`&&r?.infographic)return r.infographic;if(r?.code_block)return r.code_block}let a=r?.[i];if(a)return a;let o=wI(e);return o&&r?.[o]?r[o]:null}var jI=r(`<span hidden=""></span>`);function MI(e,t){i(t,!0);let n=D(t,`context`,3,void 0),r=D(t,`indexKey`,3,void 0),o=P(()=>String(t.node?.type||``)),s=P(()=>n()?.customComponents||Gj(n()?.customId)),c=P(()=>AI(t.node,n(),T(s))),l=P(()=>TI(t.node)),u=P(()=>DI(t.node,n())||{}),d=P(()=>CI(t.node,n())),f=P(()=>wI(t.node)),h=P(C),g=P(()=>EI(t.node,T(o))),_=P(()=>`${String(r()??`code-block`)}:${String(t.node?.language??``)}:${t.node?.diff?`diff`:`code`}`),y=P(()=>typeof n()?.codeBlockProps?.showLineNumbers==`boolean`?n().codeBlockProps.showLineNumbers:typeof n()?.codeBlockOptions?.disableLineNumbers==`boolean`&&!n().codeBlockOptions.disableLineNumbers),x=P(()=>n()?.codeBlockOptions?.overflow?`white-space: ${n().codeBlockOptions.overflow===`scroll`?`pre`:`pre-wrap`}`:void 0),S=P(()=>({type:`text`,content:String(t.node?.content??t.node?.raw??``),raw:String(t.node?.content??t.node?.raw??``)}));function C(){return T(o)!==`html_block`&&T(o)!==`html_inline`?!1:n()?.htmlPolicy===`escape`?!0:!T(f)||(n()?.customHtmlTags??[]).some(e=>String(e).toLowerCase()===T(f))||ny.has(T(f))?!1:!Fy(t.node?.content??t.node?.raw,T(f))}var w=J(),E=K(w),O=e=>{var t=J(),i=K(t);{let e=P(()=>n()?.customId),t=P(()=>n()?.isDark),o=P(()=>n()?.typewriter),s=P(()=>n()?.fade),d=P(()=>n()?.codeBlockOptions);a(i,()=>T(c),(i,a)=>{a(i,G({get node(){return T(l)},get context(){return n()},get ctx(){return n()},get customId(){return T(e)},get isDark(){return T(t)},get indexKey(){return r()},get typewriter(){return T(o)},get fade(){return T(s)}},()=>T(u),{get codeBlockOptions(){return T(d)}}))})}v(e,t)},k=e=>{{let i=P(()=>n()?.typewriter);yI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},get typewriter(){return T(i)}})}},ee=e=>{uI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},A=e=>{RN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},j=e=>{FI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},te=e=>{WP(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},M=e=>{VP(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},N=e=>{gI(e,{get node(){return t.node},get context(){return n()}})},F=e=>{wN(e,{get node(){return t.node},get context(){return n()}})},ne=e=>{NN(e,{get node(){return t.node},get context(){return n()}})},re=e=>{FN(e,{get node(){return t.node}})},I=e=>{jN(e,{get node(){return t.node}})},L=e=>{Bj(e,{get node(){return t.node},get context(){return n()}})},ie=e=>{LN(e,{})},ae=e=>{{let i=P(()=>typeof n()?.showTooltips==`boolean`?n()?.showTooltips:void 0);zP(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()},get showTooltip(){return T(i)}})}},oe=e=>{JN(e,{get node(){return t.node}})},R=e=>{FP(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},z=e=>{pI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},B=e=>{ON(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},se=e=>{fI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},V=e=>{zN(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},H=e=>{IP(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},U=e=>{mI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},ce=e=>{hI(e,{get node(){return t.node},get context(){return n()},get indexKey(){return r()}})},le=e=>{qj(e,{get node(){return t.node}})},ue=e=>{EN(e,{get node(){return t.node}})},W=e=>{dI(e,{get node(){return t.node},get context(){return n()}})},de=e=>{var t=J(),i=K(t),a=e=>{yI(e,{get node(){return T(S)},get context(){return n()},get indexKey(){return r()}})},o=e=>{BN(e,{get node(){return T(g)},get context(){return n()}})};m(i,e=>{T(h)?e(a):e(o,-1)}),v(e,t)},q=e=>{var t=J(),i=K(t),a=e=>{yI(e,{get node(){return T(S)},get context(){return n()},get indexKey(){return r()}})},o=e=>{VN(e,{get node(){return T(g)},get context(){return n()}})};m(i,e=>{T(h)?e(a):e(o,-1)}),v(e,t)},fe=e=>{SI(e,{get node(){return t.node},get context(){return n()}})},pe=e=>{xI(e,{})},me=e=>{xF(e,{get node(){return t.node}})},he=e=>{vF(e,{get node(){return t.node}})},ge=e=>{var r=J(),i=K(r),a=e=>{cI(e,G({get node(){return t.node},get context(){return n()}},()=>T(u)))},o=e=>{CN(e,G({get node(){return t.node},get context(){return n()}},()=>T(u)))},s=e=>{bP(e,G({get node(){return t.node},get context(){return n()}},()=>T(u)))},c=e=>{FM(e,{get node(){return t.node},get showLineNumbers(){return T(y)},get style(){return T(x)}})},l=e=>{var r=J(),i=K(r);p(i,()=>T(_),e=>{{let r=P(()=>n()?.codeBlockOptions);ZM(e,G({get node(){return t.node},get context(){return n()}},()=>T(u),{get codeBlockOptions(){return T(r)}}))}}),v(e,r)};m(i,e=>{T(d)===`mermaid`?e(a):T(d)===`d2`?e(o,1):T(d)===`infographic`?e(s,2):T(d)===`pre`?e(c,3):e(l,-1)}),v(e,r)},Y=e=>{var t=jI();v(e,t)},_e=e=>{kN(e,{get node(){return t.node},get context(){return n()}})};m(E,e=>{T(c)?e(O):T(o)===`text`||T(o)===`text_special`?e(k,1):T(o)===`paragraph`?e(ee,2):T(o)===`heading`?e(A,3):T(o)===`blockquote`?e(j,4):T(o)===`list`?e(te,5):T(o)===`list_item`?e(M,6):T(o)===`table`?e(N,7):T(o)===`definition_list`?e(F,8):T(o)===`footnote`?e(ne,9):T(o)===`footnote_reference`?e(re,10):T(o)===`footnote_anchor`?e(I,11):T(o)===`admonition`?e(L,12):T(o)===`hardbreak`?e(ie,13):T(o)===`link`?e(ae,14):T(o)===`image`?e(oe,15):T(o)===`inline_code`?e(R,16):T(o)===`strong`?e(z,17):T(o)===`emphasis`?e(B,18):T(o)===`strikethrough`?e(se,19):T(o)===`highlight`?e(V,20):T(o)===`insert`?e(H,21):T(o)===`subscript`?e(U,22):T(o)===`superscript`?e(ce,23):T(o)===`checkbox`||T(o)===`checkbox_input`?e(le,24):T(o)===`emoji`?e(ue,25):T(o)===`reference`?e(W,26):T(o)===`html_block`?e(de,27):T(o)===`html_inline`?e(q,28):T(o)===`vmr_container`?e(fe,29):T(o)===`thematic_break`?e(pe,30):T(o)===`math_inline`?e(me,31):T(o)===`math_block`?e(he,32):T(o)===`code_block`?e(ge,33):T(o)===`label_open`||T(o)===`label_close`?e(Y,34):e(_e,-1)}),v(e,w),b()}function NI(e,n){let r=D(n,`nodes`,19,()=>[]),i=D(n,`context`,3,void 0),a=D(n,`prefix`,3,`child`);var o=J(),s=K(o);t(s,19,()=>r()||[],(e,t)=>a()+`-`+t,(e,t,n)=>{{let r=P(()=>a()+`-`+T(n));MI(e,{get node(){return T(t)},get context(){return i()},get indexKey(){return T(r)}})}}),v(e,o)}var PI=r(`<blockquote class="blockquote blockquote-node" dir="auto"><!></blockquote>`);function FI(e,t){i(t,!0);let r=D(t,`context`,3,void 0),a=D(t,`indexKey`,3,void 0),o=P(()=>LA(t.node?.cite));var s=PI(),c=U(s);{let e=P(()=>IA(t.node?.children)),n=P(()=>String(a()??`blockquote`)+`-blockquote`);NI(c,{get nodes(){return T(e)},get context(){return r()},get prefix(){return T(n)}})}n(s),V(()=>{z(s,`cite`,T(o)||void 0),s.dir=s.dir}),v(e,s),b()}var II=0,LI=new WeakMap,RI={N1:`#E5E7EB`,N2:`#CBD5E1`,N3:`#94A3B8`,N4:`#64748B`,N5:`#475569`,N6:`#334155`,N7:`#0B1220`,B1:`#60A5FA`,B2:`#3B82F6`,B3:`#2563EB`,B4:`#1D4ED8`,B5:`#1E40AF`,B6:`#111827`,AA2:`#22D3EE`,AA4:`#0EA5E9`,AA5:`#0284C7`,AB4:`#FBBF24`,AB5:`#F59E0B`},zI={cjs:`javascript`,cts:`typescript`,d2lang:`plaintext`,js:`javascript`,jsonc:`json`,jsx:`javascript`,md:`markdown`,mjs:`javascript`,sh:`shell`,text:`plaintext`,ts:`typescript`,tsx:`typescript`,txt:`plaintext`,vue:`html`,yml:`yaml`};async function BI(e,t={}){VI(e);let n=[],r=!1,i=()=>!r&&t.isCancelled?.call(t)!==!0,a={dispose:()=>{var t;if(!r){r=!0;for(let e=n.length-1;e>=0;--e)try{(t=n[e])==null||t.call(n)}catch{}LI.get(e)===a&&LI.delete(e)}}};return LI.set(e,a),!i()||(await qI(e,i),!i())||(await YI(e,n,t,i),!i())||t.final!==!1&&(await tL(e,n,t,i),!i()||(await nL(e,n,t,i),!i())||(t.renderCodeBlocksAsPre||await rL(e,n,t,i),!i()))||!i()||(hL(e,n),!i())||mL(e,n,t),a}function VI(e){e&&LI.get(e)?.dispose()}function HI(e,t){let n=e.querySelector(t);return{sourceElement:n,source:(n?.textContent||(n?``:e.textContent)||``).trim()}}function UI(e,t){return e.querySelector(t)}function WI(e,t){return!!(UI(e,t)||e).querySelector(`.katex, .katex-display`)}function GI(e,t,n,r={}){t?t.innerHTML=n:e.innerHTML=n,e.dataset.markstreamKatex=`1`,r.renderedClass&&e.classList.add(r.renderedClass)}function KI(e,t,n={}){t&&(t.innerHTML=``),delete e.dataset.markstreamKatex,delete e.dataset.markstreamKatexSource,n.renderedClass&&e.classList.remove(n.renderedClass)}async function qI(e,t){let n=Array.from(e.querySelectorAll(`.markstream-nested-math`));for(let e of n){if(!t())return;if(e.dataset.markstreamKatexManaged===`1`)continue;let{source:n}=HI(e,`.markstream-nested-math__source`),r=UI(e,`.markstream-nested-math__render`);if(!n){KI(e,r);continue}if(!(e.dataset.markstreamKatex===`1`&&e.dataset.markstreamKatexSource===n&&WI(e,`.markstream-nested-math__render`)))try{GI(e,r,await JI(n,e.dataset.display===`block`)),e.dataset.markstreamKatexSource=n}catch{KI(e,r)}}let r=Array.from(e.querySelectorAll(`.markstream-nested-math-block`));for(let e of r){if(!t())return;if(e.dataset.markstreamKatexManaged===`1`)continue;let{source:n}=HI(e,`.markstream-nested-math-block__source`),r=UI(e,`.markstream-nested-math-block__render`);if(!n){KI(e,r,{renderedClass:`markstream-nested-math-block--rendered`});continue}if(!(e.dataset.markstreamKatex===`1`&&e.dataset.markstreamKatexSource===n&&WI(e,`.markstream-nested-math-block__render`)))try{GI(e,r,await JI(n,!0),{renderedClass:`markstream-nested-math-block--rendered`}),e.dataset.markstreamKatexSource=n}catch{KI(e,r,{renderedClass:`markstream-nested-math-block--rendered`})}}}async function JI(e,t){let n=eF(e);try{return await gF(n,t,{timeout:1500,waitTimeout:0,maxRetries:0})}catch(e){let t=e?.code||e?.name;if(!(t===`WORKER_INIT_ERROR`||e?.fallbackToRenderer)&&t!==`WORKER_BUSY`&&t!==`WORKER_TIMEOUT`)throw e}let r=await $P();if(!r)throw Error(`KaTeX renderer is not available.`);let i=r.renderToString(n,{displayMode:t,throwOnError:!1});return fF(n,t,i),i}async function YI(e,t,n,r){var i;let a=n.mermaidProps?.isStrict!==!1,o=await IF({startOnLoad:!1,securityLevel:a?`strict`:`loose`,suppressErrorRendering:!0,...a?{flowchart:{htmlLabels:!1}}:{}});if(!o||!r())return;let s=Array.from(e.querySelectorAll(`pre > code.language-mermaid`));for(let e of s){if(!r())return;let a=e.parentElement,s=(e.textContent||``).trim();if(!a||!s)continue;let c=a.cloneNode(!0),l=fL(`mermaid`,`Mermaid`,s,!0,n,{showHeader:n.mermaidProps?.showHeader!==!1});a.replaceWith(l.wrapper);try{let e=n.isDark?`dark`:`light`,a=s;if(n.final===!1)try{await ZI(s,e,o,n)}catch(t){if(t?.name===`AbortError`)return;let i=await QI(s,e,n);if(!r())return;if(!i){l.wrapper.replaceWith(c);continue}a=i}let u=`markstream-svelte-mermaid-${++II}`,d=await eL(()=>Promise.resolve(o.render(u,XI(a,e))),n.final===!1?Number(n.mermaidProps?.renderTimeoutMs??2500):Number(n.mermaidProps?.fullRenderTimeoutMs??4e3));if(!r())return;let f=typeof d==`string`?d:d?.svg;if(!f)continue;let p=vA(f);if(!p)continue;if(l.body.innerHTML=p,l.body.classList.add(`markstream-svelte-mermaid`),l.wrapper.dataset.markstreamMermaid=`1`,n.mermaidProps?.enableMermaidInteractions===!0&&typeof d!=`string`)try{(i=d?.bindFunctions)==null||i.call(d,l.body)}catch{}t.push(()=>{l.wrapper.isConnected&&l.wrapper.replaceWith(c.cloneNode(!0))})}catch{l.wrapper.replaceWith(c)}}}function XI(e,t){return e.trimStart().startsWith(`%%{`)?e:`%%{init: {"theme": "${t===`dark`?`dark`:`default`}"}}%%\n${e}`}async function ZI(e,t,n,r){let i=Number(r.mermaidProps?.workerTimeoutMs??1400),a=Number(r.mermaidProps?.parseTimeoutMs??1800);try{if(await WF(e,t,i))return!0}catch(e){if(e?.name===`AbortError`)throw e}let o=XI(e,t);if(typeof n?.parse==`function`)return await eL(()=>Promise.resolve(n.parse(o)),a),!0;let s=`markstream-svelte-mermaid-parse-${++II}`;return await eL(()=>Promise.resolve(n.render(s,o)),a),!0}async function QI(e,t,n){let r=Number(n.mermaidProps?.workerTimeoutMs??1400);try{let n=await GF(e,t,r);if(n)return n}catch(e){if(e?.name===`AbortError`)throw e}return $I(e)}function $I(e){let t=e.split(`
219
+ `);for(;t.length>0;){let e=t[t.length-1].trimEnd();if(!e){t.pop();continue}if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}return t.join(`
220
+ `)}function eL(e,t){return!t||t<=0?e():new Promise((n,r)=>{let i=!1,a=globalThis.setTimeout(()=>{i||(i=!0,r(Error(`Operation timed out`)))},t);e().then(e=>{i||(i=!0,clearTimeout(a),n(e))}).catch(e=>{i||(i=!0,clearTimeout(a),r(e))})})}async function tL(e,t,n,r){let i=Array.from(e.querySelectorAll(`pre[data-markstream-code-block="1"] > code.language-infographic`));if(!i.length)return;let a=await ZN();if(a&&r())for(let e of i){if(!r())return;let i=e.parentElement,o=e.textContent||``;if(!i||!o.trim())continue;let s=i.cloneNode(!0),c=fL(`infographic`,`Infographic`,o,!0,n,{showHeader:n.infographicProps?.showHeader!==!1});c.body.style.minHeight=`320px`,c.body.style.height=`360px`,i.replaceWith(c.wrapper);try{let e=new a({container:c.body,width:`100%`,height:`100%`});e.render(o);let n=null;typeof window<`u`&&typeof window.requestAnimationFrame==`function`&&(n=window.requestAnimationFrame(()=>{let e=c.body.scrollHeight;e>0&&(c.body.style.height=`${Math.min(Math.max(e,260),720)}px`)})),t.push(()=>{var t;n!=null&&typeof window<`u`&&window.cancelAnimationFrame(n),(t=e.destroy)==null||t.call(e),c.wrapper.isConnected&&c.wrapper.replaceWith(s.cloneNode(!0))}),c.wrapper.dataset.markstreamInfographic=`1`}catch{c.wrapper.replaceWith(s)}}}async function nL(e,t,n,r){let i=await rN();if(!i||!r())return;let a=Array.from(e.querySelectorAll(`pre[data-markstream-code-block="1"] > code.language-d2, pre[data-markstream-code-block="1"] > code.language-d2lang`));for(let e of a){if(!r())return;let a=e.parentElement,o=e.textContent||``;if(!a||!o.trim())continue;let s=a.cloneNode(!0),c=fL(`d2`,`D2`,o,!0,n,{showHeader:n.d2Props?.showHeader!==!1});a.replaceWith(c.wrapper);try{let e=iL(i);if(!e||typeof e.compile!=`function`||typeof e.render!=`function`)throw TypeError(`D2 instance is missing compile/render methods.`);let a=await e.compile(o),l=a?.diagram??a,u=a?.renderOptions??a?.options??{},d=n.d2ThemeId??u.themeID,f=n.d2DarkThemeId??u.darkThemeID,p={...u};if(p.themeID=n.isDark&&f!=null?f:d,p.darkThemeID=null,p.darkThemeOverrides=null,n.isDark){let e=u.themeOverrides&&typeof u.themeOverrides==`object`?u.themeOverrides:null;p.themeOverrides={...RI,...e||{}}}let m=await e.render(l,p);if(!r())return;let h=lN(uN(m));if(!h)throw Error(`D2 render returned empty output.`);c.body.innerHTML=h,c.wrapper.dataset.markstreamD2=`1`,t.push(()=>{c.wrapper.isConnected&&c.wrapper.replaceWith(s.cloneNode(!0))})}catch{c.wrapper.replaceWith(s)}}}async function rL(e,t,n,r){let i=Array.from(e.querySelectorAll(`pre[data-markstream-code-block="1"]`)),a=n.codeBlockOptions?.overflow===`scroll`?`pre`:`pre-wrap`,o=n.codeBlockOptions?.maxHeight;for(let e of i){let t=e.querySelector(`code`);if(!t)continue;let n=aL(e,t).trim().toLowerCase();n!==`mermaid`&&n!==`infographic`&&n!==`d2`&&n!==`d2lang`&&(e.style.whiteSpace=a,typeof o==`number`&&(e.style.maxHeight=`${o}px`,e.style.overflow=`auto`))}let s=await rM();if(s&&typeof s.createCodeBlockRuntime==`function`&&r())for(let e of i){if(!r())return;let i=e.querySelector(`code`);if(!i)continue;let a=aL(e,i),c=a.trim().toLowerCase();if(c===`mermaid`||c===`infographic`||c===`d2`||c===`d2lang`)continue;let l=i.textContent||``,u=e.dataset.markstreamDiff===`1`,d=dL(e.dataset.markstreamOriginal),f=dL(e.dataset.markstreamUpdated),p=oL(a),m=fL(`code`,u?`Diff / ${p}`:`Code / ${p}`,l,!1,n,{showHeader:n.codeBlockProps?.showHeader!==!1});m.body.classList.add(`markstream-svelte-enhanced-block__body--code`);let h=sL(u&&f||l,u);m.body.style.minHeight=`${typeof o==`number`?Math.min(h,o):h}px`,typeof o==`number`&&(m.body.style.maxHeight=`${o}px`,m.body.style.overflow=`auto`);let g=e.cloneNode(!0),_=null,v=!1,y=()=>{var e;if(!v){v=!0;try{(e=_?.cleanupEditor)==null||e.call(_)}catch{}m.wrapper.parentNode&&m.wrapper.replaceWith(g.cloneNode(!0))}};e.replaceWith(m.wrapper);let b={...n.codeBlockOptions??{}};for(let e of[`maxHeight`,`padding`,`tabSize`,`theme`,`themes`,`themeType`,`language`,`languages`,`stream`,`disableFileHeader`,`onThemeChange`,`renderCustomHeader`,`renderHeaderMetadata`,`renderHeaderPrefix`])delete b[e];let x=b.parseDiffOptions&&typeof b.parseDiffOptions==`object`?b.parseDiffOptions:{},S=u?{diffStyle:`split`,expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:`line-info`,...b,parseDiffOptions:{context:2,...x}}:b,C=n.codeBlockProps?.theme,w=[n.codeBlockProps?.darkTheme??n.codeBlockProps?.themes?.[0]??n.codeBlockDarkTheme??n.themes?.[0]??`vitesse-dark`,n.codeBlockProps?.lightTheme??n.codeBlockProps?.themes?.[1]??n.codeBlockLightTheme??n.themes?.[1]??`vitesse-light`],T=typeof C==`string`?C:C&&typeof C==`object`?n.isDark?C.dark:C.light:n.isDark?n.codeBlockProps?.darkTheme??n.codeBlockProps?.themes?.[0]??n.codeBlockDarkTheme??n.themes?.[0]??`vitesse-dark`:n.codeBlockProps?.lightTheme??n.codeBlockProps?.themes?.[1]??n.codeBlockLightTheme??n.themes?.[1]??`vitesse-light`,E=typeof S.unsafeCSS==`string`?S.unsafeCSS:``,D=n.codeBlockProps?.showLineNumbers??n.codeBlockOptions?.disableLineNumbers!==!0,O=()=>{m.body.style.setProperty(`--diffs-tab-size`,String(n.codeBlockOptions?.tabSize??4)),typeof n.codeBlockOptions?.padding==`number`?m.body.style.setProperty(`--diffs-gap-block`,`${n.codeBlockOptions.padding}px`):m.body.style.removeProperty(`--diffs-gap-block`)};O(),_=s.createCodeBlockRuntime({overflow:`wrap`,...S,themes:w,theme:T,themeType:n.isDark?`dark`:`light`,disableLineNumbers:!D,MAX_HEIGHT:n.codeBlockOptions?.maxHeight??500,fontSize:n.codeBlockOptions?.fontSize??13,lineHeight:n.codeBlockOptions?.lineHeight,fontFamily:n.codeBlockOptions?.fontFamily,unsafeCSS:`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }
221
+ ${E}`.trim(),disableFileHeader:!0,stream:!1,onThemeChange:O}),t.push(y);try{if(u&&typeof _.createDiffEditor==`function`?await _.createDiffEditor(m.body,d,f||l,p):await _.createEditor?.call(_,m.body,l,p),!r()){y();return}if(await _.setTheme?.call(_,T),!r()){y();return}if(await uL(),!r()){y();return}if(!cL(m.body,l))throw Error(`Code editor rendered no visible code content.`);m.wrapper.dataset.markstreamEnhanced=`1`,u&&(m.wrapper.dataset.markstreamEnhancedDiff=`1`)}catch{y()}}}function iL(e){if(typeof e==`function`){let t=new e;if(t&&typeof t.compile==`function`)return t;if(typeof e.compile==`function`)return e}return e?.D2&&typeof e.D2==`function`?new e.D2:typeof e?.compile==`function`?e:null}function aL(e,t){let n=e.dataset.markstreamLanguage?.trim();if(n)return n;let r=Array.from(t.classList).find(e=>e.startsWith(`language-`));return r?r.slice(9):`plaintext`}function oL(e){let t=e.trim().toLowerCase();return zI[t]||t||`plaintext`}function sL(e,t){let n=Math.max(1,e.split(`
222
+ `).length);return Math.min(520,(t?180:96)+n*(t?20:18))}function cL(e,t){let n=e.querySelector([`diffs-container`,`.stream-diffs-shell`,`[data-stream-diffs-state]`].join(`,`));if(!n)return!1;let r=n.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;let i=t.split(`
223
+ `).find(e=>e.trim())?.trim();if(!i)return!0;let a=lL(e.textContent||``),o=lL(i);return a.includes(o)}function lL(e){return e.replace(/\s+/g,``)}async function uL(){typeof window>`u`||typeof window.requestAnimationFrame!=`function`||await new Promise(e=>window.requestAnimationFrame(()=>e()))}function dL(e){if(!e)return``;let t=(globalThis==null?void 0:globalThis.require)?.call(globalThis,`buffer`)?.Buffer;if(t?.from)return t.from(e,`base64`).toString(`utf8`);if(typeof globalThis.atob==`function`&&typeof TextDecoder<`u`){let t=globalThis.atob(e),n=Uint8Array.from(t,e=>e.charCodeAt(0));return new TextDecoder().decode(n)}return``}function fL(e,t,n,r,i,a={}){let o=document.createElement(`div`);if(o.className=`markstream-svelte-enhanced-block markstream-svelte-enhanced-block--${e}`,a.showHeader!==!1){let e=document.createElement(`div`);e.className=`markstream-svelte-enhanced-block__header`;let r=document.createElement(`span`);r.className=`markstream-svelte-enhanced-block__badge`,r.textContent=t,e.appendChild(r),e.appendChild(pL(n,i)),o.appendChild(e)}let s=document.createElement(`div`);if(s.className=`markstream-svelte-enhanced-block__body`,o.appendChild(s),r){let e=document.createElement(`details`);e.className=`markstream-svelte-enhanced-block__details`;let t=document.createElement(`summary`);t.textContent=`Source`,e.appendChild(t);let r=document.createElement(`pre`);r.className=`markstream-svelte-enhanced-block__source`;let i=document.createElement(`code`);i.textContent=n,r.appendChild(i),e.appendChild(r),o.appendChild(e)}return{wrapper:o,body:s}}function pL(e,t){let n=document.createElement(`div`);n.className=`markstream-svelte-enhanced-block__actions`;let r=document.createElement(`button`);return r.type=`button`,r.className=`markstream-svelte-enhanced-block__action`,r.textContent=`Copy`,t.showTooltips!==!1&&(r.title=`Copy source`),r.addEventListener(`click`,()=>{var n;gL(e),(n=t.onCopy)==null||n.call(t,e)}),n.appendChild(r),n}function mL(e,t,n){if(n.showTooltips===!1)return;let r=Array.from(e.querySelectorAll(`[data-markstream-tooltip], [title]`));if(r.length!==0)for(let e of r){if(e.matches(`.footnote-link, .footnote-anchor`))continue;let r=e.getAttribute(`title`),i=(e.dataset.markstreamTooltip||r||``).trim();if(!i)continue;r!=null&&e.removeAttribute(`title`);let a=()=>mM(e,i,`top`,!1,void 0,n.isDark),o=()=>$();e.addEventListener(`mouseenter`,a),e.addEventListener(`focus`,a),e.addEventListener(`mouseleave`,o),e.addEventListener(`blur`,o),t.push(()=>{let t=e.getAttribute(`aria-describedby`)!=null;e.removeEventListener(`mouseenter`,a),e.removeEventListener(`focus`,a),e.removeEventListener(`mouseleave`,o),e.removeEventListener(`blur`,o),t&&$(!0),r!=null&&e.getAttribute(`title`)==null&&e.setAttribute(`title`,r)})}}function hL(e,t){let n=Array.from(e.querySelectorAll(`.footnote-reference .footnote-link[href^="#"]`));for(let e of n){let n=t=>{let n=e.getAttribute(`href`);n&&(t.preventDefault(),document.getElementById(n.slice(1))?.scrollIntoView({behavior:`smooth`,block:`start`}))};e.addEventListener(`click`,n),t.push(()=>e.removeEventListener(`click`,n))}}async function gL(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}}catch{}if(typeof document>`u`)return;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,`true`),t.style.position=`fixed`,t.style.opacity=`0`,t.style.pointerEvents=`none`,document.body.appendChild(t),t.select();try{document.execCommand(`copy`)}catch{}finally{t.remove()}}function _L(e={}){let t=typeof e==`function`?e():e,n=B(``),r=B(``),i=B(!1),a=B(0),o=B(!1),s=B(!1),c=DP(t),l=()=>{let e=c.getSnapshot();N(n,e.source,!0),N(r,e.visible,!0),N(i,e.done,!0),N(a,e.pendingChars,!0),N(o,e.caughtUp,!0),N(s,e.final,!0)},u=c.subscribe(l);return l(),se(()=>{u(),c.destroy()}),{get source(){return T(n)},get visible(){return T(r)},get done(){return T(i)},get caughtUp(){return T(o)},get final(){return T(s)},get pendingChars(){return T(a)},enqueue:e=>c.enqueue(e),finish:e=>c.finish(e),flush:()=>c.flush(),reset:e=>c.reset(e),pause:()=>c.pause(),resume:()=>c.resume()}}var vL=`markstreamSmoothStreaming`,yL=r(`<div class="node-slot"><div><!></div></div>`),bL=r(`<span class="typewriter-cursor" aria-hidden="true"></span>`),xL=r(`<div><!> <!></div>`);function SL(e,r){i(r,!0);let a=D(r,`content`,3,``),o=D(r,`nodes`,3,null),s=D(r,`final`,3,void 0),c=D(r,`parseOptions`,3,void 0),u=D(r,`customMarkdownIt`,3,void 0),d=D(r,`debugPerformance`,3,!1),f=D(r,`customHtmlTags`,3,void 0),p=D(r,`htmlPolicy`,3,`safe`),h=D(r,`viewportPriority`,3,!0),g=D(r,`codeBlockStream`,3,!0),y=D(r,`codeBlockDarkTheme`,3,void 0),x=D(r,`codeBlockLightTheme`,3,void 0),S=D(r,`renderCodeBlocksAsPre`,3,!1),C=D(r,`codeBlockMinWidth`,3,void 0),w=D(r,`codeBlockMaxWidth`,3,void 0),E=D(r,`codeBlockOptions`,3,void 0),O=D(r,`codeBlockProps`,3,void 0),k=D(r,`mermaidProps`,3,void 0),A=D(r,`d2Props`,3,void 0),j=D(r,`infographicProps`,3,void 0),te=D(r,`customComponents`,3,void 0),M=D(r,`showTooltips`,3,!0),F=D(r,`themes`,3,void 0),ne=D(r,`isDark`,3,!1),I=D(r,`customId`,3,void 0),L=D(r,`indexKey`,3,void 0),ie=D(r,`typewriter`,3,!1),ae=D(r,`fade`,3,!0),H=D(r,`batchRendering`,3,!0),ce=D(r,`initialRenderBatchSize`,3,40),le=D(r,`renderBatchSize`,3,80),G=D(r,`renderBatchDelay`,3,16),K=D(r,`renderBatchBudgetMs`,3,6),de=D(r,`renderBatchIdleTimeoutMs`,3,120),q=D(r,`deferNodesUntilVisible`,3,!0),fe=D(r,`maxLiveNodes`,3,320),he=D(r,`liveNodeBuffer`,3,60),J=D(r,`allowHtml`,3,!0),ge=D(r,`smoothStreaming`,3,`auto`),Y=D(r,`smoothStreamingOptions`,3,void 0),_e=D(r,`className`,3,``),ve=D(r,`onCopy`,3,void 0),ye=D(r,`onHandleArtifactClick`,3,void 0),be=D(r,`onClick`,3,void 0),xe=D(r,`onMouseover`,3,void 0),Se=D(r,`onMouseout`,3,void 0),Ce=B(null),we=B(0),Te=B(0),Ee=B(void 0),De=B(void 0),Oe=0,ke=null,Ae=B(0),je=null,Me=null,Ne=null,Pe=0,Fe=new Map,Ie=B(!1),Le=_L(()=>Y()),Re=P(()=>ge()===!0||T(Ie)),ze=P(()=>Array.isArray(o())),Be=ee(vL),Ve=P(()=>ge()===!1||T(ze)||ge()!==!0&&Be?.()?!1:ge()===!0||ie()===!0||(fe()??0)<=0),He=P(()=>T(Re)&&T(Ve));pe(vL,()=>T(He));let Ue=P(()=>T(He)?Le.visible:a()??``),We=P(()=>a()??``),Ge=P(()=>T(ze)||Le.source===T(We)),Ke=P(()=>{let e=c()??{};return s()??e.final}),qe=P(()=>T(He)&&T(Ke)!=null?!!(T(Ke)&&T(Ge)&&Le.caughtUp):T(Ke));ue(()=>{N(Ie,!0)}),W(()=>{let e=a()??``;if(T(ze)){Le.reset(``);return}if(!T(He)){Le.reset(e),T(Ke)&&Le.finish({flush:!0});return}let t=Le.source;e?e===t||(e.startsWith(t)?Le.enqueue(e.slice(t.length)):Le.reset(e)):Le.reset(``),T(Ke)&&Le.finish()});let Je=P(()=>({content:T(Ue),nodes:o(),final:T(qe),parseOptions:c(),customMarkdownIt:u(),debugPerformance:d(),customHtmlTags:f(),htmlPolicy:p(),viewportPriority:h(),codeBlockStream:g(),codeBlockDarkTheme:y(),codeBlockLightTheme:x(),renderCodeBlocksAsPre:S(),codeBlockMinWidth:C(),codeBlockMaxWidth:w(),codeBlockOptions:E(),codeBlockProps:O(),mermaidProps:k(),d2Props:A(),infographicProps:j(),customComponents:te(),showTooltips:M(),themes:F(),isDark:ne(),customId:I(),indexKey:L(),typewriter:ie(),fade:ae(),batchRendering:H(),initialRenderBatchSize:ce(),renderBatchSize:le(),renderBatchDelay:G(),renderBatchBudgetMs:K(),renderBatchIdleTimeoutMs:de(),deferNodesUntilVisible:q(),maxLiveNodes:fe(),liveNodeBuffer:he(),allowHtml:J(),smoothStreaming:ge(),smoothStreamingOptions:Y()}));re(()=>{(T(Ee)!==T(Ue)||T(De)!==o())&&(N(Te,T(Te)+1),N(Ee,T(Ue),!0),N(De,o()))});let Ye=P(()=>{let e=d()&&typeof performance<`u`?performance.now():0,t=FA(T(Je));return d()&&typeof console<`u`&&typeof performance<`u`&&console.info(`[markstream-svelte][perf] parse(sync)`,{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:T(Ue)?.length??0}),t}),Xe=P(()=>{T(we);let e=Gj(I()),t=te()?{...e,...te()}:e;return PA({...T(Je),customComponents:t},{onCopy:ve(),onHandleArtifactClick:ye()},Fe,T(Te))});W(()=>{T(Ye).length,H(),ce(),le(),G(),K(),de(),T(qe),T(Ae),$e()});let Ze=P(()=>T(Ye).slice(0,Math.min(T(Ae),T(Ye).length)));W(()=>{T(Ce),T(qe),T(Ye),T(Ze),ne(),S(),E(),O(),y(),x(),F(),k(),A(),j(),M(),ve(),nt()}),ue(()=>Wj(()=>{N(we,T(we)+1)})),se(()=>{Oe+=1,tt(),ke?.dispose(),ke=null,VI(T(Ce)),pt()});function Qe(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function $e(){let e=T(Ye).length,t=Math.min(e,Qe(ce(),40));if(!(T(qe)!==!1&&H()!==!1&&e>t)){tt(),T(Ae)!==e&&N(Ae,e,!0);return}(T(Ae)<=0||T(Ae)>e||T(Ae)<t)&&N(Ae,t,!0),et()}function et(){if(T(Ae)>=T(Ye).length||je||Me!=null||Ne!=null)return;let e=++Pe,t=Math.max(0,Number(G())||0),n=t=>{if(je=null,Me=null,Ne=null,e!==Pe)return;let n=Qe(le(),80),r=Math.max(2,Qe(K(),6)),i=T(Ae);do if(i=Math.min(T(Ye).length,i+n),!t||(typeof t.timeRemaining==`function`?t.timeRemaining():0)<=r*.5)break;while(i<T(Ye).length);i!==T(Ae)&&N(Ae,i,!0)},r=typeof window<`u`?window.requestIdleCallback:void 0;if(r){Ne=r(n,{timeout:Math.max(0,Number(de())||120)});return}if(typeof window<`u`&&typeof window.requestAnimationFrame==`function`){Me=window.requestAnimationFrame(()=>{Me=null,t>0?je=setTimeout(n,t):n()});return}je=setTimeout(n,t)}function tt(){Pe+=1,je&&=(clearTimeout(je),null),Me!=null&&typeof window<`u`&&(window.cancelAnimationFrame(Me),Me=null);let e=typeof window<`u`?window.cancelIdleCallback:void 0;Ne!=null&&(e?.(Ne),Ne=null)}async function nt(){if(!T(Ce)||typeof window>`u`)return;let e=typeof T(qe)==`boolean`?T(qe):!rt(T(Ye));if(!e){Oe+=1,ke?.dispose(),ke=null;return}let t=++Oe;if(await _(),t!==Oe||!T(Ce))return;ke?.dispose();let n=await BI(T(Ce),{final:e,isDark:ne(),renderCodeBlocksAsPre:S(),codeBlockOptions:E(),codeBlockProps:O(),codeBlockDarkTheme:y(),codeBlockLightTheme:x(),themes:F(),mermaidProps:k(),d2Props:A(),infographicProps:j(),showTooltips:M(),onCopy:ve(),isCancelled:()=>t!==Oe});if(t!==Oe){n.dispose();return}ke=n}function rt(e){for(let t of e)if(t?.loading===!0||rt(t?.children||[])||rt(t?.items||[]))return!0;return!1}let it=B(null),at=B(!1),ot,st=0,ct=new Set([`code_block`,`admonition`,`table`,`math_block`,`html_block`,`image`]);function lt(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return typeof t==`string`&&ct.has(t)}function ut(){let e=T(Ye)[T(Ye).length-1];return!lt(e)}function dt(e){if(!e||typeof e!=`object`)return 0;let t=e,n=t.raw??t.content??t.code;if(typeof n==`string`)return n.length;let r=t.children;if(Array.isArray(r))return r.reduce((e,t)=>e+dt(t),0);let i=t.items;return Array.isArray(i)?i.reduce((e,t)=>e+dt(t),0):0}function ft(){return o()?.length?o().reduce((e,t)=>e+dt(t),0):(a()??``).length}function pt(){ot&&=(clearTimeout(ot),void 0)}function mt(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){if(!(e.textContent??``).trim())return NodeFilter.FILTER_REJECT;let t=e.parentElement;return!t||t.closest(`.typewriter-cursor, .height-estimation-probes, [data-node-type="code_block"], [data-node-type="admonition"], [data-node-type="table"], [data-node-type="math_block"], [data-node-type="html_block"], [data-node-type="image"], script, style`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),n=null,r=t.nextNode();for(;r;)n=r,r=t.nextNode();return n}function ht(){if(typeof window>`u`||!T(at)||!T(Ce)||!T(it))return;let e=T(Ce),t=T(it),n=mt(e),r=e.getBoundingClientRect(),i=0,a=0,o=20;if(n?.textContent){let t=document.createRange(),s=n.textContent.length;t.setStart(n,Math.max(0,s-1)),t.setEnd(n,s);let c=typeof t.getClientRects==`function`?t.getClientRects():void 0,l=c?.[c.length-1]??n.parentElement?.getBoundingClientRect();l&&(i=l.right-r.left+e.scrollLeft,a=l.top-r.top+e.scrollTop,o=l.height||o),t.detach()}t.style.transform=`translate(${Math.max(0,i)}px, ${Math.max(0,a)}px)`,t.style.height=`${o}px`}W(()=>{if(T(Ue),o(),ie(),T(Ye).length,T(qe),typeof window>`u`||T(ze))return;if(T(qe)){N(at,!1),pt();return}let e=ft(),t=ut();if(ie()===!1||!t||e<=st){(ie()===!1||!t)&&N(at,!1),st=e;return}st=e,N(at,!0),pt(),_().then(()=>{ht()}),ot=setTimeout(()=>{N(at,!1)},3e3)}),W(()=>{T(at)&&_().then(()=>{ht()})});function gt(e){e.target?.closest(`[data-node-index]`)&&xe()?.(e)}function _t(e){e.target?.closest(`[data-node-index]`)&&Se()?.(e)}var vt=xL();let yt;var bt=U(vt);t(bt,19,()=>T(Ze),(e,t)=>(L()==null?`markdown-renderer`:String(L()))+`-`+t,(e,t,r)=>{var i=yL(),a=U(i);let o;var s=U(a);{let e=P(()=>(L()==null?`markdown-renderer`:String(L()))+`-`+T(r));MI(s,{get node(){return T(t)},get context(){return T(Xe)},get indexKey(){return T(e)}})}n(a),n(i),V((e,n)=>{z(i,`data-node-index`,T(r)),z(i,`data-node-type`,T(t)?.type),o=me(a,1,`node-content`,null,o,{"fade-node":e,"typewriter-node":n}),z(a,`data-node-index`,T(r))},[()=>ae()!==!1&&String(T(t)?.type||``)!==`code_block`,()=>ae()!==!1&&String(T(t)?.type||``)!==`code_block`]),v(e,i)});var xt=R(bt,2),St=e=>{var t=bL();oe(t,e=>N(it,e),()=>T(it)),v(e,t)};m(xt,e=>{T(at)&&e(St)}),n(vt),oe(vt,e=>N(Ce,e),()=>T(Ce)),V(()=>{yt=me(vt,1,`markstream-svelte markdown-renderer ${_e()??``}`,null,yt,{dark:ne()}),z(vt,`data-custom-id`,I())}),l(`click`,vt,function(...e){be()?.apply(this,e)}),l(`mouseover`,vt,gt),l(`mouseout`,vt,_t),v(e,vt),b()}w([`click`,`mouseover`,`mouseout`]);var CL=r(`<button type="button"><span class="flex items-center gap-1 text-xs font-medium"> </span> <span class="mt-0.5 block text-[10px] leading-snug text-muted-foreground"> </span></button>`),wL=r(`<div class="flex h-full flex-col items-center justify-center gap-3 text-center"><p class="max-w-[280px] text-xs text-muted-foreground">Pick a way to work with your skill library:</p> <div class="w-full max-w-[300px] space-y-1.5"></div></div>`),TL=r(`<div class="flow-item flex h-6 items-center gap-2 text-xs uppercase tracking-wide text-muted-foreground"><span class="h-px flex-1 bg-border"></span> <span class="h-px flex-1 bg-border"></span></div>`),EL=r(`<span class="turn-pill"> </span>`),DL=r(`<div class="flow-item flex h-5 items-center gap-1.5"><!></div>`),OL=r(`<div class="flow-item flex h-6 items-center gap-2 text-xs text-muted-foreground" role="separator"><span class="h-px flex-1 bg-border"></span> <span class="rounded bg-muted px-1 text-[10px] uppercase">mode</span> <span class="h-px flex-1 bg-border"></span></div>`),kL=r(`<div class="flow-item px-1 text-[11px] text-muted-foreground"> </div>`),AL=r(`<div class="flow-item flex h-6 items-center gap-2 px-3 text-[10px] text-muted-foreground" role="note"><span class="h-px flex-1 bg-border"></span> <span class="rounded bg-muted px-1 text-[10px] uppercase">compact</span> <span class="truncate"> </span> <span class="h-px flex-1 bg-border"></span></div>`),jL=r(`<div class="flow-item flex h-6 items-center gap-2 px-3 text-[10px] text-muted-foreground" role="status"><span class="h-px flex-1 bg-border"></span> <!> <span class="rounded bg-muted px-1 uppercase">agent</span> <span class="truncate"> </span> <span class="rounded bg-primary/10 px-1 text-primary"> </span> <span class="h-px flex-1 bg-border"></span></div>`),ML=r(`<img alt="" class="h-16 w-16 rounded-xl border border-border object-cover"/>`),NL=r(`<div class="mb-1 flex flex-wrap justify-end gap-1"></div>`),PL=r(`<span class="flex items-center gap-1 rounded-md border border-border bg-muted/40 px-1.5 py-0.5 text-[10px]"><!> <span class="max-w-40 truncate"> </span></span>`),FL=r(`<div class="bubble-user max-h-40 overflow-y-auto px-3.5 py-2 text-[13px] leading-5 whitespace-pre-wrap"> </div>`),IL=r(`<div class="flow-item group/msg ml-auto max-w-[85%]"><!> <!> <!> <div role="toolbar" aria-label="Message actions"><button type="button" class="flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground" title="Copy" aria-label="Copy message"><!></button> <button type="button" class="flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground" title="Edit &amp; resend — resends as a new message, keeps history" aria-label="Edit and resend — resends as a new message, keeps history"><!></button> <button type="button" class="flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-50" title="Resend — keeps history" aria-label="Resend message — keeps history"><!></button></div></div>`),LL=r(`<div class="mt-1 max-h-48 overflow-y-auto rounded-md px-2 pb-1 text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground"> </div>`),RL=r(`<div class="flow-item"><!> <!></div>`),zL=r(`<div class="flow-item group/msg max-w-full"><div class="ms-md msg-body max-w-full [&amp;_a]:text-primary svelte-1fhja6f"><!></div> <div role="toolbar" aria-label="Message actions"><button type="button" class="flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground" title="Copy" aria-label="Copy message"><!></button></div></div>`),BL=r(`<div class="flow-item"><!></div>`),VL=r(`<div class="flow-item flex h-6 items-center" role="status"><span class="sweep rounded-md px-1 text-xs text-muted-foreground"> </span></div>`),HL=r(`<!> <!>`,1),UL=r(`<button type="button" class="absolute top-3 right-3 z-10 flex h-7 w-7 items-center justify-center rounded-full border border-border bg-popover text-muted-foreground shadow-md transition-colors hover:text-foreground" title="Back to bottom" aria-label="Back to bottom"><!></button>`),WL=r(`<div class="relative min-h-0 flex-1"><div class="h-full overflow-y-auto px-4 py-3"><!></div> <!></div>`);function GL(e,r){i(r,!0);let a=B(null),o=B(de({})),s=B(null),u=B(!1),d=0;W(()=>{Q.items.length,Q.status;let e=T(a);if(!e)return;let t=()=>{let t=d-e.scrollTop-e.clientHeight<160;d=e.scrollHeight,(t||e.scrollHeight-e.scrollTop-e.clientHeight<160)&&(e.scrollTop=e.scrollHeight),N(u,e.scrollHeight-e.scrollTop-e.clientHeight>200)};t();let n=new ResizeObserver(t);for(let t of e.children)n.observe(t);return()=>n.disconnect()});let p=B(0);W(()=>{if(Q.status!==`running`){N(p,0);return}let e=()=>{let e=Q.turnStartedAt?Date.parse(Q.turnStartedAt):NaN;N(p,Number.isFinite(e)?Math.max(0,(Date.now()-e)/1e3):0,!0)};e();let t=setInterval(e,1e3);return()=>clearInterval(t)});async function h(e,t){try{await navigator.clipboard.writeText(e),N(s,t,!0),setTimeout(()=>{T(s)===t&&N(s,null)},1e3)}catch{ht(`Copy failed — clipboard unavailable.`)}}function g(e){jn(e),document.querySelector(`aside[aria-label="Agent panel"] textarea`)?.focus()}function _(e){Q.sending||Hn(e)}let y=P(()=>{for(let e=Q.items.length-1;e>=0;e--){let t=Q.items[e];if(t?.kind===`user`)return t.seq}return null}),x=P(()=>{for(let e=Q.items.length-1;e>=0;e--){let t=Q.items[e];if(t?.kind===`assistant`)return t.seq}return null});function S(e,t){let n=e.trim();if(n.length===0)return``;let r=n.split(`
224
+ `).filter(e=>e.trim().length>0);if(r.length===0)return``;let i=t?r[r.length-1]:r[0];return i.length>96?`${i.slice(0,96)}…`:i}function C(e){return Ue.find(t=>t.id===e)?.label??e}function w(e){return[e.usage?`↑ ${uu(e.usage.inputTokens)}`:``,e.usage?`↓ ${uu(e.usage.outputTokens)}`:``,e.elapsedMs===void 0?``:du(e.elapsedMs)].filter(e=>e.length>0)}function E(e){N(o,{...T(o),[e]:!(T(o)[e]??!1)},!0)}function D(){let e=T(a);e&&(e.scrollTop=e.scrollHeight)}var O=WL(),k=U(O),ee=U(k),A=e=>{var r=wL(),i=R(U(r),2);t(i,21,()=>Ue,e=>e.id,(e,t)=>{var r=CL(),i=U(r),a=j(i,!0),o=R(i,2),s=j(o,!0);n(r),V(()=>{me(r,1,`w-full rounded-md border p-2 text-left transition-colors ${Q.pendingMode===T(t).id?`border-primary/60 bg-primary/5`:`border-border hover:border-primary/50 hover:bg-primary/5`}`),z(r,`aria-pressed`,Q.pendingMode===T(t).id),r.disabled=Q.sending,c(a,T(t).label),c(s,T(t).description)}),l(`click`,r,()=>Q.pendingMode=T(t).id),v(e,r)}),n(i),n(r),v(e,r)},te=e=>{var r=HL(),i=K(r);t(i,17,()=>Q.items,e=>e.seq,(e,r)=>{var i=J(),a=K(i),u=e=>{var t=TL(),i=R(U(t));ae(),n(t),V(()=>c(i,` ${T(r).label??`Turn`??``} `)),v(e,t)},d=e=>{var t=DL(),i=U(t),a=e=>{var t=EL(),n=j(t,!0);V(e=>c(n,e),[()=>w(T(r)).join(` · `)]),v(e,t)},o=P(()=>w(T(r)).length>0),s=e=>{var t=EL(),n=j(t,!0);V(()=>c(n,T(r).reason)),v(e,t)};m(i,e=>{T(o)?e(a):e(s,-1)}),n(t),V(()=>z(t,`title`,T(r).reason)),v(e,t)},f=e=>{var t=OL(),i=R(U(t),3);ae(),n(t),V((e,n,r)=>{z(t,`aria-label`,e),c(i,` ${n??``} → ${r??``} `)},[()=>`Mode switched from ${C(T(r).from)} to ${C(T(r).to)}`,()=>C(T(r).from),()=>C(T(r).to)]),v(e,t)},p=e=>{var t=kL(),n=j(t,!0);V(()=>c(n,T(r).text)),v(e,t)},b=e=>{var t=AL(),i=R(U(t),4),a=j(i,!0);ae(2),n(t),V(()=>c(a,T(r).text)),v(e,t)},D=e=>{var t=jL(),i=R(U(t),2);rt(i,{class:`h-3 w-3 shrink-0`,"aria-hidden":`true`});var a=R(i,4),o=j(a,!0),s=R(a,2),l=j(s,!0);ae(2),n(t),V(()=>{z(t,`aria-label`,`Subagent spawned: ${T(r).label} (${T(r).mode})`),c(o,T(r).label),c(l,T(r).mode)}),v(e,t)},O=e=>{var i=IL(),a=U(i),o=e=>{var i=NL();t(i,21,()=>T(r).images,I,(e,t)=>{var n=ML();V(()=>z(n,`src`,T(t))),v(e,n)}),n(i),v(e,i)};m(a,e=>{T(r).images&&T(r).images.length>0&&e(o)});var u=R(a,2),d=e=>{var i=NL();t(i,21,()=>T(r).files,I,(e,t)=>{var i=PL(),a=U(i),o=e=>{fl(e,{class:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})},s=P(()=>T(r).imageChipNames?.includes(T(t))),l=e=>{ul(e,{class:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`})};m(a,e=>{T(s)?e(o):e(l,-1)});var u=R(a,2),d=j(u,!0);n(i),V(()=>c(d,T(t))),v(e,i)}),n(i),v(e,i)};m(u,e=>{T(r).files&&T(r).files.length>0&&e(d)});var f=R(u,2),p=e=>{var t=FL(),n=j(t,!0);V(()=>c(n,T(r).text)),v(e,t)};m(f,e=>{T(r).text.length>0&&e(p)});var b=R(f,2),x=U(b),S=U(x),C=e=>{vn(e,{class:`h-3.5 w-3.5 text-primary`})},w=e=>{cl(e,{class:`h-3.5 w-3.5`})};m(S,e=>{T(s)===T(r).seq?e(C):e(w,-1)}),n(x);var E=R(x,2),D=U(E);we(D,{class:`h-3.5 w-3.5`}),n(E);var O=R(E,2),k=U(O);wn(k,{class:`h-3.5 w-3.5`}),n(O),n(b),n(i),V(()=>{me(b,1,`mt-0.5 flex h-5 justify-end gap-0.5 transition-opacity ${T(r).seq===T(y)?`opacity-100`:`opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100`}`),O.disabled=Q.sending}),l(`click`,x,()=>void h(T(r).text,T(r).seq)),l(`click`,E,()=>g(T(r).text)),l(`click`,O,()=>_(T(r).text)),v(e,i)},k=e=>{var t=RL(),i=U(t);{let e=P(()=>S(T(r).text,T(r).streaming)),t=P(()=>T(r).streaming?!0:T(o)[T(r).seq]??!1);Al(i,{get icon(){return Cn},title:`Thinking`,get summary(){return T(e)},get open(){return T(t)},get running(){return T(r).streaming},onToggle:()=>E(T(r).seq)})}var a=R(i,2),s=e=>{var t=LL(),n=j(t,!0);V(()=>c(n,T(r).text)),v(e,t)};m(a,e=>{(T(r).streaming||T(o)[T(r).seq])&&e(s)}),n(t),v(e,t)},ee=e=>{var t=zL(),i=U(t),a=U(i);{let e=P(()=>!T(r).streaming);SL(a,{get content(){return T(r).text},htmlPolicy:`escape`,get final(){return T(e)}})}n(i);var o=R(i,2),c=U(o),u=U(c),d=e=>{vn(e,{class:`h-3.5 w-3.5 text-primary`})},f=e=>{cl(e,{class:`h-3.5 w-3.5`})};m(u,e=>{T(s)===T(r).seq?e(d):e(f,-1)}),n(c),n(o),n(t),V(()=>me(o,1,`mt-0.5 flex h-5 gap-0.5 transition-opacity ${T(r).seq===T(x)?`opacity-100`:`opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100`}`)),l(`click`,c,()=>void h(T(r).text,T(r).seq)),v(e,t)},A=e=>{{let t=P(()=>T(r).phase===`calling`&&Q.status===`running`);lu(e,{get toolName(){return T(r).toolName},get argsText(){return T(r).argsText},get result(){return T(r).result},get phase(){return T(r).phase},get running(){return T(t)},get startedAt(){return T(r).startedAt},get endedAt(){return T(r).endedAt}})}},te=e=>{var t=BL();Cl(U(t),{get seq(){return T(r).seq},get questions(){return T(r).questions},get resolved(){return T(r).resolved}}),n(t),v(e,t)};m(a,e=>{T(r).kind===`turn`?e(u):T(r).kind===`turn-end`?e(d,1):T(r).kind===`mode`?e(f,2):T(r).kind===`status`?e(p,3):T(r).kind===`note`?e(b,4):T(r).kind===`subagent`?e(D,5):T(r).kind===`user`?e(O,6):T(r).kind===`reasoning`?e(k,7):T(r).kind===`assistant`?e(ee,8):T(r).kind===`tool`?e(A,9):T(r).kind===`approval`&&e(te,10)}),v(e,i)});var a=R(i,2),u=e=>{var t=VL(),r=U(t),i=j(r);n(t),V(e=>c(i,`Working${e??``}`),[()=>T(p)>=15?` · ${Math.floor(T(p))}s`:``]),v(e,t)};m(a,e=>{Q.status===`running`&&e(u)}),v(e,r)};m(ee,e=>{Q.sessionId?e(te,-1):e(A)}),n(k),oe(k,e=>N(a,e),()=>T(a));var M=R(k,2),F=e=>{var t=UL();ml(U(t),{class:`h-3.5 w-3.5`}),n(t),l(`click`,t,D),v(e,t)};m(M,e=>{T(u)&&Q.sessionId&&e(F)}),n(O),f(`scroll`,k,e=>{let t=e.currentTarget;N(u,t.scrollHeight-t.scrollTop-t.clientHeight>200)}),v(e,O),b()}w([`click`]);var KL=new Set([`$$slots`,`$$events`,`$$legacy`]);function qL(e,t){let n=H(t,KL),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M12 12v6`}],[`path`,{d:`m15 15-3-3-3 3`}]];ve(e,G({name:`file-up`},()=>n,{get iconNode(){return r}}))}var JL=r(`<div class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-primary/5 backdrop-blur-[1px]" role="status" aria-label="Drop files to attach"><div class="flex flex-col items-center gap-2 rounded-2xl border-2 border-dashed border-primary/50 bg-background/90 px-8 py-6 shadow-lg"><!> <p class="text-sm font-medium text-foreground">Drop to attach</p> <p class="text-xs text-muted-foreground">Images and files go to this message</p></div></div>`);function YL(e,t){i(t,!0);let r=B(!1),a=0;function o(e){return[...e.dataTransfer?.types??[]].includes(`Files`)}ue(()=>{let e=e=>{o(e)&&(e.preventDefault(),a+=1,N(r,!0))},t=e=>{o(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))},n=e=>{o(e)&&(a=Math.max(0,a-1),a===0&&N(r,!1))},i=e=>{o(e)&&(e.preventDefault(),a=0,N(r,!1),Pn(e))};return document.addEventListener(`dragenter`,e),document.addEventListener(`dragover`,t),document.addEventListener(`dragleave`,n),document.addEventListener(`drop`,i),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragover`,t),document.removeEventListener(`dragleave`,n),document.removeEventListener(`drop`,i)}});var s=J(),c=K(s),l=e=>{var t=JL(),r=U(t);qL(U(r),{class:`h-7 w-7 text-primary`,"aria-hidden":`true`}),ae(4),n(r),n(t),v(e,t)};m(c,e=>{T(r)&&e(l)}),v(e,s),b()}var XL=r(`<li><span aria-hidden="true"></span> <span class="min-w-0 break-words"> </span></li>`),ZL=r(`<ul class="mt-1 max-h-40 space-y-0.5 overflow-y-auto rounded-lg border border-border bg-card px-2 py-1.5 shadow-sm"></ul>`),QL=r(`<div class="mx-3 mb-1.5 shrink-0"><button type="button" class="disclosure-row disclosure-row-tall w-full rounded-lg border border-border bg-card px-2 shadow-sm" aria-label="Tasks"><span class="flex items-center justify-center text-muted-foreground" aria-hidden="true"><!></span> <span class="truncate text-left font-medium text-foreground">Tasks</span> <span class="text-center text-muted-foreground/70" aria-hidden="true">·</span> <span class="disclosure-summary tabular-nums"> </span> <!></button> <!></div>`);function $L(e,r){let i=B(!1),a=P(()=>{let e=0,t=0,n=0;for(let i of r.todos)i.status===`completed`?e+=1:i.status===`in_progress`?t+=1:n+=1;return{done:e,active:t,pending:n}});var o=QL(),s=U(o),u=U(s),d=U(u);ar(d,{class:`h-3.5 w-3.5`}),n(u);var f=R(u,6),p=j(f),h=R(f,2);or(h,{class:`disclosure-chevron h-3.5 w-3.5 shrink-0 text-muted-foreground`}),n(s);var g=R(s,2),_=e=>{var i=ZL();t(i,21,()=>r.todos,I,(e,t)=>{var r=XL(),i=U(r),a=R(i,2),o=j(a,!0);n(r),V(()=>{me(r,1,`flex items-start gap-1.5 text-xs ${T(t).status===`completed`?`text-muted-foreground line-through`:``}`),me(i,1,`mt-[3px] h-3 w-3 shrink-0 rounded-full border-2 ${T(t).status===`completed`?`border-primary bg-primary/20`:T(t).status===`in_progress`?`border-primary`:`border-muted-foreground/50`}`),c(o,T(t).content)}),v(e,r)}),n(i),v(e,i)};m(g,e=>{T(i)&&e(_)}),n(o),V(()=>{z(s,`data-open`,T(i)),z(s,`aria-expanded`,T(i)),c(p,`done ${T(a).done??``} · active ${T(a).active??``} · pending ${T(a).pending??``}`)}),l(`click`,s,()=>N(i,!T(i))),v(e,o)}w([`click`]);var eR=new Set([`$$slots`,`$$events`,`$$legacy`]);function tR(e,t){let n=H(t,eR),r=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]];ve(e,G({name:`list-plus`},()=>n,{get iconNode(){return r}}))}var nR=new Set([`$$slots`,`$$events`,`$$legacy`]);function rR(e,t){let n=H(t,nR),r=[[`path`,{d:`M16 3h5v5`}],[`path`,{d:`M8 3H3v5`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`}],[`path`,{d:`m15 9 6-6`}]];ve(e,G({name:`split`},()=>n,{get iconNode(){return r}}))}var iR=new Set([`$$slots`,`$$events`,`$$legacy`]);function aR(e,t){let n=H(t,iR),r=[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]];ve(e,G({name:`arrow-up`},()=>n,{get iconNode(){return r}}))}var oR=new Set([`$$slots`,`$$events`,`$$legacy`]);function sR(e,t){let n=H(t,oR),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];ve(e,G({name:`square`},()=>n,{get iconNode(){return r}}))}var cR=new Set([`$$slots`,`$$events`,`$$legacy`]);function lR(e,t){let n=H(t,cR),r=[[`path`,{d:`m6 9 6 6 6-6`}]];ve(e,G({name:`chevron-down`},()=>n,{get iconNode(){return r}}))}var uR=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function dR(e,t){i(t,!0);let n=D(t,`open`,15,!1),r=H(t,uR);var o=J(),s=K(o);a(s,()=>ws,(e,t)=>{t(e,G(()=>r,{get open(){return n()},set open(e){n(e)}}))}),v(e,o),b()}var fR=new Set([`$$slots`,`$$events`,`$$legacy`]);function pR(e,t){let n=H(t,fR);var r=J(),i=K(r);a(i,()=>Ft,(e,t)=>{t(e,G(()=>n))}),v(e,r)}var mR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`sideOffset`,`align`,`portalProps`,`class`]);function hR(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=D(t,`sideOffset`,3,4),o=D(t,`align`,3,`start`),s=H(t,mR);pR(e,G(()=>t.portalProps,{children:(e,i)=>{var c=J(),l=K(c);{let e=P(()=>dn(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-(--bits-dropdown-menu-anchor-width) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden`,t.class));a(l,()=>Ds,(t,i)=>{i(t,G({"data-slot":`dropdown-menu-content`,get sideOffset(){return r()},get align(){return o()},get class(){return T(e)}},()=>s,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,c)},$$slots:{default:!0}})),b()}var gR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function _R(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,gR);var o=J(),s=K(o);a(s,()=>_s,(e,t)=>{t(e,G({"data-slot":`dropdown-menu-group`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),v(e,o),b()}var vR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function yR(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=D(t,`variant`,3,`default`),o=H(t,vR);var s=J(),c=K(s);{let e=P(()=>dn(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed data-inset:pl-7.5 [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));a(c,()=>ms,(i,a)=>{a(i,G({"data-slot":`dropdown-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return T(e)}},()=>o,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,s),b()}var bR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`children`]),xR=r(`<div><!></div>`);function SR(e,t){i(t,!0);let r=D(t,`ref`,15,null),a=H(t,bR);var o=xR();M(o,e=>({"data-slot":`dropdown-menu-label`,"data-inset":t.inset,class:e,...a}),[()=>dn(`text-muted-foreground px-2 py-1.5 text-xs data-inset:pl-7.5 data-[inset]:pl-8`,t.class)]);var s=U(o);g(s,()=>t.children??L),n(o),oe(o,e=>r(e),()=>r()),v(e,o),b()}var CR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function wR(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,CR);var o=J(),s=K(o);{let e=P(()=>dn(`bg-border/50 -mx-1 my-1 h-px`,t.class));a(s,()=>Cs,(t,i)=>{i(t,G({"data-slot":`dropdown-menu-separator`,get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,o),b()}var TR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function ER(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,TR);var o=J(),s=K(o);a(s,()=>As,(e,t)=>{t(e,G({"data-slot":`dropdown-menu-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),v(e,o),b()}var DR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`]);function OR(e,t){i(t,!0);let n=D(t,`ref`,15,null),r=H(t,DR);var o=J(),s=K(o);{let e=P(()=>dn(`px-2 py-1.5 text-sm font-semibold data-[inset]:ps-8`,t.class));a(s,()=>bs,(i,a)=>{a(i,G({"data-slot":`dropdown-menu-group-heading`,get"data-inset"(){return t.inset},get class(){return T(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}v(e,o),b()}var kR=/[\uE100-\uE11D\uFFFC]/g,AR=/[\uE100-\uE11D\uFFFC]/;function jR(e,t,n=Date.now()){return!!(e.isComposing||e.keyCode===229||t!==null&&n-t<10)}function MR(e){return e.replace(kR,``)}function NR(e){return AR.test(e)}function PR(e){return e.owner!==void 0&&e.owner!==null&&e.owner.length>0?e.owner:e.disconnected?`Reconnecting…`:e.unavailable?`Agent unavailable`:e.modeLabel?`Message the ${e.modeLabel.toLowerCase()} agent…`:`Message the agent…`}function FR(e){return!e.startsWith(`/`)||e.startsWith(`//`)||(e.split(/\s/,1)[0]??``).includes(`://`)?``:e}function IR(e,t){return e===null?null:t.startsWith(e.token)?e:null}function LR(e,t){let n=e.split(/\s/,1)[0]??``;if(!n.startsWith(`/`))return null;let r=`${n} `;return t.includes(r)&&e.startsWith(r)?{token:r}:null}function RR(e,t){return t===null||!e.startsWith(t.token)?e:e.slice(t.token.length)}function zR(e,t){return t===0||/\s/.test(e[t-1]??``)}function BR(e,t){let n=new Map;for(let e of t){let t=n.get(e.token)??[];t.push(e),n.set(e.token,t)}let r=[...n.keys()],i=[],a=0;for(;a<e.length;){if(!zR(e,a)){a+=1;continue}let t=r.find(t=>e.startsWith(t,a));if(t===void 0){a+=1;continue}let o=n.get(t)?.shift();o!==void 0&&i.push({reference:o,start:a,end:a+t.length}),a+=t.length}return i}function VR(e,t){return BR(e,t).map(e=>e.reference)}function HR(e,t,n=[]){let r=[...[...t].sort((e,t)=>e.start-t.start).map(t=>({start:t.start,end:t.end,segment:{kind:`chip`,text:e.slice(t.start,t.end),reference:t.reference}})),...[...n].sort((e,t)=>e.start-t.start).map(t=>({start:t.start,end:t.end,segment:{kind:`skill`,text:e.slice(t.start,t.end),name:t.name}}))].sort((e,t)=>e.start-t.start),i=[],a=0;for(let t of r)t.start<a||(t.start>a&&i.push({kind:`plain`,text:e.slice(a,t.start)}),i.push(t.segment),a=t.end);return a<e.length&&i.push({kind:`plain`,text:e.slice(a)}),i}function UR(e,t,n){return n.find(e=>e.end===t)??null}function WR(e,t){if(t.length===0)return[];let n=[...new Set(t)].sort((e,t)=>t.length-e.length),r=[],i=0;for(;i<e.length;){if(!zR(e,i)||e[i]!==`/`){i+=1;continue}let t=n.find(t=>e.startsWith(`/${t}`,i)&&(i+t.length+1===e.length||/\s/.test(e[i+t.length+1]??``)));if(t===void 0){i+=1;continue}r.push({start:i,end:i+t.length+1,name:t}),i+=t.length+1}return r}var GR=r(`<div class="px-2.5 pt-1 text-[10px] text-muted-foreground" data-menu-source="true"> </div>`),KR=r(`<li class="cursor-default px-2.5 py-1.5 text-[11px] text-muted-foreground"> </li>`),qR=r(`<li><button type="button" data-menu-pinned="true"><span class="shrink-0 font-medium"> </span></button></li>`),JR=r(`<li class="px-2.5 pt-1.5 pb-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"> </li>`),YR=r(`<span class="truncate text-muted-foreground"> </span>`),XR=r(`<!> <li><button type="button"><span class="shrink-0 font-medium"> </span> <!></button></li>`,1),ZR=r(`<!> <!>`,1),QR=r(`<ul class="absolute bottom-full left-3 z-20 mb-1.5 max-h-64 w-72 overflow-y-auto rounded-lg border border-border bg-popover py-1 shadow-md"><!> <!></ul>`);function $R(e,r){i(r,!0);let a=D(r,`suppress`,3,!1),o=D(r,`forcedOpen`,3,!1),s=B(null),u=B(0),d=P(()=>r.text.startsWith(r.trigger)?r.text.split(`
225
+ `,1)[0]??``:``),f=P(()=>o()&&T(d).length===0?r.trigger:T(d)),p=P(()=>{if(T(f).length===0)return[];if(r.matcher!==void 0)return r.entries.filter(e=>r.matcher(T(f),e));let e=T(f).toLowerCase();return r.entries.filter(t=>t.value.toLowerCase().startsWith(e))}),h=P(()=>r.entries.length===0&&r.emptyMessage!==void 0),g=P(()=>!a()&&r.caretOnFirstLine&&T(s)!==r.text&&(o()&&(T(p).length>0||T(h))||T(d).length>0&&(T(p).length>0||T(h)||r.pinned!==void 0&&T(d).includes(`/`)))),_=P(()=>T(p).length+(r.pinned===void 0?0:1)),y=P(()=>Math.min(T(u),Math.max(0,T(_)-1))),x=P(()=>T(p).map((e,t)=>({entry:e,index:t,header:e.group!==void 0&&e.group!==T(p)[t-1]?.group})));function S(e){e.preventDefault(),e.stopPropagation()}function C(e){if(!T(g))return!1;if(e.key===`Escape`)return S(e),N(s,r.text,!0),r.onForceClose?.(),!0;if(T(_)===0)return e.key===`Enter`&&(S(e),!0);if(e.key===`ArrowDown`)return S(e),N(u,(T(y)+1)%T(_)),!0;if(e.key===`ArrowUp`)return S(e),N(u,(T(y)-1+T(_))%T(_)),!0;if(e.key===`Enter`||e.key===`Tab`&&o()){if(S(e),r.pinned!==void 0&&T(y)===0)r.onSelect(r.pinned.value),r.onForceClose?.();else{let e=T(p)[T(y)-(r.pinned===void 0?0:1)];e&&(r.onSelect(e.value,e),r.onForceClose?.())}return!0}return!1}var w={handleKeydown:C},E=J(),O=K(E),k=e=>{var i=QR(),a=U(i),o=e=>{var t=GR(),n=j(t,!0);V(()=>c(n,r.sourceLabel)),v(e,t)};m(a,e=>{r.sourceLabel&&e(o)});var s=R(a,2),u=e=>{var t=KR(),n=j(t,!0);V(()=>c(n,r.emptyMessage)),v(e,t)},d=e=>{var i=ZR(),a=K(i),o=e=>{var t=qR(),i=U(t),a=U(i),o=j(a,!0);n(i),n(t),V(()=>{me(i,1,`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-[11px] ${T(y)===0?`bg-primary/15 text-foreground`:`text-muted-foreground`} hover:bg-accent/50`),z(i,`aria-current`,T(y)===0?`true`:void 0),c(o,r.pinned.label)}),l(`click`,i,()=>{r.onSelect(r.pinned.value),r.onForceClose?.()}),v(e,t)};m(a,e=>{r.pinned&&e(o)});var s=R(a,2);t(s,17,()=>T(x),e=>e.entry.key??e.entry.value,(e,t)=>{var i=XR(),a=K(i),o=e=>{var n=JR(),r=j(n,!0);V(()=>{z(n,`data-menu-group`,T(t).entry.group),c(r,T(t).entry.group)}),v(e,n)};m(a,e=>{T(t).header&&T(t).entry.group&&e(o)});var s=R(a,2),u=U(s),d=U(u),f=j(d,!0),p=R(d,2),h=e=>{var n=YR(),r=j(n,!0);V(()=>c(r,T(t).entry.description)),v(e,n)};m(p,e=>{T(t).entry.description&&e(h)}),n(u),n(s),V(()=>{me(u,1,`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-[11px] ${T(t).index+(r.pinned===void 0?0:1)===T(y)?`bg-primary/15 text-foreground`:`text-foreground`} hover:bg-accent/50`),z(u,`aria-current`,T(t).index+(r.pinned===void 0?0:1)===T(y)?`true`:void 0),c(f,T(t).entry.value)}),l(`click`,u,()=>{r.onSelect(T(t).entry.value,T(t).entry),r.onForceClose?.()}),v(e,i)}),v(e,i)};m(s,e=>{T(p).length===0&&r.pinned===void 0?e(u):e(d,-1)}),n(i),V(()=>{z(i,`data-slot`,r.dataSlot),z(i,`aria-label`,r.menuLabel)}),v(e,i)};return m(O,e=>{T(g)&&e(k)}),v(e,E),b(w)}w([`click`]);var ez=[{command:`/compact`,description:`Summarize the transcript to reclaim context`},{command:`/queue`,description:`While busy, Enter queues after the current turn`},{command:`/steer`,description:`While busy, Enter steers the current turn`}],tz=ez.filter(e=>e.kind===`input-taking`).map(e=>`${e.command} `);function nz(e,t){i(t,!0);let n=D(t,`suppress`,3,!1),r=D(t,`forcedOpen`,3,!1),a=P(()=>{let e=ez.map(e=>({value:e.command,group:`Commands`,...e.description.length>0?{description:e.description}:{}})),t=lt.skills.map(e=>({value:`/${e.name}`,group:`Skills`,...e.description.length>0?{description:e.description}:{}}));return[...e,...t]}),o=P(()=>lt.target?`skills from provider: ${lt.target.providerId}`:`Open a Workspace provider to load skills`),s=P(()=>t.text.startsWith(`/`)&&FR(t.text.split(`
226
+ `,1)[0]??``)===``),c=B(null);function l(e){return T(c)?.handleKeydown(e)??!1}function u(e){if(ez.some(t=>t.command===e)){t.onExecute(e);return}t.onInsertSkill(e)}var d={handleKeydown:l};{let i=P(()=>n()||T(s));oe($R(e,{trigger:`/`,get entries(){return T(a)},get text(){return t.text},get caretOnFirstLine(){return t.caretOnFirstLine},get suppress(){return T(i)},get forcedOpen(){return r()},get onForceClose(){return t.onForceClose},menuLabel:`Slash commands and skills`,get sourceLabel(){return T(o)},dataSlot:`slash-menu`,emptyMessage:`No matching command or skill`,onSelect:u}),e=>N(c,e,!0),()=>T(c))}return b(d)}function rz(e){if(!e)return null;let{provider:t,model:n}=e.settings.model,r=e.settings.modelRoutes.find(e=>e.provider===t);return r?r.models.find(e=>e.id===n)?.contextWindow??null:null}var iz=r(`<div class="flex items-center justify-between"><span>Used</span> <span> </span></div> <div class="mt-0.5 flex items-center justify-between text-muted-foreground"><span>Last turn</span> <span class="tabular-nums"> </span></div> <div class="mt-0.5 flex items-center justify-between text-muted-foreground"><span>Capacity</span> <span class="tabular-nums"> </span></div>`,1),az=r(`<div class="text-muted-foreground">No turns yet.</div>`),oz=r(`<div role="dialog" aria-label="Context usage details" class="absolute right-0 bottom-full z-20 mb-1.5 w-56 rounded-lg border border-border bg-popover p-2.5 text-xs shadow-md"><div class="mb-1.5 text-[11px] font-medium text-muted-foreground">Context</div> <!> <button type="button" class="mt-2 w-full rounded-md border border-border px-2 py-1 text-[11px] transition-colors hover:bg-muted disabled:opacity-50" title="Compact the conversation history (kernel /compact)">compact</button></div>`),sz=r(`<div class="relative"><button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50" aria-label="Context usage"><svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><circle cx="7" cy="7" r="5" fill="none" stroke-width="2.5" class="stroke-muted-foreground/40"></circle><circle cx="7" cy="7" r="5" fill="none" stroke-width="2.5" stroke-linecap="round" transform="rotate(-90 7 7)"></circle></svg></button> <!></div>`);function cz(e,t){i(t,!0);let r=B(!1),a=B(null),o=P(()=>Q.lastUsage),s=P(()=>rz(Xn.view)),u=P(()=>T(s)??131072),d=P(()=>T(o)?Math.min(1,Math.max(0,T(o).inputTokens/T(u))):0),p=P(()=>Math.round(T(d)*100)),h=P(()=>T(p)>=75),g=2*Math.PI*5,_=P(()=>`${(T(d)*g).toFixed(2)} ${g.toFixed(2)}`),x=P(()=>T(o)?`${T(p)}% of context used · last turn ${uu(T(o).inputTokens)} in / ${uu(T(o).outputTokens)} out`:`No turns yet — context usage appears after the first turn`);function S(){Q.sending||Q.status===`running`||(N(r,!1),Hn(`/compact`))}function C(e){T(r)&&T(a)!==null&&e.target instanceof Node&&!T(a).contains(e.target)&&N(r,!1)}var w=sz();f(`pointerdown`,O,C);var E=U(w),D=U(E),k=R(U(D));n(D),n(E);var ee=R(E,2),A=e=>{var t=oz(),r=R(U(t),2),i=e=>{var t=iz(),r=K(t),i=R(U(r),2),a=j(i);n(r);var l=R(r,2),d=R(U(l),2),f=j(d);n(l);var m=R(l,2),g=R(U(m),2),_=j(g);n(m),V((e,t,n)=>{me(i,1,`tabular-nums ${T(h)?`text-amber-600 dark:text-amber-400`:``}`),c(a,`${T(p)??``}%`),c(f,`↑ ${e??``} · ↓ ${t??``}`),c(_,`${n??``}${T(s)===null?` · assumed 128k`:``}`)},[()=>uu(T(o).inputTokens),()=>uu(T(o).outputTokens),()=>uu(T(u))]),v(e,t)},a=e=>{var t=az();v(e,t)};m(r,e=>{T(o)?e(i):e(a,-1)});var d=R(r,2);n(t),V(()=>d.disabled=Q.sending||Q.status===`running`||!Q.sessionId),l(`click`,d,S),v(e,t)};m(ee,e=>{T(r)&&e(A)}),n(w),oe(w,e=>N(a,e),()=>T(a)),V(()=>{z(E,`title`,T(x)),z(E,`aria-expanded`,T(r)),E.disabled=!Q.sessionId,me(k,0,y(T(h)?`stroke-amber-500`:`stroke-primary`)),z(k,`stroke-dasharray`,T(_))}),l(`click`,E,()=>N(r,!T(r))),v(e,w),b()}w([`click`]);var lz=r(`<input class="min-w-0 flex-1 rounded border border-border bg-background px-1.5 py-0.5 text-[11px] outline-none focus:border-primary" aria-label="Edit queued message"/>`),uz=r(`<span class="truncate text-foreground/80"> </span>`),dz=r(`<span class="shrink-0 rounded border border-border bg-background px-1 text-[10px] text-muted-foreground"> </span>`),fz=r(`<span class="shrink-0 rounded border border-border bg-background px-1 text-[10px] text-primary" title="Steers the running turn at the next step boundary">steer</span>`),pz=r(`<button type="button" class="relative flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground" aria-label="Edit queued message" title="Edit this queued message"><!></button> <button type="button" class="relative flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40" aria-label="Steer with this message"><!></button>`,1),mz=r(`<li class="flex items-center gap-1 px-2.5 py-1 text-[11px]"><!> <!> <!> <span class="flex-1"></span> <!> <button type="button" class="relative flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-destructive" aria-label="Remove queued message" title="Remove from queue"><!></button></li>`),hz=r(`<li class="flex items-center gap-1 px-2.5 py-1 text-[11px]"><span class="truncate text-muted-foreground/70"> </span> <span class="flex-1"></span> <span class="shrink-0 text-[10px] text-muted-foreground/60">sending…</span></li>`),gz=r(`<ul class="border-t border-border"></ul>`),_z=r(`<div class="mx-2.5 mt-2.5 shrink-0 rounded-lg border border-border bg-muted/30" aria-label="Queued messages"><button type="button" class="flex w-full items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-muted-foreground hover:text-foreground"><!> <span class="font-medium">Queued</span> <span class="rounded border border-border bg-background px-1 text-primary"> </span> <span class="flex-1"></span> <!></button> <!></div>`);function vz(e,r){i(r,!0);let a=B(!1),o=P(()=>{let e=new Set(qn.items.map(e=>e.text)),t=Fn.items.filter(t=>!e.has(t.text)).map(e=>({kind:`optimistic`,text:e.text}));return[...qn.items.map(e=>({kind:`kernel`,item:e})),...t]}),s=B(null),u=B(``),d=P(()=>Q.status===`running`);function p(e,t){N(s,e,!0),N(u,t,!0)}async function h(e){let t=T(u).trim();if(N(s,null),t.length===0)return;let n=await En({messageId:e,action:`edit`,text:t});n&&`error`in n&&ht(`Queue edit failed: ${n.error}`)}async function g(e){let t=await En({messageId:e,action:`remove`});t&&`error`in t&&ht(`Queue remove failed: ${t.error}`)}async function _(e){let t=await En({messageId:e,action:`steer`});t&&`error`in t&&ht(`Queue steer failed: ${t.error}`)}function y(e,t){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(s,null);return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.stopPropagation(),h(t))}var x=J(),S=K(x),C=e=>{var r=_z(),i=U(r),b=U(i);tR(b,{class:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`});var x=R(b,4),S=j(x,!0),C=R(x,4);{let e=P(()=>T(a)?``:`rotate-180`);lR(C,{get class(){return`h-3 w-3 transition-transform ${T(e)??``}`},"aria-hidden":`true`})}n(i);var w=R(i,2),E=e=>{var r=gz();t(r,23,()=>T(o),(e,t)=>e.kind===`kernel`?e.item.messageId:`optimistic-${t}`,(e,t)=>{var r=J(),i=K(r),a=e=>{var r=mz(),i=U(r),a=e=>{var n=lz();ce(n),l(`keydown`,n,e=>y(e,T(t).item.messageId)),f(`blur`,n,()=>void h(T(t).item.messageId)),te(n,()=>T(u),e=>N(u,e)),v(e,n)},o=e=>{var n=uz(),r=j(n,!0);V(()=>{z(n,`title`,T(t).item.text),c(r,T(t).item.text)}),v(e,n)};m(i,e=>{T(s)===T(t).item.messageId?e(a):e(o,-1)});var b=R(i,2),x=e=>{var n=dz(),r=j(n);V(()=>{z(n,`title`,`${T(t).item.attachments??``} attachment(s)`),c(r,`+${T(t).item.attachments??``}`)}),v(e,n)};m(b,e=>{T(t).item.attachments>0&&e(x)});var S=R(b,2),C=e=>{var t=fz();v(e,t)};m(S,e=>{T(t).item.target===`next-step`&&e(C)});var w=R(S,4),E=e=>{var r=pz(),i=K(r),a=U(i);nt(a,{class:`h-3 w-3`,"aria-hidden":`true`}),n(i);var o=R(i,2);rR(U(o),{class:`h-3 w-3`,"aria-hidden":`true`}),n(o),V(()=>{z(o,`title`,T(d)?`Steer the current turn with this message`:`Steering unlocks while a turn is running`),o.disabled=!T(d)||T(t).item.target!==`next-turn`}),l(`click`,i,()=>p(T(t).item.messageId,T(t).item.text)),l(`click`,o,()=>void _(T(t).item.messageId)),v(e,r)};m(w,e=>{T(s)!==T(t).item.messageId&&e(E)});var D=R(w,2),O=U(D);hn(O,{class:`h-3 w-3`,"aria-hidden":`true`}),n(D),n(r),V(()=>z(r,`data-queue-target`,T(t).item.target)),l(`click`,D,()=>void g(T(t).item.messageId)),v(e,r)},o=e=>{var r=hz(),i=U(r),a=j(i,!0);ae(4),n(r),V(()=>{z(i,`title`,T(t).text),c(a,T(t).text)}),v(e,r)};m(i,e=>{T(t).kind===`kernel`?e(a):e(o,-1)}),v(e,r)}),n(r),v(e,r)};m(w,e=>{T(a)||e(E)}),n(r),V(()=>{z(i,`aria-expanded`,!T(a)),c(S,T(o).length)}),l(`click`,i,()=>N(a,!T(a))),v(e,r)};m(S,e=>{T(o).length>0&&e(C)}),v(e,x),b()}w([`click`,`keydown`]);var yz=r(`<span class="rounded-[4px] bg-primary/15 [box-decoration-break:clone]"> </span>`),bz=r(`<span class="rounded-[4px] bg-muted [box-decoration-break:clone]" data-composer-chip="skill"> </span>`),xz=r(`<span> </span>`),Sz=r(`<div aria-hidden="true" class="msg-body pointer-events-none absolute inset-x-0 top-0 z-0 overflow-hidden whitespace-pre-wrap break-words px-3.5 py-2.5 text-transparent"></div>`);function Cz(e,r){i(r,!0);let a=D(r,`skillSpans`,19,()=>[]),o=P(()=>HR(r.text,r.occurrences,a()));var s=Sz();t(s,21,()=>T(o),I,(e,t)=>{var n=J(),r=K(n),i=e=>{var n=yz(),r=j(n,!0);V(()=>{z(n,`data-composer-chip`,T(t).reference.kind),z(n,`title`,T(t).reference.kind===`file`?T(t).reference.target:`session: ${T(t).reference.label}`),c(r,T(t).text)}),v(e,n)},a=e=>{var n=bz(),r=j(n,!0);V(()=>{z(n,`title`,`skill: ${T(t).name}`),c(r,T(t).text)}),v(e,n)},o=e=>{var n=xz(),r=j(n,!0);V(()=>c(r,T(t).text)),v(e,n)};m(r,e=>{T(t).kind===`chip`?e(i):T(t).kind===`skill`?e(a,1):e(o,-1)}),v(e,n)}),n(s),V(()=>k(s,`height: ${r.heightPx??``}px`)),v(e,s),b()}function wz(e,t){i(t,!0);function n(e,t){return{token:e,reference:{...t,token:e}}}let r=D(t,`suppress`,3,!1),a=P(()=>t.text.startsWith(`@`)?t.text.split(`
227
+ `,1)[0]??``:``),o=P(()=>{let e=T(a).lastIndexOf(`/`);return e>=0?T(a).slice(0,e+1):`@`}),s=P(()=>T(o)!==`@`);function c(e,t){let n=e.trim().length>0?e.trim():t.slice(0,12);return n.length>40?`${n.slice(0,39)}…`:n}let l=P(()=>{if(T(s))return[];let e=[];for(let t of Ln.sessions){if(t.sessionId===Q.sessionId)continue;let n=c(t.title,t.sessionId);e.push({value:`@${n}`,group:`Sessions`})}return e}),u=B(de(new Map)),d=B(!1),f=B(null);W(()=>{if(!T(a).startsWith(`@`))return;let e=T(o),t=T(f);if(T(u),T(u).get(e)!==void 0||T(d))return;let n=qe();if(n===null)return;let r=e.slice(1).split(`/`).filter(Boolean),i=t===null||r.length===0?null:[t,...r].join(`/`);N(d,!0),n.agent.files.list(i===null?{}:{dir:i}).then(n=>{if(t===null){N(f,n.dir,!0);return}if(e!==T(o))return;let r=new Map(T(u));r.set(e,{dir:n.dir,entries:n.entries}),N(u,r,!0)}).catch(()=>{if(e!==T(o))return;let t=new Map(T(u));t.set(e,{dir:i??``,entries:[]}),N(u,t,!0)}).finally(()=>{N(d,!1)})}),W(()=>{T(a).startsWith(`@`)&&!Ln.loading&&(Ln.loaded?Ln.error!==null&&Vn():Vn())});let p=P(()=>{let e=T(u).get(T(o));if(e===void 0)return[];let t=[];for(let n of e.entries)t.push({value:n.kind===`dir`?`${T(o)}${n.name}/`:`${T(o)}${n.name}`,group:`Files`});return t}),m=P(()=>[...T(l),...T(p)]),h=P(()=>{if(!T(s))return;let e=T(o).slice(0,-1),t=e.lastIndexOf(`/`);return{value:`${e.slice(0,t+1)}`,label:`..`}}),g=P(()=>{if(T(d))return`Loading directory…`;let e=T(u).get(T(o));return e===void 0||e.dir.length===0?qe()===null?`Not connected`:`Files from: home`:`Files from: ${e.dir}`}),_=B(null);function v(e){return T(_)?.handleKeydown(e)??!1}function y(e){if(e.endsWith(`/`)){t.onNavigate(e);return}let r=T(l).find(t=>t.value===e);if(r!==void 0){let e=r.value.slice(1),i=Ln.sessions.find(t=>c(t.title,t.sessionId)===e&&t.sessionId!==Q.sessionId);if(i!==void 0){t.onPick(n(r.value,{kind:`session`,target:i.sessionId,label:e}));return}}let i=T(u).get(T(o)),a=e.slice(T(o).length),s=i?.entries.find(e=>e.kind===`file`&&e.name===a);if(i!==void 0&&s!==void 0){let e=i.dir.includes(`\\`)?`\\`:`/`;t.onPick(n(`@${a}`,{kind:`file`,target:`${i.dir}${e}${a}`,label:a}))}}var x={handleKeydown:v};return oe($R(e,{trigger:`@`,get entries(){return T(m)},get text(){return t.text},get caretOnFirstLine(){return t.caretOnFirstLine},get suppress(){return r()},get pinned(){return T(h)},menuLabel:`References — files and sessions`,get sourceLabel(){return T(g)},dataSlot:`reference-menu`,emptyMessage:`No matching file or session`,onSelect:y}),e=>N(_,e,!0),()=>T(_)),b(x)}function Tz(e,t){i(t,!0);let n=D(t,`suppress`,3,!1),r=P(()=>t.text.startsWith(`$`)?t.text.split(`
228
+ `,1)[0]??``:``),a=P(()=>T(r).startsWith(`$`)?T(r).slice(1).trim():``),o=B(null),s=0,c=!1;W(()=>{let e=T(a);if(!e){c&&=(st(),!1),s+=1,N(o,T(r).startsWith(`$`)&&qe()===null?`Not connected`:null,!0);return}c=!0;let t=s;if(qe()===null){N(o,`Not connected`);return}N(o,null);let n=setTimeout(()=>{t===s&&ct(e)},150);return()=>clearTimeout(n)}),W(()=>()=>st());let l=P(()=>at.query===T(a)),u=P(()=>T(o)??(T(l)?at.error:null)),d=P(()=>T(a)!==``&&T(u)===null&&(!T(l)||at.searching)),f=P(()=>{if(!T(a)||!T(l))return[];let e=[];for(let t of at.results)for(let n of t.installations){let r=`${n.workspaceId}:${n.providerId}:${t.id}`,i=`$${t.name}`;e.push({key:r,name:t.name,token:i,entry:{value:i,description:t.description,group:ot(n.workspaceId,n.providerId),key:r},target:{workspaceId:n.workspaceId,providerId:n.providerId,skillId:t.id}})}return e}),p=P(()=>T(f).map(e=>e.entry));function m(e,n){let r=T(f).find(t=>n?.key===void 0?t.entry.value===e:t.key===n.key);r!==void 0&&t.onPick({token:r.token,reference:{kind:`skill`,token:r.token,target:r.target.skillId,label:r.name,skill:r.target}})}let h=B(null);function g(e){return T(h)?.handleKeydown(e)??!1}let _=P(()=>{if(!T(a))return`输入关键词检索技能`;if(T(u)!==null)return T(u);if(T(d))return`Searching skills…`;if(T(l)&&at.results.length>0){let e=new Set(T(f).map(e=>e.entry.group)).size;return`${at.results.length} skills · ${e} provider groups`}return`Skills across workspaces`});var v={handleKeydown:g};{let r=P(()=>T(u)===null?T(d)?`Searching skills…`:T(a)?`No matching skill`:`输入关键词检索技能…`:`Search unavailable`);oe($R(e,{trigger:`$`,get entries(){return T(p)},get text(){return t.text},get caretOnFirstLine(){return t.caretOnFirstLine},get suppress(){return n()},matcher:e=>!/\s/.test(e.slice(1)),menuLabel:`Skills — across workspaces`,get sourceLabel(){return T(_)},dataSlot:`skill-menu`,get emptyMessage(){return T(r)},onSelect:m}),e=>N(h,e,!0),()=>T(h))}return b(v)}var Ez=null;function Dz(){if(Ez!==null)return Ez;let e=qe();return e?(Ez=e.agent.models.catalog({}).then(e=>Object.fromEntries(e.providers.map(e=>[e.provider,e.label]))).catch(()=>(Ez=null,{})),Ez):Promise.resolve({})}var Oz=r(`<img class="h-full w-full object-cover"/>`),kz=r(`<div class="flex h-full w-full items-center justify-center bg-muted/40"><!></div>`),Az=r(`<div class="group relative h-14 w-14 overflow-hidden rounded-lg border border-border"><!> <button type="button" class="absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-background/80 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:text-destructive" aria-label="Remove attachment"><!></button></div>`),jz=r(`<span class="flex items-center gap-1 rounded-md border border-border bg-muted/40 px-1.5 py-0.5 text-[10px]"> <button type="button" class="text-muted-foreground hover:text-destructive">×</button></span>`),Mz=r(`<div class="flex flex-wrap gap-1.5 px-3 pt-3" aria-label="Pending attachments"><!> <!></div>`),Nz=r(`<textarea class="msg-body relative z-10 max-h-40 w-full resize-none border-0 bg-transparent px-3.5 py-2.5 outline-none focus:outline-none focus-visible:ring-0 placeholder:text-muted-foreground disabled:opacity-50" aria-label="Message"></textarea>`),Pz=r(`<span class="truncate"> </span> <!>`,1),Fz=r(`<span class="flex h-3.5 w-3.5 shrink-0 items-center justify-center"><!></span> <span class="truncate"> </span>`,1),Iz=r(`<!> <!>`,1),Lz=r(`<span class="h-1.5 w-1.5 shrink-0 rounded-full bg-primary"></span>`),Rz=r(`<span class="truncate"> </span> <!> <!>`,1),zz=r(`<span class="flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded text-[8px] font-semibold text-white" aria-hidden="true"> </span> <span class="truncate"> </span>`,1),Bz=r(`<!> <!> <!>`,1),Vz=r(`<div class="relative mx-3 mb-3 flex shrink-0 flex-col rounded-[22px] border border-border bg-card shadow-sm"><!> <!> <!> <!> <!> <div class="relative w-full"><!> <!></div> <div class="flex h-11 items-center gap-1 px-2.5"><!> <button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground disabled:opacity-50" title="Commands and skills" aria-label="Commands and skills"><!></button> <button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground disabled:opacity-50" title="Attach images (paste or pick, ≤4 MiB each)" aria-label="Attach images (paste or pick, ≤4 MiB each)"><span class="relative flex items-center justify-center"><!> <!></span></button> <button type="button" class="relative flex h-8 w-8 items-center justify-center rounded text-muted-foreground transition-colors after:absolute after:-inset-1.5 after:content-[''] hover:bg-muted hover:text-foreground disabled:opacity-50" title="Attach files (text inlined, binary as refs, ≤512 KiB each)" aria-label="Attach files (text inlined, binary as refs, ≤512 KiB each)"><span class="relative flex items-center justify-center"><!> <!></span></button> <div class="flex-1"></div> <!> <!> <button type="button"><!></button></div></div>`);function Hz(e,r){i(r,!0);let o=B(null),s=B(null),u=B(null),d=B(null),h=B(!0),g=P(()=>BR(Z.text,Z.references)),_=P(()=>WR(Z.text,lt.skills.map(e=>e.name))),y=B(null);W(()=>{Z.text,N(y,IR(T(y),Z.text)??LR(Z.text,tz),!0)});let x=B(!1),C=B(44);W(()=>{Z.text;let e=T(o);e&&(e.style.height=`auto`,N(C,Math.min(160,Math.max(44,e.scrollHeight)),!0),e.style.height=`${T(C)}px`)}),W(()=>{Z.text,N(h,w(),!0)});function w(){return!Z.text.slice(0,T(o)?.selectionStart??0).includes(`
229
+ `)}let D=P(()=>Q.status===`running`),O=P(()=>Z.text.trim().length>0||Z.images.length>0||Z.files.length>0),ee=P(()=>Z.editing!==null),A=P(()=>T(D)&&!T(O)?`stop`:T(D)?An()===`steer`?`steer`:`queue`:`send`),M=P(()=>Q.sessionId?Q.mode:Q.pendingMode),F=P(()=>Ue.find(e=>e.id===T(M))?.label),ne=P(()=>PR({owner:T(ee)?`Edit your message — sending will resend it as a new message`:null,disconnected:Je.status===`disconnected`,unavailable:Q.error!==null&&Q.sessionId===null,modeLabel:T(F)??null})),re=P(()=>{let e=Xn.view;if(!e)return null;let t=e.settings.model,n=!e.settings.modelRoutes.some(e=>e.provider===t.provider);return{label:`${t.provider} · ${t.model}`,effort:t.reasoningEffort,dangling:n}}),L=B(de({})),ie=B(!1),se=B(!1);W(()=>{Dz().then(e=>N(L,e,!0))});let H=P(()=>{let e=Xn.view;if(!e)return[];let t=e.settings.model;return e.settings.modelRoutes.map(e=>{let n=e.models.map(e=>e.id);t.provider===e.provider&&!n.includes(t.model)&&n.unshift(t.model);let r=T(L)[e.provider]??e.provider;return{provider:e.provider,label:r,letter:e.iconLetter??r.slice(0,1).toUpperCase(),color:e.iconColor??`hsl(${tt(e.provider)} 55% 45%)`,models:n}})});function ce(e,t){let n=Xn.view;return n!==null&&n.settings.model.provider===e&&n.settings.model.model===t}async function le(e,t){let n=Xn.view?.settings.model.reasoningEffort,r=await er({model:{provider:e,model:t,...n!==void 0&&n.length>0?{reasoningEffort:n}:{}}});if(r){if(r.outcome===`rejected`){ht(`${r.code}: ${r.detail}`);return}if(r.outcome===`error`){ht(r.message);return}ht(`Active model → ${e} · ${t}`)}}function ue(e=!1){let t=RR(Z.text.trim(),T(y)).trim();if(t.length===0&&Z.images.length===0&&Z.files.length===0||Q.sending)return;if(Wn.pending>0){ht(`Attachments are still being read — try again in a moment.`);return}let n=Q.status===`running`?nr(e,An()):`queue`,r=VR(Z.text,Z.references);q=!0,Hn(t,Z.images,Z.files,n,r)}let G=B(0),q=!1;W(()=>{q&&Z.text===``&&(q=!1,N(G,T(G)+1))});let fe=B(null);async function pe(e){if(T(fe)===null){N(fe,e,!0);try{let t=await Kn(e);if(t===null||t.paths.length===0)return;let n=t.paths.map(e=>({path:e,name:e.split(/[\\/]/).filter(Boolean).pop()??e}));e===`image`?(Gn(n),Bn(n)):Nn(n)}finally{N(fe,null)}}}function he(e){if(!Q.sessionId){Q.pendingMode=e;return}Rn(e)}function ge(e){if(N(x,!1),e===`/queue`||e===`/steer`){let t=e===`/queue`?`queue`:`steer`;Tn(t),ht(`Busy-Enter preference → ${t}`),Z.text=``;return}Q.sending||(Z.text=``,Z.images=[],Z.files=[],Mn(),Hn(e))}function Y(e){N(x,!1);let t=T(o),n=Math.min(t?.selectionStart??Z.text.length,Z.text.length);Z.text=`${e} ${Z.text.slice(n)}`;let r=Math.min(e.length+1,Z.text.length);requestAnimationFrame(()=>{t?.setSelectionRange(r,r),N(h,w(),!0)})}function _e(e){let t=T(o),n=Math.min(t?.selectionStart??Z.text.length,Z.text.length);Z.text=e+Z.text.slice(n);let r=Math.min(e.length,Z.text.length);requestAnimationFrame(()=>{t?.setSelectionRange(r,r),N(h,w(),!0)})}function ve(e){_e(e)}function ye(e){_e(`${e.token} `),Dn(e.reference)}function be(e){if(!T(u)?.handleKeydown(e)&&!T(d)?.handleKeydown(e)&&!T(s)?.handleKeydown(e)){if(e.key===`Backspace`&&!T(Se)){let t=T(o);if(t&&t.selectionStart===t.selectionEnd){let n=UR(Z.text,t.selectionStart,T(g));if(n){e.preventDefault(),Z.text=Z.text.slice(0,n.start)+Z.text.slice(n.end),kn(n.reference.uid);let r=n.start;requestAnimationFrame(()=>t.setSelectionRange(r,r));return}}}if(e.key===`Enter`&&!e.shiftKey){if(e.repeat){e.preventDefault();return}if(jR(e,xe)){e.preventDefault();return}e.preventDefault(),ue(e.metaKey||e.ctrlKey)}}}let xe=null,Se=B(!1);function Ce(){N(Se,!0)}function we(){N(Se,!1),xe=Date.now()}function Te(){N(h,w(),!0)}function Ee(e){let t=[...e.clipboardData?.files??[]];if(t.length>0){e.preventDefault();let n=t.filter(e=>e.type.startsWith(`image/`)),r=t.filter(e=>!e.type.startsWith(`image/`));n.length>0&&On(n),r.length>0&&In(r);return}let n=e.clipboardData?.getData(`text/plain`)??``;NR(n)&&(e.preventDefault(),De(MR(n)))}function De(e){let t=T(o);if(!t){Z.text=MR(Z.text+e);return}let n=t.selectionStart??Z.text.length,r=t.selectionEnd??n;Z.text=Z.text.slice(0,n)+e+Z.text.slice(r);let i=n+e.length;requestAnimationFrame(()=>t?.setSelectionRange(i,i))}var Oe=Vz(),ke=U(Oe);vz(ke,{});var Ae=R(ke,2);{let e=P(()=>T(y)!==null);oe(wz(Ae,{get text(){return Z.text},get caretOnFirstLine(){return T(h)},onNavigate:ve,onPick:ye,get suppress(){return T(e)}}),e=>N(u,e,!0),()=>T(u))}var je=R(Ae,2);{let e=P(()=>T(y)!==null);oe(Tz(je,{get text(){return Z.text},get caretOnFirstLine(){return T(h)},onPick:ye,get suppress(){return T(e)}}),e=>N(d,e,!0),()=>T(d))}var Me=R(je,2);{let e=P(()=>T(y)!==null);oe(nz(Me,{get text(){return Z.text},get caretOnFirstLine(){return T(h)},onExecute:ge,onInsertSkill:Y,get suppress(){return T(e)},get forcedOpen(){return T(x)},onForceClose:()=>N(x,!1)}),e=>N(s,e,!0),()=>T(s))}var Ne=R(Me,2),Pe=e=>{var r=Mz(),i=U(r);t(i,17,()=>Z.images,I,(e,t,r)=>{var i=Az(),a=U(i),o=e=>{var n=Oz();V(()=>{z(n,`src`,T(t).preview),z(n,`alt`,T(t).name??`image`)}),v(e,n)},s=e=>{var r=kz();fl(U(r),{class:`h-5 w-5 text-muted-foreground`,"aria-hidden":`true`}),n(r),V(()=>z(r,`title`,T(t).path??T(t).name??`image`)),v(e,r)};m(a,e=>{T(t).preview?e(o):e(s,-1)});var c=R(a,2),u=U(c);hn(u,{class:`h-2.5 w-2.5`}),n(c),n(i),l(`click`,c,()=>Z.images=Z.images.filter((e,t)=>t!==r)),v(e,i)});var a=R(i,2);t(a,17,()=>Z.files,I,(e,t,r)=>{var i=jz(),a=U(i),o=R(a);n(i),V(()=>{c(a,`📄 ${T(t).name??``} `),z(o,`aria-label`,`Remove file ${T(t).name??``}`)}),l(`click`,o,()=>Z.files=Z.files.filter((e,t)=>t!==r)),v(e,i)}),n(r),v(e,r)};m(Ne,e=>{(Z.files.length>0||Z.images.length>0)&&e(Pe)});var Fe=R(Ne,2),Ie=U(Fe);Cz(Ie,{get text(){return Z.text},get occurrences(){return T(g)},get skillSpans(){return T(_)},get heightPx(){return T(C)}});var Le=R(Ie,2);p(Le,()=>T(G),e=>{var t=Nz();E(t),z(t,`rows`,1),z(t,`maxlength`,2e4),oe(t,e=>N(o,e),()=>T(o)),V(()=>{z(t,`placeholder`,T(ne)),z(t,`data-composer-composing`,T(Se)?`true`:void 0)}),l(`keydown`,t,be),l(`keyup`,t,Te),l(`click`,t,Te),f(`select`,t,Te),f(`paste`,t,Ee),f(`compositionstart`,t,Ce),f(`compositionend`,t,we),te(t,()=>Z.text,e=>Z.text=e),v(e,t)}),n(Fe);var Re=R(Fe,2),ze=U(Re);a(ze,()=>dR,(e,r)=>{r(e,{get open(){return T(se)},set open(e){N(se,e,!0)},children:(e,r)=>{var i=Iz(),o=K(i);{let e=P(()=>T(D)?`Switch after the current turn ends`:Q.sessionId?`Switch this session's mode`:`Pick the mode for your next session`);a(o,()=>ER,(t,n)=>{n(t,{class:`flex h-7 max-w-[130px] items-center gap-1.5 rounded-full border border-border px-2.5 text-[11px] text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,get title(){return T(e)},"aria-label":`Session mode`,get disabled(){return T(D)},onkeydown:e=>{e.key===`Escape`&&T(se)&&(e.stopPropagation(),N(se,!1))},children:(e,t)=>{var n=Pz(),r=K(n),i=j(r,!0);lR(R(r,2),{class:`h-3 w-3 shrink-0 opacity-60`,"aria-hidden":`true`}),V(()=>c(i,T(F)??`Mode`)),v(e,n)},$$slots:{default:!0}})})}var s=R(o,2),l=e=>{var r=J(),i=K(r);a(i,()=>hR,(e,r)=>{r(e,{align:`start`,class:`max-h-72 w-44 overflow-y-auto`,onkeydown:e=>{e.key===`Escape`&&(e.stopPropagation(),N(se,!1))},children:(e,r)=>{var i=J(),o=K(i);t(o,17,()=>Ue,e=>e.id,(e,t)=>{var r=J(),i=K(r);{let e=P(()=>T(M)===T(t).id?`true`:void 0);a(i,()=>yR,(r,i)=>{i(r,{get"data-mode-active"(){return T(e)},class:`gap-1.5`,onclick:()=>he(T(t).id),children:(e,r)=>{var i=Fz(),a=K(i),o=U(a),s=e=>{vn(e,{class:`h-3 w-3`,"aria-hidden":`true`})};m(o,e=>{T(M)===T(t).id&&e(s)}),n(a);var l=R(a,2),u=j(l,!0);V(()=>c(u,T(t).label)),v(e,i)},$$slots:{default:!0}})})}v(e,r)}),v(e,i)},$$slots:{default:!0}})}),v(e,r)};m(s,e=>{T(se)&&e(l)}),v(e,i)},$$slots:{default:!0}})});var Be=R(ze,2),Ve=U(Be);rr(Ve,{class:`h-4 w-4`}),n(Be);var He=R(Be,2),We=U(He),Ge=U(We);{let e=P(()=>T(fe)===`image`?`opacity-0`:``);fl(Ge,{get class(){return`h-4 w-4 ${T(e)??``}`}})}var Ke=R(Ge,2),qe=e=>{mn(e,{class:`absolute inset-0 m-auto h-4 w-4 animate-spin`,"aria-hidden":`true`})};m(Ke,e=>{T(fe)===`image`&&e(qe)}),n(We),n(He);var Ye=R(He,2),Xe=U(Ye),Ze=U(Xe);{let e=P(()=>T(fe)===`file`?`opacity-0`:``);qL(Ze,{get class(){return`h-4 w-4 ${T(e)??``}`}})}var Qe=R(Ze,2),$e=e=>{mn(e,{class:`absolute inset-0 m-auto h-4 w-4 animate-spin`,"aria-hidden":`true`})};m(Qe,e=>{T(fe)===`file`&&e($e)}),n(Xe),n(Ye);var nt=R(Ye,4),rt=e=>{var r=J(),i=K(r);a(i,()=>dR,(e,r)=>{r(e,{get open(){return T(ie)},set open(e){N(ie,e,!0)},children:(e,r)=>{var i=Iz(),o=K(i);{let e=P(()=>T(re).dangling?`border-amber-500/60 text-amber-600 dark:text-amber-400`:`border-border text-muted-foreground hover:text-foreground`),t=P(()=>T(D)?`Switch after the current turn ends`:`Switch the active model — route configuration lives in Settings → Model`);a(o,()=>ER,(n,r)=>{r(n,{get class(){return`flex h-7 max-w-[150px] items-center gap-1.5 rounded-full border px-2.5 text-[11px] transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50 ${T(e)??``}`},get title(){return T(t)},"aria-label":`Switch active model`,get disabled(){return T(D)},onkeydown:e=>{e.key===`Escape`&&T(ie)&&(e.stopPropagation(),N(ie,!1))},children:(e,t)=>{var n=Rz(),r=K(n),i=j(r,!0),a=R(r,2),o=e=>{var t=Lz();V(()=>z(t,`title`,`Reasoning effort: ${T(re).effort}`)),v(e,t)};m(a,e=>{T(re).effort&&e(o)}),lR(R(a,2),{class:`h-3 w-3 shrink-0 opacity-60`,"aria-hidden":`true`}),V(()=>c(i,T(re).label)),v(e,n)},$$slots:{default:!0}})})}var s=R(o,2);a(s,()=>hR,(e,r)=>{r(e,{align:`end`,class:`max-h-72 w-56 overflow-y-auto`,onkeydown:e=>{e.key===`Escape`&&(e.stopPropagation(),N(ie,!1))},children:(e,r)=>{var i=Bz(),o=K(i),s=e=>{var t=Iz(),n=K(t);a(n,()=>SR,(e,t)=>{t(e,{"data-dangling":`true`,class:`px-2 py-1.5 text-[10px] font-medium text-amber-600 dark:text-amber-400`,children:(e,t)=>{ae();var n=S();V(()=>c(n,`${T(re).label??``} — outside Routes`)),v(e,n)},$$slots:{default:!0}})});var r=R(n,2);a(r,()=>wR,(e,t)=>{t(e,{})}),v(e,t)};m(o,e=>{T(re).dangling&&e(s)});var l=R(o,2);t(l,17,()=>T(H),e=>e.provider,(e,r)=>{var i=Iz(),o=K(i);a(o,()=>_R,(e,i)=>{i(e,{children:(e,i)=>{var o=Iz(),s=K(o);a(s,()=>OR,(e,t)=>{t(e,{class:`flex items-center gap-1.5 px-2 py-1 text-[10px] font-medium`,children:(e,t)=>{var n=zz(),i=K(n),a=j(i,!0),o=R(i,2),s=j(o,!0);V(()=>{k(i,`background: ${T(r).color??``}`),c(a,T(r).letter),c(s,T(r).label)}),v(e,n)},$$slots:{default:!0}})});var l=R(s,2);t(l,16,()=>T(r).models,e=>e,(e,t)=>{var i=J(),o=K(i);{let e=P(()=>ce(T(r).provider,t)?`true`:void 0);a(o,()=>yR,(i,a)=>{a(i,{get"data-model-active"(){return T(e)},class:`gap-1.5`,onclick:()=>void le(T(r).provider,t),children:(e,i)=>{var a=Fz(),o=K(a),s=U(o),l=e=>{vn(e,{class:`h-3 w-3`,"aria-hidden":`true`})},u=P(()=>ce(T(r).provider,t));m(s,e=>{T(u)&&e(l)}),n(o);var d=R(o,2),f=j(d,!0);V(()=>c(f,t)),v(e,a)},$$slots:{default:!0}})})}v(e,i)}),v(e,o)},$$slots:{default:!0}})});var s=R(o,2);a(s,()=>wR,(e,t)=>{t(e,{})}),v(e,i)});var u=R(l,2);a(u,()=>yR,(e,t)=>{t(e,{onclick:()=>et(`model`),children:(e,t)=>{ae();var n=S(`Open settings →`);v(e,n)},$$slots:{default:!0}})}),v(e,i)},$$slots:{default:!0}})}),v(e,i)},$$slots:{default:!0}})}),v(e,r)};m(nt,e=>{T(re)&&e(rt)});var it=R(nt,2);cz(it,{});var at=R(it,2),ot=U(at),st=e=>{sR(e,{class:`h-3 w-3`})},ct=e=>{tR(e,{class:`h-4 w-4`})},ut=e=>{rR(e,{class:`h-4 w-4`})},dt=e=>{aR(e,{class:`h-4 w-4`})};m(ot,e=>{T(A)===`stop`?e(st):T(A)===`queue`?e(ct,1):T(A)===`steer`?e(ut,2):e(dt,-1)}),n(at),n(Re),n(Oe),V(()=>{z(Be,`aria-expanded`,T(x)),z(He,`aria-busy`,T(fe)===`image`),He.disabled=T(fe)!==null,z(Ye,`aria-busy`,T(fe)===`file`),Ye.disabled=T(fe)!==null,me(at,1,`relative flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-full transition-colors after:absolute after:-inset-0.5 after:content-[''] ${T(A)===`stop`?`bg-destructive text-white hover:bg-destructive/90`:T(A)===`queue`||T(A)===`steer`?`bg-primary/85 text-primary-foreground hover:bg-primary`:`bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50`}`),z(at,`aria-label`,T(A)===`stop`?`Cancel current activity`:T(A)===`queue`?`Queue message after the current turn`:T(A)===`steer`?`Steer the current turn with this message`:`Send message`),z(at,`title`,T(A)===`stop`?`Cancel current activity`:T(A)===`queue`?`Queue (Enter) · Steer (⌘/Ctrl+Enter)`:T(A)===`steer`?`Steer (Enter) · Queue (⌘/Ctrl+Enter)`:`Send (Enter)`),at.disabled=T(A)!==`stop`&&(!T(O)||Q.sending)}),l(`click`,Be,()=>{N(x,!T(x)),T(o)?.focus()}),l(`click`,He,()=>void pe(`image`)),l(`click`,Ye,()=>void pe(`file`)),l(`click`,at,()=>T(A)===`stop`?void zn():ue(T(A)===`steer`&&An()===`queue`)),v(e,Oe),b()}w([`click`,`keydown`,`keyup`]);var Uz=r(`<div class="border-t border-destructive/30 bg-destructive/8 px-3 py-1.5 text-xs text-destructive" role="alert"> </div>`),Wz=r(`<div class="mx-3 mb-1.5 flex h-7 shrink-0 items-center justify-between gap-2 rounded-lg bg-amber-500/10 px-2.5 text-[11px] text-amber-700 dark:text-amber-400" role="status"><span class="truncate">Editing — resending keeps your full history (append-only)</span> <button type="button" class="shrink-0 rounded p-0.5 text-amber-700/80 hover:text-amber-700 dark:text-amber-400/80 dark:hover:text-amber-400" title="Cancel edit" aria-label="Cancel edit"><!></button></div>`),Gz=r(`<aside aria-label="Agent panel"><!> <div class="absolute inset-y-0 left-0 z-10 hidden w-1.5 cursor-col-resize touch-none select-none hover:bg-primary/30 min-[720px]:block" role="separator" aria-orientation="vertical" aria-label="Resize agent panel"></div> <!> <!> <!> <!> <!> <!></aside>`);function Kz(e,t){i(t,!0),W(()=>{Qn.open&&Je.status===`connected`&&Xn.view===null&&!Xn.loading&&Yn()}),W(()=>{if(Qn.seedPrompt){let e=Qn.seedPrompt;Qn.seedPrompt=null,Z.text.length===0&&(Z.text=e)}});let r=B(!1),a=0,o=0;function s(e){if(e.button!==0)return;N(r,!0),a=e.clientX,o=Qn.width;let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId),document.body.style.userSelect=`none`,document.body.style.cursor=`col-resize`}function u(){T(r)&&(N(r,!1),document.body.style.userSelect=``,document.body.style.cursor=``)}var d=Gz();f(`keydown`,O,e=>{e.key===`Escape`&&Qn.open&&!document.querySelector(`[role='dialog']`)&&$n(!1)}),f(`pointermove`,O,e=>{T(r)&&tr(o+(a-e.clientX))}),f(`pointerup`,O,u),f(`pointercancel`,O,u);var p=U(d);YL(p,{});var h=R(p,2),g=R(h,2);ol(g,{});var _=R(g,2);GL(_,{});var y=R(_,2),x=e=>{var t=Uz(),n=j(t,!0);V(()=>c(n,Q.promptError??Q.error)),v(e,t)};m(y,e=>{(Q.promptError??Q.error)&&e(x)});var S=R(y,2),C=e=>{$L(e,{get todos(){return Q.todos}})};m(S,e=>{Q.sessionId&&Q.todos.length>0&&e(C)});var w=R(S,2),E=e=>{var t=Wz(),r=R(U(t),2),i=U(r);hn(i,{class:`h-3 w-3`}),n(r),n(t),l(`click`,r,()=>{Z.editing!==null&&(Z.text=``),Z.editing=null}),v(e,t)};m(w,e=>{Z.editing!==null&&e(E)}),Hz(R(w,2),{}),n(d),V(()=>{me(d,1,`relative flex h-full w-full flex-col bg-background min-[720px]:w-(--agent-panel-width) min-[720px]:overflow-hidden duration-150 ease-in-out ${T(r)?``:`min-[720px]:transition-[width,border-color] max-[720px]:transition-[transform,visibility]`} ${Qn.open?`border-l border-border`:`border-l-0 max-[720px]:translate-x-full max-[720px]:invisible`}`),k(d,`--agent-panel-width: ${(Qn.open?Qn.width:0)??``}px`)}),l(`pointerdown`,h,s),v(e,d),b()}w([`pointerdown`,`click`]);var qz=r(`<link rel="icon" href="/icons/monochrome-mini.png" type="image/png"/> <link rel="apple-touch-icon" href="/icons/monochrome-mini.png"/>`,1),Jz=r(`<span class="px-1 text-xs font-medium text-muted-foreground">Skill Creator</span>`),Yz=r(`<button class="no-drag flex h-6 w-8 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground max-[720px]:h-11 max-[720px]:w-11" aria-label="Open command palette" aria-keyshortcuts="Meta+K" title="Command palette (Cmd+K)"><!></button> <button class="no-drag flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground max-[720px]:h-11 max-[720px]:w-11" aria-label="Reload app" title="Reload"><!></button> <button aria-label="Toggle agent panel" title="Agent panel"><!></button>`,1),Xz=r(`<div class="flex min-h-8 items-center border-y border-destructive/30 bg-destructive/8 px-3 text-xs text-destructive" role="status"> </div>`),Zz=r(`<button><!></button>`),Qz=r(`<div class="relative flex h-screen w-screen flex-col overflow-hidden bg-background text-foreground"><!> <!> <div class="flex min-h-0 flex-1"><nav class="flex w-14 shrink-0 flex-col items-center gap-1 border-r border-border bg-muted/30 py-3"><!> <div class="my-1 h-px w-8 bg-border"></div> <button class="flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground" title="Import workspace" aria-label="Import workspace"><!></button></nav> <main class="min-w-0 flex-1 overflow-hidden"><!> <!></main> <div><!></div></div></div>`),$z=r(`<!> <!> <!> <!>`,1);function eB(e,r){i(r,!0),ue(()=>(He(),_e.url.pathname===`/`&&ge(`/workspaces`,{replaceState:!0}),Ae({navigate(e,t){t===`REPLACE`?ge(e,{replaceState:!0,keepFocus:!0,noScroll:!0}):ge(e)}}),Ke(),We));let o=P(()=>_e.url.pathname);W(()=>{T(o).startsWith(`/creator`)?Qc(Zc):Qc(Xc)});let s=P(()=>Je.status===`connected`);W(()=>{T(s)&&dt()});let u=P(()=>De.list()),d=P(()=>ke(_e.url.pathname)?.app??null);function f(e){ge(`/${e}`)}var p=$z();x(`12qhfyh`,e=>{var t=qz();ae(2),v(e,t)});var h=K(p);Jc(h,{children:(e,i)=>{var o=Qz(),s=U(o);gr(s,{variant:`main`,left:e=>{var t=Jz();v(e,t)},right:e=>{var t=Yz(),r=K(t);el(U(r),{class:`h-3.5 w-3.5`}),n(r);var i=R(r,2),a=U(i);wn(a,{class:`h-3.5 w-3.5`}),n(i);var o=R(i,2),s=U(o);xe(s,{class:`h-3.5 w-3.5`}),n(o),V(()=>{me(o,1,`no-drag flex h-6 w-6 items-center justify-center rounded transition-colors ${Qn.open?`bg-primary/10 text-primary`:`text-muted-foreground hover:text-foreground`} max-[720px]:h-11 max-[720px]:w-11`),z(o,`aria-pressed`,Qn.open)}),l(`pointerdown`,r,e=>e.stopPropagation()),l(`click`,r,()=>globalThis.dispatchEvent(new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0}))),l(`pointerdown`,i,e=>e.stopPropagation()),l(`click`,i,()=>globalThis.location.reload()),l(`pointerdown`,o,e=>e.stopPropagation()),l(`click`,o,()=>$n(!Qn.open)),v(e,t)},$$slots:{left:!0,right:!0}});var p=R(s,2),h=e=>{var t=Xz(),n=j(t,!0);V(()=>c(n,Je.error)),v(e,t)};m(p,e=>{Je.status===`disconnected`&&e(h)});var _=R(p,2),y=U(_),b=U(y);t(b,17,()=>T(u),e=>e.id,(e,t)=>{let r=P(()=>T(t).icon);var i=Zz(),o=U(i);a(o,()=>T(r),(e,t)=>{t(e,{class:`h-5 w-5`})}),n(i),V(()=>{me(i,1,`flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-muted ${T(d)===T(t).id?`bg-accent text-primary ring-1 ring-inset ring-primary/25`:`text-muted-foreground`}`),z(i,`title`,T(t).name),z(i,`aria-label`,T(t).name),z(i,`aria-current`,T(d)===T(t).id?`page`:void 0)}),l(`click`,i,()=>f(T(t).id)),v(e,i)});var x=R(b,4),S=U(x);Ce(S,{class:`h-5 w-5`}),n(x),n(y);var C=R(y,2),w=U(C);Me(w,{});var E=R(w,2);g(E,()=>r.children??L),n(C);var D=R(C,2);Kz(U(D),{}),n(D),n(_),n(o),V(()=>me(D,1,`agent-panel-layer shrink-0 max-[720px]:absolute max-[720px]:inset-0 max-[720px]:z-40 ${Qn.open?``:`pointer-events-none`}`)),l(`click`,x,()=>ye()),v(e,o)},$$slots:{default:!0}});var _=R(h,2);Ys(_,{});var y=R(_,2);Hc(y,{}),Kc(R(y,2),{}),v(e,p),b()}w([`pointerdown`,`click`]);export{eB as component,sr as universal};