@cline/cli-linux-arm64 3.0.60 → 3.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cline +0 -0
- package/cline-hub/webview/assets/Chat-nhlJdFjI.js +342 -0
- package/cline-hub/webview/assets/abnfDiagram-N423BO3Z-CA3n4CVB.js +1 -0
- package/cline-hub/webview/assets/architectureDiagram-T3A2C74G-BGNrlwUL.js +36 -0
- package/cline-hub/webview/assets/badge-X4W3Q0cc.js +1 -0
- package/cline-hub/webview/assets/{blockDiagram-677ZJIJ3-CHD_J6RY.js → blockDiagram-VBNYF7ZC-CvIo5nET.js} +1 -1
- package/cline-hub/webview/assets/{c4Diagram-LMCZKHZV-ClmFYV3g.js → c4Diagram-5PPSVZJV-B91Sv2Na.js} +1 -1
- package/cline-hub/webview/assets/channel-Cn9dB4WD.js +1 -0
- package/cline-hub/webview/assets/{chunk-32BRIVSS-7roN4V45.js → chunk-2GRJ4B5K-u4MGLwtv.js} +1 -1
- package/cline-hub/webview/assets/{chunk-HOUHSVGY-B04R_umg.js → chunk-4I5QYGJK-0RNwvBrV.js} +1 -1
- package/cline-hub/webview/assets/{chunk-EX3LRPZG-Cy_TQpzv.js → chunk-5RXB4S5H-BHjkdRhh.js} +1 -1
- package/cline-hub/webview/assets/{chunk-MOJQB5TN-B_gKeTxM.js → chunk-6Q2QTUOP-CLgL8rxg.js} +1 -1
- package/cline-hub/webview/assets/{chunk-52WLFC77-DEfoFGdq.js → chunk-7Z6QIM7H-C6_Ywz3w.js} +1 -1
- package/cline-hub/webview/assets/{chunk-V7JOEXUC-BMNa01wQ.js → chunk-GF5L2VYU-iIVxDVKm.js} +1 -1
- package/cline-hub/webview/assets/chunk-I66GZJ75-DXqP3B91.js +126 -0
- package/cline-hub/webview/assets/{chunk-PUDLZKDR-C6jX_SVA.js → chunk-JQJVKLGR-CmK9TOTe.js} +2 -2
- package/cline-hub/webview/assets/{chunk-VR4S4FIN-NuklvPa4.js → chunk-KBJHAD2P-L-89C026.js} +1 -1
- package/cline-hub/webview/assets/{chunk-ICXQ74PX-BSKRMyFr.js → chunk-NSK5VX7P-D5026Kzu.js} +1 -1
- package/cline-hub/webview/assets/{chunk-ZGVPDNZ5-CeJ5hUbe.js → chunk-QR6OTTB3-DgKOIk7B.js} +1 -1
- package/cline-hub/webview/assets/{chunk-OGEWGWER-CR4zh_DV.js → chunk-UBXNYLIW-DzzRI8B_.js} +1 -1
- package/cline-hub/webview/assets/{chunk-C7G6YPKG-DBhUCKu7.js → chunk-W5SLKNZC-jIqX_Eb5.js} +1 -1
- package/cline-hub/webview/assets/{chunk-Q4XR5HBZ-DkRpWOkn.js → chunk-WRU74C26-BSENSjFs.js} +1 -1
- package/cline-hub/webview/assets/classDiagram-JCYQIIEL-BMEETwfQ.js +1 -0
- package/cline-hub/webview/assets/classDiagram-v2-OCEON4UE-BMEETwfQ.js +1 -0
- package/cline-hub/webview/assets/{cose-bilkent-JH36ORCC-0-dytQ64.js → cose-bilkent-JH36ORCC-DFv1GHTs.js} +1 -1
- package/cline-hub/webview/assets/cynefinDiagram-MW4NZA55-CIoeFR2b.js +62 -0
- package/cline-hub/webview/assets/{dagre-VKFMJZFB-C3zd729J.js → dagre-VZM6K2ZE-CXd9m4cA.js} +1 -1
- package/cline-hub/webview/assets/{diagram-OA4YK3LP-Bj--3hBp.js → diagram-7IWD3JNH-CgiYOAGC.js} +3 -3
- package/cline-hub/webview/assets/{diagram-FQU43EPY-vHaV1X0k.js → diagram-B4RE2ZJO-i1LZz3qn.js} +1 -1
- package/cline-hub/webview/assets/diagram-LBJQPF4R-GOvZ7wow.js +24 -0
- package/cline-hub/webview/assets/diagram-Q27KOJAE-C-x1hqFU.js +24 -0
- package/cline-hub/webview/assets/diagram-UB23O5K3-Ds1emBxU.js +41 -0
- package/cline-hub/webview/assets/ebnfDiagram-BXEA7PRR-Bmu-47tU.js +1 -0
- package/cline-hub/webview/assets/{erDiagram-Q63AITRT-BYUDNAG5.js → erDiagram-JOGREHBK--TO8WYZl.js} +1 -1
- package/cline-hub/webview/assets/extensions-view-SuauWCKD.js +1 -0
- package/cline-hub/webview/assets/flowDiagram-UKHOOZJN-epuPN-mi.js +1 -0
- package/cline-hub/webview/assets/{ganttDiagram-NO4QXBWP-XEhvpkHf.js → ganttDiagram-PKOTCBZU-BJMCqdx8.js} +1 -1
- package/cline-hub/webview/assets/{gitGraphDiagram-IHSO6WYX-2WUvHlRx.js → gitGraphDiagram-DS77QQ5N-CFngxqjY.js} +1 -1
- package/cline-hub/webview/assets/highlighted-body-KPVGNVTW-C38puTq_.js +1 -0
- package/cline-hub/webview/assets/index-BH5QAVsD.css +1 -0
- package/cline-hub/webview/assets/index-Lryt7pNP.js +10 -0
- package/cline-hub/webview/assets/infoDiagram-6WML65LV-HYF3E1dT.js +2 -0
- package/cline-hub/webview/assets/{ishikawaDiagram-FXEZZL3T-Bt1KHIH7.js → ishikawaDiagram-WSZJBQD7-BXMe4UcZ.js} +2 -2
- package/cline-hub/webview/assets/{journeyDiagram-5HDEW3XC-BVfSAExa.js → journeyDiagram-NVQOT4AX-CRKFmsae.js} +1 -1
- package/cline-hub/webview/assets/{kanban-definition-HUTT4EX6-CdFpXq3T.js → kanban-definition-27J2QSJJ-fGza5kV5.js} +4 -4
- package/cline-hub/webview/assets/label-CfYx7R2D.js +76 -0
- package/cline-hub/webview/assets/{line-Zi3iUihi.js → line-BImJQVif.js} +1 -1
- package/cline-hub/webview/assets/mermaid-HWGCJPDP-B2eHIVs6.js +1 -0
- package/cline-hub/webview/assets/{mermaid-layout-C2x7inlt.js → mermaid-layout-CGd-uY3x.js} +1 -1
- package/cline-hub/webview/assets/mermaid-markup-D01n6Kcj.js +259 -0
- package/cline-hub/webview/assets/mermaid-parser-B74RvNk1.js +3 -0
- package/cline-hub/webview/assets/mermaid-parser-ByV-ZOdd.js +1 -0
- package/cline-hub/webview/assets/mermaid-parser-C2jETkNP.js +2 -0
- package/cline-hub/webview/assets/mermaid-parser-C3SJa12Y.js +1 -0
- package/cline-hub/webview/assets/mermaid-parser-CFqrADy2.js +4 -0
- package/cline-hub/webview/assets/mermaid-parser-CiEp2wH6.js +1 -0
- package/cline-hub/webview/assets/{mermaid-parser-BICK3FdT.js → mermaid-parser-DHwB1DNv.js} +2 -2
- package/cline-hub/webview/assets/mermaid-parser-DgB__rYs.js +1 -0
- package/cline-hub/webview/assets/mermaid.core-CNhdxt2h.js +42 -0
- package/cline-hub/webview/assets/{mindmap-definition-LN4V7U3C-BivXsx29.js → mindmap-definition-FAOFIHXS-CSIdPH6Q.js} +1 -1
- package/cline-hub/webview/assets/pegDiagram-VL7TDLO6-C6mMcz9U.js +1 -0
- package/cline-hub/webview/assets/{pieDiagram-ENE6RG2P-DkDm2qZ7.js → pieDiagram-7S7Q4E2Y-_Em6O_U1.js} +2 -2
- package/cline-hub/webview/assets/{quadrantDiagram-ABIIQ3AL-oKoCSLjB.js → quadrantDiagram-CIZ2JOQS-DAUZ-M5i.js} +1 -1
- package/cline-hub/webview/assets/railroadDiagram-AXF67PYL-D-nONgIY.js +1 -0
- package/cline-hub/webview/assets/{requirementDiagram-TGXJPOKE-XKSjP20t.js → requirementDiagram-LRYGKXZP--TyKFbQR.js} +1 -1
- package/cline-hub/webview/assets/{sankeyDiagram-HTMAVEWB-Bj74CCDT.js → sankeyDiagram-W5VNT64P-D_L0wHGo.js} +1 -1
- package/cline-hub/webview/assets/{sequenceDiagram-DBY2YBRQ-D-rKANAQ.js → sequenceDiagram-SI44F4Z6-DQZqzwJM.js} +2 -2
- package/cline-hub/webview/assets/settings-view-D6D49OyW.js +1 -0
- package/cline-hub/webview/assets/stateDiagram-OKZ733FA-CRrKMpks.js +1 -0
- package/cline-hub/webview/assets/stateDiagram-v2-UEYNNEHI-gzRtUcKB.js +1 -0
- package/cline-hub/webview/assets/{swimlanes-5IMT3BWC-C3eLBK2s.js → swimlanes-SLNWSIFB-z7E3j6mU.js} +1 -1
- package/cline-hub/webview/assets/swimlanesDiagram-ULZ7WXOC-eylwAnWt.js +8 -0
- package/cline-hub/webview/assets/switch-DrjcFF6_.js +1 -0
- package/cline-hub/webview/assets/{timeline-definition-FHXFAJF6-B7v7GMSp.js → timeline-definition-Z64GVDOM-s7-rEymV.js} +1 -1
- package/cline-hub/webview/assets/{vennDiagram-L72KCM5P-CTNU0xJq.js → vennDiagram-T6HMQDX7-HuTwN2dY.js} +2 -2
- package/cline-hub/webview/assets/{vscode-2dRY2WFo.js → vscode-CFosRdBr.js} +1 -1
- package/cline-hub/webview/assets/{wardleyDiagram-EHGQE667-B1h41ZEX.js → wardleyDiagram-T6FBY63Y-BG9WRwXn.js} +2 -2
- package/cline-hub/webview/assets/{xychartDiagram-FW5EYKEG--ZLgcMtO.js → xychartDiagram-ELKLHX3M-C0kPny3I.js} +3 -3
- package/cline-hub/webview/assets/zap-BF3XOCN3.js +1 -0
- package/cline-hub/webview/index.html +3 -4
- package/package.json +1 -1
- package/cline-hub/webview/assets/Chat-D1yFEsnx.js +0 -201
- package/cline-hub/webview/assets/DialogTitle-BqajMDIm.js +0 -1
- package/cline-hub/webview/assets/abnfDiagram-VRR7QNED-Be9ivyLF.js +0 -1
- package/cline-hub/webview/assets/architectureDiagram-ZJ3FMSHR-BDsKCTs4.js +0 -36
- package/cline-hub/webview/assets/badge-6HhkS3z9.js +0 -1
- package/cline-hub/webview/assets/channel-BIC0YCzT.js +0 -1
- package/cline-hub/webview/assets/chunk-BO2N2NFS-BsZ82u-z.js +0 -131
- package/cline-hub/webview/assets/chunk-FWX5IMBZ-DO4vTS0i.js +0 -2
- package/cline-hub/webview/assets/chunk-VAUOI2AC-DC6y0Pon.js +0 -1
- package/cline-hub/webview/assets/chunk-WYO6CB5R-Ht1kfqSA.js +0 -126
- package/cline-hub/webview/assets/chunk-ZIRB5QZD-O39ZBUk3.js +0 -32
- package/cline-hub/webview/assets/classDiagram-OUVF2IWQ-Dsa9aGWZ.js +0 -1
- package/cline-hub/webview/assets/classDiagram-v2-EOCWNBFH-Dsa9aGWZ.js +0 -1
- package/cline-hub/webview/assets/cynefinDiagram-TSTJHNR4-CM3Cb0zD.js +0 -62
- package/cline-hub/webview/assets/desktop-client-BzJm9_zB.js +0 -1
- package/cline-hub/webview/assets/diagram-G47NLZAW-3CFUWxkm.js +0 -24
- package/cline-hub/webview/assets/diagram-NH7WQ7WH-knhXCIYS.js +0 -24
- package/cline-hub/webview/assets/diagram-WEI45ONY-CU1ul1cq.js +0 -41
- package/cline-hub/webview/assets/ebnfDiagram-CCIWWBDH-CO67IabF.js +0 -1
- package/cline-hub/webview/assets/extensions-view-CrNdCNmP.js +0 -1
- package/cline-hub/webview/assets/flowDiagram-23GEKE2U-DB8ijrFq.js +0 -1
- package/cline-hub/webview/assets/highlighted-body-OFNGDK62-D1t0OvrR.js +0 -1
- package/cline-hub/webview/assets/index-aYt5DmxH.js +0 -10
- package/cline-hub/webview/assets/index-eMmOF_mm.css +0 -1
- package/cline-hub/webview/assets/infoDiagram-FWYZ7A6U-BuLkUwbh.js +0 -2
- package/cline-hub/webview/assets/label-DySiNulg.js +0 -76
- package/cline-hub/webview/assets/mermaid-GHXKKRXX-Ckyoy2Mi.js +0 -1
- package/cline-hub/webview/assets/mermaid-markup-4KnljNms.js +0 -259
- package/cline-hub/webview/assets/mermaid-parser-B5dtuYEh.js +0 -2
- package/cline-hub/webview/assets/mermaid-parser-BYr1RLu9.js +0 -3
- package/cline-hub/webview/assets/mermaid-parser-Bd5X_psc.js +0 -1
- package/cline-hub/webview/assets/mermaid-parser-CUdSKy0R.js +0 -1
- package/cline-hub/webview/assets/mermaid-parser-DL14msmj.js +0 -1
- package/cline-hub/webview/assets/mermaid-parser-DMx__WIl.js +0 -1
- package/cline-hub/webview/assets/mermaid-parser-Dp5WGUCu.js +0 -1
- package/cline-hub/webview/assets/mermaid-parser-u_Yu50JG.js +0 -4
- package/cline-hub/webview/assets/mermaid.core-gn7g72XA.js +0 -11
- package/cline-hub/webview/assets/pegDiagram-2B236MQR-B3bct9eT.js +0 -1
- package/cline-hub/webview/assets/railroadDiagram-RFXS5EU6-vFIfQEnq.js +0 -1
- package/cline-hub/webview/assets/settings-view-snjUAWHF.js +0 -1
- package/cline-hub/webview/assets/stateDiagram-2N3HPSRC-B1gVQY9Z.js +0 -1
- package/cline-hub/webview/assets/stateDiagram-v2-6OUMAXLB-BAbYfZMc.js +0 -1
- package/cline-hub/webview/assets/swimlanesDiagram-G3AALYLV-BiyLi762.js +0 -8
- package/cline-hub/webview/assets/switch-CsW_9J9M.js +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlighted-body-KPVGNVTW-C38puTq_.js","./rolldown-runtime-B0Z9INg1.js","./bundle-mjs-CyB9GzWm.js","./bash-B7CDPTg5.js","./shellscript-CLZ0U2zV.js","./html-BY76lXLH.js","./css-BsVw1vtW.js","./javascript-BgS3c2Ky.js","./mermaid.core-CNhdxt2h.js","./mermaid-parser-HclGiUj8.js","./mermaid-markup-D01n6Kcj.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-BY_WSiz7.js","./chunk-I66GZJ75-DXqP3B91.js","./chunk-NSK5VX7P-D5026Kzu.js","./dist-BDCdLWk4.js","./chunk-4I5QYGJK-0RNwvBrV.js","./chunk-WRU74C26-BSENSjFs.js","./chunk-7BUUIJ7U-Bb538aSH.js","./chunk-UBXNYLIW-DzzRI8B_.js","./chunk-W5SLKNZC-jIqX_Eb5.js","./chunk-QR6OTTB3-DgKOIk7B.js","./rough.esm-Dy-Kn_BL.js","./chunk-7Z6QIM7H-C6_Ywz3w.js","./line-BImJQVif.js","./path-fybaL0A-.js","./array-BifhSqXX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{a,i as o,n as s,r as c,t as l}from"./bundle-mjs-CyB9GzWm.js";import{Bt as u,C as d,F as f,G as p,Ht as m,I as h,L as g,R as _,T as v,Tn as y,Wn as b,X as x,Z as S,_t as C,an as w,ar as T,c as E,j as ee,jn as D,ln as te,n as O,on as ne,or as k,rn as re,sn as ie,t as ae,un as oe,vt as se,w as A,yt as ce,z as j}from"./vscode-CFosRdBr.js";import{B as le,F as ue,H as de,L as fe,P as pe,U as me,V as he,W as ge,_ as _e,c as ve,g as ye,h as be,i as xe,l as Se,m as Ce,n as we,o as Te,p as Ee,r as De,t as Oe,v as ke,y as Ae}from"./label-CfYx7R2D.js";import{a as je,i as Me,r as Ne,t as Pe}from"./switch-DrjcFF6_.js";import{t as Fe}from"./mermaid-parser-HclGiUj8.js";import{B as Ie,F as Le,H as Re,L as ze,N as Be,V as Ve,j as He,m as Ue}from"./index-Lryt7pNP.js";import{n as We,t as Ge}from"./badge-X4W3Q0cc.js";var Ke=_(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),qe=_(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Je=_(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ye=_(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Xe=_(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ze=_(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Qe=_(`file-code`,[[`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`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),$e=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),et=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),tt=_(`hat-glasses`,[[`path`,{d:`M14 18a2 2 0 0 0-4 0`,key:`1v8fkw`}],[`path`,{d:`m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11`,key:`1fkr7p`}],[`path`,{d:`M2 11h20`,key:`3eubbj`}],[`circle`,{cx:`17`,cy:`18`,r:`3`,key:`82mm0e`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),nt=_(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),rt=_(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),it=_(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),at=_(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ot=_(`signal-low`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}]]),st=_(`signal-high`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}]]),ct=_(`signal-medium`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}]]),lt=_(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ut=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),dt=_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ft=_(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),pt=e(o(),1),M=c(),N=e(a(),1);function mt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ht(...e){return t=>{let n=!1,r=e.map(e=>{let r=mt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():mt(e[t],null)}}}}function gt(...e){return N.useCallback(ht(...e),e)}var _t=Symbol.for(`react.lazy`),vt=N.use;function yt(e){return typeof e==`object`&&!!e&&`then`in e}function bt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_t&&`_payload`in e&&yt(e._payload)}function xt(e){let t=St(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e;bt(r)&&typeof vt==`function`&&(r=vt(r._payload));let a=N.Children.toArray(r),o=a.find(wt);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function St(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(bt(n)&&typeof vt==`function`&&(n=vt(n._payload)),N.isValidElement(n)){let e=Et(n),i=Tt(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol(`radix.slottable`);function wt(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}function Tt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Et(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dt(e){if(!(e.length>8388608||!fe(e)))try{let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}catch{return}}var Ot=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/i;function kt(e){let t=e.mediaType.trim().toLowerCase();if(Ot.test(t))switch(e.modality){case`image`:return pe.includes(t)?t:void 0;case`audio`:return t.startsWith(`audio/`)?t:void 0;case`video`:return t.startsWith(`video/`)?t:void 0;case`file`:return`application/octet-stream`}}function At(e){let t=e.source.type===`base64`?e.source.data:void 0,[n,r]=(0,N.useState)(),i=kt(e);return(0,N.useEffect)(()=>{if(r(void 0),t===void 0||i===void 0)return;let e=Dt(t);if(!e||typeof URL.createObjectURL!=`function`)return;let n;try{n=URL.createObjectURL(new Blob([e],{type:i}))}catch{return}return r(n),()=>URL.revokeObjectURL?.(n)},[i,t]),n}function jt(e){return e.source.type===`artifact`?`Generated ${e.modality} is stored as an artifact (${e.source.artifactId}).`:e.source.type===`url`?`Generated ${e.modality} requires a trusted remote-media resolver.`:`Generated ${e.modality} could not be rendered.`}function Mt({media:e,className:t,classNames:n}){let r=At(e),i=r?.startsWith(`blob:`)?r:void 0;if(!i)return(0,M.jsx)(`div`,{className:n?.unavailable??t,"data-media-id":e.id,"data-testid":`generated-media-unavailable`,children:jt(e)});let a=n?.[e.modality]??t;switch(e.modality){case`image`:return(0,M.jsx)(`img`,{alt:e.name??`Generated image`,className:a,"data-media-id":e.id,src:i});case`audio`:return(0,M.jsx)(`audio`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`video`:return(0,M.jsx)(`video`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`file`:return(0,M.jsx)(`a`,{className:a,"data-media-id":e.id,download:e.name??!0,href:i,children:e.name??`Generated file (${e.mediaType})`})}return null}var Nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Pt=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Nt[n[e]&63];return t};function Ft({className:e,orientation:t=`horizontal`,...n}){return(0,M.jsx)(Ue,{"data-slot":`separator`,orientation:t,className:j(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var It=({className:e,children:t,...n})=>(0,M.jsxs)(`div`,{className:j(`flex items-center gap-0.5 overflow-hidden text-muted-foreground`,e),...n,children:[t,(0,M.jsx)(Ft,{})]}),Lt=({className:e,children:t,...n})=>t??(0,M.jsx)(qe,{className:j(`size-4 shrink-0`,e),...n}),Rt=({children:e,variant:t=`ghost`,size:n=`sm`,tooltip:r,...i})=>r?(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{render:(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i}),children:e}),(0,M.jsx)(Ve,{align:`start`,side:`bottom`,children:r})]}):(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i,children:e}),zt={damping:.7,stiffness:.05,mass:1.25},Bt=70,Vt=1e3/60,Ht=350,Ut=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Ut=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Ut=!1}),globalThis.document?.addEventListener(`click`,()=>{Ut=!1});var Wt=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!Ut)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bt}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=qt(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Vt;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:qt(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Gt(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Gt(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=qt(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Ht})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Gt(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var Kt=new Map;function qt(...e){let t={...zt},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return Kt.has(r)||Kt.set(r,Object.freeze(t)),n?`instant`:Kt.get(r)}var Jt=(0,N.createContext)(null),Yt=typeof window<`u`?N.useLayoutEffect:N.useEffect;function Xt({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Wt({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),Yt(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(Jt.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Zt();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Xt||={});function Zt(){let e=(0,N.useContext)(Jt);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Qt=({className:e,...t})=>(0,M.jsx)(Xt,{className:j(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),$t=({className:e,...t})=>(0,M.jsx)(Xt.Content,{className:j(`flex flex-col gap-8 p-4`,e),...t}),en=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Zt(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,M.jsx)(A,{className:j(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,M.jsx)(Ke,{className:`size-4`})})};v(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});var P={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},tn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},nn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},rn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],an=[12288,12288,65281,65376,65504,65510],on=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],sn=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],cn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],ln=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},un=19968,[dn,fn]=pn(cn);function pn(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(un>=i&&un<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var mn=e=>e<161||e>1114109?!1:ln(rn,e),hn=e=>e<12288||e>65510?!1:ln(an,e),gn=e=>e<8361||e>65518?!1:ln(on,e),_n=e=>e<32||e>10630?!1:ln(sn,e),vn=e=>e>=dn&&e<=fn?!0:e<4352||e>262141?!1:ln(cn,e);function yn(e){return mn(e)?`ambiguous`:hn(e)?`fullwidth`:gn(e)?`halfwidth`:_n(e)?`narrow`:vn(e)?`wide`:`neutral`}function bn(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function xn(e){return bn(e),yn(e)}function Sn(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function Cn(e){if(!e||e<4352)return!1;switch(xn(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!Sn(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function wn(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function Tn(e){return e!==null&&e>=65024&&e<=65038}var En=On(/\p{P}|\p{S}/u),Dn=On(/\s/);function On(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function kn(e){return!!(e&tn.characterGroupWhitespace)}function An(e){return(e&qn.cjkPunctuation)===tn.characterGroupPunctuation}function jn(e){return!!(e&qn.cjk)}function Mn(e){return e===qn.ivs}function Nn(e){return!!(e&qn.cjkOrIvs)}function Pn(e){return e===qn.nonEmojiGeneralUseVS}function Fn(e){return!!(e&qn.spaceOrPunctuation)}var In=Kn(/[A-Za-z]/),Ln=Kn(/[\dA-Za-z]/),Rn=Kn(/[#-'*+\--9=?A-Z^-~]/);function zn(e){return e!==null&&(e<32||e===127)}var Bn=Kn(/\d/),Vn=Kn(/[\dA-Fa-f]/),Hn=Kn(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function Un(e){return e!==null&&(e<0||e===32)}function I(e){return e===-2||e===-1||e===32}var Wn=Kn(/\p{P}|\p{S}/u),Gn=Kn(/\s/);function Kn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var qn;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(qn||={});function Jn(e){if(e===P.eof||Un(e)||Dn(e))return tn.characterGroupWhitespace;let t=0;if(e>=4352){if(Tn(e))return qn.nonEmojiGeneralUseVS;switch(Cn(e)){case null:return qn.ivs;case!0:t|=qn.cjk}}return En(e)&&(t|=tn.characterGroupPunctuation),t}function Yn(e,t,n){if(!Pn(e))return e;let r=t(),i=Jn(r);return!r||kn(i)?e:wn(r,n)?qn.cjkPunctuation:Xn(i)}function Xn(e){return e&~qn.ivs}function Zn(e){return!!(e&&e>=55296&&e<=56319)}function Qn(e){return!!(e&&e>=56320&&e<=57343)}function $n(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function er(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var tr=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=er(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function nr(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function rr(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ir(e,t){return e.length>0?(rr(e,e.length,0,t),e):t}function ar(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var or={name:`attention`,resolveAll:sr,tokenize:cr};function sr(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};lr(d,-c),lr(f,c),o={type:c>1?nn.strongSequence:nn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?nn.strongSequence:nn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?nn.strongText:nn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?nn.strong:nn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ir(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ir(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=ir(l,ar(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ir(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ir(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,rr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function cr(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Qn(a)?$n(a,r(),i):a,s=Jn(o),c=new tr(o,r(),i),l=Yn(s,c.value.bind(c),o),u;return d;function d(t){return t===P.asterisk||P.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=Jn(Zn(a)?nr(a,r(),i):a),d=An(l),p=d||kn(l),m=An(c),h=m||kn(c),g=Nn(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||jn(c))||n.includes(o);return s._open=!!(u===P.asterisk?_:_&&(Fn(l)||!v)),s._close=!!(u===P.asterisk?v:v&&(Fn(c)||!_)),t(a)}}function lr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function ur(){return{text:{[P.asterisk]:or,[P.underscore]:or},insideSpan:{null:[or]}}}function dr(){let e=this.data();(e.micromarkExtensions||=[]).push(ur())}var fr=`;`.codePointAt(0)??P.eof,pr=`&`.codePointAt(0)??P.eof;function mr(){return{handlers:{emphasis:hr,strong:gr,text:br}}}hr.peek=_r,gr.peek=vr;function hr(e,t,n,r){return yr(e,t,n,r,_r(e,t,n),1)}function gr(e,t,n,r){return yr(e,t,n,r,vr(e,t,n),2)}function _r(e,t,n){return n.options.emphasis||`*`}function vr(e,t,n){return n.options.strong||`*`}function yr(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=Or(e,t,n,r.before),f=kr(e,t,n,r.after),p=xr(d,Vr(u),i,`open`);p.inside&&u&&(u=Rr(u));let m=xr({current:Hr(u),previous:Br(u)},f,i,`close`);m.inside&&u&&(u=zr(u));let h=c.move(o);s();let g=m.outside&&Pr(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},Fr(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function br(e,t,n,r){let i=Fr(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${Lr(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function xr(e,t,n,r){let i=Dr(e),a=Jn(t);if(!Nn(i)&&!Nn(a))return r===`open`?Sr(i,a,n):Sr(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?Ur:e:i.inside?Ur:e,o=r===`open`?i.inside?Wr:t:i.outside?Wr:t;if(r===`open`?Cr(n,a,o):wr(n,a,o))return i}return l}function Sr(e,t,n){return Er(e)?Er(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:kn(e)?Er(t)?{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Cr(e,t,n){let r=Dr(t),{close:i,open:a}=Tr(r,Jn(n));return e===`_`?a&&(Fn(r)||!i):a}function wr(e,t,n){let r=Jn(n),{close:i,open:a}=Tr(Dr(t),r);return e===`_`?i&&(Fn(r)||!a):i}function Tr(e,t){let n=An(e),r=n||kn(e),i=An(t),a=i||kn(t);return{open:!a||i&&(r||Nn(e)),close:!r||n&&(a||jn(t))}}function Er(e){return!kn(e)&&!An(e)}function Dr(e){let t=Jn(e.current);return e.current===null||!Pn(t)?t:Yn(t,()=>e.previous,e.current)}function Or(e,t,n,r){let i=Hr(r),a=Br(r);if(Ar(i)||Mr(i,a)){let r=Nr(e,t,n,-1);r&&(i=Hr(r),a=Br(r))}return{current:i,previous:a}}function kr(e,t,n,r){let i=Vr(r);if(!jr(i))return i;let a=Nr(e,t,n,1);return a?Vr(a):i}function Ar(e){return e!==null&&56320<=e&&e<=57343}function jr(e){return e!==null&&55296<=e&&e<=56319}function Mr(e,t){return Pn(Jn(e))&&(t===null||t===P.eof)}function Nr(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Ir(s)||void 0}function Pr(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Vr(r.value)??0)>65535}function Fr(e){return e}function Ir(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Ir).join(``):``}function Lr(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Rr(e){let[t=``]=[...e];return Lr(t.codePointAt(0)??P.eof)+e.slice(t.length)}function zr(e){let t=[...e],n=t.pop();return`${t.join(``)}${Lr(n?.codePointAt(0)??P.eof)}`}function Br(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function Vr(e){return e.codePointAt(0)??P.eof}function Hr(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var Ur={current:fr,previous:P.eof},Wr=pr;function Gr(){let e=this.data();(e.toMarkdownExtensions||=[]).push(mr())}function Kr(){dr.call(this),Gr.call(this)}var qr=Kr;function Jr(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[P.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[P.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&rr(o,o.length,0,ar(s,e.slice(r+1,n),t)),rr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),rr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=nn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=Qn(o)?$n(o,i(),a):o,c=Jn(s),l=new tr(s,i(),a),u=Yn(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return P.tilde,s===P.tilde&&d[d.length-1][1].type!==nn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=Jn(s);if(o===P.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=Jn(Zn(o)?nr(o,i(),a):o),p=An(u)||kn(u),h=An(d)||kn(d),g=jn(u)||Mn(c);return l._open=!h||d===tn.attentionSideAfter&&(p||g),l._close=!p||c===tn.attentionSideAfter&&(h||jn(d)),n(o)}}}function Yr(e){let t=this.data();(t.micromarkExtensions||=[]).push(Jr(e))}var Xr=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Zr=`;`.codePointAt(0)??P.eof,Qr=`&`.codePointAt(0)??P.eof;function $r(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Xr}],handlers:{delete:ei,text:ti}}}ei.peek=ni;function ei(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=ui(e,t,n,r.before),l=di(e,t,n,r.after),u=ri(c,Ci(s),`open`);u.inside&&s&&(s=bi(s));let d=ri({current:wi(s),previous:Si(s)},l,`close`);d.inside&&s&&(s=xi(s));let f=a.move(`~~`);i();let p=d.outside&&gi(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},_i(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function ti(e,t,n,r){let i=_i(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${yi(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function ni(){return`~`}function ri(e,t,n){let r=li(e),i=Jn(t);if(!Nn(r)&&!Nn(i))return n===`open`?ii(r,i):ii(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?Ti:e:r.inside?Ti:e,a=n===`open`?r.inside?Ei:t:r.outside?Ei:t;if(n===`open`?ai(i,a):oi(i,a))return r}return c}function ii(e,t){return ci(e)?ci(t)?{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:kn(e)?ci(t)?{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:kn(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function ai(e,t){let{open:n}=si(li(e),Jn(t));return n}function oi(e,t){let n=Jn(t),{close:r}=si(li(e),n);return r}function si(e,t){let n=An(e),r=n||kn(e),i=An(t),a=i||kn(t);return{open:!a||i&&(r||Nn(e)),close:!r||n&&(a||jn(t))}}function ci(e){return!kn(e)&&!An(e)}function li(e){let t=Jn(e.current);return e.current===null||!Pn(t)?t:Yn(t,()=>e.previous,e.current)}function ui(e,t,n,r){let i=wi(r),a=Si(r);if(fi(i)||mi(i,a)){let r=hi(e,t,n,-1);r&&(i=wi(r),a=Si(r))}return{current:i,previous:a}}function di(e,t,n,r){let i=Ci(r);if(!pi(i))return i;let a=hi(e,t,n,1);return a?Ci(a):i}function fi(e){return e!==null&&56320<=e&&e<=57343}function pi(e){return e!==null&&55296<=e&&e<=56319}function mi(e,t){return Pn(Jn(e))&&(t===null||t===P.eof)}function hi(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return vi(s)||void 0}function gi(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Ci(r.value)??0)>65535}function _i(e){return e}function vi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(vi).join(``):``}function yi(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function bi(e){let[t=``]=[...e];return yi(t.codePointAt(0)??P.eof)+e.slice(t.length)}function xi(e){let t=[...e],n=t.pop();return`${t.join(``)}${yi(n?.codePointAt(0)??P.eof)}`}function Si(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function Ci(e){return e.codePointAt(0)??P.eof}function wi(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var Ti={current:Zr,previous:P.eof},Ei=Qr;function Di(){let e=this.data();(e.toMarkdownExtensions||=[]).push($r())}function Oi(e){Yr.call(this,e),Di.call(this)}var ki=Oi,Ai=(function(e){if(e==null)return Fi;if(typeof e==`function`)return Pi(e);if(typeof e==`object`)return Array.isArray(e)?ji(e):Mi(e);if(typeof e==`string`)return Ni(e);throw Error(`Expected function, string, or object as test`)});function ji(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ai(e[n]);return Pi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Mi(e){let t=e;return Pi(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ni(e){return Pi(t);function t(t){return t&&t.type===e}}function Pi(e){return t;function t(t,n,r){return!!(Ii(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Fi(){return!0}function Ii(e){return typeof e==`object`&&!!e&&`type`in e}function Li(e){return e}var Ri=[],zi=`skip`;function Bi(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ai(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Li(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Ri,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Vi(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Vi(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Ri:[e]}function Hi(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Bi(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Ui=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Wi=/^(https?:\/\/|mailto:|www\.)/i,Gi=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Ki=e=>{let t=0;for(let n of e){if(Ui.has(n))return t;t+=n.length}return null},qi=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Ji=e=>({type:`text`,value:e}),Yi=()=>e=>{Hi(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!Gi(e)||!Wi.test(e.url))return;let r=Ki(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=qi(i,e),s=Ji(a);return n.children.splice(t,1,o,s),t+1})};function Xi(){let e=[qr],t=[Yi,ki];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var Zi=Xi(),Qi={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function $i({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=Qi.indicator,imageBlockPolicy:c=Qi.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=la(e,t,n,r,i,a,o,s,c);aa(l),Hi(l,u)}}function ea(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function ta(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var na=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),ra=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function ia(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=ea(e,n);if(!o||ra.has(o.protocol)||!(na.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=ta(e);return o&&t.some(e=>{let t=ea(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function aa(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)aa(t)}}var oa=Symbol(`node-seen`);function sa(e,t,n){return t===Qi.remove?{type:`remove`}:t===Qi.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function ca(e,t,n){if(t===Qi.remove)return{type:`remove`};if(t===Qi.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var la=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[oa])return!0;if(u.tagName===`a`){let n=ia(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[oa]=!0,Hi(u,l),f&&typeof d==`number`){let e=sa(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[zi,d];f.children[d]=e.element}return zi}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=ia(u.properties.src,n,e,r,!0,i);if(t===null){if(u[oa]=!0,Hi(u,l),f&&typeof d==`number`){let e=ca(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[zi,d];f.children[d]=e.element}return zi}return u.properties.src=t,!0}return!0};return l},ua=typeof self==`object`?self:globalThis,da=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ua[e](t)},fa=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ua[e]==`function`?da(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(da(a,o),i)};return r},pa=e=>fa(new Map,e)(0),ma=``,{toString:ha}={},{keys:ga}=Object,_a=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=ha.call(e).slice(8,-1);switch(n){case`Array`:return[1,ma];case`Object`:return[2,ma];case`Date`:return[3,ma];case`RegExp`:return[4,ma];case`Map`:return[5,ma];case`Set`:return[6,ma];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},va=([e,t])=>e===0&&(t===`function`||t===`symbol`),ya=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=_a(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of ga(r))(e||!va(_a(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?ma:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(va(_a(n))||va(_a(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!va(_a(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},ba=(e,{json:t,lossy:n}={})=>{let r=[];return ya(!(t||n),!!t,new Map,r)(e),r},xa=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?pa(ba(e,t)):structuredClone(e):(e,t)=>pa(ba(e,t)),Sa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Sa.prototype.normal={},Sa.prototype.property={},Sa.prototype.space=void 0;function Ca(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Sa(n,r,t)}function wa(e){return e.toLowerCase()}var Ta=class{constructor(e,t){this.attribute=t,this.property=e}};Ta.prototype.attribute=``,Ta.prototype.booleanish=!1,Ta.prototype.boolean=!1,Ta.prototype.commaOrSpaceSeparated=!1,Ta.prototype.commaSeparated=!1,Ta.prototype.defined=!1,Ta.prototype.mustUseProperty=!1,Ta.prototype.number=!1,Ta.prototype.overloadedBoolean=!1,Ta.prototype.property=``,Ta.prototype.spaceSeparated=!1,Ta.prototype.space=void 0;var Ea=r({boolean:()=>L,booleanish:()=>Oa,commaOrSpaceSeparated:()=>Ma,commaSeparated:()=>ja,number:()=>R,overloadedBoolean:()=>ka,spaceSeparated:()=>Aa}),Da=0,L=Na(),Oa=Na(),ka=Na(),R=Na(),Aa=Na(),ja=Na(),Ma=Na();function Na(){return 2**++Da}var Pa=Object.keys(Ea),Fa=class extends Ta{constructor(e,t,n,r){let i=-1;if(super(e,t),Ia(this,`space`,r),typeof n==`number`)for(;++i<Pa.length;){let e=Pa[i];Ia(this,Pa[i],(n&Ea[e])===Ea[e])}}};Fa.prototype.defined=!0;function Ia(e,t,n){n&&(e[t]=n)}function La(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Fa(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wa(r)]=r,n[wa(a.attribute)]=r}return new Sa(t,n,e.space)}var Ra=La({properties:{ariaActiveDescendant:null,ariaAtomic:Oa,ariaAutoComplete:null,ariaBusy:Oa,ariaChecked:Oa,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:Aa,ariaCurrent:null,ariaDescribedBy:Aa,ariaDetails:null,ariaDisabled:Oa,ariaDropEffect:Aa,ariaErrorMessage:null,ariaExpanded:Oa,ariaFlowTo:Aa,ariaGrabbed:Oa,ariaHasPopup:null,ariaHidden:Oa,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Aa,ariaLevel:R,ariaLive:null,ariaModal:Oa,ariaMultiLine:Oa,ariaMultiSelectable:Oa,ariaOrientation:null,ariaOwns:Aa,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:Oa,ariaReadOnly:Oa,ariaRelevant:null,ariaRequired:Oa,ariaRoleDescription:Aa,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:Oa,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function za(e,t){return t in e?e[t]:t}function Ba(e,t){return za(e,t.toLowerCase())}var Va=La({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ja,acceptCharset:Aa,accessKey:Aa,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:Aa,autoFocus:L,autoPlay:L,blocking:Aa,capture:null,charSet:null,checked:L,cite:null,className:Aa,closedBy:null,colorSpace:null,cols:R,colSpan:R,command:null,commandFor:null,content:null,contentEditable:Oa,controls:L,controlsList:Aa,coords:R|ja,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:ka,draggable:Oa,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:Aa,height:R,hidden:ka,high:R,href:null,hrefLang:null,htmlFor:Aa,httpEquiv:Aa,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:Aa,itemRef:Aa,itemScope:L,itemType:Aa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:R,pattern:null,ping:Aa,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:Aa,required:L,reversed:L,rows:R,rowSpan:R,sandbox:Aa,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:Oa,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:Oa,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Aa,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:Oa,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:ja,part:Aa,prefix:null,property:null,results:R,security:null,unselectable:null},space:`html`,transform:Ba}),Ha=La({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Ma,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:Aa,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ja,g2:ja,glyphName:ja,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:Ma,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Aa,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ma,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ma,rev:Ma,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ma,requiredFeatures:Ma,requiredFonts:Ma,requiredFormats:Ma,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:Ma,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ma,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ma,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:za}),Ua=La({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Wa=La({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ba}),Ga=La({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ka={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},qa=/[A-Z]/g,Ja=/-[a-z]/g,Ya=/^data[-\w.:]+$/i;function Xa(e,t){let n=wa(t),r=t,i=Ta;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ya.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ja,Qa);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ja.test(e)){let n=e.replace(qa,Za);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Fa}return new i(r,t)}function Za(e){return`-`+e.toLowerCase()}function Qa(e){return e.charAt(1).toUpperCase()}var $a=Ca([Ra,Va,Ua,Wa,Ga],`html`),eo=Ca([Ra,Ha,Ua,Wa,Ga],`svg`);function to(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function no(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ro=/[#.]/g;function io(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){ro.lastIndex=i;let e=ro.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function ao(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function oo(e){return e.join(` `).trim()}function so(e,t,n){let r=n?mo(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=io(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,co(i))a.unshift(i);else for(let[t,n]of Object.entries(i))lo(e,o.properties,t,n)}for(let e of a)uo(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function co(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function lo(e,t,n,r){let i=Xa(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?ao(r):i.commaSeparated?to(r):i.commaOrSpaceSeparated?ao(to(r).join(` `)):fo(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?po(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(fo(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function uo(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)uo(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?uo(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function fo(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||wa(n)===wa(t)))return!0}return n}function po(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function mo(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var ho=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),go=so($a,`div`),_o=so(eo,`g`,ho);function vo(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=yo(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=yo(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function yo(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
3
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var bo={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},xo={}.hasOwnProperty,So=Object.prototype;function Co(e,t){let n=t||{};return wo({file:n.file||void 0,location:!1,schema:n.space===`svg`?eo:$a,verbose:n.verbose||!1},e)}function wo(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},Do(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:To(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=vo(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},Do(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},Do(e,r,n),n}default:return n=Eo(e,t),n}}function To(e,t){let n=-1,r=[];for(;++n<t.length;){let i=wo(e,t[n]);r.push(i)}return r}function Eo(e,t){let n=e.schema;e.schema=t.namespaceURI===bo.svg?eo:$a;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;xo.call(So,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?_o:go)(t.tagName,i,To(e,t.childNodes));if(Do(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&ko(r.startTag),o=r&&r.endTag&&ko(r.endTag),s=wo(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function Do(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=Oo(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Oo(e,t,n){let r=ko(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)xo.call(n.attrs,i)&&(r[Xa(e.schema,i).property]=ko(n.attrs[i]));n.startTag;let a=ko(n.startTag),o=n.endTag?ko(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function ko(e){let t=Ao({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ao({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ao(e){return e.line&&e.column?e:void 0}var jo={}.hasOwnProperty;function Mo(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&jo.call(t,e)){let n=String(t[e]);i=jo.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var No={},Po={}.hasOwnProperty,Fo=Mo(`type`,{handlers:{root:Lo,element:Ho,text:Bo,comment:Vo,doctype:zo}});function Io(e,t){let n=(t||No).space;return Fo(e,n===`svg`?eo:$a)}function Lo(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=Wo(e.children,n,t),Go(e,n),n}function Ro(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=Wo(e.children,n,t),Go(e,n),n}function zo(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Go(e,t),t}function Bo(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Go(e,t),t}function Vo(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Go(e,t),t}function Ho(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=eo);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Po.call(e.properties,a)){let t=Uo(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:bo[o],childNodes:[],parentNode:null};return s.childNodes=Wo(e.children,s,r),Go(e,s),e.tagName===`template`&&e.content&&(s.content=Ro(e.content,r)),s}function Uo(e,t,n){let r=Xa(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?no(n):oo(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=bo[r.space]}return i}function Wo(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=Fo(e[r],n);a.parentNode=t,i.push(a)}return i}function Go(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var Ko=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],qo=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),z;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(z||={});var Jo={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function Yo(e){return e>=55296&&e<=57343}function Xo(e){return e>=56320&&e<=57343}function Zo(e,t){return(e-55296)*1024+9216+t}function Qo(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $o(e){return e>=64976&&e<=65007||qo.has(e)}var B;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(B||={});var es=65536,ts=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=es,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(Xo(t))return this.pos++,this._addGap(),Zo(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,z.EOF;return this._err(B.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let n=this.html.charCodeAt(t);return n===z.CARRIAGE_RETURN?z.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let e=this.html.charCodeAt(this.pos);return e===z.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,z.LINE_FEED):e===z.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Yo(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===z.LINE_FEED||e===z.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Qo(e)?this._err(B.controlCharacterInInputStream):$o(e)&&this._err(B.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},V;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(V||={});function ns(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var rs=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),is=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]]);String.fromCodePoint;function as(e){return e>=55296&&e<=57343||e>1114111?65533:is.get(e)??e}var os;(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`})(os||={});var ss=32,cs;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(cs||={});function ls(e){return e>=os.ZERO&&e<=os.NINE}function us(e){return e>=os.UPPER_A&&e<=os.UPPER_F||e>=os.LOWER_A&&e<=os.LOWER_F}function ds(e){return e>=os.UPPER_A&&e<=os.UPPER_Z||e>=os.LOWER_A&&e<=os.LOWER_Z||ls(e)}function fs(e){return e===os.EQUALS||ds(e)}var ps;(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`})(ps||={});var ms;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(ms||={});var hs=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ps.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ms.Strict}startEntity(e){this.decodeMode=e,this.state=ps.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ps.EntityStart:return e.charCodeAt(t)===os.NUM?(this.state=ps.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ps.NamedEntity,this.stateNamedEntity(e,t));case ps.NumericStart:return this.stateNumericStart(e,t);case ps.NumericDecimal:return this.stateNumericDecimal(e,t);case ps.NumericHex:return this.stateNumericHex(e,t);case ps.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ss)===os.LOWER_X?(this.state=ps.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ps.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(ls(r)||us(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(ls(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===os.SEMI)this.consumed+=1;else if(this.decodeMode===ms.Strict)return 0;return this.emitCodePoint(as(this.result),this.consumed),this.errors&&(e!==os.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&cs.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=gs(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===ms.Attribute&&(i===0||fs(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&cs.VALUE_LENGTH)>>14,i!==0){if(a===os.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ms.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&cs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~cs.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ps.NamedEntity:return this.result!==0&&(this.decodeMode!==ms.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ps.NumericDecimal:return this.emitNumericEntity(0,2);case ps.NumericHex:return this.emitNumericEntity(0,3);case ps.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ps.EntityStart:return 0}}};function gs(e,t,n,r){let i=(t&cs.BRANCH_LENGTH)>>7,a=t&cs.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=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var H;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(H||={});var _s;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(_s||={});var vs;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(vs||={});var U;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(U||={});var W;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(W||={});var ys=new Map([[U.A,W.A],[U.ADDRESS,W.ADDRESS],[U.ANNOTATION_XML,W.ANNOTATION_XML],[U.APPLET,W.APPLET],[U.AREA,W.AREA],[U.ARTICLE,W.ARTICLE],[U.ASIDE,W.ASIDE],[U.B,W.B],[U.BASE,W.BASE],[U.BASEFONT,W.BASEFONT],[U.BGSOUND,W.BGSOUND],[U.BIG,W.BIG],[U.BLOCKQUOTE,W.BLOCKQUOTE],[U.BODY,W.BODY],[U.BR,W.BR],[U.BUTTON,W.BUTTON],[U.CAPTION,W.CAPTION],[U.CENTER,W.CENTER],[U.CODE,W.CODE],[U.COL,W.COL],[U.COLGROUP,W.COLGROUP],[U.DD,W.DD],[U.DESC,W.DESC],[U.DETAILS,W.DETAILS],[U.DIALOG,W.DIALOG],[U.DIR,W.DIR],[U.DIV,W.DIV],[U.DL,W.DL],[U.DT,W.DT],[U.EM,W.EM],[U.EMBED,W.EMBED],[U.FIELDSET,W.FIELDSET],[U.FIGCAPTION,W.FIGCAPTION],[U.FIGURE,W.FIGURE],[U.FONT,W.FONT],[U.FOOTER,W.FOOTER],[U.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[U.FORM,W.FORM],[U.FRAME,W.FRAME],[U.FRAMESET,W.FRAMESET],[U.H1,W.H1],[U.H2,W.H2],[U.H3,W.H3],[U.H4,W.H4],[U.H5,W.H5],[U.H6,W.H6],[U.HEAD,W.HEAD],[U.HEADER,W.HEADER],[U.HGROUP,W.HGROUP],[U.HR,W.HR],[U.HTML,W.HTML],[U.I,W.I],[U.IMG,W.IMG],[U.IMAGE,W.IMAGE],[U.INPUT,W.INPUT],[U.IFRAME,W.IFRAME],[U.KEYGEN,W.KEYGEN],[U.LABEL,W.LABEL],[U.LI,W.LI],[U.LINK,W.LINK],[U.LISTING,W.LISTING],[U.MAIN,W.MAIN],[U.MALIGNMARK,W.MALIGNMARK],[U.MARQUEE,W.MARQUEE],[U.MATH,W.MATH],[U.MENU,W.MENU],[U.META,W.META],[U.MGLYPH,W.MGLYPH],[U.MI,W.MI],[U.MO,W.MO],[U.MN,W.MN],[U.MS,W.MS],[U.MTEXT,W.MTEXT],[U.NAV,W.NAV],[U.NOBR,W.NOBR],[U.NOFRAMES,W.NOFRAMES],[U.NOEMBED,W.NOEMBED],[U.NOSCRIPT,W.NOSCRIPT],[U.OBJECT,W.OBJECT],[U.OL,W.OL],[U.OPTGROUP,W.OPTGROUP],[U.OPTION,W.OPTION],[U.P,W.P],[U.PARAM,W.PARAM],[U.PLAINTEXT,W.PLAINTEXT],[U.PRE,W.PRE],[U.RB,W.RB],[U.RP,W.RP],[U.RT,W.RT],[U.RTC,W.RTC],[U.RUBY,W.RUBY],[U.S,W.S],[U.SCRIPT,W.SCRIPT],[U.SEARCH,W.SEARCH],[U.SECTION,W.SECTION],[U.SELECT,W.SELECT],[U.SOURCE,W.SOURCE],[U.SMALL,W.SMALL],[U.SPAN,W.SPAN],[U.STRIKE,W.STRIKE],[U.STRONG,W.STRONG],[U.STYLE,W.STYLE],[U.SUB,W.SUB],[U.SUMMARY,W.SUMMARY],[U.SUP,W.SUP],[U.TABLE,W.TABLE],[U.TBODY,W.TBODY],[U.TEMPLATE,W.TEMPLATE],[U.TEXTAREA,W.TEXTAREA],[U.TFOOT,W.TFOOT],[U.TD,W.TD],[U.TH,W.TH],[U.THEAD,W.THEAD],[U.TITLE,W.TITLE],[U.TR,W.TR],[U.TRACK,W.TRACK],[U.TT,W.TT],[U.U,W.U],[U.UL,W.UL],[U.SVG,W.SVG],[U.VAR,W.VAR],[U.WBR,W.WBR],[U.XMP,W.XMP]]);function bs(e){return ys.get(e)??W.UNKNOWN}var G=W,xs={[H.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[H.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[H.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[H.XLINK]:new Set,[H.XML]:new Set,[H.XMLNS]:new Set},Ss=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);U.STYLE,U.SCRIPT,U.XMP,U.IFRAME,U.NOEMBED,U.NOFRAMES,U.PLAINTEXT;var K;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(K||={});var Cs={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function ws(e){return e>=z.DIGIT_0&&e<=z.DIGIT_9}function Ts(e){return e>=z.LATIN_CAPITAL_A&&e<=z.LATIN_CAPITAL_Z}function Es(e){return e>=z.LATIN_SMALL_A&&e<=z.LATIN_SMALL_Z}function Ds(e){return Es(e)||Ts(e)}function Os(e){return Ds(e)||ws(e)}function ks(e){return e+32}function As(e){return e===z.SPACE||e===z.LINE_FEED||e===z.TABULATION||e===z.FORM_FEED}function js(e){return As(e)||e===z.SOLIDUS||e===z.GREATER_THAN_SIGN}function Ms(e){return e===z.NULL?B.nullCharacterReference:e>1114111?B.characterReferenceOutsideUnicodeRange:Yo(e)?B.surrogateCharacterReference:$o(e)?B.noncharacterCharacterReference:Qo(e)||e===z.CARRIAGE_RETURN?B.controlCharacterReference:null}var Ns=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new ts(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new hs(rs,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(B.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(B.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=Ms(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:V.START_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:V.END_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:V.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:V.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(ns(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(B.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=bs(e.tagName),e.type===V.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(B.endTagWithAttributes),e.selfClosing&&this._err(B.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case V.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case V.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case V.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:V.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=As(e)?V.WHITESPACE_CHARACTER:e===z.NULL?V.NULL_CHARACTER:V.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(V.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ms.Attribute:ms.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case K.DATA:this._stateData(e);break;case K.RCDATA:this._stateRcdata(e);break;case K.RAWTEXT:this._stateRawtext(e);break;case K.SCRIPT_DATA:this._stateScriptData(e);break;case K.PLAINTEXT:this._statePlaintext(e);break;case K.TAG_OPEN:this._stateTagOpen(e);break;case K.END_TAG_OPEN:this._stateEndTagOpen(e);break;case K.TAG_NAME:this._stateTagName(e);break;case K.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case K.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case K.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case K.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case K.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case K.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case K.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case K.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case K.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case K.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case K.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case K.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case K.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case K.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case K.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case K.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case K.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case K.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case K.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case K.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case K.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case K.BOGUS_COMMENT:this._stateBogusComment(e);break;case K.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case K.COMMENT_START:this._stateCommentStart(e);break;case K.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case K.COMMENT:this._stateComment(e);break;case K.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case K.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case K.COMMENT_END:this._stateCommentEnd(e);break;case K.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case K.DOCTYPE:this._stateDoctype(e);break;case K.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case K.DOCTYPE_NAME:this._stateDoctypeName(e);break;case K.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case K.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case K.CDATA_SECTION:this._stateCdataSection(e);break;case K.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case K.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case K.CHARACTER_REFERENCE:this._stateCharacterReference();break;case K.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.TAG_OPEN;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitCodePoint(e);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case z.AMPERSAND:this._startCharacterReference();break;case z.LESS_THAN_SIGN:this.state=K.RCDATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.RAWTEXT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ds(e))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.EXCLAMATION_MARK:this.state=K.MARKUP_DECLARATION_OPEN;break;case z.SOLIDUS:this.state=K.END_TAG_OPEN;break;case z.QUESTION_MARK:this._err(B.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e);break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=K.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ds(e))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.GREATER_THAN_SIGN:this._err(B.missingEndTagName),this.state=K.DATA;break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.tagName+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(Ts(e)?ks(e):e)}}_stateRcdataLessThanSign(e){e===z.SOLIDUS?this.state=K.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ds(e)?(this.state=K.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=K.BEFORE_ATTRIBUTE_NAME,!1;case z.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=K.SELF_CLOSING_START_TAG,!1;case z.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=K.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===z.SOLIDUS?this.state=K.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ds(e)?(this.state=K.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case z.SOLIDUS:this.state=K.SCRIPT_DATA_END_TAG_OPEN;break;case z.EXCLAMATION_MARK:this.state=K.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=K.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ds(e)?(this.state=K.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===z.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ds(e)?(this._emitChars(`<`),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ds(e)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Jo.SCRIPT,!1)&&js(this.preprocessor.peek(Jo.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Jo.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===z.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Jo.SCRIPT,!1)&&js(this.preprocessor.peek(Jo.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Jo.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._err(B.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=K.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this._leaveAttrName(),this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._leaveAttrName(),this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:this._err(B.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(Ts(e)?ks(e):e)}}_stateAfterAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.EQUALS_SIGN:this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:this.state=K.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case z.APOSTROPHE:this.state=K.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingAttributeValue),this.state=K.DATA,this.emitCurrentTagToken();break;default:this.state=K.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case z.APOSTROPHE:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.AMPERSAND:this._startCharacterReference();break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:case z.EQUALS_SIGN:case z.GRAVE_ACCENT:this._err(B.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this._leaveAttrValue(),this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.missingWhitespaceBetweenAttributes),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case z.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=K.DATA,this.emitCurrentTagToken();break}case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.unexpectedSolidusInTag),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Jo.DASH_DASH,!0)?(this._createCommentToken(Jo.DASH_DASH.length+1),this.state=K.COMMENT_START):this._consumeSequenceIfMatch(Jo.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Jo.DOCTYPE.length+1),this.state=K.DOCTYPE):this._consumeSequenceIfMatch(Jo.CDATA_START,!0)?this.inForeignNode?this.state=K.CDATA_SECTION:(this._err(B.cdataInHtmlContent),this._createCommentToken(Jo.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=K.BOGUS_COMMENT):this._ensureHibernation()||(this._err(B.incorrectlyOpenedComment),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_START_DASH;break;case z.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.GREATER_THAN_SIGN:this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END_DASH;break;case z.LESS_THAN_SIGN:t.data+=`<`,this.state=K.COMMENT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case z.EXCLAMATION_MARK:t.data+=`!`,this.state=K.COMMENT_LESS_THAN_SIGN_BANG;break;case z.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=K.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=K.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==z.GREATER_THAN_SIGN&&e!==z.EOF&&this._err(B.nestedComment),this.state=K.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EXCLAMATION_MARK:this.state=K.COMMENT_END_BANG;break;case z.HYPHEN_MINUS:t.data+=`-`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:t.data+=`--!`,this.state=K.COMMENT_END_DASH;break;case z.GREATER_THAN_SIGN:this._err(B.incorrectlyClosedComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=K.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBeforeDoctypeName),this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Ts(e))this._createDoctypeToken(String.fromCharCode(ks(e))),this.state=K.DOCTYPE_NAME;else switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.NULL:this._err(B.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=K.DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:{this._err(B.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=K.DATA;break}case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=K.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.AFTER_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.NULL:this._err(B.unexpectedNullCharacter),t.name+=`�`;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(Ts(e)?ks(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(Jo.PUBLIC,!1)?this.state=K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Jo.SYSTEM,!1)?this.state=K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(B.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.NULL:this._err(B.unexpectedNullCharacter);break;case z.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case z.RIGHT_SQUARE_BRACKET:this.state=K.CDATA_SECTION_BRACKET;break;case z.EOF:this._err(B.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===z.RIGHT_SQUARE_BRACKET?this.state=K.CDATA_SECTION_END:(this._emitChars(`]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA;break;case z.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(z.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Os(this.preprocessor.peek(1))?K.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Os(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===z.SEMICOLON&&this._err(B.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Ps=new Set([W.DD,W.DT,W.LI,W.OPTGROUP,W.OPTION,W.P,W.RB,W.RP,W.RT,W.RTC]),Fs=new Set([...Ps,W.CAPTION,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]),Is=new Set([W.APPLET,W.CAPTION,W.HTML,W.MARQUEE,W.OBJECT,W.TABLE,W.TD,W.TEMPLATE,W.TH]),Ls=new Set([...Is,W.OL,W.UL]),Rs=new Set([...Is,W.BUTTON]),zs=new Set([W.ANNOTATION_XML,W.MI,W.MN,W.MO,W.MS,W.MTEXT]),Bs=new Set([W.DESC,W.FOREIGN_OBJECT,W.TITLE]),Vs=new Set([W.TR,W.TEMPLATE,W.HTML]),Hs=new Set([W.TBODY,W.TFOOT,W.THEAD,W.TEMPLATE,W.HTML]),Us=new Set([W.TABLE,W.TEMPLATE,W.HTML]),Ws=new Set([W.TD,W.TH]),Gs=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=W.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===W.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===H.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==H.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ss,H.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ws,H.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Us,H.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Hs,H.HTML)}clearBackToTableRowContext(){this.clearBackTo(Vs,H.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===W.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===W.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case H.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case H.SVG:if(Bs.has(r))return!1;break;case H.MATHML:if(zs.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Is)}hasInListItemScope(e){return this.hasInDynamicScope(e,Ls)}hasInButtonScope(e){return this.hasInDynamicScope(e,Rs)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case H.HTML:if(Ss.has(t))return!0;if(Is.has(t))return!1;break;case H.SVG:if(Bs.has(t))return!1;break;case H.MATHML:if(zs.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===H.HTML)switch(this.tagIDs[e]){case W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ps.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Fs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Fs.has(this.currentTagId);)this.pop()}},Ks=3,qs;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(qs||={});var Js={type:qs.Marker},Ys=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===qs.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Ks)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Ks)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Ks&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Js)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:qs.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:qs.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Js);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===qs.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===qs.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===qs.Element&&t.element===e)}},Xs={createDocument(){return{nodeName:`#document`,mode:vs.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Xs.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Xs.isTextNode(n)){n.value+=t;return}}Xs.appendChild(e,Xs.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Xs.isTextNode(r)?r.value+=t:Xs.insertBefore(e,Xs.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Zs=`html`,Qs=`about:legacy-compat`,$s=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,ec=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),tc=[...ec,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],nc=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),rc=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],ic=[...rc,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function ac(e,t){return t.some(t=>e.startsWith(t))}function oc(e){return e.name===Zs&&e.publicId===null&&(e.systemId===null||e.systemId===Qs)}function sc(e){if(e.name!==Zs)return vs.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===$s)return vs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),nc.has(n))return vs.QUIRKS;let e=t===null?tc:ec;if(ac(n,e))return vs.QUIRKS;if(e=t===null?rc:ic,ac(n,e))return vs.LIMITED_QUIRKS}return vs.NO_QUIRKS}var cc={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},lc=`definitionurl`,uc=`definitionURL`,dc=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),fc=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:H.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:H.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:H.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:H.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:H.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:H.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:H.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:H.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:H.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:H.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:H.XMLNS}]]),pc=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),mc=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function hc(e){let t=e.tagID;return t===W.FONT&&e.attrs.some(({name:e})=>e===_s.COLOR||e===_s.SIZE||e===_s.FACE)||mc.has(t)}function gc(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===lc){e.attrs[t].name=uc;break}}function _c(e){for(let t=0;t<e.attrs.length;t++){let n=dc.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function vc(e){for(let t=0;t<e.attrs.length;t++){let n=fc.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function yc(e){let t=pc.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=bs(e.tagName))}function bc(e,t){return t===H.MATHML&&(e===W.MI||e===W.MO||e===W.MN||e===W.MS||e===W.MTEXT)}function xc(e,t,n){if(t===H.MATHML&&e===W.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===_s.ENCODING){let t=n[e].value.toLowerCase();return t===cc.TEXT_HTML||t===cc.APPLICATION_XML}}return t===H.SVG&&(e===W.FOREIGN_OBJECT||e===W.DESC||e===W.TITLE)}function Sc(e,t,n,r){return(!r||r===H.HTML)&&xc(e,t,n)||(!r||r===H.MATHML)&&bc(e,t)}var Cc=`hidden`,wc=8,Tc=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var Ec={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Dc=new Set([W.TABLE,W.TBODY,W.TFOOT,W.THEAD,W.TR]),Oc={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Xs,onParseError:null},kc=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Oc,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Ns(this.options,this),this.activeFormattingElements=new Ys(this.treeAdapter),this.fragmentContextID=n?bs(this.treeAdapter.getTagName(n)):W.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Gs(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...Oc,...t};e??=n.treeAdapter.createElement(U.TEMPLATE,H.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,H.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===W.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Ec,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===H.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,H.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=Cs.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===U.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==H.HTML))switch(this.fragmentContextID){case W.TITLE:case W.TEXTAREA:this.tokenizer.state=Cs.RCDATA;break;case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:this.tokenizer.state=Cs.RAWTEXT;break;case W.SCRIPT:this.tokenizer.state=Cs.SCRIPT_DATA;break;case W.PLAINTEXT:this.tokenizer.state=Cs.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,H.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,H.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(U.HTML,H.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,W.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===V.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===W.SVG&&this.treeAdapter.getTagName(t)===U.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===H.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,H.HTML)}_processToken(e){switch(e.type){case V.CHARACTER:this.onCharacter(e);break;case V.NULL_CHARACTER:this.onNullCharacter(e);break;case V.COMMENT:this.onComment(e);break;case V.DOCTYPE:this.onDoctype(e);break;case V.START_TAG:this._processStartTag(e);break;case V.END_TAG:this.onEndTag(e);break;case V.EOF:this.onEof(e);break;case V.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Sc(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===qs.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:this.insertionMode=q.IN_ROW;return;case W.TBODY:case W.THEAD:case W.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case W.CAPTION:this.insertionMode=q.IN_CAPTION;return;case W.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case W.TABLE:this.insertionMode=q.IN_TABLE;return;case W.BODY:this.insertionMode=q.IN_BODY;return;case W.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case W.SELECT:this._resetInsertionModeForSelect(e);return;case W.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case W.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case W.TD:case W.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case W.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===W.TEMPLATE)break;if(e===W.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return Dc.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case W.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===H.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case W.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return xs[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){qu(this,e);return}switch(this.insertionMode){case q.INITIAL:Hc(this,e);break;case q.BEFORE_HTML:Gc(this,e);break;case q.BEFORE_HEAD:Jc(this,e);break;case q.IN_HEAD:Qc(this,e);break;case q.IN_HEAD_NO_SCRIPT:tl(this,e);break;case q.AFTER_HEAD:il(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:sl(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:nu(this,e);break;case q.IN_TABLE_TEXT:hu(this,e);break;case q.IN_COLUMN_GROUP:Su(this,e);break;case q.AFTER_BODY:Ru(this,e);break;case q.AFTER_AFTER_BODY:Wu(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ku(this,e);return}switch(this.insertionMode){case q.INITIAL:Hc(this,e);break;case q.BEFORE_HTML:Gc(this,e);break;case q.BEFORE_HEAD:Jc(this,e);break;case q.IN_HEAD:Qc(this,e);break;case q.IN_HEAD_NO_SCRIPT:tl(this,e);break;case q.AFTER_HEAD:il(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:nu(this,e);break;case q.IN_COLUMN_GROUP:Su(this,e);break;case q.AFTER_BODY:Ru(this,e);break;case q.AFTER_AFTER_BODY:Wu(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Lc(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:Lc(this,e);break;case q.IN_TABLE_TEXT:gu(this,e);break;case q.AFTER_BODY:Rc(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:zc(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:Vc(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,B.misplacedDoctype);break;case q.IN_TABLE_TEXT:gu(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,B.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Yu(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Hc(this,e);break;case q.BEFORE_HTML:Uc(this,e);break;case q.BEFORE_HEAD:Kc(this,e);break;case q.IN_HEAD:Yc(this,e);break;case q.IN_HEAD_NO_SCRIPT:$c(this,e);break;case q.AFTER_HEAD:nl(this,e);break;case q.IN_BODY:Bl(this,e);break;case q.IN_TABLE:du(this,e);break;case q.IN_TABLE_TEXT:gu(this,e);break;case q.IN_CAPTION:vu(this,e);break;case q.IN_COLUMN_GROUP:bu(this,e);break;case q.IN_TABLE_BODY:Cu(this,e);break;case q.IN_ROW:Tu(this,e);break;case q.IN_CELL:Du(this,e);break;case q.IN_SELECT:ku(this,e);break;case q.IN_SELECT_IN_TABLE:ju(this,e);break;case q.IN_TEMPLATE:Nu(this,e);break;case q.AFTER_BODY:Iu(this,e);break;case q.IN_FRAMESET:zu(this,e);break;case q.AFTER_FRAMESET:Vu(this,e);break;case q.AFTER_AFTER_BODY:Uu(this,e);break;case q.AFTER_AFTER_FRAMESET:Gu(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Xu(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Hc(this,e);break;case q.BEFORE_HTML:Wc(this,e);break;case q.BEFORE_HEAD:qc(this,e);break;case q.IN_HEAD:Xc(this,e);break;case q.IN_HEAD_NO_SCRIPT:el(this,e);break;case q.AFTER_HEAD:rl(this,e);break;case q.IN_BODY:Ql(this,e);break;case q.TEXT:eu(this,e);break;case q.IN_TABLE:fu(this,e);break;case q.IN_TABLE_TEXT:gu(this,e);break;case q.IN_CAPTION:yu(this,e);break;case q.IN_COLUMN_GROUP:xu(this,e);break;case q.IN_TABLE_BODY:wu(this,e);break;case q.IN_ROW:Eu(this,e);break;case q.IN_CELL:Ou(this,e);break;case q.IN_SELECT:Au(this,e);break;case q.IN_SELECT_IN_TABLE:Mu(this,e);break;case q.IN_TEMPLATE:Pu(this,e);break;case q.AFTER_BODY:Lu(this,e);break;case q.IN_FRAMESET:Bu(this,e);break;case q.AFTER_FRAMESET:Hu(this,e);break;case q.AFTER_AFTER_BODY:Wu(this,e)}}onEof(e){switch(this.insertionMode){case q.INITIAL:Hc(this,e);break;case q.BEFORE_HTML:Gc(this,e);break;case q.BEFORE_HEAD:Jc(this,e);break;case q.IN_HEAD:Qc(this,e);break;case q.IN_HEAD_NO_SCRIPT:tl(this,e);break;case q.AFTER_HEAD:il(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:$l(this,e);break;case q.TEXT:tu(this,e);break;case q.IN_TABLE_TEXT:gu(this,e);break;case q.IN_TEMPLATE:Fu(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Bc(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===z.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:ol(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:nu(this,e);break;case q.IN_TABLE_TEXT:mu(this,e)}}};function Ac(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Zl(e,t),n}function jc(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Mc(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Tc;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Nc(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Nc(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Pc(e,t,n){let r=bs(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===W.TEMPLATE&&i===H.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Fc(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Ic(e,t){for(let n=0;n<wc;n++){let n=Ac(e,t);if(!n)break;let r=jc(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Mc(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&Pc(e,a,i),Fc(e,r,n)}}function Lc(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Rc(e,t){e._appendCommentNode(t,e.openElements.items[0])}function zc(e,t){e._appendCommentNode(t,e.document)}function Bc(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Vc(e,t){e._setDocumentType(t);let n=t.forceQuirks?vs.QUIRKS:sc(t);oc(t)||e._err(t,B.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function Hc(e,t){e._err(t,B.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,vs.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function Uc(e,t){t.tagID===W.HTML?(e._insertElement(t,H.HTML),e.insertionMode=q.BEFORE_HEAD):Gc(e,t)}function Wc(e,t){let n=t.tagID;(n===W.HTML||n===W.HEAD||n===W.BODY||n===W.BR)&&Gc(e,t)}function Gc(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Kc(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.HEAD:e._insertElement(t,H.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:Jc(e,t)}}function qc(e,t){let n=t.tagID;n===W.HEAD||n===W.BODY||n===W.HTML||n===W.BR?Jc(e,t):e._err(t,B.endTagWithoutMatchingOpenElement)}function Jc(e,t){e._insertFakeElement(U.HEAD,W.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Yc(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TITLE:e._switchToTextParsing(t,Cs.RCDATA);break;case W.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Cs.RAWTEXT):(e._insertElement(t,H.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case W.NOFRAMES:case W.STYLE:e._switchToTextParsing(t,Cs.RAWTEXT);break;case W.SCRIPT:e._switchToTextParsing(t,Cs.SCRIPT_DATA);break;case W.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:Qc(e,t)}}function Xc(e,t){switch(t.tagID){case W.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case W.BODY:case W.BR:case W.HTML:Qc(e,t);break;case W.TEMPLATE:Zc(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Zc(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==W.TEMPLATE&&e._err(t,B.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,B.endTagWithoutMatchingOpenElement)}function Qc(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function $c(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:Yc(e,t);break;case W.NOSCRIPT:e._err(t,B.nestedNoscriptInHead);break;default:tl(e,t)}}function el(e,t){switch(t.tagID){case W.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case W.BR:tl(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function tl(e,t){let n=t.type===V.EOF?B.openElementsLeftAfterEof:B.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function nl(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.BODY:e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case W.FRAMESET:e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET;break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:e._err(t,B.abandonedHeadElementChild),e.openElements.push(e.headElement,W.HEAD),Yc(e,t),e.openElements.remove(e.headElement);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:il(e,t)}}function rl(e,t){switch(t.tagID){case W.BODY:case W.HTML:case W.BR:il(e,t);break;case W.TEMPLATE:Zc(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function il(e,t){e._insertFakeElement(U.BODY,W.BODY),e.insertionMode=q.IN_BODY,al(e,t)}function al(e,t){switch(t.type){case V.CHARACTER:sl(e,t);break;case V.WHITESPACE_CHARACTER:ol(e,t);break;case V.COMMENT:Lc(e,t);break;case V.START_TAG:Bl(e,t);break;case V.END_TAG:Ql(e,t);break;case V.EOF:$l(e,t)}}function ol(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function sl(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function cl(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ll(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function ul(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET)}function dl(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function fl(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Ss.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,H.HTML)}function pl(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ml(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),n||(e.formElement=e.openElements.current))}function hl(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===W.LI&&r===W.LI||(n===W.DD||n===W.DT)&&(r===W.DD||r===W.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==W.ADDRESS&&r!==W.DIV&&r!==W.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function gl(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.tokenizer.state=Cs.PLAINTEXT}function _l(e,t){e.openElements.hasInScope(W.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1}function vl(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(U.A);n&&(Ic(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bl(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(W.NOBR)&&(Ic(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Sl(e,t){e.treeAdapter.getDocumentMode(e.document)!==vs.QUIRKS&&e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function Cl(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wl(e){let t=ns(e,_s.TYPE);return t!=null&&t.toLowerCase()===Cc}function Tl(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),wl(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function El(e,t){e._appendElement(t,H.HTML),t.ackSelfClosing=!0}function Dl(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ol(e,t){t.tagName=U.IMG,t.tagID=W.IMG,Cl(e,t)}function kl(e,t){e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Cs.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function Al(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Cs.RAWTEXT)}function jl(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Cs.RAWTEXT)}function Ml(e,t){e._switchToTextParsing(t,Cs.RAWTEXT)}function Nl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function Pl(e,t){e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Fl(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,H.HTML)}function Il(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(W.RTC),e._insertElement(t,H.HTML)}function Ll(e,t){e._reconstructActiveFormattingElements(),gc(t),vc(t),t.selfClosing?e._appendElement(t,H.MATHML):e._insertElement(t,H.MATHML),t.ackSelfClosing=!0}function Rl(e,t){e._reconstructActiveFormattingElements(),_c(t),vc(t),t.selfClosing?e._appendElement(t,H.SVG):e._insertElement(t,H.SVG),t.ackSelfClosing=!0}function zl(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Bl(e,t){switch(t.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:yl(e,t);break;case W.A:vl(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:fl(e,t);break;case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:dl(e,t);break;case W.LI:case W.DD:case W.DT:hl(e,t);break;case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:Cl(e,t);break;case W.HR:Dl(e,t);break;case W.RB:case W.RTC:Fl(e,t);break;case W.RT:case W.RP:Il(e,t);break;case W.PRE:case W.LISTING:pl(e,t);break;case W.XMP:Al(e,t);break;case W.SVG:Rl(e,t);break;case W.HTML:cl(e,t);break;case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:Yc(e,t);break;case W.BODY:ll(e,t);break;case W.FORM:ml(e,t);break;case W.NOBR:bl(e,t);break;case W.MATH:Ll(e,t);break;case W.TABLE:Sl(e,t);break;case W.INPUT:Tl(e,t);break;case W.PARAM:case W.TRACK:case W.SOURCE:El(e,t);break;case W.IMAGE:Ol(e,t);break;case W.BUTTON:_l(e,t);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:xl(e,t);break;case W.IFRAME:jl(e,t);break;case W.SELECT:Nl(e,t);break;case W.OPTION:case W.OPTGROUP:Pl(e,t);break;case W.NOEMBED:case W.NOFRAMES:Ml(e,t);break;case W.FRAMESET:ul(e,t);break;case W.TEXTAREA:kl(e,t);break;case W.NOSCRIPT:e.options.scriptingEnabled?Ml(e,t):zl(e,t);break;case W.PLAINTEXT:gl(e,t);break;case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:zl(e,t)}}function Vl(e,t){if(e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Hl(e,t){e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,Lu(e,t))}function Ul(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Wl(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(W.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(W.FORM):n&&e.openElements.remove(n))}function Gl(e){e.openElements.hasInButtonScope(W.P)||e._insertFakeElement(U.P,W.P),e._closePElement()}function Kl(e){e.openElements.hasInListItemScope(W.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(W.LI),e.openElements.popUntilTagNamePopped(W.LI))}function ql(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Jl(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Yl(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Xl(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(U.BR,W.BR),e.openElements.pop(),e.framesetOk=!1}function Zl(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==W.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Ql(e,t){switch(t.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:Ic(e,t);break;case W.P:Gl(e);break;case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:Ul(e,t);break;case W.LI:Kl(e);break;case W.DD:case W.DT:ql(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:Jl(e);break;case W.BR:Xl(e);break;case W.BODY:Vl(e,t);break;case W.HTML:Hl(e,t);break;case W.FORM:Wl(e);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:Yl(e,t);break;case W.TEMPLATE:Zc(e,t);break;default:Zl(e,t)}}function $l(e,t){e.tmplInsertionModeStack.length>0?Fu(e,t):Bc(e,t)}function eu(e,t){var n;t.tagID===W.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tu(e,t){e._err(t,B.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function nu(e,t){if(e.openElements.currentTagId!==void 0&&Dc.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case V.CHARACTER:hu(e,t);break;case V.WHITESPACE_CHARACTER:mu(e,t)}else pu(e,t)}function ru(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CAPTION}function iu(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function au(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.COLGROUP,W.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,bu(e,t)}function ou(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_TABLE_BODY}function su(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.TBODY,W.TBODY),e.insertionMode=q.IN_TABLE_BODY,Cu(e,t)}function cu(e,t){e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function lu(e,t){wl(t)?e._appendElement(t,H.HTML):pu(e,t),t.ackSelfClosing=!0}function uu(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,H.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function du(e,t){switch(t.tagID){case W.TD:case W.TH:case W.TR:su(e,t);break;case W.STYLE:case W.SCRIPT:case W.TEMPLATE:Yc(e,t);break;case W.COL:au(e,t);break;case W.FORM:uu(e,t);break;case W.TABLE:cu(e,t);break;case W.TBODY:case W.TFOOT:case W.THEAD:ou(e,t);break;case W.INPUT:lu(e,t);break;case W.CAPTION:ru(e,t);break;case W.COLGROUP:iu(e,t);break;default:pu(e,t)}}function fu(e,t){switch(t.tagID){case W.TABLE:e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode());break;case W.TEMPLATE:Zc(e,t);break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:pu(e,t)}}function pu(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,al(e,t),e.fosterParentingEnabled=n}function mu(e,t){e.pendingCharacterTokens.push(t)}function hu(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)pu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var _u=new Set([W.CAPTION,W.COL,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]);function vu(e,t){let n=t.tagID;_u.has(n)?e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,du(e,t)):Bl(e,t)}function yu(e,t){let n=t.tagID;switch(n){case W.CAPTION:case W.TABLE:e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===W.TABLE&&fu(e,t));break;case W.BODY:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:Ql(e,t)}}function bu(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.COL:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TEMPLATE:Yc(e,t);break;default:Su(e,t)}}function xu(e,t){switch(t.tagID){case W.COLGROUP:e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TEMPLATE:Zc(e,t);break;case W.COL:break;default:Su(e,t)}}function Su(e,t){e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function Cu(e,t){switch(t.tagID){case W.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_ROW;break;case W.TH:case W.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(U.TR,W.TR),e.insertionMode=q.IN_ROW,Tu(e,t);break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,du(e,t));break;default:du(e,t)}}function wu(e,t){let n=t.tagID;switch(t.tagID){case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,fu(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:case W.TR:break;default:fu(e,t)}}function Tu(e,t){switch(t.tagID){case W.TH:case W.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,Cu(e,t));break;default:du(e,t)}}function Eu(e,t){switch(t.tagID){case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case W.TABLE:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,wu(e,t));break;case W.TBODY:case W.TFOOT:case W.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(W.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,wu(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:break;default:fu(e,t)}}function Du(e,t){let n=t.tagID;_u.has(n)?(e.openElements.hasInTableScope(W.TD)||e.openElements.hasInTableScope(W.TH))&&(e._closeTableCell(),Tu(e,t)):Bl(e,t)}function Ou(e,t){let n=t.tagID;switch(n){case W.TD:case W.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case W.TABLE:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Eu(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:break;default:Ql(e,t)}}function ku(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.OPTGROUP:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.HR:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.INPUT:case W.KEYGEN:case W.TEXTAREA:case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),t.tagID!==W.SELECT&&e._processStartTag(t));break;case W.SCRIPT:case W.TEMPLATE:Yc(e,t)}}function Au(e,t){switch(t.tagID){case W.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===W.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===W.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop();break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop();break;case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode());break;case W.TEMPLATE:Zc(e,t)}}function ju(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ku(e,t)}function Mu(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Au(e,t)}function Nu(e,t){switch(t.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:Yc(e,t);break;case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,du(e,t);break;case W.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,bu(e,t);break;case W.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,Cu(e,t);break;case W.TD:case W.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,Tu(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Bl(e,t)}}function Pu(e,t){t.tagID===W.TEMPLATE&&Zc(e,t)}function Fu(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Bc(e,t)}function Iu(e,t){t.tagID===W.HTML?Bl(e,t):Ru(e,t)}function Lu(e,t){if(t.tagID===W.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===W.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else Ru(e,t)}function Ru(e,t){e.insertionMode=q.IN_BODY,al(e,t)}function zu(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.FRAMESET:e._insertElement(t,H.HTML);break;case W.FRAME:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.NOFRAMES:Yc(e,t)}}function Bu(e,t){t.tagID===W.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==W.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function Vu(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.NOFRAMES:Yc(e,t)}}function Hu(e,t){t.tagID===W.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function Uu(e,t){t.tagID===W.HTML?Bl(e,t):Wu(e,t)}function Wu(e,t){e.insertionMode=q.IN_BODY,al(e,t)}function Gu(e,t){switch(t.tagID){case W.HTML:Bl(e,t);break;case W.NOFRAMES:Yc(e,t)}}function Ku(e,t){t.chars=`�`,e._insertCharacters(t)}function qu(e,t){e._insertCharacters(t),e.framesetOk=!1}function Ju(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==H.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Yu(e,t){if(hc(t))Ju(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===H.MATHML?gc(t):r===H.SVG&&(yc(t),_c(t)),vc(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Xu(e,t){if(t.tagID===W.P||t.tagID===W.BR){Ju(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===H.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}U.AREA,U.BASE,U.BASEFONT,U.BGSOUND,U.BR,U.COL,U.EMBED,U.FRAME,U.HR,U.IMG,U.INPUT,U.KEYGEN,U.LINK,U.META,U.PARAM,U.SOURCE,U.TRACK,U.WBR;var Zu=$u(`end`),Qu=$u(`start`);function $u(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ed(e){let t=Qu(e),n=Zu(e);if(t&&n)return{start:t,end:n}}var td=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,nd=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),rd={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function id(e,t){let n=vd(e),r=Mo(`type`,{handlers:{root:od,element:sd,text:cd,comment:dd,doctype:ld,raw:fd},unknown:pd}),i={parser:n?new kc(rd):kc.getFragmentParser(void 0,rd),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),md(i,Qu());let a=Co(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&Hi(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function ad(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function od(e,t){ad(e.children,t)}function sd(e,t){gd(e,t),ad(e.children,t),_d(e,t)}function cd(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:V.CHARACTER,chars:e.value,location:yd(e)};md(t,Qu(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ld(e,t){let n={type:V.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:yd(e)};md(t,Qu(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ud(e,t){t.stitches=!0;let n=bd(e);`children`in e&&`children`in n&&(n.children=id({type:`root`,children:e.children},t.options).children),dd({type:`comment`,value:{stitch:n}},t)}function dd(e,t){let n=e.value,r={type:V.COMMENT,data:n,location:yd(e)};md(t,Qu(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function fd(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,hd(t,Qu(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(td,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function pd(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))ud(n,t);else{let e=``;throw nd.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function md(e,t){hd(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Cs.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function hd(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function gd(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Cs.PLAINTEXT)return;md(t,Qu(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:bo.html;i===bo.html&&n===`svg`&&(i=bo.svg);let a=Io({...e,children:[]},{space:i===bo.svg?`svg`:`html`}),o={type:V.START_TAG,tagName:n,tagID:bs(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:yd(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function _d(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Ko.includes(n)||t.parser.tokenizer.state===Cs.PLAINTEXT)return;md(t,Zu(e));let r={type:V.END_TAG,tagName:n,tagID:bs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:yd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Cs.RCDATA||t.parser.tokenizer.state===Cs.RAWTEXT||t.parser.tokenizer.state===Cs.SCRIPT_DATA)&&(t.parser.tokenizer.state=Cs.DATA)}function vd(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function yd(e){let t=Qu(e)||{line:void 0,column:void 0,offset:void 0},n=Zu(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function bd(e){return`children`in e?xa({...e,children:[]}):xa(e)}function xd(e){return function(t,n){return id(t,{...e,file:n})}}var Sd=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],Cd={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...Sd,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...Sd],h2:[[`className`,`sr-only`]],img:[...Sd,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...Sd,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...Sd],table:[...Sd],ul:[...Sd,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},wd={}.hasOwnProperty;function Td(e,t){let n={type:`root`,children:[]},r=Ed({schema:t?{...Cd,...t}:Cd,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Ed(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Dd(e,n);case`doctype`:return Od(e,n);case`element`:return kd(e,n);case`root`:return Ad(e,n);case`text`:return jd(e,n)}}}function Dd(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return Rd(r,t),r}}function Od(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Rd(e,t),e}}function kd(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Md(e,t.children),i=Nd(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&wd.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return Rd(o,t),o}function Ad(e,t){let n={type:`root`,children:Md(e,t.children)};return Rd(n,t),n}function jd(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return Rd(n,t),n}function Md(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Ed(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Nd(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&wd.call(r,n)?r[n]:void 0,o=r&&wd.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(wd.call(s,l)){let t=s[l],n=Pd(e,zd(a,l),l,t);n??=Pd(e,zd(o,l),l,t),n!=null&&(c[l]=n)}if(i&&wd.call(i,n)){let e=i[n];for(l in e)wd.call(e,l)&&!wd.call(c,l)&&(c[l]=e[l])}return c}function Pd(e,t,n,r){return t?Array.isArray(r)?Fd(e,t,n,r):Id(e,t,n,r):void 0}function Fd(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Id(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Id(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&Ld(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Ld(e,t,n){let r=e.schema.protocols&&wd.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function Rd(e,t){let n=ed(t);t.data&&(e.data=xa(t.data)),n&&(e.position=n)}function zd(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Bd(e){return function(t){return Td(t,e)}}function Vd(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Hd(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ud(e,t,n){let r=Ai((n||{}).ignore||[]),i=Wd(t),a=-1;for(;++a<i.length;)Bi(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Wd(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Gd(e[0]),Kd(e[1])])}return t}function Gd(e){return typeof e==`string`?new RegExp(Hd(e),`g`):e}function Kd(e){return typeof e==`function`?e:function(){return e}}var qd=`phrasing`,Jd=[`autolink`,`link`,`image`,`label`];function Yd(){return{transforms:[rf],enter:{literalAutolink:Zd,literalAutolinkEmail:Qd,literalAutolinkHttp:Qd,literalAutolinkWww:Qd},exit:{literalAutolink:nf,literalAutolinkEmail:tf,literalAutolinkHttp:$d,literalAutolinkWww:ef}}}function Xd(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:qd,notInConstruct:Jd},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:qd,notInConstruct:Jd},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:qd,notInConstruct:Jd}]}}function Zd(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Qd(e){this.config.enter.autolinkProtocol.call(this,e)}function $d(e){this.config.exit.autolinkProtocol.call(this,e)}function ef(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function tf(e){this.config.exit.autolinkEmail.call(this,e)}function nf(e){this.exit(e)}function rf(e){Ud(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,af],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,of]],{ignore:[`link`,`linkReference`]})}function af(e,t,n,r,i){let a=``;if(!lf(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!sf(n)))return!1;let o=cf(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function of(e,t,n,r){return!lf(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function sf(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cf(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Vd(e,`(`),a=Vd(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function lf(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Gn(n)||Wn(n))&&(!t||n!==47)}function uf(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}bf.peek=yf;function df(){this.buffer()}function ff(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function pf(){this.buffer()}function mf(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function hf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gf(e){this.exit(e)}function _f(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vf(e){this.exit(e)}function yf(){return`[`}function bf(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function xf(){return{enter:{gfmFootnoteCallString:df,gfmFootnoteCall:ff,gfmFootnoteDefinitionLabelString:pf,gfmFootnoteDefinition:mf},exit:{gfmFootnoteCallString:hf,gfmFootnoteCall:gf,gfmFootnoteDefinitionLabelString:_f,gfmFootnoteDefinition:vf}}}function Sf(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:bf},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
4
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?wf:Cf))),s(),o}}function Cf(e,t,n){return t===0?e:wf(e,t,n)}function wf(e,t,n){return(n?``:` `)+e}var Tf=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Af.peek=jf;function Ef(){return{canContainEols:[`delete`],enter:{strikethrough:Of},exit:{strikethrough:kf}}}function Df(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Tf}],handlers:{delete:Af}}}function Of(e){this.enter({type:`delete`,children:[]},e)}function kf(e){this.exit(e)}function Af(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function jf(){return`~`}function Mf(e){return e.length}function Nf(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Mf,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Pf(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Ff(r[d]);else{let e=Ff(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
5
|
+
`)}function Pf(e){return e==null?``:String(e)}function Ff(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function If(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Lf);return i(),o}function Lf(e,t,n){return`>`+(n?``:` `)+e}function Rf(e,t){return zf(e,t.inConstruct,!0)&&!zf(e,t.notInConstruct,!1)}function zf(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Bf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
+
`&&Rf(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
7
|
+
`}function Vf(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Hf(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Uf(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Wf(e,t,n,r){let i=Uf(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Hf(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Gf);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Vf(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
8
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
9
|
+
`),a&&(u+=s.move(a+`
|
|
10
|
+
`)),u+=s.move(c),l(),u}function Gf(e,t,n){return(n?``:` `)+e}function Kf(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function qf(e,t,n,r){let i=Kf(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
11
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Jf(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Yf(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Xf(e){if(e===null||Un(e)||Gn(e))return 1;if(Wn(e))return 2}function Zf(e,t,n){let r=Xf(e),i=Xf(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qf.peek=$f;function Qf(e,t,n,r){let i=Jf(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Zf(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Yf(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Zf(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Yf(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function $f(e,t,n){return n.options.emphasis||`*`}var ep={};function tp(e,t){let n=t||ep;return np(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function np(e,t,n){if(ip(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return rp(e.children,t,n)}return Array.isArray(e)?rp(e,t,n):``}function rp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=np(e[i],t,n);return r.join(``)}function ip(e){return!!(e&&typeof e==`object`)}function ap(e,t){let n=!1;return Hi(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&tp(e)&&(t.options.setext||n))}function op(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ap(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
12
|
+
`,after:`
|
|
13
|
+
`});return r(),t(),o+`
|
|
14
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
15
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
16
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Yf(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}sp.peek=cp;function sp(e){return e.value||``}function cp(){return`<`}lp.peek=up;function lp(e,t,n,r){let i=Kf(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function up(){return`!`}dp.peek=fp;function dp(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fp(){return`!`}pp.peek=mp;function pp(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function mp(){return"`"}function hp(e,t){let n=tp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}gp.peek=_p;function gp(e,t,n,r){let i=Kf(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(hp(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function _p(e,t,n){return hp(e,n)?`<`:`[`}vp.peek=yp;function vp(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function yp(){return`[`}function bp(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xp(e){let t=bp(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Sp(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Cp(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wp(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Sp(n):bp(n),s=e.ordered?o===`.`?`)`:`.`:xp(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Cp(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Tp(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Ep(e,t,n,r){let i=Tp(n),a=n.bulletCurrent||bp(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Dp(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Op=Ai([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function kp(e,t,n,r){return(e.children.some(function(e){return Op(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ap(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jp.peek=Mp;function jp(e,t,n,r){let i=Ap(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Zf(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Yf(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Zf(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Yf(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Mp(e,t,n){return n.options.strong||`*`}function Np(e,t,n,r){return n.safe(e.value,r)}function Pp(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Fp(e,t,n){let r=(Cp(n)+(n.options.ruleSpaces?` `:``)).repeat(Pp(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ip={blockquote:If,break:Bf,code:Wf,definition:qf,emphasis:Qf,hardBreak:Bf,heading:op,html:sp,image:lp,imageReference:dp,inlineCode:pp,link:gp,linkReference:vp,list:wp,listItem:Ep,paragraph:Dp,root:kp,strong:jp,text:Np,thematicBreak:Fp},Lp=document.createElement(`i`);function Rp(e){let t=`&`+e+`;`;Lp.innerHTML=t;let n=Lp.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function zp(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var Bp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Vp(e){return e.replace(Bp,Hp)}function Hp(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return zp(n.slice(t?2:1),t?16:10)}return Rp(n)||e}function Up(){return{enter:{table:Wp,tableData:Jp,tableHeader:Jp,tableRow:Kp},exit:{codeText:Yp,table:Gp,tableData:qp,tableHeader:qp,tableRow:qp}}}function Wp(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Gp(e){this.exit(e),this.data.inTable=void 0}function Kp(e){this.enter({type:`tableRow`,children:[]},e)}function qp(e){this.exit(e)}function Jp(e){this.enter({type:`tableCell`,children:[]},e)}function Yp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Xp));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Xp(e,t){return t===`|`?t:e}function Zp(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
17
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
18
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Nf(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ip.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Qp(){return{exit:{taskListCheckValueChecked:em,taskListCheckValueUnchecked:em,paragraph:tm}}}function $p(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:nm}}}function em(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function tm(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function nm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ip.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function rm(){return[Yd(),xf(),Ef(),Up(),Qp()]}function im(e){return{extensions:[Xd(),Sf(e),Df(),Zp(e),$p()]}}var am={}.hasOwnProperty;function om(e){let t={},n=-1;for(;++n<e.length;)sm(t,e[n]);return t}function sm(e,t){let n;for(n in t){let r=(am.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){am.call(r,a)||(r[a]=[]);let e=i[a];cm(r[a],Array.isArray(e)?e:e?[e]:[])}}}function cm(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);rr(e,0,0,r)}var lm={tokenize:Cm,partial:!0},um={tokenize:wm,partial:!0},dm={tokenize:Tm,partial:!0},fm={tokenize:Em,partial:!0},pm={tokenize:Dm,partial:!0},mm={name:`wwwAutolink`,tokenize:xm,previous:Om},hm={name:`protocolAutolink`,tokenize:Sm,previous:km},gm={name:`emailAutolink`,tokenize:bm,previous:Am},_m={};function vm(){return{text:_m}}for(var ym=48;ym<123;)_m[ym]=gm,ym++,ym===58?ym=65:ym===91&&(ym=97);_m[43]=gm,_m[45]=gm,_m[46]=gm,_m[95]=gm,_m[72]=[gm,hm],_m[104]=[gm,hm],_m[87]=[gm,mm],_m[119]=[gm,mm];function bm(e,t,n){let r=this,i,a;return o;function o(t){return!jm(t)||!Am.call(r,r.previous)||Mm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return jm(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(pm,u,l)(t):t===45||t===95||Ln(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&In(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function xm(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Om.call(r,r.previous)||Mm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(lm,e.attempt(um,e.attempt(dm,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Sm(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&km.call(r,r.previous)&&!Mm(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(In(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||zn(t)||Un(t)||Gn(t)||Wn(t)?n(t):e.attempt(um,e.attempt(dm,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Cm(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function wm(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(fm,c,s)(t):t===null||Un(t)||Gn(t)||t!==45&&Wn(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Tm(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(fm,t,a)(o):o===null||Un(o)||Gn(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Em(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Un(o)||Gn(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Un(e)||Gn(e)?t(e):r(e)}function a(e){return In(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):In(t)?(e.consume(t),o):n(t)}}function Dm(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ln(e)?n(e):t(e)}}function Om(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Un(e)}function km(e){return!In(e)}function Am(e){return!(e===47||jm(e))}function jm(e){return e===43||e===45||e===46||e===95||Ln(e)}function Mm(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Nm(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ln(e.charCodeAt(n+1))&&Ln(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var Pm={name:`attention`,resolveAll:Fm,tokenize:Im};function Fm(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Lm(d,-c),Lm(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ir(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ir(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ir(l,ar(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ir(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ir(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,rr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Im(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xf(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Xf(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Lm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Rm={name:`autolink`,tokenize:zm};function zm(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return In(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ln(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Ln(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||zn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Rn(t)?(e.consume(t),l):n(t)}function u(e){return Ln(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Ln(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return I(r)?(e.enter(n),s(r)):t(r)}function s(r){return I(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Bm={partial:!0,tokenize:Vm};function Vm(e,t,n){return r;function r(t){return I(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||F(e)?t(e):n(e)}}var Hm={continuation:{tokenize:Wm},exit:Gm,name:`blockQuote`,tokenize:Um};function Um(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return I(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Wm(e,t,n){let r=this;return i;function i(t){return I(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Hm,t,n)(r)}}function Gm(e){e.exit(`blockQuote`)}var Km={name:`characterEscape`,tokenize:qm};function qm(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Hn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Jm={name:`characterReference`,tokenize:Ym};function Ym(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Ln,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Vn,u):(e.enter(`characterReferenceValue`),a=7,o=Bn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ln&&!Rp(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Xm={partial:!0,tokenize:$m},Zm={concrete:!0,name:`codeFenced`,tokenize:Qm};function Qm(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),I(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||F(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Xm,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||F(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||F(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||F(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&I(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||F(t)?e.check(Xm,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||F(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),I(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),I(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||F(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function $m(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var eh={name:`codeIndented`,tokenize:nh},th={partial:!0,tokenize:rh};function nh(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),J(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):F(t)?e.attempt(th,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||F(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function rh(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):J(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):F(e)?i(e):n(e)}}var ih={name:`codeText`,previous:oh,resolve:ah,tokenize:sh};function ah(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function oh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function sh(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||F(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ch=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&lh(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),lh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),lh(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);lh(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);lh(this.left,t.reverse())}}}};function lh(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uh(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ch(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,dh(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return rr(e,0,1/0,u.slice(0)),!l}function dh(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var fh={resolve:mh,tokenize:hh},ph={partial:!0,tokenize:gh};function mh(e){return uh(e),e}function hh(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):F(t)?e.check(ph,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function gh(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||F(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function _h(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||zn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||F(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Un(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||zn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function vh(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):F(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||F(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!I(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function yh(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||F(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function bh(e,t){let n;return r;function r(i){return F(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):I(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var xh={name:`definition`,tokenize:Ch},Sh={partial:!0,tokenize:wh};function Ch(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return vh.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=uf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Un(t)?bh(e,l)(t):l(t)}function l(t){return _h(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Sh,d,d)(t)}function d(t){return I(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||F(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function wh(e,t,n){return r;function r(t){return Un(t)?bh(e,i)(t):n(t)}function i(t){return yh(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return I(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||F(e)?t(e):n(e)}}var Th={name:`hardBreakEscape`,tokenize:Eh};function Eh(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return F(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Dh={name:`headingAtx`,resolve:Oh,tokenize:kh};function Oh(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},rr(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function kh(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Un(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||F(n)?(e.exit(`atxHeading`),t(n)):I(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Un(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ah=`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(`.`),jh=[`pre`,`script`,`style`,`textarea`],Mh={concrete:!0,name:`htmlFlow`,resolveTo:Fh,tokenize:Ih},Nh={partial:!0,tokenize:Rh},Ph={partial:!0,tokenize:Lh};function Fh(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ih(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:oe):In(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):In(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return In(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Un(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&jh.includes(l)?(i=1,r.interrupt?t(s):D(s)):Ah.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Ln(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return I(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||In(t)?(e.consume(t),b):I(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ln(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):I(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):I(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||F(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Un(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||I(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||F(t)?D(t):I(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),k):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):F(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Nh,A,te)(t)):t===null||F(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Ph,O,A)(t)}function O(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||F(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function k(t){return t===45?(e.consume(t),oe):D(t)}function re(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return jh.includes(n)?(e.consume(t),se):D(t)}return In(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||F(t)?(e.exit(`htmlFlowData`),A(t)):(e.consume(t),se)}function A(n){return e.exit(`htmlFlow`),t(n)}}function Lh(e,t,n){let r=this;return i;function i(t){return F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Rh(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Bm,t,n)}}var zh={name:`htmlText`,tokenize:Bh};function Bh(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):In(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):In(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):F(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?k(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):F(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?k(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?k(t):F(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):F(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?k(e):y(e)}function x(t){return In(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ln(t)?(e.consume(t),S):C(t)}function C(t){return F(t)?(o=C,re(t)):I(t)?(e.consume(t),C):k(t)}function w(t){return t===45||Ln(t)?(e.consume(t),w):t===47||t===62||Un(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),k):t===58||t===95||In(t)?(e.consume(t),E):F(t)?(o=T,re(t)):I(t)?(e.consume(t),T):k(t)}function E(t){return t===45||t===46||t===58||t===95||Ln(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):F(t)?(o=ee,re(t)):I(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):F(t)?(o=D,re(t)):I(t)?(e.consume(t),D):(e.consume(t),O)}function te(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):F(t)?(o=te,re(t)):(e.consume(t),te)}function O(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Un(t)?T(t):(e.consume(t),O)}function ne(e){return e===47||e===62||Un(e)?T(e):n(e)}function k(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return I(t)?J(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var Vh={name:`labelEnd`,resolveAll:Gh,resolveTo:Kh,tokenize:qh},Hh={tokenize:Jh},Uh={tokenize:Yh},Wh={tokenize:Xh};function Gh(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&rr(e,0,e.length,n),e}function Kh(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ir(s,e.slice(a+1,a+r+3)),s=ir(s,[[`enter`,u,t]]),s=ir(s,ar(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ir(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ir(s,e.slice(o+1)),s=ir(s,[[`exit`,c,t]]),rr(e,a,e.length,s),e}function qh(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(uf(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Hh,u,o?u:d)(t):t===91?e.attempt(Uh,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Wh,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Jh(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Un(t)?bh(e,a)(t):a(t)}function a(t){return t===41?u(t):_h(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Un(t)?bh(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?yh(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Un(t)?bh(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Yh(e,t,n){let r=this;return i;function i(t){return vh.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(uf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Xh(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Zh={name:`labelStartImage`,resolveAll:Vh.resolveAll,tokenize:Qh};function Qh(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var $h={name:`labelStartLink`,resolveAll:Vh.resolveAll,tokenize:eg};function eg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var tg={name:`lineEnding`,tokenize:ng};function ng(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var rg={name:`thematicBreak`,tokenize:ig};function ig(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||F(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),I(t)?J(e,s,`whitespace`)(t):s(t))}}var ag={continuation:{tokenize:lg},exit:dg,name:`list`,tokenize:cg},og={partial:!0,tokenize:fg},sg={partial:!0,tokenize:ug};function cg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Bn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(rg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Bn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Bm,r.interrupt?n:u,e.attempt(og,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return I(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function lg(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Bm,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!I(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sg,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(ag,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ug(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function dg(e){e.exit(this.containerState.type)}function fg(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!I(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var pg={name:`setextUnderline`,resolveTo:mg,tokenize:hg};function mg(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function hg(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),I(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||F(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var gg={tokenize:wg,partial:!0};function _g(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:xg,continuation:{tokenize:Sg},exit:Cg}},text:{91:{name:`gfmFootnoteCall`,tokenize:bg},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:vg,resolveTo:yg}}}}function vg(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=uf(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function yg(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function bg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Un(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(uf(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Un(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function xg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Un(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=uf(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Un(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Sg(e,t,n){return e.check(Bm,t,e.attempt(gg,t,n))}function Cg(e){e.exit(`gfmFootnoteDefinition`)}function wg(e,t,n){let r=this;return J(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Tg(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&rr(o,o.length,0,ar(s,e.slice(r+1,n),t)),rr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),rr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Xf(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Xf(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Eg=class{constructor(){this.map=[]}add(e,t,n){Dg(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Dg(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Og(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function kg(){return{flow:{null:{name:`table`,tokenize:Ag,resolveAll:jg}}}}function Ag(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):F(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):I(t)?J(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Un(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,I(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return I(t)?J(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||F(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return I(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||F(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||F(n)?(e.exit(`tableRow`),t(n)):I(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Un(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function jg(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Eg;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Ng(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Mg(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Mg(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Mg(f,t,o,i,n,d)):(o[0]=o[1],d=Mg(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Ng(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Og(t.events,n))}return e}function Mg(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Pg(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Pg(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Pg(t.events,n[2]),a=Pg(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Pg(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ng(e,t,n,r,i){let a=[],o=Pg(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Pg(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Fg={name:`tasklistCheck`,tokenize:Lg};function Ig(){return{text:{91:Fg}}}function Lg(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Un(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return F(r)?t(r):I(r)?e.check({tokenize:Rg},t,n)(r):n(r)}}function Rg(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zg(e){return om([vm(),_g(),Tg(e),kg(),Ig()])}var Bg={};function Vg(e){let t=this,n=e||Bg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zg(n)),a.push(rm()),o.push(im(n))}var Hg=Object.defineProperty,Ug=Object.defineProperties,Wg=Object.getOwnPropertyDescriptors,Gg=Object.getOwnPropertySymbols,Kg=Object.prototype.hasOwnProperty,qg=Object.prototype.propertyIsEnumerable,Jg=(e,t,n)=>t in e?Hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yg=(e,t)=>{for(var n in t||={})Kg.call(t,n)&&Jg(e,n,t[n]);if(Gg)for(var n of Gg(t))qg.call(t,n)&&Jg(e,n,t[n]);return e},Xg=(e,t)=>Ug(e,Wg(t)),Zg=e=>{let t=new Uint8Array(e.length+1),n=!1,r=!1,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){let e=n||r?1:0;t[i+1]=e,t[i+2]=e,i+=2;continue}if(e.substring(i,i+3)==="```"){r=!r;let a=n||r?1:0,o=Math.min(i+3,e.length);for(let e=i+1;e<=o;e+=1)t[e]=a;i=o;continue}!r&&e[i]==="`"&&(n=!n),t[i+1]=n||r?1:0,i+=1}return t},Qg=null,$g=(e,t)=>{let n=Qg;return(n===null||n.text!==e)&&(n={text:e,lookup:Zg(e)},Qg=n),n.lookup[Math.min(t,e.length)]===1},e_=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},t_=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!e_(e,n)&&(t+=1)}return t},n_=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`"){if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}}return!1},r_=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,i_=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(r_,(t,n,r,i)=>$g(e,i)?t:`${n}\\>${r}`),a_=/(\*\*)([^*]*\*?)$/,o_=/(__)([^_]*?)$/,s_=/(\*\*\*)([^*]*?)$/,c_=/(\*)([^*]*?)$/,l_=/(_)([^_]*?)$/,u_=/(`)([^`]*?)$/,d_=/(~~)([^~]*?)$/,f_=/^[\s_~*`]*$/,p_=/^[\s]*[-*+][\s]+$/,m_=/[\p{L}\p{N}_]/u,h_=/^```[^`\n]*```?$/,g_=/^\*{4,}$/,__=/(__)([^_]+)_$/,v_=/(~~)([^~]+)~$/,y_=/~~/g,b_=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||m_.test(e)},x_=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},S_=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},C_=e=>e===`inlineLatex`||e===`blockLatex`,w_=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,T_=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,E_=(e,t)=>{let n=`none`;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]===`\\`&&e[r+1]===`$`){r+=1;continue}if(e[r]===`\\`){let t=w_(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!C_(n)){let t=e[r+1]===`$`;n=T_(n,t),t&&(r+=1)}}return n!==`none`},D_=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
19
|
+
`)return!1}return!1},O_=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&D_(e,t);if(e[n]===`
|
|
20
|
+
`)return!1}return!1},k_=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
21
|
+
`)return!1}return!1},A_=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
22
|
+
`){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
|
|
23
|
+
`){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},j_=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),M_=(e,t,n,r)=>n===`\\`||j_(e)&&E_(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
|
|
24
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
25
|
+
`),N_=e=>e===` `||e===` `||e===`
|
|
26
|
+
`,P_=(e,t)=>!!(e&&t&&b_(e)&&b_(t)),F_=(e,t,n,r)=>{let i=P_(e,t),a=!!t&&!N_(t),o=!!e&&!N_(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},I_=e=>{let t=0,n=!1,r=!1,i=e.length;for(let a=0;a<i;a+=1){if(e[a]==="`"&&a+2<i&&e[a+1]==="`"&&e[a+2]==="`"){n=!n,a+=2;continue}if(n)continue;if(e[a]!==`*`){b_(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(M_(e,a,o,s))continue;let c=F_(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},L_=(e,t,n,r)=>!!(n===`\\`||j_(e)&&E_(e,t)||O_(e,t)||k_(e,t)||n===`_`||r===`_`||n&&r&&b_(n)&&b_(r)),R_=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;L_(e,i,a,o)||(t+=1)}return t},z_=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},B_=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`*`&&r+1<e.length&&e[r+1]===`*`&&(t+=1,r+=1)}return t},V_=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`_`&&r+1<e.length&&e[r+1]===`_`&&(t+=1,r+=1)}return t},H_=(e,t,n)=>{if(!t||f_.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
27
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return p_.test(a)&&t.includes(`
|
|
28
|
+
`)?!0:A_(e,n,`*`)},U_=e=>{let t=e.match(a_);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return $g(e,r)||n_(e,r)||H_(e,n,r)?e:B_(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},W_=(e,t,n)=>{if(!t||f_.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
29
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return p_.test(a)&&t.includes(`
|
|
30
|
+
`)?!0:A_(e,n,`_`)},G_=e=>{let t=e.match(o_);if(!t){let t=e.match(__);if(t){let n=e.lastIndexOf(t[1]);if(!($g(e,n)||n_(e,n))&&V_(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return $g(e,r)||n_(e,r)||W_(e,n,r)?e:V_(e)%2==1?`${e}__`:e},K_=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`*`&&e[n-1]!==`*`&&e[n+1]!==`*`&&e[n-1]!==`\\`&&!E_(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||N_(t),a=!r||N_(r);if(i&&a||t&&r&&b_(t)&&b_(r)||a)continue;return n}}return-1},q_=e=>{if(!e.match(c_))return e;let t=K_(e);if(t===-1||$g(e,t)||n_(e,t))return e;let n=e.substring(t+1);return!n||f_.test(n)?e:I_(e)%2==1?`${e}*`:e},J_=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`_`&&e[n-1]!==`_`&&e[n+1]!==`_`&&e[n-1]!==`\\`&&!E_(e,n)&&!O_(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&b_(t)&&b_(r))continue;return n}}return-1},Y_=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
31
|
+
`;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},X_=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(B_(t)%2!=1)return null;let n=t.indexOf(`**`),r=J_(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},Z_=e=>{if(!e.match(l_))return e;let t=J_(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||f_.test(n)||$g(e,t)||n_(e,t))return e;if(R_(e)%2==1){let t=X_(e);return t===null?Y_(e):t}return e},Q_=e=>{let t=B_(e),n=I_(e);return t%2==0&&n%2==0},$_=(e,t,n)=>!t||f_.test(t)||$g(e,n)||n_(e,n)?!0:A_(e,n,`*`),ev=e=>{if(g_.test(e))return e;let t=e.match(s_);if(!t)return e;let n=t[2];return $_(e,n,e.lastIndexOf(t[1]))?e:z_(e)%2==1?Q_(e)?e:`${e}***`:e},tv=/<[a-zA-Z/][^>]*$/,nv=e=>{let t=e.match(tv);return!t||t.index===void 0||$g(e,t.index)?e:e.substring(0,t.index).trimEnd()},rv=e=>!e.match(h_)||e.includes(`
|
|
32
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,iv=e=>(e.match(/```/g)||[]).length%2==1,av=e=>{let t=rv(e);if(t!==null)return t;let n=e.match(u_);if(n&&!iv(e)){let t=n[2];if(!t||f_.test(t))return e;if(t_(e)%2==1)return`${e}\``}return e},ov=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",sv=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!ov(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},cv=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!ov(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},lv=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
|
|
33
|
+
`,t)!==-1&&!e.endsWith(`
|
|
34
|
+
`)?`${e}
|
|
35
|
+
$$`:`${e}$$`},uv=e=>sv(e)%2==0?e:lv(e),dv=e=>cv(e)%2==1?`${e}$`:e,fv=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=x_(e,t);if(r===-1||$g(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},pv=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!$g(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=S_(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},mv=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=pv(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(S_(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=pv(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},hv=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!$g(e,n)){let r=fv(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!$g(e,n)){let r=mv(e,n,t);if(r!==null)return r}return e},gv=/^-{1,2}$/,_v=/^[\s]*-{1,2}[\s]+$/,vv=/^={1,2}$/,yv=/^[\s]*={1,2}[\s]+$/,bv=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
|
|
36
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(gv.test(i)&&!n.match(_v)){let t=r.split(`
|
|
37
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(vv.test(i)&&!n.match(yv)){let t=r.split(`
|
|
38
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},xv=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,Sv=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(xv,(t,n,r)=>$g(e,r+n.length)?t:`${n}\\~`),Cv=e=>{let t=e.match(d_);if(t){let n=t[2];if(!n||f_.test(n))return e;let r=e.lastIndexOf(t[1]);if($g(e,r)||n_(e,r))return e;if(e.match(y_)?.length%2==1)return`${e}~~`}else{let t=e.match(v_);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if($g(e,n)||n_(e,n))return e;if(e.match(y_)?.length%2==1)return`${e}~`}}return e},wv=e=>e!==!1,Tv=e=>e===!0,Ev={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},Dv=[{handler:{name:`singleTilde`,handle:Sv,priority:Ev.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:i_,priority:Ev.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:nv,priority:Ev.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:bv,priority:Ev.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:hv,priority:Ev.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:ev,priority:Ev.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:U_,priority:Ev.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:G_,priority:Ev.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:q_,priority:Ev.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:Z_,priority:Ev.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:av,priority:Ev.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:Cv,priority:Ev.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:uv,priority:Ev.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:dv,priority:Ev.INLINE_KATEX},optionKey:`inlineKatex`}],Ov=e=>{let t=e?.linkMode??`protocol`;return Dv.filter(({handler:t,optionKey:n})=>t.name===`links`?wv(e?.links)||wv(e?.images):t.name===`inlineKatex`?Tv(e?.inlineKatex):wv(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:Xg(Yg({},e),{handle:e=>hv(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},kv=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=Ov(t),i=(t?.handlers??[]).map(e=>({handler:Xg(Yg({},e),{priority:e.priority??Ev.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},Av=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mv={};function Nv(e,t){return((t||Mv).jsx?jv:Av).test(e)}var Pv=/[ \t\n\f\r]/g;function Fv(e){return typeof e==`object`?e.type===`text`&&Iv(e.value):Iv(e)}function Iv(e){return e.replace(Pv,``)===``}var Lv=i(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
39
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Rv=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Lv());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),zv=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Bv=i(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Rv()),r=zv();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function Vv(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Uv(e.position):`start`in e||`end`in e?Uv(e):`line`in e||`column`in e?Hv(e):``}function Hv(e){return Wv(e&&e.line)+`:`+Wv(e&&e.column)}function Uv(e){return Hv(e&&e.start)+`-`+Hv(e&&e.end)}function Wv(e){return e&&typeof e==`number`?e:1}var Gv=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Vv(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Gv.prototype.file=``,Gv.prototype.name=``,Gv.prototype.reason=``,Gv.prototype.message=``,Gv.prototype.stack=``,Gv.prototype.column=void 0,Gv.prototype.line=void 0,Gv.prototype.ancestors=void 0,Gv.prototype.cause=void 0,Gv.prototype.fatal=void 0,Gv.prototype.place=void 0,Gv.prototype.ruleId=void 0,Gv.prototype.source=void 0;var Kv=e(Bv(),1),qv={}.hasOwnProperty,Jv=new Map,Yv=/[A-Z]/g,Xv=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Zv=new Set([`td`,`th`]),Qv=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function $v(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=uy(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ly(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?eo:$a,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ey(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ey(e,t,n){if(t.type===`element`)return ty(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return ny(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return iy(e,t,n);if(t.type===`mdxjsEsm`)return ry(e,t);if(t.type===`root`)return ay(e,t,n);if(t.type===`text`)return oy(e,t)}function ty(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=eo,e.schema=i),e.ancestors.push(t);let a=gy(e,t.tagName,!1),o=dy(e,t),s=py(e,t);return Xv.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Fv(e)})),sy(e,o,a,t),cy(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ny(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}_y(e,t.position)}function ry(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_y(e,t.position)}function iy(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=eo,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:gy(e,t.name,!0),o=fy(e,t),s=py(e,t);return sy(e,o,a,t),cy(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ay(e,t,n){let r={};return cy(r,py(e,t)),e.create(t,e.Fragment,r,n)}function oy(e,t){return t.value}function sy(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cy(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ly(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function uy(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Qu(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function dy(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&qv.call(t.properties,i)){let a=my(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Zv.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function fy(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else _y(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else _y(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function py(e,t){let n=[],r=-1,i=e.passKeys?new Map:Jv;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ey(e,a,o);s!==void 0&&n.push(s)}return n}function my(e,t,n){let r=Xa(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?no(n):oo(n)),r.property===`style`){let t=typeof n==`object`?n:hy(e,String(n));return e.stylePropertyNameCase===`css`&&(t=vy(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ka[r.property]||r.property:r.attribute,n]}}function hy(e,t){try{return(0,Kv.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Gv("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Qv+`#cannot-parse-style-attribute`,r}}function gy(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Nv(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Nv(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return qv.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);_y(e)}function _y(e,t){let n=new Gv("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Qv+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function vy(e){let t={},n;for(n in e)qv.call(e,n)&&(t[yy(n)]=e[n]);return t}function yy(e){let t=e.replace(Yv,by);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function by(e){return`-`+e.toLowerCase()}var xy={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Sy={tokenize:Cy};function Cy(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return F(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var wy={tokenize:Ey},Ty={tokenize:Dy};function Ey(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return rr(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ty,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ty,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return F(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;rr(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Dy(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var Oy={tokenize:ky};function ky(e){let t=this,n=e.attempt(Bm,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fh,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Ay={resolveAll:Py()},jy=Ny(`string`),My=Ny(`text`);function Ny(e){return{resolveAll:Py(e===`text`?Fy:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Py(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Fy(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Iy=r({attentionMarkers:()=>Wy,contentInitial:()=>Ry,disable:()=>Gy,document:()=>Ly,flow:()=>By,flowInitial:()=>zy,insideSpan:()=>Uy,string:()=>Vy,text:()=>Hy}),Ly={42:ag,43:ag,45:ag,48:ag,49:ag,50:ag,51:ag,52:ag,53:ag,54:ag,55:ag,56:ag,57:ag,62:Hm},Ry={91:xh},zy={[-2]:eh,[-1]:eh,32:eh},By={35:Dh,42:rg,45:[pg,rg],60:Mh,61:pg,95:rg,96:Zm,126:Zm},Vy={38:Jm,92:Km},Hy={[-5]:tg,[-4]:tg,[-3]:tg,33:Zh,38:Jm,42:Pm,60:[Rm,zh],91:$h,92:[Th,Km],93:Vh,95:Pm,96:ih},Uy={null:[Pm,Ay]},Wy={null:[42,95]},Gy={null:[]};function Ky(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ir(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ar(a,l.events,l),l.events):[]}function f(e,t){return Jy(p(e),t)}function p(e){return qy(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){F(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&rr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qy(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Jy(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
40
|
+
`;break;case-3:o=`\r
|
|
41
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Yy(e){let t={constructs:om([Iy,...(e||{}).extensions||[]]),content:n(Sy),defined:[],document:n(wy),flow:n(Oy),lazy:{},string:n(jy),text:n(My)};return t;function n(e){return n;function n(n){return Ky(t,e,n)}}}function Xy(e){for(;!uh(e););return e}var Zy=/[\0\t\n\r]/g;function Qy(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Zy.lastIndex=u,c=Zy.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var $y={}.hasOwnProperty;function eb(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),tb(n)(Xy(Yy(n).document().write(Qy()(e,t,!0))))}function tb(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:ce,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(O),htmlTextData:E,image:c(re),label:ae,labelText:ie,lineEnding:ee,link:c(k),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:j,resourceDestinationString:oe,resourceTitleString:se,resource:A,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};rb(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];$y.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ab).call(a,void 0,e[0])}for(r.position={start:nb(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nb(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nb(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ab).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Vv({start:e.start,end:e.end})+`): it’s not open`);n.position.end=nb(e.end)}function u(){return tp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uf(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:nb(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nb(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=nb(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Vp(t),n.identifier=uf(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function A(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function j(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uf(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=zp(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Rp(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=nb(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function nb(e){return{line:e.line,column:e.column,offset:e.offset}}function rb(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?rb(e,r):ib(e,r)}}function ib(e,t){let n;for(n in t)if($y.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ab(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Vv({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vv({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Vv({start:t.start,end:t.end})+`) is still open`)}function ob(e){let t=this;t.parser=n;function n(n){return eb(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function sb(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function cb(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
42
|
+
`}]}function lb(e,t){let n=t.value?t.value+`
|
|
43
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function ub(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function db(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fb(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Nm(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function pb(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mb(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hb(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function gb(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hb(e,t);let i={src:Nm(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _b(e,t){let n={src:Nm(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vb(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function yb(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hb(e,t);let i={href:Nm(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bb(e,t){let n={href:Nm(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xb(e,t,n){let r=e.all(t),i=n?Sb(n):Cb(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
44
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
45
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Sb(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Cb(n[r])}return t}function Cb(e){return e.spread??e.children.length>1}function wb(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Tb(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eb(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Db(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ob(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Qu(t.children[1]),o=Zu(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function kb(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Ab(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var jb=9,Mb=32;function Nb(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Pb(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Pb(t.slice(i),i>0,!1)),a.join(``)}function Pb(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===jb||t===Mb;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===jb||t===Mb;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Fb(e,t){let n={type:`text`,value:Nb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ib(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Lb={blockquote:sb,break:cb,code:lb,delete:ub,emphasis:db,footnoteReference:fb,heading:pb,html:mb,imageReference:gb,image:_b,inlineCode:vb,linkReference:yb,link:bb,listItem:xb,list:wb,paragraph:Tb,root:Eb,strong:Db,table:Ob,tableCell:Ab,tableRow:kb,text:Fb,thematicBreak:Ib,toml:Rb,yaml:Rb,definition:Rb,footnoteDefinition:Rb};function Rb(){}function zb(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Bb(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Vb(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||zb,r=e.options.footnoteBackLabel||Bb,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Nm(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...xa(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
46
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
47
|
+
`}]}}var Hb={}.hasOwnProperty,Ub={};function Wb(e,t){let n=t||Ub,r=new Map,i=new Map,a={all:s,applyData:Kb,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Lb,...n.handlers},one:o,options:n,patch:Gb,wrap:Jb};return Hi(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Hb.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=xa(n);return r.children=a.all(e),r}return xa(e)}return(a.options.unknownHandler||qb)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Yb(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Yb(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Gb(e,t){e.position&&(t.position=ed(e))}function Kb(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,xa(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function qb(e,t){let n=t.data||{},r=`value`in t&&!(Hb.call(n,`hProperties`)||Hb.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jb(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
48
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
49
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
50
|
+
`}),n}function Yb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xb(e,t){let n=Wb(e,t),r=n.one(e,void 0),i=Vb(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
51
|
+
`},i)),a}function Zb(e,t){return e&&`run`in e?async function(n,r){let i=Xb(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Xb(n,{file:r,...e||t})}}function Qb(e){if(e)throw e}var $b=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function ex(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tx(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?nx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function nx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var rx={basename:ix,dirname:ax,extname:ox,join:sx,sep:`/`};function ix(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ux(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ax(e){if(ux(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ox(e){ux(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function sx(...e){let t=-1,n;for(;++t<e.length;)ux(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:cx(n)}function cx(e){ux(e);let t=e.codePointAt(0)===47,n=lx(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function lx(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ux(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var dx={cwd:fx};function fx(){return`/`}function px(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function mx(e){if(typeof e==`string`)e=new URL(e);else if(!px(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return hx(e)}function hx(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var gx=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],_x=class{constructor(e){let t;t=e?px(e)?{path:e}:typeof e==`string`||xx(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:dx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<gx.length;){let e=gx[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)gx.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?rx.basename(this.path):void 0}set basename(e){yx(e,`basename`),vx(e,`basename`),this.path=rx.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?rx.dirname(this.path):void 0}set dirname(e){bx(this.basename,`dirname`),this.path=rx.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?rx.extname(this.path):void 0}set extname(e){if(vx(e,`extname`),bx(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=rx.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){px(e)&&(e=mx(e)),yx(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?rx.basename(this.path,this.extname):void 0}set stem(e){yx(e,`stem`),vx(e,`stem`),this.path=rx.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Gv(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function vx(e,t){if(e&&e.includes(rx.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+rx.sep+"`")}function yx(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function bx(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function xx(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Sx=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Cx=e($b(),1),wx={}.hasOwnProperty,Tx=new class e extends Sx{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=tx()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Cx.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ox(`data`,this.frozen),this.namespace[e]=t,this):wx.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ox(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=jx(e),n=this.parser||this.Parser;return Ex(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ex(`process`,this.parser||this.Parser),Dx(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=jx(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Nx(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Ex(`processSync`,this.parser||this.Parser),Dx(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ax(`processSync`,`process`,t),n;function r(e,r){t=!0,Qb(e),n=r}}run(e,t,n){kx(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=jx(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ax(`runSync`,`run`,n),r;function i(e,t){Qb(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=jx(t),r=this.compiler||this.Compiler;return Dx(`stringify`,r),kx(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ox(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Cx.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];ex(o)&&ex(r)&&(r=(0,Cx.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ex(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Dx(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ox(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kx(e){if(!ex(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ax(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function jx(e){return Mx(e)?e:new _x(e)}function Mx(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Nx(e){return typeof e==`string`||Px(e)}function Px(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function Fx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ix=Fx();function Lx(e){Ix=e}var Rx={exec:()=>null};function Y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Bx.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var zx=(()=>{try{return!0}catch{return!1}})(),Bx={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Vx=/^(?:[ \t]*(?:\n|$))+/,Hx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ux=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wx=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kx=/(?:[*+-]|\d{1,9}[.)])/,qx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Jx=Y(qx).replace(/bull/g,Kx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Yx=Y(qx).replace(/bull/g,Kx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Xx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zx=/^[^\n]+/,Qx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$x=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Qx).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eS=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kx).getRegex(),tS=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,nS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rS=Y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,nS).replace(`tag`,tS).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),iS=Y(Xx).replace(`hr`,Wx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,tS).getRegex(),aS={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,iS).getRegex(),code:Hx,def:$x,fences:Ux,heading:Gx,hr:Wx,html:rS,lheading:Jx,list:eS,newline:Vx,paragraph:iS,table:Rx,text:Zx},oS=Y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Wx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,tS).getRegex(),sS={...aS,lheading:Yx,table:oS,paragraph:Y(Xx).replace(`hr`,Wx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,oS).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,tS).getRegex()},cS={...aS,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,nS).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rx,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(Xx).replace(`hr`,Wx).replace(`heading`,` *#{1,6} *[^
|
|
52
|
+
]`).replace(`lheading`,Jx).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},lS=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uS=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dS=/^( {2,}|\\)\n(?!\s*$)/,fS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pS=/[\p{P}\p{S}]/u,mS=/[\s\p{P}\p{S}]/u,hS=/[^\s\p{P}\p{S}]/u,gS=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,mS).getRegex(),_S=/(?!~)[\p{P}\p{S}]/u,vS=/(?!~)[\s\p{P}\p{S}]/u,yS=/(?:[^\s\p{P}\p{S}]|~)/u,bS=Y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,zx?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),xS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,SS=Y(xS,`u`).replace(/punct/g,pS).getRegex(),CS=Y(xS,`u`).replace(/punct/g,_S).getRegex(),wS=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,TS=Y(wS,`gu`).replace(/notPunctSpace/g,hS).replace(/punctSpace/g,mS).replace(/punct/g,pS).getRegex(),ES=Y(wS,`gu`).replace(/notPunctSpace/g,yS).replace(/punctSpace/g,vS).replace(/punct/g,_S).getRegex(),DS=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,hS).replace(/punctSpace/g,mS).replace(/punct/g,pS).getRegex(),OS=Y(/\\(punct)/,`gu`).replace(/punct/g,pS).getRegex(),kS=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[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])?)+(?![-_])/).getRegex(),AS=Y(nS).replace(`(?:-->|$)`,`-->`).getRegex(),jS=Y(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,AS).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),MS=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,NS=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,MS).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),PS=Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,MS).replace(`ref`,Qx).getRegex(),FS=Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Qx).getRegex(),IS=Y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,PS).replace(`nolink`,FS).getRegex(),LS=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,RS={_backpedal:Rx,anyPunctuation:OS,autolink:kS,blockSkip:bS,br:dS,code:uS,del:Rx,emStrongLDelim:SS,emStrongRDelimAst:TS,emStrongRDelimUnd:DS,escape:lS,link:NS,nolink:FS,punctuation:gS,reflink:PS,reflinkSearch:IS,tag:jS,text:fS,url:Rx},zS={...RS,link:Y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,MS).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,MS).getRegex()},BS={...RS,emStrongRDelimAst:ES,emStrongLDelim:CS,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,LS).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,LS).getRegex()},VS={...BS,br:Y(dS).replace(`{2,}`,`*`).getRegex(),text:Y(BS.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},HS={normal:aS,gfm:sS,pedantic:cS},US={normal:RS,gfm:BS,breaks:VS,pedantic:zS},WS={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},GS=e=>WS[e];function KS(e,t){if(t){if(Bx.escapeTest.test(e))return e.replace(Bx.escapeReplace,GS)}else if(Bx.escapeTestNoEncode.test(e))return e.replace(Bx.escapeReplaceNoEncode,GS);return e}function qS(e){try{e=encodeURI(e).replace(Bx.percentDecode,`%`)}catch{return null}return e}function JS(e,t){let n=e.replace(Bx.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Bx.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Bx.slashPipe,`|`);return n}function YS(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function XS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ZS(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function QS(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
53
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
54
|
+
`)}var $S=class{options;rules;lexer;constructor(e){this.options=e||Ix}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:YS(e,`
|
|
55
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=QS(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=YS(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:YS(t[0],`
|
|
56
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=YS(t[0],`
|
|
57
|
+
`).split(`
|
|
58
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
59
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
60
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
61
|
+
${s}`:s,r=r?`${r}
|
|
62
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
63
|
+
`+e.join(`
|
|
64
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
65
|
+
`+e.join(`
|
|
66
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
67
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
68
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
69
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
70
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
71
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
72
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
73
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
74
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=JS(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
75
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(JS(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
76
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=YS(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=XS(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ZS(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ZS(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},eC=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ix,this.options.tokenizer=this.options.tokenizer||new $S,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Bx,block:HS.normal,inline:US.normal};this.options.pedantic?(t.block=HS.pedantic,t.inline=US.pedantic):this.options.gfm&&(t.block=HS.gfm,t.inline=this.options.breaks?US.breaks:US.gfm),this.tokenizer.rules=t}static get rules(){return{block:HS,inline:US}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Bx.carriageReturn,`
|
|
77
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Bx.tabCharGlobal,` `).replace(Bx.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
78
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
79
|
+
`)?``:`
|
|
80
|
+
`)+r.raw,n.text+=`
|
|
81
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
82
|
+
`)?``:`
|
|
83
|
+
`)+r.raw,n.text+=`
|
|
84
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
85
|
+
`)?``:`
|
|
86
|
+
`)+r.raw,a.text+=`
|
|
87
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
88
|
+
`)?``:`
|
|
89
|
+
`)+r.raw,n.text+=`
|
|
90
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},tC=class{options;parser;constructor(e){this.options=e||Ix}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Bx.notSpaceStart)?.[0],i=e.replace(Bx.endingNewline,``)+`
|
|
91
|
+
`;return r?`<pre><code class="language-`+KS(r)+`">`+(n?i:KS(i,!0))+`</code></pre>
|
|
92
|
+
`:`<pre><code>`+(n?i:KS(i,!0))+`</code></pre>
|
|
93
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
94
|
+
${this.parser.parse(e)}</blockquote>
|
|
95
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
96
|
+
`}hr(e){return`<hr>
|
|
97
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
98
|
+
`+r+`</`+i+`>
|
|
99
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
100
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
101
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
102
|
+
<thead>
|
|
103
|
+
`+t+`</thead>
|
|
104
|
+
`+r+`</table>
|
|
105
|
+
`}tablerow({text:e}){return`<tr>
|
|
106
|
+
${e}</tr>
|
|
107
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
108
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${KS(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=qS(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+KS(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=qS(e);if(i===null)return KS(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${KS(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:KS(e.text)}},nC=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},rC=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ix,this.options.renderer=this.options.renderer||new tC,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nC}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},iC=class{options;block;constructor(e){this.options=e||Ix}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?eC.lex:eC.lexInline}provideParser(){return this.block?rC.parse:rC.parseInline}},aC=new class{defaults=Fx();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=rC;Renderer=tC;TextRenderer=nC;Lexer=eC;Tokenizer=$S;Hooks=iC;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new tC(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $S(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new iC;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=iC.passThroughHooks.has(n)?e=>{if(this.defaults.async&&iC.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return eC.lex(e,t??this.defaults)}parser(e,t){return rC.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?eC.lex:eC.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?rC.parse:rC.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?eC.lex:eC.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?rC.parse:rC.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
109
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+KS(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function oC(e,t){return aC.parse(e,t)}oC.options=oC.setOptions=function(e){return aC.setOptions(e),oC.defaults=aC.defaults,Lx(oC.defaults),oC},oC.getDefaults=Fx,oC.defaults=Ix,oC.use=function(...e){return aC.use(...e),oC.defaults=aC.defaults,Lx(oC.defaults),oC},oC.walkTokens=function(e,t){return aC.walkTokens(e,t)},oC.parseInline=aC.parseInline,oC.Parser=rC,oC.parser=rC.parse,oC.Renderer=tC,oC.TextRenderer=nC,oC.Lexer=eC,oC.lexer=eC.lex,oC.Tokenizer=$S,oC.Hooks=iC,oC.parse=oC,oC.options,oC.setOptions,oC.use,oC.walkTokens,oC.parseInline,rC.parse,eC.lex;var sC=300,cC=`300px`,lC=500;function uC(e={}){let{immediate:t=!1,debounceDelay:n=sC,rootMargin:r=cC,idleTimeout:i=lC}=e,[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,N.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,N.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var dC=320,fC=4,pC=()=>typeof performance>`u`?Date.now():performance.now();function mC(e){let t=e?.now??pC,n=e?.maxBacklogMs??dC,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,fC),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var hC=/\s/,gC=/^\s+$/,_C=new Set([`pre`,`svg`,`math`,`annotation`]),vC=new Set([`img`,`hr`]),yC=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,bC=e=>e.some(e=>yC(e)&&_C.has(e.tagName)),xC=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(yC(n)&&n.tagName===`li`)return n}},SC=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},CC=new Set([`ul`,`ol`,`li`]),wC=e=>{for(let t of e.children)if(yC(t)){if(t.tagName===`input`)return t;if(CC.has(t.tagName))continue;let e=wC(t);if(e)return e}},TC=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},EC=(e,t,n,r)=>{let i=wC(e);i&&TC(i,t,n,r)},DC=(e,t,n,r,i,a)=>{if(bC(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;TC(e,n,c?0:n.duration,l)},OC=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(yC(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},kC=e=>{let t=[],n=``,r=!1;for(let i of e){let e=hC.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},AC=e=>{let t=[],n=``;for(let r of e)hC.test(r)?t.length>0&&!gC.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},jC=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},MC=(e,t)=>!(e>0&&t<e),NC=e=>yC(e)&&vC.has(e.tagName),PC=(e,t,n)=>{let r=0,i=0;return Bi(e,e=>e.type===`text`||NC(e),(e,a)=>{if(bC(a))return zi;if(NC(e)){MC(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?AC(o):kC(o);for(let e of s){let t=i;i+=e.length,!gC.test(e)&&MC(n,t)&&(r+=1)}}),r},FC=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(bC(t))return zi;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?AC(u):kC(u),f=r.prevContentLength,p=!1,m=xC(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,gC.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;SC(m,e,o,n.easing),EC(m,n,e,o),g=!0}return jC(e,n.animation,n.duration,n.easing,r,o)});return p&&OC(t),c.children.splice(l,1,..._),l+_.length},IC=0;function LC(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=IC++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??pC();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(PC(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};Bi(e,e=>e.type===`text`||NC(e),(e,i)=>{if(e.type===`text`)return FC(e,i,t,n,r,o);DC(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}LC();var RC=(0,N.createContext)(!1),zC=()=>(0,N.useContext)(RC),BC=(...e)=>l(s(e)),VC=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},HC=e=>e?(...t)=>VC(e,l(s(t))):BC,UC=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},WC=(0,N.createContext)(BC),X=()=>(0,N.useContext)(WC),GC=8,KC=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},qC=(e,t,n)=>{let r=(0,N.useRef)(null),i=(0,N.useRef)(!0),a=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<GC;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,N.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,N.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},JC=BC(`block`),YC=BC(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),XC=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},ZC=(0,N.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(PE),u=KC(i),d=qC(l,!!u,t),f=(0,N.useMemo)(()=>c(YC),[c]),p=(0,N.useMemo)(()=>c(JC),[c]),m=(0,N.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,XC(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,M.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,M.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,M.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,M.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
110
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,M.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),QC=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=X();return(0,M.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},$C=(0,N.createContext)({code:``}),ew=()=>(0,N.useContext)($C),tw=({language:e})=>{let t=X();return(0,M.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,M.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},nw=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
111
|
+
`;)t--;return e.slice(0,t)},rw=(0,N.lazy)(()=>Fe(()=>import(`./highlighted-body-KPVGNVTW-C38puTq_.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2]),import.meta.url)),iw=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=X(),{codeBlockMaxHeight:l}=(0,N.useContext)(PE),u=(0,N.useMemo)(()=>nw(e),[e]),d=(0,N.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
112
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,M.jsx)($C.Provider,{value:{code:e},children:(0,M.jsxs)(QC,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,M.jsx)(tw,{language:t}),r?(0,M.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(ZC,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,M.jsx)(rw,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},aw={CheckIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,M.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,M.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},ow=(0,N.createContext)(aw),sw=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},cw=({icons:e,children:t})=>{let n=(0,N.useRef)(e),r=(0,N.useRef)(e?{...aw,...e}:aw);sw(n.current,e)||(n.current=e,r.current=e?{...aw,...e}:aw);let i=r.current;return(0,M.jsx)(ow.Provider,{value:i,children:t})},lw=()=>(0,N.useContext)(ow),uw={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},dw=(0,N.createContext)(uw),fw=()=>(0,N.useContext)(dw),pw=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=X(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:d}=ew(),{isAnimating:f}=(0,N.useContext)(PE),p=fw(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=lw(),_=c?g.CheckIcon:g.CopyIcon;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,M.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,M.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},mw=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},hw={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},gw=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=X(),{code:c}=ew(),{isAnimating:l,controls:u}=(0,N.useContext)(PE),d=fw(),f=lw(),p=a??c,m=n&&n in hw?hw[n]:`txt`,h=`${mw(u,`code`,`file`)}.${m}`;return(0,M.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{UC(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,M.jsx)(f.DownloadIcon,{size:14})})},_w=()=>{let{Loader2Icon:e}=lw(),t=X();return(0,M.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,M.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,M.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,M.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},vw=/\.[^/.]+$/,yw=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=lw(),u=X(),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),g=fw(),_=c.width!=null||c.height!=null,v=(f||_)&&!m&&o&&s,y=m&&!_;(0,N.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let b=(0,N.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),x=(0,N.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),S=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(vw,``)}.${i}`}UC(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,M.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,M.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,y&&`hidden`,t),"data-streamdown":`image`,onError:x,onLoad:b,ref:d,src:n,...c}),y&&(0,M.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,M.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),v&&(0,M.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:S,title:g.downloadImage,type:`button`,children:(0,M.jsx)(l,{size:14})})]}):null},bw=0,xw=()=>{bw+=1,bw===1&&(document.body.style.overflow=`hidden`)},Sw=()=>{bw=Math.max(0,bw-1),bw===0&&(document.body.style.overflow=``)},Cw=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=lw(),c=X(),[l,u]=(0,N.useState)(!1),d=fw(),f=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,N.useCallback)(()=>{r(),n()},[r,n]);if((0,N.useEffect)(()=>{if(t){xw();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Sw()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,M.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,M.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,M.jsx)(s,{size:16})}),(0,M.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,M.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,M.jsx)(o,{size:20}),(0,M.jsx)(`span`,{children:d.openExternalLink})]}),(0,M.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,M.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,M.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,M.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(i,{size:14}),(0,M.jsx)(`span`,{children:d.copied})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{size:14}),(0,M.jsx)(`span`,{children:d.copyLink})]})}),(0,M.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,M.jsx)(o,{size:14}),(0,M.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,pt.createPortal)(m,document.body)},ww=(0,N.createContext)(null),Tw=()=>(0,N.useContext)(ww),Ew=()=>Tw()?.code??null,Dw=()=>Tw()?.mermaid??null,Ow=e=>{var t;let n=Tw();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},kw=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},Aw=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),jw=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=X(),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u,controls:d}=(0,N.useContext)(PE),f=lw(),p=Dw(),m=fw(),h=mw(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){UC(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=kw(l);if(t===`svg`){UC(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await Aw(u);UC(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,M.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,M.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},Mw=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=lw(),c=X(),[l,u]=(0,N.useState)(!1),{isAnimating:d,controls:f}=(0,N.useContext)(PE),p=fw(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,N.useEffect)(()=>{if(l){xw();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Sw()}}},[l]),(0,N.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,M.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,pt.createPortal)((0,M.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,M.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,M.jsx)(jw,{chart:e,config:t}):null,g?(0,M.jsx)(pw,{code:e}):null,(0,M.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,M.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,M.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,M.jsx)(RE,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function Nw(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
113
|
+
`:Array.from(t.childNodes).map(Nw).join(``)}var Pw=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(Nw(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(Nw(e).trim());n.push(t)}return{headers:t,rows:n}},Fw=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},Iw=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
114
|
+
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
115
|
+
`)},Lw=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
116
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
117
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
118
|
+
`)},Rw=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
119
|
+
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
120
|
+
`?n.push(`<br>`):n.push(t);return n.join(``)},zw=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>Rw(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?Rw(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>Rw(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
121
|
+
`)},Bw=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=X(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f,controls:p}=(0,N.useContext)(PE),m=fw(),h=Fw(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Pw(t),o=``;o=e===`csv`?Iw(a,h):e===`tsv`?Lw(a):zw(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=lw(),v=c?_.CheckIcon:_.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,M.jsx)(v,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},Vw=({children:e,className:t,onDownload:n,onError:r})=>{let i=X(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c,controls:l}=(0,N.useContext)(PE),u=fw(),d=lw(),f=Fw(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Pw(t),a=e===`csv`?Iw(i,f):zw(i),c=e===`csv`?`csv`:`md`;UC(`${mw(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,M.jsx)(d.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},Hw=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=lw(),o=X(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(PE),u=fw(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){xw();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Sw()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,pt.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(Bw,{}):null,r?(0,M.jsx)(Vw,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Uw=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(PE),u=KC(n),d=qC(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,M.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,M.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,M.jsx)(Bw,{}):null,p?(0,M.jsx)(Vw,{}):null,m?(0,M.jsx)(Hw,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,M.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,M.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},Ww=/startLine=(\d+)/,Gw=/\bnoLineNumbers\b/,Kw=(0,N.lazy)(()=>Fe(()=>import(`./mermaid-HWGCJPDP-B2eHIVs6.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),qw=/language-([^\s]+)/,Jw=`node`;function Yw(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==Jw&&!Object.is(r[e],i[e]))return!1;return!0}function Xw(e,t){return e?.properties?.metastring===t?.properties?.metastring}var Zw=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,Qw=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},$w=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},eT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},tT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},nT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>Yw(e,t));nT.displayName=`MarkdownOl`;var rT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>Yw(e,t));rT.displayName=`MarkdownLi`;var iT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>Yw(e,t));iT.displayName=`MarkdownUl`;var aT=(0,N.memo)(({className:e,node:t,...n})=>{let r=X();return(0,M.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>Yw(e,t));aT.displayName=`MarkdownHr`;var oT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>Yw(e,t));oT.displayName=`MarkdownStrong`;var sT=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=X(),{linkSafety:o}=(0,N.useContext)(PE),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(Cw,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Yw(e,t));sT.displayName=`MarkdownA`;var cT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>Yw(e,t));cT.displayName=`MarkdownH1`;var lT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>Yw(e,t));lT.displayName=`MarkdownH2`;var uT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>Yw(e,t));uT.displayName=`MarkdownH3`;var dT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>Yw(e,t));dT.displayName=`MarkdownH4`;var fT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>Yw(e,t));fT.displayName=`MarkdownH5`;var pT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>Yw(e,t));pT.displayName=`MarkdownH6`;var mT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,N.useContext)(PE),o=Zw(i,`table`),s=Qw(i,`copy`),c=Qw(i,`download`),l=Qw(i,`fullscreen`);return(0,M.jsx)(Uw,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>Yw(e,t));mT.displayName=`MarkdownTable`;var hT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>Yw(e,t));hT.displayName=`MarkdownThead`;var gT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>Yw(e,t));gT.displayName=`MarkdownTbody`;var _T=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>Yw(e,t));_T.displayName=`MarkdownTr`;var vT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>Yw(e,t));vT.displayName=`MarkdownTh`;var yT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>Yw(e,t));yT.displayName=`MarkdownTd`;var bT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>Yw(e,t));bT.displayName=`MarkdownBlockquote`;var xT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>Yw(e,t));xT.displayName=`MarkdownSup`;var ST=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>Yw(e,t));ST.displayName=`MarkdownSub`;var CT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===nT){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Yw(e,t));CT.displayName=`MarkdownSection`;var wT=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=X(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(PE),l=Dw(),u=zC(),d=(t?.match(qw))?.at(1)??``,f=Ow(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Ww),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&Gw.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(_w,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=Zw(s,`mermaid`),n=eT(s,`download`),r=eT(s,`copy`),a=eT(s,`fullscreen`),c=eT(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(_w,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(jw,{chart:v,config:o?.config}):null,r?(0,M.jsx)(pw,{code:v}):null,a?(0,M.jsx)(Mw,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(Kw,{chart:v,config:o?.config,showControls:c})})]})})}let y=Zw(s,`code`),b=$w(s,`download`),x=$w(s,`copy`),{"data-block":S,...C}=r;return(0,M.jsx)(iw,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...C,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(gw,{code:v,language:d}):null,x?(0,M.jsx)(pw,{}):null]}):null})},(e,t)=>Yw(e,t)&&Xw(e.node,t.node));wT.displayName=`MarkdownCode`;var TT=(0,N.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,N.useContext)(PE),i=Zw(r,`image`),a=i&&tT(r,`download`);return(0,M.jsx)(yw,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>Yw(e,t));TT.displayName=`MarkdownImg`;var ET=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>Yw(e,t));ET.displayName=`MarkdownParagraph`;var DT={ol:nT,li:rT,ul:iT,hr:aT,strong:oT,a:sT,h1:cT,h2:lT,h3:uT,h4:dT,h5:fT,h6:pT,table:mT,thead:hT,tbody:gT,tr:_T,th:vT,td:yT,blockquote:bT,code:wT,img:TT,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:xT,sub:ST,p:ET,section:CT},OT=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,kT=/\p{L}/u;function AT(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(OT.test(e)){n??=`rtl`,i+=1;continue}kT.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var jT=/^[ \t]{0,3}(`{3,}|~{3,})/,MT=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,NT=e=>{let t=e.split(`
|
|
122
|
+
`),n=null,r=0;for(let e of t){let t=jT.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},PT=e=>{let t=e.split(`
|
|
123
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&MT.test(t))return!0}return!1},FT=()=>e=>{Hi(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},IT=[],LT={allowDangerousHtml:!0},RT=new WeakMap,zT=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=RT.get(e);n||(n=e.name,RT.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=RT.get(r);e||(e=r.name,RT.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},BT=e=>{let t=VT(e),n=e.children||``;return JT(t.runSync(t.parse(n),n),e)},VT=e=>{let t=zT.get(e);if(t)return t;let n=UT(e);return zT.set(e,n),n},HT=e=>e.some(e=>Array.isArray(e)?e[0]===xd:e===xd),UT=e=>{let t=e.rehypePlugins||IT,n=e.remarkPlugins||IT,r=HT(t)?n:[...n,FT],i=e.remarkRehypeOptions?{...LT,...e.remarkRehypeOptions}:LT;return Tx().use(ob).use(r).use(Zb,i).use(t)},WT=e=>e,GT=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},KT=(e,t)=>{for(let n in xy)if(Object.hasOwn(xy,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=xy[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},qT=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},JT=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||WT;Hi(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return GT(c,s,a,e.value),s;if(e.type===`element`&&(KT(e,t),qT(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return $v(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0})},YT=/\[\^[\w-]{1,200}\](?!:)/,XT=/\[\^[\w-]{1,200}\]:/,ZT=/<([A-Za-z][\w:-]*)[\s>/]/,QT=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),$T=new Map,eE=new Map,tE=e=>{let t=e.toLowerCase(),n=$T.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return $T.set(t,r),r},nE=e=>{let t=e.toLowerCase(),n=eE.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return eE.set(t,r),r},rE=(e,t)=>{if(QT.has(t.toLowerCase()))return 0;let n=e.match(tE(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},iE=(e,t)=>{let n=e.match(nE(t));return n?n.length:0},aE=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},oE=e=>{let t=YT.test(e),n=XT.test(e);if(t||n)return[e];let r=eC.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=rE(t,e),o=iE(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(ZT);if(e){let n=e[1];rE(t,n)>iE(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(aE(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},sE=/^\n*/,cE=/\n*$/,lE=/\n\n/g,uE=(e,t,n)=>t.includes(`
|
|
124
|
+
`)?`${e}${t.replace(lE,`
|
|
125
|
+
<!---->
|
|
126
|
+
`).replace(sE,`
|
|
127
|
+
|
|
128
|
+
`).replace(cE,`
|
|
129
|
+
|
|
130
|
+
`)}${n}
|
|
131
|
+
|
|
132
|
+
`:e+t+n,dE=(e,t)=>{let n=RegExp(`<(${t})(?=[\\s>/])([^>]*)>`,`gi`),r=``,i=0,a=n.exec(e);for(;a;){let t=a[0],o=a[1],s=a.index+t.length,c=e.slice(s);if(RegExp(`</${o}\\s*>`,`i`).test(c)){a=n.exec(e);continue}if(r+=e.slice(i,a.index),c.length===0){r+=t,i=s,a=n.exec(e);continue}if(c.startsWith(`
|
|
133
|
+
|
|
134
|
+
`)){let n=c.slice(2).replace(lE,`
|
|
135
|
+
<!---->
|
|
136
|
+
`);r+=`${t}
|
|
137
|
+
|
|
138
|
+
${n}`,i=e.length;break}if(!c.startsWith(`
|
|
139
|
+
`)){r+=t,i=s,a=n.exec(e);continue}let l=c.slice(1);if(l.trim().length===0){r+=t,i=s,a=n.exec(e);continue}let u=l.replace(lE,`
|
|
140
|
+
<!---->
|
|
141
|
+
`);r+=`${t}
|
|
142
|
+
|
|
143
|
+
${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},fE=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>uE(t,n,r)),n=dE(n,e)}return n},pE=/([\\`*_~[\]|])/g,mE=e=>e.replace(pE,`\\$1`),hE=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+mE(n).replace(/\n\n/g,` `)+r)}return n},gE=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),_E=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function vE(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!_E.has(e.tagName)?vE(e):``).join(``)}function yE(){return e=>{Hi(e,`element`,e=>{if(_E.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}gE.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=AT(vE(e))))})}}var bE=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(bE).join(``):``,xE=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));Hi(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=bE(e);e.children=t?[{type:`text`,value:t}]:[]}})},SE=()=>e=>{Hi(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},CE=/^[ \t]*<[\w!/?-]/,wE=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,TE=e=>typeof e!=`string`||e.length===0||!CE.test(e)?e:e.replace(wE,`$1`),EE={...Cd,clobberPrefix:``,protocols:{...Cd.protocols,href:[...Cd.protocols?.href??[],`tel`,`streamdown`]},attributes:{...Cd.attributes,code:[...Cd.attributes?.code??[],`metastring`]}},DE={raw:xd,sanitize:[Bd,EE],harden:[$i,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},OE={gfm:[Vg,{}],codeMeta:SE},kE=Object.values(DE),AE=Object.values(OE),jE={block:` ▋`,circle:` ●`},ME=[`github-light`,`github-dark`],NE={enabled:!0},PE=(0,N.createContext)({codeBlockMaxHeight:400,shikiTheme:ME,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:NE,tableMaxHeight:300}),FE=(0,N.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{(0,N.useLayoutEffect)(()=>{o?.commit()});let c=typeof e==`string`&&n?TE(e):e,l=(0,M.jsx)(BT,{...s,children:c});return(0,M.jsx)(RC.Provider,{value:i,children:a?(0,M.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins&&!!e.animatePlugin==!!t.animatePlugin});FE.displayName=`Block`;var IE=(0,N.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=kE,remarkPlugins:s=AE,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=FE,parseMarkdownIntoBlocksFn:_=oE,caret:v,plugins:y,remend:b,linkSafety:x=NE,lineNumbers:S=!0,allowedTags:C,literalTagContent:w,translations:T,icons:E,prefix:ee,onAnimationStart:D,onAnimationEnd:te,...O})=>{let ne=(0,N.useId)(),k=(0,N.useMemo)(()=>HC(ee),[ee]),re=(0,N.useRef)(null),ie=(0,N.useRef)(D),ae=(0,N.useRef)(te);ie.current=D,ae.current=te,(0,N.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=re.current;if(re.current=p,i===null){p&&((e=ie.current)==null||e.call(ie));return}p&&!i?(n=ie.current)==null||n.call(ie):!p&&i&&((r=ae.current)==null||r.call(ae))},[p,t]);let oe=(0,N.useMemo)(()=>C?Object.keys(C):[],[C]),se=(0,N.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?kv(e,b):e;return w&&w.length>0&&(n=hE(n,w)),oe.length>0&&(n=fE(n,oe)),n},[e,t,r,b,oe,w]),A=(0,N.useMemo)(()=>_(se),[se,_]),ce=(0,N.useMemo)(()=>n===`auto`?A.map(AT):void 0,[A,n]),j=(0,N.useMemo)(()=>A.map((e,t)=>`${ne}-${t}`),[A.length,ne]),le=(0,N.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),ue=(0,N.useRef)(null),de=(0,N.useRef)([]),fe=(0,N.useRef)([]),pe=(0,N.useRef)(null),me=(0,N.useRef)(``);le?(me.current===le?ue.current||=mC():(me.current=le,ue.current=mC({maxBacklogMs:le===`true`?void 0:h.maxBacklogMs}),de.current=[],fe.current=[]),p&&ue.current&&ue.current.beginPass(ue.current.now())):(ue.current=null,de.current=[],fe.current=[],me.current=``),(0,N.useLayoutEffect)(()=>{var e;p&&((e=ue.current)==null||e.commitPass())});let he=(0,N.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(y?.code)?.getThemes()??ME,controls:f,isAnimating:p,lineNumbers:S,mode:t,mermaid:u,linkSafety:x,tableMaxHeight:m}),[d,l,f,p,S,t,u,x,y?.code,m]),ge=(0,N.useMemo)(()=>T?JSON.stringify(T):``,[T]),_e=(0,N.useMemo)(()=>({...uw,...T}),[ge]),ve=(0,N.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...DT,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,N.createElement)(t,n):null:(0,N.createElement)(e,n)}return n},[a]),ye=(0,N.useMemo)(()=>{let e=[];return y!=null&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsBefore]),e=[...e,...s],y!=null&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(e=[...e,y.math.remarkPlugin]),e},[s,y?.math,y?.cjk]),be=(0,N.useMemo)(()=>{let e=o;if(C&&Object.keys(C).length>0&&o===kE){let t={...EE,tagNames:[...EE.tagNames??[],...Object.keys(C)],attributes:{...EE.attributes,...C}};e=[DE.raw,[Bd,t],DE.harden]}return w&&w.length>0&&(e=[...e,[xE,w]]),y!=null&&y.math&&(e=[...e,y.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,yE]),e},[o,y?.math,C,w,n,t]),xe=(0,N.useMemo)(()=>{if(!p||A.length===0)return!1;let e=A.at(-1);return NT(e)||PT(e)},[p,A]),Se=(0,N.useMemo)(()=>v&&p&&!xe?{"--streamdown-caret":`"${jE[v]}"`}:void 0,[v,p,xe]),Ce=e=>{let t=null;if(ue.current&&p){if(!de.current[e]){let{maxBacklogMs:t,...n}=le&&le!==`true`?h:{};de.current[e]=LC({...n,timeline:ue.current})}t=de.current[e]}pe.current!==be&&(fe.current=[],pe.current=be),t&&!fe.current[e]&&(fe.current[e]=[...be,t.rehypePlugin]);let n=t&&fe.current[e]?fe.current[e]:be;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,M.jsx)(dw.Provider,{value:_e,children:(0,M.jsx)(ww.Provider,{value:y??null,children:(0,M.jsx)(PE.Provider,{value:he,children:(0,M.jsx)(cw,{icons:E,children:(0,M.jsx)(WC.Provider,{value:k,children:(0,M.jsx)(`div`,{className:k(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?void 0:n,children:(0,M.jsx)(BT,{components:ve,rehypePlugins:be,remarkPlugins:ye,...O,children:se})})})})})})}):(0,M.jsx)(dw.Provider,{value:_e,children:(0,M.jsx)(ww.Provider,{value:y??null,children:(0,M.jsx)(PE.Provider,{value:he,children:(0,M.jsx)(cw,{icons:E,children:(0,M.jsx)(WC.Provider,{value:k,children:(0,M.jsxs)(`div`,{className:k(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,v&&!xe?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:Se,children:[A.length===0&&v&&p&&(0,M.jsx)(`span`,{}),A.map((e,t)=>{let a=t===A.length-1,o=p&&a&&NT(e),{blockAnimatePlugin:s,blockRehypePlugins:c}=Ce(t);return(0,M.jsx)(g,{animatePlugin:s,components:ve,content:e,dir:ce?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:c,remarkPlugins:ye,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...O},j[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);IE.displayName=`Streamdown`;var LE=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=lw(),d=X(),f=fw(),p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)(o),[_,v]=(0,N.useState)({x:0,y:0}),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)({x:0,y:0}),[C,w]=(0,N.useState)({x:0,y:0}),T=(0,N.useCallback)(e=>{g(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),E=(0,N.useCallback)(()=>{T(i)},[T,i]),ee=(0,N.useCallback)(()=>{T(-i)},[T,i]),D=(0,N.useCallback)(()=>{g(o),v({x:0,y:0})},[o]),te=(0,N.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-i:i;T(t)},[T,i]),O=(0,N.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;b(!0),S({x:e.clientX,y:e.clientY}),w(_);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[_]),ne=(0,N.useCallback)(e=>{if(!y)return;e.preventDefault();let t=e.clientX-x.x,n=e.clientY-x.y;v({x:C.x+t,y:C.y+n})},[y,x,C]),k=(0,N.useCallback)(e=>{b(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,N.useEffect)(()=>{let e=p.current;if(e)return e.addEventListener(`wheel`,te,{passive:!1}),()=>{e.removeEventListener(`wheel`,te)}},[te]),(0,N.useEffect)(()=>{let e=m.current;if(e&&y)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,ne,{passive:!1}),e.addEventListener(`pointerup`,k),e.addEventListener(`pointercancel`,k),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,ne),e.removeEventListener(`pointerup`,k),e.removeEventListener(`pointercancel`,k)}},[y,ne,k]),(0,M.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:p,style:{cursor:y?`grabbing`:`grab`},children:[a?(0,M.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,M.jsx)(`button`,{"aria-label":f.zoomIn,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h>=r,onClick:E,title:f.zoomIn,type:`button`,children:(0,M.jsx)(l,{"aria-hidden":`true`,size:16})}),(0,M.jsx)(`button`,{"aria-label":f.zoomOut,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h<=n,onClick:ee,title:f.zoomOut,type:`button`,children:(0,M.jsx)(u,{"aria-hidden":`true`,size:16})}),(0,M.jsx)(`button`,{"aria-label":f.resetView,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:D,title:f.resetView,type:`button`,children:(0,M.jsx)(c,{"aria-hidden":`true`,size:16})})]}):null,(0,M.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:O,ref:m,role:`application`,style:{transform:`translate(${_.x}px, ${_.y}px) scale(${h})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},RE=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=X(),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(``),[f,p]=(0,N.useState)(``),[m,h]=(0,N.useState)(0),{mermaid:g}=(0,N.useContext)(PE),_=Dw(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=uC({immediate:r});if((0,N.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){if(!(f||u)){let t=e instanceof Error?e.message:`Failed to render Mermaid chart`;s(t)}}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,M.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,M.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,M.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,M.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,M.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,M.jsx)(`div`,{ref:b,children:(0,M.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,M.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,M.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,M.jsxs)(`details`,{className:a(`mt-2`),children:[(0,M.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,M.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,M.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,M.jsx)(LE,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,M.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})},zE=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function BE(e){return VE(e)}function VE(e){return Array.isArray(e)?HE(e):e instanceof RegExp?e:typeof e==`object`?UE(e):e}function HE(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=VE(e[n]);return t}function UE(e){let t={};for(let n in e)t[n]=VE(e[n]);return t}function WE(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function GE(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?GE(e.substring(0,e.length-1)):e.substr(~t+1)}var KE=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,qE=class{static hasCaptures(e){return e!==null&&(KE.lastIndex=0,KE.test(e))}static replaceCaptures(e,t,n){return e.replace(KE,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function JE(e,t){return e<t?-1:+(e>t)}function YE(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=JE(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function XE(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ZE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var QE=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},$E=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(iD(e),t)}static createFromParsedTheme(e,t){return sD(e,t)}_cachedMatchRoot=new QE(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>tD(e.parent,t.parentScopes));return n?new rD(n.fontStyle,n.foreground,n.background):null}},eD=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function tD(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!nD(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function nD(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var rD=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function iD(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&XE(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&XE(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new aD(l,u,e,o,s,c)}}return n}var aD=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},oD=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(oD||{});function sD(e,t){e.sort((e,t)=>{let n=JE(e.scope,t.scope);return n!==0||(n=YE(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new cD(t),o=new rD(n,a.getId(r),a.getId(i)),s=new dD(new uD(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new $E(a,o,s)}var cD=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},lD=Object.freeze([]),uD=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||lD,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},dD=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),uD.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(YE(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new uD(e,t,n,r,i))}},fD=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=mD(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function pD(e){return e}function mD(e){return e}function hD(e,t){let n=[],r=_D(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(gD(i)){let e=[];do e.push(i),i=r.next();while(gD(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function gD(e){return!!e&&!!e.match(/[\w\.:]+/)}function _D(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function vD(e){typeof e.dispose==`function`&&e.dispose()}var yD=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},bD=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xD=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},SD=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new yD(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xD;for(let n of e)CD(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof yD){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function CD(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof yD?TD({baseGrammar:a,selfGrammar:i},r):wD(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new yD(e))}function wD(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];ED([r],t,n)}}function TD(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ED(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ED(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ED(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?WE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ED(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=MD(i);switch(a.kind){case 0:TD({...t,selfGrammar:t.baseGrammar},n);break;case 1:TD(t,n);break;case 2:wD(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?wD(a.ruleName,i,n):TD(i,n)}else a.kind===4?n.add(new bD(a.scopeName,a.ruleName)):n.add(new yD(a.scopeName))}}}var DD=class{kind=0},OD=class{kind=1},kD=class{constructor(e){this.ruleName=e}kind=2},AD=class{constructor(e){this.scopeName=e}kind=3},jD=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function MD(e){if(e===`$base`)return new DD;if(e===`$self`)return new OD;let t=e.indexOf(`#`);return t===-1?new AD(e):t===0?new kD(e.substring(1)):new jD(e.substring(0,t),e.substring(t+1))}var ND=/\\(\d+)/,PD=/\\(\d+)/g,FD=-1,ID=-2;function LD(e){return e}function RD(e){return e}var zD=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=qE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=qE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${GE(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:qE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:qE.replaceCaptures(this._contentName,e,t)}},BD=class extends zD{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},VD=class extends zD{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new KD(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new qD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},HD=class extends zD{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new qD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},UD=class extends zD{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new KD(i,this.id),this.beginCaptures=a,this._end=new KD(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new qD;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},WD=class extends zD{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new KD(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new KD(o,ID),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new qD;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new qD,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},GD=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new BD(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new VD(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=WE({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new HD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new WD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new UD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=MD(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof HD||e instanceof UD||e instanceof WD)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},KD=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&ND.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return PD.lastIndex=0,this.source.replace(PD,(e,t)=>ZE(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},qD=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new JD(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new JD(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},JD=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
144
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},YD=class{constructor(e,t){this.languageId=e,this.tokenType=t}},XD=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new YD(e,8),this._embeddedLanguagesMatcher=new ZD(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new YD(0,0);_getBasicScopeAttributes=new QE(e=>new YD(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},ZD=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ZE(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var QD=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function $D(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=eO(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new QD(i,!0);f()}return new QD(i,!1);function f(){let o=tO(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===FD){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),oO(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof UD){let r=o;oO(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof WD){let r=o;oO(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(oO(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function eO(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof WD&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=aO(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ID){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),oO(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function tO(e,t,n,r,i,a){let o=nO(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=rO(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function nO(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=iO(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function rO(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=iO(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function iO(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function aO(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function oO(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));$D(e,p,n&&d.start===0,d.start,f,i,!1,0),vD(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new sO(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var sO=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function cO(e,t,n,r,i,a,o,s){return new fO(e,t,n,r,i,a,o,s)}function lO(e,t,n,r,i){let a=hD(t,uO),o=GD.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function uO(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(dO(t[r],e))return n=r+1,!0;return!1})}function dO(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var fO=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new XD(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=pO(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=hD(e,uO);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)lO(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&lO(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(LD(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[RD(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=pO(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=GD.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===hO.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=fD.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?mO.createRootAndLookUpScopeName(a,r,this):mO.createRoot(`unknown`,r),t=new hO(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
145
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new _O(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=$D(this,a,i,0,t,s,!0,r);return vD(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function pO(e,t){return e=BE(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var mO=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=eD.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new eD(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new eD(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),fD.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},hO=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?mO.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:RD(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=mO.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,LD(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,mO.fromExtension(r,n.contentNameScopesList))}},gO=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):hD(e,uO).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>hD(e,uO).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},_O=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=fD.set(n,0,pD(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=fD.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},vO=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,cO(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},yO=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new vO($E.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme($E.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new gO(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new SD(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},bO=hO.NULL;function xO(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function SO(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function CO(e){return Array.isArray(e)?e:[e]}async function wO(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function TO(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function EO(e){return e===`ansi`||TO(e)}function DO(e){return e===`none`}function OO(e){return DO(e)}var kO=/(\r?\n)/g;function AO(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(kO),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var jO={light:`#333333`,dark:`#bbbbbb`},MO={light:`#fffffe`,dark:`#1e1e1e`},NO=`__shiki_resolved`;function PO(e){if(e?.[NO])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?jO.light:jO.dark,n||=t.type===`light`?MO.light:MO.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,NO,{enumerable:!1,writable:!1,value:!0}),t}async function FO(e){return[...new Set((await Promise.all(e.filter(e=>!EO(e)).map(async e=>await wO(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function IO(e){return(await Promise.all(e.map(async e=>OO(e)?null:PO(await wO(e))))).filter(e=>!!e)}function LO(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new zE(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var RO=class extends yO{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=PO(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=$E.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=LO(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new zE(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},zO=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},BO=0;function VO(e){BO+=1,e.warnings!==!1&&BO>=10&&BO%10==0&&console.warn(`[Shiki] ${BO} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new zE("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(PO),i=new RO(new zO(e.engine,n),r,n,e.langAlias),a;function o(t){return LO(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new zE(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new zE(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await FO(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await IO(e))}function g(){if(t)throw new zE(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--BO)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function HO(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([IO(e.themes||[]),FO(e.langs||[]),e.engine]);return VO({...e,themes:t,langs:n,engine:r})}var UO=new WeakMap;function WO(e,t){UO.set(e,t)}function GO(e){return UO.get(e)}var KO=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(CO(n).map(e=>[e,bO])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return qO(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function qO(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function JO(e,t){if(!(e instanceof KO))throw new zE(`Invalid grammar state`);return e.getInternalStack(t)}var YO=/,/,XO=/ /;function ZO(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(TO(e.resolveLangAlias(n.lang||`text`))||DO(r))return AO(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new zE(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new zE(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return $O(t,o,i,a,n)}function QO(...e){if(e.length===2)return GO(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(TO(i)||DO(a))throw new zE(`Plain language does not have grammar state`);if(i===`ansi`)throw new zE(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new KO(ek(n,c,o,s,r).stateStack,c.name,o.name)}function $O(e,t,n,r,i){let a=ek(e,t,n,r,i),o=new KO(a.stateStack,t.name,n.name);return WO(a.tokens,o),a.tokens}function ek(e,t,n,r,i){let a=xO(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=AO(e),u=i.grammarState?JO(i.grammarState,n.name)??bO:i.grammarContextCode==null?bO:ek(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=SO(r[fD.getForeground(s)],a),u=fD.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=fD.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(YO).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(XO))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?tk(t.scopes):nk(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function tk(e){return e.map(e=>({scopeName:e}))}function nk(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:ak(e,i,t.slice(0,r))}}return n}function rk(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ik(e,t,n){if(!rk(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)rk(e[r],n[i])&&--r,--i;return r===-1}function ak(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ik(e,t,n)){r.push(a);break}return r}function ok(e,t,n,r=ZO){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:GO(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=sk(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new KO(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&WO(s,c),s}function sk(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var ck=/["&'<>`]/g,lk=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,uk=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,dk=/[|\\{}()[\]^$+*?.]/g,fk=new WeakMap;function pk(e,t){if(e=e.replace(t.subset?mk(t.subset):ck,r),t.subset||t.escapeOnly)return e;return e.replace(lk,n).replace(uk,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function mk(e){let t=fk.get(e);return t||(t=hk(e),fk.set(e,t)),t}function hk(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(dk,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var gk=/[\dA-Fa-f]/;function _k(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!gk.test(String.fromCharCode(t))?r:r+`;`}var vk=/\d/;function yk(e,t,n){let r=`&#`+String(e);return n&&t&&!vk.test(String.fromCharCode(t))?r:r+`;`}var bk=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),xk={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Sk=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ck={}.hasOwnProperty,wk={},Tk;for(Tk in xk)Ck.call(xk,Tk)&&(wk[xk[Tk]]=Tk);var Ek=/[^\dA-Za-z]/;function Dk(e,t,n,r){let i=String.fromCharCode(e);if(Ck.call(wk,i)){let e=wk[i],a=`&`+e;return n&&bk.includes(e)&&!Sk.includes(e)&&(!r||t&&t!==61&&Ek.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ok(e,t,n){let r=_k(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Dk(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=yk(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function kk(e,t){return pk(e,Object.assign({format:Ok},t))}var Ak=/^>|^->|<!--|-->|--!>|<!-$/g,jk=[`>`],Mk=[`<`,`>`];function Nk(e,t,n,r){return r.settings.bogusComments?`<?`+kk(e.value,Object.assign({},r.settings.characterReferences,{subset:jk}))+`>`:`<!--`+e.value.replace(Ak,i)+`-->`;function i(e){return kk(e,Object.assign({},r.settings.characterReferences,{subset:Mk}))}}function Pk(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var Fk=Rk(1),Ik=Rk(-1),Lk=[];function Rk(e){return t;function t(t,n,r){let i=t?t.children:Lk,a=(n||0)+e,o=i[a];if(!r)for(;o&&Fv(o);)a+=e,o=i[a];return o}}var zk={}.hasOwnProperty;function Bk(e){return t;function t(t,n,r){return zk.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Vk=Bk({body:Wk,caption:Hk,colgroup:Hk,dd:Jk,dt:qk,head:Hk,html:Uk,li:Kk,optgroup:Xk,option:Zk,p:Gk,rp:Yk,rt:Yk,tbody:$k,td:nA,tfoot:eA,th:nA,thead:Qk,tr:tA});function Hk(e,t,n){let r=Fk(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Fv(r.value.charAt(0)))}function Uk(e,t,n){let r=Fk(n,t);return!r||r.type!==`comment`}function Wk(e,t,n){let r=Fk(n,t);return!r||r.type!==`comment`}function Gk(e,t,n){let r=Fk(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Kk(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&r.tagName===`li`}function qk(e,t,n){let r=Fk(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Jk(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Yk(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Xk(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Zk(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Qk(e,t,n){let r=Fk(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function $k(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function eA(e,t,n){return!Fk(n,t)}function tA(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function nA(e,t,n){let r=Fk(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var rA=Bk({body:oA,colgroup:sA,head:aA,html:iA,tbody:cA});function iA(e){let t=Fk(e,-1);return!t||t.type!==`comment`}function aA(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function oA(e){let t=Fk(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Fv(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function sA(e,t,n){let r=Ik(n,t),i=Fk(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Vk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function cA(e,t,n){let r=Ik(n,t),i=Fk(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Vk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var lA={name:[[`
|
|
146
|
+
\f\r &/=>`.split(``),`
|
|
147
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
148
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
149
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
150
|
+
\f\r &>`.split(``),`\0
|
|
151
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
152
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
153
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function uA(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=eo);let l=dA(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!rA(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Vk(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function dA(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=fA(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function fA(e,t,n){let r=Xa(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=kk(r.attribute,Object.assign({},e.settings.characterReferences,{subset:lA.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?no:oo)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=kk(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:lA.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Vd(n,o)>Vd(n,e.alternative)&&(o=e.alternative),s=o+kk(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?lA.single:lA.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var pA=[`<`,`&`];function mA(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:kk(e.value,Object.assign({},r.settings.characterReferences,{subset:pA}))}function hA(e,t,n,r){return r.settings.allowDangerousHtml?e.value:mA(e,t,n,r)}function gA(e,t,n,r){return r.all(e)}var _A=Mo(`type`,{invalid:vA,unknown:yA,handlers:{comment:Nk,doctype:Pk,element:uA,raw:hA,root:gA,text:mA}});function vA(e){throw Error("Expected node, not `"+e+"`")}function yA(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var bA={},xA={},SA=[];function CA(e,t){let n=t||bA,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:wA,all:TA,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ko,characterReferences:n.characterReferences||xA,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?eo:$a,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function wA(e,t,n){return _A(e,t,n,this)}function TA(e){let t=[],n=e&&e.children||SA,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var EA=/\s+/g;function DA(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(EA)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(EA);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function OA(e){let t=AO(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var kA=[`color`,`background-color`];function AA(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function jA(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function MA(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=jA(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return AA(e,a)})):e}function NA(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>PA(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&kA.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new zE('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function PA(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&oD.Italic&&(t[`font-style`]=`italic`),e.fontStyle&oD.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&oD.Underline&&n.push(`underline`),e.fontStyle&oD.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function FA(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function IA(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=OA(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new zE(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new zE(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new zE(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));LA(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return MA(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new zE(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=RA(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new zE(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new zE(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&DA(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function LA(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new zE(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new zE(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function RA(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(RA).join(``):``}var zA=[IA()];function BA(e){let t=VA(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...zA]}function VA(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var HA=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],UA={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function WA(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function GA(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function KA(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)UA[r]&&t.push({type:`setDecoration`,value:UA[r]});else if(r<=29){let e=UA[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:HA[r-30]}});else if(r===38){let n=GA(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:HA[r-40]}});else if(r===48){let n=GA(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:HA[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:HA[r-100+8]}})}}return t}function qA(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=WA(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=KA(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var JA={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function YA(e=JA){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<HA.length;e++)r.push(t(HA[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var XA=/#([0-9a-f]{3,8})/i,ZA=/var\((--[\w-]+-ansi-[\w-]+)\)/,QA={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function $A(e,t,n){let r=xO(e,n),i=AO(t),a=YA(Object.fromEntries(HA.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||QA[t]]}))),o=qA();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=SO(i,r),o=SO(o,r),n.decorations.has(`dim`)&&(i=ej(i));let s=oD.None;return n.decorations.has(`bold`)&&(s|=oD.Bold),n.decorations.has(`italic`)&&(s|=oD.Italic),n.decorations.has(`underline`)&&(s|=oD.Underline),n.decorations.has(`strikethrough`)&&(s|=oD.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function ej(e){let t=e.match(XA);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(ZA);return n?`var(${n[1]}-dim)`:e}function tj(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!TO(r)&&!DO(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return $A(r,t,n)}return ZO(e,t,n)}function nj(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new zE("`themes` option must not be empty");let p=ok(e,t,n,tj);if(c=GO(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new zE(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>NA(e,h,u,l,d))),c&&WO(a,c);let g=f.map(e=>xO(e.theme,n));i=rj(f,m,g,u,l,`fg`,d),r=rj(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=xO(n.theme,n);a=tj(e,t,n);let l=e.getTheme(n.theme);r=SO(l.bg,s),i=SO(l.fg,s),o=l.name,c=GO(a)}else throw new zE("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function rj(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=SO(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new zE('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${SO(t[r][a],n[r])||`inherit`}, ${SO(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var ij=/^\s+$/,aj=/^(\s*)(.*?)(\s*)$/;function oj(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>oj(e,t,n),codeToTokens:(t,n)=>nj(e,t,n)}){let i=t;for(let e of BA(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=nj(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=cj(a):d===`never`&&(a=lj(a)),f&&(a=uj(a));let p={...r,get source(){return i}};for(let e of BA(n))a=e.tokens?.call(p,a)||a;return sj(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function sj(e,t,n,r=GO(e)){let i=BA(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:DA,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
154
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=FA(a.htmlStyle||PA(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&WO(m,r),m}function cj(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&oD.Underline||i.fontStyle&oD.Strikethrough));o&&ij.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function lj(e){return e.map(e=>e.flatMap(e=>{if(ij.test(e.content))return e;let t=e.content.match(aj);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function uj(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=FA(e.htmlStyle||PA(e)),i=FA(n.htmlStyle||PA(n)),a=e.fontStyle&&(e.fontStyle&oD.Underline||e.fontStyle&oD.Strikethrough),o=n.fontStyle&&(n.fontStyle&oD.Underline||n.fontStyle&oD.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var dj=CA;function fj(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>oj(e,t,n),codeToTokens:(t,n)=>nj(e,t,n)},i=dj(oj(e,t,n,r));for(let e of BA(n))i=e.postprocess?.call(r,i,n)||i;return i}async function pj(e){let t=await HO(e);return{getLastGrammarState:(...e)=>QO(t,...e),codeToTokensBase:(e,n)=>tj(t,e,n),codeToTokensWithThemes:(e,n)=>ok(t,e,n),codeToTokens:(e,n)=>nj(t,e,n),codeToHast:(e,n)=>oj(t,e,n),codeToHtml:(e,n)=>fj(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var mj=4294967295,hj=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:mj,end:mj,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function gj(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function _j(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var vj=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),yj=String.raw;function bj(e,t){if(e==null)throw Error(t??`Value expected`);return e}var xj=yj`\[\^?`,Sj=`c.? | C(?:-.?)?|${yj`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${yj`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${yj`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${yj`o\{[^\}]*\}?`}|${yj`\d{1,3}`}`,Cj=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,wj=new RegExp(yj`
|
|
155
|
+
\\ (?:
|
|
156
|
+
${Sj}
|
|
157
|
+
| [gk]<[^>]*>?
|
|
158
|
+
| [gk]'[^']*'?
|
|
159
|
+
| .
|
|
160
|
+
)
|
|
161
|
+
| \( (?:
|
|
162
|
+
\? (?:
|
|
163
|
+
[:=!>({]
|
|
164
|
+
| <[=!]
|
|
165
|
+
| <[^>]*>
|
|
166
|
+
| '[^']*'
|
|
167
|
+
| ~\|?
|
|
168
|
+
| #(?:[^)\\]|\\.?)*
|
|
169
|
+
| [^:)]*[:)]
|
|
170
|
+
)?
|
|
171
|
+
| \*[^\)]*\)?
|
|
172
|
+
)?
|
|
173
|
+
| (?:${Cj.source})+
|
|
174
|
+
| ${xj}
|
|
175
|
+
| .
|
|
176
|
+
`.replace(/\s+/g,``),`gsu`),Tj=new RegExp(yj`
|
|
177
|
+
\\ (?:
|
|
178
|
+
${Sj}
|
|
179
|
+
| .
|
|
180
|
+
)
|
|
181
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
182
|
+
| ${xj}
|
|
183
|
+
| &&
|
|
184
|
+
| .
|
|
185
|
+
`.replace(/\s+/g,``),`gsu`);function Ej(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=nM(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(wj.lastIndex=0;s=wj.exec(e);){let t=Dj(a,e,s[0],wj.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(wj.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?iM(e,u):e).flat(),flags:r}}function Dj(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Oj(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Mj(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Kj(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Nj(n)}}if(a===`K`)return{token:Bj(`keep`,n)};if(a===`N`||a===`R`)return{token:zj(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:zj(`any`,n)};if(a===`X`)return{token:zj(`text_segment`,n)};let e=Aj(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Zj(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Xj(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Uj(`group`,n)};if(n===`(?>`)return{token:Uj(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Uj(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Uj(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Uj(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Hj(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
186
|
+
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:zj(`dot`,n)}:n===`^`||n===`$`?{token:Mj(e.singleline?{"^":yj`\A`,$:yj`\Z`}[n]:n,n)}:n===`|`?{token:jj(n)}:Cj.test(n)?{tokens:aM(n)}:{token:Pj(gj(n),n)}}function Oj(e,t,n){let r=[Rj(t[1]===`^`,t)],i=1,a;for(Tj.lastIndex=n;a=Tj.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Rj(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Pj(93,e));else if(i--,r.push(Fj(e)),!i)break}else{let t=kj(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Tj.lastIndex||e.length}}function kj(e){if(e[0]===`\\`)return Aj(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!vj.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return zj(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Ij(e):e===`&&`?Lj(e):Pj(gj(e),e)}function Aj(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Yj(e);if(`dDhHsSwW`.includes(n))return $j(e);if(e.startsWith(yj`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return eM(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Pj(gj(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Pj(rM(e),e);if(Jj.has(n))return Pj(Jj.get(n),e);if(/\d/.test(n))return Vj(t,e);if(e===`\\`)throw Error(yj`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Pj(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function jj(e){return{type:`Alternator`,raw:e}}function Mj(e,t){return{type:`Assertion`,kind:e,raw:t}}function Nj(e){return{type:`Backreference`,raw:e}}function Pj(e,t){return{type:`Character`,value:e,raw:t}}function Fj(e){return{type:`CharacterClassClose`,raw:e}}function Ij(e){return{type:`CharacterClassHyphen`,raw:e}}function Lj(e){return{type:`CharacterClassIntersector`,raw:e}}function Rj(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function zj(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Bj(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:bj(n.flags),raw:t}}function Vj(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Hj(e){return{type:`GroupClose`,raw:e}}function Uj(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Wj(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Gj(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Kj(e){return{type:`Subroutine`,raw:e}}var qj=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Jj=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Yj(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Pj(gj(t.toUpperCase())-64,e)}function Xj(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=tM(n),o=tM(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Bj(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Uj(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Zj(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=qj.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Wj(l,r??null,i?.split(`,`)??null,e)}function Qj(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Gj(t,n,r,e)}function $j(e){let t=e[1].toLowerCase();return zj({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function eM(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return zj(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function tM(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function nM(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function rM(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function iM(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Nj(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(yj`Octal encoded byte above 177 unsupported "${n}"`)}else r=gj(t);a.push(Pj(r,(e===0?`\\`:``)+t))}return a}function aM(e){let t=[],n=new RegExp(Cj,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Qj(e.slice(0,-1)));continue}}}t.push(Qj(e))}return t}function oM(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function sM(e){return cM.has(e.type)}var cM=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function lM(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Ej(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return yM();case`Assertion`:return uM(n);case`Backreference`:return dM(n,a);case`Character`:return CM(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return fM(n,a,t);case`CharacterClassOpen`:return pM(n,a,t);case`CharacterSet`:return mM(n,a);case`Directive`:return DM(n.kind,{flags:n.flags});case`GroupOpen`:return hM(n,a,t);case`NamedCallout`:return jM(n.kind,n.tag,n.arguments);case`Quantifier`:return gM(n,a);case`Subroutine`:return _M(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=PM(OM(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(yj`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(yj`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function uM({kind:e}){return bM(bj({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===yj`\B`||e===yj`\Y`})}function dM({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,xM(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return xM(r)}return i(+r)}function fM(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),TM(o,e);throw Error(`Invalid character class range`)}return CM(gj(`-`))}function pM({negate:e},t,n){let{tokens:r,walk:i}=t,a=[wM()],o=r[t.nextIndex],s=GM(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(wM()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=GM(r[t.nextIndex],o)}let c=wM({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function mM({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=WM(n);if(vj.has(r)&&!o?.has(r))e=`posix`,n=r;else return IM(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?MM(n,{negate:t}):EM(e,{negate:t})}function hM(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=LM(e),l=c.type===`AbsenceFunction`,u=VM(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&_j(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=KM(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(yM()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(BM(t)||t.type===`CapturingGroup`)throw Error(e)}else if(BM(t)||VM(t)&&t.negate)throw Error(e)}}f=KM(r[t.nextIndex])}return t.nextIndex++,c}function gM({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!sM(a))throw Error(`Quantifier requires a repeatable token`);let o=NM(e,t,n,a);return i.body.pop(),o}function _M({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=FM(i);return r.push(o),o}function vM(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:RM(t?.body)}}function yM(e){return{type:`Alternative`,body:zM(e?.body)}}function bM(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function xM(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function SM(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!HM(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:RM(t?.body)}}function CM(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function wM(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:zM(e?.body)}}function TM(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function EM(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function DM(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:bj(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function OM(e){return{type:`Flags`,...e}}function kM(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:RM(e?.body)}}function AM(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:RM(e?.body)}}function jM(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function MM(e,t){let n=!!t?.negate;if(!vj.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function NM(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function PM(e,t){return{type:`Regex`,body:RM(t?.body),flags:e}}function FM(e){return{type:`Subroutine`,ref:e}}function IM(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(WM(e));if(!r){if(n.normalizeUnknownPropertyNames)r=UM(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(yj`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function LM({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return vM(`repeater`);case`atomic`:return kM({atomic:!0});case`capturing`:return SM(i,{name:n});case`group`:return kM({flags:e});case`lookahead`:case`lookbehind`:return AM({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function RM(e){if(e===void 0)e=[yM()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function zM(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function BM(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function VM(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function HM(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function UM(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function WM(e){return e.replace(/[- _]+/g,``).toLowerCase()}function GM(e,t){let n=t;return bj(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function KM(e){return bj(e,`Unclosed group`)}function qM(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){JM(c).splice(Math.max(0,YM(s)+l),1),l--,u=!0},removeAllNextSiblings(){return JM(c).splice(YM(s)+1)},removeAllPrevSiblings(){let e=YM(s)+l;return l-=e,JM(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,YM(s)+l)]=e:bj(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(JM(c).splice(Math.max(0,YM(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,YM(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function JM(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function YM(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var XM=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ZM(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function QM(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var $M=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function eN(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===$M.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?$M.CHAR_CLASS:$M.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function tN(e,t,n,r){eN(e,t,n,r)}function nN(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===$M.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function rN(e,t,n){return!!nN(e,t,0,n)}function iN(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var aN=new RegExp(String.raw`(?<noncapturingStart>${XM})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function oN(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(aN.lastIndex=Number.isNaN(c)?0:c+7;f=aN.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),ZM(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=eN(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},$M.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var sN=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,cN=new RegExp(String.raw`
|
|
187
|
+
\\(?: \d+
|
|
188
|
+
| c[A-Za-z]
|
|
189
|
+
| [gk]<[^>]+>
|
|
190
|
+
| [pPu]\{[^\}]+\}
|
|
191
|
+
| u[A-Fa-f\d]{4}
|
|
192
|
+
| x[A-Fa-f\d]{2}
|
|
193
|
+
)
|
|
194
|
+
| \((?: \? (?: [:=!>]
|
|
195
|
+
| <(?:[=!]|[^>]+>)
|
|
196
|
+
| [A-Za-z\-]+:
|
|
197
|
+
| \(DEFINE\)
|
|
198
|
+
))?
|
|
199
|
+
| (?<qBase>${sN})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
200
|
+
| \\?.
|
|
201
|
+
`.replace(/\s+/g,``),`gsu`);function lN(e){if(!RegExp(`${sN}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(cN.lastIndex=0;o=cN.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=QM(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}cN.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var uN=String.raw,dN=uN`\(\?R=(?<rDepth>[^\)]+)\)|${uN`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,fN=uN`\(\?<(?![=!])(?<captureName>[^>]+)>`,pN=uN`${fN}|(?<unnamed>\()(?!\?)`,mN=new RegExp(uN`${fN}|${dN}|\(\?|\\?.`,`gsu`),hN=`Cannot use multiple overlapping recursions`;function gN(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(dN,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&rN(e,uN`\(\?\(DEFINE\)`,$M.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=rN(e,uN`\\[1-9]`,$M.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(mN.lastIndex=0;f=mN.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(_N(m),l)throw Error(hN);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(mN.lastIndex);if(rN(s,dN,$M.DEFAULT))throw Error(hN);let c=m-1;e=vN(t,s,c,!1,n,a,d),i=xN(i,t,c,a.length,0,d);break}if(h){_N(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(hN);break}if(!u)throw Error(uN`Recursive \g cannot be used outside the referenced group "${r===`external`?h:uN`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=iN(e,p);if(o&&rN(m,uN`${fN}|\((?!\?)`,$M.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=vN(_,v,b,!0,n,a,d);i=xN(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,mN.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),mN.lastIndex),s.set(p,mN.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),mN.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function _N(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function vN(e,t,n,r,i,a,o){let s=new Set;r&&tN(e+t,fN,({groups:{captureName:e}})=>{s.add(e)},$M.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${yN(`(?:${e}`,`forward`,...c)}(?:)${yN(`${t})`,`backward`,...c)}${t}`}function yN(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=eN(e,uN`${pN}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),bN(i,n),s?e:`(?<${t}${l}>`}return uN`\k<${c}${l}>`},$M.DEFAULT)}return c}function bN(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function xN(e,t,n,r,i,a){if(e.size&&r){let o=0;tN(t,pN,()=>o++,$M.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var SN=String.fromCodePoint,Z=String.raw,CN={},wN=globalThis.RegExp;CN.flagGroups=(()=>{try{new wN(`(?i:)`)}catch{return!1}return!0})(),CN.unicodeSets=(()=>{try{new wN(`[[]]`,`v`)}catch{return!1}return!0})(),CN.bugFlagVLiteralHyphenIsRange=CN.unicodeSets?(()=>{try{new wN(Z`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,CN.bugNestedClassIgnoresNegation=CN.unicodeSets&&new wN(`[[^a]]`,`v`).test(`a`);function TN(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function EN(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function DN(e,t){return kN[e]>=kN[t]}function ON(e,t){if(e==null)throw Error(t??`Value expected`);return e}var kN={ES2025:2025,ES2024:2024,ES2018:2018},AN={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function jN(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!AN[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=CN.flagGroups?`ES2025`:CN.unicodeSets?`ES2024`:`ES2018`),t}var MN=`[ -\r ]`,NN=new Set([SN(304),SN(305)]),PN=Z`[\p{L}\p{M}\p{N}\p{Pc}]`;function FN(e){if(NN.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=zN.get(n),a=LN.get(n),o=RN.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var IN=new Map(`C Other
|
|
202
|
+
Cc Control cntrl
|
|
203
|
+
Cf Format
|
|
204
|
+
Cn Unassigned
|
|
205
|
+
Co Private_Use
|
|
206
|
+
Cs Surrogate
|
|
207
|
+
L Letter
|
|
208
|
+
LC Cased_Letter
|
|
209
|
+
Ll Lowercase_Letter
|
|
210
|
+
Lm Modifier_Letter
|
|
211
|
+
Lo Other_Letter
|
|
212
|
+
Lt Titlecase_Letter
|
|
213
|
+
Lu Uppercase_Letter
|
|
214
|
+
M Mark Combining_Mark
|
|
215
|
+
Mc Spacing_Mark
|
|
216
|
+
Me Enclosing_Mark
|
|
217
|
+
Mn Nonspacing_Mark
|
|
218
|
+
N Number
|
|
219
|
+
Nd Decimal_Number digit
|
|
220
|
+
Nl Letter_Number
|
|
221
|
+
No Other_Number
|
|
222
|
+
P Punctuation punct
|
|
223
|
+
Pc Connector_Punctuation
|
|
224
|
+
Pd Dash_Punctuation
|
|
225
|
+
Pe Close_Punctuation
|
|
226
|
+
Pf Final_Punctuation
|
|
227
|
+
Pi Initial_Punctuation
|
|
228
|
+
Po Other_Punctuation
|
|
229
|
+
Ps Open_Punctuation
|
|
230
|
+
S Symbol
|
|
231
|
+
Sc Currency_Symbol
|
|
232
|
+
Sk Modifier_Symbol
|
|
233
|
+
Sm Math_Symbol
|
|
234
|
+
So Other_Symbol
|
|
235
|
+
Z Separator
|
|
236
|
+
Zl Line_Separator
|
|
237
|
+
Zp Paragraph_Separator
|
|
238
|
+
Zs Space_Separator
|
|
239
|
+
ASCII
|
|
240
|
+
ASCII_Hex_Digit AHex
|
|
241
|
+
Alphabetic Alpha
|
|
242
|
+
Any
|
|
243
|
+
Assigned
|
|
244
|
+
Bidi_Control Bidi_C
|
|
245
|
+
Bidi_Mirrored Bidi_M
|
|
246
|
+
Case_Ignorable CI
|
|
247
|
+
Cased
|
|
248
|
+
Changes_When_Casefolded CWCF
|
|
249
|
+
Changes_When_Casemapped CWCM
|
|
250
|
+
Changes_When_Lowercased CWL
|
|
251
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
252
|
+
Changes_When_Titlecased CWT
|
|
253
|
+
Changes_When_Uppercased CWU
|
|
254
|
+
Dash
|
|
255
|
+
Default_Ignorable_Code_Point DI
|
|
256
|
+
Deprecated Dep
|
|
257
|
+
Diacritic Dia
|
|
258
|
+
Emoji
|
|
259
|
+
Emoji_Component EComp
|
|
260
|
+
Emoji_Modifier EMod
|
|
261
|
+
Emoji_Modifier_Base EBase
|
|
262
|
+
Emoji_Presentation EPres
|
|
263
|
+
Extended_Pictographic ExtPict
|
|
264
|
+
Extender Ext
|
|
265
|
+
Grapheme_Base Gr_Base
|
|
266
|
+
Grapheme_Extend Gr_Ext
|
|
267
|
+
Hex_Digit Hex
|
|
268
|
+
IDS_Binary_Operator IDSB
|
|
269
|
+
IDS_Trinary_Operator IDST
|
|
270
|
+
ID_Continue IDC
|
|
271
|
+
ID_Start IDS
|
|
272
|
+
Ideographic Ideo
|
|
273
|
+
Join_Control Join_C
|
|
274
|
+
Logical_Order_Exception LOE
|
|
275
|
+
Lowercase Lower
|
|
276
|
+
Math
|
|
277
|
+
Noncharacter_Code_Point NChar
|
|
278
|
+
Pattern_Syntax Pat_Syn
|
|
279
|
+
Pattern_White_Space Pat_WS
|
|
280
|
+
Quotation_Mark QMark
|
|
281
|
+
Radical
|
|
282
|
+
Regional_Indicator RI
|
|
283
|
+
Sentence_Terminal STerm
|
|
284
|
+
Soft_Dotted SD
|
|
285
|
+
Terminal_Punctuation Term
|
|
286
|
+
Unified_Ideograph UIdeo
|
|
287
|
+
Uppercase Upper
|
|
288
|
+
Variation_Selector VS
|
|
289
|
+
White_Space space
|
|
290
|
+
XID_Continue XIDC
|
|
291
|
+
XID_Start XIDS`.split(/\s/).map(e=>[WM(e),e])),LN=new Map([[`s`,SN(383)],[SN(383),`s`]]),RN=new Map([[SN(223),SN(7838)],[SN(107),SN(8490)],[SN(229),SN(8491)],[SN(969),SN(8486)]]),zN=new Map([HN(453),HN(456),HN(459),HN(498),...UN(8072,8079),...UN(8088,8095),...UN(8104,8111),HN(8124),HN(8140),HN(8188)]),BN=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function VN(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function HN(e){let t=SN(e);return[t.toLowerCase(),t]}function UN(e,t){return VN(e,t).map(e=>HN(e))}var WN=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function GN(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};YN(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:DN(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};qM(e,KN,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return qM(e,qN,a),qM(e,JN,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var KN={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=kM();e.body[0].body.push(AM({negate:!0,body:r}),IM(`Any`));let i=kM();i.body[0].body.push(NM(`greedy`,0,1/0,e)),n(mP(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];EN(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=nP(t.get(e));if(n){let t=kM({flags:n});t.body[0].body=e.body,e.body=[mP(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(mP(AM({body:[yM({body:[bM(`string_end`)]}),yM({body:[CM(10)]})]}),t));else if(c===`line_start`)o(mP(dP(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&cP(e))o(mP(AM({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(pP(bM(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(mP(dP(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${PN})(?!${PN})|(?<!${PN})(?=${PN}))`,n=`(?:(?<=${PN})(?=${PN})|(?<!${PN})(?!${PN}))`;o(mP(dP(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!uP(n)&&(n=tP(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!uP(r)&&(r=tP(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(mP(wM({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(pP(EM(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(mP(fP(dP(MN),l),t));return}if(s&&(c===`word`||u===`word`)){n(pP(EM(`word`,{negate:l}),t));return}if(c===`any`)n(pP(IM(`Any`),t));else if(c===`digit`)n(pP(IM(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(mP(dP(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(pP(IM(`AHex`,{negate:l}),t));else if(c===`newline`)n(mP(dP(l?`[^
|
|
292
|
+
]`:`(?>\r
|
|
293
|
+
?|[
|
|
294
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${SN(e.codePointAt(0)-1)}${SN(e.codePointAt(2)+1)}-\u{10FFFF}`),n(mP(dP(`[${e}]`),t))}else n(mP(fP(dP(BN.get(u)),l),t))}else if(c===`property`)IN.has(WM(u))||(e.key=`sc`);else if(c===`space`)n(pP(IM(`space`,{negate:l}),t));else if(c===`word`)n(mP(fP(dP(PN),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=kM({flags:c});e.body[0].body=o(),i(mP(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&oM(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=AM({behind:!0});o.body[0].body=a(),i(mP(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(mP(AM({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=kM();t.body[0].body.push(e.body),e.body=mP(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=aP(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!uP(n)&&(n=tP(n,t),e.ref=n)}},qN={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=pP($N(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&EN(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=EN(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=TN(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?$N(0):QN(o,r.groupOriginByCopy,null),l=c;if(!s){let e=nP(eP(o,e=>e.type===`Group`&&!!e.flags)),t=e?TN(r.globalFlags,e):r.globalFlags;XN(t,r.currentFlags)||(l=kM({flags:rP(t)}),l.body[0].body.push(c))}n(mP(l,t),{traverse:!s})}},JN={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>ZN(t,e));i.length?i.length>1?n(mP(kM({atomic:!0,body:i.reverse().map(e=>yM({body:[xM(e.number)]}))}),t)):e.ref=i[0].number:n(mP(AM({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=SM();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function YN(e){qM(e,{"*"({node:e,parent:t}){e.parent=t}})}function XN(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function ZN(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=iP(n.parent);for(let r of t){if(r===n)break;if(r===e||oP(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function QN(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=QN(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function $N(e){let t=FM(e);return t.isRecursive=!0,t}function eP(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function tP(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function nP(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function rP({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function iP(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function aP(e){let t=e.find(e=>e.kind===`search_start`||lP(e,{negate:!1})||!sP(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=aP(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function oP(e,t){let n=iP(e)??[];for(let e of n)if(e===t||oP(e,t))return!0;return!1}function sP({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function cP(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function lP(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&oM(e.body[0],{type:`Assertion`,kind:`search_start`})}function uP(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function dP(e,t){let n=lM(e,{...t,unicodePropertyMap:IN}).body;return n.length>1||n[0].body.length>1?kM({body:n}):n[0].body[0]}function fP(e,t){return e.negate=t,e}function pP(e,t){return e.parent=t,e}function mP(e,t){return YN(e),e.parent=t,e}function hP(e,t){let n=jN(t),r=DN(n.target,`ES2024`),i=DN(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];qM(e,gP,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,ON(_P[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&EN(f._captureTransfers,e.transferTo,[]).push(t)}),f}var gP={"*":{enter({node:e},t){if(kP(e)){let n=t.getCurrentModI();t.pushModI(e.flags?TN({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){kP(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){CP(SN(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),wP(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&WN.has(e.value)&&t.setHasCasedChar()}},_P={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=SN(e),r=TP(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&CP(n)){let e=FN(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);CN.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(jP)&&(o=[CM(45),...o.filter(e=>!jP(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||CN.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=kM(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=yM({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(CN.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=TP(n,i),o=TP(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&EP(wP(e)).forEach(e=>{s.add(Array.isArray(e)?`${TP(e[0],i)}-${TP(e[1],i)}`:TP(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&WN.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=TN(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${DP(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+OP(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},vP=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),yP=new Set([`-`,`\\`,`]`,`^`,`[`]),bP=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),xP=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),SP=/^\p{Cased}$/u;function CP(e){return SP.test(e)}function wP(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=SN(e);if(!CP(t))continue;let o=FN(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function TP(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(xP.has(e))return xP.get(e);if(e<32||e>126&&e<160||e>262143||t&&AP(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?bP:yP:vP,a=SN(e);return(i.has(a)?`\\`:``)+a}function EP(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function DP(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function OP({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function kP({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function AP(e){return e>47&&e<58}function jP({type:e,value:t}){return e===`Character`&&t===45}var MP=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=PP(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(NP(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=FP(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function NP(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function PP(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)EN(n,t,{}).transferTo=e;return n}function FP(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function IP(e,t){let n=LP(e,t);return n.options?new MP(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function LP(e,t){let n=jN(t),r=GN(lM(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:IN}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=hP(r,n),a=gN(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=oN(lN(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function RP(e,t){return IP(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function zP(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>RP(e,{target:t.target}),{createScanner(e){return new hj(e,t)},createString(e){return{content:e}}}}var BP=e=>e&&e&1,VP=e=>e&&e&2,HP=e=>e&&e&4,UP=new Set([`bash`,`css`,`diff`,`html`,`javascript`,`json`,`jsonc`,`jsx`,`markdown`,`python`,`shellscript`,`tsx`,`typescript`,`yaml`]),WP={bash:()=>Fe(()=>import(`./bash-B7CDPTg5.js`).then(e=>e.default),__vite__mapDeps([3,4]),import.meta.url),css:()=>Fe(()=>import(`./css-BsVw1vtW.js`).then(e=>e.default),[],import.meta.url),diff:()=>Fe(()=>import(`./diff-woXpYk--.js`).then(e=>e.default),[],import.meta.url),html:()=>Fe(()=>import(`./html-BY76lXLH.js`).then(e=>e.default),__vite__mapDeps([5,6,7]),import.meta.url),javascript:()=>Fe(()=>import(`./javascript-BgS3c2Ky.js`).then(e=>e.default),[],import.meta.url),json:()=>Fe(()=>import(`./json-qhed-kSA.js`).then(e=>e.default),[],import.meta.url),jsonc:()=>Fe(()=>import(`./jsonc-CYpm1nAK.js`).then(e=>e.default),[],import.meta.url),jsx:()=>Fe(()=>import(`./jsx-Bz0zcwM4.js`).then(e=>e.default),[],import.meta.url),markdown:()=>Fe(()=>import(`./markdown-BYOwaDjH.js`).then(e=>e.default),[],import.meta.url),python:()=>Fe(()=>import(`./python-gzcpVVnB.js`).then(e=>e.default),[],import.meta.url),shellscript:()=>Fe(()=>import(`./shellscript-CLZ0U2zV.js`).then(e=>e.default),[],import.meta.url),tsx:()=>Fe(()=>import(`./tsx-udAQXfEw.js`).then(e=>e.default),[],import.meta.url),typescript:()=>Fe(()=>import(`./typescript-bsJCZSQ-.js`).then(e=>e.default),[],import.meta.url),yaml:()=>Fe(()=>import(`./yaml-rwi0_p6S.js`).then(e=>e.default),[],import.meta.url)},GP={console:`shellscript`,cjs:`javascript`,htm:`html`,js:`javascript`,json5:`jsonc`,md:`markdown`,mjs:`javascript`,py:`python`,sh:`shellscript`,shell:`shellscript`,ts:`typescript`,yml:`yaml`},KP=e=>{let t=e.trim().toLowerCase();if(!t)return`text`;let n=GP[t]??t;return UP.has(n)?n:`text`},qP=e=>e.map((e,t)=>({key:`line-${t}`,tokens:e.map((e,n)=>({key:`line-${t}-${n}`,token:e}))})),JP=({token:e})=>(0,M.jsx)(`span`,{className:`dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!`,style:{backgroundColor:e.bgColor,color:e.color,fontStyle:BP(e.fontStyle)?`italic`:void 0,fontWeight:VP(e.fontStyle)?`bold`:void 0,textDecoration:HP(e.fontStyle)?`underline`:void 0,...e.htmlStyle},children:e.content}),YP=j(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-8`,`before:mr-4`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),XP=({keyedLine:e,showLineNumbers:t})=>(0,M.jsx)(`span`,{className:t?YP:`block`,children:e.tokens.length===0?`
|
|
295
|
+
`:e.tokens.map(({token:e,key:t})=>(0,M.jsx)(JP,{token:e},t))}),ZP=(0,N.createContext)({code:``}),QP,$P,eF=new Map,tF=new Map,nF=new Map,rF=(e,t)=>{let n=e.slice(0,100),r=e.length>100?e.slice(-100):``;return`${t}:${e.length}:${n}:${r}`},iF=()=>(QP||=pj({engine:zP({forgiving:!0})}),QP),aF=e=>($P||=Promise.all([Fe(()=>import(`./github-light-EUqPIrTm.js`).then(e=>e.default),[],import.meta.url),Fe(()=>import(`./github-dark-C-LZuMrd.js`).then(e=>e.default),[],import.meta.url)]).then(t=>e.loadTheme(...t)),$P),oF=(e,t)=>{let n=eF.get(t);if(n)return n;let r=WP[t]().then(t=>e.loadLanguage(...t));return eF.set(t,r),r},sF=e=>({bg:`transparent`,fg:`inherit`,tokens:e.split(`
|
|
296
|
+
`).map(e=>e===``?[]:[{color:`inherit`,content:e}])}),cF=(e,t,n)=>{let r=KP(t);if(r===`text`)return sF(e);let i=rF(e,r);return tF.get(i)||(n&&(nF.has(i)||nF.set(i,new Set),nF.get(i)?.add(n)),iF().then(async t=>{await aF(t),await oF(t,r);let n=t.codeToTokens(e,{lang:r,themes:{dark:`github-dark`,light:`github-light`}}),a={bg:n.bg??`transparent`,fg:n.fg??`inherit`,tokens:n.tokens};tF.set(i,a);let o=nF.get(i);if(o){for(let e of o)e(a);nF.delete(i)}}).catch(e=>{console.error(`Failed to highlight code:`,e),nF.delete(i)}),null)},lF=(0,N.memo)(({tokenized:e,showLineNumbers:t,className:n})=>{let r=(0,N.useMemo)(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=(0,N.useMemo)(()=>qP(e.tokens),[e.tokens]);return(0,M.jsx)(`pre`,{className:j(`dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)! m-0 p-4 text-sm`,n),style:r,children:(0,M.jsx)(`code`,{className:j(`font-mono text-sm`,t&&`[counter-increment:line_0] [counter-reset:line]`),children:i.map(e=>(0,M.jsx)(XP,{keyedLine:e,showLineNumbers:t},e.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);lF.displayName=`CodeBlockBody`;var uF=({className:e,language:t,style:n,...r})=>(0,M.jsx)(`div`,{className:j(`group relative w-full overflow-hidden rounded-sm border bg-background text-foreground`,e),"data-language":t,style:{containIntrinsicSize:`auto 200px`,contentVisibility:`auto`,...n},...r}),dF=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs`,t),...n,children:e}),fF=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`flex items-center gap-2`,t),...n,children:e}),pF=({children:e,className:t,...n})=>(0,M.jsx)(`span`,{className:j(`font-mono`,t),...n,children:e}),mF=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`-my-1 -mr-1 flex items-center gap-2`,t),...n,children:e}),hF=({code:e,language:t,showLineNumbers:n=!1})=>{let r=(0,N.useMemo)(()=>sF(e),[e]),i=(0,N.useMemo)(()=>cF(e,t)??r,[e,t,r]),a=(0,N.useMemo)(()=>({code:e,language:t}),[e,t]),[o,s]=(0,N.useState)({key:a,tokens:null}),c=o.key===a?o.tokens:null;return(0,N.useEffect)(()=>{let n=!1;return cF(e,t,e=>{n||s({key:a,tokens:e})}),()=>{n=!0}},[e,t,a]),(0,M.jsx)(`div`,{className:`relative overflow-auto`,children:(0,M.jsx)(lF,{showLineNumbers:n,tokenized:c??i})})},gF=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let o=(0,N.useMemo)(()=>({code:e}),[e]);return(0,M.jsx)(ZP.Provider,{value:o,children:(0,M.jsxs)(uF,{className:r,language:t,...a,children:[i,(0,M.jsx)(hF,{code:e,language:t,showLineNumbers:n})]})})},_F=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,...a})=>{let[o,s]=(0,N.useState)(!1),c=(0,N.useRef)(0),{code:l}=(0,N.useContext)(ZP),u=(0,N.useCallback)(async()=>{if(typeof window>`u`||!navigator?.clipboard?.writeText){t?.(Error(`Clipboard API not available`));return}try{o||(await navigator.clipboard.writeText(l),s(!0),e?.(),c.current=window.setTimeout(()=>s(!1),n))}catch(e){t?.(e)}},[l,e,t,n,o]);(0,N.useEffect)(()=>()=>{window.clearTimeout(c.current)},[]);let d=o?g:je;return(0,M.jsx)(A,{className:j(`shrink-0`,i),onClick:u,size:`icon`,variant:`ghost`,...a,children:r??(0,M.jsx)(d,{size:14})})},vF=/(?:^|\s)language-([^\s]+)/,yF=/startLine=(\d+)/,bF=/\bnoLineNumbers\b/;function xF(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(xF).join(``):(0,N.isValidElement)(e)?xF(e.props.children):``}var SF={code:({children:e,className:t,node:n,"data-block":r,...i})=>{let a=t?.match(vF)?.[1]??`text`;if(!r)return(0,M.jsx)(`code`,{className:j(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),...i,children:e});let o=n?.properties?.metastring,s=typeof o==`string`?o:void 0,c=s?.match(yF),l=c?Number.parseInt(c[1],10):1,u=!s||!bF.test(s);return(0,M.jsx)(gF,{code:xF(e),"data-start-line":l>1?l:void 0,language:a,showLineNumbers:u,children:(0,M.jsxs)(dF,{children:[(0,M.jsx)(fF,{children:(0,M.jsx)(pF,{children:a})}),(0,M.jsx)(mF,{children:(0,M.jsx)(_F,{})})]})})}},CF={fontFamily:`monospace`,securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:`default`};function wF(){let e=CF,t=!1,n={initialize(n){e={...CF,...e,...n},t=!1},async render(n,r){let i=(await Fe(()=>import(`./mermaid.core-CNhdxt2h.js`).then(e=>e.t),__vite__mapDeps([8,1,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url)).default;return t||=(i.initialize(e),!0),i.render(n,r)}};return{getMermaid(e){return e&&n.initialize(e),n},language:`mermaid`,name:`mermaid`,type:`diagram`}}var TF={cjk:Zi,mermaid:wF()},EF=(0,N.memo)(({className:e,components:t,...n})=>{let r=t?{...SF,...t}:SF;return(0,M.jsx)(IE,{className:e,components:r,plugins:TF,...n})});EF.displayName=`HubStreamdown`;var DF=({className:e,from:t,...n})=>(0,M.jsx)(`div`,{className:j(`group flex w-full flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),OF=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`is-user:dark flex w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),...n,children:e});(0,N.createContext)(null);var kF=(0,N.memo)(({className:e,...t})=>(0,M.jsx)(EF,{className:j(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t}));kF.displayName=`MessageResponse`;var AF=1,jF=.9,MF=.8,NF=.17,PF=.1,FF=.999,IF=.9999,LF=.99,RF=/[\\\/_+.#"@\[\(\{&]/,zF=/[\\\/_+.#"@\[\(\{&]/g,BF=/[\s-]/,VF=/[\s-]/g;function HF(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?AF:LF;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=HF(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=AF:RF.test(e.charAt(l-1))?(d*=MF,p=e.slice(i,l-1).match(zF),p&&i>0&&(d*=FF**+p.length)):BF.test(e.charAt(l-1))?(d*=jF,m=e.slice(i,l-1).match(VF),m&&i>0&&(d*=FF**+m.length)):(d*=NF,i>0&&(d*=FF**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=IF)),(d<PF&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=HF(e,t,n,r,l+1,a+2,o),f*PF>d&&(d=f*PF)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function UF(e){return e.toLowerCase().replace(VF,` `)}function WF(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,HF(e,t,UF(e),UF(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function GF(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function KF(e,t){let n=N.createContext(t),r=e=>{let{children:t,...r}=e,i=N.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=N.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function qF(e,t=[]){let n=[];function r(t,r){let i=N.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=N.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=N.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>N.createContext(e));return function(n){let r=n?.[e]||t;return N.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,JF(i,...t)]}function JF(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var YF=globalThis?.document?N.useLayoutEffect:()=>{},XF=N.useId||(()=>void 0),ZF=0;function QF(e){let[t,n]=N.useState(XF());return YF(()=>{e||n(e=>e??String(ZF++))},[e]),e||(t?`radix-${t}`:``)}var $F=N.useInsertionEffect||YF;function eI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=tI({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=N.useRef(e!==void 0);N.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,N.useCallback(t=>{if(s){let n=nI(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function tI({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return $F(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function nI(e){return typeof e==`function`}function rI(e){let t=iI(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e,a=N.Children.toArray(r),o=a.find(oI);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function iI(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(N.isValidElement(n)){let e=cI(n),i=sI(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aI=Symbol(`radix.slottable`);function oI(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===aI}function sI(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function cI(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lI=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=rI(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function uI(e,t){e&&pt.flushSync(()=>e.dispatchEvent(t))}function dI(e){let t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...e)=>t.current?.(...e),[])}function fI(e,t=globalThis?.document){let n=dI(e);N.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var pI=`DismissableLayer`,mI=`dismissableLayer.update`,hI=`dismissableLayer.pointerDownOutside`,gI=`dismissableLayer.focusOutside`,_I,vI=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yI=N.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=N.useContext(vI),[u,d]=N.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=N.useState({}),m=gt(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=SI(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=CI(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return fI(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),N.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(_I=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),wI(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_I)}},[u,f,n,l]),N.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),wI())},[u,l]),N.useEffect(()=>{let e=()=>p({});return document.addEventListener(mI,e),()=>document.removeEventListener(mI,e)},[]),(0,M.jsx)(lI.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:GF(e.onFocusCapture,S.onFocusCapture),onBlurCapture:GF(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:GF(e.onPointerDownCapture,x.onPointerDownCapture)})});yI.displayName=pI;var bI=`DismissableLayerBranch`,xI=N.forwardRef((e,t)=>{let n=N.useContext(vI),r=N.useRef(null),i=gt(t,r);return N.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(lI.div,{...e,ref:i})});xI.displayName=bI;function SI(e,t=globalThis?.document){let n=dI(e),r=N.useRef(!1),i=N.useRef(()=>{});return N.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){TI(hI,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function CI(e,t=globalThis?.document){let n=dI(e),r=N.useRef(!1);return N.useEffect(()=>{let e=e=>{e.target&&!r.current&&TI(gI,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wI(){let e=new CustomEvent(mI);document.dispatchEvent(e)}function TI(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?uI(i,a):i.dispatchEvent(a)}var EI=`focusScope.autoFocusOnMount`,DI=`focusScope.autoFocusOnUnmount`,OI={bubbles:!1,cancelable:!0},kI=`FocusScope`,AI=N.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=N.useState(null),l=dI(i),u=dI(a),d=N.useRef(null),f=gt(t,e=>c(e)),p=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:LI(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||LI(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&LI(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),N.useEffect(()=>{if(s){RI.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(EI,OI);s.addEventListener(EI,l),s.dispatchEvent(t),t.defaultPrevented||(jI(VI(NI(s)),{select:!0}),document.activeElement===e&&LI(s))}return()=>{s.removeEventListener(EI,l),setTimeout(()=>{let t=new CustomEvent(DI,OI);s.addEventListener(DI,u),s.dispatchEvent(t),t.defaultPrevented||LI(e??document.body,{select:!0}),s.removeEventListener(DI,u),RI.remove(p)},0)}}},[s,l,u,p]);let m=N.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=MI(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&LI(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&LI(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(lI.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});AI.displayName=kI;function jI(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(LI(r,{select:t}),document.activeElement!==n)return}function MI(e){let t=NI(e);return[PI(t,e),PI(t.reverse(),e)]}function NI(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function PI(e,t){for(let n of e)if(!FI(n,{upTo:t}))return n}function FI(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function II(e){return e instanceof HTMLInputElement&&`select`in e}function LI(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&II(e)&&t&&e.select()}}var RI=zI();function zI(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=BI(e,t),e.unshift(t)},remove(t){e=BI(e,t),e[0]?.resume()}}}function BI(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function VI(e){return e.filter(e=>e.tagName!==`A`)}var HI=`Portal`,UI=N.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=N.useState(!1);YF(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pt.createPortal((0,M.jsx)(lI.div,{...r,ref:t}),o):null});UI.displayName=HI;function WI(e,t){return N.useReducer((e,n)=>t[e][n]??e,e)}var GI=e=>{let{present:t,children:n}=e,r=KI(t),i=typeof n==`function`?n({present:r.isPresent}):N.Children.only(n),a=gt(r.ref,JI(i));return typeof n==`function`||r.isPresent?N.cloneElement(i,{ref:a}):null};GI.displayName=`Presence`;function KI(e){let[t,n]=N.useState(),r=N.useRef(null),i=N.useRef(e),a=N.useRef(`none`),[o,s]=WI(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return N.useEffect(()=>{let e=qI(r.current);a.current=o===`mounted`?e:`none`},[o]),YF(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=qI(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),YF(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=qI(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=qI(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:N.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function qI(e){return e?.animationName||`none`}function JI(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YI=0;function XI(){N.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ZI()),document.body.insertAdjacentElement(`beforeend`,e[1]??ZI()),YI++,()=>{YI===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),YI--}},[])}function ZI(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var QI=function(){return QI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},QI.apply(this,arguments)};function $I(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function eL(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tL=`right-scroll-bar-position`,nL=`width-before-scroll-bar`,rL=`with-scroll-bars-hidden`,iL=`--removed-body-scroll-bar-size`;function aL(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function oL(e,t){var n=(0,N.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var sL=typeof window<`u`?N.useLayoutEffect:N.useEffect,cL=new WeakMap;function lL(e,t){var n=oL(t||null,function(t){return e.forEach(function(e){return aL(e,t)})});return sL(function(){var t=cL.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||aL(e,null)}),i.forEach(function(e){r.has(e)||aL(e,a)})}cL.set(n,e)},[e]),n}function uL(e){return e}function dL(e,t){t===void 0&&(t=uL);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fL(e){e===void 0&&(e={});var t=dL(null);return t.options=QI({async:!0,ssr:!1},e),t}var pL=function(e){var t=e.sideCar,n=$I(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return N.createElement(r,QI({},n))};pL.isSideCarExport=!0;function mL(e,t){return e.useMedium(t),pL}var hL=fL(),gL=function(){},_L=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:gL,onWheelCapture:gL,onTouchMoveCapture:gL}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=$I(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=lL([n,t]),C=QI(QI({},b),i);return N.createElement(N.Fragment,null,u&&N.createElement(x,{sideCar:hL,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?N.cloneElement(N.Children.only(s),QI(QI({},C),{ref:S})):N.createElement(v,QI({},C,{className:c,ref:S}),s))});_L.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_L.classNames={fullWidth:nL,zeroRight:tL};var vL=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function yL(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=vL();return t&&e.setAttribute(`nonce`,t),e}function bL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xL(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var SL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yL())&&(bL(t,n),xL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},CL=function(){var e=SL();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wL=function(){var e=CL();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},TL={left:0,top:0,right:0,gap:0},EL=function(e){return parseInt(e||``,10)||0},DL=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[EL(n),EL(r),EL(i)]},OL=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return TL;var t=DL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kL=wL(),AL=`data-scroll-locked`,jL=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
297
|
+
.${rL} {
|
|
298
|
+
overflow: hidden ${r};
|
|
299
|
+
padding-right: ${s}px ${r};
|
|
300
|
+
}
|
|
301
|
+
body[${AL}] {
|
|
302
|
+
overflow: hidden ${r};
|
|
303
|
+
overscroll-behavior: contain;
|
|
304
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
305
|
+
padding-left: ${i}px;
|
|
306
|
+
padding-top: ${a}px;
|
|
307
|
+
padding-right: ${o}px;
|
|
308
|
+
margin-left:0;
|
|
309
|
+
margin-top:0;
|
|
310
|
+
margin-right: ${s}px ${r};
|
|
311
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.${tL} {
|
|
315
|
+
right: ${s}px ${r};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.${nL} {
|
|
319
|
+
margin-right: ${s}px ${r};
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.${tL} .${tL} {
|
|
323
|
+
right: 0 ${r};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.${nL} .${nL} {
|
|
327
|
+
margin-right: 0 ${r};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
body[${AL}] {
|
|
331
|
+
${iL}: ${s}px;
|
|
332
|
+
}
|
|
333
|
+
`},ML=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},NL=function(){N.useEffect(function(){return document.body.setAttribute(AL,(ML()+1).toString()),function(){var e=ML()-1;e<=0?document.body.removeAttribute(AL):document.body.setAttribute(AL,e.toString())}},[])},PL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;NL();var a=N.useMemo(function(){return OL(i)},[i]);return N.createElement(kL,{styles:jL(a,!t,i,n?``:`!important`)})},FL=!1;if(typeof window<`u`)try{var IL=Object.defineProperty({},"passive",{get:function(){return FL=!0,!0}});window.addEventListener(`test`,IL,IL),window.removeEventListener(`test`,IL,IL)}catch{FL=!1}var LL=FL?{passive:!1}:!1,RL=function(e){return e.tagName===`TEXTAREA`},zL=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!RL(e)&&n[t]===`visible`)},BL=function(e){return zL(e,`overflowY`)},VL=function(e){return zL(e,`overflowX`)},HL=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),GL(e,r)){var i=KL(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UL=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},WL=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},GL=function(e,t){return e===`v`?BL(t):VL(t)},KL=function(e,t){return e===`v`?UL(t):WL(t)},qL=function(e,t){return e===`h`&&t===`rtl`?-1:1},JL=function(e,t,n,r,i){var a=qL(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=KL(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&GL(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},YL=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},XL=function(e){return[e.deltaX,e.deltaY]},ZL=function(e){return e&&`current`in e?e.current:e},QL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$L=function(e){return`
|
|
334
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
335
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
336
|
+
`},eR=0,tR=[];function nR(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(eR++)[0],a=N.useState(wL)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=eL([e.lockRef.current],(e.shards||[]).map(ZL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=YL(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=HL(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=HL(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return JL(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(!(!tR.length||tR[tR.length-1]!==a)){var r=`deltaY`in n?XL(n):YL(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&QL(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ZL).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:rR(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=YL(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,XL(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,YL(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return tR.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,LL),document.addEventListener(`touchmove`,c,LL),document.addEventListener(`touchstart`,u,LL),function(){tR=tR.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,LL),document.removeEventListener(`touchmove`,c,LL),document.removeEventListener(`touchstart`,u,LL)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:$L(i)}):null,p?N.createElement(PL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var iR=mL(hL,nR),aR=N.forwardRef(function(e,t){return N.createElement(_L,QI({},e,{ref:t,sideCar:iR}))});aR.classNames=_L.classNames;var oR=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},sR=new WeakMap,cR=new WeakMap,lR={},uR=0,dR=function(e){return e&&(e.host||dR(e.parentNode))},fR=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=dR(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},pR=function(e,t,n,r){var i=fR(t,Array.isArray(e)?e:[e]);lR[n]||(lR[n]=new WeakMap);var a=lR[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(sR.get(e)||0)+1,l=(a.get(e)||0)+1;sR.set(e,c),a.set(e,l),o.push(e),c===1&&i&&cR.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),uR++,function(){o.forEach(function(e){var t=sR.get(e)-1,i=a.get(e)-1;sR.set(e,t),a.set(e,i),t||(cR.has(e)||e.removeAttribute(r),cR.delete(e)),i||e.removeAttribute(n)}),uR--,uR||(sR=new WeakMap,sR=new WeakMap,cR=new WeakMap,lR={})}},mR=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||oR(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),pR(r,i,n,`aria-hidden`)):function(){return null}},hR=`Dialog`,[gR,_R]=qF(hR),[vR,yR]=gR(hR),bR=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=N.useRef(null),c=N.useRef(null),[l,u]=eI({prop:r,defaultProp:i??!1,onChange:a,caller:hR});return(0,M.jsx)(vR,{scope:t,triggerRef:s,contentRef:c,contentId:QF(),titleId:QF(),descriptionId:QF(),open:l,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};bR.displayName=hR;var xR=`DialogTrigger`,SR=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=yR(xR,n),a=gt(t,i.triggerRef);return(0,M.jsx)(lI.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":HR(i.open),...r,ref:a,onClick:GF(e.onClick,i.onOpenToggle)})});SR.displayName=xR;var CR=`DialogPortal`,[wR,TR]=gR(CR,{forceMount:void 0}),ER=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=yR(CR,t);return(0,M.jsx)(wR,{scope:t,forceMount:n,children:N.Children.map(r,e=>(0,M.jsx)(GI,{present:n||a.open,children:(0,M.jsx)(UI,{asChild:!0,container:i,children:e})}))})};ER.displayName=CR;var DR=`DialogOverlay`,OR=N.forwardRef((e,t)=>{let n=TR(DR,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yR(DR,e.__scopeDialog);return a.modal?(0,M.jsx)(GI,{present:r||a.open,children:(0,M.jsx)(AR,{...i,ref:t})}):null});OR.displayName=DR;var kR=rI(`DialogOverlay.RemoveScroll`),AR=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=yR(DR,n);return(0,M.jsx)(aR,{as:kR,allowPinchZoom:!0,shards:[i.contentRef],children:(0,M.jsx)(lI.div,{"data-state":HR(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),jR=`DialogContent`,MR=N.forwardRef((e,t)=>{let n=TR(jR,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yR(jR,e.__scopeDialog);return(0,M.jsx)(GI,{present:r||a.open,children:a.modal?(0,M.jsx)(NR,{...i,ref:t}):(0,M.jsx)(PR,{...i,ref:t})})});MR.displayName=jR;var NR=N.forwardRef((e,t)=>{let n=yR(jR,e.__scopeDialog),r=N.useRef(null),i=gt(t,n.contentRef,r);return N.useEffect(()=>{let e=r.current;if(e)return mR(e)},[]),(0,M.jsx)(FR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:GF(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:GF(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:GF(e.onFocusOutside,e=>e.preventDefault())})}),PR=N.forwardRef((e,t)=>{let n=yR(jR,e.__scopeDialog),r=N.useRef(!1),i=N.useRef(!1);return(0,M.jsx)(FR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),FR=N.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=yR(jR,n),c=N.useRef(null),l=gt(t,c);return XI(),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(AI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(yI,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":HR(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(KR,{titleId:s.titleId}),(0,M.jsx)(JR,{contentRef:c,descriptionId:s.descriptionId})]})]})}),IR=`DialogTitle`,LR=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=yR(IR,n);return(0,M.jsx)(lI.h2,{id:i.titleId,...r,ref:t})});LR.displayName=IR;var RR=`DialogDescription`,zR=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=yR(RR,n);return(0,M.jsx)(lI.p,{id:i.descriptionId,...r,ref:t})});zR.displayName=RR;var BR=`DialogClose`,VR=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=yR(BR,n);return(0,M.jsx)(lI.button,{type:`button`,...r,ref:t,onClick:GF(e.onClick,()=>i.onOpenChange(!1))})});VR.displayName=BR;function HR(e){return e?`open`:`closed`}var UR=`DialogTitleWarning`,[WR,GR]=KF(UR,{contentName:jR,titleName:IR,docsSlug:`dialog`}),KR=({titleId:e})=>{let t=GR(UR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
337
|
+
|
|
338
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
339
|
+
|
|
340
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},qR=`DialogDescriptionWarning`,JR=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GR(qR).contentName}}.`;return N.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},YR=bR,XR=ER,ZR=OR,QR=MR,$R=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xt(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ez=`[cmdk-group=""]`,tz=`[cmdk-group-items=""]`,nz=`[cmdk-group-heading=""]`,rz=`[cmdk-item=""]`,iz=`${rz}:not([aria-disabled="true"])`,az=`cmdk-item-select`,oz=`data-value`,sz=(e,t,n)=>WF(e,t,n),cz=N.createContext(void 0),lz=()=>N.useContext(cz),uz=N.createContext(void 0),dz=()=>N.useContext(uz),fz=N.createContext(void 0),pz=N.forwardRef((e,t)=>{let n=Dz(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Dz(()=>new Set),i=Dz(()=>new Map),a=Dz(()=>new Map),o=Dz(()=>new Set),s=Tz(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=QF(),y=QF(),b=QF(),x=N.useRef(null),S=Az();Ez(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Ez(()=>{S(6,te)},[]);let C=N.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),E(),S(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=N.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),E(),n.current.value||ee(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&ee(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??sz;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(tz);t?t.appendChild(e.parentElement===t?e:e.closest(`${tz} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${tz} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${ez}[${oz}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(oz);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ez)?.querySelector(nz))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${rz}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(iz)||[])}function k(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(oz))}function re(e){var t;let n=O(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(oz))}function ie(e){let t=O()?.closest(ez),n;for(;t&&!n;)t=e>0?Cz(t,ez):wz(t,ez),n=t?.querySelector(iz);n?C.setState(`value`,n.getAttribute(oz)):re(e)}let ae=()=>k(ne().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?k(0):e.altKey?ie(-1):re(-1)};return N.createElement($R.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:g&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),k(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(az);t.dispatchEvent(e)}}}}},N.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:Nz},c),Mz(e,e=>N.createElement(uz.Provider,{value:C},N.createElement(cz.Provider,{value:w},e))))}),mz=N.forwardRef((e,t)=>{let n=QF(),r=N.useRef(null),i=N.useContext(fz),a=lz(),o=Tz(e),s=o.current?.forceMount??i?.forceMount;Ez(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=kz(n,r,[e.value,e.children,r],e.keywords),l=dz(),u=Oz(e=>e.value&&e.value===c.current),d=Oz(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);N.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(az,f),()=>t.removeEventListener(az,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return N.createElement($R.div,{ref:ht(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),hz=N.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=QF(),s=N.useRef(null),c=N.useRef(null),l=QF(),u=lz(),d=Oz(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Ez(()=>u.group(o),[]),kz(o,s,[e.value,e.heading,c]);let f=N.useMemo(()=>({id:o,forceMount:i}),[i]);return N.createElement($R.div,{ref:ht(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&N.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Mz(e,e=>N.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},N.createElement(fz.Provider,{value:f},e))))}),gz=N.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=N.useRef(null),a=Oz(e=>!e.search);return!n&&!a?null:N.createElement($R.div,{ref:ht(i,t),...r,"cmdk-separator":``,role:`separator`})}),_z=N.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=dz(),o=Oz(e=>e.search),s=Oz(e=>e.selectedItemId),c=lz();return N.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),N.createElement($R.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),vz=N.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=N.useRef(null),o=N.useRef(null),s=Oz(e=>e.selectedItemId),c=lz();return N.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),N.createElement($R.div,{ref:ht(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Mz(e,e=>N.createElement(`div`,{ref:ht(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),yz=N.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return N.createElement(YR,{open:n,onOpenChange:r},N.createElement(XR,{container:o},N.createElement(ZR,{"cmdk-overlay":``,className:i}),N.createElement(QR,{"aria-label":e.label,"cmdk-dialog":``,className:a},N.createElement(pz,{ref:t,...s}))))}),bz=N.forwardRef((e,t)=>Oz(e=>e.filtered.count===0)?N.createElement($R.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),xz=N.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return N.createElement($R.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Mz(e,e=>N.createElement(`div`,{"aria-hidden":!0},e)))}),Sz=Object.assign(pz,{List:vz,Item:mz,Input:_z,Group:hz,Separator:gz,Dialog:yz,Empty:bz,Loading:xz});function Cz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wz(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Tz(e){let t=N.useRef(e);return Ez(()=>{t.current=e}),t}var Ez=typeof window>`u`?N.useEffect:N.useLayoutEffect;function Dz(e){let t=N.useRef();return t.current===void 0&&(t.current=e()),t}function Oz(e){let t=dz(),n=()=>e(t.snapshot());return N.useSyncExternalStore(t.subscribe,n,n)}function kz(e,t,n,r=[]){let i=N.useRef(),a=lz();return Ez(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(oz,s),i.current=s}),i}var Az=()=>{let[e,t]=N.useState(),n=Dz(()=>new Map);return Ez(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function jz(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Mz({asChild:e,children:t},n){return e&&N.isValidElement(t)?N.cloneElement(jz(t),{ref:t.ref},n(t.props.children)):n(t)}var Nz={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Pz({className:e,...t}){return(0,M.jsx)(Sz,{"data-slot":`command`,className:j(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function Fz({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(we,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,M.jsx)(Sz.Input,{"data-slot":`command-input`,className:j(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(De,{children:(0,M.jsx)(h,{className:`size-4 shrink-0 opacity-50`})})]})})}function Iz({className:e,...t}){return(0,M.jsx)(Sz.List,{"data-slot":`command-list`,className:j(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function Lz({className:e,...t}){return(0,M.jsx)(Sz.Empty,{"data-slot":`command-empty`,className:j(`py-6 text-center text-sm`,e),...t})}function Rz({className:e,...t}){return(0,M.jsx)(Sz.Group,{"data-slot":`command-group`,className:j(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function zz({className:e,children:t,...n}){return(0,M.jsxs)(Sz.Item,{"data-slot":`command-item`,className:j(`group/command-item relative flex cursor-pointer 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]:cursor-not-allowed data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(g,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var Bz=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},Vz=async e=>await new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result??null),n.onerror=()=>t(null),n.readAsDataURL(e)}),Hz=(0,N.createContext)(null),Uz=(0,N.createContext)(null),Wz=()=>{let e=(0,N.useContext)(Hz);if(!e)throw Error(`Wrap your component inside <PromptInputProvider> to use usePromptInputController().`);return e},Gz=()=>(0,N.useContext)(Hz),Kz=()=>(0,N.useContext)(Uz),qz=({initialInput:e=``,children:t})=>{let[n,r]=(0,N.useState)(e),i=(0,N.useCallback)(()=>r(``),[]),[a,o]=(0,N.useState)([]),s=(0,N.useRef)(null),c=(0,N.useRef)(()=>{}),l=(0,N.useCallback)(e=>{let t=[...e];t.length!==0&&o(e=>[...e,...t.map(e=>({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)}))])},[]),u=(0,N.useCallback)(e=>{o(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),d=(0,N.useCallback)(()=>{o(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]})},[]),f=(0,N.useRef)(a);(0,N.useEffect)(()=>{f.current=a},[a]),(0,N.useEffect)(()=>()=>{for(let e of f.current)e.url&&URL.revokeObjectURL(e.url)},[]);let p=(0,N.useCallback)(()=>{c.current?.()},[]),m=(0,N.useMemo)(()=>({add:l,clear:d,fileInputRef:s,files:a,openFileDialog:p,remove:u}),[a,l,u,d,p]),h=(0,N.useCallback)((e,t)=>{s.current=e.current,c.current=t},[]),g=(0,N.useMemo)(()=>({__registerFileInput:h,attachments:m,textInput:{clear:i,setInput:r,value:n}}),[n,i,m,h]);return(0,M.jsx)(Hz.Provider,{value:g,children:(0,M.jsx)(Uz.Provider,{value:m,children:t})})},Jz=(0,N.createContext)(null),Yz=()=>{let e=Kz(),t=(0,N.useContext)(Jz)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},Xz=(0,N.createContext)(null),Zz=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=Gz(),f=!!d,p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,N.useState)([]),b=(0,N.useRef)(_);(0,N.useEffect)(()=>{b.current=_},[_]);let x=(0,N.useCallback)(()=>{p.current?.click()},[]),S=(0,N.useCallback)(e=>!t||t.trim()===``||t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,N.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,N.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),ee=(0,N.useCallback)(()=>y([]),[]),D=f?T:C,te=f?d.attachments.remove:w,O=f?d.attachments.openFileDialog:x,ne=(0,N.useCallback)(()=>{E(),ee()},[E,ee]);(0,N.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,N.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,N.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,r]),(0,N.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,r]),(0,N.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let k=(0,N.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),re=(0,N.useMemo)(()=>({add:D,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:O,remove:te}),[_,D,te,E,O]),ie=(0,N.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:Pt()}))])},clear:ee,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,ee]),ae=(0,N.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,rawFile:t,...n})=>{if(t){let e=await Vz(t);return{...n,url:e??n.url}}if(n.url?.startsWith(`blob:`)){let e=await Bz(n.url);return{...n,url:e??n.url}}return n})),text:n},e);if(t instanceof Promise)try{await t,ne(),f&&d.textInput.clear()}catch{}else ne(),f&&d.textInput.clear()}catch{}},[f,d,_,c,ne]),oe=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:k,ref:p,title:`Upload files`,type:`file`}),(0,M.jsx)(`form`,{className:j(`w-full`,e),onSubmit:ae,ref:m,...u,children:(0,M.jsx)(we,{className:`overflow-hidden`,children:l})})]}),se=(0,M.jsx)(Xz.Provider,{value:ie,children:oe});return(0,M.jsx)(Jz.Provider,{value:re,children:se})},Qz=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`contents`,e),...t}),$z=({onChange:e,onKeyDown:t,className:n,placeholder:r=`How can I help you?`,...i})=>{let a=Gz(),o=Yz(),[s,c]=(0,N.useState)(!1),l=(0,N.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,N.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,N.useCallback)(()=>c(!1),[]),f=(0,N.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,M.jsx)(Te,{className:j(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},eB=({className:e,...t})=>(0,M.jsx)(De,{align:`block-end`,className:j(`order-first flex-wrap gap-1`,e),...t}),tB=({className:e,...t})=>(0,M.jsx)(De,{align:`block-end`,className:j(`justify-between gap-1`,e),...t}),nB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex min-w-0 items-center gap-1`,e),...t}),rB=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(N.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,M.jsx)(xe,{className:j(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,l=typeof r==`string`?`top`:r.side??`top`;return(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{children:o}),(0,M.jsxs)(Ve,{side:l,children:[s,c&&(0,M.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},iB=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,M.jsx)(Ze,{className:`size-3`});r===`submitted`?l=(0,M.jsx)(We,{}):r===`streaming`?l=(0,M.jsx)(lt,{className:`size-3`}):r===`error`&&(l=(0,M.jsx)(le,{className:`size-3`}));let u=(0,N.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,M.jsx)(xe,{"aria-label":c?`Stop`:`Submit`,className:j(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})},aB=globalThis?.document?N.useLayoutEffect:()=>{},oB=Object.defineProperty,sB=(e,t)=>oB(e,`name`,{value:t,configurable:!0}),cB=N.useEffectEvent,lB=N.useInsertionEffect;function uB(e){if(typeof cB==`function`)return cB(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof lB==`function`?lB(()=>{t.current=e}):aB(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}sB(uB,`useEffectEvent`);var dB=Object.defineProperty,fB=(e,t)=>dB(e,`name`,{value:t,configurable:!0}),pB=N.useInsertionEffect||aB;function mB({prop:e,defaultProp:t,onChange:n=fB(()=>{},`onChange`),caller:r}){let[i,a,o]=hB({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=gB(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}fB(mB,`useControllableState`);function hB({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return pB(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}fB(hB,`useUncontrolledState`);function gB(e){return typeof e==`function`}fB(gB,`isFunction`);var _B=Symbol(`RADIX:SYNC_STATE`);function vB(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=uB(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===_B)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:_B,state:i})},[i,d.state,c]),[h,f]}fB(vB,`useControllableStateReducer`);function yB(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=d({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=ce(a,!0,!0),u=p(),[f,m]=N.useState(),h=f===null?void 0:f??u,g=w(e=>{let t=!a,n=oe(D,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return N.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:h,setMounted:c,setOpen:o,setPanelIdState:m,transitionStatus:l}),[u,i,g,s,a,h,c,o,m,l])}var bB=N.createContext(void 0);function xB(){let e=N.useContext(bB);if(e===void 0)throw Error(T(15));return e}var SB=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=x.startingStyle]=`startingStyle`,e[e.endingStyle=x.endingStyle]=`endingStyle`,e}({}),CB=function(e){return e.panelOpen=`data-panel-open`,e}({}),wB={[SB.open]:``},TB={[SB.closed]:``},EB={open(e){return e?{[CB.panelOpen]:``}:null}},DB={open(e){return e?wB:TB},...S},OB=N.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,d=w(o),f=yB({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),p=N.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=N.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),h=u(`div`,e,{state:p,ref:t,props:l,stateAttributesMapping:DB});return(0,M.jsx)(bB.Provider,{value:m,children:h})}),kB={...EB,...S},AB=N.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=xB(),{className:s,disabled:c=o,render:l,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=ee({disabled:c,focusableWhenDisabled:!0,native:d});return u(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:kB})}),jB={height:void 0,width:void 0};function MB(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=N.useRef(null),f=N.useRef(null),[p,m]=N.useState(jB),h=N.useRef(jB),g=N.useRef(!1),_=N.useRef(s),v=N.useRef(!1),[b,x]=N.useState(!1),S=N.useRef(null),T=ie(t,d),E=ne(s),ee=se(d),D=!s&&!a,O=b?`idle`:u,ae=s&&(_.current||v.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,ce=n&&D&&f.current!==`css-animation`,j=w((e,t=!0)=>{t&&(h.current=e),m(e)}),le=w(()=>{S.current?.(),S.current=null}),ue=w(e=>{le(),S.current=()=>{S.current=null,e()}}),de=w(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});k(()=>{!b||u===`starting`||x(!1)},[b,u]),N.useEffect(()=>()=>{de(),le()},[de,le]),k(()=>{let e=d.current;if(!e)return;!s&&S.current&&le();let t=PB(e,ae);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=NB(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(NB(e)),x(!0);return}if(t===`css-transition`){let t=LB(e);if(j(NB(e)),!n)return t;let r=IB(e,`transition-duration`,`0s`);return ue(r),x(!0),t}j(NB(e));let r=IB(e,`animation-name`,`none`);if(!n){r();return}let i=IB(e,`animation-duration`,`0s`);r(),ue(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(jB,!1),c(!1);return}j(NB(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=NB(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&IB(e,`animation-name`,`none`)()},[a,s,le,j,c,ue,ae,u]),C({enabled:s&&a&&O===`idle`,open:!0,ref:d,onComplete(){s&&j(jB,!1)}}),N.useEffect(()=>{if(s||!a||O!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){E.current||(c(!1),j(jB,!1))}return t=re.request(()=>{ee(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[E,a,s,O,ee,j,c]),k(()=>{let e=d.current;!e||!n||!D||e.setAttribute(`hidden`,`until-found`)},[D,n]),N.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=oe(y,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return te(e,`beforematch`,t)},[o,l]);let fe=i||n||a||s;return{height:A.height,props:{...ce?{[SB.startingStyle]:``}:void 0,hidden:D,id:r},ref:T,shouldPreventOpenAnimation:ae,shouldRender:fe,transitionStatus:O,width:A.width}}function NB(e){return{height:e.scrollHeight,width:e.scrollWidth}}function PB(e,t){let n=b(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&FB(n.animationDuration),i=FB(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function FB(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function IB(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function LB(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var RB=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),zB=N.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:d,onOpenChange:f,open:p,setMounted:h,setPanelIdState:g,setOpen:_,state:v,transitionStatus:y}=xB(),b=r??!1,x=i??!1,S=o||void 0,C=S??l;k(()=>(g(e=>S??(e===null?void 0:e)),()=>{g(e=>e===S?null:e)}),[S,g]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:ee,shouldRender:D,transitionStatus:te,width:O}=MB({externalRef:t,hiddenUntilFound:b,id:C,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:h,setOpen:_,transitionStatus:y}),ne={...v,transitionStatus:te},re=m(s,ne),ie=u(`div`,{...e,style:void 0},{state:ne,ref:E,props:[T,{style:{[RB.collapsiblePanelHeight]:w===void 0?`auto`:`${w}px`,[RB.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c,re?{style:re}:void 0,ee?{style:{animationName:`none`}}:void 0],stateAttributesMapping:DB});return D?ie:null});function BB({...e}){return(0,M.jsx)(OB,{"data-slot":`collapsible`,...e})}function VB({...e}){return(0,M.jsx)(AB,{"data-slot":`collapsible-trigger`,...e})}function HB({...e}){return(0,M.jsx)(zB,{"data-slot":`collapsible-content`,...e})}var UB=(0,N.createContext)({});function WB(e){let t=(0,N.useRef)(null);return t.current===null&&(t.current=e()),t.current}var GB=typeof window<`u`?N.useLayoutEffect:N.useEffect,KB=(0,N.createContext)(null);function qB(e,t){e.indexOf(t)===-1&&e.push(t)}function JB(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var YB=(e,t,n)=>n>t?t:n<e?e:n,XB={},ZB=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QB=e=>typeof e==`object`&&!!e,$B=e=>/^0[^.\s]+$/u.test(e);function eV(e){let t;return()=>(t===void 0&&(t=e()),t)}var tV=e=>e,nV=(...e)=>e.reduce((e,t)=>n=>t(e(n))),rV=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},iV=class{constructor(){this.subscriptions=[]}add(e){return qB(this.subscriptions,e),()=>JB(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},aV=e=>e*1e3,oV=e=>e/1e3,sV=(e,t)=>t?1e3/t*e:0,cV=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lV=1e-7,uV=12;function dV(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=cV(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>lV&&++s<uV);return o}function fV(e,t,n,r){if(e===t&&n===r)return tV;let i=t=>dV(t,0,1,e,n);return e=>e===0||e===1?e:cV(i(e),t,r)}var pV=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mV=e=>t=>1-e(1-t),hV=fV(.33,1.53,.69,.99),gV=mV(hV),_V=pV(gV),vV=e=>e>=1?1:(e*=2)<1?.5*gV(e):.5*(2-2**(-10*(e-1))),yV=e=>1-Math.sin(Math.acos(e)),bV=mV(yV),xV=pV(yV),SV=fV(.42,0,1,1),CV=fV(0,0,.58,1),wV=fV(.42,0,.58,1),TV=e=>Array.isArray(e)&&typeof e[0]!=`number`,EV=e=>Array.isArray(e)&&typeof e[0]==`number`,DV={linear:tV,easeIn:SV,easeInOut:wV,easeOut:CV,circIn:yV,circInOut:xV,circOut:bV,backIn:gV,backInOut:_V,backOut:hV,anticipate:vV},OV=e=>typeof e==`string`,kV=e=>{if(EV(e)){e.length;let[t,n,r,i]=e;return fV(t,n,r,i)}return OV(e)?(DV[e],`${e}`,DV[e]):e},AV=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function jV(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var MV=40;function NV(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=AV.reduce((e,t)=>(e[t]=jV(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=XB.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,MV),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:AV.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<AV.length;t++)o[AV[t]].cancel(e)},state:i,steps:o}}var{schedule:PV,cancel:FV,state:IV,steps:LV}=NV(typeof requestAnimationFrame<`u`?requestAnimationFrame:tV,!0),RV;function zV(){RV=void 0}var BV={now:()=>(RV===void 0&&BV.set(IV.isProcessing||XB.useManualTiming?IV.timestamp:performance.now()),RV),set:e=>{RV=e,queueMicrotask(zV)}},VV=e=>t=>typeof t==`string`&&t.startsWith(e),HV=VV(`--`),UV=VV(`var(--`),WV=e=>UV(e)?GV.test(e.split(`/*`)[0].trim()):!1,GV=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function KV(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var qV={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},JV={...qV,transform:e=>YB(0,1,e)},YV={...qV,default:1},XV=e=>Math.round(e*1e5)/1e5,ZV=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QV(e){return e==null}var $V=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,eH=(e,t)=>n=>!!(typeof n==`string`&&$V.test(n)&&n.startsWith(e)||t&&!QV(n)&&Object.prototype.hasOwnProperty.call(n,t)),tH=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ZV);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},nH=e=>YB(0,255,e),rH={...qV,transform:e=>Math.round(nH(e))},iH={test:eH(`rgb`,`red`),parse:tH(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+rH.transform(e)+`, `+rH.transform(t)+`, `+rH.transform(n)+`, `+XV(JV.transform(r))+`)`};function aH(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var oH={test:eH(`#`),parse:aH,transform:iH.transform},sH=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cH=sH(`deg`),lH=sH(`%`),Q=sH(`px`),uH=sH(`vh`),dH=sH(`vw`),fH={...lH,parse:e=>lH.parse(e)/100,transform:e=>lH.transform(e*100)},pH={test:eH(`hsl`,`hue`),parse:tH(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+lH.transform(XV(t))+`, `+lH.transform(XV(n))+`, `+XV(JV.transform(r))+`)`},mH={test:e=>iH.test(e)||oH.test(e)||pH.test(e),parse:e=>iH.test(e)?iH.parse(e):pH.test(e)?pH.parse(e):oH.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?iH.transform(e):pH.transform(e),getAnimatableNone:e=>{let t=mH.parse(e);return t.alpha=0,mH.transform(t)}},hH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gH(e){return isNaN(e)&&typeof e==`string`&&(e.match(ZV)?.length||0)+(e.match(hH)?.length||0)>0}var _H=`number`,vH=`color`,yH=`var`,bH=`var(`,xH="${}",SH=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function CH(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(SH,e=>(mH.test(e)?(r.color.push(a),i.push(vH),n.push(mH.parse(e))):e.startsWith(bH)?(r.var.push(a),i.push(yH),n.push(e)):(r.number.push(a),i.push(_H),n.push(parseFloat(e))),++a,xH)).split(xH),indexes:r,types:i}}function wH(e){return CH(e).values}function TH({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===_H?XV(r[a]):e===vH?mH.transform(r[a]):r[a]}return i}}function EH(e){return TH(CH(e))}var DH=e=>typeof e==`number`?0:mH.test(e)?mH.getAnimatableNone(e):e,OH=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:DH(e);function kH(e){let t=CH(e);return TH(t)(t.values.map((e,n)=>OH(e,t.split[n])))}var AH={test:gH,parse:wH,createTransformer:EH,getAnimatableNone:kH};function jH(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function MH({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=jH(s,r,e+1/3),a=jH(s,r,e),o=jH(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function NH(e,t){return n=>n>0?t:e}var PH=(e,t,n)=>e+(t-e)*n,FH=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},IH=[oH,iH,pH],LH=e=>IH.find(t=>t.test(e));function RH(e){let t=LH(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===pH&&(n=MH(n)),n}var zH=(e,t)=>{let n=RH(e),r=RH(t);if(!n||!r)return NH(e,t);let i={...n};return e=>(i.red=FH(n.red,r.red,e),i.green=FH(n.green,r.green,e),i.blue=FH(n.blue,r.blue,e),i.alpha=PH(n.alpha,r.alpha,e),iH.transform(i))},BH=new Set([`none`,`hidden`]);function VH(e,t){return BH.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function HH(e,t){return n=>PH(e,t,n)}function UH(e){return typeof e==`number`?HH:typeof e==`string`?WV(e)?NH:mH.test(e)?zH:qH:Array.isArray(e)?WH:typeof e==`object`?mH.test(e)?zH:GH:NH}function WH(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>UH(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function GH(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=UH(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function KH(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var qH=(e,t)=>{let n=AH.createTransformer(t),r=CH(e),i=CH(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?BH.has(e)&&!i.values.length||BH.has(t)&&!r.values.length?VH(e,t):nV(WH(KH(r,i),i.values),n):(`${e}${t}`,NH(e,t))};function JH(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?PH(e,t,n):UH(e)(e,t)}var YH=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>PV.update(t,e),stop:()=>FV(t),now:()=>IV.isProcessing?IV.timestamp:BV.now()}},XH=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},ZH=2e4;function QH(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function $H(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(QH(r),ZH);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:oV(i)}}var eU={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function tU(e,t){return e*Math.sqrt(1-t*t)}var nU=12;function rU(e,t,n){let r=n;for(let n=1;n<nU;n++)r-=e(r)/t(r);return r}var iU=.001;function aU({duration:e=eU.duration,bounce:t=eU.bounce,velocity:n=eU.velocity,mass:r=eU.mass}){let i,a;eU.maxDuration;let o=1-t;o=YB(eU.minDamping,eU.maxDamping,o),e=YB(eU.minDuration,eU.maxDuration,oV(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=tU(t,o),c=Math.exp(-i);return iU-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=tU(t**2,o);return(-i(t)+iU>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=rU(i,a,s);if(e=aV(e),isNaN(c))return{stiffness:eU.stiffness,damping:eU.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var oU=[`duration`,`bounce`],sU=[`stiffness`,`damping`,`mass`];function cU(e,t){return t.some(t=>e[t]!==void 0)}function lU(e){let t={velocity:eU.velocity,stiffness:eU.stiffness,damping:eU.damping,mass:eU.mass,isResolvedFromDuration:!1,...e};if(!cU(e,sU)&&cU(e,oU)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*YB(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:eU.mass,stiffness:i,damping:a}}else{let n=aU({...e,velocity:0});t={...t,...n,mass:eU.mass},t.isResolvedFromDuration=!0}}return t}function uU(e=eU.visualDuration,t=eU.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=lU({...n,velocity:-oV(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=oV(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?eU.restSpeed.granular:eU.restSpeed.default,i||=v?eU.restDelta.granular:eU.restDelta.default;let y,b,x,S,C,w;if(h<1)x=tU(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>aV(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=aV(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=aV(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(QH(T),ZH),t=XH(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}uU.applyToOptions=e=>{let t=$H(e,100,uU);return e.ease=t.ease,e.duration=aV(t.duration),e.type=`keyframes`,e};var dU=5;function fU(e,t,n){let r=Math.max(t-dU,0);return sV(n-e(r),t-r)}function pU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=uU({keyframes:[f.value,m(f.value)],velocity:fU(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function mU(e,t,n){let r=[],i=n||XB.mix||JH,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=nV(Array.isArray(t)?t[n]||tV:t,a)),r.push(a)}return r}function hU(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=mU(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=rV(e[r],e[r+1],n);return s[r](i)};return n?t=>l(YB(e[0],e[a-1],t)):l}function gU(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=rV(0,t,r);e.push(PH(n,1,i))}}function _U(e){let t=[0];return gU(t,e.length-1),t}function vU(e,t){return e.map(e=>e*t)}function yU(e,t){return e.map(()=>t||wV).splice(0,e.length-1)}function bU({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=TV(r)?r.map(kV):kV(r),a={done:!1,value:t[0]},o=hU(vU(n&&n.length===t.length?n:_U(t),e),t,{ease:Array.isArray(i)?i:yU(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var xU=e=>e!==null;function SU(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(xU),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var CU={decay:pU,inertia:pU,tween:bU,keyframes:bU,spring:uU};function wU(e){typeof e.type==`string`&&(e.type=CU[e.type])}var TU=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},EU=e=>e/100,DU=class extends TU{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==BV.now()&&this.tick(BV.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;wU(e);let{type:t=bU,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||bU;s!==bU&&typeof o[0]!=`number`&&(this.mixKeyframes=nV(EU,JH(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=QH(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=YB(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==pU&&(b.value=SU(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return oV(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+oV(e)}get time(){return oV(this.currentTime)}set time(e){e=aV(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return fU(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(BV.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=oV(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=YH,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(BV.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function OU(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var kU=e=>e*180/Math.PI,AU=e=>MU(kU(Math.atan2(e[1],e[0]))),jU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:AU,rotateZ:AU,skewX:e=>kU(Math.atan(e[1])),skewY:e=>kU(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},MU=e=>(e%=360,e<0&&(e+=360),e),NU=AU,PU=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),FU=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),IU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:PU,scaleY:FU,scale:e=>(PU(e)+FU(e))/2,rotateX:e=>MU(kU(Math.atan2(e[6],e[5]))),rotateY:e=>MU(kU(Math.atan2(-e[2],e[0]))),rotateZ:NU,rotate:NU,skewX:e=>kU(Math.atan(e[4])),skewY:e=>kU(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function LU(e){return+!!e.includes(`scale`)}function RU(e,t){if(!e||e===`none`)return LU(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=IU,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=jU,i=t}if(!i)return LU(t);let a=r[t],o=i[1].split(`,`).map(BU);return typeof a==`function`?a(o):o[a]}var zU=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return RU(n,t)};function BU(e){return parseFloat(e.trim())}var VU=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],HU=new Set([...VU,`pathRotation`]),UU=e=>e===qV||e===Q,WU=new Set([`x`,`y`,`z`]),GU=VU.filter(e=>!WU.has(e));function KU(e){let t=[];return GU.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var qU={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>RU(t,`x`),y:(e,{transform:t})=>RU(t,`y`)};qU.translateX=qU.x,qU.translateY=qU.y;var JU=new Set,YU=!1,XU=!1,ZU=!1;function QU(){if(XU){let e=Array.from(JU).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=KU(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}XU=!1,YU=!1,JU.forEach(e=>e.complete(ZU)),JU.clear()}function $U(){JU.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(XU=!0)})}function eW(){ZU=!0,$U(),QU(),ZU=!1}var tW=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(JU.add(this),YU||(YU=!0,PV.read($U),PV.resolveKeyframes(QU))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}OU(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),JU.delete(this)}cancel(){this.state===`scheduled`&&(JU.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},nW=e=>e.startsWith(`--`);function rW(e,t,n){nW(t)?e.style.setProperty(t,n):e.style[t]=n}var iW={};function aW(e,t){let n=eV(e);return()=>iW[t]??n()}var oW=aW(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),sW=aW(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),cW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,lW={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:cW([0,.65,.55,1]),circOut:cW([.55,0,1,.45]),backIn:cW([.31,.01,.66,-.59]),backOut:cW([.33,1.53,.69,.99])};function uW(e,t){if(e)return typeof e==`function`?sW()?XH(e,t):`ease-out`:EV(e)?cW(e):Array.isArray(e)?e.map(e=>uW(e,t)||lW.easeOut):lW[e]}function dW(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=uW(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function fW(e){return typeof e==`function`&&`applyToOptions`in e}function pW({type:e,...t}){return fW(e)&&sW()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var mW=class extends TU{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=pW(e);this.animation=dW(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=SU(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),rW(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return oV(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+oV(e)}get time(){return oV(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aV(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&oW()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),tV):r(this)}},hW={anticipate:vV,backInOut:_V,circInOut:xV};function gW(e){return e in hW}function _W(e){typeof e.ease==`string`&&gW(e.ease)&&(e.ease=hW[e.ease])}var vW=10,yW=class extends mW{constructor(e){_W(e),wU(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new DU({...a,autoplay:!1}),s=Math.max(vW,BV.now()-this.startTime),c=YB(0,vW,s-vW),l=o.sample(s).value,{name:u}=this.options;i&&u&&rW(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},bW=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(AH.test(e)||e===`0`)&&!e.startsWith(`url(`));function xW(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function SW(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=bW(i,t),s=bW(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:xW(e)||(n===`spring`||fW(n))&&r}function CW(e){e.duration=0,e.type=`keyframes`}var wW=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),TW=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function EW(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&TW.test(e[t]))return!0;return!1}var DW=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),OW=eV(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function kW(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return OW()&&n&&(wW.has(n)||DW.has(n)&&EW(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var AW=40,jW=class extends TU{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=BV.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||tW;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=BV.now();let u=!0;SW(e,i,a,o)||(u=!1,(XB.instantAnimations||!s)&&l?.(SU(e,n,t)),e[0]=e[e.length-1],CW(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>AW?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&kW(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new yW({...d,element:p})}catch{m=new DU(d)}else m=new DU(d);m.finished.then(()=>{this.notifyFinished()}).catch(tV),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),eW()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function MW(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var NW=30,PW=e=>!isNaN(parseFloat(e)),FW={current:void 0},IW=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=BV.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=BV.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=PW(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new iV);let n=this.events[e].add(t);return e===`change`?()=>{n(),PV.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return FW.current&&FW.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=BV.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>NW)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,NW);return sV(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function LW(e,t){return new IW(e,t)}function RW(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function zW(e,t){let n=e?.[t]??e?.default??e;return n===e?n:RW(n,e)}var BW={type:`spring`,stiffness:500,damping:25,restSpeed:10},VW=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),HW={type:`keyframes`,duration:.8},UW={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},WW=(e,{keyframes:t})=>t.length>2?HW:HU.has(e)?e.startsWith(`scale`)?VW(t[1]):BW:UW,GW=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function KW(e){for(let t in e)if(!GW.has(t))return!0;return!1}var qW=(e,t,n,r={},i,a)=>o=>{let s=zW(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=aV(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};KW(s)||Object.assign(u,WW(e,u)),u.duration&&=aV(u.duration),u.repeatDelay&&=aV(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(CW(u),u.delay===0&&(d=!0)),(XB.instantAnimations||XB.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,CW(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=SU(u.keyframes,s);if(e!==void 0){PV.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new DU(u):new jW(u)},JW=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function YW(e){let t=JW.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function XW(e,t,n=1){`${e}`;let[r,i]=YW(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ZB(e)?parseFloat(e):e}return WV(i)?XW(i,t,n+1):i}function ZW(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function QW(e,t,n,r){if(typeof t==`function`){let[i,a]=ZW(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=ZW(r);t=t(n===void 0?e.custom:n,i,a)}return t}function $W(e,t,n){let r=e.getProps();return QW(r,t,n===void 0?r.custom:n,e)}var eG=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...VU]),tG=e=>Array.isArray(e);function nG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,LW(n))}function rG(e){return tG(e)?e[e.length-1]||0:e}function iG(e,t){let{transitionEnd:n={},transition:r={},...i}=$W(e,t)||{};i={...i,...n};for(let t in i)nG(e,t,rG(i[t]))}var aG=e=>!!(e&&e.getVelocity);function oG(e){return!!(aG(e)&&e.add)}function sG(e,t){let n=e.getValue(`willChange`);if(oG(n))return n.add(t);if(!n&&XB.WillChange){let n=new XB.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function cG(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var lG=`data-`+cG(`framerAppearId`);function uG(e){return e.props[lG]}function dG({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function fG(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?RW(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&dG(f,t))continue;let o={delay:n,...zW(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){PV.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=uG(e);if(n){let e=window.MotionHandoffAnimation(n,t,PV);e!==null&&(o.startTime=e,p=!0)}}sG(e,t);let m=l??e.shouldReduceMotion;r.start(qW(t,r,i,m&&eG.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>PV.update(()=>{o&&iG(e,o)});d.length?Promise.all(d).then(t):t()}return d}function pG(e,t,n={}){let r=$W(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(fG(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return mG(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function mG(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(pG(c,t,{...o,delay:n+(typeof r==`function`?0:r)+MW(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function hG(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>pG(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=pG(e,t,n);else{let i=typeof t==`function`?$W(e,t,n.custom):t;r=Promise.all(fG(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var gG={test:e=>e===`auto`,parse:e=>e},_G=e=>t=>t.test(e),vG=[qV,Q,lH,cH,dH,uH,gG],yG=e=>vG.find(_G(e));function bG(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||$B(e)}var xG=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function SG(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ZV)||[];if(!r)return e;let i=n.replace(r,``),a=+!!xG.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var CG=/\b([a-z-]*)\(.*?\)/gu,wG={...AH,getAnimatableNone:e=>{let t=e.match(CG);return t?t.map(SG).join(` `):e}},TG={...AH,getAnimatableNone:e=>{let t=AH.parse(e);return AH.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},EG={...qV,transform:Math.round},DG={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,rotate:cH,pathRotation:cH,rotateX:cH,rotateY:cH,rotateZ:cH,scale:YV,scaleX:YV,scaleY:YV,scaleZ:YV,skew:cH,skewX:cH,skewY:cH,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:JV,originX:fH,originY:fH,originZ:Q,zIndex:EG,fillOpacity:JV,strokeOpacity:JV,numOctaves:EG},OG={...DG,color:mH,backgroundColor:mH,outlineColor:mH,fill:mH,stroke:mH,borderColor:mH,borderTopColor:mH,borderRightColor:mH,borderBottomColor:mH,borderLeftColor:mH,filter:wG,WebkitFilter:wG,mask:TG,WebkitMask:TG},kG=e=>OG[e],AG=new Set([wG,TG]);function jG(e,t){let n=kG(e);return AG.has(n)||(n=AH),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var MG=new Set([`auto`,`none`,`0`]);function NG(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!MG.has(t)&&CH(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=jG(n,i)}var PG=class extends tW{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),WV(r))){let i=XW(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!eG.has(n)||e.length!==2)return;let[r,i]=e,a=yG(r),o=yG(i);if(KV(r)!==KV(i)&&qU[n]){this.needsMeasurement=!0;return}if(a!==o){if(UU(a)&&UU(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else qU[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||bG(e[t]))&&n.push(t);n.length&&NG(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=qU[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=qU[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},FG=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function IG(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var LG=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function RG(e){return QB(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:zG,cancel:BG}=NV(queueMicrotask,!1),VG={x:!1,y:!1};function HG(){return VG.x||VG.y}function UG(e){return e===`x`||e===`y`?VG[e]?null:(VG[e]=!0,()=>{VG[e]=!1}):VG.x||VG.y?null:(VG.x=VG.y=!0,()=>{VG.x=VG.y=!1})}function WG(e,t){let n=IG(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function GG(e){return!(e.pointerType===`touch`||HG())}function KG(e,t,n={}){let[r,i,a]=WG(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!GG(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var qG=(e,t)=>t?e===t||qG(e,t.parentElement):!1,JG=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,YG=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function XG(e){return YG.has(e.tagName)||e.isContentEditable===!0}var ZG=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function QG(e){return ZG.has(e.tagName)||e.isContentEditable===!0}var $G=new WeakSet;function eK(e){return t=>{t.key===`Enter`&&e(t)}}function tK(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var nK=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=eK(()=>{if($G.has(n))return;tK(n,`down`);let e=eK(()=>{tK(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>tK(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function rK(e){return JG(e)&&!HG()}var iK=new WeakSet;function aK(e,t,n={}){let[r,i,a]=WG(e,n),o=e=>{let r=e.currentTarget;if(!rK(e)||iK.has(e))return;$G.add(r),n.stopPropagation&&iK.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),$G.has(r)&&$G.delete(r),rK(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||qG(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),RG(e)&&(e.addEventListener(`focus`,e=>nK(e,i)),!XG(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function oK(e){return QB(e)&&`ownerSVGElement`in e}var sK=new WeakMap,cK,lK=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:oK(r)&&`getBBox`in r?r.getBBox()[t]:r[n],uK=lK(`inline`,`width`,`offsetWidth`),dK=lK(`block`,`height`,`offsetHeight`);function fK({target:e,borderBoxSize:t}){sK.get(e)?.forEach(n=>{n(e,{get width(){return uK(e,t)},get height(){return dK(e,t)}})})}function pK(e){e.forEach(fK)}function mK(){typeof ResizeObserver>`u`||(cK=new ResizeObserver(pK))}function hK(e,t){cK||mK();let n=IG(e);return n.forEach(e=>{let n=sK.get(e);n||(n=new Set,sK.set(e,n)),n.add(t),cK?.observe(e)}),()=>{n.forEach(e=>{let n=sK.get(e);n?.delete(t),n?.size||cK?.unobserve(e)})}}var gK=new Set,_K;function vK(){_K=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};gK.forEach(t=>t(e))},window.addEventListener(`resize`,_K)}function yK(e){return gK.add(e),_K||vK(),()=>{gK.delete(e),!gK.size&&typeof _K==`function`&&(window.removeEventListener(`resize`,_K),_K=void 0)}}function bK(e,t){return typeof e==`function`?yK(e):hK(e,t)}var xK={value:null,addProjectionMetrics:null};function SK(e){return oK(e)&&e.tagName===`svg`}var CK=[...vG,mH,AH],wK=e=>CK.find(_G(e)),TK=()=>({translate:0,scale:1,origin:0,originPoint:0}),EK=()=>({x:TK(),y:TK()}),DK=()=>({min:0,max:0}),OK=()=>({x:DK(),y:DK()}),kK=new WeakMap;function AK(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function jK(e){return typeof e==`string`||Array.isArray(e)}var MK=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],NK=[`initial`,...MK];function PK(e){return AK(e.animate)||NK.some(t=>jK(e[t]))}function FK(e){return!!(PK(e)||e.variants)}function IK(e,t,n){for(let r in t){let i=t[r],a=n[r];if(aG(i))e.addValue(r,i);else if(aG(a))e.addValue(r,LW(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,LW(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var LK={current:null},RK={current:!1},zK=typeof window<`u`;function BK(){if(RK.current=!0,zK){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>LK.current=e.matches;e.addEventListener(`change`,t),t()}else LK.current=!1}}var VK=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],HK={};function UK(e){HK=e}function WK(){return HK}var GK=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=tW,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=BV.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,PV.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=PK(t),this.isVariantNode=FK(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&aG(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,kK.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(RK.current||BK(),this.shouldReduceMotion=LK.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),FV(this.notifyUpdate),FV(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&wW.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new mW({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:aV(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=HU.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&PV.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in HK){let t=HK[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):OK()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<VK.length;t++){let n=VK[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=IK(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=LW(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ZB(n)||$B(n))?n=parseFloat(n):!wK(n)&&AH.test(t)&&(n=jG(e,t)),this.setBaseTarget(e,aG(n)?n.get():n)),aG(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=QW(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!aG(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new iV),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){zG.render(this.render)}},KK=class extends GK{constructor(){super(...arguments),this.KeyframeResolver=PG}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;aG(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},qK=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function JK({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function YK({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function XK(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ZK(e){return e===void 0||e===1}function QK({scale:e,scaleX:t,scaleY:n}){return!ZK(e)||!ZK(t)||!ZK(n)}function $K(e){return QK(e)||eq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function eq(e){return tq(e.x)||tq(e.y)}function tq(e){return e&&e!==`0%`}function nq(e,t,n){return n+t*(e-n)}function rq(e,t,n,r,i){return i!==void 0&&(e=nq(e,i,r)),nq(e,n,r)+t}function iq(e,t=0,n=1,r,i){e.min=rq(e.min,t,n,r,i),e.max=rq(e.max,t,n,r,i)}function aq(e,{x:t,y:n}){iq(e.x,t.translate,t.scale,t.originPoint),iq(e.y,n.translate,n.scale,n.originPoint)}var oq=.999999999999,sq=1.0000000000001;function cq(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(lq(e.x,-a.scroll.offset.x),lq(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,aq(e,o)),r&&$K(a.latestValues)&&fq(e,a.latestValues,a.layout?.layoutBox))}t.x<sq&&t.x>oq&&(t.x=1),t.y<sq&&t.y>oq&&(t.y=1)}function lq(e,t){e.min+=t,e.max+=t}function uq(e,t,n,r,i=.5){iq(e,t,n,PH(e.min,e.max,i),r)}function dq(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function fq(e,t,n){let r=n??e;uq(e.x,dq(t.x,r.x),t.scaleX,t.scale,t.originX),uq(e.y,dq(t.y,r.y),t.scaleY,t.scale,t.originY)}function pq(e,t){return JK(XK(e.getBoundingClientRect(),t))}function mq(e,t,n){let r=pq(e,n),{scroll:i}=t;return i&&(lq(r.x,i.offset.x),lq(r.y,i.offset.y)),r}var hq={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},gq=VU.length;function _q(e,t,n){let r=``,i=!0;for(let a=0;a<gq;a++){let o=VU[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=LG(s,DG[o]);if(!c){i=!1;let t=hq[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${LG(a,DG.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function vq(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(HU.has(e)){o=!0;continue}if(HV(e)){i[e]=n;continue}{let t=LG(n,DG[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=_q(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function yq(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function bq(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var xq={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Q.test(e))e=parseFloat(e);else return e}return`${bq(e,t.target.x)}% ${bq(e,t.target.y)}%`}},Sq={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=AH.parse(e);if(i.length>5)return r;let a=AH.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=PH(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Cq={borderRadius:{...xq,applyTo:[...FG]},borderTopLeftRadius:xq,borderTopRightRadius:xq,borderBottomLeftRadius:xq,borderBottomRightRadius:xq,boxShadow:Sq};function wq(e,{layout:t,layoutId:n}){return HU.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Cq[e]||e===`opacity`)}function Tq(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(aG(r[t])||i&&aG(i[t])||wq(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Eq(e){return window.getComputedStyle(e)}var Dq=class extends KK{constructor(){super(...arguments),this.type=`html`,this.renderInstance=yq}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(HU.has(t))return this.projection?.isProjecting?LU(t):zU(e,t);{let n=Eq(e),r=(HV(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return pq(e,t)}build(e,t,n){vq(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Tq(e,t,n)}},Oq={offset:`stroke-dashoffset`,array:`stroke-dasharray`},kq={offset:`strokeDashoffset`,array:`strokeDasharray`};function Aq(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Oq:kq;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var jq=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Mq(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(vq(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of jq)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Aq(d,i,a,o,!1)}var Nq=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Pq=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Fq(e,t,n,r){yq(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Nq.has(n)?n:cG(n),t.attrs[n])}function Iq(e,t,n){let r=Tq(e,t,n);for(let n in e)if(aG(e[n])||aG(t[n])){let t=VU.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Lq=class extends KK{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=OK}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(HU.has(t)){let e=kG(t);return e&&e.default||0}return t=Nq.has(t)?t:cG(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Iq(e,t,n)}build(e,t,n){Mq(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Fq(e,t,n,r)}mount(e){this.isSVGTag=Pq(e.tagName),super.mount(e)}},Rq=NK.length;function zq(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&zq(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Rq;n++){let r=NK[n],i=e.props[r];(jK(i)||i===!1)&&(t[r]=i)}return t}function Bq(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Vq=[...MK].reverse(),Hq=MK.length;function Uq(e){return t=>Promise.all(t.map(({animation:t,options:n})=>hG(e,t,n)))}function Wq(e){let t=Uq(e),n=qq(),r=!0,i=!1,a=t=>(n,r)=>{let i=$W(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=zq(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Hq;t++){let p=Vq[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=jK(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||AK(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Gq(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=tG(t)&&tG(n)?!Bq(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ee=v&&y;b&&(!ee||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ee&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=$W(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=MW(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=$W(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qq(),i=!0}}}function Gq(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Bq(t,e):!1}function Kq(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qq(){return{animate:Kq(!0),whileInView:Kq(),whileHover:Kq(),whileTap:Kq(),whileDrag:Kq(),whileFocus:Kq(),exit:Kq()}}function Jq(e,t){e.min=t.min,e.max=t.max}function Yq(e,t){Jq(e.x,t.x),Jq(e.y,t.y)}function Xq(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Zq=.9999,Qq=1.0001,$q=-.01,eJ=.01;function tJ(e){return e.max-e.min}function nJ(e,t,n){return Math.abs(e-t)<=n}function rJ(e,t,n,r=.5){e.origin=r,e.originPoint=PH(t.min,t.max,e.origin),e.scale=tJ(n)/tJ(t),e.translate=PH(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zq&&e.scale<=Qq||isNaN(e.scale))&&(e.scale=1),(e.translate>=$q&&e.translate<=eJ||isNaN(e.translate))&&(e.translate=0)}function iJ(e,t,n,r){rJ(e.x,t.x,n.x,r?r.originX:void 0),rJ(e.y,t.y,n.y,r?r.originY:void 0)}function aJ(e,t,n,r=0){e.min=(r?PH(n.min,n.max,r):n.min)+t.min,e.max=e.min+tJ(t)}function oJ(e,t,n,r){aJ(e.x,t.x,n.x,r?.x),aJ(e.y,t.y,n.y,r?.y)}function sJ(e,t,n,r=0){let i=r?PH(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+tJ(t)}function cJ(e,t,n,r){sJ(e.x,t.x,n.x,r?.x),sJ(e.y,t.y,n.y,r?.y)}function lJ(e,t,n,r,i){return e-=t,e=nq(e,1/n,r),i!==void 0&&(e=nq(e,1/i,r)),e}function uJ(e,t=0,n=1,r=.5,i,a=e,o=e){if(lH.test(t)&&(t=parseFloat(t),t=PH(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=PH(a.min,a.max,r);e===a&&(s-=t),e.min=lJ(e.min,t,n,s,i),e.max=lJ(e.max,t,n,s,i)}function dJ(e,t,[n,r,i],a,o){uJ(e,t[n],t[r],t[i],t.scale,a,o)}var fJ=[`x`,`scaleX`,`originX`],pJ=[`y`,`scaleY`,`originY`];function mJ(e,t,n,r){dJ(e.x,t,fJ,n?n.x:void 0,r?r.x:void 0),dJ(e.y,t,pJ,n?n.y:void 0,r?r.y:void 0)}function hJ(e){return e.translate===0&&e.scale===1}function gJ(e){return hJ(e.x)&&hJ(e.y)}function _J(e,t){return e.min===t.min&&e.max===t.max}function vJ(e,t){return _J(e.x,t.x)&&_J(e.y,t.y)}function yJ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bJ(e,t){return yJ(e.x,t.x)&&yJ(e.y,t.y)}function xJ(e){return tJ(e.x)/tJ(e.y)}function SJ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function CJ(e){return[e(`x`),e(`y`)]}function wJ(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var TJ=FG.length,EJ=e=>typeof e==`string`?parseFloat(e):e,DJ=e=>typeof e==`number`||Q.test(e);function OJ(e,t,n,r,i,a){i?(e.opacity=PH(0,n.opacity??1,AJ(r)),e.opacityExit=PH(t.opacity??1,0,jJ(r))):a&&(e.opacity=PH(t.opacity??1,n.opacity??1,r));for(let i=0;i<TJ;i++){let a=FG[i],o=kJ(t,a),s=kJ(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||DJ(o)===DJ(s)?(e[a]=Math.max(PH(EJ(o),EJ(s),r),0),(lH.test(s)||lH.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=PH(t.rotate||0,n.rotate||0,r))}function kJ(e,t){return e[t]===void 0?e.borderRadius:e[t]}var AJ=MJ(0,.5,bV),jJ=MJ(.5,.95,tV);function MJ(e,t,n){return r=>r<e?0:r>t?1:n(rV(e,t,r))}function NJ(e,t,n){let r=aG(e)?e:LW(e);return r.start(qW(``,r,t,n)),r.animation}function PJ(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var FJ=(e,t)=>e.depth-t.depth,IJ=class{constructor(){this.children=[],this.isDirty=!1}add(e){qB(this.children,e),this.isDirty=!0}remove(e){JB(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(FJ),this.isDirty=!1,this.children.forEach(e)}};function LJ(e,t){let n=BV.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(FV(r),e(a-t))};return PV.setup(r,!0),()=>FV(r)}function RJ(e){return aG(e)?e.get():e}var zJ=class{constructor(){this.members=[]}add(e){qB(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(JB(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(JB(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},BJ={hasAnimatedSinceResize:!0,hasEverUpdated:!1},VJ={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},HJ=[``,`X`,`Y`,`Z`],UJ=1e3,WJ=0;function GJ(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function KJ(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=uG(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,PV,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&KJ(r)}function qJ({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=WJ++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,xK.value&&(VJ.nodes=VJ.calculatedTargetDeltas=VJ.calculatedProjections=0),this.nodes.forEach(XJ),this.nodes.forEach(aY),this.nodes.forEach(oY),this.nodes.forEach(ZJ),xK.addProjectionMetrics&&xK.addProjectionMetrics(VJ)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new IJ)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new iV),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=oK(t)&&!SK(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;PV.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=LJ(i,250),BJ.hasAnimatedSinceResize&&(BJ.hasAnimatedSinceResize=!1,this.nodes.forEach(iY)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||pY,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!bJ(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...zW(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||iY(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),FV(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(sY),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&KJ(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(eY),this.nodes.forEach($J);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tY);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nY),this.nodes.forEach(rY),this.nodes.forEach(JJ),this.nodes.forEach(YJ)):this.nodes.forEach(tY),this.clearAllSnapshots();let e=BV.now();IV.delta=YB(0,1e3/60,e-IV.timestamp),IV.timestamp=e,IV.isProcessing=!0,LV.update.process(IV),LV.preRender.process(IV),LV.render.process(IV),IV.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zG.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(QJ),this.sharedNodes.forEach(cY)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,PV.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){PV.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!tJ(this.snapshot.measuredBox.x)&&!tJ(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=OK(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!gJ(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||$K(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),_Y(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return OK();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(yY))){let{scroll:e}=this.root;e&&(lq(t.x,e.offset.x),lq(t.y,e.offset.y))}return t}removeElementScroll(e){let t=OK();if(Yq(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Yq(t,e),lq(t.x,i.offset.x),lq(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||OK();Yq(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(lq(r.x,-n.scroll.offset.x),lq(r.y,-n.scroll.offset.y)),$K(n.latestValues)&&fq(r,n.latestValues,n.layout?.layoutBox)}return $K(this.latestValues)&&fq(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=OK();Yq(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!$K(n.latestValues))continue;let r;n.instance&&(QK(n.latestValues)&&n.updateSnapshot(),r=OK(),Yq(r,n.measurePageBox())),mJ(t,n.latestValues,n.snapshot?.layoutBox,r)}return $K(this.latestValues)&&mJ(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==IV.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=IV.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=OK(),this.targetWithTransforms=OK()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Yq(this.target,this.layout.layoutBox),aq(this.target,this.targetDelta)):Yq(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),xK.value&&VJ.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||QK(this.parent.latestValues)||eq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=OK(),this.relativeTargetOrigin=OK(),cJ(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Yq(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===IV.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Yq(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;cq(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=OK());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Xq(this.prevProjectionDelta.x,this.projectionDelta.x),Xq(this.prevProjectionDelta.y,this.projectionDelta.y)),iJ(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!SJ(this.projectionDelta.x,this.prevProjectionDelta.x)||!SJ(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),xK.value&&VJ.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=EK(),this.projectionDelta=EK(),this.projectionDeltaWithTransform=EK()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=EK();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=OK(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(fY));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=PH(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=PH(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(lY(o.x,e.x,n),lY(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cJ(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),dY(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&vJ(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=OK(),Yq(f,this.relativeTarget)),c&&(this.animationValues=a,OJ(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(FV(this.pendingAnimation),void 0),this.pendingAnimation=PV.update(()=>{BJ.hasAnimatedSinceResize=!0,this.motionValue||=LW(0),this.motionValue.jump(0,!1),this.currentAnimation=NJ(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(UJ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&vY(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||OK();let t=tJ(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=tJ(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Yq(t,n),fq(t,i),iJ(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new zJ),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&GJ(`z`,e,r,this.animationValues);for(let t=0;t<HJ.length;t++)GJ(`rotate${HJ[t]}`,e,r,this.animationValues),GJ(`skew${HJ[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=RJ(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=RJ(t?.pointerEvents)||``),this.hasProjected&&!$K(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=wJ(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Cq){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Cq[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?RJ(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach($J),this.root.sharedNodes.clear()}}}function JJ(e){e.updateLayout()}function YJ(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)CJ(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=tJ(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Jq(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else vY(i,t.layoutBox,n)&&CJ(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=tJ(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=EK();iJ(o,n,t.layoutBox);let s=EK();a?iJ(s,e.applyTransform(r,!0),t.measuredBox):iJ(s,n,t.layoutBox);let c=!gJ(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=OK();cJ(s,t.layoutBox,i.layoutBox,o);let c=OK();cJ(c,n,a.layoutBox,o),bJ(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function XJ(e){xK.value&&VJ.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ZJ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function QJ(e){e.clearSnapshot()}function $J(e){e.clearMeasurements()}function eY(e){e.isLayoutDirty=!0,e.updateLayout()}function tY(e){e.isLayoutDirty=!1}function nY(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rY(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function iY(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function aY(e){e.resolveTargetDelta()}function oY(e){e.calcProjection()}function sY(e){e.resetSkewAndRotation()}function cY(e){e.removeLeadSnapshot()}function lY(e,t,n){e.translate=PH(t.translate,0,n),e.scale=PH(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uY(e,t,n,r){e.min=PH(t.min,n.min,r),e.max=PH(t.max,n.max,r)}function dY(e,t,n,r){uY(e.x,t.x,n.x,r),uY(e.y,t.y,n.y,r)}function fY(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var pY={duration:.45,ease:[.4,0,.1,1]},mY=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),hY=mY(`applewebkit/`)&&!mY(`chrome/`)?Math.round:tV;function gY(e){e.min=hY(e.min),e.max=hY(e.max)}function _Y(e){gY(e.x),gY(e.y)}function vY(e,t,n){return e===`position`||e===`preserve-aspect`&&!nJ(xJ(t),xJ(n),.2)}function yY(e){return e!==e.root&&e.scroll?.wasRoot}var bY=qJ({attachResizeListener:(e,t)=>PJ(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),xY={current:void 0},SY=qJ({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xY.current){let e=new bY({});e.mount(window),e.setOptions({layoutScroll:!0}),xY.current=e}return xY.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),CY=(0,N.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function wY(e=!0){let t=(0,N.useContext)(KB);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,N.useId)();(0,N.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,N.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var TY=(0,N.createContext)({strict:!1}),EY={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},DY=!1;function OY(){if(DY)return;let e={};for(let t in EY)e[t]={isEnabled:e=>EY[t].some(t=>!!e[t])};UK(e),DY=!0}function kY(){return OY(),WK()}function AY(e){let t=kY();for(let n in e)t[n]={...t[n],...e[n]};UK(t)}var jY=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function MY(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||jY.has(e)}function NY(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var PY=n((()=>{})),FY=r({default:()=>LY}),IY,LY,RY=n((()=>{PY(),IY=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,LY=NY(function(e){return IY.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),zY=e=>!MY(e);function BY(e){typeof e==`function`&&(zY=t=>t.startsWith(`on`)?!MY(t):e(t))}try{BY((RY(),t(FY)).default)}catch{}function VY(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(aG(e[i])||(zY(i)||n===!0&&MY(i)||!t&&!MY(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var HY=(0,N.createContext)({});function UY(e,t){if(PK(e)){let{initial:t,animate:n}=e;return{initial:t===!1||jK(t)?t:void 0,animate:jK(n)?n:void 0}}return e.inherit===!1?{}:t}function WY(e){let{initial:t,animate:n}=UY(e,(0,N.useContext)(HY));return(0,N.useMemo)(()=>({initial:t,animate:n}),[GY(t),GY(n)])}function GY(e){return Array.isArray(e)?e.join(` `):e}var KY=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qY(e,t,n){for(let r in t)!aG(t[r])&&!wq(r,n)&&(e[r]=t[r])}function JY({transformTemplate:e},t){return(0,N.useMemo)(()=>{let n=KY();return vq(n,t,e),Object.assign({},n.vars,n.style)},[t])}function YY(e,t){let n=e.style||{},r={};return qY(r,n,e),Object.assign(r,JY(e,t)),r}function XY(e,t){let n={},r=YY(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var ZY=()=>({...KY(),attrs:{}});function QY(e,t,n,r){let i=(0,N.useMemo)(()=>{let n=ZY();return Mq(n,t,Pq(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};qY(t,e.style,e),i.style={...t,...i.style}}return i}var $Y=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function eX(e){return typeof e!=`string`||e.includes(`-`)?!1:!!($Y.indexOf(e)>-1||/[A-Z]/u.test(e))}function tX(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??eX(e)?QY:XY)(t,r,i,e),c=VY(t,typeof e==`string`,a),l=e===N.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,N.useMemo)(()=>aG(u)?u.get():u,[u]);return(0,N.createElement)(e,{...l,children:d})}function nX({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:rX(n,r,i,e),renderState:t()}}function rX(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=RJ(a[e]);let{initial:o,animate:s}=e,c=PK(e),l=FK(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!AK(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=QW(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var iX=e=>(t,n)=>{let r=(0,N.useContext)(HY),i=(0,N.useContext)(KB),a=()=>nX(e,t,r,i);return n?a():WB(a)},aX=iX({scrapeMotionValuesFromProps:Tq,createRenderState:KY}),oX=iX({scrapeMotionValuesFromProps:Iq,createRenderState:ZY}),sX=Symbol.for(`motionComponentSymbol`);function cX(e,t,n){let r=(0,N.useRef)(n);(0,N.useInsertionEffect)(()=>{r.current=n});let i=(0,N.useRef)(null);return(0,N.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var lX=(0,N.createContext)({});function uX(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function dX(e,t,n,r,i,a){let{visualElement:o}=(0,N.useContext)(HY),s=(0,N.useContext)(TY),c=(0,N.useContext)(KB),l=(0,N.useContext)(CY),u=l.reducedMotion,d=l.skipAnimations,f=(0,N.useRef)(null),p=(0,N.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,N.useContext)(lX);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&fX(f.current,n,i,h);let g=(0,N.useRef)(!1);(0,N.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[lG],v=(0,N.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return GB(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,N.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function fX(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:pX(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&uX(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function pX(e){if(e)return e.options.allowProjection===!1?pX(e.parent):e.projection}function mX(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&AY(r);let a=n?n===`svg`:eX(e),o=a?oX:aX;function s(n,s){let c,l={...(0,N.useContext)(CY),...n,layoutId:hX(n)},{isStatic:u}=l,d=WY(n),f=o(n,u);if(!u&&typeof window<`u`){gX(l,r);let t=_X(l);c=t.MeasureLayout,d.visualElement=dX(e,f,l,i,t.ProjectionNode,a)}return(0,M.jsxs)(HY.Provider,{value:d,children:[c&&d.visualElement?(0,M.jsx)(c,{visualElement:d.visualElement,...l}):null,tX(e,n,cX(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,N.forwardRef)(s);return c[sX]=e,c}function hX({layoutId:e}){let t=(0,N.useContext)(UB).id;return t&&e!==void 0?t+`-`+e:e}function gX(e,t){(0,N.useContext)(TY).strict}function _X(e){let{drag:t,layout:n}=kY();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function vX(e,t){if(typeof Proxy>`u`)return mX;let n=new Map,r=(n,r)=>mX(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,mX(a,void 0,e,t)),n.get(a))})}var yX=(e,t)=>t.isSVG??eX(e)?new Lq(t):new Dq(t,{allowProjection:e!==N.Fragment}),bX=class extends qK{constructor(e){super(e),e.animationState||=Wq(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();AK(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xX=0,SX={animation:{Feature:bX},exit:{Feature:class extends qK{constructor(){super(...arguments),this.id=xX++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=$W(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function CX(e){return{point:{x:e.pageX,y:e.pageY}}}var wX=e=>t=>JG(t)&&e(t,CX(t));function TX(e,t,n,r){return PJ(e,t,wX(n),r)}var EX=({current:e})=>e?e.ownerDocument.defaultView:null,DX=(e,t)=>Math.abs(e-t);function OX(e,t){let n=DX(e.x,t.x),r=DX(e.y,t.y);return Math.sqrt(n**2+r**2)}var kX=new Set([`auto`,`scroll`]),AX=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jX(this.lastRawMoveEventInfo,this.transformPagePoint));let e=NX(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=OX(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=IV;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=jX(t,this.transformPagePoint),PV.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=NX(e.type===`pointercancel`?this.lastMoveEventInfo:jX(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!JG(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=jX(CX(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=IV;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,NX(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=nV(TX(this.contextWindow,`pointermove`,this.handlePointerMove,d),TX(this.contextWindow,`pointerup`,this.handlePointerUp,d),TX(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(kX.has(e.overflowX)||kX.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),PV.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),FV(this.updatePoint)}};function jX(e,t){return t?{point:t(e.point)}:e}function MX(e,t){return{x:e.x-t.x,y:e.y-t.y}}function NX({point:e},t){return{point:e,delta:MX(e,FX(t)),offset:MX(e,PX(t)),velocity:IX(t,.1)}}function PX(e){return e[0]}function FX(e){return e[e.length-1]}function IX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=FX(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>aV(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>aV(t)*2&&(r=e[1]);let a=oV(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function LX(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?PH(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?PH(n,e,r.max):Math.min(e,n)),e}function RX(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function zX(e,{top:t,left:n,bottom:r,right:i}){return{x:RX(e.x,n,i),y:RX(e.y,t,r)}}function BX(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function VX(e,t){return{x:BX(e.x,t.x),y:BX(e.y,t.y)}}function HX(e,t){let n=.5,r=tJ(e),i=tJ(t);return i>r?n=rV(t.min,t.max-r,e.min):r>i&&(n=rV(e.min,e.max-i,t.min)),YB(0,1,n)}function UX(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var WX=.35;function GX(e=WX){return e===!1?e=0:e===!0&&(e=WX),{x:KX(e,`left`,`right`),y:KX(e,`top`,`bottom`)}}function KX(e,t,n){return{min:qX(e,t),max:qX(e,n)}}function qX(e,t){return typeof e==`number`?e:e[t]||0}var JX=new WeakMap,YX=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=OK(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(CX(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UG(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),CJ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(lH.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=tJ(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&PV.update(()=>i(e,t),!1,!0),sG(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=$X(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&PV.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new AX(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:EX(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&PV.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!QX(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=LX(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&uX(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?zX(n.layoutBox,e):!1,this.elastic=GX(t),r!==this.constraints&&!uX(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&CJ(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=UX(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!uX(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=mq(n,r.root,this.visualElement.getTransformPagePoint()),a=VX(r.layout.layoutBox,i);if(t){let e=t(YK(a));this.hasMutatedConstraints=!!e,e&&(a=JK(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=CJ(o=>{if(!QX(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return sG(this.visualElement,e),n.start(qW(e,n,0,t,this.visualElement,!1))}stopAnimation(){CJ(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){CJ(t=>{let{drag:n}=this.getProps();if(!QX(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-PH(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!uX(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};CJ(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=HX({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),CJ(t=>{if(!QX(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(PH(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;JX.set(this.visualElement,this);let e=this.visualElement.current,t=TX(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&QG(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();uX(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=ZX(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),PV.read(r);let o=PJ(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(CJ(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=WX,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function XX(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ZX(e,t,n){let r=bK(e,XX(n)),i=bK(t,XX(n));return()=>{r(),i()}}function QX(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $X(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var eZ=class extends qK{constructor(e){super(e),this.removeGroupControls=tV,this.removeListeners=tV,this.controls=new YX(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tV}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},tZ=e=>(t,n)=>{e&&PV.update(()=>e(t,n),!1,!0)},nZ=class extends qK{constructor(){super(...arguments),this.removePointerDownListener=tV}onPointerDown(e){this.session=new AX(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EX(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:tZ(e),onStart:tZ(t),onMove:tZ(n),onEnd:(e,t)=>{delete this.session,r&&PV.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=TX(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},rZ=!1,iZ=class extends N.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),rZ&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),BJ.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),rZ=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||PV.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),zG.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;rZ=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function aZ(e){let[t,n]=wY(),r=(0,N.useContext)(UB);return(0,M.jsx)(iZ,{...e,layoutGroup:r,switchLayoutGroup:(0,N.useContext)(lX),isPresent:t,safeToRemove:n})}var oZ={pan:{Feature:nZ},drag:{Feature:eZ,ProjectionNode:SY,MeasureLayout:aZ}};function sZ(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&PV.postRender(()=>i(t,CX(t)))}var cZ=class extends qK{mount(){let{current:e}=this.node;e&&(this.unmount=KG(e,(e,t)=>(sZ(this.node,t,`Start`),e=>sZ(this.node,e,`End`))))}unmount(){}},lZ=class extends qK{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=nV(PJ(this.node.current,`focus`,()=>this.onFocus()),PJ(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function uZ(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&PV.postRender(()=>i(t,CX(t)))}var dZ=class extends qK{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=aK(e,(e,t)=>(uZ(this.node,t,`Start`),(e,{success:t})=>uZ(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},fZ=new WeakMap,pZ=new WeakMap,mZ=e=>{let t=fZ.get(e.target);t&&t(e)},hZ=e=>{e.forEach(mZ)};function gZ({root:e,...t}){let n=e||document;pZ.has(n)||pZ.set(n,{});let r=pZ.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(hZ,{root:e,...t})),r[i]}function _Z(e,t,n){let r=gZ(t);return fZ.set(e,n),r.observe(e),()=>{fZ.delete(e),r.unobserve(e)}}var vZ={some:0,all:1},yZ=class extends qK{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:vZ[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=_Z(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(bZ(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function bZ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var xZ={inView:{Feature:yZ},tap:{Feature:dZ},focus:{Feature:lZ},hover:{Feature:cZ}},SZ={layout:{ProjectionNode:SY,MeasureLayout:aZ}},CZ=vX({...SX,...xZ,...oZ,...SZ},yX),wZ=new Map,TZ=e=>{let t=wZ.get(e);return t||(t=CZ.create(e),wZ.set(e,t)),t},EZ=(0,N.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=TZ(t),o=(0,N.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,M.jsx)(a,{animate:{backgroundPosition:`0% center`},className:j(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),DZ=(0,N.createContext)(null),OZ=()=>{let e=(0,N.useContext)(DZ);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},kZ=1e3,AZ=1e3,jZ=(0,N.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=mB({defaultProp:c,onChange:i,prop:n}),[f,p]=mB({defaultProp:void 0,prop:a}),m=(0,N.useRef)(t),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(null);(0,N.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/AZ)),_.current=null)},[t,p]),(0,N.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,N.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},kZ);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,N.useCallback)(e=>{d(e)},[d]),y=(0,N.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,M.jsx)(DZ.Provider,{value:y,children:(0,M.jsx)(BB,{className:j(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),MZ=(e,t)=>e||t===0?(0,M.jsx)(EZ,{duration:1,children:`Thinking...`}):t===void 0?(0,M.jsx)(`p`,{children:`Thought for a few seconds`}):(0,M.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),NZ=(0,N.memo)(({className:e,children:t,getThinkingMessage:n=MZ,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=OZ();return(0,M.jsx)(VB,{className:j(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Je,{className:`size-4`}),n(i,o),(0,M.jsx)(ge,{className:j(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),PZ=(0,N.memo)(({className:e,children:t,...n})=>(0,M.jsx)(HB,{className:j(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,M.jsx)(EF,{children:t})}));jZ.displayName=`Reasoning`,NZ.displayName=`ReasoningTrigger`,PZ.displayName=`ReasoningContent`;var FZ={"approval-requested":(0,M.jsx)(ze,{className:`size-4 text-yellow-600`}),"approval-responded":(0,M.jsx)(Ye,{className:`size-4 text-blue-600`}),"input-available":(0,M.jsx)(ze,{className:`size-4 animate-pulse`}),"input-streaming":(0,M.jsx)(me,{className:`size-4`}),"output-available":(0,M.jsx)(Ye,{className:`size-4 text-green-600`}),"output-denied":(0,M.jsx)(Xe,{className:`size-4 text-orange-600`}),"output-error":(0,M.jsx)(Xe,{className:`size-4 text-red-600`})};function IZ(e){return(0,M.jsx)(Ge,{className:`gap-1.5 text-xs`,variant:`secondary`,children:FZ[e]})}var LZ=({className:e,...t})=>(0,M.jsx)(BB,{className:j(`group not-prose mb-4 w-full rounded-sm border`,e),...t}),RZ={run_commands:(0,M.jsx)(ut,{className:`size-4`}),read_files:(0,M.jsx)(Qe,{className:`size-4`}),editor:(0,M.jsx)(Be,{className:`size-4`}),ask_question:(0,M.jsx)(nt,{className:`size-4`})},zZ=e=>(0,M.jsx)(Ge,{className:`text-xs`,variant:`ghost`,children:e&&RZ[e]||(0,M.jsx)(He,{className:`size-4`})}),BZ=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=t?.split(`:`),s=o?.[0]||i,c=o?.[1],l=s||t||n.split(`-`).slice(1).join(`-`);return(0,M.jsx)(VB,{className:j(`flex w-full overflow-hidden items-center justify-between gap-4 p-3 cursor-pointer`,e),...a,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[zZ(l),(0,M.jsx)(`span`,{className:`font-light text-muted-foreground text-sm truncated wrap-break-word ellipses`,children:c}),IZ(r)]})})},VZ=({className:e,...t})=>(0,M.jsx)(HB,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-1 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in overflow-hidden font-mono`,e),...t}),HZ=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,M.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,N.isValidElement)(t)?i=(0,M.jsx)(gF,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,M.jsx)(gF,{code:t,language:`json`})),(0,M.jsx)(`div`,{className:j(`space-y-2`,e),...r,children:(0,M.jsxs)(`div`,{className:j(`overflow-auto rounded-md text-xs [&_table]:w-full max-h-20`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,M.jsx)(`div`,{children:n}),i]})})},UZ=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`text-muted-foreground text-sm`,t),...n,children:e}),WZ=({defaultOpen:e=!0,className:t,...n})=>(0,M.jsx)(BB,{className:j(t),defaultOpen:e,...n}),GZ=({children:e,className:t,title:n,...r})=>(0,M.jsx)(VB,{className:j(`group`,t),...r,children:e??(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(h,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:n}),(0,M.jsx)(ge,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})}),KZ=({children:e,className:t,...n})=>(0,M.jsx)(HB,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,t),...n,children:(0,M.jsx)(`div`,{className:`mt-4 space-y-2 border-muted border-l-2 pl-4`,children:e})});function qZ(e){return typeof e==`object`&&e?e:void 0}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function JZ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function YZ(e){return e===`output-error`?`Failed`:e===`output-available`?`Done`:`Running`}function XZ(e){let t=qZ(e.input),n=qZ(e.output),r=YZ(e.state);switch(e.name){case`team_spawn_teammate`:return`${r} spawn teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_shutdown_teammate`:return`${r} shutdown teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_status`:return`${r} fetch team status`;case`team_task`:{let e=$(t?.action);return e===`create`?`${r} create task ${$(n?.taskId)??``}${$(t?.title)?`: ${$(t?.title)}`:``}`.trim():e===`list`?`${r} list team tasks`:e===`claim`?`${r} claim task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`complete`?`${r} complete task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`block`?`${r} block task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():`${r} update team task`}case`team_run_task`:{let e=$(t?.agentId)??$(n?.agentId)??`agent`,i=$(n?.mode)??$(t?.runMode),a=$(n?.status),o=$(t?.task),s=o?`: ${o}`:``;return`${r} ${i===`async`?`queue`:a===`joined`?`join`:`run`} task with ${e}${a?` (${a})`:``}${s}`}case`team_cancel_run`:return`${r} cancel run ${$(t?.runId)??$(n?.runId)??``}`.trim();case`team_list_runs`:return`${r} list teammate runs`;case`team_await_run`:return`${r} await run ${$(t?.runId)??``}`.trim();case`team_await_all_runs`:return`${r} await all active runs`;case`team_send_message`:return`${r} message ${$(t?.toAgentId)??$(n?.toAgentId)??`agent`}${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_broadcast`:return`${r} broadcast${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_read_mailbox`:return`${r} read mailbox`;case`team_mission_log`:return`${r} log ${$(t?.kind)??`update`}${$(t?.summary)?`: ${$(t?.summary)}`:``}`;case`team_cleanup`:return`${r} clean up team runtime`;case`team_create_outcome`:return`${r} create outcome${$(t?.title)?`: ${$(t?.title)}`:``}`;case`team_attach_outcome_fragment`:return`${r} attach fragment to ${$(t?.section)??`section`}`;case`team_review_outcome_fragment`:return`${r} ${t?.approved===!1?`reject`:`review`} fragment ${$(t?.fragmentId)??``}`.trim();case`team_finalize_outcome`:return`${r} finalize outcome ${$(t?.outcomeId)??$(n?.outcomeId)??``}`.trim();case`team_list_outcomes`:return`${r} list outcomes`;default:return`${r} ${e.name.replace(/^team_/,``).replaceAll(`_`,` `)}`}}function ZZ(e){if(e.error)return e.error;let t=qZ(e.input),n=qZ(e.output);switch(e.name){case`team_task`:{let e=$(t?.action);if(e===`create`)return $(t?.description);if(e===`block`)return $(t?.reason);if(e===`list`){let e=Array.isArray(n?.tasks)?n.tasks.length:void 0;return typeof e==`number`?`${e} task${e===1?``:`s`}`:void 0}return}case`team_run_task`:return $(n?.message)??$(n?.runId)??$(n?.text);case`team_send_message`:case`team_broadcast`:return $(t?.body);case`team_mission_log`:return $(t?.nextAction)??$(t?.summary);case`team_attach_outcome_fragment`:return $(t?.content);case`team_status`:{let e=Array.isArray(n?.members)?n.members.length:void 0,t=Array.isArray(n?.tasks)?n.tasks.length:void 0,r=Array.isArray(n?.runs)?n.runs.length:void 0;return[typeof e==`number`?`${e} members`:void 0,typeof t==`number`?`${t} tasks`:void 0,typeof r==`number`?`${r} runs`:void 0].filter(Boolean).join(` • `)||void 0}case`team_list_runs`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} run${t.length===1?``:`s`}`:`No runs`}case`team_read_mailbox`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} message${t.length===1?``:`s`}`:`No messages`}case`team_create_outcome`:{let e=JZ(t?.requiredSections);return e?.length?e.join(`, `):void 0}default:return}}function QZ({className:e,defaultOpen:t=!0,events:n,...r}){if(n.length===0)return null;let i=n.length===1?`Team activity`:`Team activity (${n.length})`;return(0,M.jsxs)(WZ,{className:e,defaultOpen:t,...r,children:[(0,M.jsx)(GZ,{title:i,children:(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(dt,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:i})]})}),(0,M.jsx)(KZ,{children:n.map(e=>{let t=ZZ(e);return(0,M.jsxs)(UZ,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{children:XZ(e)}),t?(0,M.jsx)(`div`,{className:`line-clamp-3 text-xs text-muted-foreground/90`,children:t}):null]},e.id)})})]})}function $Z(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);var eQ=1,tQ=100,nQ=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:eQ++,rQ=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-tQ;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=nQ(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(aQ(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=nQ(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},iQ=(e,t)=>rQ.message(e,t),aQ=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,oQ=Object.assign(iQ,{success:rQ.success,info:rQ.info,warning:rQ.warning,error:rQ.error,custom:rQ.custom,message:rQ.message,promise:rQ.promise,dismiss:rQ.dismiss,loading:rQ.loading},{getHistory:()=>rQ.toasts,getToasts:()=>rQ.getActiveToasts()});$Z(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);var sQ={audio:rt,document:Le,image:de,source:et,unknown:it,video:ft},cQ=e=>{if(e.type===`source-document`)return`source`;let t=e.mediaType??``;return t.startsWith(`image/`)?`image`:t.startsWith(`video/`)?`video`:t.startsWith(`audio/`)?`audio`:t.startsWith(`application/`)||t.startsWith(`text/`)?`document`:`unknown`},lQ=(e,t,n)=>n?(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full object-cover`,height:96,src:e,width:96}):(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full rounded object-cover`,height:20,src:e,width:20}),uQ=(0,N.createContext)(null),dQ=(0,N.createContext)(null),fQ=()=>(0,N.useContext)(uQ)??{variant:`grid`},pQ=()=>{let e=(0,N.useContext)(dQ);if(!e)throw Error(`Attachment components must be used within <Attachment>`);return e},mQ=({variant:e=`grid`,className:t,children:n,...r})=>{let i=(0,N.useMemo)(()=>({variant:e}),[e]);return(0,M.jsx)(uQ.Provider,{value:i,children:(0,M.jsx)(`div`,{className:j(`flex items-start`,e===`list`?`flex-col gap-2`:`flex-wrap gap-2`,e===`grid`&&`ml-auto w-fit`,t),...r,children:n})})},hQ=({data:e,onRemove:t,className:n,children:r,...i})=>{let{variant:a}=fQ(),o=cQ(e),s=(0,N.useMemo)(()=>({data:e,mediaCategory:o,onRemove:t,variant:a}),[e,o,t,a]);return(0,M.jsx)(dQ.Provider,{value:s,children:(0,M.jsx)(`div`,{className:j(`group relative`,a===`grid`&&`size-24 overflow-hidden rounded-lg`,a===`inline`&&[`flex h-8 cursor-pointer select-none items-center gap-1.5`,`rounded-md border border-border px-1.5`,`font-medium text-sm transition-all`,`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`],a===`list`&&[`flex w-full items-center gap-3 rounded-lg border p-3`,`hover:bg-accent/50`],n),...i,children:r})})},gQ=({fallbackIcon:e,className:t,...n})=>{let{data:r,mediaCategory:i,variant:a}=pQ(),o=a===`inline`?`size-3`:`size-4`,s=e=>(0,M.jsx)(e,{className:j(o,`text-muted-foreground`)}),c=()=>{if(i===`image`&&r.type===`file`&&r.url)return lQ(r.url,r.filename,a===`grid`);if(i===`video`&&r.type===`file`&&r.url)return(0,M.jsx)(`video`,{className:`size-full object-cover`,muted:!0,src:r.url});let t=sQ[i];return e??s(t)};return(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center justify-center overflow-hidden`,a===`grid`&&`size-full bg-muted`,a===`inline`&&`size-5 rounded bg-background`,a===`list`&&`size-12 rounded bg-muted`,t),...n,children:c()})},_Q=({label:e=`Remove`,className:t,children:n,...r})=>{let{onRemove:i,variant:a}=pQ(),o=(0,N.useCallback)(e=>{e.stopPropagation(),i?.()},[i]);return i?(0,M.jsxs)(A,{"aria-label":e,className:j(a===`grid`&&[`absolute top-2 right-2 size-6 rounded-full p-0`,`bg-background/80 backdrop-blur-sm`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-background`,`[&>svg]:size-3`],a===`inline`&&[`size-5 rounded p-0`,`opacity-0 transition-opacity group-hover:opacity-100`,`[&>svg]:size-2.5`],a===`list`&&[`size-8 shrink-0 rounded p-0`,`[&>svg]:size-4`],t),onClick:o,type:`button`,variant:`ghost`,...r,children:[n??(0,M.jsx)(le,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:e})]}):null},vQ=e=>(0,M.jsx)(ve,{...e}),yQ=e=>(0,M.jsx)(Ce,{...e}),bQ=({className:e,children:t,title:n=`Model Selector`,...r})=>(0,M.jsxs)(Se,{"aria-describedby":void 0,className:j(`outline! border-none! p-0 outline-border! outline-solid!`,e),...r,children:[(0,M.jsx)(Ee,{className:`sr-only`,children:n}),(0,M.jsx)(Pz,{className:`**:data-[slot=command-input-wrapper]:h-auto`,children:t})]}),xQ=({className:e,...t})=>(0,M.jsx)(Fz,{className:j(`h-auto py-3.5`,e),...t}),SQ=e=>(0,M.jsx)(Iz,{...e}),CQ=e=>(0,M.jsx)(Lz,{...e}),wQ=e=>(0,M.jsx)(Rz,{...e}),TQ=e=>(0,M.jsx)(zz,{...e}),EQ=({provider:e,className:t,...n})=>(0,M.jsx)(`img`,{...n,alt:`${e} logo`,className:j(`size-3 dark:invert`,t),height:12,src:`https://models.dev/logos/${e}.svg`,width:12}),DQ=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1 dark:[&>img]:bg-foreground`,e),...t}),OQ=({className:e,...t})=>(0,M.jsx)(`span`,{className:j(`flex-1 truncate text-left`,e),...t});function kQ(){let e=Yz();return e.files.length===0?null:(0,M.jsx)(mQ,{variant:`inline`,children:e.files.map(t=>(0,M.jsxs)(hQ,{data:t,onRemove:()=>e.remove(t.id),children:[(0,M.jsx)(gQ,{}),(0,M.jsx)(_Q,{})]},t.id))})}function AQ({autoApproveTools:e,enableSpawn:t,enableTeams:n,model:r,modelSelectorOpen:i,models:a,onAutoApproveToolsChange:o,onEnableSpawnChange:s,onEnableTeamsChange:c,onModelChange:l,onModelSelectorOpenChange:u,onProviderChange:d,provider:f,providers:p,workspaceRoot:m}){let h=p.find(e=>e.id===f),_=a.find(e=>e.id===r)??a[0]??void 0;return(0,M.jsxs)(`div`,{className:`grid gap-3 bg-background/70 p-3`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Provider`}),(0,M.jsxs)(be,{onValueChange:e=>{e&&d(e)},value:f,children:[(0,M.jsx)(ke,{className:`w-full`,children:(0,M.jsx)(Ae,{placeholder:`Select provider`})}),(0,M.jsx)(ye,{children:p.map(e=>(0,M.jsx)(_e,{value:e.id,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[jQ(e.id),(0,M.jsx)(`span`,{children:e.name})]})},e.id))})]})]}),(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Model`}),(0,M.jsxs)(vQ,{onOpenChange:u,open:i,children:[(0,M.jsx)(yQ,{children:(0,M.jsx)(A,{className:`w-full justify-between`,variant:`outline`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&jQ(h.id),(0,M.jsx)(`span`,{className:`truncate`,children:_?.name||_?.id||`Select model`})]})})}),(0,M.jsxs)(bQ,{children:[(0,M.jsx)(xQ,{placeholder:`Search models...`}),(0,M.jsxs)(SQ,{children:[(0,M.jsx)(CQ,{children:`No models found.`}),(0,M.jsx)(wQ,{heading:h?.name||`Models`,children:a.map(e=>(0,M.jsxs)(TQ,{onSelect:()=>{l(e.id),u(!1)},value:e.id,children:[h&&jQ(h.id),(0,M.jsx)(OQ,{children:e.name||e.id}),(0,M.jsx)(DQ,{children:h&&jQ(h.id)}),r===e.id?(0,M.jsx)(g,{className:`ml-auto size-4`}):(0,M.jsx)(`div`,{className:`ml-auto size-4`})]},e.id))})]})]})]})]})]}),(0,M.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,htmlFor:`workspace-root`,children:`Workspace`}),(0,M.jsx)(E,{id:`workspace-root`,readOnly:!0,value:m})]})}),(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsx)(MQ,{checked:t,label:`Subagents`,onChange:s}),(0,M.jsx)(MQ,{checked:n,label:`Agent Teams`,onChange:c}),(0,M.jsx)(MQ,{checked:e,label:`Auto-approves`,onChange:o})]})]})}function jQ(e){return(0,M.jsx)(EQ,{className:`size-3.5`,provider:e||`openai`})}function MQ({checked:e,label:t,onChange:n,disabled:r}){return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-background/60 px-3 py-2`,children:[(0,M.jsx)(Oe,{className:`text-sm`,htmlFor:t,children:t}),(0,M.jsx)(Pe,{checked:e,id:t,onCheckedChange:e=>n(e),disabled:r})]})}var NQ={None:`none`,Low:`low`,Medium:`medium`,High:`high`},PQ=[{value:NQ.None,label:`Thinking Off`,icon:st},{value:NQ.Low,label:`Low`,icon:ot},{value:NQ.Medium,label:`Medium`,icon:ct},{value:NQ.High,label:`High`,icon:st}];function FQ({autoApproveTools:e,disabled:t=!1,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,mode:s,modelSelectorOpen:c,models:l,onAbort:u,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onModeChange:h,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSend:b,onSystemPromptChange:x,onReasonLevelChange:S,provider:C,providers:w,sending:T,status:E,systemPrompt:ee,reasonLevel:D,workspaceRoot:te}){let[O,ne]=(0,N.useState)(!1),k=Wz(),re=Yz(),ie=l.find(e=>e.id===o)?.supportsThinking===!0,ae=ie?D:NQ.None,oe=Math.max(PQ.findIndex(e=>e.value===ae),0),se=PQ[oe].icon;return(0,M.jsx)(`div`,{className:`border-t bg-background`,children:(0,M.jsxs)(Zz,{accept:`image/*,.txt,.md,.json,.ts,.tsx,.js,.jsx`,globalDrop:!0,className:`rounded-none [&>[data-slot=input-group]]:border-0! [&>[data-slot=input-group]]:ring-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:border-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:ring-0!`,maxFiles:8,multiple:!0,onError:e=>oQ.error(e.message),onSubmit:async e=>{let t=e.text.trim();if(!t&&!e.files.length)return;let n;if(e.files.length>0){let t=(await Promise.all(e.files.map(e=>IQ(e.url)))).filter(e=>!!e);t.length>0&&(n={userImages:t}),t.length!==e.files.length&&oQ.warning(`Only image attachments are currently sent in the VS Code chat runtime.`)}!t&&!n?.userImages?.length||b({prompt:t,attachments:n,attachmentCount:e.files.length})},children:[(0,M.jsx)(eB,{children:(0,M.jsx)(kQ,{})}),(0,M.jsx)(Qz,{children:(0,M.jsx)($z,{disabled:t||E.includes(`Failed`),onChange:e=>k.textInput.setInput(e.target.value),placeholder:`Type @ for context and / for skills`,value:k.textInput.value,className:`text-sm outline-none ring-0`})}),(0,M.jsxs)(tB,{className:`flex-col items-stretch gap-1 px-0`,children:[O?(0,M.jsx)(AQ,{autoApproveTools:e,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,modelSelectorOpen:c,models:l,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSystemPromptChange:x,provider:C,providers:w,systemPrompt:ee,workspaceRoot:te}):null,(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(nB,{className:`shrink-0`,children:[(0,M.jsx)(rB,{disabled:t,onClick:()=>re.openFileDialog(),type:`button`,variant:`ghost`,children:(0,M.jsx)(it,{className:`size-3`})}),(0,M.jsxs)(rB,{disabled:t,onClick:()=>ne(e=>!e),type:`button`,variant:O?`default`:`ghost`,children:[(0,M.jsx)(at,{className:`size-3`}),(0,M.jsxs)(`span`,{children:[C,`:`,o]})]}),(0,M.jsx)(rB,{disabled:t||!ie,onClick:()=>{S(PQ[(oe+1)%PQ.length].value)},type:`button`,title:PQ[oe].label,variant:ae===NQ.None?`ghost`:`default`,children:(0,M.jsx)(se,{className:`size-3`})}),(0,M.jsxs)(rB,{disabled:t,onClick:()=>h(s===`act`?`plan`:`act`),type:`button`,variant:s===`plan`?`default`:`ghost`,className:`hidden`,children:[s===`act`?(0,M.jsx)(Ne,{className:`size-3`}):(0,M.jsx)(tt,{className:`size-3`}),s]}),(0,M.jsx)(Ge,{className:`rounded-sm px-3 py-1 text-xs hidden`,variant:E.includes(`Error`)?`destructive`:`secondary`,children:E})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T?(0,M.jsx)(A,{onClick:u,type:`button`,variant:`destructive`,children:`Abort`}):null,(0,M.jsx)(iB,{disabled:t||E.includes(`Failed`),status:T?`submitted`:`ready`,variant:`ghost`})]})]})]})]})})}async function IQ(e){if(e){if(e.startsWith(`data:image/`))return e;if(e.startsWith(`blob:`))try{let t=await(await fetch(e)).blob();return t.type.startsWith(`image/`)?await new Promise(e=>{let n=new FileReader;n.onloadend=()=>{e(typeof n.result==`string`?n.result:void 0)},n.onerror=()=>e(void 0),n.readAsDataURL(t)}):void 0}catch{return}}}var LQ=r({default:()=>p$}),RQ={lastProvider:``,lastModelByProvider:{}};function zQ(){try{let e=ae()?.getState();if(e?.modelSelection)return e.modelSelection}catch{}return RQ}function BQ(e){try{let t=ae();if(!t)return;let n=t.getState()??{};t.setState({...n,modelSelection:e})}catch{}}function VQ(e){let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}function HQ(e,t,n){return{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,role:e,text:t,...n}}function UQ(e,t,n=0){let r=n||(t?.userImages?.length??0);return r===0?e:`${e}${e.length>0?`
|
|
341
|
+
|
|
342
|
+
`:``}[attached ${r} file${r===1?``:`s`}]`}function WQ(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}function GQ(e,t,n){if(!t)return e;let r=n.current;if(r){let n=e.findIndex(e=>e.id===r);if(n>=0)return e.map((e,r)=>r===n?{...e,text:`${e.text}${t}`,blocks:KQ(e.blocks,t)}:e)}let i=e.at(-1);if(i?.role===`assistant`)return n.current=i.id,[...e.slice(0,-1),{...i,text:`${i.text}${t}`,blocks:KQ(i.blocks,t)}];let a=HQ(`assistant`,t,{blocks:[{id:Pt(),type:`text`,text:t}]});return n.current=a.id,[...e,a]}function KQ(e,t){let n=e??[];return n.at(-1)?.type===`text`?n.map((e,r)=>r===n.length-1&&e.type===`text`?{...e,text:`${e.text}${t}`}:e):[...n,{id:Pt(),type:`text`,text:t}]}function qQ(e,t,n){let r=e??[];return r.at(-1)?.type===`reasoning`?r.map((e,i)=>i===r.length-1&&e.type===`reasoning`?{...e,text:`${e.text}${t}`,redacted:e.redacted||n}:e):[...r,{id:Pt(),type:`reasoning`,text:t,redacted:n}]}function JQ(e,t){let n=e??[],r=n.findIndex(e=>e.type===`tool`&&(e.toolEvent.toolCallId&&t.toolCallId&&e.toolEvent.toolCallId===t.toolCallId||!e.toolEvent.toolCallId&&!t.toolCallId&&e.toolEvent.name===t.name&&e.toolEvent.state===`input-available`&&t.state!==`input-available`));return r===-1?[...n,{id:Pt(),type:`tool`,toolEvent:t}]:n.map((e,n)=>n===r&&e.type===`tool`?{...e,toolEvent:{...e.toolEvent,...t}}:e)}function YQ(e,t,n,r){let i=t||(n?`[redacted]`:``);if(!i)return e;let a=r.current;if(a){let t=e.findIndex(e=>e.id===a);if(t>=0)return e.map((e,r)=>r===t?{...e,reasoning:`${e.reasoning??``}${i}`,reasoningRedacted:e.reasoningRedacted||n,blocks:qQ(e.blocks,i,n)}:e)}let o=e.at(-1);if(o?.role===`assistant`)return r.current=o.id,[...e.slice(0,-1),{...o,reasoning:`${o.reasoning??``}${i}`,reasoningRedacted:o.reasoningRedacted||n,blocks:qQ(o.blocks,i,n)}];let s=HQ(`assistant`,``,{reasoning:i,reasoningRedacted:n,blocks:[{id:Pt(),type:`reasoning`,text:i,redacted:n}]});return r.current=s.id,[...e,s]}function XQ(e,t,n){return e.some(e=>e.blocks?.some(e=>e.type===`media`&&e.media.id===t.id))?e:(n.current=void 0,[...e,HQ(`assistant`,``,{blocks:[{id:`media:${t.id}`,type:`media`,media:t}]})])}function ZQ(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`result`in e[0]}function QQ(e){return e==null?``:typeof e==`string`?e:typeof e==`object`?Object.values(e).filter(e=>typeof e==`string`||typeof e==`number`).map(String).join(` `):String(e)}function $Q(e,t){return e==null?t:typeof e==`string`?e:JSON.stringify(e,null,2)}function e$(e){if(ZQ(e.output))return e.output.map((t,n)=>{let r=t.query??``,i=r?`${e.name}: ${r}`:e.name,a=t.success===!1?`output-error`:e.state,o=t.result??(t.success===!1?`(failed)`:`(no output)`),s=t.success===!1?t.result??`failed`:void 0;return{id:`${e.id}-${n}`,name:e.name,title:i,state:a,output:o,error:s}});let t=QQ(e.input),n=t?`${e.name}: ${t}`:e.name;return[{id:e.id,name:e.name,title:n,state:e.state,output:e.error??$Q(e.output,e.text),error:e.error}]}function t$(e){let t=/^Running (.+)\.\.\.$/.exec(e);return t?.[1]?t[1]:/^(.+?) (completed|failed:.*)$/.exec(e)?.[1]??`tool`}function n$(e){return e.includes(`failed:`)?`output-error`:e.endsWith(`completed`)?`output-available`:`input-available`}function r$(e,t){return e?.status===`failed`?`output-error`:e?.status===`completed`?`output-available`:e?.status===`running`?`input-available`:n$(t??``)}function i$(e,t){let n=e.findIndex(e=>e.toolCallId&&t.toolCallId&&e.toolCallId===t.toolCallId||!e.toolCallId&&!t.toolCallId&&e.name===t.name&&e.state===`input-available`&&t.state!==`input-available`);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,text:t.text,state:t.state,output:t.output,error:t.error}:e)}function a$(e,t,n,r){let i=r.current,a={id:Pt(),toolCallId:n?.toolCallId,name:n?.toolName??t$(t),state:r$(n,t),text:t,input:n?.input,output:n?.output,error:n?.error};return i?e.map(e=>e.id===i?{...e,toolEvents:i$(e.toolEvents??[],a),blocks:JQ(e.blocks,a)}:e):[...e,HQ(`meta`,t,{toolEvents:[a],blocks:[{id:Pt(),type:`tool`,toolEvent:a}]})]}function o$(e,t){if(t.length===0)return e;let n=[...e];for(let e of t){let t=n.at(-1);if(e.role===`assistant`&&t?.role===`assistant`){n[n.length-1]={...t,text:`${t.text}${e.text}`,reasoning:`${t.reasoning??``}${e.reasoning??``}`||void 0,reasoningRedacted:t.reasoningRedacted||e.reasoningRedacted||void 0,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}if(e.role===`meta`&&t?.role===`meta`&&(e.toolEvents?.length??0)>0){n[n.length-1]={...t,text:e.text||t.text,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}n.push(e)}return n}function s$(e,t){return e$(e).map(e=>(0,M.jsxs)(LZ,{className:t,children:[(0,M.jsx)(BZ,{state:e.state,title:e.title,type:`dynamic-tool`,toolName:e.name}),(0,M.jsx)(VZ,{children:(0,M.jsx)(HZ,{errorText:e.error,output:e.output})})]},e.id))}function c$(e){let t=[];for(let n of e.toolEvents??[])t.push({id:`legacy-tool-${n.id}`,type:`tool`,toolEvent:n});return e.reasoning&&t.push({id:`legacy-reasoning-${e.id}`,type:`reasoning`,text:e.reasoning,redacted:e.reasoningRedacted}),e.text&&t.push({id:`legacy-text-${e.id}`,type:`text`,text:e.text}),t}function l$(e,t){return(e.blocks?.length?e.blocks:c$(e)).flatMap(e=>{switch(e.type){case`tool`:return e.toolEvent.name.startsWith(`team_`)?[(0,M.jsx)(QZ,{className:t.isMeta?`mt-3 w-full`:`mb-3 w-full`,events:[e.toolEvent]},e.id)]:s$(e.toolEvent,t.isMeta?`mt-3`:`mb-3`);case`reasoning`:return[(0,M.jsxs)(jZ,{className:t.isMeta?`mt-3`:`mb-3`,defaultOpen:!1,children:[(0,M.jsx)(NZ,{}),(0,M.jsx)(PZ,{children:e.text})]},e.id)];case`media`:return[(0,M.jsx)(Mt,{classNames:{image:`max-h-96 max-w-full rounded-md`,audio:`w-full`,video:`max-h-96 max-w-full`,unavailable:`rounded-md border p-3 text-sm`},media:e.media},e.id)];case`text`:return t.isMeta?[(0,M.jsx)(`pre`,{className:`whitespace-pre-wrap font-inherit`,children:e.text},e.id)]:[(0,M.jsx)(OF,{children:(0,M.jsx)(kF,{children:e.text})},e.id)]}return[]})}function u$(e,t,n,r){return[...e,HQ(`meta`,`Done (${t}) • iterations=${n} • input=${r?.inputTokens??0} output=${r?.outputTokens??0}`)]}function d$(e){return[e.title?.trim()||e.sessionId.slice(0,12),e.workspaceRoot?.trim()?e.workspaceRoot.trim().split(`/`).pop():void 0].filter(Boolean).join(` • `)}function f$(e){try{return new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(new Date(e))}catch{return`Checkpoint`}}function p$({initialSessionId:e,onSessionSelected:t}){let[n,r]=(0,N.useState)([]),[i,a]=(0,N.useState)(`Waiting for RPC initialization...`),[o,s]=(0,N.useState)(),[c,l]=(0,N.useState)(),[u,d]=(0,N.useState)(!1),[p,m]=(0,N.useState)([]),[h,_]=(0,N.useState)({}),[v,y]=(0,N.useState)({workspaceRoot:``,cwd:``}),[b,x]=(0,N.useState)([]),[S,C]=(0,N.useState)(``),[w,T]=(0,N.useState)(zQ),[E,ee]=(0,N.useState)(()=>w.lastProvider),[D,te]=(0,N.useState)(()=>w.lastModelByProvider[w.lastProvider]??``),[ne,k]=(0,N.useState)(``),[re,ie]=(0,N.useState)(``),[ae,oe]=(0,N.useState)(`act`),[se,ce]=(0,N.useState)(`none`),[de,fe]=(0,N.useState)(!0),[pe,me]=(0,N.useState)(!1),[ge,_e]=(0,N.useState)(!0),[ve,ye]=(0,N.useState)(!0),[be,xe]=(0,N.useState)([]),[Se,Ce]=(0,N.useState)(!1),[we,Te]=(0,N.useState)(!1),[Ee,De]=(0,N.useState)(!1),[Oe,ke]=(0,N.useState)(null),Ae=(0,N.useRef)(void 0),je=(0,N.useRef)(void 0),Ne=(0,N.useRef)(void 0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(t),Ie=(0,N.useRef)(w),Le=(0,N.useRef)(b),Re=(0,N.useRef)(v),ze=(0,N.useCallback)(e=>{Ne.current===e||Pe.current===e&&!Ne.current||(Pe.current=e,Ne.current=e,s(e),l(e),r([]),d(!1),xe([]),Ae.current=void 0,a(`Loading chat history for ${e}...`),t?.(e),O({type:`attachSession`,sessionId:e}))},[t]);(0,N.useEffect)(()=>{Ne.current=c},[c]),(0,N.useEffect)(()=>{Pe.current=o},[o]),(0,N.useEffect)(()=>{Fe.current=t},[t]),(0,N.useEffect)(()=>{Le.current=b},[b]),(0,N.useEffect)(()=>{Re.current=v},[v]),(0,N.useEffect)(()=>{let e=e=>{let t=e.data;if(!(!t||typeof t!=`object`||!(`type`in t)))switch(t.type){case`status`:a(t.text);return;case`error`:if(t.recoverable){a(`Recoverable error (run continues): ${t.text}`);return}a(`Error: ${t.text}`),d(!1),l(void 0),Ne.current=void 0,Ae.current=void 0,r(e=>{if(e.length===0)return e;let n=`Error: ${t.text}`,r=e.at(-1);return r?.role===`error`&&r.text===n?e:[...e,HQ(`error`,n)]});return;case`defaults`:y(t.defaults),t.defaults.provider&&ee(t.defaults.provider),t.defaults.model&&te(t.defaults.model);return;case`sessions`:x(t.sessions);return;case`providers`:m(t.providers),ee(e=>{let n=e&&t.providers.some(t=>t.id===e)?e:``,r=zQ().lastProvider,i=n||(r&&t.providers.some(e=>e.id===r)?r:``)||t.providers.find(e=>e.enabled)?.id||t.providers[0]?.id||``;return i&&O({type:`loadModels`,providerId:i}),i});return;case`models`:_(e=>({...e,[t.providerId]:t.models})),te(e=>{if(e&&t.models.some(t=>t.id===e))return e;let n=Re.current;if(n.provider===t.providerId&&n.model&&t.models.some(e=>e.id===n.model))return n.model;let r=zQ().lastModelByProvider[t.providerId];return r&&t.models.some(e=>e.id===r)?r:t.models[0]?.id||``});return;case`session_started`:Pe.current=t.sessionId,s(t.sessionId),Fe.current?.(t.sessionId),Te(!1),C(``);return;case`session_hydrated`:if(Ne.current&&Ne.current!==t.sessionId)return;if(Pe.current=t.sessionId,Ne.current=void 0,s(t.sessionId),l(void 0),d(t.status===`running`),t.providerId&&ee(t.providerId),t.providerId&&t.modelId){let e={lastProvider:t.providerId,lastModelByProvider:{...Ie.current.lastModelByProvider,[t.providerId]:t.modelId}};Ie.current=e,T(e),BQ(e),te(t.modelId)}Te(!1),C(Le.current.find(e=>e.sessionId===t.sessionId)?.title?.trim()||``),r(e=>{let n=t.status===`running`?o$(t.messages,e):t.messages;return Ae.current=t.status===`running`?[...n].reverse().find(e=>e.role===`assistant`)?.id:void 0,n}),a(t.status===`running`?`Attached to ${t.sessionId} (running)`:`Attached to ${t.sessionId}`);return;case`assistant_delta`:r(e=>GQ(e,t.text,Ae));return;case`reasoning_delta`:r(e=>YQ(e,t.text,t.redacted,Ae));return;case`assistant_media`:r(e=>XQ(e,t.media,Ae));return;case`tool_event`:r(e=>a$(e,t.text,t.event,Ae));return;case`approval_request`:xe(e=>{let n=e.findIndex(e=>e.approvalId===t.approvalId),r={...t,responding:!1};return n===-1?[...e,r]:e.map((e,t)=>t===n?r:e)}),a(`Waiting for approval: ${t.toolName}`);return;case`approval_resolved`:xe(e=>e.filter(e=>e.approvalId!==t.approvalId));return;case`turn_done`:a(`Done (${t.finishReason})`),d(!1),xe([]),Ae.current=void 0,r(e=>u$(e,t.finishReason,t.iterations,t.usage));return;case`reset_done`:Pe.current=void 0,Ne.current=void 0,s(void 0),l(void 0),d(!1),xe([]),Te(!1),C(``),Ae.current=void 0,Fe.current?.(void 0),a(`Started a new chat session.`),r([]);return;case`fork_done`:De(!1),ke(null),a(`Forked → new session ${t.newSessionId}`);return;case`fork_error`:De(!1),ke(t.text),a(`Fork failed: ${t.text}`);return}};return window.addEventListener(`message`,e),O({type:`ready`}),()=>{window.removeEventListener(`message`,e)}},[]),(0,N.useEffect)(()=>{!e||je.current===e||(je.current=e,ze(e))},[ze,e]),(0,N.useEffect)(()=>{E&&O({type:`loadModels`,providerId:E})},[E]),(0,N.useEffect)(()=>{if(!E||!D)return;let e=Ie.current;if(e.lastProvider===E&&e.lastModelByProvider[E]===D)return;let t={lastProvider:E,lastModelByProvider:{...e.lastModelByProvider,[E]:D}};Ie.current=t,T(t),BQ(t)},[E,D]);let Be=h[E]??[],Ve=!!c,He=Be.find(e=>e.id===D)?.supportsThinking===!0?se:`none`,Ue=(0,N.useMemo)(()=>n.filter(e=>e.role!==`meta`||e.text),[n]),We=o&&typeof b.find(e=>e.sessionId===o)?.title==`string`&&b.find(e=>e.sessionId===o)?.title?.trim()||``,Ge=we?S:We,Ke=()=>{if(!o){Te(!1);return}let e=S.replace(/\s+/g,` `).trim();Te(!1),e!==We&&(C(e),O({type:`updateSessionMetadata`,sessionId:o,metadata:{title:e}}))},qe=(e,t)=>{xe(t=>t.map(t=>t.approvalId===e?{...t,responding:!0}:t)),O({type:`approval_response`,approvalId:e,approved:t,reason:t?`Approved in Cline Hub.`:ue}),a(t?`Approval sent.`:`Rejection sent.`)};return(0,M.jsx)(qz,{children:(0,M.jsxs)(`div`,{className:`relative flex h-screen flex-col overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[b.length>0?(0,M.jsxs)(`select`,{className:`max-w-48 rounded-md border bg-background px-2 py-1 text-xs`,disabled:Ve,onChange:e=>{let t=e.target.value;if(!t){O({type:`reset`}),a(`Resetting session...`),xe([]);return}ze(t)},value:o??``,children:[(0,M.jsx)(`option`,{value:``,children:`New session`}),b.map(e=>(0,M.jsx)(`option`,{value:e.sessionId,children:d$(e)},e.sessionId))]}):null,Ve?(0,M.jsxs)(`span`,{className:`ml-2 inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,M.jsx)(Me,{className:`size-3 animate-spin`}),`Loading history`]}):null,o?(0,M.jsx)(`input`,{className:`min-w-0 max-w-56 rounded-md border bg-muted px-2 py-1 text-xs`,disabled:Ve,onBlur:Ke,onChange:e=>C(e.target.value),onFocus:()=>{Te(!0),C(We)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Ke())},placeholder:`Session title`,value:Ge}):null,o?(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{a(`Deleting ${o}...`),O({type:`deleteSession`,sessionId:o})},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(f,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Delete session`})]}):null]}),(0,M.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{O({type:`reset`}),a(`Resetting session...`),xe([])},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(he,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`New chat`})]})})]}),(0,M.jsxs)(Qt,{className:`min-h-0 flex-1`,children:[(0,M.jsxs)($t,{className:`px-4 py-5`,children:[Ve?(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,M.jsx)(Me,{className:`size-4 animate-spin`}),`Loading chat history...`]})}):Ue.length===0?(0,M.jsx)(`div`,{className:`flex h-full items-center align-middle justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:`How can I help you?`}):null,Ue.map(e=>e.role===`meta`||e.role===`error`?(0,M.jsx)(`div`,{className:j(`w-full rounded-lg border px-4 py-3 text-sm`,e.role===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`bg-muted/40 text-muted-foreground`),children:l$(e,{isMeta:!0})},e.id):(0,M.jsx)(DF,{from:e.role,children:(0,M.jsxs)(`div`,{children:[l$(e,{sending:u}),e.role===`user`&&e.checkpoint?(0,M.jsx)(It,{className:`mt-1 justify-end`,children:(0,M.jsxs)(Rt,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:u,onClick:()=>{e.checkpoint&&O({type:`restore`,checkpointRunCount:e.checkpoint.runCount})},tooltip:`Checkpoint from run ${e.checkpoint.runCount}`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(Lt,{className:`size-3`}),f$(e.checkpoint.createdAt)]})}):null,e.role===`assistant`&&e.text&&!u?(0,M.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,M.jsxs)(A,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:Ee,onClick:()=>{De(!0),ke(null),O({type:`forkSession`})},size:`sm`,title:`Fork session — copy full message history into a new session`,type:`button`,variant:`ghost`,children:[Ee?(0,M.jsx)(Me,{className:`size-3 animate-spin`}):(0,M.jsx)($e,{className:`size-3`}),`Fork`]}),Oe?(0,M.jsx)(`span`,{className:`text-[11px] text-destructive`,children:Oe}):null]}):null]})},e.id))]}),(0,M.jsx)(en,{})]}),be.length>0?(0,M.jsx)(`div`,{className:`grid max-h-72 gap-2 overflow-auto border-t bg-background/95 px-4 py-3`,children:be.map(e=>(0,M.jsxs)(`div`,{className:`grid gap-2 rounded-lg border bg-card p-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`p`,{className:`font-semibold`,children:`Approve tool call?`}),(0,M.jsx)(`p`,{className:`break-all text-muted-foreground text-xs`,children:e.toolName})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!1),size:`sm`,type:`button`,variant:`destructive`,children:[(0,M.jsx)(le,{className:`size-4`}),`Reject`]}),(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!0),size:`sm`,type:`button`,children:[e.responding?(0,M.jsx)(Me,{className:`size-4 animate-spin`}):(0,M.jsx)(g,{className:`size-4`}),`Approve`]})]})]}),(0,M.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md border bg-background p-2 text-[11px]`,children:WQ(e.input)})]},e.approvalId))}):null,(0,M.jsx)(FQ,{autoApproveTools:ve,disabled:Ve,enableSpawn:pe,enableTeams:ge,enableTools:de,maxIterations:re,model:D,mode:ae,modelSelectorOpen:Se,models:Be,onAbort:()=>{O({type:`abort`}),a(`Abort requested...`)},onAutoApproveToolsChange:ye,onEnableSpawnChange:me,onEnableTeamsChange:_e,onEnableToolsChange:fe,onModeChange:oe,onMaxIterationsChange:ie,onModelChange:te,onModelSelectorOpenChange:Ce,onProviderChange:e=>{ee(e);let t=w.lastModelByProvider[e],n=(h[e]??[]).map(e=>e.id);if(t&&n.includes(t)){te(t);return}te(``)},onSend:({prompt:e,attachments:t,attachmentCount:n})=>{if(Ve)return;let i=HQ(`assistant`,``);Ae.current=i.id,r(r=>[...r,HQ(`user`,UQ(e,t,n)),i]),d(!0),a(`Running...`),O({type:`send`,prompt:e,attachments:t,config:{autoApproveTools:ve,enableSpawn:pe,enableTeams:ge,enableTools:de,maxIterations:VQ(re),model:D||void 0,mode:ae,provider:E||void 0,reasonLevel:He,systemPrompt:ne.trim()||void 0}})},onSystemPromptChange:k,onReasonLevelChange:ce,provider:E,providers:p,sending:u,status:i,systemPrompt:ne,reasonLevel:He,workspaceRoot:v.workspaceRoot})]})})}export{ZC as a,p$ as default,RE as i,Ew as n,PE as r,LQ as t};
|