flow-mindmap 0.5.9 → 0.5.10

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.
@@ -1,19 +1,19 @@
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";var Kh=Object.defineProperty;var Yh=(Ce,e,In)=>e in Ce?Kh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:In}):Ce[e]=In;var Ve=(Ce,e,In)=>Yh(Ce,typeof e!="symbol"?e+"":e,In);var ei;const In=["width","height","stroke-width"],Na={key:4,points:"6 9 12 15 18 9"},Sa={key:5,points:"9 6 15 12 9 18"},_e=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,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",Na)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Sa)):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==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=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[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=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[39]||(n[39]=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[40]||(n[40]=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:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=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:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=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:24},[n[53]||(n[53]=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:25},[n[54]||(n[54]=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:26},[n[55]||(n[55]=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:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=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:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=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[62]||(n[62]=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:30},[n[63]||(n[63]=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[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,In))}}),lr="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",ar="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",sr=[22,15,13,12],cr=[700,600,500,400],Ta=[46,36,30,26],Ca=[120,80,60,44],Ma=[.8,.8,.8,.8],Aa=1,_a=sr.length-1;function Ra(t,o){return Math.round(mi(t,o)*Ma[Ao(t)])}function Ao(t){return Math.min(_a,Math.max(0,t))}function mi(t,o=14){return Math.round(sr[Ao(t)]*o/14*10)/10}function Ba(t,o=14){return Math.round(Ta[Ao(t)]*o/14)}const io=60,va=30,Ia=.75,zn=14,vt=24;function dr(t){return Math.max(va,Math.round(io*Math.pow(Ia,t)))}let pi=null;function za(){if(pi)return pi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(pi=t,t):{font:"",measureText:()=>({width:0})}}const ur=new Map;function fr(t,o,n){const i=`${n}|${o}|${t}`,a=ur.get(i);if(a!==void 0)return a;const c=za();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
- `);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return ur.set(i,u),u}const Oa=24,La=400,Da=8,mr=16,pr=4,hr=200;function Va(t,o,n){return Math.min(n,Math.max(o,t))}function $a(t,o,n,i,a){const c=Ao(o),s=mi(o,n),u=Math.min(fr(t.text||"",s,cr[c]),hr),d=Ra(o,n),p=Math.ceil(u+d*2+Aa*2),h=(t.text||"").split(`
3
- `);let x=0;for(const ae of h){const ke=fr(ae,s,cr[c]);x+=Math.max(1,Math.ceil(ke/hr))}x=Math.max(1,x);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(x-1)):Ba(o,n)+Math.ceil(s*1.2*(x-1));let R=0;if(t.link&&(R+=mr),t.note&&(R+=mr),R>0){const ae=(t.link?1:0)+(t.note?1:0);R+=pr*ae}const F=14,O=2;let A=0;t.markers&&t.markers.length>0&&(A=t.markers.length*F+(t.markers.length-1)*O+pr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+A,G=(()=>{const ae=Math.round(Ca[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ke=a==null?void 0:a[t.id];return Math.max(ae,ke??240)}return ae})(),q=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),w=i==null?void 0:i[t.id],ie=q?Math.max(24,w??Math.max(70,Math.ceil(s*5))):0,fe=ie>0?10:0;if(!t.image){const ae=Math.max(G,P),ke=Math.ceil($+fe+ie+(m>0?k+m:0));return{w:ae,h:ke}}const ce=Va(t.image.width,Oa,La),J=Math.max(G,P,Math.ceil(ce+d*2)),me=Math.ceil(t.image.height+Da+$+fe+ie+(m>0?k+m:0));return{w:J,h:me}}function Pa(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=br(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Ua(c),Fa(c,n,i),c.x=0,c.y=0,Ha(c,i)}function Fa(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((x,C)=>x+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let x=0;x<i.length-1;x++){h+=i[x]._subtreeH;const C=Math.abs(h-(u-h));C<p&&(p=C,d=x+1)}for(let x=0;x<d;x++)i[x]._dir="right",i[x].side=1,i[x]._dirRight=1;for(let x=d;x<i.length;x++)i[x]._dir="left",i[x].side=-1,i[x]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const p=d==="right"?1:-1;u._dir=d,u.side=p,u._dirRight=p;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};_o(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};_o(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";_o(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";gr(t,io,n)}}function _o(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,x,C)=>h+x._subtreeH+(C>0?zn:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const p=dr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+zn),_o(h,o,n,!1,a)})}function gr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?zn*2:0),0);let a=t.x-i/2;const c=dr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+zn*2,gr(s,o,n)})}function br(t,o,n,i,a,c,s,u){const d=$a(t,o,c,s,u),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:mi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_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,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return p;const h=t.children.length,x=Math.ceil(h/2);return p.children=t.children.map((C,$)=>{const R=o===0?$<x?1:-1:i;return br(C,o+1,p,R,a,c,s,u)}),p}function Ua(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=zn*(i.children.length-1),c+=zn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ha(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,x=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-x<c&&(c=p.y-x),p.y+x>s&&(s=p.y+x),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const u=vt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=u,d.push(...p.children)}return c+=u,s+=u,{root:t,width:a-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const dn=[{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 Wa(t,o=[]){return[...dn,...o].find(i=>i.id===t)??dn[0]}function Ga(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=ja(s):s.startsWith("rgb")?u=Ka(s):u=Ya[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function ja(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Ka(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ya={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Yt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function It(t){return JSON.parse(JSON.stringify(t))}function he(t,o){if(t.id===o)return t;for(const n of t.children){const i=he(n,o);if(i)return i}return null}function zt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=zt(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function qa(t,o,n){const i=he(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function hi(t,o,n,i){if(!zt(t,o)||o===n||he(he(t,o),n))return!1;const a=zt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=he(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=zt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function kr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function yr(t,o,n){const i=he(t,o);if(!i)return null;const a={id:Yt(),text:n??kr(i),children:[]};return i.children.push(a),a}function Er(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Yt(),text:n??kr(i),children:[]};return i.children.splice(a+1,0,c),c}function Xa(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Yt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Za(t,o){const n=zt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=It(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Yt();for(const o of t.children)Bo(o)}function xr(t,o){const n=he(t,o);if(!n||n.id===t.id)return null;const i=It(n);return Bo(i),i}const vo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Yt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let x=!1,C=[],$=null;function R(A){C.push(A)}function F(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const A=C.join(`
4
- `);A&&($.note={text:A})}x=!1,C=[]}for(const A of n){if(x){const G=A.match(h);if(G&&G[1][0]==="`"){F();continue}R(A);continue}const y=A.match(u);if(y){const G=y[1].length,q=y[2].trim();s.push({level:G,text:q,body:""}),$=s[s.length-1];continue}const k=A.match(h);if(k&&k[2]==="note"){x=!0,C=[];continue}const m=A.match(d);if(m&&$){const G=m[2],q=160,w=120;$.image={src:G,naturalW:q,naturalH:w,width:q,height:w};continue}const P=A.match(p);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(A.trim().length>0&&$){const G=A.trim();$.body=$.body?$.body+`
5
- `+G:G}}x&&F();function O(A){for(;a.length>1;){const P=a.length-1,G=c[P];if(G!==void 0&&G<A.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=A.text,m={id:Yt(),text:k,children:[]};A.image&&(m.image={...A.image}),A.link&&(m.link={url:A.link.url}),A.note&&(m.note={text:A.note.text}),A.body&&(m.note={text:A.body}),y.children.push(m),a.push(m),c.push(A.level)}for(const A of s)O(A);if(s.length>0&&s[0].level===1){const A=i.children[0];A&&(i.text=A.text,i.id=A.id,A.image&&(i.image={...A.image}),A.link&&(i.link={url:A.link.url}),A.note&&(i.note={text:A.note.text}),i.children=A.children)}return i}function Ln(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(Te,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Te=typeof globalThis<"u"?globalThis:Te||self,e(Te.FlowMind={},Te.Vue))})(this,function(Te,e){"use strict";var Yh=Object.defineProperty;var qh=(Te,e,zn)=>e in Te?Yh(Te,e,{enumerable:!0,configurable:!0,writable:!0,value:zn}):Te[e]=zn;var Ve=(Te,e,zn)=>qh(Te,typeof e!="symbol"?e+"":e,zn);var ti;const zn=["width","height","stroke-width"],Ta={key:4,points:"6 9 12 15 18 9"},Ca={key:5,points:"9 6 15 12 9 18"},_e=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,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",Ta)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ca)):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==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=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[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=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[39]||(n[39]=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[40]||(n[40]=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:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=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:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=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:24},[n[53]||(n[53]=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:25},[n[54]||(n[54]=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:26},[n[55]||(n[55]=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:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=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:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=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[62]||(n[62]=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:30},[n[63]||(n[63]=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[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,zn))}}),sr="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",cr="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",dr=[22,15,13,12],ur=[700,600,500,400],Ma=[46,36,30,26],Aa=[120,80,60,44],_a=[.8,.8,.8,.8],Ra=1,va=dr.length-1;function Ba(t,o){return Math.round(pi(t,o)*_a[_o(t)])}function _o(t){return Math.min(va,Math.max(0,t))}function pi(t,o=14){return Math.round(dr[_o(t)]*o/14*10)/10}function za(t,o=14){return Math.round(Ma[_o(t)]*o/14)}const io=60,Ia=30,Oa=.75,In=14,vt=24;function fr(t){return Math.max(Ia,Math.round(io*Math.pow(Oa,t)))}let hi=null;function La(){if(hi)return hi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(hi=t,t):{font:"",measureText:()=>({width:0})}}const mr=new Map;function pr(t,o,n){const i=`${n}|${o}|${t}`,a=mr.get(i);if(a!==void 0)return a;const c=La();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
+ `);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return mr.set(i,u),u}const Da=24,Va=400,$a=8,hr=16,gr=4,br=200;function Pa(t,o,n){return Math.min(n,Math.max(o,t))}function Fa(t,o,n,i,a){const c=_o(o),s=pi(o,n),u=Math.min(pr(t.text||"",s,ur[c]),br),d=Ba(o,n),p=Math.ceil(u+d*2+Ra*2),h=(t.text||"").split(`
3
+ `);let x=0;for(const ce of h){const ue=pr(ce,s,ur[c]);x+=Math.max(1,Math.ceil(ue/br))}x=Math.max(1,x);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(x-1)):za(o,n)+Math.ceil(s*1.2*(x-1));let R=0;if(t.link&&(R+=hr),t.note&&(R+=hr),R>0){const ce=(t.link?1:0)+(t.note?1:0);R+=gr*ce}const F=14,I=2;let A=0;t.markers&&t.markers.length>0&&(A=t.markers.length*F+(t.markers.length-1)*I+gr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+A,G=(()=>{const ce=Math.round(Aa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ue=a==null?void 0:a[t.id];return Math.max(ce,ue??240)}return ce})(),Y=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),N=i==null?void 0:i[t.id],re=Y?Math.max(24,N??Math.max(70,Math.ceil(s*5))):0,pe=re>0?10:0;if(!t.image){const ce=Math.max(G,P),ue=Math.ceil($+pe+re+(m>0?k+m:0));return{w:ce,h:ue}}const de=Pa(t.image.width,Da,Va),xe=Math.max(G,P,Math.ceil(de+d*2)),ee=Math.ceil(t.image.height+$a+$+pe+re+(m>0?k+m:0));return{w:xe,h:ee}}function Ua(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=yr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Wa(c),Ha(c,n,i),c.x=0,c.y=0,Ga(c,i)}function Ha(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((x,C)=>x+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let x=0;x<i.length-1;x++){h+=i[x]._subtreeH;const C=Math.abs(h-(u-h));C<p&&(p=C,d=x+1)}for(let x=0;x<d;x++)i[x]._dir="right",i[x].side=1,i[x]._dirRight=1;for(let x=d;x<i.length;x++)i[x]._dir="left",i[x].side=-1,i[x]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const p=d==="right"?1:-1;u._dir=d,u.side=p,u._dirRight=p;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};Ro(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};Ro(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";Ro(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";kr(t,io,n)}}function Ro(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,x,C)=>h+x._subtreeH+(C>0?In:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const p=fr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+In),Ro(h,o,n,!1,a)})}function kr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?In*2:0),0);let a=t.x-i/2;const c=fr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+In*2,kr(s,o,n)})}function yr(t,o,n,i,a,c,s,u){const d=Fa(t,o,c,s,u),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:pi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_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,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return p;const h=t.children.length,x=Math.ceil(h/2);return p.children=t.children.map((C,$)=>{const R=o===0?$<x?1:-1:i;return yr(C,o+1,p,R,a,c,s,u)}),p}function Wa(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=In*(i.children.length-1),c+=In*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ga(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,x=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-x<c&&(c=p.y-x),p.y+x>s&&(s=p.y+x),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const u=vt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=u,d.push(...p.children)}return c+=u,s+=u,{root:t,width:a-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const cn=[{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 ja(t,o=[]){return[...cn,...o].find(i=>i.id===t)??cn[0]}function Ka(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ya(s):s.startsWith("rgb")?u=qa(s):u=Xa[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ya(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function qa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Xa={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Bt(t){return JSON.parse(JSON.stringify(t))}function be(t,o){if(t.id===o)return t;for(const n of t.children){const i=be(n,o);if(i)return i}return null}function zt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=zt(i,o,t);if(a!==null)return a}return null}function vo(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(vo(i,o))return!0;return!1}function Za(t,o,n){const i=be(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function gi(t,o,n,i){if(!zt(t,o)||o===n||be(be(t,o),n))return!1;const a=zt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=be(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=zt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function Er(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?zo:n>0?`新节点 ${n+1}`:"新节点 2"}function bi(t,o,n){const i=be(t,o);if(!i)return null;const a={id:Kt(),text:n??Er(i),children:[]};return i.children.push(a),a}function xr(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n??Er(i),children:[]};return i.children.splice(a+1,0,c),c}function Ja(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Qa(t,o){const n=zt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=Bt(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Kt();for(const o of t.children)Bo(o)}function wr(t,o){const n=be(t,o);if(!n||n.id===t.id)return null;const i=Bt(n);return Bo(i),i}function Nr(t){return t.children.reduce((o,n)=>o+1+Nr(n),0)}const zo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Kt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let x=!1,C=[],$=null;function R(A){C.push(A)}function F(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const A=C.join(`
4
+ `);A&&($.note={text:A})}x=!1,C=[]}for(const A of n){if(x){const G=A.match(h);if(G&&G[1][0]==="`"){F();continue}R(A);continue}const y=A.match(u);if(y){const G=y[1].length,Y=y[2].trim();s.push({level:G,text:Y,body:""}),$=s[s.length-1];continue}const k=A.match(h);if(k&&k[2]==="note"){x=!0,C=[];continue}const m=A.match(d);if(m&&$){const G=m[2],Y=160,N=120;$.image={src:G,naturalW:Y,naturalH:N,width:Y,height:N};continue}const P=A.match(p);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(A.trim().length>0&&$){const G=A.trim();$.body=$.body?$.body+`
5
+ `+G:G}}x&&F();function I(A){for(;a.length>1;){const P=a.length-1,G=c[P];if(G!==void 0&&G<A.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=A.text,m={id:Kt(),text:k,children:[]};A.image&&(m.image={...A.image}),A.link&&(m.link={url:A.link.url}),A.note&&(m.note={text:A.note.text}),A.body&&(m.note={text:A.body}),y.children.push(m),a.push(m),c.push(A.level)}for(const A of s)I(A);if(s.length>0&&s[0].level===1){const A=i.children[0];A&&(i.text=A.text,i.id=A.id,A.image&&(i.image={...A.image}),A.link&&(i.link={url:A.link.url}),A.note&&(i.note={text:A.note.text}),i.children=A.children)}return i}function Ln(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
6
6
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
7
7
  `),t.image&&(n+=`![image](${t.image.src})
8
8
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
9
- `);for(const i of t.children)n+=Ln(i,o+1);return n}function Ja(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const x=o[i],C=x.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[x];for(i++;i<o.length;){const q=o[i].match(c);if(q&&q[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const G=P.slice(1,-1).join(`
9
+ `);for(const i of t.children)n+=Ln(i,o+1);return n}function es(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const x=o[i],C=x.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[x];for(i++;i<o.length;){const Y=o[i].match(c);if(Y&&Y[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const G=P.slice(1,-1).join(`
10
10
  `).trim();n.push({kind:"code",text:((p=G.split(`
11
11
  `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:P.join(`
12
12
  `),lang:m});continue}const $=x.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:x}),i++;continue}if(/^\s*\|/.test(x)){const k=[];let m=i,P=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),s.test(o[m])&&(P=!0),m++;if(P&&k.length>=2){n.push({kind:"table",text:((h=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:k.join(`
13
- `)}),i=m;continue}}const R=x.match(u),F=x.match(d);if(R||F){let k=i;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const G=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();G.length>0&&n.push({kind:"list",text:G.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(x.trim()===""){i++;continue}const O=[x];let A=i+1;for(;A<o.length;){const k=o[A];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;O.push(k),A++}const y=O.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:O.join(`
14
- `)}),i=A}return n}function Qa(t,o="导入的导图"){const n=Ja(t||""),i={id:Yt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const x={id:Yt(),text:d.text,children:[]};a[a.length-1].children.push(x),a.push(x),c.push(h);return}const p={id:Yt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)u(d);return i}function es(t){return t.richContent?t.richContent.raw+`
15
- `:""}function ts(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),x=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(J){R=J}function O(J){J.preventDefault();const me=t.getContainer();if(!me)return;const ae=-J.deltaY*.001,ke=Math.min(n,Math.max(o,a.value*(1+ae))),b=me.getBoundingClientRect(),V=J.clientX-b.left,W=J.clientY-b.top,ee=(V-c.value)/a.value,ge=(W-s.value)/a.value;a.value=ke,c.value=V-ee*ke,s.value=W-ge*ke}function A(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(J){var ae;J.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=J.clientX,p.y=J.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ae=J.preventDefault)==null||ae.call(J))}function m(J){if(!u.value)return;const me=J.clientX-p.x,ae=J.clientY-p.y;(Math.abs(me)>3||Math.abs(ae)>3)&&(d.value=!0),c.value=p.ox+me,s.value=p.oy+ae}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function G(J,me,ae){h.value=!0,x.x=J,x.y=me,C.x=J,C.y=me,C.width=0,C.height=0,C.shiftKey=!!(ae!=null&&ae.shift),$.value++,window.addEventListener("mousemove",ie),window.addEventListener("mouseup",w)}function q(J,me){if(!h.value)return;const ae=Math.min(x.x,J),ke=Math.min(x.y,me),b=Math.max(x.x,J),V=Math.max(x.y,me);C.x=ae,C.y=ke,C.width=b-ae,C.height=V-ke,$.value++}function w(){h.value=!1,window.removeEventListener("mousemove",ie),window.removeEventListener("mouseup",w),R&&R()}function ie(J){if(!h.value)return;const me=t.getContainer();if(!me)return;const ae=me.getBoundingClientRect(),ke=(J.clientX-ae.left-c.value)/a.value,b=(J.clientY-ae.top-s.value)/a.value;q(ke,b)}function fe(J,me,ae,ke=60){const b=t.getContainer();if(!b)return;const V=b.getBoundingClientRect(),W=(V.width-ke*2)/J,ee=(V.height-ke*2)/me,ge=Math.min(1,Math.max(.3,Math.min(W,ee)));a.value=ge,c.value=V.width/2,s.value=V.height/2-ae*ge}function ce(J,me,ae,ke,b=80){const V=t.getContainer();if(!V)return;const W=V.getBoundingClientRect();let ee=a.value;(ae*ee<40||ke*ee<40)&&(ee=Math.min(n,Math.max(1,60/Math.min(ae,ke)))),a.value=ee,c.value=W.width/2-J*ee,s.value=W.height/2-me*ee}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:O,zoomIn:A,zoomOut:y,startPan:k,startMarquee:G,updateMarquee:q,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:fe,centerOn:ce}}const ns=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function wr(t){return ns?t.metaKey:t.ctrlKey}function os(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(wr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(wr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function is(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const rs={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ls={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=rs[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function as(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ss={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:as(t)}))},cs={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},gi=[ls,ss,cs,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of gi)for(const o of t.markers)Io[o.id]=o;function ds(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Nr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function bi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const us={key:5,class:"zm-marker-picker"},fs={class:"zm-marker-group-label"},ms={class:"zm-marker-grid"},ps=["title","onClick","innerHTML"],hs=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},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,q=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;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+q>m.bottom&&(k=Math.max(m.top+4,n.y-q-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function x(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function F(y){y.key==="Escape"&&i("close")}function O(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",O,!0),window.addEventListener("scroll",O,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",O,!0),window.removeEventListener("scroll",O,!0)});function A(y){y(),i("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>A(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{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:k[3]||(k[3]=e.withModifiers(m=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>A(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=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:k[5]||(k[5]=e.withModifiers(m=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>A(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=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:k[7]||(k[7]=e.withModifiers(m=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>A(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(x,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(gi),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",fs,e.toDisplayString(m.label),1),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(G=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(P.id)+"</svg>"},null,10,ps))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),gs=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),A<k.left+2&&(A=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:A,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const y=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,G=4+3*28;let q=y.right;q+P>k-4&&(q=Math.max(4,y.left-P));let w=y.top-4;return w+G>m-4&&(w=Math.max(4,m-G-4)),{left:q+"px",top:w+"px",display:"block"}});let p=null,h=null;function x(A){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=A},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(A){const y=A.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function O(A){A(),i("close")}return(A,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>O(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=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":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>x("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[17]=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)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>x("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>O(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>O(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>O(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>O(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>x("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[22]=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)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>x("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>O(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>O(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),bs=["aria-hidden"],ks=["aria-hidden"],ys={key:0,class:"zm-drawer-header"},Es={key:0,class:"zm-drawer-title"},xs={class:"zm-drawer-body"},ws=["aria-hidden"],Ns={key:0,class:"zm-drawer-header"},Ss={key:0,class:"zm-drawer-title"},Ts={class:"zm-drawer-body"},Ot=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,bs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",ys,[t.title?(e.openBlock(),e.createElementBlock("h3",Es,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[e.renderSlot(c.$slots,"default")])],14,ks)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ns,[t.title?(e.openBlock(),e.createElementBlock("h3",Ss,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ts,[e.renderSlot(c.$slots,"default")])],14,ws)):e.createCommentVNode("",!0)]),_:3}))}}),Cs={class:"zm-outline-root"},Ms={class:"zm-outline-search"},As={key:0,class:"zm-outline-search-count"},_s={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Rs={class:"zm-outline-actions"},Bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Is={key:1,d:"M5 12 L10 17 L19 7"},zs={class:"zm-outline"},Os=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Ls=["title","onClick"],Ds={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Vs={key:0,points:"6 9 12 15 18 9"},$s={key:1,points:"9 6 15 12 9 18"},Ps={key:1,class:"zm-outline-dot"},Fs={key:2,class:"zm-outline-index"},Us={key:4,class:"zm-outline-text"},Hs=["onClick"],Ws=["src"],Gs=["onClick"],js=["src"],Ks=["title","onClick"],Ys={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Xs={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const N=a.value.trim().toLowerCase();if(!N)return new Set;const U=new Set,H=oe=>{var Ee;(oe.text.toLowerCase().includes(N)||(Ee=oe.note)!=null&&Ee.text&&oe.note.text.toLowerCase().includes(N))&&U.add(oe.id);for(const et of oe.children)H(et)};return H(n.data),U}),d=e.computed(()=>{if(u.value.size===0)return new Set;const N=new Set,U=H=>{let oe=u.value.has(H.id);for(const Ee of H.children)U(Ee)&&(oe=!0);return oe&&N.add(H.id),oe};return U(n.data),N}),p=e.computed(()=>{const N=[],U=H=>{u.value.has(H.id)&&N.push(H.id);for(const oe of H.children)U(oe)};return U(n.data),N}),h=e.computed(()=>a.value.trim().length>0),x=e.computed(()=>{const N=[],U=d.value,H=(oe,Ee,et)=>{if(h.value&&!U.has(oe.id))return;const ut=oe.children.length>0,tt=h.value?!1:n.collapsedIds.has(oe.id);N.push({id:oe.id,text:oe.text||"(无标题)",depth:Ee,siblingIndex:et,hasChildren:ut,collapsed:tt,node:oe}),ut&&!tt&&oe.children.forEach((nn,nt)=>H(nn,Ee+1,nt))};return H(n.data,0,0),N});function C(){s.value=p.value.length>0?0:-1}function $(){const N=p.value;N.length!==0&&(s.value=(s.value+1)%N.length,O(s.value))}function R(){const N=p.value;N.length!==0&&(s.value=(s.value-1+N.length)%N.length,O(s.value))}function F(N){N.key==="Enter"?(N.preventDefault(),N.shiftKey?R():$()):N.key==="Escape"&&(N.preventDefault(),a.value="",s.value=-1)}function O(N){const U=p.value[N];if(!U)return;const H=x.value.find(oe=>oe.id===U);H&&i("select",H.node),e.nextTick(()=>{const oe=document.querySelector(`[data-outline-id="${U}"]`);oe==null||oe.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var N;return(N=c.value)==null?void 0:N.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(N){n.readonly||(y.value=N.id,k.value=N.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function G(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),q())}function q(){y.value=null,k.value="",m=null}function w(N){N.key==="Enter"?(N.preventDefault(),G()):N.key==="Escape"&&(N.preventDefault(),q())}e.onBeforeUnmount(q);const ie=e.ref(null),fe=e.ref(null),ce=e.ref(null);function J(N,U){if(n.readonly){N.preventDefault();return}ie.value={id:U.id,text:U.text},N.dataTransfer&&(N.dataTransfer.effectAllowed="move",N.dataTransfer.setData("text/plain",U.id))}function me(){ie.value=null,fe.value=null,ce.value=null}function ae(N,U){if(!ie.value)return;N.preventDefault(),N.dataTransfer&&(N.dataTransfer.dropEffect="move");const H=V(N);fe.value=U.id,ce.value=H}function ke(N){fe.value===N.id&&(fe.value=null,ce.value=null)}function b(N,U){N.preventDefault();const H=ie.value;if(!H)return;const oe=V(N);H.id!==U.id&&i("move",{srcId:H.id,targetId:U.id,position:oe}),me()}function V(N,U){const oe=N.currentTarget.getBoundingClientRect(),Ee=N.clientY-oe.top,et=oe.height;return Ee<et*.3?"before":Ee>et*.7?"after":"child"}const W=e.ref(null);let ee=null;async function ge(N){try{return await navigator.clipboard.writeText(N),!0}catch{const U=document.createElement("textarea");U.value=N,document.body.appendChild(U),U.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(U)}return H}}async function D(N,U,H){N.stopPropagation(),await ge(U)&&(W.value=H,ee&&clearTimeout(ee),ee=setTimeout(()=>W.value=null,1200))}const z=e.computed(()=>{const N=[],U=(H,oe)=>{const Ee=" ".repeat(oe),et=oe===0?"":"- ";N.push(Ee+et+(H.text||""));for(const ut of H.children)U(ut,oe+1)};return U(n.data,0),N.join(`
16
- `)}),le=e.ref(!1);let be=null;async function I(){await ge(z.value)&&(le.value=!0,be&&clearTimeout(be),be=setTimeout(()=>le.value=!1,1200))}return(N,U)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.createElementVNode("div",Ms,[U[3]||(U[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":U[0]||(U[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",_s,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":le.value}]),title:"复制完整大纲为纯文本",onClick:I},[(e.openBlock(),e.createElementBlock("svg",Bs,[le.value?(e.openBlock(),e.createElementBlock("path",Is)):(e.openBlock(),e.createElementBlock("rect",vs)),U[4]||(U[4]=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(le.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":y.value===H.id,"is-search-hit":u.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":fe.value===H.id&&ce.value==="before","is-drag-over-after":fe.value===H.id&&ce.value==="after","is-drag-over-child":fe.value===H.id&&ce.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:oe=>i("select",H.node),onDblclick:oe=>P(H),onDragstart:oe=>J(oe,H),onDragend:me,onDragover:oe=>ae(oe,H),onDragleave:()=>ke(H),onDrop:oe=>b(oe,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(oe=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ds,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",$s)):(e.openBlock(),e.createElementBlock("polyline",Vs))]))],8,Ls)):(e.openBlock(),e.createElementBlock("span",Ps)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Fs,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":U[1]||(U[1]=oe=>k.value=oe),class:"zm-outline-input",onBlur:G,onKeydown:w,onClick:U[2]||(U[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Us,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(oe=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ws)],8,Hs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(oe=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,js)],8,Gs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":W.value===H.id}]),title:W.value===H.id?"已复制":"复制节点文本",onClick:oe=>D(oe,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Ys,[W.value!==H.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Xs)),U[5]||(U[5]=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,Ks)],46,Os))),128))])]))}}),Zs={key:0,class:"zm-jtv-root"},Js={key:0,class:"zm-jtv-key"},Qs={key:1,class:"zm-jtv-colon"},ec={key:2,class:"zm-jtv-key zm-jtv-bracket"},tc={key:3,class:"zm-jtv-size"},nc={key:4,class:"zm-jtv-bracket"},oc={key:5,class:"zm-jtv-brace"},ic={key:0,class:"zm-jtv-children"},rc={class:"zm-jtv-key"},lc={key:0,class:"zm-jtv-key"},ac=["src","alt"],sc=["href"],cc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):i.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function x(y){return u.value===""?y:`${u.value}.${y}`}function C(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function F(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function O(y){if(typeof y!="string")return!1;const k=y.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function A(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,G,q,w,ie,fe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ce.key,ce.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Js,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Qs,":")),a.value?(e.openBlock(),e.createElementBlock("span",ec,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",nc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",oc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ce.key,ce.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",rc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("span",null,e.toDisplayString((P=A(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((G=A(t.keyName))==null?void 0:G.match),1),e.createElementVNode("span",null,e.toDisplayString((q=A(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((w=A(F(t.value)))==null?void 0:w.before),1),e.createElementVNode("mark",null,e.toDisplayString((ie=A(F(t.value)))==null?void 0:ie.match),1),e.createElementVNode("span",null,e.toDisplayString((fe=A(F(t.value)))==null?void 0:fe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),O(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,ac),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,sc)])):e.createCommentVNode("",!0)],4))}}}),dc={class:"zm-data-panel"},uc={class:"zm-data-header"},fc={class:"zm-data-title"},mc={class:"zm-data-title-meta"},pc={class:"zm-data-toolbar"},hc=["title"],gc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},bc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},kc={key:0,class:"zm-data-paste"},yc={class:"zm-data-tabs"},Ec=["placeholder"],xc={key:0,class:"zm-data-error"},wc={class:"zm-data-paste-actions"},Nc=["disabled"],Sc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),x=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const O=e.computed(()=>F(n.data)),A=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var G;const m=(G=k.files)==null?void 0:G[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",mc,e.toDisplayString(O.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",gc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),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.openBlock(),e.createElementBlock("svg",bc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,hc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:y},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":x.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=P=>x.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,x.value]]),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>x.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ec),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Nc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createVNode(cc,{value:t.data,query:x.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Tc={class:"zm-md-panel"},Cc={key:0,class:"zm-md-error"},Mc={class:"zm-md-split"},Ac={class:"zm-md-edit"},_c={class:"zm-md-preview"},Rc={class:"zm-md-preview-body"},Bc={class:"zm-md-footer"},vc=["disabled"],Ic=`# flow-mindmap 思维导图
13
+ `)}),i=m;continue}}const R=x.match(u),F=x.match(d);if(R||F){let k=i;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const G=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();G.length>0&&n.push({kind:"list",text:G.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(x.trim()===""){i++;continue}const I=[x];let A=i+1;for(;A<o.length;){const k=o[A];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),A++}const y=I.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:I.join(`
14
+ `)}),i=A}return n}function ts(t,o="导入的导图"){const n=es(t||""),i={id:Kt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const x={id:Kt(),text:d.text,children:[]};a[a.length-1].children.push(x),a.push(x),c.push(h);return}const p={id:Kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)u(d);return i}function ns(t){return t.richContent?t.richContent.raw+`
15
+ `:""}function os(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),x=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(ee){R=ee}function I(ee){ee.preventDefault();const ce=t.getContainer();if(!ce)return;const ue=-ee.deltaY*.001,g=Math.min(n,Math.max(o,a.value*(1+ue))),V=ce.getBoundingClientRect(),W=ee.clientX-V.left,te=ee.clientY-V.top,fe=(W-c.value)/a.value,L=(te-s.value)/a.value;a.value=g,c.value=W-fe*g,s.value=te-L*g}function A(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(ee){var ue;ee.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=ee.clientX,p.y=ee.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ue=ee.preventDefault)==null||ue.call(ee))}function m(ee){if(!u.value)return;const ce=ee.clientX-p.x,ue=ee.clientY-p.y;(Math.abs(ce)>3||Math.abs(ue)>3)&&(d.value=!0),c.value=p.ox+ce,s.value=p.oy+ue}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function G(ee,ce,ue){h.value=!0,x.x=ee,x.y=ce,C.x=ee,C.y=ce,C.width=0,C.height=0,C.shiftKey=!!(ue!=null&&ue.shift),$.value++,window.addEventListener("mousemove",re),window.addEventListener("mouseup",N)}function Y(ee,ce){if(!h.value)return;const ue=Math.min(x.x,ee),g=Math.min(x.y,ce),V=Math.max(x.x,ee),W=Math.max(x.y,ce);C.x=ue,C.y=g,C.width=V-ue,C.height=W-g,$.value++}function N(){h.value=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",N),R&&R()}function re(ee){if(!h.value)return;const ce=t.getContainer();if(!ce)return;const ue=ce.getBoundingClientRect(),g=(ee.clientX-ue.left-c.value)/a.value,V=(ee.clientY-ue.top-s.value)/a.value;Y(g,V)}function pe(ee,ce,ue,g=60){const V=t.getContainer();if(!V)return;const W=V.getBoundingClientRect(),te=(W.width-g*2)/ee,fe=(W.height-g*2)/ce,L=Math.min(1,Math.max(.3,Math.min(te,fe)));a.value=L,c.value=W.width/2,s.value=W.height/2-ue*L}function de(){const ee=t.getContainer();if(!ee)return;const ce=ee.getBoundingClientRect(),ue=ce.width/2,g=ce.height/2,V=(ue-c.value)/a.value,W=(g-s.value)/a.value;a.value=1,c.value=ue-V,s.value=g-W}function xe(ee,ce,ue,g,V=80){const W=t.getContainer();if(!W)return;const te=W.getBoundingClientRect();let fe=a.value;(ue*fe<40||g*fe<40)&&(fe=Math.min(n,Math.max(1,60/Math.min(ue,g)))),a.value=fe,c.value=te.width/2-ee*fe,s.value=te.height/2-ce*fe}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:I,zoomIn:A,zoomOut:y,zoomTo100:de,startPan:k,startMarquee:G,updateMarquee:Y,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:pe,centerOn:xe}}const is=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Sr(t){return is?t.metaKey:t.ctrlKey}function rs(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Sr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(Sr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ls(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const as={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ss={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=as[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function cs(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ds={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:cs(t)}))},us={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ki=[ss,ds,us,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of ki)for(const o of t.markers)Io[o.id]=o;function fs(t){return Io[t]}function Oo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Tr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function yi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const ms={key:5,class:"zm-marker-picker"},ps={class:"zm-marker-group-label"},hs={class:"zm-marker-grid"},gs=["title","onClick","innerHTML"],bs=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},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=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;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+Y>m.bottom&&(k=Math.max(m.top+4,n.y-Y-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function x(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function F(y){y.key==="Escape"&&i("close")}function I(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function A(y){y(),i("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>A(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{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:k[3]||(k[3]=e.withModifiers(m=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>A(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=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:k[5]||(k[5]=e.withModifiers(m=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>A(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=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:k[7]||(k[7]=e.withModifiers(m=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>A(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(x,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ki),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ps,e.toDisplayString(m.label),1),e.createElementVNode("div",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(G=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Oo)(P.id)+"</svg>"},null,10,gs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ks=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),A<k.left+2&&(A=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:A,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const y=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,G=4+3*28;let Y=y.right;Y+P>k-4&&(Y=Math.max(4,y.left-P));let N=y.top-4;return N+G>m-4&&(N=Math.max(4,m-G-4)),{left:Y+"px",top:N+"px",display:"block"}});let p=null,h=null;function x(A){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=A},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(A){const y=A.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function I(A){A(),i("close")}return(A,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>I(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=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":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>x("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[17]=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)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>x("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>I(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>I(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>I(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>I(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>x("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[22]=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)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>x("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>I(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>I(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),ys=["aria-hidden"],Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Ss=["aria-hidden"],Ts={key:0,class:"zm-drawer-header"},Cs={key:0,class:"zm-drawer-title"},Ms={class:"zm-drawer-body"},It=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,ys)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",xs,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ts,[t.title?(e.openBlock(),e.createElementBlock("h3",Cs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.renderSlot(c.$slots,"default")])],14,Ss)):e.createCommentVNode("",!0)]),_:3}))}}),As={class:"zm-outline-root"},_s={class:"zm-outline-search"},Rs={key:0,class:"zm-outline-search-count"},vs={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Bs={class:"zm-outline-actions"},zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Is={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Os={key:1,d:"M5 12 L10 17 L19 7"},Ls={class:"zm-outline"},Ds=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={key:2,class:"zm-outline-index"},Ws={key:4,class:"zm-outline-text"},Gs=["onClick"],js=["src"],Ks=["onClick"],Ys=["src"],qs=["title","onClick"],Xs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Js={key:1,d:"M5 12 L10 17 L19 7"},Lo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const S=a.value.trim().toLowerCase();if(!S)return new Set;const U=new Set,H=ne=>{var ye;(ne.text.toLowerCase().includes(S)||(ye=ne.note)!=null&&ye.text&&ne.note.text.toLowerCase().includes(S))&&U.add(ne.id);for(const Qe of ne.children)H(Qe)};return H(n.data),U}),d=e.computed(()=>{if(u.value.size===0)return new Set;const S=new Set,U=H=>{let ne=u.value.has(H.id);for(const ye of H.children)U(ye)&&(ne=!0);return ne&&S.add(H.id),ne};return U(n.data),S}),p=e.computed(()=>{const S=[],U=H=>{u.value.has(H.id)&&S.push(H.id);for(const ne of H.children)U(ne)};return U(n.data),S}),h=e.computed(()=>a.value.trim().length>0),x=e.computed(()=>{const S=[],U=d.value,H=(ne,ye,Qe)=>{if(h.value&&!U.has(ne.id))return;const ut=ne.children.length>0,et=h.value?!1:n.collapsedIds.has(ne.id);S.push({id:ne.id,text:ne.text||"(无标题)",depth:ye,siblingIndex:Qe,hasChildren:ut,collapsed:et,node:ne}),ut&&!et&&ne.children.forEach((en,tt)=>H(en,ye+1,tt))};return H(n.data,0,0),S});function C(){s.value=p.value.length>0?0:-1}function $(){const S=p.value;S.length!==0&&(s.value=(s.value+1)%S.length,I(s.value))}function R(){const S=p.value;S.length!==0&&(s.value=(s.value-1+S.length)%S.length,I(s.value))}function F(S){S.key==="Enter"?(S.preventDefault(),S.shiftKey?R():$()):S.key==="Escape"&&(S.preventDefault(),a.value="",s.value=-1)}function I(S){const U=p.value[S];if(!U)return;const H=x.value.find(ne=>ne.id===U);H&&i("select",H.node),e.nextTick(()=>{const ne=document.querySelector(`[data-outline-id="${U}"]`);ne==null||ne.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var S;return(S=c.value)==null?void 0:S.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(S){n.readonly||(y.value=S.id,k.value=S.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function G(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),Y())}function Y(){y.value=null,k.value="",m=null}function N(S){S.key==="Enter"?(S.preventDefault(),G()):S.key==="Escape"&&(S.preventDefault(),Y())}e.onBeforeUnmount(Y);const re=e.ref(null),pe=e.ref(null),de=e.ref(null);function xe(S,U){if(n.readonly){S.preventDefault();return}re.value={id:U.id,text:U.text},S.dataTransfer&&(S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",U.id))}function ee(){re.value=null,pe.value=null,de.value=null}function ce(S,U){if(!re.value)return;S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="move");const H=V(S);pe.value=U.id,de.value=H}function ue(S){pe.value===S.id&&(pe.value=null,de.value=null)}function g(S,U){S.preventDefault();const H=re.value;if(!H)return;const ne=V(S);H.id!==U.id&&i("move",{srcId:H.id,targetId:U.id,position:ne}),ee()}function V(S,U){const ne=S.currentTarget.getBoundingClientRect(),ye=S.clientY-ne.top,Qe=ne.height;return ye<Qe*.3?"before":ye>Qe*.7?"after":"child"}const W=e.ref(null);let te=null;async function fe(S){try{return await navigator.clipboard.writeText(S),!0}catch{const U=document.createElement("textarea");U.value=S,document.body.appendChild(U),U.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(U)}return H}}async function L(S,U,H){S.stopPropagation(),await fe(U)&&(W.value=H,te&&clearTimeout(te),te=setTimeout(()=>W.value=null,1200))}const O=e.computed(()=>{const S=[],U=(H,ne)=>{const ye=" ".repeat(ne),Qe=ne===0?"":"- ";S.push(ye+Qe+(H.text||""));for(const ut of H.children)U(ut,ne+1)};return U(n.data,0),S.join(`
16
+ `)}),ae=e.ref(!1);let ke=null;async function B(){await fe(O.value)&&(ae.value=!0,ke&&clearTimeout(ke),ke=setTimeout(()=>ae.value=!1,1200))}return(S,U)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",_s,[U[3]||(U[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":U[0]||(U[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Rs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",vs,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ae.value}]),title:"复制完整大纲为纯文本",onClick:B},[(e.openBlock(),e.createElementBlock("svg",zs,[ae.value?(e.openBlock(),e.createElementBlock("path",Os)):(e.openBlock(),e.createElementBlock("rect",Is)),U[4]||(U[4]=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(ae.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":y.value===H.id,"is-search-hit":u.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":pe.value===H.id&&de.value==="before","is-drag-over-after":pe.value===H.id&&de.value==="after","is-drag-over-child":pe.value===H.id&&de.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:ne=>i("select",H.node),onDblclick:ne=>P(H),onDragstart:ne=>xe(ne,H),onDragend:ee,onDragover:ne=>ce(ne,H),onDragleave:()=>ue(H),onDrop:ne=>g(ne,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(ne=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Hs,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":U[1]||(U[1]=ne=>k.value=ne),class:"zm-outline-input",onBlur:G,onKeydown:N,onClick:U[2]||(U[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(ne=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,js)],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ne=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ys)],8,Ks)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":W.value===H.id}]),title:W.value===H.id?"已复制":"复制节点文本",onClick:ne=>L(ne,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Xs,[W.value!==H.id?(e.openBlock(),e.createElementBlock("rect",Zs)):(e.openBlock(),e.createElementBlock("path",Js)),U[5]||(U[5]=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,qs)],46,Ds))),128))])]))}}),Qs={key:0,class:"zm-jtv-root"},ec={key:0,class:"zm-jtv-key"},tc={key:1,class:"zm-jtv-colon"},nc={key:2,class:"zm-jtv-key zm-jtv-bracket"},oc={key:3,class:"zm-jtv-size"},ic={key:4,class:"zm-jtv-bracket"},rc={key:5,class:"zm-jtv-brace"},lc={key:0,class:"zm-jtv-children"},ac={class:"zm-jtv-key"},sc={key:0,class:"zm-jtv-key"},cc=["src","alt"],dc=["href"],uc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):i.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function x(y){return u.value===""?y:`${u.value}.${y}`}function C(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function F(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function I(y){if(typeof y!="string")return!1;const k=y.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function A(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,G,Y,N,re,pe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:x(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ec,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",tc,":")),a.value?(e.openBlock(),e.createElementBlock("span",nc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",oc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ic,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",rc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:x(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",ac,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",sc,[e.createElementVNode("span",null,e.toDisplayString((P=A(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((G=A(t.keyName))==null?void 0:G.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=A(t.keyName))==null?void 0:Y.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((N=A(F(t.value)))==null?void 0:N.before),1),e.createElementVNode("mark",null,e.toDisplayString((re=A(F(t.value)))==null?void 0:re.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=A(F(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,cc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,dc)])):e.createCommentVNode("",!0)],4))}}}),fc={class:"zm-data-panel"},mc={class:"zm-data-header"},pc={class:"zm-data-title"},hc={class:"zm-data-title-meta"},gc={class:"zm-data-toolbar"},bc=["title"],kc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},yc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},Ec={key:0,class:"zm-data-paste"},xc={class:"zm-data-tabs"},wc=["placeholder"],Nc={key:0,class:"zm-data-error"},Sc={class:"zm-data-paste-actions"},Tc=["disabled"],Cc={class:"zm-data-tree"},Do=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),x=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const I=e.computed(()=>F(n.data)),A=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var G;const m=(G=k.files)==null?void 0:G[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",mc,[e.createElementVNode("div",pc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",hc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",gc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",kc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),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.openBlock(),e.createElementBlock("svg",yc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,bc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:y},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":x.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=P=>x.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,x.value]]),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>x.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",xc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,wc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",Nc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Tc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Cc,[e.createVNode(uc,{value:t.data,query:x.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Mc={class:"zm-md-panel"},Ac={key:0,class:"zm-md-error"},_c={class:"zm-md-split"},Rc={class:"zm-md-edit"},vc={class:"zm-md-preview"},Bc={class:"zm-md-preview-body"},zc={class:"zm-md-footer"},Ic=["disabled"],Oc=`# flow-mindmap 思维导图
17
17
 
18
18
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
19
19
 
@@ -52,23 +52,23 @@
52
52
 
53
53
  ## 开源协议
54
54
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
55
- `,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(Ln(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const O=On(a.value||"");return c.value=null,O}catch(O){return c.value=O.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>It(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var O;return(O=s.value)==null?void 0:O.resetView()},250)});function h(){try{const O=On(a.value||"");c.value=null,i("import",O)}catch(O){c.value=O.message}}function x(){a.value=Ln(n.data),c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}function $(){const O=document.createElement("input");O.type="file",O.accept=".md,text/markdown,text/plain",O.onchange=()=>{var k;const A=(k=O.files)==null?void 0:k[0];if(!A)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&(a.value=y.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},y.readAsText(A)},O.click()}function R(){const O=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),A=URL.createObjectURL(O),y=document.createElement("a");y.href=A;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(A)}function F(){a.value=Ic,c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}return(O,A)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...A[1]||(A[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:R},[...A[2]||(A[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),A[3]||(A[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:x},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Mc,[e.createElementVNode("div",Ac,[A[4]||(A[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[0]||(A[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",_c,[A[5]||(A[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Rc,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Bc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,vc)])]))}}),zc={class:"zm-settings-panel"},Oc={class:"zm-settings-section"},Lc={class:"zm-settings-field"},Dc={class:"zm-settings-control"},Vc={class:"zm-color-input-wrap"},$c=["value"],Pc={class:"zm-color-input-text"},Fc={class:"zm-swatch-row zm-swatch-row--compact"},Uc=["title","onClick"],Hc={class:"zm-settings-field"},Wc=["value"],Gc={class:"zm-slider"},jc=["value"],Kc={class:"zm-settings-field"},Yc=["value"],qc={class:"zm-slider"},Xc=["value"],Zc={class:"zm-settings-field zm-line-style-field"},Jc={class:"zm-line-style-group"},Qc=["title","onClick"],ed=["viewBox"],td={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},nd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},od={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},id={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},rd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ld={class:"zm-line-style-label"},ad={class:"zm-settings-field zm-line-style-field"},sd={class:"zm-line-style-group"},cd=["title","onClick"],dd=["viewBox"],ud={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},fd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},md={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},pd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},gd={class:"zm-line-style-label"},bd={key:0,class:"zm-settings-field"},kd={class:"zm-settings-label"},yd={class:"zm-settings-sub"},Ed=["value"],xd={key:1,class:"zm-slider"},wd=["value"],Nd={class:"zm-settings-field zm-line-style-field"},Sd={class:"zm-line-style-group"},Td=["title","onClick"],Cd={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Md={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Ad={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},_d={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},Rd={class:"zm-line-style-label"},Bd={class:"zm-settings-field"},vd={key:2,class:"zm-palette-picker"},Id={class:"zm-palette-list"},zd=["onClick"],Od={class:"zm-palette-option-name"},Ld={class:"zm-palette-option-swatches"},Dd={key:0,class:"zm-palette-custom-editor"},Vd=["value"],$d={class:"zm-palette-custom-actions"},Pd={class:"zm-settings-field"},Fd={key:3,class:"zm-settings-field"},Ud={class:"zm-settings-label"},Hd={class:"zm-settings-sub"},Wd=["value"],Gd={key:4,class:"zm-slider"},jd=["value"],Kd={class:"zm-settings-field"},Yd={class:"zm-settings-preview"},qd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Xd=["x1","y1","x2","y2","stroke","stroke-width"],Zd={key:0,class:"zm-settings-section"},Jd={class:"zm-settings-section-title"},Qd={key:0,class:"zm-settings-section-sub"},eu={class:"zm-settings-field"},tu={class:"zm-settings-value-tag"},nu={class:"zm-swatch-row"},ou=["title","onClick"],iu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},ru=["value"],lu={class:"zm-settings-field"},au={class:"zm-settings-value-tag"},su={class:"zm-swatch-row"},cu=["title","onClick"],du={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},uu=["value"],fu={class:"zm-settings-field"},mu=["value"],pu=["value"],hu={class:"zm-settings-field"},gu=["value"],bu={class:"zm-slider"},ku=["value"],yu={class:"zm-settings-section zm-settings-section--actions"},Vo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(q,w){i("update:settings",{[q]:w})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function p(q){i("update:nodeStyle",q)}const h=e.computed(()=>[...dn,...n.settings.customPalettes]),x=e.reactive({});function C(q){return x[q.id]===void 0&&(x[q.id]=q.colors.join(`
56
- `)),x[q.id]}function $(q){const w=x[q.id]??"",ie=Ga(w);if(ie.length===0){x[q.id]=q.colors.join(`
57
- `);return}const fe=n.settings.customPalettes.map(ce=>ce.id===q.id?{...ce,colors:ie}:ce);i("update:settings",{customPalettes:fe})}function R(){const q=h.value.find(J=>J.id===n.settings.branchPaletteId),w=q?[...q.colors]:[...dn[0].colors],ie="custom-";let fe=ie+(n.settings.customPalettes.length+1);for(;dn.some(J=>J.id===fe)||n.settings.customPalettes.some(J=>J.id===fe);)fe=ie+Math.random().toString(36).slice(2,7);const ce={id:fe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:w};i("update:settings",{customPalettes:[...n.settings.customPalettes,ce],branchPaletteId:fe}),x[fe]=w.join(`
58
- `)}function F(q){const w=n.settings.customPalettes.filter(fe=>fe.id!==q.id),ie=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:w,...ie!==n.settings.branchPaletteId?{branchPaletteId:ie}:{}}),delete x[q.id]}const O=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(q,w,ie,fe){if(w<=1)return ie;const ce=q/(w-1);return ie+(fe-ie)*ce}function P(q,w,ie,fe){const ce=w*Math.pow(fe,q);return Math.max(ie,ce)}const G=e.computed(()=>{const q=n.settings.lineWidthStart,w=n.settings.lineWidthEnd,ie=n.settings.taperedEdge,fe=y.length,ce=8,J=192,me=h.value.find(ke=>ke.id===n.settings.branchPaletteId),ae=me&&me.colors.length?me.colors:k;return y.map((ke,b)=>{const V=10+b*60/(fe-1);return{x1:ce,y1:V,x2:J,y2:V,w:ie?P(ke,q,w,n.settings.lineWidthTaper):m(ke,fe,q,w),color:n.settings.rainbowBranch?ae[b%ae.length]:"#94a3b8"}})});return(q,w)=>{var ie,fe,ce,J,me,ae,ke;return e.openBlock(),e.createElementBlock("div",zc,[e.createElementVNode("section",Oc,[w[45]||(w[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Lc,[w[24]||(w[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Dc,[e.createElementVNode("label",Vc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:w[0]||(w[0]=b=>a("canvasBg",b.target.value))},null,40,$c),e.createElementVNode("span",Pc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Fc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,b=>e.createElementVNode("button",{key:"cbg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:V=>a("canvasBg",b)},null,14,Uc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:w[1]||(w[1]=b=>a("canvasBg",void 0))},"∅")]),w[46]||(w[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hc,[w[25]||(w[25]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:w[2]||(w[2]=b=>a("lineWidthStart",parseFloat(b.target.value)||0))},null,40,Wc)]),e.createElementVNode("div",Gc,[w[26]||(w[26]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:w[3]||(w[3]=b=>a("lineWidthStart",parseFloat(b.target.value)))},null,40,jc)]),e.createElementVNode("div",Kc,[w[27]||(w[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:w[4]||(w[4]=b=>a("lineWidthEnd",parseFloat(b.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",qc,[w[28]||(w[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:w[5]||(w[5]=b=>a("lineWidthEnd",parseFloat(b.target.value)))},null,40,Xc)]),w[47]||(w[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Zc,[w[29]||(w[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===b.value}]),title:b.label,onClick:V=>a("rootLineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",td)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",nd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",od)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",id)):(e.openBlock(),e.createElementBlock("line",rd))],8,ed)),e.createElementVNode("span",ld,e.toDisplayString(b.label),1)],10,Qc))),128))])]),e.createElementVNode("div",ad,[w[30]||(w[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===b.value}]),title:b.label,onClick:V=>a("lineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",ud)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",fd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",md)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",pd)):(e.openBlock(),e.createElementBlock("line",hd))],8,dd)),e.createElementVNode("span",gd,e.toDisplayString(b.label),1)],10,cd)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("span",kd,[w[31]||(w[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"20",value:t.settings.elbowRadius,onChange:w[6]||(w[6]=b=>a("elbowRadius",parseFloat(b.target.value)||8))},null,40,Ed)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",xd,[w[32]||(w[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"20",step:"1",value:t.settings.elbowRadius,onInput:w[7]||(w[7]=b=>a("elbowRadius",parseFloat(b.target.value)))},null,40,wd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nd,[w[34]||(w[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===b.value}]),title:b.label,onClick:V=>a("lineOrigin",b.value)},[(e.openBlock(),e.createElementBlock("svg",Cd,[w[33]||(w[33]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),b.value==="edge"?(e.openBlock(),e.createElementBlock("path",Md)):b.value==="center"?(e.openBlock(),e.createElementBlock("path",Ad)):(e.openBlock(),e.createElementBlock("path",_d))])),e.createElementVNode("span",Rd,e.toDisplayString(b.label),1)],10,Td)),64))])]),e.createElementVNode("div",Bd,[w[36]||(w[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:w[8]||(w[8]=b=>a("rainbowBranch",!t.settings.rainbowBranch))},[...w[35]||(w[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",vd,[w[37]||(w[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("button",{key:b.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===b.id}]),onClick:V=>a("branchPaletteId",b.id)},[e.createElementVNode("span",Od,e.toDisplayString(b.name),1),e.createElementVNode("span",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.colors,(V,W)=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,zd))),128))]),t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)),onInput:w[9]||(w[9]=b=>x[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=b.target.value)},null,40,Vd),e.createElementVNode("div",$d,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:w[10]||(w[10]=b=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:w[11]||(w[11]=b=>F(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),w[48]||(w[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Pd,[w[39]||(w[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:w[12]||(w[12]=b=>a("taperedEdge",!t.settings.taperedEdge))},[...w[38]||(w[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("span",Ud,[w[40]||(w[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Hd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:w[13]||(w[13]=b=>a("lineWidthTaper",parseFloat(b.target.value)||.67))},null,40,Wd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Gd,[w[41]||(w[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:w[14]||(w[14]=b=>a("lineWidthTaper",parseFloat(b.target.value)))},null,40,jd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Kd,[w[43]||(w[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:w[15]||(w[15]=b=>a("showOrderBadge",!t.settings.showOrderBadge))},[...w[42]||(w[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Yd,[(e.openBlock(),e.createElementBlock("svg",qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(b,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,stroke:t.settings.rainbowBranch?b.color:"#94a3b8","stroke-width":b.w,"stroke-linecap":"butt"},null,8,Xd))),128))])),w[44]||(w[44]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Zd,[e.createElementVNode("h4",Jd,[w[49]||(w[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Qd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",eu,[w[50]||(w[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",tu,e.toDisplayString(((ie=t.nodeStyle)==null?void 0:ie.bg)||"默认"),1)]),e.createElementVNode("div",nu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"bg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({bg:b})},null,14,ou)}),64)),e.createElementVNode("label",iu,[e.createElementVNode("input",{type:"color",value:((fe=t.nodeStyle)==null?void 0:fe.bg)||"#ffffff",onInput:w[16]||(w[16]=b=>p({bg:b.target.value}))},null,40,ru)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[17]||(w[17]=b=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",lu,[w[51]||(w[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",au,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",su,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"fg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({textColor:b})},null,14,cu)}),64)),e.createElementVNode("label",du,[e.createElementVNode("input",{type:"color",value:((J=t.nodeStyle)==null?void 0:J.textColor)||"#1e2937",onInput:w[18]||(w[18]=b=>p({textColor:b.target.value}))},null,40,uu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[19]||(w[19]=b=>p({textColor:void 0}))},"∅")]),w[55]||(w[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",fu,[w[52]||(w[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((me=t.nodeStyle)==null?void 0:me.fontWeight)??400,onChange:w[20]||(w[20]=b=>p({fontWeight:parseInt(b.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,b=>e.createElementVNode("option",{key:b.value,value:b.value},e.toDisplayString(b.label),9,pu)),64))],40,mu)]),e.createElementVNode("div",hu,[w[53]||(w[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ae=t.nodeStyle)==null?void 0:ae.fontSize)??14,onChange:w[21]||(w[21]=b=>p({fontSize:parseInt(b.target.value)||14}))},null,40,gu)]),e.createElementVNode("div",bu,[w[54]||(w[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ke=t.nodeStyle)==null?void 0:ke.fontSize)??14,onInput:w[22]||(w[22]=b=>p({fontSize:parseInt(b.target.value)}))},null,40,ku)]),w[56]||(w[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",yu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:w[23]||(w[23]=b=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-f1937c03"]]),Sr=20;function Eu(t,o){t.style.height="auto";const n=o.minRows*Sr,i=o.maxRows>0?o.maxRows*Sr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function ki(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Eu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tr(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(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Tr(n)}),t}class Cr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function un(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const wu="</span>",Ar=t=>!!t.scope,Nu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Su{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Mr(o)}openNode(o){if(!Ar(o))return;const n=Nu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ar(o)&&(this.buffer+=wu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const _r=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class yi{constructor(){this.rootNode=_r(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=_r({scope:o});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(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{yi._collapse(n)}))}}class Tu extends yi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Su(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Rr(t){return En("(?=",t,")")}function Cu(t){return En("(?:",t,")*")}function Mu(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function Au(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function Ei(...t){return"("+(Au(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Br(t){return new RegExp(t.toString()+"|").exec("").length-1}function _u(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Ru=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xi(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Ru.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const Bu=/\b\B/,vr="[a-zA-Z]\\w*",wi="[a-zA-Z_]\\w*",Ir="\\b\\d+(\\.\\d+)?",zr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Or="\\b(0b[01]+)",vu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Iu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},zu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},Ou={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Lu={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/},$o=function(t,o,n={}){const i=un({scope:"comment",begin:t,end:o,contains:[]},n);i.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 a=Ei("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 i.contains.push({begin:En(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Du=$o("//","$"),Vu=$o("/\\*","\\*/"),$u=$o("#","$"),Pu={scope:"number",begin:Ir,relevance:0},Fu={scope:"number",begin:zr,relevance:0},Uu={scope:"number",begin:Or,relevance:0},Hu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Wu={scope:"title",begin:vr,relevance:0},Gu={scope:"title",begin:wi,relevance:0},ju={begin:"\\.\\s*"+wi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:zu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Uu,BINARY_NUMBER_RE:Or,COMMENT:$o,C_BLOCK_COMMENT_MODE:Vu,C_LINE_COMMENT_MODE:Du,C_NUMBER_MODE:Fu,C_NUMBER_RE:zr,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:$u,IDENT_RE:vr,MATCH_NOTHING_RE:Bu,METHOD_GUARD:ju,NUMBER_MODE:Pu,NUMBER_RE:Ir,PHRASAL_WORDS_MODE:Lu,QUOTE_STRING_MODE:Ou,REGEXP_MODE:Hu,RE_STARTERS_RE:vu,SHEBANG:Iu,TITLE_MODE:Wu,UNDERSCORE_IDENT_RE:wi,UNDERSCORE_TITLE_MODE:Gu});function Ku(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Yu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function qu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ku,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Xu(t,o){Array.isArray(t.illegal)&&(t.illegal=Ei(...t.illegal))}function Zu(t,o){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 Ju(t,o){t.relevance===void 0&&(t.relevance=1)}const Qu=(t,o)=>{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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=En(n.beforeMatch,Rr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ef=["of","and","for","in","not","or","if","then","parent","list","value"],tf="keyword";function Lr(t,o,n=tf){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Lr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,nf(d[0],d[1])]})}}function nf(t,o){return o?Number(o):of(t)?0:1}function of(t){return ef.includes(t.toLowerCase())}const Dr={},xn=t=>{console.error(t)},Vr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Dn=(t,o)=>{Dr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Dr[`${t}/${o}`]=!0)},Fo=new Error;function $r(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=Br(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function rf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw xn("beginScope must be object"),Fo;$r(t,t.begin,{key:"beginScope"}),t.begin=xi(t.begin,{joinWith:""})}}function lf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw xn("endScope must be object"),Fo;$r(t,t.end,{key:"endScope"}),t.end=xi(t.end,{joinWith:""})}}function af(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function sf(t){af(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),rf(t),lf(t)}function cf(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Br(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(xi(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((x,C)=>C>0&&x!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Yu,Zu,sf,Qu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[qu,Xu,Ju].forEach(h=>h(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Lr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return df(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(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=un(t.classNameAliases||{}),c(t)}function Pr(t){return t?t.endsWithParent||Pr(t.starts):!1}function df(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Pr(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var uf="11.11.1";class ff extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ni=Mr,Fr=un,Ur=Symbol("nomatch"),mf=7,Hr=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Tu};function d(b){return u.noHighlightRe.test(b)}function p(b){let V=b.className+" ";V+=b.parentNode?b.parentNode.className:"";const W=u.languageDetectRe.exec(V);if(W){const ee=w(W[1]);return ee||(Vr(c.replace("{}",W[1])),Vr("Falling back to no-highlight mode for this block.",b)),ee?W[1]:"no-highlight"}return V.split(/\s+/).find(ee=>d(ee)||w(ee))}function h(b,V,W){let ee="",ge="";typeof V=="object"?(ee=b,W=V.ignoreIllegals,ge=V.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
59
- https://github.com/highlightjs/highlight.js/issues/2277`),ge=b,ee=V),W===void 0&&(W=!0);const D={code:ee,language:ge};ae("before:highlight",D);const z=D.result?D.result:x(D.language,D.code,W);return z.code=D.code,ae("after:highlight",z),z}function x(b,V,W,ee){const ge=Object.create(null);function D(X,re){return X.keywords[re]}function z(){if(!ue.keywords){ze.addText(Be);return}let X=0;ue.keywordPatternRe.lastIndex=0;let re=ue.keywordPatternRe.exec(Be),xe="";for(;re;){xe+=Be.substring(X,re.index);const Ae=nt.case_insensitive?re[0].toLowerCase():re[0],Ue=D(ue,Ae);if(Ue){const[it,wt]=Ue;if(ze.addText(xe),xe="",ge[Ae]=(ge[Ae]||0)+1,ge[Ae]<=mf&&(Vt+=wt),it.startsWith("_"))xe+=re[0];else{const An=nt.classNameAliases[it]||it;I(re[0],An)}}else xe+=re[0];X=ue.keywordPatternRe.lastIndex,re=ue.keywordPatternRe.exec(Be)}xe+=Be.substring(X),ze.addText(xe)}function le(){if(Be==="")return;let X=null;if(typeof ue.subLanguage=="string"){if(!o[ue.subLanguage]){ze.addText(Be);return}X=x(ue.subLanguage,Be,!0,ft[ue.subLanguage]),ft[ue.subLanguage]=X._top}else X=$(Be,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Vt+=X.relevance),ze.__addSublanguage(X._emitter,X.language)}function be(){ue.subLanguage!=null?le():z(),Be=""}function I(X,re){X!==""&&(ze.startScope(re),ze.addText(X),ze.endScope())}function N(X,re){let xe=1;const Ae=re.length-1;for(;xe<=Ae;){if(!X._emit[xe]){xe++;continue}const Ue=nt.classNameAliases[X[xe]]||X[xe],it=re[xe];Ue?I(it,Ue):(Be=it,z(),Be=""),xe++}}function U(X,re){return X.scope&&typeof X.scope=="string"&&ze.openNode(nt.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(I(Be,nt.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Be=""):X.beginScope._multi&&(N(X.beginScope,re),Be="")),ue=Object.create(X,{parent:{value:ue}}),ue}function H(X,re,xe){let Ae=_u(X.endRe,xe);if(Ae){if(X["on:end"]){const Ue=new Cr(X);X["on:end"](re,Ue),Ue.isMatchIgnored&&(Ae=!1)}if(Ae){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return H(X.parent,re,xe)}function oe(X){return ue.matcher.regexIndex===0?(Be+=X[0],1):(kt=!0,0)}function Ee(X){const re=X[0],xe=X.rule,Ae=new Cr(xe),Ue=[xe.__beforeBegin,xe["on:begin"]];for(const it of Ue)if(it&&(it(X,Ae),Ae.isMatchIgnored))return oe(re);return xe.skip?Be+=re:(xe.excludeBegin&&(Be+=re),be(),!xe.returnBegin&&!xe.excludeBegin&&(Be=re)),U(xe,X),xe.returnBegin?0:re.length}function et(X){const re=X[0],xe=V.substring(X.index),Ae=H(ue,X,xe);if(!Ae)return Ur;const Ue=ue;ue.endScope&&ue.endScope._wrap?(be(),I(re,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(be(),N(ue.endScope,X)):Ue.skip?Be+=re:(Ue.returnEnd||Ue.excludeEnd||(Be+=re),be(),Ue.excludeEnd&&(Be=re));do ue.scope&&ze.closeNode(),!ue.skip&&!ue.subLanguage&&(Vt+=ue.relevance),ue=ue.parent;while(ue!==Ae.parent);return Ae.starts&&U(Ae.starts,X),Ue.returnEnd?0:re.length}function ut(){const X=[];for(let re=ue;re!==nt;re=re.parent)re.scope&&X.unshift(re.scope);X.forEach(re=>ze.openNode(re))}let tt={};function nn(X,re){const xe=re&&re[0];if(Be+=X,xe==null)return be(),0;if(tt.type==="begin"&&re.type==="end"&&tt.index===re.index&&xe===""){if(Be+=V.slice(re.index,re.index+1),!a){const Ae=new Error(`0 width match regex (${b})`);throw Ae.languageName=b,Ae.badRule=tt.rule,Ae}return 1}if(tt=re,re.type==="begin")return Ee(re);if(re.type==="illegal"&&!W){const Ae=new Error('Illegal lexeme "'+xe+'" for mode "'+(ue.scope||"<unnamed>")+'"');throw Ae.mode=ue,Ae}else if(re.type==="end"){const Ae=et(re);if(Ae!==Ur)return Ae}if(re.type==="illegal"&&xe==="")return Be+=`
60
- `,1;if(xt>1e5&&xt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=xe,xe.length}const nt=w(b);if(!nt)throw xn(c.replace("{}",b)),new Error('Unknown language: "'+b+'"');const on=cf(nt);let Dt="",ue=ee||on;const ft={},ze=new u.__emitter(u);ut();let Be="",Vt=0,ot=0,xt=0,kt=!1;try{if(nt.__emitTokens)nt.__emitTokens(V,ze);else{for(ue.matcher.considerAll();;){xt++,kt?kt=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=ot;const X=ue.matcher.exec(V);if(!X)break;const re=V.substring(ot,X.index),xe=nn(re,X);ot=X.index+xe}nn(V.substring(ot))}return ze.finalize(),Dt=ze.toHTML(),{language:b,value:Dt,relevance:Vt,illegal:!1,_emitter:ze,_top:ue}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:b,value:Ni(V),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:ot,context:V.slice(ot-100,ot+100),mode:X.mode,resultSoFar:Dt},_emitter:ze};if(a)return{language:b,value:Ni(V),illegal:!1,relevance:0,errorRaised:X,_emitter:ze,_top:ue};throw X}}function C(b){const V={value:Ni(b),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(b),V}function $(b,V){V=V||u.languages||Object.keys(o);const W=C(b),ee=V.filter(w).filter(fe).map(be=>x(be,b,!1));ee.unshift(W);const ge=ee.sort((be,I)=>{if(be.relevance!==I.relevance)return I.relevance-be.relevance;if(be.language&&I.language){if(w(be.language).supersetOf===I.language)return 1;if(w(I.language).supersetOf===be.language)return-1}return 0}),[D,z]=ge,le=D;return le.secondBest=z,le}function R(b,V,W){const ee=V&&n[V]||W;b.classList.add("hljs"),b.classList.add(`language-${ee}`)}function F(b){let V=null;const W=p(b);if(d(W))return;if(ae("before:highlightElement",{el:b,language:W}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.children.length>0&&(u.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(b)),u.throwUnescapedHTML))throw new ff("One of your code blocks includes unescaped HTML.",b.innerHTML);V=b;const ee=V.textContent,ge=W?h(ee,{language:W,ignoreIllegals:!0}):$(ee);b.innerHTML=ge.value,b.dataset.highlighted="yes",R(b,W,ge.language),b.result={language:ge.language,re:ge.relevance,relevance:ge.relevance},ge.secondBest&&(b.secondBest={language:ge.secondBest.language,relevance:ge.secondBest.relevance}),ae("after:highlightElement",{el:b,result:ge,text:ee})}function O(b){u=Fr(u,b)}const A=()=>{m(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function b(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",b,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(b,V){let W=null;try{W=V(t)}catch(ee){if(xn("Language definition for '{}' could not be registered.".replace("{}",b)),a)xn(ee);else throw ee;W=s}W.name||(W.name=b),o[b]=W,W.rawDefinition=V.bind(null,t),W.aliases&&ie(W.aliases,{languageName:b})}function G(b){delete o[b];for(const V of Object.keys(n))n[V]===b&&delete n[V]}function q(){return Object.keys(o)}function w(b){return b=(b||"").toLowerCase(),o[b]||o[n[b]]}function ie(b,{languageName:V}){typeof b=="string"&&(b=[b]),b.forEach(W=>{n[W.toLowerCase()]=V})}function fe(b){const V=w(b);return V&&!V.disableAutodetect}function ce(b){b["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=V=>{b["before:highlightBlock"](Object.assign({block:V.el},V))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=V=>{b["after:highlightBlock"](Object.assign({block:V.el},V))})}function J(b){ce(b),i.push(b)}function me(b){const V=i.indexOf(b);V!==-1&&i.splice(V,1)}function ae(b,V){const W=b;i.forEach(function(ee){ee[W]&&ee[W](V)})}function ke(b){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),F(b)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ke,configure:O,initHighlighting:A,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:G,listLanguages:q,getLanguage:w,registerAliases:ie,autoDetection:fe,inherit:Fr,addPlugin:J,removePlugin:me}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=uf,t.regex={concat:En,lookahead:Rr,either:Ei,optional:Mu,anyNumberOfTimes:Cu};for(const b in Po)typeof Po[b]=="object"&&Tr(Po[b]);return Object.assign(t,Po),t},Vn=Hr({});Vn.newInstance=()=>Hr({});var pf=Vn;Vn.HighlightJS=Vn,Vn.default=Vn;const Si=xu(pf);function Ti(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=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"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],A={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["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"],P=["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:F,literal:O,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,x,c,s,A,u,d,p,h,n]}}const hf=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_-]*/}}),gf=["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"],bf=["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"],kf=[...gf,...bf],yf=["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(),Ef=["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(),xf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wf=["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 Nf(t){const o=t.regex,n=hf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[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,i,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:":("+Ef.join("|")+")"},{begin:":(:)?("+xf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:yf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+kf.join("|")+")\\b"}]}}function Wr(t){const c={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:c,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:c,illegal:/["']/}]}]}}var $n="[0-9](_*[0-9])*",Uo=`\\.(${$n})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Gr={className:"number",variants:[{begin:`(\\b(${$n})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jr(t,o,n){return n===-1?"":t.replace(o,i=>jr(t,o,n-1))}function Sf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+jr("(?:<"+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"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={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:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Gr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Gr,p]}}const Kr="[A-Za-z$_][0-9A-Za-z$_]*",Tf=["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"],Cf=["true","false","null","undefined","NaN","Infinity"],Yr=["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"],qr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Mf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Af=[].concat(Xr,Yr,qr);function Zr(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Kr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Kr,keyword:Tf,literal:Cf,built_in:Af,"variable.language":Mf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:o.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:{_:[...Yr,...qr]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...Xr,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:b,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:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function _f(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Jr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={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}]},c={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}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),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}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(x);let $=[n,d];return[p,h,x,C].forEach(A=>{A.contains=A.contains.concat($)}),$=$.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Qr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,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:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},x={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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},O={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,O,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,A,x]}]}}function el(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["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"],p=["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!"],h=["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:h,keyword:u,literal:d,built_in:p},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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Rf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["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"],p=["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"],h=["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"],x=["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"],C=["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,R=[...p,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:G,when:q}={}){const w=q;return G=G||[],P.map(ie=>ie.match(/\|\d+$/)||G.includes(ie)?ie:w(ie)?`${ie}|0`:ie)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:x},contains:[{scope:"type",match:y(s)},k,A,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,O]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",tl=["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"],nl=["true","false","null","undefined","NaN","Infinity"],ol=["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"],il=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ll=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],al=[].concat(rl,ol,il);function Bf(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Wo,keyword:tl,literal:nl,built_in:al,"variable.language":ll},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:o.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:{_:[...ol,...il]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...rl,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:b,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:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function sl(t){const o=t.regex,n=Bf(t),i=Wo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Wo,keyword:tl.concat(d),literal:nl,built_in:al.concat(a),"variable.language":ll},h={className:"meta",begin:"@"+i},x=(F,O,A)=>{const y=F.contains.findIndex(k=>k.label===O);if(y===-1)throw new Error("can not find mode to replace");F.contains.splice(y,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function cl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function dl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={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,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},O=[i,{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:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,F,c,s],A=[...O];return A.pop(),A.push(u),$.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}const Ci={bash:Ti,sh:Ti,shell:Ti,css:Nf,go:Wr,golang:Wr,java:Sf,javascript:Zr,js:Zr,json:_f,markdown:Jr,md:Jr,python:Qr,py:Qr,rust:el,rs:el,sql:Rf,typescript:sl,ts:sl,xml:cl,html:cl,yaml:dl,yml:dl};for(const[t,o]of Object.entries(Ci))Si.registerLanguage(t,o);function Go(t){const o=t.split(`
55
+ `,Vo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(Ln(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const I=On(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Bt(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function h(){try{const I=On(a.value||"");c.value=null,i("import",I)}catch(I){c.value=I.message}}function x(){a.value=Ln(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function $(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const A=(k=I.files)==null?void 0:k[0];if(!A)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&(a.value=y.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},y.readAsText(A)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),A=URL.createObjectURL(I),y=document.createElement("a");y.href=A;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(A)}function F(){a.value=Oc,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,A)=>(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...A[1]||(A[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:R},[...A[2]||(A[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),A[3]||(A[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:x},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Ac,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_c,[e.createElementVNode("div",Rc,[A[4]||(A[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[0]||(A[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",vc,[A[5]||(A[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Bc,[e.createVNode(ei,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",zc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Ic)])]))}}),Lc={class:"zm-settings-panel"},Dc={class:"zm-settings-section"},Vc={class:"zm-settings-field"},$c={class:"zm-settings-control"},Pc={class:"zm-color-input-wrap"},Fc=["value"],Uc={class:"zm-color-input-text"},Hc={class:"zm-swatch-row zm-swatch-row--compact"},Wc=["title","onClick"],Gc={class:"zm-settings-field"},jc=["value"],Kc={class:"zm-slider"},Yc=["value"],qc={class:"zm-settings-field"},Xc=["value"],Zc={class:"zm-slider"},Jc=["value"],Qc={class:"zm-settings-field zm-line-style-field"},ed={class:"zm-line-style-group"},td=["title","onClick"],nd=["viewBox"],od={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},rd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ld={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ad={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},sd={class:"zm-line-style-label"},cd={class:"zm-settings-field zm-line-style-field"},dd={class:"zm-line-style-group"},ud=["title","onClick"],fd=["viewBox"],md={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},pd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},hd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},gd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},bd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},kd={class:"zm-line-style-label"},yd={key:0,class:"zm-settings-field"},Ed={class:"zm-settings-label"},xd={class:"zm-settings-sub"},wd=["value"],Nd={key:1,class:"zm-slider"},Sd=["value"],Td={class:"zm-settings-field zm-line-style-field"},Cd={class:"zm-line-style-group"},Md=["title","onClick"],Ad={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},_d={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Rd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},vd={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},Bd={class:"zm-line-style-label"},zd={class:"zm-settings-field"},Id={key:2,class:"zm-palette-picker"},Od={class:"zm-palette-list"},Ld=["onClick"],Dd={class:"zm-palette-option-name"},Vd={class:"zm-palette-option-swatches"},$d={key:0,class:"zm-palette-custom-editor"},Pd=["value"],Fd={class:"zm-palette-custom-actions"},Ud={class:"zm-settings-field"},Hd={key:3,class:"zm-settings-field"},Wd={class:"zm-settings-label"},Gd={class:"zm-settings-sub"},jd=["value"],Kd={key:4,class:"zm-slider"},Yd=["value"],qd={class:"zm-settings-field"},Xd={class:"zm-settings-preview"},Zd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Jd=["x1","y1","x2","y2","stroke","stroke-width"],Qd={key:0,class:"zm-settings-section"},eu={class:"zm-settings-section-title"},tu={key:0,class:"zm-settings-section-sub"},nu={class:"zm-settings-field"},ou={class:"zm-settings-value-tag"},iu={class:"zm-swatch-row"},ru=["title","onClick"],lu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},au=["value"],su={class:"zm-settings-field"},cu={class:"zm-settings-value-tag"},du={class:"zm-swatch-row"},uu=["title","onClick"],fu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},mu=["value"],pu={class:"zm-settings-field"},hu=["value"],gu=["value"],bu={class:"zm-settings-field"},ku=["value"],yu={class:"zm-slider"},Eu=["value"],xu={class:"zm-settings-section zm-settings-section--actions"},$o=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(Y,N){i("update:settings",{[Y]:N})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function p(Y){i("update:nodeStyle",Y)}const h=e.computed(()=>[...cn,...n.settings.customPalettes]),x=e.reactive({});function C(Y){return x[Y.id]===void 0&&(x[Y.id]=Y.colors.join(`
56
+ `)),x[Y.id]}function $(Y){const N=x[Y.id]??"",re=Ka(N);if(re.length===0){x[Y.id]=Y.colors.join(`
57
+ `);return}const pe=n.settings.customPalettes.map(de=>de.id===Y.id?{...de,colors:re}:de);i("update:settings",{customPalettes:pe})}function R(){const Y=h.value.find(xe=>xe.id===n.settings.branchPaletteId),N=Y?[...Y.colors]:[...cn[0].colors],re="custom-";let pe=re+(n.settings.customPalettes.length+1);for(;cn.some(xe=>xe.id===pe)||n.settings.customPalettes.some(xe=>xe.id===pe);)pe=re+Math.random().toString(36).slice(2,7);const de={id:pe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:N};i("update:settings",{customPalettes:[...n.settings.customPalettes,de],branchPaletteId:pe}),x[pe]=N.join(`
58
+ `)}function F(Y){const N=n.settings.customPalettes.filter(pe=>pe.id!==Y.id),re=n.settings.branchPaletteId===Y.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:N,...re!==n.settings.branchPaletteId?{branchPaletteId:re}:{}}),delete x[Y.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(Y,N,re,pe){if(N<=1)return re;const de=Y/(N-1);return re+(pe-re)*de}function P(Y,N,re,pe){const de=N*Math.pow(pe,Y);return Math.max(re,de)}const G=e.computed(()=>{const Y=n.settings.lineWidthStart,N=n.settings.lineWidthEnd,re=n.settings.taperedEdge,pe=y.length,de=8,xe=192,ee=h.value.find(ue=>ue.id===n.settings.branchPaletteId),ce=ee&&ee.colors.length?ee.colors:k;return y.map((ue,g)=>{const V=10+g*60/(pe-1);return{x1:de,y1:V,x2:xe,y2:V,w:re?P(ue,Y,N,n.settings.lineWidthTaper):m(ue,pe,Y,N),color:n.settings.rainbowBranch?ce[g%ce.length]:"#94a3b8"}})});return(Y,N)=>{var re,pe,de,xe,ee,ce,ue;return e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("section",Dc,[N[45]||(N[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Vc,[N[24]||(N[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",$c,[e.createElementVNode("label",Pc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:N[0]||(N[0]=g=>a("canvasBg",g.target.value))},null,40,Fc),e.createElementVNode("span",Uc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Hc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,g=>e.createElementVNode("button",{key:"cbg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:V=>a("canvasBg",g)},null,14,Wc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:N[1]||(N[1]=g=>a("canvasBg",void 0))},"∅")]),N[46]||(N[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Gc,[N[25]||(N[25]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:N[2]||(N[2]=g=>a("lineWidthStart",parseFloat(g.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[N[26]||(N[26]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:N[3]||(N[3]=g=>a("lineWidthStart",parseFloat(g.target.value)))},null,40,Yc)]),e.createElementVNode("div",qc,[N[27]||(N[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:N[4]||(N[4]=g=>a("lineWidthEnd",parseFloat(g.target.value)||0))},null,40,Xc)]),e.createElementVNode("div",Zc,[N[28]||(N[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:N[5]||(N[5]=g=>a("lineWidthEnd",parseFloat(g.target.value)))},null,40,Jc)]),N[47]||(N[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Qc,[N[29]||(N[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===g.value}]),title:g.label,onClick:V=>a("rootLineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",od)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",id)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",rd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",ld)):(e.openBlock(),e.createElementBlock("line",ad))],8,nd)),e.createElementVNode("span",sd,e.toDisplayString(g.label),1)],10,td))),128))])]),e.createElementVNode("div",cd,[N[30]||(N[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",dd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===g.value}]),title:g.label,onClick:V=>a("lineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",md)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",pd)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",hd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",gd)):(e.openBlock(),e.createElementBlock("line",bd))],8,fd)),e.createElementVNode("span",kd,e.toDisplayString(g.label),1)],10,ud)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",yd,[e.createElementVNode("span",Ed,[N[31]||(N[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",xd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"40",value:t.settings.elbowRadius,onChange:N[6]||(N[6]=g=>a("elbowRadius",parseFloat(g.target.value)||20))},null,40,wd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",Nd,[N[32]||(N[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"40",step:"1",value:t.settings.elbowRadius,onInput:N[7]||(N[7]=g=>a("elbowRadius",parseFloat(g.target.value)))},null,40,Sd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Td,[N[34]||(N[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Cd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===g.value}]),title:g.label,onClick:V=>a("lineOrigin",g.value)},[(e.openBlock(),e.createElementBlock("svg",Ad,[N[33]||(N[33]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),g.value==="edge"?(e.openBlock(),e.createElementBlock("path",_d)):g.value==="center"?(e.openBlock(),e.createElementBlock("path",Rd)):(e.openBlock(),e.createElementBlock("path",vd))])),e.createElementVNode("span",Bd,e.toDisplayString(g.label),1)],10,Md)),64))])]),e.createElementVNode("div",zd,[N[36]||(N[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:N[8]||(N[8]=g=>a("rainbowBranch",!t.settings.rainbowBranch))},[...N[35]||(N[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Id,[N[37]||(N[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===g.id}]),onClick:V=>a("branchPaletteId",g.id)},[e.createElementVNode("span",Dd,e.toDisplayString(g.name),1),e.createElementVNode("span",Vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.colors,(V,W)=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,Ld))),128))]),t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)),onInput:N[9]||(N[9]=g=>x[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=g.target.value)},null,40,Pd),e.createElementVNode("div",Fd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:N[10]||(N[10]=g=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:N[11]||(N[11]=g=>F(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),N[48]||(N[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Ud,[N[39]||(N[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:N[12]||(N[12]=g=>a("taperedEdge",!t.settings.taperedEdge))},[...N[38]||(N[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("span",Wd,[N[40]||(N[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Gd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.1",max:"1",value:t.settings.lineWidthTaper,onChange:N[13]||(N[13]=g=>a("lineWidthTaper",parseFloat(g.target.value)||.67))},null,40,jd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Kd,[N[41]||(N[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:N[14]||(N[14]=g=>a("lineWidthTaper",parseFloat(g.target.value)))},null,40,Yd)])):e.createCommentVNode("",!0),e.createElementVNode("div",qd,[N[43]||(N[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:N[15]||(N[15]=g=>a("showOrderBadge",!t.settings.showOrderBadge))},[...N[42]||(N[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Xd,[(e.openBlock(),e.createElementBlock("svg",Zd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(g,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:t.settings.rainbowBranch?g.color:"#94a3b8","stroke-width":g.w,"stroke-linecap":"butt"},null,8,Jd))),128))])),N[44]||(N[44]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Qd,[e.createElementVNode("h4",eu,[N[49]||(N[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",tu,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",nu,[N[50]||(N[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",ou,e.toDisplayString(((re=t.nodeStyle)==null?void 0:re.bg)||"默认"),1)]),e.createElementVNode("div",iu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"bg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:W=>p({bg:g})},null,14,ru)}),64)),e.createElementVNode("label",lu,[e.createElementVNode("input",{type:"color",value:((pe=t.nodeStyle)==null?void 0:pe.bg)||"#ffffff",onInput:N[16]||(N[16]=g=>p({bg:g.target.value}))},null,40,au)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[17]||(N[17]=g=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",su,[N[51]||(N[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",cu,e.toDisplayString(((de=t.nodeStyle)==null?void 0:de.textColor)||"默认"),1)]),e.createElementVNode("div",du,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"fg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:W=>p({textColor:g})},null,14,uu)}),64)),e.createElementVNode("label",fu,[e.createElementVNode("input",{type:"color",value:((xe=t.nodeStyle)==null?void 0:xe.textColor)||"#1e2937",onInput:N[18]||(N[18]=g=>p({textColor:g.target.value}))},null,40,mu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[19]||(N[19]=g=>p({textColor:void 0}))},"∅")]),N[55]||(N[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",pu,[N[52]||(N[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ee=t.nodeStyle)==null?void 0:ee.fontWeight)??400,onChange:N[20]||(N[20]=g=>p({fontWeight:parseInt(g.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,g=>e.createElementVNode("option",{key:g.value,value:g.value},e.toDisplayString(g.label),9,gu)),64))],40,hu)]),e.createElementVNode("div",bu,[N[53]||(N[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ce=t.nodeStyle)==null?void 0:ce.fontSize)??14,onChange:N[21]||(N[21]=g=>p({fontSize:parseInt(g.target.value)||14}))},null,40,ku)]),e.createElementVNode("div",yu,[N[54]||(N[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ue=t.nodeStyle)==null?void 0:ue.fontSize)??14,onInput:N[22]||(N[22]=g=>p({fontSize:parseInt(g.target.value)}))},null,40,Eu)]),N[56]||(N[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",xu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:N[23]||(N[23]=g=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-9698bb5c"]]),Cr=20;function wu(t,o){t.style.height="auto";const n=o.minRows*Cr,i=o.maxRows>0?o.maxRows*Cr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Ei(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&wu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function Nu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(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(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Mr(n)}),t}class Ar{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const Su="</span>",Rr=t=>!!t.scope,Tu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Cu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=_r(o)}openNode(o){if(!Rr(o))return;const n=Tu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Rr(o)&&(this.buffer+=Su)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const vr=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class xi{constructor(){this.rootNode=vr(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=vr({scope:o});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(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{xi._collapse(n)}))}}class Mu extends xi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Cu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Br(t){return wn("(?=",t,")")}function Au(t){return wn("(?:",t,")*")}function _u(t){return wn("(?:",t,")?")}function wn(...t){return t.map(n=>ro(n)).join("")}function Ru(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function wi(...t){return"("+(Ru(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function zr(t){return new RegExp(t.toString()+"|").exec("").length-1}function vu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Bu=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ni(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Bu.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const zu=/\b\B/,Ir="[a-zA-Z]\\w*",Si="[a-zA-Z_]\\w*",Or="\\b\\d+(\\.\\d+)?",Lr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Dr="\\b(0b[01]+)",Iu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ou=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=wn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},Lu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},Du={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Vu={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/},Po=function(t,o,n={}){const i=dn({scope:"comment",begin:t,end:o,contains:[]},n);i.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 a=wi("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 i.contains.push({begin:wn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},$u=Po("//","$"),Pu=Po("/\\*","\\*/"),Fu=Po("#","$"),Uu={scope:"number",begin:Or,relevance:0},Hu={scope:"number",begin:Lr,relevance:0},Wu={scope:"number",begin:Dr,relevance:0},Gu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},ju={scope:"title",begin:Ir,relevance:0},Ku={scope:"title",begin:Si,relevance:0},Yu={begin:"\\.\\s*"+Si,relevance:0};var Fo=Object.freeze({__proto__:null,APOS_STRING_MODE:Lu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Wu,BINARY_NUMBER_RE:Dr,COMMENT:Po,C_BLOCK_COMMENT_MODE:Pu,C_LINE_COMMENT_MODE:$u,C_NUMBER_MODE:Hu,C_NUMBER_RE:Lr,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:Fu,IDENT_RE:Ir,MATCH_NOTHING_RE:zu,METHOD_GUARD:Yu,NUMBER_MODE:Uu,NUMBER_RE:Or,PHRASAL_WORDS_MODE:Vu,QUOTE_STRING_MODE:Du,REGEXP_MODE:Gu,RE_STARTERS_RE:Iu,SHEBANG:Ou,TITLE_MODE:ju,UNDERSCORE_IDENT_RE:Si,UNDERSCORE_TITLE_MODE:Ku});function qu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Xu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Zu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=qu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ju(t,o){Array.isArray(t.illegal)&&(t.illegal=wi(...t.illegal))}function Qu(t,o){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 ef(t,o){t.relevance===void 0&&(t.relevance=1)}const tf=(t,o)=>{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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=wn(n.beforeMatch,Br(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},nf=["of","and","for","in","not","or","if","then","parent","list","value"],of="keyword";function Vr(t,o,n=of){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Vr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,rf(d[0],d[1])]})}}function rf(t,o){return o?Number(o):lf(t)?0:1}function lf(t){return nf.includes(t.toLowerCase())}const $r={},Nn=t=>{console.error(t)},Pr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Dn=(t,o)=>{$r[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),$r[`${t}/${o}`]=!0)},Uo=new Error;function Fr(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=zr(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function af(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Nn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Uo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Nn("beginScope must be object"),Uo;Fr(t,t.begin,{key:"beginScope"}),t.begin=Ni(t.begin,{joinWith:""})}}function sf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Nn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Uo;if(typeof t.endScope!="object"||t.endScope===null)throw Nn("endScope must be object"),Uo;Fr(t,t.end,{key:"endScope"}),t.end=Ni(t.end,{joinWith:""})}}function cf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function df(t){cf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),af(t),sf(t)}function uf(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=zr(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ni(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((x,C)=>C>0&&x!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Xu,Qu,df,tf].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[Zu,Ju,ef].forEach(h=>h(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Vr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return ff(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(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=dn(t.classNameAliases||{}),c(t)}function Ur(t){return t?t.endsWithParent||Ur(t.starts):!1}function ff(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Ur(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var mf="11.11.1";class pf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ti=_r,Hr=dn,Wr=Symbol("nomatch"),hf=7,Gr=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Mu};function d(g){return u.noHighlightRe.test(g)}function p(g){let V=g.className+" ";V+=g.parentNode?g.parentNode.className:"";const W=u.languageDetectRe.exec(V);if(W){const te=N(W[1]);return te||(Pr(c.replace("{}",W[1])),Pr("Falling back to no-highlight mode for this block.",g)),te?W[1]:"no-highlight"}return V.split(/\s+/).find(te=>d(te)||N(te))}function h(g,V,W){let te="",fe="";typeof V=="object"?(te=g,W=V.ignoreIllegals,fe=V.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),fe=g,te=V),W===void 0&&(W=!0);const L={code:te,language:fe};ce("before:highlight",L);const O=L.result?L.result:x(L.language,L.code,W);return O.code=L.code,ce("after:highlight",O),O}function x(g,V,W,te){const fe=Object.create(null);function L(q,le){return q.keywords[le]}function O(){if(!me.keywords){Ie.addText(Be);return}let q=0;me.keywordPatternRe.lastIndex=0;let le=me.keywordPatternRe.exec(Be),Ee="";for(;le;){Ee+=Be.substring(q,le.index);const Ae=tt.case_insensitive?le[0].toLowerCase():le[0],Ue=L(me,Ae);if(Ue){const[ot,St]=Ue;if(Ie.addText(Ee),Ee="",fe[Ae]=(fe[Ae]||0)+1,fe[Ae]<=hf&&(Dt+=St),ot.startsWith("_"))Ee+=le[0];else{const Rn=tt.classNameAliases[ot]||ot;B(le[0],Rn)}}else Ee+=le[0];q=me.keywordPatternRe.lastIndex,le=me.keywordPatternRe.exec(Be)}Ee+=Be.substring(q),Ie.addText(Ee)}function ae(){if(Be==="")return;let q=null;if(typeof me.subLanguage=="string"){if(!o[me.subLanguage]){Ie.addText(Be);return}q=x(me.subLanguage,Be,!0,ft[me.subLanguage]),ft[me.subLanguage]=q._top}else q=$(Be,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(Dt+=q.relevance),Ie.__addSublanguage(q._emitter,q.language)}function ke(){me.subLanguage!=null?ae():O(),Be=""}function B(q,le){q!==""&&(Ie.startScope(le),Ie.addText(q),Ie.endScope())}function S(q,le){let Ee=1;const Ae=le.length-1;for(;Ee<=Ae;){if(!q._emit[Ee]){Ee++;continue}const Ue=tt.classNameAliases[q[Ee]]||q[Ee],ot=le[Ee];Ue?B(ot,Ue):(Be=ot,O(),Be=""),Ee++}}function U(q,le){return q.scope&&typeof q.scope=="string"&&Ie.openNode(tt.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(B(Be,tt.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),Be=""):q.beginScope._multi&&(S(q.beginScope,le),Be="")),me=Object.create(q,{parent:{value:me}}),me}function H(q,le,Ee){let Ae=vu(q.endRe,Ee);if(Ae){if(q["on:end"]){const Ue=new Ar(q);q["on:end"](le,Ue),Ue.isMatchIgnored&&(Ae=!1)}if(Ae){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return H(q.parent,le,Ee)}function ne(q){return me.matcher.regexIndex===0?(Be+=q[0],1):(kt=!0,0)}function ye(q){const le=q[0],Ee=q.rule,Ae=new Ar(Ee),Ue=[Ee.__beforeBegin,Ee["on:begin"]];for(const ot of Ue)if(ot&&(ot(q,Ae),Ae.isMatchIgnored))return ne(le);return Ee.skip?Be+=le:(Ee.excludeBegin&&(Be+=le),ke(),!Ee.returnBegin&&!Ee.excludeBegin&&(Be=le)),U(Ee,q),Ee.returnBegin?0:le.length}function Qe(q){const le=q[0],Ee=V.substring(q.index),Ae=H(me,q,Ee);if(!Ae)return Wr;const Ue=me;me.endScope&&me.endScope._wrap?(ke(),B(le,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ke(),S(me.endScope,q)):Ue.skip?Be+=le:(Ue.returnEnd||Ue.excludeEnd||(Be+=le),ke(),Ue.excludeEnd&&(Be=le));do me.scope&&Ie.closeNode(),!me.skip&&!me.subLanguage&&(Dt+=me.relevance),me=me.parent;while(me!==Ae.parent);return Ae.starts&&U(Ae.starts,q),Ue.returnEnd?0:le.length}function ut(){const q=[];for(let le=me;le!==tt;le=le.parent)le.scope&&q.unshift(le.scope);q.forEach(le=>Ie.openNode(le))}let et={};function en(q,le){const Ee=le&&le[0];if(Be+=q,Ee==null)return ke(),0;if(et.type==="begin"&&le.type==="end"&&et.index===le.index&&Ee===""){if(Be+=V.slice(le.index,le.index+1),!a){const Ae=new Error(`0 width match regex (${g})`);throw Ae.languageName=g,Ae.badRule=et.rule,Ae}return 1}if(et=le,le.type==="begin")return ye(le);if(le.type==="illegal"&&!W){const Ae=new Error('Illegal lexeme "'+Ee+'" for mode "'+(me.scope||"<unnamed>")+'"');throw Ae.mode=me,Ae}else if(le.type==="end"){const Ae=Qe(le);if(Ae!==Wr)return Ae}if(le.type==="illegal"&&Ee==="")return Be+=`
60
+ `,1;if(Nt>1e5&&Nt>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=Ee,Ee.length}const tt=N(g);if(!tt)throw Nn(c.replace("{}",g)),new Error('Unknown language: "'+g+'"');const tn=uf(tt);let Lt="",me=te||tn;const ft={},Ie=new u.__emitter(u);ut();let Be="",Dt=0,nt=0,Nt=0,kt=!1;try{if(tt.__emitTokens)tt.__emitTokens(V,Ie);else{for(me.matcher.considerAll();;){Nt++,kt?kt=!1:me.matcher.considerAll(),me.matcher.lastIndex=nt;const q=me.matcher.exec(V);if(!q)break;const le=V.substring(nt,q.index),Ee=en(le,q);nt=q.index+Ee}en(V.substring(nt))}return Ie.finalize(),Lt=Ie.toHTML(),{language:g,value:Lt,relevance:Dt,illegal:!1,_emitter:Ie,_top:me}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:g,value:Ti(V),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:nt,context:V.slice(nt-100,nt+100),mode:q.mode,resultSoFar:Lt},_emitter:Ie};if(a)return{language:g,value:Ti(V),illegal:!1,relevance:0,errorRaised:q,_emitter:Ie,_top:me};throw q}}function C(g){const V={value:Ti(g),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(g),V}function $(g,V){V=V||u.languages||Object.keys(o);const W=C(g),te=V.filter(N).filter(pe).map(ke=>x(ke,g,!1));te.unshift(W);const fe=te.sort((ke,B)=>{if(ke.relevance!==B.relevance)return B.relevance-ke.relevance;if(ke.language&&B.language){if(N(ke.language).supersetOf===B.language)return 1;if(N(B.language).supersetOf===ke.language)return-1}return 0}),[L,O]=fe,ae=L;return ae.secondBest=O,ae}function R(g,V,W){const te=V&&n[V]||W;g.classList.add("hljs"),g.classList.add(`language-${te}`)}function F(g){let V=null;const W=p(g);if(d(W))return;if(ce("before:highlightElement",{el:g,language:W}),g.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",g);return}if(g.children.length>0&&(u.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(g)),u.throwUnescapedHTML))throw new pf("One of your code blocks includes unescaped HTML.",g.innerHTML);V=g;const te=V.textContent,fe=W?h(te,{language:W,ignoreIllegals:!0}):$(te);g.innerHTML=fe.value,g.dataset.highlighted="yes",R(g,W,fe.language),g.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(g.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),ce("after:highlightElement",{el:g,result:fe,text:te})}function I(g){u=Hr(u,g)}const A=()=>{m(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function g(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",g,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(g,V){let W=null;try{W=V(t)}catch(te){if(Nn("Language definition for '{}' could not be registered.".replace("{}",g)),a)Nn(te);else throw te;W=s}W.name||(W.name=g),o[g]=W,W.rawDefinition=V.bind(null,t),W.aliases&&re(W.aliases,{languageName:g})}function G(g){delete o[g];for(const V of Object.keys(n))n[V]===g&&delete n[V]}function Y(){return Object.keys(o)}function N(g){return g=(g||"").toLowerCase(),o[g]||o[n[g]]}function re(g,{languageName:V}){typeof g=="string"&&(g=[g]),g.forEach(W=>{n[W.toLowerCase()]=V})}function pe(g){const V=N(g);return V&&!V.disableAutodetect}function de(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=V=>{g["before:highlightBlock"](Object.assign({block:V.el},V))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=V=>{g["after:highlightBlock"](Object.assign({block:V.el},V))})}function xe(g){de(g),i.push(g)}function ee(g){const V=i.indexOf(g);V!==-1&&i.splice(V,1)}function ce(g,V){const W=g;i.forEach(function(te){te[W]&&te[W](V)})}function ue(g){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),F(g)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ue,configure:I,initHighlighting:A,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:G,listLanguages:Y,getLanguage:N,registerAliases:re,autoDetection:pe,inherit:Hr,addPlugin:xe,removePlugin:ee}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=mf,t.regex={concat:wn,lookahead:Br,either:wi,optional:_u,anyNumberOfTimes:Au};for(const g in Fo)typeof Fo[g]=="object"&&Mr(Fo[g]);return Object.assign(t,Fo),t},Vn=Gr({});Vn.newInstance=()=>Gr({});var gf=Vn;Vn.HighlightJS=Vn,Vn.default=Vn;const Ci=Nu(gf);function Mi(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=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"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],A={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["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"],P=["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:F,literal:I,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,x,c,s,A,u,d,p,h,n]}}const bf=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_-]*/}}),kf=["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"],yf=["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"],Ef=[...kf,...yf],xf=["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(),wf=["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(),Nf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Sf=["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 Tf(t){const o=t.regex,n=bf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[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,i,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:":("+wf.join("|")+")"},{begin:":(:)?("+Nf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Sf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:xf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ef.join("|")+")\\b"}]}}function jr(t){const c={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:c,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:c,illegal:/["']/}]}]}}var $n="[0-9](_*[0-9])*",Ho=`\\.(${$n})`,Wo="[0-9a-fA-F](_*[0-9a-fA-F])*",Kr={className:"number",variants:[{begin:`(\\b(${$n})((${Ho})|\\.)?|(${Ho}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Ho})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ho})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Wo})\\.?|(${Wo})?\\.(${Wo}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yr(t,o,n){return n===-1?"":t.replace(o,i=>Yr(t,o,n-1))}function Cf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Yr("(?:<"+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"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={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:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Kr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Kr,p]}}const qr="[A-Za-z$_][0-9A-Za-z$_]*",Mf=["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"],Af=["true","false","null","undefined","NaN","Infinity"],Xr=["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"],Zr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Jr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_f=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rf=[].concat(Jr,Xr,Zr);function Qr(t){const o=t.regex,n=(W,{after:te})=>{const fe="</"+W[0].slice(1);return W.input.indexOf(fe,te)!==-1},i=qr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,te)=>{const fe=W[0].length+W.index,L=W.input[fe];if(L==="<"||L===","){te.ignoreMatch();return}L===">"&&(n(W,{after:fe})||te.ignoreMatch());let O;const ae=W.input.substring(fe);if(O=ae.match(/^\s*=/)){te.ignoreMatch();return}if((O=ae.match(/^\s+extends\s+/))&&O.index===0){te.ignoreMatch();return}}},u={$pattern:qr,keyword:Mf,literal:Af,built_in:Rf,"variable.language":_f},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:o.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:{_:[...Xr,...Zr]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function xe(W){return o.concat("(?!",W.join("|"),")")}const ee={match:o.concat(/\b/,xe([...Jr,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,y,{match:/\$\d+/},x,N,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,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:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ee,de,Y,ue,{match:/\$[(.]/}]}}function vf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function el(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={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}]},c={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}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),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}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(x);let $=[n,d];return[p,h,x,C].forEach(A=>{A.contains=A.contains.concat($)}),$=$.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tl(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,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:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},x={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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,A,x]}]}}function nl(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["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"],p=["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!"],h=["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:h,keyword:u,literal:d,built_in:p},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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Bf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["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"],p=["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"],h=["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"],x=["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"],C=["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,R=[...p,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:G,when:Y}={}){const N=Y;return G=G||[],P.map(re=>re.match(/\|\d+$/)||G.includes(re)?re:N(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:x},contains:[{scope:"type",match:y(s)},k,A,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Go="[A-Za-z$_][0-9A-Za-z$_]*",ol=["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"],il=["true","false","null","undefined","NaN","Infinity"],rl=["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"],ll=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],al=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cl=[].concat(al,rl,ll);function zf(t){const o=t.regex,n=(W,{after:te})=>{const fe="</"+W[0].slice(1);return W.input.indexOf(fe,te)!==-1},i=Go,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,te)=>{const fe=W[0].length+W.index,L=W.input[fe];if(L==="<"||L===","){te.ignoreMatch();return}L===">"&&(n(W,{after:fe})||te.ignoreMatch());let O;const ae=W.input.substring(fe);if(O=ae.match(/^\s*=/)){te.ignoreMatch();return}if((O=ae.match(/^\s+extends\s+/))&&O.index===0){te.ignoreMatch();return}}},u={$pattern:Go,keyword:ol,literal:il,built_in:cl,"variable.language":sl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:o.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:{_:[...rl,...ll]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function xe(W){return o.concat("(?!",W.join("|"),")")}const ee={match:o.concat(/\b/,xe([...al,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,y,{match:/\$\d+/},x,N,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,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:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ee,de,Y,ue,{match:/\$[(.]/}]}}function dl(t){const o=t.regex,n=zf(t),i=Go,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Go,keyword:ol.concat(d),literal:il,built_in:cl.concat(a),"variable.language":sl},h={className:"meta",begin:"@"+i},x=(F,I,A)=>{const y=F.contains.findIndex(k=>k.label===I);if(y===-1)throw new Error("can not find mode to replace");F.contains.splice(y,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ul(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={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,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},I=[i,{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:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,F,c,s],A=[...I];return A.pop(),A.push(u),$.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Ai={bash:Mi,sh:Mi,shell:Mi,css:Tf,go:jr,golang:jr,java:Cf,javascript:Qr,js:Qr,json:vf,markdown:el,md:el,python:tl,py:tl,rust:nl,rs:nl,sql:Bf,typescript:dl,ts:dl,xml:ul,html:ul,yaml:fl,yml:fl};for(const[t,o]of Object.entries(Ai))Ci.registerLanguage(t,o);function jo(t){const o=t.split(`
61
61
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
62
- `).replace(/\n+$/,"")}function wn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ci[n]?n:""}function Mi(t,o){const n=o&&Ci[o]?o:"";try{return n?Si.highlight(t,{language:n,ignoreIllegals:!0}).value:Si.highlightAuto(t).value}catch{return vf(t)}}function Ai(t){return t.split(`
64
- `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function vf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nn=_i();function ul(t){Nn=t}var Sn={exec:()=>null};function Pn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ct.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var If=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}>`))},zf=/^(?:[ \t]*(?:\n|$))+/,Of=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ri=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ml=Re(fl).replace(/bull/g,Ri).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vf=Re(fl).replace(/bull/g,Ri).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$f=/^[^\n]+/,vi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Pf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ff=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ri).getRegex(),jo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ii=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Uf=Re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ii).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pl=Re(Bi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Hf=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pl).getRegex(),zi={blockquote:Hf,code:Of,def:Pf,fences:Lf,heading:Df,hr:ao,html:Uf,lheading:ml,list:Ff,newline:zf,paragraph:pl,table:Sn,text:$f},hl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Wf={...zi,lheading:Vf,table:hl,paragraph:Re(Bi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex()},Gf={...zi,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ii).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(Bi).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
- ]`).replace("lheading",ml).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gl=/^( {2,}|\\)\n(?!\s*$)/,Yf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fn=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,Oi=/[^\s\p{P}\p{S}]/u,qf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),bl=/(?!~)[\p{P}\p{S}]/u,Xf=/(?!~)[\s\p{P}\p{S}]/u,Zf=/(?:[^\s\p{P}\p{S}]|~)/u,Jf=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",If?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Qf=Re(kl,"u").replace(/punct/g,Fn).getRegex(),em=Re(kl,"u").replace(/punct/g,bl).getRegex(),yl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",tm=Re(yl,"gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),nm=Re(yl,"gu").replace(/notPunctSpace/g,Zf).replace(/punctSpace/g,Xf).replace(/punct/g,bl).getRegex(),om=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),im=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fn).getRegex(),rm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lm=Re(rm,"gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),am=Re(/\\(punct)/,"gu").replace(/punct/g,Fn).getRegex(),sm=Re(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cm=Re(Ii).replace("(?:-->|$)","-->").getRegex(),dm=Re("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",cm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,um=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),El=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",vi).getRegex(),xl=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",vi).getRegex(),fm=Re("reflink|nolink(?!\\()","g").replace("reflink",El).replace("nolink",xl).getRegex(),wl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Li={_backpedal:Sn,anyPunctuation:am,autolink:sm,blockSkip:Jf,br:gl,code:Kf,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:Qf,emStrongRDelimAst:tm,emStrongRDelimUnd:om,escape:jf,link:um,nolink:xl,punctuation:qf,reflink:El,reflinkSearch:fm,tag:dm,text:Yf,url:Sn},mm={...Li,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Di={...Li,emStrongRDelimAst:nm,emStrongLDelim:em,delLDelim:im,delRDelim:lm,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wl).getRegex()},pm={...Di,br:Re(gl).replace("{2,}","*").getRegex(),text:Re(Di.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:zi,gfm:Wf,pedantic:Gf},so={normal:Li,gfm:Di,breaks:pm,pedantic:mm},hm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nl=t=>hm[t];function qt(t,o){if(o){if(ct.escapeTest.test(t))return t.replace(ct.escapeReplace,Nl)}else if(ct.escapeTestNoEncode.test(t))return t.replace(ct.escapeReplaceNoEncode,Nl);return t}function Sl(t){try{t=encodeURI(t).replace(ct.percentDecode,"%")}catch{return null}return t}function Tl(t,o){var c;let n=t.replace(ct.findPipe,(s,u,d)=>{let p=!1,h=u;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(ct.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(ct.slashPipe,"|");return i}function fn(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Cl(t){let o=t.split(`
62
+ `).replace(/\n+$/,"")}function Sn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ai[n]?n:""}function _i(t,o){const n=o&&Ai[o]?o:"";try{return n?Ci.highlight(t,{language:n,ignoreIllegals:!0}).value:Ci.highlightAuto(t).value}catch{return If(t)}}function Ri(t){return t.split(`
64
+ `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function If(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function vi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tn=vi();function ml(t){Tn=t}var Cn={exec:()=>null};function Pn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ct.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Of=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}>`))},Lf=/^(?:[ \t]*(?:\n|$))+/,Df=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$f=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hl=Re(pl).replace(/bull/g,Bi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Pf=Re(pl).replace(/bull/g,Bi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ff=/^[^\n]+/,Ii=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Uf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ii).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Hf=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Bi).getRegex(),Ko="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Oi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Wf=Re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Oi).replace("tag",Ko).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gl=Re(zi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),Gf=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gl).getRegex(),Li={blockquote:Gf,code:Df,def:Uf,fences:Vf,heading:$f,hr:ao,html:Wf,lheading:hl,list:Hf,newline:Lf,paragraph:gl,table:Cn,text:Ff},bl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),jf={...Li,lheading:Pf,table:bl,paragraph:Re(zi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex()},Kf={...Li,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Oi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(zi).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
+ ]`).replace("lheading",hl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Yf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kl=/^( {2,}|\\)\n(?!\s*$)/,Xf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fn=/[\p{P}\p{S}]/u,Yo=/[\s\p{P}\p{S}]/u,Di=/[^\s\p{P}\p{S}]/u,Zf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yo).getRegex(),yl=/(?!~)[\p{P}\p{S}]/u,Jf=/(?!~)[\s\p{P}\p{S}]/u,Qf=/(?:[^\s\p{P}\p{S}]|~)/u,em=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Of?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),El=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,tm=Re(El,"u").replace(/punct/g,Fn).getRegex(),nm=Re(El,"u").replace(/punct/g,yl).getRegex(),xl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",om=Re(xl,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),im=Re(xl,"gu").replace(/notPunctSpace/g,Qf).replace(/punctSpace/g,Jf).replace(/punct/g,yl).getRegex(),rm=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),lm=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fn).getRegex(),am="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",sm=Re(am,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),cm=Re(/\\(punct)/,"gu").replace(/punct/g,Fn).getRegex(),dm=Re(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),um=Re(Oi).replace("(?:-->|$)","-->").getRegex(),fm=Re("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",um).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,mm=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",qo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wl=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",qo).replace("ref",Ii).getRegex(),Nl=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ii).getRegex(),pm=Re("reflink|nolink(?!\\()","g").replace("reflink",wl).replace("nolink",Nl).getRegex(),Sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vi={_backpedal:Cn,anyPunctuation:cm,autolink:dm,blockSkip:em,br:kl,code:qf,del:Cn,delLDelim:Cn,delRDelim:Cn,emStrongLDelim:tm,emStrongRDelimAst:om,emStrongRDelimUnd:rm,escape:Yf,link:mm,nolink:Nl,punctuation:Zf,reflink:wl,reflinkSearch:pm,tag:fm,text:Xf,url:Cn},hm={...Vi,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",qo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qo).getRegex()},$i={...Vi,emStrongRDelimAst:im,emStrongLDelim:nm,delLDelim:lm,delRDelim:sm,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sl).getRegex()},gm={...$i,br:Re(kl).replace("{2,}","*").getRegex(),text:Re($i.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xo={normal:Li,gfm:jf,pedantic:Kf},so={normal:Vi,gfm:$i,breaks:gm,pedantic:hm},bm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tl=t=>bm[t];function Yt(t,o){if(o){if(ct.escapeTest.test(t))return t.replace(ct.escapeReplace,Tl)}else if(ct.escapeTestNoEncode.test(t))return t.replace(ct.escapeReplaceNoEncode,Tl);return t}function Cl(t){try{t=encodeURI(t).replace(ct.percentDecode,"%")}catch{return null}return t}function Ml(t,o){var c;let n=t.replace(ct.findPipe,(s,u,d)=>{let p=!1,h=u;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(ct.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(ct.slashPipe,"|");return i}function un(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Al(t){let o=t.split(`
66
66
  `),n=o.length-1;for(;n>=0&&ct.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
- `)}function gm(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function bm(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function Ml(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function km(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
67
+ `)}function km(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function ym(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function _l(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Em(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
68
68
  `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=a.length?c.slice(a.length):c}).join(`
69
- `)}var Xo=class{constructor(t){Ve(this,"options");Ve(this,"rules");Ve(this,"lexer");this.options=t||Nn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Cl(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=km(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=fn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:fn(o[0],`
70
- `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:fn(o[0],`
71
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=fn(o[0],`
69
+ `)}var Zo=class{constructor(t){Ve(this,"options");Ve(this,"rules");Ve(this,"lexer");this.options=t||Tn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Al(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=Em(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=un(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:un(o[0],`
70
+ `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:un(o[0],`
71
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
72
72
  `).split(`
73
73
  `),i="",a="",c=[];for(;n.length>0;){let s=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),s=!0;else if(!s)u.push(n[d]);else break;n=n.slice(d);let p=u.join(`
74
74
  `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
@@ -79,19 +79,19 @@ ${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
79
79
  `),F=this.blockquote(R);c[c.length-1]=F,i=i.substring(0,i.length-$.raw.length)+F.raw,a=a.substring(0,a.length-$.text.length)+F.text;break}else if((C==null?void 0:C.type)==="list"){let $=C,R=$.raw+`
80
80
  `+n.join(`
81
81
  `),F=this.list(R);c[c.length-1]=F,i=i.substring(0,i.length-C.raw.length)+F.raw,a=a.substring(0,a.length-$.raw.length)+F.raw,n=R.substring(c.at(-1).raw.length).split(`
82
- `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let x=bm(o[2].split(`
82
+ `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let x=ym(o[2].split(`
83
83
  `,1)[0],o[1].length),C=t.split(`
84
84
  `,1)[0],$=!x.trim(),R=0;if(this.options.pedantic?(R=2,h=x.trimStart()):$?R=o[1].length+1:(R=x.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=x.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(p+=C+`
85
- `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(R),O=this.rules.other.hrRegex(R),A=this.rules.other.fencesBeginRegex(R),y=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
86
- `,1)[0],G;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),G=C):G=C.replace(this.rules.other.tabCharGlobal," "),A.test(C)||y.test(C)||k.test(C)||m.test(C)||F.test(C)||O.test(C))break;if(G.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
87
- `+G.slice(R);else{if($||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(x)||y.test(x)||O.test(x))break;h+=`
85
+ `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),A=this.rules.other.fencesBeginRegex(R),y=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
86
+ `,1)[0],G;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),G=C):G=C.replace(this.rules.other.tabCharGlobal," "),A.test(C)||y.test(C)||k.test(C)||m.test(C)||F.test(C)||I.test(C))break;if(G.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
87
+ `+G.slice(R);else{if($||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(x)||y.test(x)||I.test(x))break;h+=`
88
88
  `+C}$=!C.trim(),p+=P+`
89
- `,t=t.substring(P.length+1),x=G.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let x={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=x.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),x=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=x}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Cl(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:fn(o[0],`
90
- `),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Tl(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
- `):[],c={type:"table",raw:fn(o[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Tl(u,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:fn(o[0],`
89
+ `,t=t.substring(P.length+1),x=G.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let x={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=x.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),x=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=x}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Al(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:un(o[0],`
90
+ `),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ml(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
+ `):[],c={type:"table",raw:un(o[0],`
92
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Ml(u,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:un(o[0],`
93
93
  `),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
94
- `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=fn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=gm(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ml(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Ml(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,x=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=x.slice(1,-1);return{type:"em",raw:x,text:$,tokens:this.lexer.inlineTokens($)}}let C=x.slice(2,-2);return{type:"strong",raw:x,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),x=h.slice(a,-a);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Ht=class ir{constructor(o){Ve(this,"tokens");Ve(this,"options");Ve(this,"state");Ve(this,"inlineQueue");Ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Nn,this.options.tokenizer=this.options.tokenizer||new Xo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ct,block:qo.normal,inline:so.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:so}}static lex(o,n){return new ir(n).lex(o)}static lexInline(o,n){return new ir(n).inlineTokens(o)}lex(o){o=o.replace(ct.carriageReturn,`
94
+ `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=un(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=km(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),_l(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return _l(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,x=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=x.slice(1,-1);return{type:"em",raw:x,text:$,tokens:this.lexer.inlineTokens($)}}let C=x.slice(2,-2);return{type:"strong",raw:x,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),x=h.slice(a,-a);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Ht=class lr{constructor(o){Ve(this,"tokens");Ve(this,"options");Ve(this,"state");Ve(this,"inlineQueue");Ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Tn,this.options.tokenizer=this.options.tokenizer||new Zo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ct,block:Xo.normal,inline:so.normal};this.options.pedantic?(n.block=Xo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=Xo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xo,inline:so}}static lex(o,n){return new lr(n).lex(o)}static lexInline(o,n){return new lr(n).inlineTokens(o)}lex(o){o=o.replace(ct.carriageReturn,`
95
95
  `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ct.tabCharGlobal," ").replace(ct.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.some(h=>(d=h.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
96
96
  `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
97
97
  `)?"":`
@@ -105,9 +105,9 @@ ${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
105
105
  `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=p.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
106
106
  `)?"":`
107
107
  `)+d.raw,h.text+=`
108
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,x,C,$;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((C=(x=this.options.extensions)==null?void 0:x.inline)!=null&&C.some(O=>(R=O.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let O=n.at(-1);R.type==="text"&&(O==null?void 0:O.type)==="text"?(O.raw+=R.raw,O.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let F=o;if(($=this.options.extensions)!=null&&$.startInline){let O=1/0,A=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},A),typeof y=="number"&&y>=0&&(O=Math.min(O,y))}),O<1/0&&O>=0&&(F=o.substring(0,O+1))}if(R=this.tokenizer.inlineText(F)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let O=n.at(-1);(O==null?void 0:O.type)==="text"?(O.raw+=R.raw,O.text+=R.text):n.push(R);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){Ve(this,"options");Ve(this,"parser");this.options=t||Nn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(ct.notSpaceStart))==null?void 0:c[0],a=t.replace(ct.endingNewline,"")+`
109
- `;return i?'<pre><code class="language-'+qt(i)+'">'+(n?a:qt(a,!0))+`</code></pre>
110
- `:"<pre><code>"+(n?a:qt(a,!0))+`</code></pre>
108
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,x,C,$;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((C=(x=this.options.extensions)==null?void 0:x.inline)!=null&&C.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let F=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,A=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},A),typeof y=="number"&&y>=0&&(I=Math.min(I,y))}),I<1/0&&I>=0&&(F=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(F)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){Ve(this,"options");Ve(this,"parser");this.options=t||Tn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(ct.notSpaceStart))==null?void 0:c[0],a=t.replace(ct.endingNewline,"")+`
109
+ `;return i?'<pre><code class="language-'+Yt(i)+'">'+(n?a:Yt(a,!0))+`</code></pre>
110
+ `:"<pre><code>"+(n?a:Yt(a,!0))+`</code></pre>
111
111
  `}blockquote({tokens:t}){return`<blockquote>
112
112
  ${this.parser.parse(t)}</blockquote>
113
113
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
@@ -123,20 +123,20 @@ ${this.parser.parse(t)}</blockquote>
123
123
  `}tablerow({text:t}){return`<tr>
124
124
  ${t}</tr>
125
125
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
126
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${qt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Sl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+qt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Sl(t);if(a===null)return qt(n);t=a;let c=`<img src="${t}" alt="${qt(n)}"`;return o&&(c+=` title="${qt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:qt(t.text)}},Vi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Wt=class rr{constructor(o){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=o||Nn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vi}static parse(o,n){return new rr(n).parse(o)}static parseInline(o,n){return new rr(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let u=s;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=p||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}},uo=(ei=class{constructor(t){Ve(this,"options");Ve(this,"block");this.options=t||Nn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ht.lex:Ht.lexInline}provideParser(t=this.block){return t?Wt.parse:Wt.parseInline}},Ve(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Al=class{constructor(...t){Ve(this,"defaults",_i());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",Wt);Ve(this,"Renderer",co);Ve(this,"TextRenderer",Vi);Ve(this,"Lexer",Ht);Ve(this,"Tokenizer",Xo);Ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Xo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let x=await u.call(a,p);return d.call(a,x)})();let h=u.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await u.apply(a,p);return x===!1&&(x=await d.apply(a,p)),x})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ht.lex(t,o??this.defaults)}parser(t,o){return Wt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+qt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Tn=new Al;function De(t,o){return Tn.parse(t,o)}De.options=De.setOptions=function(t){return Tn.setOptions(t),De.defaults=Tn.defaults,ul(De.defaults),De},De.getDefaults=_i,De.defaults=Nn,De.use=function(...t){return Tn.use(...t),De.defaults=Tn.defaults,ul(De.defaults),De},De.walkTokens=function(t,o){return Tn.walkTokens(t,o)},De.parseInline=Tn.parseInline,De.Parser=Wt,De.parser=Wt.parse,De.Renderer=co,De.TextRenderer=Vi,De.Lexer=Ht,De.lexer=Ht.lex,De.Tokenizer=Xo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Wt.parse,Ht.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function _l(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function ym(t){if(Array.isArray(t))return t}function Em(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function xm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wm(t,o){return ym(t)||Em(t,o)||Nm(t,o)||xm()}function Nm(t,o){if(t){if(typeof t=="string")return _l(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_l(t,o):void 0}}const Rl=Object.entries,Bl=Object.setPrototypeOf,Sm=Object.isFrozen,Tm=Object.getPrototypeOf,Cm=Object.getOwnPropertyDescriptor;let gt=Object.freeze,Lt=Object.seal,Un=Object.create,vl=typeof Reflect<"u"&&Reflect,$i=vl.apply,Pi=vl.construct;gt||(gt=function(o){return o}),Lt||(Lt=function(o){return o}),$i||($i=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Pi||(Pi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Cn=Je(Array.prototype.forEach),Mm=Je(Array.prototype.lastIndexOf),Il=Je(Array.prototype.pop),Hn=Je(Array.prototype.push),Am=Je(Array.prototype.splice),bt=Array.isArray,fo=Je(String.prototype.toLowerCase),Fi=Je(String.prototype.toString),zl=Je(String.prototype.match),Wn=Je(String.prototype.replace),Ol=Je(String.prototype.indexOf),_m=Je(String.prototype.trim),Rm=Je(Number.prototype.toString),Bm=Je(Boolean.prototype.toString),Ll=typeof BigInt>"u"?null:Je(BigInt.prototype.toString),Dl=typeof Symbol>"u"?null:Je(Symbol.prototype.toString),Ge=Je(Object.prototype.hasOwnProperty),mo=Je(Object.prototype.toString),rt=Je(RegExp.prototype.test),Gn=vm(TypeError);function Je(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return $i(t,o,i)}}function vm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Pi(t,n)}}function Ne(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Bl&&Bl(t,null),!bt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Sm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Im(t){for(let o=0;o<t.length;o++)Ge(t,o)||(t[o]=null);return t}function dt(t){const o=Un(null);for(const i of Rl(t)){var n=wm(i,2);const a=n[0],c=n[1];Ge(t,a)&&(bt(c)?o[a]=Im(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=dt(c):o[a]=c)}return o}function zm(t){switch(typeof t){case"string":return t;case"number":return Rm(t);case"boolean":return Bm(t);case"bigint":return Ll?Ll(t):"0";case"symbol":return Dl?Dl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Xt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function Xt(t,o){for(;t!==null;){const i=Cm(t,o);if(i){if(i.get)return Je(i.get);if(typeof i.value=="function")return Je(i.value)}t=Tm(t)}function n(){return null}return n}function Om(t){try{return rt(t,""),!0}catch{return!1}}const Vl=gt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ui=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hi=gt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Lm=gt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wi=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dm=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$l=gt(["#text"]),Pl=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Gi=gt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fl=gt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zo=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vm=Lt(/{{[\w\W]*|^[\w\W]*}}/g),$m=Lt(/<%[\w\W]*|^[\w\W]*%>/g),Pm=Lt(/\${[\w\W]*/g),Fm=Lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Um=Lt(/^aria-[\-\w]+$/),Ul=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hm=Lt(/^(?:\w+script|data):/i),Wm=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gm=Lt(/^html$/i),jm=Lt(/^[a-z][.\w]*(-[.\w]+)+$/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Km=function(){return typeof window>"u"?null:window},Ym=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Hl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Km();const o=_=>Wl(_);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Zt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,x=t.trustedTypes,C=u.prototype,$=Xt(C,"cloneNode"),R=Xt(C,"remove"),F=Xt(C,"nextSibling"),O=Xt(C,"childNodes"),A=Xt(C,"parentNode"),y=Xt(C,"shadowRoot"),k=Xt(C,"attributes"),m=s&&s.prototype?Xt(s.prototype,"nodeType"):null,P=s&&s.prototype?Xt(s.prototype,"nodeName"):null;if(typeof c=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let G,q="",w=0;const ie=function(g){if(w>0)throw Gn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');w++;try{return G.createHTML(g)}finally{w--}},fe=n,ce=fe.implementation,J=fe.createNodeIterator,me=fe.createDocumentFragment,ae=fe.getElementsByTagName,ke=i.importNode;let b=Hl();o.isSupported=typeof Rl=="function"&&typeof A=="function"&&ce&&ce.createHTMLDocument!==void 0;const V=Vm,W=$m,ee=Pm,ge=Fm,D=Um,z=Hm,le=Wm,be=jm;let I=Ul,N=null;const U=Ne({},[...Vl,...Ui,...Hi,...Wi,...$l]);let H=null;const oe=Ne({},[...Pl,...Gi,...Fl,...Zo]);let Ee=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),et=null,ut=null;const tt=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,nt=!0,on=!1,Dt=!0,ue=!1,ft=!0,ze=!1,Be=!1,Vt=!1,ot=!1,xt=!1,kt=!1,X=!0,re=!1;const xe="user-content-";let Ae=!0,Ue=!1,it={},wt=null;const An=Ne({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const ni=Ne({},["audio","video","img","source","image","track"]);let po=null;const oi=Ne({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",$t="http://www.w3.org/1999/xhtml";let pn=$t,ho=!1,go=null;const ji=Ne({},[Kn,Yn,$t],Fi);let bo=Ne({},["mi","mo","mn","ms","mtext"]),ko=Ne({},["annotation-xml"]);const Ki=Ne({},["title","style","font","a","script"]);let _n=null;const ii=["application/xhtml+xml","text/html"],Yi="text/html";let He=null,hn=null;const ri=n.createElement("form"),li=function(g){return g instanceof RegExp||g instanceof Function},qn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(hn&&hn===g)return;(!g||typeof g!="object")&&(g={}),g=dt(g),_n=ii.indexOf(g.PARSER_MEDIA_TYPE)===-1?Yi:g.PARSER_MEDIA_TYPE,He=_n==="application/xhtml+xml"?Fi:fo,N=Ge(g,"ALLOWED_TAGS")&&bt(g.ALLOWED_TAGS)?Ne({},g.ALLOWED_TAGS,He):U,H=Ge(g,"ALLOWED_ATTR")&&bt(g.ALLOWED_ATTR)?Ne({},g.ALLOWED_ATTR,He):oe,go=Ge(g,"ALLOWED_NAMESPACES")&&bt(g.ALLOWED_NAMESPACES)?Ne({},g.ALLOWED_NAMESPACES,Fi):ji,po=Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)?Ne(dt(oi),g.ADD_URI_SAFE_ATTR,He):oi,ti=Ge(g,"ADD_DATA_URI_TAGS")&&bt(g.ADD_DATA_URI_TAGS)?Ne(dt(ni),g.ADD_DATA_URI_TAGS,He):ni,wt=Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)?Ne({},g.FORBID_CONTENTS,He):An,et=Ge(g,"FORBID_TAGS")&&bt(g.FORBID_TAGS)?Ne({},g.FORBID_TAGS,He):dt({}),ut=Ge(g,"FORBID_ATTR")&&bt(g.FORBID_ATTR)?Ne({},g.FORBID_ATTR,He):dt({}),it=Ge(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?dt(g.USE_PROFILES):g.USE_PROFILES:!1,nn=g.ALLOW_ARIA_ATTR!==!1,nt=g.ALLOW_DATA_ATTR!==!1,on=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=g.SAFE_FOR_TEMPLATES||!1,ft=g.SAFE_FOR_XML!==!1,ze=g.WHOLE_DOCUMENT||!1,ot=g.RETURN_DOM||!1,xt=g.RETURN_DOM_FRAGMENT||!1,kt=g.RETURN_TRUSTED_TYPE||!1,Vt=g.FORCE_BODY||!1,X=g.SANITIZE_DOM!==!1,re=g.SANITIZE_NAMED_PROPS||!1,Ae=g.KEEP_CONTENT!==!1,Ue=g.IN_PLACE||!1,I=Om(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Ul,pn=typeof g.NAMESPACE=="string"?g.NAMESPACE:$t,bo=Ge(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(g.MATHML_TEXT_INTEGRATION_POINTS):Ne({},["mi","mo","mn","ms","mtext"]),ko=Ge(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?dt(g.HTML_INTEGRATION_POINTS):Ne({},["annotation-xml"]);const L=Ge(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?dt(g.CUSTOM_ELEMENT_HANDLING):Un(null);if(Ee=Un(null),Ge(L,"tagNameCheck")&&li(L.tagNameCheck)&&(Ee.tagNameCheck=L.tagNameCheck),Ge(L,"attributeNameCheck")&&li(L.attributeNameCheck)&&(Ee.attributeNameCheck=L.attributeNameCheck),Ge(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(Ee.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),ue&&(nt=!1),xt&&(ot=!0),it&&(N=Ne({},$l),H=Un(null),it.html===!0&&(Ne(N,Vl),Ne(H,Pl)),it.svg===!0&&(Ne(N,Ui),Ne(H,Gi),Ne(H,Zo)),it.svgFilters===!0&&(Ne(N,Hi),Ne(H,Gi),Ne(H,Zo)),it.mathMl===!0&&(Ne(N,Wi),Ne(H,Fl),Ne(H,Zo))),tt.tagCheck=null,tt.attributeCheck=null,Ge(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?tt.tagCheck=g.ADD_TAGS:bt(g.ADD_TAGS)&&(N===U&&(N=dt(N)),Ne(N,g.ADD_TAGS,He))),Ge(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?tt.attributeCheck=g.ADD_ATTR:bt(g.ADD_ATTR)&&(H===oe&&(H=dt(H)),Ne(H,g.ADD_ATTR,He))),Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)&&Ne(po,g.ADD_URI_SAFE_ATTR,He),Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.FORBID_CONTENTS,He)),Ge(g,"ADD_FORBID_CONTENTS")&&bt(g.ADD_FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.ADD_FORBID_CONTENTS,He)),Ae&&(N["#text"]=!0),ze&&Ne(N,["html","head","body"]),N.table&&(Ne(N,["tbody"]),delete et.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=G;G=g.TRUSTED_TYPES_POLICY;try{q=ie("")}catch(ve){throw G=Z,ve}}else G===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(G=Ym(x,a)),G&&typeof q=="string"&&(q=ie(""));(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&N===U&&(N=dt(N)),b.uponSanitizeAttribute.length>0&&H===oe&&(H=dt(H)),gt&&gt(g),hn=g},yo=Ne({},[...Ui,...Hi,...Lm]),gn=Ne({},[...Wi,...Dm]),qi=function(g){let L=A(g);(!L||!L.tagName)&&(L={namespaceURI:pn,tagName:"template"});const Z=fo(g.tagName),ve=fo(L.tagName);return go[g.namespaceURI]?g.namespaceURI===Yn?L.namespaceURI===$t?Z==="svg":L.namespaceURI===Kn?Z==="svg"&&(ve==="annotation-xml"||bo[ve]):!!yo[Z]:g.namespaceURI===Kn?L.namespaceURI===$t?Z==="math":L.namespaceURI===Yn?Z==="math"&&ko[ve]:!!gn[Z]:g.namespaceURI===$t?L.namespaceURI===Yn&&!ko[ve]||L.namespaceURI===Kn&&!bo[ve]?!1:!gn[Z]&&(Ki[Z]||!yo[Z]):!!(_n==="application/xhtml+xml"&&go[g.namespaceURI]):!1},Mt=function(g){Hn(o.removed,{element:g});try{A(g).removeChild(g)}catch{R(g)}},Jt=function(g,L){try{Hn(o.removed,{attribute:L.getAttributeNode(g),from:L})}catch{Hn(o.removed,{attribute:null,from:L})}if(L.removeAttribute(g),g==="is")if(ot||xt)try{Mt(L)}catch{}else try{L.setAttribute(g,"")}catch{}},Eo=function(g){let L=null,Z=null;if(Vt)g="<remove></remove>"+g;else{const Le=zl(g,/^[\r\n\t ]+/);Z=Le&&Le[0]}_n==="application/xhtml+xml"&&pn===$t&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const ve=G?ie(g):g;if(pn===$t)try{L=new h().parseFromString(ve,_n)}catch{}if(!L||!L.documentElement){L=ce.createDocument(pn,"template",null);try{L.documentElement.innerHTML=ho?q:ve}catch{}}const we=L.body||L.documentElement;return g&&Z&&we.insertBefore(n.createTextNode(Z),we.childNodes[0]||null),pn===$t?ae.call(L,ze?"html":"body")[0]:ze?L.documentElement:we},Xn=function(g){return J.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(g){var L,Z;g.normalize();const ve=J.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let we=ve.nextNode();for(;we;){let Xe=we.data;Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),we.data=Xe,we=ve.nextNode()}const Le=(L=(Z=g.querySelectorAll)===null||Z===void 0?void 0:Z.call(g,"template"))!==null&&L!==void 0?L:[];Cn(Array.from(Le),Xe=>{bn(Xe.content)&&Rn(Xe.content)})},Zn=function(g){const L=P?P(g):null;return typeof L!="string"||He(L)!=="form"?!1:typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||g.attributes!==k(g)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function"||g.nodeType!==m(g)||g.childNodes!==O(g)},bn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return m(g)===Zt.documentFragment}catch{return!1}},Jn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return typeof m(g)=="number"}catch{return!1}};function At(_,g,L){Cn(_,Z=>{Z.call(o,g,L,hn)})}const Qn=function(g){let L=null;if(At(b.beforeSanitizeElements,g,null),Zn(g))return Mt(g),!0;const Z=He(P?P(g):g.nodeName);if(At(b.uponSanitizeElement,g,{tagName:Z,allowedTags:N}),ft&&g.hasChildNodes()&&!Jn(g.firstElementChild)&&rt(/<[/\w!]/g,g.innerHTML)&&rt(/<[/\w!]/g,g.textContent)||ft&&g.namespaceURI===$t&&Z==="style"&&Jn(g.firstElementChild)||g.nodeType===Zt.progressingInstruction||ft&&g.nodeType===Zt.comment&&rt(/<[/\w]/g,g.data))return Mt(g),!0;if(et[Z]||!(tt.tagCheck instanceof Function&&tt.tagCheck(Z))&&!N[Z]){if(!et[Z]&&Se(Z)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z)))return!1;if(Ae&&!wt[Z]){const we=A(g),Le=O(g);if(Le&&we){const Xe=Le.length;for(let yt=Xe-1;yt>=0;--yt){const mt=$(Le[yt],!0);we.insertBefore(mt,F(g))}}}return Mt(g),!0}return(m?m(g):g.nodeType)===Zt.element&&!qi(g)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&rt(/<\/no(script|embed|frames)/i,g.innerHTML)?(Mt(g),!0):(ue&&g.nodeType===Zt.text&&(L=g.textContent,Cn([V,W,ee],we=>{L=Wn(L,we," ")}),g.textContent!==L&&(Hn(o.removed,{element:g.cloneNode()}),g.textContent=L)),At(b.afterSanitizeElements,g,null),!1)},Gt=function(g,L,Z){if(ut[L]||X&&(L==="id"||L==="name")&&(Z in n||Z in ri))return!1;const ve=H[L]||tt.attributeCheck instanceof Function&&tt.attributeCheck(L,g);if(!(nt&&!ut[L]&&rt(ge,L))){if(!(nn&&rt(D,L))){if(!ve||ut[L]){if(!(Se(g)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,g)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(g))&&(Ee.attributeNameCheck instanceof RegExp&&rt(Ee.attributeNameCheck,L)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(L,g))||L==="is"&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z))))return!1}else if(!po[L]){if(!rt(I,Wn(Z,le,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&g!=="script"&&Ol(Z,"data:")===0&&ti[g])){if(!(on&&!rt(z,Wn(Z,le,"")))){if(Z)return!1}}}}}}return!0},Oe=Ne({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Se=function(g){return!Oe[fo(g)]&&rt(be,g)},ai=function(g){At(b.beforeSanitizeAttributes,g,null);const L=g.attributes;if(!L||Zn(g))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ve=L.length;for(;ve--;){const we=L[ve],Le=we.name,Xe=we.namespaceURI,yt=we.value,mt=He(Le),xo=yt;let Ze=Le==="value"?xo:_m(xo);if(Z.attrName=mt,Z.attrValue=Ze,Z.keepAttr=!0,Z.forceKeepAttr=void 0,At(b.uponSanitizeAttribute,g,Z),Ze=Z.attrValue,re&&(mt==="id"||mt==="name")&&Ol(Ze,xe)!==0&&(Jt(Le,g),Ze=xe+Ze),ft&&rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ze)){Jt(Le,g);continue}if(mt==="attributename"&&zl(Ze,"href")){Jt(Le,g);continue}if(Z.forceKeepAttr)continue;if(!Z.keepAttr){Jt(Le,g);continue}if(!Dt&&rt(/\/>/i,Ze)){Jt(Le,g);continue}ue&&Cn([V,W,ee],wo=>{Ze=Wn(Ze,wo," ")});const en=He(g.nodeName);if(!Gt(en,mt,Ze)){Jt(Le,g);continue}if(G&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Xe)switch(x.getAttributeType(en,mt)){case"TrustedHTML":{Ze=ie(Ze);break}case"TrustedScriptURL":{Ze=G.createScriptURL(Ze);break}}if(Ze!==xo)try{Xe?g.setAttributeNS(Xe,Le,Ze):g.setAttribute(Le,Ze),Zn(g)?Mt(g):Il(o.removed)}catch{Jt(Le,g)}}At(b.afterSanitizeAttributes,g,null)},lt=function(g){let L=null;const Z=Xn(g);for(At(b.beforeSanitizeShadowDOM,g,null);L=Z.nextNode();)if(At(b.uponSanitizeShadowNode,L,null),Qn(L),ai(L),bn(L.content)&&lt(L.content),(m?m(L):L.nodeType)===Zt.element){const we=y?y(L):L.shadowRoot;bn(we)&&(Qt(we),lt(we))}At(b.afterSanitizeShadowDOM,g,null)},Qt=function(g){const L=m?m(g):g.nodeType;if(L===Zt.element){const we=y?y(g):g.shadowRoot;bn(we)&&(Qt(we),lt(we))}const Z=O?O(g):g.childNodes;if(!Z)return;const ve=[];Cn(Z,we=>{Hn(ve,we)});for(const we of ve)Qt(we);if(L===Zt.element){const we=P?P(g):null;if(typeof we=="string"&&He(we)==="template"){const Le=g.content;bn(Le)&&Qt(Le)}}};return o.sanitize=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,Z=null,ve=null,we=null;if(ho=!_,ho&&(_="<!-->"),typeof _!="string"&&!Jn(_)&&(_=zm(_),typeof _!="string"))throw Gn("dirty is not a string, aborting");if(!o.isSupported)return _;if(Be||qn(g),o.removed=[],typeof _=="string"&&(Ue=!1),Ue){const yt=P?P(_):_.nodeName;if(typeof yt=="string"){const mt=He(yt);if(!N[mt]||et[mt])throw Gn("root node is forbidden and cannot be sanitized in-place")}if(Zn(_))throw Gn("root node is clobbered and cannot be sanitized in-place");Qt(_)}else if(Jn(_))L=Eo("<!---->"),Z=L.ownerDocument.importNode(_,!0),Z.nodeType===Zt.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?L=Z:L.appendChild(Z),Qt(Z);else{if(!ot&&!ue&&!ze&&_.indexOf("<")===-1)return G&&kt?ie(_):_;if(L=Eo(_),!L)return ot?null:kt?q:""}L&&Vt&&Mt(L.firstChild);const Le=Xn(Ue?_:L);for(;ve=Le.nextNode();)Qn(ve),ai(ve),bn(ve.content)&&lt(ve.content);if(Ue)return ue&&Rn(_),_;if(ot){if(ue&&Rn(L),xt)for(we=me.call(L.ownerDocument);L.firstChild;)we.appendChild(L.firstChild);else we=L;return(H.shadowroot||H.shadowrootmode)&&(we=ke.call(i,we,!0)),we}let Xe=ze?L.outerHTML:L.innerHTML;return ze&&N["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&rt(Gm,L.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
129
- `+Xe),ue&&Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),G&&kt?ie(Xe):Xe},o.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(_),Be=!0},o.clearConfig=function(){hn=null,Be=!1},o.isValidAttribute=function(_,g,L){hn||qn({});const Z=He(_),ve=He(g);return Gt(Z,ve,L)},o.addHook=function(_,g){typeof g=="function"&&Hn(b[_],g)},o.removeHook=function(_,g){if(g!==void 0){const L=Mm(b[_],g);return L===-1?void 0:Am(b[_],L,1)[0]}return Il(b[_])},o.removeHooks=function(_){b[_]=[]},o.removeAllHooks=function(){b=Hl()},o}var qm=Wl();const Xm=new Al({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Mi(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Zm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],Jm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Qm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function ep(t){if(!t)return"";const o=Xm.parse(t,{async:!1});return qm.sanitize(o,{ALLOWED_TAGS:Zm,ALLOWED_ATTR:Jm,ALLOWED_URI_REGEXP:Qm})}const tp={class:"zm-note-panel"},np={key:0,class:"zm-note-empty"},op={class:"zm-note-header"},ip={class:"zm-note-title-row"},rp={class:"zm-note-name"},lp={class:"zm-note-meta"},ap={class:"zm-note-scroll"},sp={class:"zm-note-section"},cp={class:"zm-note-section-head"},dp={class:"zm-note-split"},up=["disabled"],fp={key:0,class:"zm-note-preview"},mp=["innerHTML"],pp={key:1,class:"zm-note-preview-hint"},hp={key:0,class:"zm-note-section-actions"},gp={key:0,class:"zm-note-add-row"},bp={key:1,class:"zm-note-section"},kp=["disabled"],yp=["href","title"],Ep={key:2,class:"zm-note-section"},xp=["disabled"],wp=["src","alt"],Np={key:3,class:"zm-note-section"},Sp={class:"zm-note-section-head"},Tp={key:0,class:"zm-note-section-tag"},Cp=["disabled"],Mp={key:0,class:"zm-note-code"},Ap=["innerHTML"],_p={key:4,class:"zm-note-section"},Rp=["disabled"],Bp={key:0,class:"zm-note-table"},Jo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);ki(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>ep(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text]},()=>{var D,z;a.value=((z=(D=n.selectedNode)==null?void 0:D.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const D=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(D){D.focus();const z=D.value.length;D.setSelectionRange(z,z)}});function h(){var le,be;if(n.readonly)return;const D=a.value,z=((be=(le=n.selectedNode)==null?void 0:le.note)==null?void 0:be.text)??"";D!==z&&i("apply",D)}function x(D){var z,le;n.readonly||(D.key==="Escape"?(D.preventDefault(),a.value=((le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text)??"",D.target.blur()):D.key==="Enter"&&(D.ctrlKey||D.metaKey)&&(D.preventDefault(),h(),D.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.link)!=null&&z.url)}),R=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.image)!=null&&z.src)}),F=e.computed(()=>{var D,z;return(z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.kind}),O=e.computed(()=>F.value==="code"),A=e.computed(()=>F.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var D;return(D=n.selectedNode)==null?void 0:D.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const G=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:le.url]},()=>{var D,z;G.value=((z=(D=n.selectedNode)==null?void 0:D.link)==null?void 0:z.url)??""},{immediate:!0});function q(){var le,be;if(n.readonly)return;const D=G.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.link)==null?void 0:be.url)??"";D!==z&&i("set-link",D)}const w=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:le.src]},()=>{var D,z;w.value=((z=(D=n.selectedNode)==null?void 0:D.image)==null?void 0:z.src)??""},{immediate:!0});function ie(){var le,be;if(n.readonly)return;const D=w.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.image)==null?void 0:be.src)??"";D!==z&&i("set-image",D)}function fe(D){const z=D.target;z.style.display="none"}function ce(D){const z=D.target;z.style.display=""}const J=e.ref(""),me=e.ref(null);ki(me,{minRows:4,maxRows:18}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;J.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});const ae=e.computed(()=>Mi(Go(J.value),wn(J.value)));function ke(){var be,I;if(n.readonly)return;const D=J.value,z=((I=(be=n.selectedNode)==null?void 0:be.richContent)==null?void 0:I.raw)??"";if(D===z)return;const le=wn(D)||void 0;i("set-rich",D?{kind:"code",raw:D,lang:le}:null)}const b=e.ref(""),V=e.ref(null);ki(V,{minRows:4,maxRows:14}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;b.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});function W(){var le,be;if(n.readonly)return;const D=b.value,z=((be=(le=n.selectedNode)==null?void 0:le.richContent)==null?void 0:be.raw)??"";D!==z&&i("set-rich",D?{kind:"table",raw:D}:null)}const ee=e.computed(()=>Ai(b.value)),ge=e.computed(()=>{const D=[];return s.value||D.push(`${a.value.length} 字`),$.value&&D.push("1 链接"),R.value&&D.push("1 图片"),O.value&&D.push("代码块"),A.value&&D.push("表格"),D.length===0?"节点没有额外内容":D.join(" · ")});return(D,z)=>{var le,be,I,N;return e.openBlock(),e.createElementBlock("div",tp,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",op,[e.createElementVNode("div",ip,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",rp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",lp,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",ap,[e.createElementVNode("section",sp,[e.createElementVNode("header",cp,[z[13]||(z[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),z[14]||(z[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",dp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":z[0]||(z[0]=U=>a.value=U),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:x},null,40,up),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",fp,[s.value?(e.openBlock(),e.createElementBlock("div",pp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,mp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",hp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=U=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=U=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!O.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=U=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=U=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",bp,[z[15]||(z[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[5]||(z[5]=U=>G.value=U),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,kp),[[e.vModelText,G.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(le=t.selectedNode.link)==null?void 0:le.url,target:"_blank",rel:"noopener noreferrer",title:(be=t.selectedNode.link)==null?void 0:be.url},e.toDisplayString((I=t.selectedNode.link)==null?void 0:I.url),9,yp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Ep,[z[16]||(z[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[7]||(z[7]=U=>w.value=U),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ie,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,xp),[[e.vModelText,w.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(N=t.selectedNode.image)==null?void 0:N.src,alt:t.selectedNode.text,onError:fe,onLoad:ce},null,40,wp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),O.value||m.value?(e.openBlock(),e.createElementBlock("section",Np,[e.createElementVNode("header",Sp,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(J.value)?(e.openBlock(),e.createElementBlock("span",Tp,e.toDisplayString(e.unref(wn)(J.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:me,"onUpdate:modelValue":z[9]||(z[9]=U=>J.value=U),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ke},null,40,Cp),[[e.vModelText,J.value]]),J.value.trim()?(e.openBlock(),e.createElementBlock("pre",Mp,[e.createElementVNode("code",{innerHTML:ae.value},null,8,Ap)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||P.value?(e.openBlock(),e.createElementBlock("section",_p,[z[18]||(z[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":z[10]||(z[10]=U=>b.value=U),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
126
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Cl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Yt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Cl(t);if(a===null)return Yt(n);t=a;let c=`<img src="${t}" alt="${Yt(n)}"`;return o&&(c+=` title="${Yt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Yt(t.text)}},Pi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Wt=class ar{constructor(o){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=o||Tn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pi}static parse(o,n){return new ar(n).parse(o)}static parseInline(o,n){return new ar(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let u=s;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=p||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}},uo=(ti=class{constructor(t){Ve(this,"options");Ve(this,"block");this.options=t||Tn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ht.lex:Ht.lexInline}provideParser(t=this.block){return t?Wt.parse:Wt.parseInline}},Ve(ti,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(ti,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ti),Rl=class{constructor(...t){Ve(this,"defaults",vi());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",Wt);Ve(this,"Renderer",co);Ve(this,"TextRenderer",Pi);Ve(this,"Lexer",Ht);Ve(this,"Tokenizer",Zo);Ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Zo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let x=await u.call(a,p);return d.call(a,x)})();let h=u.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await u.apply(a,p);return x===!1&&(x=await d.apply(a,p)),x})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ht.lex(t,o??this.defaults)}parser(t,o){return Wt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Mn=new Rl;function De(t,o){return Mn.parse(t,o)}De.options=De.setOptions=function(t){return Mn.setOptions(t),De.defaults=Mn.defaults,ml(De.defaults),De},De.getDefaults=vi,De.defaults=Tn,De.use=function(...t){return Mn.use(...t),De.defaults=Mn.defaults,ml(De.defaults),De},De.walkTokens=function(t,o){return Mn.walkTokens(t,o)},De.parseInline=Mn.parseInline,De.Parser=Wt,De.parser=Wt.parse,De.Renderer=co,De.TextRenderer=Pi,De.Lexer=Ht,De.lexer=Ht.lex,De.Tokenizer=Zo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Wt.parse,Ht.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function vl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function xm(t){if(Array.isArray(t))return t}function wm(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function Nm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(t,o){return xm(t)||wm(t,o)||Tm(t,o)||Nm()}function Tm(t,o){if(t){if(typeof t=="string")return vl(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vl(t,o):void 0}}const Bl=Object.entries,zl=Object.setPrototypeOf,Cm=Object.isFrozen,Mm=Object.getPrototypeOf,Am=Object.getOwnPropertyDescriptor;let gt=Object.freeze,Ot=Object.seal,Un=Object.create,Il=typeof Reflect<"u"&&Reflect,Fi=Il.apply,Ui=Il.construct;gt||(gt=function(o){return o}),Ot||(Ot=function(o){return o}),Fi||(Fi=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Ui||(Ui=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const An=Ze(Array.prototype.forEach),_m=Ze(Array.prototype.lastIndexOf),Ol=Ze(Array.prototype.pop),Hn=Ze(Array.prototype.push),Rm=Ze(Array.prototype.splice),bt=Array.isArray,fo=Ze(String.prototype.toLowerCase),Hi=Ze(String.prototype.toString),Ll=Ze(String.prototype.match),Wn=Ze(String.prototype.replace),Dl=Ze(String.prototype.indexOf),vm=Ze(String.prototype.trim),Bm=Ze(Number.prototype.toString),zm=Ze(Boolean.prototype.toString),Vl=typeof BigInt>"u"?null:Ze(BigInt.prototype.toString),$l=typeof Symbol>"u"?null:Ze(Symbol.prototype.toString),je=Ze(Object.prototype.hasOwnProperty),mo=Ze(Object.prototype.toString),lt=Ze(RegExp.prototype.test),Gn=Im(TypeError);function Ze(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Fi(t,o,i)}}function Im(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Ui(t,n)}}function Se(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(zl&&zl(t,null),!bt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Cm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Om(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function dt(t){const o=Un(null);for(const i of Bl(t)){var n=Sm(i,2);const a=n[0],c=n[1];je(t,a)&&(bt(c)?o[a]=Om(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=dt(c):o[a]=c)}return o}function Lm(t){switch(typeof t){case"string":return t;case"number":return Bm(t);case"boolean":return zm(t);case"bigint":return Vl?Vl(t):"0";case"symbol":return $l?$l(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=qt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function qt(t,o){for(;t!==null;){const i=Am(t,o);if(i){if(i.get)return Ze(i.get);if(typeof i.value=="function")return Ze(i.value)}t=Mm(t)}function n(){return null}return n}function Dm(t){try{return lt(t,""),!0}catch{return!1}}const Pl=gt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wi=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gi=gt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Vm=gt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ji=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$m=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fl=gt(["#text"]),Ul=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ki=gt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Hl=gt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Jo=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pm=Ot(/{{[\w\W]*|^[\w\W]*}}/g),Fm=Ot(/<%[\w\W]*|^[\w\W]*%>/g),Um=Ot(/\${[\w\W]*/g),Hm=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wm=Ot(/^aria-[\-\w]+$/),Wl=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gm=Ot(/^(?:\w+script|data):/i),jm=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Km=Ot(/^html$/i),Ym=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qm=function(){return typeof window>"u"?null:window},Xm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Gl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qm();const o=_=>jl(_);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,x=t.trustedTypes,C=u.prototype,$=qt(C,"cloneNode"),R=qt(C,"remove"),F=qt(C,"nextSibling"),I=qt(C,"childNodes"),A=qt(C,"parentNode"),y=qt(C,"shadowRoot"),k=qt(C,"attributes"),m=s&&s.prototype?qt(s.prototype,"nodeType"):null,P=s&&s.prototype?qt(s.prototype,"nodeName"):null;if(typeof c=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let G,Y="",N=0;const re=function(b){if(N>0)throw Gn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');N++;try{return G.createHTML(b)}finally{N--}},pe=n,de=pe.implementation,xe=pe.createNodeIterator,ee=pe.createDocumentFragment,ce=pe.getElementsByTagName,ue=i.importNode;let g=Gl();o.isSupported=typeof Bl=="function"&&typeof A=="function"&&de&&de.createHTMLDocument!==void 0;const V=Pm,W=Fm,te=Um,fe=Hm,L=Wm,O=Gm,ae=jm,ke=Ym;let B=Wl,S=null;const U=Se({},[...Pl,...Wi,...Gi,...ji,...Fl]);let H=null;const ne=Se({},[...Ul,...Ki,...Hl,...Jo]);let ye=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Qe=null,ut=null;const et=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let en=!0,tt=!0,tn=!1,Lt=!0,me=!1,ft=!0,Ie=!1,Be=!1,Dt=!1,nt=!1,Nt=!1,kt=!1,q=!0,le=!1;const Ee="user-content-";let Ae=!0,Ue=!1,ot={},St=null;const Rn=Se({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ni=null;const oi=Se({},["audio","video","img","source","image","track"]);let po=null;const ii=Se({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",Vt="http://www.w3.org/1999/xhtml";let mn=Vt,ho=!1,go=null;const Yi=Se({},[Kn,Yn,Vt],Hi);let bo=Se({},["mi","mo","mn","ms","mtext"]),ko=Se({},["annotation-xml"]);const qi=Se({},["title","style","font","a","script"]);let vn=null;const ri=["application/xhtml+xml","text/html"],Xi="text/html";let He=null,pn=null;const li=n.createElement("form"),ai=function(b){return b instanceof RegExp||b instanceof Function},qn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===b)return;(!b||typeof b!="object")&&(b={}),b=dt(b),vn=ri.indexOf(b.PARSER_MEDIA_TYPE)===-1?Xi:b.PARSER_MEDIA_TYPE,He=vn==="application/xhtml+xml"?Hi:fo,S=je(b,"ALLOWED_TAGS")&&bt(b.ALLOWED_TAGS)?Se({},b.ALLOWED_TAGS,He):U,H=je(b,"ALLOWED_ATTR")&&bt(b.ALLOWED_ATTR)?Se({},b.ALLOWED_ATTR,He):ne,go=je(b,"ALLOWED_NAMESPACES")&&bt(b.ALLOWED_NAMESPACES)?Se({},b.ALLOWED_NAMESPACES,Hi):Yi,po=je(b,"ADD_URI_SAFE_ATTR")&&bt(b.ADD_URI_SAFE_ATTR)?Se(dt(ii),b.ADD_URI_SAFE_ATTR,He):ii,ni=je(b,"ADD_DATA_URI_TAGS")&&bt(b.ADD_DATA_URI_TAGS)?Se(dt(oi),b.ADD_DATA_URI_TAGS,He):oi,St=je(b,"FORBID_CONTENTS")&&bt(b.FORBID_CONTENTS)?Se({},b.FORBID_CONTENTS,He):Rn,Qe=je(b,"FORBID_TAGS")&&bt(b.FORBID_TAGS)?Se({},b.FORBID_TAGS,He):dt({}),ut=je(b,"FORBID_ATTR")&&bt(b.FORBID_ATTR)?Se({},b.FORBID_ATTR,He):dt({}),ot=je(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?dt(b.USE_PROFILES):b.USE_PROFILES:!1,en=b.ALLOW_ARIA_ATTR!==!1,tt=b.ALLOW_DATA_ATTR!==!1,tn=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Lt=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=b.SAFE_FOR_TEMPLATES||!1,ft=b.SAFE_FOR_XML!==!1,Ie=b.WHOLE_DOCUMENT||!1,nt=b.RETURN_DOM||!1,Nt=b.RETURN_DOM_FRAGMENT||!1,kt=b.RETURN_TRUSTED_TYPE||!1,Dt=b.FORCE_BODY||!1,q=b.SANITIZE_DOM!==!1,le=b.SANITIZE_NAMED_PROPS||!1,Ae=b.KEEP_CONTENT!==!1,Ue=b.IN_PLACE||!1,B=Dm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Wl,mn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Vt,bo=je(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(b.MATHML_TEXT_INTEGRATION_POINTS):Se({},["mi","mo","mn","ms","mtext"]),ko=je(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?dt(b.HTML_INTEGRATION_POINTS):Se({},["annotation-xml"]);const D=je(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?dt(b.CUSTOM_ELEMENT_HANDLING):Un(null);if(ye=Un(null),je(D,"tagNameCheck")&&ai(D.tagNameCheck)&&(ye.tagNameCheck=D.tagNameCheck),je(D,"attributeNameCheck")&&ai(D.attributeNameCheck)&&(ye.attributeNameCheck=D.attributeNameCheck),je(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(ye.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),me&&(tt=!1),Nt&&(nt=!0),ot&&(S=Se({},Fl),H=Un(null),ot.html===!0&&(Se(S,Pl),Se(H,Ul)),ot.svg===!0&&(Se(S,Wi),Se(H,Ki),Se(H,Jo)),ot.svgFilters===!0&&(Se(S,Gi),Se(H,Ki),Se(H,Jo)),ot.mathMl===!0&&(Se(S,ji),Se(H,Hl),Se(H,Jo))),et.tagCheck=null,et.attributeCheck=null,je(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?et.tagCheck=b.ADD_TAGS:bt(b.ADD_TAGS)&&(S===U&&(S=dt(S)),Se(S,b.ADD_TAGS,He))),je(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?et.attributeCheck=b.ADD_ATTR:bt(b.ADD_ATTR)&&(H===ne&&(H=dt(H)),Se(H,b.ADD_ATTR,He))),je(b,"ADD_URI_SAFE_ATTR")&&bt(b.ADD_URI_SAFE_ATTR)&&Se(po,b.ADD_URI_SAFE_ATTR,He),je(b,"FORBID_CONTENTS")&&bt(b.FORBID_CONTENTS)&&(St===Rn&&(St=dt(St)),Se(St,b.FORBID_CONTENTS,He)),je(b,"ADD_FORBID_CONTENTS")&&bt(b.ADD_FORBID_CONTENTS)&&(St===Rn&&(St=dt(St)),Se(St,b.ADD_FORBID_CONTENTS,He)),Ae&&(S["#text"]=!0),Ie&&Se(S,["html","head","body"]),S.table&&(Se(S,["tbody"]),delete Qe.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=G;G=b.TRUSTED_TYPES_POLICY;try{Y=re("")}catch(ze){throw G=X,ze}}else G===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(G=Xm(x,a)),G&&typeof Y=="string"&&(Y=re(""));(g.uponSanitizeElement.length>0||g.uponSanitizeAttribute.length>0)&&S===U&&(S=dt(S)),g.uponSanitizeAttribute.length>0&&H===ne&&(H=dt(H)),gt&&gt(b),pn=b},yo=Se({},[...Wi,...Gi,...Vm]),hn=Se({},[...ji,...$m]),Zi=function(b){let D=A(b);(!D||!D.tagName)&&(D={namespaceURI:mn,tagName:"template"});const X=fo(b.tagName),ze=fo(D.tagName);return go[b.namespaceURI]?b.namespaceURI===Yn?D.namespaceURI===Vt?X==="svg":D.namespaceURI===Kn?X==="svg"&&(ze==="annotation-xml"||bo[ze]):!!yo[X]:b.namespaceURI===Kn?D.namespaceURI===Vt?X==="math":D.namespaceURI===Yn?X==="math"&&ko[ze]:!!hn[X]:b.namespaceURI===Vt?D.namespaceURI===Yn&&!ko[ze]||D.namespaceURI===Kn&&!bo[ze]?!1:!hn[X]&&(qi[X]||!yo[X]):!!(vn==="application/xhtml+xml"&&go[b.namespaceURI]):!1},Tt=function(b){Hn(o.removed,{element:b});try{A(b).removeChild(b)}catch{R(b)}},Zt=function(b,D){try{Hn(o.removed,{attribute:D.getAttributeNode(b),from:D})}catch{Hn(o.removed,{attribute:null,from:D})}if(D.removeAttribute(b),b==="is")if(nt||Nt)try{Tt(D)}catch{}else try{D.setAttribute(b,"")}catch{}},Eo=function(b){let D=null,X=null;if(Dt)b="<remove></remove>"+b;else{const Le=Ll(b,/^[\r\n\t ]+/);X=Le&&Le[0]}vn==="application/xhtml+xml"&&mn===Vt&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ze=G?re(b):b;if(mn===Vt)try{D=new h().parseFromString(ze,vn)}catch{}if(!D||!D.documentElement){D=de.createDocument(mn,"template",null);try{D.documentElement.innerHTML=ho?Y:ze}catch{}}const Ne=D.body||D.documentElement;return b&&X&&Ne.insertBefore(n.createTextNode(X),Ne.childNodes[0]||null),mn===Vt?ce.call(D,Ie?"html":"body")[0]:Ie?D.documentElement:Ne},Xn=function(b){return xe.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Bn=function(b){var D,X;b.normalize();const ze=xe.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=ze.nextNode();for(;Ne;){let qe=Ne.data;An([V,W,te],Et=>{qe=Wn(qe,Et," ")}),Ne.data=qe,Ne=ze.nextNode()}const Le=(D=(X=b.querySelectorAll)===null||X===void 0?void 0:X.call(b,"template"))!==null&&D!==void 0?D:[];An(Array.from(Le),qe=>{gn(qe.content)&&Bn(qe.content)})},Zn=function(b){const D=P?P(b):null;return typeof D!="string"||He(D)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==k(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==m(b)||b.childNodes!==I(b)},gn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Xt.documentFragment}catch{return!1}},Jn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function Ct(_,b,D){An(_,X=>{X.call(o,b,D,pn)})}const Qn=function(b){let D=null;if(Ct(g.beforeSanitizeElements,b,null),Zn(b))return Tt(b),!0;const X=He(P?P(b):b.nodeName);if(Ct(g.uponSanitizeElement,b,{tagName:X,allowedTags:S}),ft&&b.hasChildNodes()&&!Jn(b.firstElementChild)&&lt(/<[/\w!]/g,b.innerHTML)&&lt(/<[/\w!]/g,b.textContent)||ft&&b.namespaceURI===Vt&&X==="style"&&Jn(b.firstElementChild)||b.nodeType===Xt.progressingInstruction||ft&&b.nodeType===Xt.comment&&lt(/<[/\w]/g,b.data))return Tt(b),!0;if(Qe[X]||!(et.tagCheck instanceof Function&&et.tagCheck(X))&&!S[X]){if(!Qe[X]&&we(X)&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X)))return!1;if(Ae&&!St[X]){const Ne=A(b),Le=I(b);if(Le&&Ne){const qe=Le.length;for(let Et=qe-1;Et>=0;--Et){const mt=$(Le[Et],!0);Ne.insertBefore(mt,F(b))}}}return Tt(b),!0}return(m?m(b):b.nodeType)===Xt.element&&!Zi(b)||(X==="noscript"||X==="noembed"||X==="noframes")&&lt(/<\/no(script|embed|frames)/i,b.innerHTML)?(Tt(b),!0):(me&&b.nodeType===Xt.text&&(D=b.textContent,An([V,W,te],Ne=>{D=Wn(D,Ne," ")}),b.textContent!==D&&(Hn(o.removed,{element:b.cloneNode()}),b.textContent=D)),Ct(g.afterSanitizeElements,b,null),!1)},Gt=function(b,D,X){if(ut[D]||q&&(D==="id"||D==="name")&&(X in n||X in li))return!1;const ze=H[D]||et.attributeCheck instanceof Function&&et.attributeCheck(D,b);if(!(tt&&!ut[D]&&lt(fe,D))){if(!(en&&lt(L,D))){if(!ze||ut[D]){if(!(we(b)&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,b)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(b))&&(ye.attributeNameCheck instanceof RegExp&&lt(ye.attributeNameCheck,D)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(D,b))||D==="is"&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X))))return!1}else if(!po[D]){if(!lt(B,Wn(X,ae,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&b!=="script"&&Dl(X,"data:")===0&&ni[b])){if(!(tn&&!lt(O,Wn(X,ae,"")))){if(X)return!1}}}}}}return!0},Oe=Se({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),we=function(b){return!Oe[fo(b)]&&lt(ke,b)},si=function(b){Ct(g.beforeSanitizeAttributes,b,null);const D=b.attributes;if(!D||Zn(b))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ze=D.length;for(;ze--;){const Ne=D[ze],Le=Ne.name,qe=Ne.namespaceURI,Et=Ne.value,mt=He(Le),xo=Et;let Xe=Le==="value"?xo:vm(xo);if(X.attrName=mt,X.attrValue=Xe,X.keepAttr=!0,X.forceKeepAttr=void 0,Ct(g.uponSanitizeAttribute,b,X),Xe=X.attrValue,le&&(mt==="id"||mt==="name")&&Dl(Xe,Ee)!==0&&(Zt(Le,b),Xe=Ee+Xe),ft&&lt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Xe)){Zt(Le,b);continue}if(mt==="attributename"&&Ll(Xe,"href")){Zt(Le,b);continue}if(X.forceKeepAttr)continue;if(!X.keepAttr){Zt(Le,b);continue}if(!Lt&&lt(/\/>/i,Xe)){Zt(Le,b);continue}me&&An([V,W,te],wo=>{Xe=Wn(Xe,wo," ")});const nn=He(b.nodeName);if(!Gt(nn,mt,Xe)){Zt(Le,b);continue}if(G&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!qe)switch(x.getAttributeType(nn,mt)){case"TrustedHTML":{Xe=re(Xe);break}case"TrustedScriptURL":{Xe=G.createScriptURL(Xe);break}}if(Xe!==xo)try{qe?b.setAttributeNS(qe,Le,Xe):b.setAttribute(Le,Xe),Zn(b)?Tt(b):Ol(o.removed)}catch{Zt(Le,b)}}Ct(g.afterSanitizeAttributes,b,null)},yt=function(b){let D=null;const X=Xn(b);for(Ct(g.beforeSanitizeShadowDOM,b,null);D=X.nextNode();)if(Ct(g.uponSanitizeShadowNode,D,null),Qn(D),si(D),gn(D.content)&&yt(D.content),(m?m(D):D.nodeType)===Xt.element){const Ne=y?y(D):D.shadowRoot;gn(Ne)&&(Jt(Ne),yt(Ne))}Ct(g.afterSanitizeShadowDOM,b,null)},Jt=function(b){const D=m?m(b):b.nodeType;if(D===Xt.element){const Ne=y?y(b):b.shadowRoot;gn(Ne)&&(Jt(Ne),yt(Ne))}const X=I?I(b):b.childNodes;if(!X)return;const ze=[];An(X,Ne=>{Hn(ze,Ne)});for(const Ne of ze)Jt(Ne);if(D===Xt.element){const Ne=P?P(b):null;if(typeof Ne=="string"&&He(Ne)==="template"){const Le=b.content;gn(Le)&&Jt(Le)}}};return o.sanitize=function(_){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,X=null,ze=null,Ne=null;if(ho=!_,ho&&(_="<!-->"),typeof _!="string"&&!Jn(_)&&(_=Lm(_),typeof _!="string"))throw Gn("dirty is not a string, aborting");if(!o.isSupported)return _;if(Be||qn(b),o.removed=[],typeof _=="string"&&(Ue=!1),Ue){const Et=P?P(_):_.nodeName;if(typeof Et=="string"){const mt=He(Et);if(!S[mt]||Qe[mt])throw Gn("root node is forbidden and cannot be sanitized in-place")}if(Zn(_))throw Gn("root node is clobbered and cannot be sanitized in-place");Jt(_)}else if(Jn(_))D=Eo("<!---->"),X=D.ownerDocument.importNode(_,!0),X.nodeType===Xt.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?D=X:D.appendChild(X),Jt(X);else{if(!nt&&!me&&!Ie&&_.indexOf("<")===-1)return G&&kt?re(_):_;if(D=Eo(_),!D)return nt?null:kt?Y:""}D&&Dt&&Tt(D.firstChild);const Le=Xn(Ue?_:D);for(;ze=Le.nextNode();)Qn(ze),si(ze),gn(ze.content)&&yt(ze.content);if(Ue)return me&&Bn(_),_;if(nt){if(me&&Bn(D),Nt)for(Ne=ee.call(D.ownerDocument);D.firstChild;)Ne.appendChild(D.firstChild);else Ne=D;return(H.shadowroot||H.shadowrootmode)&&(Ne=ue.call(i,Ne,!0)),Ne}let qe=Ie?D.outerHTML:D.innerHTML;return Ie&&S["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&lt(Km,D.ownerDocument.doctype.name)&&(qe="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
129
+ `+qe),me&&An([V,W,te],Et=>{qe=Wn(qe,Et," ")}),G&&kt?re(qe):qe},o.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(_),Be=!0},o.clearConfig=function(){pn=null,Be=!1},o.isValidAttribute=function(_,b,D){pn||qn({});const X=He(_),ze=He(b);return Gt(X,ze,D)},o.addHook=function(_,b){typeof b=="function"&&Hn(g[_],b)},o.removeHook=function(_,b){if(b!==void 0){const D=_m(g[_],b);return D===-1?void 0:Rm(g[_],D,1)[0]}return Ol(g[_])},o.removeHooks=function(_){g[_]=[]},o.removeAllHooks=function(){g=Gl()},o}var Zm=jl();const Jm=new Rl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=_i(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Qm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],ep=["href","title","target","rel","src","alt","class","checked","type","disabled"],tp=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function np(t){if(!t)return"";const o=Jm.parse(t,{async:!1});return Zm.sanitize(o,{ALLOWED_TAGS:Qm,ALLOWED_ATTR:ep,ALLOWED_URI_REGEXP:tp})}const op={class:"zm-note-panel"},ip={key:0,class:"zm-note-empty"},rp={class:"zm-note-header"},lp={class:"zm-note-title-row"},ap={class:"zm-note-name"},sp={class:"zm-note-meta"},cp={class:"zm-note-scroll"},dp={class:"zm-note-section"},up={class:"zm-note-section-head"},fp={class:"zm-note-split"},mp=["disabled"],pp={key:0,class:"zm-note-preview"},hp=["innerHTML"],gp={key:1,class:"zm-note-preview-hint"},bp={key:0,class:"zm-note-section-actions"},kp={key:0,class:"zm-note-add-row"},yp={key:1,class:"zm-note-section"},Ep=["disabled"],xp=["href","title"],wp={key:2,class:"zm-note-section"},Np=["disabled"],Sp=["src","alt"],Tp={key:3,class:"zm-note-section"},Cp={class:"zm-note-section-head"},Mp={key:0,class:"zm-note-section-tag"},Ap=["disabled"],_p={key:0,class:"zm-note-code"},Rp=["innerHTML"],vp={key:4,class:"zm-note-section"},Bp=["disabled"],zp={key:0,class:"zm-note-table"},Qo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);Ei(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>np(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:ae.text]},()=>{var L,O;a.value=((O=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:O.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const L=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(L){L.focus();const O=L.value.length;L.setSelectionRange(O,O)}});function h(){var ae,ke;if(n.readonly)return;const L=a.value,O=((ke=(ae=n.selectedNode)==null?void 0:ae.note)==null?void 0:ke.text)??"";L!==O&&i("apply",L)}function x(L){var O,ae;n.readonly||(L.key==="Escape"?(L.preventDefault(),a.value=((ae=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:ae.text)??"",L.target.blur()):L.key==="Enter"&&(L.ctrlKey||L.metaKey)&&(L.preventDefault(),h(),L.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var L,O;return!!((O=(L=n.selectedNode)==null?void 0:L.link)!=null&&O.url)}),R=e.computed(()=>{var L,O;return!!((O=(L=n.selectedNode)==null?void 0:L.image)!=null&&O.src)}),F=e.computed(()=>{var L,O;return(O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.kind}),I=e.computed(()=>F.value==="code"),A=e.computed(()=>F.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var L;return(L=n.selectedNode)==null?void 0:L.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const G=e.ref("");e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:ae.url]},()=>{var L,O;G.value=((O=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:O.url)??""},{immediate:!0});function Y(){var ae,ke;if(n.readonly)return;const L=G.value.trim(),O=((ke=(ae=n.selectedNode)==null?void 0:ae.link)==null?void 0:ke.url)??"";L!==O&&i("set-link",L)}const N=e.ref("");e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:ae.src]},()=>{var L,O;N.value=((O=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:O.src)??""},{immediate:!0});function re(){var ae,ke;if(n.readonly)return;const L=N.value.trim(),O=((ke=(ae=n.selectedNode)==null?void 0:ae.image)==null?void 0:ke.src)??"";L!==O&&i("set-image",L)}function pe(L){const O=L.target;O.style.display="none"}function de(L){const O=L.target;O.style.display=""}const xe=e.ref(""),ee=e.ref(null);Ei(ee,{minRows:4,maxRows:18}),e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:ae.raw]},()=>{var L,O;xe.value=((O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.raw)??""},{immediate:!0});const ce=e.computed(()=>_i(jo(xe.value),Sn(xe.value)));function ue(){var ke,B;if(n.readonly)return;const L=xe.value,O=((B=(ke=n.selectedNode)==null?void 0:ke.richContent)==null?void 0:B.raw)??"";if(L===O)return;const ae=Sn(L)||void 0;i("set-rich",L?{kind:"code",raw:L,lang:ae}:null)}const g=e.ref(""),V=e.ref(null);Ei(V,{minRows:4,maxRows:14}),e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:ae.raw]},()=>{var L,O;g.value=((O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.raw)??""},{immediate:!0});function W(){var ae,ke;if(n.readonly)return;const L=g.value,O=((ke=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:ke.raw)??"";L!==O&&i("set-rich",L?{kind:"table",raw:L}:null)}const te=e.computed(()=>Ri(g.value)),fe=e.computed(()=>{const L=[];return s.value||L.push(`${a.value.length} 字`),$.value&&L.push("1 链接"),R.value&&L.push("1 图片"),I.value&&L.push("代码块"),A.value&&L.push("表格"),L.length===0?"节点没有额外内容":L.join(" · ")});return(L,O)=>{var ae,ke,B,S;return e.openBlock(),e.createElementBlock("div",op,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",rp,[e.createElementVNode("div",lp,[O[12]||(O[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",ap,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",sp,e.toDisplayString(fe.value),1)]),e.createElementVNode("div",cp,[e.createElementVNode("section",dp,[e.createElementVNode("header",up,[O[13]||(O[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),O[14]||(O[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",fp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":O[0]||(O[0]=U=>a.value=U),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:x},null,40,mp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",pp,[s.value?(e.openBlock(),e.createElementBlock("div",gp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,hp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",bp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:O[1]||(O[1]=U=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:O[2]||(O[2]=U=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:O[3]||(O[3]=U=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:O[4]||(O[4]=U=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",yp,[O[15]||(O[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":O[5]||(O[5]=U=>G.value=U),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:Y,onKeydown:O[6]||(O[6]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,Ep),[[e.vModelText,G.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ae=t.selectedNode.link)==null?void 0:ae.url,target:"_blank",rel:"noopener noreferrer",title:(ke=t.selectedNode.link)==null?void 0:ke.url},e.toDisplayString((B=t.selectedNode.link)==null?void 0:B.url),9,xp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",wp,[O[16]||(O[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":O[7]||(O[7]=U=>N.value=U),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:re,onKeydown:O[8]||(O[8]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,Np),[[e.vModelText,N.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(S=t.selectedNode.image)==null?void 0:S.src,alt:t.selectedNode.text,onError:pe,onLoad:de},null,40,Sp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Tp,[e.createElementVNode("header",Cp,[O[17]||(O[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Sn)(xe.value)?(e.openBlock(),e.createElementBlock("span",Mp,e.toDisplayString(e.unref(Sn)(xe.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":O[9]||(O[9]=U=>xe.value=U),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ue},null,40,Ap),[[e.vModelText,xe.value]]),xe.value.trim()?(e.openBlock(),e.createElementBlock("pre",_p,[e.createElementVNode("code",{innerHTML:ce.value},null,8,Rp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||P.value?(e.openBlock(),e.createElementBlock("section",vp,[O[18]||(O[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":O[10]||(O[10]=U=>g.value=U),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
130
130
  | --- | --- |
131
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:W},null,40,Rp),[[e.vModelText,b.value]]),ee.value.length?(e.openBlock(),e.createElementBlock("table",Bp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(U,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U,(oe,Ee)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ee}`},e.toDisplayString(oe),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U,(oe,Ee)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ee}`},e.toDisplayString(oe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",np,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),vp=["viewBox","width","height"],Ip={class:"zm-edges"},zp=["d","fill"],Op=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Lp=["src","width","height","alt"],Dp=["onDblclick"],Vp={key:0,class:"zm-rich-code"},$p=["innerHTML"],Pp={key:1,class:"zm-rich-table"},Fp={key:2,class:"zm-text"},Up={key:0,class:"zm-node-markers"},Hp=["title","innerHTML"],Wp={class:"zm-text-label"},Gp=["href","title"],jp=["title","onClick"],Kp={key:4,class:"zm-node-tags"},Yp=["title"],qp=["title","onClick"],Xp=["onClick"],Zp=["onMousedown"],Jp=["onClick"],Qp=["title"],eh={class:"zm-tb-tip zm-tb-zoom"},th=["src"],nh=["src"],Mn=24,jn=400,mn=160,Gl=4,Qo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),x=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),F=e.computed(()=>{const r=C.value;if(!r||!r.currentTargetId||!r.dropPosition||r.dropPosition==="child")return null;const l=rn.value.find(B=>B.id===r.currentTargetId);if(!l)return null;const f=l.width/2,S=l.height/2;if(l._dir==="down"){const B=r.dropPosition==="before"?l.x-f:l.x+f;return{x1:B,y1:l.y-S,x2:B,y2:l.y+S,horizontal:!1}}const E=r.dropPosition==="before"?l.y-S:l.y+S;return{x1:l.x-f,y1:E,x2:l.x+f,y2:E,horizontal:!0}}),O=e.ref(null),A=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(It(i.data)),P=e.ref({}),G=e.ref({}),q=e.ref(i.markdown!==void 0);let w=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){q.value=!1;return}q.value=!0;const l=On(r||"");w=!0,m.value=It(l),d.value=new Set,h.value=new Set,Se(),e.nextTick(()=>{w=!1,ln()})}),e.watch(m,()=>{q.value&&!w&&a("markdownChange",Ln(m.value))},{deep:!0});const ie=e.computed(()=>_.showOrderBadge===!0),fe=e.ref(new Map),ce=fe.value;function J(r,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?ce.delete(r):ce.set(r,f),fe.value=new Map(ce)}function me(r){return ce.get(r)??{}}function ae(r,l){const f=he(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,Mn,jn),height:V(l.height,Mn,jn)},Oe(),Se(),a("change",m.value))}function ke(r){const l=he(m.value,r);!l||!l.image||(delete l.image,Oe(),Se(),a("change",m.value))}function b(r,l){const f=l.trim();if(!he(m.value,r))return;if(!f){ke(r);return}const E=new Image;E.onload=()=>{const B=he(m.value,r);if(!B)return;const M=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,v=V(E.naturalWidth||mn,Mn,jn),j=Math.round(v/M);B.image={src:f,naturalW:E.naturalWidth||v,naturalH:E.naturalHeight||j,width:v,height:j},Oe(),Se(),a("change",m.value)},E.onerror=()=>{},E.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function W(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const S=f.result,E=new window.Image;E.onload=()=>{const B=E.naturalWidth||mn,M=E.naturalHeight||mn,v=V(B,Mn,mn),j=V(Math.round(M*v/B),Mn,jn);l({src:S,naturalW:B,naturalH:M,width:v,height:j})},E.onerror=()=>{l({src:S,naturalW:mn,naturalH:mn,width:mn,height:mn})},E.src=S},f.readAsDataURL(r)}function ee(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var S;const f=(S=l.files)==null?void 0:S[0];f&&(W(f,E=>ae(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function ge(r,l){const f=l.trim(),S=he(m.value,r);S&&(f?S.link={url:f}:delete S.link,Oe(),Se(),a("change",m.value))}function D(r){ge(r,"")}function z(r,l){const f=he(m.value,r);f&&(l?f.note={text:l}:delete f.note,Oe(),Se(),a("change",m.value))}function le(r){z(r,"")}function be(r,l){const f=he(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Oe(),Se(),a("change",m.value))}const I=e.ref(null),N=e.ref(null),U=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),H=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function oe(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),N.value=null,d.value=new Set([l.id]),at(),I.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function Ee(){I.value=null}function et(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(di&&pe.panMoved.value){di=!1,r.preventDefault();return}r.preventDefault(),I.value&&(I.value=null),N.value={x:r.clientX,y:r.clientY}}}function ut(){N.value=null}function tt(){ut(),i.builtInDrawers&&(xt(),ze.value=!0),a("canvas-settings")}function nn(){ut(),i.builtInDrawers&&(xt(),Dt.value=!0),a("canvas-data")}function nt(r){ut(),i.builtInDrawers&&(xt(),Vt.value=r,Dt.value=!0),a("canvas-import",r)}const on=e.ref(!1),Dt=e.ref(!1),ue=e.ref(!1),ft=e.ref(!1),ze=e.ref(!1),Be=e.ref(0),Vt=e.ref(null),ot=e.ref(new Set);function xt(){Dt.value=!1,ue.value=!1,ft.value=!1,ze.value=!1}const kt=e.computed(()=>{const r=p.value;return r?he(m.value,r)??null:null}),X=e.computed(()=>kt.value?me(kt.value.id):{});function re(r){r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)}function xe(r){kt.value&&J(kt.value.id,r)}function Ae(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};_.autoBalanceOnChange=r.autoBalanceOnChange,_.lineWidthStart=r.lineWidthStart,_.lineWidthEnd=r.lineWidthEnd,_.rainbowBranch=r.rainbowBranch,_.branchPaletteId=r.branchPaletteId,_.customPalettes=r.customPalettes,_.lineStyle=r.lineStyle,_.rootLineStyle=r.rootLineStyle,_.lineOrigin=r.lineOrigin,_.layoutMode=r.layoutMode,_.taperedEdge=r.taperedEdge,_.lineWidthTaper=r.lineWidthTaper,_.elbowRadius=r.elbowRadius,_.showOrderBadge=r.showOrderBadge,_.canvasBg=r.canvasBg}function Ue(){Vt.value=null}function it(r){const l=p.value;l&&z(l,r)}function wt(){const r=p.value;r&&le(r)}function An(r){const l=p.value;l&&ge(l,r)}function ti(r){const l=p.value;l&&b(l,r)}function ni(r){const l=p.value;l&&be(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function oi(r){ma(r.id,r.text)}function Kn(r){no(r)}function Yn(r){si(r)}function $t(r){Qi(r.srcId,r.targetId,r.position)}function pn(r){const l=new Set(ot.value);l.has(r)?l.delete(r):l.add(r),ot.value=l}function ho(){i.builtInDrawers&&(on.value=!on.value),a("canvas-outline")}function go(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ee(r)}function ji(){var S,E,B;const r=(S=I.value)==null?void 0:S.nodeId;if(!r)return;const l=((B=(E=he(m.value,r))==null?void 0:E.link)==null?void 0:B.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&ge(r,f)}function bo(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&D(r)}function ko(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ri(r)}function Ki(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&le(r)}function _n(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ke(r)}function ii(){var ye,T;const r=(ye=I.value)==null?void 0:ye.nodeId;if(!r)return;const l=(T=he(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",S=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=S?"```"+S+`
132
- `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?E+f+(f.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(M===null)return;const v=M.trim();if(!v){be(r,null);return}const j=/^```([^\s`]*)/.exec(v),K=j?j[1]:void 0;be(r,{kind:"code",raw:v,lang:K})}function Yi(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&be(r,null)}function He(){var M,v;const r=(M=I.value)==null?void 0:M.nodeId;if(!r)return;const l=(v=he(m.value,r))==null?void 0:v.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
131
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:W},null,40,Bp),[[e.vModelText,g.value]]),te.value.length?(e.openBlock(),e.createElementBlock("table",zp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(U,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U,(ne,ye)=>(e.openBlock(),e.createElementBlock("th",{key:`h${ye}`},e.toDisplayString(ne),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U,(ne,ye)=>(e.openBlock(),e.createElementBlock("td",{key:`c${ye}`},e.toDisplayString(ne),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",ip,[...O[11]||(O[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Ip=["viewBox","width","height"],Op={class:"zm-edges"},Lp=["d","fill"],Dp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Vp=["src","width","height","alt"],$p=["onDblclick"],Pp={key:0,class:"zm-rich-code"},Fp=["innerHTML"],Up={key:1,class:"zm-rich-table"},Hp={key:2,class:"zm-text"},Wp={key:0,class:"zm-node-markers"},Gp=["title","innerHTML"],jp={class:"zm-text-label"},Kp=["href","title"],Yp=["title","onClick"],qp={key:4,class:"zm-node-tags"},Xp=["title"],Zp=["title","onClick"],Jp=["onClick"],Qp=["onMousedown"],eh=["onClick"],th=["title"],nh=["src"],oh=["src"],_n=24,jn=400,fn=160,Kl=4,ei=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),x=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),F=e.computed(()=>{const r=C.value;if(!r||!r.currentTargetId||!r.dropPosition||r.dropPosition==="child")return null;const l=on.value.find(v=>v.id===r.currentTargetId);if(!l)return null;const f=l.width/2,w=l.height/2;if(l._dir==="down"){const v=r.dropPosition==="before"?l.x-f:l.x+f;return{x1:v,y1:l.y-w,x2:v,y2:l.y+w,horizontal:!1}}const E=r.dropPosition==="before"?l.y-w:l.y+w;return{x1:l.x-f,y1:E,x2:l.x+f,y2:E,horizontal:!0}}),I=e.ref(null),A=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(Bt(i.data)),P=e.ref({}),G=e.ref({}),Y=e.ref(i.markdown!==void 0);let N=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){Y.value=!1;return}Y.value=!0;const l=On(r||"");N=!0,m.value=Bt(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>{N=!1,rn()})}),e.watch(m,()=>{Y.value&&!N&&a("markdownChange",Ln(m.value))},{deep:!0});const re=e.computed(()=>_.showOrderBadge===!0),pe=e.ref(new Map),de=pe.value;function xe(r,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?de.delete(r):de.set(r,f),pe.value=new Map(de)}function ee(r){return de.get(r)??{}}function ce(r,l){const f=be(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,_n,jn),height:V(l.height,_n,jn)},Oe(),we(),a("change",m.value))}function ue(r){const l=be(m.value,r);!l||!l.image||(delete l.image,Oe(),we(),a("change",m.value))}function g(r,l){const f=l.trim();if(!be(m.value,r))return;if(!f){ue(r);return}const E=new Image;E.onload=()=>{const v=be(m.value,r);if(!v)return;const M=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,z=V(E.naturalWidth||fn,_n,jn),Z=Math.round(z/M);v.image={src:f,naturalW:E.naturalWidth||z,naturalH:E.naturalHeight||Z,width:z,height:Z},Oe(),we(),a("change",m.value)},E.onerror=()=>{},E.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function W(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const w=f.result,E=new window.Image;E.onload=()=>{const v=E.naturalWidth||fn,M=E.naturalHeight||fn,z=V(v,_n,fn),Z=V(Math.round(M*z/v),_n,jn);l({src:w,naturalW:v,naturalH:M,width:z,height:Z})},E.onerror=()=>{l({src:w,naturalW:fn,naturalH:fn,width:fn,height:fn})},E.src=w},f.readAsDataURL(r)}function te(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var w;const f=(w=l.files)==null?void 0:w[0];f&&(W(f,E=>ce(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function fe(r,l){const f=l.trim(),w=be(m.value,r);w&&(f?w.link={url:f}:delete w.link,Oe(),we(),a("change",m.value))}function L(r){fe(r,"")}function O(r,l){const f=be(m.value,r);f&&(l?f.note={text:l}:delete f.note,Oe(),we(),a("change",m.value))}function ae(r){O(r,"")}function ke(r,l){const f=be(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Oe(),we(),a("change",m.value))}const B=e.ref(null),S=e.ref(null),U=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),H=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function ne(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),S.value=null,d.value=new Set([l.id]),at(),B.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ye(){B.value=null}function Qe(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ui&&he.panMoved.value){ui=!1,r.preventDefault();return}r.preventDefault(),B.value&&(B.value=null),S.value={x:r.clientX,y:r.clientY}}}function ut(){S.value=null}function et(){ut(),i.builtInDrawers&&(Nt(),Ie.value=!0),a("canvas-settings")}function en(){ut(),i.builtInDrawers&&(Nt(),Lt.value=!0),a("canvas-data")}function tt(r){ut(),i.builtInDrawers&&(Nt(),Dt.value=r,Lt.value=!0),a("canvas-import",r)}const tn=e.ref(!1),Lt=e.ref(!1),me=e.ref(!1),ft=e.ref(!1),Ie=e.ref(!1),Be=e.ref(0),Dt=e.ref(null),nt=e.ref(new Set);function Nt(){Lt.value=!1,me.value=!1,ft.value=!1,Ie.value=!1}const kt=e.computed(()=>{const r=p.value;return r?be(m.value,r)??null:null}),q=e.computed(()=>kt.value?ee(kt.value.id):{});function le(r){r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.1,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)}function Ee(r){kt.value&&xe(kt.value.id,r)}function Ae(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};_.autoBalanceOnChange=r.autoBalanceOnChange,_.lineWidthStart=r.lineWidthStart,_.lineWidthEnd=r.lineWidthEnd,_.rainbowBranch=r.rainbowBranch,_.branchPaletteId=r.branchPaletteId,_.customPalettes=r.customPalettes,_.lineStyle=r.lineStyle,_.rootLineStyle=r.rootLineStyle,_.lineOrigin=r.lineOrigin,_.layoutMode=r.layoutMode,_.taperedEdge=r.taperedEdge,_.lineWidthTaper=r.lineWidthTaper,_.elbowRadius=r.elbowRadius,_.showOrderBadge=r.showOrderBadge,_.canvasBg=r.canvasBg}function Ue(){Dt.value=null}function ot(r){const l=p.value;l&&O(l,r)}function St(){const r=p.value;r&&ae(r)}function Rn(r){const l=p.value;l&&fe(l,r)}function ni(r){const l=p.value;l&&g(l,r)}function oi(r){const l=p.value;l&&ke(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function ii(r){ha(r.id,r.text)}function Kn(r){no(r)}function Yn(r){ci(r)}function Vt(r){tr(r.srcId,r.targetId,r.position)}function mn(r){const l=new Set(nt.value);l.has(r)?l.delete(r):l.add(r),nt.value=l}function ho(){i.builtInDrawers&&(tn.value=!tn.value),a("canvas-outline")}function go(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&te(r)}function Yi(){var w,E,v;const r=(w=B.value)==null?void 0:w.nodeId;if(!r)return;const l=((v=(E=be(m.value,r))==null?void 0:E.link)==null?void 0:v.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&fe(r,f)}function bo(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&L(r)}function ko(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&li(r)}function qi(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ae(r)}function vn(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ue(r)}function ri(){var oe,T;const r=(oe=B.value)==null?void 0:oe.nodeId;if(!r)return;const l=(T=be(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?jo(l.raw):"",w=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=w?"```"+w+`
132
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?E+f+(f.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(M===null)return;const z=M.trim();if(!z){ke(r,null);return}const Z=/^```([^\s`]*)/.exec(z),j=Z?Z[1]:void 0;ke(r,{kind:"code",raw:z,lang:j})}function Xi(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ke(r,null)}function He(){var M,z;const r=(M=B.value)==null?void 0:M.nodeId;if(!r)return;const l=(z=be(m.value,r))==null?void 0:z.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
133
133
  | --- | --- | --- |
134
- | a | b | c |`);if(E===null)return;const B=E.trim();if(!B){be(r,null);return}be(r,{kind:"table",raw:B})}function hn(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&be(r,null)}function ri(r){i.previewMode||(d.value=new Set([r]),at(),i.builtInDrawers&&(xt(),ft.value=!0,Be.value++),a("edit-note",r))}function li(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function qn(r){var E;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const S=(E=r.clipboardData)==null?void 0:E.items;if(S)for(let B=0;B<S.length;B++){const M=S[B];if(M.kind==="file"&&M.type.startsWith("image/")){const v=M.getAsFile();if(!v)continue;r.preventDefault();const j=he(m.value,f);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;W(v,K=>ae(f,K));return}}}e.onMounted(()=>{window.addEventListener("paste",qn),window.addEventListener("keydown",yo),Se()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",qn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const gn=e.ref(null),qi=e.computed(()=>{var r;return((r=gn.value)==null?void 0:r.nodeId)??null});function Mt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,S=l.image.naturalH||l.image.height,E=S>0?S/f:1;gn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:S,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Jt),window.addEventListener("mouseup",Eo)}function Jt(r){var j,K;const l=gn.value;if(!l)return;const f=pe.scale.value||1,S=r.clientX-l.startX,E=V(l.startW+S/f,Mn,jn),B=V(E*l.ratio,Mn,jn);l.pendingW=E,l.pendingH=B;const M=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${E}px`,M.style.height=`${B}px`);const v=(K=c.value)==null?void 0:K.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,v.style.height=`${Math.ceil(B+8+30)}px`)}function Eo(){const r=gn.value;if(window.removeEventListener("mousemove",Jt),window.removeEventListener("mouseup",Eo),gn.value=null,!r)return;const l=he(m.value,r.nodeId);!l||!l.image||(ae(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),at(),Rn=!0)}const Xn=e.ref(null);let Rn=!1;function Zn(r){Xn.value=r}function bn(r){Xn.value===r&&(Xn.value=null),A.value&&(A.value=null)}function Jn(r,l){var de;if(!l.text||l.text.length<14)return;const S=r.currentTarget.getBoundingClientRect(),E=(de=c.value)==null?void 0:de.getBoundingClientRect();if(!E)return;const B=10,M=240,v=S.top-E.top>60,j=S.left-E.left+S.width/2,K=B+M/2,ye=E.width-M/2-B,T=Math.max(K,Math.min(j,ye)),Q=v?S.top-E.top-8:S.bottom-E.top+8;A.value={text:l.text,x:T,y:Q,above:v}}const At=e.ref(0),Qn=e.ref(!1),Gt=is(100);function Oe(){Gt.record({data:m.value,selectedIds:[...d.value]})}function Se(){h.value=new Set(h.value),At.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{At.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(S=>{let E=S,B=null;for(;E&&!B;)B=E.getAttribute("data-node-id"),E=E.parentElement;if(!B)return;const M=S.offsetHeight,v=S.scrollWidth,j=Math.round(M*2)/2,K=Math.round(v*2)/2;l[B]=j,f[B]=K,P.value[B],G.value[B]}),P.value=l,G.value=f}const lt=e.computed(()=>{var r,l,f,S,E,B,M,v,j,K;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((S=i.theme)==null?void 0:S.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((B=i.theme)==null?void 0:B.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((j=i.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((K=i.theme)==null?void 0:K.rainbowBranch)??!1}}),Qt=e.computed(()=>_.canvasBg||lt.value.bgColor),_=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0});function g(r){return r?_.rootLineStyle:_.lineStyle}function L(r){return _.taperedEdge?ve(r):we(r)}function Z(r){return _.taperedEdge?_.lineWidthEnd:we(r)}function ve(r){const l=_.lineWidthTaper,f=_.lineWidthStart*Math.pow(l,r);return Math.max(_.lineWidthEnd,f)}function we(r){if(r<=0)return _.lineWidthStart;if(r>=3)return _.lineWidthEnd;const l=r/3;return _.lineWidthStart+(_.lineWidthEnd-_.lineWidthStart)*l}function Le(r,l,f,S){const E=1-r,B=E*E*E*l.x+3*E*E*r*f.x1+3*E*r*r*f.x2+r*r*r*S.x,M=E*E*E*l.y+3*E*E*r*f.y1+3*E*r*r*f.y2+r*r*r*S.y;return{x:B,y:M}}function Xe(r,l,f,S){const E=1-r,B=E*E*l.x+2*E*r*f.x+r*r*S.x,M=E*E*l.y+2*E*r*f.y+r*r*S.y;return{x:B,y:M}}function yt(r,l,f,S,E=32,B="curve",M="right"){if(B==="curve"){let v;if(M==="right"||M==="left"){const de=Math.abs(l.x-r.x)*.45,se=M==="right"?1:-1;v={x1:r.x+se*de,y1:r.y,x2:l.x-se*de,y2:l.y}}else{const de=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+de,x2:l.x,y2:l.y-de}}const j=Q=>{const de=1-Q,se=-3*de*de*r.x+3*(de*de-2*de*Q)*v.x1+3*(2*de*Q-Q*Q)*v.x2+3*Q*Q*l.x,Te=-3*de*de*r.y+3*(de*de-2*de*Q)*v.y1+3*(2*de*Q-Q*Q)*v.y2+3*Q*Q*l.y;return{dx:se,dy:Te}},K=[],ye=[];for(let Q=0;Q<=E;Q++){const de=Q/E,se=Q===0?r:Q===E?l:Le(de,r,v,l),Te=j(de);let Ie=Math.hypot(Te.dx,Te.dy);Ie<1e-6&&(Ie=1);const Me=-Te.dy/Ie,te=Te.dx/Ie,ne=(f+(S-f)*de)/2;K.push({x:se.x+Me*ne,y:se.y+te*ne}),ye.push({x:se.x-Me*ne,y:se.y-te*ne})}let T=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let Q=1;Q<=E;Q++)T+=` L ${K[Q].x.toFixed(2)} ${K[Q].y.toFixed(2)}`;for(let Q=E;Q>=0;Q--)T+=` L ${ye[Q].x.toFixed(2)} ${ye[Q].y.toFixed(2)}`;return T+=" Z",T}if(B==="arc"){let v;M==="right"||M==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const j=se=>{const Te=1-se,Ie=2*Te*(v.x-r.x)+2*se*(l.x-v.x),Me=2*Te*(v.y-r.y)+2*se*(l.y-v.y);return{dx:Ie,dy:Me}},K=[],ye=[];for(let se=0;se<=E;se++){const Te=se/E,Ie=se===0?r:se===E?l:Xe(Te,r,v,l),Me=j(Te);let te=Math.hypot(Me.dx,Me.dy);te<1e-6&&(te=1);const ne=-Me.dy/te,je=Me.dx/te,Y=(f+(S-f)*Te)/2;K.push({x:Ie.x+ne*Y,y:Ie.y+je*Y}),ye.push({x:Ie.x-ne*Y,y:Ie.y-je*Y})}const T=f/2,Q=S/2;let de=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let se=1;se<=E;se++)de+=` L ${K[se].x.toFixed(2)} ${K[se].y.toFixed(2)}`;de+=` A ${Q.toFixed(2)} ${Q.toFixed(2)} 0 0 0 ${ye[E].x.toFixed(2)} ${ye[E].y.toFixed(2)}`;for(let se=E-1;se>=0;se--)de+=` L ${ye[se].x.toFixed(2)} ${ye[se].y.toFixed(2)}`;return de+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`,de+=" Z",de}if(B==="elbow"){const v=[];if(M==="down"){const te=(r.y+l.y)/2;v.push(r,{x:r.x,y:te},{x:l.x,y:te},l)}else{const te=(r.x+l.x)/2;v.push(r,{x:te,y:r.y},{x:te,y:l.y},l)}const j=[];let K=0;for(let te=0;te<v.length-1;te++){const ne=Math.hypot(v[te+1].x-v[te].x,v[te+1].y-v[te].y);j.push(ne),K+=ne}const ye=[f/2];let T=0;for(let te=0;te<j.length-1;te++){T+=j[te];const ne=K>0?T/K:0;ye.push((f+(S-f)*ne)/2)}ye.push(S/2);const Q=[];for(let te=0;te<v.length-1;te++){const ne=v[te+1].x-v[te].x,je=v[te+1].y-v[te].y;let Y=Math.hypot(ne,je);Y<1e-6&&(Y=1),Q.push({x:-je/Y,y:ne/Y})}const de=[],se=[];de.push({x:v[0].x+Q[0].x*ye[0],y:v[0].y+Q[0].y*ye[0]}),se.push({x:v[0].x-Q[0].x*ye[0],y:v[0].y-Q[0].y*ye[0]});for(let te=1;te<v.length-1;te++){const ne=Q[te-1],je=Q[te],Y=ye[te];de.push({x:v[te].x+ne.x*Y+je.x*Y,y:v[te].y+ne.y*Y+je.y*Y}),se.push({x:v[te].x-ne.x*Y-je.x*Y,y:v[te].y-ne.y*Y-je.y*Y})}const Te=Q[Q.length-1],Ie=ye[ye.length-1];de.push({x:v[v.length-1].x+Te.x*Ie,y:v[v.length-1].y+Te.y*Ie}),se.push({x:v[v.length-1].x-Te.x*Ie,y:v[v.length-1].y-Te.y*Ie});let Me=`M ${de[0].x.toFixed(2)} ${de[0].y.toFixed(2)}`;for(let te=1;te<de.length;te++)Me+=` L ${de[te].x.toFixed(2)} ${de[te].y.toFixed(2)}`;for(let te=se.length-1;te>=0;te--)Me+=` L ${se[te].x.toFixed(2)} ${se[te].y.toFixed(2)}`;return Me+=" Z",Me}if(B==="rounded-elbow"){let v=function(Y,$e,Nt){const Pt={x:Y.pos.x-$e*Y.d1.x,y:Y.pos.y-$e*Y.d1.y},Bn={x:Y.pos.x+$e*Y.d2.x,y:Y.pos.y+$e*Y.d2.y},St={x:Y.pos.x+$e*(Y.d2.x-Y.d1.x),y:Y.pos.y+$e*(Y.d2.y-Y.d1.y)},vn=Math.atan2(Pt.y-St.y,Pt.x-St.x);let We=Math.atan2(Bn.y-St.y,Bn.x-St.x)-vn;for(;We>Math.PI;)We-=2*Math.PI;for(;We<-Math.PI;)We+=2*Math.PI;const Ke=[];for(let Ct=1;Ct<Nt;Ct++){const Pe=Ct/Nt,Kt=vn+We*Pe;Ke.push({x:St.x+$e*Math.cos(Kt),y:St.y+$e*Math.sin(Kt)})}return Ke};const j=[];let K;if(M==="down"){const Y=(r.y+l.y)/2,$e=Math.sign(Y-r.y)||1,Nt=Math.sign(l.x-r.x)||1,Pt=Math.sign(l.y-Y)||1;K=[{pos:{x:r.x,y:Y},d1:{x:0,y:$e},d2:{x:Nt,y:0}},{pos:{x:l.x,y:Y},d1:{x:Nt,y:0},d2:{x:0,y:Pt}}]}else{const Y=(r.x+l.x)/2,$e=Math.sign(Y-r.x)||1,Nt=Math.sign(l.y-r.y)||1,Pt=Math.sign(l.x-Y)||1;K=[{pos:{x:Y,y:r.y},d1:{x:$e,y:0},d2:{x:0,y:Nt}},{pos:{x:Y,y:l.y},d1:{x:0,y:Nt},d2:{x:Pt,y:0}}]}const ye=Math.hypot(K[0].pos.x-r.x,K[0].pos.y-r.y),T=Math.hypot(K[1].pos.x-K[0].pos.x,K[1].pos.y-K[0].pos.y),Q=Math.hypot(l.x-K[1].pos.x,l.y-K[1].pos.y),de=Math.min(ye,T,Q,_.elbowRadius)*.45,se=Math.max(2,de);j.push(r),j.push({x:K[0].pos.x-se*K[0].d1.x,y:K[0].pos.y-se*K[0].d1.y});for(const Y of v(K[0],se,7))j.push(Y);j.push({x:K[1].pos.x-se*K[1].d1.x,y:K[1].pos.y-se*K[1].d1.y});for(const Y of v(K[1],se,7))j.push(Y);j.push(l);const Te=[];let Ie=0;for(let Y=0;Y<j.length-1;Y++){const $e=Math.hypot(j[Y+1].x-j[Y].x,j[Y+1].y-j[Y].y);Te.push($e),Ie+=$e}const Me=[],te=[];let ne=0;for(let Y=0;Y<j.length;Y++){const $e=j[Math.max(0,Y-1)],Nt=j[Math.min(j.length-1,Y+1)],Pt=Nt.x-$e.x,Bn=Nt.y-$e.y;let St=Math.hypot(Pt,Bn);St<1e-6&&(St=1);const vn=-Bn/St,Tt=Pt/St;Y>0&&(ne+=Te[Y-1]);const We=Ie>0?ne/Ie:0,Ke=(f+(S-f)*We)/2;Me.push({x:j[Y].x+vn*Ke,y:j[Y].y+Tt*Ke}),te.push({x:j[Y].x-vn*Ke,y:j[Y].y-Tt*Ke})}let je=`M ${Me[0].x.toFixed(2)} ${Me[0].y.toFixed(2)}`;for(let Y=1;Y<Me.length;Y++)je+=` L ${Me[Y].x.toFixed(2)} ${Me[Y].y.toFixed(2)}`;je+=` L ${te[Me.length-1].x.toFixed(2)} ${te[Me.length-1].y.toFixed(2)}`;for(let Y=te.length-2;Y>=0;Y--)je+=` L ${te[Y].x.toFixed(2)} ${te[Y].y.toFixed(2)}`;return je+=" Z",je}{const v=l.x-r.x,j=l.y-r.y;let K=Math.hypot(v,j);K<1e-6&&(K=1);const ye=-j/K,T=v/K,Q=f/2,de=S/2,se={x:r.x+ye*Q,y:r.y+T*Q},Te={x:r.x-ye*Q,y:r.y-T*Q},Ie={x:l.x-ye*de,y:l.y-T*de},Me={x:l.x+ye*de,y:l.y+T*de};return`M ${se.x.toFixed(2)} ${se.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ie.x.toFixed(2)} ${Ie.y.toFixed(2)} L ${Te.x.toFixed(2)} ${Te.y.toFixed(2)} Z`}}const mt=e.computed(()=>pt.value.root.children),xo=dn[0].colors,Ze=e.computed(()=>Wa(_.branchPaletteId,_.customPalettes)),en=e.computed(()=>{const r=new Map;if(!_.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Ze.value.colors.length>0?Ze.value.colors:xo;for(let E=0;E<mt.value.length;E++){const B=mt.value[E];r.set(B.id,f[E%f.length])}const S=(E,B)=>{r.set(E.id,B);for(const M of E.children)S(M,B)};for(let E=0;E<mt.value.length;E++){const B=mt.value[E];S(B,f[E%f.length])}return r});function wo(r,l){return _.rainbowBranch?en.value.get(l.id)??lt.value.lineColor:lt.value.lineColor}function Kl(r){const l=me(r.id);if(l.bg)return l.bg;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return sh(f,.18)}return lt.value.branchBg}function eo(r){const l=me(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return lt.value.rootText;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.55)}return lt.value.branchText}function to(r){const l=me(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.3)}return lt.value.lineColor}function Yl(r){const l=me(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function ql(r){return me(r.id).fontSize??r.fontSize??lt.value.fontSize}function sh(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=parseInt(S.slice(0,2),16),B=parseInt(S.slice(2,4),16),M=parseInt(S.slice(4,6),16);return`rgba(${E}, ${B}, ${M}, ${l})`}function Xl(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=Math.round(parseInt(S.slice(0,2),16)*(1-l)),B=Math.round(parseInt(S.slice(2,4),16)*(1-l)),M=Math.round(parseInt(S.slice(4,6),16)*(1-l));return`rgb(${E}, ${B}, ${M})`}const pe=ts({getContainer:()=>c.value});pe.setOnMarqueeEnd(Mh),os({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:gh,onRemove:ca,onStartEdit:No,onClearSelection:()=>{d.value=new Set,at()},onDuplicate:na,onCopy:la,onCut:aa,onPaste:sa,hasClipboard:()=>!!O.value&&O.value.nodes.length>0,onUndo:Zi,onRedo:Ji,onNavigate:bh,onMoveSibling:Eh,onSelectRoot:()=>{d.value=new Set([m.value.id]),at()}});const pt=e.computed(()=>{const r=It(m.value);return Ql(r),Pa(r,{mode:_.layoutMode,baseFontSize:lt.value.fontSize,richHeights:P.value,richWidths:G.value})}),Zl=e.ref([]),rn=e.computed(()=>(At.value,Zl.value));e.watch(pt,r=>{const l=[],f=S=>{l.push(S);for(const E of S.children)f(E)};f(r.root),Zl.value=l},{immediate:!0});const Jl=e.computed(()=>{const r=[];for(const l of rn.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),ch=e.computed(()=>`${pt.value.vbX} ${pt.value.vbY} ${pt.value.vbW} ${pt.value.vbH}`);function Ql(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Ql(l)}function No(r){const l=he(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),at(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),ea(f)}))}function Xi(){if(!s.value)return;const r=he(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function dh(){s.value=null}function ea(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function uh(r){ea(r.target)}function fh(r){if(i.previewMode)return;const l=he(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function ta(){if(!y.value)return;const r=y.value,l=he(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const S=wn(f)||void 0;be(r,{kind:"code",raw:f,lang:S})}else be(r,{kind:"table",raw:f});y.value=null}function mh(){y.value=null}function ph(r){r.key==="Escape"?(r.preventDefault(),mh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),ta())}function hh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Zi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Ji())}function no(r){const l=yr(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=Er(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function gh(r){if(r===m.value.id){no(r);return}const l=Xa(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function na(r){if(r===m.value.id)return;const l=Za(m.value,r);l&&(Oe(),d.value=new Set([l.id]),at(),a("change",m.value),Se())}function oa(r){const l=[],f=new Set;for(const S of r)S!==m.value.id&&(f.has(S)||he(m.value,S)&&(f.add(S),l.push(S)));return l}function ia(r){const l=new Set(r),f=[],S=E=>{l.has(E.id)&&f.push(E.id);for(const B of E.children)S(B)};return S(m.value),f}function ra(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function la(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const S of l){const E=xr(m.value,S);E&&f.push(E)}f.length!==0&&(O.value={nodes:f,originalIds:new Set(l)},ra(f.map(S=>S.text).join(`
135
- `)),Se())}function aa(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const S of l){const E=xr(m.value,S);E&&f.push(E)}if(f.length!==0){Oe();for(const S of l)Ro(m.value,S);d.value=new Set,at(),O.value={nodes:f,originalIds:new Set(l)},ra(f.map(S=>S.text).join(`
136
- `)),Se(),a("change",m.value)}}function sa(r){const l=O.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,S=he(m.value,f);if(S){for(const E of l.originalIds){const B=he(m.value,E);if(B&&he(B,f))return}Oe();for(const E of l.nodes){const B=It(E);Bo(B),S.children.push(B)}O.value=null,Se(),a("change",m.value)}}function Zi(){const r=Gt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function Ji(){const r=Gt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function at(){const r=[];for(const l of d.value){const f=he(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ft.value&&ka(l.id)&&(xt(),ft.value=!0)}else i.builtInDrawers&&r.length===0&&(ft.value=!1);a("select",r.length>0?r:null)}function bh(r,l){const f=p.value??m.value.id,S=he(m.value,f);if(!S)return;let E=null;if(l===1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>=0&&M<B.children.length-1&&(E=B.children[M+1].id)}}else if(l===-1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>0&&(E=B.children[M-1].id)}}else if(r===1){const B=zt(m.value,S.id);B&&(E=B.id)}else r===-1&&S.children.length>0&&(E=S.children[0].id);E&&(d.value=new Set([E]),at())}function ca(r){if(r!==m.value.id&&Ro(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,at()}Se(),a("change",m.value)}}function da(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Se()}function ua(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:S}=l.pop();r(f,S);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:S+1})}}function kh(){h.value=new Set,ua(r=>{r.children.length>0&&h.value.add(r.id)}),Se()}function fa(r){h.value=new Set,ua((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),Se()}function yh(){h.value=new Set,Se()}function ma(r,l){qa(m.value,r,l)&&(Oe(),Se(),a("change",m.value))}function Qi(r,l,f){return hi(m.value,r,l,f)?(Oe(),Se(),a("change",m.value),!0):!1}function Eh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const S=zt(f,l);if(!S)return;const E=S.children.findIndex(v=>v.id===l);if(E<0)return;let B=r;const M=rn.value.find(v=>v.id===l);if(M&&ha(M)&&(B=-r),B<0){if(E===0)return;const v=S.children[E-1].id;hi(f,l,v,"before")}else{if(E>=S.children.length-1)return;const v=S.children[E+1].id;hi(f,l,v,"after")}Oe(),Se(),a("change",f)}function xh(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);at()}function wh(r,l,f){let S=null;for(const E of rn.value){if(E.id===f)continue;const B=E.width/2,M=E.height/2;r>=E.x-B&&r<=E.x+B&&l>=E.y-M&&l<=E.y+M&&(S=E)}return S}let jt=null;function Nh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const S=c.value.getBoundingClientRect(),E=l.x*pe.scale.value+pe.offsetX.value,B=l.y*pe.scale.value+pe.offsetY.value,M=r.clientX-S.left-E,v=r.clientY-S.top-B;jt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",pa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function pa(r){if(jt){const M=r.clientX-jt.startX,v=r.clientY-jt.startY;if(Math.abs(M)<=Gl&&Math.abs(v)<=Gl)return;C.value={srcId:jt.srcId,srcText:jt.srcText,pointerOffsetX:jt.pointerOffsetX,pointerOffsetY:jt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),jt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value,B=wh(S,E,l.srcId);l.currentTargetId=(B==null?void 0:B.id)??null,B?l.dropPosition=Sh(S,E,B):l.dropPosition=null}function Sh(r,l,f){if(f.isRoot)return"child";const S=f.width/2,E=f.height/2;if(f._dir==="down"){const M=r-f.x;return M<-S*.3?"before":M>S*.3?"after":"child"}const B=l-f.y;return B<-E*.3?"before":B>E*.3?"after":"child"}function ha(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function ci(r){if(window.removeEventListener("pointermove",pa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),jt){jt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const S=rn.value.find(E=>E.id===l.currentTargetId);S&&ha(S)&&(f=f==="before"?"after":"before")}Qi(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),at()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let di=!1;function Th(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,pe.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value;pe.startMarquee(S,E,{shift:r.shiftKey})}function Ch(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=pe.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,at())}function Mh(){const r=pe.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,S=r.x+r.width,E=r.y+r.height,B=[];for(const M of rn.value){const v=M.width/2,j=M.height/2,K=M.x-v,ye=M.x+v,T=M.y-j,Q=M.y+j;K<=S&&ye>=l&&T<=E&&Q>=f&&B.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...B]):new Set(B),at()}function ga(r){return h.value.has(r)}function Ah(r){const l=he(m.value,r.id);return!!l&&l.children.length>0}function er(r){const l=he(m.value,r);return l?l.children.length:0}function ba(r){if(!he(m.value,r))return 0;const S=[m.value];for(;S.length;){const E=S.pop(),B=E.children.findIndex(M=>M.id===r);if(B>=0)return B;for(const M of E.children)S.push(M)}return 0}function ui(r,l,f,S){const E=(S==null?void 0:S._dir)??r._dir;if(l==="out"&&r.isRoot&&_.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&_.lineOrigin==="proportional"&&S){const v=pt.value.root.children;if(E==="down"){const de=v.reduce((Me,te)=>Math.max(Me,Math.abs(te.x-r.x)),1),se=Math.min(1,Math.abs(S.x-r.x)/de),Te=r.y+r.height/2,Ie=r.y;return{x:r.x,y:Te+(Ie-Te)*se}}const j=v.reduce((de,se)=>Math.max(de,Math.abs(se.y-r.y)),1),K=Math.min(1,Math.abs(S.y-r.y)/j),ye=f!==void 0?f:r.side,T=r.x+ye*(r.width/2),Q=r.x;return{x:T+(Q-T)*K,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let B;l==="in"?B=-r.side:f!==void 0?B=f:B=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+B*(r.width/2-M),y:r.y}}function ln(){const r=pt.value;pe.resetView(r.width,r.height,r.root.y)}function _h(){Qn.value=!0,Oe(),Se(),e.nextTick(()=>ln())}function tr(r){_.layoutMode!==r&&(_.layoutMode=r,Se(),e.nextTick(()=>ln()))}function Rh(){return JSON.stringify(m.value,null,2)}function ka(r){const l=he(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Bh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Gt.reset(),m.value=It(l),d.value=new Set,h.value=new Set,Se(),e.nextTick(()=>ln()),a("change",m.value),!0)}catch{return!1}}const ya=e.ref(""),an=e.ref([]),So=e.ref(-1);function vh(r){ya.value=r;const l=r.trim();if(!l){an.value=[],So.value=-1;return}const f=l.toLowerCase(),S=[],E=B=>{var M;(B.text.toLowerCase().includes(f)||(M=B.note)!=null&&M.text&&B.note.text.toLowerCase().includes(f))&&S.push(B.id);for(const v of B.children)E(v)};E(m.value),an.value=S,So.value=S.length>0?0:-1,S.length>0&&(Lh(S),e.nextTick(()=>Dh(0)))}function Ih(r){return an.value.includes(r)}function zh(r){return So.value>=0&&an.value[So.value]===r}function Oh(r){return ya.value.trim().length>0&&an.value.length>0&&!an.value.includes(r)}function Lh(r){if(r.length===0)return;const l=new Set(r),f=new Set,S=E=>{let B=l.has(E.id);for(const M of E.children)S(M)&&(B=!0);return B&&E.children.length>0&&h.value.has(E.id)&&f.add(E.id),B};if(S(m.value),f.size>0){for(const E of f)h.value.delete(E);Se()}}function Dh(r){const l=an.value[r];if(!l)return;const f=rn.value.find(S=>S.id===l);f&&(d.value=new Set([l]),at(),pe.centerOn(f.x,f.y,f.width,f.height))}function Vh(r,l){const f=he(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),Se(),a("change",m.value)))}function $h(r,l){const f=he(m.value,r);if(!f||!f.markers)return;const S=f.markers.indexOf(l);S<0||(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value))}function Ea(r,l){const f=he(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const S=f.markers.indexOf(l);return S>=0?(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value),!1):(f.markers.push(l),Oe(),Se(),a("change",m.value),!0)}function Ph(r){const l=he(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Fh(r){var f;const l=(f=I.value)==null?void 0:f.nodeId;l&&Ea(l,r)}function Uh(){var f;const r=(f=I.value)==null?void 0:f.nodeId;if(!r)return;const l=he(m.value,r);!l||!l.markers||(delete l.markers,Oe(),Se(),a("change",m.value),Ee())}function nr(r,l){const f=he(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),Se(),a("change",m.value))}function Hh(r){const l=he(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Wh(){var B,M;const r=(B=I.value)==null?void 0:B.nodeId;if(!r)return;const l=he(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",S=window.prompt("输入标签(多个用逗号分隔)",f);if(S===null)return;const E=S.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);nr(r,E),Ee()}function Gh(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&(nr(r,[]),Ee())}function xa(){const r=pt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const S=document.createElementNS(l,"rect");S.setAttribute("x",String(r.vbX)),S.setAttribute("y",String(r.vbY)),S.setAttribute("width",String(r.vbW)),S.setAttribute("height",String(r.vbH)),S.setAttribute("fill",Qt.value),f.appendChild(S);for(const M of Jl.value){const v=document.createElementNS(l,"path");v.setAttribute("d",yt(ui(M.from,"out",M.to.side,M.to),ui(M.to,"in"),L(M.from.depth),Z(M.to.depth),32,g(M.from.isRoot),M.to._dir)),v.setAttribute("fill",wo(M.from,M.to)),v.setAttribute("stroke","none"),f.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function B(M,v){let j=0;for(const K of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(K)?j+=v:j+=v*.55;return j}for(const M of rn.value){const v=M.x-M.width/2,j=M.y-M.height/2,K=document.createElementNS(l,"rect");K.setAttribute("x",String(v)),K.setAttribute("y",String(j)),K.setAttribute("width",String(M.width)),K.setAttribute("height",String(M.height)),K.setAttribute("rx","8"),K.setAttribute("fill",Kl(M)),K.setAttribute("stroke",to(M)),K.setAttribute("stroke-width","1"),f.appendChild(K);const ye=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Q=!!M.image,de=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let se=0,Te=0;if(de){const We=M.richContent,Ke=M.fontSize*.78*.92,Ct=6,Pe=4,Kt=2,kn=6;if(We.kind==="code"){const _t=Go(We.raw),Et=wn(We.raw),Rt=_t.split(`
137
- `),tn=Ke*1.35;let Ft=0;for(const Fe of Rt)Ft=Math.max(Ft,B(Fe,Ke));Te=Math.min(Ft+Ct*2+4,M.width-4),se=Rt.length*tn+Pe*2+Kt;const Qe=M.x-Te/2;let ht=j+4;Q&&(ht=j+M.image.height+kn);const Bt=document.createElementNS(l,"rect");if(Bt.setAttribute("x",String(Qe)),Bt.setAttribute("y",String(ht)),Bt.setAttribute("width",String(Te)),Bt.setAttribute("height",String(se-Kt)),Bt.setAttribute("rx","6"),Bt.setAttribute("fill","rgba(255,255,255,0.55)"),Bt.setAttribute("stroke",to(M)),Bt.setAttribute("stroke-width","1"),f.appendChild(Bt),Et){const Fe=document.createElementNS(l,"text");Fe.setAttribute("x",String(Qe+Te-Ct)),Fe.setAttribute("y",String(ht+Pe+4)),Fe.setAttribute("text-anchor","end"),Fe.setAttribute("fill",eo(M)),Fe.setAttribute("font-size",String(Ke*.8)),Fe.setAttribute("font-family",E),Fe.setAttribute("opacity","0.5"),Fe.textContent=Et,f.appendChild(Fe)}const Co="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Fe=0;Fe<Rt.length;Fe++){const st=document.createElementNS(l,"text");st.setAttribute("x",String(Qe+Ct)),st.setAttribute("y",String(ht+Pe+(Fe+.5)*tn+2)),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",eo(M)),st.setAttribute("font-size",String(Ke)),st.setAttribute("font-family",Co);let Ut=Rt[Fe];const Ye=Math.floor((Te-Ct*2)/(Ke*.6));Ut.length>Ye&&(Ut=Ut.substring(0,Ye-1)+"…"),st.textContent=Ut,f.appendChild(st)}}else if(We.kind==="table"){const _t=Ai(We.raw);if(_t.length>0){const Et=Ke*1.35,Rt=6,tn=3,Ft=_t[0].length,Qe=[];for(let Ye=0;Ye<Ft;Ye++){let sn=0;for(const yn of _t)Ye<yn.length&&(sn=Math.max(sn,B(yn[Ye],Ke)));Qe.push(sn+Rt*2)}Te=Math.min(Qe.reduce((Ye,sn)=>Ye+sn,0),M.width-4);const ht=Te/Qe.reduce((Ye,sn)=>Ye+sn,0);for(let Ye=0;Ye<Ft;Ye++)Qe[Ye]*=ht;se=_t.length*(Et+tn*2)+Kt;const Bt=M.x-Te/2;let Co=j+4;Q&&(Co=j+M.image.height+kn);const Fe=document.createElementNS(l,"rect");Fe.setAttribute("x",String(Bt)),Fe.setAttribute("y",String(Co)),Fe.setAttribute("width",String(Te)),Fe.setAttribute("height",String(se-Kt)),Fe.setAttribute("rx","6"),Fe.setAttribute("fill","rgba(255,255,255,0.55)"),Fe.setAttribute("stroke",to(M)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe);let st=Bt,Ut=Co;for(let Ye=0;Ye<_t.length;Ye++){const sn=_t[Ye],yn=Et+tn*2;st=Bt;for(let Mo=0;Mo<Ft;Mo++){const oo=Qe[Mo],jh=sn[Mo]||"";if(Mo<Ft-1){const qe=document.createElementNS(l,"line");qe.setAttribute("x1",String(st+oo)),qe.setAttribute("y1",String(Ut)),qe.setAttribute("x2",String(st+oo)),qe.setAttribute("y2",String(Ut+yn)),qe.setAttribute("stroke",to(M)),qe.setAttribute("stroke-width","1"),f.appendChild(qe)}if(Ye<_t.length-1){const qe=document.createElementNS(l,"line");qe.setAttribute("x1",String(st)),qe.setAttribute("y1",String(Ut+yn)),qe.setAttribute("x2",String(st+oo)),qe.setAttribute("y2",String(Ut+yn)),qe.setAttribute("stroke",to(M)),qe.setAttribute("stroke-width","1"),f.appendChild(qe)}if(Ye===0){const qe=document.createElementNS(l,"rect");qe.setAttribute("x",String(st)),qe.setAttribute("y",String(Ut)),qe.setAttribute("width",String(oo)),qe.setAttribute("height",String(yn)),qe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(qe)}const cn=document.createElementNS(l,"text");cn.setAttribute("x",String(st+Rt)),cn.setAttribute("y",String(Ut+tn+Et/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",eo(M)),cn.setAttribute("font-size",String(Ke)),cn.setAttribute("font-family",E),Ye===0&&cn.setAttribute("font-weight","600");let fi=jh;const or=Math.floor((oo-Rt*2)/(Ke*.55));fi.length>or&&or>2&&(fi=fi.substring(0,or-1)+"…"),cn.textContent=fi,f.appendChild(cn),st+=oo}Ut+=yn}}}}let Ie=0;if(Q){const We=M.image,Ke=j+4,Ct=M.x-We.width/2,Pe=document.createElementNS(l,"image");Pe.setAttribute("x",String(Ct)),Pe.setAttribute("y",String(Ke)),Pe.setAttribute("width",String(We.width)),Pe.setAttribute("height",String(We.height)),Pe.setAttribute("href",We.src),Pe.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",We.src),Pe.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Pe),Ie=We.height+6}let Me=M.y;const te=Ie+se;te>0?Me=j+te+(M.height-te)/2:ye&&(Me=M.y-8);const ne=14,je=2,Y=4,$e=T?M.markers.length:0,Nt=$e>0?$e*ne+($e-1)*je+Y:0,Pt=B(M.text,M.fontSize),Bn=Nt+Pt,St=M.x-Bn/2;if(T){let We=St;for(const Ke of M.markers){const Ct=zo(Ke);if(Ct){const Pe=document.createElementNS(l,"svg");Pe.setAttribute("x",String(We)),Pe.setAttribute("y",String(Me-ne/2)),Pe.setAttribute("width",String(ne)),Pe.setAttribute("height",String(ne)),Pe.setAttribute("viewBox","0 0 24 24"),Pe.setAttribute("color",eo(M));const kn=new DOMParser().parseFromString(`<svg xmlns="${l}">${Ct}</svg>`,"image/svg+xml");if(!kn.querySelector("parsererror"))for(;kn.documentElement.firstChild;)Pe.appendChild(kn.documentElement.firstChild);f.appendChild(Pe)}We+=ne+je}}const vn=T?St+Nt+Pt/2:M.x,Tt=document.createElementNS(l,"text");if(Tt.setAttribute("x",String(vn)),Tt.setAttribute("y",String(Me)),Tt.setAttribute("text-anchor","middle"),Tt.setAttribute("dominant-baseline","central"),Tt.setAttribute("fill",eo(M)),Tt.setAttribute("font-size",String(ql(M))),Tt.setAttribute("font-weight",String(Yl(M))),Tt.setAttribute("font-family",E),Tt.textContent=M.text,f.appendChild(Tt),ye){const Pe=M.y+10,Kt=M.tags.map(Et=>B(Et,10)+12),kn=Kt.reduce((Et,Rt)=>Et+Rt+3,-3);let _t=M.x-kn/2;for(let Et=0;Et<M.tags.length;Et++){const Rt=M.tags[Et],tn=bi(Rt),Ft=Kt[Et],Qe=document.createElementNS(l,"rect");Qe.setAttribute("x",String(_t)),Qe.setAttribute("y",String(Pe-16/2)),Qe.setAttribute("width",String(Ft)),Qe.setAttribute("height",String(16)),Qe.setAttribute("rx",String(16/2)),Qe.setAttribute("fill",tn.background),Qe.setAttribute("stroke",tn.borderColor),Qe.setAttribute("stroke-width","1"),f.appendChild(Qe);const ht=document.createElementNS(l,"text");ht.setAttribute("x",String(_t+Ft/2)),ht.setAttribute("y",String(Pe)),ht.setAttribute("text-anchor","middle"),ht.setAttribute("dominant-baseline","central"),ht.setAttribute("fill",tn.color),ht.setAttribute("font-size",String(10)),ht.setAttribute("font-family",E),ht.textContent=Rt,f.appendChild(ht),_t+=Ft+3}}}return f}function To(){const r=xa();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
138
- `+f);const S=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(S),B=document.createElement("a");B.href=E,B.download=`${m.value.text||"mindmap"}.svg`,B.click(),URL.revokeObjectURL(E)}function wa(r=2){const l=xa(),f=pt.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
- `+E);const B=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(B),v=new window.Image;v.onload=()=>{const j=document.createElement("canvas");j.width=Math.ceil(f.vbW*r),j.height=Math.ceil(f.vbH*r);const K=j.getContext("2d");if(!K){URL.revokeObjectURL(M);return}K.fillStyle=Qt.value,K.fillRect(0,0,j.width,j.height),K.drawImage(v,0,0,j.width,j.height),URL.revokeObjectURL(M);try{j.toBlob(ye=>{if(!ye){To();return}const T=URL.createObjectURL(ye),Q=document.createElement("a");Q.href=T,Q.download=`${m.value.text||"mindmap"}.png`,Q.click(),URL.revokeObjectURL(T)},"image/png")}catch(ye){console.warn("PNG export failed, falling back to SVG:",ye),To()}},v.onerror=()=>{URL.revokeObjectURL(M),To()},v.src=M}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>ca(r),duplicateNode:r=>na(r),setNodeText:(r,l)=>ma(r,l),moveNode:(r,l,f)=>Qi(r,l,f),lineWidthForDepth:L,endWidthForDepth:Z,getData:()=>m.value,nodeHasContent:r=>ka(r),getSelectedIds:()=>[...d.value],copyNodes:r=>la(r),cutNodes:r=>aa(r),pasteNodes:r=>sa(r),setData:r=>{Gt.reset(),m.value=It(r),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>ln())},resetView:()=>ln(),exportData:Rh,importData:Bh,getMarkdown:()=>Ln(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(q.value=!0),w=!l,Gt.reset(),m.value=It(f),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>{w=!1,ln()}),a("change",m.value)},setBalanced:r=>{Qn.value=r},isBalanced:()=>Qn.value,balance:()=>_h(),applyNodeStyle:(r,l)=>J(r,l),getNodeStyle:r=>me(r),applyNodeImage:(r,l)=>ae(r,l),applyNodeImageByUrl:(r,l)=>b(r,l),removeNodeImage:r=>ke(r),applyNodeLink:(r,l)=>ge(r,l),removeNodeLink:r=>D(r),applyNodeNote:(r,l)=>z(r,l),removeNodeNote:r=>le(r),applyNodeRichContent:(r,l)=>be(r,l),addNodeMarker:(r,l)=>Vh(r,l),removeNodeMarker:(r,l)=>$h(r,l),toggleNodeMarker:(r,l)=>Ea(r,l),getNodeMarkers:r=>Ph(r),setNodeTags:(r,l)=>nr(r,l),getNodeTags:r=>Hh(r),exportPNG:r=>wa(r),exportSVG:()=>To(),searchNodes:r=>(vh(r),[...an.value]),undo:()=>Zi(),redo:()=>Ji(),canUndo:()=>Gt.canUndo(),canRedo:()=>Gt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:_.autoBalanceOnChange,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineStyle:_.lineStyle,rootLineStyle:_.rootLineStyle,lineOrigin:_.lineOrigin,layoutMode:_.layoutMode,taperedEdge:_.taperedEdge,lineWidthTaper:_.lineWidthTaper,elbowRadius:_.elbowRadius,showOrderBadge:_.showOrderBadge,canvasBg:_.canvasBg}),setBranchPalette:r=>{if(!r)return;[...dn,..._.customPalettes].find(f=>f.id===r)&&(_.branchPaletteId=r)},getBranchPalette:()=>_.branchPaletteId,getBranchPalettes:()=>[...dn,..._.customPalettes],getSearchResults:()=>[...an.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=It(r),Se()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>ln())}),(r,l)=>{var f,S,E,B,M,v,j,K,ye;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Qt.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Th,onContextmenu:et,onWheel:l[25]||(l[25]=(...T)=>e.unref(pe).onWheel&&e.unref(pe).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>x.value=!0),onMouseleave:l[27]||(l[27]=T=>x.value=!1),onClick:Ch},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:pt.value.vbX*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:pt.value.vbY*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:pt.value.vbW*e.unref(pe).scale.value+"px",height:pt.value.vbH*e.unref(pe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ch.value,preserveAspectRatio:"xMinYMin meet",width:pt.value.vbW*e.unref(pe).scale.value,height:pt.value.vbH*e.unref(pe).scale.value},[e.createElementVNode("g",Ip,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:yt(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),L(T.from.depth),Z(T.to.depth),32,g(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,zp))),128))])],8,vp))],4),e.unref(pe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(pe).marquee.x*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:e.unref(pe).marquee.y*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:e.unref(pe).marquee.width*e.unref(pe).scale.value+"px",height:e.unref(pe).marquee.height*e.unref(pe).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(pe).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(pe).offsetX.value}px, ${e.unref(pe).offsetY.value}px) scale(${e.unref(pe).scale.value})`})},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:F.value.x1+"px",top:F.value.y1+"px",width:F.value.horizontal?F.value.x2-F.value.x1+"px":"3px",height:F.value.horizontal?"3px":F.value.y2-F.value.y1+"px",transform:F.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.value,T=>{var Q,de,se,Te,Ie,Me,te;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":qi.value===T.id,"is-dragging-source":((Q=C.value)==null?void 0:Q.srcId)===T.id,"is-drop-target":((de=C.value)==null?void 0:de.currentTargetId)===T.id&&((se=C.value)==null?void 0:se.dropPosition)==="child","is-drop-target-before":((Te=C.value)==null?void 0:Te.currentTargetId)===T.id&&((Ie=C.value)==null?void 0:Ie.dropPosition)==="before","is-drop-target-after":((Me=C.value)==null?void 0:Me.currentTargetId)===T.id&&((te=C.value)==null?void 0:te.dropPosition)==="after","is-search-hit":Ih(T.id),"is-search-current":zh(T.id),"is-search-dimmed":Oh(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:ql(T)+"px",background:Kl(T),color:eo(T),borderColor:to(T),fontWeight:Yl(T),transform:"translate(-50%, -50%)"}),onClick:ne=>xh(ne,T),onPointerdown:ne=>Nh(ne,T),onDblclick:ne=>{ne.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:ne=>oe(ne,T),onMouseenter:ne=>{Zn(T.id),Jn(ne,T)},onMouseleave:ne=>bn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Lp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ne=>fh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ne=>k.value=ne),class:"zm-rich-edit",spellcheck:"false",onBlur:ta,onKeydown:ph},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Vp,[e.createElementVNode("code",{innerHTML:e.unref(Mi)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,$p)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Pp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ai)(T.richContent.raw),(ne,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("th",{key:`h${$e}`},e.toDisplayString(Y),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("td",{key:`c${$e}`},e.toDisplayString(Y),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Dp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Fp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-marker",title:e.unref(Nr)(ne),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ne)+"</svg>"},null,8,Hp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Wp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Gp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:li(T.note.text),onClick:e.withModifiers(ne=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,jp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ne=>u.value=ne),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ne=>Xi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ne=>Xi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ne=>Xi(),["prevent"]),["tab"])),e.withKeys(dh,["esc"]),hh],onInput:uh,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",Kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-tag",style:e.normalizeStyle(e.unref(bi)(ne))},e.toDisplayString(ne),5))),128))])):e.createCommentVNode("",!0),ie.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ba(T.id)+1} 个`},e.toDisplayString(ba(T.id)+1),9,Yp)):e.createCommentVNode("",!0),ga(T.id)&&er(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:en.value.get(T.id)??"#64748b"}),title:`展开 ${er(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},e.toDisplayString(er(T.id)),47,qp)):e.createCommentVNode("",!0),Ah(T)&&!ga(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:en.value.get(T.id)??"#64748b",borderColor:en.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Xp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ne=>Mt(ne,T),["stop"])},null,40,Zp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>ke(T.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,Jp)):e.createCommentVNode("",!0)],46,Op)}),128))],4),A.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!A.value.above}]),style:e.normalizeStyle({left:A.value.x+"px",top:A.value.y+"px"})},e.toDisplayString(A.value.text),7)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(hs,{key:3,x:I.value.x,y:I.value.y,container:c.value,"has-image":!!((f=e.unref(he)(m.value,I.value.nodeId))!=null&&f.image),"has-link":!!((S=e.unref(he)(m.value,I.value.nodeId))!=null&&S.link),"has-note":!!((E=e.unref(he)(m.value,I.value.nodeId))!=null&&E.note),"has-code":((M=(B=e.unref(he)(m.value,I.value.nodeId))==null?void 0:B.richContent)==null?void 0:M.kind)==="code","has-table":((j=(v=e.unref(he)(m.value,I.value.nodeId))==null?void 0:v.richContent)==null?void 0:j.kind)==="table","node-markers":((K=e.unref(he)(m.value,I.value.nodeId))==null?void 0:K.markers)??[],"node-tags":((ye=e.unref(he)(m.value,I.value.nodeId))==null?void 0:ye.tags)??[],onPickImage:go,onRemoveImage:_n,onSetLink:ji,onRemoveLink:bo,onEditNote:ko,onRemoveNote:Ki,onAddCode:ii,onEditCode:ii,onRemoveCode:Yi,onAddTable:He,onEditTable:He,onRemoveTable:hn,onToggleMarker:Fh,onClearMarkers:Uh,onAddTag:Wh,onRemoveTags:Gh,onClose:Ee},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createBlock(gs,{key:4,x:N.value.x,y:N.value.y,container:c.value,onOpenSettings:tt,onOpenData:nn,onOpenImport:nt,onExportPng:wa,onExportSvg:To,onClose:ut},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(U.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Qp),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:ho},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",eh,e.toDisplayString(Math.round(e.unref(pe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(pe).zoomIn&&e.unref(pe).zoomIn(...T))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(pe).zoomOut&&e.unref(pe).zoomOut(...T))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:ln},[e.createVNode(_e,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:kh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>fa(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>fa(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:yh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=T=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,th)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>p.value&&si(p.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,nh)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>tr("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>tr("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>tr("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Ot,{side:"left",scope:"canvas",width:300,open:on.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>on.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":p.value,"collapsed-ids":ot.value,"show-index":ie.value,onSelect:po,onToggleCollapse:pn,onEdit:oi,onAddChild:Kn,onAddSibling:Yn,onMove:$t},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:Dt.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>Dt.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Vt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:420,open:ue.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>ue.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,onImport:l[31]||(l[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:ft.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>ft.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":kt.value,"focus-tick":Be.value,onApply:it,onRemove:wt,onSetLink:An,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:340,open:ze.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ze.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Vo,{settings:_,"has-selection":p.value!==null,"selected-node-text":(T=kt.value)==null?void 0:T.text,"node-style":X.value,"onUpdate:settings":re,"onUpdate:nodeStyle":xe,onReset:Ae},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),oh={class:"zm-app"},ih={class:"zm-app-main"},rh={class:"zm-app-canvas"},jl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
134
+ | a | b | c |`);if(E===null)return;const v=E.trim();if(!v){ke(r,null);return}ke(r,{kind:"table",raw:v})}function pn(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ke(r,null)}function li(r){i.previewMode||(d.value=new Set([r]),at(),i.builtInDrawers&&(Nt(),ft.value=!0,Be.value++),a("edit-note",r))}function ai(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function qn(r){var M,z;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const w=(M=r.clipboardData)==null?void 0:M.items;if(!w)return;for(let Z=0;Z<w.length;Z++){const j=w[Z];if(j.kind==="file"&&j.type.startsWith("image/")){const oe=j.getAsFile();if(!oe)continue;r.preventDefault();const T=be(m.value,f);if(T!=null&&T.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;W(oe,J=>ce(f,J));return}}if(I.value&&I.value.nodes.length>0)return;let E=null;for(let Z=0;Z<w.length;Z++){const j=w[Z];if(j.kind==="string"&&j.type==="text/plain"){E=((z=r.clipboardData)==null?void 0:z.getData("text/plain"))??null;break}}if(!E)return;const v=E.split(/\r?\n/).map(Z=>Z.replace(/^\s*[-*+]\s+/,"").trim()).filter(Z=>Z.length>0);if(v.length!==0){r.preventDefault(),Oe();for(const Z of v)bi(m.value,f,Z);we(),a("change",m.value)}}e.onMounted(()=>{window.addEventListener("paste",qn),window.addEventListener("keydown",yo),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",qn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const hn=e.ref(null),Zi=e.computed(()=>{var r;return((r=hn.value)==null?void 0:r.nodeId)??null});function Tt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,w=l.image.naturalH||l.image.height,E=w>0?w/f:1;hn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:w,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Zt),window.addEventListener("mouseup",Eo)}function Zt(r){var Z,j;const l=hn.value;if(!l)return;const f=he.scale.value||1,w=r.clientX-l.startX,E=V(l.startW+w/f,_n,jn),v=V(E*l.ratio,_n,jn);l.pendingW=E,l.pendingH=v;const M=(Z=c.value)==null?void 0:Z.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${E}px`,M.style.height=`${v}px`);const z=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"]`);z&&(z.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,z.style.height=`${Math.ceil(v+8+30)}px`)}function Eo(){const r=hn.value;if(window.removeEventListener("mousemove",Zt),window.removeEventListener("mouseup",Eo),hn.value=null,!r)return;const l=be(m.value,r.nodeId);!l||!l.image||(ce(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),at(),Bn=!0)}const Xn=e.ref(null);let Bn=!1;function Zn(r){Xn.value=r}function gn(r){Xn.value===r&&(Xn.value=null),A.value&&(A.value=null)}function Jn(r,l){var se;if(!l.text||l.text.length<14)return;const w=r.currentTarget.getBoundingClientRect(),E=(se=c.value)==null?void 0:se.getBoundingClientRect();if(!E)return;const v=10,M=240,z=w.top-E.top>60,Z=w.left-E.left+w.width/2,j=v+M/2,oe=E.width-M/2-v,T=Math.max(j,Math.min(Z,oe)),J=z?w.top-E.top-8:w.bottom-E.top+8;A.value={text:l.text,x:T,y:J,above:z}}const Ct=e.ref(0),Qn=e.ref(!1),Gt=ls(100);function Oe(){Gt.record({data:m.value,selectedIds:[...d.value]})}function we(){h.value=new Set(h.value),Ct.value++,e.nextTick().then(()=>e.nextTick()).then(()=>si()).then(()=>{Ct.value++})}function si(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(w=>{let E=w,v=null;for(;E&&!v;)v=E.getAttribute("data-node-id"),E=E.parentElement;if(!v)return;const M=w.offsetHeight,z=w.scrollWidth,Z=Math.round(M*2)/2,j=Math.round(z*2)/2;l[v]=Z,f[v]=j,P.value[v],G.value[v]}),P.value=l,G.value=f}const yt=e.computed(()=>{var r,l,f,w,E,v,M,z,Z,j;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((w=i.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((v=i.theme)==null?void 0:v.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((z=i.theme)==null?void 0:z.lineWidthStart)??2.2,lineWidthEnd:((Z=i.theme)==null?void 0:Z.lineWidthEnd)??.8,rainbowBranch:((j=i.theme)==null?void 0:j.rainbowBranch)??!1}}),Jt=e.computed(()=>_.canvasBg||yt.value.bgColor),_=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0});function b(r){return r?_.rootLineStyle:_.lineStyle}function D(r){return _.taperedEdge?ze(r):Ne(r)}function X(r){return _.taperedEdge?_.lineWidthEnd:Ne(r)}function ze(r){const l=_.lineWidthTaper,f=_.lineWidthStart*Math.pow(l,r);return Math.max(_.lineWidthEnd,f)}function Ne(r){if(r<=0)return _.lineWidthStart;if(r>=3)return _.lineWidthEnd;const l=r/3;return _.lineWidthStart+(_.lineWidthEnd-_.lineWidthStart)*l}function Le(r,l,f,w){const E=1-r,v=E*E*E*l.x+3*E*E*r*f.x1+3*E*r*r*f.x2+r*r*r*w.x,M=E*E*E*l.y+3*E*E*r*f.y1+3*E*r*r*f.y2+r*r*r*w.y;return{x:v,y:M}}function qe(r,l,f,w){const E=1-r,v=E*E*l.x+2*E*r*f.x+r*r*w.x,M=E*E*l.y+2*E*r*f.y+r*r*w.y;return{x:v,y:M}}function Et(r,l,f,w,E=32,v="curve",M="right"){if(v==="curve"){let z;if(M==="right"||M==="left"){const se=Math.abs(l.x-r.x)*.45,ge=M==="right"?1:-1;z={x1:r.x+ge*se,y1:r.y,x2:l.x-ge*se,y2:l.y}}else{const se=Math.abs(l.y-r.y)*.45;z={x1:r.x,y1:r.y+se,x2:l.x,y2:l.y-se}}const Z=J=>{const se=1-J,ge=-3*se*se*r.x+3*(se*se-2*se*J)*z.x1+3*(2*se*J-J*J)*z.x2+3*J*J*l.x,Me=-3*se*se*r.y+3*(se*se-2*se*J)*z.y1+3*(2*se*J-J*J)*z.y2+3*J*J*l.y;return{dx:ge,dy:Me}},j=[],oe=[];for(let J=0;J<=E;J++){const se=J/E,ge=J===0?r:J===E?l:Le(se,r,z,l),Me=Z(se);let Ce=Math.hypot(Me.dx,Me.dy);Ce<1e-6&&(Ce=1);const ve=-Me.dy/Ce,Q=Me.dx/Ce,ie=(f+(w-f)*se)/2;j.push({x:ge.x+ve*ie,y:ge.y+Q*ie}),oe.push({x:ge.x-ve*ie,y:ge.y-Q*ie})}let T=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let J=1;J<=E;J++)T+=` L ${j[J].x.toFixed(2)} ${j[J].y.toFixed(2)}`;for(let J=E;J>=0;J--)T+=` L ${oe[J].x.toFixed(2)} ${oe[J].y.toFixed(2)}`;return T+=" Z",T}if(v==="arc"){let z;M==="right"||M==="left"?z={x:(r.x+l.x)/2,y:l.y}:z={x:l.x,y:(r.y+l.y)/2};const Z=ge=>{const Me=1-ge,Ce=2*Me*(z.x-r.x)+2*ge*(l.x-z.x),ve=2*Me*(z.y-r.y)+2*ge*(l.y-z.y);return{dx:Ce,dy:ve}},j=[],oe=[];for(let ge=0;ge<=E;ge++){const Me=ge/E,Ce=ge===0?r:ge===E?l:qe(Me,r,z,l),ve=Z(Me);let Q=Math.hypot(ve.dx,ve.dy);Q<1e-6&&(Q=1);const ie=-ve.dy/Q,Fe=ve.dx/Q,K=(f+(w-f)*Me)/2;j.push({x:Ce.x+ie*K,y:Ce.y+Fe*K}),oe.push({x:Ce.x-ie*K,y:Ce.y-Fe*K})}const T=f/2,J=w/2;let se=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let ge=1;ge<=E;ge++)se+=` L ${j[ge].x.toFixed(2)} ${j[ge].y.toFixed(2)}`;se+=` A ${J.toFixed(2)} ${J.toFixed(2)} 0 0 0 ${oe[E].x.toFixed(2)} ${oe[E].y.toFixed(2)}`;for(let ge=E-1;ge>=0;ge--)se+=` L ${oe[ge].x.toFixed(2)} ${oe[ge].y.toFixed(2)}`;return se+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`,se+=" Z",se}if(v==="elbow"){const z=[];if(M==="down"){const Q=(r.y+l.y)/2;z.push(r,{x:r.x,y:Q},{x:l.x,y:Q},l)}else{const Q=(r.x+l.x)/2;z.push(r,{x:Q,y:r.y},{x:Q,y:l.y},l)}const Z=[];let j=0;for(let Q=0;Q<z.length-1;Q++){const ie=Math.hypot(z[Q+1].x-z[Q].x,z[Q+1].y-z[Q].y);Z.push(ie),j+=ie}const oe=[f/2];let T=0;for(let Q=0;Q<Z.length-1;Q++){T+=Z[Q];const ie=j>0?T/j:0;oe.push((f+(w-f)*ie)/2)}oe.push(w/2);const J=[];for(let Q=0;Q<z.length-1;Q++){const ie=z[Q+1].x-z[Q].x,Fe=z[Q+1].y-z[Q].y;let K=Math.hypot(ie,Fe);K<1e-6&&(K=1),J.push({x:-Fe/K,y:ie/K})}const se=[],ge=[];se.push({x:z[0].x+J[0].x*oe[0],y:z[0].y+J[0].y*oe[0]}),ge.push({x:z[0].x-J[0].x*oe[0],y:z[0].y-J[0].y*oe[0]});for(let Q=1;Q<z.length-1;Q++){const ie=J[Q-1],Fe=J[Q],K=oe[Q];se.push({x:z[Q].x+ie.x*K+Fe.x*K,y:z[Q].y+ie.y*K+Fe.y*K}),ge.push({x:z[Q].x-ie.x*K-Fe.x*K,y:z[Q].y-ie.y*K-Fe.y*K})}const Me=J[J.length-1],Ce=oe[oe.length-1];se.push({x:z[z.length-1].x+Me.x*Ce,y:z[z.length-1].y+Me.y*Ce}),ge.push({x:z[z.length-1].x-Me.x*Ce,y:z[z.length-1].y-Me.y*Ce});let ve=`M ${se[0].x.toFixed(2)} ${se[0].y.toFixed(2)}`;for(let Q=1;Q<se.length;Q++)ve+=` L ${se[Q].x.toFixed(2)} ${se[Q].y.toFixed(2)}`;for(let Q=ge.length-1;Q>=0;Q--)ve+=` L ${ge[Q].x.toFixed(2)} ${ge[Q].y.toFixed(2)}`;return ve+=" Z",ve}if(v==="rounded-elbow"&&!(M==="down"?Math.abs(r.x-l.x)<.5:Math.abs(r.y-l.y)<.5)){let Z=function(K,We,xt){const $t={x:K.pos.x-We*K.d1.x,y:K.pos.y-We*K.d1.y},bn={x:K.pos.x+We*K.d2.x,y:K.pos.y+We*K.d2.y},Mt={x:K.pos.x+We*(K.d2.x-K.d1.x),y:K.pos.y+We*(K.d2.y-K.d1.y)},kn=Math.atan2($t.y-Mt.y,$t.x-Mt.x);let it=Math.atan2(bn.y-Mt.y,bn.x-Mt.x)-kn;for(;it>Math.PI;)it-=2*Math.PI;for(;it<-Math.PI;)it+=2*Math.PI;const Ge=[];for(let rt=1;rt<xt;rt++){const Pt=rt/xt,$e=kn+it*Pt;Ge.push({x:Mt.x+We*Math.cos($e),y:Mt.y+We*Math.sin($e)})}return Ge};const j=[];let oe;if(M==="down"){const K=(r.y+l.y)/2,We=Math.sign(K-r.y)||1,xt=Math.sign(l.x-r.x)||1,$t=Math.sign(l.y-K)||1;oe=[{pos:{x:r.x,y:K},d1:{x:0,y:We},d2:{x:xt,y:0}},{pos:{x:l.x,y:K},d1:{x:xt,y:0},d2:{x:0,y:$t}}]}else{const K=(r.x+l.x)/2,We=Math.sign(K-r.x)||1,xt=Math.sign(l.y-r.y)||1,$t=Math.sign(l.x-K)||1;oe=[{pos:{x:K,y:r.y},d1:{x:We,y:0},d2:{x:0,y:xt}},{pos:{x:K,y:l.y},d1:{x:0,y:xt},d2:{x:$t,y:0}}]}const T=Math.hypot(oe[1].pos.x-oe[0].pos.x,oe[1].pos.y-oe[0].pos.y),J=Math.hypot(l.x-oe[1].pos.x,l.y-oe[1].pos.y),se=Math.min(T,J,_.elbowRadius)*.5,ge=Math.max(2,se);j.push(r),j.push(oe[0].pos),j.push({x:oe[1].pos.x-ge*oe[1].d1.x,y:oe[1].pos.y-ge*oe[1].d1.y});for(const K of Z(oe[1],ge,7))j.push(K);j.push(l);const Me=[];let Ce=0;for(let K=0;K<j.length-1;K++){const We=Math.hypot(j[K+1].x-j[K].x,j[K+1].y-j[K].y);Me.push(We),Ce+=We}const ve=[],Q=[];let ie=0;for(let K=0;K<j.length;K++){const We=j[Math.max(0,K-1)],xt=j[Math.min(j.length-1,K+1)],$t=xt.x-We.x,bn=xt.y-We.y;let Mt=Math.hypot($t,bn);Mt<1e-6&&(Mt=1);const kn=-bn/Mt,Co=$t/Mt;K>0&&(ie+=Me[K-1]);const it=Ce>0?ie/Ce:0,Ge=(f+(w-f)*it)/2;ve.push({x:j[K].x+kn*Ge,y:j[K].y+Co*Ge}),Q.push({x:j[K].x-kn*Ge,y:j[K].y-Co*Ge})}let Fe=`M ${ve[0].x.toFixed(2)} ${ve[0].y.toFixed(2)}`;for(let K=1;K<ve.length;K++)Fe+=` L ${ve[K].x.toFixed(2)} ${ve[K].y.toFixed(2)}`;Fe+=` L ${Q[ve.length-1].x.toFixed(2)} ${Q[ve.length-1].y.toFixed(2)}`;for(let K=Q.length-2;K>=0;K--)Fe+=` L ${Q[K].x.toFixed(2)} ${Q[K].y.toFixed(2)}`;return Fe+=" Z",Fe}{const z=l.x-r.x,Z=l.y-r.y;let j=Math.hypot(z,Z);j<1e-6&&(j=1);const oe=-Z/j,T=z/j,J=f/2,se=w/2,ge={x:r.x+oe*J,y:r.y+T*J},Me={x:r.x-oe*J,y:r.y-T*J},Ce={x:l.x-oe*se,y:l.y-T*se},ve={x:l.x+oe*se,y:l.y+T*se};return`M ${ge.x.toFixed(2)} ${ge.y.toFixed(2)} L ${ve.x.toFixed(2)} ${ve.y.toFixed(2)} L ${Ce.x.toFixed(2)} ${Ce.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} Z`}}const mt=e.computed(()=>pt.value.root.children),xo=cn[0].colors,Xe=e.computed(()=>ja(_.branchPaletteId,_.customPalettes)),nn=e.computed(()=>{const r=new Map;if(!_.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Xe.value.colors.length>0?Xe.value.colors:xo;for(let E=0;E<mt.value.length;E++){const v=mt.value[E];r.set(v.id,f[E%f.length])}const w=(E,v)=>{r.set(E.id,v);for(const M of E.children)w(M,v)};for(let E=0;E<mt.value.length;E++){const v=mt.value[E];w(v,f[E%f.length])}return r});function wo(r,l){return _.rainbowBranch?nn.value.get(l.id)??yt.value.lineColor:yt.value.lineColor}function ql(r){const l=ee(r.id);if(l.bg)return l.bg;if(r.isRoot)return yt.value.rootBg;if(r.depth>=3)return"transparent";const f=r.depth===1?.15:.08;if(_.rainbowBranch){const w=nn.value.get(r.id);if(w)return Jl(w,f)}return Jl(yt.value.rootBg,f)}function eo(r){const l=ee(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return yt.value.rootText;if(_.rainbowBranch){const f=nn.value.get(r.id);if(f)return ch(f,.55)}return yt.value.branchText}function to(r){const l=ee(r.id);return l.borderColor?l.borderColor:"transparent"}function Xl(r){const l=ee(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Zl(r){return ee(r.id).fontSize??r.fontSize??yt.value.fontSize}function Jl(r,l){const f=r.replace("#",""),w=f.length===6?f:f.split("").map(z=>z+z).join(""),E=parseInt(w.slice(0,2),16),v=parseInt(w.slice(2,4),16),M=parseInt(w.slice(4,6),16);return`rgba(${E}, ${v}, ${M}, ${l})`}function ch(r,l){const f=r.replace("#",""),w=f.length===6?f:f.split("").map(z=>z+z).join(""),E=Math.round(parseInt(w.slice(0,2),16)*(1-l)),v=Math.round(parseInt(w.slice(2,4),16)*(1-l)),M=Math.round(parseInt(w.slice(4,6),16)*(1-l));return`rgb(${E}, ${v}, ${M})`}const he=os({getContainer:()=>c.value});he.setOnMarqueeEnd(Ah),rs({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:ci,onAddSiblingBefore:bh,onRemove:ua,onStartEdit:No,onClearSelection:()=>{d.value=new Set,at()},onDuplicate:ia,onCopy:sa,onCut:ca,onPaste:da,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:Qi,onRedo:er,onNavigate:kh,onMoveSibling:xh,onSelectRoot:()=>{d.value=new Set([m.value.id]),at()}});const pt=e.computed(()=>{const r=Bt(m.value);return ta(r),Ua(r,{mode:_.layoutMode,baseFontSize:yt.value.fontSize,richHeights:P.value,richWidths:G.value})}),Ql=e.ref([]),on=e.computed(()=>(Ct.value,Ql.value));e.watch(pt,r=>{const l=[],f=w=>{l.push(w);for(const E of w.children)f(E)};f(r.root),Ql.value=l},{immediate:!0});const ea=e.computed(()=>{const r=[];for(const l of on.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),dh=e.computed(()=>`${pt.value.vbX} ${pt.value.vbY} ${pt.value.vbW} ${pt.value.vbH}`);function ta(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)ta(l)}function No(r){const l=be(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),at(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),na(f)}))}function Ji(){if(!s.value)return;const r=be(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function uh(){s.value=null}function na(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function fh(r){na(r.target)}function mh(r){if(i.previewMode)return;const l=be(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function oa(){if(!y.value)return;const r=y.value,l=be(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const w=Sn(f)||void 0;ke(r,{kind:"code",raw:f,lang:w})}else ke(r,{kind:"table",raw:f});y.value=null}function ph(){y.value=null}function hh(r){r.key==="Escape"?(r.preventDefault(),ph()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),oa())}function gh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Qi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),er())}function no(r){const l=bi(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function ci(r){if(r===m.value.id){no(r);return}const l=xr(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function bh(r){if(r===m.value.id){no(r);return}const l=Ja(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function ia(r){if(r===m.value.id)return;const l=Qa(m.value,r);l&&(Oe(),d.value=new Set([l.id]),at(),a("change",m.value),we())}function ra(r){const l=[],f=new Set;for(const w of r)w!==m.value.id&&(f.has(w)||be(m.value,w)&&(f.add(w),l.push(w)));return l}function la(r){const l=new Set(r),f=[],w=E=>{l.has(E.id)&&f.push(E.id);for(const v of E.children)w(v)};return w(m.value),f}function aa(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function sa(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const w of l){const E=wr(m.value,w);E&&f.push(E)}f.length!==0&&(I.value={nodes:f,originalIds:new Set(l)},aa(f.map(w=>w.text).join(`
135
+ `)),we())}function ca(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const w of l){const E=wr(m.value,w);E&&f.push(E)}if(f.length!==0){Oe();for(const w of l)vo(m.value,w);d.value=new Set,at(),I.value={nodes:f,originalIds:new Set(l)},aa(f.map(w=>w.text).join(`
136
+ `)),we(),a("change",m.value)}}function da(r){const l=I.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,w=be(m.value,f);if(w){for(const E of l.originalIds){const v=be(m.value,E);if(v&&be(v,f))return}Oe();for(const E of l.nodes){const v=Bt(E);Bo(v),w.children.push(v)}I.value=null,we(),a("change",m.value)}}function Qi(){const r=Gt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),we(),a("change",m.value))}function er(){const r=Gt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),we(),a("change",m.value))}function at(){const r=[];for(const l of d.value){const f=be(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ft.value&&Ea(l.id)&&(Nt(),ft.value=!0)}else i.builtInDrawers&&r.length===0&&(ft.value=!1);a("select",r.length>0?r:null)}function kh(r,l){const f=p.value??m.value.id,w=be(m.value,f);if(!w)return;let E=null;if(l===1){const v=zt(m.value,w.id);if(v){const M=v.children.findIndex(z=>z.id===w.id);M>=0&&M<v.children.length-1&&(E=v.children[M+1].id)}}else if(l===-1){const v=zt(m.value,w.id);if(v){const M=v.children.findIndex(z=>z.id===w.id);M>0&&(E=v.children[M-1].id)}}else if(r===1){const v=zt(m.value,w.id);v&&(E=v.id)}else r===-1&&w.children.length>0&&(E=w.children[0].id);E&&(d.value=new Set([E]),at())}function ua(r){if(r!==m.value.id&&vo(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,at()}we(),a("change",m.value)}}function fa(r){h.value.has(r)?h.value.delete(r):h.value.add(r),we()}function ma(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:w}=l.pop();r(f,w);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:w+1})}}function yh(){h.value=new Set,ma(r=>{r.children.length>0&&h.value.add(r.id)}),we()}function pa(r){h.value=new Set,ma((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),we()}function Eh(){h.value=new Set,we()}function ha(r,l){Za(m.value,r,l)&&(Oe(),we(),a("change",m.value))}function tr(r,l,f){return gi(m.value,r,l,f)?(Oe(),we(),a("change",m.value),!0):!1}function xh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const w=zt(f,l);if(!w)return;const E=w.children.findIndex(z=>z.id===l);if(E<0)return;let v=r;const M=on.value.find(z=>z.id===l);if(M&&ba(M)&&(v=-r),v<0){if(E===0)return;const z=w.children[E-1].id;gi(f,l,z,"before")}else{if(E>=w.children.length-1)return;const z=w.children[E+1].id;gi(f,l,z,"after")}Oe(),we(),a("change",f)}function wh(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);at()}function Nh(r,l,f){let w=null;for(const E of on.value){if(E.id===f)continue;const v=E.width/2,M=E.height/2;r>=E.x-v&&r<=E.x+v&&l>=E.y-M&&l<=E.y+M&&(w=E)}return w}let jt=null;function Sh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const w=c.value.getBoundingClientRect(),E=l.x*he.scale.value+he.offsetX.value,v=l.y*he.scale.value+he.offsetY.value,M=r.clientX-w.left-E,z=r.clientY-w.top-v;jt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:z,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",ga),window.addEventListener("pointerup",di),window.addEventListener("pointercancel",di)}function ga(r){if(jt){const M=r.clientX-jt.startX,z=r.clientY-jt.startY;if(Math.abs(M)<=Kl&&Math.abs(z)<=Kl)return;C.value={srcId:jt.srcId,srcText:jt.srcText,pointerOffsetX:jt.pointerOffsetX,pointerOffsetY:jt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),jt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const w=(r.clientX-f.left-he.offsetX.value)/he.scale.value,E=(r.clientY-f.top-he.offsetY.value)/he.scale.value,v=Nh(w,E,l.srcId);l.currentTargetId=(v==null?void 0:v.id)??null,v?l.dropPosition=Th(w,E,v):l.dropPosition=null}function Th(r,l,f){if(f.isRoot)return"child";const w=f.width/2,E=f.height/2;if(f._dir==="down"){const M=r-f.x;return M<-w*.3?"before":M>w*.3?"after":"child"}const v=l-f.y;return v<-E*.3?"before":v>E*.3?"after":"child"}function ba(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function di(r){if(window.removeEventListener("pointermove",ga),window.removeEventListener("pointerup",di),window.removeEventListener("pointercancel",di),jt){jt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const w=on.value.find(E=>E.id===l.currentTargetId);w&&ba(w)&&(f=f==="before"?"after":"before")}tr(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),at()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let ui=!1;function Ch(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){ui=!0,he.startPan(r);return}if(ui=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),w=(r.clientX-f.left-he.offsetX.value)/he.scale.value,E=(r.clientY-f.top-he.offsetY.value)/he.scale.value;he.startMarquee(w,E,{shift:r.shiftKey})}function Mh(r){if(Bn){Bn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=he.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,at())}function Ah(){const r=he.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,w=r.x+r.width,E=r.y+r.height,v=[];for(const M of on.value){const z=M.width/2,Z=M.height/2,j=M.x-z,oe=M.x+z,T=M.y-Z,J=M.y+Z;j<=w&&oe>=l&&T<=E&&J>=f&&v.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...v]):new Set(v),at()}function ka(r){return h.value.has(r)}function _h(r){const l=be(m.value,r.id);return!!l&&l.children.length>0}function nr(r){const l=be(m.value,r);return l?Nr(l):0}function ya(r){if(!be(m.value,r))return 0;const w=[m.value];for(;w.length;){const E=w.pop(),v=E.children.findIndex(M=>M.id===r);if(v>=0)return v;for(const M of E.children)w.push(M)}return 0}function fi(r,l,f,w){const E=(w==null?void 0:w._dir)??r._dir;if(l==="out"&&r.isRoot&&_.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&_.lineOrigin==="proportional"&&w){const z=pt.value.root.children;if(E==="down"){const se=z.reduce((ve,Q)=>Math.max(ve,Math.abs(Q.x-r.x)),1),ge=Math.min(1,Math.abs(w.x-r.x)/se),Me=r.y+r.height/2,Ce=r.y;return{x:r.x,y:Me+(Ce-Me)*ge}}const Z=z.reduce((se,ge)=>Math.max(se,Math.abs(ge.y-r.y)),1),j=Math.min(1,Math.abs(w.y-r.y)/Z),oe=f!==void 0?f:r.side,T=r.x+oe*(r.width/2),J=r.x;return{x:T+(J-T)*j,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let v;l==="in"?v=-r.side:f!==void 0?v=f:v=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+v*(r.width/2-M),y:r.y}}function rn(){const r=pt.value;he.resetView(r.width,r.height,r.root.y)}function Rh(){Qn.value=!0,Oe(),we(),e.nextTick(()=>rn())}function or(r){_.layoutMode!==r&&(_.layoutMode=r,we(),e.nextTick(()=>rn()))}function vh(){return JSON.stringify(m.value,null,2)}function Ea(r){const l=be(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Bh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Gt.reset(),m.value=Bt(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>rn()),a("change",m.value),!0)}catch{return!1}}const xa=e.ref(""),ln=e.ref([]),So=e.ref(-1);function zh(r){xa.value=r;const l=r.trim();if(!l){ln.value=[],So.value=-1;return}const f=l.toLowerCase(),w=[],E=v=>{var M;(v.text.toLowerCase().includes(f)||(M=v.note)!=null&&M.text&&v.note.text.toLowerCase().includes(f))&&w.push(v.id);for(const z of v.children)E(z)};E(m.value),ln.value=w,So.value=w.length>0?0:-1,w.length>0&&(Dh(w),e.nextTick(()=>Vh(0)))}function Ih(r){return ln.value.includes(r)}function Oh(r){return So.value>=0&&ln.value[So.value]===r}function Lh(r){return xa.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(r)}function Dh(r){if(r.length===0)return;const l=new Set(r),f=new Set,w=E=>{let v=l.has(E.id);for(const M of E.children)w(M)&&(v=!0);return v&&E.children.length>0&&h.value.has(E.id)&&f.add(E.id),v};if(w(m.value),f.size>0){for(const E of f)h.value.delete(E);we()}}function Vh(r){const l=ln.value[r];if(!l)return;const f=on.value.find(w=>w.id===l);f&&(d.value=new Set([l]),at(),he.centerOn(f.x,f.y,f.width,f.height))}function $h(r,l){const f=be(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),we(),a("change",m.value)))}function Ph(r,l){const f=be(m.value,r);if(!f||!f.markers)return;const w=f.markers.indexOf(l);w<0||(f.markers.splice(w,1),f.markers.length===0&&delete f.markers,Oe(),we(),a("change",m.value))}function wa(r,l){const f=be(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const w=f.markers.indexOf(l);return w>=0?(f.markers.splice(w,1),f.markers.length===0&&delete f.markers,Oe(),we(),a("change",m.value),!1):(f.markers.push(l),Oe(),we(),a("change",m.value),!0)}function Fh(r){const l=be(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Uh(r){var f;const l=(f=B.value)==null?void 0:f.nodeId;l&&wa(l,r)}function Hh(){var f;const r=(f=B.value)==null?void 0:f.nodeId;if(!r)return;const l=be(m.value,r);!l||!l.markers||(delete l.markers,Oe(),we(),a("change",m.value),ye())}function ir(r,l){const f=be(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),we(),a("change",m.value))}function Wh(r){const l=be(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Gh(){var v,M;const r=(v=B.value)==null?void 0:v.nodeId;if(!r)return;const l=be(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",w=window.prompt("输入标签(多个用逗号分隔)",f);if(w===null)return;const E=w.split(/[,,]/).map(z=>z.trim()).filter(z=>z.length>0);ir(r,E),ye()}function jh(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&(ir(r,[]),ye())}function Na(){const r=pt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const w=document.createElementNS(l,"rect");w.setAttribute("x",String(r.vbX)),w.setAttribute("y",String(r.vbY)),w.setAttribute("width",String(r.vbW)),w.setAttribute("height",String(r.vbH)),w.setAttribute("fill",Jt.value),f.appendChild(w);for(const M of ea.value){const z=document.createElementNS(l,"path");z.setAttribute("d",Et(fi(M.from,"out",M.to.side,M.to),fi(M.to,"in"),D(M.from.depth),X(M.to.depth),32,b(M.from.isRoot),M.to._dir)),z.setAttribute("fill",wo(M.from,M.to)),z.setAttribute("stroke","none"),f.appendChild(z)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function v(M,z){let Z=0;for(const j of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(j)?Z+=z:Z+=z*.55;return Z}for(const M of on.value){const z=M.x-M.width/2,Z=M.y-M.height/2,j=document.createElementNS(l,"rect");j.setAttribute("x",String(z)),j.setAttribute("y",String(Z)),j.setAttribute("width",String(M.width)),j.setAttribute("height",String(M.height)),j.setAttribute("rx","8"),j.setAttribute("fill",ql(M));const oe=to(M);oe!=="transparent"&&(j.setAttribute("stroke",oe),j.setAttribute("stroke-width","1")),f.appendChild(j);const T=!!(M.tags&&M.tags.length>0),J=!!(M.markers&&M.markers.length>0),se=!!M.image,ge=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let Me=0,Ce=0;if(ge){const Ge=M.richContent,rt=M.fontSize*.78*.92,Pt=6,$e=4,yn=2,En=6;if(Ge.kind==="code"){const At=jo(Ge.raw),wt=Sn(Ge.raw),_t=At.split(`
137
+ `),Qt=rt*1.35;let Ft=0;for(const Pe of _t)Ft=Math.max(Ft,v(Pe,rt));Ce=Math.min(Ft+Pt*2+4,M.width-4),Me=_t.length*Qt+$e*2+yn;const Je=M.x-Ce/2;let ht=Z+4;se&&(ht=Z+M.image.height+En);const Rt=document.createElementNS(l,"rect");if(Rt.setAttribute("x",String(Je)),Rt.setAttribute("y",String(ht)),Rt.setAttribute("width",String(Ce)),Rt.setAttribute("height",String(Me-yn)),Rt.setAttribute("rx","6"),Rt.setAttribute("fill","rgba(255,255,255,0.55)"),Rt.setAttribute("stroke",to(M)),Rt.setAttribute("stroke-width","1"),f.appendChild(Rt),wt){const Pe=document.createElementNS(l,"text");Pe.setAttribute("x",String(Je+Ce-Pt)),Pe.setAttribute("y",String(ht+$e+4)),Pe.setAttribute("text-anchor","end"),Pe.setAttribute("fill",eo(M)),Pe.setAttribute("font-size",String(rt*.8)),Pe.setAttribute("font-family",E),Pe.setAttribute("opacity","0.5"),Pe.textContent=wt,f.appendChild(Pe)}const Mo="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Pe=0;Pe<_t.length;Pe++){const st=document.createElementNS(l,"text");st.setAttribute("x",String(Je+Pt)),st.setAttribute("y",String(ht+$e+(Pe+.5)*Qt+2)),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",eo(M)),st.setAttribute("font-size",String(rt)),st.setAttribute("font-family",Mo);let Ut=_t[Pe];const Ke=Math.floor((Ce-Pt*2)/(rt*.6));Ut.length>Ke&&(Ut=Ut.substring(0,Ke-1)+"…"),st.textContent=Ut,f.appendChild(st)}}else if(Ge.kind==="table"){const At=Ri(Ge.raw);if(At.length>0){const wt=rt*1.35,_t=6,Qt=3,Ft=At[0].length,Je=[];for(let Ke=0;Ke<Ft;Ke++){let an=0;for(const xn of At)Ke<xn.length&&(an=Math.max(an,v(xn[Ke],rt)));Je.push(an+_t*2)}Ce=Math.min(Je.reduce((Ke,an)=>Ke+an,0),M.width-4);const ht=Ce/Je.reduce((Ke,an)=>Ke+an,0);for(let Ke=0;Ke<Ft;Ke++)Je[Ke]*=ht;Me=At.length*(wt+Qt*2)+yn;const Rt=M.x-Ce/2;let Mo=Z+4;se&&(Mo=Z+M.image.height+En);const Pe=document.createElementNS(l,"rect");Pe.setAttribute("x",String(Rt)),Pe.setAttribute("y",String(Mo)),Pe.setAttribute("width",String(Ce)),Pe.setAttribute("height",String(Me-yn)),Pe.setAttribute("rx","6"),Pe.setAttribute("fill","rgba(255,255,255,0.55)"),Pe.setAttribute("stroke",to(M)),Pe.setAttribute("stroke-width","1"),f.appendChild(Pe);let st=Rt,Ut=Mo;for(let Ke=0;Ke<At.length;Ke++){const an=At[Ke],xn=wt+Qt*2;st=Rt;for(let Ao=0;Ao<Ft;Ao++){const oo=Je[Ao],Kh=an[Ao]||"";if(Ao<Ft-1){const Ye=document.createElementNS(l,"line");Ye.setAttribute("x1",String(st+oo)),Ye.setAttribute("y1",String(Ut)),Ye.setAttribute("x2",String(st+oo)),Ye.setAttribute("y2",String(Ut+xn)),Ye.setAttribute("stroke",to(M)),Ye.setAttribute("stroke-width","1"),f.appendChild(Ye)}if(Ke<At.length-1){const Ye=document.createElementNS(l,"line");Ye.setAttribute("x1",String(st)),Ye.setAttribute("y1",String(Ut+xn)),Ye.setAttribute("x2",String(st+oo)),Ye.setAttribute("y2",String(Ut+xn)),Ye.setAttribute("stroke",to(M)),Ye.setAttribute("stroke-width","1"),f.appendChild(Ye)}if(Ke===0){const Ye=document.createElementNS(l,"rect");Ye.setAttribute("x",String(st)),Ye.setAttribute("y",String(Ut)),Ye.setAttribute("width",String(oo)),Ye.setAttribute("height",String(xn)),Ye.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Ye)}const sn=document.createElementNS(l,"text");sn.setAttribute("x",String(st+_t)),sn.setAttribute("y",String(Ut+Qt+wt/2+2)),sn.setAttribute("dominant-baseline","central"),sn.setAttribute("fill",eo(M)),sn.setAttribute("font-size",String(rt)),sn.setAttribute("font-family",E),Ke===0&&sn.setAttribute("font-weight","600");let mi=Kh;const rr=Math.floor((oo-_t*2)/(rt*.55));mi.length>rr&&rr>2&&(mi=mi.substring(0,rr-1)+"…"),sn.textContent=mi,f.appendChild(sn),st+=oo}Ut+=xn}}}}let ve=0;if(se){const Ge=M.image,rt=Z+4,Pt=M.x-Ge.width/2,$e=document.createElementNS(l,"image");$e.setAttribute("x",String(Pt)),$e.setAttribute("y",String(rt)),$e.setAttribute("width",String(Ge.width)),$e.setAttribute("height",String(Ge.height)),$e.setAttribute("href",Ge.src),$e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ge.src),$e.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild($e),ve=Ge.height+6}let Q=M.y;const ie=ve+Me;ie>0?Q=Z+ie+(M.height-ie)/2:T&&(Q=M.y-8);const Fe=14,K=2,We=4,xt=J?M.markers.length:0,$t=xt>0?xt*Fe+(xt-1)*K+We:0,bn=v(M.text,M.fontSize),Mt=$t+bn,kn=M.x-Mt/2;if(J){let Ge=kn;for(const rt of M.markers){const Pt=Oo(rt);if(Pt){const $e=document.createElementNS(l,"svg");$e.setAttribute("x",String(Ge)),$e.setAttribute("y",String(Q-Fe/2)),$e.setAttribute("width",String(Fe)),$e.setAttribute("height",String(Fe)),$e.setAttribute("viewBox","0 0 24 24"),$e.setAttribute("color",eo(M));const En=new DOMParser().parseFromString(`<svg xmlns="${l}">${Pt}</svg>`,"image/svg+xml");if(!En.querySelector("parsererror"))for(;En.documentElement.firstChild;)$e.appendChild(En.documentElement.firstChild);f.appendChild($e)}Ge+=Fe+K}}const Co=J?kn+$t+bn/2:M.x,it=document.createElementNS(l,"text");if(it.setAttribute("x",String(Co)),it.setAttribute("y",String(Q)),it.setAttribute("text-anchor","middle"),it.setAttribute("dominant-baseline","central"),it.setAttribute("fill",eo(M)),it.setAttribute("font-size",String(Zl(M))),it.setAttribute("font-weight",String(Xl(M))),it.setAttribute("font-family",E),it.textContent=M.text,f.appendChild(it),T){const $e=M.y+10,yn=M.tags.map(wt=>v(wt,10)+12),En=yn.reduce((wt,_t)=>wt+_t+3,-3);let At=M.x-En/2;for(let wt=0;wt<M.tags.length;wt++){const _t=M.tags[wt],Qt=yi(_t),Ft=yn[wt],Je=document.createElementNS(l,"rect");Je.setAttribute("x",String(At)),Je.setAttribute("y",String($e-16/2)),Je.setAttribute("width",String(Ft)),Je.setAttribute("height",String(16)),Je.setAttribute("rx",String(16/2)),Je.setAttribute("fill",Qt.background),Je.setAttribute("stroke",Qt.borderColor),Je.setAttribute("stroke-width","1"),f.appendChild(Je);const ht=document.createElementNS(l,"text");ht.setAttribute("x",String(At+Ft/2)),ht.setAttribute("y",String($e)),ht.setAttribute("text-anchor","middle"),ht.setAttribute("dominant-baseline","central"),ht.setAttribute("fill",Qt.color),ht.setAttribute("font-size",String(10)),ht.setAttribute("font-family",E),ht.textContent=_t,f.appendChild(ht),At+=Ft+3}}}return f}function To(){const r=Na();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
138
+ `+f);const w=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(w),v=document.createElement("a");v.href=E,v.download=`${m.value.text||"mindmap"}.svg`,v.click(),URL.revokeObjectURL(E)}function Sa(r=2){const l=Na(),f=pt.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
+ `+E);const v=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(v),z=new window.Image;z.onload=()=>{const Z=document.createElement("canvas");Z.width=Math.ceil(f.vbW*r),Z.height=Math.ceil(f.vbH*r);const j=Z.getContext("2d");if(!j){URL.revokeObjectURL(M);return}j.fillStyle=Jt.value,j.fillRect(0,0,Z.width,Z.height),j.drawImage(z,0,0,Z.width,Z.height),URL.revokeObjectURL(M);try{Z.toBlob(oe=>{if(!oe){To();return}const T=URL.createObjectURL(oe),J=document.createElement("a");J.href=T,J.download=`${m.value.text||"mindmap"}.png`,J.click(),URL.revokeObjectURL(T)},"image/png")}catch(oe){console.warn("PNG export failed, falling back to SVG:",oe),To()}},z.onerror=()=>{URL.revokeObjectURL(M),To()},z.src=M}return o({addChild:r=>no(r),addSibling:r=>ci(r),removeNode:r=>ua(r),duplicateNode:r=>ia(r),setNodeText:(r,l)=>ha(r,l),moveNode:(r,l,f)=>tr(r,l,f),lineWidthForDepth:D,endWidthForDepth:X,getData:()=>m.value,nodeHasContent:r=>Ea(r),getSelectedIds:()=>[...d.value],copyNodes:r=>sa(r),cutNodes:r=>ca(r),pasteNodes:r=>da(r),setData:r=>{Gt.reset(),m.value=Bt(r),d.value=new Set,h.value=new Set,we(),Oe(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:vh,importData:Bh,getMarkdown:()=>Ln(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(Y.value=!0),N=!l,Gt.reset(),m.value=Bt(f),d.value=new Set,h.value=new Set,we(),Oe(),e.nextTick(()=>{N=!1,rn()}),a("change",m.value)},setBalanced:r=>{Qn.value=r},isBalanced:()=>Qn.value,balance:()=>Rh(),applyNodeStyle:(r,l)=>xe(r,l),getNodeStyle:r=>ee(r),applyNodeImage:(r,l)=>ce(r,l),applyNodeImageByUrl:(r,l)=>g(r,l),removeNodeImage:r=>ue(r),applyNodeLink:(r,l)=>fe(r,l),removeNodeLink:r=>L(r),applyNodeNote:(r,l)=>O(r,l),removeNodeNote:r=>ae(r),applyNodeRichContent:(r,l)=>ke(r,l),addNodeMarker:(r,l)=>$h(r,l),removeNodeMarker:(r,l)=>Ph(r,l),toggleNodeMarker:(r,l)=>wa(r,l),getNodeMarkers:r=>Fh(r),setNodeTags:(r,l)=>ir(r,l),getNodeTags:r=>Wh(r),exportPNG:r=>Sa(r),exportSVG:()=>To(),searchNodes:r=>(zh(r),[...ln.value]),undo:()=>Qi(),redo:()=>er(),canUndo:()=>Gt.canUndo(),canRedo:()=>Gt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:_.autoBalanceOnChange,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineStyle:_.lineStyle,rootLineStyle:_.rootLineStyle,lineOrigin:_.lineOrigin,layoutMode:_.layoutMode,taperedEdge:_.taperedEdge,lineWidthTaper:_.lineWidthTaper,elbowRadius:_.elbowRadius,showOrderBadge:_.showOrderBadge,canvasBg:_.canvasBg}),setBranchPalette:r=>{if(!r)return;[...cn,..._.customPalettes].find(f=>f.id===r)&&(_.branchPaletteId=r)},getBranchPalette:()=>_.branchPaletteId,getBranchPalettes:()=>[...cn,..._.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=Bt(r),we()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>rn())}),(r,l)=>{var f,w,E,v,M,z,Z,j,oe;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Jt.value,fontSize:yt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Ch,onContextmenu:Qe,onWheel:l[26]||(l[26]=(...T)=>e.unref(he).onWheel&&e.unref(he).onWheel(...T)),onMouseenter:l[27]||(l[27]=T=>x.value=!0),onMouseleave:l[28]||(l[28]=T=>x.value=!1),onClick:Mh},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:pt.value.vbX*e.unref(he).scale.value+e.unref(he).offsetX.value+"px",top:pt.value.vbY*e.unref(he).scale.value+e.unref(he).offsetY.value+"px",width:pt.value.vbW*e.unref(he).scale.value+"px",height:pt.value.vbH*e.unref(he).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:dh.value,preserveAspectRatio:"xMinYMin meet",width:pt.value.vbW*e.unref(he).scale.value,height:pt.value.vbH*e.unref(he).scale.value},[e.createElementVNode("g",Op,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ea.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Et(fi(T.from,"out",T.to.side,T.to),fi(T.to,"in"),D(T.from.depth),X(T.to.depth),32,b(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,Lp))),128))])],8,Ip))],4),e.unref(he).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(he).marquee.x*e.unref(he).scale.value+e.unref(he).offsetX.value+"px",top:e.unref(he).marquee.y*e.unref(he).scale.value+e.unref(he).offsetY.value+"px",width:e.unref(he).marquee.width*e.unref(he).scale.value+"px",height:e.unref(he).marquee.height*e.unref(he).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(he).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(he).offsetX.value}px, ${e.unref(he).offsetY.value}px) scale(${e.unref(he).scale.value})`})},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:F.value.x1+"px",top:F.value.y1+"px",width:F.value.horizontal?F.value.x2-F.value.x1+"px":"3px",height:F.value.horizontal?"3px":F.value.y2-F.value.y1+"px",transform:F.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,T=>{var J,se,ge,Me,Ce,ve,Q;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Zi.value===T.id,"is-dragging-source":((J=C.value)==null?void 0:J.srcId)===T.id,"is-drop-target":((se=C.value)==null?void 0:se.currentTargetId)===T.id&&((ge=C.value)==null?void 0:ge.dropPosition)==="child","is-drop-target-before":((Me=C.value)==null?void 0:Me.currentTargetId)===T.id&&((Ce=C.value)==null?void 0:Ce.dropPosition)==="before","is-drop-target-after":((ve=C.value)==null?void 0:ve.currentTargetId)===T.id&&((Q=C.value)==null?void 0:Q.dropPosition)==="after","is-search-hit":Ih(T.id),"is-search-current":Oh(T.id),"is-search-dimmed":Lh(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Zl(T)+"px",background:ql(T),color:eo(T),borderColor:to(T),fontWeight:Xl(T),transform:"translate(-50%, -50%)"}),onClick:ie=>wh(ie,T),onPointerdown:ie=>Sh(ie,T),onDblclick:ie=>{ie.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:ie=>ne(ie,T),onMouseenter:ie=>{Zn(T.id),Jn(ie,T)},onMouseleave:ie=>gn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Vp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ie=>mh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ie=>k.value=ie),class:"zm-rich-edit",spellcheck:"false",onBlur:oa,onKeydown:hh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Pp,[e.createElementVNode("code",{innerHTML:e.unref(_i)(e.unref(jo)(T.richContent.raw),e.unref(Sn)(T.richContent.raw))},null,8,Fp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Up,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ri)(T.richContent.raw),(ie,Fe)=>(e.openBlock(),e.createElementBlock("tr",{key:Fe},[Fe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ie,(K,We)=>(e.openBlock(),e.createElementBlock("th",{key:`h${We}`},e.toDisplayString(K),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ie,(K,We)=>(e.openBlock(),e.createElementBlock("td",{key:`c${We}`},e.toDisplayString(K),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,$p)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Hp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Wp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ie=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:"zm-node-marker",title:e.unref(Tr)(ie),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Oo)(ie)+"</svg>"},null,8,Gp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",jp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Kp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ai(T.note.text),onClick:e.withModifiers(ie=>li(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,Yp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ie=>u.value=ie),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ie=>Ji()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ie=>Ji(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ie=>Ji(),["prevent"]),["tab"])),e.withKeys(uh,["esc"]),gh],onInput:fh,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",qp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ie=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:"zm-node-tag",style:e.normalizeStyle(e.unref(yi)(ie))},e.toDisplayString(ie),5))),128))])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ya(T.id)+1} 个`},e.toDisplayString(ya(T.id)+1),9,Xp)):e.createCommentVNode("",!0),ka(T.id)&&nr(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:nn.value.get(T.id)??"#64748b"}),title:`展开 ${nr(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>fa(T.id),["stop"])},e.toDisplayString(nr(T.id)),47,Zp)):e.createCommentVNode("",!0),_h(T)&&!ka(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:nn.value.get(T.id)??"#64748b",borderColor:nn.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>fa(T.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Jp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ie=>Tt(ie,T),["stop"])},null,40,Qp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>ue(T.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,eh)):e.createCommentVNode("",!0)],46,Dp)}),128))],4),A.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!A.value.above}]),style:e.normalizeStyle({left:A.value.x+"px",top:A.value.y+"px"})},e.toDisplayString(A.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(bs,{key:3,x:B.value.x,y:B.value.y,container:c.value,"has-image":!!((f=e.unref(be)(m.value,B.value.nodeId))!=null&&f.image),"has-link":!!((w=e.unref(be)(m.value,B.value.nodeId))!=null&&w.link),"has-note":!!((E=e.unref(be)(m.value,B.value.nodeId))!=null&&E.note),"has-code":((M=(v=e.unref(be)(m.value,B.value.nodeId))==null?void 0:v.richContent)==null?void 0:M.kind)==="code","has-table":((Z=(z=e.unref(be)(m.value,B.value.nodeId))==null?void 0:z.richContent)==null?void 0:Z.kind)==="table","node-markers":((j=e.unref(be)(m.value,B.value.nodeId))==null?void 0:j.markers)??[],"node-tags":((oe=e.unref(be)(m.value,B.value.nodeId))==null?void 0:oe.tags)??[],onPickImage:go,onRemoveImage:vn,onSetLink:Yi,onRemoveLink:bo,onEditNote:ko,onRemoveNote:qi,onAddCode:ri,onEditCode:ri,onRemoveCode:Xi,onAddTable:He,onEditTable:He,onRemoveTable:pn,onToggleMarker:Uh,onClearMarkers:Hh,onAddTag:Gh,onRemoveTags:jh,onClose:ye},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(ks,{key:4,x:S.value.x,y:S.value.y,container:c.value,onOpenSettings:et,onOpenData:en,onOpenImport:tt,onExportPng:Sa,onExportSvg:To,onClose:ut},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(U.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,th),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:ho},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",{class:"zm-tb-tip zm-tb-zoom",title:"点击重置为 100%",onClick:l[16]||(l[16]=T=>e.unref(he).zoomTo100())},e.toDisplayString(Math.round(e.unref(he).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[17]||(l[17]=(...T)=>e.unref(he).zoomIn&&e.unref(he).zoomIn(...T))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[18]||(l[18]=(...T)=>e.unref(he).zoomOut&&e.unref(he).zoomOut(...T))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(_e,{name:"reset"})]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:yh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[19]||(l[19]=T=>pa(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[20]||(l[20]=T=>pa(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Eh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[21]||(l[21]=T=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,nh)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[22]||(l[22]=T=>p.value&&ci(p.value))},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,oh)]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[23]||(l[23]=T=>or("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[24]||(l[24]=T=>or("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[25]||(l[25]=T=>or("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(It,{side:"left",scope:"canvas",width:300,open:tn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[29]||(l[29]=T=>tn.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"selected-id":p.value,"collapsed-ids":nt.value,"show-index":re.value,onSelect:po,onToggleCollapse:mn,onEdit:ii,onAddChild:Kn,onAddSibling:Yn,onMove:Vt},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:Lt.value&&!t.previewMode,title:"数据","onUpdate:open":l[31]||(l[31]=T=>Lt.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,"pending-mode":Dt.value,onImport:l[30]||(l[30]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:420,open:me.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[33]||(l[33]=T=>me.value=T)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:m.value,onImport:l[32]||(l[32]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:ft.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[34]||(l[34]=T=>ft.value=T)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":kt.value,"focus-tick":Be.value,onApply:ot,onRemove:St,onSetLink:Rn,onSetImage:ni,onSetRich:oi},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:340,open:Ie.value&&!t.previewMode,title:"设置","onUpdate:open":l[35]||(l[35]=T=>Ie.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode($o,{settings:_,"has-selection":p.value!==null,"selected-node-text":(T=kt.value)==null?void 0:T.text,"node-style":q.value,"onUpdate:settings":le,"onUpdate:nodeStyle":Ee,onReset:Ae},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),ih={class:"zm-app"},rh={class:"zm-app-main"},lh={class:"zm-app-canvas"},Yl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
140
140
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
141
141
  渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
142
142
  interface Node {
@@ -167,4 +167,4 @@ function walk(n: Node) {
167
167
  | --- | --- | --- | --- | --- |
168
168
  | 1 | 2 | 3 | 4 | 5 |
169
169
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
170
- 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const I=(H,oe)=>({id:H,text:oe,children:[]}),N=[I("s_l1","左一"),I("s_l2","左二"),I("s_l3","左三"),I("s_l4","左四"),I("s_l5","左五"),I("s_l6","左六"),I("s_l7","左七")],U=[I("s_r1","右一"),I("s_r2","右二"),I("s_r3","右三"),I("s_r4","右四"),I("s_r5","右五"),I("s_r6","右六"),I("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...N,...U]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),x=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),F=e.ref(null);function O(){c.value=n()}function A(){p.value=!0,h.value=!1,x.value=!1}function y(I){A()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var I;return s.value?((I=F.value)==null?void 0:I.getNodeStyle(s.value.id))??{}:{}});function P(I){var N;Object.assign(k,I),(N=F.value)==null||N.applySettings(I)}function G(I){var N;s.value&&((N=F.value)==null||N.applyNodeStyle(s.value.id,I))}function q(){var N;const I={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,I),(N=F.value)==null||N.applySettings(I)}function w(I){if(I.key==="Escape"){if($.value){$.value=!1,I.stopPropagation();return}R.value&&(R.value=!1,I.stopPropagation())}}e.onMounted(()=>{var I;document.addEventListener("keydown",w),window.addEventListener("hashchange",O),(I=F.value)==null||I.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",w),window.removeEventListener("hashchange",O)});function ie(I){c.value=I}function fe(I){var U;const N=I&&I.length>0?I[0]:null;s.value=N,N?!x.value&&((U=F.value)!=null&&U.nodeHasContent(N.id))&&(p.value=!1,h.value=!1,x.value=!0):x.value=!1}e.watch(c,I=>{if(!s.value)return;const N=J(I,s.value.id);N?N!==s.value&&(s.value=N):s.value=null},{deep:!1});function ce(I){if(!s.value||s.value.id!==I){const N=J(c.value,I);N&&(s.value=N)}p.value=!1,h.value=!1,x.value=!0,C.value++}function J(I,N){if(I.id===N)return I;for(const U of I.children){const H=J(U,N);if(H)return H}return null}function me(I){var N;s.value&&((N=F.value)==null||N.applyNodeNote(s.value.id,I))}function ae(){var I;s.value&&((I=F.value)==null||I.removeNodeNote(s.value.id))}function ke(I){var N;s.value&&((N=F.value)==null||N.applyNodeLink(s.value.id,I))}function b(I){var N;s.value&&((N=F.value)==null||N.applyNodeImageByUrl(s.value.id,I))}function V(I){var N;s.value&&((N=F.value)==null||N.applyNodeRichContent(s.value.id,I))}function W(I){const N=document.querySelector(`[data-node-id="${I.id}"]`);N&&N.click()}function ee(I){const N=new Set(u.value);N.has(I)?N.delete(I):N.add(I),u.value=N}function ge(I){var N;(N=F.value)==null||N.setNodeText(I.id,I.text)}function D(I){var N;(N=F.value)==null||N.addChild(I)}function z(I){var N;(N=F.value)==null||N.addSibling(I)}function le(I){var N;(N=F.value)==null||N.moveNode(I.srcId,I.targetId,I.position)}const be=e.computed(()=>{var I;return((I=s.value)==null?void 0:I.id)??null});return(I,N)=>(e.openBlock(),e.createElementBlock("div",oh,[e.createVNode(Ot,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":N[0]||(N[0]=U=>d.value=U)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":be.value,"collapsed-ids":u.value,onSelect:W,onToggleCollapse:ee,onEdit:ge,onAddChild:D,onAddSibling:z,onMove:le},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",ih,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:N[1]||(N[1]=U=>R.value=!1)},[...N[11]||(N[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",rh,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:ie,onSelect:fe,onEditNote:ce,onCanvasSettings:N[2]||(N[2]=U=>$.value=!0),onCanvasData:A,onCanvasImport:y,onCanvasTogglePreview:N[3]||(N[3]=U=>R.value=!R.value),onCanvasOutline:N[4]||(N[4]=U=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Ot,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":N[6]||(N[6]=U=>p.value=U)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:N[5]||(N[5]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":N[8]||(N[8]=U=>h.value=U)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:N[7]||(N[7]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:360,open:x.value&&!R.value,title:"节点内容","onUpdate:open":N[9]||(N[9]=U=>x.value=U)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:me,onRemove:ae,onSetLink:ke,onSetImage:b,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":N[10]||(N[10]=U=>$.value=U)},{default:e.withCtx(()=>{var U;return[e.createVNode(Vo,{settings:k,"has-selection":s.value!==null,"selected-node-text":(U=s.value)==null?void 0:U.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":G,onReset:q},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),lh="0.5.9",ah={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Ot),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",Vo),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",jl)}};Ce.DataPanel=Lo,Ce.Drawer=Ot,Ce.MARKER_LIB=gi,Ce.MarkdownPanel=Do,Ce.MindMap=Qo,Ce.MindMapApp=jl,Ce.NotePanel=Jo,Ce.Outline=Oo,Ce.SettingsPanel=Vo,Ce.VERSION=lh,Ce.addChild=yr,Ce.addSibling=Er,Ce.clone=It,Ce.default=ah,Ce.findNode=he,Ce.findParent=zt,Ce.markdownToMindMap=On,Ce.markdownToRichMindMap=Qa,Ce.markerDef=ds,Ce.markerLabel=Nr,Ce.markerSvg=zo,Ce.mindMapToMarkdown=Ln,Ce.removeNode=Ro,Ce.richBlockToMarkdown=es,Ce.tagColor=bi,Ce.uid=Yt,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
170
+ 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const B=(H,ne)=>({id:H,text:ne,children:[]}),S=[B("s_l1","左一"),B("s_l2","左二"),B("s_l3","左三"),B("s_l4","左四"),B("s_l5","左五"),B("s_l6","左六"),B("s_l7","左七")],U=[B("s_r1","右一"),B("s_r2","右二"),B("s_r3","右三"),B("s_r4","右四"),B("s_r5","右五"),B("s_r6","右六"),B("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...S,...U]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),x=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),F=e.ref(null);function I(){c.value=n()}function A(){p.value=!0,h.value=!1,x.value=!1}function y(B){A()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var B;return s.value?((B=F.value)==null?void 0:B.getNodeStyle(s.value.id))??{}:{}});function P(B){var S;Object.assign(k,B),(S=F.value)==null||S.applySettings(B)}function G(B){var S;s.value&&((S=F.value)==null||S.applyNodeStyle(s.value.id,B))}function Y(){var S;const B={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,B),(S=F.value)==null||S.applySettings(B)}function N(B){if(B.key==="Escape"){if($.value){$.value=!1,B.stopPropagation();return}R.value&&(R.value=!1,B.stopPropagation())}}e.onMounted(()=>{var B;document.addEventListener("keydown",N),window.addEventListener("hashchange",I),(B=F.value)==null||B.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",N),window.removeEventListener("hashchange",I)});function re(B){c.value=B}function pe(B){var U;const S=B&&B.length>0?B[0]:null;s.value=S,S?!x.value&&((U=F.value)!=null&&U.nodeHasContent(S.id))&&(p.value=!1,h.value=!1,x.value=!0):x.value=!1}e.watch(c,B=>{if(!s.value)return;const S=xe(B,s.value.id);S?S!==s.value&&(s.value=S):s.value=null},{deep:!1});function de(B){if(!s.value||s.value.id!==B){const S=xe(c.value,B);S&&(s.value=S)}p.value=!1,h.value=!1,x.value=!0,C.value++}function xe(B,S){if(B.id===S)return B;for(const U of B.children){const H=xe(U,S);if(H)return H}return null}function ee(B){var S;s.value&&((S=F.value)==null||S.applyNodeNote(s.value.id,B))}function ce(){var B;s.value&&((B=F.value)==null||B.removeNodeNote(s.value.id))}function ue(B){var S;s.value&&((S=F.value)==null||S.applyNodeLink(s.value.id,B))}function g(B){var S;s.value&&((S=F.value)==null||S.applyNodeImageByUrl(s.value.id,B))}function V(B){var S;s.value&&((S=F.value)==null||S.applyNodeRichContent(s.value.id,B))}function W(B){const S=document.querySelector(`[data-node-id="${B.id}"]`);S&&S.click()}function te(B){const S=new Set(u.value);S.has(B)?S.delete(B):S.add(B),u.value=S}function fe(B){var S;(S=F.value)==null||S.setNodeText(B.id,B.text)}function L(B){var S;(S=F.value)==null||S.addChild(B)}function O(B){var S;(S=F.value)==null||S.addSibling(B)}function ae(B){var S;(S=F.value)==null||S.moveNode(B.srcId,B.targetId,B.position)}const ke=e.computed(()=>{var B;return((B=s.value)==null?void 0:B.id)??null});return(B,S)=>(e.openBlock(),e.createElementBlock("div",ih,[e.createVNode(It,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":S[0]||(S[0]=U=>d.value=U)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,"selected-id":ke.value,"collapsed-ids":u.value,onSelect:W,onToggleCollapse:te,onEdit:fe,onAddChild:L,onAddSibling:O,onMove:ae},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",rh,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:S[1]||(S[1]=U=>R.value=!1)},[...S[11]||(S[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",lh,[e.createVNode(ei,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:re,onSelect:pe,onEditNote:de,onCanvasSettings:S[2]||(S[2]=U=>$.value=!0),onCanvasData:A,onCanvasImport:y,onCanvasTogglePreview:S[3]||(S[3]=U=>R.value=!R.value),onCanvasOutline:S[4]||(S[4]=U=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(It,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":S[6]||(S[6]=U=>p.value=U)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:S[5]||(S[5]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":S[8]||(S[8]=U=>h.value=U)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:c.value,onImport:S[7]||(S[7]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:360,open:x.value&&!R.value,title:"节点内容","onUpdate:open":S[9]||(S[9]=U=>x.value=U)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ee,onRemove:ce,onSetLink:ue,onSetImage:g,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":S[10]||(S[10]=U=>$.value=U)},{default:e.withCtx(()=>{var U;return[e.createVNode($o,{settings:k,"has-selection":s.value!==null,"selected-node-text":(U=s.value)==null?void 0:U.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":G,onReset:Y},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ah="0.5.10",sh={install(t){t.component("FlowMindMap",ei),t.component("FlowMindMapOutline",Lo),t.component("FlowMindMapDrawer",It),t.component("FlowMindMapDataPanel",Do),t.component("FlowMindMapMarkdownPanel",Vo),t.component("FlowMindMapSettingsPanel",$o),t.component("FlowMindMapNotePanel",Qo),t.component("FlowMindMapApp",Yl)}};Te.DataPanel=Do,Te.Drawer=It,Te.MARKER_LIB=ki,Te.MarkdownPanel=Vo,Te.MindMap=ei,Te.MindMapApp=Yl,Te.NotePanel=Qo,Te.Outline=Lo,Te.SettingsPanel=$o,Te.VERSION=ah,Te.addChild=bi,Te.addSibling=xr,Te.clone=Bt,Te.default=sh,Te.findNode=be,Te.findParent=zt,Te.markdownToMindMap=On,Te.markdownToRichMindMap=ts,Te.markerDef=fs,Te.markerLabel=Tr,Te.markerSvg=Oo,Te.mindMapToMarkdown=Ln,Te.removeNode=vo,Te.richBlockToMarkdown=ns,Te.tagColor=yi,Te.uid=Kt,Object.defineProperties(Te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});