flow-mindmap 0.3.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flow-mindmap.js +2787 -2463
- package/dist/flow-mindmap.umd.cjs +21 -20
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/CanvasContextMenu.vue.d.ts +0 -21
- package/dist/components/DataPanel.vue.d.ts +0 -19
- package/dist/components/Drawer.vue.d.ts +0 -33
- package/dist/components/Icon.vue.d.ts +0 -7
- package/dist/components/JsonTreeViewer.vue.d.ts +0 -25
- package/dist/components/MarkdownPanel.vue.d.ts +0 -12
- package/dist/components/MindMap.vue.d.ts +0 -93
- package/dist/components/NodeContextMenu.vue.d.ts +0 -63
- package/dist/components/NotePanel.vue.d.ts +0 -34
- package/dist/components/Outline.vue.d.ts +0 -45
- package/dist/components/SettingsPanel.vue.d.ts +0 -30
- package/dist/composables/useAutosize.d.ts +0 -21
- package/dist/composables/useHistory.d.ts +0 -19
- package/dist/composables/useKeyboard.d.ts +0 -32
- package/dist/composables/useMarkdown.d.ts +0 -6
- package/dist/composables/usePanZoom.d.ts +0 -35
- package/dist/composables/useRichContent.d.ts +0 -29
- package/dist/core/layout.d.ts +0 -144
- package/dist/core/palettes.d.ts +0 -43
- package/dist/entry.d.ts +0 -11
- package/dist/tree.d.ts +0 -96
- package/dist/types.d.ts +0 -270
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
(function(de,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(de=typeof globalThis<"u"?globalThis:de||self,t(de.FlowMind={},de.Vue))})(this,function(de,t){"use strict";const Ei=["width","height","stroke-width"],xi={key:4,points:"6 9 12 15 18 9"},ki={key:5,points:"9 6 15 12 9 18"},q=t.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(e){return(a,n)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="add"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n[0]||(n[0]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=t.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="minus"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n[3]||(n[3]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="delete"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[n[5]||(n[5]=t.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):e.name==="edit"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n[6]||(n[6]=t.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=t.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):e.name==="collapse"?(t.openBlock(),t.createElementBlock("polyline",xi)):e.name==="expand"?(t.openBlock(),t.createElementBlock("polyline",ki)):e.name==="collapse-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[n[8]||(n[8]=t.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):e.name==="expand-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[n[9]||(n[9]=t.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):e.name==="expand-level-1"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:8},[n[10]||(n[10]=t.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):e.name==="expand-level-2"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:9},[n[11]||(n[11]=t.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):e.name==="zoom-in"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:10},[n[12]||(n[12]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=t.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="zoom-out"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:11},[n[16]||(n[16]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="reset"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:12},[n[19]||(n[19]=t.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=t.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=t.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=t.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:13},[n[23]||(n[23]=t.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[n[24]||(n[24]=t.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=t.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[n[27]||(n[27]=t.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:16},[n[28]||(n[28]=t.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=t.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="markdown"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[n[31]||(n[31]=t.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=t.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=t.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=t.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):e.name==="txt"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[n[35]||(n[35]=t.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=t.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:19},[n[39]||(n[39]=t.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):e.name==="import"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:20},[n[40]||(n[40]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[41]||(n[41]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[42]||(n[42]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:21},[n[43]||(n[43]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[44]||(n[44]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[45]||(n[45]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:22},[n[46]||(n[46]=t.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):e.name==="mindmap"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:23},[n[47]||(n[47]=t.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):e.name==="tree"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[n[48]||(n[48]=t.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):e.name==="org"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:25},[n[49]||(n[49]=t.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):e.name==="image"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:26},[n[50]||(n[50]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[51]||(n[51]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[52]||(n[52]=t.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):e.name==="x"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:27},[n[53]||(n[53]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[54]||(n[54]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:28},[n[55]||(n[55]=t.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[56]||(n[56]=t.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):e.name==="note"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:29},[n[57]||(n[57]=t.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[58]||(n[58]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[59]||(n[59]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[60]||(n[60]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.createCommentVNode("",!0)],8,Ei))}}),Ni="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",wi="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",jt=[18,15,13,12],_i=[700,600,500,400],Si=[52,40,32,28],Mi=[120,80,60,44],Ci=[.8,.8,.8,.8],vi=jt.length-1;function Ti(e,a){return Math.round(Tt(e,a)*Ci[lt(e)])}function lt(e){return Math.min(vi,Math.max(0,e))}function Tt(e,a=14){return Math.round(jt[lt(e)]*a/14*10)/10}function Ai(e,a=14){return Math.round(Si[lt(e)]*a/14)}const st=60,Pe=14,ye=24;let At=null;function Ri(){if(At)return At;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(At=e,e):{font:"",measureText:()=>({width:0})}}const Jt=new Map;function Oi(e,a,n){const r=`${n}|${a}|${e}`,l=Jt.get(r);if(l!==void 0)return l;const f=Ri();f.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=f.measureText(e).width;return Jt.set(r,s),s}const Ii=24,Bi=400,Li=8,Qt=16,Di=4,zi=200;function $i(e,a,n){return Math.min(n,Math.max(a,e))}function Pi(e,a,n,r,l){const f=lt(a),s=Tt(a,n),d=Math.min(Oi(e.text||"",s,_i[f]),zi),c=Ti(a,n),g=Math.ceil(d+c*2),y=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ai(a,n);let N=0;if(e.link&&(N+=Qt),e.note&&(N+=Qt),N>0){const I=(e.link?1:0)+(e.note?1:0);N+=Di*I}const h=g+N,m=(()=>{const I=Math.round(Mi[f]*n/14);if(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")){const J=l==null?void 0:l[e.id];return Math.max(I,J??240)}return I})(),L=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")),B=r==null?void 0:r[e.id],b=L?Math.max(24,B??Math.max(70,Math.ceil(s*5))):0,O=b>0?10:0;if(!e.image){const I=Math.max(m,h),J=Math.ceil(y+O+b);return{w:I,h:J}}const R=$i(e.image.width,Ii,Bi),z=Math.max(m,h,Math.ceil(R+c*2)),$=Math.ceil(e.image.height+Li+y+O+b);return{w:z,h:$}}function Vi(e,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,f=tn(e,0,null,1,"right",l,a.richHeights,a.richWidths);return Hi(f),Ui(f,n,r),f.x=0,f.y=0,Fi(f,r)}function Ui(e,a,n=!1){if(a==="mindmap"){const r=e.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const d=r.reduce((y,N)=>y+N._subtreeH,0);let c=1,g=Math.abs(r[0]._subtreeH-(d-r[0]._subtreeH)),k=0;for(let y=0;y<r.length-1;y++){k+=r[y]._subtreeH;const N=Math.abs(k-(d-k));N<g&&(g=N,c=y+1)}for(let y=0;y<c;y++)r[y]._dir="right",r[y].side=1,r[y]._dirRight=1;for(let y=c;y<r.length;y++)r[y]._dir="left",r[y].side=-1,r[y]._dirRight=-1}const l=e.children.filter(d=>d.side===1),f=e.children.filter(d=>d.side===-1),s=(d,c)=>{const g=c==="right"?1:-1;d._dir=c,d.side=g,d._dirRight=g;for(const k of d.children)s(k,c)};for(const d of l)s(d,"right");for(const d of f)s(d,"left");if(l.length>0){const d={...e,children:l};ct(d,"right",st,!0,n)}if(f.length>0){const d={...e,children:f};ct(d,"left",st,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const f of l.children)r(f)};for(const l of e.children)l._dir="right";ct(e,"right",st,!0,n),r(e)}else{for(const r of e.children)r._dir="down";en(e,st,n)}}function ct(e,a,n,r,l=!1){if(e.children.length===0)return;const f=e.children.reduce((g,k,y)=>g+k._subtreeH+(y>0?Pe:0),0),s=a==="right"?1:-1,d=r?s:1;let c=e.y-d*f/2;e.children.forEach(g=>{l||(g.x=e.x+s*(e.width/2+n+g.width/2),g.y=c+d*g._subtreeH/2),g._dir=a,c+=d*(g._subtreeH+Pe),ct(g,a,n,!1,l)})}function en(e,a,n=!1){if(e.children.length===0)return;const r=e.children.reduce((f,s,d)=>f+s._subtreeW+(d>0?Pe*2:0),0);let l=e.x-r/2;e.children.forEach(f=>{n||(f.x=l+f._subtreeW/2,f.y=e.y+e.height/2+a+f.height/2),f._dir="down",l+=f._subtreeW+Pe*2,en(f,a,n)})}function tn(e,a,n,r,l,f,s,d){const c=Pi(e,a,f,s,d),g={id:e.id,text:e.text,depth:a,x:e._x??0,y:e._y??0,width:c.w,height:c.h,fontSize:Tt(a,f),isRoot:a===0,collapsed:e.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:c.h,_subtreeW:c.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return g;const k=e.children.length,y=Math.ceil(k/2);return g.children=e.children.map((N,h)=>{const m=a===0?h<y?1:-1:r;return tn(N,a+1,g,m,l,f,s,d)}),g}function Hi(e){const a=[e];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,f=0;for(const s of r.children)l+=s._subtreeH,f+=s._subtreeW;r.children.length>1&&(l+=Pe*(r.children.length-1),f+=Pe*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,f)}}function Fi(e,a=!1){const n=[e];let r=1/0,l=-1/0,f=1/0,s=-1/0;for(;n.length;){const g=n.pop(),k=g.width/2,y=g.height/2;g.x-k<r&&(r=g.x-k),g.x+k>l&&(l=g.x+k),g.y-y<f&&(f=g.y-y),g.y+y>s&&(s=g.y+y),n.push(...g.children)}if(a)return{root:e,width:l-r+ye*2,height:s-f+ye*2,vbX:r-ye,vbY:f-ye,vbW:l-r+ye*2,vbH:s-f+ye*2};const d=ye-f,c=[e];for(;c.length;){const g=c.pop();g.y+=d,c.push(...g.children)}return f+=d,s+=d,{root:e,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const qe=[{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 Wi(e,a=[]){return[...qe,...a].find(r=>r.id===e)??qe[0]}function Se(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(e){return JSON.parse(JSON.stringify(e))}function W(e,a){if(e.id===a)return e;for(const n of e.children){const r=W(n,a);if(r)return r}return null}function we(e,a,n=null){if(e.id===a)return n;for(const r of e.children){const l=we(r,a,e);if(l!==null)return l}return null}function Rt(e,a){const n=e.children.findIndex(r=>r.id===a);if(n>=0)return e.children.splice(n,1),!0;for(const r of e.children)if(Rt(r,a))return!0;return!1}function Gi(e,a,n){const r=W(e,a);return!r||r.text===n?!1:(r.text=n,!0)}function Ki(e,a,n,r){if(!we(e,a)||a===n||W(W(e,a),n))return!1;const l=we(e,a),f=l.children.findIndex(g=>g.id===a);if(f<0)return!1;const[s]=l.children.splice(f,1);if(r==="child"){const g=W(e,n);return g?(g.children.push(s),!0):(l.children.splice(f,0,s),!1)}const d=we(e,n);if(!d)return l.children.splice(f,0,s),!1;let c=d.children.findIndex(g=>g.id===n);return c<0?(l.children.splice(f,0,s),!1):(r==="after"&&(c+=1),d.children.splice(c,0,s),!0)}function nn(e){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of e.children){const f=l.text.match(a);if(f)if(f[1]){const s=parseInt(f[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?dt:n>0?`新节点 ${n+1}`:"新节点 2"}function on(e,a,n){const r=W(e,a);if(!r)return null;const l={id:Se(),text:n??nn(r),children:[]};return r.children.push(l),l}function rn(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n??nn(r),children:[]};return r.children.splice(l+1,0,f),f}function Yi(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n,children:[]};return r.children.splice(l,0,f),f}function Zi(e,a){const n=we(e,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],f=Te(l);return an(f),n.children.splice(r+1,0,f),f}function an(e){e.id=Se();for(const a of e.children)an(a)}const dt="新节点";function Ot(e,a="导入的导图"){const n=e.split(/\r?\n/),r={id:Se(),text:a,children:[]},l=[r],f=[-1/0],s=[],d=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,k=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let y=!1,N=[],h=null;function m(b){N.push(b)}function L(){if(h&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const b=N.join(`
|
|
2
|
-
`);
|
|
3
|
-
`+I:I}}
|
|
4
|
-
`;
|
|
5
|
-
`),
|
|
6
|
-
`),
|
|
7
|
-
`);for(const r of
|
|
8
|
-
`).trim();n.push({kind:"code",text:((
|
|
9
|
-
`)[0])==null?void 0:
|
|
10
|
-
`),lang:
|
|
11
|
-
`)}),r=
|
|
12
|
-
`)}),r=
|
|
13
|
-
`:""}function Ji(e){const a=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,l=t.ref(1),f=t.ref(0),s=t.ref(0),d=t.ref(!1),c=t.reactive({x:0,y:0,ox:0,oy:0}),g=t.ref(!1),k=t.reactive({x:0,y:0}),y=t.reactive({x:0,y:0,width:0,height:0}),N=t.ref(0);let h=null;function m(G){h=G}function L(G){G.preventDefault();const Q=e.getContainer();if(!Q)return;const re=-G.deltaY*.001,ue=Math.min(n,Math.max(a,l.value*(1+re))),ie=Q.getBoundingClientRect(),fe=G.clientX-ie.left,x=G.clientY-ie.top,C=(fe-f.value)/l.value,M=(x-s.value)/l.value;l.value=ue,f.value=fe-C*ue,s.value=x-M*ue}function B(){l.value=Math.min(n,l.value*r)}function b(){l.value=Math.max(a,l.value/r)}function O(G){var re;G.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(d.value=!0,c.x=G.clientX,c.y=G.clientY,c.ox=f.value,c.oy=s.value,window.addEventListener("mousemove",R),window.addEventListener("mouseup",z),(re=G.preventDefault)==null||re.call(G))}function R(G){d.value&&(f.value=c.ox+(G.clientX-c.x),s.value=c.oy+(G.clientY-c.y))}function z(){d.value=!1,window.removeEventListener("mousemove",R),window.removeEventListener("mouseup",z)}function $(G,Q){g.value=!0,k.x=G,k.y=Q,y.x=G,y.y=Q,y.width=0,y.height=0,N.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",J)}function I(G,Q){if(!g.value)return;const re=Math.min(k.x,G),ue=Math.min(k.y,Q),ie=Math.max(k.x,G),fe=Math.max(k.y,Q);y.x=re,y.y=ue,y.width=ie-re,y.height=fe-ue,N.value++}function J(){g.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",J),h&&h()}function ee(G){if(!g.value)return;const Q=e.getContainer();if(!Q)return;const re=Q.getBoundingClientRect(),ue=(G.clientX-re.left-f.value)/l.value,ie=(G.clientY-re.top-s.value)/l.value;I(ue,ie)}function ae(G,Q,re,ue=60){const ie=e.getContainer();if(!ie)return;const fe=ie.getBoundingClientRect(),x=(fe.width-ue*2)/G,C=(fe.height-ue*2)/Q,M=Math.min(1,Math.max(.3,Math.min(x,C)));l.value=M,f.value=fe.width/2,s.value=fe.height/2-re*M}return{scale:l,offsetX:f,offsetY:s,isPanning:d,onWheel:L,zoomIn:B,zoomOut:b,startPan:O,startMarquee:$,updateMarquee:I,isMarquee:g,marquee:y,marqueeVersion:N,setOnMarqueeEnd:m,resetView:ae}}const Qi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ln(e){return Qi?e.metaKey:e.ctrlKey}function eo(e){function a(){const r=e.getSelectedId();return r||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||e.isReadonly()||e.isEditing())return;const f=e.getSelectedId(),s=a();if(s){if(ln(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){f&&f!==e.getRootId()&&(r.preventDefault(),e.onDuplicate(f));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),e.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),e.onRedo();return}if(r.key==="Home"){r.preventDefault(),e.onSelectRoot();return}}if(ln(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),e.onRedo();return}r.key==="Tab"?(r.preventDefault(),e.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?f&&f!==e.getRootId()&&e.onAddSiblingBefore(f):e.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&f&&f!==e.getRootId()?(r.preventDefault(),e.onRemove(f)):r.key==="F2"&&f?(r.preventDefault(),e.onStartEdit(f)):r.key==="Escape"?(r.preventDefault(),e.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),e.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),e.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),e.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),e.onNavigate(-1,0))}}t.onMounted(()=>{window.addEventListener("keydown",n)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function to(e=100){const a=t.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function f(g){const k=JSON.stringify(g);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(k),n=a.value.length-1;a.value.length>e;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function d(){return l()?(n++,JSON.parse(a.value[n])):null}function c(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:d,reset:c}}const no=t.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let N=n.x+2,h=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),L=180,b=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;N+L>m.right&&(N=Math.max(m.left+4,n.x-L-2)),h+b>m.bottom&&(h=Math.max(m.top+4,n.y-b-2)),N<m.left+2&&(N=m.left+2),h<m.top+2&&(h=m.top+2)}return{left:N,top:h}}),f=t.computed(()=>n.hasImage),s=t.computed(()=>n.hasLink),d=t.computed(()=>n.hasNote);function c(N){const h=N.target;h&&h.closest(".zm-node-menu")||r("close")}function g(N){N.key==="Escape"&&r("close")}function k(){r("close")}window.addEventListener("mousedown",c,!0),window.addEventListener("keydown",g,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",c,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function y(N){N(),r("close")}return(N,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[10]||(h[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[0]||(h[0]=t.withModifiers(m=>y(()=>r("pickImage")),["stop"]))},[t.createVNode(q,{name:"image",size:13}),t.createElementVNode("span",null,t.toDisplayString(f.value?"替换图片":"添加图片"),1)]),f.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:h[1]||(h[1]=t.withModifiers(m=>y(()=>r("removeImage")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[11]||(h[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[2]||(h[2]=t.withModifiers(m=>y(()=>r("setLink")),["stop"]))},[t.createVNode(q,{name:"link",size:13}),t.createElementVNode("span",null,t.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:h[3]||(h[3]=t.withModifiers(m=>y(()=>r("removeLink")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[12]||(h[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[4]||(h[4]=t.withModifiers(m=>y(()=>r("addCode")),["stop"]))},[h[13]||(h[13]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasCode?"编辑代码块":"添加代码块"),1)]),e.hasCode?(t.openBlock(),t.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:h[5]||(h[5]=t.withModifiers(m=>y(()=>r("removeCode")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[14]||(h[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[6]||(h[6]=t.withModifiers(m=>y(()=>r("addTable")),["stop"]))},[h[15]||(h[15]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasTable?"编辑表格":"添加表格"),1)]),e.hasTable?(t.openBlock(),t.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:h[7]||(h[7]=t.withModifiers(m=>y(()=>r("removeTable")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[16]||(h[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[8]||(h[8]=t.withModifiers(m=>y(()=>r("editNote")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),t.createElementVNode("span",null,t.toDisplayString(d.value?"编辑笔记":"添加笔记"),1)]),d.value?(t.openBlock(),t.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:h[9]||(h[9]=t.withModifiers(m=>y(()=>r("removeNote")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[17]||(h[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),io=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let B=n.x+2,b=n.y+2;if(n.container){const O=n.container.getBoundingClientRect(),R=160,z=4+3*28;B+R>O.right&&(B=Math.max(O.left+4,n.x-R-2)),b+z>O.bottom&&(b=Math.max(O.top+4,n.y-z-2)),B<O.left+2&&(B=O.left+2),b<O.top+2&&(b=O.top+2)}return{left:B,top:b}}),f=t.ref(!1),s=t.ref(null),d=t.computed(()=>{if(!s.value)return{left:"-9999px",top:"-9999px",display:"none"};const B=s.value.getBoundingClientRect(),b=window.innerWidth,O=window.innerHeight,R=176,z=4+3*28;let $=B.right;$+R>b-4&&($=Math.max(4,B.left-R));let I=B.top-4;return I+z>O-4&&(I=Math.max(4,O-z-4)),{left:$+"px",top:I+"px",display:"block"}});let c=null,g=null;function k(){g&&(clearTimeout(g),g=null),c=setTimeout(()=>{f.value=!0},60)}function y(){c&&(clearTimeout(c),c=null),g=setTimeout(()=>{f.value=!1},120)}t.onBeforeUnmount(()=>{c&&clearTimeout(c),g&&clearTimeout(g)});function N(B){const b=B.target;b&&b.closest(".zm-canvas-menu")||r("close")}function h(B){B.key==="Escape"&&r("close")}function m(){r("close")}window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",h,!0),window.addEventListener("wheel",m,!0),window.addEventListener("scroll",m,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",h,!0),window.removeEventListener("wheel",m,!0),window.removeEventListener("scroll",m,!0)});function L(B){B(),r("close")}return(B,b)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:b[5]||(b[5]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[0]||(b[0]=t.withModifiers(O=>L(()=>r("openData")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),b[6]||(b[6]=t.createElementVNode("span",null,"查看数据",-1))]),t.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:t.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":f.value}]),onMouseenter:k,onMouseleave:y},[t.createVNode(q,{name:"import",size:13}),b[10]||(b[10]=t.createElementVNode("span",null,"导入",-1)),b[11]||(b[11]=t.createElementVNode("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"},[t.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:t.normalizeStyle(d.value),onMouseenter:k,onMouseleave:y},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[1]||(b[1]=t.withModifiers(O=>L(()=>r("openImport","markdown")),["stop"]))},[t.createVNode(q,{name:"markdown",size:13}),b[7]||(b[7]=t.createElementVNode("span",null,"Markdown 导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[2]||(b[2]=t.withModifiers(O=>L(()=>r("openImport","json")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),b[8]||(b[8]=t.createElementVNode("span",null,"JSON 文件导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[3]||(b[3]=t.withModifiers(O=>L(()=>r("openImport","txt")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),b[9]||(b[9]=t.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):t.createCommentVNode("",!0)],34),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[4]||(b[4]=t.withModifiers(O=>L(()=>r("openSettings")),["stop"]))},[t.createVNode(q,{name:"settings",size:13}),b[12]||(b[12]=t.createElementVNode("span",null,"设置",-1))])],36))}});function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(a=>{const n=e[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&sn(n)}),e}class cn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function dn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e,...a){const n=Object.create(null);for(const r in e)n[r]=e[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const ro="</span>",un=e=>!!e.scope,ao=(e,{prefix:a})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${e}`};class lo{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=dn(a)}openNode(a){if(!un(a))return;const n=ao(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){un(a)&&(this.buffer+=ro)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const fn=(e={})=>{const a={children:[]};return Object.assign(a,e),a};class It{constructor(){this.rootNode=fn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=fn({scope:a});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{It._collapse(n)}))}}class so extends It{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new lo(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function je(e){return e?typeof e=="string"?e:e.source:null}function gn(e){return Le("(?=",e,")")}function co(e){return Le("(?:",e,")*")}function uo(e){return Le("(?:",e,")?")}function Le(...e){return e.map(n=>je(n)).join("")}function fo(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function Bt(...e){return"("+(fo(e).capture?"":"?:")+e.map(r=>je(r)).join("|")+")"}function mn(e){return new RegExp(e.toString()+"|").exec("").length-1}function go(e,a){const n=e&&e.exec(a);return n&&n.index===0}const mo=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:a}){let n=0;return e.map(r=>{n+=1;const l=n;let f=je(r),s="";for(;f.length>0;){const d=mo.exec(f);if(!d){s+=f;break}s+=f.substring(0,d.index),f=f.substring(d.index+d[0].length),d[0][0]==="\\"&&d[1]?s+="\\"+String(Number(d[1])+l):(s+=d[0],d[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const po=/\b\B/,pn="[a-zA-Z]\\w*",Dt="[a-zA-Z_]\\w*",hn="\\b\\d+(\\.\\d+)?",bn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yn="\\b(0b[01]+)",ho="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",bo=(e={})=>{const a=/^#![ ]*\//;return e.binary&&(e.begin=Le(a,/.*\b/,e.binary,/\b.*/)),Ie({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Je={begin:"\\\\[\\s\\S]",relevance:0},yo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Je]},Eo={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Je]},xo={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/},ft=function(e,a,n={}){const r=Ie({scope:"comment",begin:e,end:a,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});const l=Bt("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:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ko=ft("//","$"),No=ft("/\\*","\\*/"),wo=ft("#","$"),_o={scope:"number",begin:hn,relevance:0},So={scope:"number",begin:bn,relevance:0},Mo={scope:"number",begin:yn,relevance:0},Co={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Je,{begin:/\[/,end:/\]/,relevance:0,contains:[Je]}]},vo={scope:"title",begin:pn,relevance:0},To={scope:"title",begin:Dt,relevance:0},Ao={begin:"\\.\\s*"+Dt,relevance:0};var gt=Object.freeze({__proto__:null,APOS_STRING_MODE:yo,BACKSLASH_ESCAPE:Je,BINARY_NUMBER_MODE:Mo,BINARY_NUMBER_RE:yn,COMMENT:ft,C_BLOCK_COMMENT_MODE:No,C_LINE_COMMENT_MODE:ko,C_NUMBER_MODE:So,C_NUMBER_RE:bn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:wo,IDENT_RE:pn,MATCH_NOTHING_RE:po,METHOD_GUARD:Ao,NUMBER_MODE:_o,NUMBER_RE:hn,PHRASAL_WORDS_MODE:xo,QUOTE_STRING_MODE:Eo,REGEXP_MODE:Co,RE_STARTERS_RE:ho,SHEBANG:bo,TITLE_MODE:vo,UNDERSCORE_IDENT_RE:Dt,UNDERSCORE_TITLE_MODE:To});function Ro(e,a){e.input[e.index-1]==="."&&a.ignoreMatch()}function Oo(e,a){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Io(e,a){a&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ro,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Bo(e,a){Array.isArray(e.illegal)&&(e.illegal=Bt(...e.illegal))}function Lo(e,a){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Do(e,a){e.relevance===void 0&&(e.relevance=1)}const zo=(e,a)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Le(n.beforeMatch,gn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},$o=["of","and","for","in","not","or","if","then","parent","list","value"],Po="keyword";function En(e,a,n=Po){const r=Object.create(null);return typeof e=="string"?l(n,e.split(" ")):Array.isArray(e)?l(n,e):Object.keys(e).forEach(function(f){Object.assign(r,En(e[f],a,f))}),r;function l(f,s){a&&(s=s.map(d=>d.toLowerCase())),s.forEach(function(d){const c=d.split("|");r[c[0]]=[f,Vo(c[0],c[1])]})}}function Vo(e,a){return a?Number(a):Uo(e)?0:1}function Uo(e){return $o.includes(e.toLowerCase())}const xn={},De=e=>{console.error(e)},kn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},Ve=(e,a)=>{xn[`${e}/${a}`]||(console.log(`Deprecated as of ${e}. ${a}`),xn[`${e}/${a}`]=!0)},mt=new Error;function Nn(e,a,{key:n}){let r=0;const l=e[n],f={},s={};for(let d=1;d<=a.length;d++)s[d+r]=l[d],f[d+r]=!0,r+=mn(a[d-1]);e[n]=s,e[n]._emit=f,e[n]._multi=!0}function Ho(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mt;if(typeof e.beginScope!="object"||e.beginScope===null)throw De("beginScope must be object"),mt;Nn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}function Fo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mt;if(typeof e.endScope!="object"||e.endScope===null)throw De("endScope must be object"),mt;Nn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}function Wo(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Go(e){Wo(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ho(e),Fo(e)}function Ko(e){function a(s,d){return new RegExp(je(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(d?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(d,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,d]),this.matchAt+=mn(d)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const d=this.regexes.map(c=>c[1]);this.matcherRe=a(Lt(d,{joinWith:"|"}),!0),this.lastIndex=0}exec(d){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(d);if(!c)return null;const g=c.findIndex((y,N)=>N>0&&y!==void 0),k=this.matchIndexes[g];return c.splice(0,g),Object.assign(c,k)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(d){if(this.multiRegexes[d])return this.multiRegexes[d];const c=new n;return this.rules.slice(d).forEach(([g,k])=>c.addRule(g,k)),c.compile(),this.multiRegexes[d]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(d,c){this.rules.push([d,c]),c.type==="begin"&&this.count++}exec(d){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let g=c.exec(d);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const k=this.getMatcher(0);k.lastIndex=this.lastIndex+1,g=k.exec(d)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(s){const d=new r;return s.contains.forEach(c=>d.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&d.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&d.addRule(s.illegal,{type:"illegal"}),d}function f(s,d){const c=s;if(s.isCompiled)return c;[Oo,Lo,Go,zo].forEach(k=>k(s,d)),e.compilerExtensions.forEach(k=>k(s,d)),s.__beforeBegin=null,[Io,Bo,Do].forEach(k=>k(s,d)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=En(s.keywords,e.case_insensitive)),c.keywordPatternRe=a(g,!0),d&&(s.begin||(s.begin=/\B|\b/),c.beginRe=a(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=a(c.end)),c.terminatorEnd=je(c.end)||"",s.endsWithParent&&d.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+d.terminatorEnd)),s.illegal&&(c.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(k){return Yo(k==="self"?s:k)})),s.contains.forEach(function(k){f(k,c)}),s.starts&&f(s.starts,d),c.matcher=l(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ie(e.classNameAliases||{}),f(e)}function wn(e){return e?e.endsWithParent||wn(e.starts):!1}function Yo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(a){return Ie(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Ie(e,{starts:e.starts?Ie(e.starts):null}):Object.isFrozen(e)?Ie(e):e}var Zo="11.11.1";class Xo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const zt=dn,_n=Ie,Sn=Symbol("nomatch"),qo=7,Mn=function(e){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const f="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:so};function c(x){return d.noHighlightRe.test(x)}function g(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";const M=d.languageDetectRe.exec(C);if(M){const v=ee(M[1]);return v||(kn(f.replace("{}",M[1])),kn("Falling back to no-highlight mode for this block.",x)),v?M[1]:"no-highlight"}return C.split(/\s+/).find(v=>c(v)||ee(v))}function k(x,C,M){let v="",H="";typeof C=="object"?(v=x,M=C.ignoreIllegals,H=C.language):(Ve("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ve("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
15
|
-
`,1;if(Ke>1e5&&Ke>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=U,U.length}const ke=ee(x);if(!ke)throw De(f.replace("{}",x)),new Error('Unknown language: "'+x+'"');const kt=Ko(ke);let et="",P=v||kt;const Nt={},le=new d.__emitter(d);Wt();let Y="",Ge=0,Ae=0,Ke=0,Ye=!1;try{if(ke.__emitTokens)ke.__emitTokens(C,le);else{for(P.matcher.considerAll();;){Ke++,Ye?Ye=!1:P.matcher.considerAll(),P.matcher.lastIndex=Ae;const S=P.matcher.exec(C);if(!S)break;const A=C.substring(Ae,S.index),U=Qe(A,S);Ae=S.index+U}Qe(C.substring(Ae))}return le.finalize(),et=le.toHTML(),{language:x,value:et,relevance:Ge,illegal:!1,_emitter:le,_top:P}}catch(S){if(S.message&&S.message.includes("Illegal"))return{language:x,value:zt(C),illegal:!0,relevance:0,_illegalBy:{message:S.message,index:Ae,context:C.slice(Ae-100,Ae+100),mode:S.mode,resultSoFar:et},_emitter:le};if(l)return{language:x,value:zt(C),illegal:!1,relevance:0,errorRaised:S,_emitter:le,_top:P};throw S}}function N(x){const C={value:zt(x),illegal:!1,relevance:0,_top:s,_emitter:new d.__emitter(d)};return C._emitter.addText(x),C}function h(x,C){C=C||d.languages||Object.keys(a);const M=N(x),v=C.filter(ee).filter(G).map(me=>y(me,x,!1));v.unshift(M);const H=v.sort((me,xe)=>{if(me.relevance!==xe.relevance)return xe.relevance-me.relevance;if(me.language&&xe.language){if(ee(me.language).supersetOf===xe.language)return 1;if(ee(xe.language).supersetOf===me.language)return-1}return 0}),[ne,ge]=H,Ee=ne;return Ee.secondBest=ge,Ee}function m(x,C,M){const v=C&&n[C]||M;x.classList.add("hljs"),x.classList.add(`language-${v}`)}function L(x){let C=null;const M=g(x);if(c(M))return;if(ie("before:highlightElement",{el:x,language:M}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(d.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(x)),d.throwUnescapedHTML))throw new Xo("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;const v=C.textContent,H=M?k(v,{language:M,ignoreIllegals:!0}):h(v);x.innerHTML=H.value,x.dataset.highlighted="yes",m(x,M,H.language),x.result={language:H.language,re:H.relevance,relevance:H.relevance},H.secondBest&&(x.secondBest={language:H.secondBest.language,relevance:H.secondBest.relevance}),ie("after:highlightElement",{el:x,result:H,text:v})}function B(x){d=_n(d,x)}const b=()=>{z(),Ve("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){z(),Ve("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let R=!1;function z(){function x(){z()}if(document.readyState==="loading"){R||window.addEventListener("DOMContentLoaded",x,!1),R=!0;return}document.querySelectorAll(d.cssSelector).forEach(L)}function $(x,C){let M=null;try{M=C(e)}catch(v){if(De("Language definition for '{}' could not be registered.".replace("{}",x)),l)De(v);else throw v;M=s}M.name||(M.name=x),a[x]=M,M.rawDefinition=C.bind(null,e),M.aliases&&ae(M.aliases,{languageName:x})}function I(x){delete a[x];for(const C of Object.keys(n))n[C]===x&&delete n[C]}function J(){return Object.keys(a)}function ee(x){return x=(x||"").toLowerCase(),a[x]||a[n[x]]}function ae(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(M=>{n[M.toLowerCase()]=C})}function G(x){const C=ee(x);return C&&!C.disableAutodetect}function Q(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C))})}function re(x){Q(x),r.push(x)}function ue(x){const C=r.indexOf(x);C!==-1&&r.splice(C,1)}function ie(x,C){const M=x;r.forEach(function(v){v[M]&&v[M](C)})}function fe(x){return Ve("10.7.0","highlightBlock will be removed entirely in v12.0"),Ve("10.7.0","Please use highlightElement now."),L(x)}Object.assign(e,{highlight:k,highlightAuto:h,highlightAll:z,highlightElement:L,highlightBlock:fe,configure:B,initHighlighting:b,initHighlightingOnLoad:O,registerLanguage:$,unregisterLanguage:I,listLanguages:J,getLanguage:ee,registerAliases:ae,autoDetection:G,inherit:_n,addPlugin:re,removePlugin:ue}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Zo,e.regex={concat:Le,lookahead:gn,either:Bt,optional:uo,anyNumberOfTimes:co};for(const x in gt)typeof gt[x]=="object"&&sn(gt[x]);return Object.assign(e,gt),e},Ue=Mn({});Ue.newInstance=()=>Mn({});var jo=Ue;Ue.HighlightJS=Ue,Ue.default=Ue;const $t=oo(jo);function Pt(e){const a=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,l]};l.contains.push(d);const c={match:/\\"/},g={className:"string",begin:/'/,end:/'/},k={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],b={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["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"],$=["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"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:B,built_in:[...O,...R,"set","shopt",...z,...$]},contains:[h,e.SHEBANG(),m,y,f,s,b,d,c,g,k,n]}}const Jo=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_-]*/}}),Qo=["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"],er=["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"],tr=[...Qo,...er],nr=["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"].sort().reverse(),ir=["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"].sort().reverse(),or=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rr=["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"].sort().reverse();function ar(e){const a=e.regex,n=Jo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",f=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",d=[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:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ir.join("|")+")"},{begin:":(:)?("+or.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:nr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tr.join("|")+")\\b"}]}}function Cn(e){const f={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:f,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:f,illegal:/["']/}]}]}}var He="[0-9](_*[0-9])*",pt=`\\.(${He})`,ht="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${He})((${pt})|\\.)?|(${pt}))[eE][+-]?(${He})[fFdD]?\\b`},{begin:`\\b(${He})((${pt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pt})[fFdD]?\\b`},{begin:`\\b(${He})[fFdD]\\b`},{begin:`\\b0[xX]((${ht})\\.?|(${ht})?\\.(${ht}))[pP][+-]?(${He})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ht})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Tn(e,a,n){return n===-1?"":e.replace(a,r=>Tn(e,a,n-1))}function lr(e){const a=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Tn("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={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"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},k={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,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:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[k,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:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vn,g]}}const An="[A-Za-z$_][0-9A-Za-z$_]*",sr=["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"],cr=["true","false","null","undefined","NaN","Infinity"],Rn=["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"],On=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],In=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ur=[].concat(In,Rn,On);function Bn(e){const a=e.regex,n=(M,{after:v})=>{const H="</"+M[0].slice(1);return M.input.indexOf(H,v)!==-1},r=An,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,v)=>{const H=M[0].length+M.index,ne=M.input[H];if(ne==="<"||ne===","){v.ignoreMatch();return}ne===">"&&(n(M,{after:H})||v.ignoreMatch());let ge;const Ee=M.input.substring(H);if(ge=Ee.match(/^\s*=/)){v.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){v.ignoreMatch();return}}},d={$pattern:An,keyword:sr,literal:cr,built_in:ur,"variable.language":dr},c="[0-9](_?[0-9])*",g=`\\.(${c})`,k="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${k})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b`},{begin:`\\b(${k})\\b((${g})\\b|\\.)?|(${g})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},O={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,{match:/\$\d+/},y];N.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const z=[].concat(O,N.contains),$=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(z)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Rn,...On]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...In,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,O,{match:/\$\d+/},y,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:x,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:d,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,Q,J,fe,{match:/\$[(.]/}]}}function fr(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,n,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ln(e){const a=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={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}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),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}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},k={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(g,{contains:[]}),N=e.inherit(k,{contains:[]});g.contains.push(N),k.contains.push(y);let h=[n,c];return[g,k,y,N].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(g,k),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,f,g,k,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Dn(e){const a=e.regex,n=new 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"],d={$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"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},k={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,k,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,k,g]},{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,k,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,k,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",h=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,m=`\\b|${r.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${h}))[eE][+-]?(${N})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${N})[jJ](?=${m})`}]},B={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",c,L,y,e.HASH_COMMENT_MODE]}]};return g.contains=[y,L,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[c,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,B,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{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:[L,b,y]}]}}function zn(e){const a=e.regex,n=/(r#)?/,r=a.concat(n,e.UNDERSCORE_IDENT_RE),l=a.concat(n,e.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",d=["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"],c=["true","false","Some","None","Ok","Err"],g=["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!"],k=["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:k,keyword:d,literal:c,built_in:g},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_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],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:g,type:k}},{className:"punctuation",begin:"->"},f]}}function gr(e){const a=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],d=["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"],c=["add","asc","collation","desc","final","first","last","view"],g=["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"],k=["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"],y=["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"],N=["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"],h=k,m=[...g,...c].filter($=>!k.includes($)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:a.concat(/\b/,a.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function O($){return a.concat(/\b/,a.either(...$.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:O(N),relevance:0};function z($,{exceptions:I,when:J}={}){const ee=J;return I=I||[],$.map(ae=>ae.match(/\|\d+$/)||I.includes(ae)?ae:ee(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(m,{when:$=>$.length<3}),literal:f,type:d,built_in:y},contains:[{scope:"type",match:O(s)},R,b,L,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,B]}}const bt="[A-Za-z$_][0-9A-Za-z$_]*",$n=["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"],Pn=["true","false","null","undefined","NaN","Infinity"],Vn=["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"],Un=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wn=[].concat(Hn,Vn,Un);function mr(e){const a=e.regex,n=(M,{after:v})=>{const H="</"+M[0].slice(1);return M.input.indexOf(H,v)!==-1},r=bt,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,v)=>{const H=M[0].length+M.index,ne=M.input[H];if(ne==="<"||ne===","){v.ignoreMatch();return}ne===">"&&(n(M,{after:H})||v.ignoreMatch());let ge;const Ee=M.input.substring(H);if(ge=Ee.match(/^\s*=/)){v.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){v.ignoreMatch();return}}},d={$pattern:bt,keyword:$n,literal:Pn,built_in:Wn,"variable.language":Fn},c="[0-9](_?[0-9])*",g=`\\.(${c})`,k="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${k})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b`},{begin:`\\b(${k})\\b((${g})\\b|\\.)?|(${g})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},O={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,{match:/\$\d+/},y];N.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const z=[].concat(O,N.contains),$=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(z)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Vn,...Un]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...Hn,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,O,{match:/\$\d+/},y,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:x,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:d,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,Q,J,fe,{match:/\$[(.]/}]}}function Gn(e){const a=e.regex,n=mr(e),r=bt,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:bt,keyword:$n.concat(c),literal:Pn,built_in:Wn.concat(l),"variable.language":Fn},k={className:"meta",begin:"@"+r},y=(L,B,b)=>{const O=L.contains.findIndex(R=>R.label===B);if(O===-1)throw new Error("can not find mode to replace");L.contains.splice(O,1,b)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(k);const N=n.contains.find(L=>L.scope==="attr"),h=Object.assign({},N,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,h]),n.contains=n.contains.concat([k,f,s,h]),y(n,"shebang",e.SHEBANG()),y(n,"use_strict",d);const m=n.contains.find(L=>L.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Kn(e){const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(f,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={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:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[f,c,d,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,s,c,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{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:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yn(e){const a="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},d=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},B=[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:a,keywords:{literal:a}},N,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,L,f,s],b=[...B];return b.pop(),b.push(d),h.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const Vt={bash:Pt,sh:Pt,shell:Pt,css:ar,go:Cn,golang:Cn,java:lr,javascript:Bn,js:Bn,json:fr,markdown:Ln,md:Ln,python:Dn,py:Dn,rust:zn,rs:zn,sql:gr,typescript:Gn,ts:Gn,xml:Kn,html:Kn,yaml:Yn,yml:Yn};for(const[e,a]of Object.entries(Vt))$t.registerLanguage(e,a);function Zn(e){const a=e.split(`
|
|
1
|
+
(function(ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(ce=typeof globalThis<"u"?globalThis:ce||self,e(ce.FlowMind={},ce.Vue))})(this,function(ce,e){"use strict";const wi=["width","height","stroke-width"],_i={key:4,points:"6 9 12 15 18 9"},Si={key:5,points:"9 6 15 12 9 18"},j=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(a,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<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)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",_i)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Si)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<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)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<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)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<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)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<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)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[43]||(n[43]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[44]||(n[44]=e.createElementVNode("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)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createStaticVNode('<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)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=e.createStaticVNode('<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)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[57]||(n[57]=e.createStaticVNode('<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)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[58]||(n[58]=e.createStaticVNode('<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)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createStaticVNode('<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)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[66]||(n[66]=e.createElementVNode("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)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[67]||(n[67]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,wi))}}),Qt="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",en="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",tn=[18,15,13,12],Mi=[700,600,500,400],Ci=[52,40,32,28],vi=[120,80,60,44],Ti=[.8,.8,.8,.8],Ai=tn.length-1;function Ri(t,a){return Math.round(Rt(t,a)*Ti[ct(t)])}function ct(t){return Math.min(Ai,Math.max(0,t))}function Rt(t,a=14){return Math.round(tn[ct(t)]*a/14*10)/10}function Bi(t,a=14){return Math.round(Ci[ct(t)]*a/14)}const dt=60,Ue=14,ye=24;let Bt=null;function Oi(){if(Bt)return Bt;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(Bt=t,t):{font:"",measureText:()=>({width:0})}}const nn=new Map;function Ii(t,a,n){const r=`${n}|${a}|${t}`,l=nn.get(r);if(l!==void 0)return l;const u=Oi();u.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=u.measureText(t).width;return nn.set(r,s),s}const Li=24,Di=400,zi=8,on=16,$i=4,Vi=200;function Pi(t,a,n){return Math.min(n,Math.max(a,t))}function Ui(t,a,n,r,l){const u=ct(a),s=Rt(a,n),c=Math.min(Ii(t.text||"",s,Mi[u]),Vi),d=Ri(a,n),m=Math.ceil(c+d*2),E=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Bi(a,n);let N=0;if(t.link&&(N+=on),t.note&&(N+=on),N>0){const I=(t.link?1:0)+(t.note?1:0);N+=$i*I}const b=m+N,g=(()=>{const I=Math.round(vi[u]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const Q=l==null?void 0:l[t.id];return Math.max(I,Q??240)}return I})(),V=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),D=r==null?void 0:r[t.id],y=V?Math.max(24,D??Math.max(70,Math.ceil(s*5))):0,L=y>0?10:0;if(!t.image){const I=Math.max(g,b),Q=Math.ceil(E+L+y);return{w:I,h:Q}}const O=Pi(t.image.width,Li,Di),P=Math.max(g,b,Math.ceil(O+d*2)),z=Math.ceil(t.image.height+zi+E+L+y);return{w:P,h:z}}function Hi(t,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,u=an(t,0,null,1,"right",l,a.richHeights,a.richWidths);return Wi(u),Fi(u,n,r),u.x=0,u.y=0,Ki(u,r)}function Fi(t,a,n=!1){if(a==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const c=r.reduce((E,N)=>E+N._subtreeH,0);let d=1,m=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),x=0;for(let E=0;E<r.length-1;E++){x+=r[E]._subtreeH;const N=Math.abs(x-(c-x));N<m&&(m=N,d=E+1)}for(let E=0;E<d;E++)r[E]._dir="right",r[E].side=1,r[E]._dirRight=1;for(let E=d;E<r.length;E++)r[E]._dir="left",r[E].side=-1,r[E]._dirRight=-1}const l=t.children.filter(c=>c.side===1),u=t.children.filter(c=>c.side===-1),s=(c,d)=>{const m=d==="right"?1:-1;c._dir=d,c.side=m,c._dirRight=m;for(const x of c.children)s(x,d)};for(const c of l)s(c,"right");for(const c of u)s(c,"left");if(l.length>0){const c={...t,children:l};ut(c,"right",dt,!0,n)}if(u.length>0){const c={...t,children:u};ut(c,"left",dt,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const u of l.children)r(u)};for(const l of t.children)l._dir="right";ut(t,"right",dt,!0,n),r(t)}else{for(const r of t.children)r._dir="down";rn(t,dt,n)}}function ut(t,a,n,r,l=!1){if(t.children.length===0)return;const u=t.children.reduce((m,x,E)=>m+x._subtreeH+(E>0?Ue:0),0),s=a==="right"?1:-1,c=r?s:1;let d=t.y-c*u/2;t.children.forEach(m=>{l||(m.x=t.x+s*(t.width/2+n+m.width/2),m.y=d+c*m._subtreeH/2),m._dir=a,d+=c*(m._subtreeH+Ue),ut(m,a,n,!1,l)})}function rn(t,a,n=!1){if(t.children.length===0)return;const r=t.children.reduce((u,s,c)=>u+s._subtreeW+(c>0?Ue*2:0),0);let l=t.x-r/2;t.children.forEach(u=>{n||(u.x=l+u._subtreeW/2,u.y=t.y+t.height/2+a+u.height/2),u._dir="down",l+=u._subtreeW+Ue*2,rn(u,a,n)})}function an(t,a,n,r,l,u,s,c){const d=Ui(t,a,u,s,c),m={id:t.id,text:t.text,depth:a,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:Rt(a,u),isRoot:a===0,collapsed:t.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,children:[],parent:n};if(t.collapsed)return m;const x=t.children.length,E=Math.ceil(x/2);return m.children=t.children.map((N,b)=>{const g=a===0?b<E?1:-1:r;return an(N,a+1,m,g,l,u,s,c)}),m}function Wi(t){const a=[t];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,u=0;for(const s of r.children)l+=s._subtreeH,u+=s._subtreeW;r.children.length>1&&(l+=Ue*(r.children.length-1),u+=Ue*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,u)}}function Ki(t,a=!1){const n=[t];let r=1/0,l=-1/0,u=1/0,s=-1/0;for(;n.length;){const m=n.pop(),x=m.width/2,E=m.height/2;m.x-x<r&&(r=m.x-x),m.x+x>l&&(l=m.x+x),m.y-E<u&&(u=m.y-E),m.y+E>s&&(s=m.y+E),n.push(...m.children)}if(a)return{root:t,width:l-r+ye*2,height:s-u+ye*2,vbX:r-ye,vbY:u-ye,vbW:l-r+ye*2,vbH:s-u+ye*2};const c=ye-u,d=[t];for(;d.length;){const m=d.pop();m.y+=c,d.push(...m.children)}return u+=c,s+=c,{root:t,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const Xe=[{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 Gi(t,a=[]){return[...Xe,...a].find(r=>r.id===t)??Xe[0]}function Me(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(t){return JSON.parse(JSON.stringify(t))}function Z(t,a){if(t.id===a)return t;for(const n of t.children){const r=Z(n,a);if(r)return r}return null}function we(t,a,n=null){if(t.id===a)return n;for(const r of t.children){const l=we(r,a,t);if(l!==null)return l}return null}function Ot(t,a){const n=t.children.findIndex(r=>r.id===a);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Ot(r,a))return!0;return!1}function Yi(t,a,n){const r=Z(t,a);return!r||r.text===n?!1:(r.text=n,!0)}function Zi(t,a,n,r){if(!we(t,a)||a===n||Z(Z(t,a),n))return!1;const l=we(t,a),u=l.children.findIndex(m=>m.id===a);if(u<0)return!1;const[s]=l.children.splice(u,1);if(r==="child"){const m=Z(t,n);return m?(m.children.push(s),!0):(l.children.splice(u,0,s),!1)}const c=we(t,n);if(!c)return l.children.splice(u,0,s),!1;let d=c.children.findIndex(m=>m.id===n);return d<0?(l.children.splice(u,0,s),!1):(r==="after"&&(d+=1),c.children.splice(d,0,s),!0)}function ln(t){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of t.children){const u=l.text.match(a);if(u)if(u[1]){const s=parseInt(u[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?ft:n>0?`新节点 ${n+1}`:"新节点 2"}function sn(t,a,n){const r=Z(t,a);if(!r)return null;const l={id:Me(),text:n??ln(r),children:[]};return r.children.push(l),l}function cn(t,a,n){const r=we(t,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const u={id:Me(),text:n??ln(r),children:[]};return r.children.splice(l+1,0,u),u}function Xi(t,a,n){const r=we(t,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const u={id:Me(),text:n,children:[]};return r.children.splice(l,0,u),u}function qi(t,a){const n=we(t,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],u=Te(l);return dn(u),n.children.splice(r+1,0,u),u}function dn(t){t.id=Me();for(const a of t.children)dn(a)}const ft="新节点";function It(t,a="导入的导图"){const n=t.split(/\r?\n/),r={id:Me(),text:a,children:[]},l=[r],u=[-1/0],s=[],c=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,x=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let E=!1,N=[],b=null;function g(y){N.push(y)}function V(){if(b&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const y=N.join(`
|
|
2
|
+
`);y&&(b.note={text:y})}E=!1,N=[]}for(const y of n){if(E){const I=y.match(x);if(I&&I[1][0]==="`"){V();continue}g(y);continue}const L=y.match(c);if(L){const I=L[1].length,Q=L[2].trim();s.push({level:I,text:Q,body:""}),b=s[s.length-1];continue}const O=y.match(x);if(O&&O[2]==="note"){E=!0,N=[];continue}const P=y.match(d);if(P&&b){const I=P[2],Q=160,te=120;b.image={src:I,naturalW:Q,naturalH:te,width:Q,height:te};continue}const z=y.match(m);if(z&&b){b.link={url:z[2]},b.text=z[1];continue}if(y.trim().length>0&&b){const I=y.trim();b.body=b.body?b.body+`
|
|
3
|
+
`+I:I}}E&&V();function D(y){for(;l.length>1;){const z=l.length-1,I=u[z];if(I!==void 0&&I<y.level)break;l.pop(),u.pop()}const L=l[l.length-1],O=y.text,P={id:Me(),text:O,children:[]};y.image&&(P.image={...y.image}),y.link&&(P.link={url:y.link.url}),y.note&&(P.note={text:y.note.text}),y.body&&(P.note={text:y.body}),L.children.push(P),l.push(P),u.push(y.level)}for(const y of s)D(y);if(s.length>0&&s[0].level===1){const y=r.children[0];y&&(r.text=y.text,r.id=y.id,y.image&&(r.image={...y.image}),y.link&&(r.link={url:y.link.url}),y.note&&(r.note={text:y.note.text}),r.children=y.children)}return r}function mt(t,a=1){let n="#".repeat(a)+" "+(t.text||"")+`
|
|
4
|
+
`;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
|
|
5
|
+
`),t.image&&(n+=`
|
|
6
|
+
`),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
|
|
7
|
+
`);for(const r of t.children)n+=mt(r,a+1);return n}function ji(t){var m,x;const a=t.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,u=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,c=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<a.length;){const E=a[r],N=E.match(u);if(N){const O=N[1][0],P=N[2]||"",z=[E];for(r++;r<a.length;){const Q=a[r].match(u);if(Q&&Q[1][0]===O){z.push(a[r]),r++;break}z.push(a[r]),r++}const I=z.slice(1,-1).join(`
|
|
8
|
+
`).trim();n.push({kind:"code",text:((m=I.split(`
|
|
9
|
+
`)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:z.join(`
|
|
10
|
+
`),lang:P});continue}const b=E.match(l);if(b){n.push({kind:"heading",level:b[1].length,text:b[2].trim(),raw:E}),r++;continue}if(/^\s*\|/.test(E)){const O=[];let P=r,z=!1;for(;P<a.length&&/^\s*\|/.test(a[P]);)O.push(a[P]),s.test(a[P])&&(z=!0),P++;if(z&&O.length>=2){n.push({kind:"table",text:((x=O[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:x.trim())||"表格",raw:O.join(`
|
|
11
|
+
`)}),r=P;continue}}const g=E.match(c),V=E.match(d);if(g||V){let O=r;for(;O<a.length;){const P=a[O].match(c),z=a[O].match(d);if(!(P||z))break;const I=a[O].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();I.length>0&&n.push({kind:"list",text:I.slice(0,80)||"(列表项)",raw:a[O]}),O++}r=O;continue}if(E.trim()===""){r++;continue}const D=[E];let y=r+1;for(;y<a.length;){const O=a[y];if(O.trim()===""||l.test(O)||u.test(O)||c.test(O)||d.test(O)||/^\s*\|/.test(O))break;D.push(O),y++}const L=D.join(" ").trim();n.push({kind:"paragraph",text:L.slice(0,80)||"(空段落)",raw:D.join(`
|
|
12
|
+
`)}),r=y}return n}function Ji(t,a="导入的导图"){const n=ji(t||""),r={id:Me(),text:a,children:[]},l=[r],u=[0];let s=!1;function c(d){if(d.kind==="heading"){const x=d.level;for(;l.length>1&&u[u.length-1]>=x;)l.pop(),u.pop();if(!s&&x===1){s=!0,r.text=d.text,u[0]=1;return}const E={id:Me(),text:d.text,children:[]};l[l.length-1].children.push(E),l.push(E),u.push(x);return}const m={id:Me(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(m)}for(const d of n)c(d);return r}function Qi(t){return t.richContent?t.richContent.raw+`
|
|
13
|
+
`:""}function eo(t){const a=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,l=e.ref(1),u=e.ref(0),s=e.ref(0),c=e.ref(!1),d=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),x=e.reactive({x:0,y:0}),E=e.reactive({x:0,y:0,width:0,height:0}),N=e.ref(0);let b=null;function g(K){b=K}function V(K){K.preventDefault();const J=t.getContainer();if(!J)return;const ae=-K.deltaY*.001,B=Math.min(n,Math.max(a,l.value*(1+ae))),$=J.getBoundingClientRect(),v=K.clientX-$.left,p=K.clientY-$.top,C=(v-u.value)/l.value,_=(p-s.value)/l.value;l.value=B,u.value=v-C*B,s.value=p-_*B}function D(){l.value=Math.min(n,l.value*r)}function y(){l.value=Math.max(a,l.value/r)}function L(K){var ae;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,d.x=K.clientX,d.y=K.clientY,d.ox=u.value,d.oy=s.value,window.addEventListener("mousemove",O),window.addEventListener("mouseup",P),(ae=K.preventDefault)==null||ae.call(K))}function O(K){c.value&&(u.value=d.ox+(K.clientX-d.x),s.value=d.oy+(K.clientY-d.y))}function P(){c.value=!1,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",P)}function z(K,J){m.value=!0,x.x=K,x.y=J,E.x=K,E.y=J,E.width=0,E.height=0,N.value++,window.addEventListener("mousemove",te),window.addEventListener("mouseup",Q)}function I(K,J){if(!m.value)return;const ae=Math.min(x.x,K),B=Math.min(x.y,J),$=Math.max(x.x,K),v=Math.max(x.y,J);E.x=ae,E.y=B,E.width=$-ae,E.height=v-B,N.value++}function Q(){m.value=!1,window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",Q),b&&b()}function te(K){if(!m.value)return;const J=t.getContainer();if(!J)return;const ae=J.getBoundingClientRect(),B=(K.clientX-ae.left-u.value)/l.value,$=(K.clientY-ae.top-s.value)/l.value;I(B,$)}function le(K,J,ae,B=60){const $=t.getContainer();if(!$)return;const v=$.getBoundingClientRect(),p=(v.width-B*2)/K,C=(v.height-B*2)/J,_=Math.min(1,Math.max(.3,Math.min(p,C)));l.value=_,u.value=v.width/2,s.value=v.height/2-ae*_}return{scale:l,offsetX:u,offsetY:s,isPanning:c,onWheel:V,zoomIn:D,zoomOut:y,startPan:L,startMarquee:z,updateMarquee:I,isMarquee:m,marquee:E,marqueeVersion:N,setOnMarqueeEnd:g,resetView:le}}const to=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function un(t){return to?t.metaKey:t.ctrlKey}function no(t){function a(){const r=t.getSelectedId();return r||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||t.isReadonly()||t.isEditing())return;const u=t.getSelectedId(),s=a();if(s){if(un(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){u&&u!==t.getRootId()&&(r.preventDefault(),t.onDuplicate(u));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(un(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}r.key==="Tab"?(r.preventDefault(),t.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?u&&u!==t.getRootId()&&t.onAddSiblingBefore(u):t.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&u&&u!==t.getRootId()?(r.preventDefault(),t.onRemove(u)):r.key==="F2"&&u?(r.preventDefault(),t.onStartEdit(u)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function io(t=100){const a=e.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function u(m){const x=JSON.stringify(m);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(x),n=a.value.length-1;a.value.length>t;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function c(){return l()?(n++,JSON.parse(a.value[n])):null}function d(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:u,undo:s,redo:c,reset:d}}const oo=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:a}){const n=t,r=a,l=e.computed(()=>{let N=n.x+2,b=n.y+2;if(n.container){const g=n.container.getBoundingClientRect(),V=180,y=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;N+V>g.right&&(N=Math.max(g.left+4,n.x-V-2)),b+y>g.bottom&&(b=Math.max(g.top+4,n.y-y-2)),N<g.left+2&&(N=g.left+2),b<g.top+2&&(b=g.top+2)}return{left:N,top:b}}),u=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),c=e.computed(()=>n.hasNote);function d(N){const b=N.target;b&&b.closest(".zm-node-menu")||r("close")}function m(N){N.key==="Escape"&&r("close")}function x(){r("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",x,!0),window.addEventListener("scroll",x,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",x,!0),window.removeEventListener("scroll",x,!0)});function E(N){N(),r("close")}return(N,b)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:b[10]||(b[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[0]||(b[0]=e.withModifiers(g=>E(()=>r("pickImage")),["stop"]))},[e.createVNode(j,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"替换图片":"添加图片"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:b[1]||(b[1]=e.withModifiers(g=>E(()=>r("removeImage")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[11]||(b[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[2]||(b[2]=e.withModifiers(g=>E(()=>r("setLink")),["stop"]))},[e.createVNode(j,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:b[3]||(b[3]=e.withModifiers(g=>E(()=>r("removeLink")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[12]||(b[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[4]||(b[4]=e.withModifiers(g=>E(()=>r("addCode")),["stop"]))},[b[13]||(b[13]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:b[5]||(b[5]=e.withModifiers(g=>E(()=>r("removeCode")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[14]||(b[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[6]||(b[6]=e.withModifiers(g=>E(()=>r("addTable")),["stop"]))},[b[15]||(b[15]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:b[7]||(b[7]=e.withModifiers(g=>E(()=>r("removeTable")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[16]||(b[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[8]||(b[8]=e.withModifiers(g=>E(()=>r("editNote")),["stop"]))},[e.createVNode(j,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑笔记":"添加笔记"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:b[9]||(b[9]=e.withModifiers(g=>E(()=>r("removeNote")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[17]||(b[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),ro=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:a}){const n=t,r=a,l=e.computed(()=>{let D=n.x+2,y=n.y+2;if(n.container){const L=n.container.getBoundingClientRect(),O=160,P=4+3*28;D+O>L.right&&(D=Math.max(L.left+4,n.x-O-2)),y+P>L.bottom&&(y=Math.max(L.top+4,n.y-P-2)),D<L.left+2&&(D=L.left+2),y<L.top+2&&(y=L.top+2)}return{left:D,top:y}}),u=e.ref(!1),s=e.ref(null),c=e.computed(()=>{if(!s.value)return{left:"-9999px",top:"-9999px",display:"none"};const D=s.value.getBoundingClientRect(),y=window.innerWidth,L=window.innerHeight,O=176,P=4+3*28;let z=D.right;z+O>y-4&&(z=Math.max(4,D.left-O));let I=D.top-4;return I+P>L-4&&(I=Math.max(4,L-P-4)),{left:z+"px",top:I+"px",display:"block"}});let d=null,m=null;function x(){m&&(clearTimeout(m),m=null),d=setTimeout(()=>{u.value=!0},60)}function E(){d&&(clearTimeout(d),d=null),m=setTimeout(()=>{u.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),m&&clearTimeout(m)});function N(D){const y=D.target;y&&y.closest(".zm-canvas-menu")||r("close")}function b(D){D.key==="Escape"&&r("close")}function g(){r("close")}window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",b,!0),window.addEventListener("wheel",g,!0),window.addEventListener("scroll",g,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",b,!0),window.removeEventListener("wheel",g,!0),window.removeEventListener("scroll",g,!0)});function V(D){D(),r("close")}return(D,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:y[5]||(y[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(L=>V(()=>r("openData")),["stop"]))},[e.createVNode(j,{name:"data",size:13}),y[6]||(y[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":u.value}]),onMouseenter:x,onMouseleave:E},[e.createVNode(j,{name:"import",size:13}),y[10]||(y[10]=e.createElementVNode("span",null,"导入",-1)),y[11]||(y[11]=e.createElementVNode("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"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(c.value),onMouseenter:x,onMouseleave:E},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(L=>V(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(j,{name:"markdown",size:13}),y[7]||(y[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(L=>V(()=>r("openImport","json")),["stop"]))},[e.createVNode(j,{name:"data",size:13}),y[8]||(y[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(L=>V(()=>r("openImport","txt")),["stop"]))},[e.createVNode(j,{name:"note",size:13}),y[9]||(y[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[4]||(y[4]=e.withModifiers(L=>V(()=>r("openSettings")),["stop"]))},[e.createVNode(j,{name:"settings",size:13}),y[12]||(y[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function ao(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fn(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(a=>{const n=t[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&fn(n)}),t}class mn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function gn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Be(t,...a){const n=Object.create(null);for(const r in t)n[r]=t[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const lo="</span>",pn=t=>!!t.scope,so=(t,{prefix:a})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${t}`};class co{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=gn(a)}openNode(a){if(!pn(a))return;const n=so(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){pn(a)&&(this.buffer+=lo)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const hn=(t={})=>{const a={children:[]};return Object.assign(a,t),a};class Lt{constructor(){this.rootNode=hn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=hn({scope:a});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{Lt._collapse(n)}))}}class uo extends Lt{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new co(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function qe(t){return t?typeof t=="string"?t:t.source:null}function bn(t){return Le("(?=",t,")")}function fo(t){return Le("(?:",t,")*")}function mo(t){return Le("(?:",t,")?")}function Le(...t){return t.map(n=>qe(n)).join("")}function go(t){const a=t[t.length-1];return typeof a=="object"&&a.constructor===Object?(t.splice(t.length-1,1),a):{}}function Dt(...t){return"("+(go(t).capture?"":"?:")+t.map(r=>qe(r)).join("|")+")"}function yn(t){return new RegExp(t.toString()+"|").exec("").length-1}function po(t,a){const n=t&&t.exec(a);return n&&n.index===0}const ho=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function zt(t,{joinWith:a}){let n=0;return t.map(r=>{n+=1;const l=n;let u=qe(r),s="";for(;u.length>0;){const c=ho.exec(u);if(!c){s+=u;break}s+=u.substring(0,c.index),u=u.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+l):(s+=c[0],c[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const bo=/\b\B/,En="[a-zA-Z]\\w*",$t="[a-zA-Z_]\\w*",xn="\\b\\d+(\\.\\d+)?",kn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Nn="\\b(0b[01]+)",yo="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Eo=(t={})=>{const a=/^#![ ]*\//;return t.binary&&(t.begin=Le(a,/.*\b/,t.binary,/\b.*/)),Be({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},je={begin:"\\\\[\\s\\S]",relevance:0},xo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[je]},ko={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[je]},No={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/},gt=function(t,a,n={}){const r=Be({scope:"comment",begin:t,end:a,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});const l=Dt("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:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},wo=gt("//","$"),_o=gt("/\\*","\\*/"),So=gt("#","$"),Mo={scope:"number",begin:xn,relevance:0},Co={scope:"number",begin:kn,relevance:0},vo={scope:"number",begin:Nn,relevance:0},To={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[je,{begin:/\[/,end:/\]/,relevance:0,contains:[je]}]},Ao={scope:"title",begin:En,relevance:0},Ro={scope:"title",begin:$t,relevance:0},Bo={begin:"\\.\\s*"+$t,relevance:0};var pt=Object.freeze({__proto__:null,APOS_STRING_MODE:xo,BACKSLASH_ESCAPE:je,BINARY_NUMBER_MODE:vo,BINARY_NUMBER_RE:Nn,COMMENT:gt,C_BLOCK_COMMENT_MODE:_o,C_LINE_COMMENT_MODE:wo,C_NUMBER_MODE:Co,C_NUMBER_RE:kn,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:So,IDENT_RE:En,MATCH_NOTHING_RE:bo,METHOD_GUARD:Bo,NUMBER_MODE:Mo,NUMBER_RE:xn,PHRASAL_WORDS_MODE:No,QUOTE_STRING_MODE:ko,REGEXP_MODE:To,RE_STARTERS_RE:yo,SHEBANG:Eo,TITLE_MODE:Ao,UNDERSCORE_IDENT_RE:$t,UNDERSCORE_TITLE_MODE:Ro});function Oo(t,a){t.input[t.index-1]==="."&&a.ignoreMatch()}function Io(t,a){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Lo(t,a){a&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Oo,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Do(t,a){Array.isArray(t.illegal)&&(t.illegal=Dt(...t.illegal))}function zo(t,a){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function $o(t,a){t.relevance===void 0&&(t.relevance=1)}const Vo=(t,a)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Le(n.beforeMatch,bn(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Po=["of","and","for","in","not","or","if","then","parent","list","value"],Uo="keyword";function wn(t,a,n=Uo){const r=Object.create(null);return typeof t=="string"?l(n,t.split(" ")):Array.isArray(t)?l(n,t):Object.keys(t).forEach(function(u){Object.assign(r,wn(t[u],a,u))}),r;function l(u,s){a&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const d=c.split("|");r[d[0]]=[u,Ho(d[0],d[1])]})}}function Ho(t,a){return a?Number(a):Fo(t)?0:1}function Fo(t){return Po.includes(t.toLowerCase())}const _n={},De=t=>{console.error(t)},Sn=(t,...a)=>{console.log(`WARN: ${t}`,...a)},He=(t,a)=>{_n[`${t}/${a}`]||(console.log(`Deprecated as of ${t}. ${a}`),_n[`${t}/${a}`]=!0)},ht=new Error;function Mn(t,a,{key:n}){let r=0;const l=t[n],u={},s={};for(let c=1;c<=a.length;c++)s[c+r]=l[c],u[c+r]=!0,r+=yn(a[c-1]);t[n]=s,t[n]._emit=u,t[n]._multi=!0}function Wo(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof t.beginScope!="object"||t.beginScope===null)throw De("beginScope must be object"),ht;Mn(t,t.begin,{key:"beginScope"}),t.begin=zt(t.begin,{joinWith:""})}}function Ko(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof t.endScope!="object"||t.endScope===null)throw De("endScope must be object"),ht;Mn(t,t.end,{key:"endScope"}),t.end=zt(t.end,{joinWith:""})}}function Go(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Yo(t){Go(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Wo(t),Ko(t)}function Zo(t){function a(s,c){return new RegExp(qe(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=yn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(d=>d[1]);this.matcherRe=a(zt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(c);if(!d)return null;const m=d.findIndex((E,N)=>N>0&&E!==void 0),x=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,x)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const d=new n;return this.rules.slice(c).forEach(([m,x])=>d.addRule(m,x)),d.compile(),this.multiRegexes[c]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,d){this.rules.push([c,d]),d.type==="begin"&&this.count++}exec(c){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.exec(c);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const x=this.getMatcher(0);x.lastIndex=this.lastIndex+1,m=x.exec(c)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function l(s){const c=new r;return s.contains.forEach(d=>c.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function u(s,c){const d=s;if(s.isCompiled)return d;[Io,zo,Yo,Vo].forEach(x=>x(s,c)),t.compilerExtensions.forEach(x=>x(s,c)),s.__beforeBegin=null,[Lo,Do,$o].forEach(x=>x(s,c)),s.isCompiled=!0;let m=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),m=s.keywords.$pattern,delete s.keywords.$pattern),m=m||/\w+/,s.keywords&&(s.keywords=wn(s.keywords,t.case_insensitive)),d.keywordPatternRe=a(m,!0),c&&(s.begin||(s.begin=/\B|\b/),d.beginRe=a(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=a(d.end)),d.terminatorEnd=qe(d.end)||"",s.endsWithParent&&c.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(d.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(x){return Xo(x==="self"?s:x)})),s.contains.forEach(function(x){u(x,d)}),s.starts&&u(s.starts,c),d.matcher=l(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Be(t.classNameAliases||{}),u(t)}function Cn(t){return t?t.endsWithParent||Cn(t.starts):!1}function Xo(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(a){return Be(t,{variants:null},a)})),t.cachedVariants?t.cachedVariants:Cn(t)?Be(t,{starts:t.starts?Be(t.starts):null}):Object.isFrozen(t)?Be(t):t}var qo="11.11.1";class jo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const Vt=gn,vn=Be,Tn=Symbol("nomatch"),Jo=7,An=function(t){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const u="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:uo};function d(p){return c.noHighlightRe.test(p)}function m(p){let C=p.className+" ";C+=p.parentNode?p.parentNode.className:"";const _=c.languageDetectRe.exec(C);if(_){const T=te(_[1]);return T||(Sn(u.replace("{}",_[1])),Sn("Falling back to no-highlight mode for this block.",p)),T?_[1]:"no-highlight"}return C.split(/\s+/).find(T=>d(T)||te(T))}function x(p,C,_){let T="",G="";typeof C=="object"?(T=p,_=C.ignoreIllegals,G=C.language):(He("10.7.0","highlight(lang, code, ...args) has been deprecated."),He("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),G=p,T=C),_===void 0&&(_=!0);const re={code:T,language:G};$("before:highlight",re);const ue=re.result?re.result:E(re.language,re.code,_);return ue.code=re.code,$("after:highlight",ue),ue}function E(p,C,_,T){const G=Object.create(null);function re(M,R){return M.keywords[R]}function ue(){if(!H.keywords){de.addText(ie);return}let M=0;H.keywordPatternRe.lastIndex=0;let R=H.keywordPatternRe.exec(ie),W="";for(;R;){W+=ie.substring(M,R.index);const q=ke.case_insensitive?R[0].toLowerCase():R[0],fe=re(H,q);if(fe){const[_e,tt]=fe;if(de.addText(W),W="",G[q]=(G[q]||0)+1,G[q]<=Jo&&(Ve+=tt),_e.startsWith("_"))W+=R[0];else{const nt=ke.classNameAliases[_e]||_e;xe(R[0],nt)}}else W+=R[0];M=H.keywordPatternRe.lastIndex,R=H.keywordPatternRe.exec(ie)}W+=ie.substring(M),de.addText(W)}function Ee(){if(ie==="")return;let M=null;if(typeof H.subLanguage=="string"){if(!a[H.subLanguage]){de.addText(ie);return}M=E(H.subLanguage,ie,!0,_t[H.subLanguage]),_t[H.subLanguage]=M._top}else M=b(ie,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(Ve+=M.relevance),de.__addSublanguage(M._emitter,M.language)}function ge(){H.subLanguage!=null?Ee():ue(),ie=""}function xe(M,R){M!==""&&(de.startScope(R),de.addText(M),de.endScope())}function $e(M,R){let W=1;const q=R.length-1;for(;W<=q;){if(!M._emit[W]){W++;continue}const fe=ke.classNameAliases[M[W]]||M[W],_e=R[W];fe?xe(_e,fe):(ie=_e,ue(),ie=""),W++}}function xt(M,R){return M.scope&&typeof M.scope=="string"&&de.openNode(ke.classNameAliases[M.scope]||M.scope),M.beginScope&&(M.beginScope._wrap?(xe(ie,ke.classNameAliases[M.beginScope._wrap]||M.beginScope._wrap),ie=""):M.beginScope._multi&&($e(M.beginScope,R),ie="")),H=Object.create(M,{parent:{value:H}}),H}function kt(M,R,W){let q=po(M.endRe,W);if(q){if(M["on:end"]){const fe=new mn(M);M["on:end"](R,fe),fe.isMatchIgnored&&(q=!1)}if(q){for(;M.endsParent&&M.parent;)M=M.parent;return M}}if(M.endsWithParent)return kt(M.parent,R,W)}function Ft(M){return H.matcher.regexIndex===0?(ie+=M[0],1):(et=!0,0)}function Wt(M){const R=M[0],W=M.rule,q=new mn(W),fe=[W.__beforeBegin,W["on:begin"]];for(const _e of fe)if(_e&&(_e(M,q),q.isMatchIgnored))return Ft(R);return W.skip?ie+=R:(W.excludeBegin&&(ie+=R),ge(),!W.returnBegin&&!W.excludeBegin&&(ie=R)),xt(W,M),W.returnBegin?0:R.length}function Kt(M){const R=M[0],W=C.substring(M.index),q=kt(H,M,W);if(!q)return Tn;const fe=H;H.endScope&&H.endScope._wrap?(ge(),xe(R,H.endScope._wrap)):H.endScope&&H.endScope._multi?(ge(),$e(H.endScope,M)):fe.skip?ie+=R:(fe.returnEnd||fe.excludeEnd||(ie+=R),ge(),fe.excludeEnd&&(ie=R));do H.scope&&de.closeNode(),!H.skip&&!H.subLanguage&&(Ve+=H.relevance),H=H.parent;while(H!==q.parent);return q.starts&&xt(q.starts,M),fe.returnEnd?0:R.length}function Gt(){const M=[];for(let R=H;R!==ke;R=R.parent)R.scope&&M.unshift(R.scope);M.forEach(R=>de.openNode(R))}let Ge={};function Nt(M,R){const W=R&&R[0];if(ie+=M,W==null)return ge(),0;if(Ge.type==="begin"&&R.type==="end"&&Ge.index===R.index&&W===""){if(ie+=C.slice(R.index,R.index+1),!l){const q=new Error(`0 width match regex (${p})`);throw q.languageName=p,q.badRule=Ge.rule,q}return 1}if(Ge=R,R.type==="begin")return Wt(R);if(R.type==="illegal"&&!_){const q=new Error('Illegal lexeme "'+W+'" for mode "'+(H.scope||"<unnamed>")+'"');throw q.mode=H,q}else if(R.type==="end"){const q=Kt(R);if(q!==Tn)return q}if(R.type==="illegal"&&W==="")return ie+=`
|
|
15
|
+
`,1;if(Qe>1e5&&Qe>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ie+=W,W.length}const ke=te(p);if(!ke)throw De(u.replace("{}",p)),new Error('Unknown language: "'+p+'"');const wt=Zo(ke);let Je="",H=T||wt;const _t={},de=new c.__emitter(c);Gt();let ie="",Ve=0,he=0,Qe=0,et=!1;try{if(ke.__emitTokens)ke.__emitTokens(C,de);else{for(H.matcher.considerAll();;){Qe++,et?et=!1:H.matcher.considerAll(),H.matcher.lastIndex=he;const M=H.matcher.exec(C);if(!M)break;const R=C.substring(he,M.index),W=Nt(R,M);he=M.index+W}Nt(C.substring(he))}return de.finalize(),Je=de.toHTML(),{language:p,value:Je,relevance:Ve,illegal:!1,_emitter:de,_top:H}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:p,value:Vt(C),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:he,context:C.slice(he-100,he+100),mode:M.mode,resultSoFar:Je},_emitter:de};if(l)return{language:p,value:Vt(C),illegal:!1,relevance:0,errorRaised:M,_emitter:de,_top:H};throw M}}function N(p){const C={value:Vt(p),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return C._emitter.addText(p),C}function b(p,C){C=C||c.languages||Object.keys(a);const _=N(p),T=C.filter(te).filter(K).map(ge=>E(ge,p,!1));T.unshift(_);const G=T.sort((ge,xe)=>{if(ge.relevance!==xe.relevance)return xe.relevance-ge.relevance;if(ge.language&&xe.language){if(te(ge.language).supersetOf===xe.language)return 1;if(te(xe.language).supersetOf===ge.language)return-1}return 0}),[re,ue]=G,Ee=re;return Ee.secondBest=ue,Ee}function g(p,C,_){const T=C&&n[C]||_;p.classList.add("hljs"),p.classList.add(`language-${T}`)}function V(p){let C=null;const _=m(p);if(d(_))return;if($("before:highlightElement",{el:p,language:_}),p.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",p);return}if(p.children.length>0&&(c.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(p)),c.throwUnescapedHTML))throw new jo("One of your code blocks includes unescaped HTML.",p.innerHTML);C=p;const T=C.textContent,G=_?x(T,{language:_,ignoreIllegals:!0}):b(T);p.innerHTML=G.value,p.dataset.highlighted="yes",g(p,_,G.language),p.result={language:G.language,re:G.relevance,relevance:G.relevance},G.secondBest&&(p.secondBest={language:G.secondBest.language,relevance:G.secondBest.relevance}),$("after:highlightElement",{el:p,result:G,text:T})}function D(p){c=vn(c,p)}const y=()=>{P(),He("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){P(),He("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function P(){function p(){P()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",p,!1),O=!0;return}document.querySelectorAll(c.cssSelector).forEach(V)}function z(p,C){let _=null;try{_=C(t)}catch(T){if(De("Language definition for '{}' could not be registered.".replace("{}",p)),l)De(T);else throw T;_=s}_.name||(_.name=p),a[p]=_,_.rawDefinition=C.bind(null,t),_.aliases&&le(_.aliases,{languageName:p})}function I(p){delete a[p];for(const C of Object.keys(n))n[C]===p&&delete n[C]}function Q(){return Object.keys(a)}function te(p){return p=(p||"").toLowerCase(),a[p]||a[n[p]]}function le(p,{languageName:C}){typeof p=="string"&&(p=[p]),p.forEach(_=>{n[_.toLowerCase()]=C})}function K(p){const C=te(p);return C&&!C.disableAutodetect}function J(p){p["before:highlightBlock"]&&!p["before:highlightElement"]&&(p["before:highlightElement"]=C=>{p["before:highlightBlock"](Object.assign({block:C.el},C))}),p["after:highlightBlock"]&&!p["after:highlightElement"]&&(p["after:highlightElement"]=C=>{p["after:highlightBlock"](Object.assign({block:C.el},C))})}function ae(p){J(p),r.push(p)}function B(p){const C=r.indexOf(p);C!==-1&&r.splice(C,1)}function $(p,C){const _=p;r.forEach(function(T){T[_]&&T[_](C)})}function v(p){return He("10.7.0","highlightBlock will be removed entirely in v12.0"),He("10.7.0","Please use highlightElement now."),V(p)}Object.assign(t,{highlight:x,highlightAuto:b,highlightAll:P,highlightElement:V,highlightBlock:v,configure:D,initHighlighting:y,initHighlightingOnLoad:L,registerLanguage:z,unregisterLanguage:I,listLanguages:Q,getLanguage:te,registerAliases:le,autoDetection:K,inherit:vn,addPlugin:ae,removePlugin:B}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString=qo,t.regex={concat:Le,lookahead:bn,either:Dt,optional:mo,anyNumberOfTimes:fo};for(const p in pt)typeof pt[p]=="object"&&fn(pt[p]);return Object.assign(t,pt),t},Fe=An({});Fe.newInstance=()=>An({});var Qo=Fe;Fe.HighlightJS=Fe,Fe.default=Fe;const Pt=ao(Qo);function Ut(t){const a=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},u=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,l]};l.contains.push(c);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},x={match:/\\'/},E={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},V=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],D=["true","false"],y={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],P=["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"],z=["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"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:V,literal:D,built_in:[...L,...O,"set","shopt",...P,...z]},contains:[b,t.SHEBANG(),g,E,u,s,y,c,d,m,x,n]}}const er=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),tr=["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"],nr=["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"],ir=[...tr,...nr],or=["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"].sort().reverse(),rr=["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"].sort().reverse(),ar=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),lr=["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"].sort().reverse();function sr(t){const a=t.regex,n=er(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",u=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.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:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rr.join("|")+")"},{begin:":(:)?("+ar.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:or.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ir.join("|")+")\\b"}]}}function Rn(t){const u={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:u,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.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:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}var We="[0-9](_*[0-9])*",bt=`\\.(${We})`,yt="[0-9a-fA-F](_*[0-9a-fA-F])*",Bn={className:"number",variants:[{begin:`(\\b(${We})((${bt})|\\.)?|(${bt}))[eE][+-]?(${We})[fFdD]?\\b`},{begin:`\\b(${We})((${bt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${bt})[fFdD]?\\b`},{begin:`\\b(${We})[fFdD]\\b`},{begin:`\\b0[xX]((${yt})\\.?|(${yt})?\\.(${yt}))[pP][+-]?(${We})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function On(t,a,n){return n===-1?"":t.replace(a,r=>On(t,a,n-1))}function cr(t){const a=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+On("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={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"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.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:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Bn,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Bn,m]}}const In="[A-Za-z$_][0-9A-Za-z$_]*",dr=["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"],ur=["true","false","null","undefined","NaN","Infinity"],Ln=["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"],Dn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mr=[].concat(zn,Ln,Dn);function $n(t){const a=t.regex,n=(_,{after:T})=>{const G="</"+_[0].slice(1);return _.input.indexOf(G,T)!==-1},r=In,l={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,T)=>{const G=_[0].length+_.index,re=_.input[G];if(re==="<"||re===","){T.ignoreMatch();return}re===">"&&(n(_,{after:G})||T.ignoreMatch());let ue;const Ee=_.input.substring(G);if(ue=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ue=Ee.match(/^\s+extends\s+/))&&ue.index===0){T.ignoreMatch();return}}},c={$pattern:In,keyword:dr,literal:ur,built_in:mr,"variable.language":fr},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${m})\\b|\\.)?|(${m})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},L={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,{match:/\$\d+/},E];N.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const P=[].concat(L,N.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},Q={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.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:{_:[...Ln,...Dn]}},le={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(_){return a.concat("(?!",_.join("|"),")")}const B={match:a.concat(/\b/,ae([...zn,"super","import"].map(_=>`${_}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},p="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(p)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,L,{match:/\$\d+/},E,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:p,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:u},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},B,J,Q,v,{match:/\$[(.]/}]}}function gr(t){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Vn(t){const a=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={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}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),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}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},E=t.inherit(m,{contains:[]}),N=t.inherit(x,{contains:[]});m.contains.push(N),x.contains.push(E);let b=[n,d];return[m,x,E,N].forEach(y=>{y.contains=y.contains.concat(b)}),b=b.concat(m,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,u,m,x,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},l,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Pn(t){const a=t.regex,n=new 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"],c={$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"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},x={begin:/\{\{/,relevance:0},E={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,x,m]},{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:[t.BACKSLASH_ESCAPE,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,x,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",b=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,g=`\\b|${r.join("|")}`,V={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${b}))[eE][+-]?(${N})[jJ]?(?=${g})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${N})[jJ](?=${g})`}]},D={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,V,E,t.HASH_COMMENT_MODE]}]};return m.contains=[E,V,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,V,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},E,D,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[V,y,E]}]}}function Un(t){const a=t.regex,n=/(r#)?/,r=a.concat(n,t.UNDERSCORE_IDENT_RE),l=a.concat(n,t.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",c=["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"],d=["true","false","Some","None","Ok","Err"],m=["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!"],x=["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:t.IDENT_RE+"!?",type:x,keyword:c,literal:d,built_in:m},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.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:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:x}},{className:"punctuation",begin:"->"},u]}}function pr(t){const a=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["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"],d=["add","asc","collation","desc","final","first","last","view"],m=["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"],x=["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"],E=["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"],N=["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"],b=x,g=[...m,...d].filter(z=>!x.includes(z)),V={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},D={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:a.concat(/\b/,a.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function L(z){return a.concat(/\b/,a.either(...z.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:L(N),relevance:0};function P(z,{exceptions:I,when:Q}={}){const te=Q;return I=I||[],z.map(le=>le.match(/\|\d+$/)||I.includes(le)?le:te(le)?`${le}|0`:le)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:P(g,{when:z=>z.length<3}),literal:u,type:c,built_in:E},contains:[{scope:"type",match:L(s)},O,y,V,r,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,D]}}const Et="[A-Za-z$_][0-9A-Za-z$_]*",Hn=["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"],Fn=["true","false","null","undefined","NaN","Infinity"],Wn=["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"],Kn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Yn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Zn=[].concat(Gn,Wn,Kn);function hr(t){const a=t.regex,n=(_,{after:T})=>{const G="</"+_[0].slice(1);return _.input.indexOf(G,T)!==-1},r=Et,l={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,T)=>{const G=_[0].length+_.index,re=_.input[G];if(re==="<"||re===","){T.ignoreMatch();return}re===">"&&(n(_,{after:G})||T.ignoreMatch());let ue;const Ee=_.input.substring(G);if(ue=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ue=Ee.match(/^\s+extends\s+/))&&ue.index===0){T.ignoreMatch();return}}},c={$pattern:Et,keyword:Hn,literal:Fn,built_in:Zn,"variable.language":Yn},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${m})\\b|\\.)?|(${m})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},L={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,{match:/\$\d+/},E];N.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const P=[].concat(L,N.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},Q={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.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:{_:[...Wn,...Kn]}},le={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(_){return a.concat("(?!",_.join("|"),")")}const B={match:a.concat(/\b/,ae([...Gn,"super","import"].map(_=>`${_}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},p="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(p)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,L,{match:/\$\d+/},E,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:p,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:u},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},B,J,Q,v,{match:/\$[(.]/}]}}function Xn(t){const a=t.regex,n=hr(t),r=Et,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Et,keyword:Hn.concat(d),literal:Fn,built_in:Zn.concat(l),"variable.language":Yn},x={className:"meta",begin:"@"+r},E=(V,D,y)=>{const L=V.contains.findIndex(O=>O.label===D);if(L===-1)throw new Error("can not find mode to replace");V.contains.splice(L,1,y)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(x);const N=n.contains.find(V=>V.scope==="attr"),b=Object.assign({},N,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,b]),n.contains=n.contains.concat([x,u,s,b]),E(n,"shebang",t.SHEBANG()),E(n,"use_strict",c);const g=n.contains.find(V=>V.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function qn(t){const a=t.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(u,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={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:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[u,d,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,s,d,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function jn(t){const a="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},c=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={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"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},g={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},V={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},D=[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:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,V,u,s],y=[...D];return y.pop(),y.push(c),b.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:D}}const Ht={bash:Ut,sh:Ut,shell:Ut,css:sr,go:Rn,golang:Rn,java:cr,javascript:$n,js:$n,json:gr,markdown:Vn,md:Vn,python:Pn,py:Pn,rust:Un,rs:Un,sql:pr,typescript:Xn,ts:Xn,xml:qn,html:qn,yaml:jn,yml:jn};for(const[t,a]of Object.entries(Ht))Pt.registerLanguage(t,a);function Jn(t){const a=t.split(`
|
|
16
16
|
`);return/^(`{3,}|~{3,})/.test(a[0]??"")&&a.shift(),/^(`{3,}|~{3,})\s*$/.test(a[a.length-1]??"")&&a.pop(),a.join(`
|
|
17
|
-
`).replace(/\n+$/,"")}function
|
|
18
|
-
`)[0]??""),n=((a==null?void 0:a[2])??"").toLowerCase();return n&&
|
|
19
|
-
`).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function
|
|
20
|
-
`:"```\n",
|
|
17
|
+
`).replace(/\n+$/,"")}function Qn(t){const a=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
|
|
18
|
+
`)[0]??""),n=((a==null?void 0:a[2])??"").toLowerCase();return n&&Ht[n]?n:""}function br(t,a){const n=a&&Ht[a]?a:"";try{return n?Pt.highlight(t,{language:n,ignoreIllegals:!0}).value:Pt.highlightAuto(t).value}catch{return Er(t)}}function yr(t){return t.split(`
|
|
19
|
+
`).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function Er(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function xr(t,a,n){if(t.length<=1)return t.slice();const[r,...l]=t,u=l.map(m=>m[a]??""),s=u.length>0&&u.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),c=n==="asc"?1:-1,d=l.slice().sort((m,x)=>{const E=m[a]??"",N=x[a]??"";return s?(Number(E)-Number(N))*c:E.localeCompare(N,"zh-Hans-CN",{numeric:!0})*c});return[r,...d]}const kr=["viewBox","width","height"],Nr={class:"zm-edges"},wr=["d","fill"],_r=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Sr=["src","width","height","alt"],Mr=["onDblclick"],Cr={key:0,class:"zm-rich-code"},vr=["innerHTML"],Tr={key:1,class:"zm-rich-table"},Ar=["onClick"],Rr={class:"zm-rich-sort-mark","aria-hidden":"true"},Br={key:2,class:"zm-text"},Or={class:"zm-text-label"},Ir=["href","title"],Lr=["title","onClick"],Dr=["title"],zr=["title","onClick"],$r=["onClick"],Vr=["onMousedown"],Pr=["onClick"],Ur=["title"],Hr={class:"zm-tb-tip zm-tb-zoom"},Fr=["src"],Wr=["src"],ze=24,Ke=400,Oe=160,ei=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange"],setup(t,{expose:a,emit:n}){const r=t,l=n,u=e.ref(null),s=e.ref(null),c=e.ref(""),d=e.ref(null),m=e.ref(new Set),x=e.ref(!1),E=e.ref(null),N=e.ref(""),b=e.ref(new Map),g=e.ref(Te(r.data)),V=e.ref({}),D=e.ref({}),y=e.ref(r.markdown!==void 0);let L=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){y.value=!1;return}y.value=!0;const o=It(i||"");L=!0,g.value=Te(o),d.value=null,m.value=new Set,oe(),e.nextTick(()=>{L=!1,Ae()})}),e.watch(g,()=>{y.value&&!L&&l("markdownChange",mt(g.value))},{deep:!0});const O=e.computed(()=>U.showOrderBadge===!0),P=e.ref(new Map),z=P.value;function I(i,o){const f={};o.bg&&(f.bg=o.bg),o.textColor&&(f.textColor=o.textColor),o.borderColor&&(f.borderColor=o.borderColor),o.fontWeight&&(f.fontWeight=o.fontWeight),Object.keys(f).length===0?z.delete(i):z.set(i,f),P.value=new Map(z)}function Q(i){return z.get(i)??{}}function te(i,o){const f=Z(g.value,i);f&&(f.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:J(o.width,ze,Ke),height:J(o.height,ze,Ke)},me(),oe(),l("change",g.value))}function le(i){const o=Z(g.value,i);!o||!o.image||(delete o.image,me(),oe(),l("change",g.value))}function K(i,o){const f=o.trim();if(!Z(g.value,i))return;if(!f){le(i);return}const k=new Image;k.onload=()=>{const S=Z(g.value,i);if(!S)return;const A=k.naturalWidth&&k.naturalHeight?k.naturalWidth/k.naturalHeight:1,F=J(k.naturalWidth||Oe,ze,Ke),ne=Math.round(F/A);S.image={src:f,naturalW:k.naturalWidth||F,naturalH:k.naturalHeight||ne,width:F,height:ne},me(),oe(),l("change",g.value)},k.onerror=()=>{},k.src=f}function J(i,o,f){return Math.min(f,Math.max(o,i))}function ae(i,o){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const w=f.result,k=new window.Image;k.onload=()=>{const S=k.naturalWidth||Oe,A=k.naturalHeight||Oe,F=J(S,ze,Oe),ne=J(Math.round(A*F/S),ze,Ke);o({src:w,naturalW:S,naturalH:A,width:F,height:ne})},k.onerror=()=>{o({src:w,naturalW:Oe,naturalH:Oe,width:Oe,height:Oe})},k.src=w},f.readAsDataURL(i)}function B(i){const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.display="none",o.onchange=()=>{var w;const f=(w=o.files)==null?void 0:w[0];f&&(ae(f,k=>te(i,k)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function $(i,o){const f=o.trim(),w=Z(g.value,i);w&&(f?w.link={url:f}:delete w.link,me(),oe(),l("change",g.value))}function v(i){$(i,"")}function p(i,o){const f=Z(g.value,i);f&&(o?f.note={text:o}:delete f.note,me(),oe(),l("change",g.value))}function C(i){p(i,"")}function _(i,o){const f=Z(g.value,i);f&&(o?f.richContent=o:delete f.richContent,me(),oe(),l("change",g.value))}const T=e.ref(null),G=e.ref(null),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),ue=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function Ee(i,o){r.previewMode||(i.preventDefault(),i.stopPropagation(),G.value=null,d.value=o.id,l("select",Z(g.value,o.id)),T.value={nodeId:o.id,x:i.clientX,y:i.clientY})}function ge(){T.value=null}function xe(i){const o=i.target;o!=null&&o.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(i.preventDefault(),T.value&&(T.value=null),G.value={x:i.clientX,y:i.clientY})}function $e(){G.value=null}function xt(){$e(),l("canvas-settings")}function kt(){$e(),l("canvas-data")}function Ft(i){$e(),l("canvas-import",i)}function Wt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&B(i)}function Kt(){var w,k,S;const i=(w=T.value)==null?void 0:w.nodeId;if(!i)return;const o=((S=(k=Z(g.value,i))==null?void 0:k.link)==null?void 0:S.url)??"",f=window.prompt("输入链接 URL(留空取消)",o);f!==null&&$(i,f)}function Gt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&v(i)}function Ge(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&de(i)}function Nt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&C(i)}function ke(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&le(i)}function wt(){var X,Ne;const i=(X=T.value)==null?void 0:X.nodeId;if(!i)return;const o=(Ne=Z(g.value,i))==null?void 0:Ne.richContent,f=(o==null?void 0:o.kind)==="code"?Jn(o.raw):"",w=(o==null?void 0:o.kind)==="code"&&o.lang||"",k=w?"```"+w+`
|
|
20
|
+
`:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?k+f+(f.endsWith("```")?"":"\n```"):k+"// 你的代码"+"\n```");if(A===null)return;const F=A.trim();if(!F){_(i,null);return}const ne=/^```([^\s`]*)/.exec(F),h=ne?ne[1]:void 0;_(i,{kind:"code",raw:F,lang:h})}function Je(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&_(i,null)}function H(){var A,F;const i=(A=T.value)==null?void 0:A.nodeId;if(!i)return;const o=(F=Z(g.value,i))==null?void 0:F.richContent,f=(o==null?void 0:o.kind)==="table"?o.raw:"",k=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
|
|
21
21
|
| --- | --- | --- |
|
|
22
|
-
| a | b | c |`);if(E===null)return;const _=E.trim();if(!_){M(i,null);return}M(i,{kind:"table",raw:_})}function et(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&M(i,null)}function P(i){r.previewMode||l("edit-note",i)}function Nt(i,o=60){const u=i.replace(/\s+/g," ").trim();return u.length<=o?u||"点击编辑笔记":u.slice(0,o)+"…"}function le(i){var E;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const u=c.value;if(!u)return;const w=(E=i.clipboardData)==null?void 0:E.items;if(w)for(let _=0;_<w.length;_++){const T=w[_];if(T.kind==="file"&&T.type.startsWith("image/")){const V=T.getAsFile();if(!V)continue;i.preventDefault();const j=W(m.value,u);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;re(V,p=>ee(u,p));return}}}t.onMounted(()=>{window.addEventListener("paste",le),te()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const Y=t.ref(null),Ge=t.computed(()=>{var i;return((i=Y.value)==null?void 0:i.nodeId)??null});function Ae(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const u=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,E=w>0?w/u:1;Y.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:u,naturalH:w,ratio:E,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",Ye)}function Ke(i){var j,p;const o=Y.value;if(!o)return;const u=F.scale.value||1,w=i.clientX-o.startX,E=Q(o.startW+w/u,ze,Fe),_=Q(E*o.ratio,ze,Fe);o.pendingW=E,o.pendingH=_;const T=(j=f.value)==null?void 0:j.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);T&&(T.style.width=`${E}px`,T.style.height=`${_}px`);const V=(p=f.value)==null?void 0:p.querySelector(`[data-node-id="${o.nodeId}"]`);V&&(V.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,V.style.height=`${Math.ceil(_+8+30)}px`)}function Ye(){const i=Y.value;if(window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",Ye),Y.value=null,!i)return;const o=W(m.value,i.nodeId);!o||!o.image||(ee(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),c.value=i.nodeId,l("select",o),A=!0)}const S=t.ref(null);let A=!1;function U(i){S.value=i}function Z(i){S.value===i&&(S.value=null)}const se=t.ref(0),he=t.ref(!1),Me=to(100);function ce(){Me.record({data:m.value})}function te(){g.value=new Set(g.value),se.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Fr()).then(()=>{se.value++})}function Fr(){const i=document.querySelectorAll(".zm-rich"),o={},u={};i.forEach(w=>{let E=w,_=null;for(;E&&!_;)_=E.getAttribute("data-node-id"),E=E.parentElement;if(!_)return;const T=w.offsetHeight,V=w.scrollWidth,j=Math.round(T*2)/2,p=Math.round(V*2)/2;o[_]=j,u[_]=p,L.value[_],B.value[_]}),L.value=o,B.value=u}const _e=t.computed(()=>{var i,o,u,w,E,_,T,V,j,p;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((u=r.theme)==null?void 0:u.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((E=r.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((_=r.theme)==null?void 0:_.bgColor)??"#f8fafc",fontSize:((T=r.theme)==null?void 0:T.fontSize)??14,lineWidthStart:((V=r.theme)==null?void 0:V.lineWidthStart)??2.2,lineWidthEnd:((j=r.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((p=r.theme)==null?void 0:p.rainbowBranch)??!1}}),D=t.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function jn(i){return D.taperedEdge?Wr(i):Qn(i)}function Jn(i){return D.taperedEdge?D.lineWidthEnd:Qn(i)}function Wr(i){return i<=0?D.lineWidthStart:i===1?Math.max(1.5,D.lineWidthStart*.67):i===2?Math.max(.8,D.lineWidthStart*.42):D.lineWidthEnd}function Qn(i){if(i<=0)return D.lineWidthStart;if(i>=3)return D.lineWidthEnd;const o=i/3;return D.lineWidthStart+(D.lineWidthEnd-D.lineWidthStart)*o}function Gr(i,o,u,w){const E=1-i,_=E*E*E*o.x+3*E*E*i*u.x1+3*E*i*i*u.x2+i*i*i*w.x,T=E*E*E*o.y+3*E*E*i*u.y1+3*E*i*i*u.y2+i*i*i*w.y;return{x:_,y:T}}function Kr(i,o,u,w,E=32,_="curve",T="right"){if(_==="curve"){let ve;if(T==="right"||T==="left"){const oe=Math.abs(o.x-i.x)*.45,Oe=T==="right"?1:-1;ve={x1:i.x+Oe*oe,y1:i.y,x2:o.x-Oe*oe,y2:o.y}}else{const oe=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+oe,x2:o.x,y2:o.y-oe}}const hi=X=>{const oe=1-X,Oe=-3*oe*oe*i.x+3*(oe*oe-2*oe*X)*ve.x1+3*(2*oe*X-X*X)*ve.x2+3*X*X*o.x,Xe=-3*oe*oe*i.y+3*(oe*oe-2*oe*X)*ve.y1+3*(2*oe*X-X*X)*ve.y2+3*X*X*o.y;return{dx:Oe,dy:Xe}},at=[],qt=[];for(let X=0;X<=E;X++){const oe=X/E,Oe=X===0?i:X===E?o:Gr(oe,i,ve,o),Xe=hi(oe);let Ct=Math.hypot(Xe.dx,Xe.dy);Ct<1e-6&&(Ct=1);const bi=-Xe.dy/Ct,yi=Xe.dx/Ct,vt=(u+(w-u)*oe)/2;at.push({x:Oe.x+bi*vt,y:Oe.y+yi*vt}),qt.push({x:Oe.x-bi*vt,y:Oe.y-yi*vt})}let Mt=`M ${at[0].x.toFixed(2)} ${at[0].y.toFixed(2)}`;for(let X=1;X<=E;X++)Mt+=` L ${at[X].x.toFixed(2)} ${at[X].y.toFixed(2)}`;for(let X=E;X>=0;X--)Mt+=` L ${qt[X].x.toFixed(2)} ${qt[X].y.toFixed(2)}`;return Mt+=" Z",Mt}const V=o.x-i.x,j=o.y-i.y;let p=Math.hypot(V,j);p<1e-6&&(p=1);const K=-j/p,Ne=V/p,Ce=u/2,pe=w/2,nt={x:i.x+K*Ce,y:i.y+Ne*Ce},it={x:i.x-K*Ce,y:i.y-Ne*Ce},ot={x:o.x-K*pe,y:o.y-Ne*pe},rt={x:o.x+K*pe,y:o.y+Ne*pe};return`M ${nt.x.toFixed(2)} ${nt.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} L ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${it.x.toFixed(2)} ${it.y.toFixed(2)} Z`}const wt=t.computed(()=>be.value.root.children),Yr=qe[0].colors,ei=t.computed(()=>Wi(D.branchPaletteId,D.customPalettes)),$e=t.computed(()=>{const i=new Map;if(!D.rainbowBranch)return i;const o=r.lineColors,u=o&&o.length>0?o:ei.value.colors.length>0?ei.value.colors:Yr;for(let E=0;E<wt.value.length;E++){const _=wt.value[E];i.set(_.id,u[E%u.length])}const w=(E,_)=>{i.set(E.id,_);for(const T of E.children)w(T,_)};for(let E=0;E<wt.value.length;E++){const _=wt.value[E];w(_,u[E%u.length])}return i});function Zr(i,o){return D.rainbowBranch?$e.value.get(o.id)??_e.value.lineColor:_e.value.lineColor}function Xr(i){const o=J(i.id);if(o.bg)return o.bg;if(i.isRoot)return _e.value.rootBg;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return Qr(u,.18)}return _e.value.branchBg}function qr(i){const o=J(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return _e.value.rootText;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.55)}return _e.value.branchText}function jr(i){const o=J(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return _e.value.rootBg;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.3)}return _e.value.lineColor}function Jr(i){return J(i.id).fontWeight??(i.isRoot?600:400)}function Qr(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map(V=>V+V).join(""),E=parseInt(w.slice(0,2),16),_=parseInt(w.slice(2,4),16),T=parseInt(w.slice(4,6),16);return`rgba(${E}, ${_}, ${T}, ${o})`}function ti(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map(V=>V+V).join(""),E=Math.round(parseInt(w.slice(0,2),16)*(1-o)),_=Math.round(parseInt(w.slice(2,4),16)*(1-o)),T=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${E}, ${_}, ${T})`}const F=Ji({getContainer:()=>f.value});F.setOnMarqueeEnd(ya),eo({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>c.value,getRootId:()=>m.value.id,defaultTargetId:()=>m.value.id,onAddChild:Ze,onAddSibling:St,onAddSiblingBefore:ri,onRemove:li,onStartEdit:tt,onClearSelection:()=>{c.value=null,l("select",null)},onDuplicate:ai,onUndo:Kt,onRedo:Yt,onNavigate:da,onSelectRoot:()=>{c.value=m.value.id;const i=W(m.value,m.value.id);i&&l("select",i)}});const be=t.computed(()=>{const i=Te(m.value);return ii(i),Vi(i,{mode:D.layoutMode,baseFontSize:_e.value.fontSize,richHeights:L.value,richWidths:B.value})}),ni=t.ref([]),Gt=t.computed(()=>(se.value,ni.value));t.watch(be,i=>{const o=[],u=w=>{o.push(w);for(const E of w.children)u(E)};u(i.root),ni.value=o},{immediate:!0});const ea=t.computed(()=>{const i=[];for(const o of Gt.value)for(const u of o.children)i.push({from:o,to:u,key:`${o.id}->${u.id}`});return i}),ta=t.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function ii(i){if(g.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)ii(o)}function tt(i){const o=W(m.value,i);o&&(s.value=i,d.value=o.text,t.nextTick(()=>{const u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select()}))}function _t(i={}){if(!s.value)return;const o=W(m.value,s.value);o&&o.text!==(d.value.trim()||" ")&&(o.text=d.value.trim()||" ",ce(),l("change",m.value));const u=s.value;s.value=null,i.addChild?t.nextTick(()=>Ze(u)):i.addSibling==="after"?t.nextTick(()=>St(u)):i.addSibling==="before"&&t.nextTick(()=>ri(u))}function na(){s.value=null}function ia(i){if(r.previewMode)return;const o=W(m.value,i);o!=null&&o.richContent&&(y.value=i,N.value=o.richContent.raw,t.nextTick(()=>{const u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function oi(){if(!y.value)return;const i=y.value,o=W(m.value,i),u=N.value;if(o&&o.richContent&&o.richContent.raw!==u)if(o.richContent.kind==="code"){const w=Xn(u)||void 0;M(i,{kind:"code",raw:u,lang:w})}else M(i,{kind:"table",raw:u});y.value=null}function oa(){y.value=null}function ra(i){i.key==="Escape"?(i.preventDefault(),oa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),oi())}function aa(i,o){const u=h.value.get(i);!u||u.col!==o?h.value.set(i,{col:o,dir:"asc"}):u.dir==="asc"?h.value.set(i,{col:o,dir:"desc"}):h.value.delete(i)}function la(i,o){const u=h.value.get(i);return!u||o.length<=1?o:yr(o,u.col,u.dir)}function sa(i,o){const u=h.value.get(i);return!u||u.col!==o?"↕":u.dir==="asc"?"▲":"▼"}function ca(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Kt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Yt())}function Ze(i){const o=on(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function St(i){if(i===m.value.id){Ze(i);return}const o=rn(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ri(i){if(i===m.value.id){Ze(i);return}const o=Yi(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ai(i){if(i===m.value.id)return;const o=Zi(m.value,i);o&&(ce(),c.value=o.id,l("change",m.value),te())}function Kt(){const i=Me.undo();i&&(m.value=i.data,c.value=null,l("select",null),te(),l("change",m.value))}function Yt(){const i=Me.redo();i&&(m.value=i.data,c.value=null,l("select",null),te(),l("change",m.value))}function da(i,o){const u=c.value??m.value.id,w=W(m.value,u);if(!w)return;let E=null;if(o===1){const _=we(m.value,w.id);if(_){const T=_.children.findIndex(V=>V.id===w.id);T>=0&&T<_.children.length-1&&(E=_.children[T+1].id)}}else if(o===-1){const _=we(m.value,w.id);if(_){const T=_.children.findIndex(V=>V.id===w.id);T>0&&(E=_.children[T-1].id)}}else if(i===1){const _=we(m.value,w.id);_&&(E=_.id)}else i===-1&&w.children.length>0&&(E=w.children[0].id);if(E){c.value=E;const _=W(m.value,E);_&&l("select",_)}}function li(i){i!==m.value.id&&Rt(m.value,i)&&(ce(),c.value===i&&(c.value=null),te(),l("change",m.value))}function si(i){g.value.has(i)?g.value.delete(i):g.value.add(i),te()}function ci(i){const o=[{n:m.value,depth:1}];for(;o.length;){const{n:u,depth:w}=o.pop();i(u,w);for(let E=u.children.length-1;E>=0;E--)o.push({n:u.children[E],depth:w+1})}}function ua(){g.value=new Set,ci(i=>{i.children.length>0&&g.value.add(i.id)}),te()}function di(i){g.value=new Set,ci((o,u)=>{u>i&&o.children.length>0&&g.value.add(o.id)}),te()}function fa(){g.value=new Set,te()}function ga(i,o){Gi(m.value,i,o)&&(ce(),te(),l("change",m.value))}function ma(i,o,u){return Ki(m.value,i,o,u)?(ce(),te(),l("change",m.value),!0):!1}function pa(i,o){i.stopPropagation(),c.value=o.id;const u=W(m.value,o.id);l("select",u)}function ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){F.startPan(i);return}if(i.button!==0)return;const u=f.value.getBoundingClientRect(),w=(i.clientX-u.left-F.offsetX.value)/F.scale.value,E=(i.clientY-u.top-F.offsetY.value)/F.scale.value;F.startMarquee(w,E)}function ba(i){if(A){A=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const u=F.marquee;u.width>=4||u.height>=4||c.value!==null&&(c.value=null,l("select",null))}function ya(){const i=F.marquee;if(i.width<4&&i.height<4)return;const o=i.x,u=i.y,w=i.x+i.width,E=i.y+i.height,_=[];for(const T of Gt.value){const V=T.width/2,j=T.height/2,p=T.x-V,K=T.x+V,Ne=T.y-j,Ce=T.y+j;p<=w&&K>=o&&Ne<=E&&Ce>=u&&_.push(T.id)}if(_.length>0){c.value=_[0];const T=W(m.value,_[0]);T&&l("select",T)}}function ui(i){return g.value.has(i)}function Ea(i){const o=W(m.value,i.id);return!!o&&o.children.length>0}function Zt(i){const o=W(m.value,i);return o?o.children.length:0}function fi(i){if(!W(m.value,i))return 0;const w=[m.value];for(;w.length;){const E=w.pop(),_=E.children.findIndex(T=>T.id===i);if(_>=0)return _;for(const T of E.children)w.push(T)}return 0}function gi(i,o,u,w){if(((w==null?void 0:w._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let _;o==="in"?_=-i.side:u!==void 0?_=u:_=i.side;const T=o==="in"?i._richInsetX??0:0;return{x:i.x+_*(i.width/2-T),y:i.y}}function Re(){const i=be.value;F.resetView(i.width,i.height,i.root.y)}function xa(){he.value=!0,ce(),te(),t.nextTick(()=>Re())}function Xt(i){D.layoutMode!==i&&(D.layoutMode=i,te(),t.nextTick(()=>Re()))}function mi(){return JSON.stringify(m.value,null,2)}function pi(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Me.reset(),m.value=Te(o),c.value=null,g.value=new Set,te(),t.nextTick(()=>Re()),l("change",m.value),!0)}catch{return!1}}function ka(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var w;const o=(w=i.files)==null?void 0:w[0];if(!o)return;const u=new FileReader;u.onload=()=>{typeof u.result=="string"&&(pi(u.result)||alert("导入失败:JSON 格式无效"))},u.readAsText(o)},i.click()}function Na(){const i=new Blob([mi()],{type:"application/json"}),o=URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=`${m.value.text||"mindmap"}.json`,u.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ze(i),addSibling:i=>St(i),removeNode:i=>li(i),duplicateNode:i=>ai(i),setNodeText:(i,o)=>ga(i,o),moveNode:(i,o,u)=>ma(i,o,u),lineWidthForDepth:jn,endWidthForDepth:Jn,getData:()=>m.value,setData:i=>{Me.reset(),m.value=Te(i),c.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>Re())},resetView:()=>Re(),exportData:mi,importData:pi,getMarkdown:()=>ut(m.value),setMarkdown:(i,o=!0)=>{const u=Ot(i||"");o&&(b.value=!0),O=!o,Me.reset(),m.value=Te(u),c.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>{O=!1,Re()}),l("change",m.value)},setBalanced:i=>{he.value=i},isBalanced:()=>he.value,balance:()=>xa(),applyNodeStyle:(i,o)=>I(i,o),getNodeStyle:i=>J(i),applyNodeImage:(i,o)=>ee(i,o),applyNodeImageByUrl:(i,o)=>G(i,o),removeNodeImage:i=>ae(i),applyNodeLink:(i,o)=>ie(i,o),removeNodeLink:i=>fe(i),applyNodeNote:(i,o)=>x(i,o),removeNodeNote:i=>C(i),applyNodeRichContent:(i,o)=>M(i,o),undo:()=>Kt(),redo:()=>Yt(),canUndo:()=>Me.canUndo(),canRedo:()=>Me.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(D.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(D.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(D.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(D.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(D.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(D.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(D.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(D.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(D.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:D.autoBalanceOnChange,lineWidthStart:D.lineWidthStart,lineWidthEnd:D.lineWidthEnd,rainbowBranch:D.rainbowBranch,branchPaletteId:D.branchPaletteId,customPalettes:D.customPalettes,lineStyle:D.lineStyle,layoutMode:D.layoutMode,taperedEdge:D.taperedEdge,showOrderBadge:D.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...qe,...D.customPalettes].find(u=>u.id===i)&&(D.branchPaletteId=i)},getBranchPalette:()=>D.branchPaletteId,getBranchPalettes:()=>[...qe,...D.customPalettes]}),t.watch(()=>r.data,i=>{m.value=Te(i),te()},{deep:!1}),t.onMounted(()=>{ce(),t.nextTick(()=>Re())}),(i,o)=>{var u,w,E,_,T,V,j;return t.openBlock(),t.createElementBlock("div",{class:"zm-mindmap",style:t.normalizeStyle({background:_e.value.bgColor,fontSize:_e.value.fontSize+"px"})},[t.createElementVNode("div",{ref_key:"wrapperRef",ref:f,class:"zm-canvas",onMousedown:ha,onContextmenu:Ee,onWheel:o[25]||(o[25]=(...p)=>t.unref(F).onWheel&&t.unref(F).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>k.value=!0),onMouseleave:o[27]||(o[27]=p=>k.value=!1),onClick:ba},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:be.value.vbX*t.unref(F).scale.value+t.unref(F).offsetX.value+"px",top:be.value.vbY*t.unref(F).scale.value+t.unref(F).offsetY.value+"px",width:be.value.vbW*t.unref(F).scale.value+"px",height:be.value.vbH*t.unref(F).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:ta.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*t.unref(F).scale.value,height:be.value.vbH*t.unref(F).scale.value},[t.createElementVNode("g",xr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ea.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Kr(gi(p.from,"out",p.to.side,p.to),gi(p.to,"in"),jn(p.from.depth),Jn(p.to.depth),32,D.lineStyle,p.to._dir),fill:Zr(p.from,p.to),stroke:"none"},null,8,kr))),128))])],8,Er))],4),t.unref(F).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(F).marquee.x*t.unref(F).scale.value+t.unref(F).offsetX.value+"px",top:t.unref(F).marquee.y*t.unref(F).scale.value+t.unref(F).offsetY.value+"px",width:t.unref(F).marquee.width*t.unref(F).scale.value+"px",height:t.unref(F).marquee.height*t.unref(F).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(F).offsetX.value}px, ${t.unref(F).offsetY.value}px) scale(${t.unref(F).scale.value})`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Gt.value,p=>(t.openBlock(),t.createElementBlock("div",{key:p.id,class:t.normalizeClass(["zm-node",{"is-root":p.isRoot,"is-selected":c.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":Ge.value===p.id}]),"data-node-id":p.id,style:t.normalizeStyle({left:p.x+"px",top:p.y+"px",width:p.width+"px",minWidth:p.width+"px",height:p.height+"px",fontSize:p.fontSize+"px",background:Xr(p),color:qr(p),borderColor:jr(p),fontWeight:Jr(p),transform:"translate(-50%, -50%)"}),onClick:K=>pa(K,p),onDblclick:K=>{K.stopPropagation(),e.previewMode||tt(p.id)},onContextmenu:K=>ne(K,p),onMouseenter:K=>U(p.id),onMouseleave:K=>Z(p.id)},[p.image?(t.openBlock(),t.createElementBlock("img",{key:0,class:"zm-node-img",src:p.image.src,width:p.image.width,height:p.image.height,alt:p.text,draggable:"false"},null,8,wr)):t.createCommentVNode("",!0),p.richContent&&(p.richContent.kind==="code"||p.richContent.kind==="table")&&s.value!==p.id?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":p.richContent.kind==="table"||p.richContent.kind==="code"}]),onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"])),onDblclick:t.withModifiers(K=>ia(p.id),["stop"]),onMousedown:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))},[y.value===p.id?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=K=>N.value=K),class:"zm-rich-edit",spellcheck:"false",onBlur:oi,onKeydown:ra},null,544)),[[t.vModelText,N.value]]):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[p.richContent.kind==="code"?(t.openBlock(),t.createElementBlock("pre",Sr,[t.createElementVNode("code",{innerHTML:t.unref(pr)(t.unref(Zn)(p.richContent.raw),t.unref(Xn)(p.richContent.raw))},null,8,Mr)])):p.richContent.kind==="table"?(t.openBlock(),t.createElementBlock("table",Cr,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(la(p.id,t.unref(hr)(p.richContent.raw)),(K,Ne)=>(t.openBlock(),t.createElementBlock("tr",{key:Ne},[Ne===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(K,(Ce,pe)=>{var nt,it,ot,rt,ve;return t.openBlock(),t.createElementBlock("th",{key:`h${pe}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((nt=h.value.get(p.id))==null?void 0:nt.col)===pe,"is-asc":((it=h.value.get(p.id))==null?void 0:it.col)===pe&&((ot=h.value.get(p.id))==null?void 0:ot.dir)==="asc","is-desc":((rt=h.value.get(p.id))==null?void 0:rt.col)===pe&&((ve=h.value.get(p.id))==null?void 0:ve.dir)==="desc"}]),onClick:t.withModifiers(hi=>aa(p.id,pe),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(Ce),1),t.createElementVNode("span",Tr,t.toDisplayString(sa(p.id,pe)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(K,(Ce,pe)=>(t.openBlock(),t.createElementBlock("td",{key:`c${pe}`},t.toDisplayString(Ce),1))),128))]))),128))])])):t.createCommentVNode("",!0)],64))],42,_r)):t.createCommentVNode("",!0),s.value!==p.id?(t.openBlock(),t.createElementBlock("span",Ar,[t.createElementVNode("span",Rr,t.toDisplayString(p.text),1),p.link&&!s.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zm-node-link",href:p.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${p.link.url}`,onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"link",size:11,stroke:2})],40,Or)):t.createCommentVNode("",!0),p.note&&!s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Nt(p.note.text),onClick:t.withModifiers(K=>P(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"note",size:11,stroke:2})],40,Ir)):t.createCommentVNode("",!0)])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=K=>d.value=K),autofocus:"",onBlur:o[7]||(o[7]=K=>_t()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(K=>_t({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(K=>_t({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(K=>_t({addChild:!0}),["prevent"]),["tab"])),t.withKeys(na,["esc"]),ca],onMousedown:o[11]||(o[11]=t.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,d.value]]),R.value?(t.openBlock(),t.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${fi(p.id)+1} 个`},t.toDisplayString(fi(p.id)+1),9,Br)):t.createCommentVNode("",!0),ui(p.id)&&Zt(p.id)>0?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["zm-collapse-badge",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({background:$e.value.get(p.id)??"#64748b"}),title:`展开 ${Zt(p.id)} 个子节点`,onMousedown:o[13]||(o[13]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},t.toDisplayString(Zt(p.id)),47,Lr)):t.createCommentVNode("",!0),Ea(p)&&!ui(p.id)?(t.openBlock(),t.createElementBlock("button",{key:6,class:t.normalizeClass(["zm-btn zm-collapse",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({color:$e.value.get(p.id)??"#64748b",borderColor:$e.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},[t.createVNode(q,{name:"minus",size:10,stroke:2.4})],46,Dr)):t.createCommentVNode("",!0),p.image&&c.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:t.withModifiers(K=>Ae(K,p),["stop"])},null,40,zr)):t.createCommentVNode("",!0),p.image&&c.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>ae(p.id),["stop"])},[t.createVNode(q,{name:"x",size:9,stroke:2.2})],40,$r)):t.createCommentVNode("",!0)],46,Nr))),128))],4),v.value?(t.openBlock(),t.createBlock(no,{key:1,x:v.value.x,y:v.value.y,container:f.value,"has-image":!!((u=t.unref(W)(m.value,v.value.nodeId))!=null&&u.image),"has-link":!!((w=t.unref(W)(m.value,v.value.nodeId))!=null&&w.link),"has-note":!!((E=t.unref(W)(m.value,v.value.nodeId))!=null&&E.note),"has-code":((T=(_=t.unref(W)(m.value,v.value.nodeId))==null?void 0:_.richContent)==null?void 0:T.kind)==="code","has-table":((j=(V=t.unref(W)(m.value,v.value.nodeId))==null?void 0:V.richContent)==null?void 0:j.kind)==="table",onPickImage:xt,onRemoveImage:We,onSetLink:Ut,onRemoveLink:Ht,onEditNote:Ft,onRemoveNote:Wt,onAddCode:Qe,onEditCode:Qe,onRemoveCode:ke,onAddTable:kt,onEditTable:kt,onRemoveTable:et,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):t.createCommentVNode("",!0),H.value?(t.openBlock(),t.createBlock(io,{key:2,x:H.value.x,y:H.value.y,container:f.value,onOpenData:yt,onOpenImport:Et,onOpenSettings:xe,onClose:me},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":k.value}])},[t.createElementVNode("span",Pr,t.toDisplayString(Math.round(t.unref(F).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(F).zoomIn&&t.unref(F).zoomIn(...p))},[t.createVNode(q,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(F).zoomOut&&t.unref(F).zoomOut(...p))},[t.createVNode(q,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Re},[t.createVNode(q,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ua},[t.createVNode(q,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>di(1))},[t.createVNode(q,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>di(2))},[t.createVNode(q,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:fa},[t.createVNode(q,{name:"expand-all"})]),o[32]||(o[32]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Na},[t.createVNode(q,{name:"export"})]),r.previewMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[28]||(o[28]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[20]||(o[20]=p=>c.value&&Ze(c.value))},[t.createElementVNode("img",{src:t.unref(wi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Vr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>c.value&&St(c.value))},[t.createElementVNode("img",{src:t.unref(Ni),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ur)]),o[29]||(o[29]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[22]||(o[22]=p=>Xt("mindmap"))},[t.createVNode(q,{name:"mindmap"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[23]||(o[23]=p=>Xt("tree"))},[t.createVNode(q,{name:"tree"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[24]||(o[24]=p=>Xt("org"))},[t.createVNode(q,{name:"org"})],2),o[30]||(o[30]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:ka},[t.createVNode(q,{name:"import"})])],64))],2)],544)],4)}}}),Hr={install(e){e.component("FlowMindMap",qn)}};de.MindMap=qn,de.addChild=on,de.addSibling=rn,de.clone=Te,de.default=Hr,de.findNode=W,de.findParent=we,de.markdownToMindMap=Ot,de.markdownToRichMindMap=qi,de.mindMapToMarkdown=ut,de.removeNode=Rt,de.richBlockToMarkdown=ji,de.uid=Se,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
22
|
+
| a | b | c |`);if(k===null)return;const S=k.trim();if(!S){_(i,null);return}_(i,{kind:"table",raw:S})}function _t(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&_(i,null)}function de(i){r.previewMode||l("edit-note",i)}function ie(i,o=60){const f=i.replace(/\s+/g," ").trim();return f.length<=o?f||"点击编辑笔记":f.slice(0,o)+"…"}function Ve(i){var k;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const f=d.value;if(!f)return;const w=(k=i.clipboardData)==null?void 0:k.items;if(w)for(let S=0;S<w.length;S++){const A=w[S];if(A.kind==="file"&&A.type.startsWith("image/")){const F=A.getAsFile();if(!F)continue;i.preventDefault();const ne=Z(g.value,f);if(ne!=null&&ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;ae(F,h=>te(f,h));return}}}e.onMounted(()=>{window.addEventListener("paste",Ve),oe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Ve)});const he=e.ref(null),Qe=e.computed(()=>{var i;return((i=he.value)==null?void 0:i.nodeId)??null});function et(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const f=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,k=w>0?w/f:1;he.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:f,naturalH:w,ratio:k,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",M),window.addEventListener("mouseup",R)}function M(i){var ne,h;const o=he.value;if(!o)return;const f=Y.scale.value||1,w=i.clientX-o.startX,k=J(o.startW+w/f,ze,Ke),S=J(k*o.ratio,ze,Ke);o.pendingW=k,o.pendingH=S;const A=(ne=u.value)==null?void 0:ne.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);A&&(A.style.width=`${k}px`,A.style.height=`${S}px`);const F=(h=u.value)==null?void 0:h.querySelector(`[data-node-id="${o.nodeId}"]`);F&&(F.style.minWidth=`${Math.max(80,Math.ceil(k+28))}px`,F.style.height=`${Math.ceil(S+8+30)}px`)}function R(){const i=he.value;if(window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",R),he.value=null,!i)return;const o=Z(g.value,i.nodeId);!o||!o.image||(te(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=i.nodeId,l("select",o),q=!0)}const W=e.ref(null);let q=!1;function fe(i){W.value=i}function _e(i){W.value===i&&(W.value=null)}const tt=e.ref(0),nt=e.ref(!1),Ie=io(100);function me(){Ie.record({data:g.value})}function oe(){m.value=new Set(m.value),tt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>pa()).then(()=>{tt.value++})}function pa(){const i=document.querySelectorAll(".zm-rich"),o={},f={};i.forEach(w=>{let k=w,S=null;for(;k&&!S;)S=k.getAttribute("data-node-id"),k=k.parentElement;if(!S)return;const A=w.offsetHeight,F=w.scrollWidth,ne=Math.round(A*2)/2,h=Math.round(F*2)/2;o[S]=ne,f[S]=h,V.value[S],D.value[S]}),V.value=o,D.value=f}const Se=e.computed(()=>{var i,o,f,w,k,S,A,F,ne,h;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((k=r.theme)==null?void 0:k.lineColor)??"#94a3b8",bgColor:((S=r.theme)==null?void 0:S.bgColor)??"#f8fafc",fontSize:((A=r.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((F=r.theme)==null?void 0:F.lineWidthStart)??2.2,lineWidthEnd:((ne=r.theme)==null?void 0:ne.lineWidthEnd)??.8,rainbowBranch:((h=r.theme)==null?void 0:h.rainbowBranch)??!1}}),U=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function ti(i){return U.taperedEdge?ha(i):ii(i)}function ni(i){return U.taperedEdge?U.lineWidthEnd:ii(i)}function ha(i){return i<=0?U.lineWidthStart:i===1?Math.max(1.5,U.lineWidthStart*.67):i===2?Math.max(.8,U.lineWidthStart*.42):U.lineWidthEnd}function ii(i){if(i<=0)return U.lineWidthStart;if(i>=3)return U.lineWidthEnd;const o=i/3;return U.lineWidthStart+(U.lineWidthEnd-U.lineWidthStart)*o}function ba(i,o,f,w){const k=1-i,S=k*k*k*o.x+3*k*k*i*f.x1+3*k*i*i*f.x2+i*i*i*w.x,A=k*k*k*o.y+3*k*k*i*f.y1+3*k*i*i*f.y2+i*i*i*w.y;return{x:S,y:A}}function ya(i,o,f,w,k=32,S="curve",A="right"){if(S==="curve"){let ve;if(A==="right"||A==="left"){const se=Math.abs(o.x-i.x)*.45,Re=A==="right"?1:-1;ve={x1:i.x+Re*se,y1:i.y,x2:o.x-Re*se,y2:o.y}}else{const se=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+se,x2:o.x,y2:o.y-se}}const xi=ee=>{const se=1-ee,Re=-3*se*se*i.x+3*(se*se-2*se*ee)*ve.x1+3*(2*se*ee-ee*ee)*ve.x2+3*ee*ee*o.x,Ze=-3*se*se*i.y+3*(se*se-2*se*ee)*ve.y1+3*(2*se*ee-ee*ee)*ve.y2+3*ee*ee*o.y;return{dx:Re,dy:Ze}},st=[],Jt=[];for(let ee=0;ee<=k;ee++){const se=ee/k,Re=ee===0?i:ee===k?o:ba(se,i,ve,o),Ze=xi(se);let Tt=Math.hypot(Ze.dx,Ze.dy);Tt<1e-6&&(Tt=1);const ki=-Ze.dy/Tt,Ni=Ze.dx/Tt,At=(f+(w-f)*se)/2;st.push({x:Re.x+ki*At,y:Re.y+Ni*At}),Jt.push({x:Re.x-ki*At,y:Re.y-Ni*At})}let vt=`M ${st[0].x.toFixed(2)} ${st[0].y.toFixed(2)}`;for(let ee=1;ee<=k;ee++)vt+=` L ${st[ee].x.toFixed(2)} ${st[ee].y.toFixed(2)}`;for(let ee=k;ee>=0;ee--)vt+=` L ${Jt[ee].x.toFixed(2)} ${Jt[ee].y.toFixed(2)}`;return vt+=" Z",vt}const F=o.x-i.x,ne=o.y-i.y;let h=Math.hypot(F,ne);h<1e-6&&(h=1);const X=-ne/h,Ne=F/h,Ce=f/2,pe=w/2,ot={x:i.x+X*Ce,y:i.y+Ne*Ce},rt={x:i.x-X*Ce,y:i.y-Ne*Ce},at={x:o.x-X*pe,y:o.y-Ne*pe},lt={x:o.x+X*pe,y:o.y+Ne*pe};return`M ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${lt.x.toFixed(2)} ${lt.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} Z`}const St=e.computed(()=>be.value.root.children),Ea=Xe[0].colors,oi=e.computed(()=>Gi(U.branchPaletteId,U.customPalettes)),Pe=e.computed(()=>{const i=new Map;if(!U.rainbowBranch)return i;const o=r.lineColors,f=o&&o.length>0?o:oi.value.colors.length>0?oi.value.colors:Ea;for(let k=0;k<St.value.length;k++){const S=St.value[k];i.set(S.id,f[k%f.length])}const w=(k,S)=>{i.set(k.id,S);for(const A of k.children)w(A,S)};for(let k=0;k<St.value.length;k++){const S=St.value[k];w(S,f[k%f.length])}return i});function xa(i,o){return U.rainbowBranch?Pe.value.get(o.id)??Se.value.lineColor:Se.value.lineColor}function ka(i){const o=Q(i.id);if(o.bg)return o.bg;if(i.isRoot)return Se.value.rootBg;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return Sa(f,.18)}return Se.value.branchBg}function Na(i){const o=Q(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return Se.value.rootText;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return ri(f,.55)}return Se.value.branchText}function wa(i){const o=Q(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return Se.value.rootBg;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return ri(f,.3)}return Se.value.lineColor}function _a(i){return Q(i.id).fontWeight??(i.isRoot?600:400)}function Sa(i,o){const f=i.replace("#",""),w=f.length===6?f:f.split("").map(F=>F+F).join(""),k=parseInt(w.slice(0,2),16),S=parseInt(w.slice(2,4),16),A=parseInt(w.slice(4,6),16);return`rgba(${k}, ${S}, ${A}, ${o})`}function ri(i,o){const f=i.replace("#",""),w=f.length===6?f:f.split("").map(F=>F+F).join(""),k=Math.round(parseInt(w.slice(0,2),16)*(1-o)),S=Math.round(parseInt(w.slice(2,4),16)*(1-o)),A=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${k}, ${S}, ${A})`}const Y=eo({getContainer:()=>u.value});Y.setOnMarqueeEnd(Wa),no({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>d.value,getRootId:()=>g.value.id,defaultTargetId:()=>g.value.id,onAddChild:Ye,onAddSibling:Ct,onAddSiblingBefore:ci,onRemove:ui,onStartEdit:it,onClearSelection:()=>{d.value=null,l("select",null)},onDuplicate:di,onUndo:Zt,onRedo:Xt,onNavigate:Da,onSelectRoot:()=>{d.value=g.value.id;const i=Z(g.value,g.value.id);i&&l("select",i)}});const be=e.computed(()=>{const i=Te(g.value);return li(i),Hi(i,{mode:U.layoutMode,baseFontSize:Se.value.fontSize,richHeights:V.value,richWidths:D.value})}),ai=e.ref([]),Yt=e.computed(()=>(tt.value,ai.value));e.watch(be,i=>{const o=[],f=w=>{o.push(w);for(const k of w.children)f(k)};f(i.root),ai.value=o},{immediate:!0});const Ma=e.computed(()=>{const i=[];for(const o of Yt.value)for(const f of o.children)i.push({from:o,to:f,key:`${o.id}->${f.id}`});return i}),Ca=e.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function li(i){if(m.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)li(o)}function it(i){const o=Z(g.value,i);o&&(s.value=i,c.value=o.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function Mt(i={}){if(!s.value)return;const o=Z(g.value,s.value);o&&o.text!==(c.value.trim()||" ")&&(o.text=c.value.trim()||" ",me(),l("change",g.value));const f=s.value;s.value=null,i.addChild?e.nextTick(()=>Ye(f)):i.addSibling==="after"?e.nextTick(()=>Ct(f)):i.addSibling==="before"&&e.nextTick(()=>ci(f))}function va(){s.value=null}function Ta(i){if(r.previewMode)return;const o=Z(g.value,i);o!=null&&o.richContent&&(E.value=i,N.value=o.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function si(){if(!E.value)return;const i=E.value,o=Z(g.value,i),f=N.value;if(o&&o.richContent&&o.richContent.raw!==f)if(o.richContent.kind==="code"){const w=Qn(f)||void 0;_(i,{kind:"code",raw:f,lang:w})}else _(i,{kind:"table",raw:f});E.value=null}function Aa(){E.value=null}function Ra(i){i.key==="Escape"?(i.preventDefault(),Aa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),si())}function Ba(i,o){const f=b.value.get(i);!f||f.col!==o?b.value.set(i,{col:o,dir:"asc"}):f.dir==="asc"?b.value.set(i,{col:o,dir:"desc"}):b.value.delete(i)}function Oa(i,o){const f=b.value.get(i);return!f||o.length<=1?o:xr(o,f.col,f.dir)}function Ia(i,o){const f=b.value.get(i);return!f||f.col!==o?"↕":f.dir==="asc"?"▲":"▼"}function La(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Zt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Xt())}function Ye(i){const o=sn(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function Ct(i){if(i===g.value.id){Ye(i);return}const o=cn(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function ci(i){if(i===g.value.id){Ye(i);return}const o=Xi(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function di(i){if(i===g.value.id)return;const o=qi(g.value,i);o&&(me(),d.value=o.id,l("change",g.value),oe())}function Zt(){const i=Ie.undo();i&&(g.value=i.data,d.value=null,l("select",null),oe(),l("change",g.value))}function Xt(){const i=Ie.redo();i&&(g.value=i.data,d.value=null,l("select",null),oe(),l("change",g.value))}function Da(i,o){const f=d.value??g.value.id,w=Z(g.value,f);if(!w)return;let k=null;if(o===1){const S=we(g.value,w.id);if(S){const A=S.children.findIndex(F=>F.id===w.id);A>=0&&A<S.children.length-1&&(k=S.children[A+1].id)}}else if(o===-1){const S=we(g.value,w.id);if(S){const A=S.children.findIndex(F=>F.id===w.id);A>0&&(k=S.children[A-1].id)}}else if(i===1){const S=we(g.value,w.id);S&&(k=S.id)}else i===-1&&w.children.length>0&&(k=w.children[0].id);if(k){d.value=k;const S=Z(g.value,k);S&&l("select",S)}}function ui(i){i!==g.value.id&&Ot(g.value,i)&&(me(),d.value===i&&(d.value=null),oe(),l("change",g.value))}function fi(i){m.value.has(i)?m.value.delete(i):m.value.add(i),oe()}function mi(i){const o=[{n:g.value,depth:1}];for(;o.length;){const{n:f,depth:w}=o.pop();i(f,w);for(let k=f.children.length-1;k>=0;k--)o.push({n:f.children[k],depth:w+1})}}function za(){m.value=new Set,mi(i=>{i.children.length>0&&m.value.add(i.id)}),oe()}function gi(i){m.value=new Set,mi((o,f)=>{f>i&&o.children.length>0&&m.value.add(o.id)}),oe()}function $a(){m.value=new Set,oe()}function Va(i,o){Yi(g.value,i,o)&&(me(),oe(),l("change",g.value))}function Pa(i,o,f){return Zi(g.value,i,o,f)?(me(),oe(),l("change",g.value),!0):!1}function Ua(i,o){i.stopPropagation(),d.value=o.id;const f=Z(g.value,o.id);l("select",f)}function Ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){Y.startPan(i);return}if(i.button!==0)return;const f=u.value.getBoundingClientRect(),w=(i.clientX-f.left-Y.offsetX.value)/Y.scale.value,k=(i.clientY-f.top-Y.offsetY.value)/Y.scale.value;Y.startMarquee(w,k)}function Fa(i){if(q){q=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const f=Y.marquee;f.width>=4||f.height>=4||d.value!==null&&(d.value=null,l("select",null))}function Wa(){const i=Y.marquee;if(i.width<4&&i.height<4)return;const o=i.x,f=i.y,w=i.x+i.width,k=i.y+i.height,S=[];for(const A of Yt.value){const F=A.width/2,ne=A.height/2,h=A.x-F,X=A.x+F,Ne=A.y-ne,Ce=A.y+ne;h<=w&&X>=o&&Ne<=k&&Ce>=f&&S.push(A.id)}if(S.length>0){d.value=S[0];const A=Z(g.value,S[0]);A&&l("select",A)}}function pi(i){return m.value.has(i)}function Ka(i){const o=Z(g.value,i.id);return!!o&&o.children.length>0}function qt(i){const o=Z(g.value,i);return o?o.children.length:0}function hi(i){if(!Z(g.value,i))return 0;const w=[g.value];for(;w.length;){const k=w.pop(),S=k.children.findIndex(A=>A.id===i);if(S>=0)return S;for(const A of k.children)w.push(A)}return 0}function bi(i,o,f,w){if(((w==null?void 0:w._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let S;o==="in"?S=-i.side:f!==void 0?S=f:S=i.side;const A=o==="in"?i._richInsetX??0:0;return{x:i.x+S*(i.width/2-A),y:i.y}}function Ae(){const i=be.value;Y.resetView(i.width,i.height,i.root.y)}function Ga(){nt.value=!0,me(),oe(),e.nextTick(()=>Ae())}function jt(i){U.layoutMode!==i&&(U.layoutMode=i,oe(),e.nextTick(()=>Ae()))}function yi(){return JSON.stringify(g.value,null,2)}function Ei(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Ie.reset(),g.value=Te(o),d.value=null,m.value=new Set,oe(),e.nextTick(()=>Ae()),l("change",g.value),!0)}catch{return!1}}function Ya(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var w;const o=(w=i.files)==null?void 0:w[0];if(!o)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(Ei(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(o)},i.click()}function Za(){const i=new Blob([yi()],{type:"application/json"}),o=URL.createObjectURL(i),f=document.createElement("a");f.href=o,f.download=`${g.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ye(i),addSibling:i=>Ct(i),removeNode:i=>ui(i),duplicateNode:i=>di(i),setNodeText:(i,o)=>Va(i,o),moveNode:(i,o,f)=>Pa(i,o,f),lineWidthForDepth:ti,endWidthForDepth:ni,getData:()=>g.value,setData:i=>{Ie.reset(),g.value=Te(i),d.value=null,m.value=new Set,oe(),me(),e.nextTick(()=>Ae())},resetView:()=>Ae(),exportData:yi,importData:Ei,getMarkdown:()=>mt(g.value),setMarkdown:(i,o=!0)=>{const f=It(i||"");o&&(y.value=!0),L=!o,Ie.reset(),g.value=Te(f),d.value=null,m.value=new Set,oe(),me(),e.nextTick(()=>{L=!1,Ae()}),l("change",g.value)},setBalanced:i=>{nt.value=i},isBalanced:()=>nt.value,balance:()=>Ga(),applyNodeStyle:(i,o)=>I(i,o),getNodeStyle:i=>Q(i),applyNodeImage:(i,o)=>te(i,o),applyNodeImageByUrl:(i,o)=>K(i,o),removeNodeImage:i=>le(i),applyNodeLink:(i,o)=>$(i,o),removeNodeLink:i=>v(i),applyNodeNote:(i,o)=>p(i,o),removeNodeNote:i=>C(i),applyNodeRichContent:(i,o)=>_(i,o),undo:()=>Zt(),redo:()=>Xt(),canUndo:()=>Ie.canUndo(),canRedo:()=>Ie.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(U.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(U.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(U.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(U.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(U.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(U.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:U.autoBalanceOnChange,lineWidthStart:U.lineWidthStart,lineWidthEnd:U.lineWidthEnd,rainbowBranch:U.rainbowBranch,branchPaletteId:U.branchPaletteId,customPalettes:U.customPalettes,lineStyle:U.lineStyle,layoutMode:U.layoutMode,taperedEdge:U.taperedEdge,showOrderBadge:U.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...Xe,...U.customPalettes].find(f=>f.id===i)&&(U.branchPaletteId=i)},getBranchPalette:()=>U.branchPaletteId,getBranchPalettes:()=>[...Xe,...U.customPalettes]}),e.watch(()=>r.data,i=>{g.value=Te(i),oe()},{deep:!1}),e.onMounted(()=>{me(),e.nextTick(()=>Ae())}),(i,o)=>{var f,w,k,S,A,F,ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Se.value.bgColor,fontSize:Se.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:u,class:"zm-canvas",onMousedown:Ha,onContextmenu:xe,onWheel:o[27]||(o[27]=(...h)=>e.unref(Y).onWheel&&e.unref(Y).onWheel(...h)),onMouseenter:o[28]||(o[28]=h=>x.value=!0),onMouseleave:o[29]||(o[29]=h=>x.value=!1),onClick:Fa},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:be.value.vbX*e.unref(Y).scale.value+e.unref(Y).offsetX.value+"px",top:be.value.vbY*e.unref(Y).scale.value+e.unref(Y).offsetY.value+"px",width:be.value.vbW*e.unref(Y).scale.value+"px",height:be.value.vbH*e.unref(Y).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Ca.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*e.unref(Y).scale.value,height:be.value.vbH*e.unref(Y).scale.value},[e.createElementVNode("g",Nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.value,h=>(e.openBlock(),e.createElementBlock("path",{key:h.key,d:ya(bi(h.from,"out",h.to.side,h.to),bi(h.to,"in"),ti(h.from.depth),ni(h.to.depth),32,U.lineStyle,h.to._dir),fill:xa(h.from,h.to),stroke:"none"},null,8,wr))),128))])],8,kr))],4),e.unref(Y).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(Y).marquee.x*e.unref(Y).scale.value+e.unref(Y).offsetX.value+"px",top:e.unref(Y).marquee.y*e.unref(Y).scale.value+e.unref(Y).offsetY.value+"px",width:e.unref(Y).marquee.width*e.unref(Y).scale.value+"px",height:e.unref(Y).marquee.height*e.unref(Y).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(Y).offsetX.value}px, ${e.unref(Y).offsetY.value}px) scale(${e.unref(Y).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["zm-node",{"is-root":h.isRoot,"is-selected":d.value===h.id,"is-editing":s.value===h.id,"has-image":!!h.image,"is-resizing":Qe.value===h.id}]),"data-node-id":h.id,style:e.normalizeStyle({left:h.x+"px",top:h.y+"px",width:h.width+"px",minWidth:h.width+"px",height:h.height+"px",fontSize:h.fontSize+"px",background:ka(h),color:Na(h),borderColor:wa(h),fontWeight:_a(h),transform:"translate(-50%, -50%)"}),onClick:X=>Ua(X,h),onDblclick:X=>{X.stopPropagation(),t.previewMode||it(h.id)},onContextmenu:X=>Ee(X,h),onMouseenter:X=>fe(h.id),onMouseleave:X=>_e(h.id)},[h.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:h.image.src,width:h.image.width,height:h.image.height,alt:h.text,draggable:"false"},null,8,Sr)):e.createCommentVNode("",!0),h.richContent&&(h.richContent.kind==="code"||h.richContent.kind==="table")&&s.value!==h.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":h.richContent.kind==="table"||h.richContent.kind==="code"}]),onClick:o[1]||(o[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(X=>Ta(h.id),["stop"]),onMousedown:o[2]||(o[2]=e.withModifiers(()=>{},["stop"]))},[E.value===h.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=X=>N.value=X),class:"zm-rich-edit",spellcheck:"false",onBlur:si,onKeydown:Ra},null,544)),[[e.vModelText,N.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Cr,[e.createElementVNode("code",{innerHTML:e.unref(br)(e.unref(Jn)(h.richContent.raw),e.unref(Qn)(h.richContent.raw))},null,8,vr)])):h.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Tr,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oa(h.id,e.unref(yr)(h.richContent.raw)),(X,Ne)=>(e.openBlock(),e.createElementBlock("tr",{key:Ne},[Ne===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(X,(Ce,pe)=>{var ot,rt,at,lt,ve;return e.openBlock(),e.createElementBlock("th",{key:`h${pe}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((ot=b.value.get(h.id))==null?void 0:ot.col)===pe,"is-asc":((rt=b.value.get(h.id))==null?void 0:rt.col)===pe&&((at=b.value.get(h.id))==null?void 0:at.dir)==="asc","is-desc":((lt=b.value.get(h.id))==null?void 0:lt.col)===pe&&((ve=b.value.get(h.id))==null?void 0:ve.dir)==="desc"}]),onClick:e.withModifiers(xi=>Ba(h.id,pe),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(Ce),1),e.createElementVNode("span",Rr,e.toDisplayString(Ia(h.id,pe)),1)],10,Ar)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(X,(Ce,pe)=>(e.openBlock(),e.createElementBlock("td",{key:`c${pe}`},e.toDisplayString(Ce),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Mr)):e.createCommentVNode("",!0),s.value!==h.id?(e.openBlock(),e.createElementBlock("span",Br,[e.createElementVNode("span",Or,e.toDisplayString(h.text),1),h.link&&!s.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:h.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${h.link.url}`,onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(j,{name:"link",size:11,stroke:2})],40,Ir)):e.createCommentVNode("",!0),h.note&&!s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:ie(h.note.text),onClick:e.withModifiers(X=>de(h.id),["stop"]),onMousedown:o[5]||(o[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(j,{name:"note",size:11,stroke:2})],40,Lr)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=X=>c.value=X),autofocus:"",onBlur:o[7]||(o[7]=X=>Mt()),onKeydown:[o[8]||(o[8]=e.withKeys(e.withModifiers(X=>Mt({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=e.withKeys(e.withModifiers(X=>Mt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=e.withKeys(e.withModifiers(X=>Mt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(va,["esc"]),La],onMousedown:o[11]||(o[11]=e.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]),O.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${hi(h.id)+1} 个`},e.toDisplayString(hi(h.id)+1),9,Dr)):e.createCommentVNode("",!0),pi(h.id)&&qt(h.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":h.side===-1}]),style:e.normalizeStyle({background:Pe.value.get(h.id)??"#64748b"}),title:`展开 ${qt(h.id)} 个子节点`,onMousedown:o[13]||(o[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>fi(h.id),["stop"])},e.toDisplayString(qt(h.id)),47,zr)):e.createCommentVNode("",!0),Ka(h)&&!pi(h.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":h.side===-1}]),style:e.normalizeStyle({color:Pe.value.get(h.id)??"#64748b",borderColor:Pe.value.get(h.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>fi(h.id),["stop"])},[e.createVNode(j,{name:"minus",size:10,stroke:2.4})],46,$r)):e.createCommentVNode("",!0),h.image&&d.value===h.id&&s.value!==h.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(X=>et(X,h),["stop"])},null,40,Vr)):e.createCommentVNode("",!0),h.image&&d.value===h.id&&s.value!==h.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>le(h.id),["stop"])},[e.createVNode(j,{name:"x",size:9,stroke:2.2})],40,Pr)):e.createCommentVNode("",!0)],46,_r))),128))],4),T.value?(e.openBlock(),e.createBlock(oo,{key:1,x:T.value.x,y:T.value.y,container:u.value,"has-image":!!((f=e.unref(Z)(g.value,T.value.nodeId))!=null&&f.image),"has-link":!!((w=e.unref(Z)(g.value,T.value.nodeId))!=null&&w.link),"has-note":!!((k=e.unref(Z)(g.value,T.value.nodeId))!=null&&k.note),"has-code":((A=(S=e.unref(Z)(g.value,T.value.nodeId))==null?void 0:S.richContent)==null?void 0:A.kind)==="code","has-table":((ne=(F=e.unref(Z)(g.value,T.value.nodeId))==null?void 0:F.richContent)==null?void 0:ne.kind)==="table",onPickImage:Wt,onRemoveImage:ke,onSetLink:Kt,onRemoveLink:Gt,onEditNote:Ge,onRemoveNote:Nt,onAddCode:wt,onEditCode:wt,onRemoveCode:Je,onAddTable:H,onEditTable:H,onRemoveTable:_t,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createBlock(ro,{key:2,x:G.value.x,y:G.value.y,container:u.value,onOpenSettings:xt,onOpenData:kt,onOpenImport:Ft,onClose:$e},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:o[16]||(o[16]=h=>l("canvas-toggle-preview"))},[e.createVNode(j,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ur),e.createElementVNode("button",{class:e.normalizeClass(ue.value),title:"显示大纲视图",onClick:o[17]||(o[17]=h=>l("canvas-outline"))},[e.createVNode(j,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",Hr,e.toDisplayString(Math.round(e.unref(Y).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[18]||(o[18]=(...h)=>e.unref(Y).zoomIn&&e.unref(Y).zoomIn(...h))},[e.createVNode(j,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[19]||(o[19]=(...h)=>e.unref(Y).zoomOut&&e.unref(Y).zoomOut(...h))},[e.createVNode(j,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ae},[e.createVNode(j,{name:"reset"})]),o[33]||(o[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:za},[e.createVNode(j,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[20]||(o[20]=h=>gi(1))},[e.createVNode(j,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[21]||(o[21]=h=>gi(2))},[e.createVNode(j,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:$a},[e.createVNode(j,{name:"expand-all"})]),o[34]||(o[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Za},[e.createVNode(j,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o[30]||(o[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[22]||(o[22]=h=>d.value&&Ye(d.value))},[e.createElementVNode("img",{src:e.unref(en),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Fr)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[23]||(o[23]=h=>d.value&&Ct(d.value))},[e.createElementVNode("img",{src:e.unref(Qt),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Wr)]),o[31]||(o[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[24]||(o[24]=h=>jt("mindmap"))},[e.createVNode(j,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[25]||(o[25]=h=>jt("tree"))},[e.createVNode(j,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[26]||(o[26]=h=>jt("org"))},[e.createVNode(j,{name:"org"})],2),o[32]||(o[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Ya},[e.createVNode(j,{name:"import"})])],64))],2)],544)],4)}}}),Kr={class:"zm-outline-root"},Gr={class:"zm-outline-actions"},Yr={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zr={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Xr={key:1,d:"M5 12 L10 17 L19 7"},qr={class:"zm-outline"},jr=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Jr=["title","onClick"],Qr={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},ea={key:0,points:"6 9 12 15 18 9"},ta={key:1,points:"9 6 15 12 9 18"},na={key:1,class:"zm-outline-dot"},ia={class:"zm-outline-index"},oa={key:3,class:"zm-outline-text"},ra=["onClick"],aa=["src"],la=["onClick"],sa=["src"],ca=["title","onClick"],da={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ua={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},fa={key:1,d:"M5 12 L10 17 L19 7"},ma=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:a}){const n=t,r=a,l=e.computed(()=>{const B=[],$=(v,p,C)=>{const _=v.children.length>0,T=n.collapsedIds.has(v.id);B.push({id:v.id,text:v.text||"(无标题)",depth:p,siblingIndex:C,hasChildren:_,collapsed:T,node:v}),_&&!T&&v.children.forEach((G,re)=>$(G,p+1,re))};return $(n.data,0,0),B}),u=e.ref(null),s=e.ref("");let c=null;function d(B){n.readonly||(u.value=B.id,s.value=B.text,e.nextTick(()=>{c=document.querySelector(".zm-outline-input"),c==null||c.focus(),c==null||c.select()}))}function m(){u.value!=null&&(r("edit",{id:u.value,text:s.value.trim()||"(无标题)"}),x())}function x(){u.value=null,s.value="",c=null}function E(B){B.key==="Enter"?(B.preventDefault(),m()):B.key==="Escape"&&(B.preventDefault(),x())}e.onBeforeUnmount(x);const N=e.ref(null),b=e.ref(null),g=e.ref(null);function V(B,$){if(n.readonly){B.preventDefault();return}N.value={id:$.id,text:$.text},B.dataTransfer&&(B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",$.id))}function D(){N.value=null,b.value=null,g.value=null}function y(B,$){if(!N.value)return;B.preventDefault(),B.dataTransfer&&(B.dataTransfer.dropEffect="move");const v=P(B);b.value=$.id,g.value=v}function L(B){b.value===B.id&&(b.value=null,g.value=null)}function O(B,$){B.preventDefault();const v=N.value;if(!v)return;const p=P(B);v.id!==$.id&&r("move",{srcId:v.id,targetId:$.id,position:p}),D()}function P(B,$){const p=B.currentTarget.getBoundingClientRect(),C=B.clientY-p.top,_=p.height;return C<_*.3?"before":C>_*.7?"after":"child"}const z=e.ref(null);let I=null;async function Q(B){try{return await navigator.clipboard.writeText(B),!0}catch{const $=document.createElement("textarea");$.value=B,document.body.appendChild($),$.select();let v=!1;try{v=document.execCommand("copy")}finally{document.body.removeChild($)}return v}}async function te(B,$,v){B.stopPropagation(),await Q($)&&(z.value=v,I&&clearTimeout(I),I=setTimeout(()=>z.value=null,1200))}const le=e.computed(()=>{const B=[],$=(v,p)=>{const C=" ".repeat(p),_=p===0?"":"- ";B.push(C+_+(v.text||""));for(const T of v.children)$(T,p+1)};return $(n.data,0),B.join(`
|
|
23
|
+
`)}),K=e.ref(!1);let J=null;async function ae(){await Q(le.value)&&(K.value=!0,J&&clearTimeout(J),J=setTimeout(()=>K.value=!1,1200))}return(B,$)=>(e.openBlock(),e.createElementBlock("div",Kr,[e.createElementVNode("div",Gr,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:ae},[(e.openBlock(),e.createElementBlock("svg",Yr,[K.value?(e.openBlock(),e.createElementBlock("path",Xr)):(e.openBlock(),e.createElementBlock("rect",Zr)),$[2]||($[2]=e.createElementVNode("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.createElementVNode("span",null,e.toDisplayString(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,v=>(e.openBlock(),e.createElementBlock("li",{key:v.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":v.id===t.selectedId,"is-root":v.depth===0,"is-editing":u.value===v.id,"is-drag-over-before":b.value===v.id&&g.value==="before","is-drag-over-after":b.value===v.id&&g.value==="after","is-drag-over-child":b.value===v.id&&g.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+v.depth*16+"px"}),draggable:"true",onClick:p=>r("select",v.node),onDblclick:p=>d(v),onDragstart:p=>V(p,v),onDragend:D,onDragover:p=>y(p,v),onDragleave:()=>L(v),onDrop:p=>O(p,v)},[v.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:v.collapsed?"展开":"折叠",onClick:e.withModifiers(p=>r("toggleCollapse",v.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Qr,[v.collapsed?(e.openBlock(),e.createElementBlock("polyline",ta)):(e.openBlock(),e.createElementBlock("polyline",ea))]))],8,Jr)):(e.openBlock(),e.createElementBlock("span",na)),e.createElementVNode("span",ia,e.toDisplayString(v.siblingIndex+1)+".",1),u.value===v.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":$[0]||($[0]=p=>s.value=p),class:"zm-outline-input",onBlur:m,onKeydown:E,onClick:$[1]||($[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,s.value]]):(e.openBlock(),e.createElementBlock("span",oa,e.toDisplayString(v.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(p=>r("addSibling",v.id),["stop"])},[e.createElementVNode("img",{src:e.unref(Qt),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,aa)],8,ra)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(p=>r("addChild",v.id),["stop"])},[e.createElementVNode("img",{src:e.unref(en),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,sa)],8,la)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":z.value===v.id}]),title:z.value===v.id?"已复制":"复制节点文本",onClick:p=>te(p,v.text,v.id)},[(e.openBlock(),e.createElementBlock("svg",da,[z.value!==v.id?(e.openBlock(),e.createElementBlock("rect",ua)):(e.openBlock(),e.createElementBlock("path",fa)),$[3]||($[3]=e.createElementVNode("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,ca)],46,jr))),128))])]))}}),ga={install(t){t.component("FlowMindMap",ei)}};ce.MindMap=ei,ce.Outline=ma,ce.addChild=sn,ce.addSibling=cn,ce.clone=Te,ce.default=ga,ce.findNode=Z,ce.findParent=we,ce.markdownToMindMap=It,ce.markdownToRichMindMap=Ji,ce.mindMapToMarkdown=mt,ce.removeNode=Ot,ce.richBlockToMarkdown=Qi,ce.uid=Me,Object.defineProperties(ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|