zen-gitsync 2.18.11 → 2.18.13
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 +14 -14
- package/package.json +6 -1
- package/src/cli/ai/agent.js +1385 -1385
- package/src/cli/ai/context.js +431 -431
- package/src/cli/ai/context.test.js +376 -376
- package/src/cli/ai/turn.js +190 -190
- package/src/ui/public/assets/AgentView-CuEM6xzC.js +11 -0
- package/src/ui/public/assets/{AgentView-CbBLjlfr.css → AgentView-D6MJOrJt.css} +1 -1
- package/src/ui/public/assets/AppVersionBadge-BK1Fiv3b.js +2 -0
- package/src/ui/public/assets/BranchSelector-avxY_m05.js +1 -0
- package/src/ui/public/assets/CommitForm-hThTnoNt.js +14 -0
- package/src/ui/public/assets/CommonDialog-zaBdFGFH.js +1 -0
- package/src/ui/public/assets/CopySessionButton-CAxaqLQL.js +21 -0
- package/src/ui/public/assets/EditorView-B7Rq9QV1.css +1 -0
- package/src/ui/public/assets/EditorView-iSA2SXJR.js +37 -0
- package/src/ui/public/assets/{FlowExecutionViewer-D7FaZSHd.js → FlowExecutionViewer-C5ylYV2C.js} +1 -1
- package/src/ui/public/assets/FlowOrchestrationWorkspace-CiQ07ZQv.js +21 -0
- package/src/ui/public/assets/LogList-Sjb8vmvq.js +7 -0
- package/src/ui/public/assets/MindmapView-B5rChFMP.js +2 -0
- package/src/ui/public/assets/MonitorView-Dcc-i2Fo.js +3 -0
- package/src/ui/public/assets/ProjectStartupButton-fz6eLCZU.js +1 -0
- package/src/ui/public/assets/RecentDirectoriesChat-BDnNp9jh.js +3 -0
- package/src/ui/public/assets/RemoteManagerDialog-NA1jRC7O.js +4 -0
- package/src/ui/public/assets/RemoteRepoCard-CKm4KqHs.js +7 -0
- package/src/ui/public/assets/SourceMapView-Drfato_u.js +3 -0
- package/src/ui/public/assets/SvgIcon-DR_79iBR.js +1 -0
- package/src/ui/public/assets/UserInputNode-DroKvDOa.js +1 -0
- package/src/ui/public/assets/WorkbenchView-CW7OACCU.js +326 -0
- package/src/ui/public/assets/WorkbenchView-C_u6BptZ.css +1 -0
- package/src/ui/public/assets/_plugin-vue_export-helper-bQQyMRS6.js +19 -0
- package/src/ui/public/assets/agentConversations-wYAksLq1.js +10 -0
- package/src/ui/public/assets/{configStore-Z6Z8hVMO.js → configStore-BeHB-gV4.js} +1 -1
- package/src/ui/public/assets/{css.worker-BDCmgL4U.js → css.worker-DFdt6_zu.js} +9 -9
- package/src/ui/public/assets/{dagre-CiGYsZhd.js → dagre-CXi8gaG9.js} +4 -4
- package/src/ui/public/assets/editor.worker-O-CH8JUO.js +26 -0
- package/src/ui/public/assets/{element-plus-D-6gla1z.css → element-plus-DJ3ZQa98.css} +1 -1
- package/src/ui/public/assets/element-plus-DgSY_Wt4.js +48 -0
- package/src/ui/public/assets/{flow-mindmap-C-X_QPQI.js → flow-mindmap-BsTRkgat.js} +56 -56
- package/src/ui/public/assets/{html.worker-DG8hnSJR.js → html.worker-JUzsMP-j.js} +8 -8
- package/src/ui/public/assets/index-BRQstBzy.js +211 -0
- package/src/ui/public/assets/json.worker-B4dEhy0e.js +58 -0
- package/src/ui/public/assets/{monaco-CbN14ZVi.js → monaco-CnWeufxc.js} +6 -6
- package/src/ui/public/assets/{office-docx-8MF5-THx.js → office-docx-EUfAIM4w.js} +6 -6
- package/src/ui/public/assets/{office-excel-BTzQyK6y.js → office-excel-BZW0bXQo.js} +1 -1
- package/src/ui/public/assets/{office-pptx-DhxvWA0D.js → office-pptx-CBvDNZ4m.js} +3 -3
- package/src/ui/public/assets/{ts.worker-DgFMIcEs.js → ts.worker-CmEKzkmF.js} +49 -49
- package/src/ui/public/assets/useOrchestrator-Bhl7DGKW.js +1 -0
- package/src/ui/public/assets/{vendor-Bd8DyOF9.css → vendor-CSFGMcMB.css} +1 -1
- package/src/ui/public/assets/{vendor-Cd7TGb0b.js → vendor-CZlKgriV.js} +43 -43
- package/src/ui/public/assets/vue-flow-DawpR_uk.js +39 -0
- package/src/ui/public/index.html +13 -13
- package/src/ui/server/routes/config.js +1348 -1348
- package/src/ui/server/routes/fileOpen.js +85 -16
- package/src/ui/server/routes/workbench/agentChat.js +752 -752
- package/src/ui/server/routes/workbench/agentChatShared.test.js +496 -497
- package/src/ui/server/routes/workbench/agentRoutes.js +13 -1
- package/src/ui/server/routes/workbench/agentRoutes.test.js +75 -0
- package/src/ui/server/routes/workbench/dispatchInstruction.js +6 -7
- package/src/ui/server/routes/workbench/dispatchInstruction.test.js +3 -19
- package/src/ui/server/routes/workbench/index.js +8 -17
- package/src/ui/server/routes/workbench/orchestratorPrompt.test.js +2 -2
- package/src/ui/server/routes/workbench/orchestratorStore.js +2 -16
- package/src/ui/server/routes/workbench/projectRegistry.test.js +1 -5
- package/src/ui/server/routes/workbench/scheduleRoutes.js +2 -2
- package/src/ui/server/routes/workbench/shared.js +18 -1
- package/src/ui/public/assets/AgentView-D3I3D3YR.js +0 -11
- package/src/ui/public/assets/AppVersionBadge-CrDf0lYs.js +0 -2
- package/src/ui/public/assets/BranchSelector-DEHLVln4.js +0 -1
- package/src/ui/public/assets/CommitForm-D2rVFZf2.js +0 -14
- package/src/ui/public/assets/CommonDialog-CV7T8OCb.js +0 -1
- package/src/ui/public/assets/CopySessionButton-BbVtrOa7.js +0 -21
- package/src/ui/public/assets/EditorView-BiNRO222.css +0 -1
- package/src/ui/public/assets/EditorView-CiW0kkpS.js +0 -37
- package/src/ui/public/assets/FlowOrchestrationWorkspace-BR3cPhyU.js +0 -21
- package/src/ui/public/assets/LogList-D_Q3pyMF.js +0 -7
- package/src/ui/public/assets/MindmapView-A4QZ6_c3.js +0 -2
- package/src/ui/public/assets/MonitorView-BljWw76B.js +0 -3
- package/src/ui/public/assets/ProjectStartupButton-Be5DovFL.js +0 -1
- package/src/ui/public/assets/RecentDirectoriesChat-DN7ruCU7.js +0 -3
- package/src/ui/public/assets/RemoteManagerDialog-BSCNy4RC.js +0 -4
- package/src/ui/public/assets/RemoteRepoCard-CeCRQp9p.js +0 -7
- package/src/ui/public/assets/SourceMapView-B_S-vspy.js +0 -3
- package/src/ui/public/assets/SvgIcon-9IbiSszR.js +0 -1
- package/src/ui/public/assets/UserInputNode-DASGnUCl.js +0 -1
- package/src/ui/public/assets/WorkbenchView-B3v-0vWa.js +0 -305
- package/src/ui/public/assets/WorkbenchView-DO2ndsES.css +0 -1
- package/src/ui/public/assets/_plugin-vue_export-helper-zp6tdw8N.js +0 -19
- package/src/ui/public/assets/agentConversations-Cplq42kA.js +0 -10
- package/src/ui/public/assets/editor.worker-GCPm6rMv.js +0 -26
- package/src/ui/public/assets/element-plus-CJqN49tX.js +0 -48
- package/src/ui/public/assets/index-C90dYckz.js +0 -211
- package/src/ui/public/assets/json.worker-CxwlJRnL.js +0 -58
- package/src/ui/public/assets/useOrchestrator-C3wjJ7p4.js +0 -1
- package/src/ui/public/assets/vue-flow-x4TlHHzT.js +0 -39
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$n as e,An as t,Cn as n,Dn as r,Fn as i,Hn as a,In as o,Kn as s,Lr as c,On as l,Pn as u,Qr as d,Rn as f,Sn as p,Sr as m,Xr as h,Yn as g,Zn as _,bn as v,br as y,cr as b,dr as x,fn as S,hr as C,jn as w,kn as T,ni as E,nr as D,rr as ee,tr as O,un as k,ur as A,xn as j,yn as M}from"./element-plus-DgSY_Wt4.js";a(),C(),S(),c();var N=Object.defineProperty,te=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>te(e,typeof t==`symbol`?t:t+``,n),ne=f({__name:`Icon`,props:{name:{type:String,required:!0},size:{type:[Number,String],required:!1},stroke:{type:[Number,String],required:!1}},setup(e,{expose:t}){t();let n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),F=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},re=[`width`,`height`,`stroke-width`];function ie(r,i,a,o,s,c){return e(),w(`svg`,{width:a.size??16,height:a.size??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":a.stroke??1.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[t(` add: plus in circle `),a.name===`add`?(e(),w(n,{key:0},[i[0]||=l(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),i[1]||=l(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`},null,-1),i[2]||=l(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):a.name===`minus`?(e(),w(n,{key:1},[t(` minus `),i[3]||=l(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),i[4]||=l(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):a.name===`delete`?(e(),w(n,{key:2},[t(` delete: trash `),i[5]||=u(`<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)):a.name===`edit`?(e(),w(n,{key:3},[t(` edit: pencil `),i[6]||=l(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`},null,-1),i[7]||=l(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`},null,-1)],64)):a.name===`collapse`?(e(),w(n,{key:4},[t(` collapse: chevron up/down (rotate via :transform) `),i[8]||=l(`polyline`,{points:`6 9 12 15 18 9`},null,-1)],64)):a.name===`expand`?(e(),w(n,{key:5},[t(` expand: chevron right `),i[9]||=l(`polyline`,{points:`9 6 15 12 9 18`},null,-1)],64)):a.name===`collapse-all`?(e(),w(n,{key:6},[t(` collapse-all: 4 diagonal arrows pointing INWARD to the\r
|
|
2
2
|
center (4,4) (20,4) (20,20) (4,20) → (10,10) (14,10)\r
|
|
3
|
-
(14,14) (10,14). Reads as "compress all to center". `),
|
|
3
|
+
(14,14) (10,14). Reads as "compress all to center". `),i[10]||=u(`<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)):a.name===`expand-all`?(e(),w(n,{key:7},[t(` expand-all: mirror of collapse-all — 4 diagonal arrows\r
|
|
4
4
|
pointing OUTWARD from the center. Reads as "expand to\r
|
|
5
|
-
bounds". `),
|
|
6
|
-
root centered at top, 3 children at the bottom row). `),
|
|
5
|
+
bounds". `),i[11]||=u(`<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)):a.name===`expand-level-1`?(e(),w(n,{key:8},[t(` expand-level-1: 1 root dot + 3 children dots (2-level tree,\r
|
|
6
|
+
root centered at top, 3 children at the bottom row). `),i[12]||=u(`<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)):a.name===`expand-level-2`?(e(),w(n,{key:9},[t(` expand-level-2: 1 root + 3 children + 3 grandchildren\r
|
|
7
7
|
(3-level tree). Lines fan out from each child to its\r
|
|
8
|
-
single grandchild, giving a symmetric "tree" silhouette. `),
|
|
9
|
-
glyph: reads as "snap the canvas back into the frame". `),
|
|
8
|
+
single grandchild, giving a symmetric "tree" silhouette. `),i[13]||=u(`<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)):a.name===`zoom-in`?(e(),w(n,{key:10},[t(` zoom in `),i[14]||=l(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),i[15]||=l(`line`,{x1:`11`,y1:`8`,x2:`11`,y2:`14`},null,-1),i[16]||=l(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),i[17]||=l(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`zoom-out`?(e(),w(n,{key:11},[t(` zoom out `),i[18]||=l(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),i[19]||=l(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),i[20]||=l(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`reset`?(e(),w(n,{key:12},[t(` reset: 4 corner brackets pointing inward — "fit to view"\r
|
|
9
|
+
glyph: reads as "snap the canvas back into the frame". `),i[21]||=l(`polyline`,{points:`4 9 4 4 9 4`},null,-1),i[22]||=l(`polyline`,{points:`15 4 20 4 20 9`},null,-1),i[23]||=l(`polyline`,{points:`20 15 20 20 15 20`},null,-1),i[24]||=l(`polyline`,{points:`9 20 4 20 4 15`},null,-1)],64)):a.name===`database`?(e(),w(n,{key:13},[t(` database: classic cylinder — reads as “view data / data\r
|
|
10
10
|
source”. Stroke-only; matches the other monoline\r
|
|
11
|
-
icons. `),
|
|
11
|
+
icons. `),i[25]||=l(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.5`},null,-1),i[26]||=l(`path`,{d:`M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6`},null,-1),i[27]||=l(`path`,{d:`M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12`},null,-1)],64)):a.name===`settings`?(e(),w(n,{key:14},[t(` settings: gear / cog — Lucide-style single-path gear with\r
|
|
12
12
|
a center hole. Reads as “settings / preferences” at any\r
|
|
13
|
-
size and stays crisp at 13 px. `),
|
|
14
|
-
logo mark. Clean and recognizable at small sizes. `),
|
|
15
|
-
Slightly different from 'note' (no folded corner). `),
|
|
13
|
+
size and stays crisp at 13 px. `),i[28]||=l(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`},null,-1),i[29]||=l(`circle`,{cx:`12`,cy:`12`,r:`3`},null,-1)],64)):a.name===`markdown`?(e(),w(n,{key:15},[t(` markdown: rounded rect with “M↓” — the standard Markdown\r
|
|
14
|
+
logo mark. Clean and recognizable at small sizes. `),i[30]||=l(`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`},null,-1),i[31]||=l(`path`,{d:`M6 15 V9 L9 12 L12 9 V15`},null,-1),i[32]||=l(`path`,{d:`M15 15 V9 L18 12 V9 M15 12 L18 15`},null,-1)],64)):a.name===`txt`?(e(),w(n,{key:16},[t(` txt: a page with horizontal lines, reads as plain text.\r
|
|
15
|
+
Slightly different from 'note' (no folded corner). `),i[33]||=l(`rect`,{x:`5`,y:`3`,width:`14`,height:`18`,rx:`1.5`},null,-1),i[34]||=l(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),i[35]||=l(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),i[36]||=l(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`eye`?(e(),w(n,{key:17},[t(` eye: open eye -- used for the canvas preview toggle button.\r
|
|
16
16
|
Reads as "click to enter preview mode" (the eye is "open",\r
|
|
17
|
-
i.e. seeing the canvas in full). `),
|
|
17
|
+
i.e. seeing the canvas in full). `),i[37]||=l(`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),i[38]||=l(`circle`,{cx:`12`,cy:`12`,r:`3.2`},null,-1)],64)):a.name===`eye-off`?(e(),w(n,{key:18},[t(` eye-off: closed/slashed eye -- used for "exit preview"\r
|
|
18
18
|
in the same button slot. When the canvas is in preview\r
|
|
19
19
|
mode, the button shows this icon to signal "click to go\r
|
|
20
|
-
back to the editable view". `),
|
|
21
|
-
Reads as "click to show the outline / sidebar view". `),
|
|
22
|
-
nodes — classic radial / hub-and-spoke silhouette. `),
|
|
23
|
-
with right-angled lines — clearly reads as "expand right". `),
|
|
24
|
-
"export vector/SVG". `),
|
|
25
|
-
"联系 / relationship line" (XMind). `),
|
|
20
|
+
back to the editable view". `),i[39]||=l(`path`,{d:`M3 3 L21 21`},null,-1),i[40]||=l(`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),i[41]||=l(`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),i[42]||=l(`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)):a.name===`outline`?(e(),w(n,{key:19},[t(` outline: document with a list -- the left-drawer trigger.\r
|
|
21
|
+
Reads as "click to show the outline / sidebar view". `),i[43]||=l(`rect`,{x:`4`,y:`3`,width:`16`,height:`18`,rx:`2`},null,-1),i[44]||=l(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),i[45]||=l(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),i[46]||=l(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`logo`?(e(),w(n,{key:20},[t(` mindmap logo: branched node `),t(` mindmap logo: branched node `),i[47]||=u(`<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)):a.name===`import`?(e(),w(n,{key:21},[t(` import: arrow down into tray `),i[48]||=l(`path`,{d:`M12 4 V15`},null,-1),i[49]||=l(`polyline`,{points:`7 10 12 15 17 10`},null,-1),i[50]||=l(`path`,{d:`M4 19 H20`},null,-1)],64)):a.name===`export`?(e(),w(n,{key:22},[t(` export: arrow up out of tray `),i[51]||=l(`path`,{d:`M12 15 V4`},null,-1),i[52]||=l(`polyline`,{points:`7 9 12 4 17 9`},null,-1),i[53]||=l(`path`,{d:`M4 19 H20`},null,-1)],64)):a.name===`balance`?(e(),w(n,{key:23},[t(` balance: two arrows pointing inward, suggesting even distribution `),i[54]||=u(`<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)):a.name===`mindmap`?(e(),w(n,{key:24},[t(` mindmap: central node with 4 diagonal branches to outer\r
|
|
22
|
+
nodes — classic radial / hub-and-spoke silhouette. `),i[55]||=u(`<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)):a.name===`tree`?(e(),w(n,{key:25},[t(` tree: root on the left, 3 children on the right, joined\r
|
|
23
|
+
with right-angled lines — clearly reads as "expand right". `),i[56]||=u(`<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)):a.name===`org`?(e(),w(n,{key:26},[t(` org: top-down hierarchy (1.html btnLayoutOrg) `),i[57]||=u(`<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)):a.name===`image`?(e(),w(n,{key:27},[t(` image: rectangle + sun + mountain, picture glyph `),i[58]||=l(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`},null,-1),i[59]||=l(`circle`,{cx:`9`,cy:`11`,r:`1.6`},null,-1),i[60]||=l(`polyline`,{points:`3 17 9 12 13 15 16 13 21 17`},null,-1)],64)):a.name===`x`?(e(),w(n,{key:28},[t(` x: simple cross `),i[61]||=l(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1),i[62]||=l(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1)],64)):a.name===`link`?(e(),w(n,{key:29},[t(` link: chain link glyph `),i[63]||=l(`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),i[64]||=l(`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)):a.name===`note`?(e(),w(n,{key:30},[t(` note: lined note / page `),i[65]||=l(`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),i[66]||=l(`line`,{x1:`8`,y1:`10`,x2:`16`,y2:`10`},null,-1),i[67]||=l(`line`,{x1:`8`,y1:`13`,x2:`16`,y2:`13`},null,-1),i[68]||=l(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`search`?(e(),w(n,{key:31},[t(` search: magnifying glass `),i[69]||=l(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),i[70]||=l(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`json`?(e(),w(n,{key:32},[t(` json: curly braces — reads as "JSON data format". `),i[71]||=l(`path`,{d:`M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14`},null,-1),i[72]||=l(`path`,{d:`M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14`},null,-1)],64)):a.name===`svg-export`?(e(),w(n,{key:33},[t(` svg-export: document with angle brackets — reads as\r
|
|
24
|
+
"export vector/SVG". `),i[73]||=l(`path`,{d:`M6 3 h8 l4 4 v14 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),i[74]||=l(`polyline`,{points:`14 3 14 7 18 7`},null,-1),i[75]||=l(`polyline`,{points:`8 14 6 16 8 18`},null,-1),i[76]||=l(`polyline`,{points:`14 14 16 16 14 18`},null,-1)],64)):a.name===`relation`?(e(),w(n,{key:34},[t(` relation: two nodes joined by a dashed curve — reads as\r
|
|
25
|
+
"联系 / relationship line" (XMind). `),i[77]||=l(`circle`,{cx:`5`,cy:`19`,r:`2.5`},null,-1),i[78]||=l(`circle`,{cx:`19`,cy:`5`,r:`2.5`},null,-1),i[79]||=l(`path`,{d:`M7 17 C 10 12, 14 12, 17 7`,"stroke-dasharray":`3 2.2`},null,-1)],64)):t(`v-if`,!0)],8,re)}var I=F(ne,[[`render`,ie],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/Icon.vue`]]),ae=`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`,L=`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`,R=[22,15,13,12],z=[700,600,500,400],oe=[46,36,30,26],se=[120,80,60,44],ce=[.8,.8,.8,.8],le=R.length-1;function ue(e,t){return Math.round(B(e,t)*ce[de(e)])}function de(e){return Math.min(le,Math.max(0,e))}function B(e,t=14){return Math.round(R[de(e)]*t/14*10)/10}function fe(e,t=14){return Math.round(oe[de(e)]*t/14)}var pe=60,me=30,he=.75,ge=14,_e=24;function ve(e){return Math.max(me,Math.round(pe*he**+e))}var ye=null;function be(){if(ye)return ye;let e=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null;return e?(ye=e,e):{font:``,measureText:()=>({width:0})}}var xe=new Map;function Se(e,t,n){let r=`${n}|${t}|${e}`,i=xe.get(r);if(i!==void 0)return i;let a=be();a.font=`${n} ${t}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;let o=e.split(`
|
|
26
26
|
`),s=0;for(let e of o){let t=a.measureText(e).width;t>s&&(s=t)}return xe.set(r,s),s}var Ce=24,we=400,Te=8,Ee=16,De=4,Oe=200;function ke(e,t,n){return Math.min(n,Math.max(t,e))}function Ae(e,t,n,r,i){let a=de(t),o=B(t,n),s=Math.min(Se(e.text||``,o,z[a]),Oe),c=ue(t,n),l=Math.ceil(s+c*2+2),u=(e.text||``).split(`
|
|
27
27
|
`),d=0;for(let e of u){let t=Se(e,o,z[a]);d+=Math.max(1,Math.ceil(t/Oe))}d=Math.max(1,d);let f=!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`?fe(t,n)+Math.ceil(o*1.2*(d-1)):Math.ceil(o*1.2)+6+Math.ceil(o*1.2*(d-1)),p=0;if(e.link&&(p+=Ee),e.note&&(p+=Ee),p>0){let t=+!!e.link+ +!!e.note;p+=De*t}let m=0;e.markers&&e.markers.length>0&&(m=e.markers.length*14+(e.markers.length-1)*2+De);let h=e.tags&&e.tags.length>0?18:0,g=l+p+m,_=(()=>{let t=Math.round(se[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})(),v=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),y=r?.[e.id],b=v?Math.max(24,y??Math.max(70,Math.ceil(o*5))):0,x=b>0?10:0;if(!e.image)return{w:Math.max(_,g),h:Math.ceil(f+x+b+(h>0?4+h:0))};let S=ke(e.image.width,Ce,we);return{w:Math.max(_,g,Math.ceil(S+c*2)),h:Math.ceil(e.image.height+Te+f+x+b+(h>0?4+h:0))}}function je(e,t={}){let n=t.mode??`mindmap`,r=t.preservePositions===!0,i=t.baseFontSize??14,a=t.branchGap??0,o=Fe(e,0,null,1,`right`,i,t.richHeights,t.richWidths);return Ie(o,a),Me(o,n,r,a),o.x=0,o.y=0,Le(o,r)}function Me(e,t,n=!1,r=0){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 i=e.children.filter(e=>e.side===1),a=e.children.filter(e=>e.side===-1),o=(e,t)=>{let n=t===`right`?1:-1;e._dir=t,e.side=n,e._dirRight=n;for(let n of e.children)o(n,t)};for(let e of i)o(e,`right`);for(let e of a)o(e,`left`);i.length>0&&Ne({...e,children:i},`right`,pe,!0,n,r),a.length>0&&Ne({...e,children:a},`left`,pe,!0,n,r)}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`;Ne(e,`right`,pe,!0,n,r),t(e)}else{for(let t of e.children)t._dir=`down`;Pe(e,pe,n,r)}}function Ne(e,t,n,r,i=!1,a=0){if(e.children.length===0)return;let o=r?ge+a:ge,s=e.children.reduce((e,t,n)=>e+t._subtreeH+(n>0?o:0),0),c=t===`right`?1:-1,l=r?c:1,u=e.y-l*s/2,d=ve(e.depth);e.children.forEach(r=>{i||(r.x=e.x+c*(e.width/2+d+r.width/2),r.y=u+l*r._subtreeH/2),r._dir=t,u+=l*(r._subtreeH+o),Ne(r,t,n,!1,i,0)})}function Pe(e,t,n=!1,r=0){if(e.children.length===0)return;let i=e.depth===0?ge+r:ge,a=e.children.reduce((e,t,n)=>e+t._subtreeW+(n>0?i*2:0),0),o=e.x-a/2,s=ve(e.depth);e.children.forEach(r=>{n||(r.x=o+r._subtreeW/2,r.y=e.y+e.height/2+s+r.height/2),r._dir=`down`,o+=r._subtreeW+i*2,Pe(r,t,n,0)})}function Fe(e,t,n,r,i,a,o,s){let c=Ae(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:B(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,markers:e.markers?[...e.markers]:void 0,tags:e.tags?[...e.tags]: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 Fe(e,t+1,l,c,i,a,o,s)}),l}function Ie(e,t=0){let n=[e];for(let e=0;e<n.length;e++){let t=n[e];for(let e of t.children)n.push(e)}for(let e=n.length-1;e>=0;e--){let r=n[e];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let i=r.depth===0?ge+t:ge,a=0,o=0;for(let e of r.children)a+=e._subtreeH,o+=e._subtreeW;r.children.length>1&&(a+=i*(r.children.length-1),o+=i*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,a),r._subtreeW=Math.max(r.width,o)}}function Le(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+48,height:o-a+48,vbX:r-_e,vbY:a-_e,vbW:i-r+48,vbH:o-a+48};let s=_e-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+48,height:o+_e,vbX:r-_e,vbY:0,vbW:i-r+48,vbH:o+_e}}var Re=[{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 ze(e,t=[]){return[...Re,...t].find(t=>t.id===e)??Re[0]}function Be(e,t=8){let n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g,a;for(;(a=i.exec(e))!==null;){let e=a[0],i=null;if(i=e.startsWith(`#`)?Ve(e):e.startsWith(`rgb`)?He(e):Ue[e.toLowerCase()]??null,!i)continue;let o=i.toLowerCase();if(!r.has(o)&&(r.add(o),n.push(o),n.length>=t))break}return n}function Ve(e){let t=e.startsWith(`#`)?e.slice(1):e;if(!/^[0-9a-fA-F]+$/.test(t))return null;let n;if(t.length===3)n=t.split(``).map(e=>e+e).join(``);else if(t.length===4)n=t.slice(0,3).split(``).map(e=>e+e).join(``);else if(t.length===6)n=t;else if(t.length===8)n=t.slice(0,6);else return null;return`#`+n.toLowerCase()}function He(e){let t=e.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!t)return null;let n=t[1].split(/\s*,\s*/);if(n.length<3)return null;let r=[];for(let e=0;e<3;e++){let t=n[e];if(t.endsWith(`%`)){let e=parseFloat(t);if(!isFinite(e))return null;r.push(Math.round(e/100*255))}else{let e=parseInt(t,10);if(!isFinite(e)||e<0||e>255)return null;r.push(e)}}return`#`+r.map(e=>e.toString(16).padStart(2,`0`)).join(``).toLowerCase()}var Ue={black:`#000000`,white:`#ffffff`,red:`#ff0000`,green:`#008000`,blue:`#0000ff`,yellow:`#ffff00`,cyan:`#00ffff`,magenta:`#ff00ff`,gray:`#808080`,grey:`#808080`,silver:`#c0c0c0`,maroon:`#800000`,olive:`#808000`,lime:`#00ff00`,aqua:`#00ffff`,teal:`#008080`,navy:`#000080`,fuchsia:`#ff00ff`,purple:`#800080`,orange:`#ffa500`,pink:`#ffc0cb`,brown:`#a52a2a`,gold:`#ffd700`,coral:`#ff7f50`,tomato:`#ff6347`,salmon:`#fa8072`,khaki:`#f0e68c`,violet:`#ee82ee`,indigo:`#4b0082`,turquoise:`#40e0d0`,chocolate:`#d2691e`,crimson:`#dc143c`,darkred:`#8b0000`,darkblue:`#00008b`,darkgreen:`#006400`,darkgray:`#a9a9a9`,darkgrey:`#a9a9a9`,lightgray:`#d3d3d3`,lightgrey:`#d3d3d3`,lightblue:`#add8e6`,lightgreen:`#90ee90`,lightyellow:`#ffffe0`,lightpink:`#ffb6c1`,skyblue:`#87ceeb`,forestgreen:`#228b22`,royalblue:`#4169e1`,steelblue:`#4682b4`,hotpink:`#ff69b4`,deeppink:`#ff1493`,orangered:`#ff4500`,goldenrod:`#daa520`,mediumpurple:`#9370db`};function V(){return`n_`+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function H(e){return JSON.parse(JSON.stringify(e))}function U(e,t){if(e.id===t)return e;for(let n of e.children){let e=U(n,t);if(e)return e}return null}function We(e,t,n=null){if(e.id===t)return n;for(let n of e.children){let r=We(n,t,e);if(r!==null)return r}return null}function Ge(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(Ge(n,t))return!0;return!1}function Ke(e,t,n){let r=U(e,t);return!r||r.text===n?!1:(r.text=n,!0)}function qe(e,t,n,r){if(!We(e,t)||t===n||U(U(e,t),n))return!1;let i=We(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=U(e,n);return t?(t.children.push(o),!0):(i.children.splice(a,0,o),!1)}let s=We(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 Je(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?nt:n>0?`新节点 ${n+1}`:`新节点 2`}function Ye(e,t,n){let r=U(e,t);if(!r)return null;let i={id:V(),text:n??Je(r),children:[]};return r.children.push(i),i}function Xe(e,t,n){let r=We(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:V(),text:n??Je(r),children:[]};return r.children.splice(i+1,0,a),a}function Ze(e,t,n){let r=We(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:V(),text:n,children:[]};return r.children.splice(i,0,a),a}function Qe(e,t){let n=We(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=H(i);return $e(a),n.children.splice(r+1,0,a),a}function $e(e){e.id=V();for(let t of e.children)$e(t)}function et(e,t){let n=U(e,t);if(!n||n.id===e.id)return null;let r=H(n);return $e(r),r}function tt(e){return e.children.reduce((e,t)=>e+1+tt(t),0)}var nt=`新节点`;function rt(e){return e.relations||=[],e.relations}function it(e,t){return e.relations?.find(e=>e.id===t)??null}function at(e,t,n){if(t===n||!U(e,t)||!U(e,n))return null;let r=rt(e);if(r.some(e=>e.fromId===t&&e.toId===n))return null;let i={id:V(),fromId:t,toId:n};return r.push(i),i}function ot(e,t){let n=e.relations;if(!n)return!1;let r=n.findIndex(e=>e.id===t);return r<0?!1:(n.splice(r,1),!0)}function st(e,t,n){let r=it(e,t);return r?(Object.assign(r,n),!0):!1}function ct(e,t,n,r){var i;let a=it(e,t);if(!a||!U(e,r)||r===(n===`from`?a.toId:a.fromId))return!1;let o=n===`from`?r:a.fromId,s=n===`to`?r:a.toId;return(i=e.relations)!=null&&i.some(e=>e.id!==t&&e.fromId===o&&e.toId===s)?!1:(n===`from`?(a.fromId=r,delete a.fromT):(a.toId=r,delete a.toT),delete a.c1,delete a.c2,!0)}function lt(e,t){let n=e.relations;if(!n||n.length===0)return 0;let r=n.length;return e.relations=n.filter(e=>e.fromId!==t&&e.toId!==t),r-e.relations.length}function ut(e,t=`导入的导图`){let n=e.split(/\r?\n/),r={id:V(),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(`
|
|
28
28
|
`);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+`
|
|
@@ -35,15 +35,15 @@ import{An as e,Dn as t,En as n,Fn as r,Gn as i,Ir as a,Jn as o,Ln as s,Nn as c,O
|
|
|
35
35
|
`)[0]?.slice(0,80)||`(空代码块)`,raw:s.join(`
|
|
36
36
|
`),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(`
|
|
37
37
|
`)}),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(`
|
|
38
|
-
`)}),r=m}return n}function pt(e,t=`导入的导图`){let n=ft(e||``),r={id:V(),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:V(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:V(),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 mt(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=A(1),a=A(0),o=A(0),s=A(!1),c=A(!1),l=M({x:0,y:0,ox:0,oy:0}),u=A(!1),d=M({x:0,y:0}),f=M({x:0,y:0,width:0,height:0}),p=A(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.value=!1,l.x=e.clientX,l.y=e.clientY,l.ox=a.value,l.oy=o.value,window.addEventListener(`mousemove`,b),window.addEventListener(`mouseup`,x),(t=e.preventDefault)==null||t.call(e))}function b(e){if(!s.value)return;let t=e.clientX-l.x,n=e.clientY-l.y;(Math.abs(t)>3||Math.abs(n)>3)&&(c.value=!0),a.value=l.ox+t,o.value=l.oy+n}function x(){s.value=!1,window.removeEventListener(`mousemove`,b),window.removeEventListener(`mouseup`,x)}function S(e,t,n){u.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,f.shiftKey=!!(n!=null&&n.shift),p.value++,window.addEventListener(`mousemove`,T),window.addEventListener(`mouseup`,w)}function C(e,t){if(!u.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 w(){u.value=!1,window.removeEventListener(`mousemove`,T),window.removeEventListener(`mouseup`,w),m&&m()}function T(t){if(!u.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();C((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function E(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}function ee(){let t=e.getContainer();if(!t)return;let n=t.getBoundingClientRect(),r=n.width/2,s=n.height/2,c=(r-a.value)/i.value,l=(s-o.value)/i.value;i.value=1,a.value=r-c,o.value=s-l}function D(t,r,s,c,l=80){let u=e.getContainer();if(!u)return;let d=u.getBoundingClientRect(),f=i.value;(s*f<40||c*f<40)&&(f=Math.min(n,Math.max(1,60/Math.min(s,c)))),i.value=f,a.value=d.width/2-t*f,o.value=d.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,panMoved:c,onWheel:g,zoomIn:_,zoomOut:v,zoomTo100:ee,startPan:y,startMarquee:S,updateMarquee:C,isMarquee:u,marquee:f,marqueeVersion:p,setOnMarqueeEnd:h,resetView:E,centerOn:D}}var ht=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function gt(e){return ht?e.metaKey:e.ctrlKey}function _t(e){function t(){let t=e.getSelectedId();if(t)return t;if(e.defaultTargetId)return e.defaultTargetId();let n=e.getSelectedIds();return n.length>0?n[0]:null}function n(n){let r=n.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=t();if(a){if(gt(n)&&!n.shiftKey){if(n.key===`d`||n.key===`D`){let t=e.defaultTargetId?.call(e);i&&i!==t&&(n.preventDefault(),e.onDuplicate(i));return}if(n.key===`c`||n.key===`C`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCopy(t));return}if(n.key===`x`||n.key===`X`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCut(t));return}if(n.key===`v`||n.key===`V`){if(!e.hasClipboard())return;n.preventDefault();let t=e.getSelectedIds();e.onPaste(t.length>0?t[0]:null);return}if(n.key===`z`||n.key===`Z`){n.preventDefault(),e.onUndo();return}if(n.key===`y`||n.key===`Y`){n.preventDefault(),e.onRedo();return}if(n.key===`Home`){n.preventDefault(),e.onSelectRoot();return}}if(gt(n)&&n.shiftKey&&(n.key===`Z`||n.key===`z`)){n.preventDefault(),e.onRedo();return}if(n.key===`Tab`)n.preventDefault(),e.onAddChild(a);else if(n.key===`Enter`){if(n.preventDefault(),n.shiftKey){let t=e.defaultTargetId?.call(e);i&&i!==t&&e.onAddSiblingBefore(i)}else e.onAddSibling(a)}else if((n.key===`Delete`||n.key===`Backspace`)&&i&&i!==e.defaultTargetId?.call(e))n.preventDefault(),e.onRemove(i);else if(n.key===`F2`&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===` `&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===`Escape`)n.preventDefault(),e.onClearSelection();else if(n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey){if(n.key===`ArrowUp`){n.preventDefault(),e.onMoveSibling(-1);return}if(n.key===`ArrowDown`){n.preventDefault(),e.onMoveSibling(1);return}}else n.key===`ArrowDown`?(n.preventDefault(),e.onNavigate(0,1)):n.key===`ArrowUp`?(n.preventDefault(),e.onNavigate(0,-1)):n.key===`ArrowRight`?(n.preventDefault(),e.onNavigate(1,0)):n.key===`ArrowLeft`&&(n.preventDefault(),e.onNavigate(-1,0))}}m(()=>{window.addEventListener(`keydown`,n)}),o(()=>{window.removeEventListener(`keydown`,n)})}function vt(e=100){let t=A([]),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 yt={1:`#ef4444`,2:`#f97316`,3:`#f59e0b`,4:`#eab308`,5:`#84cc16`,6:`#22c55e`,7:`#14b8a6`,8:`#3b82f6`,9:`#6366f1`},bt={label:`优先级`,markers:Array.from({length:9},(e,t)=>{let n=t+1,r=yt[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function xt(e){if(e===0)return`<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>`;if(e===100)return`<circle cx="12" cy="12" r="10" fill="#22c55e"/>`;let t=e/100*2*Math.PI,n=12+10*Math.sin(t),r=12-10*Math.cos(t);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${+(e>50)} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}var St=[bt,{label:`进度`,markers:[0,25,50,75,100].map(e=>({id:`progress-${e}`,label:`进度 ${e}%`,svg:xt(e)}))},{label:`旗帜`,markers:[{id:`flag-red`,label:`红旗`,color:`#ef4444`},{id:`flag-orange`,label:`橙旗`,color:`#f97316`},{id:`flag-yellow`,label:`黄旗`,color:`#eab308`},{id:`flag-green`,label:`绿旗`,color:`#22c55e`},{id:`flag-blue`,label:`蓝旗`,color:`#3b82f6`},{id:`flag-gray`,label:`灰旗`,color:`#94a3b8`}].map(e=>({id:e.id,label:e.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${e.color}" stroke="${e.color}" stroke-width="1" stroke-linejoin="round"/>`}))},{label:`星标`,markers:[{id:`star`,label:`星标`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>`},{id:`star-half`,label:`半星`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>`}]},{label:`其他`,markers:[{id:`smile`,label:`微笑`,svg:`<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>`},{id:`people`,label:`人员`,svg:`<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>`},{id:`arrow-up`,label:`上箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-down`,label:`下箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-right`,label:`右箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-left`,label:`左箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}]}],Ct={};for(let e of St)for(let t of e.markers)Ct[t.id]=t;function wt(e){return Ct[e]?.svg??``}function Tt(e){return Ct[e]?.label??e}function Et(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;let n=Math.abs(t)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}var Dt=s({__name:`NodeContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0},hasImage:{type:Boolean,required:!1,default:!1},hasLink:{type:Boolean,required:!1,default:!1},hasNote:{type:Boolean,required:!1,default:!1},hasCode:{type:Boolean,required:!1,default:!1},hasTable:{type:Boolean,required:!1,default:!1},nodeMarkers:{type:Array,required:!1,default:()=>[]},nodeTags:{type:Array,required:!1,default:()=>[]}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`toggleMarker`,`clearMarkers`,`addTag`,`removeTags`,`addRelation`,`close`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,s=n(()=>{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+1+ +(i.nodeTags.length>0)+1)*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}}),c=n(()=>i.hasImage),l=n(()=>i.hasLink),u=n(()=>i.hasNote),d=n(()=>i.nodeMarkers.length>0),f=n(()=>i.nodeTags.length>0),p=A(!1);function m(){p.value=!p.value}function h(e){return i.nodeMarkers.includes(e)}function g(e){a(`toggleMarker`,e)}function _(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||a(`close`)}function v(e){e.key===`Escape`&&a(`close`)}function y(){a(`close`)}window.addEventListener(`mousedown`,_,!0),window.addEventListener(`keydown`,v,!0),window.addEventListener(`wheel`,y,!0),window.addEventListener(`scroll`,y,!0),o(()=>{window.removeEventListener(`mousedown`,_,!0),window.removeEventListener(`keydown`,v,!0),window.removeEventListener(`wheel`,y,!0),window.removeEventListener(`scroll`,y,!0)});function b(e){e(),a(`close`)}let x={props:i,emit:a,clamped:s,hasImage:c,hasLink:l,hasNote:u,hasMarkers:d,hasTags:f,markerPickerOpen:p,toggleMarkerPicker:m,isMarkerActive:h,onMarkerClick:g,onWindowMouseDown:_,onWindowKey:v,onWindowScroll:y,run:b,Icon:I,get MARKER_LIB(){return St},get markerSvg(){return wt}};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Ot={key:5,class:`zm-marker-picker`},kt={class:`zm-marker-group-label`},At={class:`zm-marker-grid`},jt=[`title`,`onClick`,`innerHTML`];function Mt(n,i,a,o,s,c){return d(),e(`div`,{class:`zm-node-menu`,style:g({left:o.clamped.left+`px`,top:o.clamped.top+`px`}),onContextmenu:i[14]||=k(()=>{},[`prevent`])},[t(`button`,{class:`zm-node-menu-item`,onClick:i[0]||=k(e=>o.run(()=>o.emit(`pickImage`)),[`stop`])},[r(o.Icon,{name:`image`,size:13}),t(`span`,null,E(o.hasImage?`替换图片`:`添加图片`),1)]),o.hasImage?(d(),e(`button`,{key:0,class:`zm-node-menu-item`,onClick:i[1]||=k(e=>o.run(()=>o.emit(`removeImage`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[15]||=t(`span`,null,`移除图片`,-1)])):b(`v-if`,!0),t(`button`,{class:`zm-node-menu-item`,onClick:i[2]||=k(e=>o.run(()=>o.emit(`setLink`)),[`stop`])},[r(o.Icon,{name:`link`,size:13}),t(`span`,null,E(o.hasLink?`编辑链接`:`添加链接`),1)]),o.hasLink?(d(),e(`button`,{key:1,class:`zm-node-menu-item`,onClick:i[3]||=k(e=>o.run(()=>o.emit(`removeLink`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[16]||=t(`span`,null,`移除链接`,-1)])):b(`v-if`,!0),t(`button`,{class:`zm-node-menu-item`,onClick:i[4]||=k(e=>o.run(()=>o.emit(`addCode`)),[`stop`])},[i[17]||=t(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),t(`span`,null,E(a.hasCode?`编辑代码块`:`添加代码块`),1)]),a.hasCode?(d(),e(`button`,{key:2,class:`zm-node-menu-item`,onClick:i[5]||=k(e=>o.run(()=>o.emit(`removeCode`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[18]||=t(`span`,null,`移除代码块`,-1)])):b(`v-if`,!0),t(`button`,{class:`zm-node-menu-item`,onClick:i[6]||=k(e=>o.run(()=>o.emit(`addTable`)),[`stop`])},[i[19]||=t(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),t(`span`,null,E(a.hasTable?`编辑表格`:`添加表格`),1)]),a.hasTable?(d(),e(`button`,{key:3,class:`zm-node-menu-item`,onClick:i[7]||=k(e=>o.run(()=>o.emit(`removeTable`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[20]||=t(`span`,null,`移除表格`,-1)])):b(`v-if`,!0),t(`button`,{class:`zm-node-menu-item`,onClick:i[8]||=k(e=>o.run(()=>o.emit(`editNote`)),[`stop`])},[r(o.Icon,{name:`note`,size:13}),t(`span`,null,E(o.hasNote?`编辑笔记`:`添加笔记`),1)]),o.hasNote?(d(),e(`button`,{key:4,class:`zm-node-menu-item`,onClick:i[9]||=k(e=>o.run(()=>o.emit(`removeNote`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[21]||=t(`span`,null,`移除笔记`,-1)])):b(`v-if`,!0),i[27]||=t(`div`,{class:`zm-node-menu-divider`},null,-1),b(` Markers — expandable picker grid `),t(`button`,{class:`zm-node-menu-item`,onClick:k(o.toggleMarkerPicker,[`stop`])},[i[22]||=t(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`⚑`,-1),i[23]||=t(`span`,null,`标记图标`,-1),t(`span`,{class:h([`zm-node-menu-arrow`,{"is-open":o.markerPickerOpen}])},`›`,2)]),o.markerPickerOpen?(d(),e(`div`,Ot,[(d(!0),e(f,null,y(o.MARKER_LIB,n=>(d(),e(`div`,{key:n.label,class:`zm-marker-group`},[t(`div`,kt,E(n.label),1),t(`div`,At,[(d(!0),e(f,null,y(n.markers,t=>(d(),e(`button`,{key:t.id,class:h([`zm-marker-cell`,{"is-active":o.isMarkerActive(t.id)}]),title:t.label,onClick:k(e=>o.onMarkerClick(t.id),[`stop`]),innerHTML:`<svg viewBox="0 0 24 24" width="20" height="20">`+o.markerSvg(t.id)+`</svg>`},null,10,jt))),128))])]))),128)),o.hasMarkers?(d(),e(`button`,{key:0,class:`zm-marker-clear`,onClick:i[10]||=k(e=>o.emit(`clearMarkers`),[`stop`])},` 清除所有标记 `)):b(`v-if`,!0)])):b(`v-if`,!0),b(` Tags `),t(`button`,{class:`zm-node-menu-item`,onClick:i[11]||=k(e=>o.run(()=>o.emit(`addTag`)),[`stop`])},[i[24]||=t(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`#`,-1),t(`span`,null,E(o.hasTags?`编辑标签`:`添加标签`),1)]),o.hasTags?(d(),e(`button`,{key:6,class:`zm-node-menu-item`,onClick:i[12]||=k(e=>o.run(()=>o.emit(`removeTags`)),[`stop`])},[r(o.Icon,{name:`x`,size:13}),i[25]||=t(`span`,null,`移除标签`,-1)])):b(`v-if`,!0),i[28]||=t(`div`,{class:`zm-node-menu-divider`},null,-1),b(` Relationship line ("联系") — enter creation mode with this\r
|
|
39
|
-
node as the first endpoint. `),
|
|
38
|
+
`)}),r=m}return n}function pt(e,t=`导入的导图`){let n=ft(e||``),r={id:V(),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:V(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:V(),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 mt(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=m(1),a=m(0),o=m(0),s=m(!1),c=m(!1),l=y({x:0,y:0,ox:0,oy:0}),u=m(!1),d=y({x:0,y:0}),f=y({x:0,y:0,width:0,height:0}),p=m(0),h=null;function g(e){h=e}function _(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 v(){i.value=Math.min(n,i.value*r)}function b(){i.value=Math.max(t,i.value/r)}function x(e){var t;e.target.closest(`.zm-node, .zm-toolbar, button, input, textarea`)||(s.value=!0,c.value=!1,l.x=e.clientX,l.y=e.clientY,l.ox=a.value,l.oy=o.value,window.addEventListener(`mousemove`,S),window.addEventListener(`mouseup`,C),(t=e.preventDefault)==null||t.call(e))}function S(e){if(!s.value)return;let t=e.clientX-l.x,n=e.clientY-l.y;(Math.abs(t)>3||Math.abs(n)>3)&&(c.value=!0),a.value=l.ox+t,o.value=l.oy+n}function C(){s.value=!1,window.removeEventListener(`mousemove`,S),window.removeEventListener(`mouseup`,C)}function w(e,t,n){u.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,f.shiftKey=!!(n!=null&&n.shift),p.value++,window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,E)}function T(e,t){if(!u.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 E(){u.value=!1,window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,E),h&&h()}function D(t){if(!u.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();T((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function ee(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}function O(){let t=e.getContainer();if(!t)return;let n=t.getBoundingClientRect(),r=n.width/2,s=n.height/2,c=(r-a.value)/i.value,l=(s-o.value)/i.value;i.value=1,a.value=r-c,o.value=s-l}function k(t,r,s,c,l=80){let u=e.getContainer();if(!u)return;let d=u.getBoundingClientRect(),f=i.value;(s*f<40||c*f<40)&&(f=Math.min(n,Math.max(1,60/Math.min(s,c)))),i.value=f,a.value=d.width/2-t*f,o.value=d.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,panMoved:c,onWheel:_,zoomIn:v,zoomOut:b,zoomTo100:O,startPan:x,startMarquee:w,updateMarquee:T,isMarquee:u,marquee:f,marqueeVersion:p,setOnMarqueeEnd:g,resetView:ee,centerOn:k}}var ht=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function gt(e){return ht?e.metaKey:e.ctrlKey}function _t(e){function t(){let t=e.getSelectedId();if(t)return t;if(e.defaultTargetId)return e.defaultTargetId();let n=e.getSelectedIds();return n.length>0?n[0]:null}function n(n){let r=n.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=t();if(a){if(gt(n)&&!n.shiftKey){if(n.key===`d`||n.key===`D`){let t=e.defaultTargetId?.call(e);i&&i!==t&&(n.preventDefault(),e.onDuplicate(i));return}if(n.key===`c`||n.key===`C`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCopy(t));return}if(n.key===`x`||n.key===`X`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCut(t));return}if(n.key===`v`||n.key===`V`){if(!e.hasClipboard())return;n.preventDefault();let t=e.getSelectedIds();e.onPaste(t.length>0?t[0]:null);return}if(n.key===`z`||n.key===`Z`){n.preventDefault(),e.onUndo();return}if(n.key===`y`||n.key===`Y`){n.preventDefault(),e.onRedo();return}if(n.key===`Home`){n.preventDefault(),e.onSelectRoot();return}}if(gt(n)&&n.shiftKey&&(n.key===`Z`||n.key===`z`)){n.preventDefault(),e.onRedo();return}if(n.key===`Tab`)n.preventDefault(),e.onAddChild(a);else if(n.key===`Enter`){if(n.preventDefault(),n.shiftKey){let t=e.defaultTargetId?.call(e);i&&i!==t&&e.onAddSiblingBefore(i)}else e.onAddSibling(a)}else if((n.key===`Delete`||n.key===`Backspace`)&&i&&i!==e.defaultTargetId?.call(e))n.preventDefault(),e.onRemove(i);else if(n.key===`F2`&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===` `&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===`Escape`)n.preventDefault(),e.onClearSelection();else if(n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey){if(n.key===`ArrowUp`){n.preventDefault(),e.onMoveSibling(-1);return}if(n.key===`ArrowDown`){n.preventDefault(),e.onMoveSibling(1);return}}else n.key===`ArrowDown`?(n.preventDefault(),e.onNavigate(0,1)):n.key===`ArrowUp`?(n.preventDefault(),e.onNavigate(0,-1)):n.key===`ArrowRight`?(n.preventDefault(),e.onNavigate(1,0)):n.key===`ArrowLeft`&&(n.preventDefault(),e.onNavigate(-1,0))}}_(()=>{window.addEventListener(`keydown`,n)}),g(()=>{window.removeEventListener(`keydown`,n)})}function vt(e=100){let t=m([]),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 yt={1:`#ef4444`,2:`#f97316`,3:`#f59e0b`,4:`#eab308`,5:`#84cc16`,6:`#22c55e`,7:`#14b8a6`,8:`#3b82f6`,9:`#6366f1`},bt={label:`优先级`,markers:Array.from({length:9},(e,t)=>{let n=t+1,r=yt[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function xt(e){if(e===0)return`<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>`;if(e===100)return`<circle cx="12" cy="12" r="10" fill="#22c55e"/>`;let t=e/100*2*Math.PI,n=12+10*Math.sin(t),r=12-10*Math.cos(t);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${+(e>50)} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}var St=[bt,{label:`进度`,markers:[0,25,50,75,100].map(e=>({id:`progress-${e}`,label:`进度 ${e}%`,svg:xt(e)}))},{label:`旗帜`,markers:[{id:`flag-red`,label:`红旗`,color:`#ef4444`},{id:`flag-orange`,label:`橙旗`,color:`#f97316`},{id:`flag-yellow`,label:`黄旗`,color:`#eab308`},{id:`flag-green`,label:`绿旗`,color:`#22c55e`},{id:`flag-blue`,label:`蓝旗`,color:`#3b82f6`},{id:`flag-gray`,label:`灰旗`,color:`#94a3b8`}].map(e=>({id:e.id,label:e.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${e.color}" stroke="${e.color}" stroke-width="1" stroke-linejoin="round"/>`}))},{label:`星标`,markers:[{id:`star`,label:`星标`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>`},{id:`star-half`,label:`半星`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>`}]},{label:`其他`,markers:[{id:`smile`,label:`微笑`,svg:`<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>`},{id:`people`,label:`人员`,svg:`<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>`},{id:`arrow-up`,label:`上箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-down`,label:`下箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-right`,label:`右箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-left`,label:`左箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}]}],Ct={};for(let e of St)for(let t of e.markers)Ct[t.id]=t;function wt(e){return Ct[e]?.svg??``}function Tt(e){return Ct[e]?.label??e}function Et(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;let n=Math.abs(t)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}var Dt=f({__name:`NodeContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0},hasImage:{type:Boolean,required:!1,default:!1},hasLink:{type:Boolean,required:!1,default:!1},hasNote:{type:Boolean,required:!1,default:!1},hasCode:{type:Boolean,required:!1,default:!1},hasTable:{type:Boolean,required:!1,default:!1},nodeMarkers:{type:Array,required:!1,default:()=>[]},nodeTags:{type:Array,required:!1,default:()=>[]}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`toggleMarker`,`clearMarkers`,`addTag`,`removeTags`,`addRelation`,`close`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=r(()=>{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+1+ +(i.nodeTags.length>0)+1)*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=r(()=>i.hasImage),c=r(()=>i.hasLink),l=r(()=>i.hasNote),u=r(()=>i.nodeMarkers.length>0),d=r(()=>i.nodeTags.length>0),f=m(!1);function p(){f.value=!f.value}function h(e){return i.nodeMarkers.includes(e)}function _(e){a(`toggleMarker`,e)}function v(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||a(`close`)}function y(e){e.key===`Escape`&&a(`close`)}function b(){a(`close`)}window.addEventListener(`mousedown`,v,!0),window.addEventListener(`keydown`,y,!0),window.addEventListener(`wheel`,b,!0),window.addEventListener(`scroll`,b,!0),g(()=>{window.removeEventListener(`mousedown`,v,!0),window.removeEventListener(`keydown`,y,!0),window.removeEventListener(`wheel`,b,!0),window.removeEventListener(`scroll`,b,!0)});function x(e){e(),a(`close`)}let S={props:i,emit:a,clamped:o,hasImage:s,hasLink:c,hasNote:l,hasMarkers:u,hasTags:d,markerPickerOpen:f,toggleMarkerPicker:p,isMarkerActive:h,onMarkerClick:_,onWindowMouseDown:v,onWindowKey:y,onWindowScroll:b,run:x,Icon:I,get MARKER_LIB(){return St},get markerSvg(){return wt}};return Object.defineProperty(S,"__isScriptSetup",{enumerable:!1,value:!0}),S}}),Ot={key:5,class:`zm-marker-picker`},kt={class:`zm-marker-group-label`},At={class:`zm-marker-grid`},jt=[`title`,`onClick`,`innerHTML`];function Mt(r,i,a,s,c,u){return e(),w(`div`,{class:`zm-node-menu`,style:d({left:s.clamped.left+`px`,top:s.clamped.top+`px`}),onContextmenu:i[14]||=p(()=>{},[`prevent`])},[l(`button`,{class:`zm-node-menu-item`,onClick:i[0]||=p(e=>s.run(()=>s.emit(`pickImage`)),[`stop`])},[o(s.Icon,{name:`image`,size:13}),l(`span`,null,E(s.hasImage?`替换图片`:`添加图片`),1)]),s.hasImage?(e(),w(`button`,{key:0,class:`zm-node-menu-item`,onClick:i[1]||=p(e=>s.run(()=>s.emit(`removeImage`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[15]||=l(`span`,null,`移除图片`,-1)])):t(`v-if`,!0),l(`button`,{class:`zm-node-menu-item`,onClick:i[2]||=p(e=>s.run(()=>s.emit(`setLink`)),[`stop`])},[o(s.Icon,{name:`link`,size:13}),l(`span`,null,E(s.hasLink?`编辑链接`:`添加链接`),1)]),s.hasLink?(e(),w(`button`,{key:1,class:`zm-node-menu-item`,onClick:i[3]||=p(e=>s.run(()=>s.emit(`removeLink`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[16]||=l(`span`,null,`移除链接`,-1)])):t(`v-if`,!0),l(`button`,{class:`zm-node-menu-item`,onClick:i[4]||=p(e=>s.run(()=>s.emit(`addCode`)),[`stop`])},[i[17]||=l(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),l(`span`,null,E(a.hasCode?`编辑代码块`:`添加代码块`),1)]),a.hasCode?(e(),w(`button`,{key:2,class:`zm-node-menu-item`,onClick:i[5]||=p(e=>s.run(()=>s.emit(`removeCode`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[18]||=l(`span`,null,`移除代码块`,-1)])):t(`v-if`,!0),l(`button`,{class:`zm-node-menu-item`,onClick:i[6]||=p(e=>s.run(()=>s.emit(`addTable`)),[`stop`])},[i[19]||=l(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),l(`span`,null,E(a.hasTable?`编辑表格`:`添加表格`),1)]),a.hasTable?(e(),w(`button`,{key:3,class:`zm-node-menu-item`,onClick:i[7]||=p(e=>s.run(()=>s.emit(`removeTable`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[20]||=l(`span`,null,`移除表格`,-1)])):t(`v-if`,!0),l(`button`,{class:`zm-node-menu-item`,onClick:i[8]||=p(e=>s.run(()=>s.emit(`editNote`)),[`stop`])},[o(s.Icon,{name:`note`,size:13}),l(`span`,null,E(s.hasNote?`编辑笔记`:`添加笔记`),1)]),s.hasNote?(e(),w(`button`,{key:4,class:`zm-node-menu-item`,onClick:i[9]||=p(e=>s.run(()=>s.emit(`removeNote`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[21]||=l(`span`,null,`移除笔记`,-1)])):t(`v-if`,!0),i[27]||=l(`div`,{class:`zm-node-menu-divider`},null,-1),t(` Markers — expandable picker grid `),l(`button`,{class:`zm-node-menu-item`,onClick:p(s.toggleMarkerPicker,[`stop`])},[i[22]||=l(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`⚑`,-1),i[23]||=l(`span`,null,`标记图标`,-1),l(`span`,{class:h([`zm-node-menu-arrow`,{"is-open":s.markerPickerOpen}])},`›`,2)]),s.markerPickerOpen?(e(),w(`div`,Ot,[(e(!0),w(n,null,O(s.MARKER_LIB,t=>(e(),w(`div`,{key:t.label,class:`zm-marker-group`},[l(`div`,kt,E(t.label),1),l(`div`,At,[(e(!0),w(n,null,O(t.markers,t=>(e(),w(`button`,{key:t.id,class:h([`zm-marker-cell`,{"is-active":s.isMarkerActive(t.id)}]),title:t.label,onClick:p(e=>s.onMarkerClick(t.id),[`stop`]),innerHTML:`<svg viewBox="0 0 24 24" width="20" height="20">`+s.markerSvg(t.id)+`</svg>`},null,10,jt))),128))])]))),128)),s.hasMarkers?(e(),w(`button`,{key:0,class:`zm-marker-clear`,onClick:i[10]||=p(e=>s.emit(`clearMarkers`),[`stop`])},` 清除所有标记 `)):t(`v-if`,!0)])):t(`v-if`,!0),t(` Tags `),l(`button`,{class:`zm-node-menu-item`,onClick:i[11]||=p(e=>s.run(()=>s.emit(`addTag`)),[`stop`])},[i[24]||=l(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`#`,-1),l(`span`,null,E(s.hasTags?`编辑标签`:`添加标签`),1)]),s.hasTags?(e(),w(`button`,{key:6,class:`zm-node-menu-item`,onClick:i[12]||=p(e=>s.run(()=>s.emit(`removeTags`)),[`stop`])},[o(s.Icon,{name:`x`,size:13}),i[25]||=l(`span`,null,`移除标签`,-1)])):t(`v-if`,!0),i[28]||=l(`div`,{class:`zm-node-menu-divider`},null,-1),t(` Relationship line ("联系") — enter creation mode with this\r
|
|
39
|
+
node as the first endpoint. `),l(`button`,{class:`zm-node-menu-item`,onClick:i[13]||=p(e=>s.run(()=>s.emit(`addRelation`)),[`stop`])},[o(s.Icon,{name:`relation`,size:13}),i[26]||=l(`span`,null,`添加联系`,-1)])],36)}var Nt=F(Dt,[[`render`,Mt],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/NodeContextMenu.vue`]]),Pt=f({__name:`CanvasContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0}},emits:[`openSettings`,`openData`,`openImport`,`exportPng`,`exportSvg`,`close`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=r(()=>{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+121>n.bottom&&(t=Math.max(n.top+4,i.y-121-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=m(null),c=m(null),l=m(null),u=r(()=>{let e=s.value===`import`?c.value:s.value===`export`?l.value:null;if(!e)return{left:`-9999px`,top:`-9999px`,display:`none`};let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t.right;i+176>n-4&&(i=Math.max(4,t.left-176));let a=t.top-4;return a+88>r-4&&(a=Math.max(4,r-88-4)),{left:i+`px`,top:a+`px`,display:`block`}}),d=null,f=null;function p(e){f&&=(clearTimeout(f),null),d=setTimeout(()=>{s.value=e},60)}function h(){d&&=(clearTimeout(d),null),f=setTimeout(()=>{s.value=null},120)}g(()=>{d&&clearTimeout(d),f&&clearTimeout(f)});function _(e){let t=e.target;t&&t.closest(`.zm-canvas-menu`)||a(`close`)}function v(e){e.key===`Escape`&&a(`close`)}function y(){a(`close`)}window.addEventListener(`mousedown`,_,!0),window.addEventListener(`keydown`,v,!0),window.addEventListener(`wheel`,y,!0),window.addEventListener(`scroll`,y,!0),g(()=>{window.removeEventListener(`mousedown`,_,!0),window.removeEventListener(`keydown`,v,!0),window.removeEventListener(`wheel`,y,!0),window.removeEventListener(`scroll`,y,!0)});function b(e){e(),a(`close`)}let x={props:i,emit:a,clamped:o,openSubmenu:s,importItemRef:c,exportItemRef:l,submenuStyle:u,get submenuEnterTimer(){return d},set submenuEnterTimer(e){d=e},get submenuLeaveTimer(){return f},set submenuLeaveTimer(e){f=e},onSubmenuEnter:p,onSubmenuLeave:h,onWindowMouseDown:_,onWindowKey:v,onWindowScroll:y,run:b,Icon:I};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}});function Ft(n,r,i,a,s,c){return e(),w(`div`,{class:`zm-canvas-menu`,style:d({left:a.clamped.left+`px`,top:a.clamped.top+`px`}),onContextmenu:r[11]||=p(()=>{},[`prevent`])},[l(`button`,{class:`zm-canvas-menu-item`,onClick:r[0]||=p(e=>a.run(()=>a.emit(`openData`)),[`stop`])},[o(a.Icon,{name:`database`,size:13,stroke:1.6}),r[12]||=l(`span`,null,`查看数据`,-1)]),l(`div`,{ref:`importItemRef`,class:h([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":a.openSubmenu===`import`}]),onMouseenter:r[5]||=e=>a.onSubmenuEnter(`import`),onMouseleave:a.onSubmenuLeave},[o(a.Icon,{name:`import`,size:13,stroke:1.6}),r[16]||=l(`span`,null,`导入`,-1),r[17]||=l(`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`},[l(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),a.openSubmenu===`import`?(e(),w(`div`,{key:0,class:`zm-canvas-submenu`,style:d(a.submenuStyle),onMouseenter:r[4]||=e=>a.onSubmenuEnter(`import`),onMouseleave:a.onSubmenuLeave},[l(`button`,{class:`zm-canvas-menu-item`,onClick:r[1]||=p(e=>a.run(()=>a.emit(`openImport`,`markdown`)),[`stop`])},[o(a.Icon,{name:`markdown`,size:13,stroke:1.6}),r[13]||=l(`span`,null,`Markdown 导入`,-1)]),l(`button`,{class:`zm-canvas-menu-item`,onClick:r[2]||=p(e=>a.run(()=>a.emit(`openImport`,`json`)),[`stop`])},[o(a.Icon,{name:`json`,size:13,stroke:1.6}),r[14]||=l(`span`,null,`JSON 文件导入`,-1)]),l(`button`,{class:`zm-canvas-menu-item`,onClick:r[3]||=p(e=>a.run(()=>a.emit(`openImport`,`txt`)),[`stop`])},[o(a.Icon,{name:`txt`,size:13,stroke:1.6}),r[15]||=l(`span`,null,`TXT 文件导入`,-1)])],36)):t(`v-if`,!0)],34),l(`button`,{class:`zm-canvas-menu-item`,onClick:r[6]||=p(e=>a.run(()=>a.emit(`openSettings`)),[`stop`])},[o(a.Icon,{name:`settings`,size:13,stroke:1.6}),r[18]||=l(`span`,null,`设置`,-1)]),r[23]||=l(`div`,{class:`zm-canvas-menu-divider`},null,-1),l(`div`,{ref:`exportItemRef`,class:h([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":a.openSubmenu===`export`}]),onMouseenter:r[10]||=e=>a.onSubmenuEnter(`export`),onMouseleave:a.onSubmenuLeave},[o(a.Icon,{name:`export`,size:13,stroke:1.6}),r[21]||=l(`span`,null,`导出`,-1),r[22]||=l(`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`},[l(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),a.openSubmenu===`export`?(e(),w(`div`,{key:0,class:`zm-canvas-submenu`,style:d(a.submenuStyle),onMouseenter:r[9]||=e=>a.onSubmenuEnter(`export`),onMouseleave:a.onSubmenuLeave},[l(`button`,{class:`zm-canvas-menu-item`,onClick:r[7]||=p(e=>a.run(()=>a.emit(`exportPng`)),[`stop`])},[o(a.Icon,{name:`image`,size:13,stroke:1.6}),r[19]||=l(`span`,null,`导出 PNG`,-1)]),l(`button`,{class:`zm-canvas-menu-item`,onClick:r[8]||=p(e=>a.run(()=>a.emit(`exportSvg`)),[`stop`])},[o(a.Icon,{name:`svg-export`,size:13,stroke:1.6}),r[20]||=l(`span`,null,`导出 SVG`,-1)])],36)):t(`v-if`,!0)],34)],36)}var It=F(Pt,[[`render`,Ft],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/CanvasContextMenu.vue`]]),Lt=f({__name:`Drawer`,props:{side:{type:String,required:!1,default:`left`},width:{type:Number,required:!1,default:320},open:{type:Boolean,required:!1,default:!0},title:{type:String,required:!1,default:``},scope:{type:String,required:!1,default:`page`},closable:{type:Boolean,required:!1,default:!0},closeOnBackdrop:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{expose:t,emit:n}){t();let r=n;function i(){r(`update:open`,!1)}function a(){r(`update:open`,!1)}let o={emit:r,close:i,onBackdropClick:a};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Rt=[`aria-hidden`],zt=[`aria-hidden`],Bt={key:0,class:`zm-drawer-header`},Vt={key:0,class:`zm-drawer-title`},Ht={class:`zm-drawer-body`},Ut=[`aria-hidden`],Wt={key:0,class:`zm-drawer-header`},Gt={key:0,class:`zm-drawer-title`},Kt={class:`zm-drawer-body`};function qt(r,i,a,s,c,u){return e(),w(n,null,[t(` scope=canvas: render the backdrop + the floating aside. Both\r
|
|
40
40
|
are wrapped in a single root so v-if toggles the whole overlay\r
|
|
41
|
-
in/out together. `),a.scope===`canvas`?(
|
|
42
|
-
`)}),se=
|
|
41
|
+
in/out together. `),a.scope===`canvas`?(e(),w(n,{key:0},[o(k,{name:`zm-fade`},{default:A(()=>[a.open?(e(),w(`div`,{key:0,class:`zm-drawer-canvas-backdrop`,"aria-hidden":!a.open,onClick:i[0]||=e=>a.closeOnBackdrop&&s.onBackdropClick()},null,8,Rt)):t(`v-if`,!0)]),_:1}),o(k,{name:a.side===`left`?`zm-slide-left`:`zm-slide-right`},{default:A(()=>[a.open?(e(),w(`aside`,{key:0,class:h([`zm-drawer zm-drawer--canvas`,[`zm-drawer--`+a.side]]),style:d({width:a.width+`px`}),"aria-hidden":!a.open},[a.title||r.$slots.header?(e(),w(`div`,Bt,[a.title?(e(),w(`h3`,Vt,E(a.title),1)):t(`v-if`,!0),D(r.$slots,`header`),a.closable?(e(),w(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:s.close},[...i[1]||=[l(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[l(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):t(`v-if`,!0)])):t(`v-if`,!0),l(`div`,Ht,[D(r.$slots,`default`)])],14,zt)):t(`v-if`,!0)]),_:3},8,[`name`])],64)):(e(),w(n,{key:1},[t(` scope=page: legacy flex-flow aside that takes layout space. `),o(k,{name:`zm-drawer`},{default:A(()=>[a.open?(e(),w(`aside`,{key:0,class:h([`zm-drawer`,[`zm-drawer--`+a.side,{"is-open":a.open}]]),style:d({width:a.width+`px`}),"aria-hidden":!a.open},[a.title||r.$slots.header?(e(),w(`div`,Wt,[a.title?(e(),w(`h3`,Gt,E(a.title),1)):t(`v-if`,!0),D(r.$slots,`header`),a.closable?(e(),w(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:s.close},[...i[2]||=[l(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[l(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):t(`v-if`,!0)])):t(`v-if`,!0),l(`div`,Kt,[D(r.$slots,`default`)])],14,Ut)):t(`v-if`,!0)]),_:3})],2112))],2112)}var Jt=F(Lt,[[`render`,qt],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/Drawer.vue`]]),Yt=f({__name:`Outline`,props:{data:{type:Object,required:!0},selectedId:{type:[String,null],required:!1,default:null},collapsedIds:{type:Set,required:!1,default:()=>new Set},readonly:{type:Boolean,required:!1,default:!1},showIndex:{type:Boolean,required:!1,default:!1}},emits:[`select`,`toggleCollapse`,`edit`,`addChild`,`addSibling`,`move`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=m(``),c=m(null),l=m(-1),u=r(()=>{let e=o.value.trim().toLowerCase();if(!e)return new Set;let t=new Set,n=r=>{var i;(r.text.toLowerCase().includes(e)||(i=r.note)!=null&&i.text&&r.note.text.toLowerCase().includes(e))&&t.add(r.id);for(let e of r.children)n(e)};return n(i.data),t}),d=r(()=>{if(u.value.size===0)return new Set;let e=new Set,t=n=>{let r=u.value.has(n.id);for(let e of n.children)t(e)&&(r=!0);return r&&e.add(n.id),r};return t(i.data),e}),f=r(()=>{let e=[],t=n=>{u.value.has(n.id)&&e.push(n.id);for(let e of n.children)t(e)};return t(i.data),e}),p=r(()=>o.value.trim().length>0),h=r(()=>{let e=[],t=d.value,n=(r,a,o)=>{if(p.value&&!t.has(r.id))return;let s=r.children.length>0,c=!p.value&&i.collapsedIds.has(r.id);e.push({id:r.id,text:r.text||`(无标题)`,depth:a,siblingIndex:o,hasChildren:s,collapsed:c,node:r}),s&&!c&&r.children.forEach((e,t)=>n(e,a+1,t))};return n(i.data,0,0),e});function v(){l.value=f.value.length>0?0:-1}function y(){let e=f.value;e.length!==0&&(l.value=(l.value+1)%e.length,S(l.value))}function b(){let e=f.value;e.length!==0&&(l.value=(l.value-1+e.length)%e.length,S(l.value))}function x(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?b():y()):e.key===`Escape`&&(e.preventDefault(),o.value=``,l.value=-1)}function S(e){let t=f.value[e];if(!t)return;let n=h.value.find(e=>e.id===t);n&&a(`select`,n.node),s(()=>{document.querySelector(`[data-outline-id="${t}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function C(){o.value=``,l.value=-1}_(()=>{s(()=>c.value?.focus())});let w=m(null),T=m(``),E=null;function D(e){i.readonly||(w.value=e.id,T.value=e.text,s(()=>{E=document.querySelector(`.zm-outline-input`),E?.focus(),E?.select()}))}function ee(){w.value!=null&&(a(`edit`,{id:w.value,text:T.value.trim()||`(无标题)`}),O())}function O(){w.value=null,T.value=``,E=null}function k(e){e.key===`Enter`?(e.preventDefault(),ee()):e.key===`Escape`&&(e.preventDefault(),O())}g(O);let A=m(null),j=m(null),M=m(null);function N(e,t){if(i.readonly){e.preventDefault();return}A.value={id:t.id,text:t.text},e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id))}function te(){A.value=null,j.value=null,M.value=null}function P(e,t){if(!A.value)return;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=re(e);j.value=t.id,M.value=n}function ne(e){j.value===e.id&&(j.value=null,M.value=null)}function F(e,t){e.preventDefault();let n=A.value;if(!n)return;let r=re(e);n.id!==t.id&&a(`move`,{srcId:n.id,targetId:t.id,position:r}),te()}function re(e,t){let n=e.currentTarget.getBoundingClientRect(),r=e.clientY-n.top,i=n.height;return r<i*.3?`before`:r>i*.7?`after`:`child`}let ie=m(null),I=null;async function R(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand(`copy`)}finally{document.body.removeChild(t)}return n}}async function z(e,t,n){e.stopPropagation(),await R(t)&&(ie.value=n,I&&clearTimeout(I),I=setTimeout(()=>ie.value=null,1200))}let oe=r(()=>{let e=[],t=(n,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;e.push(i+a+(n.text||``));for(let e of n.children)t(e,r+1)};return t(i.data,0),e.join(`
|
|
42
|
+
`)}),se=m(!1),ce=null;async function le(){await R(oe.value)&&(se.value=!0,ce&&clearTimeout(ce),ce=setTimeout(()=>se.value=!1,1200))}let ue={props:i,emit:a,searchQuery:o,searchInputRef:c,searchIndex:l,searchMatchIds:u,searchVisibleIds:d,searchMatchList:f,hasSearch:p,rows:h,onSearchInput:v,searchNext:y,searchPrev:b,onSearchKeydown:x,jumpToMatch:S,clearSearch:C,editingId:w,editingText:T,get editInputEl(){return E},set editInputEl(e){E=e},startEdit:D,commitEdit:ee,cancelEdit:O,onEditKeydown:k,dragData:A,dragOverId:j,dragOverPos:M,onDragStart:N,onDragEnd:te,onDragOver:P,onDragLeave:ne,onDrop:F,dropPositionFor:re,copiedId:ie,get copyTimer(){return I},set copyTimer(e){I=e},copyText:R,copyNodeText:z,plainText:oe,copyingOutline:se,get outlineTimer(){return ce},set outlineTimer(e){ce=e},copyOutline:le,get addNodeIcon(){return ae},get addSubNodeIcon(){return L}};return Object.defineProperty(ue,"__isScriptSetup",{enumerable:!1,value:!0}),ue}}),Xt={class:`zm-outline-root`},Zt={class:`zm-outline-search`},Qt={key:0,class:`zm-outline-search-count`},$t={key:1,class:`zm-outline-search-count zm-outline-search-empty`},en={class:`zm-outline-actions`},tn={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},W={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},nn={key:1,d:`M5 12 L10 17 L19 7`},G={class:`zm-outline`},rn=[`data-outline-id`,`onClick`,`onDblclick`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`],an=[`title`,`onClick`],on={width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`},K={key:0,points:`6 9 12 15 18 9`},sn={key:1,points:`9 6 15 12 9 18`},cn={key:1,class:`zm-outline-dot`},ln={key:2,class:`zm-outline-index`},un={key:4,class:`zm-outline-text`},dn=[`onClick`],fn=[`onClick`],pn=[`src`],mn=[`onClick`],hn=[`src`],gn=[`title`,`onClick`],_n={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},vn={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},yn={key:1,d:`M5 12 L10 17 L19 7`};function bn(r,i,a,o,s,c){return e(),w(`div`,Xt,[t(` Search bar — sits at the top of the outline drawer. When\r
|
|
43
43
|
the drawer opens (via Ctrl+F or the outline button), this\r
|
|
44
44
|
input auto-focuses so the user can start typing immediately.\r
|
|
45
45
|
Matches are highlighted in the list below; Enter jumps to\r
|
|
46
|
-
the next match (Shift+Enter for previous). `),t(`div`,Zt,[r[3]||=t(`svg`,{class:`zm-outline-search-icon`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[t(`circle`,{cx:`11`,cy:`11`,r:`7`}),t(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),D(t(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":r[0]||=e=>a.searchQuery=e,type:`text`,class:`zm-outline-search-input`,placeholder:`搜索节点… (Enter 下一个, Shift+Enter 上一个)`,onInput:a.onSearchInput,onKeydown:a.onSearchKeydown},null,544),[[O,a.searchQuery]]),a.searchMatchList.length>0?(d(),e(`span`,Qt,E(a.searchIndex+1)+`/`+E(a.searchMatchList.length),1)):a.hasSearch?(d(),e(`span`,$t,`无结果`)):b(`v-if`,!0),a.searchQuery?(d(),e(`button`,{key:2,class:`zm-outline-search-clear`,title:`清除搜索`,onClick:a.clearSearch},`×`)):b(`v-if`,!0)]),t(`div`,en,[t(`button`,{class:h([`zm-outline-action-btn`,{"is-success":a.copyingOutline}]),title:`复制完整大纲为纯文本`,onClick:a.copyOutline},[(d(),e(`svg`,tn,[a.copyingOutline?(d(),e(`path`,nn)):(d(),e(`rect`,W)),r[4]||=t(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)])),t(`span`,null,E(a.copyingOutline?`已复制`:`复制大纲`),1)],2)]),t(`ul`,G,[(d(!0),e(f,null,y(a.rows,n=>(d(),e(`li`,{key:n.id,"data-outline-id":n.id,class:h([`zm-outline-row`,{"is-selected":n.id===i.selectedId,"is-root":n.depth===0,"is-editing":a.editingId===n.id,"is-search-hit":a.searchMatchIds.has(n.id),"is-search-current":a.searchMatchList[a.searchIndex]===n.id,"is-drag-over-before":a.dragOverId===n.id&&a.dragOverPos===`before`,"is-drag-over-after":a.dragOverId===n.id&&a.dragOverPos===`after`,"is-drag-over-child":a.dragOverId===n.id&&a.dragOverPos===`child`}]),style:g({paddingLeft:12+n.depth*16+`px`}),draggable:`true`,onClick:e=>a.emit(`select`,n.node),onDblclick:e=>a.startEdit(n),onDragstart:e=>a.onDragStart(e,n),onDragend:a.onDragEnd,onDragover:e=>a.onDragOver(e,n),onDragleave:()=>a.onDragLeave(n),onDrop:e=>a.onDrop(e,n)},[n.hasChildren?(d(),e(`button`,{key:0,class:`zm-outline-toggle`,title:n.collapsed?`展开`:`折叠`,onClick:k(e=>a.emit(`toggleCollapse`,n.id),[`stop`])},[(d(),e(`svg`,on,[n.collapsed?(d(),e(`polyline`,sn)):(d(),e(`polyline`,K))]))],8,an)):(d(),e(`span`,cn)),a.props.showIndex?(d(),e(`span`,ln,E(n.siblingIndex+1)+`.`,1)):b(`v-if`,!0),a.editingId===n.id?D((d(),e(`input`,{key:3,"onUpdate:modelValue":r[1]||=e=>a.editingText=e,class:`zm-outline-input`,onBlur:a.commitEdit,onKeydown:a.onEditKeydown,onClick:r[2]||=k(()=>{},[`stop`])},null,544)),[[O,a.editingText]]):(d(),e(`span`,un,E(n.text),1)),a.props.readonly?b(`v-if`,!0):(d(),e(`button`,{key:5,class:`zm-outline-row-action`,title:`编辑文字`,onClick:k(e=>a.startEdit(n),[`stop`])},[...r[5]||=[t(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[t(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`}),t(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`})],-1)]],8,dn)),a.props.readonly?b(`v-if`,!0):(d(),e(`button`,{key:6,class:`zm-outline-row-action`,title:`添加同级`,onClick:k(e=>a.emit(`addSibling`,n.id),[`stop`])},[t(`img`,{src:a.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,pn)],8,fn)),a.props.readonly?b(`v-if`,!0):(d(),e(`button`,{key:7,class:`zm-outline-row-action`,title:`添加子节点`,onClick:k(e=>a.emit(`addChild`,n.id),[`stop`])},[t(`img`,{src:a.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,hn)],8,mn)),t(`button`,{class:h([`zm-outline-row-copy`,{"is-success":a.copiedId===n.id}]),title:a.copiedId===n.id?`已复制`:`复制节点文本`,onClick:e=>a.copyNodeText(e,n.text,n.id)},[(d(),e(`svg`,_n,[a.copiedId===n.id?(d(),e(`path`,yn)):(d(),e(`rect`,vn)),r[6]||=t(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]))],10,gn)],46,rn))),128))])])}var xn=F(Yt,[[`render`,bn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/Outline.vue`]]),Sn=s({__name:`JsonTreeViewer`,props:{value:{type:null,required:!0},keyName:{type:String,required:!1,default:``},isRoot:{type:Boolean,required:!1,default:!0},path:{type:String,required:!1,default:``},depth:{type:Number,required:!1,default:0},query:{type:String,required:!1,default:``},collapsedPaths:{type:Set,required:!1,default:()=>new Set}},setup(e,{expose:t}){t();let r=e,i=n(()=>r.value===null?`null`:Array.isArray(r.value)?`array`:typeof r.value),a=n(()=>i.value===`object`),o=n(()=>i.value===`array`),s=n(()=>!a.value&&!o.value),c=n(()=>{if(o.value)return`Array(${r.value.length})`;if(a.value){let e=r.value,t=Object.keys(e);return`Object(${t.length} ${t.length===1?`key`:`keys`})`}return``}),l=n(()=>o.value?r.value.map((e,t)=>({key:String(t),value:e})):a.value?Object.entries(r.value).map(([e,t])=>({key:e,value:t})):[]),u=n(()=>r.isRoot?`<root>`:r.path),d=n(()=>r.collapsedPaths.has(u.value));function f(e,t,n){e!==`<root>`&&(n<2||typeof t!=`object`||!t||r.collapsedPaths.has(e)||r.collapsedPaths.add(e))}r.isRoot||f(u.value,r.value,r.depth);function p(){d.value?r.collapsedPaths.delete(u.value):r.collapsedPaths.add(u.value)}function m(e){return u.value===``?e:`${u.value}.${e}`}function h(e){if(!r.query)return!0;let t=r.query.toLowerCase();return typeof e==`string`?e.toLowerCase().includes(t):e===null?`null`.includes(t):String(e).toLowerCase().includes(t)}function g(e){return!r.query||e.toLowerCase().includes(r.query.toLowerCase())}function _(e,t){return!r.query||g(e)?!0:typeof t!=`object`||!t?h(t):!0}function v(e){return e===null?`null`:typeof e==`string`?e.length>80?`"${e.slice(0,80)}..."`:`"${e}"`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):typeof e>`u`?`undefined`:JSON.stringify(e)}function y(e){if(typeof e!=`string`)return!1;let t=e.trim();return!!(t.startsWith(`data:image/`)||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t)||/^https?:\/\/.+/i.test(t)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t))}function b(e){if(!r.query)return null;let t=e.toLowerCase().indexOf(r.query.toLowerCase());return t<0?null:{before:e.slice(0,t),match:e.slice(t,t+r.query.length),after:e.slice(t+r.query.length)}}let x={props:r,type:i,isObject:a,isArray:o,isPrimitive:s,sizeLabel:c,entries:l,myPath:u,isCollapsed:d,applyDefaultCollapse:f,toggle:p,childPath:m,primitiveMatches:h,keyMatches:g,shouldShowEntry:_,displayValue:v,isImageValue:y,highlightMatch:b};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Cn={key:0,class:`zm-jtv-root`},wn={key:0,class:`zm-jtv-key`},Tn={key:1,class:`zm-jtv-colon`},En={key:2,class:`zm-jtv-key zm-jtv-bracket`},Dn={key:3,class:`zm-jtv-size`},q={key:4,class:`zm-jtv-bracket`},On={key:5,class:`zm-jtv-brace`},kn={key:0,class:`zm-jtv-children`},An={class:`zm-jtv-key`},jn={key:0,class:`zm-jtv-key`},Mn=[`src`,`alt`],Nn=[`href`];function Pn(n,i,a,o,s,c){let l=w(`JsonTreeViewer`,!0);return d(),e(f,null,[b(` Root: just the children, no key prefix. `),a.isRoot?(d(),e(`div`,Cn,[(d(!0),e(f,null,y(o.entries,t=>D((d(),e(`div`,{key:t.key,class:`zm-jtv-row`},[r(l,{"key-name":t.key,value:t.value,path:o.childPath(t.key),depth:a.depth+1,query:a.query,"collapsed-paths":a.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[j,o.shouldShowEntry(t.key,t.value)]])),128))])):o.isObject||o.isArray?(d(),e(f,{key:1},[b(` Object / array header + children `),t(`div`,{class:h([`zm-jtv-branch`,{"is-collapsed":o.isCollapsed}])},[t(`div`,{class:`zm-jtv-header`,style:g({paddingLeft:6+a.depth*12+`px`}),onClick:o.toggle},[t(`span`,{class:h([`zm-jtv-toggle`,{"is-leaf":!1}])},E(o.isCollapsed?`▶`:`▼`),1),o.isArray?b(`v-if`,!0):(d(),e(`span`,wn,E(a.keyName),1)),o.isArray?b(`v-if`,!0):(d(),e(`span`,Tn,`:`)),o.isArray?(d(),e(`span`,En,`[`)):b(`v-if`,!0),o.isCollapsed?(d(),e(`span`,Dn,E(o.sizeLabel),1)):b(`v-if`,!0),o.isCollapsed&&o.isArray?(d(),e(`span`,q,`]`)):b(`v-if`,!0),o.isCollapsed&&o.isObject?(d(),e(`span`,On,`}`)):b(`v-if`,!0)],4),o.isCollapsed?b(`v-if`,!0):(d(),e(`div`,kn,[(d(!0),e(f,null,y(o.entries,t=>D((d(),e(`div`,{key:t.key,class:`zm-jtv-row`},[r(l,{"key-name":t.key,value:t.value,path:o.childPath(t.key),depth:a.depth+1,query:a.query,"collapsed-paths":a.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[j,o.shouldShowEntry(t.key,t.value)]])),128))])),!o.isCollapsed&&o.isArray?(d(),e(`div`,{key:1,class:`zm-jtv-footer`,style:g({paddingLeft:6+a.depth*12+`px`})},`]`,4)):b(`v-if`,!0),!o.isCollapsed&&o.isObject&&!o.isArray?(d(),e(`div`,{key:2,class:`zm-jtv-footer`,style:g({paddingLeft:6+a.depth*12+`px`})},`}`,4)):b(`v-if`,!0)],2)],2112)):(d(),e(f,{key:2},[b(` Primitive value row `),t(`div`,{class:`zm-jtv-leaf`,style:g({paddingLeft:6+a.depth*12+`px`})},[i[2]||=t(`span`,{class:`zm-jtv-toggle is-leaf`},`·`,-1),t(`span`,An,E(a.keyName),1),i[3]||=t(`span`,{class:`zm-jtv-colon`},`:`,-1),o.keyMatches(a.keyName)&&o.highlightMatch(a.keyName)?(d(),e(`span`,jn,[t(`span`,null,E(o.highlightMatch(a.keyName)?.before),1),t(`mark`,null,E(o.highlightMatch(a.keyName)?.match),1),t(`span`,null,E(o.highlightMatch(a.keyName)?.after),1)])):b(`v-if`,!0),t(`span`,{class:h([`zm-jtv-value`,`zm-jtv-${o.type}`])},[o.highlightMatch(o.displayValue(a.value))?(d(),e(f,{key:0},[t(`span`,null,E(o.highlightMatch(o.displayValue(a.value))?.before),1),t(`mark`,null,E(o.highlightMatch(o.displayValue(a.value))?.match),1),t(`span`,null,E(o.highlightMatch(o.displayValue(a.value))?.after),1)],64)):(d(),e(f,{key:1},[u(E(o.displayValue(a.value)),1)],64))],2),o.isImageValue(a.value)?(d(),e(`span`,{key:1,class:`zm-jtv-thumb-wrap`,onClick:i[1]||=k(()=>{},[`stop`])},[t(`img`,{class:`zm-jtv-thumb`,src:String(a.value),alt:a.keyName,loading:`lazy`,referrerpolicy:`no-referrer`},null,8,Mn),t(`a`,{class:`zm-jtv-thumb-link`,href:String(a.value),target:`_blank`,rel:`noopener noreferrer`,onClick:i[0]||=k(()=>{},[`stop`])},`open`,8,Nn)])):b(`v-if`,!0)],4)],2112))],2112)}var Fn=F(Sn,[[`render`,Pn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/JsonTreeViewer.vue`]]),In=s({__name:`DataPanel`,props:{data:{type:Object,required:!0},pendingMode:{type:[String,null],required:!1,default:null}},emits:[`import`,`consumed-mode`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,o=n(()=>JSON.stringify(i.data,null,2)),s=A(``),c=A(null),l=A(!1),u=A(`json`),d=A(`idle`),f=A(new Set),p=A(``);T(()=>i.pendingMode,e=>{e&&(l.value=!0,u.value=e,a(`consumed-mode`))},{immediate:!0});async function m(){try{await navigator.clipboard.writeText(o.value),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}catch{let e=document.createElement(`textarea`);e.value=o.value,document.body.appendChild(e),e.select();try{document.execCommand(`copy`),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}finally{document.body.removeChild(e)}}}function h(){let e=new Blob([o.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i.data.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}function g(){c.value=null;let e=s.value.trim();if(e){if(u.value===`markdown`||u.value===`txt`){try{let t=ut(e);a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=(u.value===`txt`?`TXT 解析失败:`:`Markdown 解析失败:`)+e.message}return}try{let t=JSON.parse(e);if(!t.id||!Array.isArray(t.children)){c.value=`JSON 缺少 id 或 children 字段`;return}a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=`JSON 解析失败:`+e.message}}}function _(e){return 1+e.children.reduce((e,t)=>e+_(t),0)}let v=n(()=>_(i.data)),y=n(()=>o.value.length);function b(){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`&&(s.value=n.result,g())},n.readAsText(t)},e.click()}let x={props:i,emit:a,json:o,pasteText:s,pasteError:c,pasteOpen:l,pasteMode:u,copyState:d,collapsedPaths:f,searchQuery:p,copyAll:m,downloadJson:h,applyPaste:g,countNodes:_,totalNodes:v,charCount:y,pickFile:b,JsonTreeViewer:Fn};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Ln={class:`zm-data-panel`},Rn={class:`zm-data-header`},zn={class:`zm-data-title`},Bn={class:`zm-data-title-meta`},Vn={class:`zm-data-toolbar`},Hn=[`title`],Un={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Wn={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gn={key:0,class:`zm-data-paste`},Kn={class:`zm-data-tabs`},qn=[`placeholder`],Jn={key:0,class:`zm-data-error`},Yn={class:`zm-data-paste-actions`},Xn=[`disabled`],Zn={class:`zm-data-tree`};function Qn(n,i,a,o,s,l){return d(),e(`div`,Ln,[t(`div`,Rn,[t(`div`,zn,[i[8]||=t(`span`,{class:`zm-data-title-text`},`数据 JSON`,-1),t(`span`,Bn,E(o.totalNodes)+` 节点 · `+E(o.charCount)+` chars`,1)])]),t(`div`,Vn,[t(`button`,{class:h([`zm-data-btn is-icon`,{"is-success":o.copyState===`copied`}]),title:o.copyState===`copied`?`已复制`:`复制 JSON 到剪贴板`,onClick:o.copyAll},[o.copyState===`idle`?(d(),e(`svg`,Un,[...i[9]||=[t(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},null,-1),t(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]])):(d(),e(`svg`,Wn,[...i[10]||=[t(`polyline`,{points:`5 12 10 17 19 7`},null,-1)]])),i[11]||=t(`span`,{class:`zm-data-btn-label`},`复制`,-1)],10,Hn),t(`button`,{class:`zm-data-btn is-icon`,title:`导出为 JSON 文件`,onClick:o.downloadJson},[...i[12]||=[c(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>`,2)]]),t(`button`,{class:`zm-data-btn is-icon`,title:`从 JSON 文件导入`,onClick:o.pickFile},[...i[13]||=[c(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>`,2)]]),t(`button`,{class:h([`zm-data-btn is-icon`,{"is-active":o.pasteOpen}]),title:`粘贴 JSON 或 Markdown 替换当前数据`,onClick:i[0]||=e=>o.pasteOpen=!o.pasteOpen},[...i[14]||=[c(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>`,2)]],2),i[16]||=t(`div`,{class:`zm-data-toolbar-spacer`},null,-1),t(`div`,{class:h([`zm-data-search`,{"is-active":o.searchQuery.length>0}])},[i[15]||=t(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[t(`circle`,{cx:`11`,cy:`11`,r:`7`}),t(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),D(t(`input`,{"onUpdate:modelValue":i[1]||=e=>o.searchQuery=e,type:`text`,placeholder:`过滤 (键 / 值)`,spellcheck:`false`},null,512),[[O,o.searchQuery]]),o.searchQuery?(d(),e(`button`,{key:0,class:`zm-data-search-clear`,title:`清空过滤`,onClick:i[2]||=e=>o.searchQuery=``},`×`)):b(`v-if`,!0)],2)]),o.pasteOpen?(d(),e(`div`,Gn,[t(`div`,Kn,[t(`button`,{class:h([`zm-data-tab`,{"is-active":o.pasteMode===`json`}]),onClick:i[3]||=e=>o.pasteMode=`json`},`JSON`,2),t(`button`,{class:h([`zm-data-tab`,{"is-active":o.pasteMode===`markdown`}]),onClick:i[4]||=e=>o.pasteMode=`markdown`},`Markdown`,2)]),D(t(`textarea`,{"onUpdate:modelValue":i[5]||=e=>o.pasteText=e,placeholder:o.pasteMode===`json`?`paste a JSON tree to replace current data`:`paste markdown - # / ## / ### become nodes`,spellcheck:`false`},null,8,qn),[[O,o.pasteText]]),o.pasteError?(d(),e(`div`,Jn,E(o.pasteError),1)):b(`v-if`,!0),t(`div`,Yn,[t(`button`,{class:`zm-data-btn is-primary`,disabled:!o.pasteText,onClick:o.applyPaste},`应用`,8,Xn),t(`button`,{class:`zm-data-btn`,onClick:i[6]||=e=>{o.pasteText=``,o.pasteError=null}},`清空`),t(`button`,{class:`zm-data-btn`,onClick:i[7]||=e=>o.pasteOpen=!1},`关闭`)])])):b(`v-if`,!0),t(`div`,Zn,[r(o.JsonTreeViewer,{value:a.data,query:o.searchQuery,"collapsed-paths":o.collapsedPaths},null,8,[`value`,`query`,`collapsed-paths`])]),i[17]||=t(`div`,{class:`zm-data-footer`},[t(`span`,{class:`zm-data-footer-hint`},[u(` 图片支持 `),t(`code`,null,`data:image/...`),u(` / `),t(`code`,null,`https://...`),u(` / `),t(`code`,null,`/imgs/foo.png`),u(` (同源)。本地 `),t(`code`,null,`file://`),u(` 路径被浏览器拒绝。 `)])],-1)])}var $n=F(In,[[`render`,Qn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/DataPanel.vue`]]),er=`# flow-mindmap 思维导图
|
|
46
|
+
the next match (Shift+Enter for previous). `),l(`div`,Zt,[i[3]||=l(`svg`,{class:`zm-outline-search-icon`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[l(`circle`,{cx:`11`,cy:`11`,r:`7`}),l(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),x(l(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":i[0]||=e=>o.searchQuery=e,type:`text`,class:`zm-outline-search-input`,placeholder:`搜索节点… (Enter 下一个, Shift+Enter 上一个)`,onInput:o.onSearchInput,onKeydown:o.onSearchKeydown},null,544),[[M,o.searchQuery]]),o.searchMatchList.length>0?(e(),w(`span`,Qt,E(o.searchIndex+1)+`/`+E(o.searchMatchList.length),1)):o.hasSearch?(e(),w(`span`,$t,`无结果`)):t(`v-if`,!0),o.searchQuery?(e(),w(`button`,{key:2,class:`zm-outline-search-clear`,title:`清除搜索`,onClick:o.clearSearch},`×`)):t(`v-if`,!0)]),l(`div`,en,[l(`button`,{class:h([`zm-outline-action-btn`,{"is-success":o.copyingOutline}]),title:`复制完整大纲为纯文本`,onClick:o.copyOutline},[(e(),w(`svg`,tn,[o.copyingOutline?(e(),w(`path`,nn)):(e(),w(`rect`,W)),i[4]||=l(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)])),l(`span`,null,E(o.copyingOutline?`已复制`:`复制大纲`),1)],2)]),l(`ul`,G,[(e(!0),w(n,null,O(o.rows,n=>(e(),w(`li`,{key:n.id,"data-outline-id":n.id,class:h([`zm-outline-row`,{"is-selected":n.id===a.selectedId,"is-root":n.depth===0,"is-editing":o.editingId===n.id,"is-search-hit":o.searchMatchIds.has(n.id),"is-search-current":o.searchMatchList[o.searchIndex]===n.id,"is-drag-over-before":o.dragOverId===n.id&&o.dragOverPos===`before`,"is-drag-over-after":o.dragOverId===n.id&&o.dragOverPos===`after`,"is-drag-over-child":o.dragOverId===n.id&&o.dragOverPos===`child`}]),style:d({paddingLeft:12+n.depth*16+`px`}),draggable:`true`,onClick:e=>o.emit(`select`,n.node),onDblclick:e=>o.startEdit(n),onDragstart:e=>o.onDragStart(e,n),onDragend:o.onDragEnd,onDragover:e=>o.onDragOver(e,n),onDragleave:()=>o.onDragLeave(n),onDrop:e=>o.onDrop(e,n)},[n.hasChildren?(e(),w(`button`,{key:0,class:`zm-outline-toggle`,title:n.collapsed?`展开`:`折叠`,onClick:p(e=>o.emit(`toggleCollapse`,n.id),[`stop`])},[(e(),w(`svg`,on,[n.collapsed?(e(),w(`polyline`,sn)):(e(),w(`polyline`,K))]))],8,an)):(e(),w(`span`,cn)),o.props.showIndex?(e(),w(`span`,ln,E(n.siblingIndex+1)+`.`,1)):t(`v-if`,!0),o.editingId===n.id?x((e(),w(`input`,{key:3,"onUpdate:modelValue":i[1]||=e=>o.editingText=e,class:`zm-outline-input`,onBlur:o.commitEdit,onKeydown:o.onEditKeydown,onClick:i[2]||=p(()=>{},[`stop`])},null,544)),[[M,o.editingText]]):(e(),w(`span`,un,E(n.text),1)),o.props.readonly?t(`v-if`,!0):(e(),w(`button`,{key:5,class:`zm-outline-row-action`,title:`编辑文字`,onClick:p(e=>o.startEdit(n),[`stop`])},[...i[5]||=[l(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[l(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`}),l(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`})],-1)]],8,dn)),o.props.readonly?t(`v-if`,!0):(e(),w(`button`,{key:6,class:`zm-outline-row-action`,title:`添加同级`,onClick:p(e=>o.emit(`addSibling`,n.id),[`stop`])},[l(`img`,{src:o.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,pn)],8,fn)),o.props.readonly?t(`v-if`,!0):(e(),w(`button`,{key:7,class:`zm-outline-row-action`,title:`添加子节点`,onClick:p(e=>o.emit(`addChild`,n.id),[`stop`])},[l(`img`,{src:o.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,hn)],8,mn)),l(`button`,{class:h([`zm-outline-row-copy`,{"is-success":o.copiedId===n.id}]),title:o.copiedId===n.id?`已复制`:`复制节点文本`,onClick:e=>o.copyNodeText(e,n.text,n.id)},[(e(),w(`svg`,_n,[o.copiedId===n.id?(e(),w(`path`,yn)):(e(),w(`rect`,vn)),i[6]||=l(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]))],10,gn)],46,rn))),128))])])}var xn=F(Yt,[[`render`,bn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/Outline.vue`]]),Sn=f({__name:`JsonTreeViewer`,props:{value:{type:null,required:!0},keyName:{type:String,required:!1,default:``},isRoot:{type:Boolean,required:!1,default:!0},path:{type:String,required:!1,default:``},depth:{type:Number,required:!1,default:0},query:{type:String,required:!1,default:``},collapsedPaths:{type:Set,required:!1,default:()=>new Set}},setup(e,{expose:t}){t();let n=e,i=r(()=>n.value===null?`null`:Array.isArray(n.value)?`array`:typeof n.value),a=r(()=>i.value===`object`),o=r(()=>i.value===`array`),s=r(()=>!a.value&&!o.value),c=r(()=>{if(o.value)return`Array(${n.value.length})`;if(a.value){let e=n.value,t=Object.keys(e);return`Object(${t.length} ${t.length===1?`key`:`keys`})`}return``}),l=r(()=>o.value?n.value.map((e,t)=>({key:String(t),value:e})):a.value?Object.entries(n.value).map(([e,t])=>({key:e,value:t})):[]),u=r(()=>n.isRoot?`<root>`:n.path),d=r(()=>n.collapsedPaths.has(u.value));function f(e,t,r){e!==`<root>`&&(r<2||typeof t!=`object`||!t||n.collapsedPaths.has(e)||n.collapsedPaths.add(e))}n.isRoot||f(u.value,n.value,n.depth);function p(){d.value?n.collapsedPaths.delete(u.value):n.collapsedPaths.add(u.value)}function m(e){return u.value===``?e:`${u.value}.${e}`}function h(e){if(!n.query)return!0;let t=n.query.toLowerCase();return typeof e==`string`?e.toLowerCase().includes(t):e===null?`null`.includes(t):String(e).toLowerCase().includes(t)}function g(e){return!n.query||e.toLowerCase().includes(n.query.toLowerCase())}function _(e,t){return!n.query||g(e)?!0:typeof t!=`object`||!t?h(t):!0}function v(e){return e===null?`null`:typeof e==`string`?e.length>80?`"${e.slice(0,80)}..."`:`"${e}"`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):typeof e>`u`?`undefined`:JSON.stringify(e)}function y(e){if(typeof e!=`string`)return!1;let t=e.trim();return!!(t.startsWith(`data:image/`)||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t)||/^https?:\/\/.+/i.test(t)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t))}function b(e){if(!n.query)return null;let t=e.toLowerCase().indexOf(n.query.toLowerCase());return t<0?null:{before:e.slice(0,t),match:e.slice(t,t+n.query.length),after:e.slice(t+n.query.length)}}let x={props:n,type:i,isObject:a,isArray:o,isPrimitive:s,sizeLabel:c,entries:l,myPath:u,isCollapsed:d,applyDefaultCollapse:f,toggle:p,childPath:m,primitiveMatches:h,keyMatches:g,shouldShowEntry:_,displayValue:v,isImageValue:y,highlightMatch:b};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Cn={key:0,class:`zm-jtv-root`},wn={key:0,class:`zm-jtv-key`},Tn={key:1,class:`zm-jtv-colon`},En={key:2,class:`zm-jtv-key zm-jtv-bracket`},Dn={key:3,class:`zm-jtv-size`},q={key:4,class:`zm-jtv-bracket`},On={key:5,class:`zm-jtv-brace`},kn={key:0,class:`zm-jtv-children`},An={class:`zm-jtv-key`},jn={key:0,class:`zm-jtv-key`},Mn=[`src`,`alt`],Nn=[`href`];function Pn(r,a,s,c,u,f){let m=ee(`JsonTreeViewer`,!0);return e(),w(n,null,[t(` Root: just the children, no key prefix. `),s.isRoot?(e(),w(`div`,Cn,[(e(!0),w(n,null,O(c.entries,t=>x((e(),w(`div`,{key:t.key,class:`zm-jtv-row`},[o(m,{"key-name":t.key,value:t.value,path:c.childPath(t.key),depth:s.depth+1,query:s.query,"collapsed-paths":s.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[v,c.shouldShowEntry(t.key,t.value)]])),128))])):c.isObject||c.isArray?(e(),w(n,{key:1},[t(` Object / array header + children `),l(`div`,{class:h([`zm-jtv-branch`,{"is-collapsed":c.isCollapsed}])},[l(`div`,{class:`zm-jtv-header`,style:d({paddingLeft:6+s.depth*12+`px`}),onClick:c.toggle},[l(`span`,{class:h([`zm-jtv-toggle`,{"is-leaf":!1}])},E(c.isCollapsed?`▶`:`▼`),1),c.isArray?t(`v-if`,!0):(e(),w(`span`,wn,E(s.keyName),1)),c.isArray?t(`v-if`,!0):(e(),w(`span`,Tn,`:`)),c.isArray?(e(),w(`span`,En,`[`)):t(`v-if`,!0),c.isCollapsed?(e(),w(`span`,Dn,E(c.sizeLabel),1)):t(`v-if`,!0),c.isCollapsed&&c.isArray?(e(),w(`span`,q,`]`)):t(`v-if`,!0),c.isCollapsed&&c.isObject?(e(),w(`span`,On,`}`)):t(`v-if`,!0)],4),c.isCollapsed?t(`v-if`,!0):(e(),w(`div`,kn,[(e(!0),w(n,null,O(c.entries,t=>x((e(),w(`div`,{key:t.key,class:`zm-jtv-row`},[o(m,{"key-name":t.key,value:t.value,path:c.childPath(t.key),depth:s.depth+1,query:s.query,"collapsed-paths":s.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[v,c.shouldShowEntry(t.key,t.value)]])),128))])),!c.isCollapsed&&c.isArray?(e(),w(`div`,{key:1,class:`zm-jtv-footer`,style:d({paddingLeft:6+s.depth*12+`px`})},`]`,4)):t(`v-if`,!0),!c.isCollapsed&&c.isObject&&!c.isArray?(e(),w(`div`,{key:2,class:`zm-jtv-footer`,style:d({paddingLeft:6+s.depth*12+`px`})},`}`,4)):t(`v-if`,!0)],2)],2112)):(e(),w(n,{key:2},[t(` Primitive value row `),l(`div`,{class:`zm-jtv-leaf`,style:d({paddingLeft:6+s.depth*12+`px`})},[a[2]||=l(`span`,{class:`zm-jtv-toggle is-leaf`},`·`,-1),l(`span`,An,E(s.keyName),1),a[3]||=l(`span`,{class:`zm-jtv-colon`},`:`,-1),c.keyMatches(s.keyName)&&c.highlightMatch(s.keyName)?(e(),w(`span`,jn,[l(`span`,null,E(c.highlightMatch(s.keyName)?.before),1),l(`mark`,null,E(c.highlightMatch(s.keyName)?.match),1),l(`span`,null,E(c.highlightMatch(s.keyName)?.after),1)])):t(`v-if`,!0),l(`span`,{class:h([`zm-jtv-value`,`zm-jtv-${c.type}`])},[c.highlightMatch(c.displayValue(s.value))?(e(),w(n,{key:0},[l(`span`,null,E(c.highlightMatch(c.displayValue(s.value))?.before),1),l(`mark`,null,E(c.highlightMatch(c.displayValue(s.value))?.match),1),l(`span`,null,E(c.highlightMatch(c.displayValue(s.value))?.after),1)],64)):(e(),w(n,{key:1},[i(E(c.displayValue(s.value)),1)],64))],2),c.isImageValue(s.value)?(e(),w(`span`,{key:1,class:`zm-jtv-thumb-wrap`,onClick:a[1]||=p(()=>{},[`stop`])},[l(`img`,{class:`zm-jtv-thumb`,src:String(s.value),alt:s.keyName,loading:`lazy`,referrerpolicy:`no-referrer`},null,8,Mn),l(`a`,{class:`zm-jtv-thumb-link`,href:String(s.value),target:`_blank`,rel:`noopener noreferrer`,onClick:a[0]||=p(()=>{},[`stop`])},`open`,8,Nn)])):t(`v-if`,!0)],4)],2112))],2112)}var Fn=F(Sn,[[`render`,Pn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/JsonTreeViewer.vue`]]),In=f({__name:`DataPanel`,props:{data:{type:Object,required:!0},pendingMode:{type:[String,null],required:!1,default:null}},emits:[`import`,`consumed-mode`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=r(()=>JSON.stringify(i.data,null,2)),s=m(``),c=m(null),l=m(!1),u=m(`json`),d=m(`idle`),f=m(new Set),p=m(``);b(()=>i.pendingMode,e=>{e&&(l.value=!0,u.value=e,a(`consumed-mode`))},{immediate:!0});async function h(){try{await navigator.clipboard.writeText(o.value),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}catch{let e=document.createElement(`textarea`);e.value=o.value,document.body.appendChild(e),e.select();try{document.execCommand(`copy`),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}finally{document.body.removeChild(e)}}}function g(){let e=new Blob([o.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i.data.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}function _(){c.value=null;let e=s.value.trim();if(e){if(u.value===`markdown`||u.value===`txt`){try{let t=ut(e);a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=(u.value===`txt`?`TXT 解析失败:`:`Markdown 解析失败:`)+e.message}return}try{let t=JSON.parse(e);if(!t.id||!Array.isArray(t.children)){c.value=`JSON 缺少 id 或 children 字段`;return}a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=`JSON 解析失败:`+e.message}}}function v(e){return 1+e.children.reduce((e,t)=>e+v(t),0)}let y=r(()=>v(i.data)),x=r(()=>o.value.length);function S(){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`&&(s.value=n.result,_())},n.readAsText(t)},e.click()}let C={props:i,emit:a,json:o,pasteText:s,pasteError:c,pasteOpen:l,pasteMode:u,copyState:d,collapsedPaths:f,searchQuery:p,copyAll:h,downloadJson:g,applyPaste:_,countNodes:v,totalNodes:y,charCount:x,pickFile:S,JsonTreeViewer:Fn};return Object.defineProperty(C,"__isScriptSetup",{enumerable:!1,value:!0}),C}}),Ln={class:`zm-data-panel`},Rn={class:`zm-data-header`},zn={class:`zm-data-title`},Bn={class:`zm-data-title-meta`},Vn={class:`zm-data-toolbar`},Hn=[`title`],Un={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Wn={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gn={key:0,class:`zm-data-paste`},Kn={class:`zm-data-tabs`},qn=[`placeholder`],Jn={key:0,class:`zm-data-error`},Yn={class:`zm-data-paste-actions`},Xn=[`disabled`],Zn={class:`zm-data-tree`};function Qn(n,r,a,s,c,d){return e(),w(`div`,Ln,[l(`div`,Rn,[l(`div`,zn,[r[8]||=l(`span`,{class:`zm-data-title-text`},`数据 JSON`,-1),l(`span`,Bn,E(s.totalNodes)+` 节点 · `+E(s.charCount)+` chars`,1)])]),l(`div`,Vn,[l(`button`,{class:h([`zm-data-btn is-icon`,{"is-success":s.copyState===`copied`}]),title:s.copyState===`copied`?`已复制`:`复制 JSON 到剪贴板`,onClick:s.copyAll},[s.copyState===`idle`?(e(),w(`svg`,Un,[...r[9]||=[l(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},null,-1),l(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]])):(e(),w(`svg`,Wn,[...r[10]||=[l(`polyline`,{points:`5 12 10 17 19 7`},null,-1)]])),r[11]||=l(`span`,{class:`zm-data-btn-label`},`复制`,-1)],10,Hn),l(`button`,{class:`zm-data-btn is-icon`,title:`导出为 JSON 文件`,onClick:s.downloadJson},[...r[12]||=[u(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>`,2)]]),l(`button`,{class:`zm-data-btn is-icon`,title:`从 JSON 文件导入`,onClick:s.pickFile},[...r[13]||=[u(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>`,2)]]),l(`button`,{class:h([`zm-data-btn is-icon`,{"is-active":s.pasteOpen}]),title:`粘贴 JSON 或 Markdown 替换当前数据`,onClick:r[0]||=e=>s.pasteOpen=!s.pasteOpen},[...r[14]||=[u(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>`,2)]],2),r[16]||=l(`div`,{class:`zm-data-toolbar-spacer`},null,-1),l(`div`,{class:h([`zm-data-search`,{"is-active":s.searchQuery.length>0}])},[r[15]||=l(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[l(`circle`,{cx:`11`,cy:`11`,r:`7`}),l(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),x(l(`input`,{"onUpdate:modelValue":r[1]||=e=>s.searchQuery=e,type:`text`,placeholder:`过滤 (键 / 值)`,spellcheck:`false`},null,512),[[M,s.searchQuery]]),s.searchQuery?(e(),w(`button`,{key:0,class:`zm-data-search-clear`,title:`清空过滤`,onClick:r[2]||=e=>s.searchQuery=``},`×`)):t(`v-if`,!0)],2)]),s.pasteOpen?(e(),w(`div`,Gn,[l(`div`,Kn,[l(`button`,{class:h([`zm-data-tab`,{"is-active":s.pasteMode===`json`}]),onClick:r[3]||=e=>s.pasteMode=`json`},`JSON`,2),l(`button`,{class:h([`zm-data-tab`,{"is-active":s.pasteMode===`markdown`}]),onClick:r[4]||=e=>s.pasteMode=`markdown`},`Markdown`,2)]),x(l(`textarea`,{"onUpdate:modelValue":r[5]||=e=>s.pasteText=e,placeholder:s.pasteMode===`json`?`paste a JSON tree to replace current data`:`paste markdown - # / ## / ### become nodes`,spellcheck:`false`},null,8,qn),[[M,s.pasteText]]),s.pasteError?(e(),w(`div`,Jn,E(s.pasteError),1)):t(`v-if`,!0),l(`div`,Yn,[l(`button`,{class:`zm-data-btn is-primary`,disabled:!s.pasteText,onClick:s.applyPaste},`应用`,8,Xn),l(`button`,{class:`zm-data-btn`,onClick:r[6]||=e=>{s.pasteText=``,s.pasteError=null}},`清空`),l(`button`,{class:`zm-data-btn`,onClick:r[7]||=e=>s.pasteOpen=!1},`关闭`)])])):t(`v-if`,!0),l(`div`,Zn,[o(s.JsonTreeViewer,{value:a.data,query:s.searchQuery,"collapsed-paths":s.collapsedPaths},null,8,[`value`,`query`,`collapsed-paths`])]),r[17]||=l(`div`,{class:`zm-data-footer`},[l(`span`,{class:`zm-data-footer-hint`},[i(` 图片支持 `),l(`code`,null,`data:image/...`),i(` / `),l(`code`,null,`https://...`),i(` / `),l(`code`,null,`/imgs/foo.png`),i(` (同源)。本地 `),l(`code`,null,`file://`),i(` 路径被浏览器拒绝。 `)])],-1)])}var $n=F(In,[[`render`,Qn],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/DataPanel.vue`]]),er=`# flow-mindmap 思维导图
|
|
47
47
|
|
|
48
48
|
[GitHub 仓库](https://github.com/xz333221/flow-mindmap)
|
|
49
49
|
|
|
@@ -82,17 +82,17 @@ import{An as e,Dn as t,En as n,Fn as r,Gn as i,Ir as a,Jn as o,Ln as s,Nn as c,O
|
|
|
82
82
|
|
|
83
83
|
## 开源协议
|
|
84
84
|
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
85
|
-
`,tr=
|
|
85
|
+
`,tr=f({__name:`MarkdownPanel`,props:{data:{type:Object,required:!0}},emits:[`import`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=m(dt(i.data)),c=m(null),l=m(null),u=r(()=>{try{let e=ut(o.value||``);return c.value=null,e}catch(e){return c.value=e.message,{id:`preview_fallback`,text:o.value||`(空)`,children:[]}}}),d=r(()=>H(u.value)),f=null;b(o,()=>{f&&clearTimeout(f),f=setTimeout(()=>l.value?.resetView(),250)});function p(){try{let e=ut(o.value||``);c.value=null,a(`import`,e)}catch(e){c.value=e.message}}function h(){o.value=dt(i.data),c.value=null,s(()=>l.value?.resetView())}function g(){o.value=``,c.value=null,s(()=>l.value?.resetView())}function _(){let e=document.createElement(`input`);e.type=`file`,e.accept=`.md,text/markdown,text/plain`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(o.value=n.result,c.value=null,s(()=>l.value?.resetView()))},n.readAsText(t)},e.click()}function v(){let e=new Blob([o.value],{type:`text/markdown;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${(i.data.text||`mindmap`).trim()||`mindmap`}.md`,n.click(),URL.revokeObjectURL(t)}function y(){o.value=er,c.value=null,s(()=>l.value?.resetView())}let x={props:i,emit:a,mdText:o,parseError:c,previewRef:l,previewDataRaw:u,previewData:d,get resetTimer(){return f},set resetTimer(e){f=e},applyToData:p,syncFromData:h,clearAll:g,loadFromFile:_,exportToFile:v,STARTER:er,loadStarter:y,MindMap:lf};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),nr={class:`zm-md-panel`},rr={key:0,class:`zm-md-error`},J={class:`zm-md-split`},ir={class:`zm-md-edit`},ar={class:`zm-md-preview`},or={class:`zm-md-preview-body`},sr={class:`zm-md-footer`},cr=[`disabled`];function lr(n,r,i,a,s,c){return e(),w(`div`,nr,[l(`div`,{class:`zm-md-toolbar`},[l(`button`,{class:`zm-md-btn`,title:`从 .md 文件加载`,onClick:a.loadFromFile},[...r[1]||=[l(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[l(`path`,{d:`M12 4 V15`}),l(`polyline`,{points:`7 9 12 4 17 9`}),l(`path`,{d:`M4 19 H20`})],-1),l(`span`,null,`加载 .md`,-1)]]),l(`button`,{class:`zm-md-btn`,title:`把当前导图导出为 .md`,onClick:a.exportToFile},[...r[2]||=[l(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[l(`path`,{d:`M12 15 V4`}),l(`polyline`,{points:`7 9 12 4 17 9`}),l(`path`,{d:`M4 19 H20`})],-1),l(`span`,null,`导出 .md`,-1)]]),r[3]||=l(`span`,{class:`zm-md-spacer`},null,-1),l(`button`,{class:`zm-md-btn`,title:`用示例内容填充`,onClick:a.loadStarter},`示例`),l(`button`,{class:`zm-md-btn`,title:`覆盖为当前导图`,onClick:a.syncFromData},`同步`),l(`button`,{class:`zm-md-btn`,title:`清空`,onClick:a.clearAll},`清空`)]),a.parseError?(e(),w(`div`,rr,E(a.parseError),1)):t(`v-if`,!0),l(`div`,J,[l(`div`,ir,[r[4]||=l(`div`,{class:`zm-md-pane-header`},[l(`span`,null,`Markdown`),l(`span`,{class:`zm-md-hint`},`# 根 · ## 一级 · ### 二级 …`)],-1),x(l(`textarea`,{"onUpdate:modelValue":r[0]||=e=>a.mdText=e,class:`zm-md-textarea`,spellcheck:`false`,placeholder:`# 标题…`},null,512),[[M,a.mdText]])]),l(`div`,ar,[r[5]||=l(`div`,{class:`zm-md-pane-header`},[l(`span`,null,`导图预览`),l(`span`,{class:`zm-md-hint`},`只读`)],-1),l(`div`,or,[o(a.MindMap,{ref:`previewRef`,data:a.previewData,readonly:``,"preview-mode":``},null,8,[`data`])])])]),l(`div`,sr,[l(`button`,{class:`zm-md-btn is-primary`,disabled:!a.mdText.trim(),onClick:a.applyToData},`应用到导图`,8,cr)])])}var ur=F(tr,[[`render`,lr],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/MarkdownPanel.vue`]]),dr=f({__name:`SettingsPanel`,props:{settings:{type:Object,required:!0},hasSelection:{type:Boolean,required:!0},selectedNodeText:{type:String,required:!1},nodeStyle:{type:Object,required:!1}},emits:[`update:settings`,`update:nodeStyle`,`reset`],setup(e,{expose:t,emit:n}){t();let i=e,a=n;function o(e,t){a(`update:settings`,{[e]:t})}let s=[{value:`arc`,label:`圆弧`,viewBox:`0 0 28 14`},{value:`rounded-elbow`,label:`圆角折线`,viewBox:`0 0 28 14`},{value:`elbow`,label:`折线`,viewBox:`0 0 28 14`},{value:`straight`,label:`直线`,viewBox:`0 0 28 14`},{value:`curve`,label:`S曲线`,viewBox:`0 0 28 14`}],c=s,l=[{value:`edge`,label:`左右中点`},{value:`center`,label:`节点正中心`},{value:`proportional`,label:`按比例计算`},{value:`xmind`,label:`分散排布`}],u=[{value:100,label:`100`},{value:200,label:`200`},{value:300,label:`300`},{value:400,label:`400 (常规)`},{value:500,label:`500`},{value:600,label:`600 (半粗)`},{value:700,label:`700 (粗体)`},{value:800,label:`800`},{value:900,label:`900`}];function d(e){a(`update:nodeStyle`,e)}let f=r(()=>[...Re,...i.settings.customPalettes]),p=y({});function m(e){return p[e.id]===void 0&&(p[e.id]=e.colors.join(`
|
|
86
86
|
`)),p[e.id]}function h(e){let t=Be(p[e.id]??``);if(t.length===0){p[e.id]=e.colors.join(`
|
|
87
87
|
`);return}let n=i.settings.customPalettes.map(n=>n.id===e.id?{...n,colors:t}:n);a(`update:settings`,{customPalettes:n})}function g(){let e=f.value.find(e=>e.id===i.settings.branchPaletteId),t=e?[...e.colors]:[...Re[0].colors],n=`custom-`,r=n+(i.settings.customPalettes.length+1);for(;Re.some(e=>e.id===r)||i.settings.customPalettes.some(e=>e.id===r);)r=n+Math.random().toString(36).slice(2,7);let o={id:r,name:`我的配色 ${i.settings.customPalettes.length+1}`,colors:t};a(`update:settings`,{customPalettes:[...i.settings.customPalettes,o],branchPaletteId:r}),p[r]=t.join(`
|
|
88
|
-
`)}function _(e){let t=i.settings.customPalettes.filter(t=>t.id!==e.id),n=i.settings.branchPaletteId===e.id?`default`:i.settings.branchPaletteId;a(`update:settings`,{customPalettes:t,...n===i.settings.branchPaletteId?{}:{branchPaletteId:n}}),delete p[e.id]}let v=[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`,`#1e2937`,`#f8fafc`,`#94a3b8`],
|
|
88
|
+
`)}function _(e){let t=i.settings.customPalettes.filter(t=>t.id!==e.id),n=i.settings.branchPaletteId===e.id?`default`:i.settings.branchPaletteId;a(`update:settings`,{customPalettes:t,...n===i.settings.branchPaletteId?{}:{branchPaletteId:n}}),delete p[e.id]}let v=[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`,`#1e2937`,`#f8fafc`,`#94a3b8`],b=[`#f8fafc`,`#ffffff`,`#e2e8f0`,`#1e2937`,`#0f172a`,`#fef3c7`,`#dbeafe`,`#dcfce7`,`#fce7f3`,`#f1f5f9`],x=[0,1,2,3],S=[`#f87171`,`#fb923c`,`#34d399`,`#818cf8`];function C(e,t,n,r){if(t<=1)return n;let i=e/(t-1);return n+(r-n)*i}function w(e,t,n,r){let i=t*r**+e;return Math.max(n,i)}let T={props:i,emit:a,set:o,LINE_STYLE_OPTIONS:s,ROOT_LINE_STYLE_OPTIONS:c,LINE_ORIGIN_OPTIONS:l,FONT_WEIGHT_OPTIONS:u,applyNodeStyleDelta:d,allPalettes:f,customDrafts:p,draftFor:m,commitCustomPalette:h,addCustomPalette:g,deleteCustomPalette:_,PALETTE:v,CANVAS_BG_PRESETS:b,PREVIEW_DEPTHS:x,PREVIEW_PALETTE:S,widthAt:C,taperedParentW:w,previewLines:r(()=>{let e=i.settings.lineWidthStart,t=i.settings.lineWidthEnd,n=i.settings.taperedEdge,r=x.length,a=f.value.find(e=>e.id===i.settings.branchPaletteId),o=a&&a.colors.length?a.colors:S;return x.map((a,s)=>{let c=10+s*60/(r-1);return{x1:8,y1:c,x2:192,y2:c,w:n?w(a,e,t,i.settings.lineWidthTaper):C(a,r,e,t),color:i.settings.rainbowBranch?o[s%o.length]:`#94a3b8`}})})};return Object.defineProperty(T,"__isScriptSetup",{enumerable:!1,value:!0}),T}}),fr={class:`zm-settings-panel`},pr={class:`zm-settings-section`},mr={class:`zm-settings-field`},hr={class:`zm-settings-control`},gr={class:`zm-color-input-wrap`},_r=[`value`],vr={class:`zm-color-input-text`},yr={class:`zm-swatch-row zm-swatch-row--compact`},br=[`title`,`onClick`],xr={class:`zm-settings-field`},Sr=[`value`],Cr={class:`zm-slider`},wr=[`value`],Tr={class:`zm-settings-field`},Er=[`value`],Dr={class:`zm-slider`},Or=[`value`],kr={class:`zm-settings-field zm-line-style-field`},Ar={class:`zm-line-style-group`},jr=[`title`,`onClick`],Mr=[`viewBox`],Nr={key:0,d:`M 0 12 Q 14 2, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Pr={key:1,d:`M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Fr={key:2,d:`M 0 10 L 16 10 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Ir={key:3,d:`M 0 12 C 8 0, 20 0, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Lr={key:4,x1:`0`,y1:`12`,x2:`28`,y2:`12`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Rr={class:`zm-line-style-label`},zr={class:`zm-settings-field zm-line-style-field`},Br={class:`zm-line-style-group`},Vr=[`title`,`onClick`],Hr=[`viewBox`],Ur={key:0,d:`M 0 12 Q 14 2, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Wr={key:1,d:`M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gr={key:2,d:`M 0 10 L 16 10 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Kr={key:3,d:`M 0 12 C 8 0, 20 0, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},qr={key:4,x1:`0`,y1:`12`,x2:`28`,y2:`12`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Jr={class:`zm-line-style-label`},Yr={key:0,class:`zm-settings-field`},Xr={class:`zm-settings-label`},Zr={class:`zm-settings-sub`},Qr=[`value`],$r={key:1,class:`zm-slider`},ei=[`value`],ti={class:`zm-settings-field zm-line-style-field`},ni={class:`zm-line-style-group`},ri=[`title`,`onClick`],ii={viewBox:`0 0 28 18`,width:`28`,height:`18`,preserveAspectRatio:`none`},ai={key:0,d:`M 8 9 L 0 9 M 20 9 L 28 9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},oi={key:1,d:`M 14 9 L 0 9 M 14 9 L 28 9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},si={key:2,d:`M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},ci={key:3,d:`M 11 6 L 8 0 M 8 8 L 0 7 M 8 11 L 0 14 M 17 6 L 20 0 M 20 8 L 28 7 M 20 11 L 28 14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},li={class:`zm-line-style-label`},ui={class:`zm-settings-field`},di={key:2,class:`zm-palette-picker`},fi={class:`zm-palette-list`},pi=[`onClick`],mi={class:`zm-palette-option-name`},hi={class:`zm-palette-option-swatches`},gi={key:0,class:`zm-palette-custom-editor`},_i=[`value`],vi={class:`zm-palette-custom-actions`},yi={class:`zm-settings-field`},bi={key:3,class:`zm-settings-field`},xi={class:`zm-settings-label`},Si={class:`zm-settings-sub`},Ci=[`value`],wi={key:4,class:`zm-slider`},Ti=[`value`],Ei={key:5,class:`zm-settings-field`},Di={class:`zm-settings-field`},Oi={class:`zm-settings-label`},ki={class:`zm-settings-sub`},Ai=[`value`],ji={class:`zm-slider`},Mi=[`value`],Ni={class:`zm-settings-field`},Pi={class:`zm-settings-preview`},Fi={viewBox:`0 0 200 70`,width:`100%`,height:`70`,preserveAspectRatio:`none`},Ii=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Li={key:0,class:`zm-settings-section`},Ri={class:`zm-settings-section-title`},zi={key:0,class:`zm-settings-section-sub`},Bi={class:`zm-settings-field`},Vi={class:`zm-settings-value-tag`},Hi={class:`zm-swatch-row`},Ui=[`title`,`onClick`],Wi={class:`zm-swatch zm-swatch--custom`,title:`自定义颜色`},Gi=[`value`],Ki={class:`zm-settings-field`},qi={class:`zm-settings-value-tag`},Ji={class:`zm-swatch-row`},Yi=[`title`,`onClick`],Xi={class:`zm-swatch zm-swatch--custom`,title:`自定义颜色`},Zi=[`value`],Qi={class:`zm-settings-field`},$i=[`value`],ea=[`value`],ta={class:`zm-settings-field`},na=[`value`],ra={class:`zm-slider`},ia=[`value`],aa={class:`zm-settings-section zm-settings-section--actions`};function oa(r,a,o,s,c,u){return e(),w(`div`,fr,[t(` ============================================================\r
|
|
89
89
|
CANVAS / GLOBAL settings\r
|
|
90
|
-
============================================================ `),
|
|
90
|
+
============================================================ `),l(`section`,pr,[a[52]||=l(`h4`,{class:`zm-settings-section-title`},`画布`,-1),t(` Canvas background color `),l(`div`,mr,[a[27]||=l(`span`,{class:`zm-settings-label`},`画布背景色`,-1),l(`div`,hr,[l(`label`,gr,[l(`input`,{type:`color`,class:`zm-color-input`,value:o.settings.canvasBg||`#f8fafc`,onInput:a[0]||=e=>s.set(`canvasBg`,e.target.value)},null,40,_r),l(`span`,vr,E(o.settings.canvasBg||`默认`),1)])])]),l(`div`,yr,[(e(),w(n,null,O(s.CANVAS_BG_PRESETS,e=>l(`button`,{key:`cbg-`+e,class:h([`zm-swatch`,{"is-active":(o.settings.canvasBg||`#f8fafc`)===e}]),style:d({background:e}),title:e,onClick:t=>s.set(`canvasBg`,e)},null,14,br)),64)),l(`button`,{class:`zm-swatch is-reset`,title:`恢复默认`,onClick:a[1]||=e=>s.set(`canvasBg`,void 0)},`∅`)]),a[53]||=l(`div`,{class:`zm-settings-divider`},null,-1),t(` Line width start (root) `),l(`div`,xr,[a[28]||=l(`span`,{class:`zm-settings-label`},`线条粗端 (根部)`,-1),l(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:o.settings.lineWidthStart,onChange:a[2]||=e=>s.set(`lineWidthStart`,parseFloat(e.target.value)||0)},null,40,Sr)]),l(`div`,Cr,[a[29]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`0.4`,max:`20`,step:`0.2`,value:o.settings.lineWidthStart,onInput:a[3]||=e=>s.set(`lineWidthStart`,parseFloat(e.target.value))},null,40,wr)]),t(` Line width end (leaf) `),l(`div`,Tr,[a[30]||=l(`span`,{class:`zm-settings-label`},`线条细端 (子端)`,-1),l(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:o.settings.lineWidthEnd,onChange:a[4]||=e=>s.set(`lineWidthEnd`,parseFloat(e.target.value)||0)},null,40,Er)]),l(`div`,Dr,[a[31]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`0.1`,max:`6`,step:`0.1`,value:o.settings.lineWidthEnd,onInput:a[5]||=e=>s.set(`lineWidthEnd`,parseFloat(e.target.value))},null,40,Or)]),a[54]||=l(`div`,{class:`zm-settings-divider`},null,-1),t(` Root line style `),l(`div`,kr,[a[32]||=l(`span`,{class:`zm-settings-label`},`根节点线条`,-1),l(`div`,Ar,[(e(!0),w(n,null,O(s.ROOT_LINE_STYLE_OPTIONS,t=>(e(),w(`button`,{key:t.value,class:h([`zm-line-style-btn`,{"is-on":o.settings.rootLineStyle===t.value}]),title:t.label,onClick:e=>s.set(`rootLineStyle`,t.value)},[(e(),w(`svg`,{viewBox:t.viewBox,width:`28`,height:`14`,preserveAspectRatio:`none`},[t.value===`arc`?(e(),w(`path`,Nr)):t.value===`rounded-elbow`?(e(),w(`path`,Pr)):t.value===`elbow`?(e(),w(`path`,Fr)):t.value===`curve`?(e(),w(`path`,Ir)):(e(),w(`line`,Lr))],8,Mr)),l(`span`,Rr,E(t.label),1)],10,jr))),128))])]),t(` Line style (other nodes) `),l(`div`,zr,[a[33]||=l(`span`,{class:`zm-settings-label`},`非根节点线条`,-1),l(`div`,Br,[(e(),w(n,null,O(s.LINE_STYLE_OPTIONS,t=>l(`button`,{key:t.value,class:h([`zm-line-style-btn`,{"is-on":o.settings.lineStyle===t.value}]),title:t.label,onClick:e=>s.set(`lineStyle`,t.value)},[(e(),w(`svg`,{viewBox:t.viewBox,width:`28`,height:`14`,preserveAspectRatio:`none`},[t.value===`arc`?(e(),w(`path`,Ur)):t.value===`rounded-elbow`?(e(),w(`path`,Wr)):t.value===`elbow`?(e(),w(`path`,Gr)):t.value===`curve`?(e(),w(`path`,Kr)):(e(),w(`line`,qr))],8,Hr)),l(`span`,Jr,E(t.label),1)],10,Vr)),64))])]),t(` Elbow corner radius (only when rounded-elbow is active) `),o.settings.lineStyle===`rounded-elbow`||o.settings.rootLineStyle===`rounded-elbow`?(e(),w(`div`,Yr,[l(`span`,Xr,[a[34]||=i(`圆角大小 `,-1),l(`span`,Zr,E(o.settings.elbowRadius)+`px`,1)]),l(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`2`,max:`40`,value:o.settings.elbowRadius,onChange:a[6]||=e=>s.set(`elbowRadius`,parseFloat(e.target.value)||20)},null,40,Qr)])):t(`v-if`,!0),o.settings.lineStyle===`rounded-elbow`||o.settings.rootLineStyle===`rounded-elbow`?(e(),w(`div`,$r,[a[35]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`2`,max:`40`,step:`1`,value:o.settings.elbowRadius,onInput:a[7]||=e=>s.set(`elbowRadius`,parseFloat(e.target.value))},null,40,ei)])):t(`v-if`,!0),t(` Line origin `),l(`div`,ti,[a[37]||=l(`span`,{class:`zm-settings-label`},`线条起点`,-1),l(`div`,ni,[(e(),w(n,null,O(s.LINE_ORIGIN_OPTIONS,n=>l(`button`,{key:n.value,class:h([`zm-line-style-btn`,{"is-on":o.settings.lineOrigin===n.value}]),title:n.label,onClick:e=>s.set(`lineOrigin`,n.value)},[(e(),w(`svg`,ii,[t(` Root node rectangle `),a[36]||=l(`rect`,{x:`8`,y:`6`,width:`12`,height:`6`,rx:`2`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,opacity:`0.5`},null,-1),n.value===`edge`?(e(),w(`path`,ai)):n.value===`center`?(e(),w(`path`,oi)):n.value===`proportional`?(e(),w(`path`,si)):(e(),w(`path`,ci))])),l(`span`,li,E(n.label),1)],10,ri)),64))])]),t(` Rainbow branches `),l(`div`,ui,[a[39]||=l(`span`,{class:`zm-settings-label`},`一级分支彩虹色`,-1),l(`button`,{class:h([`zm-toggle`,{"is-on":o.settings.rainbowBranch}]),onClick:a[8]||=e=>s.set(`rainbowBranch`,!o.settings.rainbowBranch)},[...a[38]||=[l(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),t(` Palette picker `),o.settings.rainbowBranch?(e(),w(`div`,di,[a[40]||=l(`div`,{class:`zm-settings-field`},[l(`span`,{class:`zm-settings-label`},`配色方案`)],-1),l(`div`,fi,[(e(!0),w(n,null,O(s.allPalettes,t=>(e(),w(`button`,{key:t.id,class:h([`zm-palette-option`,{"is-active":o.settings.branchPaletteId===t.id}]),onClick:e=>s.set(`branchPaletteId`,t.id)},[l(`span`,mi,E(t.name),1),l(`span`,hi,[(e(!0),w(n,null,O(t.colors,(t,n)=>(e(),w(`span`,{key:n,class:`zm-palette-option-swatch`,style:d({background:t})},null,4))),128))])],10,pi))),128))]),t(` Custom palette editor (only show when a custom palette is active) `),o.settings.customPalettes.find(e=>e.id===o.settings.branchPaletteId)?(e(),w(`div`,gi,[l(`textarea`,{class:`zm-palette-textarea`,rows:`3`,spellcheck:`false`,placeholder:`一行一个 hex,例如 #f87171`,value:s.draftFor(o.settings.customPalettes.find(e=>e.id===o.settings.branchPaletteId)),onInput:a[9]||=e=>s.customDrafts[o.settings.customPalettes.find(e=>e.id===o.settings.branchPaletteId).id]=e.target.value},null,40,_i),l(`div`,vi,[l(`button`,{type:`button`,class:`zm-data-btn is-primary`,onClick:a[10]||=e=>s.commitCustomPalette(o.settings.customPalettes.find(e=>e.id===o.settings.branchPaletteId))},`保存`),l(`button`,{type:`button`,class:`zm-data-btn`,onClick:a[11]||=e=>s.deleteCustomPalette(o.settings.customPalettes.find(e=>e.id===o.settings.branchPaletteId))},`删除`)])])):t(`v-if`,!0),l(`button`,{type:`button`,class:`zm-palette-add`,onClick:s.addCustomPalette},`+ 新建配色`)])):t(`v-if`,!0),a[55]||=l(`div`,{class:`zm-settings-divider`},null,-1),t(` Tapered edge `),l(`div`,yi,[a[42]||=l(`span`,{class:`zm-settings-label`},`每条连线独立渐变`,-1),l(`button`,{class:h([`zm-toggle`,{"is-on":o.settings.taperedEdge}]),onClick:a[12]||=e=>s.set(`taperedEdge`,!o.settings.taperedEdge)},[...a[41]||=[l(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),t(` Line width taper ratio (only relevant in tapered mode) `),o.settings.taperedEdge?(e(),w(`div`,bi,[l(`span`,xi,[a[43]||=i(`层级衰减 `,-1),l(`span`,Si,E(Math.round(o.settings.lineWidthTaper*100))+`%`,1)]),l(`input`,{class:`zm-settings-number`,type:`number`,step:`0.05`,min:`0.1`,max:`1`,value:o.settings.lineWidthTaper,onChange:a[13]||=e=>s.set(`lineWidthTaper`,parseFloat(e.target.value)||.67)},null,40,Ci)])):t(`v-if`,!0),o.settings.taperedEdge?(e(),w(`div`,wi,[a[44]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`0.1`,max:`1`,step:`0.01`,value:o.settings.lineWidthTaper,onInput:a[14]||=e=>s.set(`lineWidthTaper`,parseFloat(e.target.value))},null,40,Ti)])):t(`v-if`,!0),t(` Uniform non-root line width (only relevant in tapered mode) `),o.settings.taperedEdge?(e(),w(`div`,Ei,[a[46]||=l(`span`,{class:`zm-settings-label`},`非根节点相同粗细`,-1),l(`button`,{class:h([`zm-toggle`,{"is-on":o.settings.uniformLineWidth}]),onClick:a[15]||=e=>s.set(`uniformLineWidth`,!o.settings.uniformLineWidth)},[...a[45]||=[l(`span`,{class:`zm-toggle-knob`},null,-1)]],2)])):t(`v-if`,!0),t(` Branch gap (extra spacing between first-level branches) `),l(`div`,Di,[l(`span`,Oi,[a[47]||=i(`一级分支间距 `,-1),l(`span`,ki,E(o.settings.branchGap)+`px`,1)]),l(`input`,{class:`zm-settings-number`,type:`number`,step:`2`,min:`0`,max:`80`,value:o.settings.branchGap,onChange:a[16]||=e=>s.set(`branchGap`,parseFloat(e.target.value)||0)},null,40,Ai)]),l(`div`,ji,[a[48]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`0`,max:`80`,step:`2`,value:o.settings.branchGap,onInput:a[17]||=e=>s.set(`branchGap`,parseFloat(e.target.value))},null,40,Mi)]),t(` Order badge `),l(`div`,Ni,[a[50]||=l(`span`,{class:`zm-settings-label`},`显示节点序号`,-1),l(`button`,{class:h([`zm-toggle`,{"is-on":o.settings.showOrderBadge}]),onClick:a[18]||=e=>s.set(`showOrderBadge`,!o.settings.showOrderBadge)},[...a[49]||=[l(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),t(` Preview `),l(`div`,Pi,[(e(),w(`svg`,Fi,[(e(!0),w(n,null,O(s.previewLines,(t,n)=>(e(),w(`line`,{key:n,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:o.settings.rainbowBranch?t.color:`#94a3b8`,"stroke-width":t.w,"stroke-linecap":`butt`},null,8,Ii))),128))])),a[51]||=l(`div`,{class:`zm-settings-preview-labels`},[l(`span`,null,`根`),l(`span`,null,`1级`),l(`span`,null,`2级`),l(`span`,null,`3级`)],-1)])]),t(` ============================================================\r
|
|
91
91
|
NODE-LEVEL overrides — only when a node is selected.\r
|
|
92
92
|
Immediate-apply: every control emits on change.\r
|
|
93
|
-
============================================================ `),i.hasSelection?(d(),e(`section`,Li,[t(`h4`,Ri,[r[56]||=u(` 节点 `,-1),i.selectedNodeText?(d(),e(`span`,zi,`"`+E(i.selectedNodeText)+`"`,1)):b(`v-if`,!0)]),b(` Background color `),t(`div`,Bi,[r[57]||=t(`span`,{class:`zm-settings-label`},`背景颜色`,-1),t(`span`,Vi,E(i.nodeStyle?.bg||`默认`),1)]),t(`div`,Hi,[(d(),e(f,null,y(a.PALETTE,e=>t(`button`,{key:`bg-`+e,class:h([`zm-swatch`,{"is-active":i.nodeStyle?.bg===e}]),style:g({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({bg:e})},null,14,Ui)),64)),t(`label`,Wi,[t(`input`,{type:`color`,value:i.nodeStyle?.bg||`#ffffff`,onInput:r[19]||=e=>a.applyNodeStyleDelta({bg:e.target.value})},null,40,Gi)]),t(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:r[20]||=e=>a.applyNodeStyleDelta({bg:void 0})},`∅`)]),b(` Text color `),t(`div`,Ki,[r[58]||=t(`span`,{class:`zm-settings-label`},`文字颜色`,-1),t(`span`,qi,E(i.nodeStyle?.textColor||`默认`),1)]),t(`div`,Ji,[(d(),e(f,null,y(a.PALETTE,e=>t(`button`,{key:`fg-`+e,class:h([`zm-swatch`,{"is-active":i.nodeStyle?.textColor===e}]),style:g({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({textColor:e})},null,14,Yi)),64)),t(`label`,Xi,[t(`input`,{type:`color`,value:i.nodeStyle?.textColor||`#1e2937`,onInput:r[21]||=e=>a.applyNodeStyleDelta({textColor:e.target.value})},null,40,Zi)]),t(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:r[22]||=e=>a.applyNodeStyleDelta({textColor:void 0})},`∅`)]),r[62]||=t(`div`,{class:`zm-settings-divider`},null,-1),b(` Font weight `),t(`div`,Qi,[r[59]||=t(`span`,{class:`zm-settings-label`},`字重`,-1),t(`select`,{class:`zm-select`,value:i.nodeStyle?.fontWeight??400,onChange:r[23]||=e=>a.applyNodeStyleDelta({fontWeight:parseInt(e.target.value)})},[(d(),e(f,null,y(a.FONT_WEIGHT_OPTIONS,e=>t(`option`,{key:e.value,value:e.value},E(e.label),9,ea)),64))],40,$i)]),b(` Font size `),t(`div`,ta,[r[60]||=t(`span`,{class:`zm-settings-label`},`文字大小`,-1),t(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`8`,max:`48`,value:i.nodeStyle?.fontSize??14,onChange:r[24]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)||14})},null,40,na)]),t(`div`,ra,[r[61]||=t(`div`,{class:`zm-slider-track`},null,-1),t(`input`,{type:`range`,min:`8`,max:`48`,step:`1`,value:i.nodeStyle?.fontSize??14,onInput:r[25]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)})},null,40,ia)]),r[63]||=t(`p`,{class:`zm-settings-hint`},`仅作用于当前节点,不影响子节点。`,-1)])):b(`v-if`,!0),t(`section`,aa,[t(`button`,{class:`zm-settings-reset`,onClick:r[26]||=e=>a.emit(`reset`)},`恢复默认设置`)])])}var sa=F(dr,[[`render`,oa],[`__scopeId`,`data-v-89c2361e`],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/SettingsPanel.vue`]]),ca=20;function la(e,t){e.style.height=`auto`;let n=t.minRows*ca,r=t.maxRows>0?t.maxRows*ca:1/0,i=Math.max(n,Math.min(r,e.scrollHeight));e.style.height=i+`px`,e.style.overflowY=e.scrollHeight>r?`auto`:`hidden`}function ua(e,t={}){let n={minRows:t.minRows??3,maxRows:t.maxRows??12};function r(){let t=e.value;t&&la(t,n)}function a(){r()}m(async()=>{await i();let t=e.value;t&&(t.addEventListener(`input`,a),r())}),T(()=>e.value?.value,()=>r()),o(()=>{let t=e.value;t&&t.removeEventListener(`input`,a)})}function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function fa(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)&&fa(n)}),e}var pa=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function ma(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function ha(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 ga=`</span>`,_a=e=>!!e.scope,va=(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}`},ya=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=ma(e)}openNode(e){if(!_a(e))return;let t=va(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){_a(e)&&(this.buffer+=ga)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ba=(e={})=>{let t={children:[]};return Object.assign(t,e),t},xa=class e{constructor(){this.rootNode=ba(),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=ba({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)}))}},Sa=class extends xa{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 ya(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ca(e){return e?typeof e==`string`?e:e.source:null}function wa(e){return Da(`(?=`,e,`)`)}function Ta(e){return Da(`(?:`,e,`)*`)}function Ea(e){return Da(`(?:`,e,`)?`)}function Da(...e){return e.map(e=>Ca(e)).join(``)}function Oa(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ka(...e){return`(`+(Oa(e).capture?``:`?:`)+e.map(e=>Ca(e)).join(`|`)+`)`}function Aa(e){return RegExp(e.toString()+`|`).exec(``).length-1}function ja(e,t){let n=e&&e.exec(t);return n&&n.index===0}var Ma=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Na(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=Ca(e),i=``;for(;r.length>0;){let e=Ma.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 Pa=/\b\B/,Fa=`[a-zA-Z]\\w*`,Ia=`[a-zA-Z_]\\w*`,La=`\\b\\d+(\\.\\d+)?`,Ra=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,za=`\\b(0b[01]+)`,Ba=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Va=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Da(t,/.*\b/,e.binary,/\b.*/)),ha({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},Ha={begin:`\\\\[\\s\\S]`,relevance:0},Ua={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[Ha]},Wa={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[Ha]},Ga={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/},Ka=function(e,t,n={}){let r=ha({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=ka(`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:Da(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},qa=Ka(`//`,`$`),Ja=Ka(`/\\*`,`\\*/`),Ya=Ka(`#`,`$`),Xa={scope:`number`,begin:La,relevance:0},Za={scope:`number`,begin:Ra,relevance:0},Qa={scope:`number`,begin:za,relevance:0},$a={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ha,{begin:/\[/,end:/\]/,relevance:0,contains:[Ha]}]},eo={scope:`title`,begin:Fa,relevance:0},to={scope:`title`,begin:Ia,relevance:0},no={begin:`\\.\\s*`+Ia,relevance:0},ro=Object.freeze({__proto__:null,APOS_STRING_MODE:Ua,BACKSLASH_ESCAPE:Ha,BINARY_NUMBER_MODE:Qa,BINARY_NUMBER_RE:za,COMMENT:Ka,C_BLOCK_COMMENT_MODE:Ja,C_LINE_COMMENT_MODE:qa,C_NUMBER_MODE:Za,C_NUMBER_RE:Ra,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:Ya,IDENT_RE:Fa,MATCH_NOTHING_RE:Pa,METHOD_GUARD:no,NUMBER_MODE:Xa,NUMBER_RE:La,PHRASAL_WORDS_MODE:Ga,QUOTE_STRING_MODE:Wa,REGEXP_MODE:$a,RE_STARTERS_RE:Ba,SHEBANG:Va,TITLE_MODE:eo,UNDERSCORE_IDENT_RE:Ia,UNDERSCORE_TITLE_MODE:to});function io(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ao(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function oo(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=io,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function so(e,t){Array.isArray(e.illegal)&&(e.illegal=ka(...e.illegal))}function co(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 lo(e,t){e.relevance===void 0&&(e.relevance=1)}var uo=(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=Da(n.beforeMatch,wa(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},fo=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],po=`keyword`;function mo(e,t,n=po){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,mo(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,ho(n[0],n[1])]})}}function ho(e,t){return t?Number(t):+!go(e)}function go(e){return fo.includes(e.toLowerCase())}var _o={},vo=e=>{console.error(e)},yo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},bo=(e,t)=>{_o[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),_o[`${e}/${t}`]=!0)},xo=Error();function So(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+=Aa(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Co(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw vo(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),xo;if(typeof e.beginScope!=`object`||e.beginScope===null)throw vo(`beginScope must be object`),xo;So(e,e.begin,{key:`beginScope`}),e.begin=Na(e.begin,{joinWith:``})}}function wo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw vo(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),xo;if(typeof e.endScope!=`object`||e.endScope===null)throw vo(`endScope must be object`),xo;So(e,e.end,{key:`endScope`}),e.end=Na(e.end,{joinWith:``})}}function To(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Eo(e){To(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Co(e),wo(e)}function Do(e){function t(t,n){return new RegExp(Ca(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+=Aa(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(Na(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;[ao,co,Eo,uo].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[oo,so,lo].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&&=mo(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=Ca(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 ko(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=ha(e.classNameAliases||{}),a(e)}function Oo(e){return e?e.endsWithParent||Oo(e.starts):!1}function ko(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ha(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Oo(e)?ha(e,{starts:e.starts?ha(e.starts):null}):Object.isFrozen(e)?ha(e):e}var Ao=`11.11.1`,jo=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Mo=ma,No=ha,Po=Symbol(`nomatch`),Fo=7,Io=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:Sa};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||(yo(a.replace(`{}`,n[1])),yo(`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):(bo(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),bo(`10.7.0`,`Please use highlight(code, options) instead.
|
|
93
|
+
============================================================ `),o.hasSelection?(e(),w(`section`,Li,[l(`h4`,Ri,[a[56]||=i(` 节点 `,-1),o.selectedNodeText?(e(),w(`span`,zi,`"`+E(o.selectedNodeText)+`"`,1)):t(`v-if`,!0)]),t(` Background color `),l(`div`,Bi,[a[57]||=l(`span`,{class:`zm-settings-label`},`背景颜色`,-1),l(`span`,Vi,E(o.nodeStyle?.bg||`默认`),1)]),l(`div`,Hi,[(e(),w(n,null,O(s.PALETTE,e=>l(`button`,{key:`bg-`+e,class:h([`zm-swatch`,{"is-active":o.nodeStyle?.bg===e}]),style:d({background:e}),title:e,onClick:t=>s.applyNodeStyleDelta({bg:e})},null,14,Ui)),64)),l(`label`,Wi,[l(`input`,{type:`color`,value:o.nodeStyle?.bg||`#ffffff`,onInput:a[19]||=e=>s.applyNodeStyleDelta({bg:e.target.value})},null,40,Gi)]),l(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:a[20]||=e=>s.applyNodeStyleDelta({bg:void 0})},`∅`)]),t(` Text color `),l(`div`,Ki,[a[58]||=l(`span`,{class:`zm-settings-label`},`文字颜色`,-1),l(`span`,qi,E(o.nodeStyle?.textColor||`默认`),1)]),l(`div`,Ji,[(e(),w(n,null,O(s.PALETTE,e=>l(`button`,{key:`fg-`+e,class:h([`zm-swatch`,{"is-active":o.nodeStyle?.textColor===e}]),style:d({background:e}),title:e,onClick:t=>s.applyNodeStyleDelta({textColor:e})},null,14,Yi)),64)),l(`label`,Xi,[l(`input`,{type:`color`,value:o.nodeStyle?.textColor||`#1e2937`,onInput:a[21]||=e=>s.applyNodeStyleDelta({textColor:e.target.value})},null,40,Zi)]),l(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:a[22]||=e=>s.applyNodeStyleDelta({textColor:void 0})},`∅`)]),a[62]||=l(`div`,{class:`zm-settings-divider`},null,-1),t(` Font weight `),l(`div`,Qi,[a[59]||=l(`span`,{class:`zm-settings-label`},`字重`,-1),l(`select`,{class:`zm-select`,value:o.nodeStyle?.fontWeight??400,onChange:a[23]||=e=>s.applyNodeStyleDelta({fontWeight:parseInt(e.target.value)})},[(e(),w(n,null,O(s.FONT_WEIGHT_OPTIONS,e=>l(`option`,{key:e.value,value:e.value},E(e.label),9,ea)),64))],40,$i)]),t(` Font size `),l(`div`,ta,[a[60]||=l(`span`,{class:`zm-settings-label`},`文字大小`,-1),l(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`8`,max:`48`,value:o.nodeStyle?.fontSize??14,onChange:a[24]||=e=>s.applyNodeStyleDelta({fontSize:parseInt(e.target.value)||14})},null,40,na)]),l(`div`,ra,[a[61]||=l(`div`,{class:`zm-slider-track`},null,-1),l(`input`,{type:`range`,min:`8`,max:`48`,step:`1`,value:o.nodeStyle?.fontSize??14,onInput:a[25]||=e=>s.applyNodeStyleDelta({fontSize:parseInt(e.target.value)})},null,40,ia)]),a[63]||=l(`p`,{class:`zm-settings-hint`},`仅作用于当前节点,不影响子节点。`,-1)])):t(`v-if`,!0),l(`section`,aa,[l(`button`,{class:`zm-settings-reset`,onClick:a[26]||=e=>s.emit(`reset`)},`恢复默认设置`)])])}var sa=F(dr,[[`render`,oa],[`__scopeId`,`data-v-89c2361e`],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/SettingsPanel.vue`]]),ca=20;function la(e,t){e.style.height=`auto`;let n=t.minRows*ca,r=t.maxRows>0?t.maxRows*ca:1/0,i=Math.max(n,Math.min(r,e.scrollHeight));e.style.height=i+`px`,e.style.overflowY=e.scrollHeight>r?`auto`:`hidden`}function ua(e,t={}){let n={minRows:t.minRows??3,maxRows:t.maxRows??12};function r(){let t=e.value;t&&la(t,n)}function i(){r()}_(async()=>{await s();let t=e.value;t&&(t.addEventListener(`input`,i),r())}),b(()=>e.value?.value,()=>r()),g(()=>{let t=e.value;t&&t.removeEventListener(`input`,i)})}function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function fa(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)&&fa(n)}),e}var pa=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function ma(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function ha(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 ga=`</span>`,_a=e=>!!e.scope,va=(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}`},ya=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=ma(e)}openNode(e){if(!_a(e))return;let t=va(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){_a(e)&&(this.buffer+=ga)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ba=(e={})=>{let t={children:[]};return Object.assign(t,e),t},xa=class e{constructor(){this.rootNode=ba(),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=ba({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)}))}},Sa=class extends xa{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 ya(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ca(e){return e?typeof e==`string`?e:e.source:null}function wa(e){return Da(`(?=`,e,`)`)}function Ta(e){return Da(`(?:`,e,`)*`)}function Ea(e){return Da(`(?:`,e,`)?`)}function Da(...e){return e.map(e=>Ca(e)).join(``)}function Oa(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ka(...e){return`(`+(Oa(e).capture?``:`?:`)+e.map(e=>Ca(e)).join(`|`)+`)`}function Aa(e){return RegExp(e.toString()+`|`).exec(``).length-1}function ja(e,t){let n=e&&e.exec(t);return n&&n.index===0}var Ma=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Na(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=Ca(e),i=``;for(;r.length>0;){let e=Ma.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 Pa=/\b\B/,Fa=`[a-zA-Z]\\w*`,Ia=`[a-zA-Z_]\\w*`,La=`\\b\\d+(\\.\\d+)?`,Ra=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,za=`\\b(0b[01]+)`,Ba=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Va=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Da(t,/.*\b/,e.binary,/\b.*/)),ha({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},Ha={begin:`\\\\[\\s\\S]`,relevance:0},Ua={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[Ha]},Wa={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[Ha]},Ga={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/},Ka=function(e,t,n={}){let r=ha({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=ka(`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:Da(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},qa=Ka(`//`,`$`),Ja=Ka(`/\\*`,`\\*/`),Ya=Ka(`#`,`$`),Xa={scope:`number`,begin:La,relevance:0},Za={scope:`number`,begin:Ra,relevance:0},Qa={scope:`number`,begin:za,relevance:0},$a={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ha,{begin:/\[/,end:/\]/,relevance:0,contains:[Ha]}]},eo={scope:`title`,begin:Fa,relevance:0},to={scope:`title`,begin:Ia,relevance:0},no={begin:`\\.\\s*`+Ia,relevance:0},ro=Object.freeze({__proto__:null,APOS_STRING_MODE:Ua,BACKSLASH_ESCAPE:Ha,BINARY_NUMBER_MODE:Qa,BINARY_NUMBER_RE:za,COMMENT:Ka,C_BLOCK_COMMENT_MODE:Ja,C_LINE_COMMENT_MODE:qa,C_NUMBER_MODE:Za,C_NUMBER_RE:Ra,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:Ya,IDENT_RE:Fa,MATCH_NOTHING_RE:Pa,METHOD_GUARD:no,NUMBER_MODE:Xa,NUMBER_RE:La,PHRASAL_WORDS_MODE:Ga,QUOTE_STRING_MODE:Wa,REGEXP_MODE:$a,RE_STARTERS_RE:Ba,SHEBANG:Va,TITLE_MODE:eo,UNDERSCORE_IDENT_RE:Ia,UNDERSCORE_TITLE_MODE:to});function io(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ao(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function oo(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=io,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function so(e,t){Array.isArray(e.illegal)&&(e.illegal=ka(...e.illegal))}function co(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 lo(e,t){e.relevance===void 0&&(e.relevance=1)}var uo=(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=Da(n.beforeMatch,wa(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},fo=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],po=`keyword`;function mo(e,t,n=po){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,mo(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,ho(n[0],n[1])]})}}function ho(e,t){return t?Number(t):+!go(e)}function go(e){return fo.includes(e.toLowerCase())}var _o={},vo=e=>{console.error(e)},yo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},bo=(e,t)=>{_o[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),_o[`${e}/${t}`]=!0)},xo=Error();function So(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+=Aa(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Co(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw vo(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),xo;if(typeof e.beginScope!=`object`||e.beginScope===null)throw vo(`beginScope must be object`),xo;So(e,e.begin,{key:`beginScope`}),e.begin=Na(e.begin,{joinWith:``})}}function wo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw vo(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),xo;if(typeof e.endScope!=`object`||e.endScope===null)throw vo(`endScope must be object`),xo;So(e,e.end,{key:`endScope`}),e.end=Na(e.end,{joinWith:``})}}function To(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Eo(e){To(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Co(e),wo(e)}function Do(e){function t(t,n){return new RegExp(Ca(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+=Aa(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(Na(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;[ao,co,Eo,uo].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[oo,so,lo].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&&=mo(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=Ca(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 ko(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=ha(e.classNameAliases||{}),a(e)}function Oo(e){return e?e.endsWithParent||Oo(e.starts):!1}function ko(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ha(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Oo(e)?ha(e,{starts:e.starts?ha(e.starts):null}):Object.isFrozen(e)?ha(e):e}var Ao=`11.11.1`,jo=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Mo=ma,No=ha,Po=Symbol(`nomatch`),Fo=7,Io=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:Sa};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||(yo(a.replace(`{}`,n[1])),yo(`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):(bo(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),bo(`10.7.0`,`Please use highlight(code, options) instead.
|
|
94
94
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};k(`before:highlight`,a);let o=a.result?a.result:d(a.language,a.code,n);return o.code=a.code,k(`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(!O.keywords){A.addText(j);return}let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(j),n=``;for(;t;){n+=j.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=l(O,r);if(i){let[e,a]=i;if(A.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Fo&&(M+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(j)}n+=j.substring(e),A.addText(n)}function f(){if(j===``)return;let e=null;if(typeof O.subLanguage==`string`){if(!t[O.subLanguage]){A.addText(j);return}e=d(O.subLanguage,j,!0,k[O.subLanguage]),k[O.subLanguage]=e._top}else e=p(j,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(M+=e.relevance),A.__addSublanguage(e._emitter,e.language)}function m(){O.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=``)),O=Object.create(e,{parent:{value:O}}),O}function v(e,t,n){let r=ja(e.endRe,n);if(r){if(e[`on:end`]){let n=new pa(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 O.matcher.regexIndex===0?(j+=e[0],1):(P=!0,0)}function b(e){let t=e[0],n=e.rule,r=new pa(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(O,e,r);if(!i)return Po;let a=O;O.endScope&&O.endScope._wrap?(m(),h(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(m(),g(O.endScope,e)):a.skip?j+=t:(a.returnEnd||a.excludeEnd||(j+=t),m(),a.excludeEnd&&(j=t));do O.scope&&A.closeNode(),!O.skip&&!O.subLanguage&&(M+=O.relevance),O=O.parent;while(O!==i.parent);return i.starts&&_(i.starts,e),a.returnEnd?0:t.length}function S(){let e=[];for(let t=O;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 "`+(O.scope||`<unnamed>`)+`"`);throw e.mode=O,e}if(a.type===`end`){let e=x(a);if(e!==Po)return e}if(a.type===`illegal`&&o===``)return j+=`
|
|
95
|
-
`,1;if(te>1e5&&te>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 vo(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let ee=Do(E),D=``,O=o||ee,k={},A=new s.__emitter(s);S();let j=``,M=0,N=0,te=0,P=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(O.matcher.considerAll();;){te++,P?P=!1:O.matcher.considerAll(),O.matcher.lastIndex=N;let e=O.matcher.exec(n);if(!e)break;let t=T(n.substring(N,e.index),e);N=e.index+t}T(n.substring(N))}return A.finalize(),D=A.toHTML(),{language:e,value:D,relevance:M,illegal:!1,_emitter:A,_top:O}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Mo(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:D},_emitter:A};if(i)return{language:e,value:Mo(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:O};throw t}}function f(e){let t={value:Mo(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(k(`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 jo(`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}),k(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=No(s,e)}let _=()=>{b(),bo(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),bo(`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(vo(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)vo(e);else throw e;a=o}a.name||(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 ee(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 D(e){ee(e),r.push(e)}function O(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function k(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function A(e){return bo(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),bo(`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:No,addPlugin:D,removePlugin:O}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Ao,e.regex={concat:Da,lookahead:wa,either:ka,optional:Ea,anyNumberOfTimes:Ta};for(let e in ro)typeof ro[e]==`object`&&fa(ro[e]);return Object.assign(e,ro),e},Lo=Io({});Lo.newInstance=()=>Io({});var Ro=Lo;Lo.HighlightJS=Lo,Lo.default=Lo;var zo=da(Ro);function Bo(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 Vo=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_-]*/}}),Ho=`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(`.`),Uo=`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(`.`),Wo=[...Ho,...Uo],Go=`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(),Ko=`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(),qo=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Jo=`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 Yo(e){let t=e.regex,n=Vo(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:`:(`+Ko.join(`|`)+`)`},{begin:`:(:)?(`+qo.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Jo.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:Go.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Wo.join(`|`)+`)\\b`}]}}function Xo(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 Zo=`[0-9](_*[0-9])*`,Qo=`\\.(${Zo})`,$o=`[0-9a-fA-F](_*[0-9a-fA-F])*`,es={className:`number`,variants:[{begin:`(\\b(${Zo})((${Qo})|\\.)?|(${Qo}))[eE][+-]?(${Zo})[fFdD]?\\b`},{begin:`\\b(${Zo})((${Qo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Qo})[fFdD]?\\b`},{begin:`\\b(${Zo})[fFdD]\\b`},{begin:`\\b0[xX]((${$o})\\.?|(${$o})?\\.(${$o}))[pP][+-]?(${Zo})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${$o})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function ts(e,t,n){return n===-1?``:e.replace(t,r=>ts(e,t,n-1))}function ns(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+ts(`(?:<`+n+`~~~(?:\\s*,\\s*`+n+`~~~)*>)?`,/~~~/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:`@`+n,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,es,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},es,a]}}var rs=`[A-Za-z$_][0-9A-Za-z$_]*`,is=`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(`.`),as=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],os=`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(`.`),ss=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],cs=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],ls=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],us=[].concat(cs,os,ss);function ds(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=rs,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:rs,keyword:is,literal:as,built_in:us,"variable.language":ls},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:r+`(?=\\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:{_:[...os,...ss]}},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 ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,ee([...cs,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={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},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,E,S,k,{match:/\$[(.]/}]}}function fs(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 ps(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 ms(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 hs(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=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`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(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`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(`.`),u=[`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:u,keyword:s,literal:c,built_in:l},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_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],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:l,type:u}},{className:`punctuation`,begin:`->`},a]}}function gs(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 _s=`[A-Za-z$_][0-9A-Za-z$_]*`,vs=`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(`.`),ys=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],bs=`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(`.`),xs=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],ws=[].concat(Ss,bs,xs);function Ts(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=_s,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:_s,keyword:vs,literal:ys,built_in:ws,"variable.language":Cs},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:r+`(?=\\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:{_:[...bs,...xs]}},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 ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,ee([...Ss,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={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},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,E,S,k,{match:/\$[(.]/}]}}function Es(e){let t=e.regex,n=Ts(e),r=_s,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:_s,keyword:vs.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:ys,built_in:ws.concat(i),"variable.language":Cs},l={className:`meta`,begin:`@`+r},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 Ds(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 Os(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={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`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{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+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{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}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var ks={bash:Bo,sh:Bo,shell:Bo,css:Yo,go:Xo,golang:Xo,java:ns,javascript:ds,js:ds,json:fs,markdown:ps,md:ps,python:ms,py:ms,rust:hs,rs:hs,sql:gs,typescript:Es,ts:Es,xml:Ds,html:Ds,yaml:Os,yml:Os};for(let[e,t]of Object.entries(ks))zo.registerLanguage(e,t);function As(e){let t=e.split(`
|
|
95
|
+
`,1;if(te>1e5&&te>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 vo(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=Do(E),ee=``,O=o||D,k={},A=new s.__emitter(s);S();let j=``,M=0,N=0,te=0,P=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(O.matcher.considerAll();;){te++,P?P=!1:O.matcher.considerAll(),O.matcher.lastIndex=N;let e=O.matcher.exec(n);if(!e)break;let t=T(n.substring(N,e.index),e);N=e.index+t}T(n.substring(N))}return A.finalize(),ee=A.toHTML(),{language:e,value:ee,relevance:M,illegal:!1,_emitter:A,_top:O}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Mo(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:ee},_emitter:A};if(i)return{language:e,value:Mo(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:O};throw t}}function f(e){let t={value:Mo(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(k(`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 jo(`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}),k(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=No(s,e)}let _=()=>{b(),bo(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),bo(`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(vo(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)vo(e);else throw e;a=o}a.name||(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 ee(e){D(e),r.push(e)}function O(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function k(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function A(e){return bo(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),bo(`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:No,addPlugin:ee,removePlugin:O}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Ao,e.regex={concat:Da,lookahead:wa,either:ka,optional:Ea,anyNumberOfTimes:Ta};for(let e in ro)typeof ro[e]==`object`&&fa(ro[e]);return Object.assign(e,ro),e},Lo=Io({});Lo.newInstance=()=>Io({});var Ro=Lo;Lo.HighlightJS=Lo,Lo.default=Lo;var zo=da(Ro);function Bo(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 Vo=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_-]*/}}),Ho=`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(`.`),Uo=`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(`.`),Wo=[...Ho,...Uo],Go=`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(),Ko=`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(),qo=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Jo=`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 Yo(e){let t=e.regex,n=Vo(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:`:(`+Ko.join(`|`)+`)`},{begin:`:(:)?(`+qo.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Jo.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:Go.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Wo.join(`|`)+`)\\b`}]}}function Xo(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 Zo=`[0-9](_*[0-9])*`,Qo=`\\.(${Zo})`,$o=`[0-9a-fA-F](_*[0-9a-fA-F])*`,es={className:`number`,variants:[{begin:`(\\b(${Zo})((${Qo})|\\.)?|(${Qo}))[eE][+-]?(${Zo})[fFdD]?\\b`},{begin:`\\b(${Zo})((${Qo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Qo})[fFdD]?\\b`},{begin:`\\b(${Zo})[fFdD]\\b`},{begin:`\\b0[xX]((${$o})\\.?|(${$o})?\\.(${$o}))[pP][+-]?(${Zo})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${$o})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function ts(e,t,n){return n===-1?``:e.replace(t,r=>ts(e,t,n-1))}function ns(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+ts(`(?:<`+n+`~~~(?:\\s*,\\s*`+n+`~~~)*>)?`,/~~~/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:`@`+n,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,es,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},es,a]}}var rs=`[A-Za-z$_][0-9A-Za-z$_]*`,is=`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(`.`),as=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],os=`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(`.`),ss=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],cs=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],ls=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],us=[].concat(cs,os,ss);function ds(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=rs,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:rs,keyword:is,literal:as,built_in:us,"variable.language":ls},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:r+`(?=\\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:{_:[...os,...ss]}},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 ee={match:t.concat(/\b/,D([...cs,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={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},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ee,E,S,k,{match:/\$[(.]/}]}}function fs(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 ps(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 ms(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 hs(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=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`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(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`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(`.`),u=[`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:u,keyword:s,literal:c,built_in:l},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_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],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:l,type:u}},{className:`punctuation`,begin:`->`},a]}}function gs(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 _s=`[A-Za-z$_][0-9A-Za-z$_]*`,vs=`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(`.`),ys=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],bs=`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(`.`),xs=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],ws=[].concat(Ss,bs,xs);function Ts(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=_s,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:_s,keyword:vs,literal:ys,built_in:ws,"variable.language":Cs},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:r+`(?=\\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:{_:[...bs,...xs]}},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 ee={match:t.concat(/\b/,D([...Ss,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={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},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ee,E,S,k,{match:/\$[(.]/}]}}function Es(e){let t=e.regex,n=Ts(e),r=_s,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:_s,keyword:vs.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:ys,built_in:ws.concat(i),"variable.language":Cs},l={className:`meta`,begin:`@`+r},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 Ds(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 Os(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={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`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{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+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{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}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var ks={bash:Bo,sh:Bo,shell:Bo,css:Yo,go:Xo,golang:Xo,java:ns,javascript:ds,js:ds,json:fs,markdown:ps,md:ps,python:ms,py:ms,rust:hs,rs:hs,sql:gs,typescript:Es,ts:Es,xml:Ds,html:Ds,yaml:Os,yml:Os};for(let[e,t]of Object.entries(ks))zo.registerLanguage(e,t);function As(e){let t=e.split(`
|
|
96
96
|
`);return/^(`{3,}|~{3,})/.test(t[0]??``)&&t.shift(),/^(`{3,}|~{3,})\s*$/.test(t[t.length-1]??``)&&t.pop(),t.join(`
|
|
97
97
|
`).replace(/\n+$/,``)}function js(e){let t=(/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
|
|
98
98
|
`)[0]??``)?.[2]??``).toLowerCase();return t&&ks[t]?t:``}function Ms(e,t){let n=t&&ks[t]?t:``;try{return n?zo.highlight(e,{language:n,ignoreIllegals:!0}).value:zo.highlightAuto(e).value}catch{return Ps(e)}}function Ns(e){return e.split(`
|
|
@@ -160,45 +160,45 @@ ${e}</tr>
|
|
|
160
160
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
161
161
|
`}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>${Yc(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=Xc(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Yc(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=Xc(e);if(i===null)return Yc(n);e=i;let a=`<img src="${e}" alt="${Yc(n)}"`;return t&&(a+=` title="${Yc(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Yc(e.text)}},sl=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}},cl=class e{constructor(e){P(this,`options`),P(this,`renderer`),P(this,`textRenderer`),this.options=e||Is,this.options.renderer=this.options.renderer||new ol,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sl}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}},ll=class{constructor(e){P(this,`options`),P(this,`block`),this.options=e||Is}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?al.lex:al.lexInline}provideParser(e=this.block){return e?cl.parse:cl.parseInline}},ul=(P(ll,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),P(ll,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),ll),dl=class{constructor(...e){P(this,`defaults`,Fs()),P(this,`options`,this.setOptions),P(this,`parse`,this.parseMarkdown(!0)),P(this,`parseInline`,this.parseMarkdown(!1)),P(this,`Parser`,cl),P(this,`Renderer`,ol),P(this,`TextRenderer`,sl),P(this,`Lexer`,al),P(this,`Tokenizer`,il),P(this,`Hooks`,ul),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 ol(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 il(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 ul;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ul.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ul.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return al.lex(e,t??this.defaults)}parser(e,t){return cl.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?al.lex:al.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?cl.parse:cl.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?al.lex:al.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?cl.parse:cl.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+=`
|
|
162
162
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Yc(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},fl=new dl;function X(e,t){return fl.parse(e,t)}X.options=X.setOptions=function(e){return fl.setOptions(e),X.defaults=fl.defaults,Ls(X.defaults),X},X.getDefaults=Fs,X.defaults=Is,X.use=function(...e){return fl.use(...e),X.defaults=fl.defaults,Ls(X.defaults),X},X.walkTokens=function(e,t){return fl.walkTokens(e,t)},X.parseInline=fl.parseInline,X.Parser=cl,X.parser=cl.parse,X.Renderer=ol,X.TextRenderer=sl,X.Lexer=al,X.lexer=al.lex,X.Tokenizer=il,X.Hooks=ul,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,cl.parse,al.lex;function pl(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 ml(e){if(Array.isArray(e))return e}function hl(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 gl(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
163
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _l(e,t){return ml(e)||hl(e,t)||vl(e,t)||gl()}function vl(e,t){if(e){if(typeof e==`string`)return pl(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)?pl(e,t):void 0}}var yl=Object.entries,bl=Object.setPrototypeOf,xl=Object.isFrozen,Sl=Object.getPrototypeOf,Cl=Object.getOwnPropertyDescriptor,wl=Object.freeze,Tl=Object.seal,El=Object.create,Dl=typeof Reflect<`u`&&Reflect,Ol=Dl.apply,kl=Dl.construct;wl||=function(e){return e},Tl||=function(e){return e},Ol||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kl||=function(e){return new e(...[...arguments].slice(1))};var Al=Q(Array.prototype.forEach),jl=Q(Array.prototype.lastIndexOf),Ml=Q(Array.prototype.pop),Nl=Q(Array.prototype.push),Pl=Q(Array.prototype.splice),Fl=Array.isArray,Il=Q(String.prototype.toLowerCase),Ll=Q(String.prototype.toString),Rl=Q(String.prototype.match),zl=Q(String.prototype.replace),Bl=Q(String.prototype.indexOf),Vl=Q(String.prototype.trim),Hl=Q(Number.prototype.toString),Ul=Q(Boolean.prototype.toString),Wl=typeof BigInt>`u`?null:Q(BigInt.prototype.toString),Gl=typeof Symbol>`u`?null:Q(Symbol.prototype.toString),Z=Q(Object.prototype.hasOwnProperty),Kl=Q(Object.prototype.toString),ql=Q(RegExp.prototype.test),Jl=Yl(TypeError);function Q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ol(e,t,n)}}function Yl(e){return function(){return kl(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Il;if(bl&&bl(e,null),!Fl(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xl(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Xl(e){for(let t=0;t<e.length;t++)Z(e,t)||(e[t]=null);return e}function Zl(e){let t=El(null);for(let r of yl(e)){var n=_l(r,2);let i=n[0],a=n[1];Z(e,i)&&(t[i]=Fl(a)?Xl(a):a&&typeof a==`object`&&a.constructor===Object?Zl(a):a)}return t}function Ql(e){switch(typeof e){case`string`:return e;case`number`:return Hl(e);case`boolean`:return Ul(e);case`bigint`:return Wl?Wl(e):`0`;case`symbol`:return Gl?Gl(e):`Symbol()`;case`undefined`:return Kl(e);case`function`:case`object`:{if(e===null)return Kl(e);let t=e,n=$l(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Kl(e)}return Kl(e)}default:return Kl(e)}}function $l(e,t){for(;e!==null;){let n=Cl(e,t);if(n){if(n.get)return Q(n.get);if(typeof n.value==`function`)return Q(n.value)}e=Sl(e)}function n(){return null}return n}function eu(e){try{return ql(e,``),!0}catch{return!1}}var tu=wl(`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(`.`)),nu=wl(`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(`.`)),ru=wl([`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`]),iu=wl([`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`]),au=wl(`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(`.`)),ou=wl([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),su=wl([`#text`]),cu=wl(`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(`.`)),lu=wl(`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(`.`)),uu=wl(`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(`.`)),du=wl([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),fu=Tl(/{{[\w\W]*|^[\w\W]*}}/g),pu=Tl(/<%[\w\W]*|^[\w\W]*%>/g),mu=Tl(/\${[\w\W]*/g),hu=Tl(/^data-[\-\w.\u00B7-\uFFFF]+$/),gu=Tl(/^aria-[\-\w]+$/),_u=Tl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vu=Tl(/^(?:\w+script|data):/i),yu=Tl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bu=Tl(/^html$/i),xu=Tl(/^[a-z][.\w]*(-[.\w]+)+$/i),Su={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cu=function(){return typeof window>`u`?null:window},wu=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}},Tu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Eu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cu(),t=e=>Eu(e);if(t.version=`3.4.8`,t.removed=[],!e||!e.document||e.document.nodeType!==Su.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=$l(d,`cloneNode`),p=$l(d,`remove`),m=$l(d,`nextSibling`),h=$l(d,`childNodes`),g=$l(d,`parentNode`),_=$l(d,`shadowRoot`),v=$l(d,`attributes`),y=o&&o.prototype?$l(o.prototype,`nodeType`):null,b=o&&o.prototype?$l(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 Jl(`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,ee=T.createNodeIterator,D=T.createDocumentFragment,O=T.getElementsByTagName,k=r.importNode,A=Tu();t.isSupported=typeof yl==`function`&&typeof g==`function`&&E&&E.createHTMLDocument!==void 0;let j=fu,M=pu,N=mu,te=hu,P=gu,ne=vu,F=yu,re=xu,ie=_u,I=null,ae=$({},[...tu,...nu,...ru,...au,...su]),L=null,R=$({},[...cu,...lu,...uu,...du]),z=Object.seal(El(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}})),oe=null,se=null,ce=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),le=!0,ue=!0,de=!1,B=!0,fe=!1,pe=!0,me=!1,he=!1,ge=!1,_e=!1,ve=!1,ye=!1,be=!0,xe=!1,Se=`user-content-`,Ce=!0,we=!1,Te={},Ee=null,De=$({},[`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`]),Oe=null,ke=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ae=null,je=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Me=`http://www.w3.org/1998/Math/MathML`,Ne=`http://www.w3.org/2000/svg`,Pe=`http://www.w3.org/1999/xhtml`,Fe=Pe,Ie=!1,Le=null,Re=$({},[Me,Ne,Pe],Ll),ze=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Be=$({},[`annotation-xml`]),Ve=$({},[`title`,`style`,`font`,`a`,`script`]),He=null,Ue=[`application/xhtml+xml`,`text/html`],V=null,H=null,U=n.createElement(`form`),We=function(e){return e instanceof RegExp||e instanceof Function},Ge=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(H&&H===e)return;(!e||typeof e!=`object`)&&(e={}),e=Zl(e),He=Ue.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,V=He===`application/xhtml+xml`?Ll:Il,I=Z(e,`ALLOWED_TAGS`)&&Fl(e.ALLOWED_TAGS)?$({},e.ALLOWED_TAGS,V):ae,L=Z(e,`ALLOWED_ATTR`)&&Fl(e.ALLOWED_ATTR)?$({},e.ALLOWED_ATTR,V):R,Le=Z(e,`ALLOWED_NAMESPACES`)&&Fl(e.ALLOWED_NAMESPACES)?$({},e.ALLOWED_NAMESPACES,Ll):Re,Ae=Z(e,`ADD_URI_SAFE_ATTR`)&&Fl(e.ADD_URI_SAFE_ATTR)?$(Zl(je),e.ADD_URI_SAFE_ATTR,V):je,Oe=Z(e,`ADD_DATA_URI_TAGS`)&&Fl(e.ADD_DATA_URI_TAGS)?$(Zl(ke),e.ADD_DATA_URI_TAGS,V):ke,Ee=Z(e,`FORBID_CONTENTS`)&&Fl(e.FORBID_CONTENTS)?$({},e.FORBID_CONTENTS,V):De,oe=Z(e,`FORBID_TAGS`)&&Fl(e.FORBID_TAGS)?$({},e.FORBID_TAGS,V):Zl({}),se=Z(e,`FORBID_ATTR`)&&Fl(e.FORBID_ATTR)?$({},e.FORBID_ATTR,V):Zl({}),Te=Z(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Zl(e.USE_PROFILES):e.USE_PROFILES:!1,le=e.ALLOW_ARIA_ATTR!==!1,ue=e.ALLOW_DATA_ATTR!==!1,de=e.ALLOW_UNKNOWN_PROTOCOLS||!1,B=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fe=e.SAFE_FOR_TEMPLATES||!1,pe=e.SAFE_FOR_XML!==!1,me=e.WHOLE_DOCUMENT||!1,_e=e.RETURN_DOM||!1,ve=e.RETURN_DOM_FRAGMENT||!1,ye=e.RETURN_TRUSTED_TYPE||!1,ge=e.FORCE_BODY||!1,be=e.SANITIZE_DOM!==!1,xe=e.SANITIZE_NAMED_PROPS||!1,Ce=e.KEEP_CONTENT!==!1,we=e.IN_PLACE||!1,ie=eu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:_u,Fe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Pe,ze=Z(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Zl(e.MATHML_TEXT_INTEGRATION_POINTS):$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Be=Z(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Zl(e.HTML_INTEGRATION_POINTS):$({},[`annotation-xml`]);let t=Z(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Zl(e.CUSTOM_ELEMENT_HANDLING):El(null);if(z=El(null),Z(t,`tagNameCheck`)&&We(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),Z(t,`attributeNameCheck`)&&We(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),Z(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),fe&&(ue=!1),ve&&(_e=!0),Te&&(I=$({},su),L=El(null),Te.html===!0&&($(I,tu),$(L,cu)),Te.svg===!0&&($(I,nu),$(L,lu),$(L,du)),Te.svgFilters===!0&&($(I,ru),$(L,lu),$(L,du)),Te.mathMl===!0&&($(I,au),$(L,uu),$(L,du))),ce.tagCheck=null,ce.attributeCheck=null,Z(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ce.tagCheck=e.ADD_TAGS:Fl(e.ADD_TAGS)&&(I===ae&&(I=Zl(I)),$(I,e.ADD_TAGS,V))),Z(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ce.attributeCheck=e.ADD_ATTR:Fl(e.ADD_ATTR)&&(L===R&&(L=Zl(L)),$(L,e.ADD_ATTR,V))),Z(e,`ADD_URI_SAFE_ATTR`)&&Fl(e.ADD_URI_SAFE_ATTR)&&$(Ae,e.ADD_URI_SAFE_ATTR,V),Z(e,`FORBID_CONTENTS`)&&Fl(e.FORBID_CONTENTS)&&(Ee===De&&(Ee=Zl(Ee)),$(Ee,e.FORBID_CONTENTS,V)),Z(e,`ADD_FORBID_CONTENTS`)&&Fl(e.ADD_FORBID_CONTENTS)&&(Ee===De&&(Ee=Zl(Ee)),$(Ee,e.ADD_FORBID_CONTENTS,V)),Ce&&(I[`#text`]=!0),me&&$(I,[`html`,`head`,`body`]),I.table&&($(I,[`tbody`]),delete oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Jl(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Jl(`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=wu(u,i)),x&&typeof S==`string`&&(S=w(``));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&I===ae&&(I=Zl(I)),A.uponSanitizeAttribute.length>0&&L===R&&(L=Zl(L)),wl&&wl(e),H=e},Ke=$({},[...nu,...ru,...iu]),qe=$({},[...au,...ou]),Je=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Fe,tagName:`template`});let n=Il(e.tagName),r=Il(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===Ne?t.namespaceURI===Pe?n===`svg`:t.namespaceURI===Me?n===`svg`&&(r===`annotation-xml`||ze[r]):!!Ke[n]:e.namespaceURI===Me?t.namespaceURI===Pe?n===`math`:t.namespaceURI===Ne?n===`math`&&Be[r]:!!qe[n]:e.namespaceURI===Pe?t.namespaceURI===Ne&&!Be[r]||t.namespaceURI===Me&&!ze[r]?!1:!qe[n]&&(Ve[n]||!Ke[n]):!!(He===`application/xhtml+xml`&&Le[e.namespaceURI]):!1},Ye=function(e){Nl(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},Xe=function(e,n){try{Nl(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Nl(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(_e||ve)try{Ye(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ze=function(e){let t=null,r=null;if(ge)e=`<remove></remove>`+e;else{let t=Rl(e,/^[\r\n\t ]+/);r=t&&t[0]}He===`application/xhtml+xml`&&Fe===Pe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?w(e):e;if(Fe===Pe)try{t=new l().parseFromString(i,He)}catch{}if(!t||!t.documentElement){t=E.createDocument(Fe,`template`,null);try{t.documentElement.innerHTML=Ie?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Fe===Pe?O.call(t,me?`html`:`body`)[0]:me?t.documentElement:a},Qe=function(e){return ee.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},$e=function(e){e.normalize();let t=ee.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;Al([j,M,N],t=>{e=zl(e,t,` `)}),n.data=e,n=t.nextNode()}let r=e.querySelectorAll?.call(e,`template`)??[];Al(Array.from(r),e=>{tt(e.content)&&$e(e.content)})},et=function(e){let t=b?b(e):null;return typeof t!=`string`||V(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)},tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Su.documentFragment}catch{return!1}},nt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function rt(e,n,r){Al(e,e=>{e.call(t,n,r,H)})}let it=function(e){let n=null;if(rt(A.beforeSanitizeElements,e,null),et(e))return Ye(e),!0;let r=V(b?b(e):e.nodeName);if(rt(A.uponSanitizeElement,e,{tagName:r,allowedTags:I}),pe&&e.hasChildNodes()&&!nt(e.firstElementChild)&&ql(/<[/\w!]/g,e.innerHTML)&&ql(/<[/\w!]/g,e.textContent)||pe&&e.namespaceURI===Pe&&r===`style`&&nt(e.firstElementChild)||e.nodeType===Su.progressingInstruction||pe&&e.nodeType===Su.comment&&ql(/<[/\w]/g,e.data))return Ye(e),!0;if(oe[r]||!(ce.tagCheck instanceof Function&&ce.tagCheck(r))&&!I[r]){if(!oe[r]&&st(r)&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r)))return!1;if(Ce&&!Ee[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 Ye(e),!0}return(y?y(e):e.nodeType)===Su.element&&!Je(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ql(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ye(e),!0):(fe&&e.nodeType===Su.text&&(n=e.textContent,Al([j,M,N],e=>{n=zl(n,e,` `)}),e.textContent!==n&&(Nl(t.removed,{element:e.cloneNode()}),e.textContent=n)),rt(A.afterSanitizeElements,e,null),!1)},at=function(e,t,r){if(se[t]||be&&(t===`id`||t===`name`)&&(r in n||r in U))return!1;let i=L[t]||ce.attributeCheck instanceof Function&&ce.attributeCheck(t,e);if(!(ue&&!se[t]&&ql(te,t))&&!(le&&ql(P,t))){if(!i||se[t]){if(!(st(e)&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&ql(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||t===`is`&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r))))return!1}else if(!Ae[t]&&!ql(ie,zl(r,F,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||Bl(r,`data:`)!==0||!Oe[e])&&(!de||ql(ne,zl(r,F,``)))&&r)return!1}return!0},ot=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),st=function(e){return!ot[Il(e)]&&ql(re,e)},ct=function(e){rt(A.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=V(o),d=c,f=o===`value`?d:Vl(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,rt(A.uponSanitizeAttribute,e,r),f=r.attrValue,xe&&(l===`id`||l===`name`)&&Bl(f,Se)!==0&&(Xe(o,e),f=Se+f),pe&&ql(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Xe(o,e);continue}if(l===`attributename`&&Rl(f,`href`)){Xe(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Xe(o,e);continue}if(!B&&ql(/\/>/i,f)){Xe(o,e);continue}fe&&Al([j,M,N],e=>{f=zl(f,e,` `)});let p=V(e.nodeName);if(!at(p,l,f)){Xe(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)}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),et(e)?Ye(e):Ml(t.removed)}catch{Xe(o,e)}}rt(A.afterSanitizeAttributes,e,null)},lt=function(e){let t=null,n=Qe(e);for(rt(A.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(rt(A.uponSanitizeShadowNode,t,null),it(t),ct(t),tt(t.content)&<(t.content),(y?y(t):t.nodeType)===Su.element){let e=_?_(t):t.shadowRoot;tt(e)&&(ut(e),lt(e))}rt(A.afterSanitizeShadowDOM,e,null)},ut=function(e){let t=y?y(e):e.nodeType;if(t===Su.element){let t=_?_(e):e.shadowRoot;tt(t)&&(ut(t),lt(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];Al(n,e=>{Nl(r,e)});for(let e of r)ut(e);if(t===Su.element){let t=b?b(e):null;if(typeof t==`string`&&V(t)===`template`){let t=e.content;tt(t)&&ut(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(Ie=!e,Ie&&(e=`<!-->`),typeof e!=`string`&&!nt(e)&&(e=Ql(e),typeof e!=`string`))throw Jl(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(he||Ge(n),t.removed=[],typeof e==`string`&&(we=!1),we){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=V(t);if(!I[e]||oe[e])throw Jl(`root node is forbidden and cannot be sanitized in-place`)}if(et(e))throw Jl(`root node is clobbered and cannot be sanitized in-place`);ut(e)}else if(nt(e))i=Ze(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Su.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),ut(a);else{if(!_e&&!fe&&!me&&e.indexOf(`<`)===-1)return x&&ye?w(e):e;if(i=Ze(e),!i)return _e?null:ye?S:``}i&&ge&&Ye(i.firstChild);let c=Qe(we?e:i);for(;o=c.nextNode();)it(o),ct(o),tt(o.content)&<(o.content);if(we)return fe&&$e(e),e;if(_e){if(fe&&$e(i),ve)for(s=D.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=k.call(r,s,!0)),s}let l=me?i.outerHTML:i.innerHTML;return me&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ql(bu,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
164
|
-
`+l),fe&&Al([j,M,N],e=>{l=zl(l,e,` `)}),x&&ye?w(l):l},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ge(e),he=!0},t.clearConfig=function(){H=null,he=!1},t.isValidAttribute=function(e,t,n){H||Ge({});let r=V(e),i=V(t);return at(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Nl(A[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=jl(A[e],t);return n===-1?void 0:Pl(A[e],n,1)[0]}return Ml(A[e])},t.removeHooks=function(e){A[e]=[]},t.removeAllHooks=function(){A=Tu()},t}var Du=Eu(),Ou=new dl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{let e=new ol;return e.code=({text:e,lang:t})=>{let n=(t??``).toLowerCase(),r=Ms(e,n);return`<pre><code${n?` class="language-${n}"`:``}>${r}</code></pre>`},e})()}),ku=`p.br.strong.em.del.s.u.a.ul.ol.li.h1.h2.h3.h4.h5.h6.blockquote.code.pre.hr.table.thead.tbody.tr.th.td.img.span.input`.split(`.`),Au=[`href`,`title`,`target`,`rel`,`src`,`alt`,`class`,`checked`,`type`,`disabled`],ju=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Mu(e){if(!e)return``;let t=Ou.parse(e,{async:!1});return Du.sanitize(t,{ALLOWED_TAGS:ku,ALLOWED_ATTR:Au,ALLOWED_URI_REGEXP:ju})}var Nu=
|
|
163
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _l(e,t){return ml(e)||hl(e,t)||vl(e,t)||gl()}function vl(e,t){if(e){if(typeof e==`string`)return pl(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)?pl(e,t):void 0}}var yl=Object.entries,bl=Object.setPrototypeOf,xl=Object.isFrozen,Sl=Object.getPrototypeOf,Cl=Object.getOwnPropertyDescriptor,wl=Object.freeze,Tl=Object.seal,El=Object.create,Dl=typeof Reflect<`u`&&Reflect,Ol=Dl.apply,kl=Dl.construct;wl||=function(e){return e},Tl||=function(e){return e},Ol||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kl||=function(e){return new e(...[...arguments].slice(1))};var Al=Q(Array.prototype.forEach),jl=Q(Array.prototype.lastIndexOf),Ml=Q(Array.prototype.pop),Nl=Q(Array.prototype.push),Pl=Q(Array.prototype.splice),Fl=Array.isArray,Il=Q(String.prototype.toLowerCase),Ll=Q(String.prototype.toString),Rl=Q(String.prototype.match),zl=Q(String.prototype.replace),Bl=Q(String.prototype.indexOf),Vl=Q(String.prototype.trim),Hl=Q(Number.prototype.toString),Ul=Q(Boolean.prototype.toString),Wl=typeof BigInt>`u`?null:Q(BigInt.prototype.toString),Gl=typeof Symbol>`u`?null:Q(Symbol.prototype.toString),Z=Q(Object.prototype.hasOwnProperty),Kl=Q(Object.prototype.toString),ql=Q(RegExp.prototype.test),Jl=Yl(TypeError);function Q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ol(e,t,n)}}function Yl(e){return function(){return kl(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Il;if(bl&&bl(e,null),!Fl(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xl(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Xl(e){for(let t=0;t<e.length;t++)Z(e,t)||(e[t]=null);return e}function Zl(e){let t=El(null);for(let r of yl(e)){var n=_l(r,2);let i=n[0],a=n[1];Z(e,i)&&(t[i]=Fl(a)?Xl(a):a&&typeof a==`object`&&a.constructor===Object?Zl(a):a)}return t}function Ql(e){switch(typeof e){case`string`:return e;case`number`:return Hl(e);case`boolean`:return Ul(e);case`bigint`:return Wl?Wl(e):`0`;case`symbol`:return Gl?Gl(e):`Symbol()`;case`undefined`:return Kl(e);case`function`:case`object`:{if(e===null)return Kl(e);let t=e,n=$l(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Kl(e)}return Kl(e)}default:return Kl(e)}}function $l(e,t){for(;e!==null;){let n=Cl(e,t);if(n){if(n.get)return Q(n.get);if(typeof n.value==`function`)return Q(n.value)}e=Sl(e)}function n(){return null}return n}function eu(e){try{return ql(e,``),!0}catch{return!1}}var tu=wl(`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(`.`)),nu=wl(`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(`.`)),ru=wl([`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`]),iu=wl([`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`]),au=wl(`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(`.`)),ou=wl([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),su=wl([`#text`]),cu=wl(`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(`.`)),lu=wl(`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(`.`)),uu=wl(`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(`.`)),du=wl([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),fu=Tl(/{{[\w\W]*|^[\w\W]*}}/g),pu=Tl(/<%[\w\W]*|^[\w\W]*%>/g),mu=Tl(/\${[\w\W]*/g),hu=Tl(/^data-[\-\w.\u00B7-\uFFFF]+$/),gu=Tl(/^aria-[\-\w]+$/),_u=Tl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vu=Tl(/^(?:\w+script|data):/i),yu=Tl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bu=Tl(/^html$/i),xu=Tl(/^[a-z][.\w]*(-[.\w]+)+$/i),Su={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cu=function(){return typeof window>`u`?null:window},wu=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}},Tu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Eu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cu(),t=e=>Eu(e);if(t.version=`3.4.8`,t.removed=[],!e||!e.document||e.document.nodeType!==Su.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=$l(d,`cloneNode`),p=$l(d,`remove`),m=$l(d,`nextSibling`),h=$l(d,`childNodes`),g=$l(d,`parentNode`),_=$l(d,`shadowRoot`),v=$l(d,`attributes`),y=o&&o.prototype?$l(o.prototype,`nodeType`):null,b=o&&o.prototype?$l(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 Jl(`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,ee=T.createDocumentFragment,O=T.getElementsByTagName,k=r.importNode,A=Tu();t.isSupported=typeof yl==`function`&&typeof g==`function`&&E&&E.createHTMLDocument!==void 0;let j=fu,M=pu,N=mu,te=hu,P=gu,ne=vu,F=yu,re=xu,ie=_u,I=null,ae=$({},[...tu,...nu,...ru,...au,...su]),L=null,R=$({},[...cu,...lu,...uu,...du]),z=Object.seal(El(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}})),oe=null,se=null,ce=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),le=!0,ue=!0,de=!1,B=!0,fe=!1,pe=!0,me=!1,he=!1,ge=!1,_e=!1,ve=!1,ye=!1,be=!0,xe=!1,Se=`user-content-`,Ce=!0,we=!1,Te={},Ee=null,De=$({},[`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`]),Oe=null,ke=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ae=null,je=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Me=`http://www.w3.org/1998/Math/MathML`,Ne=`http://www.w3.org/2000/svg`,Pe=`http://www.w3.org/1999/xhtml`,Fe=Pe,Ie=!1,Le=null,Re=$({},[Me,Ne,Pe],Ll),ze=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Be=$({},[`annotation-xml`]),Ve=$({},[`title`,`style`,`font`,`a`,`script`]),He=null,Ue=[`application/xhtml+xml`,`text/html`],V=null,H=null,U=n.createElement(`form`),We=function(e){return e instanceof RegExp||e instanceof Function},Ge=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(H&&H===e)return;(!e||typeof e!=`object`)&&(e={}),e=Zl(e),He=Ue.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,V=He===`application/xhtml+xml`?Ll:Il,I=Z(e,`ALLOWED_TAGS`)&&Fl(e.ALLOWED_TAGS)?$({},e.ALLOWED_TAGS,V):ae,L=Z(e,`ALLOWED_ATTR`)&&Fl(e.ALLOWED_ATTR)?$({},e.ALLOWED_ATTR,V):R,Le=Z(e,`ALLOWED_NAMESPACES`)&&Fl(e.ALLOWED_NAMESPACES)?$({},e.ALLOWED_NAMESPACES,Ll):Re,Ae=Z(e,`ADD_URI_SAFE_ATTR`)&&Fl(e.ADD_URI_SAFE_ATTR)?$(Zl(je),e.ADD_URI_SAFE_ATTR,V):je,Oe=Z(e,`ADD_DATA_URI_TAGS`)&&Fl(e.ADD_DATA_URI_TAGS)?$(Zl(ke),e.ADD_DATA_URI_TAGS,V):ke,Ee=Z(e,`FORBID_CONTENTS`)&&Fl(e.FORBID_CONTENTS)?$({},e.FORBID_CONTENTS,V):De,oe=Z(e,`FORBID_TAGS`)&&Fl(e.FORBID_TAGS)?$({},e.FORBID_TAGS,V):Zl({}),se=Z(e,`FORBID_ATTR`)&&Fl(e.FORBID_ATTR)?$({},e.FORBID_ATTR,V):Zl({}),Te=Z(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Zl(e.USE_PROFILES):e.USE_PROFILES:!1,le=e.ALLOW_ARIA_ATTR!==!1,ue=e.ALLOW_DATA_ATTR!==!1,de=e.ALLOW_UNKNOWN_PROTOCOLS||!1,B=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fe=e.SAFE_FOR_TEMPLATES||!1,pe=e.SAFE_FOR_XML!==!1,me=e.WHOLE_DOCUMENT||!1,_e=e.RETURN_DOM||!1,ve=e.RETURN_DOM_FRAGMENT||!1,ye=e.RETURN_TRUSTED_TYPE||!1,ge=e.FORCE_BODY||!1,be=e.SANITIZE_DOM!==!1,xe=e.SANITIZE_NAMED_PROPS||!1,Ce=e.KEEP_CONTENT!==!1,we=e.IN_PLACE||!1,ie=eu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:_u,Fe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Pe,ze=Z(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Zl(e.MATHML_TEXT_INTEGRATION_POINTS):$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Be=Z(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Zl(e.HTML_INTEGRATION_POINTS):$({},[`annotation-xml`]);let t=Z(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Zl(e.CUSTOM_ELEMENT_HANDLING):El(null);if(z=El(null),Z(t,`tagNameCheck`)&&We(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),Z(t,`attributeNameCheck`)&&We(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),Z(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),fe&&(ue=!1),ve&&(_e=!0),Te&&(I=$({},su),L=El(null),Te.html===!0&&($(I,tu),$(L,cu)),Te.svg===!0&&($(I,nu),$(L,lu),$(L,du)),Te.svgFilters===!0&&($(I,ru),$(L,lu),$(L,du)),Te.mathMl===!0&&($(I,au),$(L,uu),$(L,du))),ce.tagCheck=null,ce.attributeCheck=null,Z(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ce.tagCheck=e.ADD_TAGS:Fl(e.ADD_TAGS)&&(I===ae&&(I=Zl(I)),$(I,e.ADD_TAGS,V))),Z(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ce.attributeCheck=e.ADD_ATTR:Fl(e.ADD_ATTR)&&(L===R&&(L=Zl(L)),$(L,e.ADD_ATTR,V))),Z(e,`ADD_URI_SAFE_ATTR`)&&Fl(e.ADD_URI_SAFE_ATTR)&&$(Ae,e.ADD_URI_SAFE_ATTR,V),Z(e,`FORBID_CONTENTS`)&&Fl(e.FORBID_CONTENTS)&&(Ee===De&&(Ee=Zl(Ee)),$(Ee,e.FORBID_CONTENTS,V)),Z(e,`ADD_FORBID_CONTENTS`)&&Fl(e.ADD_FORBID_CONTENTS)&&(Ee===De&&(Ee=Zl(Ee)),$(Ee,e.ADD_FORBID_CONTENTS,V)),Ce&&(I[`#text`]=!0),me&&$(I,[`html`,`head`,`body`]),I.table&&($(I,[`tbody`]),delete oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Jl(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Jl(`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=wu(u,i)),x&&typeof S==`string`&&(S=w(``));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&I===ae&&(I=Zl(I)),A.uponSanitizeAttribute.length>0&&L===R&&(L=Zl(L)),wl&&wl(e),H=e},Ke=$({},[...nu,...ru,...iu]),qe=$({},[...au,...ou]),Je=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Fe,tagName:`template`});let n=Il(e.tagName),r=Il(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===Ne?t.namespaceURI===Pe?n===`svg`:t.namespaceURI===Me?n===`svg`&&(r===`annotation-xml`||ze[r]):!!Ke[n]:e.namespaceURI===Me?t.namespaceURI===Pe?n===`math`:t.namespaceURI===Ne?n===`math`&&Be[r]:!!qe[n]:e.namespaceURI===Pe?t.namespaceURI===Ne&&!Be[r]||t.namespaceURI===Me&&!ze[r]?!1:!qe[n]&&(Ve[n]||!Ke[n]):!!(He===`application/xhtml+xml`&&Le[e.namespaceURI]):!1},Ye=function(e){Nl(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},Xe=function(e,n){try{Nl(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Nl(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(_e||ve)try{Ye(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ze=function(e){let t=null,r=null;if(ge)e=`<remove></remove>`+e;else{let t=Rl(e,/^[\r\n\t ]+/);r=t&&t[0]}He===`application/xhtml+xml`&&Fe===Pe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?w(e):e;if(Fe===Pe)try{t=new l().parseFromString(i,He)}catch{}if(!t||!t.documentElement){t=E.createDocument(Fe,`template`,null);try{t.documentElement.innerHTML=Ie?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Fe===Pe?O.call(t,me?`html`:`body`)[0]:me?t.documentElement:a},Qe=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)},$e=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;Al([j,M,N],t=>{e=zl(e,t,` `)}),n.data=e,n=t.nextNode()}let r=e.querySelectorAll?.call(e,`template`)??[];Al(Array.from(r),e=>{tt(e.content)&&$e(e.content)})},et=function(e){let t=b?b(e):null;return typeof t!=`string`||V(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)},tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Su.documentFragment}catch{return!1}},nt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function rt(e,n,r){Al(e,e=>{e.call(t,n,r,H)})}let it=function(e){let n=null;if(rt(A.beforeSanitizeElements,e,null),et(e))return Ye(e),!0;let r=V(b?b(e):e.nodeName);if(rt(A.uponSanitizeElement,e,{tagName:r,allowedTags:I}),pe&&e.hasChildNodes()&&!nt(e.firstElementChild)&&ql(/<[/\w!]/g,e.innerHTML)&&ql(/<[/\w!]/g,e.textContent)||pe&&e.namespaceURI===Pe&&r===`style`&&nt(e.firstElementChild)||e.nodeType===Su.progressingInstruction||pe&&e.nodeType===Su.comment&&ql(/<[/\w]/g,e.data))return Ye(e),!0;if(oe[r]||!(ce.tagCheck instanceof Function&&ce.tagCheck(r))&&!I[r]){if(!oe[r]&&st(r)&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r)))return!1;if(Ce&&!Ee[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 Ye(e),!0}return(y?y(e):e.nodeType)===Su.element&&!Je(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ql(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ye(e),!0):(fe&&e.nodeType===Su.text&&(n=e.textContent,Al([j,M,N],e=>{n=zl(n,e,` `)}),e.textContent!==n&&(Nl(t.removed,{element:e.cloneNode()}),e.textContent=n)),rt(A.afterSanitizeElements,e,null),!1)},at=function(e,t,r){if(se[t]||be&&(t===`id`||t===`name`)&&(r in n||r in U))return!1;let i=L[t]||ce.attributeCheck instanceof Function&&ce.attributeCheck(t,e);if(!(ue&&!se[t]&&ql(te,t))&&!(le&&ql(P,t))){if(!i||se[t]){if(!(st(e)&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&ql(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||t===`is`&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&ql(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r))))return!1}else if(!Ae[t]&&!ql(ie,zl(r,F,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||Bl(r,`data:`)!==0||!Oe[e])&&(!de||ql(ne,zl(r,F,``)))&&r)return!1}return!0},ot=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),st=function(e){return!ot[Il(e)]&&ql(re,e)},ct=function(e){rt(A.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=V(o),d=c,f=o===`value`?d:Vl(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,rt(A.uponSanitizeAttribute,e,r),f=r.attrValue,xe&&(l===`id`||l===`name`)&&Bl(f,Se)!==0&&(Xe(o,e),f=Se+f),pe&&ql(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Xe(o,e);continue}if(l===`attributename`&&Rl(f,`href`)){Xe(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Xe(o,e);continue}if(!B&&ql(/\/>/i,f)){Xe(o,e);continue}fe&&Al([j,M,N],e=>{f=zl(f,e,` `)});let p=V(e.nodeName);if(!at(p,l,f)){Xe(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)}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),et(e)?Ye(e):Ml(t.removed)}catch{Xe(o,e)}}rt(A.afterSanitizeAttributes,e,null)},lt=function(e){let t=null,n=Qe(e);for(rt(A.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(rt(A.uponSanitizeShadowNode,t,null),it(t),ct(t),tt(t.content)&<(t.content),(y?y(t):t.nodeType)===Su.element){let e=_?_(t):t.shadowRoot;tt(e)&&(ut(e),lt(e))}rt(A.afterSanitizeShadowDOM,e,null)},ut=function(e){let t=y?y(e):e.nodeType;if(t===Su.element){let t=_?_(e):e.shadowRoot;tt(t)&&(ut(t),lt(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];Al(n,e=>{Nl(r,e)});for(let e of r)ut(e);if(t===Su.element){let t=b?b(e):null;if(typeof t==`string`&&V(t)===`template`){let t=e.content;tt(t)&&ut(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(Ie=!e,Ie&&(e=`<!-->`),typeof e!=`string`&&!nt(e)&&(e=Ql(e),typeof e!=`string`))throw Jl(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(he||Ge(n),t.removed=[],typeof e==`string`&&(we=!1),we){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=V(t);if(!I[e]||oe[e])throw Jl(`root node is forbidden and cannot be sanitized in-place`)}if(et(e))throw Jl(`root node is clobbered and cannot be sanitized in-place`);ut(e)}else if(nt(e))i=Ze(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Su.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),ut(a);else{if(!_e&&!fe&&!me&&e.indexOf(`<`)===-1)return x&&ye?w(e):e;if(i=Ze(e),!i)return _e?null:ye?S:``}i&&ge&&Ye(i.firstChild);let c=Qe(we?e:i);for(;o=c.nextNode();)it(o),ct(o),tt(o.content)&<(o.content);if(we)return fe&&$e(e),e;if(_e){if(fe&&$e(i),ve)for(s=ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=k.call(r,s,!0)),s}let l=me?i.outerHTML:i.innerHTML;return me&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ql(bu,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
164
|
+
`+l),fe&&Al([j,M,N],e=>{l=zl(l,e,` `)}),x&&ye?w(l):l},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ge(e),he=!0},t.clearConfig=function(){H=null,he=!1},t.isValidAttribute=function(e,t,n){H||Ge({});let r=V(e),i=V(t);return at(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Nl(A[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=jl(A[e],t);return n===-1?void 0:Pl(A[e],n,1)[0]}return Ml(A[e])},t.removeHooks=function(e){A[e]=[]},t.removeAllHooks=function(){A=Tu()},t}var Du=Eu(),Ou=new dl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{let e=new ol;return e.code=({text:e,lang:t})=>{let n=(t??``).toLowerCase(),r=Ms(e,n);return`<pre><code${n?` class="language-${n}"`:``}>${r}</code></pre>`},e})()}),ku=`p.br.strong.em.del.s.u.a.ul.ol.li.h1.h2.h3.h4.h5.h6.blockquote.code.pre.hr.table.thead.tbody.tr.th.td.img.span.input`.split(`.`),Au=[`href`,`title`,`target`,`rel`,`src`,`alt`,`class`,`checked`,`type`,`disabled`],ju=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Mu(e){if(!e)return``;let t=Ou.parse(e,{async:!1});return Du.sanitize(t,{ALLOWED_TAGS:ku,ALLOWED_ATTR:Au,ALLOWED_URI_REGEXP:ju})}var Nu=f({__name:`NotePanel`,props:{selectedNode:{type:[Object,null],required:!0},readonly:{type:Boolean,required:!1},focusTick:{type:Number,required:!1}},emits:[`apply`,`remove`,`set-link`,`set-image`,`set-rich`],setup(e,{expose:t,emit:n}){t();let i=e,a=n,o=m(``),c=m(null);ua(c,{minRows:4,maxRows:10});let l=r(()=>!o.value||o.value.trim()===``),u=r(()=>Mu(o.value)),d=m(!0);function f(){d.value=!d.value}b(()=>[i.selectedNode?.id,i.selectedNode?.note?.text],()=>{o.value=i.selectedNode?.note?.text??``},{immediate:!0}),b(()=>i.focusTick,async()=>{if(i.readonly)return;await s();let e=document.querySelector(`.zm-note-panel textarea.zm-note-textarea`);if(e){e.focus();let t=e.value.length;e.setSelectionRange(t,t)}});function p(){if(i.readonly)return;let e=o.value;e!==(i.selectedNode?.note?.text??``)&&a(`apply`,e)}function h(e){i.readonly||(e.key===`Escape`?(e.preventDefault(),o.value=i.selectedNode?.note?.text??``,e.target.blur()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),p(),e.target.blur()))}function g(){i.readonly||confirm(`移除该节点的笔记?`)&&(o.value=``,a(`remove`))}let _=r(()=>{var e;return!!((e=i.selectedNode?.link)!=null&&e.url)}),v=r(()=>{var e;return!!((e=i.selectedNode?.image)!=null&&e.src)}),y=r(()=>i.selectedNode?.richContent?.kind),x=r(()=>y.value===`code`),S=r(()=>y.value===`table`),C=m(!1),w=m(!1),T=m(!1),E=m(!1);b(()=>i.selectedNode?.id,()=>{C.value=!1,w.value=!1,T.value=!1,E.value=!1});let D=m(``);b(()=>[i.selectedNode?.id,i.selectedNode?.link?.url],()=>{D.value=i.selectedNode?.link?.url??``},{immediate:!0});function ee(){if(i.readonly)return;let e=D.value.trim();e!==(i.selectedNode?.link?.url??``)&&a(`set-link`,e)}let O=m(``);b(()=>[i.selectedNode?.id,i.selectedNode?.image?.src],()=>{O.value=i.selectedNode?.image?.src??``},{immediate:!0});function k(){if(i.readonly)return;let e=O.value.trim();e!==(i.selectedNode?.image?.src??``)&&a(`set-image`,e)}function A(e){let t=e.target;t.style.display=`none`}function j(e){let t=e.target;t.style.display=``}let M=m(``),N=m(null);ua(N,{minRows:4,maxRows:18}),b(()=>[i.selectedNode?.id,i.selectedNode?.richContent?.raw],()=>{M.value=i.selectedNode?.richContent?.raw??``},{immediate:!0});let te=r(()=>Ms(As(M.value),js(M.value)));function P(){if(i.readonly)return;let e=M.value;if(e===(i.selectedNode?.richContent?.raw??``))return;let t=js(e)||void 0;a(`set-rich`,e?{kind:`code`,raw:e,lang:t}:null)}let ne=m(``),F=m(null);ua(F,{minRows:4,maxRows:14}),b(()=>[i.selectedNode?.id,i.selectedNode?.richContent?.raw],()=>{ne.value=i.selectedNode?.richContent?.raw??``},{immediate:!0});function re(){if(i.readonly)return;let e=ne.value;e!==(i.selectedNode?.richContent?.raw??``)&&a(`set-rich`,e?{kind:`table`,raw:e}:null)}let ie={props:i,emit:a,draft:o,noteRef:c,isEmpty:l,noteHtml:u,showPreview:d,togglePreview:f,commitNote:p,onNoteKeydown:h,onRemoveNote:g,hasLink:_,hasImage:v,richKind:y,hasCode:x,hasTable:S,showLink:C,showImage:w,showCode:T,showTable:E,linkDraft:D,commitLink:ee,imageDraft:O,commitImage:k,onImageError:A,onImageLoad:j,codeDraft:M,codeRef:N,codePreviewHtml:te,commitCode:P,tableDraft:ne,tableRef:F,commitTable:re,tableParsedRows:r(()=>Ns(ne.value)),summary:r(()=>{let e=[];return l.value||e.push(`${o.value.length} 字`),_.value&&e.push(`1 链接`),v.value&&e.push(`1 图片`),x.value&&e.push(`代码块`),S.value&&e.push(`表格`),e.length===0?`节点没有额外内容`:e.join(` · `)}),get codeLang(){return js}};return Object.defineProperty(ie,"__isScriptSetup",{enumerable:!1,value:!0}),ie}}),Pu={class:`zm-note-panel`},Fu={key:0,class:`zm-note-empty`},Iu={class:`zm-note-header`},Lu={class:`zm-note-title-row`},Ru={class:`zm-note-name`},zu={class:`zm-note-meta`},Bu={class:`zm-note-scroll`},Vu={class:`zm-note-section`},Hu={class:`zm-note-section-head`},Uu={class:`zm-note-split`},Wu=[`disabled`],Gu={key:0,class:`zm-note-preview`},Ku=[`innerHTML`],qu={key:1,class:`zm-note-preview-hint`},Ju={key:0,class:`zm-note-section-actions`},Yu={key:0,class:`zm-note-add-row`},Xu={key:1,class:`zm-note-section`},Zu=[`disabled`],Qu=[`href`,`title`],$u={key:2,class:`zm-note-section`},ed=[`disabled`],td=[`src`,`alt`],nd={key:3,class:`zm-note-section`},rd={class:`zm-note-section-head`},id={key:0,class:`zm-note-section-tag`},ad=[`disabled`],od={key:0,class:`zm-note-code`},sd=[`innerHTML`],cd={key:4,class:`zm-note-section`},ld=[`disabled`],ud={key:0,class:`zm-note-table`};function dd(r,i,a,o,s,c){return e(),w(`div`,Pu,[a.selectedNode?(e(),w(n,{key:1},[l(`div`,Iu,[l(`div`,Lu,[i[12]||=l(`span`,{class:`zm-note-label`},`节点`,-1),l(`span`,Ru,E(a.selectedNode.text||`(无标题)`),1)]),l(`div`,zu,E(o.summary),1)]),l(`div`,Bu,[t(` Note `),l(`section`,Vu,[l(`header`,Hu,[i[13]||=l(`span`,{class:`zm-note-section-title`},`笔记`,-1),i[14]||=l(`span`,{class:`zm-note-section-hint`},`Ctrl+Enter 提交, Esc 取消`,-1),a.readonly?t(`v-if`,!0):(e(),w(`button`,{key:0,type:`button`,class:`zm-note-preview-toggle`,onClick:o.togglePreview},E(o.showPreview?`隐藏预览`:`显示预览`),1))]),l(`div`,Uu,[x(l(`textarea`,{ref:`noteRef`,"onUpdate:modelValue":i[0]||=e=>o.draft=e,class:`zm-note-textarea`,placeholder:`写点什么吧… 支持 Markdown`,spellcheck:`false`,disabled:a.readonly,onBlur:o.commitNote,onKeydown:o.onNoteKeydown},null,40,Wu),[[M,o.draft]]),o.showPreview?(e(),w(`div`,Gu,[o.isEmpty?(e(),w(`div`,qu,` 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 `)):(e(),w(`div`,{key:0,class:`zm-note-preview-body`,innerHTML:o.noteHtml},null,8,Ku))])):t(`v-if`,!0)]),!a.readonly&&!o.isEmpty?(e(),w(`div`,Ju,[l(`button`,{class:`zm-note-action-btn is-danger`,onClick:o.onRemoveNote},`移除笔记`)])):t(`v-if`,!0)]),t(` Add-row: chips for sections that are not yet populated. `),a.readonly?t(`v-if`,!0):(e(),w(`div`,Yu,[!o.hasLink&&!o.showLink?(e(),w(`button`,{key:0,class:`zm-note-add-chip`,onClick:i[1]||=e=>o.showLink=!0},`+ 链接`)):t(`v-if`,!0),!o.hasImage&&!o.showImage?(e(),w(`button`,{key:1,class:`zm-note-add-chip`,onClick:i[2]||=e=>o.showImage=!0},`+ 图片`)):t(`v-if`,!0),!o.hasCode&&!o.showCode?(e(),w(`button`,{key:2,class:`zm-note-add-chip`,onClick:i[3]||=e=>o.showCode=!0},`+ 代码块`)):t(`v-if`,!0),!o.hasTable&&!o.showTable?(e(),w(`button`,{key:3,class:`zm-note-add-chip`,onClick:i[4]||=e=>o.showTable=!0},`+ 表格`)):t(`v-if`,!0)])),t(` Link `),o.hasLink||o.showLink?(e(),w(`section`,Xu,[i[15]||=l(`header`,{class:`zm-note-section-head`},[l(`span`,{class:`zm-note-section-title`},`链接`)],-1),x(l(`input`,{"onUpdate:modelValue":i[5]||=e=>o.linkDraft=e,class:`zm-note-input`,type:`url`,placeholder:`https://…`,disabled:a.readonly,onBlur:o.commitLink,onKeydown:i[6]||=j(p(e=>e.target.blur(),[`prevent`]),[`enter`])},null,40,Zu),[[M,o.linkDraft]]),o.hasLink?(e(),w(`a`,{key:0,class:`zm-note-link-chip`,href:a.selectedNode.link?.url,target:`_blank`,rel:`noopener noreferrer`,title:a.selectedNode.link?.url},E(a.selectedNode.link?.url),9,Qu)):t(`v-if`,!0)])):t(`v-if`,!0),t(` Image `),o.hasImage||o.showImage?(e(),w(`section`,$u,[i[16]||=l(`header`,{class:`zm-note-section-head`},[l(`span`,{class:`zm-note-section-title`},`图片`)],-1),x(l(`input`,{"onUpdate:modelValue":i[7]||=e=>o.imageDraft=e,class:`zm-note-input`,type:`url`,placeholder:`data:image/… 或 https://…`,disabled:a.readonly,onBlur:o.commitImage,onKeydown:i[8]||=j(p(e=>e.target.blur(),[`prevent`]),[`enter`])},null,40,ed),[[M,o.imageDraft]]),o.hasImage?(e(),w(`img`,{key:0,class:`zm-note-image`,src:a.selectedNode.image?.src,alt:a.selectedNode.text,onError:o.onImageError,onLoad:o.onImageLoad},null,40,td)):t(`v-if`,!0)])):t(`v-if`,!0),t(` Code `),o.hasCode||o.showCode?(e(),w(`section`,nd,[l(`header`,rd,[i[17]||=l(`span`,{class:`zm-note-section-title`},`代码块`,-1),o.codeLang(o.codeDraft)?(e(),w(`span`,id,E(o.codeLang(o.codeDraft)),1)):t(`v-if`,!0)]),x(l(`textarea`,{ref:`codeRef`,"onUpdate:modelValue":i[9]||=e=>o.codeDraft=e,class:`zm-note-input zm-note-input-code`,placeholder:"```ts\nconsole.log(123)\n```",spellcheck:`false`,disabled:a.readonly,onBlur:o.commitCode},null,40,ad),[[M,o.codeDraft]]),o.codeDraft.trim()?(e(),w(`pre`,od,[l(`code`,{innerHTML:o.codePreviewHtml},null,8,sd)])):t(`v-if`,!0)])):t(`v-if`,!0),t(` Table `),o.hasTable||o.showTable?(e(),w(`section`,cd,[i[18]||=l(`header`,{class:`zm-note-section-head`},[l(`span`,{class:`zm-note-section-title`},`表格`)],-1),x(l(`textarea`,{ref:`tableRef`,"onUpdate:modelValue":i[10]||=e=>o.tableDraft=e,class:`zm-note-input zm-note-input-code`,placeholder:`| 列1 | 列2 |
|
|
165
165
|
| --- | --- |
|
|
166
|
-
| a | b |`,spellcheck:`false`,disabled:
|
|
167
|
-
`:"```\n",a=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",n?i+n+(n.endsWith("```")?``:"\n```"):i+"// 你的代码\n```");if(a===null)return;let o=a.trim();if(!o){de(e,null);return}let s=/^```([^\s`]*)/.exec(o);de(e,{kind:`code`,raw:o,lang:s?s[1]:void 0})}function At(){let e=B.value?.nodeId;e&&de(e,null)}function jt(){let e=B.value?.nodeId;if(!e)return;let t=U(
|
|
166
|
+
| a | b |`,spellcheck:`false`,disabled:a.readonly,onBlur:o.commitTable},null,40,ld),[[M,o.tableDraft]]),o.tableParsedRows.length?(e(),w(`table`,ud,[l(`tbody`,null,[(e(!0),w(n,null,O(o.tableParsedRows,(t,r)=>(e(),w(`tr`,{key:r},[r===0?(e(!0),w(n,{key:0},O(t,(t,n)=>(e(),w(`th`,{key:`h${n}`},E(t),1))),128)):(e(!0),w(n,{key:1},O(t,(t,n)=>(e(),w(`td`,{key:`c${n}`},E(t),1))),128))]))),128))])])):t(`v-if`,!0)])):t(`v-if`,!0)])],64)):(e(),w(`div`,Fu,[...i[11]||=[l(`p`,null,`请先在画布上选中一个节点。`,-1),l(`p`,{class:`zm-note-hint`},` 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 `,-1)]]))])}var fd=F(Nu,[[`render`,dd],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/NotePanel.vue`]]),pd=24,md=400,hd=160,gd=4,_d=f({__name:`MindMap`,props:{data:{type:Object,required:!0},theme:{type:Object,required:!1},previewMode:{type:Boolean,required:!1,default:!1},markdown:{type:String,required:!1},lineColors:{type:Array,required:!1},hideCanvasActions:{type:Boolean,required:!1,default:!1},builtInDrawers:{type:Boolean,required:!1,default:!0}},emits:[`change`,`select`,`edit-note`,`markdownChange`,`canvas-toggle-preview`,`canvas-outline`,`canvas-settings`,`canvas-data`,`canvas-import`],setup(e,{expose:t,emit:n}){let i=e,a=n,o=m(null),c=m(null),l=m(``),u=m(new Set),d=r(()=>u.value.values().next().value??null),f=m(new Set),p=m(!1),h=m(null),v=m(0),x=m(0),S=r(()=>{let e=h.value;if(!e||!e.currentTargetId||!e.dropPosition||e.dropPosition===`child`)return null;let t=An.value.find(t=>t.id===e.currentTargetId);if(!t)return null;let n=t.width/2,r=t.height/2;if(t._dir===`down`){let i=e.dropPosition===`before`?t.x-n:t.x+n;return{x1:i,y1:t.y-r,x2:i,y2:t.y+r,horizontal:!1}}let i=e.dropPosition===`before`?t.y-r:t.y+r;return{x1:t.x-n,y1:i,x2:t.x+n,y2:i,horizontal:!0}}),C=m(null),w=m(null),T=m(null),E=m(``),D=m(H(i.data)),ee=m({}),O=m({}),k=m(i.markdown!==void 0),A=!1;b(()=>i.markdown,e=>{if(e===void 0){k.value=!1;return}k.value=!0;let t=ut(e||``);A=!0,D.value=H(t),u.value=new Set,f.value=new Set,G(),s(()=>{A=!1,ci()})}),b(D,()=>{k.value&&!A&&a(`markdownChange`,dt(D.value))},{deep:!0});let j=r(()=>K.showOrderBadge===!0),M=m(new Map),N=M.value;function te(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),t.fontSize&&(n.fontSize=t.fontSize),Object.keys(n).length===0?N.delete(e):N.set(e,n),M.value=new Map(N)}function P(e){return N.get(e)??{}}function ne(e,t){return N.get(e)??t}function F(e,t){let n=U(D.value,e);n&&(n.image={src:t.src,naturalW:t.naturalW,naturalH:t.naturalH,width:R(t.width,pd,md),height:R(t.height,pd,md)},W(),G(),a(`change`,D.value))}function re(e){let t=U(D.value,e);!t||!t.image||(delete t.image,W(),G(),a(`change`,D.value))}function ie(e,t){let n=t.trim();if(!U(D.value,e))return;if(!n){re(e);return}let r=new Image;r.onload=()=>{let t=U(D.value,e);if(!t)return;let i=r.naturalWidth&&r.naturalHeight?r.naturalWidth/r.naturalHeight:1,o=R(r.naturalWidth||hd,pd,md),s=Math.round(o/i);t.image={src:n,naturalW:r.naturalWidth||o,naturalH:r.naturalHeight||s,width:o,height:s},W(),G(),a(`change`,D.value)},r.onerror=()=>{},r.src=n}function R(e,t,n){return Math.min(n,Math.max(t,e))}function z(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||hd,i=r.naturalHeight||hd,a=R(n,pd,hd),o=R(Math.round(i*a/n),pd,md);t({src:e,naturalW:n,naturalH:i,width:a,height:o})},r.onerror=()=>{t({src:e,naturalW:hd,naturalH:hd,width:hd,height:hd})},r.src=e},n.readAsDataURL(e)}function oe(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/*`,t.style.display=`none`,t.onchange=()=>{let n=t.files?.[0];n&&(z(n,t=>F(e,t)),document.body.removeChild(t))},document.body.appendChild(t),t.click()}function se(e,t){let n=t.trim(),r=U(D.value,e);r&&(n?r.link={url:n}:delete r.link,W(),G(),a(`change`,D.value))}function ce(e){se(e,``)}function le(e,t){let n=U(D.value,e);n&&(t?n.note={text:t}:delete n.note,W(),G(),a(`change`,D.value))}function ue(e){le(e,``)}function de(e,t){let n=U(D.value,e);n&&(t?n.richContent=t:delete n.richContent,W(),G(),a(`change`,D.value))}let B=m(null),fe=m(null),pe=r(()=>[`zm-canvas-fab`,`zm-canvas-fab-preview`,!i.hideCanvasActions&&(!i.previewMode||p.value)?`is-visible`:``].filter(Boolean).join(` `)),me=r(()=>[`zm-canvas-fab`,`zm-canvas-fab-outline`,!i.hideCanvasActions&&(!i.previewMode||p.value)?`is-visible`:``].filter(Boolean).join(` `));function he(e,t){i.previewMode||(e.preventDefault(),e.stopPropagation(),fe.value=null,u.value=new Set([t.id]),J(),B.value={nodeId:t.id,x:e.clientX,y:e.clientY})}function ge(){B.value=null}function _e(e){let t=e.target;if(!(t!=null&&t.closest(`.zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline`))){if($r&&q.panMoved.value){$r=!1,e.preventDefault();return}e.preventDefault(),B.value&&=null,fe.value={x:e.clientX,y:e.clientY}}}function ve(){fe.value=null}function ye(){ve(),i.builtInDrawers&&(Ae(),Ee.value=!0),a(`canvas-settings`)}function be(){ve(),i.builtInDrawers&&(Ae(),Ce.value=!0),a(`canvas-data`)}function xe(e){ve(),i.builtInDrawers&&(Ae(),Oe.value=e,Ce.value=!0),a(`canvas-import`,e)}let Se=m(!1),Ce=m(!1),we=m(!1),Te=m(!1),Ee=m(!1),De=m(0),Oe=m(null),ke=m(new Set);function Ae(){Ce.value=!1,we.value=!1,Te.value=!1,Ee.value=!1}let Me=r(()=>{let e=d.value;return e?U(D.value,e)??null:null}),Ne=r(()=>Me.value?P(Me.value.id):{});function Pe(e){e.autoBalanceOnChange!==void 0&&(K.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(K.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(K.lineWidthEnd=Math.max(.1,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(K.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(K.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(K.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(K.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(K.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(K.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(K.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(K.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(K.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(K.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(K.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(K.canvasBg=e.canvasBg),e.branchGap!==void 0&&(K.branchGap=Math.max(0,Math.min(80,e.branchGap)))}function Fe(e){Me.value&&te(Me.value.id,e)}function Ie(){let e={autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};K.autoBalanceOnChange=e.autoBalanceOnChange,K.lineWidthStart=e.lineWidthStart,K.lineWidthEnd=e.lineWidthEnd,K.rainbowBranch=e.rainbowBranch,K.branchPaletteId=e.branchPaletteId,K.customPalettes=e.customPalettes,K.lineStyle=e.lineStyle,K.rootLineStyle=e.rootLineStyle,K.lineOrigin=e.lineOrigin,K.layoutMode=e.layoutMode,K.taperedEdge=e.taperedEdge,K.lineWidthTaper=e.lineWidthTaper,K.uniformLineWidth=e.uniformLineWidth,K.elbowRadius=e.elbowRadius,K.showOrderBadge=e.showOrderBadge,K.canvasBg=e.canvasBg,K.branchGap=e.branchGap}function Le(){Oe.value=null}function Be(e){let t=d.value;t&&le(t,e)}function Ve(){let e=d.value;e&&ue(e)}function He(e){let t=d.value;t&&se(t,e)}function Ue(e){let t=d.value;t&&ie(t,e)}function V(e){let t=d.value;t&&de(t,e)}function Je(e){let t=document.querySelector(`[data-node-id="${e.id}"]`);t&&t.click()}function rt(e){mr(e.id,e.text)}function ft(e){Wn(e)}function pt(e){Gn(e)}function ht(e){hr(e.srcId,e.targetId,e.position)}function gt(e){let t=new Set(ke.value);t.has(e)?t.delete(e):t.add(e),ke.value=t}function yt(){i.builtInDrawers&&(Se.value=!Se.value),a(`canvas-outline`)}function bt(){let e=B.value?.nodeId;e&&oe(e)}function xt(){let e=B.value?.nodeId;if(!e)return;let t=U(D.value,e)?.link?.url??``,n=window.prompt(`输入链接 URL(留空取消)`,t);n!==null&&se(e,n)}function St(){let e=B.value?.nodeId;e&&ce(e)}function Ct(){let e=B.value?.nodeId;e&&Ft(e)}function Dt(){let e=B.value?.nodeId;e&&ue(e)}function Ot(){let e=B.value?.nodeId;e&&re(e)}function kt(){let e=B.value?.nodeId;if(!e)return;let t=U(D.value,e)?.richContent,n=t?.kind===`code`?As(t.raw):``,r=t?.kind===`code`&&t.lang||``,i=r?"```"+r+`
|
|
167
|
+
`:"```\n",a=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",n?i+n+(n.endsWith("```")?``:"\n```"):i+"// 你的代码\n```");if(a===null)return;let o=a.trim();if(!o){de(e,null);return}let s=/^```([^\s`]*)/.exec(o);de(e,{kind:`code`,raw:o,lang:s?s[1]:void 0})}function At(){let e=B.value?.nodeId;e&&de(e,null)}function jt(){let e=B.value?.nodeId;if(!e)return;let t=U(D.value,e)?.richContent,n=t?.kind===`table`?t.raw:``,r=window.prompt(`输入 markdown 表格(每行以 | 分隔;留空取消)`,n||`| 列1 | 列2 | 列3 |
|
|
168
168
|
| --- | --- | --- |
|
|
169
|
-
| a | b | c |`);if(r===null)return;let i=r.trim();if(!i){de(e,null);return}de(e,{kind:`table`,raw:i})}function Mt(){let e=B.value?.nodeId;e&&de(e,null)}function Pt(){let e=B.value?.nodeId;e&&Wr(e)}function Ft(e){a.previewMode||(d.value=new Set([e]),J(),a.builtInDrawers&&(Ae(),Te.value=!0,De.value++),s(`edit-note`,e))}function Lt(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function Rt(e){if(a.previewMode||l.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=f.value;if(!n)return;let r=e.clipboardData?.items;if(!r)return;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=U(w.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;z(t,e=>F(n,e));return}}if(b.value&&b.value.nodes.length>0)return;let i=null;for(let t=0;t<r.length;t++){let n=r[t];if(n.kind===`string`&&n.type===`text/plain`){i=e.clipboardData?.getData(`text/plain`)??null;break}}if(!i)return;let o=i.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);if(o.length!==0){e.preventDefault(),W();for(let e of o)Ye(w.value,n,e);G(),s(`change`,w.value)}}m(()=>{window.addEventListener(`paste`,Rt),window.addEventListener(`keydown`,zt),G()}),o(()=>{window.removeEventListener(`paste`,Rt),window.removeEventListener(`keydown`,zt)});function zt(e){if((e.metaKey||e.ctrlKey)&&(e.key===`f`||e.key===`F`)){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;e.preventDefault(),s(`canvas-outline`);return}if((e.key===`Delete`||e.key===`Backspace`)&&kr.value){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||a.previewMode)return;e.preventDefault(),Hr(kr.value)}}let Bt=A(null),Vt=n(()=>Bt.value?.nodeId??null);function Ht(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;Bt.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`,Ut),window.addEventListener(`mouseup`,Wt)}function Ut(e){let t=Bt.value;if(!t)return;let n=q.scale.value||1,r=e.clientX-t.startX,i=R(t.startW+r/n,pd,md),a=R(i*t.ratio,pd,md);t.pendingW=i,t.pendingH=a;let o=c.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);o&&(o.style.width=`${i}px`,o.style.height=`${a}px`);let s=c.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 Wt(){let e=Bt.value;if(window.removeEventListener(`mousemove`,Ut),window.removeEventListener(`mouseup`,Wt),Bt.value=null,!e)return;let t=U(w.value,e.nodeId);!t||!t.image||(F(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),d.value=new Set([e.nodeId]),J(),Kt=!0)}let Gt=A(null),Kt=!1,qt=!1;function Yt(e){Gt.value=e}function Xt(e){Gt.value===e&&(Gt.value=null),x.value&&=null}function Zt(e,t){if(!t.text||t.text.length<14)return;let n=e.currentTarget.getBoundingClientRect(),r=c.value?.getBoundingClientRect();if(!r)return;let i=n.top-r.top>60,a=n.left-r.left+n.width/2,o=r.width-120-10,s=Math.max(130,Math.min(a,o)),l=i?n.top-r.top-8:n.bottom-r.top+8;x.value={text:t.text,x:s,y:l,above:i}}function Qt(e){return Gt.value===e||f.value===e}let $t=A(0),en=A(!1),tn=vt(100);function W(){tn.record({data:w.value,selectedIds:[...d.value]})}function nn(e,t={}){w.value=H(e),t.resetCollapsed&&(p.value=new Set),t.resetSelection&&(d.value=new Set,J()),G(),s(`change`,w.value)}function G(){p.value=new Set(p.value),$t.value++,i().then(()=>i()).then(()=>rn()).then(()=>{$t.value++})}function rn(){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,E.value[i],ee.value[i]}),E.value=t,ee.value=n}let an=n(()=>({rootBg:a.theme?.rootBg??`#1f2937`,rootText:a.theme?.rootText??`#ffffff`,branchBg:a.theme?.branchBg??`#ffffff`,branchText:a.theme?.branchText??`#1f2937`,lineColor:a.theme?.lineColor??`#94a3b8`,bgColor:a.theme?.bgColor??`#f8fafc`,fontSize:a.theme?.fontSize??14,lineWidthStart:a.theme?.lineWidthStart??2.2,lineWidthEnd:a.theme?.lineWidthEnd??.8,rainbowBranch:a.theme?.rainbowBranch??!1})),on=n(()=>K.canvasBg||an.value.bgColor),K=M({autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function sn(e){return e?K.rootLineStyle:K.lineStyle}function cn(e){return K.taperedEdge?K.uniformLineWidth&&e>0?K.lineWidthEnd:un(e):dn(e)}function ln(e){return K.taperedEdge?K.lineWidthEnd:dn(e)}function un(e){let t=K.lineWidthTaper,n=K.lineWidthStart*t**+e;return Math.max(K.lineWidthEnd,n)}function dn(e){if(e<=0)return K.lineWidthStart;if(e>=3)return K.lineWidthEnd;let t=e/3;return K.lineWidthStart+(K.lineWidthEnd-K.lineWidthStart)*t}function fn(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 pn(e,t,n,r){let i=1-e;return{x:i*i*t.x+2*i*e*n.x+e*e*r.x,y:i*i*t.y+2*i*e*n.y+e*e*r.y}}function mn(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:fn(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}if(a===`arc`){let a;a=o===`right`||o===`left`?{x:(e.x+t.x)/2,y:t.y}:{x:t.x,y:(e.y+t.y)/2};let s=n=>{let r=1-n;return{dx:2*r*(a.x-e.x)+2*n*(t.x-a.x),dy:2*r*(a.y-e.y)+2*n*(t.y-a.y)}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:pn(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=n/2,d=r/2,f=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)f+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;f+=` A ${d.toFixed(2)} ${d.toFixed(2)} 0 0 0 ${l[i].x.toFixed(2)} ${l[i].y.toFixed(2)}`;for(let e=i-1;e>=0;e--)f+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return f+=` A ${u.toFixed(2)} ${u.toFixed(2)} 0 0 0 ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`,f+=` Z`,f}if(a===`elbow`){let i=[];if(o===`down`){let n=(e.y+t.y)/2;i.push(e,{x:e.x,y:n},{x:t.x,y:n},t)}else{let n=(e.x+t.x)/2;i.push(e,{x:n,y:e.y},{x:n,y:t.y},t)}let a=[],s=0;for(let e=0;e<i.length-1;e++){let t=Math.hypot(i[e+1].x-i[e].x,i[e+1].y-i[e].y);a.push(t),s+=t}let c=[n/2],l=0;for(let e=0;e<a.length-1;e++){l+=a[e];let t=s>0?l/s:0;c.push((n+(r-n)*t)/2)}c.push(r/2);let u=[];for(let e=0;e<i.length-1;e++){let t=i[e+1].x-i[e].x,n=i[e+1].y-i[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),u.push({x:-n/r,y:t/r})}let d=[],f=[];d.push({x:i[0].x+u[0].x*c[0],y:i[0].y+u[0].y*c[0]}),f.push({x:i[0].x-u[0].x*c[0],y:i[0].y-u[0].y*c[0]});for(let e=1;e<i.length-1;e++){let t=u[e-1],n=u[e],r=c[e],a=t.x+n.x,o=t.y+n.y,s=a*a+o*o;if(s<1e-6)d.push({x:i[e].x+t.x*r,y:i[e].y+t.y*r}),f.push({x:i[e].x-t.x*r,y:i[e].y-t.y*r});else{let t=2*r/s;d.push({x:i[e].x+a*t,y:i[e].y+o*t}),f.push({x:i[e].x-a*t,y:i[e].y-o*t})}}let p=u[u.length-1],m=c[c.length-1];d.push({x:i[i.length-1].x+p.x*m,y:i[i.length-1].y+p.y*m}),f.push({x:i[i.length-1].x-p.x*m,y:i[i.length-1].y-p.y*m});let h=`M ${d[0].x.toFixed(2)} ${d[0].y.toFixed(2)}`;for(let e=1;e<d.length;e++)h+=` L ${d[e].x.toFixed(2)} ${d[e].y.toFixed(2)}`;for(let e=f.length-1;e>=0;e--)h+=` L ${f[e].x.toFixed(2)} ${f[e].y.toFixed(2)}`;return h+=` Z`,h}if(a===`rounded-elbow`&&!(o===`down`?Math.abs(e.x-t.x)<.5:Math.abs(e.y-t.y)<.5)){let i=function(e,t,n){let r={x:e.pos.x-t*e.d1.x,y:e.pos.y-t*e.d1.y},i={x:e.pos.x+t*e.d2.x,y:e.pos.y+t*e.d2.y},a={x:e.pos.x+t*(e.d2.x-e.d1.x),y:e.pos.y+t*(e.d2.y-e.d1.y)},o=Math.atan2(r.y-a.y,r.x-a.x),s=Math.atan2(i.y-a.y,i.x-a.x)-o;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;let c=[];for(let e=1;e<n;e++){let r=e/n,i=o+s*r;c.push({x:a.x+t*Math.cos(i),y:a.y+t*Math.sin(i)})}return c},a=[],s;if(o===`down`){let n=(e.y+t.y)/2,r=Math.sign(n-e.y)||1,i=Math.sign(t.x-e.x)||1,a=Math.sign(t.y-n)||1;s=[{pos:{x:e.x,y:n},d1:{x:0,y:r},d2:{x:i,y:0}},{pos:{x:t.x,y:n},d1:{x:i,y:0},d2:{x:0,y:a}}]}else{let n=(e.x+t.x)/2,r=Math.sign(n-e.x)||1,i=Math.sign(t.y-e.y)||1,a=Math.sign(t.x-n)||1;s=[{pos:{x:n,y:e.y},d1:{x:r,y:0},d2:{x:0,y:i}},{pos:{x:n,y:t.y},d1:{x:0,y:i},d2:{x:a,y:0}}]}let c=Math.hypot(s[1].pos.x-s[0].pos.x,s[1].pos.y-s[0].pos.y),l=Math.hypot(t.x-s[1].pos.x,t.y-s[1].pos.y),u=Math.min(c,l,K.elbowRadius)*.5,d=Math.max(2,u);a.push(e),a.push(s[0].pos),a.push({x:s[1].pos.x-d*s[1].d1.x,y:s[1].pos.y-d*s[1].d1.y});for(let e of i(s[1],d,12))a.push(e);a.push(t);let f=[],p=0;for(let e=0;e<a.length-1;e++){let t=Math.hypot(a[e+1].x-a[e].x,a[e+1].y-a[e].y);f.push(t),p+=t}let m=[];for(let e=0;e<a.length-1;e++){let t=a[e+1].x-a[e].x,n=a[e+1].y-a[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),m.push({x:-n/r,y:t/r})}let h=[],g=0;for(let e=0;e<a.length;e++){e>0&&(g+=f[e-1]);let t=p>0?g/p:0;h.push((n+(r-n)*t)/2)}let _=[],v=[];for(let e=0;e<a.length;e++){let t=h[e];if(e===0){let n=m[0];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else if(e===a.length-1){let n=m[m.length-1];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else{let n=m[e-1],r=m[e],i=n.x+r.x,o=n.y+r.y,s=i*i+o*o;if(s<1e-6)_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t});else{let n=2*t/s;_.push({x:a[e].x+i*n,y:a[e].y+o*n}),v.push({x:a[e].x-i*n,y:a[e].y-o*n})}}}let y=`M ${_[0].x.toFixed(2)} ${_[0].y.toFixed(2)}`;for(let e=1;e<_.length;e++)y+=` L ${_[e].x.toFixed(2)} ${_[e].y.toFixed(2)}`;y+=` L ${v[_.length-1].x.toFixed(2)} ${v[_.length-1].y.toFixed(2)}`;for(let e=v.length-2;e>=0;e--)y+=` L ${v[e].x.toFixed(2)} ${v[e].y.toFixed(2)}`;return y+=` Z`,y}{let i=t.x-e.x,a=t.y-e.y,o=Math.hypot(i,a);o<1e-6&&(o=1);let s=-a/o,c=i/o,l=n/2,u=r/2,d={x:e.x+s*l,y:e.y+c*l},f={x:e.x-s*l,y:e.y-c*l},p={x:t.x-s*u,y:t.y-c*u},m={x:t.x+s*u,y:t.y+c*u};return`M ${d.x.toFixed(2)} ${d.y.toFixed(2)} L ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${p.x.toFixed(2)} ${p.y.toFixed(2)} L ${f.x.toFixed(2)} ${f.y.toFixed(2)} Z`}}let hn=n(()=>On.value.root.children),gn=Re[0].colors,_n=n(()=>ze(K.branchPaletteId,K.customPalettes)),vn=n(()=>{let e=new Map;if(!K.rainbowBranch)return e;let t=a.lineColors,n=t&&t.length>0?t:_n.value.colors.length>0?_n.value.colors:gn;for(let t=0;t<hn.value.length;t++){let r=hn.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<hn.value.length;e++){let t=hn.value[e];r(t,n[e%n.length])}return e});function yn(e,t){return K.rainbowBranch?vn.value.get(t.id)??an.value.lineColor:an.value.lineColor}function bn(e){let t=P(e.id);if(t.bg)return t.bg;if(e.isRoot)return an.value.rootBg;if(e.depth>=3)return`transparent`;let n=e.depth===1?.15:.08;if(K.rainbowBranch){let t=vn.value.get(e.id);if(t)return En(t,n)}return En(an.value.rootBg,n)}function Sn(e){let t=P(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return an.value.rootText;if(K.rainbowBranch){let t=vn.value.get(e.id);if(t)return Dn(t,.55)}return an.value.branchText}function Cn(e){let t=P(e.id);return t.borderColor?t.borderColor:`transparent`}function wn(e){let t=P(e.id);return t.fontWeight?t.fontWeight:e.isRoot?700:e.depth<=1?600:e.depth===2?500:400}function Tn(e){return P(e.id).fontSize??e.fontSize??an.value.fontSize}function En(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 Dn(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 q=mt({getContainer:()=>c.value});q.setOnMarqueeEnd(ni),_t({isEditing:()=>l.value!==null,isReadonly:()=>a.previewMode,getSelectedId:()=>f.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>w.value.id,onAddChild:Wn,onAddSibling:Gn,onAddSiblingBefore:Kn,onRemove:sr,onStartEdit:Pn,onClearSelection:()=>{if(Ar.value){Ar.value=null;return}if(kr.value){kr.value=null;return}d.value=new Set,J()},onDuplicate:qn,onCopy:Qn,onCut:er,onPaste:tr,hasClipboard:()=>!!b.value&&b.value.nodes.length>0,onUndo:nr,onRedo:rr,onNavigate:ir,onMoveSibling:_r,onSelectRoot:()=>{d.value=new Set([w.value.id]),J()}});let On=n(()=>{let e=H(w.value);return Nn(e),je(e,{mode:K.layoutMode,baseFontSize:an.value.fontSize,richHeights:E.value,richWidths:ee.value,branchGap:K.branchGap})}),kn=A([]),An=n(()=>($t.value,kn.value));T(On,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),kn.value=t},{immediate:!0});let jn=n(()=>{let e=[];for(let t of An.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),Mn=n(()=>`${On.value.vbX} ${On.value.vbY} ${On.value.vbW} ${On.value.vbH}`);function Nn(e){if(p.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)Nn(t)}function Pn(e){let t=U(w.value,e);t&&(l.value=e,u.value=t.text,d.value=new Set([e]),J(),i(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select(),Ln(e)}))}function Fn(){if(!l.value)return;let e=U(w.value,l.value);e&&e.text!==(u.value.trim()||` `)&&(e.text=u.value.trim()||` `,W(),s(`change`,w.value)),l.value=null}function In(){l.value=null}function Ln(e){e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)}function Rn(e){Ln(e.target)}function zn(e){if(a.previewMode)return;let t=U(w.value,e);t!=null&&t.richContent&&(S.value=e,C.value=t.richContent.raw,i(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function Bn(){if(!S.value)return;let e=S.value,t=U(w.value,e),n=C.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?de(e,{kind:`code`,raw:n,lang:js(n)||void 0}):de(e,{kind:`table`,raw:n})),S.value=null}function Vn(){S.value=null}function Hn(e){e.key===`Escape`?(e.preventDefault(),Vn()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),Bn())}function Un(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),nr()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),rr())}function Wn(e){let t=Ye(w.value,e,nt);t&&(W(),G(),s(`change`,w.value),i(()=>Pn(t.id)))}function Gn(e){if(e===w.value.id){Wn(e);return}let t=Xe(w.value,e,nt);t&&(W(),G(),s(`change`,w.value),i(()=>Pn(t.id)))}function Kn(e){if(e===w.value.id){Wn(e);return}let t=Ze(w.value,e,nt);t&&(W(),G(),s(`change`,w.value),i(()=>Pn(t.id)))}function qn(e){if(e===w.value.id)return;let t=Qe(w.value,e);t&&(W(),d.value=new Set([t.id]),J(),s(`change`,w.value),G())}function Jn(e){let t=[],n=new Set;for(let r of e)r!==w.value.id&&(n.has(r)||U(w.value,r)&&(n.add(r),t.push(r)));return t}function Yn(e){let t=new Set(e),n=[],r=e=>{t.has(e.id)&&n.push(e.id);for(let t of e.children)r(t)};return r(w.value),n}function Xn(e){var t;try{(t=navigator.clipboard)==null||t.writeText(e)}catch{}}function Zn(e){let t=[],n=(e,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;t.push(i+a+(e.text||``));for(let t of e.children)n(t,r+1)};return n(e,0),t.join(`
|
|
170
|
-
`)}function Qn(e){if(e.includes(
|
|
171
|
-
`)),G())}function er(e){let t=Yn(Jn(e));if(t.length===0)return;let n=[];for(let e of t){let t=et(
|
|
172
|
-
`)),G(),
|
|
173
|
-
`).map(e=>e.replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim()).filter(e=>e.length>0)}function or(e){return e.replace(/\s+/g,` `).trim()}function sr(e){var t;if(e===w.value.id)return;let n=U(w.value,e),r=n?Qr(n):[e];if(Ge(w.value,e)){for(let e of r)lt(w.value,e);if((t=Ar.value)!=null&&t.fromId&&r.includes(Ar.value.fromId)&&(Ar.value=null),W(),d.value.has(e)){let t=new Set(d.value);t.delete(e),d.value=t,J()}G(),s(`change`,w.value)}}function cr(e){p.value.has(e)?p.value.delete(e):p.value.add(e),G()}function lr(e){let t=[{n:w.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 dr(){p.value=new Set,lr(e=>{e.children.length>0&&p.value.add(e.id)}),G()}function fr(e){p.value=new Set,lr((t,n)=>{n>e&&t.children.length>0&&p.value.add(t.id)}),G()}function pr(){p.value=new Set,G()}function mr(e,t){Ke(w.value,e,t)&&(W(),G(),s(`change`,w.value))}function hr(e,t,n){return qe(w.value,e,t,n)?(W(),G(),s(`change`,w.value),!0):!1}function gr(e,t,n){let r=e.filter(e=>e!==t);if(r.length===0)return!1;for(let e of r){if(!We(w.value,e))return!1;let n=U(w.value,e);if(n&&U(n,t))return!1}if(r.length===1)return hr(r[0],t,n);let i=n===`after`?[...r].reverse():r,a=!1;for(let e of i)qe(w.value,e,t,n)&&(a=!0);return a?(W(),G(),s(`change`,w.value),!0):!1}function _r(e){let t=f.value;if(!t)return;let n=w.value;if(t===n.id)return;let r=We(n,t);if(!r)return;let i=r.children.findIndex(e=>e.id===t);if(i<0)return;let a=e,o=An.value.find(e=>e.id===t);if(o&&Dr(o)&&(a=-e),a<0){if(i===0)return;let e=r.children[i-1].id;qe(n,t,e,`before`)}else{if(i>=r.children.length-1)return;let e=r.children[i+1].id;qe(n,t,e,`after`)}W(),G(),s(`change`,n)}function vr(e,t){if(qt){qt=!1;return}if(e.stopPropagation(),Ar.value){let e=Ar.value;e.fromId?e.fromId!==t.id&&(Vr(e.fromId,t.id),Ar.value=null):(e.fromId=t.id,d.value=new Set([t.id]),J());return}if(kr.value=null,e.shiftKey){let e=new Set(d.value);e.has(t.id)?e.delete(t.id):e.add(t.id),d.value=e}else d.value=new Set([t.id]);J()}function yr(e,t,n){let r=null;for(let i of An.value){if(n.has(i.id))continue;let a=i.width/2,o=i.height/2;e>=i.x-a&&e<=i.x+a&&t>=i.y-o&&t<=i.y+o&&(r=i)}return r}function br(){let e=new Map,t=0,n=r=>{e.set(r.id,t++);for(let e of r.children)n(e)};return n(w.value),e}function xr(e){let t=br();return[...e].sort((e,n)=>(t.get(e)??0)-(t.get(n)??0))}function Sr(e){let t=new Set(e);return e.filter(e=>{let n=We(w.value,e);for(;n;){if(t.has(n.id))return!1;n=We(w.value,n.id)}return!0})}let Cr=null;function wr(e,t){if(a.previewMode||e.button!==0)return;qt=!1;let n=e.target;if(n!=null&&n.closest(`.zm-img-resize-handle`))return;if(kr.value){let t=zr.value.find(e=>e.rel.id===kr.value);if(t){let n=c.value.getBoundingClientRect(),r=q.scale.value,i=e=>n.left+e.x*r+q.offsetX.value,a=e=>n.top+e.y*r+q.offsetY.value,o=Math.hypot(e.clientX-i(t.from),e.clientY-a(t.from)),s=Math.hypot(e.clientX-i(t.to),e.clientY-a(t.to));if(Math.min(o,s)<=20){e.stopPropagation(),e.preventDefault(),qt=!0,qr(e,t.rel.id,o<=s?`from`:`to`);return}}}if(t.isRoot)return;e.stopPropagation();let r=c.value.getBoundingClientRect(),i=t.x*q.scale.value+q.offsetX.value,o=t.y*q.scale.value+q.offsetY.value,s=e.clientX-r.left-i,l=e.clientY-r.top-o,u=d.value,f=u.size>1&&u.has(t.id)?Sr(xr([...u])):[t.id],p=f.includes(t.id)?t.id:f[0];Cr={srcIds:f,srcText:p===t.id?t.text:An.value.find(e=>e.id===p)?.text??t.text,pointerOffsetX:s,pointerOffsetY:l,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,Tr),window.addEventListener(`pointerup`,Or),window.addEventListener(`pointercancel`,Or)}function Tr(e){if(Cr){let t=e.clientX-Cr.startX,n=e.clientY-Cr.startY;if(Math.abs(t)<=gd&&Math.abs(n)<=gd)return;g.value={srcIds:Cr.srcIds,srcText:Cr.srcText,pointerOffsetX:Cr.pointerOffsetX,pointerOffsetY:Cr.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add(`is-dragging`),Cr=null}let t=g.value;if(!t)return;let n=c.value.getBoundingClientRect();_.value=e.clientX-n.left-t.pointerOffsetX,v.value=e.clientY-n.top-t.pointerOffsetY;let r=(e.clientX-n.left-q.offsetX.value)/q.scale.value,i=(e.clientY-n.top-q.offsetY.value)/q.scale.value,a=yr(r,i,new Set(t.srcIds));t.currentTargetId=a?.id??null,t.dropPosition=a?Er(r,i,a):null}function Er(e,t,n){if(n.isRoot)return`child`;let r=n.width/2,i=n.height/2;if(n._dir===`down`){let t=e-n.x;return t<-r*.3?`before`:t>r*.3?`after`:`child`}let a=t-n.y;return a<-i*.3?`before`:a>i*.3?`after`:`child`}function Dr(e){var t;return!!((t=e.parent)!=null&&t.isRoot)&&e._dir===`left`}function Or(e){if(window.removeEventListener(`pointermove`,Tr),window.removeEventListener(`pointerup`,Or),window.removeEventListener(`pointercancel`,Or),Cr){Cr=null;return}let t=g.value;if(t){if(t.currentTargetId&&t.dropPosition){let e=t.dropPosition;if(e!==`child`){let n=An.value.find(e=>e.id===t.currentTargetId);n&&Dr(n)&&(e=e===`before`?`after`:`before`)}gr(t.srcIds,t.currentTargetId,e),d.value=new Set(t.srcIds),J(),Kt=!0}g.value=null,_.value=0,v.value=0,document.body.classList.remove(`is-dragging`)}}let kr=A(null),Ar=A(null),jr=A(null),Mr=A(null),Nr=A(``);function Pr(e,t){let n=e.width/2,r=e.height/2,i=(t%4+4)%4;return i<1?{x:e.x-n+2*n*i,y:e.y-r}:i<2?{x:e.x+n,y:e.y-r+2*r*(i-1)}:i<3?{x:e.x+n-2*n*(i-2),y:e.y+r}:{x:e.x-n,y:e.y+r-2*r*(i-3)}}function Fr(e,t){let n=t.x-e.x,r=t.y-e.y,i=e.width/2,a=e.height/2;if(Math.abs(n)<1e-6&&Math.abs(r)<1e-6)return{x:e.x+i,y:e.y};let o=Math.abs(n)>1e-6?i/Math.abs(n):1/0,s=Math.abs(r)>1e-6?a/Math.abs(r):1/0,c=Math.min(o,s);return{x:e.x+n*c,y:e.y+r*c}}function Ir(e,t){let n=e.width/2||1,r=e.height/2||1,i=t.x-e.x,a=t.y-e.y;return Math.abs(i)/n>Math.abs(a)/r?i>0?1+R((a+r)/(2*r),0,1):3+R((r-a)/(2*r),0,1):a<0?R((i+n)/(2*n),0,1):2+R((n-i)/(2*n),0,1)}function Lr(e,t,n,r){let i=t===`from`?n:r,a=t===`from`?r:n,o=jr.value;if(o&&o.id===e.id&&o.end===t)return Fr(i,{x:o.wx,y:o.wy});let s=t===`from`?e.fromT:e.toT;return s===void 0?Fr(i,{x:a.x,y:a.y}):Pr(i,s)}function Rr(e,t){let n=Math.hypot(t.x,t.y);if(n<1e-6)return null;let r=t.x/n,i=t.y/n,a=e.x-r*9,o=e.y-i*9,s=-i*(7/2),c=7/2*r;return`M ${e.x.toFixed(2)} ${e.y.toFixed(2)} L ${(a+s).toFixed(2)} ${(o+c).toFixed(2)} L ${(a-s).toFixed(2)} ${(o-c).toFixed(2)} Z`}let zr=n(()=>{let e=w.value.relations;if(!e||e.length===0)return[];let t=[];for(let n of e){let e=An.value.find(e=>e.id===n.fromId),r=An.value.find(e=>e.id===n.toId);if(!e||!r)continue;let i=Lr(n,`from`,e,r),a=Lr(n,`to`,e,r),o=jr.value,s=n.c1,c=n.c2;if(o&&o.id===n.id&&o.end===`c1`&&(s={x:o.wx,y:o.wy}),o&&o.id===n.id&&o.end===`c2`&&(c={x:o.wx,y:o.wy}),!s||!c){let e=a.x-i.x,t=a.y-i.y,n=Math.hypot(e,t)||1,r=-t/n,o=e/n;o>0&&(r=-r,o=-o);let l=R(n*.18,24,160),u={x:(i.x+a.x)/2+r*l,y:(i.y+a.y)/2+o*l};s||=u,c||=u}let l=`M ${i.x.toFixed(2)} ${i.y.toFixed(2)} C ${s.x.toFixed(2)} ${s.y.toFixed(2)} ${c.x.toFixed(2)} ${c.y.toFixed(2)} ${a.x.toFixed(2)} ${a.y.toFixed(2)}`,u=fn(.5,i,{x1:s.x,y1:s.y,x2:c.x,y2:c.y},a),d=n.arrow??`end`,f=d===`none`?null:Rr(a,{x:a.x-c.x,y:a.y-c.y}),p=d===`both`?Rr(i,{x:i.x-s.x,y:i.y-s.y}):null;t.push({rel:n,from:i,to:a,c1:s,c2:c,d:l,labelPos:u,arrowEnd:f,arrowStart:p})}return t}),Br=n(()=>zr.value.find(e=>e.rel.id===Mr.value)??null);function Vr(e,t){let n=at(w.value,e,t);return n?(W(),G(),s(`change`,w.value),kr.value=n.id,d.value=new Set,J(),n.id):null}function Hr(e){ot(w.value,e)&&(W(),kr.value===e&&(kr.value=null),Mr.value===e&&(Mr.value=null),G(),s(`change`,w.value))}function Ur(e,t){st(w.value,e,t)&&(W(),G(),s(`change`,w.value))}function Wr(e){a.previewMode||(Ar.value={fromId:e},e&&(d.value=new Set([e]),J()))}function Gr(){if(Ar.value){Ar.value=null;return}Wr(f.value)}function Kr(e,t){e.stopPropagation(),kr.value=t,d.value=new Set,J()}function qr(e,t,n){if(a.previewMode)return;e.stopPropagation(),e.preventDefault();let r=c.value.getBoundingClientRect();jr.value={id:t,end:n,wx:(e.clientX-r.left-q.offsetX.value)/q.scale.value,wy:(e.clientY-r.top-q.offsetY.value)/q.scale.value,hoverNodeId:null},window.addEventListener(`pointermove`,Jr),window.addEventListener(`pointerup`,Yr),window.addEventListener(`pointercancel`,Yr)}function Jr(e){let t=jr.value;if(!t)return;let n=c.value.getBoundingClientRect();if(t.wx=(e.clientX-n.left-q.offsetX.value)/q.scale.value,t.wy=(e.clientY-n.top-q.offsetY.value)/q.scale.value,t.end===`from`||t.end===`to`){let e=it(w.value,t.id),n=e?t.end===`from`?e.fromId:e.toId:null;t.hoverNodeId=yr(t.wx,t.wy,new Set(n?[n]:[]))?.id??null}}function Yr(){window.removeEventListener(`pointermove`,Jr),window.removeEventListener(`pointerup`,Yr),window.removeEventListener(`pointercancel`,Yr);let e=jr.value;if(jr.value=null,!e)return;let t=it(w.value,e.id);if(t){if(e.end===`c1`||e.end===`c2`)t[e.end]={x:Math.round(e.wx*2)/2,y:Math.round(e.wy*2)/2};else{let n=e.end===`from`?t.fromId:t.toId;if(!(e.hoverNodeId&&e.hoverNodeId!==n&&ct(w.value,e.id,e.end,e.hoverNodeId))){let r=An.value.find(e=>e.id===n);if(r){let n=Ir(r,Fr(r,{x:e.wx,y:e.wy}));e.end===`from`?t.fromT=n:t.toT=n}}}W(),G(),s(`change`,w.value),Kt=!0}}function Xr(e){if(a.previewMode)return;let t=it(w.value,e);t&&(Mr.value=e,Nr.value=t.label??``,kr.value=e,i(()=>{let e=document.querySelector(`.zm-relation-label-input`);e?.focus(),e?.select()}))}function Zr(){let e=Mr.value;if(!e)return;Mr.value=null;let t=it(w.value,e);if(!t)return;let n=Nr.value.trim();(t.label??``)!==n&&Ur(e,{label:n||void 0})}function Qr(e){let t=[],n=e=>{t.push(e.id);for(let t of e.children)n(t)};return n(e),t}let $r=!1;function ei(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea, .zm-relations`))return;if(e.button===2){$r=!0,q.startPan(e);return}if($r=!1,e.button!==0)return;let n=c.value.getBoundingClientRect(),r=(e.clientX-n.left-q.offsetX.value)/q.scale.value,i=(e.clientY-n.top-q.offsetY.value)/q.scale.value;q.startMarquee(r,i,{shift:e.shiftKey})}function ti(e){if(Kt){Kt=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`)||t.closest(`.zm-relations`)||t.closest(`.zm-toolbar`))return;let n=q.marquee;if(!(n.width>=4||n.height>=4)){if(Ar.value){Ar.value=null;return}if(kr.value){kr.value=null;return}d.value.size>0&&(d.value=new Set,J())}}function ni(){let e=q.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 An.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)}d.value=e.shiftKey?new Set([...d.value,...a]):new Set(a),J()}function ri(e){return p.value.has(e)}function ii(e){let t=U(w.value,e.id);return!!t&&t.children.length>0}function ai(e){let t=U(w.value,e);return t?tt(t):0}function oi(e){if(!U(w.value,e))return 0;let t=[w.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 si(e,t,n,r){let i=r?._dir??e._dir;if(t===`out`&&e.isRoot&&K.lineOrigin===`center`)return{x:e.x,y:e.y};if(t===`out`&&e.isRoot&&K.lineOrigin===`xmind`&&r){if(i===`down`)return{x:e.x,y:e.y};let t=n===void 0?e.side:n,a=e.children.filter(e=>e.side===t).sort((e,t)=>e.y-t.y),o=a.length,s=Math.max(0,a.findIndex(e=>e.id===r.id)),c=0;return o===2?c=.7:o>=3&&(c=s===0||s===o-1?.17:.45),{x:e.x+t*(e.width/2)*c,y:e.y}}if(t===`out`&&e.isRoot&&K.lineOrigin===`proportional`&&r){let t=r.x-e.x,n=r.y-e.y,i=e.width/2,a=e.height/2,o=t===0?1/0:i/Math.abs(t),s=n===0?1/0:a/Math.abs(n),c=Math.min(o,s);return Number.isFinite(c)?{x:e.x+t*c,y:e.y+n*c}:{x:e.x,y:e.y}}if(i===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let a;a=t===`in`?-e.side:n===void 0?e.side:n;let o=t===`in`?e._richInsetX??0:0;return{x:e.x+a*(e.width/2-o),y:e.y}}function ci(){let e=On.value;q.resetView(e.width,e.height,e.root.y)}function li(){en.value=!0,W(),G(),i(()=>ci())}function ui(e){K.layoutMode!==e&&(K.layoutMode=e,G(),i(()=>ci()))}function di(){return JSON.stringify(w.value,null,2)}function fi(e){let t=U(w.value,e);return t?!!(t.note&&t.note.text||t.link&&t.link.url||t.image&&t.image.src||t.richContent&&t.richContent.raw||t.markers&&t.markers.length>0||t.tags&&t.tags.length>0):!1}function pi(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(tn.reset(),w.value=H(t),d.value=new Set,p.value=new Set,G(),i(()=>ci()),s(`change`,w.value),!0)}catch{return!1}}function mi(){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`&&(pi(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function hi(){let e=new Blob([di()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${w.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}let gi=A(``),_i=A([]),vi=A(-1);function yi(e){gi.value=e;let t=e.trim();if(!t){_i.value=[],vi.value=-1;return}let n=t.toLowerCase(),r=[],a=e=>{var t;(e.text.toLowerCase().includes(n)||(t=e.note)!=null&&t.text&&e.note.text.toLowerCase().includes(n))&&r.push(e.id);for(let t of e.children)a(t)};a(w.value),_i.value=r,vi.value=r.length>0?0:-1,r.length>0&&(Ei(r),i(()=>Di(0)))}function bi(){_i.value.length!==0&&(vi.value=(vi.value+1)%_i.value.length,Di(vi.value))}function xi(){_i.value.length!==0&&(vi.value=(vi.value-1+_i.value.length)%_i.value.length,Di(vi.value))}function Si(){gi.value=``,_i.value=[],vi.value=-1}function Ci(e){return _i.value.includes(e)}function wi(e){return vi.value>=0&&_i.value[vi.value]===e}function Ti(e){return gi.value.trim().length>0&&_i.value.length>0&&!_i.value.includes(e)}function Ei(e){if(e.length===0)return;let t=new Set(e),n=new Set,r=e=>{let i=t.has(e.id);for(let t of e.children)r(t)&&(i=!0);return i&&e.children.length>0&&p.value.has(e.id)&&n.add(e.id),i};if(r(w.value),n.size>0){for(let e of n)p.value.delete(e);G()}}function Di(e){let t=_i.value[e];if(!t)return;let n=An.value.find(e=>e.id===t);n&&(d.value=new Set([t]),J(),q.centerOn(n.x,n.y,n.width,n.height))}function Oi(e,t){let n=U(w.value,e);n&&(n.markers||=[],!n.markers.includes(t)&&(n.markers.push(t),W(),G(),s(`change`,w.value)))}function ki(e,t){let n=U(w.value,e);if(!n||!n.markers)return;let r=n.markers.indexOf(t);r<0||(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,W(),G(),s(`change`,w.value))}function Ai(e,t){let n=U(w.value,e);if(!n)return!1;n.markers||=[];let r=n.markers.indexOf(t);return r>=0?(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,W(),G(),s(`change`,w.value),!1):(n.markers.push(t),W(),G(),s(`change`,w.value),!0)}function ji(e){let t=U(w.value,e);return t!=null&&t.markers?[...t.markers]:[]}function Mi(e,t){var n;return!!((n=U(w.value,e)?.markers)!=null&&n.includes(t))}function Ni(e){let t=B.value?.nodeId;t&&Ai(t,e)}function Pi(){let e=B.value?.nodeId;if(!e)return;let t=U(w.value,e);!t||!t.markers||(delete t.markers,W(),G(),s(`change`,w.value),ge())}function Fi(e,t){let n=U(w.value,e);n&&(t.length===0?n.tags&&delete n.tags:n.tags=[...t],W(),G(),s(`change`,w.value))}function Ii(e){let t=U(w.value,e);return t!=null&&t.tags?[...t.tags]:[]}function Li(){let e=B.value?.nodeId;if(!e)return;let t=(U(w.value,e)?.tags)?.join(`, `)??``,n=window.prompt(`输入标签(多个用逗号分隔)`,t);n!==null&&(Fi(e,n.split(/[,,]/).map(e=>e.trim()).filter(e=>e.length>0)),ge())}function Ri(){let e=B.value?.nodeId;e&&(Fi(e,[]),ge())}function zi(){let e=On.value,t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.setAttribute(`viewBox`,`${e.vbX} ${e.vbY} ${e.vbW} ${e.vbH}`),n.setAttribute(`width`,String(e.vbW)),n.setAttribute(`height`,String(e.vbH));let r=document.createElementNS(t,`rect`);r.setAttribute(`x`,String(e.vbX)),r.setAttribute(`y`,String(e.vbY)),r.setAttribute(`width`,String(e.vbW)),r.setAttribute(`height`,String(e.vbH)),r.setAttribute(`fill`,on.value),n.appendChild(r);for(let e of jn.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,mn(si(e.from,`out`,e.to.side,e.to),si(e.to,`in`),cn(e.from.depth),ln(e.to.depth),32,sn(e.from.isRoot),e.to._dir)),r.setAttribute(`fill`,yn(e.from,e.to)),r.setAttribute(`stroke`,`none`),n.appendChild(r)}let i=`-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif`;function a(e,t){let n=0;for(let r of e)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(r)?n+=t:n+=t*.55;return n}for(let e of zr.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,e.d),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,e.rel.color??`#94a3b8`),r.setAttribute(`stroke-width`,`1.5`),r.setAttribute(`stroke-dasharray`,`6 4`),r.setAttribute(`stroke-linecap`,`round`),n.appendChild(r);let a=e.rel.color??`#94a3b8`;for(let r of[e.arrowEnd,e.arrowStart]){if(!r)continue;let e=document.createElementNS(t,`path`);e.setAttribute(`d`,r),e.setAttribute(`fill`,a),e.setAttribute(`stroke`,`none`),n.appendChild(e)}if(e.rel.label){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(e.labelPos.x)),r.setAttribute(`y`,String(e.labelPos.y-6)),r.setAttribute(`text-anchor`,`middle`),r.setAttribute(`font-size`,`12`),r.setAttribute(`font-family`,i),r.setAttribute(`fill`,`#64748b`),r.setAttribute(`stroke`,on.value),r.setAttribute(`stroke-width`,`3`),r.setAttribute(`paint-order`,`stroke`),r.textContent=e.rel.label,n.appendChild(r)}}for(let e of An.value){let r=e.x-e.width/2,o=e.y-e.height/2,s=document.createElementNS(t,`rect`);s.setAttribute(`x`,String(r)),s.setAttribute(`y`,String(o)),s.setAttribute(`width`,String(e.width)),s.setAttribute(`height`,String(e.height)),s.setAttribute(`rx`,`8`),s.setAttribute(`fill`,bn(e));let c=Cn(e);c!==`transparent`&&(s.setAttribute(`stroke`,c),s.setAttribute(`stroke-width`,`1`)),n.appendChild(s);let l=!!(e.tags&&e.tags.length>0),u=!!(e.markers&&e.markers.length>0),d=!!e.image,f=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),p=0,m=0;if(f){let r=e.richContent,s=e.fontSize*.78*.92;if(r.kind===`code`){let c=As(r.raw),l=js(r.raw),u=c.split(`
|
|
169
|
+
| a | b | c |`);if(r===null)return;let i=r.trim();if(!i){de(e,null);return}de(e,{kind:`table`,raw:i})}function Mt(){let e=B.value?.nodeId;e&&de(e,null)}function Pt(){let e=B.value?.nodeId;e&&Wr(e)}function Ft(e){i.previewMode||(u.value=new Set([e]),J(),i.builtInDrawers&&(Ae(),Te.value=!0,De.value++),a(`edit-note`,e))}function Lt(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function Rt(e){if(i.previewMode||c.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=d.value;if(!n)return;let r=e.clipboardData?.items;if(!r)return;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=U(D.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;z(t,e=>F(n,e));return}}if(C.value&&C.value.nodes.length>0)return;let o=null;for(let t=0;t<r.length;t++){let n=r[t];if(n.kind===`string`&&n.type===`text/plain`){o=e.clipboardData?.getData(`text/plain`)??null;break}}if(!o)return;let s=o.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);if(s.length!==0){e.preventDefault(),W();for(let e of s)Ye(D.value,n,e);G(),a(`change`,D.value)}}_(()=>{window.addEventListener(`paste`,Rt),window.addEventListener(`keydown`,zt),G()}),g(()=>{window.removeEventListener(`paste`,Rt),window.removeEventListener(`keydown`,zt)});function zt(e){if((e.metaKey||e.ctrlKey)&&(e.key===`f`||e.key===`F`)){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;e.preventDefault(),a(`canvas-outline`);return}if((e.key===`Delete`||e.key===`Backspace`)&&kr.value){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||i.previewMode)return;e.preventDefault(),Hr(kr.value)}}let Bt=m(null),Vt=r(()=>Bt.value?.nodeId??null);function Ht(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;Bt.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`,Ut),window.addEventListener(`mouseup`,Wt)}function Ut(e){let t=Bt.value;if(!t)return;let n=q.scale.value||1,r=e.clientX-t.startX,i=R(t.startW+r/n,pd,md),a=R(i*t.ratio,pd,md);t.pendingW=i,t.pendingH=a;let s=o.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);s&&(s.style.width=`${i}px`,s.style.height=`${a}px`);let c=o.value?.querySelector(`[data-node-id="${t.nodeId}"]`);c&&(c.style.minWidth=`${Math.max(80,Math.ceil(i+28))}px`,c.style.height=`${Math.ceil(a+8+30)}px`)}function Wt(){let e=Bt.value;if(window.removeEventListener(`mousemove`,Ut),window.removeEventListener(`mouseup`,Wt),Bt.value=null,!e)return;let t=U(D.value,e.nodeId);!t||!t.image||(F(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),u.value=new Set([e.nodeId]),J(),Kt=!0)}let Gt=m(null),Kt=!1,qt=!1;function Yt(e){Gt.value=e}function Xt(e){Gt.value===e&&(Gt.value=null),w.value&&=null}function Zt(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,s=r.width-120-10,c=Math.max(130,Math.min(a,s)),l=i?n.top-r.top-8:n.bottom-r.top+8;w.value={text:t.text,x:c,y:l,above:i}}function Qt(e){return Gt.value===e||d.value===e}let $t=m(0),en=m(!1),tn=vt(100);function W(){tn.record({data:D.value,selectedIds:[...u.value]})}function nn(e,t={}){D.value=H(e),t.resetCollapsed&&(f.value=new Set),t.resetSelection&&(u.value=new Set,J()),G(),a(`change`,D.value)}function G(){f.value=new Set(f.value),$t.value++,s().then(()=>s()).then(()=>rn()).then(()=>{$t.value++})}function rn(){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,ee.value[i],O.value[i]}),ee.value=t,O.value=n}let an=r(()=>({rootBg:i.theme?.rootBg??`#1f2937`,rootText:i.theme?.rootText??`#ffffff`,branchBg:i.theme?.branchBg??`#ffffff`,branchText:i.theme?.branchText??`#1f2937`,lineColor:i.theme?.lineColor??`#94a3b8`,bgColor:i.theme?.bgColor??`#f8fafc`,fontSize:i.theme?.fontSize??14,lineWidthStart:i.theme?.lineWidthStart??2.2,lineWidthEnd:i.theme?.lineWidthEnd??.8,rainbowBranch:i.theme?.rainbowBranch??!1})),on=r(()=>K.canvasBg||an.value.bgColor),K=y({autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function sn(e){return e?K.rootLineStyle:K.lineStyle}function cn(e){return K.taperedEdge?K.uniformLineWidth&&e>0?K.lineWidthEnd:un(e):dn(e)}function ln(e){return K.taperedEdge?K.lineWidthEnd:dn(e)}function un(e){let t=K.lineWidthTaper,n=K.lineWidthStart*t**+e;return Math.max(K.lineWidthEnd,n)}function dn(e){if(e<=0)return K.lineWidthStart;if(e>=3)return K.lineWidthEnd;let t=e/3;return K.lineWidthStart+(K.lineWidthEnd-K.lineWidthStart)*t}function fn(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 pn(e,t,n,r){let i=1-e;return{x:i*i*t.x+2*i*e*n.x+e*e*r.x,y:i*i*t.y+2*i*e*n.y+e*e*r.y}}function mn(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:fn(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}if(a===`arc`){let a;a=o===`right`||o===`left`?{x:(e.x+t.x)/2,y:t.y}:{x:t.x,y:(e.y+t.y)/2};let s=n=>{let r=1-n;return{dx:2*r*(a.x-e.x)+2*n*(t.x-a.x),dy:2*r*(a.y-e.y)+2*n*(t.y-a.y)}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:pn(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=n/2,d=r/2,f=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)f+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;f+=` A ${d.toFixed(2)} ${d.toFixed(2)} 0 0 0 ${l[i].x.toFixed(2)} ${l[i].y.toFixed(2)}`;for(let e=i-1;e>=0;e--)f+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return f+=` A ${u.toFixed(2)} ${u.toFixed(2)} 0 0 0 ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`,f+=` Z`,f}if(a===`elbow`){let i=[];if(o===`down`){let n=(e.y+t.y)/2;i.push(e,{x:e.x,y:n},{x:t.x,y:n},t)}else{let n=(e.x+t.x)/2;i.push(e,{x:n,y:e.y},{x:n,y:t.y},t)}let a=[],s=0;for(let e=0;e<i.length-1;e++){let t=Math.hypot(i[e+1].x-i[e].x,i[e+1].y-i[e].y);a.push(t),s+=t}let c=[n/2],l=0;for(let e=0;e<a.length-1;e++){l+=a[e];let t=s>0?l/s:0;c.push((n+(r-n)*t)/2)}c.push(r/2);let u=[];for(let e=0;e<i.length-1;e++){let t=i[e+1].x-i[e].x,n=i[e+1].y-i[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),u.push({x:-n/r,y:t/r})}let d=[],f=[];d.push({x:i[0].x+u[0].x*c[0],y:i[0].y+u[0].y*c[0]}),f.push({x:i[0].x-u[0].x*c[0],y:i[0].y-u[0].y*c[0]});for(let e=1;e<i.length-1;e++){let t=u[e-1],n=u[e],r=c[e],a=t.x+n.x,o=t.y+n.y,s=a*a+o*o;if(s<1e-6)d.push({x:i[e].x+t.x*r,y:i[e].y+t.y*r}),f.push({x:i[e].x-t.x*r,y:i[e].y-t.y*r});else{let t=2*r/s;d.push({x:i[e].x+a*t,y:i[e].y+o*t}),f.push({x:i[e].x-a*t,y:i[e].y-o*t})}}let p=u[u.length-1],m=c[c.length-1];d.push({x:i[i.length-1].x+p.x*m,y:i[i.length-1].y+p.y*m}),f.push({x:i[i.length-1].x-p.x*m,y:i[i.length-1].y-p.y*m});let h=`M ${d[0].x.toFixed(2)} ${d[0].y.toFixed(2)}`;for(let e=1;e<d.length;e++)h+=` L ${d[e].x.toFixed(2)} ${d[e].y.toFixed(2)}`;for(let e=f.length-1;e>=0;e--)h+=` L ${f[e].x.toFixed(2)} ${f[e].y.toFixed(2)}`;return h+=` Z`,h}if(a===`rounded-elbow`&&!(o===`down`?Math.abs(e.x-t.x)<.5:Math.abs(e.y-t.y)<.5)){let i=function(e,t,n){let r={x:e.pos.x-t*e.d1.x,y:e.pos.y-t*e.d1.y},i={x:e.pos.x+t*e.d2.x,y:e.pos.y+t*e.d2.y},a={x:e.pos.x+t*(e.d2.x-e.d1.x),y:e.pos.y+t*(e.d2.y-e.d1.y)},o=Math.atan2(r.y-a.y,r.x-a.x),s=Math.atan2(i.y-a.y,i.x-a.x)-o;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;let c=[];for(let e=1;e<n;e++){let r=e/n,i=o+s*r;c.push({x:a.x+t*Math.cos(i),y:a.y+t*Math.sin(i)})}return c},a=[],s;if(o===`down`){let n=(e.y+t.y)/2,r=Math.sign(n-e.y)||1,i=Math.sign(t.x-e.x)||1,a=Math.sign(t.y-n)||1;s=[{pos:{x:e.x,y:n},d1:{x:0,y:r},d2:{x:i,y:0}},{pos:{x:t.x,y:n},d1:{x:i,y:0},d2:{x:0,y:a}}]}else{let n=(e.x+t.x)/2,r=Math.sign(n-e.x)||1,i=Math.sign(t.y-e.y)||1,a=Math.sign(t.x-n)||1;s=[{pos:{x:n,y:e.y},d1:{x:r,y:0},d2:{x:0,y:i}},{pos:{x:n,y:t.y},d1:{x:0,y:i},d2:{x:a,y:0}}]}let c=Math.hypot(s[1].pos.x-s[0].pos.x,s[1].pos.y-s[0].pos.y),l=Math.hypot(t.x-s[1].pos.x,t.y-s[1].pos.y),u=Math.min(c,l,K.elbowRadius)*.5,d=Math.max(2,u);a.push(e),a.push(s[0].pos),a.push({x:s[1].pos.x-d*s[1].d1.x,y:s[1].pos.y-d*s[1].d1.y});for(let e of i(s[1],d,12))a.push(e);a.push(t);let f=[],p=0;for(let e=0;e<a.length-1;e++){let t=Math.hypot(a[e+1].x-a[e].x,a[e+1].y-a[e].y);f.push(t),p+=t}let m=[];for(let e=0;e<a.length-1;e++){let t=a[e+1].x-a[e].x,n=a[e+1].y-a[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),m.push({x:-n/r,y:t/r})}let h=[],g=0;for(let e=0;e<a.length;e++){e>0&&(g+=f[e-1]);let t=p>0?g/p:0;h.push((n+(r-n)*t)/2)}let _=[],v=[];for(let e=0;e<a.length;e++){let t=h[e];if(e===0){let n=m[0];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else if(e===a.length-1){let n=m[m.length-1];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else{let n=m[e-1],r=m[e],i=n.x+r.x,o=n.y+r.y,s=i*i+o*o;if(s<1e-6)_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t});else{let n=2*t/s;_.push({x:a[e].x+i*n,y:a[e].y+o*n}),v.push({x:a[e].x-i*n,y:a[e].y-o*n})}}}let y=`M ${_[0].x.toFixed(2)} ${_[0].y.toFixed(2)}`;for(let e=1;e<_.length;e++)y+=` L ${_[e].x.toFixed(2)} ${_[e].y.toFixed(2)}`;y+=` L ${v[_.length-1].x.toFixed(2)} ${v[_.length-1].y.toFixed(2)}`;for(let e=v.length-2;e>=0;e--)y+=` L ${v[e].x.toFixed(2)} ${v[e].y.toFixed(2)}`;return y+=` Z`,y}{let i=t.x-e.x,a=t.y-e.y,o=Math.hypot(i,a);o<1e-6&&(o=1);let s=-a/o,c=i/o,l=n/2,u=r/2,d={x:e.x+s*l,y:e.y+c*l},f={x:e.x-s*l,y:e.y-c*l},p={x:t.x-s*u,y:t.y-c*u},m={x:t.x+s*u,y:t.y+c*u};return`M ${d.x.toFixed(2)} ${d.y.toFixed(2)} L ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${p.x.toFixed(2)} ${p.y.toFixed(2)} L ${f.x.toFixed(2)} ${f.y.toFixed(2)} Z`}}let hn=r(()=>On.value.root.children),gn=Re[0].colors,_n=r(()=>ze(K.branchPaletteId,K.customPalettes)),vn=r(()=>{let e=new Map;if(!K.rainbowBranch)return e;let t=i.lineColors,n=t&&t.length>0?t:_n.value.colors.length>0?_n.value.colors:gn;for(let t=0;t<hn.value.length;t++){let r=hn.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<hn.value.length;e++){let t=hn.value[e];r(t,n[e%n.length])}return e});function yn(e,t){return K.rainbowBranch?vn.value.get(t.id)??an.value.lineColor:an.value.lineColor}function bn(e){let t=P(e.id);if(t.bg)return t.bg;if(e.isRoot)return an.value.rootBg;if(e.depth>=3)return`transparent`;let n=e.depth===1?.15:.08;if(K.rainbowBranch){let t=vn.value.get(e.id);if(t)return En(t,n)}return En(an.value.rootBg,n)}function Sn(e){let t=P(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return an.value.rootText;if(K.rainbowBranch){let t=vn.value.get(e.id);if(t)return Dn(t,.55)}return an.value.branchText}function Cn(e){let t=P(e.id);return t.borderColor?t.borderColor:`transparent`}function wn(e){let t=P(e.id);return t.fontWeight?t.fontWeight:e.isRoot?700:e.depth<=1?600:e.depth===2?500:400}function Tn(e){return P(e.id).fontSize??e.fontSize??an.value.fontSize}function En(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 Dn(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 q=mt({getContainer:()=>o.value});q.setOnMarqueeEnd(ni),_t({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>d.value,getSelectedIds:()=>[...u.value],defaultTargetId:()=>D.value.id,onAddChild:Wn,onAddSibling:Gn,onAddSiblingBefore:Kn,onRemove:sr,onStartEdit:Pn,onClearSelection:()=>{if(Ar.value){Ar.value=null;return}if(kr.value){kr.value=null;return}u.value=new Set,J()},onDuplicate:qn,onCopy:Qn,onCut:er,onPaste:tr,hasClipboard:()=>!!C.value&&C.value.nodes.length>0,onUndo:nr,onRedo:rr,onNavigate:ir,onMoveSibling:_r,onSelectRoot:()=>{u.value=new Set([D.value.id]),J()}});let On=r(()=>{let e=H(D.value);return Nn(e),je(e,{mode:K.layoutMode,baseFontSize:an.value.fontSize,richHeights:ee.value,richWidths:O.value,branchGap:K.branchGap})}),kn=m([]),An=r(()=>($t.value,kn.value));b(On,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),kn.value=t},{immediate:!0});let jn=r(()=>{let e=[];for(let t of An.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),Mn=r(()=>`${On.value.vbX} ${On.value.vbY} ${On.value.vbW} ${On.value.vbH}`);function Nn(e){if(f.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)Nn(t)}function Pn(e){let t=U(D.value,e);t&&(c.value=e,l.value=t.text,u.value=new Set([e]),J(),s(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select(),Ln(e)}))}function Fn(){if(!c.value)return;let e=U(D.value,c.value);e&&e.text!==(l.value.trim()||` `)&&(e.text=l.value.trim()||` `,W(),a(`change`,D.value)),c.value=null}function In(){c.value=null}function Ln(e){e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)}function Rn(e){Ln(e.target)}function zn(e){if(i.previewMode)return;let t=U(D.value,e);t!=null&&t.richContent&&(T.value=e,E.value=t.richContent.raw,s(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function Bn(){if(!T.value)return;let e=T.value,t=U(D.value,e),n=E.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?de(e,{kind:`code`,raw:n,lang:js(n)||void 0}):de(e,{kind:`table`,raw:n})),T.value=null}function Vn(){T.value=null}function Hn(e){e.key===`Escape`?(e.preventDefault(),Vn()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),Bn())}function Un(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),nr()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),rr())}function Wn(e){let t=Ye(D.value,e,nt);t&&(W(),G(),a(`change`,D.value),s(()=>Pn(t.id)))}function Gn(e){if(e===D.value.id){Wn(e);return}let t=Xe(D.value,e,nt);t&&(W(),G(),a(`change`,D.value),s(()=>Pn(t.id)))}function Kn(e){if(e===D.value.id){Wn(e);return}let t=Ze(D.value,e,nt);t&&(W(),G(),a(`change`,D.value),s(()=>Pn(t.id)))}function qn(e){if(e===D.value.id)return;let t=Qe(D.value,e);t&&(W(),u.value=new Set([t.id]),J(),a(`change`,D.value),G())}function Jn(e){let t=[],n=new Set;for(let r of e)r!==D.value.id&&(n.has(r)||U(D.value,r)&&(n.add(r),t.push(r)));return t}function Yn(e){let t=new Set(e),n=[],r=e=>{t.has(e.id)&&n.push(e.id);for(let t of e.children)r(t)};return r(D.value),n}function Xn(e){var t;try{(t=navigator.clipboard)==null||t.writeText(e)}catch{}}function Zn(e){let t=[],n=(e,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;t.push(i+a+(e.text||``));for(let t of e.children)n(t,r+1)};return n(e,0),t.join(`
|
|
170
|
+
`)}function Qn(e){if(e.includes(D.value.id)){C.value=null,Xn(Zn(D.value)),G();return}let t=Yn(Jn(e));if(t.length===0)return;let n=[];for(let e of t){let t=et(D.value,e);t&&n.push(t)}n.length!==0&&(C.value={nodes:n,originalIds:new Set(t)},Xn(n.map(e=>e.text).join(`
|
|
171
|
+
`)),G())}function er(e){let t=Yn(Jn(e));if(t.length===0)return;let n=[];for(let e of t){let t=et(D.value,e);t&&n.push(t)}if(n.length===0)return;W();let r=[];for(let e of t){let t=U(D.value,e);t&&r.push(...Qr(t))}for(let e of t)Ge(D.value,e);for(let e of r)lt(D.value,e);u.value=new Set,J(),C.value={nodes:n,originalIds:new Set(t)},Xn(n.map(e=>e.text).join(`
|
|
172
|
+
`)),G(),a(`change`,D.value)}function tr(e){let t=C.value;if(!t||t.nodes.length===0)return;let n=e??D.value.id,r=U(D.value,n);if(r){for(let e of t.originalIds){let t=U(D.value,e);if(t&&U(t,n))return}W();for(let e of t.nodes){let t=H(e);$e(t),r.children.push(t)}C.value=null,G(),a(`change`,D.value)}}function nr(){let e=tn.undo();e&&(D.value=e.data,u.value=new Set(e.selectedIds??[]),J(),G(),a(`change`,D.value))}function rr(){let e=tn.redo();e&&(D.value=e.data,u.value=new Set(e.selectedIds??[]),J(),G(),a(`change`,D.value))}function J(){let e=[];for(let t of u.value){let n=U(D.value,t);n&&e.push(n)}if(i.builtInDrawers&&!i.previewMode&&e.length>0){let t=e[0];!Te.value&&fi(t.id)&&(Ae(),Te.value=!0)}else i.builtInDrawers&&e.length===0&&(Te.value=!1);a(`select`,e.length>0?e:null)}function ir(e,t){let n=d.value??D.value.id,r=U(D.value,n);if(!r)return;let i=null;if(t===1){let e=We(D.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=We(D.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=We(D.value,r.id);e&&(i=e.id)}else e===-1&&r.children.length>0&&(i=r.children[0].id);i&&(u.value=new Set([i]),J())}function ar(e){return e.split(`
|
|
173
|
+
`).map(e=>e.replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim()).filter(e=>e.length>0)}function or(e){return e.replace(/\s+/g,` `).trim()}function sr(e){var t;if(e===D.value.id)return;let n=U(D.value,e),r=n?Qr(n):[e];if(Ge(D.value,e)){for(let e of r)lt(D.value,e);if((t=Ar.value)!=null&&t.fromId&&r.includes(Ar.value.fromId)&&(Ar.value=null),W(),u.value.has(e)){let t=new Set(u.value);t.delete(e),u.value=t,J()}G(),a(`change`,D.value)}}function cr(e){f.value.has(e)?f.value.delete(e):f.value.add(e),G()}function lr(e){let t=[{n:D.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 dr(){f.value=new Set,lr(e=>{e.children.length>0&&f.value.add(e.id)}),G()}function fr(e){f.value=new Set,lr((t,n)=>{n>e&&t.children.length>0&&f.value.add(t.id)}),G()}function pr(){f.value=new Set,G()}function mr(e,t){Ke(D.value,e,t)&&(W(),G(),a(`change`,D.value))}function hr(e,t,n){return qe(D.value,e,t,n)?(W(),G(),a(`change`,D.value),!0):!1}function gr(e,t,n){let r=e.filter(e=>e!==t);if(r.length===0)return!1;for(let e of r){if(!We(D.value,e))return!1;let n=U(D.value,e);if(n&&U(n,t))return!1}if(r.length===1)return hr(r[0],t,n);let i=n===`after`?[...r].reverse():r,o=!1;for(let e of i)qe(D.value,e,t,n)&&(o=!0);return o?(W(),G(),a(`change`,D.value),!0):!1}function _r(e){let t=d.value;if(!t)return;let n=D.value;if(t===n.id)return;let r=We(n,t);if(!r)return;let i=r.children.findIndex(e=>e.id===t);if(i<0)return;let o=e,s=An.value.find(e=>e.id===t);if(s&&Dr(s)&&(o=-e),o<0){if(i===0)return;let e=r.children[i-1].id;qe(n,t,e,`before`)}else{if(i>=r.children.length-1)return;let e=r.children[i+1].id;qe(n,t,e,`after`)}W(),G(),a(`change`,n)}function vr(e,t){if(qt){qt=!1;return}if(e.stopPropagation(),Ar.value){let e=Ar.value;e.fromId?e.fromId!==t.id&&(Vr(e.fromId,t.id),Ar.value=null):(e.fromId=t.id,u.value=new Set([t.id]),J());return}if(kr.value=null,e.shiftKey){let e=new Set(u.value);e.has(t.id)?e.delete(t.id):e.add(t.id),u.value=e}else u.value=new Set([t.id]);J()}function yr(e,t,n){let r=null;for(let i of An.value){if(n.has(i.id))continue;let a=i.width/2,o=i.height/2;e>=i.x-a&&e<=i.x+a&&t>=i.y-o&&t<=i.y+o&&(r=i)}return r}function br(){let e=new Map,t=0,n=r=>{e.set(r.id,t++);for(let e of r.children)n(e)};return n(D.value),e}function xr(e){let t=br();return[...e].sort((e,n)=>(t.get(e)??0)-(t.get(n)??0))}function Sr(e){let t=new Set(e);return e.filter(e=>{let n=We(D.value,e);for(;n;){if(t.has(n.id))return!1;n=We(D.value,n.id)}return!0})}let Cr=null;function wr(e,t){if(i.previewMode||e.button!==0)return;qt=!1;let n=e.target;if(n!=null&&n.closest(`.zm-img-resize-handle`))return;if(kr.value){let t=zr.value.find(e=>e.rel.id===kr.value);if(t){let n=o.value.getBoundingClientRect(),r=q.scale.value,i=e=>n.left+e.x*r+q.offsetX.value,a=e=>n.top+e.y*r+q.offsetY.value,s=Math.hypot(e.clientX-i(t.from),e.clientY-a(t.from)),c=Math.hypot(e.clientX-i(t.to),e.clientY-a(t.to));if(Math.min(s,c)<=20){e.stopPropagation(),e.preventDefault(),qt=!0,qr(e,t.rel.id,s<=c?`from`:`to`);return}}}if(t.isRoot)return;e.stopPropagation();let r=o.value.getBoundingClientRect(),a=t.x*q.scale.value+q.offsetX.value,s=t.y*q.scale.value+q.offsetY.value,c=e.clientX-r.left-a,l=e.clientY-r.top-s,d=u.value,f=d.size>1&&d.has(t.id)?Sr(xr([...d])):[t.id],p=f.includes(t.id)?t.id:f[0];Cr={srcIds:f,srcText:p===t.id?t.text:An.value.find(e=>e.id===p)?.text??t.text,pointerOffsetX:c,pointerOffsetY:l,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,Tr),window.addEventListener(`pointerup`,Or),window.addEventListener(`pointercancel`,Or)}function Tr(e){if(Cr){let t=e.clientX-Cr.startX,n=e.clientY-Cr.startY;if(Math.abs(t)<=gd&&Math.abs(n)<=gd)return;h.value={srcIds:Cr.srcIds,srcText:Cr.srcText,pointerOffsetX:Cr.pointerOffsetX,pointerOffsetY:Cr.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add(`is-dragging`),Cr=null}let t=h.value;if(!t)return;let n=o.value.getBoundingClientRect();v.value=e.clientX-n.left-t.pointerOffsetX,x.value=e.clientY-n.top-t.pointerOffsetY;let r=(e.clientX-n.left-q.offsetX.value)/q.scale.value,i=(e.clientY-n.top-q.offsetY.value)/q.scale.value,a=yr(r,i,new Set(t.srcIds));t.currentTargetId=a?.id??null,t.dropPosition=a?Er(r,i,a):null}function Er(e,t,n){if(n.isRoot)return`child`;let r=n.width/2,i=n.height/2;if(n._dir===`down`){let t=e-n.x;return t<-r*.3?`before`:t>r*.3?`after`:`child`}let a=t-n.y;return a<-i*.3?`before`:a>i*.3?`after`:`child`}function Dr(e){var t;return!!((t=e.parent)!=null&&t.isRoot)&&e._dir===`left`}function Or(e){if(window.removeEventListener(`pointermove`,Tr),window.removeEventListener(`pointerup`,Or),window.removeEventListener(`pointercancel`,Or),Cr){Cr=null;return}let t=h.value;if(t){if(t.currentTargetId&&t.dropPosition){let e=t.dropPosition;if(e!==`child`){let n=An.value.find(e=>e.id===t.currentTargetId);n&&Dr(n)&&(e=e===`before`?`after`:`before`)}gr(t.srcIds,t.currentTargetId,e),u.value=new Set(t.srcIds),J(),Kt=!0}h.value=null,v.value=0,x.value=0,document.body.classList.remove(`is-dragging`)}}let kr=m(null),Ar=m(null),jr=m(null),Mr=m(null),Nr=m(``);function Pr(e,t){let n=e.width/2,r=e.height/2,i=(t%4+4)%4;return i<1?{x:e.x-n+2*n*i,y:e.y-r}:i<2?{x:e.x+n,y:e.y-r+2*r*(i-1)}:i<3?{x:e.x+n-2*n*(i-2),y:e.y+r}:{x:e.x-n,y:e.y+r-2*r*(i-3)}}function Fr(e,t){let n=t.x-e.x,r=t.y-e.y,i=e.width/2,a=e.height/2;if(Math.abs(n)<1e-6&&Math.abs(r)<1e-6)return{x:e.x+i,y:e.y};let o=Math.abs(n)>1e-6?i/Math.abs(n):1/0,s=Math.abs(r)>1e-6?a/Math.abs(r):1/0,c=Math.min(o,s);return{x:e.x+n*c,y:e.y+r*c}}function Ir(e,t){let n=e.width/2||1,r=e.height/2||1,i=t.x-e.x,a=t.y-e.y;return Math.abs(i)/n>Math.abs(a)/r?i>0?1+R((a+r)/(2*r),0,1):3+R((r-a)/(2*r),0,1):a<0?R((i+n)/(2*n),0,1):2+R((n-i)/(2*n),0,1)}function Lr(e,t,n,r){let i=t===`from`?n:r,a=t===`from`?r:n,o=jr.value;if(o&&o.id===e.id&&o.end===t)return Fr(i,{x:o.wx,y:o.wy});let s=t===`from`?e.fromT:e.toT;return s===void 0?Fr(i,{x:a.x,y:a.y}):Pr(i,s)}function Rr(e,t){let n=Math.hypot(t.x,t.y);if(n<1e-6)return null;let r=t.x/n,i=t.y/n,a=e.x-r*9,o=e.y-i*9,s=-i*(7/2),c=7/2*r;return`M ${e.x.toFixed(2)} ${e.y.toFixed(2)} L ${(a+s).toFixed(2)} ${(o+c).toFixed(2)} L ${(a-s).toFixed(2)} ${(o-c).toFixed(2)} Z`}let zr=r(()=>{let e=D.value.relations;if(!e||e.length===0)return[];let t=[];for(let n of e){let e=An.value.find(e=>e.id===n.fromId),r=An.value.find(e=>e.id===n.toId);if(!e||!r)continue;let i=Lr(n,`from`,e,r),a=Lr(n,`to`,e,r),o=jr.value,s=n.c1,c=n.c2;if(o&&o.id===n.id&&o.end===`c1`&&(s={x:o.wx,y:o.wy}),o&&o.id===n.id&&o.end===`c2`&&(c={x:o.wx,y:o.wy}),!s||!c){let e=a.x-i.x,t=a.y-i.y,n=Math.hypot(e,t)||1,r=-t/n,o=e/n;o>0&&(r=-r,o=-o);let l=R(n*.18,24,160),u={x:(i.x+a.x)/2+r*l,y:(i.y+a.y)/2+o*l};s||=u,c||=u}let l=`M ${i.x.toFixed(2)} ${i.y.toFixed(2)} C ${s.x.toFixed(2)} ${s.y.toFixed(2)} ${c.x.toFixed(2)} ${c.y.toFixed(2)} ${a.x.toFixed(2)} ${a.y.toFixed(2)}`,u=fn(.5,i,{x1:s.x,y1:s.y,x2:c.x,y2:c.y},a),d=n.arrow??`end`,f=d===`none`?null:Rr(a,{x:a.x-c.x,y:a.y-c.y}),p=d===`both`?Rr(i,{x:i.x-s.x,y:i.y-s.y}):null;t.push({rel:n,from:i,to:a,c1:s,c2:c,d:l,labelPos:u,arrowEnd:f,arrowStart:p})}return t}),Br=r(()=>zr.value.find(e=>e.rel.id===Mr.value)??null);function Vr(e,t){let n=at(D.value,e,t);return n?(W(),G(),a(`change`,D.value),kr.value=n.id,u.value=new Set,J(),n.id):null}function Hr(e){ot(D.value,e)&&(W(),kr.value===e&&(kr.value=null),Mr.value===e&&(Mr.value=null),G(),a(`change`,D.value))}function Ur(e,t){st(D.value,e,t)&&(W(),G(),a(`change`,D.value))}function Wr(e){i.previewMode||(Ar.value={fromId:e},e&&(u.value=new Set([e]),J()))}function Gr(){if(Ar.value){Ar.value=null;return}Wr(d.value)}function Kr(e,t){e.stopPropagation(),kr.value=t,u.value=new Set,J()}function qr(e,t,n){if(i.previewMode)return;e.stopPropagation(),e.preventDefault();let r=o.value.getBoundingClientRect();jr.value={id:t,end:n,wx:(e.clientX-r.left-q.offsetX.value)/q.scale.value,wy:(e.clientY-r.top-q.offsetY.value)/q.scale.value,hoverNodeId:null},window.addEventListener(`pointermove`,Jr),window.addEventListener(`pointerup`,Yr),window.addEventListener(`pointercancel`,Yr)}function Jr(e){let t=jr.value;if(!t)return;let n=o.value.getBoundingClientRect();if(t.wx=(e.clientX-n.left-q.offsetX.value)/q.scale.value,t.wy=(e.clientY-n.top-q.offsetY.value)/q.scale.value,t.end===`from`||t.end===`to`){let e=it(D.value,t.id),n=e?t.end===`from`?e.fromId:e.toId:null;t.hoverNodeId=yr(t.wx,t.wy,new Set(n?[n]:[]))?.id??null}}function Yr(){window.removeEventListener(`pointermove`,Jr),window.removeEventListener(`pointerup`,Yr),window.removeEventListener(`pointercancel`,Yr);let e=jr.value;if(jr.value=null,!e)return;let t=it(D.value,e.id);if(t){if(e.end===`c1`||e.end===`c2`)t[e.end]={x:Math.round(e.wx*2)/2,y:Math.round(e.wy*2)/2};else{let n=e.end===`from`?t.fromId:t.toId;if(!(e.hoverNodeId&&e.hoverNodeId!==n&&ct(D.value,e.id,e.end,e.hoverNodeId))){let r=An.value.find(e=>e.id===n);if(r){let n=Ir(r,Fr(r,{x:e.wx,y:e.wy}));e.end===`from`?t.fromT=n:t.toT=n}}}W(),G(),a(`change`,D.value),Kt=!0}}function Xr(e){if(i.previewMode)return;let t=it(D.value,e);t&&(Mr.value=e,Nr.value=t.label??``,kr.value=e,s(()=>{let e=document.querySelector(`.zm-relation-label-input`);e?.focus(),e?.select()}))}function Zr(){let e=Mr.value;if(!e)return;Mr.value=null;let t=it(D.value,e);if(!t)return;let n=Nr.value.trim();(t.label??``)!==n&&Ur(e,{label:n||void 0})}function Qr(e){let t=[],n=e=>{t.push(e.id);for(let t of e.children)n(t)};return n(e),t}let $r=!1;function ei(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea, .zm-relations`))return;if(e.button===2){$r=!0,q.startPan(e);return}if($r=!1,e.button!==0)return;let n=o.value.getBoundingClientRect(),r=(e.clientX-n.left-q.offsetX.value)/q.scale.value,i=(e.clientY-n.top-q.offsetY.value)/q.scale.value;q.startMarquee(r,i,{shift:e.shiftKey})}function ti(e){if(Kt){Kt=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`)||t.closest(`.zm-relations`)||t.closest(`.zm-toolbar`))return;let n=q.marquee;if(!(n.width>=4||n.height>=4)){if(Ar.value){Ar.value=null;return}if(kr.value){kr.value=null;return}u.value.size>0&&(u.value=new Set,J())}}function ni(){let e=q.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 An.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)}u.value=e.shiftKey?new Set([...u.value,...a]):new Set(a),J()}function ri(e){return f.value.has(e)}function ii(e){let t=U(D.value,e.id);return!!t&&t.children.length>0}function ai(e){let t=U(D.value,e);return t?tt(t):0}function oi(e){if(!U(D.value,e))return 0;let t=[D.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 si(e,t,n,r){let i=r?._dir??e._dir;if(t===`out`&&e.isRoot&&K.lineOrigin===`center`)return{x:e.x,y:e.y};if(t===`out`&&e.isRoot&&K.lineOrigin===`xmind`&&r){if(i===`down`)return{x:e.x,y:e.y};let t=n===void 0?e.side:n,a=e.children.filter(e=>e.side===t).sort((e,t)=>e.y-t.y),o=a.length,s=Math.max(0,a.findIndex(e=>e.id===r.id)),c=0;return o===2?c=.7:o>=3&&(c=s===0||s===o-1?.17:.45),{x:e.x+t*(e.width/2)*c,y:e.y}}if(t===`out`&&e.isRoot&&K.lineOrigin===`proportional`&&r){let t=r.x-e.x,n=r.y-e.y,i=e.width/2,a=e.height/2,o=t===0?1/0:i/Math.abs(t),s=n===0?1/0:a/Math.abs(n),c=Math.min(o,s);return Number.isFinite(c)?{x:e.x+t*c,y:e.y+n*c}:{x:e.x,y:e.y}}if(i===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let a;a=t===`in`?-e.side:n===void 0?e.side:n;let o=t===`in`?e._richInsetX??0:0;return{x:e.x+a*(e.width/2-o),y:e.y}}function ci(){let e=On.value;q.resetView(e.width,e.height,e.root.y)}function li(){en.value=!0,W(),G(),s(()=>ci())}function ui(e){K.layoutMode!==e&&(K.layoutMode=e,G(),s(()=>ci()))}function di(){return JSON.stringify(D.value,null,2)}function fi(e){let t=U(D.value,e);return t?!!(t.note&&t.note.text||t.link&&t.link.url||t.image&&t.image.src||t.richContent&&t.richContent.raw||t.markers&&t.markers.length>0||t.tags&&t.tags.length>0):!1}function pi(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(tn.reset(),D.value=H(t),u.value=new Set,f.value=new Set,G(),s(()=>ci()),a(`change`,D.value),!0)}catch{return!1}}function mi(){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`&&(pi(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function hi(){let e=new Blob([di()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${D.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}let gi=m(``),_i=m([]),vi=m(-1);function yi(e){gi.value=e;let t=e.trim();if(!t){_i.value=[],vi.value=-1;return}let n=t.toLowerCase(),r=[],i=e=>{var t;(e.text.toLowerCase().includes(n)||(t=e.note)!=null&&t.text&&e.note.text.toLowerCase().includes(n))&&r.push(e.id);for(let t of e.children)i(t)};i(D.value),_i.value=r,vi.value=r.length>0?0:-1,r.length>0&&(Ei(r),s(()=>Di(0)))}function bi(){_i.value.length!==0&&(vi.value=(vi.value+1)%_i.value.length,Di(vi.value))}function xi(){_i.value.length!==0&&(vi.value=(vi.value-1+_i.value.length)%_i.value.length,Di(vi.value))}function Si(){gi.value=``,_i.value=[],vi.value=-1}function Ci(e){return _i.value.includes(e)}function wi(e){return vi.value>=0&&_i.value[vi.value]===e}function Ti(e){return gi.value.trim().length>0&&_i.value.length>0&&!_i.value.includes(e)}function Ei(e){if(e.length===0)return;let t=new Set(e),n=new Set,r=e=>{let i=t.has(e.id);for(let t of e.children)r(t)&&(i=!0);return i&&e.children.length>0&&f.value.has(e.id)&&n.add(e.id),i};if(r(D.value),n.size>0){for(let e of n)f.value.delete(e);G()}}function Di(e){let t=_i.value[e];if(!t)return;let n=An.value.find(e=>e.id===t);n&&(u.value=new Set([t]),J(),q.centerOn(n.x,n.y,n.width,n.height))}function Oi(e,t){let n=U(D.value,e);n&&(n.markers||=[],!n.markers.includes(t)&&(n.markers.push(t),W(),G(),a(`change`,D.value)))}function ki(e,t){let n=U(D.value,e);if(!n||!n.markers)return;let r=n.markers.indexOf(t);r<0||(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,W(),G(),a(`change`,D.value))}function Ai(e,t){let n=U(D.value,e);if(!n)return!1;n.markers||=[];let r=n.markers.indexOf(t);return r>=0?(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,W(),G(),a(`change`,D.value),!1):(n.markers.push(t),W(),G(),a(`change`,D.value),!0)}function ji(e){let t=U(D.value,e);return t!=null&&t.markers?[...t.markers]:[]}function Mi(e,t){var n;return!!((n=U(D.value,e)?.markers)!=null&&n.includes(t))}function Ni(e){let t=B.value?.nodeId;t&&Ai(t,e)}function Pi(){let e=B.value?.nodeId;if(!e)return;let t=U(D.value,e);!t||!t.markers||(delete t.markers,W(),G(),a(`change`,D.value),ge())}function Fi(e,t){let n=U(D.value,e);n&&(t.length===0?n.tags&&delete n.tags:n.tags=[...t],W(),G(),a(`change`,D.value))}function Ii(e){let t=U(D.value,e);return t!=null&&t.tags?[...t.tags]:[]}function Li(){let e=B.value?.nodeId;if(!e)return;let t=(U(D.value,e)?.tags)?.join(`, `)??``,n=window.prompt(`输入标签(多个用逗号分隔)`,t);n!==null&&(Fi(e,n.split(/[,,]/).map(e=>e.trim()).filter(e=>e.length>0)),ge())}function Ri(){let e=B.value?.nodeId;e&&(Fi(e,[]),ge())}function zi(){let e=On.value,t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.setAttribute(`viewBox`,`${e.vbX} ${e.vbY} ${e.vbW} ${e.vbH}`),n.setAttribute(`width`,String(e.vbW)),n.setAttribute(`height`,String(e.vbH));let r=document.createElementNS(t,`rect`);r.setAttribute(`x`,String(e.vbX)),r.setAttribute(`y`,String(e.vbY)),r.setAttribute(`width`,String(e.vbW)),r.setAttribute(`height`,String(e.vbH)),r.setAttribute(`fill`,on.value),n.appendChild(r);for(let e of jn.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,mn(si(e.from,`out`,e.to.side,e.to),si(e.to,`in`),cn(e.from.depth),ln(e.to.depth),32,sn(e.from.isRoot),e.to._dir)),r.setAttribute(`fill`,yn(e.from,e.to)),r.setAttribute(`stroke`,`none`),n.appendChild(r)}let i=`-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif`;function a(e,t){let n=0;for(let r of e)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(r)?n+=t:n+=t*.55;return n}for(let e of zr.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,e.d),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,e.rel.color??`#94a3b8`),r.setAttribute(`stroke-width`,`1.5`),r.setAttribute(`stroke-dasharray`,`6 4`),r.setAttribute(`stroke-linecap`,`round`),n.appendChild(r);let a=e.rel.color??`#94a3b8`;for(let r of[e.arrowEnd,e.arrowStart]){if(!r)continue;let e=document.createElementNS(t,`path`);e.setAttribute(`d`,r),e.setAttribute(`fill`,a),e.setAttribute(`stroke`,`none`),n.appendChild(e)}if(e.rel.label){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(e.labelPos.x)),r.setAttribute(`y`,String(e.labelPos.y-6)),r.setAttribute(`text-anchor`,`middle`),r.setAttribute(`font-size`,`12`),r.setAttribute(`font-family`,i),r.setAttribute(`fill`,`#64748b`),r.setAttribute(`stroke`,on.value),r.setAttribute(`stroke-width`,`3`),r.setAttribute(`paint-order`,`stroke`),r.textContent=e.rel.label,n.appendChild(r)}}for(let e of An.value){let r=e.x-e.width/2,o=e.y-e.height/2,s=document.createElementNS(t,`rect`);s.setAttribute(`x`,String(r)),s.setAttribute(`y`,String(o)),s.setAttribute(`width`,String(e.width)),s.setAttribute(`height`,String(e.height)),s.setAttribute(`rx`,`8`),s.setAttribute(`fill`,bn(e));let c=Cn(e);c!==`transparent`&&(s.setAttribute(`stroke`,c),s.setAttribute(`stroke-width`,`1`)),n.appendChild(s);let l=!!(e.tags&&e.tags.length>0),u=!!(e.markers&&e.markers.length>0),d=!!e.image,f=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),p=0,m=0;if(f){let r=e.richContent,s=e.fontSize*.78*.92;if(r.kind===`code`){let c=As(r.raw),l=js(r.raw),u=c.split(`
|
|
174
174
|
`),f=s*1.35,h=0;for(let e of u)h=Math.max(h,a(e,s));m=Math.min(h+12+4,e.width-4),p=u.length*f+8+2;let g=e.x-m/2,_=o+4;d&&(_=o+e.image.height+6);let v=document.createElementNS(t,`rect`);if(v.setAttribute(`x`,String(g)),v.setAttribute(`y`,String(_)),v.setAttribute(`width`,String(m)),v.setAttribute(`height`,String(p-2)),v.setAttribute(`rx`,`6`),v.setAttribute(`fill`,`rgba(255,255,255,0.55)`),v.setAttribute(`stroke`,Cn(e)),v.setAttribute(`stroke-width`,`1`),n.appendChild(v),l){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(g+m-6)),r.setAttribute(`y`,String(_+4+4)),r.setAttribute(`text-anchor`,`end`),r.setAttribute(`fill`,Sn(e)),r.setAttribute(`font-size`,String(s*.8)),r.setAttribute(`font-family`,i),r.setAttribute(`opacity`,`0.5`),r.textContent=l,n.appendChild(r)}for(let r=0;r<u.length;r++){let i=document.createElementNS(t,`text`);i.setAttribute(`x`,String(g+6)),i.setAttribute(`y`,String(_+4+(r+.5)*f+2)),i.setAttribute(`dominant-baseline`,`central`),i.setAttribute(`fill`,Sn(e)),i.setAttribute(`font-size`,String(s)),i.setAttribute(`font-family`,`'JetBrains Mono','Fira Code',Consolas,monospace`);let a=u[r],o=Math.floor((m-12)/(s*.6));a.length>o&&(a=a.substring(0,o-1)+`…`),i.textContent=a,n.appendChild(i)}}else if(r.kind===`table`){let c=Ns(r.raw);if(c.length>0){let r=s*1.35,l=c[0].length,u=[];for(let e=0;e<l;e++){let t=0;for(let n of c)e<n.length&&(t=Math.max(t,a(n[e],s)));u.push(t+12)}m=Math.min(u.reduce((e,t)=>e+t,0),e.width-4);let f=m/u.reduce((e,t)=>e+t,0);for(let e=0;e<l;e++)u[e]*=f;p=c.length*(r+6)+2;let h=e.x-m/2,g=o+4;d&&(g=o+e.image.height+6);let _=document.createElementNS(t,`rect`);_.setAttribute(`x`,String(h)),_.setAttribute(`y`,String(g)),_.setAttribute(`width`,String(m)),_.setAttribute(`height`,String(p-2)),_.setAttribute(`rx`,`6`),_.setAttribute(`fill`,`rgba(255,255,255,0.55)`),_.setAttribute(`stroke`,Cn(e)),_.setAttribute(`stroke-width`,`1`),n.appendChild(_);let v=h,y=g;for(let a=0;a<c.length;a++){let o=c[a],d=r+6;v=h;for(let f=0;f<l;f++){let p=u[f],m=o[f]||``;if(f<l-1){let r=document.createElementNS(t,`line`);r.setAttribute(`x1`,String(v+p)),r.setAttribute(`y1`,String(y)),r.setAttribute(`x2`,String(v+p)),r.setAttribute(`y2`,String(y+d)),r.setAttribute(`stroke`,Cn(e)),r.setAttribute(`stroke-width`,`1`),n.appendChild(r)}if(a<c.length-1){let r=document.createElementNS(t,`line`);r.setAttribute(`x1`,String(v)),r.setAttribute(`y1`,String(y+d)),r.setAttribute(`x2`,String(v+p)),r.setAttribute(`y2`,String(y+d)),r.setAttribute(`stroke`,Cn(e)),r.setAttribute(`stroke-width`,`1`),n.appendChild(r)}if(a===0){let e=document.createElementNS(t,`rect`);e.setAttribute(`x`,String(v)),e.setAttribute(`y`,String(y)),e.setAttribute(`width`,String(p)),e.setAttribute(`height`,String(d)),e.setAttribute(`fill`,`rgba(255,255,255,0.4)`),n.appendChild(e)}let h=document.createElementNS(t,`text`);h.setAttribute(`x`,String(v+6)),h.setAttribute(`y`,String(y+3+r/2+2)),h.setAttribute(`dominant-baseline`,`central`),h.setAttribute(`fill`,Sn(e)),h.setAttribute(`font-size`,String(s)),h.setAttribute(`font-family`,i),a===0&&h.setAttribute(`font-weight`,`600`);let g=m,_=Math.floor((p-12)/(s*.55));g.length>_&&_>2&&(g=g.substring(0,_-1)+`…`),h.textContent=g,n.appendChild(h),v+=p}y+=d}}}}let h=0;if(d){let r=e.image,i=o+4,a=e.x-r.width/2,s=document.createElementNS(t,`image`);s.setAttribute(`x`,String(a)),s.setAttribute(`y`,String(i)),s.setAttribute(`width`,String(r.width)),s.setAttribute(`height`,String(r.height)),s.setAttribute(`href`,r.src),s.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,r.src),s.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),n.appendChild(s),h=r.height+6}let g=e.y,_=h+p;_>0?g=o+_+(e.height-_)/2:l&&(g=e.y-8);let v=u?e.markers.length:0,y=v>0?v*14+(v-1)*2+4:0,b=a(e.text,e.fontSize),x=y+b,S=e.x-x/2;if(u){let r=S;for(let i of e.markers){let a=wt(i);if(a){let i=document.createElementNS(t,`svg`);i.setAttribute(`x`,String(r)),i.setAttribute(`y`,String(g-7)),i.setAttribute(`width`,`14`),i.setAttribute(`height`,`14`),i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`color`,Sn(e));let o=new DOMParser().parseFromString(`<svg xmlns="${t}">${a}</svg>`,`image/svg+xml`);if(!o.querySelector(`parsererror`))for(;o.documentElement.firstChild;)i.appendChild(o.documentElement.firstChild);n.appendChild(i)}r+=16}}let C=u?S+y+b/2:e.x,w=document.createElementNS(t,`text`);if(w.setAttribute(`x`,String(C)),w.setAttribute(`y`,String(g)),w.setAttribute(`text-anchor`,`middle`),w.setAttribute(`dominant-baseline`,`central`),w.setAttribute(`fill`,Sn(e)),w.setAttribute(`font-size`,String(Tn(e))),w.setAttribute(`font-weight`,String(wn(e))),w.setAttribute(`font-family`,i),w.textContent=e.text,n.appendChild(w),l){let r=e.y+10,o=e.tags.map(e=>a(e,10)+12),s=o.reduce((e,t)=>e+t+3,-3),c=e.x-s/2;for(let a=0;a<e.tags.length;a++){let s=e.tags[a],l=Et(s),u=o[a],d=document.createElementNS(t,`rect`);d.setAttribute(`x`,String(c)),d.setAttribute(`y`,String(r-8)),d.setAttribute(`width`,String(u)),d.setAttribute(`height`,`16`),d.setAttribute(`rx`,`8`),d.setAttribute(`fill`,l.background),d.setAttribute(`stroke`,l.borderColor),d.setAttribute(`stroke-width`,`1`),n.appendChild(d);let f=document.createElementNS(t,`text`);f.setAttribute(`x`,String(c+u/2)),f.setAttribute(`y`,String(r)),f.setAttribute(`text-anchor`,`middle`),f.setAttribute(`dominant-baseline`,`central`),f.setAttribute(`fill`,l.color),f.setAttribute(`font-size`,`10`),f.setAttribute(`font-family`,i),f.textContent=s,n.appendChild(f),c+=u+3}}}return n}function Bi(){let e=zi(),t=new XMLSerializer().serializeToString(e);t.startsWith(`<?xml`)||(t=`<?xml version="1.0" encoding="UTF-8"?>
|
|
175
|
-
`+t);let n=new Blob([t],{type:`image/svg+xml;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${
|
|
176
|
-
`+r);let i=new Blob([r],{type:`image/svg+xml;charset=utf-8`}),a=URL.createObjectURL(i),o=new window.Image;o.onload=()=>{let t=document.createElement(`canvas`);t.width=Math.ceil(n.vbW*e),t.height=Math.ceil(n.vbH*e);let r=t.getContext(`2d`);if(!r){URL.revokeObjectURL(a);return}r.fillStyle=on.value,r.fillRect(0,0,t.width,t.height),r.drawImage(o,0,0,t.width,t.height),URL.revokeObjectURL(a);try{t.toBlob(e=>{if(!e){Bi();return}let t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${w.value.text||`mindmap`}.png`,n.click(),URL.revokeObjectURL(t)},`image/png`)}catch(e){console.warn(`PNG export failed, falling back to SVG:`,e),Bi()}},o.onerror=()=>{URL.revokeObjectURL(a),Bi()},o.src=a}t({addChild:e=>Wn(e),addSibling:e=>Gn(e),removeNode:e=>sr(e),duplicateNode:e=>qn(e),setNodeText:(e,t)=>mr(e,t),moveNode:(e,t,n)=>hr(e,t,n),lineWidthForDepth:cn,endWidthForDepth:ln,getData:()=>w.value,nodeHasContent:e=>fi(e),getSelectedIds:()=>[...d.value],copyNodes:e=>Qn(e),cutNodes:e=>er(e),pasteNodes:e=>tr(e),setData:e=>{tn.reset(),w.value=H(e),d.value=new Set,p.value=new Set,G(),W(),i(()=>ci())},resetView:()=>ci(),exportData:di,importData:pi,getMarkdown:()=>dt(w.value),setMarkdown:(e,t=!0)=>{let n=ut(e||``);t&&(D.value=!0),O=!t,tn.reset(),w.value=H(n),d.value=new Set,p.value=new Set,G(),W(),i(()=>{O=!1,ci()}),s(`change`,w.value)},setBalanced:e=>{en.value=e},isBalanced:()=>en.value,balance:()=>li(),applyNodeStyle:(e,t)=>te(e,t),getNodeStyle:e=>P(e),applyNodeImage:(e,t)=>F(e,t),applyNodeImageByUrl:(e,t)=>ie(e,t),removeNodeImage:e=>re(e),applyNodeLink:(e,t)=>se(e,t),removeNodeLink:e=>ce(e),applyNodeNote:(e,t)=>le(e,t),removeNodeNote:e=>ue(e),applyNodeRichContent:(e,t)=>de(e,t),addNodeMarker:(e,t)=>Oi(e,t),removeNodeMarker:(e,t)=>ki(e,t),toggleNodeMarker:(e,t)=>Ai(e,t),getNodeMarkers:e=>ji(e),setNodeTags:(e,t)=>Fi(e,t),getNodeTags:e=>Ii(e),exportPNG:e=>Vi(e),exportSVG:()=>Bi(),searchNodes:e=>(yi(e),[..._i.value]),undo:()=>nr(),redo:()=>rr(),canUndo:()=>tn.canUndo(),canRedo:()=>tn.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(K.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(K.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(K.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(K.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(K.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(K.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(K.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(K.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(K.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(K.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(K.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(K.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(K.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(K.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(K.canvasBg=e.canvasBg),e.branchGap!==void 0&&(K.branchGap=Math.max(0,Math.min(80,e.branchGap))),e.layoutMode!==void 0&&K.layoutMode!==e.layoutMode&&(K.layoutMode=e.layoutMode,G(),i(()=>ci()))},getSettings:()=>({autoBalanceOnChange:K.autoBalanceOnChange,lineWidthStart:K.lineWidthStart,lineWidthEnd:K.lineWidthEnd,rainbowBranch:K.rainbowBranch,branchPaletteId:K.branchPaletteId,customPalettes:K.customPalettes,lineStyle:K.lineStyle,rootLineStyle:K.rootLineStyle,lineOrigin:K.lineOrigin,layoutMode:K.layoutMode,taperedEdge:K.taperedEdge,lineWidthTaper:K.lineWidthTaper,uniformLineWidth:K.uniformLineWidth,elbowRadius:K.elbowRadius,showOrderBadge:K.showOrderBadge,canvasBg:K.canvasBg,branchGap:K.branchGap}),setBranchPalette:e=>{e&&[...Re,...K.customPalettes].find(t=>t.id===e)&&(K.branchPaletteId=e)},getBranchPalette:()=>K.branchPaletteId,getBranchPalettes:()=>[...Re,...K.customPalettes],getSearchResults:()=>[..._i.value],getSearchIndex:()=>vi.value,addRelation:(e,t)=>Vr(e,t),removeRelation:e=>Hr(e),updateRelation:(e,t)=>Ur(e,t),getRelations:()=>H(w.value.relations??[])}),T(()=>a.data,e=>{w.value=H(e),G()},{deep:!1}),m(()=>{W(),i(()=>ci())});let Hi={props:a,emit:s,wrapperRef:c,editingId:l,editText:u,selectedIds:d,selectedId:f,collapsedIds:p,canvasHovered:h,dragState:g,dragGhostX:_,dragGhostY:v,dropIndicator:y,clipboard:b,tooltip:x,richEditingId:S,richEditDraft:C,dataRef:w,richHeights:E,richWidths:ee,usingMarkdown:D,get suppressMarkdownEmit(){return O},set suppressMarkdownEmit(e){O=e},showOrderBadge:k,nodeStylesRef:j,nodeStyles:N,applyNodeStyle:te,getNodeStyle:P,getNodeStyleOr:ne,IMG_MIN_W:pd,IMG_MAX_W:md,IMG_DEFAULT_W:hd,applyNodeImage:F,removeNodeImage:re,applyNodeImageByUrl:ie,clamp:R,readImageFile:z,onPickImage:oe,applyNodeLink:se,removeNodeLink:ce,applyNodeNote:le,removeNodeNote:ue,applyNodeRichContent:de,contextMenu:B,canvasMenu:fe,fabPreviewClass:pe,fabOutlineClass:me,onNodeContextMenu:he,closeContextMenu:ge,onCanvasContextMenu:_e,closeCanvasMenu:ve,menuOpenSettings:ye,menuOpenData:be,menuOpenImport:xe,_showOutline:Se,_showData:Ce,_showMarkdown:we,_showNote:Te,_showSettings:Ee,_noteFocusTick:De,_pendingImportMode:Oe,_outlineCollapsed:ke,_closeRightDrawers:Ae,_selectedNode:Me,_currentNodeStyle:Ne,_onSettingsChange:Pe,_onNodeStyleChange:Fe,_resetSettings:Ie,_onDataConsumedMode:Le,_onNoteApply:Be,_onNoteRemove:Ve,_onLinkSet:He,_onImageSet:Ue,_onRichSet:V,_onOutlineSelect:Je,_onOutlineEdit:rt,_onOutlineAddChild:ft,_onOutlineAddSibling:pt,_onOutlineMove:ht,_toggleCollapse:gt,_onCanvasOutline:yt,menuPickImage:bt,menuSetLink:xt,menuRemoveLink:St,menuEditNote:Ct,menuRemoveNote:Dt,menuRemoveImage:Ot,menuAddCode:kt,menuRemoveCode:At,menuAddTable:jt,menuRemoveTable:Mt,menuAddRelation:Pt,emitEditNote:Ft,notePreview:Lt,onPaste:Rt,onGlobalKeydown:zt,resizeState:Bt,resizingId:Vt,onResizeStart:Ht,onResizeMove:Ut,onResizeEnd:Wt,hoveredId:Gt,get suppressNextCanvasClick(){return Kt},set suppressNextCanvasClick(e){Kt=e},get suppressNextNodeClick(){return qt},set suppressNextNodeClick(e){qt=e},onNodeMouseEnter:Yt,onNodeMouseLeave:Xt,onNodeTextHover:Zt,isNodeInteractive:Qt,layoutVersion:$t,balanced:en,history:tn,record:W,applyData:nn,triggerRef:G,measureRichBodies:rn,theme:an,effectiveBg:on,settings:K,edgeLineStyle:sn,lineWidthForDepth:cn,endWidthForDepth:ln,taperedParentWidth:un,continuousWidth:dn,cubicAt:fn,quadAt:pn,variableWidthPath:mn,lrRootChildren:hn,RAINBOW_FALLBACK:gn,activePalette:_n,branchColor:vn,lineColorFor:yn,nodeBg:bn,nodeFg:Sn,nodeBorder:Cn,nodeFontWeight:wn,nodeFontSize:Tn,hexWithAlpha:En,darken:Dn,panZoom:q,layoutResult:On,allNodesComputed:kn,allNodes:An,edges:jn,viewBox:Mn,applyCollapse:Nn,startEdit:Pn,commitEdit:Fn,cancelEdit:In,autoresizeEditEl:Ln,autoresizeEdit:Rn,startRichEdit:zn,commitRichEdit:Bn,cancelRichEdit:Vn,onRichEditKeydown:Hn,onEditKeydown:Un,doAddChild:Wn,doAddSibling:Gn,doAddSiblingBefore:Kn,doDuplicate:qn,clipboardableIds:Jn,preorderIds:Yn,writeSystemClipboard:Xn,outlineClipboardText:Zn,doCopy:Qn,doCut:er,doPaste:tr,doUndo:nr,doRedo:rr,emitSelection:J,doNavigate:ir,listLines:ar,paragraphText:or,doRemove:sr,toggleCollapse:cr,walkTreeDepth:lr,collapseAll:dr,expandToLevel:fr,expandAll:pr,doSetText:mr,doMove:hr,doMoveMany:gr,doMoveSibling:_r,onNodeClick:vr,getNodeAtPointer:yr,treeOrderIndex:br,orderedDragSources:xr,topmostSources:Sr,get pendingDrag(){return Cr},set pendingDrag(e){Cr=e},DRAG_THRESHOLD:gd,onNodePointerDown:wr,onDragPointerMove:Tr,computeDropPosition:Er,isLeftSideRootChild:Dr,onDragPointerUp:Or,selectedRelationId:kr,relationMode:Ar,relationDrag:jr,relationEditingId:Mr,relationEditText:Nr,perimeterPoint:Pr,rectRayPoint:Fr,perimeterParam:Ir,relationEndpoint:Lr,arrowHeadPath:Rr,relationGeoms:zr,editingRelationGeom:Br,doAddRelation:Vr,doRemoveRelation:Hr,doUpdateRelation:Ur,startRelationMode:Wr,onRelationToolbarClick:Gr,onRelationClick:Kr,onRelationHandlePointerDown:qr,onRelationHandleMove:Jr,onRelationHandleUp:Yr,startRelationLabelEdit:Xr,commitRelationLabel:Zr,subtreeIds:Qr,get lastPanWasRightButton(){return $r},set lastPanWasRightButton(e){$r=e},onCanvasMouseDown:ei,onCanvasClick:ti,onMarqueeEnd:ni,isCollapsed:ri,nodeHasChildren:ii,collapsedChildCount:ai,siblingIndexOf:oi,lineAnchor:si,resetView:ci,runBalance:li,setLayoutMode:ui,exportData:di,nodeHasContent:fi,importData:pi,importFromFile:mi,exportToFile:hi,searchQuery:gi,searchResults:_i,searchIndex:vi,performSearch:yi,searchNext:bi,searchPrev:xi,clearSearch:Si,isSearchHit:Ci,isCurrentSearchHit:wi,isSearchDimmed:Ti,expandAncestorsOfMatches:Ei,centerOnMatch:Di,applyNodeMarker:Oi,removeNodeMarkerData:ki,toggleNodeMarkerData:Ai,getNodeMarkersData:ji,hasNodeMarker:Mi,menuToggleMarker:Ni,menuClearMarkers:Pi,setNodeTagsData:Fi,getNodeTagsData:Ii,menuAddTag:Li,menuRemoveTags:Ri,buildExportSVG:zi,exportSVGFile:Bi,exportPNGFile:Vi,Icon:I,get addNodeIcon(){return ae},get addSubNodeIcon(){return L},get findNode(){return U},NodeContextMenu:Nt,CanvasContextMenu:It,Drawer:Jt,Outline:xn,DataPanel:$n,MarkdownPanel:ur,SettingsPanel:sa,NotePanel:fd,get codeLang(){return js},get highlightCode(){return Ms},get stripCodeFence(){return As},get tableRows(){return Ns},get markerSvg(){return wt},get markerLabel(){return Tt},get tagColor(){return Et}};return Object.defineProperty(Hi,"__isScriptSetup",{enumerable:!1,value:!0}),Hi}}),vd=[`viewBox`,`width`,`height`],yd={class:`zm-edges`},bd=[`d`,`fill`],xd={class:`zm-relations`},Sd=[`d`,`onClick`,`onDblclick`],Cd=[`d`],wd=[`d`],Td=[`d`],Ed=[`x`,`y`,`onClick`,`onDblclick`],Dd=[`x1`,`y1`,`x2`,`y2`],Od=[`x1`,`y1`,`x2`,`y2`],kd=[`cx`,`cy`,`r`,`onPointerdown`],Ad=[`cx`,`cy`,`r`,`onPointerdown`],jd=[`x`,`y`,`width`,`height`,`onPointerdown`],Md=[`x`,`y`,`width`,`height`,`onPointerdown`],Nd=[`cx`,`cy`,`r`,`onPointerdown`],Pd=[`cx`,`cy`,`r`,`onPointerdown`],Fd=[`x`,`y`,`width`,`height`,`onPointerdown`],Id=[`x`,`y`,`width`,`height`,`onPointerdown`],Ld={class:`zm-drag-ghost-text`},Rd={key:0,class:`zm-drag-ghost-count`},zd=[`data-node-id`,`onClick`,`onPointerdown`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],Bd=[`src`,`width`,`height`,`alt`],Vd=[`onDblclick`],Hd={key:0,class:`zm-rich-code`},Ud=[`innerHTML`],Wd={key:1,class:`zm-rich-table`},Gd={key:2,class:`zm-text`},Kd={key:0,class:`zm-node-markers`},qd=[`title`,`innerHTML`],Jd={class:`zm-text-label`},Yd=[`href`,`title`],Xd=[`title`,`onClick`],Zd={key:4,class:`zm-node-tags`},Qd=[`title`],$d=[`title`,`onClick`],ef=[`onClick`],tf=[`onMousedown`],nf=[`onClick`],rf=[`onKeydown`],af=[`title`],of=[`src`],sf=[`src`];function cf(n,i,a,o,s,c){var u,p,m;return d(),e(`div`,{class:`zm-mindmap`,style:g({background:o.effectiveBg,fontSize:o.theme.fontSize+`px`})},[t(`div`,{ref:`wrapperRef`,class:h([`zm-canvas`,{"is-relation-mode":!!o.relationMode}]),onMousedown:o.onCanvasMouseDown,onContextmenu:o.onCanvasContextMenu,onWheel:i[30]||=(...e)=>o.panZoom.onWheel&&o.panZoom.onWheel(...e),onMouseenter:i[31]||=e=>o.canvasHovered=!0,onMouseleave:i[32]||=e=>o.canvasHovered=!1,onClick:o.onCanvasClick},[b(` SVG layer: positioned in world coords (vbX, vbY) scaled by\r
|
|
175
|
+
`+t);let n=new Blob([t],{type:`image/svg+xml;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${D.value.text||`mindmap`}.svg`,i.click(),URL.revokeObjectURL(r)}function Vi(e=2){let t=zi(),n=On.value,r=new XMLSerializer().serializeToString(t);r.startsWith(`<?xml`)||(r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
176
|
+
`+r);let i=new Blob([r],{type:`image/svg+xml;charset=utf-8`}),a=URL.createObjectURL(i),o=new window.Image;o.onload=()=>{let t=document.createElement(`canvas`);t.width=Math.ceil(n.vbW*e),t.height=Math.ceil(n.vbH*e);let r=t.getContext(`2d`);if(!r){URL.revokeObjectURL(a);return}r.fillStyle=on.value,r.fillRect(0,0,t.width,t.height),r.drawImage(o,0,0,t.width,t.height),URL.revokeObjectURL(a);try{t.toBlob(e=>{if(!e){Bi();return}let t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${D.value.text||`mindmap`}.png`,n.click(),URL.revokeObjectURL(t)},`image/png`)}catch(e){console.warn(`PNG export failed, falling back to SVG:`,e),Bi()}},o.onerror=()=>{URL.revokeObjectURL(a),Bi()},o.src=a}t({addChild:e=>Wn(e),addSibling:e=>Gn(e),removeNode:e=>sr(e),duplicateNode:e=>qn(e),setNodeText:(e,t)=>mr(e,t),moveNode:(e,t,n)=>hr(e,t,n),lineWidthForDepth:cn,endWidthForDepth:ln,getData:()=>D.value,nodeHasContent:e=>fi(e),getSelectedIds:()=>[...u.value],copyNodes:e=>Qn(e),cutNodes:e=>er(e),pasteNodes:e=>tr(e),setData:e=>{tn.reset(),D.value=H(e),u.value=new Set,f.value=new Set,G(),W(),s(()=>ci())},resetView:()=>ci(),exportData:di,importData:pi,getMarkdown:()=>dt(D.value),setMarkdown:(e,t=!0)=>{let n=ut(e||``);t&&(k.value=!0),A=!t,tn.reset(),D.value=H(n),u.value=new Set,f.value=new Set,G(),W(),s(()=>{A=!1,ci()}),a(`change`,D.value)},setBalanced:e=>{en.value=e},isBalanced:()=>en.value,balance:()=>li(),applyNodeStyle:(e,t)=>te(e,t),getNodeStyle:e=>P(e),applyNodeImage:(e,t)=>F(e,t),applyNodeImageByUrl:(e,t)=>ie(e,t),removeNodeImage:e=>re(e),applyNodeLink:(e,t)=>se(e,t),removeNodeLink:e=>ce(e),applyNodeNote:(e,t)=>le(e,t),removeNodeNote:e=>ue(e),applyNodeRichContent:(e,t)=>de(e,t),addNodeMarker:(e,t)=>Oi(e,t),removeNodeMarker:(e,t)=>ki(e,t),toggleNodeMarker:(e,t)=>Ai(e,t),getNodeMarkers:e=>ji(e),setNodeTags:(e,t)=>Fi(e,t),getNodeTags:e=>Ii(e),exportPNG:e=>Vi(e),exportSVG:()=>Bi(),searchNodes:e=>(yi(e),[..._i.value]),undo:()=>nr(),redo:()=>rr(),canUndo:()=>tn.canUndo(),canRedo:()=>tn.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(K.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(K.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(K.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(K.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(K.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(K.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(K.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(K.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(K.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(K.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(K.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(K.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(K.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(K.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(K.canvasBg=e.canvasBg),e.branchGap!==void 0&&(K.branchGap=Math.max(0,Math.min(80,e.branchGap))),e.layoutMode!==void 0&&K.layoutMode!==e.layoutMode&&(K.layoutMode=e.layoutMode,G(),s(()=>ci()))},getSettings:()=>({autoBalanceOnChange:K.autoBalanceOnChange,lineWidthStart:K.lineWidthStart,lineWidthEnd:K.lineWidthEnd,rainbowBranch:K.rainbowBranch,branchPaletteId:K.branchPaletteId,customPalettes:K.customPalettes,lineStyle:K.lineStyle,rootLineStyle:K.rootLineStyle,lineOrigin:K.lineOrigin,layoutMode:K.layoutMode,taperedEdge:K.taperedEdge,lineWidthTaper:K.lineWidthTaper,uniformLineWidth:K.uniformLineWidth,elbowRadius:K.elbowRadius,showOrderBadge:K.showOrderBadge,canvasBg:K.canvasBg,branchGap:K.branchGap}),setBranchPalette:e=>{e&&[...Re,...K.customPalettes].find(t=>t.id===e)&&(K.branchPaletteId=e)},getBranchPalette:()=>K.branchPaletteId,getBranchPalettes:()=>[...Re,...K.customPalettes],getSearchResults:()=>[..._i.value],getSearchIndex:()=>vi.value,addRelation:(e,t)=>Vr(e,t),removeRelation:e=>Hr(e),updateRelation:(e,t)=>Ur(e,t),getRelations:()=>H(D.value.relations??[])}),b(()=>i.data,e=>{D.value=H(e),G()},{deep:!1}),_(()=>{W(),s(()=>ci())});let Hi={props:i,emit:a,wrapperRef:o,editingId:c,editText:l,selectedIds:u,selectedId:d,collapsedIds:f,canvasHovered:p,dragState:h,dragGhostX:v,dragGhostY:x,dropIndicator:S,clipboard:C,tooltip:w,richEditingId:T,richEditDraft:E,dataRef:D,richHeights:ee,richWidths:O,usingMarkdown:k,get suppressMarkdownEmit(){return A},set suppressMarkdownEmit(e){A=e},showOrderBadge:j,nodeStylesRef:M,nodeStyles:N,applyNodeStyle:te,getNodeStyle:P,getNodeStyleOr:ne,IMG_MIN_W:pd,IMG_MAX_W:md,IMG_DEFAULT_W:hd,applyNodeImage:F,removeNodeImage:re,applyNodeImageByUrl:ie,clamp:R,readImageFile:z,onPickImage:oe,applyNodeLink:se,removeNodeLink:ce,applyNodeNote:le,removeNodeNote:ue,applyNodeRichContent:de,contextMenu:B,canvasMenu:fe,fabPreviewClass:pe,fabOutlineClass:me,onNodeContextMenu:he,closeContextMenu:ge,onCanvasContextMenu:_e,closeCanvasMenu:ve,menuOpenSettings:ye,menuOpenData:be,menuOpenImport:xe,_showOutline:Se,_showData:Ce,_showMarkdown:we,_showNote:Te,_showSettings:Ee,_noteFocusTick:De,_pendingImportMode:Oe,_outlineCollapsed:ke,_closeRightDrawers:Ae,_selectedNode:Me,_currentNodeStyle:Ne,_onSettingsChange:Pe,_onNodeStyleChange:Fe,_resetSettings:Ie,_onDataConsumedMode:Le,_onNoteApply:Be,_onNoteRemove:Ve,_onLinkSet:He,_onImageSet:Ue,_onRichSet:V,_onOutlineSelect:Je,_onOutlineEdit:rt,_onOutlineAddChild:ft,_onOutlineAddSibling:pt,_onOutlineMove:ht,_toggleCollapse:gt,_onCanvasOutline:yt,menuPickImage:bt,menuSetLink:xt,menuRemoveLink:St,menuEditNote:Ct,menuRemoveNote:Dt,menuRemoveImage:Ot,menuAddCode:kt,menuRemoveCode:At,menuAddTable:jt,menuRemoveTable:Mt,menuAddRelation:Pt,emitEditNote:Ft,notePreview:Lt,onPaste:Rt,onGlobalKeydown:zt,resizeState:Bt,resizingId:Vt,onResizeStart:Ht,onResizeMove:Ut,onResizeEnd:Wt,hoveredId:Gt,get suppressNextCanvasClick(){return Kt},set suppressNextCanvasClick(e){Kt=e},get suppressNextNodeClick(){return qt},set suppressNextNodeClick(e){qt=e},onNodeMouseEnter:Yt,onNodeMouseLeave:Xt,onNodeTextHover:Zt,isNodeInteractive:Qt,layoutVersion:$t,balanced:en,history:tn,record:W,applyData:nn,triggerRef:G,measureRichBodies:rn,theme:an,effectiveBg:on,settings:K,edgeLineStyle:sn,lineWidthForDepth:cn,endWidthForDepth:ln,taperedParentWidth:un,continuousWidth:dn,cubicAt:fn,quadAt:pn,variableWidthPath:mn,lrRootChildren:hn,RAINBOW_FALLBACK:gn,activePalette:_n,branchColor:vn,lineColorFor:yn,nodeBg:bn,nodeFg:Sn,nodeBorder:Cn,nodeFontWeight:wn,nodeFontSize:Tn,hexWithAlpha:En,darken:Dn,panZoom:q,layoutResult:On,allNodesComputed:kn,allNodes:An,edges:jn,viewBox:Mn,applyCollapse:Nn,startEdit:Pn,commitEdit:Fn,cancelEdit:In,autoresizeEditEl:Ln,autoresizeEdit:Rn,startRichEdit:zn,commitRichEdit:Bn,cancelRichEdit:Vn,onRichEditKeydown:Hn,onEditKeydown:Un,doAddChild:Wn,doAddSibling:Gn,doAddSiblingBefore:Kn,doDuplicate:qn,clipboardableIds:Jn,preorderIds:Yn,writeSystemClipboard:Xn,outlineClipboardText:Zn,doCopy:Qn,doCut:er,doPaste:tr,doUndo:nr,doRedo:rr,emitSelection:J,doNavigate:ir,listLines:ar,paragraphText:or,doRemove:sr,toggleCollapse:cr,walkTreeDepth:lr,collapseAll:dr,expandToLevel:fr,expandAll:pr,doSetText:mr,doMove:hr,doMoveMany:gr,doMoveSibling:_r,onNodeClick:vr,getNodeAtPointer:yr,treeOrderIndex:br,orderedDragSources:xr,topmostSources:Sr,get pendingDrag(){return Cr},set pendingDrag(e){Cr=e},DRAG_THRESHOLD:gd,onNodePointerDown:wr,onDragPointerMove:Tr,computeDropPosition:Er,isLeftSideRootChild:Dr,onDragPointerUp:Or,selectedRelationId:kr,relationMode:Ar,relationDrag:jr,relationEditingId:Mr,relationEditText:Nr,perimeterPoint:Pr,rectRayPoint:Fr,perimeterParam:Ir,relationEndpoint:Lr,arrowHeadPath:Rr,relationGeoms:zr,editingRelationGeom:Br,doAddRelation:Vr,doRemoveRelation:Hr,doUpdateRelation:Ur,startRelationMode:Wr,onRelationToolbarClick:Gr,onRelationClick:Kr,onRelationHandlePointerDown:qr,onRelationHandleMove:Jr,onRelationHandleUp:Yr,startRelationLabelEdit:Xr,commitRelationLabel:Zr,subtreeIds:Qr,get lastPanWasRightButton(){return $r},set lastPanWasRightButton(e){$r=e},onCanvasMouseDown:ei,onCanvasClick:ti,onMarqueeEnd:ni,isCollapsed:ri,nodeHasChildren:ii,collapsedChildCount:ai,siblingIndexOf:oi,lineAnchor:si,resetView:ci,runBalance:li,setLayoutMode:ui,exportData:di,nodeHasContent:fi,importData:pi,importFromFile:mi,exportToFile:hi,searchQuery:gi,searchResults:_i,searchIndex:vi,performSearch:yi,searchNext:bi,searchPrev:xi,clearSearch:Si,isSearchHit:Ci,isCurrentSearchHit:wi,isSearchDimmed:Ti,expandAncestorsOfMatches:Ei,centerOnMatch:Di,applyNodeMarker:Oi,removeNodeMarkerData:ki,toggleNodeMarkerData:Ai,getNodeMarkersData:ji,hasNodeMarker:Mi,menuToggleMarker:Ni,menuClearMarkers:Pi,setNodeTagsData:Fi,getNodeTagsData:Ii,menuAddTag:Li,menuRemoveTags:Ri,buildExportSVG:zi,exportSVGFile:Bi,exportPNGFile:Vi,Icon:I,get addNodeIcon(){return ae},get addSubNodeIcon(){return L},get findNode(){return U},NodeContextMenu:Nt,CanvasContextMenu:It,Drawer:Jt,Outline:xn,DataPanel:$n,MarkdownPanel:ur,SettingsPanel:sa,NotePanel:fd,get codeLang(){return js},get highlightCode(){return Ms},get stripCodeFence(){return As},get tableRows(){return Ns},get markerSvg(){return wt},get markerLabel(){return Tt},get tagColor(){return Et}};return Object.defineProperty(Hi,"__isScriptSetup",{enumerable:!1,value:!0}),Hi}}),vd=[`viewBox`,`width`,`height`],yd={class:`zm-edges`},bd=[`d`,`fill`],xd={class:`zm-relations`},Sd=[`d`,`onClick`,`onDblclick`],Cd=[`d`],wd=[`d`],Td=[`d`],Ed=[`x`,`y`,`onClick`,`onDblclick`],Dd=[`x1`,`y1`,`x2`,`y2`],Od=[`x1`,`y1`,`x2`,`y2`],kd=[`cx`,`cy`,`r`,`onPointerdown`],Ad=[`cx`,`cy`,`r`,`onPointerdown`],jd=[`x`,`y`,`width`,`height`,`onPointerdown`],Md=[`x`,`y`,`width`,`height`,`onPointerdown`],Nd=[`cx`,`cy`,`r`,`onPointerdown`],Pd=[`cx`,`cy`,`r`,`onPointerdown`],Fd=[`x`,`y`,`width`,`height`,`onPointerdown`],Id=[`x`,`y`,`width`,`height`,`onPointerdown`],Ld={class:`zm-drag-ghost-text`},Rd={key:0,class:`zm-drag-ghost-count`},zd=[`data-node-id`,`onClick`,`onPointerdown`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],Bd=[`src`,`width`,`height`,`alt`],Vd=[`onDblclick`],Hd={key:0,class:`zm-rich-code`},Ud=[`innerHTML`],Wd={key:1,class:`zm-rich-table`},Gd={key:2,class:`zm-text`},Kd={key:0,class:`zm-node-markers`},qd=[`title`,`innerHTML`],Jd={class:`zm-text-label`},Yd=[`href`,`title`],Xd=[`title`,`onClick`],Zd={key:4,class:`zm-node-tags`},Qd=[`title`],$d=[`title`,`onClick`],ef=[`onClick`],tf=[`onMousedown`],nf=[`onClick`],rf=[`onKeydown`],af=[`title`],of=[`src`],sf=[`src`];function cf(r,i,a,s,c,u){var f,m,g;return e(),w(`div`,{class:`zm-mindmap`,style:d({background:s.effectiveBg,fontSize:s.theme.fontSize+`px`})},[l(`div`,{ref:`wrapperRef`,class:h([`zm-canvas`,{"is-relation-mode":!!s.relationMode}]),onMousedown:s.onCanvasMouseDown,onContextmenu:s.onCanvasContextMenu,onWheel:i[30]||=(...e)=>s.panZoom.onWheel&&s.panZoom.onWheel(...e),onMouseenter:i[31]||=e=>s.canvasHovered=!0,onMouseleave:i[32]||=e=>s.canvasHovered=!1,onClick:s.onCanvasClick},[t(` SVG layer: positioned in world coords (vbX, vbY) scaled by\r
|
|
177
177
|
panZoom.scale and offset by panZoom.offsetX/Y. This MUST\r
|
|
178
178
|
match the .zm-world's translate+scale exactly so that\r
|
|
179
179
|
SVG edges line up with the DOM node rectangles — without\r
|
|
180
180
|
this alignment, edges and nodes drift apart at any zoom\r
|
|
181
181
|
≠ 1 (the SVG's viewBox-internal (0,0) corresponds to\r
|
|
182
182
|
(vbX, vbY) in world space, so the SVG element's CSS left\r
|
|
183
|
-
is vbX*scale + panX, not panX). `),
|
|
183
|
+
is vbX*scale + panX, not panX). `),l(`div`,{class:`zm-svg-layer`,style:d({left:s.layoutResult.vbX*s.panZoom.scale.value+s.panZoom.offsetX.value+`px`,top:s.layoutResult.vbY*s.panZoom.scale.value+s.panZoom.offsetY.value+`px`,width:s.layoutResult.vbW*s.panZoom.scale.value+`px`,height:s.layoutResult.vbH*s.panZoom.scale.value+`px`})},[(e(),w(`svg`,{class:`zm-svg`,viewBox:s.viewBox,preserveAspectRatio:`xMinYMin meet`,width:s.layoutResult.vbW*s.panZoom.scale.value,height:s.layoutResult.vbH*s.panZoom.scale.value},[l(`g`,yd,[(e(!0),w(n,null,O(s.edges,t=>(e(),w(`path`,{key:t.key,d:s.variableWidthPath(s.lineAnchor(t.from,`out`,t.to.side,t.to),s.lineAnchor(t.to,`in`),s.lineWidthForDepth(t.from.depth),s.endWidthForDepth(t.to.depth),32,s.edgeLineStyle(t.from.isRoot),t.to._dir),fill:s.lineColorFor(t.from,t.to),stroke:`none`},null,8,bd))),128))]),t(` Relationship lines ("联系") — dashed curves between\r
|
|
184
184
|
arbitrary node pairs. Rendered above the tree edges\r
|
|
185
185
|
but under the DOM nodes (the .zm-world layer comes\r
|
|
186
186
|
after this SVG). The .zm-svg-layer is\r
|
|
187
187
|
pointer-events:none, so interactive children opt back\r
|
|
188
|
-
in via their own pointer-events CSS. `),
|
|
189
|
-
easy to click. `),
|
|
188
|
+
in via their own pointer-events CSS. `),l(`g`,xd,[(e(!0),w(n,null,O(s.relationGeoms,r=>(e(),w(n,{key:r.rel.id},[t(` Fat invisible hit path so the thin dashed line is\r
|
|
189
|
+
easy to click. `),l(`path`,{class:`zm-relation-hit`,d:r.d,onClick:e=>s.onRelationClick(e,r.rel.id),onDblclick:e=>{e.stopPropagation(),s.startRelationLabelEdit(r.rel.id)}},null,40,Sd),l(`path`,{class:h([`zm-relation-path`,{"is-selected":s.selectedRelationId===r.rel.id}]),d:r.d},null,10,Cd),t(` Arrowheads (default: one at the target end). `),r.arrowEnd?(e(),w(`path`,{key:0,class:h([`zm-relation-arrow`,{"is-selected":s.selectedRelationId===r.rel.id}]),d:r.arrowEnd},null,10,wd)):t(`v-if`,!0),r.arrowStart?(e(),w(`path`,{key:1,class:h([`zm-relation-arrow`,{"is-selected":s.selectedRelationId===r.rel.id}]),d:r.arrowStart},null,10,Td)):t(`v-if`,!0),r.rel.label&&s.relationEditingId!==r.rel.id?(e(),w(`text`,{key:2,class:`zm-relation-label`,x:r.labelPos.x,y:r.labelPos.y-6,"text-anchor":`middle`,onClick:e=>s.onRelationClick(e,r.rel.id),onDblclick:e=>{e.stopPropagation(),s.startRelationLabelEdit(r.rel.id)}},E(r.rel.label),41,Ed)):t(`v-if`,!0),t(` Selection handles: 2 endpoint anchors (circles,\r
|
|
190
190
|
drag along the node edge or drop onto another\r
|
|
191
191
|
node to re-attach) + 2 bezier control points\r
|
|
192
|
-
(squares, free drag). `),
|
|
192
|
+
(squares, free drag). `),s.selectedRelationId===r.rel.id&&!s.props.previewMode?(e(),w(n,{key:3},[l(`line`,{class:`zm-relation-guide`,x1:r.from.x,y1:r.from.y,x2:r.c1.x,y2:r.c1.y},null,8,Dd),l(`line`,{class:`zm-relation-guide`,x1:r.to.x,y1:r.to.y,x2:r.c2.x,y2:r.c2.y},null,8,Od),l(`circle`,{class:`zm-relation-handle-hit`,cx:r.from.x,cy:r.from.y,r:14/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`from`)},null,40,kd),l(`circle`,{class:`zm-relation-handle-hit`,cx:r.to.x,cy:r.to.y,r:14/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`to`)},null,40,Ad),l(`rect`,{class:`zm-relation-handle-hit`,x:r.c1.x-12/s.panZoom.scale.value,y:r.c1.y-12/s.panZoom.scale.value,width:24/s.panZoom.scale.value,height:24/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`c1`)},null,40,jd),l(`rect`,{class:`zm-relation-handle-hit`,x:r.c2.x-12/s.panZoom.scale.value,y:r.c2.y-12/s.panZoom.scale.value,width:24/s.panZoom.scale.value,height:24/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`c2`)},null,40,Md),l(`circle`,{class:`zm-relation-handle zm-relation-handle-endpoint`,cx:r.from.x,cy:r.from.y,r:6/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`from`)},null,40,Nd),l(`circle`,{class:`zm-relation-handle zm-relation-handle-endpoint`,cx:r.to.x,cy:r.to.y,r:6/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`to`)},null,40,Pd),l(`rect`,{class:`zm-relation-handle zm-relation-handle-ctrl`,x:r.c1.x-5/s.panZoom.scale.value,y:r.c1.y-5/s.panZoom.scale.value,width:10/s.panZoom.scale.value,height:10/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`c1`)},null,40,Fd),l(`rect`,{class:`zm-relation-handle zm-relation-handle-ctrl`,x:r.c2.x-5/s.panZoom.scale.value,y:r.c2.y-5/s.panZoom.scale.value,width:10/s.panZoom.scale.value,height:10/s.panZoom.scale.value,onPointerdown:e=>s.onRelationHandlePointerDown(e,r.rel.id,`c2`)},null,40,Id)],64)):t(`v-if`,!0)],64))),128))])],8,vd))],4),t(` Marquee rectangle: shown when the user is dragging on\r
|
|
193
193
|
the empty canvas. Positioned in screen-space (does NOT\r
|
|
194
194
|
follow the world transform) so it tracks the pointer\r
|
|
195
|
-
1:1 regardless of zoom or pan. `),
|
|
195
|
+
1:1 regardless of zoom or pan. `),s.panZoom.isMarquee.value?(e(),w(`div`,{key:0,class:`zm-marquee`,style:d({left:s.panZoom.marquee.x*s.panZoom.scale.value+s.panZoom.offsetX.value+`px`,top:s.panZoom.marquee.y*s.panZoom.scale.value+s.panZoom.offsetY.value+`px`,width:s.panZoom.marquee.width*s.panZoom.scale.value+`px`,height:s.panZoom.marquee.height*s.panZoom.scale.value+`px`})},null,4)):t(`v-if`,!0),t(` Drag ghost — follows the pointer, scaled to match the\r
|
|
196
196
|
canvas so it stays visually consistent as the user zooms.\r
|
|
197
197
|
A multi-node drag adds a "+N" badge naming how many extra\r
|
|
198
|
-
nodes are riding along. `),
|
|
198
|
+
nodes are riding along. `),s.dragState?(e(),w(`div`,{key:1,class:`zm-drag-ghost`,style:d({left:s.dragGhostX+`px`,top:s.dragGhostY+`px`,transform:`scale(${s.panZoom.scale.value})`,transformOrigin:`top left`})},[l(`span`,Ld,E(s.dragState.srcText),1),s.dragState.srcIds.length>1?(e(),w(`span`,Rd,`+`+E(s.dragState.srcIds.length-1),1)):t(`v-if`,!0)],4)):t(`v-if`,!0),l(`div`,{class:`zm-world`,style:d({transform:`translate(${s.panZoom.offsetX.value}px, ${s.panZoom.offsetY.value}px) scale(${s.panZoom.scale.value})`})},[t(` Drop indicator: a coloured line shown on the edge of the\r
|
|
199
199
|
target node when the user is hovering for a before/after\r
|
|
200
200
|
(sibling) insert. Rendered in world coordinates so it\r
|
|
201
|
-
tracks the layout naturally through pan/zoom. `),
|
|
201
|
+
tracks the layout naturally through pan/zoom. `),s.dropIndicator?(e(),w(`div`,{key:0,class:`zm-drop-indicator`,style:d({left:s.dropIndicator.x1+`px`,top:s.dropIndicator.y1+`px`,width:s.dropIndicator.horizontal?s.dropIndicator.x2-s.dropIndicator.x1+`px`:`3px`,height:s.dropIndicator.horizontal?`3px`:s.dropIndicator.y2-s.dropIndicator.y1+`px`,transform:s.dropIndicator.horizontal?`translateY(-1.5px)`:`translateX(-1.5px)`})},null,4)):t(`v-if`,!0),(e(!0),w(n,null,O(s.allNodes,r=>(e(),w(`div`,{key:r.id,class:h([`zm-node`,{"is-root":r.isRoot,"is-selected":s.selectedIds.has(r.id),"is-editing":s.editingId===r.id,"has-image":!!r.image,"is-resizing":s.resizingId===r.id,"is-dragging-source":s.dragState?.srcIds.includes(r.id)??!1,"is-drop-target":s.dragState?.currentTargetId===r.id&&s.dragState?.dropPosition===`child`,"is-drop-target-before":s.dragState?.currentTargetId===r.id&&s.dragState?.dropPosition===`before`,"is-drop-target-after":s.dragState?.currentTargetId===r.id&&s.dragState?.dropPosition===`after`,"is-search-hit":s.isSearchHit(r.id),"is-search-current":s.isCurrentSearchHit(r.id),"is-search-dimmed":s.isSearchDimmed(r.id),"is-relation-source":s.relationMode?.fromId===r.id,"is-relation-target":s.relationDrag!==null&&(s.relationDrag.end===`from`||s.relationDrag.end===`to`)&&s.relationDrag.hoverNodeId===r.id}]),"data-node-id":r.id,style:d({left:r.x+`px`,top:r.y+`px`,width:r.width+`px`,minWidth:r.width+`px`,height:r.height+`px`,fontSize:s.nodeFontSize(r)+`px`,background:s.nodeBg(r),color:s.nodeFg(r),borderColor:s.nodeBorder(r),fontWeight:s.nodeFontWeight(r),transform:`translate(-50%, -50%)`}),onClick:e=>s.onNodeClick(e,r),onPointerdown:e=>s.onNodePointerDown(e,r),onDblclick:e=>{e.stopPropagation(),a.previewMode||s.startEdit(r.id)},onContextmenu:e=>s.onNodeContextMenu(e,r),onMouseenter:e=>{s.onNodeMouseEnter(r.id),s.onNodeTextHover(e,r)},onMouseleave:e=>s.onNodeMouseLeave(r.id)},[r.image?(e(),w(`img`,{key:0,class:`zm-node-img`,src:r.image.src,width:r.image.width,height:r.image.height,alt:r.text,draggable:`false`},null,8,Bd)):t(`v-if`,!0),t(`\r
|
|
202
202
|
Rich body (code / table only): produced by hand-built\r
|
|
203
203
|
trees (the \`#rich\` sample in the demo) or by\r
|
|
204
204
|
\`markdownToRichMindMap\`. Rendered as a small framed\r
|
|
@@ -211,21 +211,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
211
211
|
Pointer events are disabled on the body so clicks\r
|
|
212
212
|
fall through to the node (lets the user dblclick\r
|
|
213
213
|
to edit).\r
|
|
214
|
-
`),
|
|
214
|
+
`),r.richContent&&(r.richContent.kind===`code`||r.richContent.kind===`table`)&&s.editingId!==r.id?(e(),w(`div`,{key:1,class:h([`zm-rich zm-rich-above`,{"zm-rich-no-overflow":r.richContent.kind===`table`||r.richContent.kind===`code`}]),onClick:i[1]||=p(()=>{},[`stop`]),onDblclick:p(e=>s.startRichEdit(r.id),[`stop`]),onMousedown:i[2]||=p(()=>{},[`stop`])},[t(` Edit mode: textarea overlays the preview, same size. `),s.richEditingId===r.id?x((e(),w(`textarea`,{key:0,"onUpdate:modelValue":i[0]||=e=>s.richEditDraft=e,class:`zm-rich-edit`,spellcheck:`false`,onBlur:s.commitRichEdit,onKeydown:s.onRichEditKeydown},null,544)),[[M,s.richEditDraft]]):(e(),w(n,{key:1},[r.richContent.kind===`code`?(e(),w(`pre`,Hd,[l(`code`,{innerHTML:s.highlightCode(s.stripCodeFence(r.richContent.raw),s.codeLang(r.richContent.raw))},null,8,Ud)])):r.richContent.kind===`table`?(e(),w(`table`,Wd,[l(`tbody`,null,[(e(!0),w(n,null,O(s.tableRows(r.richContent.raw),(t,r)=>(e(),w(`tr`,{key:r},[r===0?(e(!0),w(n,{key:0},O(t,(t,n)=>(e(),w(`th`,{key:`h${n}`},E(t),1))),128)):(e(!0),w(n,{key:1},O(t,(t,n)=>(e(),w(`td`,{key:`c${n}`},E(t),1))),128))]))),128))])])):t(`v-if`,!0)],64))],42,Vd)):t(`v-if`,!0),s.editingId===r.id?x((e(),w(`textarea`,{key:3,class:`zm-input`,"onUpdate:modelValue":i[6]||=e=>s.editText=e,autofocus:``,rows:`1`,onBlur:i[7]||=e=>s.commitEdit(),onKeydown:[i[8]||=j(p(e=>s.commitEdit(),[`exact`,`prevent`]),[`enter`]),i[9]||=j(p(e=>s.commitEdit(),[`prevent`]),[`tab`]),j(s.cancelEdit,[`esc`]),s.onEditKeydown],onInput:s.autoresizeEdit,onMousedown:i[10]||=p(()=>{},[`stop`]),onClick:i[11]||=p(()=>{},[`stop`])},null,544)),[[M,s.editText]]):(e(),w(`span`,Gd,[r.markers&&r.markers.length>0?(e(),w(`span`,Kd,[(e(!0),w(n,null,O(r.markers,t=>(e(),w(`span`,{key:t,class:`zm-node-marker`,title:s.markerLabel(t),innerHTML:`<svg viewBox="0 0 24 24" width="14" height="14">`+s.markerSvg(t)+`</svg>`},null,8,qd))),128))])):t(`v-if`,!0),l(`span`,Jd,E(r.text),1),r.link&&s.editingId!==r.id?(e(),w(`a`,{key:1,class:`zm-node-link`,href:r.link.url,target:`_blank`,rel:`noopener noreferrer`,title:`打开链接:${r.link.url}`,onClick:i[3]||=p(()=>{},[`stop`]),onMousedown:i[4]||=p(()=>{},[`stop`])},[o(s.Icon,{name:`link`,size:11,stroke:2})],40,Yd)):t(`v-if`,!0),r.note&&s.editingId!==r.id?(e(),w(`button`,{key:2,class:`zm-node-note-btn`,type:`button`,title:s.notePreview(r.note.text),onClick:p(e=>s.emitEditNote(r.id),[`stop`]),onMousedown:i[5]||=p(()=>{},[`stop`])},[o(s.Icon,{name:`note`,size:11,stroke:2})],40,Xd)):t(`v-if`,!0)])),t(` Tags — small colored pills below the title. `),r.tags&&r.tags.length>0&&s.editingId!==r.id?(e(),w(`div`,Zd,[(e(!0),w(n,null,O(r.tags,t=>(e(),w(`span`,{key:t,class:`zm-node-tag`,style:d(s.tagColor(t))},E(t),5))),128))])):t(`v-if`,!0),s.showOrderBadge?(e(),w(`span`,{key:5,class:`zm-order-badge`,title:`数据顺序:第 ${s.siblingIndexOf(r.id)+1} 个`},E(s.siblingIndexOf(r.id)+1),9,Qd)):t(`v-if`,!0),s.isCollapsed(r.id)&&s.collapsedChildCount(r.id)>0?(e(),w(`span`,{key:6,class:h([`zm-collapse-badge`,{"is-on-left":r.side===-1}]),style:d({background:s.branchColor.get(r.id)??`#64748b`}),title:`展开 ${s.collapsedChildCount(r.id)} 个子节点`,onMousedown:i[12]||=p(()=>{},[`stop`]),onClick:p(e=>s.toggleCollapse(r.id),[`stop`])},E(s.collapsedChildCount(r.id)),47,$d)):t(`v-if`,!0),s.nodeHasChildren(r)&&!s.isCollapsed(r.id)?(e(),w(`button`,{key:7,class:h([`zm-btn zm-collapse`,{"is-on-left":r.side===-1}]),style:d({"--zm-collapse-color":s.branchColor.get(r.id)??`#64748b`}),title:`折叠`,onMousedown:i[13]||=p(()=>{},[`stop`]),onClick:p(e=>s.toggleCollapse(r.id),[`stop`])},[...i[40]||=[l(`span`,{class:`zm-collapse-bar`},null,-1)]],46,ef)):t(`v-if`,!0),t(` Resize handle — bottom-right corner of the node,\r
|
|
215
215
|
only on selected image-bearing nodes. Drag to\r
|
|
216
216
|
scale the image. Inline handlers update the DOM\r
|
|
217
217
|
directly for drag-time fluidity; mouseup commits\r
|
|
218
|
-
the new size to the data tree. `),
|
|
218
|
+
the new size to the data tree. `),r.image&&s.selectedId===r.id&&s.editingId!==r.id?(e(),w(`span`,{key:8,class:`zm-img-resize-handle`,title:`拖动调整图片大小`,onMousedown:p(e=>s.onResizeStart(e,r),[`stop`])},null,40,tf)):t(`v-if`,!0),t(` "Remove image" button — top-right corner. `),r.image&&s.selectedId===r.id&&s.editingId!==r.id?(e(),w(`button`,{key:9,class:`zm-img-remove-btn`,title:`移除图片`,onMousedown:i[14]||=p(()=>{},[`stop`]),onClick:p(e=>s.removeNodeImage(r.id),[`stop`])},[o(s.Icon,{name:`x`,size:10,stroke:2.2})],40,nf)):t(`v-if`,!0)],46,zd))),128)),t(` Relationship-label inline editor — floats at the\r
|
|
219
219
|
curve midpoint (world coords, so it rides the pan/zoom\r
|
|
220
|
-
transform). Enter / blur commits, Esc cancels. `),
|
|
220
|
+
transform). Enter / blur commits, Esc cancels. `),s.editingRelationGeom?x((e(),w(`input`,{key:1,"onUpdate:modelValue":i[15]||=e=>s.relationEditText=e,class:`zm-relation-label-input`,placeholder:`联系`,style:d({left:s.editingRelationGeom.labelPos.x+`px`,top:s.editingRelationGeom.labelPos.y+`px`}),onBlur:s.commitRelationLabel,onKeydown:[j(p(s.commitRelationLabel,[`prevent`]),[`enter`]),i[16]||=j(e=>s.relationEditingId=null,[`esc`])],onMousedown:i[17]||=p(()=>{},[`stop`]),onClick:i[18]||=p(()=>{},[`stop`])},null,44,rf)),[[M,s.relationEditText]]):t(`v-if`,!0)],4),t(` Floating tooltip for truncated node labels. Renders\r
|
|
221
221
|
above the zoom layer so it isn't affected by the\r
|
|
222
222
|
canvas's pan/zoom transform. Position is anchored\r
|
|
223
|
-
to the node's screen rect at hover time. `),
|
|
223
|
+
to the node's screen rect at hover time. `),s.tooltip?(e(),w(`div`,{key:2,class:h([`zm-tooltip`,{"is-below":!s.tooltip.above}]),style:d({left:s.tooltip.x+`px`,top:s.tooltip.y+`px`})},E(s.tooltip.text),7)):t(`v-if`,!0),t(` Floating context menu — mounted only while the user is\r
|
|
224
224
|
interacting with it. Container is the canvas so the\r
|
|
225
|
-
menu can clamp itself inside the visible area. `),
|
|
225
|
+
menu can clamp itself inside the visible area. `),s.contextMenu?(e(),T(s.NodeContextMenu,{key:3,x:s.contextMenu.x,y:s.contextMenu.y,container:s.wrapperRef,"has-image":!!((f=s.findNode(s.dataRef,s.contextMenu.nodeId))!=null&&f.image),"has-link":!!((m=s.findNode(s.dataRef,s.contextMenu.nodeId))!=null&&m.link),"has-note":!!((g=s.findNode(s.dataRef,s.contextMenu.nodeId))!=null&&g.note),"has-code":s.findNode(s.dataRef,s.contextMenu.nodeId)?.richContent?.kind===`code`,"has-table":s.findNode(s.dataRef,s.contextMenu.nodeId)?.richContent?.kind===`table`,"node-markers":s.findNode(s.dataRef,s.contextMenu.nodeId)?.markers??[],"node-tags":s.findNode(s.dataRef,s.contextMenu.nodeId)?.tags??[],onPickImage:s.menuPickImage,onRemoveImage:s.menuRemoveImage,onSetLink:s.menuSetLink,onRemoveLink:s.menuRemoveLink,onEditNote:s.menuEditNote,onRemoveNote:s.menuRemoveNote,onAddCode:s.menuAddCode,onEditCode:s.menuAddCode,onRemoveCode:s.menuRemoveCode,onAddTable:s.menuAddTable,onEditTable:s.menuAddTable,onRemoveTable:s.menuRemoveTable,onToggleMarker:s.menuToggleMarker,onClearMarkers:s.menuClearMarkers,onAddTag:s.menuAddTag,onRemoveTags:s.menuRemoveTags,onAddRelation:s.menuAddRelation,onClose:s.closeContextMenu},null,8,[`x`,`y`,`container`,`has-image`,`has-link`,`has-note`,`has-code`,`has-table`,`node-markers`,`node-tags`])):t(`v-if`,!0),t(` Canvas right-click menu -- rendered only while the user is\r
|
|
226
226
|
interacting with it. Container is the canvas so the menu can\r
|
|
227
227
|
clamp itself inside the visible area. Actions re-emit to the\r
|
|
228
|
-
parent (App.vue decides which drawer to open). `),
|
|
228
|
+
parent (App.vue decides which drawer to open). `),s.canvasMenu?(e(),T(s.CanvasContextMenu,{key:4,x:s.canvasMenu.x,y:s.canvasMenu.y,container:s.wrapperRef,onOpenSettings:s.menuOpenSettings,onOpenData:s.menuOpenData,onOpenImport:s.menuOpenImport,onExportPng:s.exportPNGFile,onExportSvg:s.exportSVGFile,onClose:s.closeCanvasMenu},null,8,[`x`,`y`,`container`])):t(`v-if`,!0),t(` FABs. See fabPreviewClass and fabOutlineClass. `),l(`button`,{class:h(s.fabPreviewClass),title:s.props.previewMode?`退出预览模式`:`进入预览模式`,onClick:i[19]||=e=>s.emit(`canvas-toggle-preview`)},[o(s.Icon,{name:s.props.previewMode?`eye-off`:`eye`,size:16},null,8,[`name`])],10,af),l(`button`,{class:h(s.fabOutlineClass),title:`显示大纲视图`,onClick:s._onCanvasOutline},[o(s.Icon,{name:`outline`,size:16})],2),t(` Bottom toolbar. Always rendered; the parent's previewMode\r
|
|
229
229
|
+ canvasHovered refs drive visibility:\r
|
|
230
230
|
- non-preview: toolbar always visible\r
|
|
231
231
|
- preview: toolbar fades in on canvas hover, fades\r
|
|
@@ -243,17 +243,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
243
243
|
inside .zm-canvas means the cursor is technically still\r
|
|
244
244
|
inside the canvas while it's on the toolbar (because\r
|
|
245
245
|
mouseenter/mouseleave don't fire when moving between\r
|
|
246
|
-
parent and child). `),
|
|
246
|
+
parent and child). `),l(`div`,{class:h([`zm-toolbar`,{"is-preview-only":s.props.previewMode,"is-hovered":s.canvasHovered}])},[t(` 缩放比例 + 放大 / 缩小 / 重置视图: always visible, also\r
|
|
247
247
|
show in preview mode (the canvas still needs to be\r
|
|
248
|
-
navigable in preview). `),
|
|
248
|
+
navigable in preview). `),l(`span`,{class:`zm-tb-tip zm-tb-zoom`,title:`点击重置为 100%`,onClick:i[20]||=e=>s.panZoom.zoomTo100()},E(Math.round(s.panZoom.scale.value*100))+`%`,1),l(`button`,{class:`zm-tb-btn`,title:`放大`,onClick:i[21]||=(...e)=>s.panZoom.zoomIn&&s.panZoom.zoomIn(...e)},[o(s.Icon,{name:`zoom-in`})]),l(`button`,{class:`zm-tb-btn`,title:`缩小`,onClick:i[22]||=(...e)=>s.panZoom.zoomOut&&s.panZoom.zoomOut(...e)},[o(s.Icon,{name:`zoom-out`})]),l(`button`,{class:`zm-tb-btn`,title:`重置视图`,onClick:s.resetView},[o(s.Icon,{name:`reset`})]),i[43]||=l(`span`,{class:`zm-tb-divider`},null,-1),t(` Bulk expand/collapse: safe in preview mode (it's a view\r
|
|
249
249
|
operation, not an edit). Each button has its own glyph\r
|
|
250
250
|
so they're visually distinct, not three identical\r
|
|
251
251
|
right-chevrons:\r
|
|
252
252
|
全部收起 → 4 chevrons pointing inward (compress)\r
|
|
253
253
|
展开一级 → 1 root + 3 children (2-level tree)\r
|
|
254
254
|
展开二级 → 1 root + 3 children + 6 grandchildren\r
|
|
255
|
-
全部展开 → 4 chevrons pointing outward (expand) `),
|
|
256
|
-
the right-click context menu so the toolbar stays clean. `),
|
|
255
|
+
全部展开 → 4 chevrons pointing outward (expand) `),l(`button`,{class:`zm-tb-btn`,title:`全部收起`,onClick:s.collapseAll},[o(s.Icon,{name:`collapse-all`})]),l(`button`,{class:`zm-tb-btn`,title:`展开一级`,onClick:i[23]||=e=>s.expandToLevel(1)},[o(s.Icon,{name:`expand-level-1`})]),l(`button`,{class:`zm-tb-btn`,title:`展开二级`,onClick:i[24]||=e=>s.expandToLevel(2)},[o(s.Icon,{name:`expand-level-2`})]),l(`button`,{class:`zm-tb-btn`,title:`全部展开`,onClick:s.expandAll},[o(s.Icon,{name:`expand-all`})]),t(` <span class="zm-tb-divider" /> `),t(` Non-preview-only: edit + layout. Import/export live in\r
|
|
256
|
+
the right-click context menu so the toolbar stays clean. `),s.props.previewMode?t(`v-if`,!0):(e(),w(n,{key:0},[i[41]||=l(`span`,{class:`zm-tb-divider`},null,-1),l(`button`,{class:`zm-tb-btn`,title:`添加子节点 (Tab)`,onClick:i[25]||=e=>s.selectedId&&s.doAddChild(s.selectedId)},[l(`img`,{src:s.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,of)]),l(`button`,{class:`zm-tb-btn`,title:`添加同级 (Enter)`,onClick:i[26]||=e=>s.selectedId&&s.doAddSibling(s.selectedId)},[l(`img`,{src:s.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,sf)]),l(`button`,{class:h([`zm-tb-btn`,{active:!!s.relationMode}]),title:`联系(依次点选两个节点,Esc 取消)`,onClick:s.onRelationToolbarClick},[o(s.Icon,{name:`relation`})],2),i[42]||=l(`span`,{class:`zm-tb-divider`},null,-1),l(`button`,{class:h([`zm-tb-btn`,{active:s.settings.layoutMode===`mindmap`}]),title:`思维导图布局 (中心辐射)`,onClick:i[27]||=e=>s.setLayoutMode(`mindmap`)},[o(s.Icon,{name:`mindmap`})],2),l(`button`,{class:h([`zm-tb-btn`,{active:s.settings.layoutMode===`tree`}]),title:`树形布局 (向右展开)`,onClick:i[28]||=e=>s.setLayoutMode(`tree`)},[o(s.Icon,{name:`tree`})],2),l(`button`,{class:h([`zm-tb-btn`,{active:s.settings.layoutMode===`org`}]),title:`组织结构布局 (向下展开)`,onClick:i[29]||=e=>s.setLayoutMode(`org`)},[o(s.Icon,{name:`org`})],2)],64))],2)],34),t(` Built-in drawers — rendered when \`builtInDrawers\` prop is true.\r
|
|
257
257
|
These mirror the package's App.vue, giving consumers a\r
|
|
258
258
|
zero-config experience: right-click → settings / data / import\r
|
|
259
|
-
just works without wiring up events. `),
|
|
259
|
+
just works without wiring up events. `),s.props.builtInDrawers?(e(),w(n,{key:0},[t(` Outline (left) `),o(s.Drawer,{side:`left`,scope:`canvas`,width:300,open:s._showOutline&&!a.previewMode,title:`大纲`,"onUpdate:open":i[33]||=e=>s._showOutline=e},{default:A(()=>[o(s.Outline,{data:s.dataRef,"selected-id":s.selectedId,"collapsed-ids":s._outlineCollapsed,"show-index":s.showOrderBadge,onSelect:s._onOutlineSelect,onToggleCollapse:s._toggleCollapse,onEdit:s._onOutlineEdit,onAddChild:s._onOutlineAddChild,onAddSibling:s._onOutlineAddSibling,onMove:s._onOutlineMove},null,8,[`data`,`selected-id`,`collapsed-ids`,`show-index`])]),_:1},8,[`open`]),t(` Data (right) `),o(s.Drawer,{side:`right`,scope:`canvas`,width:360,open:s._showData&&!a.previewMode,title:`数据`,"onUpdate:open":i[35]||=e=>s._showData=e},{default:A(()=>[o(s.DataPanel,{data:s.dataRef,"pending-mode":s._pendingImportMode,onImport:i[34]||=e=>s.dataRef=e,onConsumedMode:s._onDataConsumedMode},null,8,[`data`,`pending-mode`])]),_:1},8,[`open`]),t(` Markdown (right) `),o(s.Drawer,{side:`right`,scope:`canvas`,width:420,open:s._showMarkdown&&!a.previewMode,title:`Markdown`,"onUpdate:open":i[37]||=e=>s._showMarkdown=e},{default:A(()=>[o(s.MarkdownPanel,{data:s.dataRef,onImport:i[36]||=e=>s.dataRef=e},null,8,[`data`])]),_:1},8,[`open`]),t(` Note (right) `),o(s.Drawer,{side:`right`,scope:`canvas`,width:360,open:s._showNote&&!a.previewMode,title:`节点内容`,"onUpdate:open":i[38]||=e=>s._showNote=e},{default:A(()=>[o(s.NotePanel,{"selected-node":s._selectedNode,"focus-tick":s._noteFocusTick,onApply:s._onNoteApply,onRemove:s._onNoteRemove,onSetLink:s._onLinkSet,onSetImage:s._onImageSet,onSetRich:s._onRichSet},null,8,[`selected-node`,`focus-tick`])]),_:1},8,[`open`]),t(` Settings (right) `),o(s.Drawer,{side:`right`,scope:`canvas`,width:340,open:s._showSettings&&!a.previewMode,title:`设置`,"onUpdate:open":i[39]||=e=>s._showSettings=e},{default:A(()=>[o(s.SettingsPanel,{settings:s.settings,"has-selection":s.selectedId!==null,"selected-node-text":s._selectedNode?.text,"node-style":s._currentNodeStyle,"onUpdate:settings":s._onSettingsChange,"onUpdate:nodeStyle":s._onNodeStyleChange,onReset:s._resetSettings},null,8,[`settings`,`has-selection`,`selected-node-text`,`node-style`])]),_:1},8,[`open`])],64)):t(`v-if`,!0)],4)}var lf=F(_d,[[`render`,cf],[`__file`,`D:/workspace/github_workspace/flow-mindmap/src/components/MindMap.vue`]]);export{lf as n,pt as r,ut as t};
|