flow-mindmap 0.5.2 → 0.5.4

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,17 @@
1
- (function(he,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(he=typeof globalThis<"u"?globalThis:he||self,e(he.FlowMind={},he.Vue))})(this,function(he,e){"use strict";var yg=Object.defineProperty;var Eg=(he,e,Bn)=>e in he?yg(he,e,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):he[e]=Bn;var ve=(he,e,Bn)=>Eg(he,typeof e!="symbol"?e+"":e,Bn);var Qo;const Bn=["width","height","stroke-width"],ya={key:4,points:"6 9 12 15 18 9"},Ea={key:5,points:"9 6 15 12 9 18"},ye=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",ya)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ea)):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,Bn))}}),ri="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",ii="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",li=[22,15,13,12],ai=[700,600,500,400],xa=[46,36,30,26],wa=[120,80,60,44],Na=[.8,.8,.8,.8],Sa=1,Ta=li.length-1;function Ca(t,o){return Math.round(fr(t,o)*Na[Ao(t)])}function Ao(t){return Math.min(Ta,Math.max(0,t))}function fr(t,o=14){return Math.round(li[Ao(t)]*o/14*10)/10}function Aa(t,o=14){return Math.round(xa[Ao(t)]*o/14)}const ro=60,_a=30,Ma=.75,In=14,At=24;function si(t){return Math.max(_a,Math.round(ro*Math.pow(Ma,t)))}let mr=null;function va(){if(mr)return mr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(mr=t,t):{font:"",measureText:()=>({width:0})}}const ci=new Map;function di(t,o,n){const r=`${n}|${o}|${t}`,l=ci.get(r);if(l!==void 0)return l;const c=va();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 g=c.measureText(d).width;g>u&&(u=g)}return ci.set(r,u),u}const Ra=24,Ba=400,Ia=8,ui=16,fi=4,mi=200;function za(t,o,n){return Math.min(n,Math.max(o,t))}function Oa(t,o,n,r,l){const c=Ao(o),s=fr(o,n),u=Math.min(di(t.text||"",s,ai[c]),mi),d=Ca(o,n),g=Math.ceil(u+d*2+Sa*2),h=(t.text||"").split(`
3
- `);let w=0;for(const J of h){const I=di(J,s,ai[c]);w+=Math.max(1,Math.ceil(I/mi))}w=Math.max(1,w);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Aa(o,n)+Math.ceil(s*1.2*(w-1));let _=0;if(t.link&&(_+=ui),t.note&&(_+=ui),_>0){const J=(t.link?1:0)+(t.note?1:0);_+=fi*J}const P=14,z=2;let C=0;t.markers&&t.markers.length>0&&(C=t.markers.length*P+(t.markers.length-1)*z+fi);const x=18,k=4,f=t.tags&&t.tags.length>0?x:0,R=g+_+C,E=(()=>{const J=Math.round(wa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const I=l==null?void 0:l[t.id];return Math.max(J,I??240)}return J})(),Y=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),K=r==null?void 0:r[t.id],ee=Y?Math.max(24,K??Math.max(70,Math.ceil(s*5))):0,ae=ee>0?10:0;if(!t.image){const J=Math.max(E,R),I=Math.ceil($+ae+ee+(f>0?k+f:0));return{w:J,h:I}}const ie=za(t.image.width,Ra,Ba),X=Math.max(E,R,Math.ceil(ie+d*2)),te=Math.ceil(t.image.height+Ia+$+ae+ee+(f>0?k+f:0));return{w:X,h:te}}function La(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,l=o.baseFontSize??14,c=gi(t,0,null,1,"right",l,o.richHeights,o.richWidths);return Va(c),Da(c,n,r),c.x=0,c.y=0,$a(c,r)}function Da(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,S)=>w+S._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),h=0;for(let w=0;w<r.length-1;w++){h+=r[w]._subtreeH;const S=Math.abs(h-(u-h));S<g&&(g=S,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const l=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const h of u.children)s(h,d)};for(const u of l)s(u,"right");for(const u of c)s(u,"left");if(l.length>0){const u={...t,children:l};_o(u,"right",ro,!0,n)}if(c.length>0){const u={...t,children:c};_o(u,"left",ro,!0,n)}}else if(o==="tree"){const r=l=>{l.side=1,l._dir="right";for(const c of l.children)r(c)};for(const l of t.children)l._dir="right";_o(t,"right",ro,!0,n),r(t)}else{for(const r of t.children)r._dir="down";pi(t,ro,n)}}function _o(t,o,n,r,l=!1){if(t.children.length===0)return;const c=t.children.reduce((h,w,S)=>h+w._subtreeH+(S>0?In:0),0),s=o==="right"?1:-1,u=r?s:1;let d=t.y-u*c/2;const g=si(t.depth);t.children.forEach(h=>{l||(h.x=t.x+s*(t.width/2+g+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+In),_o(h,o,n,!1,l)})}function pi(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?In*2:0),0);let l=t.x-r/2;const c=si(t.depth);t.children.forEach(s=>{n||(s.x=l+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",l+=s._subtreeW+In*2,pi(s,o,n)})}function gi(t,o,n,r,l,c,s,u){const d=Oa(t,o,c,s,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:fr(o,c),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const h=t.children.length,w=Math.ceil(h/2);return g.children=t.children.map((S,$)=>{const _=o===0?$<w?1:-1:r;return gi(S,o+1,g,_,l,c,s,u)}),g}function Va(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const l of r.children)o.push(l)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,c=0;for(const s of r.children)l+=s._subtreeH,c+=s._subtreeW;r.children.length>1&&(l+=In*(r.children.length-1),c+=In*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,c)}}function $a(t,o=!1){const n=[t];let r=1/0,l=-1/0,c=1/0,s=-1/0;for(;n.length;){const g=n.pop(),h=g.width/2,w=g.height/2;g.x-h<r&&(r=g.x-h),g.x+h>l&&(l=g.x+h),g.y-w<c&&(c=g.y-w),g.y+w>s&&(s=g.y+w),n.push(...g.children)}if(o)return{root:t,width:l-r+At*2,height:s-c+At*2,vbX:r-At,vbY:c-At,vbW:l-r+At*2,vbH:s-c+At*2};const u=At-c,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return c+=u,s+=u,{root:t,width:l-r+At*2,height:s+At,vbX:r-At,vbY:0,vbW:l-r+At*2,vbH:s+At}}const en=[{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 Pa(t,o=[]){return[...en,...o].find(r=>r.id===t)??en[0]}function Fa(t,o=8){const n=[],r=new Set,l=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=l.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ua(s):s.startsWith("rgb")?u=Ha(s):u=Wa[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function Ua(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(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).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 Ha(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 r=[];for(let l=0;l<3;l++){const c=n[l];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;r.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;r.push(s)}}return"#"+r.map(l=>l.toString(16).padStart(2,"0")).join("").toLowerCase()}const Wa={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 Gt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function _t(t){return JSON.parse(JSON.stringify(t))}function re(t,o){if(t.id===o)return t;for(const n of t.children){const r=re(n,o);if(r)return r}return null}function Lt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const l=Lt(r,o,t);if(l!==null)return l}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Ga(t,o,n){const r=re(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function ja(t,o,n,r){if(!Lt(t,o)||o===n||re(re(t,o),n))return!1;const l=Lt(t,o),c=l.children.findIndex(g=>g.id===o);if(c<0)return!1;const[s]=l.children.splice(c,1);if(r==="child"){const g=re(t,n);return g?(g.children.push(s),!0):(l.children.splice(c,0,s),!1)}const u=Lt(t,n);if(!u)return l.children.splice(c,0,s),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(l.children.splice(c,0,s),!1):(r==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function hi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of t.children){const c=l.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?Ro:n>0?`新节点 ${n+1}`:"新节点 2"}function bi(t,o,n){const r=re(t,o);if(!r)return null;const l={id:Gt(),text:n??hi(r),children:[]};return r.children.push(l),l}function ki(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(s=>s.id===o);if(l<0)return null;const c={id:Gt(),text:n??hi(r),children:[]};return r.children.splice(l+1,0,c),c}function Ka(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(s=>s.id===o);if(l<0)return null;const c={id:Gt(),text:n,children:[]};return r.children.splice(l,0,c),c}function Ya(t,o){const n=Lt(t,o);if(!n)return null;const r=n.children.findIndex(s=>s.id===o);if(r<0)return null;const l=n.children[r],c=_t(l);return vo(c),n.children.splice(r+1,0,c),c}function vo(t){t.id=Gt();for(const o of t.children)vo(o)}function yi(t,o){const n=re(t,o);if(!n||n.id===t.id)return null;const r=_t(n);return vo(r),r}const Ro="新节点";function zn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Gt(),text:o,children:[]},l=[r],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,S=[],$=null;function _(C){S.push(C)}function P(){if($&&S.length>0){for(;S.length>0&&S[0].trim()==="";)S.shift();for(;S.length>0&&S[S.length-1].trim()==="";)S.pop();const C=S.join(`
4
- `);C&&($.note={text:C})}w=!1,S=[]}for(const C of n){if(w){const E=C.match(h);if(E&&E[1][0]==="`"){P();continue}_(C);continue}const x=C.match(u);if(x){const E=x[1].length,Y=x[2].trim();s.push({level:E,text:Y,body:""}),$=s[s.length-1];continue}const k=C.match(h);if(k&&k[2]==="note"){w=!0,S=[];continue}const f=C.match(d);if(f&&$){const E=f[2],Y=160,K=120;$.image={src:E,naturalW:Y,naturalH:K,width:Y,height:K};continue}const R=C.match(g);if(R&&$){$.link={url:R[2]},$.text=R[1];continue}if(C.trim().length>0&&$){const E=C.trim();$.body=$.body?$.body+`
5
- `+E:E}}w&&P();function z(C){for(;l.length>1;){const R=l.length-1,E=c[R];if(E!==void 0&&E<C.level)break;l.pop(),c.pop()}const x=l[l.length-1],k=C.text,f={id:Gt(),text:k,children:[]};C.image&&(f.image={...C.image}),C.link&&(f.link={url:C.link.url}),C.note&&(f.note={text:C.note.text}),C.body&&(f.note={text:C.body}),x.children.push(f),l.push(f),c.push(C.level)}for(const C of s)z(C);if(s.length>0&&s[0].level===1){const C=r.children[0];C&&(r.text=C.text,r.id=C.id,C.image&&(r.image={...C.image}),C.link&&(r.link={url:C.link.url}),C.note&&(r.note={text:C.note.text}),r.children=C.children)}return r}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(xe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(xe=typeof globalThis<"u"?globalThis:xe||self,e(xe.FlowMind={},xe.Vue))})(this,function(xe,e){"use strict";var Mg=Object.defineProperty;var Rg=(xe,e,vn)=>e in xe?Mg(xe,e,{enumerable:!0,configurable:!0,writable:!0,value:vn}):xe[e]=vn;var Le=(xe,e,vn)=>Rg(xe,typeof e!="symbol"?e+"":e,vn);var ei;const vn=["width","height","stroke-width"],ka={key:4,points:"6 9 12 15 18 9"},ya={key:5,points:"9 6 15 12 9 18"},Ne=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",ka)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ya)):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,vn))}}),rr="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",lr="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",ar=[22,15,13,12],Ea=[700,600,500,400],xa=[52,40,32,28],wa=[120,80,60,44],Na=[.8,.8,.8,.8],Sa=ar.length-1;function Ca(t,o){return Math.round(mi(t,o)*Na[_o(t)])}function _o(t){return Math.min(Sa,Math.max(0,t))}function mi(t,o=14){return Math.round(ar[_o(t)]*o/14*10)/10}function Ta(t,o=14){return Math.round(xa[_o(t)]*o/14)}const io=60,Aa=30,_a=.75,Bn=14,Ot=24;function sr(t){return Math.max(Aa,Math.round(io*Math.pow(_a,t)))}let pi=null;function Ma(){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 cr=new Map;function Ra(t,o,n){const i=`${n}|${o}|${t}`,a=cr.get(i);if(a!==void 0)return a;const c=Ma();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=c.measureText(t).width;return cr.set(i,s),s}const va=24,Ba=400,Ia=8,dr=16,ur=4,za=200;function Oa(t,o,n){return Math.min(n,Math.max(o,t))}function La(t,o,n,i,a){const c=_o(o),s=mi(o,n),u=Math.min(Ra(t.text||"",s,Ea[c]),za),d=Ca(o,n),g=Math.ceil(u+d*2),N=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ta(o,n);let C=0;if(t.link&&(C+=dr),t.note&&(C+=dr),C>0){const Y=(t.link?1:0)+(t.note?1:0);C+=ur*Y}const $=14,R=2;let F=0;t.markers&&t.markers.length>0&&(F=t.markers.length*$+(t.markers.length-1)*R+ur);const B=18,_=4,x=t.tags&&t.tags.length>0?B:0,k=g+C+F,m=(()=>{const Y=Math.round(wa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const oe=a==null?void 0:a[t.id];return Math.max(Y,oe??240)}return Y})(),P=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),L=i==null?void 0:i[t.id],S=P?Math.max(24,L??Math.max(70,Math.ceil(s*5))):0,K=S>0?10:0;if(!t.image){const Y=Math.max(m,k),oe=Math.ceil(N+K+S+(x>0?_+x:0));return{w:Y,h:oe}}const J=Oa(t.image.width,va,Ba),de=Math.max(m,k,Math.ceil(J+d*2)),ee=Math.ceil(t.image.height+Ia+N+K+S+(x>0?_+x:0));return{w:de,h:ee}}function Da(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=mr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return $a(c),Va(c,n,i),c.x=0,c.y=0,Pa(c,i)}function Va(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((N,C)=>N+C._subtreeH,0);let d=1,g=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let N=0;N<i.length-1;N++){h+=i[N]._subtreeH;const C=Math.abs(h-(u-h));C<g&&(g=C,d=N+1)}for(let N=0;N<d;N++)i[N]._dir="right",i[N].side=1,i[N]._dirRight=1;for(let N=d;N<i.length;N++)i[N]._dir="left",i[N].side=-1,i[N]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;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};Mo(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};Mo(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";Mo(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";fr(t,io,n)}}function Mo(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,N,C)=>h+N._subtreeH+(C>0?Bn:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const g=sr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+g+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+Bn),Mo(h,o,n,!1,a)})}function fr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?Bn*2:0),0);let a=t.x-i/2;const c=sr(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+Bn*2,fr(s,o,n)})}function mr(t,o,n,i,a,c,s,u){const d=La(t,o,c,s,u),g={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 g;const h=t.children.length,N=Math.ceil(h/2);return g.children=t.children.map((C,$)=>{const R=o===0?$<N?1:-1:i;return mr(C,o+1,g,R,a,c,s,u)}),g}function $a(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+=Bn*(i.children.length-1),c+=Bn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Pa(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const g=n.pop(),h=g.width/2,N=g.height/2;g.x-h<i&&(i=g.x-h),g.x+h>a&&(a=g.x+h),g.y-N<c&&(c=g.y-N),g.y+N>s&&(s=g.y+N),n.push(...g.children)}if(o)return{root:t,width:a-i+Ot*2,height:s-c+Ot*2,vbX:i-Ot,vbY:c-Ot,vbW:a-i+Ot*2,vbH:s-c+Ot*2};const u=Ot-c,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return c+=u,s+=u,{root:t,width:a-i+Ot*2,height:s+Ot,vbX:i-Ot,vbY:0,vbW:a-i+Ot*2,vbH:s+Ot}}const on=[{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 Fa(t,o=[]){return[...on,...o].find(i=>i.id===t)??on[0]}function Ua(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=Ha(s):s.startsWith("rgb")?u=Wa(s):u=Ga[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 Ha(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 Wa(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 Ga={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 Xt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Lt(t){return JSON.parse(JSON.stringify(t))}function le(t,o){if(t.id===o)return t;for(const n of t.children){const i=le(n,o);if(i)return i}return null}function Wt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Wt(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 ja(t,o,n){const i=le(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Ka(t,o,n,i){if(!Wt(t,o)||o===n||le(le(t,o),n))return!1;const a=Wt(t,o),c=a.children.findIndex(g=>g.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const g=le(t,n);return g?(g.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=Wt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function pr(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?Bo:n>0?`新节点 ${n+1}`:"新节点 2"}function gr(t,o,n){const i=le(t,o);if(!i)return null;const a={id:Xt(),text:n??pr(i),children:[]};return i.children.push(a),a}function hr(t,o,n){const i=Wt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n??pr(i),children:[]};return i.children.splice(a+1,0,c),c}function Ya(t,o,n){const i=Wt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n,children:[]};return i.children.splice(a,0,c),c}function qa(t,o){const n=Wt(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=Lt(a);return vo(c),n.children.splice(i+1,0,c),c}function vo(t){t.id=Xt();for(const o of t.children)vo(o)}function br(t,o){const n=le(t,o);if(!n||n.id===t.id)return null;const i=Lt(n);return vo(i),i}const Bo="新节点";function In(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Xt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let N=!1,C=[],$=null;function R(_){C.push(_)}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 _=C.join(`
2
+ `);_&&($.note={text:_})}N=!1,C=[]}for(const _ of n){if(N){const L=_.match(h);if(L&&L[1][0]==="`"){F();continue}R(_);continue}const x=_.match(u);if(x){const L=x[1].length,S=x[2].trim();s.push({level:L,text:S,body:""}),$=s[s.length-1];continue}const k=_.match(h);if(k&&k[2]==="note"){N=!0,C=[];continue}const m=_.match(d);if(m&&$){const L=m[2],S=160,K=120;$.image={src:L,naturalW:S,naturalH:K,width:S,height:K};continue}const P=_.match(g);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(_.trim().length>0&&$){const L=_.trim();$.body=$.body?$.body+`
3
+ `+L:L}}N&&F();function B(_){for(;a.length>1;){const P=a.length-1,L=c[P];if(L!==void 0&&L<_.level)break;a.pop(),c.pop()}const x=a[a.length-1],k=_.text,m={id:Xt(),text:k,children:[]};_.image&&(m.image={..._.image}),_.link&&(m.link={url:_.link.url}),_.note&&(m.note={text:_.note.text}),_.body&&(m.note={text:_.body}),x.children.push(m),a.push(m),c.push(_.level)}for(const _ of s)B(_);if(s.length>0&&s[0].level===1){const _=i.children[0];_&&(i.text=_.text,i.id=_.id,_.image&&(i.image={..._.image}),_.link&&(i.link={url:_.link.url}),_.note&&(i.note={text:_.note.text}),i.children=_.children)}return i}function zn(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
6
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
7
5
  `),t.image&&(n+=`![image](${t.image.src})
8
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
9
- `);for(const r of t.children)n+=On(r,o+1);return n}function qa(t){var g,h;const o=t.split(/\r?\n/),n=[];let r=0;const l=/^(#{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(;r<o.length;){const w=o[r],S=w.match(c);if(S){const k=S[1][0],f=S[2]||"",R=[w];for(r++;r<o.length;){const Y=o[r].match(c);if(Y&&Y[1][0]===k){R.push(o[r]),r++;break}R.push(o[r]),r++}const E=R.slice(1,-1).join(`
10
- `).trim();n.push({kind:"code",text:((g=E.split(`
11
- `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:R.join(`
12
- `),lang:f});continue}const $=w.match(l);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let f=r,R=!1;for(;f<o.length&&/^\s*\|/.test(o[f]);)k.push(o[f]),s.test(o[f])&&(R=!0),f++;if(R&&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
- `)}),r=f;continue}}const _=w.match(u),P=w.match(d);if(_||P){let k=r;for(;k<o.length;){const f=o[k].match(u),R=o[k].match(d);if(!(f||R))break;const E=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();E.length>0&&n.push({kind:"list",text:E.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const z=[w];let C=r+1;for(;C<o.length;){const k=o[C];if(k.trim()===""||l.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;z.push(k),C++}const x=z.join(" ").trim();n.push({kind:"paragraph",text:x.slice(0,80)||"(空段落)",raw:z.join(`
14
- `)}),r=C}return n}function Xa(t,o="导入的导图"){const n=qa(t||""),r={id:Gt(),text:o,children:[]},l=[r],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;l.length>1&&c[c.length-1]>=h;)l.pop(),c.pop();if(!s&&h===1){s=!0,r.text=d.text,c[0]=1;return}const w={id:Gt(),text:d.text,children:[]};l[l.length-1].children.push(w),l.push(w),c.push(h);return}const g={id:Gt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(g)}for(const d of n)u(d);return r}function Za(t){return t.richContent?t.richContent.raw+`
15
- `:""}function Ja(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,l=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),w=e.reactive({x:0,y:0}),S=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let _=null;function P(X){_=X}function z(X){X.preventDefault();const te=t.getContainer();if(!te)return;const J=-X.deltaY*.001,I=Math.min(n,Math.max(o,l.value*(1+J))),A=te.getBoundingClientRect(),U=X.clientX-A.left,F=X.clientY-A.top,G=(U-c.value)/l.value,le=(F-s.value)/l.value;l.value=I,c.value=U-G*I,s.value=F-le*I}function C(){l.value=Math.min(n,l.value*r)}function x(){l.value=Math.max(o,l.value/r)}function k(X){var J;X.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=X.clientX,g.y=X.clientY,g.ox=c.value,g.oy=s.value,window.addEventListener("mousemove",f),window.addEventListener("mouseup",R),(J=X.preventDefault)==null||J.call(X))}function f(X){if(!u.value)return;const te=X.clientX-g.x,J=X.clientY-g.y;(Math.abs(te)>3||Math.abs(J)>3)&&(d.value=!0),c.value=g.ox+te,s.value=g.oy+J}function R(){u.value=!1,window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",R)}function E(X,te,J){h.value=!0,w.x=X,w.y=te,S.x=X,S.y=te,S.width=0,S.height=0,S.shiftKey=!!(J!=null&&J.shift),$.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",K)}function Y(X,te){if(!h.value)return;const J=Math.min(w.x,X),I=Math.min(w.y,te),A=Math.max(w.x,X),U=Math.max(w.y,te);S.x=J,S.y=I,S.width=A-J,S.height=U-I,$.value++}function K(){h.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",K),_&&_()}function ee(X){if(!h.value)return;const te=t.getContainer();if(!te)return;const J=te.getBoundingClientRect(),I=(X.clientX-J.left-c.value)/l.value,A=(X.clientY-J.top-s.value)/l.value;Y(I,A)}function ae(X,te,J,I=60){const A=t.getContainer();if(!A)return;const U=A.getBoundingClientRect(),F=(U.width-I*2)/X,G=(U.height-I*2)/te,le=Math.min(1,Math.max(.3,Math.min(F,G)));l.value=le,c.value=U.width/2,s.value=U.height/2-J*le}function ie(X,te,J,I,A=80){const U=t.getContainer();if(!U)return;const F=U.getBoundingClientRect();let G=l.value;(J*G<40||I*G<40)&&(G=Math.min(n,Math.max(1,60/Math.min(J,I)))),l.value=G,c.value=F.width/2-X*G,s.value=F.height/2-te*G}return{scale:l,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:z,zoomIn:C,zoomOut:x,startPan:k,startMarquee:E,updateMarquee:Y,isMarquee:h,marquee:S,marqueeVersion:$,setOnMarqueeEnd:P,resetView:ae,centerOn:ie}}const Qa=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Ei(t){return Qa?t.metaKey:t.ctrlKey}function es(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const l=t.getSelectedIds();return l.length>0?l[0]:null}function n(r){var u,d,g;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Ei(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(r.preventDefault(),t.onDuplicate(c));return}if(r.key==="c"||r.key==="C"){const h=t.getSelectedIds();h.length>0&&(r.preventDefault(),t.onCopy(h));return}if(r.key==="x"||r.key==="X"){const h=t.getSelectedIds();h.length>0&&(r.preventDefault(),t.onCut(h));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(Ei(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(s);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else(r.key==="Delete"||r.key==="Backspace")&&c&&c!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(c)):r.key==="F2"&&c?(r.preventDefault(),t.onStartEdit(c)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ts(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function l(){return n<o.value.length-1}function c(g){const h=JSON.stringify(g);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 r()?(n--,JSON.parse(o.value[n])):null}function u(){return l()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:l,record:c,undo:s,redo:u,reset:d}}const ns={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},os={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=ns[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function rs(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),r=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)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const is={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:rs(t)}))},ls={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"/>`}))},pr=[os,is,ls,{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"/>'}]}],Bo={};for(const t of pr)for(const o of t.markers)Bo[o.id]=o;function as(t){return Bo[t]}function Io(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function xi(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function gr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),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 ss={key:5,class:"zm-marker-picker"},cs={class:"zm-marker-group-label"},ds={class:"zm-marker-grid"},us=["title","onClick","innerHTML"],fs=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,r=o,l=e.computed(()=>{let x=n.x+2,k=n.y+2;if(n.container){const f=n.container.getBoundingClientRect(),R=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;x+R>f.right&&(x=Math.max(f.left+4,n.x-R-2)),k+Y>f.bottom&&(k=Math.max(f.top+4,n.y-Y-2)),x<f.left+2&&(x=f.left+2),k<f.top+2&&(k=f.top+2)}return{left:x,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function w(){h.value=!h.value}function S(x){return n.nodeMarkers.includes(x)}function $(x){r("toggleMarker",x)}function _(x){const k=x.target;k&&k.closest(".zm-node-menu")||r("close")}function P(x){x.key==="Escape"&&r("close")}function z(){r("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",P,!0),window.addEventListener("wheel",z,!0),window.addEventListener("scroll",z,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",P,!0),window.removeEventListener("wheel",z,!0),window.removeEventListener("scroll",z,!0)});function C(x){x(),r("close")}return(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.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(f=>C(()=>r("pickImage")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("removeImage")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("setLink")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("removeLink")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("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(f=>C(()=>r("removeCode")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("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(f=>C(()=>r("removeTable")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("editNote")),["stop"]))},[e.createVNode(ye,{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(f=>C(()=>r("removeNote")),["stop"]))},[e.createVNode(ye,{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(w,["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",ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pr),f=>(e.openBlock(),e.createElementBlock("div",{key:f.label,class:"zm-marker-group"},[e.createElementVNode("div",cs,e.toDisplayString(f.label),1),e.createElementVNode("div",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.markers,R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":S(R.id)}]),title:R.label,onClick:e.withModifiers(E=>$(R.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Io)(R.id)+"</svg>"},null,10,us))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(f=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(f=>C(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(f=>C(()=>r("removeTags")),["stop"]))},[e.createVNode(ye,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ms=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let C=n.x+2,x=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),f=160,R=4+4*28+5;C+f>k.right&&(C=Math.max(k.left+4,n.x-f-2)),x+R>k.bottom&&(x=Math.max(k.top+4,n.y-R-2)),C<k.left+2&&(C=k.left+2),x<k.top+2&&(x=k.top+2)}return{left:C,top:x}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const C=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!C)return{left:"-9999px",top:"-9999px",display:"none"};const x=C.getBoundingClientRect(),k=window.innerWidth,f=window.innerHeight,R=176,E=4+3*28;let Y=x.right;Y+R>k-4&&(Y=Math.max(4,x.left-R));let K=x.top-4;return K+E>f-4&&(K=Math.max(4,f-E-4)),{left:Y+"px",top:K+"px",display:"block"}});let g=null,h=null;function w(C){h&&(clearTimeout(h),h=null),g=setTimeout(()=>{c.value=C},60)}function S(){g&&(clearTimeout(g),g=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),h&&clearTimeout(h)});function $(C){const x=C.target;x&&x.closest(".zm-canvas-menu")||r("close")}function _(C){C.key==="Escape"&&r("close")}function P(){r("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",P,!0),window.addEventListener("scroll",P,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",P,!0),window.removeEventListener("scroll",P,!0)});function z(C){C(),r("close")}return(C,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:x[11]||(x[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(k=>z(()=>r("openData")),["stop"]))},[e.createVNode(ye,{name:"database",size:13,stroke:1.6}),x[12]||(x[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:x[5]||(x[5]=k=>w("import")),onMouseleave:S},[e.createVNode(ye,{name:"import",size:13,stroke:1.6}),x[16]||(x[16]=e.createElementVNode("span",null,"导入",-1)),x[17]||(x[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:x[4]||(x[4]=k=>w("import")),onMouseleave:S},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(k=>z(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(ye,{name:"markdown",size:13,stroke:1.6}),x[13]||(x[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(k=>z(()=>r("openImport","json")),["stop"]))},[e.createVNode(ye,{name:"json",size:13,stroke:1.6}),x[14]||(x[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(k=>z(()=>r("openImport","txt")),["stop"]))},[e.createVNode(ye,{name:"txt",size:13,stroke:1.6}),x[15]||(x[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[6]||(x[6]=e.withModifiers(k=>z(()=>r("openSettings")),["stop"]))},[e.createVNode(ye,{name:"settings",size:13,stroke:1.6}),x[18]||(x[18]=e.createElementVNode("span",null,"设置",-1))]),x[23]||(x[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:x[10]||(x[10]=k=>w("export")),onMouseleave:S},[e.createVNode(ye,{name:"export",size:13,stroke:1.6}),x[21]||(x[21]=e.createElementVNode("span",null,"导出",-1)),x[22]||(x[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:x[9]||(x[9]=k=>w("export")),onMouseleave:S},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[7]||(x[7]=e.withModifiers(k=>z(()=>r("exportPng")),["stop"]))},[e.createVNode(ye,{name:"image",size:13,stroke:1.6}),x[19]||(x[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[8]||(x[8]=e.withModifiers(k=>z(()=>r("exportSvg")),["stop"]))},[e.createVNode(ye,{name:"svg-export",size:13,stroke:1.6}),x[20]||(x[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),ps=["aria-hidden"],gs=["aria-hidden"],hs={key:0,class:"zm-drawer-header"},bs={key:0,class:"zm-drawer-title"},ks={class:"zm-drawer-body"},ys=["aria-hidden"],Es={key:0,class:"zm-drawer-header"},xs={key:0,class:"zm-drawer-title"},ws={class:"zm-drawer-body"},Mt=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 r(){n("update:open",!1)}function l(){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&&l())},null,8,ps)):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",hs,[t.title?(e.openBlock(),e.createElementBlock("h3",bs,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:r},[...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",ks,[e.renderSlot(c.$slots,"default")])],14,gs)):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",Es,[t.title?(e.openBlock(),e.createElementBlock("h3",xs,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:r},[...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",ws,[e.renderSlot(c.$slots,"default")])],14,ys)):e.createCommentVNode("",!0)]),_:3}))}}),Ns={class:"zm-outline-root"},Ss={class:"zm-outline-search"},Ts={key:0,class:"zm-outline-search-count"},Cs={key:1,class:"zm-outline-search-count zm-outline-search-empty"},As={class:"zm-outline-actions"},_s={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ms={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},vs={key:1,d:"M5 12 L10 17 L19 7"},Rs={class:"zm-outline"},Bs=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Is=["title","onClick"],zs={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Os={key:0,points:"6 9 12 15 18 9"},Ls={key:1,points:"9 6 15 12 9 18"},Ds={key:1,class:"zm-outline-dot"},Vs={class:"zm-outline-index"},$s={key:3,class:"zm-outline-text"},Ps=["onClick"],Fs=["src"],Us=["onClick"],Hs=["src"],Ws=["title","onClick"],Gs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},js={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ks={key:1,d:"M5 12 L10 17 L19 7"},zo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const p=l.value.trim().toLowerCase();if(!p)return new Set;const L=new Set,V=q=>{var se;(q.text.toLowerCase().includes(p)||(se=q.note)!=null&&se.text&&q.note.text.toLowerCase().includes(p))&&L.add(q.id);for(const ge of q.children)V(ge)};return V(n.data),L}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,L=V=>{let q=u.value.has(V.id);for(const se of V.children)L(se)&&(q=!0);return q&&p.add(V.id),q};return L(n.data),p}),g=e.computed(()=>{const p=[],L=V=>{u.value.has(V.id)&&p.push(V.id);for(const q of V.children)L(q)};return L(n.data),p}),h=e.computed(()=>l.value.trim().length>0),w=e.computed(()=>{const p=[],L=d.value,V=(q,se,ge)=>{if(h.value&&!L.has(q.id))return;const Ge=q.children.length>0,Pe=h.value?!1:n.collapsedIds.has(q.id);p.push({id:q.id,text:q.text||"(无标题)",depth:se,siblingIndex:ge,hasChildren:Ge,collapsed:Pe,node:q}),Ge&&!Pe&&q.children.forEach((Ze,je)=>V(Ze,se+1,je))};return V(n.data,0,0),p});function S(){s.value=g.value.length>0?0:-1}function $(){const p=g.value;p.length!==0&&(s.value=(s.value+1)%p.length,z(s.value))}function _(){const p=g.value;p.length!==0&&(s.value=(s.value-1+p.length)%p.length,z(s.value))}function P(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?_():$()):p.key==="Escape"&&(p.preventDefault(),l.value="",s.value=-1)}function z(p){const L=g.value[p];if(!L)return;const V=w.value.find(q=>q.id===L);V&&r("select",V.node),e.nextTick(()=>{const q=document.querySelector(`[data-outline-id="${L}"]`);q==null||q.scrollIntoView({block:"nearest",behavior:"smooth"})})}function C(){l.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=c.value)==null?void 0:p.focus()})});const x=e.ref(null),k=e.ref("");let f=null;function R(p){n.readonly||(x.value=p.id,k.value=p.text,e.nextTick(()=>{f=document.querySelector(".zm-outline-input"),f==null||f.focus(),f==null||f.select()}))}function E(){x.value!=null&&(r("edit",{id:x.value,text:k.value.trim()||"(无标题)"}),Y())}function Y(){x.value=null,k.value="",f=null}function K(p){p.key==="Enter"?(p.preventDefault(),E()):p.key==="Escape"&&(p.preventDefault(),Y())}e.onBeforeUnmount(Y);const ee=e.ref(null),ae=e.ref(null),ie=e.ref(null);function X(p,L){if(n.readonly){p.preventDefault();return}ee.value={id:L.id,text:L.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",L.id))}function te(){ee.value=null,ae.value=null,ie.value=null}function J(p,L){if(!ee.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const V=U(p);ae.value=L.id,ie.value=V}function I(p){ae.value===p.id&&(ae.value=null,ie.value=null)}function A(p,L){p.preventDefault();const V=ee.value;if(!V)return;const q=U(p);V.id!==L.id&&r("move",{srcId:V.id,targetId:L.id,position:q}),te()}function U(p,L){const q=p.currentTarget.getBoundingClientRect(),se=p.clientY-q.top,ge=q.height;return se<ge*.3?"before":se>ge*.7?"after":"child"}const F=e.ref(null);let G=null;async function le(p){try{return await navigator.clipboard.writeText(p),!0}catch{const L=document.createElement("textarea");L.value=p,document.body.appendChild(L),L.select();let V=!1;try{V=document.execCommand("copy")}finally{document.body.removeChild(L)}return V}}async function Ne(p,L,V){p.stopPropagation(),await le(L)&&(F.value=V,G&&clearTimeout(G),G=setTimeout(()=>F.value=null,1200))}const _e=e.computed(()=>{const p=[],L=(V,q)=>{const se=" ".repeat(q),ge=q===0?"":"- ";p.push(se+ge+(V.text||""));for(const Ge of V.children)L(Ge,q+1)};return L(n.data,0),p.join(`
16
- `)}),Re=e.ref(!1);let xe=null;async function y(){await le(_e.value)&&(Re.value=!0,xe&&clearTimeout(xe),xe=setTimeout(()=>Re.value=!1,1200))}return(p,L)=>(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",Ss,[L[3]||(L[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":L[0]||(L[0]=V=>l.value=V),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:S,onKeydown:P},null,544),[[e.vModelText,l.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",Ts,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(g.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",Cs,"无结果")):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:C},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":Re.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",_s,[Re.value?(e.openBlock(),e.createElementBlock("path",vs)):(e.openBlock(),e.createElementBlock("rect",Ms)),L[4]||(L[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(Re.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.id,"data-outline-id":V.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":V.id===t.selectedId,"is-root":V.depth===0,"is-editing":x.value===V.id,"is-search-hit":u.value.has(V.id),"is-search-current":g.value[s.value]===V.id,"is-drag-over-before":ae.value===V.id&&ie.value==="before","is-drag-over-after":ae.value===V.id&&ie.value==="after","is-drag-over-child":ae.value===V.id&&ie.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+V.depth*16+"px"}),draggable:"true",onClick:q=>r("select",V.node),onDblclick:q=>R(V),onDragstart:q=>X(q,V),onDragend:te,onDragover:q=>J(q,V),onDragleave:()=>I(V),onDrop:q=>A(q,V)},[V.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:V.collapsed?"展开":"折叠",onClick:e.withModifiers(q=>r("toggleCollapse",V.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",zs,[V.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ls)):(e.openBlock(),e.createElementBlock("polyline",Os))]))],8,Is)):(e.openBlock(),e.createElementBlock("span",Ds)),e.createElementVNode("span",Vs,e.toDisplayString(V.siblingIndex+1)+".",1),x.value===V.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":L[1]||(L[1]=q=>k.value=q),class:"zm-outline-input",onBlur:E,onKeydown:K,onClick:L[2]||(L[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",$s,e.toDisplayString(V.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(q=>r("addSibling",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Fs)],8,Ps)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(q=>r("addChild",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Hs)],8,Us)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":F.value===V.id}]),title:F.value===V.id?"已复制":"复制节点文本",onClick:q=>Ne(q,V.text,V.id)},[(e.openBlock(),e.createElementBlock("svg",Gs,[F.value!==V.id?(e.openBlock(),e.createElementBlock("rect",js)):(e.openBlock(),e.createElementBlock("path",Ks)),L[5]||(L[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,Ws)],46,Bs))),128))])]))}}),Ys={key:0,class:"zm-jtv-root"},qs={key:0,class:"zm-jtv-key"},Xs={key:1,class:"zm-jtv-colon"},Zs={key:2,class:"zm-jtv-key zm-jtv-bracket"},Js={key:3,class:"zm-jtv-size"},Qs={key:4,class:"zm-jtv-bracket"},ec={key:5,class:"zm-jtv-brace"},tc={key:0,class:"zm-jtv-children"},nc={class:"zm-jtv-key"},oc={key:0,class:"zm-jtv-key"},rc=["src","alt"],ic=["href"],lc=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),r=e.computed(()=>n.value==="object"),l=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!l.value);const c=e.computed(()=>{if(l.value)return`Array(${o.value.length})`;if(r.value){const x=o.value,k=Object.keys(x);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>l.value?o.value.map((x,k)=>({key:String(k),value:x})):r.value?Object.entries(o.value).map(([x,k])=>({key:x,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(x,k,f){x!=="<root>"&&(f<2||k===null||typeof k!="object"||o.collapsedPaths.has(x)||o.collapsedPaths.add(x))}o.isRoot||g(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(x){return u.value===""?x:`${u.value}.${x}`}function S(x){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof x=="string"?x.toLowerCase().includes(k):x===null?"null".includes(k):String(x).toLowerCase().includes(k)}function $(x){return o.query?x.toLowerCase().includes(o.query.toLowerCase()):!0}function _(x,k){return!o.query||$(x)?!0:k===null||typeof k!="object"?S(k):!0}function P(x){return x===null?"null":typeof x=="string"?x.length>80?`"${x.slice(0,80)}..."`:`"${x}"`:typeof x=="boolean"?x?"true":"false":typeof x=="number"?String(x):typeof x>"u"?"undefined":JSON.stringify(x)}function z(x){if(typeof x!="string")return!1;const k=x.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 C(x){if(!o.query)return null;const k=x.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:x.slice(0,k),match:x.slice(k,k+o.query.length),after:x.slice(k+o.query.length)}}return(x,k)=>{var R,E,Y,K,ee,ae;const f=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ie=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ie.key,class:"zm-jtv-row"},[e.createVNode(f,{"key-name":ie.key,value:ie.value,path:w(ie.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,_(ie.key,ie.value)]])),128))])):r.value||l.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),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",qs,e.toDisplayString(t.keyName),1)),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Xs,":")),l.value?(e.openBlock(),e.createElementBlock("span",Zs,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Js,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&l.value?(e.openBlock(),e.createElementBlock("span",Qs,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",ec,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ie=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ie.key,class:"zm-jtv-row"},[e.createVNode(f,{"key-name":ie.key,value:ie.value,path:w(ie.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,_(ie.key,ie.value)]])),128))])),!d.value&&l.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&&r.value&&!l.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",nc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&C(t.keyName)?(e.openBlock(),e.createElementBlock("span",oc,[e.createElementVNode("span",null,e.toDisplayString((R=C(t.keyName))==null?void 0:R.before),1),e.createElementVNode("mark",null,e.toDisplayString((E=C(t.keyName))==null?void 0:E.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=C(t.keyName))==null?void 0:Y.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[C(P(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=C(P(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((ee=C(P(t.value)))==null?void 0:ee.match),1),e.createElementVNode("span",null,e.toDisplayString((ae=C(P(t.value)))==null?void 0:ae.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(P(t.value)),1)],64))],2),z(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,rc),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,ic)])):e.createCommentVNode("",!0)],4))}}}),ac={class:"zm-data-panel"},sc={class:"zm-data-header"},cc={class:"zm-data-title"},dc={class:"zm-data-title-meta"},uc={class:"zm-data-toolbar"},fc=["title"],mc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},pc={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"},gc={key:0,class:"zm-data-paste"},hc={class:"zm-data-tabs"},bc=["placeholder"],kc={key:0,class:"zm-data-error"},yc={class:"zm-data-paste-actions"},Ec=["disabled"],xc={class:"zm-data-tree"},Oo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),h=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function S(){try{await navigator.clipboard.writeText(l.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=l.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([l.value],{type:"application/json"}),f=URL.createObjectURL(k),R=document.createElement("a");R.href=f,R.download=`${n.data.text||"mindmap"}.json`,R.click(),URL.revokeObjectURL(f)}function _(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const f=zn(k);r("import",f),c.value="",u.value=!1}catch(f){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+f.message}return}try{const f=JSON.parse(k);if(!f.id||!Array.isArray(f.children)){s.value="JSON 缺少 id 或 children 字段";return}r("import",f),c.value="",u.value=!1}catch(f){s.value="JSON 解析失败:"+f.message}}}function P(k){return 1+k.children.reduce((f,R)=>f+P(R),0)}const z=e.computed(()=>P(n.data)),C=e.computed(()=>l.value.length);function x(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var E;const f=(E=k.files)==null?void 0:E[0];if(!f)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(c.value=R.result,_())},R.readAsText(f)},k.click()}return(k,f)=>(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("div",sc,[e.createElementVNode("div",cc,[f[8]||(f[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",dc,e.toDisplayString(z.value)+" 节点 · "+e.toDisplayString(C.value)+" chars",1)])]),e.createElementVNode("div",uc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:S},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",mc,[...f[9]||(f[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",pc,[...f[10]||(f[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),f[11]||(f[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,fc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...f[12]||(f[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:x},[...f[13]||(f[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:f[0]||(f[0]=R=>u.value=!u.value)},[...f[14]||(f[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),f[16]||(f[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[f[15]||(f[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":f[1]||(f[1]=R=>w.value=R),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:f[2]||(f[2]=R=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",hc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:f[3]||(f[3]=R=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:f[4]||(f[4]=R=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[5]||(f[5]=R=>c.value=R),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,bc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",kc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:_},"应用",8,Ec),e.createElementVNode("button",{class:"zm-data-btn",onClick:f[6]||(f[6]=R=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:f[7]||(f[7]=R=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",xc,[e.createVNode(lc,{value:t.data,query:w.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),f[17]||(f[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))]))}}),wc={class:"zm-md-panel"},Nc={key:0,class:"zm-md-error"},Sc={class:"zm-md-split"},Tc={class:"zm-md-edit"},Cc={class:"zm-md-preview"},Ac={class:"zm-md-preview-body"},_c={class:"zm-md-footer"},Mc=["disabled"],vc=`# flow-mindmap 思维导图
7
+ `);for(const i of t.children)n+=zn(i,o+1);return n}function Xa(t){var g,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 N=o[i],C=N.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[N];for(i++;i<o.length;){const S=o[i].match(c);if(S&&S[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const L=P.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((g=L.split(`
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:P.join(`
10
+ `),lang:m});continue}const $=N.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:N}),i++;continue}if(/^\s*\|/.test(N)){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(`
11
+ `)}),i=m;continue}}const R=N.match(u),F=N.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 L=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();L.length>0&&n.push({kind:"list",text:L.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(N.trim()===""){i++;continue}const B=[N];let _=i+1;for(;_<o.length;){const k=o[_];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;B.push(k),_++}const x=B.join(" ").trim();n.push({kind:"paragraph",text:x.slice(0,80)||"(空段落)",raw:B.join(`
12
+ `)}),i=_}return n}function Za(t,o="导入的导图"){const n=Xa(t||""),i={id:Xt(),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 N={id:Xt(),text:d.text,children:[]};a[a.length-1].children.push(N),a.push(N),c.push(h);return}const g={id:Xt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(g)}for(const d of n)u(d);return i}function Ja(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function Qa(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),g=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),N=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(Y){R=Y}function B(Y){Y.preventDefault();const oe=t.getContainer();if(!oe)return;const ie=-Y.deltaY*.001,ye=Math.min(n,Math.max(o,a.value*(1+ie))),y=oe.getBoundingClientRect(),V=Y.clientX-y.left,U=Y.clientY-y.top,j=(V-c.value)/a.value,ae=(U-s.value)/a.value;a.value=ye,c.value=V-j*ye,s.value=U-ae*ye}function _(){a.value=Math.min(n,a.value*i)}function x(){a.value=Math.max(o,a.value/i)}function k(Y){var ie;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Y.clientX,g.y=Y.clientY,g.ox=c.value,g.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ie=Y.preventDefault)==null||ie.call(Y))}function m(Y){if(!u.value)return;const oe=Y.clientX-g.x,ie=Y.clientY-g.y;(Math.abs(oe)>3||Math.abs(ie)>3)&&(d.value=!0),c.value=g.ox+oe,s.value=g.oy+ie}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function L(Y,oe,ie){h.value=!0,N.x=Y,N.y=oe,C.x=Y,C.y=oe,C.width=0,C.height=0,C.shiftKey=!!(ie!=null&&ie.shift),$.value++,window.addEventListener("mousemove",J),window.addEventListener("mouseup",K)}function S(Y,oe){if(!h.value)return;const ie=Math.min(N.x,Y),ye=Math.min(N.y,oe),y=Math.max(N.x,Y),V=Math.max(N.y,oe);C.x=ie,C.y=ye,C.width=y-ie,C.height=V-ye,$.value++}function K(){h.value=!1,window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",K),R&&R()}function J(Y){if(!h.value)return;const oe=t.getContainer();if(!oe)return;const ie=oe.getBoundingClientRect(),ye=(Y.clientX-ie.left-c.value)/a.value,y=(Y.clientY-ie.top-s.value)/a.value;S(ye,y)}function de(Y,oe,ie,ye=60){const y=t.getContainer();if(!y)return;const V=y.getBoundingClientRect(),U=(V.width-ye*2)/Y,j=(V.height-ye*2)/oe,ae=Math.min(1,Math.max(.3,Math.min(U,j)));a.value=ae,c.value=V.width/2,s.value=V.height/2-ie*ae}function ee(Y,oe,ie,ye,y=80){const V=t.getContainer();if(!V)return;const U=V.getBoundingClientRect();let j=a.value;(ie*j<40||ye*j<40)&&(j=Math.min(n,Math.max(1,60/Math.min(ie,ye)))),a.value=j,c.value=U.width/2-Y*j,s.value=U.height/2-oe*j}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:B,zoomIn:_,zoomOut:x,startPan:k,startMarquee:L,updateMarquee:S,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:de,centerOn:ee}}const es=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function kr(t){return es?t.metaKey:t.ctrlKey}function ts(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,g;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(kr(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(kr(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(i.key==="Delete"||i.key==="Backspace")&&c&&c!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(i.preventDefault(),t.onRemove(c)):i.key==="F2"&&c?(i.preventDefault(),t.onStartEdit(c)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):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 ns(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(g){const h=JSON.stringify(g);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 os={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},is={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=os[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 rs(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 ls={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:rs(t)}))},as={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=[is,ls,as,{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 ss(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function yr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function hi(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 cs={key:5,class:"zm-marker-picker"},ds={class:"zm-marker-group-label"},us={class:"zm-marker-grid"},fs=["title","onClick","innerHTML"],ms=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 x=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,S=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;x+P>m.right&&(x=Math.max(m.left+4,n.x-P-2)),k+S>m.bottom&&(k=Math.max(m.top+4,n.y-S-2)),x<m.left+2&&(x=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:x,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function N(){h.value=!h.value}function C(x){return n.nodeMarkers.includes(x)}function $(x){i("toggleMarker",x)}function R(x){const k=x.target;k&&k.closest(".zm-node-menu")||i("close")}function F(x){x.key==="Escape"&&i("close")}function B(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",B,!0),window.addEventListener("scroll",B,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",B,!0),window.removeEventListener("scroll",B,!0)});function _(x){x(),i("close")}return(x,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=>_(()=>i("pickImage")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>i("removeImage")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>i("setLink")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>i("removeLink")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>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=>_(()=>i("removeCode")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>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=>_(()=>i("removeTable")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>i("editNote")),["stop"]))},[e.createVNode(Ne,{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=>_(()=>i("removeNote")),["stop"]))},[e.createVNode(Ne,{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(N,["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",cs,[(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",ds,e.toDisplayString(m.label),1),e.createElementVNode("div",us,[(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(L=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(P.id)+"</svg>"},null,10,fs))),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=>_(()=>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(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>_(()=>i("removeTags")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ps=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 _=n.x+2,x=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;_+m>k.right&&(_=Math.max(k.left+4,n.x-m-2)),x+P>k.bottom&&(x=Math.max(k.top+4,n.y-P-2)),_<k.left+2&&(_=k.left+2),x<k.top+2&&(x=k.top+2)}return{left:_,top:x}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const _=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!_)return{left:"-9999px",top:"-9999px",display:"none"};const x=_.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,L=4+3*28;let S=x.right;S+P>k-4&&(S=Math.max(4,x.left-P));let K=x.top-4;return K+L>m-4&&(K=Math.max(4,m-L-4)),{left:S+"px",top:K+"px",display:"block"}});let g=null,h=null;function N(_){h&&(clearTimeout(h),h=null),g=setTimeout(()=>{c.value=_},60)}function C(){g&&(clearTimeout(g),g=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),h&&clearTimeout(h)});function $(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function R(_){_.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 B(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:x[11]||(x[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(k=>B(()=>i("openData")),["stop"]))},[e.createVNode(Ne,{name:"database",size:13,stroke:1.6}),x[12]||(x[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:x[5]||(x[5]=k=>N("import")),onMouseleave:C},[e.createVNode(Ne,{name:"import",size:13,stroke:1.6}),x[16]||(x[16]=e.createElementVNode("span",null,"导入",-1)),x[17]||(x[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:x[4]||(x[4]=k=>N("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(k=>B(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(Ne,{name:"markdown",size:13,stroke:1.6}),x[13]||(x[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(k=>B(()=>i("openImport","json")),["stop"]))},[e.createVNode(Ne,{name:"json",size:13,stroke:1.6}),x[14]||(x[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(k=>B(()=>i("openImport","txt")),["stop"]))},[e.createVNode(Ne,{name:"txt",size:13,stroke:1.6}),x[15]||(x[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[6]||(x[6]=e.withModifiers(k=>B(()=>i("openSettings")),["stop"]))},[e.createVNode(Ne,{name:"settings",size:13,stroke:1.6}),x[18]||(x[18]=e.createElementVNode("span",null,"设置",-1))]),x[23]||(x[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:x[10]||(x[10]=k=>N("export")),onMouseleave:C},[e.createVNode(Ne,{name:"export",size:13,stroke:1.6}),x[21]||(x[21]=e.createElementVNode("span",null,"导出",-1)),x[22]||(x[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:x[9]||(x[9]=k=>N("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[7]||(x[7]=e.withModifiers(k=>B(()=>i("exportPng")),["stop"]))},[e.createVNode(Ne,{name:"image",size:13,stroke:1.6}),x[19]||(x[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[8]||(x[8]=e.withModifiers(k=>B(()=>i("exportSvg")),["stop"]))},[e.createVNode(Ne,{name:"svg-export",size:13,stroke:1.6}),x[20]||(x[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),gs=["aria-hidden"],hs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Dt=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,gs)):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",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,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",ys,[e.renderSlot(c.$slots,"default")])],14,hs)):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",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[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",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3}))}}),Ss={class:"zm-outline-root"},Cs={class:"zm-outline-search"},Ts={key:0,class:"zm-outline-search-count"},As={key:1,class:"zm-outline-search-count zm-outline-search-empty"},_s={class:"zm-outline-actions"},Ms={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Rs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},vs={key:1,d:"M5 12 L10 17 L19 7"},Bs={class:"zm-outline"},Is=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],zs=["title","onClick"],Os={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ls={key:0,points:"6 9 12 15 18 9"},Ds={key:1,points:"9 6 15 12 9 18"},Vs={key:1,class:"zm-outline-dot"},$s={class:"zm-outline-index"},Ps={key:3,class:"zm-outline-text"},Fs=["onClick"],Us=["src"],Hs=["onClick"],Ws=["src"],Gs=["title","onClick"],js={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={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}},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 p=a.value.trim().toLowerCase();if(!p)return new Set;const O=new Set,D=X=>{var ue;(X.text.toLowerCase().includes(p)||(ue=X.note)!=null&&ue.text&&X.note.text.toLowerCase().includes(p))&&O.add(X.id);for(const Ee of X.children)D(Ee)};return D(n.data),O}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,O=D=>{let X=u.value.has(D.id);for(const ue of D.children)O(ue)&&(X=!0);return X&&p.add(D.id),X};return O(n.data),p}),g=e.computed(()=>{const p=[],O=D=>{u.value.has(D.id)&&p.push(D.id);for(const X of D.children)O(X)};return O(n.data),p}),h=e.computed(()=>a.value.trim().length>0),N=e.computed(()=>{const p=[],O=d.value,D=(X,ue,Ee)=>{if(h.value&&!O.has(X.id))return;const tt=X.children.length>0,Ke=h.value?!1:n.collapsedIds.has(X.id);p.push({id:X.id,text:X.text||"(无标题)",depth:ue,siblingIndex:Ee,hasChildren:tt,collapsed:Ke,node:X}),tt&&!Ke&&X.children.forEach((it,nt)=>D(it,ue+1,nt))};return D(n.data,0,0),p});function C(){s.value=g.value.length>0?0:-1}function $(){const p=g.value;p.length!==0&&(s.value=(s.value+1)%p.length,B(s.value))}function R(){const p=g.value;p.length!==0&&(s.value=(s.value-1+p.length)%p.length,B(s.value))}function F(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?R():$()):p.key==="Escape"&&(p.preventDefault(),a.value="",s.value=-1)}function B(p){const O=g.value[p];if(!O)return;const D=N.value.find(X=>X.id===O);D&&i("select",D.node),e.nextTick(()=>{const X=document.querySelector(`[data-outline-id="${O}"]`);X==null||X.scrollIntoView({block:"nearest",behavior:"smooth"})})}function _(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=c.value)==null?void 0:p.focus()})});const x=e.ref(null),k=e.ref("");let m=null;function P(p){n.readonly||(x.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function L(){x.value!=null&&(i("edit",{id:x.value,text:k.value.trim()||"(无标题)"}),S())}function S(){x.value=null,k.value="",m=null}function K(p){p.key==="Enter"?(p.preventDefault(),L()):p.key==="Escape"&&(p.preventDefault(),S())}e.onBeforeUnmount(S);const J=e.ref(null),de=e.ref(null),ee=e.ref(null);function Y(p,O){if(n.readonly){p.preventDefault();return}J.value={id:O.id,text:O.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",O.id))}function oe(){J.value=null,de.value=null,ee.value=null}function ie(p,O){if(!J.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const D=V(p);de.value=O.id,ee.value=D}function ye(p){de.value===p.id&&(de.value=null,ee.value=null)}function y(p,O){p.preventDefault();const D=J.value;if(!D)return;const X=V(p);D.id!==O.id&&i("move",{srcId:D.id,targetId:O.id,position:X}),oe()}function V(p,O){const X=p.currentTarget.getBoundingClientRect(),ue=p.clientY-X.top,Ee=X.height;return ue<Ee*.3?"before":ue>Ee*.7?"after":"child"}const U=e.ref(null);let j=null;async function ae(p){try{return await navigator.clipboard.writeText(p),!0}catch{const O=document.createElement("textarea");O.value=p,document.body.appendChild(O),O.select();let D=!1;try{D=document.execCommand("copy")}finally{document.body.removeChild(O)}return D}}async function Me(p,O,D){p.stopPropagation(),await ae(O)&&(U.value=D,j&&clearTimeout(j),j=setTimeout(()=>U.value=null,1200))}const ze=e.computed(()=>{const p=[],O=(D,X)=>{const ue=" ".repeat(X),Ee=X===0?"":"- ";p.push(ue+Ee+(D.text||""));for(const tt of D.children)O(tt,X+1)};return O(n.data,0),p.join(`
14
+ `)}),De=e.ref(!1);let Ae=null;async function E(){await ae(ze.value)&&(De.value=!0,Ae&&clearTimeout(Ae),Ae=setTimeout(()=>De.value=!1,1200))}return(p,O)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Cs,[O[3]||(O[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":O[0]||(O[0]=D=>a.value=D),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",Ts,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(g.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",As,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:_},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",_s,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":De.value}]),title:"复制完整大纲为纯文本",onClick:E},[(e.openBlock(),e.createElementBlock("svg",Ms,[De.value?(e.openBlock(),e.createElementBlock("path",vs)):(e.openBlock(),e.createElementBlock("rect",Rs)),O[4]||(O[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(De.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.id,"data-outline-id":D.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":D.id===t.selectedId,"is-root":D.depth===0,"is-editing":x.value===D.id,"is-search-hit":u.value.has(D.id),"is-search-current":g.value[s.value]===D.id,"is-drag-over-before":de.value===D.id&&ee.value==="before","is-drag-over-after":de.value===D.id&&ee.value==="after","is-drag-over-child":de.value===D.id&&ee.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+D.depth*16+"px"}),draggable:"true",onClick:X=>i("select",D.node),onDblclick:X=>P(D),onDragstart:X=>Y(X,D),onDragend:oe,onDragover:X=>ie(X,D),onDragleave:()=>ye(D),onDrop:X=>y(X,D)},[D.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:D.collapsed?"展开":"折叠",onClick:e.withModifiers(X=>i("toggleCollapse",D.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Os,[D.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ds)):(e.openBlock(),e.createElementBlock("polyline",Ls))]))],8,zs)):(e.openBlock(),e.createElementBlock("span",Vs)),e.createElementVNode("span",$s,e.toDisplayString(D.siblingIndex+1)+".",1),x.value===D.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":O[1]||(O[1]=X=>k.value=X),class:"zm-outline-input",onBlur:L,onKeydown:K,onClick:O[2]||(O[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ps,e.toDisplayString(D.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(X=>i("addSibling",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Us)],8,Fs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(X=>i("addChild",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ws)],8,Hs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":U.value===D.id}]),title:U.value===D.id?"已复制":"复制节点文本",onClick:X=>Me(X,D.text,D.id)},[(e.openBlock(),e.createElementBlock("svg",js,[U.value!==D.id?(e.openBlock(),e.createElementBlock("rect",Ks)):(e.openBlock(),e.createElementBlock("path",Ys)),O[5]||(O[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,Gs)],46,Is))),128))])]))}}),qs={key:0,class:"zm-jtv-root"},Xs={key:0,class:"zm-jtv-key"},Zs={key:1,class:"zm-jtv-colon"},Js={key:2,class:"zm-jtv-key zm-jtv-bracket"},Qs={key:3,class:"zm-jtv-size"},ec={key:4,class:"zm-jtv-bracket"},tc={key:5,class:"zm-jtv-brace"},nc={key:0,class:"zm-jtv-children"},oc={class:"zm-jtv-key"},ic={key:0,class:"zm-jtv-key"},rc=["src","alt"],lc=["href"],ac=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 x=o.value,k=Object.keys(x);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((x,k)=>({key:String(k),value:x})):i.value?Object.entries(o.value).map(([x,k])=>({key:x,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(x,k,m){x!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(x)||o.collapsedPaths.add(x))}o.isRoot||g(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function N(x){return u.value===""?x:`${u.value}.${x}`}function C(x){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof x=="string"?x.toLowerCase().includes(k):x===null?"null".includes(k):String(x).toLowerCase().includes(k)}function $(x){return o.query?x.toLowerCase().includes(o.query.toLowerCase()):!0}function R(x,k){return!o.query||$(x)?!0:k===null||typeof k!="object"?C(k):!0}function F(x){return x===null?"null":typeof x=="string"?x.length>80?`"${x.slice(0,80)}..."`:`"${x}"`:typeof x=="boolean"?x?"true":"false":typeof x=="number"?String(x):typeof x>"u"?"undefined":JSON.stringify(x)}function B(x){if(typeof x!="string")return!1;const k=x.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 _(x){if(!o.query)return null;const k=x.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:x.slice(0,k),match:x.slice(k,k+o.query.length),after:x.slice(k+o.query.length)}}return(x,k)=>{var P,L,S,K,J,de;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,ee=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ee.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ee.key,value:ee.value,path:N(ee.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(ee.key,ee.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",Xs,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Zs,":")),a.value?(e.openBlock(),e.createElementBlock("span",Js,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Qs,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ec,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",tc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ee=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ee.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ee.key,value:ee.value,path:N(ee.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(ee.key,ee.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",oc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&_(t.keyName)?(e.openBlock(),e.createElementBlock("span",ic,[e.createElementVNode("span",null,e.toDisplayString((P=_(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((L=_(t.keyName))==null?void 0:L.match),1),e.createElementVNode("span",null,e.toDisplayString((S=_(t.keyName))==null?void 0:S.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[_(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=_(F(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((J=_(F(t.value)))==null?void 0:J.match),1),e.createElementVNode("span",null,e.toDisplayString((de=_(F(t.value)))==null?void 0:de.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),B(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,rc),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,lc)])):e.createCommentVNode("",!0)],4))}}}),sc={class:"zm-data-panel"},cc={class:"zm-data-header"},dc={class:"zm-data-title"},uc={class:"zm-data-title-meta"},fc={class:"zm-data-toolbar"},mc=["title"],pc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},gc={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"},hc={key:0,class:"zm-data-paste"},bc={class:"zm-data-tabs"},kc=["placeholder"],yc={key:0,class:"zm-data-error"},Ec={class:"zm-data-paste-actions"},xc=["disabled"],wc={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"),g=e.ref("idle"),h=e.ref(new Set),N=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),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.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=In(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 B=e.computed(()=>F(n.data)),_=e.computed(()=>a.value.length);function x(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var L;const m=(L=k.files)==null?void 0:L[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",sc,[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",uc,e.toDisplayString(B.value)+" 节点 · "+e.toDisplayString(_.value)+" chars",1)])]),e.createElementVNode("div",fc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",pc,[...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",gc,[...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,mc),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:x},[...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":N.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=>N.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,N.value]]),N.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>N.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",bc,[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,kc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",yc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ec,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,xc),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",wc,[e.createVNode(ac,{value:t.data,query:N.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))]))}}),Nc={class:"zm-md-panel"},Sc={key:0,class:"zm-md-error"},Cc={class:"zm-md-split"},Tc={class:"zm-md-edit"},Ac={class:"zm-md-preview"},_c={class:"zm-md-preview-body"},Mc={class:"zm-md-footer"},Rc=["disabled"],vc=`# flow-mindmap 思维导图
17
15
 
18
16
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
19
17
 
@@ -52,89 +50,89 @@
52
50
 
53
51
  ## 开源协议
54
52
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
55
- `,Lo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(On(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const z=zn(l.value||"");return c.value=null,z}catch(z){return c.value=z.message,{id:"preview_fallback",text:l.value||"(空)",children:[]}}}),d=e.computed(()=>_t(u.value));let g=null;e.watch(l,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var z;return(z=s.value)==null?void 0:z.resetView()},250)});function h(){try{const z=zn(l.value||"");c.value=null,r("import",z)}catch(z){c.value=z.message}}function w(){l.value=On(n.data),c.value=null,e.nextTick(()=>{var z;return(z=s.value)==null?void 0:z.resetView()})}function S(){l.value="",c.value=null,e.nextTick(()=>{var z;return(z=s.value)==null?void 0:z.resetView()})}function $(){const z=document.createElement("input");z.type="file",z.accept=".md,text/markdown,text/plain",z.onchange=()=>{var k;const C=(k=z.files)==null?void 0:k[0];if(!C)return;const x=new FileReader;x.onload=()=>{typeof x.result=="string"&&(l.value=x.result,c.value=null,e.nextTick(()=>{var f;return(f=s.value)==null?void 0:f.resetView()}))},x.readAsText(C)},z.click()}function _(){const z=new Blob([l.value],{type:"text/markdown;charset=utf-8"}),C=URL.createObjectURL(z),x=document.createElement("a");x.href=C;const k=(n.data.text||"mindmap").trim()||"mindmap";x.download=`${k}.md`,x.click(),URL.revokeObjectURL(C)}function P(){l.value=vc,c.value=null,e.nextTick(()=>{var z;return(z=s.value)==null?void 0:z.resetView()})}return(z,C)=>(e.openBlock(),e.createElementBlock("div",wc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...C[1]||(C[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:_},[...C[2]||(C[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)])]),C[3]||(C[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:P},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:S},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Nc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createElementVNode("div",Tc,[C[4]||(C[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":C[0]||(C[0]=x=>l.value=x),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",Cc,[C[5]||(C[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Ac,[e.createVNode(Jo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",_c,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!l.value.trim(),onClick:h},"应用到导图",8,Mc)])]))}}),Rc={class:"zm-settings-panel"},Bc={class:"zm-settings-section"},Ic={class:"zm-settings-field"},zc={class:"zm-settings-control"},Oc={class:"zm-color-input-wrap"},Lc=["value"],Dc={class:"zm-color-input-text"},Vc={class:"zm-swatch-row zm-swatch-row--compact"},$c=["title","onClick"],Pc={class:"zm-settings-field"},Fc=["value"],Uc={class:"zm-slider"},Hc=["value"],Wc={class:"zm-settings-field"},Gc=["value"],jc={class:"zm-slider"},Kc=["value"],Yc={class:"zm-settings-field"},qc={class:"zm-line-style-group"},Xc=["title","onClick"],Zc=["viewBox"],Jc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Qc={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ed={class:"zm-line-style-label"},td={class:"zm-settings-field"},nd={key:0,class:"zm-palette-dropdown"},od={class:"zm-settings-field"},rd=["value"],id={label:"内置配色"},ld=["value"],ad={key:0,label:"自定义"},sd=["value"],cd={key:0,class:"zm-palette-preview-bar"},dd={key:1,class:"zm-palette-custom-editor"},ud=["value"],fd={class:"zm-palette-custom-actions"},md={class:"zm-settings-field"},pd={class:"zm-settings-field"},gd={class:"zm-settings-preview"},hd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},bd=["x1","y1","x2","y2","stroke","stroke-width"],kd={key:0,class:"zm-settings-section"},yd={class:"zm-settings-section-title"},Ed={key:0,class:"zm-settings-section-sub"},xd={class:"zm-settings-field"},wd={class:"zm-settings-value-tag"},Nd={class:"zm-swatch-row"},Sd=["title","onClick"],Td={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Cd=["value"],Ad={class:"zm-settings-field"},_d={class:"zm-settings-value-tag"},Md={class:"zm-swatch-row"},vd=["title","onClick"],Rd={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Bd=["value"],Id={class:"zm-settings-field"},zd=["value"],Od=["value"],Ld={class:"zm-settings-field"},Dd=["value"],Vd={class:"zm-slider"},$d=["value"],Pd={class:"zm-settings-section zm-settings-section--actions"},Do=((t,o)=>{const n=t.__vccOpts||t;for(const[r,l]of o)n[r]=l;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,r=o;function l(R,E){r("update:settings",{[R]:E})}const c=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],s=[{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 u(R){r("update:nodeStyle",R)}const d=e.computed(()=>[...en,...n.settings.customPalettes]),g=e.reactive({});function h(R){return g[R.id]===void 0&&(g[R.id]=R.colors.join(`
56
- `)),g[R.id]}function w(R){const E=g[R.id]??"",Y=Fa(E);if(Y.length===0){g[R.id]=R.colors.join(`
57
- `);return}const K=n.settings.customPalettes.map(ee=>ee.id===R.id?{...ee,colors:Y}:ee);r("update:settings",{customPalettes:K})}function S(){const R=d.value.find(ae=>ae.id===n.settings.branchPaletteId),E=R?[...R.colors]:[...en[0].colors],Y="custom-";let K=Y+(n.settings.customPalettes.length+1);for(;en.some(ae=>ae.id===K)||n.settings.customPalettes.some(ae=>ae.id===K);)K=Y+Math.random().toString(36).slice(2,7);const ee={id:K,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:E};r("update:settings",{customPalettes:[...n.settings.customPalettes,ee],branchPaletteId:K}),g[K]=E.join(`
58
- `)}function $(R){const E=n.settings.customPalettes.filter(K=>K.id!==R.id),Y=n.settings.branchPaletteId===R.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:E,...Y!==n.settings.branchPaletteId?{branchPaletteId:Y}:{}}),delete g[R.id]}const _=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],P=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],z=[0,1,2,3],C=["#f87171","#fb923c","#34d399","#818cf8"];function x(R,E,Y,K){if(E<=1)return Y;const ee=R/(E-1);return Y+(K-Y)*ee}function k(R,E,Y){return R<=0?E:R===1?Math.max(1.5,E*.67):R===2?Math.max(.8,E*.42):Y}const f=e.computed(()=>{const R=n.settings.lineWidthStart,E=n.settings.lineWidthEnd,Y=n.settings.taperedEdge,K=z.length,ee=8,ae=192,ie=d.value.find(te=>te.id===n.settings.branchPaletteId),X=ie&&ie.colors.length?ie.colors:C;return z.map((te,J)=>{const I=10+J*60/(K-1);return{x1:ee,y1:I,x2:ae,y2:I,w:Y?k(te,R,E):x(te,K,R,E),color:n.settings.rainbowBranch?X[J%X.length]:"#94a3b8"}})});return(R,E)=>{var Y,K,ee,ae,ie,X,te,J;return e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("section",Bc,[E[35]||(E[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Ic,[E[21]||(E[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",zc,[e.createElementVNode("label",Oc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:E[0]||(E[0]=I=>l("canvasBg",I.target.value))},null,40,Lc),e.createElementVNode("span",Dc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Vc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(P,I=>e.createElementVNode("button",{key:"cbg-"+I,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===I}]),style:e.normalizeStyle({background:I}),title:I,onClick:A=>l("canvasBg",I)},null,14,$c)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:E[1]||(E[1]=I=>l("canvasBg",void 0))},"∅")]),E[36]||(E[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Pc,[E[22]||(E[22]=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:E[2]||(E[2]=I=>l("lineWidthStart",parseFloat(I.target.value)||0))},null,40,Fc)]),e.createElementVNode("div",Uc,[E[23]||(E[23]=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:E[3]||(E[3]=I=>l("lineWidthStart",parseFloat(I.target.value)))},null,40,Hc)]),e.createElementVNode("div",Wc,[E[24]||(E[24]=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:E[4]||(E[4]=I=>l("lineWidthEnd",parseFloat(I.target.value)||0))},null,40,Gc)]),e.createElementVNode("div",jc,[E[25]||(E[25]=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:E[5]||(E[5]=I=>l("lineWidthEnd",parseFloat(I.target.value)))},null,40,Kc)]),E[37]||(E[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Yc,[E[26]||(E[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",qc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,I=>e.createElementVNode("button",{key:I.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===I.value}]),title:I.label,onClick:A=>l("lineStyle",I.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:I.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[I.value==="curve"?(e.openBlock(),e.createElementBlock("path",Jc)):(e.openBlock(),e.createElementBlock("line",Qc))],8,Zc)),e.createElementVNode("span",ed,e.toDisplayString(I.label),1)],10,Xc)),64))])]),e.createElementVNode("div",td,[E[28]||(E[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:E[6]||(E[6]=I=>l("rainbowBranch",!t.settings.rainbowBranch))},[...E[27]||(E[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",nd,[e.createElementVNode("div",od,[E[29]||(E[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:E[7]||(E[7]=I=>l("branchPaletteId",I.target.value))},[e.createElementVNode("optgroup",id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(en),I=>(e.openBlock(),e.createElementBlock("option",{key:I.id,value:I.id},e.toDisplayString(I.name),9,ld))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,I=>(e.openBlock(),e.createElementBlock("option",{key:I.id,value:I.id},e.toDisplayString(I.name),9,sd))),128))])):e.createCommentVNode("",!0)],40,rd)]),d.value.find(I=>I.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Y=d.value.find(I=>I.id===t.settings.branchPaletteId))==null?void 0:Y.colors,(I,A)=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:I})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(I=>I.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:h(t.settings.customPalettes.find(I=>I.id===t.settings.branchPaletteId)),onInput:E[8]||(E[8]=I=>g[t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId).id]=I.target.value)},null,40,ud),e.createElementVNode("div",fd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:E[9]||(E[9]=I=>w(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:E[10]||(E[10]=I=>$(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:S},"+ 新建配色")])):e.createCommentVNode("",!0),E[38]||(E[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",md,[E[31]||(E[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:E[11]||(E[11]=I=>l("taperedEdge",!t.settings.taperedEdge))},[...E[30]||(E[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",pd,[E[33]||(E[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:E[12]||(E[12]=I=>l("showOrderBadge",!t.settings.showOrderBadge))},[...E[32]||(E[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",gd,[(e.openBlock(),e.createElementBlock("svg",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(I,A)=>(e.openBlock(),e.createElementBlock("line",{key:A,x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,stroke:t.settings.rainbowBranch?I.color:"#94a3b8","stroke-width":I.w,"stroke-linecap":"butt"},null,8,bd))),128))])),E[34]||(E[34]=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",kd,[e.createElementVNode("h4",yd,[E[39]||(E[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Ed,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",xd,[E[40]||(E[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",wd,e.toDisplayString(((K=t.nodeStyle)==null?void 0:K.bg)||"默认"),1)]),e.createElementVNode("div",Nd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,I=>{var A;return e.createElementVNode("button",{key:"bg-"+I,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.bg)===I}]),style:e.normalizeStyle({background:I}),title:I,onClick:U=>u({bg:I})},null,14,Sd)}),64)),e.createElementVNode("label",Td,[e.createElementVNode("input",{type:"color",value:((ee=t.nodeStyle)==null?void 0:ee.bg)||"#ffffff",onInput:E[13]||(E[13]=I=>u({bg:I.target.value}))},null,40,Cd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:E[14]||(E[14]=I=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Ad,[E[41]||(E[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",_d,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.textColor)||"默认"),1)]),e.createElementVNode("div",Md,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,I=>{var A;return e.createElementVNode("button",{key:"fg-"+I,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.textColor)===I}]),style:e.normalizeStyle({background:I}),title:I,onClick:U=>u({textColor:I})},null,14,vd)}),64)),e.createElementVNode("label",Rd,[e.createElementVNode("input",{type:"color",value:((ie=t.nodeStyle)==null?void 0:ie.textColor)||"#1e2937",onInput:E[15]||(E[15]=I=>u({textColor:I.target.value}))},null,40,Bd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:E[16]||(E[16]=I=>u({textColor:void 0}))},"∅")]),E[45]||(E[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Id,[E[42]||(E[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((X=t.nodeStyle)==null?void 0:X.fontWeight)??400,onChange:E[17]||(E[17]=I=>u({fontWeight:parseInt(I.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,I=>e.createElementVNode("option",{key:I.value,value:I.value},e.toDisplayString(I.label),9,Od)),64))],40,zd)]),e.createElementVNode("div",Ld,[E[43]||(E[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((te=t.nodeStyle)==null?void 0:te.fontSize)??14,onChange:E[18]||(E[18]=I=>u({fontSize:parseInt(I.target.value)||14}))},null,40,Dd)]),e.createElementVNode("div",Vd,[E[44]||(E[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((J=t.nodeStyle)==null?void 0:J.fontSize)??14,onInput:E[19]||(E[19]=I=>u({fontSize:parseInt(I.target.value)}))},null,40,$d)]),E[46]||(E[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Pd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:E[20]||(E[20]=I=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),wi=20;function Fd(t,o){t.style.height="auto";const n=o.minRows*wi,r=o.maxRows>0?o.maxRows*wi:1/0,l=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=l+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function hr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const c=t.value;c&&Fd(c,n)}function l(){r()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",l),r())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>r()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",l)})}function Ud(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ni(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ni(n)}),t}class Si{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ti(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 r in t)n[r]=t[r];return o.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const Hd="</span>",Ci=t=>!!t.scope,Wd=(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((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${o}${t}`};class Gd{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Ti(o)}openNode(o){if(!Ci(o))return;const n=Wd(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ci(o)&&(this.buffer+=Hd)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ai=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class br{constructor(){this.rootNode=Ai(),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=Ai({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(r=>this._walk(o,r)),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=>{br._collapse(n)}))}}class jd extends br{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Gd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function io(t){return t?typeof t=="string"?t:t.source:null}function _i(t){return xn("(?=",t,")")}function Kd(t){return xn("(?:",t,")*")}function Yd(t){return xn("(?:",t,")?")}function xn(...t){return t.map(n=>io(n)).join("")}function qd(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function kr(...t){return"("+(qd(t).capture?"":"?:")+t.map(r=>io(r)).join("|")+")"}function Mi(t){return new RegExp(t.toString()+"|").exec("").length-1}function Xd(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Zd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function yr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const l=n;let c=io(r),s="";for(;c.length>0;){const u=Zd.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])+l):(s+=u[0],u[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(o)}const Jd=/\b\B/,vi="[a-zA-Z]\\w*",Er="[a-zA-Z_]\\w*",Ri="\\b\\d+(\\.\\d+)?",Bi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ii="\\b(0b[01]+)",Qd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",eu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=xn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},tu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},nu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},ou={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/},Vo=function(t,o,n={}){const r=dn({scope:"comment",begin:t,end:o,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=kr("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:xn(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ru=Vo("//","$"),iu=Vo("/\\*","\\*/"),lu=Vo("#","$"),au={scope:"number",begin:Ri,relevance:0},su={scope:"number",begin:Bi,relevance:0},cu={scope:"number",begin:Ii,relevance:0},du={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},uu={scope:"title",begin:vi,relevance:0},fu={scope:"title",begin:Er,relevance:0},mu={begin:"\\.\\s*"+Er,relevance:0};var $o=Object.freeze({__proto__:null,APOS_STRING_MODE:tu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:cu,BINARY_NUMBER_RE:Ii,COMMENT:Vo,C_BLOCK_COMMENT_MODE:iu,C_LINE_COMMENT_MODE:ru,C_NUMBER_MODE:su,C_NUMBER_RE:Bi,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:lu,IDENT_RE:vi,MATCH_NOTHING_RE:Jd,METHOD_GUARD:mu,NUMBER_MODE:au,NUMBER_RE:Ri,PHRASAL_WORDS_MODE:ou,QUOTE_STRING_MODE:nu,REGEXP_MODE:du,RE_STARTERS_RE:Qd,SHEBANG:eu,TITLE_MODE:uu,UNDERSCORE_IDENT_RE:Er,UNDERSCORE_TITLE_MODE:fu});function pu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function gu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function hu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=pu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function bu(t,o){Array.isArray(t.illegal)&&(t.illegal=kr(...t.illegal))}function ku(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 yu(t,o){t.relevance===void 0&&(t.relevance=1)}const Eu=(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(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=xn(n.beforeMatch,_i(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},xu=["of","and","for","in","not","or","if","then","parent","list","value"],wu="keyword";function zi(t,o,n=wu){const r=Object.create(null);return typeof t=="string"?l(n,t.split(" ")):Array.isArray(t)?l(n,t):Object.keys(t).forEach(function(c){Object.assign(r,zi(t[c],o,c))}),r;function l(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");r[d[0]]=[c,Nu(d[0],d[1])]})}}function Nu(t,o){return o?Number(o):Su(t)?0:1}function Su(t){return xu.includes(t.toLowerCase())}const Oi={},wn=t=>{console.error(t)},Li=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Oi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Oi[`${t}/${o}`]=!0)},Po=new Error;function Di(t,o,{key:n}){let r=0;const l=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+r]=l[u],c[u+r]=!0,r+=Mi(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function Tu(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw wn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Po;if(typeof t.beginScope!="object"||t.beginScope===null)throw wn("beginScope must be object"),Po;Di(t,t.begin,{key:"beginScope"}),t.begin=yr(t.begin,{joinWith:""})}}function Cu(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw wn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Po;if(typeof t.endScope!="object"||t.endScope===null)throw wn("endScope must be object"),Po;Di(t,t.end,{key:"endScope"}),t.end=yr(t.end,{joinWith:""})}}function Au(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function _u(t){Au(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Tu(t),Cu(t)}function Mu(t){function o(s,u){return new RegExp(io(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+=Mi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(yr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,S)=>S>0&&w!==void 0),h=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,h)}}class r{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(([g,h])=>d.addRule(g,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 g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,g=h.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(s){const u=new r;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;[gu,ku,_u,Eu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[hu,bu,yu].forEach(h=>h(s,u)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=zi(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!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=io(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 vu(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=l(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),c(t)}function Vi(t){return t?t.endsWithParent||Vi(t.starts):!1}function vu(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Vi(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var Ru="11.11.1";class Bu extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const xr=Ti,$i=dn,Pi=Symbol("nomatch"),Iu=7,Fi=function(t){const o=Object.create(null),n=Object.create(null),r=[];let l=!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:jd};function d(A){return u.noHighlightRe.test(A)}function g(A){let U=A.className+" ";U+=A.parentNode?A.parentNode.className:"";const F=u.languageDetectRe.exec(U);if(F){const G=K(F[1]);return G||(Li(c.replace("{}",F[1])),Li("Falling back to no-highlight mode for this block.",A)),G?F[1]:"no-highlight"}return U.split(/\s+/).find(G=>d(G)||K(G))}function h(A,U,F){let G="",le="";typeof U=="object"?(G=A,F=U.ignoreIllegals,le=U.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
59
- https://github.com/highlightjs/highlight.js/issues/2277`),le=A,G=U),F===void 0&&(F=!0);const Ne={code:G,language:le};J("before:highlight",Ne);const _e=Ne.result?Ne.result:w(Ne.language,Ne.code,F);return _e.code=Ne.code,J("after:highlight",_e),_e}function w(A,U,F,G){const le=Object.create(null);function Ne(H,Z){return H.keywords[Z]}function _e(){if(!Q.keywords){Te.addText(Se);return}let H=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(Se),ce="";for(;Z;){ce+=Se.substring(H,Z.index);const be=je.case_insensitive?Z[0].toLowerCase():Z[0],ze=Ne(Q,be);if(ze){const[Qe,ht]=ze;if(Te.addText(ce),ce="",le[be]=(le[be]||0)+1,le[be]<=Iu&&(Bt+=ht),Qe.startsWith("_"))ce+=Z[0];else{const Mn=je.classNameAliases[Qe]||Qe;y(Z[0],Mn)}}else ce+=Z[0];H=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(Se)}ce+=Se.substring(H),Te.addText(ce)}function Re(){if(Se==="")return;let H=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Te.addText(Se);return}H=w(Q.subLanguage,Se,!0,it[Q.subLanguage]),it[Q.subLanguage]=H._top}else H=$(Se,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(Bt+=H.relevance),Te.__addSublanguage(H._emitter,H.language)}function xe(){Q.subLanguage!=null?Re():_e(),Se=""}function y(H,Z){H!==""&&(Te.startScope(Z),Te.addText(H),Te.endScope())}function p(H,Z){let ce=1;const be=Z.length-1;for(;ce<=be;){if(!H._emit[ce]){ce++;continue}const ze=je.classNameAliases[H[ce]]||H[ce],Qe=Z[ce];ze?y(Qe,ze):(Se=Qe,_e(),Se=""),ce++}}function L(H,Z){return H.scope&&typeof H.scope=="string"&&Te.openNode(je.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(y(Se,je.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Se=""):H.beginScope._multi&&(p(H.beginScope,Z),Se="")),Q=Object.create(H,{parent:{value:Q}}),Q}function V(H,Z,ce){let be=Xd(H.endRe,ce);if(be){if(H["on:end"]){const ze=new Si(H);H["on:end"](Z,ze),ze.isMatchIgnored&&(be=!1)}if(be){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return V(H.parent,Z,ce)}function q(H){return Q.matcher.regexIndex===0?(Se+=H[0],1):(ut=!0,0)}function se(H){const Z=H[0],ce=H.rule,be=new Si(ce),ze=[ce.__beforeBegin,ce["on:begin"]];for(const Qe of ze)if(Qe&&(Qe(H,be),be.isMatchIgnored))return q(Z);return ce.skip?Se+=Z:(ce.excludeBegin&&(Se+=Z),xe(),!ce.returnBegin&&!ce.excludeBegin&&(Se=Z)),L(ce,H),ce.returnBegin?0:Z.length}function ge(H){const Z=H[0],ce=U.substring(H.index),be=V(Q,H,ce);if(!be)return Pi;const ze=Q;Q.endScope&&Q.endScope._wrap?(xe(),y(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(xe(),p(Q.endScope,H)):ze.skip?Se+=Z:(ze.returnEnd||ze.excludeEnd||(Se+=Z),xe(),ze.excludeEnd&&(Se=Z));do Q.scope&&Te.closeNode(),!Q.skip&&!Q.subLanguage&&(Bt+=Q.relevance),Q=Q.parent;while(Q!==be.parent);return be.starts&&L(be.starts,H),ze.returnEnd?0:Z.length}function Ge(){const H=[];for(let Z=Q;Z!==je;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>Te.openNode(Z))}let Pe={};function Ze(H,Z){const ce=Z&&Z[0];if(Se+=H,ce==null)return xe(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&ce===""){if(Se+=U.slice(Z.index,Z.index+1),!l){const be=new Error(`0 width match regex (${A})`);throw be.languageName=A,be.badRule=Pe.rule,be}return 1}if(Pe=Z,Z.type==="begin")return se(Z);if(Z.type==="illegal"&&!F){const be=new Error('Illegal lexeme "'+ce+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw be.mode=Q,be}else if(Z.type==="end"){const be=ge(Z);if(be!==Pi)return be}if(Z.type==="illegal"&&ce==="")return Se+=`
60
- `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ce,ce.length}const je=K(A);if(!je)throw wn(c.replace("{}",A)),new Error('Unknown language: "'+A+'"');const tn=Mu(je);let Rt="",Q=G||tn;const it={},Te=new u.__emitter(u);Ge();let Se="",Bt=0,Je=0,gt=0,ut=!1;try{if(je.__emitTokens)je.__emitTokens(U,Te);else{for(Q.matcher.considerAll();;){gt++,ut?ut=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=Je;const H=Q.matcher.exec(U);if(!H)break;const Z=U.substring(Je,H.index),ce=Ze(Z,H);Je=H.index+ce}Ze(U.substring(Je))}return Te.finalize(),Rt=Te.toHTML(),{language:A,value:Rt,relevance:Bt,illegal:!1,_emitter:Te,_top:Q}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:A,value:xr(U),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:Je,context:U.slice(Je-100,Je+100),mode:H.mode,resultSoFar:Rt},_emitter:Te};if(l)return{language:A,value:xr(U),illegal:!1,relevance:0,errorRaised:H,_emitter:Te,_top:Q};throw H}}function S(A){const U={value:xr(A),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return U._emitter.addText(A),U}function $(A,U){U=U||u.languages||Object.keys(o);const F=S(A),G=U.filter(K).filter(ae).map(xe=>w(xe,A,!1));G.unshift(F);const le=G.sort((xe,y)=>{if(xe.relevance!==y.relevance)return y.relevance-xe.relevance;if(xe.language&&y.language){if(K(xe.language).supersetOf===y.language)return 1;if(K(y.language).supersetOf===xe.language)return-1}return 0}),[Ne,_e]=le,Re=Ne;return Re.secondBest=_e,Re}function _(A,U,F){const G=U&&n[U]||F;A.classList.add("hljs"),A.classList.add(`language-${G}`)}function P(A){let U=null;const F=g(A);if(d(F))return;if(J("before:highlightElement",{el:A,language:F}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.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(A)),u.throwUnescapedHTML))throw new Bu("One of your code blocks includes unescaped HTML.",A.innerHTML);U=A;const G=U.textContent,le=F?h(G,{language:F,ignoreIllegals:!0}):$(G);A.innerHTML=le.value,A.dataset.highlighted="yes",_(A,F,le.language),A.result={language:le.language,re:le.relevance,relevance:le.relevance},le.secondBest&&(A.secondBest={language:le.secondBest.language,relevance:le.secondBest.relevance}),J("after:highlightElement",{el:A,result:le,text:G})}function z(A){u=$i(u,A)}const C=()=>{f(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){f(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function f(){function A(){f()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",A,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(P)}function R(A,U){let F=null;try{F=U(t)}catch(G){if(wn("Language definition for '{}' could not be registered.".replace("{}",A)),l)wn(G);else throw G;F=s}F.name||(F.name=A),o[A]=F,F.rawDefinition=U.bind(null,t),F.aliases&&ee(F.aliases,{languageName:A})}function E(A){delete o[A];for(const U of Object.keys(n))n[U]===A&&delete n[U]}function Y(){return Object.keys(o)}function K(A){return A=(A||"").toLowerCase(),o[A]||o[n[A]]}function ee(A,{languageName:U}){typeof A=="string"&&(A=[A]),A.forEach(F=>{n[F.toLowerCase()]=U})}function ae(A){const U=K(A);return U&&!U.disableAutodetect}function ie(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=U=>{A["before:highlightBlock"](Object.assign({block:U.el},U))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=U=>{A["after:highlightBlock"](Object.assign({block:U.el},U))})}function X(A){ie(A),r.push(A)}function te(A){const U=r.indexOf(A);U!==-1&&r.splice(U,1)}function J(A,U){const F=A;r.forEach(function(G){G[F]&&G[F](U)})}function I(A){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),P(A)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:f,highlightElement:P,highlightBlock:I,configure:z,initHighlighting:C,initHighlightingOnLoad:x,registerLanguage:R,unregisterLanguage:E,listLanguages:Y,getLanguage:K,registerAliases:ee,autoDetection:ae,inherit:$i,addPlugin:X,removePlugin:te}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString=Ru,t.regex={concat:xn,lookahead:_i,either:kr,optional:Yd,anyNumberOfTimes:Kd};for(const A in $o)typeof $o[A]=="object"&&Ni($o[A]);return Object.assign(t,$o),t},Dn=Fi({});Dn.newInstance=()=>Fi({});var zu=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const wr=Ud(zu);function Nr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={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,l]};l.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},h={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},S=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${S.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},P=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],z=["true","false"],C={match:/(\/[a-z._-]+)+/},x=["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"],f=["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"],R=["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:P,literal:z,built_in:[...x,...k,"set","shopt",...f,...R]},contains:[$,t.SHEBANG(),_,w,c,s,C,u,d,g,h,n]}}const Ou=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_-]*/}}),Lu=["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"],Du=["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"],Vu=[...Lu,...Du],$u=["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(),Pu=["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(),Fu=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Uu=["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 Hu(t){const o=t.regex,n=Ou(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="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,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Pu.join("|")+")"},{begin:":(:)?("+Fu.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Uu.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:l,attribute:$u.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Vu.join("|")+")\\b"}]}}function Ui(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 Vn="[0-9](_*[0-9])*",Fo=`\\.(${Vn})`,Uo="[0-9a-fA-F](_*[0-9a-fA-F])*",Hi={className:"number",variants:[{begin:`(\\b(${Vn})((${Fo})|\\.)?|(${Fo}))[eE][+-]?(${Vn})[fFdD]?\\b`},{begin:`\\b(${Vn})((${Fo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fo})[fFdD]?\\b`},{begin:`\\b(${Vn})[fFdD]\\b`},{begin:`\\b0[xX]((${Uo})\\.?|(${Uo})?\\.(${Uo}))[pP][+-]?(${Vn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Uo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Wi(t,o,n){return n===-1?"":t.replace(o,r=>Wi(t,o,n-1))}function Wu(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Wi("(?:<"+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"]},g={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:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Hi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Hi,g]}}const Gi="[A-Za-z$_][0-9A-Za-z$_]*",Gu=["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"],ju=["true","false","null","undefined","NaN","Infinity"],ji=["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"],Ki=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ku=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Yu=[].concat(Yi,ji,Ki);function qi(t){const o=t.regex,n=(F,{after:G})=>{const le="</"+F[0].slice(1);return F.input.indexOf(le,G)!==-1},r=Gi,l={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,G)=>{const le=F[0].length+F.index,Ne=F.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(F,{after:le})||G.ignoreMatch());let _e;const Re=F.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Gi,keyword:Gu,literal:ju,built_in:Yu,"variable.language":Ku},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},S={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"graphql"}},z={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,S]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,_,P,z,{match:/\$\d+/},w];S.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const f=[].concat(x,S.contains),R=f.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(f)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:R},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={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:{_:[...ji,...Ki]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(F){return o.concat("(?!",F.join("|"),")")}const te={match:o.concat(/\b/,X([...Yi,"super","import"].map(F=>`${F}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,_,P,z,x,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},U,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:A,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:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.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"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},te,ie,Y,I,{match:/\$[(.]/}]}}function qu(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Xi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},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}]},g={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}]},w=t.inherit(g,{contains:[]}),S=t.inherit(h,{contains:[]});g.contains.push(S),h.contains.push(w);let $=[n,d];return[g,h,w,S].forEach(C=>{C.contains=C.contains.concat($)}),$=$.concat(g,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,g,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},l,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Zi(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},w={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,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S="[0-9](_?[0-9])*",$=`(\\b(${S}))?\\.(${S})|\\b(${S})\\.`,_=`\\b|${r.join("|")}`,P={className:"number",relevance:0,variants:[{begin:`(\\b(${S})|(${$}))[eE][+-]?(${S})[jJ]?(?=${_})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${S})[jJ](?=${_})`}]},z={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,P,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,P,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,P,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,z,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{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:[P,C,w]}]}}function Ji(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),l=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,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"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],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:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:h}},{className:"punctuation",begin:"->"},c]}}function Xu(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={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"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],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"],w=["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"],S=["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,_=[...g,...d].filter(R=>!h.includes(R)),P={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},z={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function x(R){return o.concat(/\b/,o.either(...R.map(E=>E.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:x(S),relevance:0};function f(R,{exceptions:E,when:Y}={}){const K=Y;return E=E||[],R.map(ee=>ee.match(/\|\d+$/)||E.includes(ee)?ee:K(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:f(_,{when:R=>R.length<3}),literal:c,type:u,built_in:w},contains:[{scope:"type",match:x(s)},k,C,P,r,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,z]}}const Ho="[A-Za-z$_][0-9A-Za-z$_]*",Qi=["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"],el=["true","false","null","undefined","NaN","Infinity"],tl=["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"],nl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ol=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],il=[].concat(ol,tl,nl);function Zu(t){const o=t.regex,n=(F,{after:G})=>{const le="</"+F[0].slice(1);return F.input.indexOf(le,G)!==-1},r=Ho,l={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,G)=>{const le=F[0].length+F.index,Ne=F.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(F,{after:le})||G.ignoreMatch());let _e;const Re=F.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Ho,keyword:Qi,literal:el,built_in:il,"variable.language":rl},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},S={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,S],subLanguage:"graphql"}},z={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,S]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,_,P,z,{match:/\$\d+/},w];S.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const f=[].concat(x,S.contains),R=f.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(f)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:R},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={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:{_:[...tl,...nl]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(F){return o.concat("(?!",F.join("|"),")")}const te={match:o.concat(/\b/,X([...ol,"super","import"].map(F=>`${F}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,_,P,z,x,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},U,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:A,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:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.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"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},te,ie,Y,I,{match:/\$[(.]/}]}}function ll(t){const o=t.regex,n=Zu(t),r=Ho,l=["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:l},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"],g={$pattern:Ho,keyword:Qi.concat(d),literal:el,built_in:il.concat(l),"variable.language":rl},h={className:"meta",begin:"@"+r},w=(P,z,C)=>{const x=P.contains.findIndex(k=>k.label===z);if(x===-1)throw new Error("can not find mode to replace");P.contains.splice(x,1,C)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(h);const S=n.contains.find(P=>P.scope==="attr"),$=Object.assign({},S,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,S,$]),n.contains=n.contains.concat([h,c,s,$]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const _=n.contains.find(P=>P.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function al(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},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"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[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},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function sl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},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,l]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),S={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},P={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},z=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},S,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,P,c,s],C=[...z];return C.pop(),C.push(u),$.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:z}}const Sr={bash:Nr,sh:Nr,shell:Nr,css:Hu,go:Ui,golang:Ui,java:Wu,javascript:qi,js:qi,json:qu,markdown:Xi,md:Xi,python:Zi,py:Zi,rust:Ji,rs:Ji,sql:Xu,typescript:ll,ts:ll,xml:al,html:al,yaml:sl,yml:sl};for(const[t,o]of Object.entries(Sr))wr.registerLanguage(t,o);function Wo(t){const o=t.split(`
53
+ `,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(zn(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const B=In(a.value||"");return c.value=null,B}catch(B){return c.value=B.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Lt(u.value));let g=null;e.watch(a,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var B;return(B=s.value)==null?void 0:B.resetView()},250)});function h(){try{const B=In(a.value||"");c.value=null,i("import",B)}catch(B){c.value=B.message}}function N(){a.value=zn(n.data),c.value=null,e.nextTick(()=>{var B;return(B=s.value)==null?void 0:B.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var B;return(B=s.value)==null?void 0:B.resetView()})}function $(){const B=document.createElement("input");B.type="file",B.accept=".md,text/markdown,text/plain",B.onchange=()=>{var k;const _=(k=B.files)==null?void 0:k[0];if(!_)return;const x=new FileReader;x.onload=()=>{typeof x.result=="string"&&(a.value=x.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},x.readAsText(_)},B.click()}function R(){const B=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),_=URL.createObjectURL(B),x=document.createElement("a");x.href=_;const k=(n.data.text||"mindmap").trim()||"mindmap";x.download=`${k}.md`,x.click(),URL.revokeObjectURL(_)}function F(){a.value=vc,c.value=null,e.nextTick(()=>{var B;return(B=s.value)==null?void 0:B.resetView()})}return(B,_)=>(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[..._[1]||(_[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},[..._[2]||(_[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)])]),_[3]||(_[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:N},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Cc,[e.createElementVNode("div",Tc,[_[4]||(_[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":_[0]||(_[0]=x=>a.value=x),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",Ac,[_[5]||(_[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",_c,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Mc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Rc)])]))}}),Bc={class:"zm-settings-panel"},Ic={class:"zm-settings-section"},zc={class:"zm-settings-field"},Oc={class:"zm-settings-control"},Lc={class:"zm-color-input-wrap"},Dc=["value"],Vc={class:"zm-color-input-text"},$c={class:"zm-swatch-row zm-swatch-row--compact"},Pc=["title","onClick"],Fc={class:"zm-settings-field"},Uc=["value"],Hc={class:"zm-slider"},Wc=["value"],Gc={class:"zm-settings-field"},jc=["value"],Kc={class:"zm-slider"},Yc=["value"],qc={class:"zm-settings-field"},Xc={class:"zm-line-style-group"},Zc=["title","onClick"],Jc=["viewBox"],Qc={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ed={key:1,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"},td={key:2,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},nd={key:3,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},od={class:"zm-line-style-label"},id={class:"zm-settings-field"},rd={class:"zm-line-style-group"},ld=["title","onClick"],ad={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},sd={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"},cd={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"},dd={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"},ud={class:"zm-line-style-label"},fd={class:"zm-settings-field"},md={key:0,class:"zm-palette-dropdown"},pd={class:"zm-settings-field"},gd=["value"],hd={label:"内置配色"},bd=["value"],kd={key:0,label:"自定义"},yd=["value"],Ed={key:0,class:"zm-palette-preview-bar"},xd={key:1,class:"zm-palette-custom-editor"},wd=["value"],Nd={class:"zm-palette-custom-actions"},Sd={class:"zm-settings-field"},Cd={class:"zm-settings-field"},Td={class:"zm-settings-preview"},Ad={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},_d=["x1","y1","x2","y2","stroke","stroke-width"],Md={key:0,class:"zm-settings-section"},Rd={class:"zm-settings-section-title"},vd={key:0,class:"zm-settings-section-sub"},Bd={class:"zm-settings-field"},Id={class:"zm-settings-value-tag"},zd={class:"zm-swatch-row"},Od=["title","onClick"],Ld={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Dd=["value"],Vd={class:"zm-settings-field"},$d={class:"zm-settings-value-tag"},Pd={class:"zm-swatch-row"},Fd=["title","onClick"],Ud={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Hd=["value"],Wd={class:"zm-settings-field"},Gd=["value"],jd=["value"],Kd={class:"zm-settings-field"},Yd=["value"],qd={class:"zm-slider"},Xd=["value"],Zd={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(L,S){i("update:settings",{[L]:S})}const c=[{value:"arc",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=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],u=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function d(L){i("update:nodeStyle",L)}const g=e.computed(()=>[...on,...n.settings.customPalettes]),h=e.reactive({});function N(L){return h[L.id]===void 0&&(h[L.id]=L.colors.join(`
54
+ `)),h[L.id]}function C(L){const S=h[L.id]??"",K=Ua(S);if(K.length===0){h[L.id]=L.colors.join(`
55
+ `);return}const J=n.settings.customPalettes.map(de=>de.id===L.id?{...de,colors:K}:de);i("update:settings",{customPalettes:J})}function $(){const L=g.value.find(ee=>ee.id===n.settings.branchPaletteId),S=L?[...L.colors]:[...on[0].colors],K="custom-";let J=K+(n.settings.customPalettes.length+1);for(;on.some(ee=>ee.id===J)||n.settings.customPalettes.some(ee=>ee.id===J);)J=K+Math.random().toString(36).slice(2,7);const de={id:J,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:S};i("update:settings",{customPalettes:[...n.settings.customPalettes,de],branchPaletteId:J}),h[J]=S.join(`
56
+ `)}function R(L){const S=n.settings.customPalettes.filter(J=>J.id!==L.id),K=n.settings.branchPaletteId===L.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:S,...K!==n.settings.branchPaletteId?{branchPaletteId:K}:{}}),delete h[L.id]}const F=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],B=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function k(L,S,K,J){if(S<=1)return K;const de=L/(S-1);return K+(J-K)*de}function m(L,S,K){return L<=0?S:L===1?Math.max(1.5,S*.67):L===2?Math.max(.8,S*.42):K}const P=e.computed(()=>{const L=n.settings.lineWidthStart,S=n.settings.lineWidthEnd,K=n.settings.taperedEdge,J=_.length,de=8,ee=192,Y=g.value.find(ie=>ie.id===n.settings.branchPaletteId),oe=Y&&Y.colors.length?Y.colors:x;return _.map((ie,ye)=>{const y=10+ye*60/(J-1);return{x1:de,y1:y,x2:ee,y2:y,w:K?m(ie,L,S):k(ie,J,L,S),color:n.settings.rainbowBranch?oe[ye%oe.length]:"#94a3b8"}})});return(L,S)=>{var K,J,de,ee,Y,oe,ie,ye;return e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("section",Ic,[S[37]||(S[37]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",zc,[S[21]||(S[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Oc,[e.createElementVNode("label",Lc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:S[0]||(S[0]=y=>a("canvasBg",y.target.value))},null,40,Dc),e.createElementVNode("span",Vc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",$c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(B,y=>e.createElementVNode("button",{key:"cbg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:V=>a("canvasBg",y)},null,14,Pc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:S[1]||(S[1]=y=>a("canvasBg",void 0))},"∅")]),S[38]||(S[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Fc,[S[22]||(S[22]=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:S[2]||(S[2]=y=>a("lineWidthStart",parseFloat(y.target.value)||0))},null,40,Uc)]),e.createElementVNode("div",Hc,[S[23]||(S[23]=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:S[3]||(S[3]=y=>a("lineWidthStart",parseFloat(y.target.value)))},null,40,Wc)]),e.createElementVNode("div",Gc,[S[24]||(S[24]=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:S[4]||(S[4]=y=>a("lineWidthEnd",parseFloat(y.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[S[25]||(S[25]=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:S[5]||(S[5]=y=>a("lineWidthEnd",parseFloat(y.target.value)))},null,40,Yc)]),S[39]||(S[39]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",qc,[S[26]||(S[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Xc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,y=>e.createElementVNode("button",{key:y.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===y.value}]),title:y.label,onClick:V=>a("lineStyle",y.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:y.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[y.value==="arc"?(e.openBlock(),e.createElementBlock("path",Qc)):y.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ed)):y.value==="curve"?(e.openBlock(),e.createElementBlock("path",td)):(e.openBlock(),e.createElementBlock("line",nd))],8,Jc)),e.createElementVNode("span",od,e.toDisplayString(y.label),1)],10,Zc)),64))])]),e.createElementVNode("div",id,[S[28]||(S[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",rd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,y=>e.createElementVNode("button",{key:y.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===y.value}]),title:y.label,onClick:V=>a("lineOrigin",y.value)},[(e.openBlock(),e.createElementBlock("svg",ad,[S[27]||(S[27]=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)),y.value==="edge"?(e.openBlock(),e.createElementBlock("path",sd)):y.value==="center"?(e.openBlock(),e.createElementBlock("path",cd)):(e.openBlock(),e.createElementBlock("path",dd))])),e.createElementVNode("span",ud,e.toDisplayString(y.label),1)],10,ld)),64))])]),e.createElementVNode("div",fd,[S[30]||(S[30]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:S[6]||(S[6]=y=>a("rainbowBranch",!t.settings.rainbowBranch))},[...S[29]||(S[29]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("div",pd,[S[31]||(S[31]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:S[7]||(S[7]=y=>a("branchPaletteId",y.target.value))},[e.createElementVNode("optgroup",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(on),y=>(e.openBlock(),e.createElementBlock("option",{key:y.id,value:y.id},e.toDisplayString(y.name),9,bd))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,y=>(e.openBlock(),e.createElementBlock("option",{key:y.id,value:y.id},e.toDisplayString(y.name),9,yd))),128))])):e.createCommentVNode("",!0)],40,gd)]),g.value.find(y=>y.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((K=g.value.find(y=>y.id===t.settings.branchPaletteId))==null?void 0:K.colors,(y,V)=>(e.openBlock(),e.createElementBlock("span",{key:V,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:y})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(y=>y.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:N(t.settings.customPalettes.find(y=>y.id===t.settings.branchPaletteId)),onInput:S[8]||(S[8]=y=>h[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=y.target.value)},null,40,wd),e.createElementVNode("div",Nd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:S[9]||(S[9]=y=>C(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:S[10]||(S[10]=y=>R(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:$},"+ 新建配色")])):e.createCommentVNode("",!0),S[40]||(S[40]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Sd,[S[33]||(S[33]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:S[11]||(S[11]=y=>a("taperedEdge",!t.settings.taperedEdge))},[...S[32]||(S[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Cd,[S[35]||(S[35]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:S[12]||(S[12]=y=>a("showOrderBadge",!t.settings.showOrderBadge))},[...S[34]||(S[34]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Td,[(e.openBlock(),e.createElementBlock("svg",Ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(y,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,stroke:t.settings.rainbowBranch?y.color:"#94a3b8","stroke-width":y.w,"stroke-linecap":"butt"},null,8,_d))),128))])),S[36]||(S[36]=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",Md,[e.createElementVNode("h4",Rd,[S[41]||(S[41]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",vd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bd,[S[42]||(S[42]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Id,e.toDisplayString(((J=t.nodeStyle)==null?void 0:J.bg)||"默认"),1)]),e.createElementVNode("div",zd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,y=>{var V;return e.createElementVNode("button",{key:"bg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:U=>d({bg:y})},null,14,Od)}),64)),e.createElementVNode("label",Ld,[e.createElementVNode("input",{type:"color",value:((de=t.nodeStyle)==null?void 0:de.bg)||"#ffffff",onInput:S[13]||(S[13]=y=>d({bg:y.target.value}))},null,40,Dd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[14]||(S[14]=y=>d({bg:void 0}))},"∅")]),e.createElementVNode("div",Vd,[S[43]||(S[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",$d,e.toDisplayString(((ee=t.nodeStyle)==null?void 0:ee.textColor)||"默认"),1)]),e.createElementVNode("div",Pd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,y=>{var V;return e.createElementVNode("button",{key:"fg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:U=>d({textColor:y})},null,14,Fd)}),64)),e.createElementVNode("label",Ud,[e.createElementVNode("input",{type:"color",value:((Y=t.nodeStyle)==null?void 0:Y.textColor)||"#1e2937",onInput:S[15]||(S[15]=y=>d({textColor:y.target.value}))},null,40,Hd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[16]||(S[16]=y=>d({textColor:void 0}))},"∅")]),S[47]||(S[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Wd,[S[44]||(S[44]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((oe=t.nodeStyle)==null?void 0:oe.fontWeight)??400,onChange:S[17]||(S[17]=y=>d({fontWeight:parseInt(y.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,y=>e.createElementVNode("option",{key:y.value,value:y.value},e.toDisplayString(y.label),9,jd)),64))],40,Gd)]),e.createElementVNode("div",Kd,[S[45]||(S[45]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onChange:S[18]||(S[18]=y=>d({fontSize:parseInt(y.target.value)||14}))},null,40,Yd)]),e.createElementVNode("div",qd,[S[46]||(S[46]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ye=t.nodeStyle)==null?void 0:ye.fontSize)??14,onInput:S[19]||(S[19]=y=>d({fontSize:parseInt(y.target.value)}))},null,40,Xd)]),S[48]||(S[48]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Zd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:S[20]||(S[20]=y=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-ef1c774d"]]),Er=20;function Jd(t,o){t.style.height="auto";const n=o.minRows*Er,i=o.maxRows>0?o.maxRows*Er: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 bi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Jd(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 Qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xr(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)&&xr(n)}),t}class wr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Nr(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 eu="</span>",Sr=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 nu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Nr(o)}openNode(o){if(!Sr(o))return;const n=tu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Sr(o)&&(this.buffer+=eu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Cr=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ki{constructor(){this.rootNode=Cr(),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=Cr({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=>{ki._collapse(n)}))}}class ou extends ki{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 nu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Tr(t){return En("(?=",t,")")}function iu(t){return En("(?:",t,")*")}function ru(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function lu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function yi(...t){return"("+(lu(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Ar(t){return new RegExp(t.toString()+"|").exec("").length-1}function au(t,o){const n=t&&t.exec(o);return n&&n.index===0}const su=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ei(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=su.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 cu=/\b\B/,_r="[a-zA-Z]\\w*",xi="[a-zA-Z_]\\w*",Mr="\\b\\d+(\\.\\d+)?",Rr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",vr="\\b(0b[01]+)",du="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(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},fu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},mu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},pu={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=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=yi("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},gu=$o("//","$"),hu=$o("/\\*","\\*/"),bu=$o("#","$"),ku={scope:"number",begin:Mr,relevance:0},yu={scope:"number",begin:Rr,relevance:0},Eu={scope:"number",begin:vr,relevance:0},xu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},wu={scope:"title",begin:_r,relevance:0},Nu={scope:"title",begin:xi,relevance:0},Su={begin:"\\.\\s*"+xi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:fu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Eu,BINARY_NUMBER_RE:vr,COMMENT:$o,C_BLOCK_COMMENT_MODE:hu,C_LINE_COMMENT_MODE:gu,C_NUMBER_MODE:yu,C_NUMBER_RE:Rr,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:bu,IDENT_RE:_r,MATCH_NOTHING_RE:cu,METHOD_GUARD:Su,NUMBER_MODE:ku,NUMBER_RE:Mr,PHRASAL_WORDS_MODE:pu,QUOTE_STRING_MODE:mu,REGEXP_MODE:xu,RE_STARTERS_RE:du,SHEBANG:uu,TITLE_MODE:wu,UNDERSCORE_IDENT_RE:xi,UNDERSCORE_TITLE_MODE:Nu});function Cu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Tu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Au(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Cu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function _u(t,o){Array.isArray(t.illegal)&&(t.illegal=yi(...t.illegal))}function Mu(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 Ru(t,o){t.relevance===void 0&&(t.relevance=1)}const vu=(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,Tr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Bu=["of","and","for","in","not","or","if","then","parent","list","value"],Iu="keyword";function Br(t,o,n=Iu){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,Br(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,zu(d[0],d[1])]})}}function zu(t,o){return o?Number(o):Ou(t)?0:1}function Ou(t){return Bu.includes(t.toLowerCase())}const Ir={},xn=t=>{console.error(t)},zr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},On=(t,o)=>{Ir[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ir[`${t}/${o}`]=!0)},Fo=new Error;function Or(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+=Ar(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function Lu(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;Or(t,t.begin,{key:"beginScope"}),t.begin=Ei(t.begin,{joinWith:""})}}function Du(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;Or(t,t.end,{key:"endScope"}),t.end=Ei(t.end,{joinWith:""})}}function Vu(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function $u(t){Vu(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Lu(t),Du(t)}function Pu(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+=Ar(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ei(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((N,C)=>C>0&&N!==void 0),h=this.matchIndexes[g];return d.splice(0,g),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(([g,h])=>d.addRule(g,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 g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,g=h.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}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;[Tu,Mu,$u,vu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[Au,_u,Ru].forEach(h=>h(s,u)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=Br(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!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 Fu(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 Lr(t){return t?t.endsWithParent||Lr(t.starts):!1}function Fu(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Lr(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var Uu="11.11.1";class Hu extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const wi=Nr,Dr=dn,Vr=Symbol("nomatch"),Wu=7,$r=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:ou};function d(y){return u.noHighlightRe.test(y)}function g(y){let V=y.className+" ";V+=y.parentNode?y.parentNode.className:"";const U=u.languageDetectRe.exec(V);if(U){const j=K(U[1]);return j||(zr(c.replace("{}",U[1])),zr("Falling back to no-highlight mode for this block.",y)),j?U[1]:"no-highlight"}return V.split(/\s+/).find(j=>d(j)||K(j))}function h(y,V,U){let j="",ae="";typeof V=="object"?(j=y,U=V.ignoreIllegals,ae=V.language):(On("10.7.0","highlight(lang, code, ...args) has been deprecated."),On("10.7.0",`Please use highlight(code, options) instead.
57
+ https://github.com/highlightjs/highlight.js/issues/2277`),ae=y,j=V),U===void 0&&(U=!0);const Me={code:j,language:ae};ie("before:highlight",Me);const ze=Me.result?Me.result:N(Me.language,Me.code,U);return ze.code=Me.code,ie("after:highlight",ze),ze}function N(y,V,U,j){const ae=Object.create(null);function Me(H,Z){return H.keywords[Z]}function ze(){if(!Q.keywords){ve.addText(Re);return}let H=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(Re),fe="";for(;Z;){fe+=Re.substring(H,Z.index);const Se=nt.case_insensitive?Z[0].toLowerCase():Z[0],Ue=Me(Q,Se);if(Ue){const[lt,_t]=Ue;if(ve.addText(fe),fe="",ae[Se]=(ae[Se]||0)+1,ae[Se]<=Wu&&(Pt+=_t),lt.startsWith("_"))fe+=Z[0];else{const _n=nt.classNameAliases[lt]||lt;E(Z[0],_n)}}else fe+=Z[0];H=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(Re)}fe+=Re.substring(H),ve.addText(fe)}function De(){if(Re==="")return;let H=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){ve.addText(Re);return}H=N(Q.subLanguage,Re,!0,kt[Q.subLanguage]),kt[Q.subLanguage]=H._top}else H=$(Re,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(Pt+=H.relevance),ve.__addSublanguage(H._emitter,H.language)}function Ae(){Q.subLanguage!=null?De():ze(),Re=""}function E(H,Z){H!==""&&(ve.startScope(Z),ve.addText(H),ve.endScope())}function p(H,Z){let fe=1;const Se=Z.length-1;for(;fe<=Se;){if(!H._emit[fe]){fe++;continue}const Ue=nt.classNameAliases[H[fe]]||H[fe],lt=Z[fe];Ue?E(lt,Ue):(Re=lt,ze(),Re=""),fe++}}function O(H,Z){return H.scope&&typeof H.scope=="string"&&ve.openNode(nt.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(E(Re,nt.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Re=""):H.beginScope._multi&&(p(H.beginScope,Z),Re="")),Q=Object.create(H,{parent:{value:Q}}),Q}function D(H,Z,fe){let Se=au(H.endRe,fe);if(Se){if(H["on:end"]){const Ue=new wr(H);H["on:end"](Z,Ue),Ue.isMatchIgnored&&(Se=!1)}if(Se){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return D(H.parent,Z,fe)}function X(H){return Q.matcher.regexIndex===0?(Re+=H[0],1):(Ct=!0,0)}function ue(H){const Z=H[0],fe=H.rule,Se=new wr(fe),Ue=[fe.__beforeBegin,fe["on:begin"]];for(const lt of Ue)if(lt&&(lt(H,Se),Se.isMatchIgnored))return X(Z);return fe.skip?Re+=Z:(fe.excludeBegin&&(Re+=Z),Ae(),!fe.returnBegin&&!fe.excludeBegin&&(Re=Z)),O(fe,H),fe.returnBegin?0:Z.length}function Ee(H){const Z=H[0],fe=V.substring(H.index),Se=D(Q,H,fe);if(!Se)return Vr;const Ue=Q;Q.endScope&&Q.endScope._wrap?(Ae(),E(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(Ae(),p(Q.endScope,H)):Ue.skip?Re+=Z:(Ue.returnEnd||Ue.excludeEnd||(Re+=Z),Ae(),Ue.excludeEnd&&(Re=Z));do Q.scope&&ve.closeNode(),!Q.skip&&!Q.subLanguage&&(Pt+=Q.relevance),Q=Q.parent;while(Q!==Se.parent);return Se.starts&&O(Se.starts,H),Ue.returnEnd?0:Z.length}function tt(){const H=[];for(let Z=Q;Z!==nt;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>ve.openNode(Z))}let Ke={};function it(H,Z){const fe=Z&&Z[0];if(Re+=H,fe==null)return Ae(),0;if(Ke.type==="begin"&&Z.type==="end"&&Ke.index===Z.index&&fe===""){if(Re+=V.slice(Z.index,Z.index+1),!a){const Se=new Error(`0 width match regex (${y})`);throw Se.languageName=y,Se.badRule=Ke.rule,Se}return 1}if(Ke=Z,Z.type==="begin")return ue(Z);if(Z.type==="illegal"&&!U){const Se=new Error('Illegal lexeme "'+fe+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw Se.mode=Q,Se}else if(Z.type==="end"){const Se=Ee(Z);if(Se!==Vr)return Se}if(Z.type==="illegal"&&fe==="")return Re+=`
58
+ `,1;if(At>1e5&&At>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Re+=fe,fe.length}const nt=K(y);if(!nt)throw xn(c.replace("{}",y)),new Error('Unknown language: "'+y+'"');const rn=Pu(nt);let $t="",Q=j||rn;const kt={},ve=new u.__emitter(u);tt();let Re="",Pt=0,rt=0,At=0,Ct=!1;try{if(nt.__emitTokens)nt.__emitTokens(V,ve);else{for(Q.matcher.considerAll();;){At++,Ct?Ct=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=rt;const H=Q.matcher.exec(V);if(!H)break;const Z=V.substring(rt,H.index),fe=it(Z,H);rt=H.index+fe}it(V.substring(rt))}return ve.finalize(),$t=ve.toHTML(),{language:y,value:$t,relevance:Pt,illegal:!1,_emitter:ve,_top:Q}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:y,value:wi(V),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:rt,context:V.slice(rt-100,rt+100),mode:H.mode,resultSoFar:$t},_emitter:ve};if(a)return{language:y,value:wi(V),illegal:!1,relevance:0,errorRaised:H,_emitter:ve,_top:Q};throw H}}function C(y){const V={value:wi(y),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(y),V}function $(y,V){V=V||u.languages||Object.keys(o);const U=C(y),j=V.filter(K).filter(de).map(Ae=>N(Ae,y,!1));j.unshift(U);const ae=j.sort((Ae,E)=>{if(Ae.relevance!==E.relevance)return E.relevance-Ae.relevance;if(Ae.language&&E.language){if(K(Ae.language).supersetOf===E.language)return 1;if(K(E.language).supersetOf===Ae.language)return-1}return 0}),[Me,ze]=ae,De=Me;return De.secondBest=ze,De}function R(y,V,U){const j=V&&n[V]||U;y.classList.add("hljs"),y.classList.add(`language-${j}`)}function F(y){let V=null;const U=g(y);if(d(U))return;if(ie("before:highlightElement",{el:y,language:U}),y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",y);return}if(y.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(y)),u.throwUnescapedHTML))throw new Hu("One of your code blocks includes unescaped HTML.",y.innerHTML);V=y;const j=V.textContent,ae=U?h(j,{language:U,ignoreIllegals:!0}):$(j);y.innerHTML=ae.value,y.dataset.highlighted="yes",R(y,U,ae.language),y.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(y.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ie("after:highlightElement",{el:y,result:ae,text:j})}function B(y){u=Dr(u,y)}const _=()=>{m(),On("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){m(),On("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function y(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",y,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(y,V){let U=null;try{U=V(t)}catch(j){if(xn("Language definition for '{}' could not be registered.".replace("{}",y)),a)xn(j);else throw j;U=s}U.name||(U.name=y),o[y]=U,U.rawDefinition=V.bind(null,t),U.aliases&&J(U.aliases,{languageName:y})}function L(y){delete o[y];for(const V of Object.keys(n))n[V]===y&&delete n[V]}function S(){return Object.keys(o)}function K(y){return y=(y||"").toLowerCase(),o[y]||o[n[y]]}function J(y,{languageName:V}){typeof y=="string"&&(y=[y]),y.forEach(U=>{n[U.toLowerCase()]=V})}function de(y){const V=K(y);return V&&!V.disableAutodetect}function ee(y){y["before:highlightBlock"]&&!y["before:highlightElement"]&&(y["before:highlightElement"]=V=>{y["before:highlightBlock"](Object.assign({block:V.el},V))}),y["after:highlightBlock"]&&!y["after:highlightElement"]&&(y["after:highlightElement"]=V=>{y["after:highlightBlock"](Object.assign({block:V.el},V))})}function Y(y){ee(y),i.push(y)}function oe(y){const V=i.indexOf(y);V!==-1&&i.splice(V,1)}function ie(y,V){const U=y;i.forEach(function(j){j[U]&&j[U](V)})}function ye(y){return On("10.7.0","highlightBlock will be removed entirely in v12.0"),On("10.7.0","Please use highlightElement now."),F(y)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ye,configure:B,initHighlighting:_,initHighlightingOnLoad:x,registerLanguage:P,unregisterLanguage:L,listLanguages:S,getLanguage:K,registerAliases:J,autoDetection:de,inherit:Dr,addPlugin:Y,removePlugin:oe}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=Uu,t.regex={concat:En,lookahead:Tr,either:yi,optional:ru,anyNumberOfTimes:iu};for(const y in Po)typeof Po[y]=="object"&&xr(Po[y]);return Object.assign(t,Po),t},Ln=$r({});Ln.newInstance=()=>$r({});var Gu=Ln;Ln.HighlightJS=Ln,Ln.default=Ln;const Ni=Qd(Gu);function Si(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:/\\"/},g={className:"string",begin:/'/,end:/'/},h={match:/\\'/},N={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"],B=["true","false"],_={match:/(\/[a-z._-]+)+/},x=["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:B,built_in:[...x,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,N,c,s,_,u,d,g,h,n]}}const ju=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_-]*/}}),Ku=["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"],Yu=["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"],qu=[...Ku,...Yu],Xu=["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(),Zu=["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(),Ju=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Qu=["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 ef(t){const o=t.regex,n=ju(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:":("+Zu.join("|")+")"},{begin:":(:)?("+Ju.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qu.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:Xu.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+qu.join("|")+")\\b"}]}}function Pr(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 Dn="[0-9](_*[0-9])*",Uo=`\\.(${Dn})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Fr={className:"number",variants:[{begin:`(\\b(${Dn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Dn})[fFdD]?\\b`},{begin:`\\b(${Dn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Dn})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${Dn})[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 Ur(t,o,n){return n===-1?"":t.replace(o,i=>Ur(t,o,n-1))}function tf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Ur("(?:<"+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"]},g={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:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Fr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Fr,g]}}const Hr="[A-Za-z$_][0-9A-Za-z$_]*",nf=["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"],of=["true","false","null","undefined","NaN","Infinity"],Wr=["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"],Gr=["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"],rf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lf=[].concat(jr,Wr,Gr);function Kr(t){const o=t.regex,n=(U,{after:j})=>{const ae="</"+U[0].slice(1);return U.input.indexOf(ae,j)!==-1},i=Hr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,j)=>{const ae=U[0].length+U.index,Me=U.input[ae];if(Me==="<"||Me===","){j.ignoreMatch();return}Me===">"&&(n(U,{after:ae})||j.ignoreMatch());let ze;const De=U.input.substring(ae);if(ze=De.match(/^\s*=/)){j.ignoreMatch();return}if((ze=De.match(/^\s+extends\s+/))&&ze.index===0){j.ignoreMatch();return}}},u={$pattern:Hr,keyword:nf,literal:of,built_in:lf,"variable.language":rf},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},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"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={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,B,{match:/\$\d+/},N];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},S={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"}}]},K={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:{_:[...Wr,...Gr]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(U){return o.concat("(?!",U.join("|"),")")}const oe={match:o.concat(/\b/,Y([...jr,"super","import"].map(U=>`${U}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,x,{match:/\$\d+/},N,K,{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:[x,t.REGEXP_MODE,{className:"function",begin:y,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"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},oe,ee,S,ye,{match:/\$[(.]/}]}}function af(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 Yr(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}]},g={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}]},N=t.inherit(g,{contains:[]}),C=t.inherit(h,{contains:[]});g.contains.push(C),h.contains.push(N);let $=[n,d];return[g,h,N,C].forEach(_=>{_.contains=_.contains.concat($)}),$=$.concat(g,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,g,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:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},N={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,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,g]},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})`}]},B={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,N,t.HASH_COMMENT_MODE]}]};return g.contains=[N,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"},N,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{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,_,N]}]}}function Xr(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"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],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:g},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:g,type:h}},{className:"punctuation",begin:"->"},c]}}function sf(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"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],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"],N=["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=[...g,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function x(P){return o.concat(/\b/,o.either(...P.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:x(C),relevance:0};function m(P,{exceptions:L,when:S}={}){const K=S;return L=L||[],P.map(J=>J.match(/\|\d+$/)||L.includes(J)?J:K(J)?`${J}|0`:J)}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:N},contains:[{scope:"type",match:x(s)},k,_,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",Zr=["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"],Jr=["true","false","null","undefined","NaN","Infinity"],Qr=["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"],el=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ol=[].concat(tl,Qr,el);function cf(t){const o=t.regex,n=(U,{after:j})=>{const ae="</"+U[0].slice(1);return U.input.indexOf(ae,j)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,j)=>{const ae=U[0].length+U.index,Me=U.input[ae];if(Me==="<"||Me===","){j.ignoreMatch();return}Me===">"&&(n(U,{after:ae})||j.ignoreMatch());let ze;const De=U.input.substring(ae);if(ze=De.match(/^\s*=/)){j.ignoreMatch();return}if((ze=De.match(/^\s+extends\s+/))&&ze.index===0){j.ignoreMatch();return}}},u={$pattern:Wo,keyword:Zr,literal:Jr,built_in:ol,"variable.language":nl},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},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"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={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,B,{match:/\$\d+/},N];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},S={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"}}]},K={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:{_:[...Qr,...el]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(U){return o.concat("(?!",U.join("|"),")")}const oe={match:o.concat(/\b/,Y([...tl,"super","import"].map(U=>`${U}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,x,{match:/\$\d+/},N,K,{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:[x,t.REGEXP_MODE,{className:"function",begin:y,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"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},oe,ee,S,ye,{match:/\$[(.]/}]}}function il(t){const o=t.regex,n=cf(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"],g={$pattern:Wo,keyword:Zr.concat(d),literal:Jr,built_in:ol.concat(a),"variable.language":nl},h={className:"meta",begin:"@"+i},N=(F,B,_)=>{const x=F.contains.findIndex(k=>k.label===B);if(x===-1)throw new Error("can not find mode to replace");F.contains.splice(x,1,_)};Object.assign(n.keywords,g),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,$]),N(n,"shebang",t.SHEBANG()),N(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 rl(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"}),g={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:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ll(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},B=[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],_=[...B];return _.pop(),_.push(u),$.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const Ci={bash:Si,sh:Si,shell:Si,css:ef,go:Pr,golang:Pr,java:tf,javascript:Kr,js:Kr,json:af,markdown:Yr,md:Yr,python:qr,py:qr,rust:Xr,rs:Xr,sql:sf,typescript:il,ts:il,xml:rl,html:rl,yaml:ll,yml:ll};for(const[t,o]of Object.entries(Ci))Ni.registerLanguage(t,o);function Go(t){const o=t.split(`
61
59
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
62
- `).replace(/\n+$/,"")}function Nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Sr[n]?n:""}function Tr(t,o){const n=o&&Sr[o]?o:"";try{return n?wr.highlight(t,{language:n,ignoreIllegals:!0}).value:wr.highlightAuto(t).value}catch{return Ju(t)}}function Cr(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 Ju(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cl(t,o,n){if(t.length<=1)return t.slice();const[r,...l]=t,c=l.map(g=>g[o]??""),s=c.length>0&&c.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=l.slice().sort((g,h)=>{const w=g[o]??"",S=h[o]??"";return s?(Number(w)-Number(S))*u:w.localeCompare(S,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}function Ar(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sn=Ar();function dl(t){Sn=t}var Tn={exec:()=>null};function $n(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),l=o[r];return l||(l=t(r),o[r]=l),l}}function Ee(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(l,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ot.caret,"$1"),n=n.replace(l,s),r},getRegex:()=>new RegExp(n,o)};return r}var Qu=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={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:$n(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$n(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:$n(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$n(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$n(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:$n(t=>new RegExp(`^ {0,${t}}>`))},ef=/^(?:[ \t]*(?:\n|$))+/,tf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nf=/^ {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+|$)/,of=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_r=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ul=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fl=Ee(ul).replace(/bull/g,_r).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(),rf=Ee(ul).replace(/bull/g,_r).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(),Mr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,lf=/^[^\n]+/,vr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,af=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sf=Ee(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_r).getRegex(),Go="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",Rr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cf=Ee("^ {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",Rr).replace("tag",Go).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ml=Ee(Mr).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",Go).getRegex(),df=Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ml).getRegex(),Br={blockquote:df,code:tf,def:af,fences:nf,heading:of,hr:ao,html:cf,lheading:fl,list:sf,newline:ef,paragraph:ml,table:Tn,text:lf},pl=Ee("^ *([^\\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",Go).getRegex(),uf={...Br,lheading:rf,table:pl,paragraph:Ee(Mr).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pl).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",Go).getRegex()},ff={...Br,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rr).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:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ee(Mr).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
- ]`).replace("lheading",fl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gl=/^( {2,}|\\)\n(?!\s*$)/,gf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,jo=/[\s\p{P}\p{S}]/u,Ir=/[^\s\p{P}\p{S}]/u,hf=Ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jo).getRegex(),hl=/(?!~)[\p{P}\p{S}]/u,bf=/(?!~)[\s\p{P}\p{S}]/u,kf=/(?:[^\s\p{P}\p{S}]|~)/u,yf=Ee(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ef=Ee(bl,"u").replace(/punct/g,Pn).getRegex(),xf=Ee(bl,"u").replace(/punct/g,hl).getRegex(),kl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wf=Ee(kl,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Nf=Ee(kl,"gu").replace(/notPunctSpace/g,kf).replace(/punctSpace/g,bf).replace(/punct/g,hl).getRegex(),Sf=Ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Tf=Ee(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),Cf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Af=Ee(Cf,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),_f=Ee(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),Mf=Ee(/^<(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(),vf=Ee(Rr).replace("(?:-->|$)","-->").getRegex(),Rf=Ee("^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",vf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ko=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bf=Ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ko).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yl=Ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Ko).replace("ref",vr).getRegex(),El=Ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",vr).getRegex(),If=Ee("reflink|nolink(?!\\()","g").replace("reflink",yl).replace("nolink",El).getRegex(),xl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zr={_backpedal:Tn,anyPunctuation:_f,autolink:Mf,blockSkip:yf,br:gl,code:pf,del:Tn,delLDelim:Tn,delRDelim:Tn,emStrongLDelim:Ef,emStrongRDelimAst:wf,emStrongRDelimUnd:Sf,escape:mf,link:Bf,nolink:El,punctuation:hf,reflink:yl,reflinkSearch:If,tag:Rf,text:gf,url:Tn},zf={...zr,link:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Ko).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ko).getRegex()},Or={...zr,emStrongRDelimAst:Nf,emStrongLDelim:xf,delLDelim:Tf,delRDelim:Af,url:Ee(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xl).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:Ee(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xl).getRegex()},Of={...Or,br:Ee(gl).replace("{2,}","*").getRegex(),text:Ee(Or.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yo={normal:Br,gfm:uf,pedantic:ff},so={normal:zr,gfm:Or,breaks:Of,pedantic:zf},Lf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wl=t=>Lf[t];function jt(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,wl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,wl);return t}function Nl(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function Sl(t,o){var c;let n=t.replace(ot.findPipe,(s,u,d)=>{let g=!1,h=u;for(;--h>=0&&d[h]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),l=0;if(r[0].trim()||r.shift(),r.length>0&&!((c=r.at(-1))!=null&&c.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;l<r.length;l++)r[l]=r[l].trim().replace(ot.slashPipe,"|");return r}function un(t,o,n){let r=t.length;if(r===0)return"";let l=0;for(;l<r&&t.charAt(r-l-1)===o;)l++;return t.slice(0,r-l)}function Tl(t){let o=t.split(`
66
- `),n=o.length-1;for(;n>=0&&ot.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
- `)}function Df(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Vf(t,o=0){let n=o,r="";for(let l of t)if(l===" "){let c=4-n%4;r+=" ".repeat(c),n+=c}else r+=l,n++;return r}function Cl(t,o,n,r,l){let c=o.href,s=o.title||null,u=t[1].replace(l.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function $f(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let l=r[1];return o.split(`
68
- `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=l.length?c.slice(l.length):c}).join(`
69
- `)}var qo=class{constructor(t){ve(this,"options");ve(this,"rules");ve(this,"lexer");this.options=t||Sn}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]:Tl(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=$f(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:r}}}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 r=un(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:un(o[0],`
60
+ `).replace(/\n+$/,"")}function wn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
61
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ci[n]?n:""}function Ti(t,o){const n=o&&Ci[o]?o:"";try{return n?Ni.highlight(t,{language:n,ignoreIllegals:!0}).value:Ni.highlightAuto(t).value}catch{return df(t)}}function Ai(t){return t.split(`
62
+ `).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 df(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function al(t,o,n){if(t.length<=1)return t.slice();const[i,...a]=t,c=a.map(g=>g[o]??""),s=c.length>0&&c.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=a.slice().sort((g,h)=>{const N=g[o]??"",C=h[o]??"";return s?(Number(N)-Number(C))*u:N.localeCompare(C,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}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 sl(t){Nn=t}var Sn={exec:()=>null};function Vn(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 Te(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(ht.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var uf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ht={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:Vn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Vn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}>`))},ff=/^(?:[ \t]*(?:\n|$))+/,mf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pf=/^ {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+|$)/,gf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dl=Te(cl).replace(/bull/g,Mi).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(),hf=Te(cl).replace(/bull/g,Mi).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(),Ri=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bf=/^[^\n]+/,vi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,kf=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yf=Te(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Mi).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",Bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ef=Te("^ {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",Bi).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ul=Te(Ri).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(),xf=Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ul).getRegex(),Ii={blockquote:xf,code:mf,def:kf,fences:pf,heading:gf,hr:ao,html:Ef,lheading:dl,list:yf,newline:ff,paragraph:ul,table:Sn,text:bf},fl=Te("^ *([^\\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={...Ii,lheading:hf,table:fl,paragraph:Te(Ri).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fl).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()},Nf={...Ii,html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bi).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:Te(Ri).replace("hr",ao).replace("heading",` *#{1,6} *[^
63
+ ]`).replace("lheading",dl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Cf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ml=/^( {2,}|\\)\n(?!\s*$)/,Tf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,zi=/[^\s\p{P}\p{S}]/u,Af=Te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),pl=/(?!~)[\p{P}\p{S}]/u,_f=/(?!~)[\s\p{P}\p{S}]/u,Mf=/(?:[^\s\p{P}\p{S}]|~)/u,Rf=Te(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),gl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,vf=Te(gl,"u").replace(/punct/g,$n).getRegex(),Bf=Te(gl,"u").replace(/punct/g,pl).getRegex(),hl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",If=Te(hl,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,$n).getRegex(),zf=Te(hl,"gu").replace(/notPunctSpace/g,Mf).replace(/punctSpace/g,_f).replace(/punct/g,pl).getRegex(),Of=Te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,$n).getRegex(),Lf=Te(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$n).getRegex(),Df="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Vf=Te(Df,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,$n).getRegex(),$f=Te(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),Pf=Te(/^<(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(),Ff=Te(Bi).replace("(?:-->|$)","-->").getRegex(),Uf=Te("^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",Ff).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Hf=Te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bl=Te(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",vi).getRegex(),kl=Te(/^!?\[(ref)\](?:\[\])?/).replace("ref",vi).getRegex(),Wf=Te("reflink|nolink(?!\\()","g").replace("reflink",bl).replace("nolink",kl).getRegex(),yl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Oi={_backpedal:Sn,anyPunctuation:$f,autolink:Pf,blockSkip:Rf,br:ml,code:Cf,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:vf,emStrongRDelimAst:If,emStrongRDelimUnd:Of,escape:Sf,link:Hf,nolink:kl,punctuation:Af,reflink:bl,reflinkSearch:Wf,tag:Uf,text:Tf,url:Sn},Gf={...Oi,link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Li={...Oi,emStrongRDelimAst:zf,emStrongLDelim:Bf,delLDelim:Lf,delRDelim:Vf,url:Te(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",yl).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:Te(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",yl).getRegex()},jf={...Li,br:Te(ml).replace("{2,}","*").getRegex(),text:Te(Li.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:Ii,gfm:wf,pedantic:Nf},so={normal:Oi,gfm:Li,breaks:jf,pedantic:Gf},Kf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},El=t=>Kf[t];function Zt(t,o){if(o){if(ht.escapeTest.test(t))return t.replace(ht.escapeReplace,El)}else if(ht.escapeTestNoEncode.test(t))return t.replace(ht.escapeReplaceNoEncode,El);return t}function xl(t){try{t=encodeURI(t).replace(ht.percentDecode,"%")}catch{return null}return t}function wl(t,o){var c;let n=t.replace(ht.findPipe,(s,u,d)=>{let g=!1,h=u;for(;--h>=0&&d[h]==="\\";)g=!g;return g?"|":" |"}),i=n.split(ht.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(ht.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 Nl(t){let o=t.split(`
64
+ `),n=o.length-1;for(;n>=0&&ht.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
65
+ `)}function Yf(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 qf(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 Sl(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 Xf(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
66
+ `).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(`
67
+ `)}var Xo=class{constructor(t){Le(this,"options");Le(this,"rules");Le(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]:Nl(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=Xf(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
68
  `),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
69
  `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
72
70
  `).split(`
73
- `),r="",l="",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 g=u.join(`
71
+ `),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 g=u.join(`
74
72
  `),h=g.replace(this.rules.other.blockquoteSetextReplace,`
75
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
76
- ${g}`:g,l=l?`${l}
77
- ${h}`:h;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=w,n.length===0)break;let S=c.at(-1);if((S==null?void 0:S.type)==="code")break;if((S==null?void 0:S.type)==="blockquote"){let $=S,_=$.raw+`
73
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
74
+ ${g}`:g,a=a?`${a}
75
+ ${h}`:h;let N=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=N,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let $=C,R=$.raw+`
78
76
  `+n.join(`
79
- `),P=this.blockquote(_);c[c.length-1]=P,r=r.substring(0,r.length-$.raw.length)+P.raw,l=l.substring(0,l.length-$.text.length)+P.text;break}else if((S==null?void 0:S.type)==="list"){let $=S,_=$.raw+`
77
+ `),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
78
  `+n.join(`
81
- `),P=this.list(_);c[c.length-1]=P,r=r.substring(0,r.length-S.raw.length)+P.raw,l=l.substring(0,l.length-$.raw.length)+P.raw,n=_.substring(c.at(-1).raw.length).split(`
82
- `);continue}}return{type:"blockquote",raw:r,tokens:c,text:l}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,l={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,g="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Vf(o[2].split(`
83
- `,1)[0],o[1].length),S=t.split(`
84
- `,1)[0],$=!w.trim(),_=0;if(this.options.pedantic?(_=2,h=w.trimStart()):$?_=o[1].length+1:(_=w.search(this.rules.other.nonSpaceChar),_=_>4?1:_,h=w.slice(_),_+=o[1].length),$&&this.rules.other.blankLine.test(S)&&(g+=S+`
85
- `,t=t.substring(S.length+1),d=!0),!d){let P=this.rules.other.nextBulletRegex(_),z=this.rules.other.hrRegex(_),C=this.rules.other.fencesBeginRegex(_),x=this.rules.other.headingBeginRegex(_),k=this.rules.other.htmlBeginRegex(_),f=this.rules.other.blockquoteBeginRegex(_);for(;t;){let R=t.split(`
86
- `,1)[0],E;if(S=R,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),E=S):E=S.replace(this.rules.other.tabCharGlobal," "),C.test(S)||x.test(S)||k.test(S)||f.test(S)||P.test(S)||z.test(S))break;if(E.search(this.rules.other.nonSpaceChar)>=_||!S.trim())h+=`
87
- `+E.slice(_);else{if($||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(w)||x.test(w)||z.test(w))break;h+=`
88
- `+S}$=!S.trim(),g+=R+`
89
- `,t=t.substring(R.length+1),w=E.slice(_)}}l.loose||(s?l.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(s=!0)),l.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),l.raw+=g}let u=l.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let d of l.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let w={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=w.checked,l.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!l.loose){let h=d.tokens.filter(S=>S.type==="space"),w=h.length>0&&h.some(S=>this.rules.other.anyLine.test(S.raw));l.loose=w}}if(l.loose)for(let d of l.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return l}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Tl(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," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=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:r,title:l}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Sl(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
79
+ `),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(`
80
+ `);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,g="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let N=qf(o[2].split(`
81
+ `,1)[0],o[1].length),C=t.split(`
82
+ `,1)[0],$=!N.trim(),R=0;if(this.options.pedantic?(R=2,h=N.trimStart()):$?R=o[1].length+1:(R=N.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=N.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(g+=C+`
83
+ `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(R),B=this.rules.other.hrRegex(R),_=this.rules.other.fencesBeginRegex(R),x=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
84
+ `,1)[0],L;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),L=C):L=C.replace(this.rules.other.tabCharGlobal," "),_.test(C)||x.test(C)||k.test(C)||m.test(C)||F.test(C)||B.test(C))break;if(L.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
85
+ `+L.slice(R);else{if($||N.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(N)||x.test(N)||B.test(N))break;h+=`
86
+ `+C}$=!C.trim(),g+=P+`
87
+ `,t=t.substring(P.length+1),N=L.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(s=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=g}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 g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let N=this.lexer.inlineQueue.length-1;N>=0;N--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[N].src)){this.lexer.inlineQueue[N].src=this.lexer.inlineQueue[N].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let N={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=N.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=N.raw+d.tokens[0].raw,d.tokens[0].text=N.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(N)):d.tokens.unshift({type:"paragraph",raw:N.raw,text:N.raw,tokens:[N]}):d.tokens.unshift(N)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),N=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=N}}if(a.loose)for(let d of a.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Nl(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],`
88
+ `),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=wl(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
89
  `):[],c={type:"table",raw:un(o[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)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 l)c.rows.push(Sl(u,c.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[g]})));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],`
90
+ `),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(wl(u,c.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[g]})));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
91
  `),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=un(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=Df(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 r=o[2],l="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(r);c&&(r=c[1],l=c[3])}else l=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Cl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.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 r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=o[r.toLowerCase()];if(!l){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Cl(n,l,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,c,s,u=l,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+l);(r=g.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(s=[...c].length,r[3]||r[4]){u+=s;continue}else if((r[5]||r[6])&&l%3&&!((l+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...r[0]][0].length,w=t.slice(0,l+r.index+h+s);if(Math.min(l,s)%2){let $=w.slice(1,-1);return{type:"em",raw:w,text:$,tokens:this.lexer.inlineTokens($)}}let S=w.slice(2,-2);return{type:"strong",raw:w,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),l=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&l&&(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 r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,c,s,u=l,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+l);(r=d.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c||(s=[...c].length,s!==l))continue;if(r[3]||r[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let g=[...r[0]][0].length,h=t.slice(0,l+r.index+g+s),w=h.slice(l,-l);return{type:"del",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,l;if(o[2]==="@")r=o[0],l="mailto:"+r;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]);r=o[0],o[1]==="www."?l="http://"+o[0]:l=o[0]}return{type:"link",raw:o[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}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}}}},Dt=class ni{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||Sn,this.options.tokenizer=this.options.tokenizer||new qo,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:ot,block:Yo.normal,inline:so.normal};this.options.pedantic?(n.block=Yo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=Yo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:Yo,inline:so}}static lex(o,n){return new ni(n).lex(o)}static lexInline(o,n){return new ni(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
95
- `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let l=1/0;for(;o;){if(o.length<l)l=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+=`
92
+ `?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=Yf(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)),Sl(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 Sl(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,g=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+a);(i=g.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,N=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=N.slice(1,-1);return{type:"em",raw:N,text:$,tokens:this.lexer.inlineTokens($)}}let C=N.slice(2,-2);return{type:"strong",raw:N,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 g=[...i[0]][0].length,h=t.slice(0,a+i.index+g+s),N=h.slice(a,-a);return{type:"del",raw:h,text:N,tokens:this.lexer.inlineTokens(N)}}}}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}}}},Gt=class or{constructor(o){Le(this,"tokens");Le(this,"options");Le(this,"state");Le(this,"inlineQueue");Le(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:ht,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 or(n).lex(o)}static lexInline(o,n){return new or(n).inlineTokens(o)}lex(o){o=o.replace(ht.carriageReturn,`
93
+ `),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(ht.tabCharGlobal," ").replace(ht.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
94
  `: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
95
  `)?"":`
98
96
  `)+d.raw,h.text+=`
99
97
  `+d.text,this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(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(`
100
98
  `)?"":`
101
99
  `)+d.raw,h.text+=`
102
- `+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,w=o.slice(1),S;this.options.extensions.startBlock.forEach($=>{S=$.call({lexer:this},w),typeof S=="number"&&S>=0&&(h=Math.min(h,S))}),h<1/0&&h>=0&&(g=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let h=n.at(-1);r&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
100
+ `+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,N=o.slice(1),C;this.options.extensions.startBlock.forEach($=>{C=$.call({lexer:this},N),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(g=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
103
101
  `)?"":`
104
102
  `)+d.raw,h.text+=`
105
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),r=g.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(`
103
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=g.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
104
  `)?"":`
107
105
  `)+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 g,h,w,S,$;this.tokenizer.lexer=this;let r=o,l=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)_.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,l.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)c=l[2]?l[2].length:0,r=r.slice(0,l.index+c)+"["+"a".repeat(l[0].length-c-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((h=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:h.call({lexer:this},r))??r;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 _;if((S=(w=this.options.extensions)==null?void 0:w.inline)!=null&&S.some(z=>(_=z.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let z=n.at(-1);_.type==="text"&&(z==null?void 0:z.type)==="text"?(z.raw+=_.raw,z.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let P=o;if(($=this.options.extensions)!=null&&$.startInline){let z=1/0,C=o.slice(1),x;this.options.extensions.startInline.forEach(k=>{x=k.call({lexer:this},C),typeof x=="number"&&x>=0&&(z=Math.min(z,x))}),z<1/0&&z>=0&&(P=o.substring(0,z+1))}if(_=this.tokenizer.inlineText(P)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(u=_.raw.slice(-1)),s=!0;let z=n.at(-1);(z==null?void 0:z.type)==="text"?(z.raw+=_.raw,z.text+=_.text):n.push(_);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||Sn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let r=(c=(o||"").match(ot.notSpaceStart))==null?void 0:c[0],l=t.replace(ot.endingNewline,"")+`
109
- `;return r?'<pre><code class="language-'+jt(r)+'">'+(n?l:jt(l,!0))+`</code></pre>
110
- `:"<pre><code>"+(n?l:jt(l,!0))+`</code></pre>
106
+ `+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 g,h,N,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=(g=this.options.hooks)==null?void 0:g.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=(N=this.options.extensions)==null?void 0:N.inline)!=null&&C.some(B=>(R=B.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 B=n.at(-1);R.type==="text"&&(B==null?void 0:B.type)==="text"?(B.raw+=R.raw,B.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 B=1/0,_=o.slice(1),x;this.options.extensions.startInline.forEach(k=>{x=k.call({lexer:this},_),typeof x=="number"&&x>=0&&(B=Math.min(B,x))}),B<1/0&&B>=0&&(F=o.substring(0,B+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 B=n.at(-1);(B==null?void 0:B.type)==="text"?(B.raw+=R.raw,B.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){Le(this,"options");Le(this,"parser");this.options=t||Nn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(ht.notSpaceStart))==null?void 0:c[0],a=t.replace(ht.endingNewline,"")+`
107
+ `;return i?'<pre><code class="language-'+Zt(i)+'">'+(n?a:Zt(a,!0))+`</code></pre>
108
+ `:"<pre><code>"+(n?a:Zt(a,!0))+`</code></pre>
111
109
  `}blockquote({tokens:t}){return`<blockquote>
112
110
  ${this.parser.parse(t)}</blockquote>
113
111
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
114
112
  `}hr(t){return`<hr>
115
- `}list(t){let o=t.ordered,n=t.start,r="";for(let s=0;s<t.items.length;s++){let u=t.items[s];r+=this.listitem(u)}let l=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+l+c+`>
116
- `+r+"</"+l+`>
113
+ `}list(t){let o=t.ordered,n=t.start,i="";for(let s=0;s<t.items.length;s++){let u=t.items[s];i+=this.listitem(u)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
114
+ `+i+"</"+a+`>
117
115
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
118
116
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
119
- `}table(t){let o="",n="";for(let l=0;l<t.header.length;l++)n+=this.tablecell(t.header[l]);o+=this.tablerow({text:n});let r="";for(let l=0;l<t.rows.length;l++){let c=t.rows[l];n="";for(let s=0;s<c.length;s++)n+=this.tablecell(c[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
117
+ `}table(t){let o="",n="";for(let a=0;a<t.header.length;a++)n+=this.tablecell(t.header[a]);o+=this.tablerow({text:n});let i="";for(let a=0;a<t.rows.length;a++){let c=t.rows[a];n="";for(let s=0;s<c.length;s++)n+=this.tablecell(c[s]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
120
118
  <thead>
121
119
  `+o+`</thead>
122
- `+r+`</table>
120
+ `+i+`</table>
123
121
  `}tablerow({text:t}){return`<tr>
124
122
  ${t}</tr>
125
123
  `}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>${jt(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 r=this.parser.parseInline(n),l=Nl(t);if(l===null)return r;t=l;let c='<a href="'+t+'"';return o&&(c+=' title="'+jt(o)+'"'),c+=">"+r+"</a>",c}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let l=Nl(t);if(l===null)return jt(n);t=l;let c=`<img src="${t}" alt="${jt(n)}"`;return o&&(c+=` title="${jt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:jt(t.text)}},Lr=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}},Vt=class oi{constructor(o){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=o||Sn,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 Lr}static parse(o,n){return new oi(n).parse(o)}static parseInline(o,n){return new oi(n).parseInline(o)}parse(o){var r,l;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((l=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&l[s.type]){let d=s,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";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 l,c;this.renderer.parser=this;let r="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&c[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},uo=(Qo=class{constructor(t){ve(this,"options");ve(this,"block");this.options=t||Sn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Dt.lex:Dt.lexInline}provideParser(t=this.block){return t?Vt.parse:Vt.parseInline}},ve(Qo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ve(Qo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qo),Al=class{constructor(...t){ve(this,"defaults",Ar());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Vt);ve(this,"Renderer",co);ve(this,"TextRenderer",Lr);ve(this,"Lexer",Dt);ve(this,"Tokenizer",qo);ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var r,l;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;(l=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&l[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 r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let c=o.renderers[l.name];c?o.renderers[l.name]=function(...s){let u=l.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[l.level];c?c.unshift(l.tokenizer):o[l.level]=[l.tokenizer],l.start&&(l.level==="block"?o.startBlock?o.startBlock.push(l.start):o.startBlock=[l.start]:l.level==="inline"&&(o.startInline?o.startInline.push(l.start):o.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(o.childTokens[l.name]=l.childTokens)}),r.extensions=o),n.renderer){let l=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in l))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=l[s];l[s]=(...g)=>{let h=u.apply(l,g);return h===!1&&(h=d.apply(l,g)),h||""}}r.renderer=l}if(n.tokenizer){let l=this.defaults.tokenizer||new qo(this.defaults);for(let c in n.tokenizer){if(!(c in l))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=l[s];l[s]=(...g)=>{let h=u.apply(l,g);return h===!1&&(h=d.apply(l,g)),h}}r.tokenizer=l}if(n.hooks){let l=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in l))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=l[s];uo.passThroughHooks.has(c)?l[s]=g=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let w=await u.call(l,g);return d.call(l,w)})();let h=u.call(l,g);return d.call(l,h)}:l[s]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(l,g);return w===!1&&(w=await d.apply(l,g)),w})();let h=u.apply(l,g);return h===!1&&(h=d.apply(l,g)),h}}r.hooks=l}if(n.walkTokens){let l=this.defaults.walkTokens,c=n.walkTokens;r.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),l&&(u=u.concat(l.call(this,s))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Dt.lex(t,o??this.defaults)}parser(t,o){return Vt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},l={...this.defaults,...r},c=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&r.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(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let s=l.hooks?await l.hooks.preprocess(o):o,u=await(l.hooks?await l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(s,l),d=l.hooks?await l.hooks.processAllTokens(u):u;l.walkTokens&&await Promise.all(this.walkTokens(d,l.walkTokens));let g=await(l.hooks?await l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(d,l);return l.hooks?await l.hooks.postprocess(g):g})().catch(c);try{l.hooks&&(o=l.hooks.preprocess(o));let s=(l.hooks?l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(o,l);l.hooks&&(s=l.hooks.processAllTokens(s)),l.walkTokens&&this.walkTokens(s,l.walkTokens);let u=(l.hooks?l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(s,l);return l.hooks&&(u=l.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 r="<p>An error occurred:</p><pre>"+jt(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Cn=new Al;function Ae(t,o){return Cn.parse(t,o)}Ae.options=Ae.setOptions=function(t){return Cn.setOptions(t),Ae.defaults=Cn.defaults,dl(Ae.defaults),Ae},Ae.getDefaults=Ar,Ae.defaults=Sn,Ae.use=function(...t){return Cn.use(...t),Ae.defaults=Cn.defaults,dl(Ae.defaults),Ae},Ae.walkTokens=function(t,o){return Cn.walkTokens(t,o)},Ae.parseInline=Cn.parseInline,Ae.Parser=Vt,Ae.parser=Vt.parse,Ae.Renderer=co,Ae.TextRenderer=Lr,Ae.Lexer=Dt,Ae.lexer=Dt.lex,Ae.Tokenizer=qo,Ae.Hooks=uo,Ae.parse=Ae,Ae.options,Ae.setOptions,Ae.use,Ae.walkTokens,Ae.parseInline,Vt.parse,Dt.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,r=Array(o);n<o;n++)r[n]=t[n];return r}function Pf(t){if(Array.isArray(t))return t}function Ff(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,c,s,u=[],d=!0,g=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(r=c.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(h){g=!0,l=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(g)throw l}}return u}}function Uf(){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 Hf(t,o){return Pf(t)||Ff(t,o)||Wf(t,o)||Uf()}function Wf(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 Ml=Object.entries,vl=Object.setPrototypeOf,Gf=Object.isFrozen,jf=Object.getPrototypeOf,Kf=Object.getOwnPropertyDescriptor;let ct=Object.freeze,vt=Object.seal,Fn=Object.create,Rl=typeof Reflect<"u"&&Reflect,Dr=Rl.apply,Vr=Rl.construct;ct||(ct=function(o){return o}),vt||(vt=function(o){return o}),Dr||(Dr=function(o,n){for(var r=arguments.length,l=new Array(r>2?r-2:0),c=2;c<r;c++)l[c-2]=arguments[c];return o.apply(n,l)}),Vr||(Vr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return new o(...r)});const An=We(Array.prototype.forEach),Yf=We(Array.prototype.lastIndexOf),Bl=We(Array.prototype.pop),Un=We(Array.prototype.push),qf=We(Array.prototype.splice),dt=Array.isArray,fo=We(String.prototype.toLowerCase),$r=We(String.prototype.toString),Il=We(String.prototype.match),Hn=We(String.prototype.replace),zl=We(String.prototype.indexOf),Xf=We(String.prototype.trim),Zf=We(Number.prototype.toString),Jf=We(Boolean.prototype.toString),Ol=typeof BigInt>"u"?null:We(BigInt.prototype.toString),Ll=typeof Symbol>"u"?null:We(Symbol.prototype.toString),$e=We(Object.prototype.hasOwnProperty),mo=We(Object.prototype.toString),et=We(RegExp.prototype.test),Wn=Qf(TypeError);function We(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return Dr(t,o,r)}}function Qf(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return Vr(t,n)}}function ue(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(vl&&vl(t,null),!dt(o))return t;let r=o.length;for(;r--;){let l=o[r];if(typeof l=="string"){const c=n(l);c!==l&&(Gf(o)||(o[r]=c),l=c)}t[l]=!0}return t}function em(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=Fn(null);for(const r of Ml(t)){var n=Hf(r,2);const l=n[0],c=n[1];$e(t,l)&&(dt(c)?o[l]=em(c):c&&typeof c=="object"&&c.constructor===Object?o[l]=rt(c):o[l]=c)}return o}function tm(t){switch(typeof t){case"string":return t;case"number":return Zf(t);case"boolean":return Jf(t);case"bigint":return Ol?Ol(t):"0";case"symbol":return Ll?Ll(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Kt(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:mo(r)}return mo(t)}default:return mo(t)}}function Kt(t,o){for(;t!==null;){const r=Kf(t,o);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}t=jf(t)}function n(){return null}return n}function nm(t){try{return et(t,""),!0}catch{return!1}}const Dl=ct(["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"]),Pr=ct(["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"]),Fr=ct(["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"]),om=ct(["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"]),Ur=ct(["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"]),rm=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vl=ct(["#text"]),$l=ct(["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"]),Hr=ct(["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"]),Pl=ct(["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"]),Xo=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),im=vt(/{{[\w\W]*|^[\w\W]*}}/g),lm=vt(/<%[\w\W]*|^[\w\W]*%>/g),am=vt(/\${[\w\W]*/g),sm=vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),cm=vt(/^aria-[\-\w]+$/),Fl=vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dm=vt(/^(?:\w+script|data):/i),um=vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fm=vt(/^html$/i),mm=vt(/^[a-z][.\w]*(-[.\w]+)+$/i),Yt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},pm=function(){return typeof window>"u"?null:window},gm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(r=n.getAttribute(l));const c="dompurify"+(r?"#"+r:"");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}},Ul=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pm();const o=B=>Hl(B);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Yt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,l=r.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,w=t.trustedTypes,S=u.prototype,$=Kt(S,"cloneNode"),_=Kt(S,"remove"),P=Kt(S,"nextSibling"),z=Kt(S,"childNodes"),C=Kt(S,"parentNode"),x=Kt(S,"shadowRoot"),k=Kt(S,"attributes"),f=s&&s.prototype?Kt(s.prototype,"nodeType"):null,R=s&&s.prototype?Kt(s.prototype,"nodeName"):null;if(typeof c=="function"){const B=n.createElement("template");B.content&&B.content.ownerDocument&&(n=B.content.ownerDocument)}let E,Y="",K=0;const ee=function(b){if(K>0)throw Wn('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.');K++;try{return E.createHTML(b)}finally{K--}},ae=n,ie=ae.implementation,X=ae.createNodeIterator,te=ae.createDocumentFragment,J=ae.getElementsByTagName,I=r.importNode;let A=Ul();o.isSupported=typeof Ml=="function"&&typeof C=="function"&&ie&&ie.createHTMLDocument!==void 0;const U=im,F=lm,G=am,le=sm,Ne=cm,_e=dm,Re=um,xe=mm;let y=Fl,p=null;const L=ue({},[...Dl,...Pr,...Fr,...Ur,...Vl]);let V=null;const q=ue({},[...$l,...Hr,...Pl,...Xo]);let se=Object.seal(Fn(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}})),ge=null,Ge=null;const Pe=Object.seal(Fn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,je=!0,tn=!1,Rt=!0,Q=!1,it=!0,Te=!1,Se=!1,Bt=!1,Je=!1,gt=!1,ut=!1,H=!0,Z=!1;const ce="user-content-";let be=!0,ze=!1,Qe={},ht=null;const Mn=ue({},["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 er=null;const tr=ue({},["audio","video","img","source","image","track"]);let po=null;const nr=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let mn=It,go=!1,ho=null;const Wr=ue({},[jn,Kn,It],$r);let bo=ue({},["mi","mo","mn","ms","mtext"]),ko=ue({},["annotation-xml"]);const Gr=ue({},["title","style","font","a","script"]);let vn=null;const or=["application/xhtml+xml","text/html"],jr="text/html";let Oe=null,pn=null;const rr=n.createElement("form"),ir=function(b){return b instanceof RegExp||b instanceof Function},Yn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===b)return;(!b||typeof b!="object")&&(b={}),b=rt(b),vn=or.indexOf(b.PARSER_MEDIA_TYPE)===-1?jr:b.PARSER_MEDIA_TYPE,Oe=vn==="application/xhtml+xml"?$r:fo,p=$e(b,"ALLOWED_TAGS")&&dt(b.ALLOWED_TAGS)?ue({},b.ALLOWED_TAGS,Oe):L,V=$e(b,"ALLOWED_ATTR")&&dt(b.ALLOWED_ATTR)?ue({},b.ALLOWED_ATTR,Oe):q,ho=$e(b,"ALLOWED_NAMESPACES")&&dt(b.ALLOWED_NAMESPACES)?ue({},b.ALLOWED_NAMESPACES,$r):Wr,po=$e(b,"ADD_URI_SAFE_ATTR")&&dt(b.ADD_URI_SAFE_ATTR)?ue(rt(nr),b.ADD_URI_SAFE_ATTR,Oe):nr,er=$e(b,"ADD_DATA_URI_TAGS")&&dt(b.ADD_DATA_URI_TAGS)?ue(rt(tr),b.ADD_DATA_URI_TAGS,Oe):tr,ht=$e(b,"FORBID_CONTENTS")&&dt(b.FORBID_CONTENTS)?ue({},b.FORBID_CONTENTS,Oe):Mn,ge=$e(b,"FORBID_TAGS")&&dt(b.FORBID_TAGS)?ue({},b.FORBID_TAGS,Oe):rt({}),Ge=$e(b,"FORBID_ATTR")&&dt(b.FORBID_ATTR)?ue({},b.FORBID_ATTR,Oe):rt({}),Qe=$e(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?rt(b.USE_PROFILES):b.USE_PROFILES:!1,Ze=b.ALLOW_ARIA_ATTR!==!1,je=b.ALLOW_DATA_ATTR!==!1,tn=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=b.SAFE_FOR_TEMPLATES||!1,it=b.SAFE_FOR_XML!==!1,Te=b.WHOLE_DOCUMENT||!1,Je=b.RETURN_DOM||!1,gt=b.RETURN_DOM_FRAGMENT||!1,ut=b.RETURN_TRUSTED_TYPE||!1,Bt=b.FORCE_BODY||!1,H=b.SANITIZE_DOM!==!1,Z=b.SANITIZE_NAMED_PROPS||!1,be=b.KEEP_CONTENT!==!1,ze=b.IN_PLACE||!1,y=nm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Fl,mn=typeof b.NAMESPACE=="string"?b.NAMESPACE:It,bo=$e(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(b.MATHML_TEXT_INTEGRATION_POINTS):ue({},["mi","mo","mn","ms","mtext"]),ko=$e(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?rt(b.HTML_INTEGRATION_POINTS):ue({},["annotation-xml"]);const O=$e(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?rt(b.CUSTOM_ELEMENT_HANDLING):Fn(null);if(se=Fn(null),$e(O,"tagNameCheck")&&ir(O.tagNameCheck)&&(se.tagNameCheck=O.tagNameCheck),$e(O,"attributeNameCheck")&&ir(O.attributeNameCheck)&&(se.attributeNameCheck=O.attributeNameCheck),$e(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),Q&&(je=!1),gt&&(Je=!0),Qe&&(p=ue({},Vl),V=Fn(null),Qe.html===!0&&(ue(p,Dl),ue(V,$l)),Qe.svg===!0&&(ue(p,Pr),ue(V,Hr),ue(V,Xo)),Qe.svgFilters===!0&&(ue(p,Fr),ue(V,Hr),ue(V,Xo)),Qe.mathMl===!0&&(ue(p,Ur),ue(V,Pl),ue(V,Xo))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?Pe.tagCheck=b.ADD_TAGS:dt(b.ADD_TAGS)&&(p===L&&(p=rt(p)),ue(p,b.ADD_TAGS,Oe))),$e(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?Pe.attributeCheck=b.ADD_ATTR:dt(b.ADD_ATTR)&&(V===q&&(V=rt(V)),ue(V,b.ADD_ATTR,Oe))),$e(b,"ADD_URI_SAFE_ATTR")&&dt(b.ADD_URI_SAFE_ATTR)&&ue(po,b.ADD_URI_SAFE_ATTR,Oe),$e(b,"FORBID_CONTENTS")&&dt(b.FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,b.FORBID_CONTENTS,Oe)),$e(b,"ADD_FORBID_CONTENTS")&&dt(b.ADD_FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,b.ADD_FORBID_CONTENTS,Oe)),be&&(p["#text"]=!0),Te&&ue(p,["html","head","body"]),p.table&&(ue(p,["tbody"]),delete ge.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const W=E;E=b.TRUSTED_TYPES_POLICY;try{Y=ee("")}catch(we){throw E=W,we}}else E===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(E=gm(w,l)),E&&typeof Y=="string"&&(Y=ee(""));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&p===L&&(p=rt(p)),A.uponSanitizeAttribute.length>0&&V===q&&(V=rt(V)),ct&&ct(b),pn=b},yo=ue({},[...Pr,...Fr,...om]),gn=ue({},[...Ur,...rm]),Kr=function(b){let O=C(b);(!O||!O.tagName)&&(O={namespaceURI:mn,tagName:"template"});const W=fo(b.tagName),we=fo(O.tagName);return ho[b.namespaceURI]?b.namespaceURI===Kn?O.namespaceURI===It?W==="svg":O.namespaceURI===jn?W==="svg"&&(we==="annotation-xml"||bo[we]):!!yo[W]:b.namespaceURI===jn?O.namespaceURI===It?W==="math":O.namespaceURI===Kn?W==="math"&&ko[we]:!!gn[W]:b.namespaceURI===It?O.namespaceURI===Kn&&!ko[we]||O.namespaceURI===jn&&!bo[we]?!1:!gn[W]&&(Gr[W]||!yo[W]):!!(vn==="application/xhtml+xml"&&ho[b.namespaceURI]):!1},Et=function(b){Un(o.removed,{element:b});try{C(b).removeChild(b)}catch{_(b)}},qt=function(b,O){try{Un(o.removed,{attribute:O.getAttributeNode(b),from:O})}catch{Un(o.removed,{attribute:null,from:O})}if(O.removeAttribute(b),b==="is")if(Je||gt)try{Et(O)}catch{}else try{O.setAttribute(b,"")}catch{}},Eo=function(b){let O=null,W=null;if(Bt)b="<remove></remove>"+b;else{const Ce=Il(b,/^[\r\n\t ]+/);W=Ce&&Ce[0]}vn==="application/xhtml+xml"&&mn===It&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const we=E?ee(b):b;if(mn===It)try{O=new h().parseFromString(we,vn)}catch{}if(!O||!O.documentElement){O=ie.createDocument(mn,"template",null);try{O.documentElement.innerHTML=go?Y:we}catch{}}const fe=O.body||O.documentElement;return b&&W&&fe.insertBefore(n.createTextNode(W),fe.childNodes[0]||null),mn===It?J.call(O,Te?"html":"body")[0]:Te?O.documentElement:fe},qn=function(b){return X.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(b){var O,W;b.normalize();const we=X.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let fe=we.nextNode();for(;fe;){let Le=fe.data;An([U,F,G],bt=>{Le=Hn(Le,bt," ")}),fe.data=Le,fe=we.nextNode()}const Ce=(O=(W=b.querySelectorAll)===null||W===void 0?void 0:W.call(b,"template"))!==null&&O!==void 0?O:[];An(Array.from(Ce),Le=>{hn(Le.content)&&Rn(Le.content)})},Xn=function(b){const O=R?R(b):null;return typeof O!="string"||Oe(O)!=="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!==f(b)||b.childNodes!==z(b)},hn=function(b){if(!f||typeof b!="object"||b===null)return!1;try{return f(b)===Yt.documentFragment}catch{return!1}},Zn=function(b){if(!f||typeof b!="object"||b===null)return!1;try{return typeof f(b)=="number"}catch{return!1}};function xt(B,b,O){An(B,W=>{W.call(o,b,O,pn)})}const Jn=function(b){let O=null;if(xt(A.beforeSanitizeElements,b,null),Xn(b))return Et(b),!0;const W=Oe(R?R(b):b.nodeName);if(xt(A.uponSanitizeElement,b,{tagName:W,allowedTags:p}),it&&b.hasChildNodes()&&!Zn(b.firstElementChild)&&et(/<[/\w!]/g,b.innerHTML)&&et(/<[/\w!]/g,b.textContent)||it&&b.namespaceURI===It&&W==="style"&&Zn(b.firstElementChild)||b.nodeType===Yt.progressingInstruction||it&&b.nodeType===Yt.comment&&et(/<[/\w]/g,b.data))return Et(b),!0;if(ge[W]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(W))&&!p[W]){if(!ge[W]&&pe(W)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W)))return!1;if(be&&!ht[W]){const fe=C(b),Ce=z(b);if(Ce&&fe){const Le=Ce.length;for(let bt=Le-1;bt>=0;--bt){const kt=$(Ce[bt],!0);fe.insertBefore(kt,P(b))}}}return Et(b),!0}return(f?f(b):b.nodeType)===Yt.element&&!Kr(b)||(W==="noscript"||W==="noembed"||W==="noframes")&&et(/<\/no(script|embed|frames)/i,b.innerHTML)?(Et(b),!0):(Q&&b.nodeType===Yt.text&&(O=b.textContent,An([U,F,G],fe=>{O=Hn(O,fe," ")}),b.textContent!==O&&(Un(o.removed,{element:b.cloneNode()}),b.textContent=O)),xt(A.afterSanitizeElements,b,null),!1)},$t=function(b,O,W){if(Ge[O]||H&&(O==="id"||O==="name")&&(W in n||W in rr))return!1;const we=V[O]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(O,b);if(!(je&&!Ge[O]&&et(le,O))){if(!(Ze&&et(Ne,O))){if(!we||Ge[O]){if(!(pe(b)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,b)||se.tagNameCheck instanceof Function&&se.tagNameCheck(b))&&(se.attributeNameCheck instanceof RegExp&&et(se.attributeNameCheck,O)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(O,b))||O==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W))))return!1}else if(!po[O]){if(!et(y,Hn(W,Re,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&b!=="script"&&zl(W,"data:")===0&&er[b])){if(!(tn&&!et(_e,Hn(W,Re,"")))){if(W)return!1}}}}}}return!0},Me=ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pe=function(b){return!Me[fo(b)]&&et(xe,b)},lr=function(b){xt(A.beforeSanitizeAttributes,b,null);const O=b.attributes;if(!O||Xn(b))return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let we=O.length;for(;we--;){const fe=O[we],Ce=fe.name,Le=fe.namespaceURI,bt=fe.value,kt=Oe(Ce),Pt=bt;let He=Ce==="value"?Pt:Xf(Pt);if(W.attrName=kt,W.attrValue=He,W.keepAttr=!0,W.forceKeepAttr=void 0,xt(A.uponSanitizeAttribute,b,W),He=W.attrValue,Z&&(kt==="id"||kt==="name")&&zl(He,ce)!==0&&(qt(Ce,b),He=ce+He),it&&et(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,He)){qt(Ce,b);continue}if(kt==="attributename"&&Il(He,"href")){qt(Ce,b);continue}if(W.forceKeepAttr)continue;if(!W.keepAttr){qt(Ce,b);continue}if(!Rt&&et(/\/>/i,He)){qt(Ce,b);continue}Q&&An([U,F,G],nn=>{He=Hn(He,nn," ")});const xo=Oe(b.nodeName);if(!$t(xo,kt,He)){qt(Ce,b);continue}if(E&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Le)switch(w.getAttributeType(xo,kt)){case"TrustedHTML":{He=ee(He);break}case"TrustedScriptURL":{He=E.createScriptURL(He);break}}if(He!==Pt)try{Le?b.setAttributeNS(Le,Ce,He):b.setAttribute(Ce,He),Xn(b)?Et(b):Bl(o.removed)}catch{qt(Ce,b)}}xt(A.afterSanitizeAttributes,b,null)},tt=function(b){let O=null;const W=qn(b);for(xt(A.beforeSanitizeShadowDOM,b,null);O=W.nextNode();)if(xt(A.uponSanitizeShadowNode,O,null),Jn(O),lr(O),hn(O.content)&&tt(O.content),(f?f(O):O.nodeType)===Yt.element){const fe=x?x(O):O.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}xt(A.afterSanitizeShadowDOM,b,null)},Xt=function(b){const O=f?f(b):b.nodeType;if(O===Yt.element){const fe=x?x(b):b.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}const W=z?z(b):b.childNodes;if(!W)return;const we=[];An(W,fe=>{Un(we,fe)});for(const fe of we)Xt(fe);if(O===Yt.element){const fe=R?R(b):null;if(typeof fe=="string"&&Oe(fe)==="template"){const Ce=b.content;hn(Ce)&&Xt(Ce)}}};return o.sanitize=function(B){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,W=null,we=null,fe=null;if(go=!B,go&&(B="<!-->"),typeof B!="string"&&!Zn(B)&&(B=tm(B),typeof B!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return B;if(Se||Yn(b),o.removed=[],typeof B=="string"&&(ze=!1),ze){const bt=R?R(B):B.nodeName;if(typeof bt=="string"){const kt=Oe(bt);if(!p[kt]||ge[kt])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Xn(B))throw Wn("root node is clobbered and cannot be sanitized in-place");Xt(B)}else if(Zn(B))O=Eo("<!---->"),W=O.ownerDocument.importNode(B,!0),W.nodeType===Yt.element&&W.nodeName==="BODY"||W.nodeName==="HTML"?O=W:O.appendChild(W),Xt(W);else{if(!Je&&!Q&&!Te&&B.indexOf("<")===-1)return E&&ut?ee(B):B;if(O=Eo(B),!O)return Je?null:ut?Y:""}O&&Bt&&Et(O.firstChild);const Ce=qn(ze?B:O);for(;we=Ce.nextNode();)Jn(we),lr(we),hn(we.content)&&tt(we.content);if(ze)return Q&&Rn(B),B;if(Je){if(Q&&Rn(O),gt)for(fe=te.call(O.ownerDocument);O.firstChild;)fe.appendChild(O.firstChild);else fe=O;return(V.shadowroot||V.shadowrootmode)&&(fe=I.call(r,fe,!0)),fe}let Le=Te?O.outerHTML:O.innerHTML;return Te&&p["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&et(fm,O.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
129
- `+Le),Q&&An([U,F,G],bt=>{Le=Hn(Le,bt," ")}),E&&ut?ee(Le):Le},o.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(B),Se=!0},o.clearConfig=function(){pn=null,Se=!1},o.isValidAttribute=function(B,b,O){pn||Yn({});const W=Oe(B),we=Oe(b);return $t(W,we,O)},o.addHook=function(B,b){typeof b=="function"&&Un(A[B],b)},o.removeHook=function(B,b){if(b!==void 0){const O=Yf(A[B],b);return O===-1?void 0:qf(A[B],O,1)[0]}return Bl(A[B])},o.removeHooks=function(B){A[B]=[]},o.removeAllHooks=function(){A=Ul()},o}var hm=Hl();const bm=new Al({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),l=Tr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${l}</code></pre>`},t})()}),km=["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"],ym=["href","title","target","rel","src","alt","class","checked","type","disabled"],Em=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function xm(t){if(!t)return"";const o=bm.parse(t,{async:!1});return hm.sanitize(o,{ALLOWED_TAGS:km,ALLOWED_ATTR:ym,ALLOWED_URI_REGEXP:Em})}const wm={class:"zm-note-panel"},Nm={key:0,class:"zm-note-empty"},Sm={class:"zm-note-header"},Tm={class:"zm-note-title-row"},Cm={class:"zm-note-name"},Am={class:"zm-note-meta"},_m={class:"zm-note-scroll"},Mm={class:"zm-note-section"},vm={class:"zm-note-section-head"},Rm={class:"zm-note-split"},Bm=["disabled"],Im={key:0,class:"zm-note-preview"},zm=["innerHTML"],Om={key:1,class:"zm-note-preview-hint"},Lm={key:0,class:"zm-note-section-actions"},Dm={key:0,class:"zm-note-add-row"},Vm={key:1,class:"zm-note-section"},$m=["disabled"],Pm=["href","title"],Fm={key:2,class:"zm-note-section"},Um=["disabled"],Hm=["src","alt"],Wm={key:3,class:"zm-note-section"},Gm={class:"zm-note-section-head"},jm={key:0,class:"zm-note-section-tag"},Km=["disabled"],Ym={key:0,class:"zm-note-code"},qm=["innerHTML"],Xm={key:4,class:"zm-note-section"},Zm=["disabled"],Jm={key:0,class:"zm-note-table"},Qm=["onClick"],ep={class:"zm-note-table-sort-mark","aria-hidden":"true"},Zo=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,r=o,l=e.ref(""),c=e.ref(null);hr(c,{minRows:4,maxRows:10});const s=e.computed(()=>!l.value||l.value.trim()===""),u=e.computed(()=>xm(l.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text]},()=>{var y,p;l.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function h(){var L,V;if(n.readonly)return;const y=l.value,p=((V=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:V.text)??"";y!==p&&r("apply",y)}function w(y){var p,L;n.readonly||(y.key==="Escape"?(y.preventDefault(),l.value=((L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),h(),y.target.blur()))}function S(){n.readonly||confirm("移除该节点的笔记?")&&(l.value="",r("remove"))}const $=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),_=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),P=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),z=e.computed(()=>P.value==="code"),C=e.computed(()=>P.value==="table"),x=e.ref(!1),k=e.ref(!1),f=e.ref(!1),R=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{x.value=!1,k.value=!1,f.value=!1,R.value=!1});const E=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:L.url]},()=>{var y,p;E.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function Y(){var L,V;if(n.readonly)return;const y=E.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:V.url)??"";y!==p&&r("set-link",y)}const K=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:L.src]},()=>{var y,p;K.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ee(){var L,V;if(n.readonly)return;const y=K.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:V.src)??"";y!==p&&r("set-image",y)}function ae(y){const p=y.target;p.style.display="none"}function ie(y){const p=y.target;p.style.display=""}const X=e.ref(""),te=e.ref(null);hr(te,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;X.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const J=e.computed(()=>Tr(Wo(X.value),Nn(X.value)));function I(){var V,q;if(n.readonly)return;const y=X.value,p=((q=(V=n.selectedNode)==null?void 0:V.richContent)==null?void 0:q.raw)??"";if(y===p)return;const L=Nn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:L}:null)}const A=e.ref(""),U=e.ref(null);hr(U,{minRows:4,maxRows:14});const F=e.ref(-1),G=e.ref("asc");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;A.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",F.value=-1,G.value="asc"},{immediate:!0});function le(){var L,V;if(n.readonly)return;const y=A.value,p=((V=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:V.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const Ne=e.computed(()=>Cr(A.value)),_e=e.computed(()=>{const y=Ne.value;return F.value<0||y.length<=1?y:cl(y,F.value,G.value)});function Re(y){F.value!==y?(F.value=y,G.value="asc"):G.value==="asc"?G.value="desc":F.value=-1}const xe=e.computed(()=>{const y=[];return s.value||y.push(`${l.value.length} 字`),$.value&&y.push("1 链接"),_.value&&y.push("1 图片"),z.value&&y.push("代码块"),C.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var L,V,q,se;return e.openBlock(),e.createElementBlock("div",wm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Sm,[e.createElementVNode("div",Tm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Cm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Am,e.toDisplayString(xe.value),1)]),e.createElementVNode("div",_m,[e.createElementVNode("section",Mm,[e.createElementVNode("header",vm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[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:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Rm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=ge=>l.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:w},null,40,Bm),[[e.vModelText,l.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Im,[s.value?(e.openBlock(),e.createElementBlock("div",Om," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,zm))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:S},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Dm,[!$.value&&!x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>x.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!z.value&&!f.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>f.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!C.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>R.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||x.value?(e.openBlock(),e.createElementBlock("section",Vm,[p[15]||(p[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":p[5]||(p[5]=ge=>E.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:Y,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,$m),[[e.vModelText,E.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(L=t.selectedNode.link)==null?void 0:L.url,target:"_blank",rel:"noopener noreferrer",title:(V=t.selectedNode.link)==null?void 0:V.url},e.toDisplayString((q=t.selectedNode.link)==null?void 0:q.url),9,Pm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||k.value?(e.openBlock(),e.createElementBlock("section",Fm,[p[16]||(p[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":p[7]||(p[7]=ge=>K.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ee,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Um),[[e.vModelText,K.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(se=t.selectedNode.image)==null?void 0:se.src,alt:t.selectedNode.text,onError:ae,onLoad:ie},null,40,Hm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),z.value||f.value?(e.openBlock(),e.createElementBlock("section",Wm,[e.createElementVNode("header",Gm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Nn)(X.value)?(e.openBlock(),e.createElementBlock("span",jm,e.toDisplayString(e.unref(Nn)(X.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:te,"onUpdate:modelValue":p[9]||(p[9]=ge=>X.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:I},null,40,Km),[[e.vModelText,X.value]]),X.value.trim()?(e.openBlock(),e.createElementBlock("pre",Ym,[e.createElementVNode("code",{innerHTML:J.value},null,8,qm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||R.value?(e.openBlock(),e.createElementBlock("section",Xm,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:U,"onUpdate:modelValue":p[10]||(p[10]=ge=>A.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
124
+ `}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>${Zt(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=xl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Zt(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=xl(t);if(a===null)return Zt(n);t=a;let c=`<img src="${t}" alt="${Zt(n)}"`;return o&&(c+=` title="${Zt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zt(t.text)}},Di=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}},jt=class ir{constructor(o){Le(this,"options");Le(this,"renderer");Le(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 Di}static parse(o,n){return new ir(n).parse(o)}static parseInline(o,n){return new ir(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,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";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 g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=g||"";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 g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return i}},uo=(ei=class{constructor(t){Le(this,"options");Le(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?Gt.lex:Gt.lexInline}provideParser(t=this.block){return t?jt.parse:jt.parseInline}},Le(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Le(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Cl=class{constructor(...t){Le(this,"defaults",_i());Le(this,"options",this.setOptions);Le(this,"parse",this.parseMarkdown(!0));Le(this,"parseInline",this.parseMarkdown(!1));Le(this,"Parser",jt);Le(this,"Renderer",co);Le(this,"TextRenderer",Di);Le(this,"Lexer",Gt);Le(this,"Tokenizer",Xo);Le(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]=(...g)=>{let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),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]=(...g)=>{let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),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]=g=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let N=await u.call(a,g);return d.call(a,N)})();let h=u.call(a,g);return d.call(a,h)}:a[s]=(...g)=>{if(this.defaults.async)return(async()=>{let N=await u.apply(a,g);return N===!1&&(N=await d.apply(a,g)),N})();let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),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 Gt.lex(t,o??this.defaults)}parser(t,o){return jt.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?Gt.lex:Gt.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let g=await(a.hooks?await a.hooks.provideParser(t):t?jt.parse:jt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(g):g})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Gt.lex:Gt.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?jt.parse:jt.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+=`
125
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Zt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Cn=new Cl;function Ie(t,o){return Cn.parse(t,o)}Ie.options=Ie.setOptions=function(t){return Cn.setOptions(t),Ie.defaults=Cn.defaults,sl(Ie.defaults),Ie},Ie.getDefaults=_i,Ie.defaults=Nn,Ie.use=function(...t){return Cn.use(...t),Ie.defaults=Cn.defaults,sl(Ie.defaults),Ie},Ie.walkTokens=function(t,o){return Cn.walkTokens(t,o)},Ie.parseInline=Cn.parseInline,Ie.Parser=jt,Ie.parser=jt.parse,Ie.Renderer=co,Ie.TextRenderer=Di,Ie.Lexer=Gt,Ie.lexer=Gt.lex,Ie.Tokenizer=Xo,Ie.Hooks=uo,Ie.parse=Ie,Ie.options,Ie.setOptions,Ie.use,Ie.walkTokens,Ie.parseInline,jt.parse,Gt.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 Tl(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 Zf(t){if(Array.isArray(t))return t}function Jf(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,g=!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){g=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(g)throw a}}return u}}function Qf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
126
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function em(t,o){return Zf(t)||Jf(t,o)||tm(t,o)||Qf()}function tm(t,o){if(t){if(typeof t=="string")return Tl(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)?Tl(t,o):void 0}}const Al=Object.entries,_l=Object.setPrototypeOf,nm=Object.isFrozen,om=Object.getPrototypeOf,im=Object.getOwnPropertyDescriptor;let Nt=Object.freeze,Vt=Object.seal,Pn=Object.create,Ml=typeof Reflect<"u"&&Reflect,Vi=Ml.apply,$i=Ml.construct;Nt||(Nt=function(o){return o}),Vt||(Vt=function(o){return o}),Vi||(Vi=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)}),$i||($i=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 Tn=et(Array.prototype.forEach),rm=et(Array.prototype.lastIndexOf),Rl=et(Array.prototype.pop),Fn=et(Array.prototype.push),lm=et(Array.prototype.splice),St=Array.isArray,fo=et(String.prototype.toLowerCase),Pi=et(String.prototype.toString),vl=et(String.prototype.match),Un=et(String.prototype.replace),Bl=et(String.prototype.indexOf),am=et(String.prototype.trim),sm=et(Number.prototype.toString),cm=et(Boolean.prototype.toString),Il=typeof BigInt>"u"?null:et(BigInt.prototype.toString),zl=typeof Symbol>"u"?null:et(Symbol.prototype.toString),je=et(Object.prototype.hasOwnProperty),mo=et(Object.prototype.toString),dt=et(RegExp.prototype.test),Hn=dm(TypeError);function et(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 Vi(t,o,i)}}function dm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return $i(t,n)}}function ge(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(_l&&_l(t,null),!St(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(nm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function um(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function bt(t){const o=Pn(null);for(const i of Al(t)){var n=em(i,2);const a=n[0],c=n[1];je(t,a)&&(St(c)?o[a]=um(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=bt(c):o[a]=c)}return o}function fm(t){switch(typeof t){case"string":return t;case"number":return sm(t);case"boolean":return cm(t);case"bigint":return Il?Il(t):"0";case"symbol":return zl?zl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Jt(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 Jt(t,o){for(;t!==null;){const i=im(t,o);if(i){if(i.get)return et(i.get);if(typeof i.value=="function")return et(i.value)}t=om(t)}function n(){return null}return n}function mm(t){try{return dt(t,""),!0}catch{return!1}}const Ol=Nt(["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"]),Fi=Nt(["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"]),Ui=Nt(["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"]),pm=Nt(["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"]),Hi=Nt(["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"]),gm=Nt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ll=Nt(["#text"]),Dl=Nt(["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"]),Wi=Nt(["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"]),Vl=Nt(["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=Nt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hm=Vt(/{{[\w\W]*|^[\w\W]*}}/g),bm=Vt(/<%[\w\W]*|^[\w\W]*%>/g),km=Vt(/\${[\w\W]*/g),ym=Vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Em=Vt(/^aria-[\-\w]+$/),$l=Vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xm=Vt(/^(?:\w+script|data):/i),wm=Vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nm=Vt(/^html$/i),Sm=Vt(/^[a-z][.\w]*(-[.\w]+)+$/i),Qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cm=function(){return typeof window>"u"?null:window},Tm=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}},Pl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Fl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cm();const o=v=>Fl(v);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Qt.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,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,N=t.trustedTypes,C=u.prototype,$=Jt(C,"cloneNode"),R=Jt(C,"remove"),F=Jt(C,"nextSibling"),B=Jt(C,"childNodes"),_=Jt(C,"parentNode"),x=Jt(C,"shadowRoot"),k=Jt(C,"attributes"),m=s&&s.prototype?Jt(s.prototype,"nodeType"):null,P=s&&s.prototype?Jt(s.prototype,"nodeName"):null;if(typeof c=="function"){const v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}let L,S="",K=0;const J=function(b){if(K>0)throw Hn('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.');K++;try{return L.createHTML(b)}finally{K--}},de=n,ee=de.implementation,Y=de.createNodeIterator,oe=de.createDocumentFragment,ie=de.getElementsByTagName,ye=i.importNode;let y=Pl();o.isSupported=typeof Al=="function"&&typeof _=="function"&&ee&&ee.createHTMLDocument!==void 0;const V=hm,U=bm,j=km,ae=ym,Me=Em,ze=xm,De=wm,Ae=Sm;let E=$l,p=null;const O=ge({},[...Ol,...Fi,...Ui,...Hi,...Ll]);let D=null;const X=ge({},[...Dl,...Wi,...Vl,...Zo]);let ue=Object.seal(Pn(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}})),Ee=null,tt=null;const Ke=Object.seal(Pn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let it=!0,nt=!0,rn=!1,$t=!0,Q=!1,kt=!0,ve=!1,Re=!1,Pt=!1,rt=!1,At=!1,Ct=!1,H=!0,Z=!1;const fe="user-content-";let Se=!0,Ue=!1,lt={},_t=null;const _n=ge({},["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=ge({},["audio","video","img","source","image","track"]);let po=null;const oi=ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gn="http://www.w3.org/1998/Math/MathML",jn="http://www.w3.org/2000/svg",Ft="http://www.w3.org/1999/xhtml";let mn=Ft,go=!1,ho=null;const Gi=ge({},[Gn,jn,Ft],Pi);let bo=ge({},["mi","mo","mn","ms","mtext"]),ko=ge({},["annotation-xml"]);const ji=ge({},["title","style","font","a","script"]);let Mn=null;const ii=["application/xhtml+xml","text/html"],Ki="text/html";let He=null,pn=null;const ri=n.createElement("form"),li=function(b){return b instanceof RegExp||b instanceof Function},Kn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===b)return;(!b||typeof b!="object")&&(b={}),b=bt(b),Mn=ii.indexOf(b.PARSER_MEDIA_TYPE)===-1?Ki:b.PARSER_MEDIA_TYPE,He=Mn==="application/xhtml+xml"?Pi:fo,p=je(b,"ALLOWED_TAGS")&&St(b.ALLOWED_TAGS)?ge({},b.ALLOWED_TAGS,He):O,D=je(b,"ALLOWED_ATTR")&&St(b.ALLOWED_ATTR)?ge({},b.ALLOWED_ATTR,He):X,ho=je(b,"ALLOWED_NAMESPACES")&&St(b.ALLOWED_NAMESPACES)?ge({},b.ALLOWED_NAMESPACES,Pi):Gi,po=je(b,"ADD_URI_SAFE_ATTR")&&St(b.ADD_URI_SAFE_ATTR)?ge(bt(oi),b.ADD_URI_SAFE_ATTR,He):oi,ti=je(b,"ADD_DATA_URI_TAGS")&&St(b.ADD_DATA_URI_TAGS)?ge(bt(ni),b.ADD_DATA_URI_TAGS,He):ni,_t=je(b,"FORBID_CONTENTS")&&St(b.FORBID_CONTENTS)?ge({},b.FORBID_CONTENTS,He):_n,Ee=je(b,"FORBID_TAGS")&&St(b.FORBID_TAGS)?ge({},b.FORBID_TAGS,He):bt({}),tt=je(b,"FORBID_ATTR")&&St(b.FORBID_ATTR)?ge({},b.FORBID_ATTR,He):bt({}),lt=je(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?bt(b.USE_PROFILES):b.USE_PROFILES:!1,it=b.ALLOW_ARIA_ATTR!==!1,nt=b.ALLOW_DATA_ATTR!==!1,rn=b.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=b.SAFE_FOR_TEMPLATES||!1,kt=b.SAFE_FOR_XML!==!1,ve=b.WHOLE_DOCUMENT||!1,rt=b.RETURN_DOM||!1,At=b.RETURN_DOM_FRAGMENT||!1,Ct=b.RETURN_TRUSTED_TYPE||!1,Pt=b.FORCE_BODY||!1,H=b.SANITIZE_DOM!==!1,Z=b.SANITIZE_NAMED_PROPS||!1,Se=b.KEEP_CONTENT!==!1,Ue=b.IN_PLACE||!1,E=mm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:$l,mn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Ft,bo=je(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?bt(b.MATHML_TEXT_INTEGRATION_POINTS):ge({},["mi","mo","mn","ms","mtext"]),ko=je(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?bt(b.HTML_INTEGRATION_POINTS):ge({},["annotation-xml"]);const I=je(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?bt(b.CUSTOM_ELEMENT_HANDLING):Pn(null);if(ue=Pn(null),je(I,"tagNameCheck")&&li(I.tagNameCheck)&&(ue.tagNameCheck=I.tagNameCheck),je(I,"attributeNameCheck")&&li(I.attributeNameCheck)&&(ue.attributeNameCheck=I.attributeNameCheck),je(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),Q&&(nt=!1),At&&(rt=!0),lt&&(p=ge({},Ll),D=Pn(null),lt.html===!0&&(ge(p,Ol),ge(D,Dl)),lt.svg===!0&&(ge(p,Fi),ge(D,Wi),ge(D,Zo)),lt.svgFilters===!0&&(ge(p,Ui),ge(D,Wi),ge(D,Zo)),lt.mathMl===!0&&(ge(p,Hi),ge(D,Vl),ge(D,Zo))),Ke.tagCheck=null,Ke.attributeCheck=null,je(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?Ke.tagCheck=b.ADD_TAGS:St(b.ADD_TAGS)&&(p===O&&(p=bt(p)),ge(p,b.ADD_TAGS,He))),je(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?Ke.attributeCheck=b.ADD_ATTR:St(b.ADD_ATTR)&&(D===X&&(D=bt(D)),ge(D,b.ADD_ATTR,He))),je(b,"ADD_URI_SAFE_ATTR")&&St(b.ADD_URI_SAFE_ATTR)&&ge(po,b.ADD_URI_SAFE_ATTR,He),je(b,"FORBID_CONTENTS")&&St(b.FORBID_CONTENTS)&&(_t===_n&&(_t=bt(_t)),ge(_t,b.FORBID_CONTENTS,He)),je(b,"ADD_FORBID_CONTENTS")&&St(b.ADD_FORBID_CONTENTS)&&(_t===_n&&(_t=bt(_t)),ge(_t,b.ADD_FORBID_CONTENTS,He)),Se&&(p["#text"]=!0),ve&&ge(p,["html","head","body"]),p.table&&(ge(p,["tbody"]),delete Ee.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=L;L=b.TRUSTED_TYPES_POLICY;try{S=J("")}catch(_e){throw L=G,_e}}else L===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(L=Tm(N,a)),L&&typeof S=="string"&&(S=J(""));(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&p===O&&(p=bt(p)),y.uponSanitizeAttribute.length>0&&D===X&&(D=bt(D)),Nt&&Nt(b),pn=b},yo=ge({},[...Fi,...Ui,...pm]),gn=ge({},[...Hi,...gm]),Yi=function(b){let I=_(b);(!I||!I.tagName)&&(I={namespaceURI:mn,tagName:"template"});const G=fo(b.tagName),_e=fo(I.tagName);return ho[b.namespaceURI]?b.namespaceURI===jn?I.namespaceURI===Ft?G==="svg":I.namespaceURI===Gn?G==="svg"&&(_e==="annotation-xml"||bo[_e]):!!yo[G]:b.namespaceURI===Gn?I.namespaceURI===Ft?G==="math":I.namespaceURI===jn?G==="math"&&ko[_e]:!!gn[G]:b.namespaceURI===Ft?I.namespaceURI===jn&&!ko[_e]||I.namespaceURI===Gn&&!bo[_e]?!1:!gn[G]&&(ji[G]||!yo[G]):!!(Mn==="application/xhtml+xml"&&ho[b.namespaceURI]):!1},Mt=function(b){Fn(o.removed,{element:b});try{_(b).removeChild(b)}catch{R(b)}},en=function(b,I){try{Fn(o.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Fn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(rt||At)try{Mt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},Eo=function(b){let I=null,G=null;if(Pt)b="<remove></remove>"+b;else{const Be=vl(b,/^[\r\n\t ]+/);G=Be&&Be[0]}Mn==="application/xhtml+xml"&&mn===Ft&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const _e=L?J(b):b;if(mn===Ft)try{I=new h().parseFromString(_e,Mn)}catch{}if(!I||!I.documentElement){I=ee.createDocument(mn,"template",null);try{I.documentElement.innerHTML=go?S:_e}catch{}}const he=I.body||I.documentElement;return b&&G&&he.insertBefore(n.createTextNode(G),he.childNodes[0]||null),mn===Ft?ie.call(I,ve?"html":"body")[0]:ve?I.documentElement:he},Yn=function(b){return Y.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(b){var I,G;b.normalize();const _e=Y.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let he=_e.nextNode();for(;he;){let Ye=he.data;Tn([V,U,j],ft=>{Ye=Un(Ye,ft," ")}),he.data=Ye,he=_e.nextNode()}const Be=(I=(G=b.querySelectorAll)===null||G===void 0?void 0:G.call(b,"template"))!==null&&I!==void 0?I:[];Tn(Array.from(Be),Ye=>{hn(Ye.content)&&Rn(Ye.content)})},qn=function(b){const I=P?P(b):null;return typeof I!="string"||He(I)!=="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!==B(b)},hn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Qt.documentFragment}catch{return!1}},Xn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function Rt(v,b,I){Tn(v,G=>{G.call(o,b,I,pn)})}const Zn=function(b){let I=null;if(Rt(y.beforeSanitizeElements,b,null),qn(b))return Mt(b),!0;const G=He(P?P(b):b.nodeName);if(Rt(y.uponSanitizeElement,b,{tagName:G,allowedTags:p}),kt&&b.hasChildNodes()&&!Xn(b.firstElementChild)&&dt(/<[/\w!]/g,b.innerHTML)&&dt(/<[/\w!]/g,b.textContent)||kt&&b.namespaceURI===Ft&&G==="style"&&Xn(b.firstElementChild)||b.nodeType===Qt.progressingInstruction||kt&&b.nodeType===Qt.comment&&dt(/<[/\w]/g,b.data))return Mt(b),!0;if(Ee[G]||!(Ke.tagCheck instanceof Function&&Ke.tagCheck(G))&&!p[G]){if(!Ee[G]&&ke(G)&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,G)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(G)))return!1;if(Se&&!_t[G]){const he=_(b),Be=B(b);if(Be&&he){const Ye=Be.length;for(let ft=Ye-1;ft>=0;--ft){const vt=$(Be[ft],!0);he.insertBefore(vt,F(b))}}}return Mt(b),!0}return(m?m(b):b.nodeType)===Qt.element&&!Yi(b)||(G==="noscript"||G==="noembed"||G==="noframes")&&dt(/<\/no(script|embed|frames)/i,b.innerHTML)?(Mt(b),!0):(Q&&b.nodeType===Qt.text&&(I=b.textContent,Tn([V,U,j],he=>{I=Un(I,he," ")}),b.textContent!==I&&(Fn(o.removed,{element:b.cloneNode()}),b.textContent=I)),Rt(y.afterSanitizeElements,b,null),!1)},Kt=function(b,I,G){if(tt[I]||H&&(I==="id"||I==="name")&&(G in n||G in ri))return!1;const _e=D[I]||Ke.attributeCheck instanceof Function&&Ke.attributeCheck(I,b);if(!(nt&&!tt[I]&&dt(ae,I))){if(!(it&&dt(Me,I))){if(!_e||tt[I]){if(!(ke(b)&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,b)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(b))&&(ue.attributeNameCheck instanceof RegExp&&dt(ue.attributeNameCheck,I)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(I,b))||I==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,G)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(G))))return!1}else if(!po[I]){if(!dt(E,Un(G,De,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&Bl(G,"data:")===0&&ti[b])){if(!(rn&&!dt(ze,Un(G,De,"")))){if(G)return!1}}}}}}return!0},Oe=ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ke=function(b){return!Oe[fo(b)]&&dt(Ae,b)},ai=function(b){Rt(y.beforeSanitizeAttributes,b,null);const I=b.attributes;if(!I||qn(b))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let _e=I.length;for(;_e--;){const he=I[_e],Be=he.name,Ye=he.namespaceURI,ft=he.value,vt=He(Be),Jn=ft;let Ve=Be==="value"?Jn:am(Jn);if(G.attrName=vt,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,Rt(y.uponSanitizeAttribute,b,G),Ve=G.attrValue,Z&&(vt==="id"||vt==="name")&&Bl(Ve,fe)!==0&&(en(Be,b),Ve=fe+Ve),kt&&dt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){en(Be,b);continue}if(vt==="attributename"&&vl(Ve,"href")){en(Be,b);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){en(Be,b);continue}if(!$t&&dt(/\/>/i,Ve)){en(Be,b);continue}Q&&Tn([V,U,j],wo=>{Ve=Un(Ve,wo," ")});const xo=He(b.nodeName);if(!Kt(xo,vt,Ve)){en(Be,b);continue}if(L&&typeof N=="object"&&typeof N.getAttributeType=="function"&&!Ye)switch(N.getAttributeType(xo,vt)){case"TrustedHTML":{Ve=J(Ve);break}case"TrustedScriptURL":{Ve=L.createScriptURL(Ve);break}}if(Ve!==Jn)try{Ye?b.setAttributeNS(Ye,Be,Ve):b.setAttribute(Be,Ve),qn(b)?Mt(b):Rl(o.removed)}catch{en(Be,b)}}Rt(y.afterSanitizeAttributes,b,null)},ut=function(b){let I=null;const G=Yn(b);for(Rt(y.beforeSanitizeShadowDOM,b,null);I=G.nextNode();)if(Rt(y.uponSanitizeShadowNode,I,null),Zn(I),ai(I),hn(I.content)&&ut(I.content),(m?m(I):I.nodeType)===Qt.element){const he=x?x(I):I.shadowRoot;hn(he)&&(tn(he),ut(he))}Rt(y.afterSanitizeShadowDOM,b,null)},tn=function(b){const I=m?m(b):b.nodeType;if(I===Qt.element){const he=x?x(b):b.shadowRoot;hn(he)&&(tn(he),ut(he))}const G=B?B(b):b.childNodes;if(!G)return;const _e=[];Tn(G,he=>{Fn(_e,he)});for(const he of _e)tn(he);if(I===Qt.element){const he=P?P(b):null;if(typeof he=="string"&&He(he)==="template"){const Be=b.content;hn(Be)&&tn(Be)}}};return o.sanitize=function(v){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,G=null,_e=null,he=null;if(go=!v,go&&(v="<!-->"),typeof v!="string"&&!Xn(v)&&(v=fm(v),typeof v!="string"))throw Hn("dirty is not a string, aborting");if(!o.isSupported)return v;if(Re||Kn(b),o.removed=[],typeof v=="string"&&(Ue=!1),Ue){const ft=P?P(v):v.nodeName;if(typeof ft=="string"){const vt=He(ft);if(!p[vt]||Ee[vt])throw Hn("root node is forbidden and cannot be sanitized in-place")}if(qn(v))throw Hn("root node is clobbered and cannot be sanitized in-place");tn(v)}else if(Xn(v))I=Eo("<!---->"),G=I.ownerDocument.importNode(v,!0),G.nodeType===Qt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?I=G:I.appendChild(G),tn(G);else{if(!rt&&!Q&&!ve&&v.indexOf("<")===-1)return L&&Ct?J(v):v;if(I=Eo(v),!I)return rt?null:Ct?S:""}I&&Pt&&Mt(I.firstChild);const Be=Yn(Ue?v:I);for(;_e=Be.nextNode();)Zn(_e),ai(_e),hn(_e.content)&&ut(_e.content);if(Ue)return Q&&Rn(v),v;if(rt){if(Q&&Rn(I),At)for(he=oe.call(I.ownerDocument);I.firstChild;)he.appendChild(I.firstChild);else he=I;return(D.shadowroot||D.shadowrootmode)&&(he=ye.call(i,he,!0)),he}let Ye=ve?I.outerHTML:I.innerHTML;return ve&&p["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&dt(Nm,I.ownerDocument.doctype.name)&&(Ye="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
127
+ `+Ye),Q&&Tn([V,U,j],ft=>{Ye=Un(Ye,ft," ")}),L&&Ct?J(Ye):Ye},o.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kn(v),Re=!0},o.clearConfig=function(){pn=null,Re=!1},o.isValidAttribute=function(v,b,I){pn||Kn({});const G=He(v),_e=He(b);return Kt(G,_e,I)},o.addHook=function(v,b){typeof b=="function"&&Fn(y[v],b)},o.removeHook=function(v,b){if(b!==void 0){const I=rm(y[v],b);return I===-1?void 0:lm(y[v],I,1)[0]}return Rl(y[v])},o.removeHooks=function(v){y[v]=[]},o.removeAllHooks=function(){y=Pl()},o}var Am=Fl();const _m=new Cl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Ti(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Mm=["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"],Rm=["href","title","target","rel","src","alt","class","checked","type","disabled"],vm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Bm(t){if(!t)return"";const o=_m.parse(t,{async:!1});return Am.sanitize(o,{ALLOWED_TAGS:Mm,ALLOWED_ATTR:Rm,ALLOWED_URI_REGEXP:vm})}const Im={class:"zm-note-panel"},zm={key:0,class:"zm-note-empty"},Om={class:"zm-note-header"},Lm={class:"zm-note-title-row"},Dm={class:"zm-note-name"},Vm={class:"zm-note-meta"},$m={class:"zm-note-scroll"},Pm={class:"zm-note-section"},Fm={class:"zm-note-section-head"},Um={class:"zm-note-split"},Hm=["disabled"],Wm={key:0,class:"zm-note-preview"},Gm=["innerHTML"],jm={key:1,class:"zm-note-preview-hint"},Km={key:0,class:"zm-note-section-actions"},Ym={key:0,class:"zm-note-add-row"},qm={key:1,class:"zm-note-section"},Xm=["disabled"],Zm=["href","title"],Jm={key:2,class:"zm-note-section"},Qm=["disabled"],ep=["src","alt"],tp={key:3,class:"zm-note-section"},np={class:"zm-note-section-head"},op={key:0,class:"zm-note-section-tag"},ip=["disabled"],rp={key:0,class:"zm-note-code"},lp=["innerHTML"],ap={key:4,class:"zm-note-section"},sp=["disabled"],cp={key:0,class:"zm-note-table"},dp=["onClick"],up={class:"zm-note-table-sort-mark","aria-hidden":"true"},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);bi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>Bm(a.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text]},()=>{var E,p;a.value=((p=(E=n.selectedNode)==null?void 0:E.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const E=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(E){E.focus();const p=E.value.length;E.setSelectionRange(p,p)}});function h(){var O,D;if(n.readonly)return;const E=a.value,p=((D=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:D.text)??"";E!==p&&i("apply",E)}function N(E){var p,O;n.readonly||(E.key==="Escape"?(E.preventDefault(),a.value=((O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text)??"",E.target.blur()):E.key==="Enter"&&(E.ctrlKey||E.metaKey)&&(E.preventDefault(),h(),E.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var E,p;return!!((p=(E=n.selectedNode)==null?void 0:E.link)!=null&&p.url)}),R=e.computed(()=>{var E,p;return!!((p=(E=n.selectedNode)==null?void 0:E.image)!=null&&p.src)}),F=e.computed(()=>{var E,p;return(p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.kind}),B=e.computed(()=>F.value==="code"),_=e.computed(()=>F.value==="table"),x=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var E;return(E=n.selectedNode)==null?void 0:E.id},()=>{x.value=!1,k.value=!1,m.value=!1,P.value=!1});const L=e.ref("");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:O.url]},()=>{var E,p;L.value=((p=(E=n.selectedNode)==null?void 0:E.link)==null?void 0:p.url)??""},{immediate:!0});function S(){var O,D;if(n.readonly)return;const E=L.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:D.url)??"";E!==p&&i("set-link",E)}const K=e.ref("");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:O.src]},()=>{var E,p;K.value=((p=(E=n.selectedNode)==null?void 0:E.image)==null?void 0:p.src)??""},{immediate:!0});function J(){var O,D;if(n.readonly)return;const E=K.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:D.src)??"";E!==p&&i("set-image",E)}function de(E){const p=E.target;p.style.display="none"}function ee(E){const p=E.target;p.style.display=""}const Y=e.ref(""),oe=e.ref(null);bi(oe,{minRows:4,maxRows:18}),e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var E,p;Y.value=((p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>Ti(Go(Y.value),wn(Y.value)));function ye(){var D,X;if(n.readonly)return;const E=Y.value,p=((X=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:X.raw)??"";if(E===p)return;const O=wn(E)||void 0;i("set-rich",E?{kind:"code",raw:E,lang:O}:null)}const y=e.ref(""),V=e.ref(null);bi(V,{minRows:4,maxRows:14});const U=e.ref(-1),j=e.ref("asc");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var E,p;y.value=((p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.raw)??"",U.value=-1,j.value="asc"},{immediate:!0});function ae(){var O,D;if(n.readonly)return;const E=y.value,p=((D=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:D.raw)??"";E!==p&&i("set-rich",E?{kind:"table",raw:E}:null)}const Me=e.computed(()=>Ai(y.value)),ze=e.computed(()=>{const E=Me.value;return U.value<0||E.length<=1?E:al(E,U.value,j.value)});function De(E){U.value!==E?(U.value=E,j.value="asc"):j.value==="asc"?j.value="desc":U.value=-1}const Ae=e.computed(()=>{const E=[];return s.value||E.push(`${a.value.length} 字`),$.value&&E.push("1 链接"),R.value&&E.push("1 图片"),B.value&&E.push("代码块"),_.value&&E.push("表格"),E.length===0?"节点没有额外内容":E.join(" · ")});return(E,p)=>{var O,D,X,ue;return e.openBlock(),e.createElementBlock("div",Im,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Om,[e.createElementVNode("div",Lm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Dm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Vm,e.toDisplayString(Ae.value),1)]),e.createElementVNode("div",$m,[e.createElementVNode("section",Pm,[e.createElementVNode("header",Fm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[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:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Um,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=Ee=>a.value=Ee),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:N},null,40,Hm),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Wm,[s.value?(e.openBlock(),e.createElementBlock("div",jm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Gm))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",Km,[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",Ym,[!$.value&&!x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=Ee=>x.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=Ee=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!B.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=Ee=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!_.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=Ee=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||x.value?(e.openBlock(),e.createElementBlock("section",qm,[p[15]||(p[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":p[5]||(p[5]=Ee=>L.value=Ee),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:S,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(Ee=>Ee.target.blur(),["prevent"]),["enter"]))},null,40,Xm),[[e.vModelText,L.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(O=t.selectedNode.link)==null?void 0:O.url,target:"_blank",rel:"noopener noreferrer",title:(D=t.selectedNode.link)==null?void 0:D.url},e.toDisplayString((X=t.selectedNode.link)==null?void 0:X.url),9,Zm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Jm,[p[16]||(p[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":p[7]||(p[7]=Ee=>K.value=Ee),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:J,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(Ee=>Ee.target.blur(),["prevent"]),["enter"]))},null,40,Qm),[[e.vModelText,K.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(ue=t.selectedNode.image)==null?void 0:ue.src,alt:t.selectedNode.text,onError:de,onLoad:ee},null,40,ep)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||m.value?(e.openBlock(),e.createElementBlock("section",tp,[e.createElementVNode("header",np,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(Y.value)?(e.openBlock(),e.createElementBlock("span",op,e.toDisplayString(e.unref(wn)(Y.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:oe,"onUpdate:modelValue":p[9]||(p[9]=Ee=>Y.value=Ee),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ye},null,40,ip),[[e.vModelText,Y.value]]),Y.value.trim()?(e.openBlock(),e.createElementBlock("pre",rp,[e.createElementVNode("code",{innerHTML:ie.value},null,8,lp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||P.value?(e.openBlock(),e.createElementBlock("section",ap,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":p[10]||(p[10]=Ee=>y.value=Ee),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
130
128
  | --- | --- |
131
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:le},null,40,Zm),[[e.vModelText,A.value]]),Ne.value.length?(e.openBlock(),e.createElementBlock("table",Jm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(ge,Ge)=>(e.openBlock(),e.createElementBlock("tr",{key:Ge},[Ge===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":F.value===Ze,"is-asc":F.value===Ze&&G.value==="asc","is-desc":F.value===Ze&&G.value==="desc"}]),onClick:je=>Re(Ze)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",ep,e.toDisplayString(F.value===Ze?G.value==="asc"?"▲":"▼":"↕"),1)],10,Qm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Nm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),tp=["viewBox","width","height"],np={class:"zm-edges"},op=["d","fill"],rp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],ip=["src","width","height","alt"],lp=["onDblclick"],ap={key:0,class:"zm-rich-code"},sp=["innerHTML"],cp={key:1,class:"zm-rich-table"},dp=["onClick"],up={class:"zm-rich-sort-mark","aria-hidden":"true"},fp={key:2,class:"zm-text"},mp={key:0,class:"zm-node-markers"},pp=["title","innerHTML"],gp={class:"zm-text-label"},hp=["href","title"],bp=["title","onClick"],kp={key:4,class:"zm-node-tags"},yp=["title"],Ep=["title","onClick"],xp=["onClick"],wp=["onMousedown"],Np=["onClick"],Sp=["title"],Tp={class:"zm-tb-tip zm-tb-zoom"},Cp=["src"],Ap=["src"],_n=24,Gn=400,fn=160,Wl=4,Jo=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 r=t,l=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),w=e.ref(!1),S=e.ref(null),$=e.ref(0),_=e.ref(0),P=e.ref(null),z=e.ref(null),C=e.ref(null),x=e.ref(""),k=e.ref(new Map),f=e.ref(_t(r.data)),R=e.ref({}),E=e.ref({}),Y=e.ref(r.markdown!==void 0);let K=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){Y.value=!1;return}Y.value=!0;const a=zn(i||"");K=!0,f.value=_t(a),d.value=new Set,h.value=new Set,pe(),e.nextTick(()=>{K=!1,on()})}),e.watch(f,()=>{Y.value&&!K&&l("markdownChange",On(f.value))},{deep:!0});const ee=e.computed(()=>B.showOrderBadge===!0),ae=e.ref(new Map),ie=ae.value;function X(i,a){const m={};a.bg&&(m.bg=a.bg),a.textColor&&(m.textColor=a.textColor),a.borderColor&&(m.borderColor=a.borderColor),a.fontWeight&&(m.fontWeight=a.fontWeight),a.fontSize&&(m.fontSize=a.fontSize),Object.keys(m).length===0?ie.delete(i):ie.set(i,m),ae.value=new Map(ie)}function te(i){return ie.get(i)??{}}function J(i,a){const m=re(f.value,i);m&&(m.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:U(a.width,_n,Gn),height:U(a.height,_n,Gn)},Me(),pe(),l("change",f.value))}function I(i){const a=re(f.value,i);!a||!a.image||(delete a.image,Me(),pe(),l("change",f.value))}function A(i,a){const m=a.trim();if(!re(f.value,i))return;if(!m){I(i);return}const N=new Image;N.onload=()=>{const D=re(f.value,i);if(!D)return;const M=N.naturalWidth&&N.naturalHeight?N.naturalWidth/N.naturalHeight:1,j=U(N.naturalWidth||fn,_n,Gn),ne=Math.round(j/M);D.image={src:m,naturalW:N.naturalWidth||j,naturalH:N.naturalHeight||ne,width:j,height:ne},Me(),pe(),l("change",f.value)},N.onerror=()=>{},N.src=m}function U(i,a,m){return Math.min(m,Math.max(a,i))}function F(i,a){const m=new FileReader;m.onload=()=>{if(typeof m.result!="string")return;const v=m.result,N=new window.Image;N.onload=()=>{const D=N.naturalWidth||fn,M=N.naturalHeight||fn,j=U(D,_n,fn),ne=U(Math.round(M*j/D),_n,Gn);a({src:v,naturalW:D,naturalH:M,width:j,height:ne})},N.onerror=()=>{a({src:v,naturalW:fn,naturalH:fn,width:fn,height:fn})},N.src=v},m.readAsDataURL(i)}function G(i){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var v;const m=(v=a.files)==null?void 0:v[0];m&&(F(m,N=>J(i,N)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function le(i,a){const m=a.trim(),v=re(f.value,i);v&&(m?v.link={url:m}:delete v.link,Me(),pe(),l("change",f.value))}function Ne(i){le(i,"")}function _e(i,a){const m=re(f.value,i);m&&(a?m.note={text:a}:delete m.note,Me(),pe(),l("change",f.value))}function Re(i){_e(i,"")}function xe(i,a){const m=re(f.value,i);m&&(a?m.richContent=a:delete m.richContent,Me(),pe(),l("change",f.value))}const y=e.ref(null),p=e.ref(null),L=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),V=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function q(i,a){r.previewMode||(i.preventDefault(),i.stopPropagation(),p.value=null,d.value=new Set([a.id]),lt(),y.value={nodeId:a.id,x:i.clientX,y:i.clientY})}function se(){y.value=null}function ge(i){const a=i.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(cr&&oe.panMoved.value){cr=!1,i.preventDefault();return}i.preventDefault(),y.value&&(y.value=null),p.value={x:i.clientX,y:i.clientY}}}function Ge(){p.value=null}function Pe(){Ge(),r.builtInDrawers&&(gt(),Te.value=!0),l("canvas-settings")}function Ze(){Ge(),r.builtInDrawers&&(gt(),Rt.value=!0),l("canvas-data")}function je(i){Ge(),r.builtInDrawers&&(gt(),Bt.value=i,Rt.value=!0),l("canvas-import",i)}const tn=e.ref(!1),Rt=e.ref(!1),Q=e.ref(!1),it=e.ref(!1),Te=e.ref(!1),Se=e.ref(0),Bt=e.ref(null),Je=e.ref(new Set);function gt(){Rt.value=!1,Q.value=!1,it.value=!1,Te.value=!1}const ut=e.computed(()=>{const i=g.value;return i?re(f.value,i)??null:null}),H=e.computed(()=>ut.value?te(ut.value.id):{});function Z(i){i.autoBalanceOnChange!==void 0&&(B.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(B.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(B.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(B.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(B.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(B.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(B.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(B.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(B.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(B.canvasBg=i.canvasBg)}function ce(i){ut.value&&X(ut.value.id,i)}function be(){const i={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};B.autoBalanceOnChange=i.autoBalanceOnChange,B.lineWidthStart=i.lineWidthStart,B.lineWidthEnd=i.lineWidthEnd,B.rainbowBranch=i.rainbowBranch,B.branchPaletteId=i.branchPaletteId,B.customPalettes=i.customPalettes,B.lineStyle=i.lineStyle,B.layoutMode=i.layoutMode,B.taperedEdge=i.taperedEdge,B.showOrderBadge=i.showOrderBadge,B.canvasBg=i.canvasBg}function ze(){Bt.value=null}function Qe(i){const a=g.value;a&&_e(a,i)}function ht(){const i=g.value;i&&Re(i)}function Mn(i){const a=g.value;a&&le(a,i)}function er(i){const a=g.value;a&&A(a,i)}function tr(i){const a=g.value;a&&xe(a,i)}function po(i){const a=document.querySelector(`[data-node-id="${i.id}"]`);a&&a.click()}function nr(i){da(i.id,i.text)}function jn(i){to(i)}function Kn(i){ar(i)}function It(i){Zr(i.srcId,i.targetId,i.position)}function mn(i){const a=new Set(Je.value);a.has(i)?a.delete(i):a.add(i),Je.value=a}function go(){r.builtInDrawers&&(tn.value=!tn.value),l("canvas-outline")}function ho(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&G(i)}function Wr(){var v,N,D;const i=(v=y.value)==null?void 0:v.nodeId;if(!i)return;const a=((D=(N=re(f.value,i))==null?void 0:N.link)==null?void 0:D.url)??"",m=window.prompt("输入链接 URL(留空取消)",a);m!==null&&le(i,m)}function bo(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Ne(i)}function ko(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&rr(i)}function Gr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Re(i)}function vn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&I(i)}function or(){var Ve,T;const i=(Ve=y.value)==null?void 0:Ve.nodeId;if(!i)return;const a=(T=re(f.value,i))==null?void 0:T.richContent,m=(a==null?void 0:a.kind)==="code"?Wo(a.raw):"",v=(a==null?void 0:a.kind)==="code"&&a.lang||"",N=v?"```"+v+`
132
- `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",m?N+m+(m.endsWith("```")?"":"\n```"):N+"// 你的代码"+"\n```");if(M===null)return;const j=M.trim();if(!j){xe(i,null);return}const ne=/^```([^\s`]*)/.exec(j),me=ne?ne[1]:void 0;xe(i,{kind:"code",raw:j,lang:me})}function jr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function Oe(){var M,j;const i=(M=y.value)==null?void 0:M.nodeId;if(!i)return;const a=(j=re(f.value,i))==null?void 0:j.richContent,m=(a==null?void 0:a.kind)==="table"?a.raw:"",N=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",m||`| 列1 | 列2 | 列3 |
129
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,sp),[[e.vModelText,y.value]]),Me.value.length?(e.openBlock(),e.createElementBlock("table",cp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(Ee,tt)=>(e.openBlock(),e.createElementBlock("tr",{key:tt},[tt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ee,(Ke,it)=>(e.openBlock(),e.createElementBlock("th",{key:`h${it}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":U.value===it,"is-asc":U.value===it&&j.value==="asc","is-desc":U.value===it&&j.value==="desc"}]),onClick:nt=>De(it)},[e.createElementVNode("span",null,e.toDisplayString(Ke),1),e.createElementVNode("span",up,e.toDisplayString(U.value===it?j.value==="asc"?"▲":"▼":"↕"),1)],10,dp))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ee,(Ke,it)=>(e.openBlock(),e.createElementBlock("td",{key:`c${it}`},e.toDisplayString(Ke),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",zm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),fp=["viewBox","width","height"],mp={class:"zm-edges"},pp=["d","fill"],gp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],hp=["src","width","height","alt"],bp=["onDblclick"],kp={key:0,class:"zm-rich-code"},yp=["innerHTML"],Ep={key:1,class:"zm-rich-table"},xp=["onClick"],wp={class:"zm-rich-sort-mark","aria-hidden":"true"},Np={key:2,class:"zm-text"},Sp={key:0,class:"zm-node-markers"},Cp=["title","innerHTML"],Tp={class:"zm-text-label"},Ap=["href","title"],_p=["title","onClick"],Mp={key:4,class:"zm-node-tags"},Rp=["title"],vp=["title","onClick"],Bp=["onClick"],Ip=["onMousedown"],zp=["onClick"],Op=["title"],Lp={class:"zm-tb-tip zm-tb-zoom"},Dp=["src"],Vp=["src"],An=24,Wn=400,fn=160,Ul=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),g=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),N=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),F=e.ref(null),B=e.ref(null),_=e.ref(null),x=e.ref(""),k=e.ref(new Map),m=e.ref(Lt(i.data)),P=e.ref({}),L=e.ref({}),S=e.ref(i.markdown!==void 0);let K=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){S.value=!1;return}S.value=!0;const l=In(r||"");K=!0,m.value=Lt(l),d.value=new Set,h.value=new Set,ke(),e.nextTick(()=>{K=!1,ln()})}),e.watch(m,()=>{S.value&&!K&&a("markdownChange",zn(m.value))},{deep:!0});const J=e.computed(()=>v.showOrderBadge===!0),de=e.ref(new Map),ee=de.value;function Y(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?ee.delete(r):ee.set(r,f),de.value=new Map(ee)}function oe(r){return ee.get(r)??{}}function ie(r,l){const f=le(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,An,Wn),height:V(l.height,An,Wn)},Oe(),ke(),a("change",m.value))}function ye(r){const l=le(m.value,r);!l||!l.image||(delete l.image,Oe(),ke(),a("change",m.value))}function y(r,l){const f=l.trim();if(!le(m.value,r))return;if(!f){ye(r);return}const w=new Image;w.onload=()=>{const z=le(m.value,r);if(!z)return;const M=w.naturalWidth&&w.naturalHeight?w.naturalWidth/w.naturalHeight:1,W=V(w.naturalWidth||fn,An,Wn),te=Math.round(W/M);z.image={src:f,naturalW:w.naturalWidth||W,naturalH:w.naturalHeight||te,width:W,height:te},Oe(),ke(),a("change",m.value)},w.onerror=()=>{},w.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function U(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const A=f.result,w=new window.Image;w.onload=()=>{const z=w.naturalWidth||fn,M=w.naturalHeight||fn,W=V(z,An,fn),te=V(Math.round(M*W/z),An,Wn);l({src:A,naturalW:z,naturalH:M,width:W,height:te})},w.onerror=()=>{l({src:A,naturalW:fn,naturalH:fn,width:fn,height:fn})},w.src=A},f.readAsDataURL(r)}function j(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var A;const f=(A=l.files)==null?void 0:A[0];f&&(U(f,w=>ie(r,w)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function ae(r,l){const f=l.trim(),A=le(m.value,r);A&&(f?A.link={url:f}:delete A.link,Oe(),ke(),a("change",m.value))}function Me(r){ae(r,"")}function ze(r,l){const f=le(m.value,r);f&&(l?f.note={text:l}:delete f.note,Oe(),ke(),a("change",m.value))}function De(r){ze(r,"")}function Ae(r,l){const f=le(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Oe(),ke(),a("change",m.value))}const E=e.ref(null),p=e.ref(null),O=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||N.value)?"is-visible":""].filter(Boolean).join(" ")),D=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||N.value)?"is-visible":""].filter(Boolean).join(" "));function X(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),p.value=null,d.value=new Set([l.id]),Et(),E.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ue(){E.value=null}function Ee(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&&re.panMoved.value){di=!1,r.preventDefault();return}r.preventDefault(),E.value&&(E.value=null),p.value={x:r.clientX,y:r.clientY}}}function tt(){p.value=null}function Ke(){tt(),i.builtInDrawers&&(At(),ve.value=!0),a("canvas-settings")}function it(){tt(),i.builtInDrawers&&(At(),$t.value=!0),a("canvas-data")}function nt(r){tt(),i.builtInDrawers&&(At(),Pt.value=r,$t.value=!0),a("canvas-import",r)}const rn=e.ref(!1),$t=e.ref(!1),Q=e.ref(!1),kt=e.ref(!1),ve=e.ref(!1),Re=e.ref(0),Pt=e.ref(null),rt=e.ref(new Set);function At(){$t.value=!1,Q.value=!1,kt.value=!1,ve.value=!1}const Ct=e.computed(()=>{const r=g.value;return r?le(m.value,r)??null:null}),H=e.computed(()=>Ct.value?oe(Ct.value.id):{});function Z(r){r.autoBalanceOnChange!==void 0&&(v.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(v.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(v.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(v.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(v.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(v.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(v.lineStyle=r.lineStyle),r.lineOrigin!==void 0&&(v.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(v.taperedEdge=r.taperedEdge),r.showOrderBadge!==void 0&&(v.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(v.canvasBg=r.canvasBg)}function fe(r){Ct.value&&Y(Ct.value.id,r)}function Se(){const r={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",lineOrigin:"edge",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};v.autoBalanceOnChange=r.autoBalanceOnChange,v.lineWidthStart=r.lineWidthStart,v.lineWidthEnd=r.lineWidthEnd,v.rainbowBranch=r.rainbowBranch,v.branchPaletteId=r.branchPaletteId,v.customPalettes=r.customPalettes,v.lineStyle=r.lineStyle,v.lineOrigin=r.lineOrigin,v.layoutMode=r.layoutMode,v.taperedEdge=r.taperedEdge,v.showOrderBadge=r.showOrderBadge,v.canvasBg=r.canvasBg}function Ue(){Pt.value=null}function lt(r){const l=g.value;l&&ze(l,r)}function _t(){const r=g.value;r&&De(r)}function _n(r){const l=g.value;l&&ae(l,r)}function ti(r){const l=g.value;l&&y(l,r)}function ni(r){const l=g.value;l&&Ae(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function oi(r){aa(r.id,r.text)}function Gn(r){no(r)}function jn(r){si(r)}function Ft(r){Ji(r.srcId,r.targetId,r.position)}function mn(r){const l=new Set(rt.value);l.has(r)?l.delete(r):l.add(r),rt.value=l}function go(){i.builtInDrawers&&(rn.value=!rn.value),a("canvas-outline")}function ho(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&j(r)}function Gi(){var A,w,z;const r=(A=E.value)==null?void 0:A.nodeId;if(!r)return;const l=((z=(w=le(m.value,r))==null?void 0:w.link)==null?void 0:z.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&ae(r,f)}function bo(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&Me(r)}function ko(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&ri(r)}function ji(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&De(r)}function Mn(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&ye(r)}function ii(){var Pe,T;const r=(Pe=E.value)==null?void 0:Pe.nodeId;if(!r)return;const l=(T=le(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",A=(l==null?void 0:l.kind)==="code"&&l.lang||"",w=A?"```"+A+`
130
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?w+f+(f.endsWith("```")?"":"\n```"):w+"// 你的代码"+"\n```");if(M===null)return;const W=M.trim();if(!W){Ae(r,null);return}const te=/^```([^\s`]*)/.exec(W),me=te?te[1]:void 0;Ae(r,{kind:"code",raw:W,lang:me})}function Ki(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&Ae(r,null)}function He(){var M,W;const r=(M=E.value)==null?void 0:M.nodeId;if(!r)return;const l=(W=le(m.value,r))==null?void 0:W.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",w=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
133
131
  | --- | --- | --- |
134
- | a | b | c |`);if(N===null)return;const D=N.trim();if(!D){xe(i,null);return}xe(i,{kind:"table",raw:D})}function pn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function rr(i){r.previewMode||(r.builtInDrawers&&(gt(),it.value=!0,Se.value++),l("edit-note",i))}function ir(i,a=60){const m=i.replace(/\s+/g," ").trim();return m.length<=a?m||"点击编辑笔记":m.slice(0,a)+"…"}function Yn(i){var N;if(r.previewMode||s.value)return;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const m=g.value;if(!m)return;const v=(N=i.clipboardData)==null?void 0:N.items;if(v)for(let D=0;D<v.length;D++){const M=v[D];if(M.kind==="file"&&M.type.startsWith("image/")){const j=M.getAsFile();if(!j)continue;i.preventDefault();const ne=re(f.value,m);if(ne!=null&&ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;F(j,me=>J(m,me));return}}}e.onMounted(()=>{window.addEventListener("paste",Yn),window.addEventListener("keydown",yo),pe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Yn),window.removeEventListener("keydown",yo)});function yo(i){if((i.metaKey||i.ctrlKey)&&(i.key==="f"||i.key==="F")){const m=i.target;if(m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable))return;i.preventDefault(),l("canvas-outline")}}const gn=e.ref(null),Kr=e.computed(()=>{var i;return((i=gn.value)==null?void 0:i.nodeId)??null});function Et(i,a){if(!a.image)return;i.preventDefault(),i.stopPropagation();const m=a.image.naturalW||a.image.width,v=a.image.naturalH||a.image.height,N=v>0?v/m:1;gn.value={nodeId:a.id,startX:i.clientX,startY:i.clientY,startW:a.image.width,startH:a.image.height,naturalW:m,naturalH:v,ratio:N,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",qt),window.addEventListener("mouseup",Eo)}function qt(i){var ne,me;const a=gn.value;if(!a)return;const m=oe.scale.value||1,v=i.clientX-a.startX,N=U(a.startW+v/m,_n,Gn),D=U(N*a.ratio,_n,Gn);a.pendingW=N,a.pendingH=D;const M=(ne=c.value)==null?void 0:ne.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);M&&(M.style.width=`${N}px`,M.style.height=`${D}px`);const j=(me=c.value)==null?void 0:me.querySelector(`[data-node-id="${a.nodeId}"]`);j&&(j.style.minWidth=`${Math.max(80,Math.ceil(N+28))}px`,j.style.height=`${Math.ceil(D+8+30)}px`)}function Eo(){const i=gn.value;if(window.removeEventListener("mousemove",qt),window.removeEventListener("mouseup",Eo),gn.value=null,!i)return;const a=re(f.value,i.nodeId);!a||!a.image||(J(i.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=new Set([i.nodeId]),lt(),Rn=!0)}const qn=e.ref(null);let Rn=!1;function Xn(i){qn.value=i}function hn(i){qn.value===i&&(qn.value=null),z.value&&(z.value=null)}function Zn(i,a){var wt;if(!a.text||a.text.length<14)return;const v=i.currentTarget.getBoundingClientRect(),N=(wt=c.value)==null?void 0:wt.getBoundingClientRect();if(!N)return;const D=10,M=240,j=v.top-N.top>60,ne=v.left-N.left+v.width/2,me=D+M/2,Ve=N.width-M/2-D,T=Math.max(me,Math.min(ne,Ve)),Ke=j?v.top-N.top-8:v.bottom-N.top+8;z.value={text:a.text,x:T,y:Ke,above:j}}const xt=e.ref(0),Jn=e.ref(!1),$t=ts(100);function Me(){$t.record({data:f.value,selectedIds:[...d.value]})}function pe(){h.value=new Set(h.value),xt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>lr()).then(()=>{xt.value++})}function lr(){const i=document.querySelectorAll(".zm-rich"),a={},m={};i.forEach(v=>{let N=v,D=null;for(;N&&!D;)D=N.getAttribute("data-node-id"),N=N.parentElement;if(!D)return;const M=v.offsetHeight,j=v.scrollWidth,ne=Math.round(M*2)/2,me=Math.round(j*2)/2;a[D]=ne,m[D]=me,R.value[D],E.value[D]}),R.value=a,E.value=m}const tt=e.computed(()=>{var i,a,m,v,N,D,M,j,ne,me;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((m=r.theme)==null?void 0:m.branchBg)??"#ffffff",branchText:((v=r.theme)==null?void 0:v.branchText)??"#1f2937",lineColor:((N=r.theme)==null?void 0:N.lineColor)??"#94a3b8",bgColor:((D=r.theme)==null?void 0:D.bgColor)??"#f8fafc",fontSize:((M=r.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((j=r.theme)==null?void 0:j.lineWidthStart)??2.2,lineWidthEnd:((ne=r.theme)==null?void 0:ne.lineWidthEnd)??.8,rainbowBranch:((me=r.theme)==null?void 0:me.rainbowBranch)??!1}}),Xt=e.computed(()=>B.canvasBg||tt.value.bgColor),B=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function b(i){return B.taperedEdge?W(i):we(i)}function O(i){return B.taperedEdge?B.lineWidthEnd:we(i)}function W(i){return i<=0?B.lineWidthStart:i===1?Math.max(1.5,B.lineWidthStart*.67):i===2?Math.max(.8,B.lineWidthStart*.42):B.lineWidthEnd}function we(i){if(i<=0)return B.lineWidthStart;if(i>=3)return B.lineWidthEnd;const a=i/3;return B.lineWidthStart+(B.lineWidthEnd-B.lineWidthStart)*a}function fe(i,a,m,v){const N=1-i,D=N*N*N*a.x+3*N*N*i*m.x1+3*N*i*i*m.x2+i*i*i*v.x,M=N*N*N*a.y+3*N*N*i*m.y1+3*N*i*i*m.y2+i*i*i*v.y;return{x:D,y:M}}function Ce(i,a,m,v,N=32,D="curve",M="right"){if(D==="curve"){let yt;if(M==="right"||M==="left"){const Ie=Math.abs(a.x-i.x)*.45,Wt=M==="right"?1:-1;yt={x1:i.x+Wt*Ie,y1:i.y,x2:a.x-Wt*Ie,y2:a.y}}else{const Ie=Math.abs(a.y-i.y)*.45;yt={x1:i.x,y1:i.y+Ie,x2:a.x,y2:a.y-Ie}}const Zt=ke=>{const Ie=1-ke,Wt=-3*Ie*Ie*i.x+3*(Ie*Ie-2*Ie*ke)*yt.x1+3*(2*Ie*ke-ke*ke)*yt.x2+3*ke*ke*a.x,an=-3*Ie*Ie*i.y+3*(Ie*Ie-2*Ie*ke)*yt.y1+3*(2*Ie*ke-ke*ke)*yt.y2+3*ke*ke*a.y;return{dx:Wt,dy:an}},Ut=[],bn=[];for(let ke=0;ke<=N;ke++){const Ie=ke/N,Wt=ke===0?i:ke===N?a:fe(Ie,i,yt,a),an=Zt(Ie);let no=Math.hypot(an.dx,an.dy);no<1e-6&&(no=1);const Nt=-an.dy/no,Ye=an.dx/no,qe=(m+(v-m)*Ie)/2;Ut.push({x:Wt.x+Nt*qe,y:Wt.y+Ye*qe}),bn.push({x:Wt.x-Nt*qe,y:Wt.y-Ye*qe})}let Ht=`M ${Ut[0].x.toFixed(2)} ${Ut[0].y.toFixed(2)}`;for(let ke=1;ke<=N;ke++)Ht+=` L ${Ut[ke].x.toFixed(2)} ${Ut[ke].y.toFixed(2)}`;for(let ke=N;ke>=0;ke--)Ht+=` L ${bn[ke].x.toFixed(2)} ${bn[ke].y.toFixed(2)}`;return Ht+=" Z",Ht}const j=a.x-i.x,ne=a.y-i.y;let me=Math.hypot(j,ne);me<1e-6&&(me=1);const Ve=-ne/me,T=j/me,Ke=m/2,wt=v/2,de={x:i.x+Ve*Ke,y:i.y+T*Ke},mt={x:i.x-Ve*Ke,y:i.y-T*Ke},ln={x:a.x-Ve*wt,y:a.y-T*wt},at={x:a.x+Ve*wt,y:a.y+T*wt};return`M ${de.x.toFixed(2)} ${de.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${ln.x.toFixed(2)} ${ln.y.toFixed(2)} L ${mt.x.toFixed(2)} ${mt.y.toFixed(2)} Z`}const Le=e.computed(()=>ft.value.root.children),bt=en[0].colors,kt=e.computed(()=>Pa(B.branchPaletteId,B.customPalettes)),Pt=e.computed(()=>{const i=new Map;if(!B.rainbowBranch)return i;const a=r.lineColors,m=a&&a.length>0?a:kt.value.colors.length>0?kt.value.colors:bt;for(let N=0;N<Le.value.length;N++){const D=Le.value[N];i.set(D.id,m[N%m.length])}const v=(N,D)=>{i.set(N.id,D);for(const M of N.children)v(M,D)};for(let N=0;N<Le.value.length;N++){const D=Le.value[N];v(D,m[N%m.length])}return i});function He(i,a){return B.rainbowBranch?Pt.value.get(a.id)??tt.value.lineColor:tt.value.lineColor}function xo(i){const a=te(i.id);if(a.bg)return a.bg;if(i.isRoot)return tt.value.rootBg;if(B.rainbowBranch){const m=Pt.value.get(i.id);if(m)return Ip(m,.18)}return tt.value.branchBg}function nn(i){const a=te(i.id);if(a.textColor)return a.textColor;if(i.isRoot)return tt.value.rootText;if(B.rainbowBranch){const m=Pt.value.get(i.id);if(m)return Yl(m,.55)}return tt.value.branchText}function Qn(i){const a=te(i.id);if(a.borderColor)return a.borderColor;if(i.isRoot)return tt.value.rootBg;if(B.rainbowBranch){const m=Pt.value.get(i.id);if(m)return Yl(m,.3)}return tt.value.lineColor}function jl(i){const a=te(i.id);return a.fontWeight?a.fontWeight:i.isRoot?700:i.depth<=1?600:i.depth===2?500:400}function Kl(i){return te(i.id).fontSize??i.fontSize??tt.value.fontSize}function Ip(i,a){const m=i.replace("#",""),v=m.length===6?m:m.split("").map(j=>j+j).join(""),N=parseInt(v.slice(0,2),16),D=parseInt(v.slice(2,4),16),M=parseInt(v.slice(4,6),16);return`rgba(${N}, ${D}, ${M}, ${a})`}function Yl(i,a){const m=i.replace("#",""),v=m.length===6?m:m.split("").map(j=>j+j).join(""),N=Math.round(parseInt(v.slice(0,2),16)*(1-a)),D=Math.round(parseInt(v.slice(2,4),16)*(1-a)),M=Math.round(parseInt(v.slice(4,6),16)*(1-a));return`rgb(${N}, ${D}, ${M})`}const oe=Ja({getContainer:()=>c.value});oe.setOnMarqueeEnd(Qp),es({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>f.value.id,onAddChild:to,onAddSibling:ar,onAddSiblingBefore:Wp,onRemove:la,onStartEdit:wo,onClearSelection:()=>{d.value=new Set,lt()},onDuplicate:ea,onCopy:oa,onCut:ra,onPaste:ia,hasClipboard:()=>!!P.value&&P.value.nodes.length>0,onUndo:qr,onRedo:Xr,onNavigate:Gp,onSelectRoot:()=>{d.value=new Set([f.value.id]),lt()}});const ft=e.computed(()=>{const i=_t(f.value);return Zl(i),La(i,{mode:B.layoutMode,baseFontSize:tt.value.fontSize,richHeights:R.value,richWidths:E.value})}),ql=e.ref([]),eo=e.computed(()=>(xt.value,ql.value));e.watch(ft,i=>{const a=[],m=v=>{a.push(v);for(const N of v.children)m(N)};m(i.root),ql.value=a},{immediate:!0});const Xl=e.computed(()=>{const i=[];for(const a of eo.value)for(const m of a.children)i.push({from:a,to:m,key:`${a.id}->${m.id}`});return i}),zp=e.computed(()=>`${ft.value.vbX} ${ft.value.vbY} ${ft.value.vbW} ${ft.value.vbH}`);function Zl(i){if(h.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const a of i.children)Zl(a)}function wo(i){const a=re(f.value,i);a&&(s.value=i,u.value=a.text,d.value=new Set([i]),lt(),e.nextTick(()=>{const m=document.querySelector(".zm-input");m==null||m.focus(),m==null||m.select(),Jl(m)}))}function Yr(){if(!s.value)return;const i=re(f.value,s.value);i&&i.text!==(u.value.trim()||" ")&&(i.text=u.value.trim()||" ",Me(),l("change",f.value)),s.value=null}function Op(){s.value=null}function Jl(i){i&&(i.style.height="auto",i.style.height=i.scrollHeight+"px")}function Lp(i){Jl(i.target)}function Dp(i){if(r.previewMode)return;const a=re(f.value,i);a!=null&&a.richContent&&(C.value=i,x.value=a.richContent.raw,e.nextTick(()=>{const m=document.querySelector(".zm-node .zm-rich textarea");m==null||m.focus()}))}function Ql(){if(!C.value)return;const i=C.value,a=re(f.value,i),m=x.value;if(a&&a.richContent&&a.richContent.raw!==m)if(a.richContent.kind==="code"){const v=Nn(m)||void 0;xe(i,{kind:"code",raw:m,lang:v})}else xe(i,{kind:"table",raw:m});C.value=null}function Vp(){C.value=null}function $p(i){i.key==="Escape"?(i.preventDefault(),Vp()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),Ql())}function Pp(i,a){const m=k.value.get(i);!m||m.col!==a?k.value.set(i,{col:a,dir:"asc"}):m.dir==="asc"?k.value.set(i,{col:a,dir:"desc"}):k.value.delete(i)}function Fp(i,a){const m=k.value.get(i);return!m||a.length<=1?a:cl(a,m.col,m.dir)}function Up(i,a){const m=k.value.get(i);return!m||m.col!==a?"↕":m.dir==="asc"?"▲":"▼"}function Hp(i){const a=i.metaKey||i.ctrlKey;a&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),qr()):(a&&i.shiftKey&&(i.key==="z"||i.key==="Z")||a&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Xr())}function to(i){const a=bi(f.value,i,Ro);a&&(Me(),pe(),l("change",f.value),e.nextTick(()=>wo(a.id)))}function ar(i){if(i===f.value.id){to(i);return}const a=ki(f.value,i,Ro);a&&(Me(),pe(),l("change",f.value),e.nextTick(()=>wo(a.id)))}function Wp(i){if(i===f.value.id){to(i);return}const a=Ka(f.value,i,Ro);a&&(Me(),pe(),l("change",f.value),e.nextTick(()=>wo(a.id)))}function ea(i){if(i===f.value.id)return;const a=Ya(f.value,i);a&&(Me(),d.value=new Set([a.id]),lt(),l("change",f.value),pe())}function ta(i){const a=[],m=new Set;for(const v of i)v!==f.value.id&&(m.has(v)||re(f.value,v)&&(m.add(v),a.push(v)));return a}function na(i){const a=new Set(i),m=[],v=N=>{a.has(N.id)&&m.push(N.id);for(const D of N.children)v(D)};return v(f.value),m}function oa(i){const a=na(ta(i));if(a.length===0)return;const m=[];for(const v of a){const N=yi(f.value,v);N&&m.push(N)}m.length!==0&&(P.value={nodes:m,originalIds:new Set(a)},pe())}function ra(i){const a=na(ta(i));if(a.length===0)return;const m=[];for(const v of a){const N=yi(f.value,v);N&&m.push(N)}if(m.length!==0){Me();for(const v of a)Mo(f.value,v);d.value=new Set,lt(),P.value={nodes:m,originalIds:new Set(a)},pe(),l("change",f.value)}}function ia(i){const a=P.value;if(!a||a.nodes.length===0)return;const m=i??f.value.id,v=re(f.value,m);if(v){for(const N of a.originalIds){const D=re(f.value,N);if(D&&re(D,m))return}Me();for(const N of a.nodes){const D=_t(N);vo(D),v.children.push(D)}P.value=null,pe(),l("change",f.value)}}function qr(){const i=$t.undo();i&&(f.value=i.data,d.value=new Set(i.selectedIds??[]),lt(),pe(),l("change",f.value))}function Xr(){const i=$t.redo();i&&(f.value=i.data,d.value=new Set(i.selectedIds??[]),lt(),pe(),l("change",f.value))}function lt(){const i=[];for(const a of d.value){const m=re(f.value,a);m&&i.push(m)}if(r.builtInDrawers&&!r.previewMode&&i.length>0){const a=i[0];!it.value&&pa(a.id)&&(gt(),it.value=!0)}else r.builtInDrawers&&i.length===0&&(it.value=!1);l("select",i.length>0?i:null)}function Gp(i,a){const m=g.value??f.value.id,v=re(f.value,m);if(!v)return;let N=null;if(a===1){const D=Lt(f.value,v.id);if(D){const M=D.children.findIndex(j=>j.id===v.id);M>=0&&M<D.children.length-1&&(N=D.children[M+1].id)}}else if(a===-1){const D=Lt(f.value,v.id);if(D){const M=D.children.findIndex(j=>j.id===v.id);M>0&&(N=D.children[M-1].id)}}else if(i===1){const D=Lt(f.value,v.id);D&&(N=D.id)}else i===-1&&v.children.length>0&&(N=v.children[0].id);N&&(d.value=new Set([N]),lt())}function la(i){if(i!==f.value.id&&Mo(f.value,i)){if(Me(),d.value.has(i)){const a=new Set(d.value);a.delete(i),d.value=a,lt()}pe(),l("change",f.value)}}function aa(i){h.value.has(i)?h.value.delete(i):h.value.add(i),pe()}function sa(i){const a=[{n:f.value,depth:1}];for(;a.length;){const{n:m,depth:v}=a.pop();i(m,v);for(let N=m.children.length-1;N>=0;N--)a.push({n:m.children[N],depth:v+1})}}function jp(){h.value=new Set,sa(i=>{i.children.length>0&&h.value.add(i.id)}),pe()}function ca(i){h.value=new Set,sa((a,m)=>{m>i&&a.children.length>0&&h.value.add(a.id)}),pe()}function Kp(){h.value=new Set,pe()}function da(i,a){Ga(f.value,i,a)&&(Me(),pe(),l("change",f.value))}function Zr(i,a,m){return ja(f.value,i,a,m)?(Me(),pe(),l("change",f.value),!0):!1}function Yp(i,a){if(i.stopPropagation(),i.shiftKey){const m=new Set(d.value);m.has(a.id)?m.delete(a.id):m.add(a.id),d.value=m}else d.value=new Set([a.id]);lt()}function qp(i,a,m){let v=null;for(const N of eo.value){if(N.id===m)continue;const D=N.width/2,M=N.height/2;i>=N.x-D&&i<=N.x+D&&a>=N.y-M&&a<=N.y+M&&(v=N)}return v}let Ft=null;function Xp(i,a){if(r.previewMode||a.isRoot||i.button!==0)return;const m=i.target;if(m!=null&&m.closest(".zm-img-resize-handle"))return;i.stopPropagation();const v=c.value.getBoundingClientRect(),N=a.x*oe.scale.value+oe.offsetX.value,D=a.y*oe.scale.value+oe.offsetY.value,M=i.clientX-v.left-N,j=i.clientY-v.top-D;Ft={srcId:a.id,srcText:a.text,pointerOffsetX:M,pointerOffsetY:j,startX:i.clientX,startY:i.clientY},window.addEventListener("pointermove",ua),window.addEventListener("pointerup",sr),window.addEventListener("pointercancel",sr)}function ua(i){if(Ft){const M=i.clientX-Ft.startX,j=i.clientY-Ft.startY;if(Math.abs(M)<=Wl&&Math.abs(j)<=Wl)return;S.value={srcId:Ft.srcId,srcText:Ft.srcText,pointerOffsetX:Ft.pointerOffsetX,pointerOffsetY:Ft.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Ft=null}const a=S.value;if(!a)return;const m=c.value.getBoundingClientRect();$.value=i.clientX-m.left-a.pointerOffsetX,_.value=i.clientY-m.top-a.pointerOffsetY;const v=(i.clientX-m.left-oe.offsetX.value)/oe.scale.value,N=(i.clientY-m.top-oe.offsetY.value)/oe.scale.value,D=qp(v,N,a.srcId);a.currentTargetId=(D==null?void 0:D.id)??null}function sr(i){if(window.removeEventListener("pointermove",ua),window.removeEventListener("pointerup",sr),window.removeEventListener("pointercancel",sr),Ft){Ft=null;return}const a=S.value;a&&(a.currentTargetId&&(Zr(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),lt()),S.value=null,$.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let cr=!1;function Zp(i){const a=i.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){cr=!0,oe.startPan(i);return}if(cr=!1,i.button!==0)return;const m=c.value.getBoundingClientRect(),v=(i.clientX-m.left-oe.offsetX.value)/oe.scale.value,N=(i.clientY-m.top-oe.offsetY.value)/oe.scale.value;oe.startMarquee(v,N,{shift:i.shiftKey})}function Jp(i){if(Rn){Rn=!1;return}const a=i.target;if(!a||a.closest(".zm-node"))return;const m=oe.marquee;m.width>=4||m.height>=4||d.value.size>0&&(d.value=new Set,lt())}function Qp(){const i=oe.marquee;if(i.width<4&&i.height<4)return;const a=i.x,m=i.y,v=i.x+i.width,N=i.y+i.height,D=[];for(const M of eo.value){const j=M.width/2,ne=M.height/2,me=M.x-j,Ve=M.x+j,T=M.y-ne,Ke=M.y+ne;me<=v&&Ve>=a&&T<=N&&Ke>=m&&D.push(M.id)}d.value=i.shiftKey?new Set([...d.value,...D]):new Set(D),lt()}function fa(i){return h.value.has(i)}function eg(i){const a=re(f.value,i.id);return!!a&&a.children.length>0}function Jr(i){const a=re(f.value,i);return a?a.children.length:0}function ma(i){if(!re(f.value,i))return 0;const v=[f.value];for(;v.length;){const N=v.pop(),D=N.children.findIndex(M=>M.id===i);if(D>=0)return D;for(const M of N.children)v.push(M)}return 0}function dr(i,a,m,v){if(((v==null?void 0:v._dir)??i._dir)==="down")return a==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let D;a==="in"?D=-i.side:m!==void 0?D=m:D=i.side;const M=a==="in"?i._richInsetX??0:0;return{x:i.x+D*(i.width/2-M),y:i.y}}function on(){const i=ft.value;oe.resetView(i.width,i.height,i.root.y)}function tg(){Jn.value=!0,Me(),pe(),e.nextTick(()=>on())}function Qr(i){B.layoutMode!==i&&(B.layoutMode=i,pe(),e.nextTick(()=>on()))}function ng(){return JSON.stringify(f.value,null,2)}function pa(i){const a=re(f.value,i);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function og(i){try{const a=JSON.parse(i);return!a.id||!Array.isArray(a.children)?!1:($t.reset(),f.value=_t(a),d.value=new Set,h.value=new Set,pe(),e.nextTick(()=>on()),l("change",f.value),!0)}catch{return!1}}const ga=e.ref(""),rn=e.ref([]),No=e.ref(-1);function rg(i){ga.value=i;const a=i.trim();if(!a){rn.value=[],No.value=-1;return}const m=a.toLowerCase(),v=[],N=D=>{var M;(D.text.toLowerCase().includes(m)||(M=D.note)!=null&&M.text&&D.note.text.toLowerCase().includes(m))&&v.push(D.id);for(const j of D.children)N(j)};N(f.value),rn.value=v,No.value=v.length>0?0:-1,v.length>0&&(sg(v),e.nextTick(()=>cg(0)))}function ig(i){return rn.value.includes(i)}function lg(i){return No.value>=0&&rn.value[No.value]===i}function ag(i){return ga.value.trim().length>0&&rn.value.length>0&&!rn.value.includes(i)}function sg(i){if(i.length===0)return;const a=new Set(i),m=new Set,v=N=>{let D=a.has(N.id);for(const M of N.children)v(M)&&(D=!0);return D&&N.children.length>0&&h.value.has(N.id)&&m.add(N.id),D};if(v(f.value),m.size>0){for(const N of m)h.value.delete(N);pe()}}function cg(i){const a=rn.value[i];if(!a)return;const m=eo.value.find(v=>v.id===a);m&&(d.value=new Set([a]),lt(),oe.centerOn(m.x,m.y,m.width,m.height))}function dg(i,a){const m=re(f.value,i);m&&(m.markers||(m.markers=[]),!m.markers.includes(a)&&(m.markers.push(a),Me(),pe(),l("change",f.value)))}function ug(i,a){const m=re(f.value,i);if(!m||!m.markers)return;const v=m.markers.indexOf(a);v<0||(m.markers.splice(v,1),m.markers.length===0&&delete m.markers,Me(),pe(),l("change",f.value))}function ha(i,a){const m=re(f.value,i);if(!m)return!1;m.markers||(m.markers=[]);const v=m.markers.indexOf(a);return v>=0?(m.markers.splice(v,1),m.markers.length===0&&delete m.markers,Me(),pe(),l("change",f.value),!1):(m.markers.push(a),Me(),pe(),l("change",f.value),!0)}function fg(i){const a=re(f.value,i);return a!=null&&a.markers?[...a.markers]:[]}function mg(i){var m;const a=(m=y.value)==null?void 0:m.nodeId;a&&ha(a,i)}function pg(){var m;const i=(m=y.value)==null?void 0:m.nodeId;if(!i)return;const a=re(f.value,i);!a||!a.markers||(delete a.markers,Me(),pe(),l("change",f.value),se())}function ei(i,a){const m=re(f.value,i);m&&(a.length===0?m.tags&&delete m.tags:m.tags=[...a],Me(),pe(),l("change",f.value))}function gg(i){const a=re(f.value,i);return a!=null&&a.tags?[...a.tags]:[]}function hg(){var D,M;const i=(D=y.value)==null?void 0:D.nodeId;if(!i)return;const a=re(f.value,i),m=((M=a==null?void 0:a.tags)==null?void 0:M.join(", "))??"",v=window.prompt("输入标签(多个用逗号分隔)",m);if(v===null)return;const N=v.split(/[,,]/).map(j=>j.trim()).filter(j=>j.length>0);ei(i,N),se()}function bg(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&(ei(i,[]),se())}function ba(){const i=ft.value,a="http://www.w3.org/2000/svg",m=document.createElementNS(a,"svg");m.setAttribute("xmlns",a),m.setAttribute("viewBox",`${i.vbX} ${i.vbY} ${i.vbW} ${i.vbH}`),m.setAttribute("width",String(i.vbW)),m.setAttribute("height",String(i.vbH));const v=document.createElementNS(a,"rect");v.setAttribute("x",String(i.vbX)),v.setAttribute("y",String(i.vbY)),v.setAttribute("width",String(i.vbW)),v.setAttribute("height",String(i.vbH)),v.setAttribute("fill",Xt.value),m.appendChild(v);for(const M of Xl.value){const j=document.createElementNS(a,"path");j.setAttribute("d",Ce(dr(M.from,"out",M.to.side,M.to),dr(M.to,"in"),b(M.from.depth),O(M.to.depth),32,B.lineStyle,M.to._dir)),j.setAttribute("fill",He(M.from,M.to)),j.setAttribute("stroke","none"),m.appendChild(j)}const N="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function D(M,j){let ne=0;for(const me of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(me)?ne+=j:ne+=j*.55;return ne}for(const M of eo.value){const j=M.x-M.width/2,ne=M.y-M.height/2,me=document.createElementNS(a,"rect");me.setAttribute("x",String(j)),me.setAttribute("y",String(ne)),me.setAttribute("width",String(M.width)),me.setAttribute("height",String(M.height)),me.setAttribute("rx","8"),me.setAttribute("fill",xo(M)),me.setAttribute("stroke",Qn(M)),me.setAttribute("stroke-width","1"),m.appendChild(me);const Ve=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Ke=!!M.image,wt=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let de=0,mt=0;if(wt){const Ye=M.richContent,qe=M.fontSize*.78*.92,Jt=6,De=4,kn=2,yn=6;if(Ye.kind==="code"){const St=Wo(Ye.raw),pt=Nn(Ye.raw),Tt=St.split(`
135
- `),Qt=qe*1.35;let zt=0;for(const Be of Tt)zt=Math.max(zt,D(Be,qe));mt=Math.min(zt+Jt*2+4,M.width-4),de=Tt.length*Qt+De*2+kn;const Xe=M.x-mt/2;let st=ne+4;Ke&&(st=ne+M.image.height+yn);const Ct=document.createElementNS(a,"rect");if(Ct.setAttribute("x",String(Xe)),Ct.setAttribute("y",String(st)),Ct.setAttribute("width",String(mt)),Ct.setAttribute("height",String(de-kn)),Ct.setAttribute("rx","6"),Ct.setAttribute("fill","rgba(255,255,255,0.55)"),Ct.setAttribute("stroke",Qn(M)),Ct.setAttribute("stroke-width","1"),m.appendChild(Ct),pt){const Be=document.createElementNS(a,"text");Be.setAttribute("x",String(Xe+mt-Jt)),Be.setAttribute("y",String(st+De+4)),Be.setAttribute("text-anchor","end"),Be.setAttribute("fill",nn(M)),Be.setAttribute("font-size",String(qe*.8)),Be.setAttribute("font-family",N),Be.setAttribute("opacity","0.5"),Be.textContent=pt,m.appendChild(Be)}const To="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Be=0;Be<Tt.length;Be++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Xe+Jt)),nt.setAttribute("y",String(st+De+(Be+.5)*Qt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",nn(M)),nt.setAttribute("font-size",String(qe)),nt.setAttribute("font-family",To);let Ot=Tt[Be];const Fe=Math.floor((mt-Jt*2)/(qe*.6));Ot.length>Fe&&(Ot=Ot.substring(0,Fe-1)+"…"),nt.textContent=Ot,m.appendChild(nt)}}else if(Ye.kind==="table"){const St=Cr(Ye.raw);if(St.length>0){const pt=qe*1.35,Tt=6,Qt=3,zt=St[0].length,Xe=[];for(let Fe=0;Fe<zt;Fe++){let sn=0;for(const En of St)Fe<En.length&&(sn=Math.max(sn,D(En[Fe],qe)));Xe.push(sn+Tt*2)}mt=Math.min(Xe.reduce((Fe,sn)=>Fe+sn,0),M.width-4);const st=mt/Xe.reduce((Fe,sn)=>Fe+sn,0);for(let Fe=0;Fe<zt;Fe++)Xe[Fe]*=st;de=St.length*(pt+Qt*2)+kn;const Ct=M.x-mt/2;let To=ne+4;Ke&&(To=ne+M.image.height+yn);const Be=document.createElementNS(a,"rect");Be.setAttribute("x",String(Ct)),Be.setAttribute("y",String(To)),Be.setAttribute("width",String(mt)),Be.setAttribute("height",String(de-kn)),Be.setAttribute("rx","6"),Be.setAttribute("fill","rgba(255,255,255,0.55)"),Be.setAttribute("stroke",Qn(M)),Be.setAttribute("stroke-width","1"),m.appendChild(Be);let nt=Ct,Ot=To;for(let Fe=0;Fe<St.length;Fe++){const sn=St[Fe],En=pt+Qt*2;nt=Ct;for(let Co=0;Co<zt;Co++){const oo=Xe[Co],kg=sn[Co]||"";if(Co<zt-1){const Ue=document.createElementNS(a,"line");Ue.setAttribute("x1",String(nt+oo)),Ue.setAttribute("y1",String(Ot)),Ue.setAttribute("x2",String(nt+oo)),Ue.setAttribute("y2",String(Ot+En)),Ue.setAttribute("stroke",Qn(M)),Ue.setAttribute("stroke-width","1"),m.appendChild(Ue)}if(Fe<St.length-1){const Ue=document.createElementNS(a,"line");Ue.setAttribute("x1",String(nt)),Ue.setAttribute("y1",String(Ot+En)),Ue.setAttribute("x2",String(nt+oo)),Ue.setAttribute("y2",String(Ot+En)),Ue.setAttribute("stroke",Qn(M)),Ue.setAttribute("stroke-width","1"),m.appendChild(Ue)}if(Fe===0){const Ue=document.createElementNS(a,"rect");Ue.setAttribute("x",String(nt)),Ue.setAttribute("y",String(Ot)),Ue.setAttribute("width",String(oo)),Ue.setAttribute("height",String(En)),Ue.setAttribute("fill","rgba(255,255,255,0.4)"),m.appendChild(Ue)}const cn=document.createElementNS(a,"text");cn.setAttribute("x",String(nt+Tt)),cn.setAttribute("y",String(Ot+Qt+pt/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",nn(M)),cn.setAttribute("font-size",String(qe)),cn.setAttribute("font-family",N),Fe===0&&cn.setAttribute("font-weight","600");let ur=kg;const ti=Math.floor((oo-Tt*2)/(qe*.55));ur.length>ti&&ti>2&&(ur=ur.substring(0,ti-1)+"…"),cn.textContent=ur,m.appendChild(cn),nt+=oo}Ot+=En}}}}let ln=0;if(Ke){const Ye=M.image,qe=ne+4,Jt=M.x-Ye.width/2,De=document.createElementNS(a,"image");De.setAttribute("x",String(Jt)),De.setAttribute("y",String(qe)),De.setAttribute("width",String(Ye.width)),De.setAttribute("height",String(Ye.height)),De.setAttribute("href",Ye.src),De.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),De.setAttribute("preserveAspectRatio","xMidYMid meet"),m.appendChild(De),ln=Ye.height+6}let at=M.y;const yt=ln+de;yt>0?at=ne+yt+(M.height-yt)/2:Ve&&(at=M.y-8);const Zt=14,Ut=2,bn=4,Ht=T?M.markers.length:0,ke=Ht>0?Ht*Zt+(Ht-1)*Ut+bn:0,Ie=D(M.text,M.fontSize),Wt=ke+Ie,an=M.x-Wt/2;if(T){let Ye=an;for(const qe of M.markers){const Jt=Io(qe);if(Jt){const De=document.createElementNS(a,"svg");De.setAttribute("x",String(Ye)),De.setAttribute("y",String(at-Zt/2)),De.setAttribute("width",String(Zt)),De.setAttribute("height",String(Zt)),De.setAttribute("viewBox","0 0 24 24"),De.setAttribute("color",nn(M));const yn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Jt}</svg>`,"image/svg+xml");if(!yn.querySelector("parsererror"))for(;yn.documentElement.firstChild;)De.appendChild(yn.documentElement.firstChild);m.appendChild(De)}Ye+=Zt+Ut}}const no=T?an+ke+Ie/2:M.x,Nt=document.createElementNS(a,"text");if(Nt.setAttribute("x",String(no)),Nt.setAttribute("y",String(at)),Nt.setAttribute("text-anchor","middle"),Nt.setAttribute("dominant-baseline","central"),Nt.setAttribute("fill",nn(M)),Nt.setAttribute("font-size",String(Kl(M))),Nt.setAttribute("font-weight",String(jl(M))),Nt.setAttribute("font-family",N),Nt.textContent=M.text,m.appendChild(Nt),Ve){const De=M.y+10,kn=M.tags.map(pt=>D(pt,10)+12),yn=kn.reduce((pt,Tt)=>pt+Tt+3,-3);let St=M.x-yn/2;for(let pt=0;pt<M.tags.length;pt++){const Tt=M.tags[pt],Qt=gr(Tt),zt=kn[pt],Xe=document.createElementNS(a,"rect");Xe.setAttribute("x",String(St)),Xe.setAttribute("y",String(De-16/2)),Xe.setAttribute("width",String(zt)),Xe.setAttribute("height",String(16)),Xe.setAttribute("rx",String(16/2)),Xe.setAttribute("fill",Qt.background),Xe.setAttribute("stroke",Qt.borderColor),Xe.setAttribute("stroke-width","1"),m.appendChild(Xe);const st=document.createElementNS(a,"text");st.setAttribute("x",String(St+zt/2)),st.setAttribute("y",String(De)),st.setAttribute("text-anchor","middle"),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",Qt.color),st.setAttribute("font-size",String(10)),st.setAttribute("font-family",N),st.textContent=Tt,m.appendChild(st),St+=zt+3}}}return m}function So(){const i=ba();let m=new XMLSerializer().serializeToString(i);m.startsWith("<?xml")||(m=`<?xml version="1.0" encoding="UTF-8"?>
136
- `+m);const v=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),N=URL.createObjectURL(v),D=document.createElement("a");D.href=N,D.download=`${f.value.text||"mindmap"}.svg`,D.click(),URL.revokeObjectURL(N)}function ka(i=2){const a=ba(),m=ft.value;let N=new XMLSerializer().serializeToString(a);N.startsWith("<?xml")||(N=`<?xml version="1.0" encoding="UTF-8"?>
137
- `+N);const D=new Blob([N],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(D),j=new window.Image;j.onload=()=>{const ne=document.createElement("canvas");ne.width=Math.ceil(m.vbW*i),ne.height=Math.ceil(m.vbH*i);const me=ne.getContext("2d");if(!me){URL.revokeObjectURL(M);return}me.fillStyle=Xt.value,me.fillRect(0,0,ne.width,ne.height),me.drawImage(j,0,0,ne.width,ne.height),URL.revokeObjectURL(M);try{ne.toBlob(Ve=>{if(!Ve){So();return}const T=URL.createObjectURL(Ve),Ke=document.createElement("a");Ke.href=T,Ke.download=`${f.value.text||"mindmap"}.png`,Ke.click(),URL.revokeObjectURL(T)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),So()}},j.onerror=()=>{URL.revokeObjectURL(M),So()},j.src=M}return o({addChild:i=>to(i),addSibling:i=>ar(i),removeNode:i=>la(i),duplicateNode:i=>ea(i),setNodeText:(i,a)=>da(i,a),moveNode:(i,a,m)=>Zr(i,a,m),lineWidthForDepth:b,endWidthForDepth:O,getData:()=>f.value,nodeHasContent:i=>pa(i),getSelectedIds:()=>[...d.value],copyNodes:i=>oa(i),cutNodes:i=>ra(i),pasteNodes:i=>ia(i),setData:i=>{$t.reset(),f.value=_t(i),d.value=new Set,h.value=new Set,pe(),Me(),e.nextTick(()=>on())},resetView:()=>on(),exportData:ng,importData:og,getMarkdown:()=>On(f.value),setMarkdown:(i,a=!0)=>{const m=zn(i||"");a&&(Y.value=!0),K=!a,$t.reset(),f.value=_t(m),d.value=new Set,h.value=new Set,pe(),Me(),e.nextTick(()=>{K=!1,on()}),l("change",f.value)},setBalanced:i=>{Jn.value=i},isBalanced:()=>Jn.value,balance:()=>tg(),applyNodeStyle:(i,a)=>X(i,a),getNodeStyle:i=>te(i),applyNodeImage:(i,a)=>J(i,a),applyNodeImageByUrl:(i,a)=>A(i,a),removeNodeImage:i=>I(i),applyNodeLink:(i,a)=>le(i,a),removeNodeLink:i=>Ne(i),applyNodeNote:(i,a)=>_e(i,a),removeNodeNote:i=>Re(i),applyNodeRichContent:(i,a)=>xe(i,a),addNodeMarker:(i,a)=>dg(i,a),removeNodeMarker:(i,a)=>ug(i,a),toggleNodeMarker:(i,a)=>ha(i,a),getNodeMarkers:i=>fg(i),setNodeTags:(i,a)=>ei(i,a),getNodeTags:i=>gg(i),exportPNG:i=>ka(i),exportSVG:()=>So(),searchNodes:i=>(rg(i),[...rn.value]),undo:()=>qr(),redo:()=>Xr(),canUndo:()=>$t.canUndo(),canRedo:()=>$t.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(B.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(B.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(B.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(B.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(B.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(B.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(B.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(B.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(B.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(B.canvasBg=i.canvasBg)},getSettings:()=>({autoBalanceOnChange:B.autoBalanceOnChange,lineWidthStart:B.lineWidthStart,lineWidthEnd:B.lineWidthEnd,rainbowBranch:B.rainbowBranch,branchPaletteId:B.branchPaletteId,customPalettes:B.customPalettes,lineStyle:B.lineStyle,layoutMode:B.layoutMode,taperedEdge:B.taperedEdge,showOrderBadge:B.showOrderBadge,canvasBg:B.canvasBg}),setBranchPalette:i=>{if(!i)return;[...en,...B.customPalettes].find(m=>m.id===i)&&(B.branchPaletteId=i)},getBranchPalette:()=>B.branchPaletteId,getBranchPalettes:()=>[...en,...B.customPalettes],getSearchResults:()=>[...rn.value],getSearchIndex:()=>No.value}),e.watch(()=>r.data,i=>{f.value=_t(i),pe()},{deep:!1}),e.onMounted(()=>{Me(),e.nextTick(()=>on())}),(i,a)=>{var m,v,N,D,M,j,ne,me,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Xt.value,fontSize:tt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Zp,onContextmenu:ge,onWheel:a[25]||(a[25]=(...T)=>e.unref(oe).onWheel&&e.unref(oe).onWheel(...T)),onMouseenter:a[26]||(a[26]=T=>w.value=!0),onMouseleave:a[27]||(a[27]=T=>w.value=!1),onClick:Jp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ft.value.vbX*e.unref(oe).scale.value+e.unref(oe).offsetX.value+"px",top:ft.value.vbY*e.unref(oe).scale.value+e.unref(oe).offsetY.value+"px",width:ft.value.vbW*e.unref(oe).scale.value+"px",height:ft.value.vbH*e.unref(oe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:zp.value,preserveAspectRatio:"xMinYMin meet",width:ft.value.vbW*e.unref(oe).scale.value,height:ft.value.vbH*e.unref(oe).scale.value},[e.createElementVNode("g",np,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Ce(dr(T.from,"out",T.to.side,T.to),dr(T.to,"in"),b(T.from.depth),O(T.to.depth),32,B.lineStyle,T.to._dir),fill:He(T.from,T.to),stroke:"none"},null,8,op))),128))])],8,tp))],4),e.unref(oe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(oe).marquee.x*e.unref(oe).scale.value+e.unref(oe).offsetX.value+"px",top:e.unref(oe).marquee.y*e.unref(oe).scale.value+e.unref(oe).offsetY.value+"px",width:e.unref(oe).marquee.width*e.unref(oe).scale.value+"px",height:e.unref(oe).marquee.height*e.unref(oe).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:_.value+"px",transform:`scale(${e.unref(oe).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(S.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(oe).offsetX.value}px, ${e.unref(oe).offsetY.value}px) scale(${e.unref(oe).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(eo.value,T=>{var Ke,wt;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Kr.value===T.id,"is-dragging-source":((Ke=S.value)==null?void 0:Ke.srcId)===T.id,"is-drop-target":((wt=S.value)==null?void 0:wt.currentTargetId)===T.id,"is-search-hit":ig(T.id),"is-search-current":lg(T.id),"is-search-dimmed":ag(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:Kl(T)+"px",background:xo(T),color:nn(T),borderColor:Qn(T),fontWeight:jl(T),transform:"translate(-50%, -50%)"}),onClick:de=>Yp(de,T),onPointerdown:de=>Xp(de,T),onDblclick:de=>{de.stopPropagation(),t.previewMode||wo(T.id)},onContextmenu:de=>q(de,T),onMouseenter:de=>{Xn(T.id),Zn(de,T)},onMouseleave:de=>hn(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,ip)):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:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(de=>Dp(T.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[C.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=de=>x.value=de),class:"zm-rich-edit",spellcheck:"false",onBlur:Ql,onKeydown:$p},null,544)),[[e.vModelText,x.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ap,[e.createElementVNode("code",{innerHTML:e.unref(Tr)(e.unref(Wo)(T.richContent.raw),e.unref(Nn)(T.richContent.raw))},null,8,sp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",cp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fp(T.id,e.unref(Cr)(T.richContent.raw)),(de,mt)=>(e.openBlock(),e.createElementBlock("tr",{key:mt},[mt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(de,(ln,at)=>{var yt,Zt,Ut,bn,Ht;return e.openBlock(),e.createElementBlock("th",{key:`h${at}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((yt=k.value.get(T.id))==null?void 0:yt.col)===at,"is-asc":((Zt=k.value.get(T.id))==null?void 0:Zt.col)===at&&((Ut=k.value.get(T.id))==null?void 0:Ut.dir)==="asc","is-desc":((bn=k.value.get(T.id))==null?void 0:bn.col)===at&&((Ht=k.value.get(T.id))==null?void 0:Ht.dir)==="desc"}]),onClick:e.withModifiers(ke=>Pp(T.id,at),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(ln),1),e.createElementVNode("span",up,e.toDisplayString(Up(T.id,at)),1)],10,dp)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(de,(ln,at)=>(e.openBlock(),e.createElementBlock("td",{key:`c${at}`},e.toDisplayString(ln),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,lp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",fp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-marker",title:e.unref(xi)(de),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Io)(de)+"</svg>"},null,8,pp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",gp,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:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ye,{name:"link",size:11,stroke:2})],40,hp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ir(T.note.text),onClick:e.withModifiers(de=>rr(T.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ye,{name:"note",size:11,stroke:2})],40,bp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=de=>u.value=de),autofocus:"",rows:"1",onBlur:a[7]||(a[7]=de=>Yr()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(de=>Yr(),["exact","prevent"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(de=>Yr(),["prevent"]),["tab"])),e.withKeys(Op,["esc"]),Hp],onInput:Lp,onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[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,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-tag",style:e.normalizeStyle(e.unref(gr)(de))},e.toDisplayString(de),5))),128))])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ma(T.id)+1} 个`},e.toDisplayString(ma(T.id)+1),9,yp)):e.createCommentVNode("",!0),fa(T.id)&&Jr(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:Pt.value.get(T.id)??"#64748b"}),title:`展开 ${Jr(T.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>aa(T.id),["stop"])},e.toDisplayString(Jr(T.id)),47,Ep)):e.createCommentVNode("",!0),eg(T)&&!fa(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:Pt.value.get(T.id)??"#64748b",borderColor:Pt.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>aa(T.id),["stop"])},[e.createVNode(ye,{name:"minus",size:10,stroke:2.4})],46,xp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(de=>Et(de,T),["stop"])},null,40,wp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>I(T.id),["stop"])},[e.createVNode(ye,{name:"x",size:9,stroke:2.2})],40,Np)):e.createCommentVNode("",!0)],46,rp)}),128))],4),z.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!z.value.above}]),style:e.normalizeStyle({left:z.value.x+"px",top:z.value.y+"px"})},e.toDisplayString(z.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(fs,{key:3,x:y.value.x,y:y.value.y,container:c.value,"has-image":!!((m=e.unref(re)(f.value,y.value.nodeId))!=null&&m.image),"has-link":!!((v=e.unref(re)(f.value,y.value.nodeId))!=null&&v.link),"has-note":!!((N=e.unref(re)(f.value,y.value.nodeId))!=null&&N.note),"has-code":((M=(D=e.unref(re)(f.value,y.value.nodeId))==null?void 0:D.richContent)==null?void 0:M.kind)==="code","has-table":((ne=(j=e.unref(re)(f.value,y.value.nodeId))==null?void 0:j.richContent)==null?void 0:ne.kind)==="table","node-markers":((me=e.unref(re)(f.value,y.value.nodeId))==null?void 0:me.markers)??[],"node-tags":((Ve=e.unref(re)(f.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:ho,onRemoveImage:vn,onSetLink:Wr,onRemoveLink:bo,onEditNote:ko,onRemoveNote:Gr,onAddCode:or,onEditCode:or,onRemoveCode:jr,onAddTable:Oe,onEditTable:Oe,onRemoveTable:pn,onToggleMarker:mg,onClearMarkers:pg,onAddTag:hg,onRemoveTags:bg,onClose:se},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ms,{key:4,x:p.value.x,y:p.value.y,container:c.value,onOpenSettings:Pe,onOpenData:Ze,onOpenImport:je,onExportPng:ka,onExportSvg:So,onClose:Ge},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(L.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=T=>l("canvas-toggle-preview"))},[e.createVNode(ye,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Sp),e.createElementVNode("button",{class:e.normalizeClass(V.value),title:"显示大纲视图",onClick:go},[e.createVNode(ye,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",Tp,e.toDisplayString(Math.round(e.unref(oe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[16]||(a[16]=(...T)=>e.unref(oe).zoomIn&&e.unref(oe).zoomIn(...T))},[e.createVNode(ye,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[17]||(a[17]=(...T)=>e.unref(oe).zoomOut&&e.unref(oe).zoomOut(...T))},[e.createVNode(ye,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:on},[e.createVNode(ye,{name:"reset"})]),a[37]||(a[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:jp},[e.createVNode(ye,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[18]||(a[18]=T=>ca(1))},[e.createVNode(ye,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[19]||(a[19]=T=>ca(2))},[e.createVNode(ye,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Kp},[e.createVNode(ye,{name:"expand-all"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[35]||(a[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[20]||(a[20]=T=>g.value&&to(g.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Cp)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[21]||(a[21]=T=>g.value&&ar(g.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ap)]),a[36]||(a[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[22]||(a[22]=T=>Qr("mindmap"))},[e.createVNode(ye,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[23]||(a[23]=T=>Qr("tree"))},[e.createVNode(ye,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[24]||(a[24]=T=>Qr("org"))},[e.createVNode(ye,{name:"org"})],2)],64))],2)],544),r.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Mt,{side:"left",scope:"canvas",width:300,open:tn.value&&!t.previewMode,title:"大纲","onUpdate:open":a[28]||(a[28]=T=>tn.value=T)},{default:e.withCtx(()=>[e.createVNode(zo,{data:f.value,"selected-id":g.value,"collapsed-ids":Je.value,onSelect:po,onToggleCollapse:mn,onEdit:nr,onAddChild:jn,onAddSibling:Kn,onMove:It},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:Rt.value&&!t.previewMode,title:"数据","onUpdate:open":a[30]||(a[30]=T=>Rt.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:f.value,"pending-mode":Bt.value,onImport:a[29]||(a[29]=T=>f.value=T),onConsumedMode:ze},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:420,open:Q.value&&!t.previewMode,title:"Markdown","onUpdate:open":a[32]||(a[32]=T=>Q.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:f.value,onImport:a[31]||(a[31]=T=>f.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:it.value&&!t.previewMode,title:"节点内容","onUpdate:open":a[33]||(a[33]=T=>it.value=T)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":ut.value,"focus-tick":Se.value,onApply:Qe,onRemove:ht,onSetLink:Mn,onSetImage:er,onSetRich:tr},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:340,open:Te.value&&!t.previewMode,title:"设置","onUpdate:open":a[34]||(a[34]=T=>Te.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Do,{settings:B,"has-selection":g.value!==null,"selected-node-text":(T=ut.value)==null?void 0:T.text,"node-style":H.value,"onUpdate:settings":Z,"onUpdate:nodeStyle":ce,onReset:be},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),_p={class:"zm-app"},Mp={class:"zm-app-main"},vp={class:"zm-app-canvas"},Gl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
132
+ | a | b | c |`);if(w===null)return;const z=w.trim();if(!z){Ae(r,null);return}Ae(r,{kind:"table",raw:z})}function pn(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&Ae(r,null)}function ri(r){i.previewMode||(i.builtInDrawers&&(At(),kt.value=!0,Re.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 Kn(r){var w;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=g.value;if(!f)return;const A=(w=r.clipboardData)==null?void 0:w.items;if(A)for(let z=0;z<A.length;z++){const M=A[z];if(M.kind==="file"&&M.type.startsWith("image/")){const W=M.getAsFile();if(!W)continue;r.preventDefault();const te=le(m.value,f);if(te!=null&&te.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;U(W,me=>ie(f,me));return}}}e.onMounted(()=>{window.addEventListener("paste",Kn),window.addEventListener("keydown",yo),ke()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Kn),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),Yi=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,A=l.image.naturalH||l.image.height,w=A>0?A/f:1;gn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:A,ratio:w,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",en),window.addEventListener("mouseup",Eo)}function en(r){var te,me;const l=gn.value;if(!l)return;const f=re.scale.value||1,A=r.clientX-l.startX,w=V(l.startW+A/f,An,Wn),z=V(w*l.ratio,An,Wn);l.pendingW=w,l.pendingH=z;const M=(te=c.value)==null?void 0:te.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${w}px`,M.style.height=`${z}px`);const W=(me=c.value)==null?void 0:me.querySelector(`[data-node-id="${l.nodeId}"]`);W&&(W.style.minWidth=`${Math.max(80,Math.ceil(w+28))}px`,W.style.height=`${Math.ceil(z+8+30)}px`)}function Eo(){const r=gn.value;if(window.removeEventListener("mousemove",en),window.removeEventListener("mouseup",Eo),gn.value=null,!r)return;const l=le(m.value,r.nodeId);!l||!l.image||(ie(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]),Et(),Rn=!0)}const Yn=e.ref(null);let Rn=!1;function qn(r){Yn.value=r}function hn(r){Yn.value===r&&(Yn.value=null),B.value&&(B.value=null)}function Xn(r,l){var mt;if(!l.text||l.text.length<14)return;const A=r.currentTarget.getBoundingClientRect(),w=(mt=c.value)==null?void 0:mt.getBoundingClientRect();if(!w)return;const z=10,M=240,W=A.top-w.top>60,te=A.left-w.left+A.width/2,me=z+M/2,Pe=w.width-M/2-z,T=Math.max(me,Math.min(te,Pe)),Ze=W?A.top-w.top-8:A.bottom-w.top+8;B.value={text:l.text,x:T,y:Ze,above:W}}const Rt=e.ref(0),Zn=e.ref(!1),Kt=ns(100);function Oe(){Kt.record({data:m.value,selectedIds:[...d.value]})}function ke(){h.value=new Set(h.value),Rt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{Rt.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(A=>{let w=A,z=null;for(;w&&!z;)z=w.getAttribute("data-node-id"),w=w.parentElement;if(!z)return;const M=A.offsetHeight,W=A.scrollWidth,te=Math.round(M*2)/2,me=Math.round(W*2)/2;l[z]=te,f[z]=me,P.value[z],L.value[z]}),P.value=l,L.value=f}const ut=e.computed(()=>{var r,l,f,A,w,z,M,W,te,me;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:((A=i.theme)==null?void 0:A.branchText)??"#1f2937",lineColor:((w=i.theme)==null?void 0:w.lineColor)??"#94a3b8",bgColor:((z=i.theme)==null?void 0:z.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((W=i.theme)==null?void 0:W.lineWidthStart)??2.2,lineWidthEnd:((te=i.theme)==null?void 0:te.lineWidthEnd)??.8,rainbowBranch:((me=i.theme)==null?void 0:me.rainbowBranch)??!1}}),tn=e.computed(()=>v.canvasBg||ut.value.bgColor),v=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",lineOrigin:"edge",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function b(r){return v.taperedEdge?G(r):_e(r)}function I(r){return v.taperedEdge?v.lineWidthEnd:_e(r)}function G(r){return r<=0?v.lineWidthStart:r===1?Math.max(1.5,v.lineWidthStart*.67):r===2?Math.max(.8,v.lineWidthStart*.42):v.lineWidthEnd}function _e(r){if(r<=0)return v.lineWidthStart;if(r>=3)return v.lineWidthEnd;const l=r/3;return v.lineWidthStart+(v.lineWidthEnd-v.lineWidthStart)*l}function he(r,l,f,A){const w=1-r,z=w*w*w*l.x+3*w*w*r*f.x1+3*w*r*r*f.x2+r*r*r*A.x,M=w*w*w*l.y+3*w*w*r*f.y1+3*w*r*r*f.y2+r*r*r*A.y;return{x:z,y:M}}function Be(r,l,f,A){const w=1-r,z=w*w*l.x+2*w*r*f.x+r*r*A.x,M=w*w*l.y+2*w*r*f.y+r*r*A.y;return{x:z,y:M}}function Ye(r,l,f,A,w=32,z="curve",M="right"){if(z==="curve"){let ne;if(M==="right"||M==="left"){const be=Math.abs(l.x-r.x)*.45,we=M==="right"?1:-1;ne={x1:r.x+we*be,y1:r.y,x2:l.x-we*be,y2:l.y}}else{const be=Math.abs(l.y-r.y)*.45;ne={x1:r.x,y1:r.y+be,x2:l.x,y2:l.y-be}}const xt=ce=>{const be=1-ce,we=-3*be*be*r.x+3*(be*be-2*be*ce)*ne.x1+3*(2*be*ce-ce*ce)*ne.x2+3*ce*ce*l.x,Je=-3*be*be*r.y+3*(be*be-2*be*ce)*ne.y1+3*(2*be*ce-ce*ce)*ne.y2+3*ce*ce*l.y;return{dx:we,dy:Je}},Ge=[],We=[];for(let ce=0;ce<=w;ce++){const be=ce/w,we=ce===0?r:ce===w?l:he(be,r,ne,l),Je=xt(be);let ct=Math.hypot(Je.dx,Je.dy);ct<1e-6&&(ct=1);const Fe=-Je.dy/ct,q=Je.dx/ct,Ce=(f+(A-f)*be)/2;Ge.push({x:we.x+Fe*Ce,y:we.y+q*Ce}),We.push({x:we.x-Fe*Ce,y:we.y-q*Ce})}let pt=`M ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`;for(let ce=1;ce<=w;ce++)pt+=` L ${Ge[ce].x.toFixed(2)} ${Ge[ce].y.toFixed(2)}`;for(let ce=w;ce>=0;ce--)pt+=` L ${We[ce].x.toFixed(2)} ${We[ce].y.toFixed(2)}`;return pt+=" Z",pt}if(z==="arc"){let ne;M==="right"||M==="left"?ne={x:(r.x+l.x)/2,y:l.y}:ne={x:l.x,y:(r.y+l.y)/2};const xt=we=>{const Je=1-we,ct=2*Je*(ne.x-r.x)+2*we*(l.x-ne.x),Fe=2*Je*(ne.y-r.y)+2*we*(l.y-ne.y);return{dx:ct,dy:Fe}},Ge=[],We=[];for(let we=0;we<=w;we++){const Je=we/w,ct=we===0?r:we===w?l:Be(Je,r,ne,l),Fe=xt(Je);let q=Math.hypot(Fe.dx,Fe.dy);q<1e-6&&(q=1);const Ce=-Fe.dy/q,Qe=Fe.dx/q,pe=(f+(A-f)*Je)/2;Ge.push({x:ct.x+Ce*pe,y:ct.y+Qe*pe}),We.push({x:ct.x-Ce*pe,y:ct.y-Qe*pe})}const pt=f/2,ce=A/2;let be=`M ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`;for(let we=1;we<=w;we++)be+=` L ${Ge[we].x.toFixed(2)} ${Ge[we].y.toFixed(2)}`;be+=` A ${ce.toFixed(2)} ${ce.toFixed(2)} 0 0 0 ${We[w].x.toFixed(2)} ${We[w].y.toFixed(2)}`;for(let we=w-1;we>=0;we--)be+=` L ${We[we].x.toFixed(2)} ${We[we].y.toFixed(2)}`;return be+=` A ${pt.toFixed(2)} ${pt.toFixed(2)} 0 0 0 ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`,be+=" Z",be}if(z==="elbow"){const ne=[];if(M==="down"){const q=(r.y+l.y)/2;ne.push(r,{x:r.x,y:q},{x:l.x,y:q},l)}else{const q=(r.x+l.x)/2;ne.push(r,{x:q,y:r.y},{x:q,y:l.y},l)}const xt=[];let Ge=0;for(let q=0;q<ne.length-1;q++){const Ce=Math.hypot(ne[q+1].x-ne[q].x,ne[q+1].y-ne[q].y);xt.push(Ce),Ge+=Ce}const We=[f/2];let pt=0;for(let q=0;q<xt.length-1;q++){pt+=xt[q];const Ce=Ge>0?pt/Ge:0;We.push((f+(A-f)*Ce)/2)}We.push(A/2);const ce=[];for(let q=0;q<ne.length-1;q++){const Ce=ne[q+1].x-ne[q].x,Qe=ne[q+1].y-ne[q].y;let pe=Math.hypot(Ce,Qe);pe<1e-6&&(pe=1),ce.push({x:-Qe/pe,y:Ce/pe})}const be=[],we=[];be.push({x:ne[0].x+ce[0].x*We[0],y:ne[0].y+ce[0].y*We[0]}),we.push({x:ne[0].x-ce[0].x*We[0],y:ne[0].y-ce[0].y*We[0]});for(let q=1;q<ne.length-1;q++){const Ce=ce[q-1],Qe=ce[q],pe=We[q];be.push({x:ne[q].x+Ce.x*pe+Qe.x*pe,y:ne[q].y+Ce.y*pe+Qe.y*pe}),we.push({x:ne[q].x-Ce.x*pe-Qe.x*pe,y:ne[q].y-Ce.y*pe-Qe.y*pe})}const Je=ce[ce.length-1],ct=We[We.length-1];be.push({x:ne[ne.length-1].x+Je.x*ct,y:ne[ne.length-1].y+Je.y*ct}),we.push({x:ne[ne.length-1].x-Je.x*ct,y:ne[ne.length-1].y-Je.y*ct});let Fe=`M ${be[0].x.toFixed(2)} ${be[0].y.toFixed(2)}`;for(let q=1;q<be.length;q++)Fe+=` L ${be[q].x.toFixed(2)} ${be[q].y.toFixed(2)}`;for(let q=we.length-1;q>=0;q--)Fe+=` L ${we[q].x.toFixed(2)} ${we[q].y.toFixed(2)}`;return Fe+=" Z",Fe}const W=l.x-r.x,te=l.y-r.y;let me=Math.hypot(W,te);me<1e-6&&(me=1);const Pe=-te/me,T=W/me,Ze=f/2,mt=A/2,se={x:r.x+Pe*Ze,y:r.y+T*Ze},at={x:r.x-Pe*Ze,y:r.y-T*Ze},qt={x:l.x-Pe*mt,y:l.y-T*mt},st={x:l.x+Pe*mt,y:l.y+T*mt};return`M ${se.x.toFixed(2)} ${se.y.toFixed(2)} L ${st.x.toFixed(2)} ${st.y.toFixed(2)} L ${qt.x.toFixed(2)} ${qt.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} Z`}const ft=e.computed(()=>yt.value.root.children),vt=on[0].colors,Jn=e.computed(()=>Fa(v.branchPaletteId,v.customPalettes)),Ve=e.computed(()=>{const r=new Map;if(!v.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Jn.value.colors.length>0?Jn.value.colors:vt;for(let w=0;w<ft.value.length;w++){const z=ft.value[w];r.set(z.id,f[w%f.length])}const A=(w,z)=>{r.set(w.id,z);for(const M of w.children)A(M,z)};for(let w=0;w<ft.value.length;w++){const z=ft.value[w];A(z,f[w%f.length])}return r});function xo(r,l){return v.rainbowBranch?Ve.value.get(l.id)??ut.value.lineColor:ut.value.lineColor}function wo(r){const l=oe(r.id);if(l.bg)return l.bg;if(r.isRoot)return ut.value.rootBg;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return Wp(f,.18)}return ut.value.branchBg}function Qn(r){const l=oe(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return ut.value.rootText;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return jl(f,.55)}return ut.value.branchText}function eo(r){const l=oe(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return ut.value.rootBg;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return jl(f,.3)}return ut.value.lineColor}function Wl(r){const l=oe(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Gl(r){return oe(r.id).fontSize??r.fontSize??ut.value.fontSize}function Wp(r,l){const f=r.replace("#",""),A=f.length===6?f:f.split("").map(W=>W+W).join(""),w=parseInt(A.slice(0,2),16),z=parseInt(A.slice(2,4),16),M=parseInt(A.slice(4,6),16);return`rgba(${w}, ${z}, ${M}, ${l})`}function jl(r,l){const f=r.replace("#",""),A=f.length===6?f:f.split("").map(W=>W+W).join(""),w=Math.round(parseInt(A.slice(0,2),16)*(1-l)),z=Math.round(parseInt(A.slice(2,4),16)*(1-l)),M=Math.round(parseInt(A.slice(4,6),16)*(1-l));return`rgb(${w}, ${z}, ${M})`}const re=Qa({getContainer:()=>c.value});re.setOnMarqueeEnd(cg),ts({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:eg,onRemove:oa,onStartEdit:No,onClearSelection:()=>{d.value=new Set,Et()},onDuplicate:Zl,onCopy:ea,onCut:ta,onPaste:na,hasClipboard:()=>!!F.value&&F.value.nodes.length>0,onUndo:Xi,onRedo:Zi,onNavigate:tg,onSelectRoot:()=>{d.value=new Set([m.value.id]),Et()}});const yt=e.computed(()=>{const r=Lt(m.value);return ql(r),Da(r,{mode:v.layoutMode,baseFontSize:ut.value.fontSize,richHeights:P.value,richWidths:L.value})}),Kl=e.ref([]),to=e.computed(()=>(Rt.value,Kl.value));e.watch(yt,r=>{const l=[],f=A=>{l.push(A);for(const w of A.children)f(w)};f(r.root),Kl.value=l},{immediate:!0});const Yl=e.computed(()=>{const r=[];for(const l of to.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),Gp=e.computed(()=>`${yt.value.vbX} ${yt.value.vbY} ${yt.value.vbW} ${yt.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=le(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),Et(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function qi(){if(!s.value)return;const r=le(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function jp(){s.value=null}function Kp(r){if(i.previewMode)return;const l=le(m.value,r);l!=null&&l.richContent&&(_.value=r,x.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function Xl(){if(!_.value)return;const r=_.value,l=le(m.value,r),f=x.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const A=wn(f)||void 0;Ae(r,{kind:"code",raw:f,lang:A})}else Ae(r,{kind:"table",raw:f});_.value=null}function Yp(){_.value=null}function qp(r){r.key==="Escape"?(r.preventDefault(),Yp()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),Xl())}function Xp(r,l){const f=k.value.get(r);!f||f.col!==l?k.value.set(r,{col:l,dir:"asc"}):f.dir==="asc"?k.value.set(r,{col:l,dir:"desc"}):k.value.delete(r)}function Zp(r,l){const f=k.value.get(r);return!f||l.length<=1?l:al(l,f.col,f.dir)}function Jp(r,l){const f=k.value.get(r);return!f||f.col!==l?"↕":f.dir==="asc"?"▲":"▼"}function Qp(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Xi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Zi())}function no(r){const l=gr(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=hr(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function eg(r){if(r===m.value.id){no(r);return}const l=Ya(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function Zl(r){if(r===m.value.id)return;const l=qa(m.value,r);l&&(Oe(),d.value=new Set([l.id]),Et(),a("change",m.value),ke())}function Jl(r){const l=[],f=new Set;for(const A of r)A!==m.value.id&&(f.has(A)||le(m.value,A)&&(f.add(A),l.push(A)));return l}function Ql(r){const l=new Set(r),f=[],A=w=>{l.has(w.id)&&f.push(w.id);for(const z of w.children)A(z)};return A(m.value),f}function ea(r){const l=Ql(Jl(r));if(l.length===0)return;const f=[];for(const A of l){const w=br(m.value,A);w&&f.push(w)}f.length!==0&&(F.value={nodes:f,originalIds:new Set(l)},ke())}function ta(r){const l=Ql(Jl(r));if(l.length===0)return;const f=[];for(const A of l){const w=br(m.value,A);w&&f.push(w)}if(f.length!==0){Oe();for(const A of l)Ro(m.value,A);d.value=new Set,Et(),F.value={nodes:f,originalIds:new Set(l)},ke(),a("change",m.value)}}function na(r){const l=F.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,A=le(m.value,f);if(A){for(const w of l.originalIds){const z=le(m.value,w);if(z&&le(z,f))return}Oe();for(const w of l.nodes){const z=Lt(w);vo(z),A.children.push(z)}F.value=null,ke(),a("change",m.value)}}function Xi(){const r=Kt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),Et(),ke(),a("change",m.value))}function Zi(){const r=Kt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),Et(),ke(),a("change",m.value))}function Et(){const r=[];for(const l of d.value){const f=le(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!kt.value&&fa(l.id)&&(At(),kt.value=!0)}else i.builtInDrawers&&r.length===0&&(kt.value=!1);a("select",r.length>0?r:null)}function tg(r,l){const f=g.value??m.value.id,A=le(m.value,f);if(!A)return;let w=null;if(l===1){const z=Wt(m.value,A.id);if(z){const M=z.children.findIndex(W=>W.id===A.id);M>=0&&M<z.children.length-1&&(w=z.children[M+1].id)}}else if(l===-1){const z=Wt(m.value,A.id);if(z){const M=z.children.findIndex(W=>W.id===A.id);M>0&&(w=z.children[M-1].id)}}else if(r===1){const z=Wt(m.value,A.id);z&&(w=z.id)}else r===-1&&A.children.length>0&&(w=A.children[0].id);w&&(d.value=new Set([w]),Et())}function oa(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,Et()}ke(),a("change",m.value)}}function ia(r){h.value.has(r)?h.value.delete(r):h.value.add(r),ke()}function ra(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:A}=l.pop();r(f,A);for(let w=f.children.length-1;w>=0;w--)l.push({n:f.children[w],depth:A+1})}}function ng(){h.value=new Set,ra(r=>{r.children.length>0&&h.value.add(r.id)}),ke()}function la(r){h.value=new Set,ra((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),ke()}function og(){h.value=new Set,ke()}function aa(r,l){ja(m.value,r,l)&&(Oe(),ke(),a("change",m.value))}function Ji(r,l,f){return Ka(m.value,r,l,f)?(Oe(),ke(),a("change",m.value),!0):!1}function ig(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]);Et()}function rg(r,l,f){let A=null;for(const w of to.value){if(w.id===f)continue;const z=w.width/2,M=w.height/2;r>=w.x-z&&r<=w.x+z&&l>=w.y-M&&l<=w.y+M&&(A=w)}return A}let Yt=null;function lg(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 A=c.value.getBoundingClientRect(),w=l.x*re.scale.value+re.offsetX.value,z=l.y*re.scale.value+re.offsetY.value,M=r.clientX-A.left-w,W=r.clientY-A.top-z;Yt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:W,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",sa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function sa(r){if(Yt){const M=r.clientX-Yt.startX,W=r.clientY-Yt.startY;if(Math.abs(M)<=Ul&&Math.abs(W)<=Ul)return;C.value={srcId:Yt.srcId,srcText:Yt.srcText,pointerOffsetX:Yt.pointerOffsetX,pointerOffsetY:Yt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Yt=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 A=(r.clientX-f.left-re.offsetX.value)/re.scale.value,w=(r.clientY-f.top-re.offsetY.value)/re.scale.value,z=rg(A,w,l.srcId);l.currentTargetId=(z==null?void 0:z.id)??null}function ci(r){if(window.removeEventListener("pointermove",sa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),Yt){Yt=null;return}const l=C.value;l&&(l.currentTargetId&&(Ji(l.srcId,l.currentTargetId,"child"),d.value=new Set([l.srcId]),Et()),C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging"))}let di=!1;function ag(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,re.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),A=(r.clientX-f.left-re.offsetX.value)/re.scale.value,w=(r.clientY-f.top-re.offsetY.value)/re.scale.value;re.startMarquee(A,w,{shift:r.shiftKey})}function sg(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=re.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,Et())}function cg(){const r=re.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,A=r.x+r.width,w=r.y+r.height,z=[];for(const M of to.value){const W=M.width/2,te=M.height/2,me=M.x-W,Pe=M.x+W,T=M.y-te,Ze=M.y+te;me<=A&&Pe>=l&&T<=w&&Ze>=f&&z.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...z]):new Set(z),Et()}function ca(r){return h.value.has(r)}function dg(r){const l=le(m.value,r.id);return!!l&&l.children.length>0}function Qi(r){const l=le(m.value,r);return l?l.children.length:0}function da(r){if(!le(m.value,r))return 0;const A=[m.value];for(;A.length;){const w=A.pop(),z=w.children.findIndex(M=>M.id===r);if(z>=0)return z;for(const M of w.children)A.push(M)}return 0}function ui(r,l,f,A){const w=(A==null?void 0:A._dir)??r._dir;if(l==="out"&&r.isRoot&&v.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&v.lineOrigin==="proportional"&&A){const W=yt.value.root.children;if(w==="down"){const mt=W.reduce((st,ne)=>Math.max(st,Math.abs(ne.x-r.x)),1),se=Math.min(1,Math.abs(A.x-r.x)/mt),at=r.y+r.height/2,qt=r.y;return{x:r.x,y:at+(qt-at)*se}}const te=W.reduce((mt,se)=>Math.max(mt,Math.abs(se.y-r.y)),1),me=Math.min(1,Math.abs(A.y-r.y)/te),Pe=f!==void 0?f:r.side,T=r.x+Pe*(r.width/2),Ze=r.x;return{x:T+(Ze-T)*me,y:r.y}}if(w==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let z;l==="in"?z=-r.side:f!==void 0?z=f:z=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+z*(r.width/2-M),y:r.y}}function ln(){const r=yt.value;re.resetView(r.width,r.height,r.root.y)}function ug(){Zn.value=!0,Oe(),ke(),e.nextTick(()=>ln())}function er(r){v.layoutMode!==r&&(v.layoutMode=r,ke(),e.nextTick(()=>ln()))}function ua(){return JSON.stringify(m.value,null,2)}function fa(r){const l=le(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 ma(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Kt.reset(),m.value=Lt(l),d.value=new Set,h.value=new Set,ke(),e.nextTick(()=>ln()),a("change",m.value),!0)}catch{return!1}}function fg(){const r=document.createElement("input");r.type="file",r.accept="application/json",r.onchange=()=>{var A;const l=(A=r.files)==null?void 0:A[0];if(!l)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(ma(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(l)},r.click()}function mg(){const r=new Blob([ua()],{type:"application/json"}),l=URL.createObjectURL(r),f=document.createElement("a");f.href=l,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(l)}const pa=e.ref(""),an=e.ref([]),So=e.ref(-1);function pg(r){pa.value=r;const l=r.trim();if(!l){an.value=[],So.value=-1;return}const f=l.toLowerCase(),A=[],w=z=>{var M;(z.text.toLowerCase().includes(f)||(M=z.note)!=null&&M.text&&z.note.text.toLowerCase().includes(f))&&A.push(z.id);for(const W of z.children)w(W)};w(m.value),an.value=A,So.value=A.length>0?0:-1,A.length>0&&(kg(A),e.nextTick(()=>yg(0)))}function gg(r){return an.value.includes(r)}function hg(r){return So.value>=0&&an.value[So.value]===r}function bg(r){return pa.value.trim().length>0&&an.value.length>0&&!an.value.includes(r)}function kg(r){if(r.length===0)return;const l=new Set(r),f=new Set,A=w=>{let z=l.has(w.id);for(const M of w.children)A(M)&&(z=!0);return z&&w.children.length>0&&h.value.has(w.id)&&f.add(w.id),z};if(A(m.value),f.size>0){for(const w of f)h.value.delete(w);ke()}}function yg(r){const l=an.value[r];if(!l)return;const f=to.value.find(A=>A.id===l);f&&(d.value=new Set([l]),Et(),re.centerOn(f.x,f.y,f.width,f.height))}function Eg(r,l){const f=le(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),ke(),a("change",m.value)))}function xg(r,l){const f=le(m.value,r);if(!f||!f.markers)return;const A=f.markers.indexOf(l);A<0||(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Oe(),ke(),a("change",m.value))}function ga(r,l){const f=le(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const A=f.markers.indexOf(l);return A>=0?(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Oe(),ke(),a("change",m.value),!1):(f.markers.push(l),Oe(),ke(),a("change",m.value),!0)}function wg(r){const l=le(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Ng(r){var f;const l=(f=E.value)==null?void 0:f.nodeId;l&&ga(l,r)}function Sg(){var f;const r=(f=E.value)==null?void 0:f.nodeId;if(!r)return;const l=le(m.value,r);!l||!l.markers||(delete l.markers,Oe(),ke(),a("change",m.value),ue())}function tr(r,l){const f=le(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),ke(),a("change",m.value))}function Cg(r){const l=le(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Tg(){var z,M;const r=(z=E.value)==null?void 0:z.nodeId;if(!r)return;const l=le(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",A=window.prompt("输入标签(多个用逗号分隔)",f);if(A===null)return;const w=A.split(/[,,]/).map(W=>W.trim()).filter(W=>W.length>0);tr(r,w),ue()}function Ag(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&(tr(r,[]),ue())}function ha(){const r=yt.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 A=document.createElementNS(l,"rect");A.setAttribute("x",String(r.vbX)),A.setAttribute("y",String(r.vbY)),A.setAttribute("width",String(r.vbW)),A.setAttribute("height",String(r.vbH)),A.setAttribute("fill",tn.value),f.appendChild(A);for(const M of Yl.value){const W=document.createElementNS(l,"path");W.setAttribute("d",Ye(ui(M.from,"out",M.to.side,M.to),ui(M.to,"in"),b(M.from.depth),I(M.to.depth),32,v.lineStyle,M.to._dir)),W.setAttribute("fill",xo(M.from,M.to)),W.setAttribute("stroke","none"),f.appendChild(W)}const w="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function z(M,W){let te=0;for(const me of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(me)?te+=W:te+=W*.55;return te}for(const M of to.value){const W=M.x-M.width/2,te=M.y-M.height/2,me=document.createElementNS(l,"rect");me.setAttribute("x",String(W)),me.setAttribute("y",String(te)),me.setAttribute("width",String(M.width)),me.setAttribute("height",String(M.height)),me.setAttribute("rx","8"),me.setAttribute("fill",wo(M)),me.setAttribute("stroke",eo(M)),me.setAttribute("stroke-width","1"),f.appendChild(me);const Pe=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Ze=!!M.image,mt=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let se=0,at=0;if(mt){const q=M.richContent,Ce=M.fontSize*.78*.92,Qe=6,pe=4,bn=2,kn=6;if(q.kind==="code"){const Bt=Go(q.raw),Tt=wn(q.raw),It=Bt.split(`
133
+ `),nn=Ce*1.35;let Ut=0;for(const $e of It)Ut=Math.max(Ut,z($e,Ce));at=Math.min(Ut+Qe*2+4,M.width-4),se=It.length*nn+pe*2+bn;const ot=M.x-at/2;let wt=te+4;Ze&&(wt=te+M.image.height+kn);const zt=document.createElementNS(l,"rect");if(zt.setAttribute("x",String(ot)),zt.setAttribute("y",String(wt)),zt.setAttribute("width",String(at)),zt.setAttribute("height",String(se-bn)),zt.setAttribute("rx","6"),zt.setAttribute("fill","rgba(255,255,255,0.55)"),zt.setAttribute("stroke",eo(M)),zt.setAttribute("stroke-width","1"),f.appendChild(zt),Tt){const $e=document.createElementNS(l,"text");$e.setAttribute("x",String(ot+at-Qe)),$e.setAttribute("y",String(wt+pe+4)),$e.setAttribute("text-anchor","end"),$e.setAttribute("fill",Qn(M)),$e.setAttribute("font-size",String(Ce*.8)),$e.setAttribute("font-family",w),$e.setAttribute("opacity","0.5"),$e.textContent=Tt,f.appendChild($e)}const To="'JetBrains Mono','Fira Code',Consolas,monospace";for(let $e=0;$e<It.length;$e++){const gt=document.createElementNS(l,"text");gt.setAttribute("x",String(ot+Qe)),gt.setAttribute("y",String(wt+pe+($e+.5)*nn+2)),gt.setAttribute("dominant-baseline","central"),gt.setAttribute("fill",Qn(M)),gt.setAttribute("font-size",String(Ce)),gt.setAttribute("font-family",To);let Ht=It[$e];const qe=Math.floor((at-Qe*2)/(Ce*.6));Ht.length>qe&&(Ht=Ht.substring(0,qe-1)+"…"),gt.textContent=Ht,f.appendChild(gt)}}else if(q.kind==="table"){const Bt=Ai(q.raw);if(Bt.length>0){const Tt=Ce*1.35,It=6,nn=3,Ut=Bt[0].length,ot=[];for(let qe=0;qe<Ut;qe++){let sn=0;for(const yn of Bt)qe<yn.length&&(sn=Math.max(sn,z(yn[qe],Ce)));ot.push(sn+It*2)}at=Math.min(ot.reduce((qe,sn)=>qe+sn,0),M.width-4);const wt=at/ot.reduce((qe,sn)=>qe+sn,0);for(let qe=0;qe<Ut;qe++)ot[qe]*=wt;se=Bt.length*(Tt+nn*2)+bn;const zt=M.x-at/2;let To=te+4;Ze&&(To=te+M.image.height+kn);const $e=document.createElementNS(l,"rect");$e.setAttribute("x",String(zt)),$e.setAttribute("y",String(To)),$e.setAttribute("width",String(at)),$e.setAttribute("height",String(se-bn)),$e.setAttribute("rx","6"),$e.setAttribute("fill","rgba(255,255,255,0.55)"),$e.setAttribute("stroke",eo(M)),$e.setAttribute("stroke-width","1"),f.appendChild($e);let gt=zt,Ht=To;for(let qe=0;qe<Bt.length;qe++){const sn=Bt[qe],yn=Tt+nn*2;gt=zt;for(let Ao=0;Ao<Ut;Ao++){const oo=ot[Ao],_g=sn[Ao]||"";if(Ao<Ut-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(gt+oo)),Xe.setAttribute("y1",String(Ht)),Xe.setAttribute("x2",String(gt+oo)),Xe.setAttribute("y2",String(Ht+yn)),Xe.setAttribute("stroke",eo(M)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe<Bt.length-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(gt)),Xe.setAttribute("y1",String(Ht+yn)),Xe.setAttribute("x2",String(gt+oo)),Xe.setAttribute("y2",String(Ht+yn)),Xe.setAttribute("stroke",eo(M)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe===0){const Xe=document.createElementNS(l,"rect");Xe.setAttribute("x",String(gt)),Xe.setAttribute("y",String(Ht)),Xe.setAttribute("width",String(oo)),Xe.setAttribute("height",String(yn)),Xe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Xe)}const cn=document.createElementNS(l,"text");cn.setAttribute("x",String(gt+It)),cn.setAttribute("y",String(Ht+nn+Tt/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",Qn(M)),cn.setAttribute("font-size",String(Ce)),cn.setAttribute("font-family",w),qe===0&&cn.setAttribute("font-weight","600");let fi=_g;const nr=Math.floor((oo-It*2)/(Ce*.55));fi.length>nr&&nr>2&&(fi=fi.substring(0,nr-1)+"…"),cn.textContent=fi,f.appendChild(cn),gt+=oo}Ht+=yn}}}}let qt=0;if(Ze){const q=M.image,Ce=te+4,Qe=M.x-q.width/2,pe=document.createElementNS(l,"image");pe.setAttribute("x",String(Qe)),pe.setAttribute("y",String(Ce)),pe.setAttribute("width",String(q.width)),pe.setAttribute("height",String(q.height)),pe.setAttribute("href",q.src),pe.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",q.src),pe.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(pe),qt=q.height+6}let st=M.y;const ne=qt+se;ne>0?st=te+ne+(M.height-ne)/2:Pe&&(st=M.y-8);const xt=14,Ge=2,We=4,pt=T?M.markers.length:0,ce=pt>0?pt*xt+(pt-1)*Ge+We:0,be=z(M.text,M.fontSize),we=ce+be,Je=M.x-we/2;if(T){let q=Je;for(const Ce of M.markers){const Qe=zo(Ce);if(Qe){const pe=document.createElementNS(l,"svg");pe.setAttribute("x",String(q)),pe.setAttribute("y",String(st-xt/2)),pe.setAttribute("width",String(xt)),pe.setAttribute("height",String(xt)),pe.setAttribute("viewBox","0 0 24 24"),pe.setAttribute("color",Qn(M));const kn=new DOMParser().parseFromString(`<svg xmlns="${l}">${Qe}</svg>`,"image/svg+xml");if(!kn.querySelector("parsererror"))for(;kn.documentElement.firstChild;)pe.appendChild(kn.documentElement.firstChild);f.appendChild(pe)}q+=xt+Ge}}const ct=T?Je+ce+be/2:M.x,Fe=document.createElementNS(l,"text");if(Fe.setAttribute("x",String(ct)),Fe.setAttribute("y",String(st)),Fe.setAttribute("text-anchor","middle"),Fe.setAttribute("dominant-baseline","central"),Fe.setAttribute("fill",Qn(M)),Fe.setAttribute("font-size",String(Gl(M))),Fe.setAttribute("font-weight",String(Wl(M))),Fe.setAttribute("font-family",w),Fe.textContent=M.text,f.appendChild(Fe),Pe){const pe=M.y+10,bn=M.tags.map(Tt=>z(Tt,10)+12),kn=bn.reduce((Tt,It)=>Tt+It+3,-3);let Bt=M.x-kn/2;for(let Tt=0;Tt<M.tags.length;Tt++){const It=M.tags[Tt],nn=hi(It),Ut=bn[Tt],ot=document.createElementNS(l,"rect");ot.setAttribute("x",String(Bt)),ot.setAttribute("y",String(pe-16/2)),ot.setAttribute("width",String(Ut)),ot.setAttribute("height",String(16)),ot.setAttribute("rx",String(16/2)),ot.setAttribute("fill",nn.background),ot.setAttribute("stroke",nn.borderColor),ot.setAttribute("stroke-width","1"),f.appendChild(ot);const wt=document.createElementNS(l,"text");wt.setAttribute("x",String(Bt+Ut/2)),wt.setAttribute("y",String(pe)),wt.setAttribute("text-anchor","middle"),wt.setAttribute("dominant-baseline","central"),wt.setAttribute("fill",nn.color),wt.setAttribute("font-size",String(10)),wt.setAttribute("font-family",w),wt.textContent=It,f.appendChild(wt),Bt+=Ut+3}}}return f}function Co(){const r=ha();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
134
+ `+f);const A=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),w=URL.createObjectURL(A),z=document.createElement("a");z.href=w,z.download=`${m.value.text||"mindmap"}.svg`,z.click(),URL.revokeObjectURL(w)}function ba(r=2){const l=ha(),f=yt.value;let w=new XMLSerializer().serializeToString(l);w.startsWith("<?xml")||(w=`<?xml version="1.0" encoding="UTF-8"?>
135
+ `+w);const z=new Blob([w],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(z),W=new window.Image;W.onload=()=>{const te=document.createElement("canvas");te.width=Math.ceil(f.vbW*r),te.height=Math.ceil(f.vbH*r);const me=te.getContext("2d");if(!me){URL.revokeObjectURL(M);return}me.fillStyle=tn.value,me.fillRect(0,0,te.width,te.height),me.drawImage(W,0,0,te.width,te.height),URL.revokeObjectURL(M);try{te.toBlob(Pe=>{if(!Pe){Co();return}const T=URL.createObjectURL(Pe),Ze=document.createElement("a");Ze.href=T,Ze.download=`${m.value.text||"mindmap"}.png`,Ze.click(),URL.revokeObjectURL(T)},"image/png")}catch(Pe){console.warn("PNG export failed, falling back to SVG:",Pe),Co()}},W.onerror=()=>{URL.revokeObjectURL(M),Co()},W.src=M}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>oa(r),duplicateNode:r=>Zl(r),setNodeText:(r,l)=>aa(r,l),moveNode:(r,l,f)=>Ji(r,l,f),lineWidthForDepth:b,endWidthForDepth:I,getData:()=>m.value,nodeHasContent:r=>fa(r),getSelectedIds:()=>[...d.value],copyNodes:r=>ea(r),cutNodes:r=>ta(r),pasteNodes:r=>na(r),setData:r=>{Kt.reset(),m.value=Lt(r),d.value=new Set,h.value=new Set,ke(),Oe(),e.nextTick(()=>ln())},resetView:()=>ln(),exportData:ua,importData:ma,getMarkdown:()=>zn(m.value),setMarkdown:(r,l=!0)=>{const f=In(r||"");l&&(S.value=!0),K=!l,Kt.reset(),m.value=Lt(f),d.value=new Set,h.value=new Set,ke(),Oe(),e.nextTick(()=>{K=!1,ln()}),a("change",m.value)},setBalanced:r=>{Zn.value=r},isBalanced:()=>Zn.value,balance:()=>ug(),applyNodeStyle:(r,l)=>Y(r,l),getNodeStyle:r=>oe(r),applyNodeImage:(r,l)=>ie(r,l),applyNodeImageByUrl:(r,l)=>y(r,l),removeNodeImage:r=>ye(r),applyNodeLink:(r,l)=>ae(r,l),removeNodeLink:r=>Me(r),applyNodeNote:(r,l)=>ze(r,l),removeNodeNote:r=>De(r),applyNodeRichContent:(r,l)=>Ae(r,l),addNodeMarker:(r,l)=>Eg(r,l),removeNodeMarker:(r,l)=>xg(r,l),toggleNodeMarker:(r,l)=>ga(r,l),getNodeMarkers:r=>wg(r),setNodeTags:(r,l)=>tr(r,l),getNodeTags:r=>Cg(r),exportPNG:r=>ba(r),exportSVG:()=>Co(),searchNodes:r=>(pg(r),[...an.value]),undo:()=>Xi(),redo:()=>Zi(),canUndo:()=>Kt.canUndo(),canRedo:()=>Kt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(v.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(v.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(v.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(v.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(v.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(v.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(v.lineStyle=r.lineStyle),r.lineOrigin!==void 0&&(v.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(v.taperedEdge=r.taperedEdge),r.showOrderBadge!==void 0&&(v.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(v.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:v.autoBalanceOnChange,lineWidthStart:v.lineWidthStart,lineWidthEnd:v.lineWidthEnd,rainbowBranch:v.rainbowBranch,branchPaletteId:v.branchPaletteId,customPalettes:v.customPalettes,lineStyle:v.lineStyle,lineOrigin:v.lineOrigin,layoutMode:v.layoutMode,taperedEdge:v.taperedEdge,showOrderBadge:v.showOrderBadge,canvasBg:v.canvasBg}),setBranchPalette:r=>{if(!r)return;[...on,...v.customPalettes].find(f=>f.id===r)&&(v.branchPaletteId=r)},getBranchPalette:()=>v.branchPaletteId,getBranchPalettes:()=>[...on,...v.customPalettes],getSearchResults:()=>[...an.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=Lt(r),ke()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>ln())}),(r,l)=>{var f,A,w,z,M,W,te,me,Pe;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:tn.value,fontSize:ut.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:ag,onContextmenu:Ee,onWheel:l[25]||(l[25]=(...T)=>e.unref(re).onWheel&&e.unref(re).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>N.value=!0),onMouseleave:l[27]||(l[27]=T=>N.value=!1),onClick:sg},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:yt.value.vbX*e.unref(re).scale.value+e.unref(re).offsetX.value+"px",top:yt.value.vbY*e.unref(re).scale.value+e.unref(re).offsetY.value+"px",width:yt.value.vbW*e.unref(re).scale.value+"px",height:yt.value.vbH*e.unref(re).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Gp.value,preserveAspectRatio:"xMinYMin meet",width:yt.value.vbW*e.unref(re).scale.value,height:yt.value.vbH*e.unref(re).scale.value},[e.createElementVNode("g",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Ye(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),b(T.from.depth),I(T.to.depth),32,v.lineStyle,T.to._dir),fill:xo(T.from,T.to),stroke:"none"},null,8,pp))),128))])],8,fp))],4),e.unref(re).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(re).marquee.x*e.unref(re).scale.value+e.unref(re).offsetX.value+"px",top:e.unref(re).marquee.y*e.unref(re).scale.value+e.unref(re).offsetY.value+"px",width:e.unref(re).marquee.width*e.unref(re).scale.value+"px",height:e.unref(re).marquee.height*e.unref(re).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(re).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(re).offsetX.value}px, ${e.unref(re).offsetY.value}px) scale(${e.unref(re).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,T=>{var Ze,mt;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Yi.value===T.id,"is-dragging-source":((Ze=C.value)==null?void 0:Ze.srcId)===T.id,"is-drop-target":((mt=C.value)==null?void 0:mt.currentTargetId)===T.id,"is-search-hit":gg(T.id),"is-search-current":hg(T.id),"is-search-dimmed":bg(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:Gl(T)+"px",background:wo(T),color:Qn(T),borderColor:eo(T),fontWeight:Wl(T),transform:"translate(-50%, -50%)"}),onClick:se=>ig(se,T),onPointerdown:se=>lg(se,T),onDblclick:se=>{se.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:se=>X(se,T),onMouseenter:se=>{qn(T.id),Xn(se,T)},onMouseleave:se=>hn(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,hp)):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(se=>Kp(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[_.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=se=>x.value=se),class:"zm-rich-edit",spellcheck:"false",onBlur:Xl,onKeydown:qp},null,544)),[[e.vModelText,x.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",kp,[e.createElementVNode("code",{innerHTML:e.unref(Ti)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,yp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Ep,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zp(T.id,e.unref(Ai)(T.richContent.raw)),(se,at)=>(e.openBlock(),e.createElementBlock("tr",{key:at},[at===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se,(qt,st)=>{var ne,xt,Ge,We,pt;return e.openBlock(),e.createElementBlock("th",{key:`h${st}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((ne=k.value.get(T.id))==null?void 0:ne.col)===st,"is-asc":((xt=k.value.get(T.id))==null?void 0:xt.col)===st&&((Ge=k.value.get(T.id))==null?void 0:Ge.dir)==="asc","is-desc":((We=k.value.get(T.id))==null?void 0:We.col)===st&&((pt=k.value.get(T.id))==null?void 0:pt.dir)==="desc"}]),onClick:e.withModifiers(ce=>Xp(T.id,st),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(qt),1),e.createElementVNode("span",wp,e.toDisplayString(Jp(T.id,st)),1)],10,xp)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(se,(qt,st)=>(e.openBlock(),e.createElementBlock("td",{key:`c${st}`},e.toDisplayString(qt),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,bp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Np,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Sp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,se=>(e.openBlock(),e.createElementBlock("span",{key:se,class:"zm-node-marker",title:e.unref(yr)(se),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(se)+"</svg>"},null,8,Cp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Tp,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(Ne,{name:"link",size:11,stroke:2})],40,Ap)):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(se=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ne,{name:"note",size:11,stroke:2})],40,_p)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=se=>u.value=se),autofocus:"",onBlur:l[7]||(l[7]=se=>qi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(se=>qi(),["exact"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(se=>qi(),["prevent"]),["tab"])),e.withKeys(jp,["esc"]),Qp],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",Mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,se=>(e.openBlock(),e.createElementBlock("span",{key:se,class:"zm-node-tag",style:e.normalizeStyle(e.unref(hi)(se))},e.toDisplayString(se),5))),128))])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${da(T.id)+1} 个`},e.toDisplayString(da(T.id)+1),9,Rp)):e.createCommentVNode("",!0),ca(T.id)&&Qi(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:Ve.value.get(T.id)??"#64748b"}),title:`展开 ${Qi(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(se=>ia(T.id),["stop"])},e.toDisplayString(Qi(T.id)),47,vp)):e.createCommentVNode("",!0),dg(T)&&!ca(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:Ve.value.get(T.id)??"#64748b",borderColor:Ve.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(se=>ia(T.id),["stop"])},[e.createVNode(Ne,{name:"minus",size:10,stroke:2.4})],46,Bp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(se=>Mt(se,T),["stop"])},null,40,Ip)):e.createCommentVNode("",!0),T.image&&g.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(se=>ye(T.id),["stop"])},[e.createVNode(Ne,{name:"x",size:9,stroke:2.2})],40,zp)):e.createCommentVNode("",!0)],46,gp)}),128))],4),B.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!B.value.above}]),style:e.normalizeStyle({left:B.value.x+"px",top:B.value.y+"px"})},e.toDisplayString(B.value.text),7)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(ms,{key:3,x:E.value.x,y:E.value.y,container:c.value,"has-image":!!((f=e.unref(le)(m.value,E.value.nodeId))!=null&&f.image),"has-link":!!((A=e.unref(le)(m.value,E.value.nodeId))!=null&&A.link),"has-note":!!((w=e.unref(le)(m.value,E.value.nodeId))!=null&&w.note),"has-code":((M=(z=e.unref(le)(m.value,E.value.nodeId))==null?void 0:z.richContent)==null?void 0:M.kind)==="code","has-table":((te=(W=e.unref(le)(m.value,E.value.nodeId))==null?void 0:W.richContent)==null?void 0:te.kind)==="table","node-markers":((me=e.unref(le)(m.value,E.value.nodeId))==null?void 0:me.markers)??[],"node-tags":((Pe=e.unref(le)(m.value,E.value.nodeId))==null?void 0:Pe.tags)??[],onPickImage:ho,onRemoveImage:Mn,onSetLink:Gi,onRemoveLink:bo,onEditNote:ko,onRemoveNote:ji,onAddCode:ii,onEditCode:ii,onRemoveCode:Ki,onAddTable:He,onEditTable:He,onRemoveTable:pn,onToggleMarker:Ng,onClearMarkers:Sg,onAddTag:Tg,onRemoveTags:Ag,onClose:ue},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ps,{key:4,x:p.value.x,y:p.value.y,container:c.value,onOpenSettings:Ke,onOpenData:it,onOpenImport:nt,onExportPng:ba,onExportSvg:Co,onClose:tt},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(O.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(Ne,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Op),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:"显示大纲视图",onClick:go},[e.createVNode(Ne,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":N.value}])},[e.createElementVNode("span",Lp,e.toDisplayString(Math.round(e.unref(re).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(re).zoomIn&&e.unref(re).zoomIn(...T))},[e.createVNode(Ne,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(re).zoomOut&&e.unref(re).zoomOut(...T))},[e.createVNode(Ne,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:ln},[e.createVNode(Ne,{name:"reset"})]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ng},[e.createVNode(Ne,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>la(1))},[e.createVNode(Ne,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>la(2))},[e.createVNode(Ne,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:og},[e.createVNode(Ne,{name:"expand-all"})]),l[39]||(l[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:mg},[e.createVNode(Ne,{name:"export"})]),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=>g.value&&no(g.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Dp)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>g.value&&si(g.value))},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Vp)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>er("mindmap"))},[e.createVNode(Ne,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>er("tree"))},[e.createVNode(Ne,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>er("org"))},[e.createVNode(Ne,{name:"org"})],2),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:fg},[e.createVNode(Ne,{name:"import"})])],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Dt,{side:"left",scope:"canvas",width:300,open:rn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>rn.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":g.value,"collapsed-ids":rt.value,onSelect:po,onToggleCollapse:mn,onEdit:oi,onAddChild:Gn,onAddSibling:jn,onMove:Ft},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:360,open:$t.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>$t.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Pt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:420,open:Q.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>Q.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(Dt,{side:"right",scope:"canvas",width:360,open:kt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>kt.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":Ct.value,"focus-tick":Re.value,onApply:lt,onRemove:_t,onSetLink:_n,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:340,open:ve.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ve.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Vo,{settings:v,"has-selection":g.value!==null,"selected-node-text":(T=Ct.value)==null?void 0:T.text,"node-style":H.value,"onUpdate:settings":Z,"onUpdate:nodeStyle":fe,onReset:Se},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),$p={class:"zm-app"},Pp={class:"zm-app-main"},Fp={class:"zm-app-canvas"},Hl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
138
136
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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 形式携带,
139
137
  渲染在节点标题上方,自动支持语言 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
140
138
  interface Node {
@@ -165,4 +163,4 @@ function walk(n: Node) {
165
163
  | --- | --- | --- | --- | --- |
166
164
  | 1 | 2 | 3 | 4 | 5 |
167
165
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
168
- 鼠标悬浮预览前 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"?r:typeof location<"u"&&location.hash==="#stress"?l:(typeof location<"u"&&location.hash==="#rich",o)}const r={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:[]}]},l=(()=>{const y=(V,q)=>({id:V,text:q,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],L=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...L]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),h=e.ref(!1),w=e.ref(!1),S=e.ref(0),$=e.ref(!1),_=e.ref(!1),P=e.ref(null);function z(){c.value=n()}function C(){g.value=!0,h.value=!1,w.value=!1}function x(y){C()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),f=e.computed(()=>{var y;return s.value?((y=P.value)==null?void 0:y.getNodeStyle(s.value.id))??{}:{}});function R(y){var p;Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function E(y){var p;s.value&&((p=P.value)==null||p.applyNodeStyle(s.value.id,y))}function Y(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function K(y){if(y.key==="Escape"){if($.value){$.value=!1,y.stopPropagation();return}_.value&&(_.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",K),window.addEventListener("hashchange",z),(y=P.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",K),window.removeEventListener("hashchange",z)});function ee(y){c.value=y}function ae(y){var L;const p=y&&y.length>0?y[0]:null;s.value=p,p?!w.value&&((L=P.value)!=null&&L.nodeHasContent(p.id))&&(g.value=!1,h.value=!1,w.value=!0):w.value=!1}e.watch(c,y=>{if(!s.value)return;const p=X(y,s.value.id);p?p!==s.value&&(s.value=p):s.value=null},{deep:!1});function ie(y){if(!s.value||s.value.id!==y){const p=X(c.value,y);p&&(s.value=p)}g.value=!1,h.value=!1,w.value=!0,S.value++}function X(y,p){if(y.id===p)return y;for(const L of y.children){const V=X(L,p);if(V)return V}return null}function te(y){var p;s.value&&((p=P.value)==null||p.applyNodeNote(s.value.id,y))}function J(){var y;s.value&&((y=P.value)==null||y.removeNodeNote(s.value.id))}function I(y){var p;s.value&&((p=P.value)==null||p.applyNodeLink(s.value.id,y))}function A(y){var p;s.value&&((p=P.value)==null||p.applyNodeImageByUrl(s.value.id,y))}function U(y){var p;s.value&&((p=P.value)==null||p.applyNodeRichContent(s.value.id,y))}function F(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function G(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function le(y){var p;(p=P.value)==null||p.setNodeText(y.id,y.text)}function Ne(y){var p;(p=P.value)==null||p.addChild(y)}function _e(y){var p;(p=P.value)==null||p.addSibling(y)}function Re(y){var p;(p=P.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const xe=e.computed(()=>{var y;return((y=s.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",_p,[e.createVNode(Mt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=L=>d.value=L)},{default:e.withCtx(()=>[e.createVNode(zo,{data:c.value,"selected-id":xe.value,"collapsed-ids":u.value,onSelect:F,onToggleCollapse:G,onEdit:le,onAddChild:Ne,onAddSibling:_e,onMove:Re},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Mp,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=L=>_.value=!1)},[...p[11]||(p[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",vp,[e.createVNode(Jo,{ref_key:"mindMapRef",ref:P,data:c.value,"preview-mode":_.value,"built-in-drawers":!1,onChange:ee,onSelect:ae,onEditNote:ie,onCanvasSettings:p[2]||(p[2]=L=>$.value=!0),onCanvasData:C,onCanvasImport:x,onCanvasTogglePreview:p[3]||(p[3]=L=>_.value=!_.value),onCanvasOutline:p[4]||(p[4]=L=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Mt,{side:"right",width:360,open:g.value&&!_.value,title:"数据","onUpdate:open":p[6]||(p[6]=L=>g.value=L)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,onImport:p[5]||(p[5]=L=>c.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:420,open:h.value&&!_.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=L=>h.value=L)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:p[7]||(p[7]=L=>c.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:360,open:w.value&&!_.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=L=>w.value=L)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":s.value,readonly:!1,"focus-tick":S.value,onApply:te,onRemove:J,onSetLink:I,onSetImage:A,onSetRich:U},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:340,open:$.value&&!_.value,title:"设置","onUpdate:open":p[10]||(p[10]=L=>$.value=L)},{default:e.withCtx(()=>{var L;return[e.createVNode(Do,{settings:k,"has-selection":s.value!==null,"selected-node-text":(L=s.value)==null?void 0:L.text,"node-style":f.value,"onUpdate:settings":R,"onUpdate:nodeStyle":E,onReset:Y},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),Rp="0.5.2",Bp={install(t){t.component("FlowMindMap",Jo),t.component("FlowMindMapOutline",zo),t.component("FlowMindMapDrawer",Mt),t.component("FlowMindMapDataPanel",Oo),t.component("FlowMindMapMarkdownPanel",Lo),t.component("FlowMindMapSettingsPanel",Do),t.component("FlowMindMapNotePanel",Zo),t.component("FlowMindMapApp",Gl)}};he.DataPanel=Oo,he.Drawer=Mt,he.MARKER_LIB=pr,he.MarkdownPanel=Lo,he.MindMap=Jo,he.MindMapApp=Gl,he.NotePanel=Zo,he.Outline=zo,he.SettingsPanel=Do,he.VERSION=Rp,he.addChild=bi,he.addSibling=ki,he.clone=_t,he.default=Bp,he.findNode=re,he.findParent=Lt,he.markdownToMindMap=zn,he.markdownToRichMindMap=Xa,he.markerDef=as,he.markerLabel=xi,he.markerSvg=Io,he.mindMapToMarkdown=On,he.removeNode=Mo,he.richBlockToMarkdown=Za,he.tagColor=gr,he.uid=Gt,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
166
+ 鼠标悬浮预览前 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 E=(D,X)=>({id:D,text:X,children:[]}),p=[E("s_l1","左一"),E("s_l2","左二"),E("s_l3","左三"),E("s_l4","左四"),E("s_l5","左五"),E("s_l6","左六"),E("s_l7","左七")],O=[E("s_r1","右一"),E("s_r2","右二"),E("s_r3","右三"),E("s_r4","右四"),E("s_r5","右五"),E("s_r6","右六"),E("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...O]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),h=e.ref(!1),N=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),F=e.ref(null);function B(){c.value=n()}function _(){g.value=!0,h.value=!1,N.value=!1}function x(E){_()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",lineOrigin:"edge",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var E;return s.value?((E=F.value)==null?void 0:E.getNodeStyle(s.value.id))??{}:{}});function P(E){var p;Object.assign(k,E),(p=F.value)==null||p.applySettings(E)}function L(E){var p;s.value&&((p=F.value)==null||p.applyNodeStyle(s.value.id,E))}function S(){var p;const E={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",lineOrigin:"edge",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,E),(p=F.value)==null||p.applySettings(E)}function K(E){if(E.key==="Escape"){if($.value){$.value=!1,E.stopPropagation();return}R.value&&(R.value=!1,E.stopPropagation())}}e.onMounted(()=>{var E;document.addEventListener("keydown",K),window.addEventListener("hashchange",B),(E=F.value)==null||E.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",K),window.removeEventListener("hashchange",B)});function J(E){c.value=E}function de(E){var O;const p=E&&E.length>0?E[0]:null;s.value=p,p?!N.value&&((O=F.value)!=null&&O.nodeHasContent(p.id))&&(g.value=!1,h.value=!1,N.value=!0):N.value=!1}e.watch(c,E=>{if(!s.value)return;const p=Y(E,s.value.id);p?p!==s.value&&(s.value=p):s.value=null},{deep:!1});function ee(E){if(!s.value||s.value.id!==E){const p=Y(c.value,E);p&&(s.value=p)}g.value=!1,h.value=!1,N.value=!0,C.value++}function Y(E,p){if(E.id===p)return E;for(const O of E.children){const D=Y(O,p);if(D)return D}return null}function oe(E){var p;s.value&&((p=F.value)==null||p.applyNodeNote(s.value.id,E))}function ie(){var E;s.value&&((E=F.value)==null||E.removeNodeNote(s.value.id))}function ye(E){var p;s.value&&((p=F.value)==null||p.applyNodeLink(s.value.id,E))}function y(E){var p;s.value&&((p=F.value)==null||p.applyNodeImageByUrl(s.value.id,E))}function V(E){var p;s.value&&((p=F.value)==null||p.applyNodeRichContent(s.value.id,E))}function U(E){const p=document.querySelector(`[data-node-id="${E.id}"]`);p&&p.click()}function j(E){const p=new Set(u.value);p.has(E)?p.delete(E):p.add(E),u.value=p}function ae(E){var p;(p=F.value)==null||p.setNodeText(E.id,E.text)}function Me(E){var p;(p=F.value)==null||p.addChild(E)}function ze(E){var p;(p=F.value)==null||p.addSibling(E)}function De(E){var p;(p=F.value)==null||p.moveNode(E.srcId,E.targetId,E.position)}const Ae=e.computed(()=>{var E;return((E=s.value)==null?void 0:E.id)??null});return(E,p)=>(e.openBlock(),e.createElementBlock("div",$p,[e.createVNode(Dt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=O=>d.value=O)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":Ae.value,"collapsed-ids":u.value,onSelect:U,onToggleCollapse:j,onEdit:ae,onAddChild:Me,onAddSibling:ze,onMove:De},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Pp,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=O=>R.value=!1)},[...p[11]||(p[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",Fp,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:J,onSelect:de,onEditNote:ee,onCanvasSettings:p[2]||(p[2]=O=>$.value=!0),onCanvasData:_,onCanvasImport:x,onCanvasTogglePreview:p[3]||(p[3]=O=>R.value=!R.value),onCanvasOutline:p[4]||(p[4]=O=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Dt,{side:"right",width:360,open:g.value&&!R.value,title:"数据","onUpdate:open":p[6]||(p[6]=O=>g.value=O)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:p[5]||(p[5]=O=>c.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=O=>h.value=O)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:p[7]||(p[7]=O=>c.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",width:360,open:N.value&&!R.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=O=>N.value=O)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:oe,onRemove:ie,onSetLink:ye,onSetImage:y,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":p[10]||(p[10]=O=>$.value=O)},{default:e.withCtx(()=>{var O;return[e.createVNode(Vo,{settings:k,"has-selection":s.value!==null,"selected-node-text":(O=s.value)==null?void 0:O.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":L,onReset:S},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),Up="0.5.4",Hp={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Dt),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",Vo),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",Hl)}};xe.DataPanel=Lo,xe.Drawer=Dt,xe.MARKER_LIB=gi,xe.MarkdownPanel=Do,xe.MindMap=Qo,xe.MindMapApp=Hl,xe.NotePanel=Jo,xe.Outline=Oo,xe.SettingsPanel=Vo,xe.VERSION=Up,xe.addChild=gr,xe.addSibling=hr,xe.clone=Lt,xe.default=Hp,xe.findNode=le,xe.findParent=Wt,xe.markdownToMindMap=In,xe.markdownToRichMindMap=Za,xe.markerDef=ss,xe.markerLabel=yr,xe.markerSvg=zo,xe.mindMapToMarkdown=zn,xe.removeNode=Ro,xe.richBlockToMarkdown=Ja,xe.tagColor=hi,xe.uid=Xt,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});