zen-gitsync 2.15.8 → 2.15.9
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/README.md +1 -0
- package/package.json +1 -1
- package/src/ui/public/assets/{AppVersionBadge-BmGuEsu2.js → AppVersionBadge-CTLV-gHU.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-DoY43HVz.js → BranchSelector-BCzSC273.js} +1 -1
- package/src/ui/public/assets/{CommitForm-BIwYhnl6.js → CommitForm-BWZGs6s1.js} +1 -1
- package/src/ui/public/assets/{ConsoleView-eoEYLkYu.js → ConsoleView-8fOLdsYa.js} +2 -2
- package/src/ui/public/assets/CustomCommandManager-DJiLDDiH.js +1 -0
- package/src/ui/public/assets/{EditorView-Dvt1LUL7.js → EditorView-Bo-zMCyw.js} +0 -0
- package/src/ui/public/assets/{FlowExecutionViewer-tpbVccBh.js → FlowExecutionViewer-DdjRc5h9.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-BKalhFsV.js → FlowOrchestrationWorkspace-BNYqCbcP.js} +1 -1
- package/src/ui/public/assets/{LogList-D7M5qlo9.js → LogList-DAnUC46X.js} +1 -1
- package/src/ui/public/assets/{MindmapView-u5m7lyGg.js → MindmapView-D1GpooOt.js} +1 -1
- package/src/ui/public/assets/{MonitorView-Wuza9xoA.js → MonitorView-Bv8MMIji.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-BON5_5pd.js → ProjectStartupButton-CP6Kiziu.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-DqVy9_jd.js → RemoteRepoCard-Dc3Mn7cM.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-DyEW_0Bi.js → SourceMapView-DFTEmXn-.js} +1 -1
- package/src/ui/public/assets/{SvgIcon-gZB9aFAd.js → SvgIcon-CyjVBYCr.js} +1 -1
- package/src/ui/public/assets/{TemplateManager-DjnkD7_u.js → TemplateManager-Bbk5I7Wb.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-Cr1SxzIN.js → UserInputNode-Bxfe2Vej.js} +1 -1
- package/src/ui/public/assets/WorkbenchView-CNdwvVNr.js +12 -0
- package/src/ui/public/assets/WorkbenchView-DMoulJCG.css +1 -0
- package/src/ui/public/assets/{_plugin-vue_export-helper-CbbG2Bfw.js → _plugin-vue_export-helper-AKtm5TQX.js} +3 -3
- package/src/ui/public/assets/{configStore-apbbX4nJ.js → configStore-CfU8l9be.js} +1 -1
- package/src/ui/public/assets/element-plus-CL7fBdM_.js +24 -0
- package/src/ui/public/assets/element-plus-Cu9Y2raX.css +1 -0
- package/src/ui/public/assets/flow-mindmap-BmmuW0nH.js +86 -0
- package/src/ui/public/assets/flow-mindmap-CCMw7um8.css +1 -0
- package/src/ui/public/assets/{index-BN1q_ie5.js → index-DG6vgKD4.js} +4 -4
- package/src/ui/public/assets/{socket-io-z4n873W1.js → socket-io-C2w3MxRu.js} +1 -1
- package/src/ui/public/assets/{vendor-SOsdHF7M.js → vendor--LaaJk9m.js} +37 -37
- package/src/ui/public/assets/vendor-CCbwTgrE.css +1 -0
- package/src/ui/public/assets/{vue-flow-D5lw7RxP.js → vue-flow-MtbKS8yD.js} +1 -1
- package/src/ui/public/index.html +10 -10
- package/src/ui/public/assets/CustomCommandManager-BB5dROOG.js +0 -1
- package/src/ui/public/assets/WorkbenchView-CeE1Pog-.js +0 -12
- package/src/ui/public/assets/WorkbenchView-CvHPPs8Q.css +0 -1
- package/src/ui/public/assets/element-plus-DB-NeCl9.js +0 -24
- package/src/ui/public/assets/element-plus-R1nMzM9j.css +0 -1
- package/src/ui/public/assets/flow-mindmap-DYBM6P0r.js +0 -21
- package/src/ui/public/assets/flow-mindmap-l8sIPoN8.css +0 -1
- package/src/ui/public/assets/vendor-CT8e9rs3.css +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import{Cn as e,Fn as t,Jn as n,Ln as r,Mn as i,Tn as a,Vn as o,Zn as s,_n as c,_r as l,ar as u,cn as d,gn as f,gr as p,hn as m,ln as h,mn as g,mr as _,on as v,pr as y,sr as b,un as x,vn as S,xn as C,zn as w}from"./element-plus-CL7fBdM_.js";var T=Object.defineProperty,E=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t,n)=>E(e,typeof t==`symbol`?t:t+``,n),O=[`width`,`height`,`stroke-width`],k={key:4,points:`6 9 12 15 18 9`},ee={key:5,points:`9 6 15 12 9 18`},A=a({__name:`Icon`,props:{name:{},size:{},stroke:{}},setup(e){return(t,n)=>(w(),S(`svg`,{width:e.size??16,height:e.size??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":e.stroke??1.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[e.name===`add`?(w(),S(x,{key:0},[n[0]||=m(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[1]||=m(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`},null,-1),n[2]||=m(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):e.name===`minus`?(w(),S(x,{key:1},[n[3]||=m(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[4]||=m(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):e.name===`delete`?(w(),S(x,{key:2},[n[5]||=C(`<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>`,5)],64)):e.name===`edit`?(w(),S(x,{key:3},[n[6]||=m(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`},null,-1),n[7]||=m(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`},null,-1)],64)):e.name===`collapse`?(w(),S(`polyline`,k)):e.name===`expand`?(w(),S(`polyline`,ee)):e.name===`collapse-all`?(w(),S(x,{key:6},[n[8]||=C(`<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>`,8)],64)):e.name===`expand-all`?(w(),S(x,{key:7},[n[9]||=C(`<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>`,8)],64)):e.name===`expand-level-1`?(w(),S(x,{key:8},[n[10]||=C(`<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>`,8)],64)):e.name===`expand-level-2`?(w(),S(x,{key:9},[n[11]||=C(`<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>`,20)],64)):e.name===`zoom-in`?(w(),S(x,{key:10},[n[12]||=m(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[13]||=m(`line`,{x1:`11`,y1:`8`,x2:`11`,y2:`14`},null,-1),n[14]||=m(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[15]||=m(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):e.name===`zoom-out`?(w(),S(x,{key:11},[n[16]||=m(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[17]||=m(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[18]||=m(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):e.name===`reset`?(w(),S(x,{key:12},[n[19]||=m(`polyline`,{points:`4 9 4 4 9 4`},null,-1),n[20]||=m(`polyline`,{points:`15 4 20 4 20 9`},null,-1),n[21]||=m(`polyline`,{points:`20 15 20 20 15 20`},null,-1),n[22]||=m(`polyline`,{points:`9 20 4 20 4 15`},null,-1)],64)):e.name===`settings`?(w(),S(x,{key:13},[n[23]||=C(`<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>`,9)],64)):e.name===`data`?(w(),S(x,{key:14},[n[24]||=m(`path`,{d:`M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19`},null,-1),n[25]||=m(`path`,{d:`M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19`},null,-1),n[26]||=m(`line`,{x1:`10.5`,y1:`12`,x2:`13.5`,y2:`12`},null,-1)],64)):e.name===`settings`?(w(),S(x,{key:15},[n[27]||=C(`<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>`,9)],64)):e.name===`data`?(w(),S(x,{key:16},[n[28]||=m(`path`,{d:`M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19`},null,-1),n[29]||=m(`path`,{d:`M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19`},null,-1),n[30]||=m(`line`,{x1:`10.5`,y1:`12`,x2:`13.5`,y2:`12`},null,-1)],64)):e.name===`markdown`?(w(),S(x,{key:17},[n[31]||=m(`path`,{d:`M3 17 V7 L7 13 L11 7 V17`},null,-1),n[32]||=m(`path`,{d:`M14 7 V17`},null,-1),n[33]||=m(`path`,{d:`M14 7 L18 12 L22 7`},null,-1),n[34]||=m(`line`,{x1:`14`,y1:`17`,x2:`22`,y2:`17`},null,-1)],64)):e.name===`txt`?(w(),S(x,{key:18},[n[35]||=m(`rect`,{x:`5`,y:`3`,width:`14`,height:`18`,rx:`1.5`},null,-1),n[36]||=m(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[37]||=m(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[38]||=m(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):e.name===`eye`?(w(),S(x,{key:19},[n[39]||=m(`path`,{d:`M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z`},null,-1),n[40]||=m(`circle`,{cx:`12`,cy:`12`,r:`3.2`},null,-1)],64)):e.name===`eye-off`?(w(),S(x,{key:20},[n[41]||=m(`path`,{d:`M3 3 L21 21`},null,-1),n[42]||=m(`path`,{d:`M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2`},null,-1),n[43]||=m(`path`,{d:`M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3`},null,-1),n[44]||=m(`path`,{d:`M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1`},null,-1)],64)):e.name===`outline`?(w(),S(x,{key:21},[n[45]||=m(`rect`,{x:`4`,y:`3`,width:`16`,height:`18`,rx:`2`},null,-1),n[46]||=m(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[47]||=m(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[48]||=m(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):e.name===`logo`?(w(),S(x,{key:22},[n[49]||=C(`<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>`,9)],64)):e.name===`import`?(w(),S(x,{key:23},[n[50]||=m(`path`,{d:`M12 4 V15`},null,-1),n[51]||=m(`polyline`,{points:`7 10 12 15 17 10`},null,-1),n[52]||=m(`path`,{d:`M4 19 H20`},null,-1)],64)):e.name===`export`?(w(),S(x,{key:24},[n[53]||=m(`path`,{d:`M12 15 V4`},null,-1),n[54]||=m(`polyline`,{points:`7 9 12 4 17 9`},null,-1),n[55]||=m(`path`,{d:`M4 19 H20`},null,-1)],64)):e.name===`balance`?(w(),S(x,{key:25},[n[56]||=C(`<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>`,9)],64)):e.name===`mindmap`?(w(),S(x,{key:26},[n[57]||=C(`<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>`,9)],64)):e.name===`tree`?(w(),S(x,{key:27},[n[58]||=C(`<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>`,9)],64)):e.name===`org`?(w(),S(x,{key:28},[n[59]||=C(`<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>`,9)],64)):e.name===`image`?(w(),S(x,{key:29},[n[60]||=m(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`},null,-1),n[61]||=m(`circle`,{cx:`9`,cy:`11`,r:`1.6`},null,-1),n[62]||=m(`polyline`,{points:`3 17 9 12 13 15 16 13 21 17`},null,-1)],64)):e.name===`x`?(w(),S(x,{key:30},[n[63]||=m(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1),n[64]||=m(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1)],64)):e.name===`link`?(w(),S(x,{key:31},[n[65]||=m(`path`,{d:`M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1`},null,-1),n[66]||=m(`path`,{d:`M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1`},null,-1)],64)):e.name===`note`?(w(),S(x,{key:32},[n[67]||=m(`path`,{d:`M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z`},null,-1),n[68]||=m(`line`,{x1:`8`,y1:`10`,x2:`16`,y2:`10`},null,-1),n[69]||=m(`line`,{x1:`8`,y1:`13`,x2:`16`,y2:`13`},null,-1),n[70]||=m(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):c(``,!0)],8,O))}}),j=`data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e`,te=`data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e`,M=[18,15,13,12],N=[700,600,500,400],ne=[52,40,32,28],re=[120,80,60,44],ie=[.8,.8,.8,.8],ae=M.length-1;function oe(e,t){return Math.round(se(e,t)*ie[P(e)])}function P(e){return Math.min(ae,Math.max(0,e))}function se(e,t=14){return Math.round(M[P(e)]*t/14*10)/10}function F(e,t=14){return Math.round(ne[P(e)]*t/14)}var ce=60,I=14,L=24,le=null;function ue(){if(le)return le;let e=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null;return e?(le=e,e):{font:``,measureText:()=>({width:0})}}var de=new Map;function fe(e,t,n){let r=`${n}|${t}|${e}`,i=de.get(r);if(i!==void 0)return i;let a=ue();a.font=`${n} ${t}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;let o=a.measureText(e).width;return de.set(r,o),o}var pe=24,me=400,he=8,ge=16,_e=4,ve=200;function ye(e,t,n){return Math.min(n,Math.max(t,e))}function be(e,t,n,r,i){let a=P(t),o=se(t,n),s=Math.min(fe(e.text||``,o,N[a]),ve),c=oe(t,n),l=Math.ceil(s+c*2),u=e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)?Math.ceil(o*1.2)+6:F(t,n),d=0;if(e.link&&(d+=ge),e.note&&(d+=ge),d>0){let t=+!!e.link+ +!!e.note;d+=_e*t}let f=l+d,p=(()=>{let t=Math.round(re[a]*n/14);if(e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)){let n=i?.[e.id];return Math.max(t,n??240)}return t})(),m=!!(e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)),h=r?.[e.id],g=m?Math.max(24,h??Math.max(70,Math.ceil(o*5))):0,_=g>0?10:0;if(!e.image)return{w:Math.max(p,f),h:Math.ceil(u+_+g)};let v=ye(e.image.width,pe,me);return{w:Math.max(p,f,Math.ceil(v+c*2)),h:Math.ceil(e.image.height+he+u+_+g)}}function xe(e,t={}){let n=t.mode??`mindmap`,r=t.preservePositions===!0,i=R(e,0,null,1,`right`,t.baseFontSize??14,t.richHeights,t.richWidths);return Te(i),Se(i,n,r),i.x=0,i.y=0,Ee(i,r)}function Se(e,t,n=!1){if(t===`mindmap`){let t=e.children;if(t.length!==0)if(t.length===1)t[0]._dir=`right`,t[0].side=1,t[0]._dirRight=1;else{let e=t.reduce((e,t)=>e+t._subtreeH,0),n=1,r=Math.abs(t[0]._subtreeH-(e-t[0]._subtreeH)),i=0;for(let a=0;a<t.length-1;a++){i+=t[a]._subtreeH;let o=Math.abs(i-(e-i));o<r&&(r=o,n=a+1)}for(let e=0;e<n;e++)t[e]._dir=`right`,t[e].side=1,t[e]._dirRight=1;for(let e=n;e<t.length;e++)t[e]._dir=`left`,t[e].side=-1,t[e]._dirRight=-1}let r=e.children.filter(e=>e.side===1),i=e.children.filter(e=>e.side===-1),a=(e,t)=>{let n=t===`right`?1:-1;e._dir=t,e.side=n,e._dirRight=n;for(let n of e.children)a(n,t)};for(let e of r)a(e,`right`);for(let e of i)a(e,`left`);r.length>0&&Ce({...e,children:r},`right`,ce,!0,n),i.length>0&&Ce({...e,children:i},`left`,ce,!0,n)}else if(t===`tree`){let t=e=>{e.side=1,e._dir=`right`;for(let n of e.children)t(n)};for(let t of e.children)t._dir=`right`;Ce(e,`right`,ce,!0,n),t(e)}else{for(let t of e.children)t._dir=`down`;we(e,ce,n)}}function Ce(e,t,n,r,i=!1){if(e.children.length===0)return;let a=e.children.reduce((e,t,n)=>e+t._subtreeH+(n>0?I:0),0),o=t===`right`?1:-1,s=r?o:1,c=e.y-s*a/2;e.children.forEach(r=>{i||(r.x=e.x+o*(e.width/2+n+r.width/2),r.y=c+s*r._subtreeH/2),r._dir=t,c+=s*(r._subtreeH+I),Ce(r,t,n,!1,i)})}function we(e,t,n=!1){if(e.children.length===0)return;let r=e.children.reduce((e,t,n)=>e+t._subtreeW+(n>0?I*2:0),0),i=e.x-r/2;e.children.forEach(r=>{n||(r.x=i+r._subtreeW/2,r.y=e.y+e.height/2+t+r.height/2),r._dir=`down`,i+=r._subtreeW+I*2,we(r,t,n)})}function R(e,t,n,r,i,a,o,s){let c=be(e,t,a,o,s),l={id:e.id,text:e.text,depth:t,x:e._x??0,y:e._y??0,width:c.w,height:c.h,fontSize:se(t,a),isRoot:t===0,collapsed:e.collapsed,side:r,_dir:i,_dirRight:r,_subtreeH:c.h,_subtreeW:c.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return l;let u=e.children.length,d=Math.ceil(u/2);return l.children=e.children.map((e,n)=>{let c=t===0?n<d?1:-1:r;return R(e,t+1,l,c,i,a,o,s)}),l}function Te(e){let t=[e];for(let e=0;e<t.length;e++){let n=t[e];for(let e of n.children)t.push(e)}for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.collapsed||n.children.length===0){n._subtreeH=n.height,n._subtreeW=n.width;continue}let r=0,i=0;for(let e of n.children)r+=e._subtreeH,i+=e._subtreeW;n.children.length>1&&(r+=I*(n.children.length-1),i+=I*2*(n.children.length-1)),n._subtreeH=Math.max(n.height,r),n._subtreeW=Math.max(n.width,i)}}function Ee(e,t=!1){let n=[e],r=1/0,i=-1/0,a=1/0,o=-1/0;for(;n.length;){let e=n.pop(),t=e.width/2,s=e.height/2;e.x-t<r&&(r=e.x-t),e.x+t>i&&(i=e.x+t),e.y-s<a&&(a=e.y-s),e.y+s>o&&(o=e.y+s),n.push(...e.children)}if(t)return{root:e,width:i-r+L*2,height:o-a+L*2,vbX:r-L,vbY:a-L,vbW:i-r+L*2,vbH:o-a+L*2};let s=L-a,c=[e];for(;c.length;){let e=c.pop();e.y+=s,c.push(...e.children)}return a+=s,o+=s,{root:e,width:i-r+L*2,height:o+L,vbX:r-L,vbY:0,vbW:i-r+L*2,vbH:o+L}}var De=[{id:`default`,name:`默认`,colors:[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`]},{id:`classic`,name:`经典`,colors:[`#ef4444`,`#f59e0b`,`#10b981`,`#3b82f6`,`#6366f1`,`#8b5cf6`,`#ec4899`,`#14b8a6`]},{id:`vivid`,name:`活力`,colors:[`#dc2626`,`#ea580c`,`#ca8a04`,`#16a34a`,`#0891b2`,`#2563eb`,`#7c3aed`,`#db2777`]},{id:`dev`,name:`代码`,colors:[`#f472b6`,`#a78bfa`,`#60a5fa`,`#38bdf8`,`#22d3ee`,`#34d399`,`#facc15`,`#fb923c`]},{id:`mint`,name:`薄荷`,colors:[`#5eead4`,`#67e8f9`,`#93c5fd`,`#c4b5fd`,`#fbcfe8`,`#fde68a`,`#a7f3d0`,`#bae6fd`]}];function Oe(e,t=[]){return[...De,...t].find(t=>t.id===e)??De[0]}function ke(){return`n_`+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ae(e){return JSON.parse(JSON.stringify(e))}function z(e,t){if(e.id===t)return e;for(let n of e.children){let e=z(n,t);if(e)return e}return null}function je(e,t,n=null){if(e.id===t)return n;for(let n of e.children){let r=je(n,t,e);if(r!==null)return r}return null}function Me(e,t){let n=e.children.findIndex(e=>e.id===t);if(n>=0)return e.children.splice(n,1),!0;for(let n of e.children)if(Me(n,t))return!0;return!1}function Ne(e,t,n){let r=z(e,t);return!r||r.text===n?!1:(r.text=n,!0)}function Pe(e,t,n,r){if(!je(e,t)||t===n||z(z(e,t),n))return!1;let i=je(e,t),a=i.children.findIndex(e=>e.id===t);if(a<0)return!1;let[o]=i.children.splice(a,1);if(r===`child`){let t=z(e,n);return t?(t.children.push(o),!0):(i.children.splice(a,0,o),!1)}let s=je(e,n);if(!s)return i.children.splice(a,0,o),!1;let c=s.children.findIndex(e=>e.id===n);return c<0?(i.children.splice(a,0,o),!1):(r===`after`&&(c+=1),s.children.splice(c,0,o),!0)}function Fe(e){let t=/^新节点(?:\s+(\d+))?$/,n=0,r=!1;for(let i of e.children){let e=i.text.match(t);if(e)if(e[1]){let t=parseInt(e[1],10);t>n&&(n=t)}else r=!0}return n===0&&!r?Ve:n>0?`新节点 ${n+1}`:`新节点 2`}function Ie(e,t,n){let r=z(e,t);if(!r)return null;let i={id:ke(),text:n??Fe(r),children:[]};return r.children.push(i),i}function Le(e,t,n){let r=je(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:ke(),text:n??Fe(r),children:[]};return r.children.splice(i+1,0,a),a}function Re(e,t,n){let r=je(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:ke(),text:n,children:[]};return r.children.splice(i,0,a),a}function ze(e,t){let n=je(e,t);if(!n)return null;let r=n.children.findIndex(e=>e.id===t);if(r<0)return null;let i=n.children[r],a=Ae(i);return Be(a),n.children.splice(r+1,0,a),a}function Be(e){e.id=ke();for(let t of e.children)Be(t)}var Ve=`新节点`;function He(e,t=`导入的导图`){let n=e.split(/\r?\n/),r={id:ke(),text:t,children:[]},i=[r],a=[-1/0],o=[],s=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,l=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,u=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,d=!1,f=[],p=null;function m(e){f.push(e)}function h(){if(p&&f.length>0){for(;f.length>0&&f[0].trim()===``;)f.shift();for(;f.length>0&&f[f.length-1].trim()===``;)f.pop();let e=f.join(`
|
|
2
|
+
`);e&&(p.note={text:e})}d=!1,f=[]}for(let e of n){if(d){let t=e.match(u);if(t&&t[1][0]==="`"){h();continue}m(e);continue}let t=e.match(s);if(t){let e=t[1].length,n=t[2].trim();o.push({level:e,text:n,body:``}),p=o[o.length-1];continue}let n=e.match(u);if(n&&n[2]===`note`){d=!0,f=[];continue}let r=e.match(c);if(r&&p){let e=r[2];p.image={src:e,naturalW:160,naturalH:120,width:160,height:120};continue}let i=e.match(l);if(i&&p){p.link={url:i[2]},p.text=i[1];continue}if(e.trim().length>0&&p){let t=e.trim();p.body=p.body?p.body+`
|
|
3
|
+
`+t:t}}d&&h();function g(e){for(;i.length>1;){let t=a[i.length-1];if(t!==void 0&&t<e.level)break;i.pop(),a.pop()}let t=i[i.length-1],n=e.text,r={id:ke(),text:n,children:[]};e.image&&(r.image={...e.image}),e.link&&(r.link={url:e.link.url}),e.note&&(r.note={text:e.note.text}),e.body&&(r.note={text:e.body}),t.children.push(r),i.push(r),a.push(e.level)}for(let e of o)g(e);if(o.length>0&&o[0].level===1){let e=r.children[0];e&&(r.text=e.text,r.id=e.id,e.image&&(r.image={...e.image}),e.link&&(r.link={url:e.link.url}),e.note&&(r.note={text:e.note.text}),r.children=e.children)}return r}function Ue(e,t=1){let n=`#`.repeat(t)+` `+(e.text||``)+`
|
|
4
|
+
`;e.link&&(n+=`[${e.text||`link`}](${e.link.url})
|
|
5
|
+
`),e.image&&(n+=`
|
|
6
|
+
`),e.note&&(n+="```note\n"+e.note.text+"\n```\n"),e.richContent&&(n+=e.richContent.raw+`
|
|
7
|
+
`);for(let r of e.children)n+=Ue(r,t+1);return n}function We(e){let t=e.split(/\r?\n/),n=[],r=0,i=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,o=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,s=/^(\s*)[-*+]\s+(.*)$/,c=/^(\s*)\d+\.\s+(.*)$/;for(;r<t.length;){let e=t[r],l=e.match(a);if(l){let i=l[1][0],o=l[2]||``,s=[e];for(r++;r<t.length;){let e=t[r].match(a);if(e&&e[1][0]===i){s.push(t[r]),r++;break}s.push(t[r]),r++}let c=s.slice(1,-1).join(`
|
|
8
|
+
`).trim();n.push({kind:`code`,text:c.split(`
|
|
9
|
+
`)[0]?.slice(0,80)||`(空代码块)`,raw:s.join(`
|
|
10
|
+
`),lang:o});continue}let u=e.match(i);if(u){n.push({kind:`heading`,level:u[1].length,text:u[2].trim(),raw:e}),r++;continue}if(/^\s*\|/.test(e)){let e=[],i=r,a=!1;for(;i<t.length&&/^\s*\|/.test(t[i]);)e.push(t[i]),o.test(t[i])&&(a=!0),i++;if(a&&e.length>=2){n.push({kind:`table`,text:e[0].replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`)[0]?.trim()||`表格`,raw:e.join(`
|
|
11
|
+
`)}),r=i;continue}}let d=e.match(s),f=e.match(c);if(d||f){let e=r;for(;e<t.length;){let r=t[e].match(s),i=t[e].match(c);if(!(r||i))break;let a=t[e].replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim();a.length>0&&n.push({kind:`list`,text:a.slice(0,80)||`(列表项)`,raw:t[e]}),e++}r=e;continue}if(e.trim()===``){r++;continue}let p=[e],m=r+1;for(;m<t.length;){let e=t[m];if(e.trim()===``||i.test(e)||a.test(e)||s.test(e)||c.test(e)||/^\s*\|/.test(e))break;p.push(e),m++}let h=p.join(` `).trim();n.push({kind:`paragraph`,text:h.slice(0,80)||`(空段落)`,raw:p.join(`
|
|
12
|
+
`)}),r=m}return n}function B(e,t=`导入的导图`){let n=We(e||``),r={id:ke(),text:t,children:[]},i=[r],a=[0],o=!1;function s(e){if(e.kind===`heading`){let t=e.level;for(;i.length>1&&a[a.length-1]>=t;)i.pop(),a.pop();if(!o&&t===1){o=!0,r.text=e.text,a[0]=1;return}let n={id:ke(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:ke(),text:e.text,children:[],richContent:{kind:e.kind,raw:e.raw,lang:e.lang}};i[i.length-1].children.push(t)}for(let e of n)s(e);return r}function Ge(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=b(1),a=b(0),o=b(0),s=b(!1),c=u({x:0,y:0,ox:0,oy:0}),l=b(!1),d=u({x:0,y:0}),f=u({x:0,y:0,width:0,height:0}),p=b(0),m=null;function h(e){m=e}function g(r){r.preventDefault();let s=e.getContainer();if(!s)return;let c=-r.deltaY*.001,l=Math.min(n,Math.max(t,i.value*(1+c))),u=s.getBoundingClientRect(),d=r.clientX-u.left,f=r.clientY-u.top,p=(d-a.value)/i.value,m=(f-o.value)/i.value;i.value=l,a.value=d-p*l,o.value=f-m*l}function _(){i.value=Math.min(n,i.value*r)}function v(){i.value=Math.max(t,i.value/r)}function y(e){var t;e.target.closest(`.zm-node, .zm-toolbar, button, input, textarea`)||(s.value=!0,c.x=e.clientX,c.y=e.clientY,c.ox=a.value,c.oy=o.value,window.addEventListener(`mousemove`,x),window.addEventListener(`mouseup`,S),(t=e.preventDefault)==null||t.call(e))}function x(e){s.value&&(a.value=c.ox+(e.clientX-c.x),o.value=c.oy+(e.clientY-c.y))}function S(){s.value=!1,window.removeEventListener(`mousemove`,x),window.removeEventListener(`mouseup`,S)}function C(e,t){l.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,p.value++,window.addEventListener(`mousemove`,E),window.addEventListener(`mouseup`,T)}function w(e,t){if(!l.value)return;let n=Math.min(d.x,e),r=Math.min(d.y,t),i=Math.max(d.x,e),a=Math.max(d.y,t);f.x=n,f.y=r,f.width=i-n,f.height=a-r,p.value++}function T(){l.value=!1,window.removeEventListener(`mousemove`,E),window.removeEventListener(`mouseup`,T),m&&m()}function E(t){if(!l.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();w((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function D(t,n,r,s=60){let c=e.getContainer();if(!c)return;let l=c.getBoundingClientRect(),u=(l.width-s*2)/t,d=(l.height-s*2)/n,f=Math.min(1,Math.max(.3,Math.min(u,d)));i.value=f,a.value=l.width/2,o.value=l.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,onWheel:g,zoomIn:_,zoomOut:v,startPan:y,startMarquee:C,updateMarquee:w,isMarquee:l,marquee:f,marqueeVersion:p,setOnMarqueeEnd:h,resetView:D}}var Ke=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function qe(e){return Ke?e.metaKey:e.ctrlKey}function Je(e){function n(){return e.getSelectedId()||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function i(t){let r=t.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=n();if(a){if(qe(t)&&!t.shiftKey){if(t.key===`d`||t.key===`D`){i&&i!==e.getRootId()&&(t.preventDefault(),e.onDuplicate(i));return}if(t.key===`z`||t.key===`Z`){t.preventDefault(),e.onUndo();return}if(t.key===`y`||t.key===`Y`){t.preventDefault(),e.onRedo();return}if(t.key===`Home`){t.preventDefault(),e.onSelectRoot();return}}if(qe(t)&&t.shiftKey&&(t.key===`Z`||t.key===`z`)){t.preventDefault(),e.onRedo();return}t.key===`Tab`?(t.preventDefault(),e.onAddChild(a)):t.key===`Enter`?(t.preventDefault(),t.shiftKey?i&&i!==e.getRootId()&&e.onAddSiblingBefore(i):e.onAddSibling(a)):(t.key===`Delete`||t.key===`Backspace`)&&i&&i!==e.getRootId()?(t.preventDefault(),e.onRemove(i)):t.key===`F2`&&i?(t.preventDefault(),e.onStartEdit(i)):t.key===`Escape`?(t.preventDefault(),e.onClearSelection()):t.key===`ArrowDown`?(t.preventDefault(),e.onNavigate(0,1)):t.key===`ArrowUp`?(t.preventDefault(),e.onNavigate(0,-1)):t.key===`ArrowRight`?(t.preventDefault(),e.onNavigate(1,0)):t.key===`ArrowLeft`&&(t.preventDefault(),e.onNavigate(-1,0))}}r(()=>{window.addEventListener(`keydown`,i)}),t(()=>{window.removeEventListener(`keydown`,i)})}function Ye(e=100){let t=b([]),n=-1;function r(){return n>0}function i(){return n<t.value.length-1}function a(r){let i=JSON.stringify(r);for(n<t.value.length-1&&(t.value=t.value.slice(0,n+1)),t.value.push(i),n=t.value.length-1;t.value.length>e;)t.value.shift(),n--}function o(){return r()?(n--,JSON.parse(t.value[n])):null}function s(){return i()?(n++,JSON.parse(t.value[n])):null}function c(){t.value=[],n=-1}return{canUndo:r,canRedo:i,record:a,undo:o,redo:s,reset:c}}var Xe=a({__name:`NodeContextMenu`,props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`close`],setup(n,{emit:r}){let i=n,a=r,o=g(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect(),r=4+(3+ +!!i.hasImage+ +!!i.hasLink+ +!!i.hasNote+1+ +!!i.hasCode+1+ +!!i.hasTable)*28;e+180>n.right&&(e=Math.max(n.left+4,i.x-180-2)),t+r>n.bottom&&(t=Math.max(n.top+4,i.y-r-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=g(()=>i.hasImage),u=g(()=>i.hasLink),d=g(()=>i.hasNote);function f(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||a(`close`)}function _(e){e.key===`Escape`&&a(`close`)}function v(){a(`close`)}window.addEventListener(`mousedown`,f,!0),window.addEventListener(`keydown`,_,!0),window.addEventListener(`wheel`,v,!0),window.addEventListener(`scroll`,v,!0),t(()=>{window.removeEventListener(`mousedown`,f,!0),window.removeEventListener(`keydown`,_,!0),window.removeEventListener(`wheel`,v,!0),window.removeEventListener(`scroll`,v,!0)});function y(e){e(),a(`close`)}return(t,r)=>(w(),S(`div`,{class:`zm-node-menu`,style:p({left:o.value.left+`px`,top:o.value.top+`px`}),onContextmenu:r[10]||=h(()=>{},[`prevent`])},[m(`button`,{class:`zm-node-menu-item`,onClick:r[0]||=h(e=>y(()=>a(`pickImage`)),[`stop`])},[e(A,{name:`image`,size:13}),m(`span`,null,l(s.value?`替换图片`:`添加图片`),1)]),s.value?(w(),S(`button`,{key:0,class:`zm-node-menu-item`,onClick:r[1]||=h(e=>y(()=>a(`removeImage`)),[`stop`])},[e(A,{name:`x`,size:13}),r[11]||=m(`span`,null,`移除图片`,-1)])):c(``,!0),m(`button`,{class:`zm-node-menu-item`,onClick:r[2]||=h(e=>y(()=>a(`setLink`)),[`stop`])},[e(A,{name:`link`,size:13}),m(`span`,null,l(u.value?`编辑链接`:`添加链接`),1)]),u.value?(w(),S(`button`,{key:1,class:`zm-node-menu-item`,onClick:r[3]||=h(e=>y(()=>a(`removeLink`)),[`stop`])},[e(A,{name:`x`,size:13}),r[12]||=m(`span`,null,`移除链接`,-1)])):c(``,!0),m(`button`,{class:`zm-node-menu-item`,onClick:r[4]||=h(e=>y(()=>a(`addCode`)),[`stop`])},[r[13]||=m(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),m(`span`,null,l(n.hasCode?`编辑代码块`:`添加代码块`),1)]),n.hasCode?(w(),S(`button`,{key:2,class:`zm-node-menu-item`,onClick:r[5]||=h(e=>y(()=>a(`removeCode`)),[`stop`])},[e(A,{name:`x`,size:13}),r[14]||=m(`span`,null,`移除代码块`,-1)])):c(``,!0),m(`button`,{class:`zm-node-menu-item`,onClick:r[6]||=h(e=>y(()=>a(`addTable`)),[`stop`])},[r[15]||=m(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),m(`span`,null,l(n.hasTable?`编辑表格`:`添加表格`),1)]),n.hasTable?(w(),S(`button`,{key:3,class:`zm-node-menu-item`,onClick:r[7]||=h(e=>y(()=>a(`removeTable`)),[`stop`])},[e(A,{name:`x`,size:13}),r[16]||=m(`span`,null,`移除表格`,-1)])):c(``,!0),m(`button`,{class:`zm-node-menu-item`,onClick:r[8]||=h(e=>y(()=>a(`editNote`)),[`stop`])},[e(A,{name:`note`,size:13}),m(`span`,null,l(d.value?`编辑笔记`:`添加笔记`),1)]),d.value?(w(),S(`button`,{key:4,class:`zm-node-menu-item`,onClick:r[9]||=h(e=>y(()=>a(`removeNote`)),[`stop`])},[e(A,{name:`x`,size:13}),r[17]||=m(`span`,null,`移除笔记`,-1)])):c(``,!0)],36))}}),Ze=a({__name:`CanvasContextMenu`,props:{x:{},y:{},container:{}},emits:[`openSettings`,`openData`,`openImport`,`close`],setup(n,{emit:r}){let i=n,a=r,o=g(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect();e+160>n.right&&(e=Math.max(n.left+4,i.x-160-2)),t+88>n.bottom&&(t=Math.max(n.top+4,i.y-88-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=b(!1),l=b(null),u=g(()=>{if(!l.value)return{left:`-9999px`,top:`-9999px`,display:`none`};let e=l.value.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=e.right;r+176>t-4&&(r=Math.max(4,e.left-176));let i=e.top-4;return i+88>n-4&&(i=Math.max(4,n-88-4)),{left:r+`px`,top:i+`px`,display:`block`}}),d=null,f=null;function v(){f&&=(clearTimeout(f),null),d=setTimeout(()=>{s.value=!0},60)}function y(){d&&=(clearTimeout(d),null),f=setTimeout(()=>{s.value=!1},120)}t(()=>{d&&clearTimeout(d),f&&clearTimeout(f)});function x(e){let t=e.target;t&&t.closest(`.zm-canvas-menu`)||a(`close`)}function C(e){e.key===`Escape`&&a(`close`)}function T(){a(`close`)}window.addEventListener(`mousedown`,x,!0),window.addEventListener(`keydown`,C,!0),window.addEventListener(`wheel`,T,!0),window.addEventListener(`scroll`,T,!0),t(()=>{window.removeEventListener(`mousedown`,x,!0),window.removeEventListener(`keydown`,C,!0),window.removeEventListener(`wheel`,T,!0),window.removeEventListener(`scroll`,T,!0)});function E(e){e(),a(`close`)}return(t,n)=>(w(),S(`div`,{class:`zm-canvas-menu`,style:p({left:o.value.left+`px`,top:o.value.top+`px`}),onContextmenu:n[5]||=h(()=>{},[`prevent`])},[m(`button`,{class:`zm-canvas-menu-item`,onClick:n[0]||=h(e=>E(()=>a(`openData`)),[`stop`])},[e(A,{name:`data`,size:13}),n[6]||=m(`span`,null,`查看数据`,-1)]),m(`div`,{ref_key:`importItemRef`,ref:l,class:_([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":s.value}]),onMouseenter:v,onMouseleave:y},[e(A,{name:`import`,size:13}),n[10]||=m(`span`,null,`导入`,-1),n[11]||=m(`svg`,{class:`zm-canvas-menu-caret`,width:`8`,height:`8`,viewBox:`0 0 8 8`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[m(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),s.value?(w(),S(`div`,{key:0,class:`zm-canvas-submenu`,style:p(u.value),onMouseenter:v,onMouseleave:y},[m(`button`,{class:`zm-canvas-menu-item`,onClick:n[1]||=h(e=>E(()=>a(`openImport`,`markdown`)),[`stop`])},[e(A,{name:`markdown`,size:13}),n[7]||=m(`span`,null,`Markdown 导入`,-1)]),m(`button`,{class:`zm-canvas-menu-item`,onClick:n[2]||=h(e=>E(()=>a(`openImport`,`json`)),[`stop`])},[e(A,{name:`data`,size:13}),n[8]||=m(`span`,null,`JSON 文件导入`,-1)]),m(`button`,{class:`zm-canvas-menu-item`,onClick:n[3]||=h(e=>E(()=>a(`openImport`,`txt`)),[`stop`])},[e(A,{name:`note`,size:13}),n[9]||=m(`span`,null,`TXT 文件导入`,-1)])],36)):c(``,!0)],34),m(`button`,{class:`zm-canvas-menu-item`,onClick:n[4]||=h(e=>E(()=>a(`openSettings`)),[`stop`])},[e(A,{name:`settings`,size:13}),n[12]||=m(`span`,null,`设置`,-1)])],36))}});function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function $e(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r===`object`||r===`function`)&&!Object.isFrozen(n)&&$e(n)}),e}var et=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function tt(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function nt(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var rt=`</span>`,it=e=>!!e.scope,at=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},ot=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=tt(e)}openNode(e){if(!it(e))return;let t=at(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){it(e)&&(this.buffer+=rt)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},st=(e={})=>{let t={children:[]};return Object.assign(t,e),t},ct=class e{constructor(){this.rootNode=st(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=st({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},lt=class extends ct{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new ot(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ut(e){return e?typeof e==`string`?e:e.source:null}function dt(e){return mt(`(?=`,e,`)`)}function ft(e){return mt(`(?:`,e,`)*`)}function pt(e){return mt(`(?:`,e,`)?`)}function mt(...e){return e.map(e=>ut(e)).join(``)}function ht(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function gt(...e){return`(`+(ht(e).capture?``:`?:`)+e.map(e=>ut(e)).join(`|`)+`)`}function _t(e){return RegExp(e.toString()+`|`).exec(``).length-1}function vt(e,t){let n=e&&e.exec(t);return n&&n.index===0}var yt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function bt(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=ut(e),i=``;for(;r.length>0;){let e=yt.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var xt=/\b\B/,St=`[a-zA-Z]\\w*`,Ct=`[a-zA-Z_]\\w*`,wt=`\\b\\d+(\\.\\d+)?`,V=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,H=`\\b(0b[01]+)`,Tt=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Et=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=mt(t,/.*\b/,e.binary,/\b.*/)),nt({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},U={begin:`\\\\[\\s\\S]`,relevance:0},Dt={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[U]},Ot={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[U]},kt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},At=function(e,t,n={}){let r=nt({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=gt(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:mt(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},jt=At(`//`,`$`),Mt=At(`/\\*`,`\\*/`),Nt=At(`#`,`$`),Pt=Object.freeze({__proto__:null,APOS_STRING_MODE:Dt,BACKSLASH_ESCAPE:U,BINARY_NUMBER_MODE:{scope:`number`,begin:H,relevance:0},BINARY_NUMBER_RE:H,COMMENT:At,C_BLOCK_COMMENT_MODE:Mt,C_LINE_COMMENT_MODE:jt,C_NUMBER_MODE:{scope:`number`,begin:V,relevance:0},C_NUMBER_RE:V,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Nt,IDENT_RE:St,MATCH_NOTHING_RE:xt,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:wt,relevance:0},NUMBER_RE:wt,PHRASAL_WORDS_MODE:kt,QUOTE_STRING_MODE:Ot,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[U,{begin:/\[/,end:/\]/,relevance:0,contains:[U]}]},RE_STARTERS_RE:Tt,SHEBANG:Et,TITLE_MODE:{scope:`title`,begin:St,relevance:0},UNDERSCORE_IDENT_RE:Ct,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:Ct,relevance:0}});function Ft(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function It(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Lt(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=Ft,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Rt(e,t){Array.isArray(e.illegal)&&(e.illegal=gt(...e.illegal))}function zt(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function Bt(e,t){e.relevance===void 0&&(e.relevance=1)}var Vt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=mt(n.beforeMatch,dt(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Ht=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],Ut=`keyword`;function W(e,t,n=Ut){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,W(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Wt(n[0],n[1])]})}}function Wt(e,t){return t?Number(t):+!Gt(e)}function Gt(e){return Ht.includes(e.toLowerCase())}var Kt={},qt=e=>{console.error(e)},Jt=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Yt=(e,t)=>{Kt[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Kt[`${e}/${t}`]=!0)},Xt=Error();function Zt(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=_t(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Qt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw qt(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Xt;if(typeof e.beginScope!=`object`||e.beginScope===null)throw qt(`beginScope must be object`),Xt;Zt(e,e.begin,{key:`beginScope`}),e.begin=bt(e.begin,{joinWith:``})}}function $t(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw qt(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Xt;if(typeof e.endScope!=`object`||e.endScope===null)throw qt(`endScope must be object`),Xt;Zt(e,e.end,{key:`endScope`}),e.end=bt(e.end,{joinWith:``})}}function en(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function tn(e){en(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Qt(e),$t(e)}function nn(e){function t(t,n){return new RegExp(ut(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=_t(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(bt(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function a(n,r){let o=n;if(n.isCompiled)return o;[It,zt,tn,Vt].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[Lt,Rt,Bt].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=W(n.keywords,e.case_insensitive),o.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,o.beginRe=t(o.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(o.endRe=t(o.end)),o.terminatorEnd=ut(o.end)||``,n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(o.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return an(e===`self`?n:e)})),n.contains.forEach(function(e){a(e,o)}),n.starts&&a(n.starts,r),o.matcher=i(o),o}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=nt(e.classNameAliases||{}),a(e)}function rn(e){return e?e.endsWithParent||rn(e.starts):!1}function an(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return nt(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:rn(e)?nt(e,{starts:e.starts?nt(e.starts):null}):Object.isFrozen(e)?nt(e):e}var on=`11.11.1`,sn=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},cn=tt,ln=nt,un=Symbol(`nomatch`),dn=7,fn=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,a=`Could not find the language '{}', did you forget to load/include a language module?`,o={disableAutodetect:!0,name:`Plain text`,contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:lt};function c(e){return s.noHighlightRe.test(e)}function l(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=s.languageDetectRe.exec(t);if(n){let t=w(n[1]);return t||(Jt(a.replace(`{}`,n[1])),Jt(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>c(e)||w(e))}function u(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Yt(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Yt(`10.7.0`,`Please use highlight(code, options) instead.
|
|
13
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ee(`before:highlight`,a);let o=a.result?a.result:d(a.language,a.code,n);return o.code=a.code,ee(`after:highlight`,o),o}function d(e,n,r,o){let c=Object.create(null);function l(e,t){return e.keywords[t]}function u(){if(!k.keywords){A.addText(j);return}let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(j),n=``;for(;t;){n+=j.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=l(k,r);if(i){let[e,a]=i;if(A.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=dn&&(te+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(j)}n+=j.substring(e),A.addText(n)}function f(){if(j===``)return;let e=null;if(typeof k.subLanguage==`string`){if(!t[k.subLanguage]){A.addText(j);return}e=d(k.subLanguage,j,!0,ee[k.subLanguage]),ee[k.subLanguage]=e._top}else e=p(j,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(te+=e.relevance),A.__addSublanguage(e._emitter,e.language)}function m(){k.subLanguage==null?u():f(),j=``}function h(e,t){e!==``&&(A.startScope(t),A.addText(e),A.endScope())}function g(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?h(i,r):(j=i,u(),j=``),n++}}function _(e,t){return e.scope&&typeof e.scope==`string`&&A.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(j,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),j=``):e.beginScope._multi&&(g(e.beginScope,t),j=``)),k=Object.create(e,{parent:{value:k}}),k}function v(e,t,n){let r=vt(e.endRe,n);if(r){if(e[`on:end`]){let n=new et(e);e[`on:end`](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,n)}function y(e){return k.matcher.regexIndex===0?(j+=e[0],1):(ne=!0,0)}function b(e){let t=e[0],n=e.rule,r=new et(n),i=[n.__beforeBegin,n[`on:begin`]];for(let n of i)if(n&&(n(e,r),r.isMatchIgnored))return y(t);return n.skip?j+=t:(n.excludeBegin&&(j+=t),m(),!n.returnBegin&&!n.excludeBegin&&(j=t)),_(n,e),n.returnBegin?0:t.length}function x(e){let t=e[0],r=n.substring(e.index),i=v(k,e,r);if(!i)return un;let a=k;k.endScope&&k.endScope._wrap?(m(),h(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(m(),g(k.endScope,e)):a.skip?j+=t:(a.returnEnd||a.excludeEnd||(j+=t),m(),a.excludeEnd&&(j=t));do k.scope&&A.closeNode(),!k.skip&&!k.subLanguage&&(te+=k.relevance),k=k.parent;while(k!==i.parent);return i.starts&&_(i.starts,e),a.returnEnd?0:t.length}function S(){let e=[];for(let t=k;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>A.openNode(e))}let C={};function T(t,a){let o=a&&a[0];if(j+=t,o==null)return m(),0;if(C.type===`begin`&&a.type===`end`&&C.index===a.index&&o===``){if(j+=n.slice(a.index,a.index+1),!i){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=C.rule,t}return 1}if(C=a,a.type===`begin`)return b(a);if(a.type===`illegal`&&!r){let e=Error(`Illegal lexeme "`+o+`" for mode "`+(k.scope||`<unnamed>`)+`"`);throw e.mode=k,e}else if(a.type===`end`){let e=x(a);if(e!==un)return e}if(a.type===`illegal`&&o===``)return j+=`
|
|
14
|
+
`,1;if(N>1e5&&N>a.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return j+=o,o.length}let E=w(e);if(!E)throw qt(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=nn(E),O=``,k=o||D,ee={},A=new s.__emitter(s);S();let j=``,te=0,M=0,N=0,ne=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(k.matcher.considerAll();;){N++,ne?ne=!1:k.matcher.considerAll(),k.matcher.lastIndex=M;let e=k.matcher.exec(n);if(!e)break;let t=T(n.substring(M,e.index),e);M=e.index+t}T(n.substring(M))}return A.finalize(),O=A.toHTML(),{language:e,value:O,relevance:te,illegal:!1,_emitter:A,_top:k}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:cn(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:M,context:n.slice(M-100,M+100),mode:t.mode,resultSoFar:O},_emitter:A};if(i)return{language:e,value:cn(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:k};throw t}}function f(e){let t={value:cn(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}function p(e,n){n=n||s.languages||Object.keys(t);let r=f(e),i=n.filter(w).filter(E).map(t=>d(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(w(e.language).supersetOf===t.language)return 1;if(w(t.language).supersetOf===e.language)return-1}return 0}),c=a;return c.secondBest=o,c}function m(e,t,r){let i=t&&n[t]||r;e.classList.add(`hljs`),e.classList.add(`language-${i}`)}function h(e){let t=null,n=l(e);if(c(n))return;if(ee(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(s.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),s.throwUnescapedHTML))throw new sn(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?u(r,{language:n,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,m(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ee(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=ln(s,e)}let _=()=>{b(),Yt(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),Yt(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let y=!1;function b(){function e(){b()}if(document.readyState===`loading`){y||window.addEventListener(`DOMContentLoaded`,e,!1),y=!0;return}document.querySelectorAll(s.cssSelector).forEach(h)}function x(n,r){let a=null;try{a=r(e)}catch(e){if(qt(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)qt(e);else throw e;a=o}a.name||=n,t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&T(a.aliases,{languageName:n})}function S(e){delete t[e];for(let t of Object.keys(n))n[t]===e&&delete n[t]}function C(){return Object.keys(t)}function w(e){return e=(e||``).toLowerCase(),t[e]||t[n[e]]}function T(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function E(e){let t=w(e);return t&&!t.disableAutodetect}function D(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function O(e){D(e),r.push(e)}function k(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function ee(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function A(e){return Yt(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Yt(`10.7.0`,`Please use highlightElement now.`),h(e)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:h,highlightBlock:A,configure:g,initHighlighting:_,initHighlightingOnLoad:v,registerLanguage:x,unregisterLanguage:S,listLanguages:C,getLanguage:w,registerAliases:T,autoDetection:E,inherit:ln,addPlugin:O,removePlugin:k}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=on,e.regex={concat:mt,lookahead:dt,either:gt,optional:pt,anyNumberOfTimes:ft};for(let e in Pt)typeof Pt[e]==`object`&&$e(Pt[e]);return Object.assign(e,Pt),e},pn=fn({});pn.newInstance=()=>fn({});var mn=pn;pn.HighlightJS=pn,pn.default=pn;var hn=Qe(mn);function gn(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var _n=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),vn=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),yn=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),bn=[...vn,...yn],xn=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Sn=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Cn=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),wn=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Tn(e){let t=e.regex,n=_n(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Sn.join(`|`)+`)`},{begin:`:(:)?(`+Cn.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+wn.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:xn.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+bn.join(`|`)+`)\\b`}]}}function En(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}var Dn=`[0-9](_*[0-9])*`,On=`\\.(${Dn})`,kn=`[0-9a-fA-F](_*[0-9a-fA-F])*`,An={className:`number`,variants:[{begin:`(\\b(${Dn})((${On})|\\.)?|(${On}))[eE][+-]?(${Dn})[fFdD]?\\b`},{begin:`\\b(${Dn})((${On})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${On})[fFdD]?\\b`},{begin:`\\b(${Dn})[fFdD]\\b`},{begin:`\\b0[xX]((${kn})\\.?|(${kn})?\\.(${kn}))[pP][+-]?(${Dn})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${kn})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function jn(e,t,n){return n===-1?``:e.replace(t,r=>jn(e,t,n-1))}function Mn(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+jn(`(?:<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,An,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},An,a]}}var Nn=`[A-Za-z$_][0-9A-Za-z$_]*`,Pn=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Fn=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],In=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Ln=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Rn=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],zn=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Bn=[].concat(Rn,In,Ln);function Vn(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Nn,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Nn,keyword:Pn,literal:Fn,built_in:Bn,"variable.language":zn},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...In,...Ln]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Rn,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},ee={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,ee,{match:/\$[(.]/}]}}function Hn(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Un(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Wn(e){let t=e.regex,n=RegExp(`[\\p{XID_Start}_]\\p{XID_Continue}*`,`u`),r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Gn(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}function Kn(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var qn=`[A-Za-z$_][0-9A-Za-z$_]*`,Jn=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Yn=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Xn=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Zn=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Qn=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],$n=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],er=[].concat(Qn,Xn,Zn);function tr(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=qn,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:qn,keyword:Jn,literal:Yn,built_in:er,"variable.language":$n},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Xn,...Zn]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Qn,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},ee={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,ee,{match:/\$[(.]/}]}}function nr(e){let t=e.regex,n=tr(e),r=qn,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:qn,keyword:Jn.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:Yn,built_in:er.concat(i),"variable.language":$n},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function rr(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ir(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var ar={bash:gn,sh:gn,shell:gn,css:Tn,go:En,golang:En,java:Mn,javascript:Vn,js:Vn,json:Hn,markdown:Un,md:Un,python:Wn,py:Wn,rust:Gn,rs:Gn,sql:Kn,typescript:nr,ts:nr,xml:rr,html:rr,yaml:ir,yml:ir};for(let[e,t]of Object.entries(ar))hn.registerLanguage(e,t);function or(e){let t=e.split(`
|
|
15
|
+
`);return/^(`{3,}|~{3,})/.test(t[0]??``)&&t.shift(),/^(`{3,}|~{3,})\s*$/.test(t[t.length-1]??``)&&t.pop(),t.join(`
|
|
16
|
+
`).replace(/\n+$/,``)}function sr(e){let t=(/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
|
|
17
|
+
`)[0]??``)?.[2]??``).toLowerCase();return t&&ar[t]?t:``}function cr(e,t){let n=t&&ar[t]?t:``;try{return n?hn.highlight(e,{language:n,ignoreIllegals:!0}).value:hn.highlightAuto(e).value}catch{return ur(e)}}function lr(e){return e.split(`
|
|
18
|
+
`).filter(e=>e.trim().length>0).filter(e=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(e)).map(e=>e.replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`).map(e=>e.trim()))}function ur(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function dr(e,t,n){if(e.length<=1)return e.slice();let[r,...i]=e,a=i.map(e=>e[t]??``),o=a.length>0&&a.every(e=>e.trim()!==``&&!Number.isNaN(Number(e))),s=n===`asc`?1:-1;return[r,...i.slice().sort((e,n)=>{let r=e[t]??``,i=n[t]??``;return o?(Number(r)-Number(i))*s:r.localeCompare(i,`zh-Hans-CN`,{numeric:!0})*s})]}var fr=[`viewBox`,`width`,`height`],pr={class:`zm-edges`},mr=[`d`,`fill`],hr=[`data-node-id`,`onClick`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],gr=[`src`,`width`,`height`,`alt`],_r=[`onDblclick`],vr={key:0,class:`zm-rich-code`},yr=[`innerHTML`],br={key:1,class:`zm-rich-table`},xr=[`onClick`],Sr={class:`zm-rich-sort-mark`,"aria-hidden":`true`},Cr={key:2,class:`zm-text`},wr={class:`zm-text-label`},Tr=[`href`,`title`],Er=[`title`,`onClick`],Dr=[`title`],Or=[`title`,`onClick`],kr=[`onClick`],Ar=[`onMousedown`],jr=[`onClick`],Mr=[`title`],Nr={class:`zm-tb-tip zm-tb-zoom`},Pr=[`src`],Fr=[`src`],Ir=24,Lr=400,Rr=160,zr=a({__name:`MindMap`,props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:[`change`,`select`,`edit-note`,`markdownChange`,`canvas-toggle-preview`,`canvas-outline`,`canvas-settings`,`canvas-data`,`canvas-import`],setup(a,{expose:C,emit:T}){let E=a,D=T,O=b(null),k=b(null),ee=b(``),M=b(null),N=b(new Set),ne=b(!1),re=b(null),ie=b(null),ae=b(``),oe=b(new Map),P=b(Ae(E.data)),se=b({}),F=b({}),ce=b(E.markdown!==void 0),I=!1;n(()=>E.markdown,e=>{if(e===void 0){ce.value=!1;return}ce.value=!0;let t=He(e||``);I=!0,P.value=Ae(t),M.value=null,N.value=new Set,H(),i(()=>{I=!1,Mn()})}),n(P,()=>{ce.value&&!I&&D(`markdownChange`,Ue(P.value))},{deep:!0});let L=g(()=>U.showOrderBadge===!0),le=b(new Map),ue=le.value;function de(e,t){let n={};t.bg&&(n.bg=t.bg),t.textColor&&(n.textColor=t.textColor),t.borderColor&&(n.borderColor=t.borderColor),t.fontWeight&&(n.fontWeight=t.fontWeight),Object.keys(n).length===0?ue.delete(e):ue.set(e,n),le.value=new Map(ue)}function fe(e){return ue.get(e)??{}}function pe(e,t){let n=z(P.value,e);n&&(n.image={src:t.src,naturalW:t.naturalW,naturalH:t.naturalH,width:ge(t.width,Ir,Lr),height:ge(t.height,Ir,Lr)},V(),H(),D(`change`,P.value))}function me(e){let t=z(P.value,e);!t||!t.image||(delete t.image,V(),H(),D(`change`,P.value))}function he(e,t){let n=t.trim();if(!z(P.value,e))return;if(!n){me(e);return}let r=new Image;r.onload=()=>{let t=z(P.value,e);if(!t)return;let i=r.naturalWidth&&r.naturalHeight?r.naturalWidth/r.naturalHeight:1,a=ge(r.naturalWidth||Rr,Ir,Lr),o=Math.round(a/i);t.image={src:n,naturalW:r.naturalWidth||a,naturalH:r.naturalHeight||o,width:a,height:o},V(),H(),D(`change`,P.value)},r.onerror=()=>{},r.src=n}function ge(e,t,n){return Math.min(n,Math.max(t,e))}function _e(e,t){let n=new FileReader;n.onload=()=>{if(typeof n.result!=`string`)return;let e=n.result,r=new window.Image;r.onload=()=>{let n=r.naturalWidth||Rr,i=r.naturalHeight||Rr,a=ge(n,Ir,Rr);t({src:e,naturalW:n,naturalH:i,width:a,height:ge(Math.round(i*a/n),Ir,Lr)})},r.onerror=()=>{t({src:e,naturalW:Rr,naturalH:Rr,width:Rr,height:Rr})},r.src=e},n.readAsDataURL(e)}function ve(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/*`,t.style.display=`none`,t.onchange=()=>{let n=t.files?.[0];n&&(_e(n,t=>pe(e,t)),document.body.removeChild(t))},document.body.appendChild(t),t.click()}function ye(e,t){let n=t.trim(),r=z(P.value,e);r&&(n?r.link={url:n}:delete r.link,V(),H(),D(`change`,P.value))}function be(e){ye(e,``)}function Se(e,t){let n=z(P.value,e);n&&(t?n.note={text:t}:delete n.note,V(),H(),D(`change`,P.value))}function Ce(e){Se(e,``)}function we(e,t){let n=z(P.value,e);n&&(t?n.richContent=t:delete n.richContent,V(),H(),D(`change`,P.value))}let R=b(null),Te=b(null),Ee=g(()=>[`zm-canvas-fab`,`zm-canvas-fab-preview`,!E.hideCanvasActions&&(!E.previewMode||ne.value)?`is-visible`:``].filter(Boolean).join(` `)),ke=g(()=>[`zm-canvas-fab`,`zm-canvas-fab-outline`,!E.hideCanvasActions&&(!E.previewMode||ne.value)?`is-visible`:``].filter(Boolean).join(` `));function Fe(e,t){E.previewMode||(e.preventDefault(),e.stopPropagation(),Te.value=null,M.value=t.id,D(`select`,z(P.value,t.id)),R.value={nodeId:t.id,x:e.clientX,y:e.clientY})}function Be(){R.value=null}function We(e){let t=e.target;t!=null&&t.closest(`.zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline`)||(e.preventDefault(),R.value&&=null,Te.value={x:e.clientX,y:e.clientY})}function B(){Te.value=null}function Ke(){B(),D(`canvas-settings`)}function qe(){B(),D(`canvas-data`)}function Qe(e){B(),D(`canvas-import`,e)}function $e(){let e=R.value?.nodeId;e&&ve(e)}function et(){let e=R.value?.nodeId;if(!e)return;let t=z(P.value,e)?.link?.url??``,n=window.prompt(`输入链接 URL(留空取消)`,t);n!==null&&ye(e,n)}function tt(){let e=R.value?.nodeId;e&&be(e)}function nt(){let e=R.value?.nodeId;e&<(e)}function rt(){let e=R.value?.nodeId;e&&Ce(e)}function it(){let e=R.value?.nodeId;e&&me(e)}function at(){let e=R.value?.nodeId;if(!e)return;let t=z(P.value,e)?.richContent,n=t?.kind===`code`?or(t.raw):``,r=t?.kind===`code`&&t.lang||``,i=r?"```"+r+`
|
|
19
|
+
`:"```\n",a=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",n?i+n+(n.endsWith("```")?``:"\n```"):i+"// 你的代码\n```");if(a===null)return;let o=a.trim();if(!o){we(e,null);return}let s=/^```([^\s`]*)/.exec(o);we(e,{kind:`code`,raw:o,lang:s?s[1]:void 0})}function ot(){let e=R.value?.nodeId;e&&we(e,null)}function st(){let e=R.value?.nodeId;if(!e)return;let t=z(P.value,e)?.richContent,n=t?.kind===`table`?t.raw:``,r=window.prompt(`输入 markdown 表格(每行以 | 分隔;留空取消)`,n||`| 列1 | 列2 | 列3 |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| a | b | c |`);if(r===null)return;let i=r.trim();if(!i){we(e,null);return}we(e,{kind:`table`,raw:i})}function ct(){let e=R.value?.nodeId;e&&we(e,null)}function lt(e){E.previewMode||D(`edit-note`,e)}function ut(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function dt(e){if(E.previewMode||k.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=M.value;if(!n)return;let r=e.clipboardData?.items;if(r)for(let t=0;t<r.length;t++){let i=r[t];if(i.kind===`file`&&i.type.startsWith(`image/`)){let t=i.getAsFile();if(!t)continue;e.preventDefault();let r=z(P.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;_e(t,e=>pe(n,e));return}}}r(()=>{window.addEventListener(`paste`,dt),H()}),t(()=>{window.removeEventListener(`paste`,dt)});let ft=b(null),pt=g(()=>ft.value?.nodeId??null);function mt(e,t){if(!t.image)return;e.preventDefault(),e.stopPropagation();let n=t.image.naturalW||t.image.width,r=t.image.naturalH||t.image.height,i=r>0?r/n:1;ft.value={nodeId:t.id,startX:e.clientX,startY:e.clientY,startW:t.image.width,startH:t.image.height,naturalW:n,naturalH:r,ratio:i,pendingW:t.image.width,pendingH:t.image.height},window.addEventListener(`mousemove`,ht),window.addEventListener(`mouseup`,gt)}function ht(e){let t=ft.value;if(!t)return;let n=W.scale.value||1,r=e.clientX-t.startX,i=ge(t.startW+r/n,Ir,Lr),a=ge(i*t.ratio,Ir,Lr);t.pendingW=i,t.pendingH=a;let o=O.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);o&&(o.style.width=`${i}px`,o.style.height=`${a}px`);let s=O.value?.querySelector(`[data-node-id="${t.nodeId}"]`);s&&(s.style.minWidth=`${Math.max(80,Math.ceil(i+28))}px`,s.style.height=`${Math.ceil(a+8+30)}px`)}function gt(){let e=ft.value;if(window.removeEventListener(`mousemove`,ht),window.removeEventListener(`mouseup`,gt),ft.value=null,!e)return;let t=z(P.value,e.nodeId);!t||!t.image||(pe(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),M.value=e.nodeId,D(`select`,t),vt=!0)}let _t=b(null),vt=!1;function yt(e){_t.value=e}function bt(e){_t.value===e&&(_t.value=null),re.value&&=null}function xt(e,t){if(!t.text||t.text.length<14)return;let n=e.currentTarget.getBoundingClientRect(),r=O.value?.getBoundingClientRect();if(!r)return;let i=n.top-r.top>60,a=n.left-r.left+n.width/2,o=r.width-240/2-10,s=Math.max(130,Math.min(a,o)),c=i?n.top-r.top-8:n.bottom-r.top+8;re.value={text:t.text,x:s,y:c,above:i}}let St=b(0),Ct=b(!1),wt=Ye(100);function V(){wt.record({data:P.value})}function H(){N.value=new Set(N.value),St.value++,i().then(()=>i()).then(()=>Tt()).then(()=>{St.value++})}function Tt(){let e=document.querySelectorAll(`.zm-rich`),t={},n={};e.forEach(e=>{let r=e,i=null;for(;r&&!i;)i=r.getAttribute(`data-node-id`),r=r.parentElement;if(!i)return;let a=e.offsetHeight,o=e.scrollWidth,s=Math.round(a*2)/2,c=Math.round(o*2)/2;t[i]=s,n[i]=c,se.value[i],F.value[i]}),se.value=t,F.value=n}let Et=g(()=>({rootBg:E.theme?.rootBg??`#1f2937`,rootText:E.theme?.rootText??`#ffffff`,branchBg:E.theme?.branchBg??`#ffffff`,branchText:E.theme?.branchText??`#1f2937`,lineColor:E.theme?.lineColor??`#94a3b8`,bgColor:E.theme?.bgColor??`#f8fafc`,fontSize:E.theme?.fontSize??14,lineWidthStart:E.theme?.lineWidthStart??2.2,lineWidthEnd:E.theme?.lineWidthEnd??.8,rainbowBranch:E.theme?.rainbowBranch??!1})),U=u({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`curve`,layoutMode:`mindmap`,taperedEdge:!0,showOrderBadge:!1});function Dt(e){return U.taperedEdge?kt(e):At(e)}function Ot(e){return U.taperedEdge?U.lineWidthEnd:At(e)}function kt(e){return e<=0?U.lineWidthStart:e===1?Math.max(1.5,U.lineWidthStart*.67):e===2?Math.max(.8,U.lineWidthStart*.42):U.lineWidthEnd}function At(e){if(e<=0)return U.lineWidthStart;if(e>=3)return U.lineWidthEnd;let t=e/3;return U.lineWidthStart+(U.lineWidthEnd-U.lineWidthStart)*t}function jt(e,t,n,r){let i=1-e;return{x:i*i*i*t.x+3*i*i*e*n.x1+3*i*e*e*n.x2+e*e*e*r.x,y:i*i*i*t.y+3*i*i*e*n.y1+3*i*e*e*n.y2+e*e*e*r.y}}function Mt(e,t,n,r,i=32,a=`curve`,o=`right`){if(a===`curve`){let a;if(o===`right`||o===`left`){let n=Math.abs(t.x-e.x)*.45,r=o===`right`?1:-1;a={x1:e.x+r*n,y1:e.y,x2:t.x-r*n,y2:t.y}}else{let n=Math.abs(t.y-e.y)*.45;a={x1:e.x,y1:e.y+n,x2:t.x,y2:t.y-n}}let s=n=>{let r=1-n;return{dx:-3*r*r*e.x+3*(r*r-2*r*n)*a.x1+3*(2*r*n-n*n)*a.x2+3*n*n*t.x,dy:-3*r*r*e.y+3*(r*r-2*r*n)*a.y1+3*(2*r*n-n*n)*a.y2+3*n*n*t.y}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:jt(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)u+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;for(let e=i;e>=0;e--)u+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return u+=` Z`,u}let s=t.x-e.x,c=t.y-e.y,l=Math.hypot(s,c);l<1e-6&&(l=1);let u=-c/l,d=s/l,f=n/2,p=r/2,m={x:e.x+u*f,y:e.y+d*f},h={x:e.x-u*f,y:e.y-d*f},g={x:t.x-u*p,y:t.y-d*p},_={x:t.x+u*p,y:t.y+d*p};return`M ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${_.x.toFixed(2)} ${_.y.toFixed(2)} L ${g.x.toFixed(2)} ${g.y.toFixed(2)} L ${h.x.toFixed(2)} ${h.y.toFixed(2)} Z`}let Nt=g(()=>Wt.value.root.children),Pt=De[0].colors,Ft=g(()=>Oe(U.branchPaletteId,U.customPalettes)),It=g(()=>{let e=new Map;if(!U.rainbowBranch)return e;let t=E.lineColors,n=t&&t.length>0?t:Ft.value.colors.length>0?Ft.value.colors:Pt;for(let t=0;t<Nt.value.length;t++){let r=Nt.value[t];e.set(r.id,n[t%n.length])}let r=(t,n)=>{e.set(t.id,n);for(let e of t.children)r(e,n)};for(let e=0;e<Nt.value.length;e++){let t=Nt.value[e];r(t,n[e%n.length])}return e});function Lt(e,t){return U.rainbowBranch?It.value.get(t.id)??Et.value.lineColor:Et.value.lineColor}function Rt(e){let t=fe(e.id);if(t.bg)return t.bg;if(e.isRoot)return Et.value.rootBg;if(U.rainbowBranch){let t=It.value.get(e.id);if(t)return Ht(t,.18)}return Et.value.branchBg}function zt(e){let t=fe(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return Et.value.rootText;if(U.rainbowBranch){let t=It.value.get(e.id);if(t)return Ut(t,.55)}return Et.value.branchText}function Bt(e){let t=fe(e.id);if(t.borderColor)return t.borderColor;if(e.isRoot)return Et.value.rootBg;if(U.rainbowBranch){let t=It.value.get(e.id);if(t)return Ut(t,.3)}return Et.value.lineColor}function Vt(e){return fe(e.id).fontWeight??(e.isRoot?600:400)}function Ht(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`}function Ut(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgb(${Math.round(parseInt(r.slice(0,2),16)*(1-t))}, ${Math.round(parseInt(r.slice(2,4),16)*(1-t))}, ${Math.round(parseInt(r.slice(4,6),16)*(1-t))})`}let W=Ge({getContainer:()=>O.value});W.setOnMarqueeEnd(En),Je({isEditing:()=>k.value!==null,isReadonly:()=>E.previewMode,getSelectedId:()=>M.value,getRootId:()=>P.value.id,defaultTargetId:()=>P.value.id,onAddChild:cn,onAddSibling:ln,onAddSiblingBefore:un,onRemove:hn,onStartEdit:Xt,onClearSelection:()=>{M.value=null,D(`select`,null)},onDuplicate:dn,onUndo:fn,onRedo:pn,onNavigate:mn,onSelectRoot:()=>{M.value=P.value.id;let e=z(P.value,P.value.id);e&&D(`select`,e)}});let Wt=g(()=>{let e=Ae(P.value);return Yt(e),xe(e,{mode:U.layoutMode,baseFontSize:Et.value.fontSize,richHeights:se.value,richWidths:F.value})}),Gt=b([]),Kt=g(()=>(St.value,Gt.value));n(Wt,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),Gt.value=t},{immediate:!0});let qt=g(()=>{let e=[];for(let t of Kt.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),Jt=g(()=>`${Wt.value.vbX} ${Wt.value.vbY} ${Wt.value.vbW} ${Wt.value.vbH}`);function Yt(e){if(N.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)Yt(t)}function Xt(e){let t=z(P.value,e);t&&(k.value=e,ee.value=t.text,i(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select()}))}function Zt(e={}){if(!k.value)return;let t=z(P.value,k.value);t&&t.text!==(ee.value.trim()||` `)&&(t.text=ee.value.trim()||` `,V(),D(`change`,P.value));let n=k.value;k.value=null,e.addChild?i(()=>cn(n)):e.addSibling===`after`?i(()=>ln(n)):e.addSibling===`before`&&i(()=>un(n))}function Qt(){k.value=null}function $t(e){if(E.previewMode)return;let t=z(P.value,e);t!=null&&t.richContent&&(ie.value=e,ae.value=t.richContent.raw,i(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function en(){if(!ie.value)return;let e=ie.value,t=z(P.value,e),n=ae.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?we(e,{kind:`code`,raw:n,lang:sr(n)||void 0}):we(e,{kind:`table`,raw:n})),ie.value=null}function tn(){ie.value=null}function nn(e){e.key===`Escape`?(e.preventDefault(),tn()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),en())}function rn(e,t){let n=oe.value.get(e);!n||n.col!==t?oe.value.set(e,{col:t,dir:`asc`}):n.dir===`asc`?oe.value.set(e,{col:t,dir:`desc`}):oe.value.delete(e)}function an(e,t){let n=oe.value.get(e);return!n||t.length<=1?t:dr(t,n.col,n.dir)}function on(e,t){let n=oe.value.get(e);return!n||n.col!==t?`↕`:n.dir===`asc`?`▲`:`▼`}function sn(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),fn()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),pn())}function cn(e){let t=Ie(P.value,e,Ve);t&&(V(),H(),D(`change`,P.value),i(()=>Xt(t.id)))}function ln(e){if(e===P.value.id){cn(e);return}let t=Le(P.value,e,Ve);t&&(V(),H(),D(`change`,P.value),i(()=>Xt(t.id)))}function un(e){if(e===P.value.id){cn(e);return}let t=Re(P.value,e,Ve);t&&(V(),H(),D(`change`,P.value),i(()=>Xt(t.id)))}function dn(e){if(e===P.value.id)return;let t=ze(P.value,e);t&&(V(),M.value=t.id,D(`change`,P.value),H())}function fn(){let e=wt.undo();e&&(P.value=e.data,M.value=null,D(`select`,null),H(),D(`change`,P.value))}function pn(){let e=wt.redo();e&&(P.value=e.data,M.value=null,D(`select`,null),H(),D(`change`,P.value))}function mn(e,t){let n=M.value??P.value.id,r=z(P.value,n);if(!r)return;let i=null;if(t===1){let e=je(P.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>=0&&t<e.children.length-1&&(i=e.children[t+1].id)}}else if(t===-1){let e=je(P.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>0&&(i=e.children[t-1].id)}}else if(e===1){let e=je(P.value,r.id);e&&(i=e.id)}else e===-1&&r.children.length>0&&(i=r.children[0].id);if(i){M.value=i;let e=z(P.value,i);e&&D(`select`,e)}}function hn(e){e!==P.value.id&&Me(P.value,e)&&(V(),M.value===e&&(M.value=null),H(),D(`change`,P.value))}function gn(e){N.value.has(e)?N.value.delete(e):N.value.add(e),H()}function _n(e){let t=[{n:P.value,depth:1}];for(;t.length;){let{n,depth:r}=t.pop();e(n,r);for(let e=n.children.length-1;e>=0;e--)t.push({n:n.children[e],depth:r+1})}}function vn(){N.value=new Set,_n(e=>{e.children.length>0&&N.value.add(e.id)}),H()}function yn(e){N.value=new Set,_n((t,n)=>{n>e&&t.children.length>0&&N.value.add(t.id)}),H()}function bn(){N.value=new Set,H()}function xn(e,t){Ne(P.value,e,t)&&(V(),H(),D(`change`,P.value))}function Sn(e,t,n){return Pe(P.value,e,t,n)?(V(),H(),D(`change`,P.value),!0):!1}function Cn(e,t){e.stopPropagation(),M.value=t.id,D(`select`,z(P.value,t.id))}function wn(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea`))return;if(e.button===2){W.startPan(e);return}if(e.button!==0)return;let n=O.value.getBoundingClientRect(),r=(e.clientX-n.left-W.offsetX.value)/W.scale.value,i=(e.clientY-n.top-W.offsetY.value)/W.scale.value;W.startMarquee(r,i)}function Tn(e){if(vt){vt=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`))return;let n=W.marquee;n.width>=4||n.height>=4||M.value!==null&&(M.value=null,D(`select`,null))}function En(){let e=W.marquee;if(e.width<4&&e.height<4)return;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height,a=[];for(let e of Kt.value){let o=e.width/2,s=e.height/2,c=e.x-o,l=e.x+o,u=e.y-s,d=e.y+s;c<=r&&l>=t&&u<=i&&d>=n&&a.push(e.id)}if(a.length>0){M.value=a[0];let e=z(P.value,a[0]);e&&D(`select`,e)}}function Dn(e){return N.value.has(e)}function On(e){let t=z(P.value,e.id);return!!t&&t.children.length>0}function kn(e){let t=z(P.value,e);return t?t.children.length:0}function An(e){if(!z(P.value,e))return 0;let t=[P.value];for(;t.length;){let n=t.pop(),r=n.children.findIndex(t=>t.id===e);if(r>=0)return r;for(let e of n.children)t.push(e)}return 0}function jn(e,t,n,r){if((r?._dir??e._dir)===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let i;i=t===`in`?-e.side:n===void 0?e.side:n;let a=t===`in`?e._richInsetX??0:0;return{x:e.x+i*(e.width/2-a),y:e.y}}function Mn(){let e=Wt.value;W.resetView(e.width,e.height,e.root.y)}function Nn(){Ct.value=!0,V(),H(),i(()=>Mn())}function Pn(e){U.layoutMode!==e&&(U.layoutMode=e,H(),i(()=>Mn()))}function Fn(){return JSON.stringify(P.value,null,2)}function In(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(wt.reset(),P.value=Ae(t),M.value=null,N.value=new Set,H(),i(()=>Mn()),D(`change`,P.value),!0)}catch{return!1}}function Ln(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(In(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function Rn(){let e=new Blob([Fn()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${P.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}return C({addChild:e=>cn(e),addSibling:e=>ln(e),removeNode:e=>hn(e),duplicateNode:e=>dn(e),setNodeText:(e,t)=>xn(e,t),moveNode:(e,t,n)=>Sn(e,t,n),lineWidthForDepth:Dt,endWidthForDepth:Ot,getData:()=>P.value,setData:e=>{wt.reset(),P.value=Ae(e),M.value=null,N.value=new Set,H(),V(),i(()=>Mn())},resetView:()=>Mn(),exportData:Fn,importData:In,getMarkdown:()=>Ue(P.value),setMarkdown:(e,t=!0)=>{let n=He(e||``);t&&(ce.value=!0),I=!t,wt.reset(),P.value=Ae(n),M.value=null,N.value=new Set,H(),V(),i(()=>{I=!1,Mn()}),D(`change`,P.value)},setBalanced:e=>{Ct.value=e},isBalanced:()=>Ct.value,balance:()=>Nn(),applyNodeStyle:(e,t)=>de(e,t),getNodeStyle:e=>fe(e),applyNodeImage:(e,t)=>pe(e,t),applyNodeImageByUrl:(e,t)=>he(e,t),removeNodeImage:e=>me(e),applyNodeLink:(e,t)=>ye(e,t),removeNodeLink:e=>be(e),applyNodeNote:(e,t)=>Se(e,t),removeNodeNote:e=>Ce(e),applyNodeRichContent:(e,t)=>we(e,t),undo:()=>fn(),redo:()=>pn(),canUndo:()=>wt.canUndo(),canRedo:()=>wt.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(U.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(U.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(U.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(U.lineStyle=e.lineStyle),e.taperedEdge!==void 0&&(U.taperedEdge=e.taperedEdge),e.showOrderBadge!==void 0&&(U.showOrderBadge=e.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:U.autoBalanceOnChange,lineWidthStart:U.lineWidthStart,lineWidthEnd:U.lineWidthEnd,rainbowBranch:U.rainbowBranch,branchPaletteId:U.branchPaletteId,customPalettes:U.customPalettes,lineStyle:U.lineStyle,layoutMode:U.layoutMode,taperedEdge:U.taperedEdge,showOrderBadge:U.showOrderBadge}),setBranchPalette:e=>{e&&[...De,...U.customPalettes].find(t=>t.id===e)&&(U.branchPaletteId=e)},getBranchPalette:()=>U.branchPaletteId,getBranchPalettes:()=>[...De,...U.customPalettes]}),n(()=>E.data,e=>{P.value=Ae(e),H()},{deep:!1}),r(()=>{V(),i(()=>Mn())}),(t,n)=>{var r,i,u;return w(),S(`div`,{class:`zm-mindmap`,style:p({background:Et.value.bgColor,fontSize:Et.value.fontSize+`px`})},[m(`div`,{ref_key:`wrapperRef`,ref:O,class:`zm-canvas`,onMousedown:wn,onContextmenu:We,onWheel:n[27]||=(...e)=>y(W).onWheel&&y(W).onWheel(...e),onMouseenter:n[28]||=e=>ne.value=!0,onMouseleave:n[29]||=e=>ne.value=!1,onClick:Tn},[m(`div`,{class:`zm-svg-layer`,style:p({left:Wt.value.vbX*y(W).scale.value+y(W).offsetX.value+`px`,top:Wt.value.vbY*y(W).scale.value+y(W).offsetY.value+`px`,width:Wt.value.vbW*y(W).scale.value+`px`,height:Wt.value.vbH*y(W).scale.value+`px`})},[(w(),S(`svg`,{class:`zm-svg`,viewBox:Jt.value,preserveAspectRatio:`xMinYMin meet`,width:Wt.value.vbW*y(W).scale.value,height:Wt.value.vbH*y(W).scale.value},[m(`g`,pr,[(w(!0),S(x,null,o(qt.value,e=>(w(),S(`path`,{key:e.key,d:Mt(jn(e.from,`out`,e.to.side,e.to),jn(e.to,`in`),Dt(e.from.depth),Ot(e.to.depth),32,U.lineStyle,e.to._dir),fill:Lt(e.from,e.to),stroke:`none`},null,8,mr))),128))])],8,fr))],4),y(W).isMarquee.value?(w(),S(`div`,{key:0,class:`zm-marquee`,style:p({left:y(W).marquee.x*y(W).scale.value+y(W).offsetX.value+`px`,top:y(W).marquee.y*y(W).scale.value+y(W).offsetY.value+`px`,width:y(W).marquee.width*y(W).scale.value+`px`,height:y(W).marquee.height*y(W).scale.value+`px`})},null,4)):c(``,!0),m(`div`,{class:`zm-world`,style:p({transform:`translate(${y(W).offsetX.value}px, ${y(W).offsetY.value}px) scale(${y(W).scale.value})`})},[(w(!0),S(x,null,o(Kt.value,t=>(w(),S(`div`,{key:t.id,class:_([`zm-node`,{"is-root":t.isRoot,"is-selected":M.value===t.id,"is-editing":k.value===t.id,"has-image":!!t.image,"is-resizing":pt.value===t.id}]),"data-node-id":t.id,style:p({left:t.x+`px`,top:t.y+`px`,width:t.width+`px`,minWidth:t.width+`px`,height:t.height+`px`,fontSize:t.fontSize+`px`,background:Rt(t),color:zt(t),borderColor:Bt(t),fontWeight:Vt(t),transform:`translate(-50%, -50%)`}),onClick:e=>Cn(e,t),onDblclick:e=>{e.stopPropagation(),a.previewMode||Xt(t.id)},onContextmenu:e=>Fe(e,t),onMouseenter:e=>{yt(t.id),xt(e,t)},onMouseleave:e=>bt(t.id)},[t.image?(w(),S(`img`,{key:0,class:`zm-node-img`,src:t.image.src,width:t.image.width,height:t.image.height,alt:t.text,draggable:`false`},null,8,gr)):c(``,!0),t.richContent&&(t.richContent.kind===`code`||t.richContent.kind===`table`)&&k.value!==t.id?(w(),S(`div`,{key:1,class:_([`zm-rich zm-rich-above`,{"zm-rich-no-overflow":t.richContent.kind===`table`||t.richContent.kind===`code`}]),onClick:n[1]||=h(()=>{},[`stop`]),onDblclick:h(e=>$t(t.id),[`stop`]),onMousedown:n[2]||=h(()=>{},[`stop`])},[ie.value===t.id?s((w(),S(`textarea`,{key:0,"onUpdate:modelValue":n[0]||=e=>ae.value=e,class:`zm-rich-edit`,spellcheck:`false`,onBlur:en,onKeydown:nn},null,544)),[[v,ae.value]]):(w(),S(x,{key:1},[t.richContent.kind===`code`?(w(),S(`pre`,vr,[m(`code`,{innerHTML:y(cr)(y(or)(t.richContent.raw),y(sr)(t.richContent.raw))},null,8,yr)])):t.richContent.kind===`table`?(w(),S(`table`,br,[m(`tbody`,null,[(w(!0),S(x,null,o(an(t.id,y(lr)(t.richContent.raw)),(e,n)=>(w(),S(`tr`,{key:n},[n===0?(w(!0),S(x,{key:0},o(e,(e,n)=>(w(),S(`th`,{key:`h${n}`,class:_([`zm-rich-table-sort`,{"is-sorted":oe.value.get(t.id)?.col===n,"is-asc":oe.value.get(t.id)?.col===n&&oe.value.get(t.id)?.dir===`asc`,"is-desc":oe.value.get(t.id)?.col===n&&oe.value.get(t.id)?.dir===`desc`}]),onClick:h(e=>rn(t.id,n),[`stop`])},[m(`span`,null,l(e),1),m(`span`,Sr,l(on(t.id,n)),1)],10,xr))),128)):(w(!0),S(x,{key:1},o(e,(e,t)=>(w(),S(`td`,{key:`c${t}`},l(e),1))),128))]))),128))])])):c(``,!0)],64))],42,_r)):c(``,!0),k.value===t.id?s((w(),S(`input`,{key:3,class:`zm-input`,"onUpdate:modelValue":n[6]||=e=>ee.value=e,autofocus:``,onBlur:n[7]||=e=>Zt(),onKeydown:[n[8]||=d(h(e=>Zt({addSibling:`after`}),[`exact`]),[`enter`]),n[9]||=d(h(e=>Zt({addSibling:`before`}),[`shift`,`prevent`,`exact`]),[`enter`]),n[10]||=d(h(e=>Zt({addChild:!0}),[`prevent`]),[`tab`]),d(Qt,[`esc`]),sn],onMousedown:n[11]||=h(()=>{},[`stop`]),onClick:n[12]||=h(()=>{},[`stop`])},null,544)),[[v,ee.value]]):(w(),S(`span`,Cr,[m(`span`,wr,l(t.text),1),t.link&&!k.value?(w(),S(`a`,{key:0,class:`zm-node-link`,href:t.link.url,target:`_blank`,rel:`noopener noreferrer`,title:`打开链接:${t.link.url}`,onClick:n[3]||=h(()=>{},[`stop`]),onMousedown:n[4]||=h(()=>{},[`stop`])},[e(A,{name:`link`,size:11,stroke:2})],40,Tr)):c(``,!0),t.note&&!k.value?(w(),S(`button`,{key:1,class:`zm-node-note-btn`,type:`button`,title:ut(t.note.text),onClick:h(e=>lt(t.id),[`stop`]),onMousedown:n[5]||=h(()=>{},[`stop`])},[e(A,{name:`note`,size:11,stroke:2})],40,Er)):c(``,!0)])),L.value?(w(),S(`span`,{key:4,class:`zm-order-badge`,title:`数据顺序:第 ${An(t.id)+1} 个`},l(An(t.id)+1),9,Dr)):c(``,!0),Dn(t.id)&&kn(t.id)>0?(w(),S(`span`,{key:5,class:_([`zm-collapse-badge`,{"is-on-left":t.side===-1}]),style:p({background:It.value.get(t.id)??`#64748b`}),title:`展开 ${kn(t.id)} 个子节点`,onMousedown:n[13]||=h(()=>{},[`stop`]),onClick:h(e=>gn(t.id),[`stop`])},l(kn(t.id)),47,Or)):c(``,!0),On(t)&&!Dn(t.id)?(w(),S(`button`,{key:6,class:_([`zm-btn zm-collapse`,{"is-on-left":t.side===-1}]),style:p({color:It.value.get(t.id)??`#64748b`,borderColor:It.value.get(t.id)??`#64748b`}),title:`折叠`,onMousedown:n[14]||=h(()=>{},[`stop`]),onClick:h(e=>gn(t.id),[`stop`])},[e(A,{name:`minus`,size:10,stroke:2.4})],46,kr)):c(``,!0),t.image&&M.value===t.id&&k.value!==t.id?(w(),S(`span`,{key:7,class:`zm-img-resize-handle`,title:`拖动调整图片大小`,onMousedown:h(e=>mt(e,t),[`stop`])},null,40,Ar)):c(``,!0),t.image&&M.value===t.id&&k.value!==t.id?(w(),S(`button`,{key:8,class:`zm-img-remove-btn`,title:`移除图片`,onMousedown:n[15]||=h(()=>{},[`stop`]),onClick:h(e=>me(t.id),[`stop`])},[e(A,{name:`x`,size:9,stroke:2.2})],40,jr)):c(``,!0)],46,hr))),128))],4),re.value?(w(),S(`div`,{key:1,class:_([`zm-tooltip`,{"is-below":!re.value.above}]),style:p({left:re.value.x+`px`,top:re.value.y+`px`})},l(re.value.text),7)):c(``,!0),R.value?(w(),f(Xe,{key:2,x:R.value.x,y:R.value.y,container:O.value,"has-image":!!((r=y(z)(P.value,R.value.nodeId))!=null&&r.image),"has-link":!!((i=y(z)(P.value,R.value.nodeId))!=null&&i.link),"has-note":!!((u=y(z)(P.value,R.value.nodeId))!=null&&u.note),"has-code":y(z)(P.value,R.value.nodeId)?.richContent?.kind===`code`,"has-table":y(z)(P.value,R.value.nodeId)?.richContent?.kind===`table`,onPickImage:$e,onRemoveImage:it,onSetLink:et,onRemoveLink:tt,onEditNote:nt,onRemoveNote:rt,onAddCode:at,onEditCode:at,onRemoveCode:ot,onAddTable:st,onEditTable:st,onRemoveTable:ct,onClose:Be},null,8,[`x`,`y`,`container`,`has-image`,`has-link`,`has-note`,`has-code`,`has-table`])):c(``,!0),Te.value?(w(),f(Ze,{key:3,x:Te.value.x,y:Te.value.y,container:O.value,onOpenSettings:Ke,onOpenData:qe,onOpenImport:Qe,onClose:B},null,8,[`x`,`y`,`container`])):c(``,!0),m(`button`,{class:_(Ee.value),title:E.previewMode?`退出预览模式`:`进入预览模式`,onClick:n[16]||=e=>D(`canvas-toggle-preview`)},[e(A,{name:E.previewMode?`eye-off`:`eye`,size:16},null,8,[`name`])],10,Mr),m(`button`,{class:_(ke.value),title:`显示大纲视图`,onClick:n[17]||=e=>D(`canvas-outline`)},[e(A,{name:`outline`,size:16})],2),m(`div`,{class:_([`zm-toolbar`,{"is-preview-only":E.previewMode,"is-hovered":ne.value}])},[m(`span`,Nr,l(Math.round(y(W).scale.value*100))+`%`,1),m(`button`,{class:`zm-tb-btn`,title:`放大`,onClick:n[18]||=(...e)=>y(W).zoomIn&&y(W).zoomIn(...e)},[e(A,{name:`zoom-in`})]),m(`button`,{class:`zm-tb-btn`,title:`缩小`,onClick:n[19]||=(...e)=>y(W).zoomOut&&y(W).zoomOut(...e)},[e(A,{name:`zoom-out`})]),m(`button`,{class:`zm-tb-btn`,title:`重置视图`,onClick:Mn},[e(A,{name:`reset`})]),n[33]||=m(`span`,{class:`zm-tb-divider`},null,-1),m(`button`,{class:`zm-tb-btn`,title:`全部收起`,onClick:vn},[e(A,{name:`collapse-all`})]),m(`button`,{class:`zm-tb-btn`,title:`展开一级`,onClick:n[20]||=e=>yn(1)},[e(A,{name:`expand-level-1`})]),m(`button`,{class:`zm-tb-btn`,title:`展开二级`,onClick:n[21]||=e=>yn(2)},[e(A,{name:`expand-level-2`})]),m(`button`,{class:`zm-tb-btn`,title:`全部展开`,onClick:bn},[e(A,{name:`expand-all`})]),n[34]||=m(`span`,{class:`zm-tb-divider`},null,-1),m(`button`,{class:`zm-tb-btn`,title:`导出 JSON`,onClick:Rn},[e(A,{name:`export`})]),E.previewMode?c(``,!0):(w(),S(x,{key:0},[n[30]||=m(`span`,{class:`zm-tb-divider`},null,-1),m(`button`,{class:`zm-tb-btn`,title:`添加子节点 (Tab)`,onClick:n[22]||=e=>M.value&&cn(M.value)},[m(`img`,{src:y(te),width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,Pr)]),m(`button`,{class:`zm-tb-btn`,title:`添加同级 (Enter)`,onClick:n[23]||=e=>M.value&&ln(M.value)},[m(`img`,{src:y(j),width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,Fr)]),n[31]||=m(`span`,{class:`zm-tb-divider`},null,-1),m(`button`,{class:_([`zm-tb-btn`,{active:U.layoutMode===`mindmap`}]),title:`思维导图布局 (中心辐射)`,onClick:n[24]||=e=>Pn(`mindmap`)},[e(A,{name:`mindmap`})],2),m(`button`,{class:_([`zm-tb-btn`,{active:U.layoutMode===`tree`}]),title:`树形布局 (向右展开)`,onClick:n[25]||=e=>Pn(`tree`)},[e(A,{name:`tree`})],2),m(`button`,{class:_([`zm-tb-btn`,{active:U.layoutMode===`org`}]),title:`组织结构布局 (向下展开)`,onClick:n[26]||=e=>Pn(`org`)},[e(A,{name:`org`})],2),n[32]||=m(`span`,{class:`zm-tb-divider`},null,-1),m(`button`,{class:`zm-tb-btn`,title:`导入 JSON`,onClick:Ln},[e(A,{name:`import`})])],64))],2)],544)],4)}}});function Br(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Vr=Br();function Hr(e){Vr=e}var Ur={exec:()=>null};function Wr(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function G(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(K.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Gr=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),K={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,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,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:Wr(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Wr(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Wr(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Wr(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Wr(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Wr(e=>RegExp(`^ {0,${e}}>`))},Kr=/^(?:[ \t]*(?:\n|$))+/,qr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$r=G(Qr).replace(/bull/g,Zr).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(),ei=G(Qr).replace(/bull/g,Zr).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(),ti=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ni=/^[^\n]+/,ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ii=G(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ri).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ai=G(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Zr).getRegex(),oi=`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`,si=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ci=G(`^ {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`,si).replace(`tag`,oi).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),li=G(ti).replace(`hr`,Yr).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[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oi).getRegex(),ui={blockquote:G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,li).getRegex(),code:qr,def:ii,fences:Jr,heading:Xr,hr:Yr,html:ci,lheading:$r,list:ai,newline:Kr,paragraph:li,table:Ur,text:ni},di=G(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Yr).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[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oi).getRegex(),fi={...ui,lheading:ei,table:di,paragraph:G(ti).replace(`hr`,Yr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,di).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oi).getRegex()},pi={...ui,html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,si).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:Ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(ti).replace(`hr`,Yr).replace(`heading`,` *#{1,6} *[^
|
|
22
|
+
]`).replace(`lheading`,$r).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},mi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gi=/^( {2,}|\\)\n(?!\s*$)/,_i=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vi=/[\p{P}\p{S}]/u,yi=/[\s\p{P}\p{S}]/u,bi=/[^\s\p{P}\p{S}]/u,xi=G(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,yi).getRegex(),Si=/(?!~)[\p{P}\p{S}]/u,Ci=/(?!~)[\s\p{P}\p{S}]/u,wi=/(?:[^\s\p{P}\p{S}]|~)/u,Ti=G(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Gr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ei=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Di=G(Ei,`u`).replace(/punct/g,vi).getRegex(),Oi=G(Ei,`u`).replace(/punct/g,Si).getRegex(),ki=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ai=G(ki,`gu`).replace(/notPunctSpace/g,bi).replace(/punctSpace/g,yi).replace(/punct/g,vi).getRegex(),ji=G(ki,`gu`).replace(/notPunctSpace/g,wi).replace(/punctSpace/g,Ci).replace(/punct/g,Si).getRegex(),Mi=G(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,bi).replace(/punctSpace/g,yi).replace(/punct/g,vi).getRegex(),Ni=G(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,vi).getRegex(),Pi=G(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,bi).replace(/punctSpace/g,yi).replace(/punct/g,vi).getRegex(),Fi=G(/\\(punct)/,`gu`).replace(/punct/g,vi).getRegex(),Ii=G(/^<(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(),Li=G(si).replace(`(?:-->|$)`,`-->`).getRegex(),Ri=G(`^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`,Li).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bi=G(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,zi).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vi=G(/^!?\[(label)\]\[(ref)\]/).replace(`label`,zi).replace(`ref`,ri).getRegex(),Hi=G(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ri).getRegex(),Ui=G(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Vi).replace(`nolink`,Hi).getRegex(),Wi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gi={_backpedal:Ur,anyPunctuation:Fi,autolink:Ii,blockSkip:Ti,br:gi,code:hi,del:Ur,delLDelim:Ur,delRDelim:Ur,emStrongLDelim:Di,emStrongRDelimAst:Ai,emStrongRDelimUnd:Mi,escape:mi,link:Bi,nolink:Hi,punctuation:xi,reflink:Vi,reflinkSearch:Ui,tag:Ri,text:_i,url:Ur},Ki={...Gi,link:G(/^!?\[(label)\]\((.*?)\)/).replace(`label`,zi).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,zi).getRegex()},qi={...Gi,emStrongRDelimAst:ji,emStrongLDelim:Oi,delLDelim:Ni,delRDelim:Pi,url:G(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Wi).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:G(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Wi).getRegex()},Ji={...qi,br:G(gi).replace(`{2,}`,`*`).getRegex(),text:G(qi.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Yi={normal:ui,gfm:fi,pedantic:pi},Xi={normal:Gi,gfm:qi,breaks:Ji,pedantic:Ki},Zi={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Qi=e=>Zi[e];function $i(e,t){if(t){if(K.escapeTest.test(e))return e.replace(K.escapeReplace,Qi)}else if(K.escapeTestNoEncode.test(e))return e.replace(K.escapeReplaceNoEncode,Qi);return e}function ea(e){try{e=encodeURI(e).replace(K.percentDecode,`%`)}catch{return null}return e}function ta(e,t){var n;let r=e.replace(K.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(K.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((n=r.at(-1))!=null&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push(``);for(;i<r.length;i++)r[i]=r[i].trim().replace(K.slashPipe,`|`);return r}function na(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function ra(e){let t=e.split(`
|
|
23
|
+
`),n=t.length-1;for(;n>=0&&K.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
24
|
+
`)}function ia(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 aa(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function oa(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 sa(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
25
|
+
`).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(`
|
|
26
|
+
`)}var ca=class{constructor(e){D(this,`options`),D(this,`rules`),D(this,`lexer`),this.options=e||Vr}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=this.options.pedantic?t[0]:ra(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=sa(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=na(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:na(t[0],`
|
|
27
|
+
`),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:na(t[0],`
|
|
28
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=na(t[0],`
|
|
29
|
+
`).split(`
|
|
30
|
+
`),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(`
|
|
31
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
32
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
33
|
+
${s}`:s,r=r?`${r}
|
|
34
|
+
${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+`
|
|
35
|
+
`+e.join(`
|
|
36
|
+
`),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}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
37
|
+
`+e.join(`
|
|
38
|
+
`),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(`
|
|
39
|
+
`);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=aa(t[2].split(`
|
|
40
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
41
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.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+`
|
|
42
|
+
`,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),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
43
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
44
|
+
`+m.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+=`
|
|
45
|
+
`+l}u=!l.trim(),r+=p+`
|
|
46
|
+
`,e=e.substring(p.length+1),c=m.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){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.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 n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.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=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;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){let e=ra(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}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:na(t[0],`
|
|
47
|
+
`),href:n,title:r}}}table(e){var t;let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=ta(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,``).split(`|`),a=(t=n[3])!=null&&t.trim()?n[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
48
|
+
`):[],o={type:`table`,raw:na(n[0],`
|
|
49
|
+
`),header:[],align:[],rows:[]};if(r.length===i.length){for(let e of i)this.rules.other.tableAlignRight.test(e)?o.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?o.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?o.align.push(`left`):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(let e of a)o.rows.push(ta(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:na(t[0],`
|
|
50
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
51
|
+
`?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=na(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ia(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)),oa(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 oa(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!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}else 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,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}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}}}},la=class e{constructor(e){D(this,`tokens`),D(this,`options`),D(this,`state`),D(this,`inlineQueue`),D(this,`tokenizer`),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Vr,this.options.tokenizer=this.options.tokenizer||new ca,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:K,block:Yi.normal,inline:Xi.normal};this.options.pedantic?(t.block=Yi.pedantic,t.inline=Xi.pedantic):this.options.gfm&&(t.block=Yi.gfm,this.options.breaks?t.inline=Xi.breaks:t.inline=Xi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Yi,inline:Xi}}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(K.carriageReturn,`
|
|
52
|
+
`),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){var r,i;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(K.tabCharGlobal,` `).replace(K.spaceLine,``));let a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let o;if((r=this.options.extensions?.block)!=null&&r.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let n=t.at(-1);o.raw.length===1&&n!==void 0?n.raw+=`
|
|
53
|
+
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
54
|
+
`)?``:`
|
|
55
|
+
`)+o.raw,n.text+=`
|
|
56
|
+
`+o.text,this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
57
|
+
`)?``:`
|
|
58
|
+
`)+o.raw,n.text+=`
|
|
59
|
+
`+o.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if((i=this.options.extensions)!=null&&i.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&&(s=e.substring(0,t+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
60
|
+
`)?``:`
|
|
61
|
+
`)+o.raw,r.text+=`
|
|
62
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(o),n=s.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
63
|
+
`)?``:`
|
|
64
|
+
`)+o.raw,n.text+=`
|
|
65
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r;this.tokenizer.lexer=this;let i=e,a=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)e.includes(a[0].slice(a[0].lastIndexOf(`[`)+1,-1))&&(i=i.slice(0,a.index)+`[`+`a`.repeat(a[0].length-2)+`]`+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+`++`+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)o=a[2]?a[2].length:0,i=i.slice(0,a.index+o)+`[`+`a`.repeat(a[0].length-o-2)+`]`+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=(this.options.hooks?.emStrongMask)?.call({lexer:this},i)??i;let s=!1,c=``,l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}s||(c=``),s=!1;let a;if((n=this.options.extensions?.inline)!=null&&n.some(n=>(a=n.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let n=t.at(-1);a.type===`text`&&n?.type===`text`?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,i,c)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,i,c)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let o=e;if((r=this.options.extensions)!=null&&r.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&&(o=e.substring(0,t+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!==`_`&&(c=a.raw.slice(-1)),s=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ua=class{constructor(e){D(this,`options`),D(this,`parser`),this.options=e||Vr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(K.notSpaceStart)?.[0],i=e.replace(K.endingNewline,``)+`
|
|
66
|
+
`;return r?`<pre><code class="language-`+$i(r)+`">`+(n?i:$i(i,!0))+`</code></pre>
|
|
67
|
+
`:`<pre><code>`+(n?i:$i(i,!0))+`</code></pre>
|
|
68
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
69
|
+
${this.parser.parse(e)}</blockquote>
|
|
70
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
71
|
+
`}hr(e){return`<hr>
|
|
72
|
+
`}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+`>
|
|
73
|
+
`+r+`</`+i+`>
|
|
74
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
75
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
76
|
+
`}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>
|
|
77
|
+
<thead>
|
|
78
|
+
`+t+`</thead>
|
|
79
|
+
`+r+`</table>
|
|
80
|
+
`}tablerow({text:e}){return`<tr>
|
|
81
|
+
${e}</tr>
|
|
82
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
83
|
+
`}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>${$i(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=ea(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+$i(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=ea(e);if(i===null)return $i(n);e=i;let a=`<img src="${e}" alt="${$i(n)}"`;return t&&(a+=` title="${$i(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:$i(e.text)}},da=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}},fa=class e{constructor(e){D(this,`options`),D(this,`renderer`),D(this,`textRenderer`),this.options=e||Vr,this.options.renderer=this.options.renderer||new ua,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new da}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){var t;this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if((t=this.options.extensions?.renderers)!=null&&t[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);break;case`hr`:n+=this.renderer.hr(a);break;case`heading`:n+=this.renderer.heading(a);break;case`code`:n+=this.renderer.code(a);break;case`table`:n+=this.renderer.table(a);break;case`blockquote`:n+=this.renderer.blockquote(a);break;case`list`:n+=this.renderer.list(a);break;case`checkbox`:n+=this.renderer.checkbox(a);break;case`html`:n+=this.renderer.html(a);break;case`def`:n+=this.renderer.def(a);break;case`paragraph`:n+=this.renderer.paragraph(a);break;case`text`:n+=this.renderer.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}parseInline(e,t=this.renderer){var n;this.renderer.parser=this;let r=``;for(let i=0;i<e.length;i++){let a=e[i];if((n=this.options.extensions?.renderers)!=null&&n[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){r+=e||``;continue}}let o=a;switch(o.type){case`escape`:r+=t.text(o);break;case`html`:r+=t.html(o);break;case`link`:r+=t.link(o);break;case`image`:r+=t.image(o);break;case`checkbox`:r+=t.checkbox(o);break;case`strong`:r+=t.strong(o);break;case`em`:r+=t.em(o);break;case`codespan`:r+=t.codespan(o);break;case`br`:r+=t.br(o);break;case`del`:r+=t.del(o);break;case`text`:r+=t.text(o);break;default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return r}},pa,ma=(pa=class{constructor(e){D(this,`options`),D(this,`block`),this.options=e||Vr}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?la.lex:la.lexInline}provideParser(e=this.block){return e?fa.parse:fa.parseInline}},D(pa,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),D(pa,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),pa),ha=class{constructor(...e){D(this,`defaults`,Br()),D(this,`options`,this.setOptions),D(this,`parse`,this.parseMarkdown(!0)),D(this,`parseInline`,this.parseMarkdown(!1)),D(this,`Parser`,fa),D(this,`Renderer`,ua),D(this,`TextRenderer`,da),D(this,`Lexer`,la),D(this,`Tokenizer`,ca),D(this,`Hooks`,ma),this.use(...e)}walkTokens(e,t){var n;let r=[];for(let i of e)switch(r=r.concat(t.call(this,i)),i.type){case`table`:{let e=i;for(let n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(let n of e.rows)for(let e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{let e=i;(n=this.defaults.extensions?.childTokens)!=null&&n[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}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 ua(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 ca(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 ma;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];ma.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&ma.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)}: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 la.lex(e,t??this.defaults)}parser(e,t){return fa.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):e?la.lex:la.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):e?fa.parse:fa.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):e?la.lex:la.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):e?fa.parse:fa.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+=`
|
|
84
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+$i(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},ga=new ha;function q(e,t){return ga.parse(e,t)}q.options=q.setOptions=function(e){return ga.setOptions(e),q.defaults=ga.defaults,Hr(q.defaults),q},q.getDefaults=Br,q.defaults=Vr,q.use=function(...e){return ga.use(...e),q.defaults=ga.defaults,Hr(q.defaults),q},q.walkTokens=function(e,t){return ga.walkTokens(e,t)},q.parseInline=ga.parseInline,q.Parser=fa,q.parser=fa.parse,q.Renderer=ua,q.TextRenderer=da,q.Lexer=la,q.lexer=la.lex,q.Tokenizer=ca,q.Hooks=ma,q.parse=q,q.options,q.setOptions,q.use,q.walkTokens,q.parseInline,fa.parse,la.lex;function _a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function va(e){if(Array.isArray(e))return e}function ya(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ba(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xa(e,t){return va(e)||ya(e,t)||Sa(e,t)||ba()}function Sa(e,t){if(e){if(typeof e==`string`)return _a(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_a(e,t):void 0}}var Ca=Object.entries,wa=Object.setPrototypeOf,Ta=Object.isFrozen,Ea=Object.getPrototypeOf,Da=Object.getOwnPropertyDescriptor,Oa=Object.freeze,ka=Object.seal,Aa=Object.create,ja=typeof Reflect<`u`&&Reflect,Ma=ja.apply,Na=ja.construct;Oa||=function(e){return e},ka||=function(e){return e},Ma||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Na||=function(e){return new e(...[...arguments].slice(1))};var Pa=Z(Array.prototype.forEach),Fa=Z(Array.prototype.lastIndexOf),Ia=Z(Array.prototype.pop),La=Z(Array.prototype.push),Ra=Z(Array.prototype.splice),J=Array.isArray,za=Z(String.prototype.toLowerCase),Ba=Z(String.prototype.toString),Va=Z(String.prototype.match),Ha=Z(String.prototype.replace),Ua=Z(String.prototype.indexOf),Wa=Z(String.prototype.trim),Ga=Z(Number.prototype.toString),Ka=Z(Boolean.prototype.toString),qa=typeof BigInt>`u`?null:Z(BigInt.prototype.toString),Ja=typeof Symbol>`u`?null:Z(Symbol.prototype.toString),Y=Z(Object.prototype.hasOwnProperty),Ya=Z(Object.prototype.toString),X=Z(RegExp.prototype.test),Xa=Za(TypeError);function Z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ma(e,t,n)}}function Za(e){return function(){return Na(e,[...arguments])}}function Q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:za;if(wa&&wa(e,null),!J(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ta(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Qa(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}function $(e){let t=Aa(null);for(let r of Ca(e)){var n=xa(r,2);let i=n[0],a=n[1];Y(e,i)&&(J(a)?t[i]=Qa(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=$(a):t[i]=a)}return t}function $a(e){switch(typeof e){case`string`:return e;case`number`:return Ga(e);case`boolean`:return Ka(e);case`bigint`:return qa?qa(e):`0`;case`symbol`:return Ja?Ja(e):`Symbol()`;case`undefined`:return Ya(e);case`function`:case`object`:{if(e===null)return Ya(e);let t=e,n=eo(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Ya(e)}return Ya(e)}default:return Ya(e)}}function eo(e,t){for(;e!==null;){let n=Da(e,t);if(n){if(n.get)return Z(n.get);if(typeof n.value==`function`)return Z(n.value)}e=Ea(e)}function n(){return null}return n}function to(e){try{return X(e,``),!0}catch{return!1}}var no=Oa(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ro=Oa(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),io=Oa([`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`]),ao=Oa([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),oo=Oa(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),so=Oa([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),co=Oa([`#text`]),lo=Oa(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),uo=Oa(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),fo=Oa(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),po=Oa([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),mo=ka(/{{[\w\W]*|^[\w\W]*}}/g),ho=ka(/<%[\w\W]*|^[\w\W]*%>/g),go=ka(/\${[\w\W]*/g),_o=ka(/^data-[\-\w.\u00B7-\uFFFF]+$/),vo=ka(/^aria-[\-\w]+$/),yo=ka(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bo=ka(/^(?:\w+script|data):/i),xo=ka(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),So=ka(/^html$/i),Co=ka(/^[a-z][.\w]*(-[.\w]+)+$/i),wo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},To=function(){return typeof window>`u`?null:window},Eo=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Do=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Oo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:To(),t=e=>Oo(e);if(t.version=`3.4.8`,t.removed=[],!e||!e.document||e.document.nodeType!==wo.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=eo(d,`cloneNode`),p=eo(d,`remove`),m=eo(d,`nextSibling`),h=eo(d,`childNodes`),g=eo(d,`parentNode`),_=eo(d,`shadowRoot`),v=eo(d,`attributes`),y=o&&o.prototype?eo(o.prototype,`nodeType`):null,b=o&&o.prototype?eo(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C=0,w=function(e){if(C>0)throw Xa(`The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`);C++;try{return x.createHTML(e)}finally{C--}},T=n,E=T.implementation,D=T.createNodeIterator,O=T.createDocumentFragment,k=T.getElementsByTagName,ee=r.importNode,A=Do();t.isSupported=typeof Ca==`function`&&typeof g==`function`&&E&&E.createHTMLDocument!==void 0;let j=mo,te=ho,M=go,N=_o,ne=vo,re=bo,ie=xo,ae=Co,oe=yo,P=null,se=Q({},[...no,...ro,...io,...oo,...co]),F=null,ce=Q({},[...lo,...uo,...fo,...po]),I=Object.seal(Aa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,le=null,ue=Object.seal(Aa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),de=!0,fe=!0,pe=!1,me=!0,he=!1,ge=!0,_e=!1,ve=!1,ye=!1,be=!1,xe=!1,Se=!1,Ce=!0,we=!1,R=`user-content-`,Te=!0,Ee=!1,De={},Oe=null,ke=Q({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Ae=null,z=Q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),je=null,Me=Q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ne=`http://www.w3.org/1998/Math/MathML`,Pe=`http://www.w3.org/2000/svg`,Fe=`http://www.w3.org/1999/xhtml`,Ie=Fe,Le=!1,Re=null,ze=Q({},[Ne,Pe,Fe],Ba),Be=Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ve=Q({},[`annotation-xml`]),He=Q({},[`title`,`style`,`font`,`a`,`script`]),Ue=null,We=[`application/xhtml+xml`,`text/html`],B=null,Ge=null,Ke=n.createElement(`form`),qe=function(e){return e instanceof RegExp||e instanceof Function},Je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ge&&Ge===e)return;(!e||typeof e!=`object`)&&(e={}),e=$(e),Ue=We.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,B=Ue===`application/xhtml+xml`?Ba:za,P=Y(e,`ALLOWED_TAGS`)&&J(e.ALLOWED_TAGS)?Q({},e.ALLOWED_TAGS,B):se,F=Y(e,`ALLOWED_ATTR`)&&J(e.ALLOWED_ATTR)?Q({},e.ALLOWED_ATTR,B):ce,Re=Y(e,`ALLOWED_NAMESPACES`)&&J(e.ALLOWED_NAMESPACES)?Q({},e.ALLOWED_NAMESPACES,Ba):ze,je=Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)?Q($(Me),e.ADD_URI_SAFE_ATTR,B):Me,Ae=Y(e,`ADD_DATA_URI_TAGS`)&&J(e.ADD_DATA_URI_TAGS)?Q($(z),e.ADD_DATA_URI_TAGS,B):z,Oe=Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)?Q({},e.FORBID_CONTENTS,B):ke,L=Y(e,`FORBID_TAGS`)&&J(e.FORBID_TAGS)?Q({},e.FORBID_TAGS,B):$({}),le=Y(e,`FORBID_ATTR`)&&J(e.FORBID_ATTR)?Q({},e.FORBID_ATTR,B):$({}),De=Y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?$(e.USE_PROFILES):e.USE_PROFILES:!1,de=e.ALLOW_ARIA_ATTR!==!1,fe=e.ALLOW_DATA_ATTR!==!1,pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,he=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,_e=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,xe=e.RETURN_DOM_FRAGMENT||!1,Se=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,Ce=e.SANITIZE_DOM!==!1,we=e.SANITIZE_NAMED_PROPS||!1,Te=e.KEEP_CONTENT!==!1,Ee=e.IN_PLACE||!1,oe=to(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:yo,Ie=typeof e.NAMESPACE==`string`?e.NAMESPACE:Fe,Be=Y(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?$(e.MATHML_TEXT_INTEGRATION_POINTS):Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ve=Y(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?$(e.HTML_INTEGRATION_POINTS):Q({},[`annotation-xml`]);let t=Y(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?$(e.CUSTOM_ELEMENT_HANDLING):Aa(null);if(I=Aa(null),Y(t,`tagNameCheck`)&&qe(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),Y(t,`attributeNameCheck`)&&qe(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),Y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),he&&(fe=!1),xe&&(be=!0),De&&(P=Q({},co),F=Aa(null),De.html===!0&&(Q(P,no),Q(F,lo)),De.svg===!0&&(Q(P,ro),Q(F,uo),Q(F,po)),De.svgFilters===!0&&(Q(P,io),Q(F,uo),Q(F,po)),De.mathMl===!0&&(Q(P,oo),Q(F,fo),Q(F,po))),ue.tagCheck=null,ue.attributeCheck=null,Y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ue.tagCheck=e.ADD_TAGS:J(e.ADD_TAGS)&&(P===se&&(P=$(P)),Q(P,e.ADD_TAGS,B))),Y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ue.attributeCheck=e.ADD_ATTR:J(e.ADD_ATTR)&&(F===ce&&(F=$(F)),Q(F,e.ADD_ATTR,B))),Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)&&Q(je,e.ADD_URI_SAFE_ATTR,B),Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)&&(Oe===ke&&(Oe=$(Oe)),Q(Oe,e.FORBID_CONTENTS,B)),Y(e,`ADD_FORBID_CONTENTS`)&&J(e.ADD_FORBID_CONTENTS)&&(Oe===ke&&(Oe=$(Oe)),Q(Oe,e.ADD_FORBID_CONTENTS,B)),Te&&(P[`#text`]=!0),_e&&Q(P,[`html`,`head`,`body`]),P.table&&(Q(P,[`tbody`]),delete L.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Xa(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Xa(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=w(``)}catch(e){throw x=t,e}}else x===void 0&&e.TRUSTED_TYPES_POLICY!==null&&(x=Eo(u,i)),x&&typeof S==`string`&&(S=w(``));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&P===se&&(P=$(P)),A.uponSanitizeAttribute.length>0&&F===ce&&(F=$(F)),Oa&&Oa(e),Ge=e},Ye=Q({},[...ro,...io,...ao]),Xe=Q({},[...oo,...so]),Ze=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ie,tagName:`template`});let n=za(e.tagName),r=za(t.tagName);return Re[e.namespaceURI]?e.namespaceURI===Pe?t.namespaceURI===Fe?n===`svg`:t.namespaceURI===Ne?n===`svg`&&(r===`annotation-xml`||Be[r]):!!Ye[n]:e.namespaceURI===Ne?t.namespaceURI===Fe?n===`math`:t.namespaceURI===Pe?n===`math`&&Ve[r]:!!Xe[n]:e.namespaceURI===Fe?t.namespaceURI===Pe&&!Ve[r]||t.namespaceURI===Ne&&!Be[r]?!1:!Xe[n]&&(He[n]||!Ye[n]):!!(Ue===`application/xhtml+xml`&&Re[e.namespaceURI]):!1},Qe=function(e){La(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},$e=function(e,n){try{La(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{La(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(be||xe)try{Qe(n)}catch{}else try{n.setAttribute(e,``)}catch{}},et=function(e){let t=null,r=null;if(ye)e=`<remove></remove>`+e;else{let t=Va(e,/^[\r\n\t ]+/);r=t&&t[0]}Ue===`application/xhtml+xml`&&Ie===Fe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?w(e):e;if(Ie===Fe)try{t=new l().parseFromString(i,Ue)}catch{}if(!t||!t.documentElement){t=E.createDocument(Ie,`template`,null);try{t.documentElement.innerHTML=Le?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ie===Fe?k.call(t,_e?`html`:`body`)[0]:_e?t.documentElement:a},tt=function(e){return D.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},nt=function(e){e.normalize();let t=D.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;Pa([j,te,M],t=>{e=Ha(e,t,` `)}),n.data=e,n=t.nextNode()}let r=e.querySelectorAll?.call(e,`template`)??[];Pa(Array.from(r),e=>{it(e.content)&&nt(e.content)})},rt=function(e){let t=b?b(e):null;return typeof t!=`string`||B(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},it=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===wo.documentFragment}catch{return!1}},at=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function ot(e,n,r){Pa(e,e=>{e.call(t,n,r,Ge)})}let st=function(e){let n=null;if(ot(A.beforeSanitizeElements,e,null),rt(e))return Qe(e),!0;let r=B(b?b(e):e.nodeName);if(ot(A.uponSanitizeElement,e,{tagName:r,allowedTags:P}),ge&&e.hasChildNodes()&&!at(e.firstElementChild)&&X(/<[/\w!]/g,e.innerHTML)&&X(/<[/\w!]/g,e.textContent)||ge&&e.namespaceURI===Fe&&r===`style`&&at(e.firstElementChild)||e.nodeType===wo.progressingInstruction||ge&&e.nodeType===wo.comment&&X(/<[/\w]/g,e.data))return Qe(e),!0;if(L[r]||!(ue.tagCheck instanceof Function&&ue.tagCheck(r))&&!P[r]){if(!L[r]&&ut(r)&&(I.tagNameCheck instanceof RegExp&&X(I.tagNameCheck,r)||I.tagNameCheck instanceof Function&&I.tagNameCheck(r)))return!1;if(Te&&!Oe[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return Qe(e),!0}return(y?y(e):e.nodeType)===wo.element&&!Ze(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&X(/<\/no(script|embed|frames)/i,e.innerHTML)?(Qe(e),!0):(he&&e.nodeType===wo.text&&(n=e.textContent,Pa([j,te,M],e=>{n=Ha(n,e,` `)}),e.textContent!==n&&(La(t.removed,{element:e.cloneNode()}),e.textContent=n)),ot(A.afterSanitizeElements,e,null),!1)},ct=function(e,t,r){if(le[t]||Ce&&(t===`id`||t===`name`)&&(r in n||r in Ke))return!1;let i=F[t]||ue.attributeCheck instanceof Function&&ue.attributeCheck(t,e);if(!(fe&&!le[t]&&X(N,t))&&!(de&&X(ne,t))){if(!i||le[t]){if(!(ut(e)&&(I.tagNameCheck instanceof RegExp&&X(I.tagNameCheck,e)||I.tagNameCheck instanceof Function&&I.tagNameCheck(e))&&(I.attributeNameCheck instanceof RegExp&&X(I.attributeNameCheck,t)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(t,e))||t===`is`&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&X(I.tagNameCheck,r)||I.tagNameCheck instanceof Function&&I.tagNameCheck(r))))return!1}else if(!je[t]&&!X(oe,Ha(r,ie,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ua(r,`data:`)===0&&Ae[e])&&!(pe&&!X(re,Ha(r,ie,``)))&&r)return!1}return!0},lt=Q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),ut=function(e){return!lt[za(e)]&&X(ae,e)},dt=function(e){ot(A.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||rt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=B(o),d=c,f=o===`value`?d:Wa(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,ot(A.uponSanitizeAttribute,e,r),f=r.attrValue,we&&(l===`id`||l===`name`)&&Ua(f,R)!==0&&($e(o,e),f=R+f),ge&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){$e(o,e);continue}if(l===`attributename`&&Va(f,`href`)){$e(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){$e(o,e);continue}if(!me&&X(/\/>/i,f)){$e(o,e);continue}he&&Pa([j,te,M],e=>{f=Ha(f,e,` `)});let p=B(e.nodeName);if(!ct(p,l,f)){$e(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=w(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),rt(e)?Qe(e):Ia(t.removed)}catch{$e(o,e)}}ot(A.afterSanitizeAttributes,e,null)},ft=function(e){let t=null,n=tt(e);for(ot(A.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(ot(A.uponSanitizeShadowNode,t,null),st(t),dt(t),it(t.content)&&ft(t.content),(y?y(t):t.nodeType)===wo.element){let e=_?_(t):t.shadowRoot;it(e)&&(pt(e),ft(e))}ot(A.afterSanitizeShadowDOM,e,null)},pt=function(e){let t=y?y(e):e.nodeType;if(t===wo.element){let t=_?_(e):e.shadowRoot;it(t)&&(pt(t),ft(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];Pa(n,e=>{La(r,e)});for(let e of r)pt(e);if(t===wo.element){let t=b?b(e):null;if(typeof t==`string`&&B(t)===`template`){let t=e.content;it(t)&&pt(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Le=!e,Le&&(e=`<!-->`),typeof e!=`string`&&!at(e)&&(e=$a(e),typeof e!=`string`))throw Xa(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(ve||Je(n),t.removed=[],typeof e==`string`&&(Ee=!1),Ee){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=B(t);if(!P[e]||L[e])throw Xa(`root node is forbidden and cannot be sanitized in-place`)}if(rt(e))throw Xa(`root node is clobbered and cannot be sanitized in-place`);pt(e)}else if(at(e))i=et(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===wo.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),pt(a);else{if(!be&&!he&&!_e&&e.indexOf(`<`)===-1)return x&&Se?w(e):e;if(i=et(e),!i)return be?null:Se?S:``}i&&ye&&Qe(i.firstChild);let c=tt(Ee?e:i);for(;o=c.nextNode();)st(o),dt(o),it(o.content)&&ft(o.content);if(Ee)return he&&nt(e),e;if(be){if(he&&nt(i),xe)for(s=O.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(F.shadowroot||F.shadowrootmode)&&(s=ee.call(r,s,!0)),s}let l=_e?i.outerHTML:i.innerHTML;return _e&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&X(So,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
86
|
+
`+l),he&&Pa([j,te,M],e=>{l=Ha(l,e,` `)}),x&&Se?w(l):l},t.setConfig=function(){Je(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),ve=!0},t.clearConfig=function(){Ge=null,ve=!1},t.isValidAttribute=function(e,t,n){return Ge||Je({}),ct(B(e),B(t),n)},t.addHook=function(e,t){typeof t==`function`&&La(A[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Fa(A[e],t);return n===-1?void 0:Ra(A[e],n,1)[0]}return Ia(A[e])},t.removeHooks=function(e){A[e]=[]},t.removeAllHooks=function(){A=Do()},t}Oo(),new ha({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{let e=new ua;return e.code=({text:e,lang:t})=>{let n=(t??``).toLowerCase(),r=cr(e,n);return`<pre><code${n?` class="language-${n}"`:``}>${r}</code></pre>`},e})()});export{He as n,zr as r,B as t};
|