flow-mindmap 0.4.6 → 0.4.7

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,26 +1,26 @@
1
- (function(Ee,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ee=typeof globalThis<"u"?globalThis:Ee||self,e(Ee.FlowMind={},Ee.Vue))})(this,function(Ee,e){"use strict";var hf=Object.defineProperty;var bf=(Ee,e,Yt)=>e in Ee?hf(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):Ee[e]=Yt;var Ae=(Ee,e,Yt)=>bf(Ee,typeof e!="symbol"?e+"":e,Yt);var no;const Yt=["width","height","stroke-width"],al={key:4,points:"6 9 12 15 18 9"},sl={key:5,points:"9 6 15 12 9 18"},xe=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",al)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",sl)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[43]||(n[43]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[44]||(n[44]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[57]||(n[57]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[58]||(n[58]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[66]||(n[66]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[67]||(n[67]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Yt))}}),di="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",ui="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",mi=[18,15,13,12],cl=[700,600,500,400],dl=[52,40,32,28],ul=[120,80,60,44],ml=[.8,.8,.8,.8],fl=mi.length-1;function pl(t,o){return Math.round(Eo(t,o)*ml[Dn(t)])}function Dn(t){return Math.min(fl,Math.max(0,t))}function Eo(t,o=14){return Math.round(mi[Dn(t)]*o/14*10)/10}function gl(t,o=14){return Math.round(dl[Dn(t)]*o/14)}const Vn=60,Xt=14,st=24;let xo=null;function hl(){if(xo)return xo;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(xo=t,t):{font:"",measureText:()=>({width:0})}}const fi=new Map;function bl(t,o,n){const i=`${n}|${o}|${t}`,r=fi.get(i);if(r!==void 0)return r;const s=hl();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return fi.set(i,c),c}const kl=24,yl=400,El=8,pi=16,xl=4,wl=200;function Nl(t,o,n){return Math.min(n,Math.max(o,t))}function Sl(t,o,n,i,r){const s=Dn(o),c=Eo(o,n),u=Math.min(bl(t.text||"",c,cl[s]),wl),d=pl(o,n),m=Math.ceil(u+d*2),k=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:gl(o,n);let y=0;if(t.link&&(y+=pi),t.note&&(y+=pi),y>0){const b=(t.link?1:0)+(t.note?1:0);y+=xl*b}const w=m+y,E=(()=>{const b=Math.round(ul[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const v=r==null?void 0:r[t.id];return Math.max(b,v??240)}return b})(),L=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),C=i==null?void 0:i[t.id],x=L?Math.max(24,C??Math.max(70,Math.ceil(c*5))):0,R=x>0?10:0;if(!t.image){const b=Math.max(E,w),v=Math.ceil(k+R+x);return{w:b,h:v}}const S=Nl(t.image.width,kl,yl),g=Math.max(E,w,Math.ceil(S+d*2)),_=Math.ceil(t.image.height+El+k+R+x);return{w:g,h:_}}function Tl(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,s=hi(t,0,null,1,"right",r,o.richHeights,o.richWidths);return _l(s),Cl(s,n,i),s.x=0,s.y=0,Al(s,i)}function Cl(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((k,y)=>k+y._subtreeH,0);let d=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let k=0;k<i.length-1;k++){p+=i[k]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,d=k+1)}for(let k=0;k<d;k++)i[k]._dir="right",i[k].side=1,i[k]._dirRight=1;for(let k=d;k<i.length;k++)i[k]._dir="left",i[k].side=-1,i[k]._dirRight=-1}const r=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const m=d==="right"?1:-1;u._dir=d,u.side=m,u._dirRight=m;for(const p of u.children)c(p,d)};for(const u of r)c(u,"right");for(const u of s)c(u,"left");if(r.length>0){const u={...t,children:r};$n(u,"right",Vn,!0,n)}if(s.length>0){const u={...t,children:s};$n(u,"left",Vn,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const s of r.children)i(s)};for(const r of t.children)r._dir="right";$n(t,"right",Vn,!0,n),i(t)}else{for(const i of t.children)i._dir="down";gi(t,Vn,n)}}function $n(t,o,n,i,r=!1){if(t.children.length===0)return;const s=t.children.reduce((m,p,k)=>m+p._subtreeH+(k>0?Xt:0),0),c=o==="right"?1:-1,u=i?c:1;let d=t.y-u*s/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=d+u*m._subtreeH/2),m._dir=o,d+=u*(m._subtreeH+Xt),$n(m,o,n,!1,r)})}function gi(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Xt*2:0),0);let r=t.x-i/2;t.children.forEach(s=>{n||(s.x=r+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",r+=s._subtreeW+Xt*2,gi(s,o,n)})}function hi(t,o,n,i,r,s,c,u){const d=Sl(t,o,s,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:Eo(o,s),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_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,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,k=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const E=o===0?w<k?1:-1:i;return hi(y,o+1,m,E,r,s,c,u)}),m}function _l(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}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 r=0,s=0;for(const c of i.children)r+=c._subtreeH,s+=c._subtreeW;i.children.length>1&&(r+=Xt*(i.children.length-1),s+=Xt*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,s)}}function Al(t,o=!1){const n=[t];let i=1/0,r=-1/0,s=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,k=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-k<s&&(s=m.y-k),m.y+k>c&&(c=m.y+k),n.push(...m.children)}if(o)return{root:t,width:r-i+st*2,height:c-s+st*2,vbX:i-st,vbY:s-st,vbW:r-i+st*2,vbH:c-s+st*2};const u=st-s,d=[t];for(;d.length;){const m=d.pop();m.y+=u,d.push(...m.children)}return s+=u,c+=u,{root:t,width:r-i+st*2,height:c+st,vbX:i-st,vbY:0,vbW:r-i+st*2,vbH:c+st}}const Ct=[{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 Ml(t,o=[]){return[...Ct,...o].find(i=>i.id===t)??Ct[0]}function Rl(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=r.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=Bl(c):c.startsWith("rgb")?u=zl(c):u=Il[c.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 Bl(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 zl(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 r=0;r<3;r++){const s=n[r];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const Il={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function ct(t){return JSON.parse(JSON.stringify(t))}function fe(t,o){if(t.id===o)return t;for(const n of t.children){const i=fe(n,o);if(i)return i}return null}function ut(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ut(i,o,t);if(r!==null)return r}return null}function Pn(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(Pn(i,o))return!0;return!1}function Ol(t,o,n){const i=fe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function vl(t,o,n,i){if(!ut(t,o)||o===n||fe(fe(t,o),n))return!1;const r=ut(t,o),s=r.children.findIndex(m=>m.id===o);if(s<0)return!1;const[c]=r.children.splice(s,1);if(i==="child"){const m=fe(t,n);return m?(m.children.push(c),!0):(r.children.splice(s,0,c),!1)}const u=ut(t,n);if(!u)return r.children.splice(s,0,c),!1;let d=u.children.findIndex(m=>m.id===n);return d<0?(r.children.splice(s,0,c),!1):(i==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function bi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const s=r.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Un:n>0?`新节点 ${n+1}`:"新节点 2"}function ki(t,o,n){const i=fe(t,o);if(!i)return null;const r={id:kt(),text:n??bi(i),children:[]};return i.children.push(r),r}function yi(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:kt(),text:n??bi(i),children:[]};return i.children.splice(r+1,0,s),s}function Ll(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:kt(),text:n,children:[]};return i.children.splice(r,0,s),s}function Dl(t,o){const n=ut(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],s=ct(r);return Fn(s),n.children.splice(i+1,0,s),s}function Fn(t){t.id=kt();for(const o of t.children)Fn(o)}function Ei(t,o){const n=fe(t,o);if(!n||n.id===t.id)return null;const i=ct(n);return Fn(i),i}const Un="新节点";function Zt(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:kt(),text:o,children:[]},r=[i],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let k=!1,y=[],w=null;function E(x){y.push(x)}function L(){if(w&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
2
- `);x&&(w.note={text:x})}k=!1,y=[]}for(const x of n){if(k){const b=x.match(p);if(b&&b[1][0]==="`"){L();continue}E(x);continue}const R=x.match(u);if(R){const b=R[1].length,v=R[2].trim();c.push({level:b,text:v,body:""}),w=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){k=!0,y=[];continue}const g=x.match(d);if(g&&w){const b=g[2],v=160,H=120;w.image={src:b,naturalW:v,naturalH:H,width:v,height:H};continue}const _=x.match(m);if(_&&w){w.link={url:_[2]},w.text=_[1];continue}if(x.trim().length>0&&w){const b=x.trim();w.body=w.body?w.body+`
3
- `+b:b}}k&&L();function C(x){for(;r.length>1;){const _=r.length-1,b=s[_];if(b!==void 0&&b<x.level)break;r.pop(),s.pop()}const R=r[r.length-1],S=x.text,g={id:kt(),text:S,children:[]};x.image&&(g.image={...x.image}),x.link&&(g.link={url:x.link.url}),x.note&&(g.note={text:x.note.text}),x.body&&(g.note={text:x.body}),R.children.push(g),r.push(g),s.push(x.level)}for(const x of c)C(x);if(c.length>0&&c[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Jt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(Ee,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ee=typeof globalThis<"u"?globalThis:Ee||self,e(Ee.FlowMind={},Ee.Vue))})(this,function(Ee,e){"use strict";var ym=Object.defineProperty;var Em=(Ee,e,Xt)=>e in Ee?ym(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Ee[e]=Xt;var Ae=(Ee,e,Xt)=>Em(Ee,typeof e!="symbol"?e+"":e,Xt);var oo;const Xt=["width","height","stroke-width"],dl={key:4,points:"6 9 12 15 18 9"},ul={key:5,points:"9 6 15 12 9 18"},xe=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",dl)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ul)):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)):e.createCommentVNode("",!0)],8,Xt))}}),fi="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",mi="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",pi=[18,15,13,12],fl=[700,600,500,400],ml=[52,40,32,28],pl=[120,80,60,44],gl=[.8,.8,.8,.8],hl=pi.length-1;function bl(t,o){return Math.round(wo(t,o)*gl[Vn(t)])}function Vn(t){return Math.min(hl,Math.max(0,t))}function wo(t,o=14){return Math.round(pi[Vn(t)]*o/14*10)/10}function kl(t,o=14){return Math.round(ml[Vn(t)]*o/14)}const $n=60,Zt=14,st=24;let No=null;function yl(){if(No)return No;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(No=t,t):{font:"",measureText:()=>({width:0})}}const gi=new Map;function El(t,o,n){const i=`${n}|${o}|${t}`,r=gi.get(i);if(r!==void 0)return r;const s=yl();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return gi.set(i,c),c}const xl=24,wl=400,Nl=8,hi=16,Sl=4,Tl=200;function Cl(t,o,n){return Math.min(n,Math.max(o,t))}function _l(t,o,n,i,r){const s=Vn(o),c=wo(o,n),u=Math.min(El(t.text||"",c,fl[s]),Tl),d=bl(o,n),f=Math.ceil(u+d*2),k=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:kl(o,n);let y=0;if(t.link&&(y+=hi),t.note&&(y+=hi),y>0){const b=(t.link?1:0)+(t.note?1:0);y+=Sl*b}const N=f+y,E=(()=>{const b=Math.round(pl[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(b,O??240)}return b})(),L=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),C=i==null?void 0:i[t.id],x=L?Math.max(24,C??Math.max(70,Math.ceil(c*5))):0,R=x>0?10:0;if(!t.image){const b=Math.max(E,N),O=Math.ceil(k+R+x);return{w:b,h:O}}const S=Cl(t.image.width,xl,wl),g=Math.max(E,N,Math.ceil(S+d*2)),_=Math.ceil(t.image.height+Nl+k+R+x);return{w:g,h:_}}function Al(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,s=ki(t,0,null,1,"right",r,o.richHeights,o.richWidths);return Rl(s),Ml(s,n,i),s.x=0,s.y=0,Bl(s,i)}function Ml(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((k,y)=>k+y._subtreeH,0);let d=1,f=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let k=0;k<i.length-1;k++){p+=i[k]._subtreeH;const y=Math.abs(p-(u-p));y<f&&(f=y,d=k+1)}for(let k=0;k<d;k++)i[k]._dir="right",i[k].side=1,i[k]._dirRight=1;for(let k=d;k<i.length;k++)i[k]._dir="left",i[k].side=-1,i[k]._dirRight=-1}const r=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const f=d==="right"?1:-1;u._dir=d,u.side=f,u._dirRight=f;for(const p of u.children)c(p,d)};for(const u of r)c(u,"right");for(const u of s)c(u,"left");if(r.length>0){const u={...t,children:r};Pn(u,"right",$n,!0,n)}if(s.length>0){const u={...t,children:s};Pn(u,"left",$n,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const s of r.children)i(s)};for(const r of t.children)r._dir="right";Pn(t,"right",$n,!0,n),i(t)}else{for(const i of t.children)i._dir="down";bi(t,$n,n)}}function Pn(t,o,n,i,r=!1){if(t.children.length===0)return;const s=t.children.reduce((f,p,k)=>f+p._subtreeH+(k>0?Zt:0),0),c=o==="right"?1:-1,u=i?c:1;let d=t.y-u*s/2;t.children.forEach(f=>{r||(f.x=t.x+c*(t.width/2+n+f.width/2),f.y=d+u*f._subtreeH/2),f._dir=o,d+=u*(f._subtreeH+Zt),Pn(f,o,n,!1,r)})}function bi(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Zt*2:0),0);let r=t.x-i/2;t.children.forEach(s=>{n||(s.x=r+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",r+=s._subtreeW+Zt*2,bi(s,o,n)})}function ki(t,o,n,i,r,s,c,u){const d=_l(t,o,s,c,u),f={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:wo(o,s),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_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,children:[],parent:n};if(t.collapsed)return f;const p=t.children.length,k=Math.ceil(p/2);return f.children=t.children.map((y,N)=>{const E=o===0?N<k?1:-1:i;return ki(y,o+1,f,E,r,s,c,u)}),f}function Rl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}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 r=0,s=0;for(const c of i.children)r+=c._subtreeH,s+=c._subtreeW;i.children.length>1&&(r+=Zt*(i.children.length-1),s+=Zt*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,s)}}function Bl(t,o=!1){const n=[t];let i=1/0,r=-1/0,s=1/0,c=-1/0;for(;n.length;){const f=n.pop(),p=f.width/2,k=f.height/2;f.x-p<i&&(i=f.x-p),f.x+p>r&&(r=f.x+p),f.y-k<s&&(s=f.y-k),f.y+k>c&&(c=f.y+k),n.push(...f.children)}if(o)return{root:t,width:r-i+st*2,height:c-s+st*2,vbX:i-st,vbY:s-st,vbW:r-i+st*2,vbH:c-s+st*2};const u=st-s,d=[t];for(;d.length;){const f=d.pop();f.y+=u,d.push(...f.children)}return s+=u,c+=u,{root:t,width:r-i+st*2,height:c+st,vbX:i-st,vbY:0,vbW:r-i+st*2,vbH:c+st}}const _t=[{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 zl(t,o=[]){return[..._t,...o].find(i=>i.id===t)??_t[0]}function Il(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=r.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=Ol(c):c.startsWith("rgb")?u=vl(c):u=Ll[c.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 Ol(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 vl(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 r=0;r<3;r++){const s=n[r];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ll={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function yt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function ct(t){return JSON.parse(JSON.stringify(t))}function fe(t,o){if(t.id===o)return t;for(const n of t.children){const i=fe(n,o);if(i)return i}return null}function ut(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ut(i,o,t);if(r!==null)return r}return null}function Fn(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(Fn(i,o))return!0;return!1}function Dl(t,o,n){const i=fe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Vl(t,o,n,i){if(!ut(t,o)||o===n||fe(fe(t,o),n))return!1;const r=ut(t,o),s=r.children.findIndex(f=>f.id===o);if(s<0)return!1;const[c]=r.children.splice(s,1);if(i==="child"){const f=fe(t,n);return f?(f.children.push(c),!0):(r.children.splice(s,0,c),!1)}const u=ut(t,n);if(!u)return r.children.splice(s,0,c),!1;let d=u.children.findIndex(f=>f.id===n);return d<0?(r.children.splice(s,0,c),!1):(i==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function yi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const s=r.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Hn:n>0?`新节点 ${n+1}`:"新节点 2"}function Ei(t,o,n){const i=fe(t,o);if(!i)return null;const r={id:yt(),text:n??yi(i),children:[]};return i.children.push(r),r}function xi(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:yt(),text:n??yi(i),children:[]};return i.children.splice(r+1,0,s),s}function $l(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:yt(),text:n,children:[]};return i.children.splice(r,0,s),s}function Pl(t,o){const n=ut(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],s=ct(r);return Un(s),n.children.splice(i+1,0,s),s}function Un(t){t.id=yt();for(const o of t.children)Un(o)}function wi(t,o){const n=fe(t,o);if(!n||n.id===t.id)return null;const i=ct(n);return Un(i),i}const Hn="新节点";function Jt(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:yt(),text:o,children:[]},r=[i],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,f=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let k=!1,y=[],N=null;function E(x){y.push(x)}function L(){if(N&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
2
+ `);x&&(N.note={text:x})}k=!1,y=[]}for(const x of n){if(k){const b=x.match(p);if(b&&b[1][0]==="`"){L();continue}E(x);continue}const R=x.match(u);if(R){const b=R[1].length,O=R[2].trim();c.push({level:b,text:O,body:""}),N=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){k=!0,y=[];continue}const g=x.match(d);if(g&&N){const b=g[2],O=160,W=120;N.image={src:b,naturalW:O,naturalH:W,width:O,height:W};continue}const _=x.match(f);if(_&&N){N.link={url:_[2]},N.text=_[1];continue}if(x.trim().length>0&&N){const b=x.trim();N.body=N.body?N.body+`
3
+ `+b:b}}k&&L();function C(x){for(;r.length>1;){const _=r.length-1,b=s[_];if(b!==void 0&&b<x.level)break;r.pop(),s.pop()}const R=r[r.length-1],S=x.text,g={id:yt(),text:S,children:[]};x.image&&(g.image={...x.image}),x.link&&(g.link={url:x.link.url}),x.note&&(g.note={text:x.note.text}),x.body&&(g.note={text:x.body}),R.children.push(g),r.push(g),s.push(x.level)}for(const x of c)C(x);if(c.length>0&&c[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Qt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
4
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
5
5
  `),t.image&&(n+=`![image](${t.image.src})
6
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
7
- `);for(const i of t.children)n+=Jt(i,o+1);return n}function Vl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const k=o[i],y=k.match(s);if(y){const S=y[1][0],g=y[2]||"",_=[k];for(i++;i<o.length;){const v=o[i].match(s);if(v&&v[1][0]===S){_.push(o[i]),i++;break}_.push(o[i]),i++}const b=_.slice(1,-1).join(`
8
- `).trim();n.push({kind:"code",text:((m=b.split(`
9
- `)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:_.join(`
10
- `),lang:g});continue}const w=k.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:k}),i++;continue}if(/^\s*\|/.test(k)){const S=[];let g=i,_=!1;for(;g<o.length&&/^\s*\|/.test(o[g]);)S.push(o[g]),c.test(o[g])&&(_=!0),g++;if(_&&S.length>=2){n.push({kind:"table",text:((p=S[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:S.join(`
7
+ `);for(const i of t.children)n+=Qt(i,o+1);return n}function Fl(t){var f,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const k=o[i],y=k.match(s);if(y){const S=y[1][0],g=y[2]||"",_=[k];for(i++;i<o.length;){const O=o[i].match(s);if(O&&O[1][0]===S){_.push(o[i]),i++;break}_.push(o[i]),i++}const b=_.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((f=b.split(`
9
+ `)[0])==null?void 0:f.slice(0,80))||"(空代码块)",raw:_.join(`
10
+ `),lang:g});continue}const N=k.match(r);if(N){n.push({kind:"heading",level:N[1].length,text:N[2].trim(),raw:k}),i++;continue}if(/^\s*\|/.test(k)){const S=[];let g=i,_=!1;for(;g<o.length&&/^\s*\|/.test(o[g]);)S.push(o[g]),c.test(o[g])&&(_=!0),g++;if(_&&S.length>=2){n.push({kind:"table",text:((p=S[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:S.join(`
11
11
  `)}),i=g;continue}}const E=k.match(u),L=k.match(d);if(E||L){let S=i;for(;S<o.length;){const g=o[S].match(u),_=o[S].match(d);if(!(g||_))break;const b=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();b.length>0&&n.push({kind:"list",text:b.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(k.trim()===""){i++;continue}const C=[k];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||s.test(S)||u.test(S)||d.test(S)||/^\s*\|/.test(S))break;C.push(S),x++}const R=C.join(" ").trim();n.push({kind:"paragraph",text:R.slice(0,80)||"(空段落)",raw:C.join(`
12
- `)}),i=x}return n}function $l(t,o="导入的导图"){const n=Vl(t||""),i={id:kt(),text:o,children:[]},r=[i],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const p=d.level;for(;r.length>1&&s[s.length-1]>=p;)r.pop(),s.pop();if(!c&&p===1){c=!0,i.text=d.text,s[0]=1;return}const k={id:kt(),text:d.text,children:[]};r[r.length-1].children.push(k),r.push(k),s.push(p);return}const m={id:kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};r[r.length-1].children.push(m)}for(const d of n)u(d);return i}function Pl(t){return t.richContent?t.richContent.raw+`
13
- `:""}function Fl(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),k=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function E(q){w=q}function L(q){q.preventDefault();const J=t.getContainer();if(!J)return;const ae=-q.deltaY*.001,W=Math.min(n,Math.max(o,r.value*(1+ae))),K=J.getBoundingClientRect(),F=q.clientX-K.left,N=q.clientY-K.top,P=(F-s.value)/r.value,D=(N-c.value)/r.value;r.value=W,s.value=F-P*W,c.value=N-D*W}function C(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function R(q){var ae;q.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.x=q.clientX,d.y=q.clientY,d.ox=s.value,d.oy=c.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",g),(ae=q.preventDefault)==null||ae.call(q))}function S(q){u.value&&(s.value=d.ox+(q.clientX-d.x),c.value=d.oy+(q.clientY-d.y))}function g(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",g)}function _(q,J,ae){m.value=!0,p.x=q,p.y=J,k.x=q,k.y=J,k.width=0,k.height=0,k.shiftKey=!!(ae!=null&&ae.shift),y.value++,window.addEventListener("mousemove",H),window.addEventListener("mouseup",v)}function b(q,J){if(!m.value)return;const ae=Math.min(p.x,q),W=Math.min(p.y,J),K=Math.max(p.x,q),F=Math.max(p.y,J);k.x=ae,k.y=W,k.width=K-ae,k.height=F-W,y.value++}function v(){m.value=!1,window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",v),w&&w()}function H(q){if(!m.value)return;const J=t.getContainer();if(!J)return;const ae=J.getBoundingClientRect(),W=(q.clientX-ae.left-s.value)/r.value,K=(q.clientY-ae.top-c.value)/r.value;b(W,K)}function oe(q,J,ae,W=60){const K=t.getContainer();if(!K)return;const F=K.getBoundingClientRect(),N=(F.width-W*2)/q,P=(F.height-W*2)/J,D=Math.min(1,Math.max(.3,Math.min(N,P)));r.value=D,s.value=F.width/2,c.value=F.height/2-ae*D}return{scale:r,offsetX:s,offsetY:c,isPanning:u,onWheel:L,zoomIn:C,zoomOut:x,startPan:R,startMarquee:_,updateMarquee:b,isMarquee:m,marquee:k,marqueeVersion:y,setOnMarqueeEnd:E,resetView:oe}}const Ul=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xi(t){return Ul?t.metaKey:t.ctrlKey}function Hl(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const r=t.getSelectedIds();return r.length>0?r[0]:null}function n(i){var u,d,m;const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(xi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const p=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==p&&(i.preventDefault(),t.onDuplicate(s));return}if(i.key==="c"||i.key==="C"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCopy(p));return}if(i.key==="x"||i.key==="X"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCut(p));return}if(i.key==="v"||i.key==="V"){i.preventDefault();const p=t.getSelectedIds();t.onPaste(p.length>0?p[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(xi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(c);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const p=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==p&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(i.key==="Delete"||i.key==="Backspace")&&s&&s!==((m=t.defaultTargetId)==null?void 0:m.call(t))?(i.preventDefault(),t.onRemove(s)):i.key==="F2"&&s?(i.preventDefault(),t.onStartEdit(s)):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 Wl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function s(m){const p=JSON.stringify(m);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:s,undo:c,redo:u,reset:d}}const Gl=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,w=n.y+2;if(n.container){const E=n.container.getBoundingClientRect(),L=180,x=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+L>E.right&&(y=Math.max(E.left+4,n.x-L-2)),w+x>E.bottom&&(w=Math.max(E.top+4,n.y-x-2)),y<E.left+2&&(y=E.left+2),w<E.top+2&&(w=E.top+2)}return{left:y,top:w}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function d(y){const w=y.target;w&&w.closest(".zm-node-menu")||i("close")}function m(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function k(y){y(),i("close")}return(y,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(E=>k(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(E=>k(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(E=>k(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:w[3]||(w[3]=e.withModifiers(E=>k(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(E=>k(()=>i("addCode")),["stop"]))},[w[13]||(w[13]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:w[5]||(w[5]=e.withModifiers(E=>k(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(E=>k(()=>i("addTable")),["stop"]))},[w[15]||(w[15]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:w[7]||(w[7]=e.withModifiers(E=>k(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(E=>k(()=>i("editNote")),["stop"]))},[e.createVNode(xe,{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:w[9]||(w[9]=e.withModifiers(E=>k(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),jl=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let C=n.x+2,x=n.y+2;if(n.container){const R=n.container.getBoundingClientRect(),S=160,g=4+3*28;C+S>R.right&&(C=Math.max(R.left+4,n.x-S-2)),x+g>R.bottom&&(x=Math.max(R.top+4,n.y-g-2)),C<R.left+2&&(C=R.left+2),x<R.top+2&&(x=R.top+2)}return{left:C,top:x}}),s=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const C=c.value.getBoundingClientRect(),x=window.innerWidth,R=window.innerHeight,S=176,g=4+3*28;let _=C.right;_+S>x-4&&(_=Math.max(4,C.left-S));let b=C.top-4;return b+g>R-4&&(b=Math.max(4,R-g-4)),{left:_+"px",top:b+"px",display:"block"}});let d=null,m=null;function p(){m&&(clearTimeout(m),m=null),d=setTimeout(()=>{s.value=!0},60)}function k(){d&&(clearTimeout(d),d=null),m=setTimeout(()=>{s.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),m&&clearTimeout(m)});function y(C){const x=C.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(C){C.key==="Escape"&&i("close")}function E(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",E,!0),window.addEventListener("scroll",E,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",E,!0),window.removeEventListener("scroll",E,!0)});function L(C){C(),i("close")}return(C,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(R=>L(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value}]),onMouseenter:p,onMouseleave:k},[e.createVNode(xe,{name:"import",size:13}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:k},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(R=>L(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(R=>L(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(R=>L(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"note",size:13}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(R=>L(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Kl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wi(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)&&wi(n)}),t}class Ni{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Si(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Rt(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const ql="</span>",Ti=t=>!!t.scope,Yl=(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,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Xl{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Si(o)}openNode(o){if(!Ti(o))return;const n=Yl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ti(o)&&(this.buffer+=ql)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ci=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class wo{constructor(){this.rootNode=Ci(),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=Ci({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=>{wo._collapse(n)}))}}class Zl extends wo{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 Xl(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sn(t){return t?typeof t=="string"?t:t.source:null}function _i(t){return Ft("(?=",t,")")}function Jl(t){return Ft("(?:",t,")*")}function Ql(t){return Ft("(?:",t,")?")}function Ft(...t){return t.map(n=>Sn(n)).join("")}function ea(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function No(...t){return"("+(ea(t).capture?"":"?:")+t.map(i=>Sn(i)).join("|")+")"}function Ai(t){return new RegExp(t.toString()+"|").exec("").length-1}function ta(t,o){const n=t&&t.exec(o);return n&&n.index===0}const na=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function So(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let s=Sn(i),c="";for(;s.length>0;){const u=na.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const oa=/\b\B/,Mi="[a-zA-Z]\\w*",To="[a-zA-Z_]\\w*",Ri="\\b\\d+(\\.\\d+)?",Bi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",zi="\\b(0b[01]+)",ia="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ra=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ft(o,/.*\b/,t.binary,/\b.*/)),Rt({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},Tn={begin:"\\\\[\\s\\S]",relevance:0},la={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Tn]},aa={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Tn]},sa={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/},Hn=function(t,o,n={}){const i=Rt({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 r=No("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:Ft(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},ca=Hn("//","$"),da=Hn("/\\*","\\*/"),ua=Hn("#","$"),ma={scope:"number",begin:Ri,relevance:0},fa={scope:"number",begin:Bi,relevance:0},pa={scope:"number",begin:zi,relevance:0},ga={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Tn,{begin:/\[/,end:/\]/,relevance:0,contains:[Tn]}]},ha={scope:"title",begin:Mi,relevance:0},ba={scope:"title",begin:To,relevance:0},ka={begin:"\\.\\s*"+To,relevance:0};var Wn=Object.freeze({__proto__:null,APOS_STRING_MODE:la,BACKSLASH_ESCAPE:Tn,BINARY_NUMBER_MODE:pa,BINARY_NUMBER_RE:zi,COMMENT:Hn,C_BLOCK_COMMENT_MODE:da,C_LINE_COMMENT_MODE:ca,C_NUMBER_MODE:fa,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:ua,IDENT_RE:Mi,MATCH_NOTHING_RE:oa,METHOD_GUARD:ka,NUMBER_MODE:ma,NUMBER_RE:Ri,PHRASAL_WORDS_MODE:sa,QUOTE_STRING_MODE:aa,REGEXP_MODE:ga,RE_STARTERS_RE:ia,SHEBANG:ra,TITLE_MODE:ha,UNDERSCORE_IDENT_RE:To,UNDERSCORE_TITLE_MODE:ba});function ya(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Ea(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ya,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function wa(t,o){Array.isArray(t.illegal)&&(t.illegal=No(...t.illegal))}function Na(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 Sa(t,o){t.relevance===void 0&&(t.relevance=1)}const Ta=(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=Ft(n.beforeMatch,_i(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ca=["of","and","for","in","not","or","if","then","parent","list","value"],_a="keyword";function Ii(t,o,n=_a){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(s){Object.assign(i,Ii(t[s],o,s))}),i;function r(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");i[d[0]]=[s,Aa(d[0],d[1])]})}}function Aa(t,o){return o?Number(o):Ma(t)?0:1}function Ma(t){return Ca.includes(t.toLowerCase())}const Oi={},Ut=t=>{console.error(t)},vi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Qt=(t,o)=>{Oi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Oi[`${t}/${o}`]=!0)},Gn=new Error;function Li(t,o,{key:n}){let i=0;const r=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],s[u+i]=!0,i+=Ai(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Ra(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gn;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ut("beginScope must be object"),Gn;Li(t,t.begin,{key:"beginScope"}),t.begin=So(t.begin,{joinWith:""})}}function Ba(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gn;if(typeof t.endScope!="object"||t.endScope===null)throw Ut("endScope must be object"),Gn;Li(t,t.end,{key:"endScope"}),t.end=So(t.end,{joinWith:""})}}function za(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ia(t){za(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ra(t),Ba(t)}function Oa(t){function o(c,u){return new RegExp(Sn(c),"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+=Ai(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(So(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const m=d.findIndex((k,y)=>y>0&&k!==void 0),p=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,p)}}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(([m,p])=>d.addRule(m,p)),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 m=d.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(c){const u=new i;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Ea,Na,Ia,Ta].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[xa,wa,Sa].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=Ii(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=Sn(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return va(p==="self"?c:p)})),c.contains.forEach(function(p){s(p,d)}),c.starts&&s(c.starts,u),d.matcher=r(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=Rt(t.classNameAliases||{}),s(t)}function Di(t){return t?t.endsWithParent||Di(t.starts):!1}function va(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return Rt(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Di(t)?Rt(t,{starts:t.starts?Rt(t.starts):null}):Object.isFrozen(t)?Rt(t):t}var La="11.11.1";class Da extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Co=Si,Vi=Rt,$i=Symbol("nomatch"),Va=7,Pi=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={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:Zl};function d(N){return u.noHighlightRe.test(N)}function m(N){let P=N.className+" ";P+=N.parentNode?N.parentNode.className:"";const D=u.languageDetectRe.exec(P);if(D){const Y=H(D[1]);return Y||(vi(s.replace("{}",D[1])),vi("Falling back to no-highlight mode for this block.",N)),Y?D[1]:"no-highlight"}return P.split(/\s+/).find(Y=>d(Y)||H(Y))}function p(N,P,D){let Y="",se="";typeof P=="object"?(Y=N,D=P.ignoreIllegals,se=P.language):(Qt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qt("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),se=N,Y=P),D===void 0&&(D=!0);const ke={code:Y,language:se};K("before:highlight",ke);const Re=ke.result?ke.result:k(ke.language,ke.code,D);return Re.code=ke.code,K("after:highlight",Re),Re}function k(N,P,D,Y){const se=Object.create(null);function ke(U,Z){return U.keywords[Z]}function Re(){if(!Q.keywords){Me.addText(we);return}let U=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(we),le="";for(;Z;){le+=we.substring(U,Z.index);const pe=We.case_insensitive?Z[0].toLowerCase():Z[0],ze=ke(Q,pe);if(ze){const[Ue,Je]=ze;if(Me.addText(le),le="",se[pe]=(se[pe]||0)+1,se[pe]<=Va&&(pt+=Je),Ue.startsWith("_"))le+=Z[0];else{const Ot=We.classNameAliases[Ue]||Ue;B(Z[0],Ot)}}else le+=Z[0];U=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(we)}le+=we.substring(U),Me.addText(le)}function Pe(){if(we==="")return;let U=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Me.addText(we);return}U=k(Q.subLanguage,we,!0,wt[Q.subLanguage]),wt[Q.subLanguage]=U._top}else U=w(we,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(pt+=U.relevance),Me.__addSublanguage(U._emitter,U.language)}function Te(){Q.subLanguage!=null?Pe():Re(),we=""}function B(U,Z){U!==""&&(Me.startScope(Z),Me.addText(U),Me.endScope())}function z(U,Z){let le=1;const pe=Z.length-1;for(;le<=pe;){if(!U._emit[le]){le++;continue}const ze=We.classNameAliases[U[le]]||U[le],Ue=Z[le];ze?B(Ue,ze):(we=Ue,Re(),we=""),le++}}function ie(U,Z){return U.scope&&typeof U.scope=="string"&&Me.openNode(We.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(B(we,We.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),we=""):U.beginScope._multi&&(z(U.beginScope,Z),we="")),Q=Object.create(U,{parent:{value:Q}}),Q}function re(U,Z,le){let pe=ta(U.endRe,le);if(pe){if(U["on:end"]){const ze=new Ni(U);U["on:end"](Z,ze),ze.isMatchIgnored&&(pe=!1)}if(pe){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return re(U.parent,Z,le)}function V(U){return Q.matcher.regexIndex===0?(we+=U[0],1):(Nt=!0,0)}function T(U){const Z=U[0],le=U.rule,pe=new Ni(le),ze=[le.__beforeBegin,le["on:begin"]];for(const Ue of ze)if(Ue&&(Ue(U,pe),pe.isMatchIgnored))return V(Z);return le.skip?we+=Z:(le.excludeBegin&&(we+=Z),Te(),!le.returnBegin&&!le.excludeBegin&&(we=Z)),ie(le,U),le.returnBegin?0:Z.length}function ce(U){const Z=U[0],le=P.substring(U.index),pe=re(Q,U,le);if(!pe)return $i;const ze=Q;Q.endScope&&Q.endScope._wrap?(Te(),B(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(Te(),z(Q.endScope,U)):ze.skip?we+=Z:(ze.returnEnd||ze.excludeEnd||(we+=Z),Te(),ze.excludeEnd&&(we=Z));do Q.scope&&Me.closeNode(),!Q.skip&&!Q.subLanguage&&(pt+=Q.relevance),Q=Q.parent;while(Q!==pe.parent);return pe.starts&&ie(pe.starts,U),ze.returnEnd?0:Z.length}function de(){const U=[];for(let Z=Q;Z!==We;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Me.openNode(Z))}let De={};function Ke(U,Z){const le=Z&&Z[0];if(we+=U,le==null)return Te(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&le===""){if(we+=P.slice(Z.index,Z.index+1),!r){const pe=new Error(`0 width match regex (${N})`);throw pe.languageName=N,pe.badRule=De.rule,pe}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!D){const pe=new Error('Illegal lexeme "'+le+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw pe.mode=Q,pe}else if(Z.type==="end"){const pe=ce(Z);if(pe!==$i)return pe}if(Z.type==="illegal"&&le==="")return we+=`
15
- `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=le,le.length}const We=H(N);if(!We)throw Ut(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');const mn=Oa(We);let It="",Q=Y||mn;const wt={},Me=new u.__emitter(u);de();let we="",pt=0,qe=0,gt=0,Nt=!1;try{if(We.__emitTokens)We.__emitTokens(P,Me);else{for(Q.matcher.considerAll();;){gt++,Nt?Nt=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=qe;const U=Q.matcher.exec(P);if(!U)break;const Z=P.substring(qe,U.index),le=Ke(Z,U);qe=U.index+le}Ke(P.substring(qe))}return Me.finalize(),It=Me.toHTML(),{language:N,value:It,relevance:pt,illegal:!1,_emitter:Me,_top:Q}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:Co(P),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:qe,context:P.slice(qe-100,qe+100),mode:U.mode,resultSoFar:It},_emitter:Me};if(r)return{language:N,value:Co(P),illegal:!1,relevance:0,errorRaised:U,_emitter:Me,_top:Q};throw U}}function y(N){const P={value:Co(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return P._emitter.addText(N),P}function w(N,P){P=P||u.languages||Object.keys(o);const D=y(N),Y=P.filter(H).filter(q).map(Te=>k(Te,N,!1));Y.unshift(D);const se=Y.sort((Te,B)=>{if(Te.relevance!==B.relevance)return B.relevance-Te.relevance;if(Te.language&&B.language){if(H(Te.language).supersetOf===B.language)return 1;if(H(B.language).supersetOf===Te.language)return-1}return 0}),[ke,Re]=se,Pe=ke;return Pe.secondBest=Re,Pe}function E(N,P,D){const Y=P&&n[P]||D;N.classList.add("hljs"),N.classList.add(`language-${Y}`)}function L(N){let P=null;const D=m(N);if(d(D))return;if(K("before:highlightElement",{el:N,language:D}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.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(N)),u.throwUnescapedHTML))throw new Da("One of your code blocks includes unescaped HTML.",N.innerHTML);P=N;const Y=P.textContent,se=D?p(Y,{language:D,ignoreIllegals:!0}):w(Y);N.innerHTML=se.value,N.dataset.highlighted="yes",E(N,D,se.language),N.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(N.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),K("after:highlightElement",{el:N,result:se,text:Y})}function C(N){u=Vi(u,N)}const x=()=>{g(),Qt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function R(){g(),Qt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function g(){function N(){g()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(L)}function _(N,P){let D=null;try{D=P(t)}catch(Y){if(Ut("Language definition for '{}' could not be registered.".replace("{}",N)),r)Ut(Y);else throw Y;D=c}D.name||(D.name=N),o[N]=D,D.rawDefinition=P.bind(null,t),D.aliases&&oe(D.aliases,{languageName:N})}function b(N){delete o[N];for(const P of Object.keys(n))n[P]===N&&delete n[P]}function v(){return Object.keys(o)}function H(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:P}){typeof N=="string"&&(N=[N]),N.forEach(D=>{n[D.toLowerCase()]=P})}function q(N){const P=H(N);return P&&!P.disableAutodetect}function J(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=P=>{N["before:highlightBlock"](Object.assign({block:P.el},P))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=P=>{N["after:highlightBlock"](Object.assign({block:P.el},P))})}function ae(N){J(N),i.push(N)}function W(N){const P=i.indexOf(N);P!==-1&&i.splice(P,1)}function K(N,P){const D=N;i.forEach(function(Y){Y[D]&&Y[D](P)})}function F(N){return Qt("10.7.0","highlightBlock will be removed entirely in v12.0"),Qt("10.7.0","Please use highlightElement now."),L(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:g,highlightElement:L,highlightBlock:F,configure:C,initHighlighting:x,initHighlightingOnLoad:R,registerLanguage:_,unregisterLanguage:b,listLanguages:v,getLanguage:H,registerAliases:oe,autoDetection:q,inherit:Vi,addPlugin:ae,removePlugin:W}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=La,t.regex={concat:Ft,lookahead:_i,either:No,optional:Ql,anyNumberOfTimes:Jl};for(const N in Wn)typeof Wn[N]=="object"&&wi(Wn[N]);return Object.assign(t,Wn),t},en=Pi({});en.newInstance=()=>Pi({});var $a=en;en.HighlightJS=en,en.default=en;const _o=Kl($a);function Ao(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 r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={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,r]};r.contains.push(u);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},k={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],x={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],g=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:C,built_in:[...R,...S,"set","shopt",...g,..._]},contains:[w,t.SHEBANG(),E,k,s,c,x,u,d,m,p,n]}}const Pa=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_-]*/}}),Fa=["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"],Ua=["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"],Ha=[...Fa,...Ua],Wa=["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(),Ga=["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(),ja=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ka=["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 qa(t){const o=t.regex,n=Pa(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[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:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ga.join("|")+")"},{begin:":(:)?("+ja.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ka.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Wa.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ha.join("|")+")\\b"}]}}function Fi(t){const s={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:s,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:s,illegal:/["']/}]}]}}var tn="[0-9](_*[0-9])*",jn=`\\.(${tn})`,Kn="[0-9a-fA-F](_*[0-9a-fA-F])*",Ui={className:"number",variants:[{begin:`(\\b(${tn})((${jn})|\\.)?|(${jn}))[eE][+-]?(${tn})[fFdD]?\\b`},{begin:`\\b(${tn})((${jn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${jn})[fFdD]?\\b`},{begin:`\\b(${tn})[fFdD]\\b`},{begin:`\\b0[xX]((${Kn})\\.?|(${Kn})?\\.(${Kn}))[pP][+-]?(${tn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Kn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Hi(t,o,n){return n===-1?"":t.replace(o,i=>Hi(t,o,n-1))}function Ya(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Hi("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={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:[p,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:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Ui,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Ui,m]}}const Wi="[A-Za-z$_][0-9A-Za-z$_]*",Xa=["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"],Za=["true","false","null","undefined","NaN","Infinity"],Gi=["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"],ji=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ki=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ja=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qa=[].concat(Ki,Gi,ji);function qi(t){const o=t.regex,n=(D,{after:Y})=>{const se="</"+D[0].slice(1);return D.input.indexOf(se,Y)!==-1},i=Wi,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,Y)=>{const se=D[0].length+D.index,ke=D.input[se];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(D,{after:se})||Y.ignoreMatch());let Re;const Pe=D.input.substring(se);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:Wi,keyword:Xa,literal:Za,built_in:Qa,"variable.language":Ja},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},v={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"}}]},H={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:{_:[...Gi,...ji]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,ae([...Ki,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,R,{match:/\$\d+/},k,H,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:N,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},W,J,v,F,{match:/\$[(.]/}]}}function es(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Yi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={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}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},k=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(k);let w=[n,d];return[m,p,k,y].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,s,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Xi(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:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},k={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,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,p,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",w=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,E=`\\b|${i.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${E})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${y})[jJ](?=${E})`}]},C={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,L,k,t.HASH_COMMENT_MODE]}]};return m.contains=[k,L,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},k,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,x,k]}]}}function Zi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([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"],m=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["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:p,keyword:u,literal:d,built_in:m},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],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:m,type:p}},{className:"punctuation",begin:"->"},s]}}function ts(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["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"],m=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["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"],k=["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"],y=["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"],w=p,E=[...m,...d].filter(_=>!p.includes(_)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function R(_){return o.concat(/\b/,o.either(..._.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:R(y),relevance:0};function g(_,{exceptions:b,when:v}={}){const H=v;return b=b||[],_.map(oe=>oe.match(/\|\d+$/)||b.includes(oe)?oe:H(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:g(E,{when:_=>_.length<3}),literal:s,type:u,built_in:k},contains:[{scope:"type",match:R(c)},S,x,L,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,C]}}const qn="[A-Za-z$_][0-9A-Za-z$_]*",Ji=["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"],Qi=["true","false","null","undefined","NaN","Infinity"],er=["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"],tr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],or=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ir=[].concat(nr,er,tr);function ns(t){const o=t.regex,n=(D,{after:Y})=>{const se="</"+D[0].slice(1);return D.input.indexOf(se,Y)!==-1},i=qn,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,Y)=>{const se=D[0].length+D.index,ke=D.input[se];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(D,{after:se})||Y.ignoreMatch());let Re;const Pe=D.input.substring(se);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:qn,keyword:Ji,literal:Qi,built_in:ir,"variable.language":or},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},v={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"}}]},H={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:{_:[...er,...tr]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,ae([...nr,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,R,{match:/\$\d+/},k,H,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:N,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},W,J,v,F,{match:/\$[(.]/}]}}function rr(t){const o=t.regex,n=ns(t),i=qn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},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"],m={$pattern:qn,keyword:Ji.concat(d),literal:Qi,built_in:ir.concat(r),"variable.language":or},p={className:"meta",begin:"@"+i},k=(L,C,x)=>{const R=L.contains.findIndex(S=>S.label===C);if(R===-1)throw new Error("can not find mode to replace");L.contains.splice(R,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(L=>L.scope==="attr"),w=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,w]),n.contains=n.contains.concat([p,s,c,w]),k(n,"shebang",t.SHEBANG()),k(n,"use_strict",u);const E=n.contains.find(L=>L.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function lr(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,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ar(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]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},E={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},C=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},E,L,s,c],x=[...C];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const Mo={bash:Ao,sh:Ao,shell:Ao,css:qa,go:Fi,golang:Fi,java:Ya,javascript:qi,js:qi,json:es,markdown:Yi,md:Yi,python:Xi,py:Xi,rust:Zi,rs:Zi,sql:ts,typescript:rr,ts:rr,xml:lr,html:lr,yaml:ar,yml:ar};for(const[t,o]of Object.entries(Mo))_o.registerLanguage(t,o);function Ro(t){const o=t.split(`
12
+ `)}),i=x}return n}function Ul(t,o="导入的导图"){const n=Fl(t||""),i={id:yt(),text:o,children:[]},r=[i],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const p=d.level;for(;r.length>1&&s[s.length-1]>=p;)r.pop(),s.pop();if(!c&&p===1){c=!0,i.text=d.text,s[0]=1;return}const k={id:yt(),text:d.text,children:[]};r[r.length-1].children.push(k),r.push(k),s.push(p);return}const f={id:yt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};r[r.length-1].children.push(f)}for(const d of n)u(d);return i}function Hl(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function Wl(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),f=e.reactive({x:0,y:0,ox:0,oy:0}),p=e.ref(!1),k=e.reactive({x:0,y:0}),y=e.reactive({x:0,y:0,width:0,height:0}),N=e.ref(0);let E=null;function L(K){E=K}function C(K){K.preventDefault();const ie=t.getContainer();if(!ie)return;const F=-K.deltaY*.001,q=Math.min(n,Math.max(o,r.value*(1+F))),U=ie.getBoundingClientRect(),w=K.clientX-U.left,P=K.clientY-U.top,V=(w-s.value)/r.value,Y=(P-c.value)/r.value;r.value=q,s.value=w-V*q,c.value=P-Y*q}function x(){r.value=Math.min(n,r.value*i)}function R(){r.value=Math.max(o,r.value/i)}function S(K){var F;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,f.x=K.clientX,f.y=K.clientY,f.ox=s.value,f.oy=c.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",_),(F=K.preventDefault)==null||F.call(K))}function g(K){if(!u.value)return;const ie=K.clientX-f.x,F=K.clientY-f.y;(Math.abs(ie)>3||Math.abs(F)>3)&&(d.value=!0),s.value=f.ox+ie,c.value=f.oy+F}function _(){u.value=!1,window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)}function b(K,ie,F){p.value=!0,k.x=K,k.y=ie,y.x=K,y.y=ie,y.width=0,y.height=0,y.shiftKey=!!(F!=null&&F.shift),N.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",W)}function O(K,ie){if(!p.value)return;const F=Math.min(k.x,K),q=Math.min(k.y,ie),U=Math.max(k.x,K),w=Math.max(k.y,ie);y.x=F,y.y=q,y.width=U-F,y.height=w-q,N.value++}function W(){p.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",W),E&&E()}function ne(K){if(!p.value)return;const ie=t.getContainer();if(!ie)return;const F=ie.getBoundingClientRect(),q=(K.clientX-F.left-s.value)/r.value,U=(K.clientY-F.top-c.value)/r.value;O(q,U)}function pe(K,ie,F,q=60){const U=t.getContainer();if(!U)return;const w=U.getBoundingClientRect(),P=(w.width-q*2)/K,V=(w.height-q*2)/ie,Y=Math.min(1,Math.max(.3,Math.min(P,V)));r.value=Y,s.value=w.width/2,c.value=w.height/2-F*Y}return{scale:r,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:C,zoomIn:x,zoomOut:R,startPan:S,startMarquee:b,updateMarquee:O,isMarquee:p,marquee:y,marqueeVersion:N,setOnMarqueeEnd:L,resetView:pe}}const Gl=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Ni(t){return Gl?t.metaKey:t.ctrlKey}function jl(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const r=t.getSelectedIds();return r.length>0?r[0]:null}function n(i){var u,d,f;const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(Ni(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const p=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==p&&(i.preventDefault(),t.onDuplicate(s));return}if(i.key==="c"||i.key==="C"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCopy(p));return}if(i.key==="x"||i.key==="X"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCut(p));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const p=t.getSelectedIds();t.onPaste(p.length>0?p[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(Ni(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(c);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const p=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==p&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(i.key==="Delete"||i.key==="Backspace")&&s&&s!==((f=t.defaultTargetId)==null?void 0:f.call(t))?(i.preventDefault(),t.onRemove(s)):i.key==="F2"&&s?(i.preventDefault(),t.onStartEdit(s)):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 Kl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function s(f){const p=JSON.stringify(f);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:s,undo:c,redo:u,reset:d}}const ql=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,N=n.y+2;if(n.container){const E=n.container.getBoundingClientRect(),L=180,x=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+L>E.right&&(y=Math.max(E.left+4,n.x-L-2)),N+x>E.bottom&&(N=Math.max(E.top+4,n.y-x-2)),y<E.left+2&&(y=E.left+2),N<E.top+2&&(N=E.top+2)}return{left:y,top:N}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function d(y){const N=y.target;N&&N.closest(".zm-node-menu")||i("close")}function f(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",f,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",f,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function k(y){y(),i("close")}return(y,N)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:N[10]||(N[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[0]||(N[0]=e.withModifiers(E=>k(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:N[1]||(N[1]=e.withModifiers(E=>k(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[11]||(N[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[2]||(N[2]=e.withModifiers(E=>k(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:N[3]||(N[3]=e.withModifiers(E=>k(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[12]||(N[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[4]||(N[4]=e.withModifiers(E=>k(()=>i("addCode")),["stop"]))},[N[13]||(N[13]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:N[5]||(N[5]=e.withModifiers(E=>k(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[14]||(N[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[6]||(N[6]=e.withModifiers(E=>k(()=>i("addTable")),["stop"]))},[N[15]||(N[15]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:N[7]||(N[7]=e.withModifiers(E=>k(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[16]||(N[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[8]||(N[8]=e.withModifiers(E=>k(()=>i("editNote")),["stop"]))},[e.createVNode(xe,{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:N[9]||(N[9]=e.withModifiers(E=>k(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[17]||(N[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Yl=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let C=n.x+2,x=n.y+2;if(n.container){const R=n.container.getBoundingClientRect(),S=160,g=4+3*28;C+S>R.right&&(C=Math.max(R.left+4,n.x-S-2)),x+g>R.bottom&&(x=Math.max(R.top+4,n.y-g-2)),C<R.left+2&&(C=R.left+2),x<R.top+2&&(x=R.top+2)}return{left:C,top:x}}),s=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const C=c.value.getBoundingClientRect(),x=window.innerWidth,R=window.innerHeight,S=176,g=4+3*28;let _=C.right;_+S>x-4&&(_=Math.max(4,C.left-S));let b=C.top-4;return b+g>R-4&&(b=Math.max(4,R-g-4)),{left:_+"px",top:b+"px",display:"block"}});let d=null,f=null;function p(){f&&(clearTimeout(f),f=null),d=setTimeout(()=>{s.value=!0},60)}function k(){d&&(clearTimeout(d),d=null),f=setTimeout(()=>{s.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),f&&clearTimeout(f)});function y(C){const x=C.target;x&&x.closest(".zm-canvas-menu")||i("close")}function N(C){C.key==="Escape"&&i("close")}function E(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",N,!0),window.addEventListener("wheel",E,!0),window.addEventListener("scroll",E,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",N,!0),window.removeEventListener("wheel",E,!0),window.removeEventListener("scroll",E,!0)});function L(C){C(),i("close")}return(C,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(R=>L(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"database",size:13,stroke:1.6}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value}]),onMouseenter:p,onMouseleave:k},[e.createVNode(xe,{name:"import",size:13,stroke:1.6}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:k},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(R=>L(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13,stroke:1.6}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(R=>L(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13,stroke:1.6}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(R=>L(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"txt",size:13,stroke:1.6}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(R=>L(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13,stroke:1.6}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Xl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Si(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)&&Si(n)}),t}class Ti{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ci(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Bt(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Zl="</span>",_i=t=>!!t.scope,Jl=(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,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Ql{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Ci(o)}openNode(o){if(!_i(o))return;const n=Jl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){_i(o)&&(this.buffer+=Zl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ai=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class So{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(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=>{So._collapse(n)}))}}class ea extends So{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 Ql(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Tn(t){return t?typeof t=="string"?t:t.source:null}function Mi(t){return Ut("(?=",t,")")}function ta(t){return Ut("(?:",t,")*")}function na(t){return Ut("(?:",t,")?")}function Ut(...t){return t.map(n=>Tn(n)).join("")}function oa(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function To(...t){return"("+(oa(t).capture?"":"?:")+t.map(i=>Tn(i)).join("|")+")"}function Ri(t){return new RegExp(t.toString()+"|").exec("").length-1}function ia(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ra=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Co(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let s=Tn(i),c="";for(;s.length>0;){const u=ra.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const la=/\b\B/,Bi="[a-zA-Z]\\w*",_o="[a-zA-Z_]\\w*",zi="\\b\\d+(\\.\\d+)?",Ii="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Oi="\\b(0b[01]+)",aa="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",sa=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ut(o,/.*\b/,t.binary,/\b.*/)),Bt({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},Cn={begin:"\\\\[\\s\\S]",relevance:0},ca={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Cn]},da={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Cn]},ua={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/},Wn=function(t,o,n={}){const i=Bt({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 r=To("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:Ut(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},fa=Wn("//","$"),ma=Wn("/\\*","\\*/"),pa=Wn("#","$"),ga={scope:"number",begin:zi,relevance:0},ha={scope:"number",begin:Ii,relevance:0},ba={scope:"number",begin:Oi,relevance:0},ka={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Cn,{begin:/\[/,end:/\]/,relevance:0,contains:[Cn]}]},ya={scope:"title",begin:Bi,relevance:0},Ea={scope:"title",begin:_o,relevance:0},xa={begin:"\\.\\s*"+_o,relevance:0};var Gn=Object.freeze({__proto__:null,APOS_STRING_MODE:ca,BACKSLASH_ESCAPE:Cn,BINARY_NUMBER_MODE:ba,BINARY_NUMBER_RE:Oi,COMMENT:Wn,C_BLOCK_COMMENT_MODE:ma,C_LINE_COMMENT_MODE:fa,C_NUMBER_MODE:ha,C_NUMBER_RE:Ii,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:pa,IDENT_RE:Bi,MATCH_NOTHING_RE:la,METHOD_GUARD:xa,NUMBER_MODE:ga,NUMBER_RE:zi,PHRASAL_WORDS_MODE:ua,QUOTE_STRING_MODE:da,REGEXP_MODE:ka,RE_STARTERS_RE:aa,SHEBANG:sa,TITLE_MODE:ya,UNDERSCORE_IDENT_RE:_o,UNDERSCORE_TITLE_MODE:Ea});function wa(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Na(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Sa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=wa,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ta(t,o){Array.isArray(t.illegal)&&(t.illegal=To(...t.illegal))}function Ca(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 _a(t,o){t.relevance===void 0&&(t.relevance=1)}const Aa=(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=Ut(n.beforeMatch,Mi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ma=["of","and","for","in","not","or","if","then","parent","list","value"],Ra="keyword";function vi(t,o,n=Ra){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(s){Object.assign(i,vi(t[s],o,s))}),i;function r(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");i[d[0]]=[s,Ba(d[0],d[1])]})}}function Ba(t,o){return o?Number(o):za(t)?0:1}function za(t){return Ma.includes(t.toLowerCase())}const Li={},Ht=t=>{console.error(t)},Di=(t,...o)=>{console.log(`WARN: ${t}`,...o)},en=(t,o)=>{Li[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Li[`${t}/${o}`]=!0)},jn=new Error;function Vi(t,o,{key:n}){let i=0;const r=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],s[u+i]=!0,i+=Ri(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Ia(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),jn;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ht("beginScope must be object"),jn;Vi(t,t.begin,{key:"beginScope"}),t.begin=Co(t.begin,{joinWith:""})}}function Oa(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),jn;if(typeof t.endScope!="object"||t.endScope===null)throw Ht("endScope must be object"),jn;Vi(t,t.end,{key:"endScope"}),t.end=Co(t.end,{joinWith:""})}}function va(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function La(t){va(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ia(t),Oa(t)}function Da(t){function o(c,u){return new RegExp(Tn(c),"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+=Ri(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Co(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const f=d.findIndex((k,y)=>y>0&&k!==void 0),p=this.matchIndexes[f];return d.splice(0,f),Object.assign(d,p)}}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(([f,p])=>d.addRule(f,p)),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 f=d.exec(u);if(this.resumingScanAtSamePosition()&&!(f&&f.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,f=p.exec(u)}return f&&(this.regexIndex+=f.position+1,this.regexIndex===this.count&&this.considerAll()),f}}function r(c){const u=new i;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Na,Ca,La,Aa].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[Sa,Ta,_a].forEach(p=>p(c,u)),c.isCompiled=!0;let f=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),f=c.keywords.$pattern,delete c.keywords.$pattern),f=f||/\w+/,c.keywords&&(c.keywords=vi(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(f,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=Tn(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return Va(p==="self"?c:p)})),c.contains.forEach(function(p){s(p,d)}),c.starts&&s(c.starts,u),d.matcher=r(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=Bt(t.classNameAliases||{}),s(t)}function $i(t){return t?t.endsWithParent||$i(t.starts):!1}function Va(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return Bt(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:$i(t)?Bt(t,{starts:t.starts?Bt(t.starts):null}):Object.isFrozen(t)?Bt(t):t}var $a="11.11.1";class Pa extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ao=Ci,Pi=Bt,Fi=Symbol("nomatch"),Fa=7,Ui=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={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:ea};function d(w){return u.noHighlightRe.test(w)}function f(w){let P=w.className+" ";P+=w.parentNode?w.parentNode.className:"";const V=u.languageDetectRe.exec(P);if(V){const Y=W(V[1]);return Y||(Di(s.replace("{}",V[1])),Di("Falling back to no-highlight mode for this block.",w)),Y?V[1]:"no-highlight"}return P.split(/\s+/).find(Y=>d(Y)||W(Y))}function p(w,P,V){let Y="",ae="";typeof P=="object"?(Y=w,V=P.ignoreIllegals,ae=P.language):(en("10.7.0","highlight(lang, code, ...args) has been deprecated."),en("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),ae=w,Y=P),V===void 0&&(V=!0);const ke={code:Y,language:ae};q("before:highlight",ke);const Re=ke.result?ke.result:k(ke.language,ke.code,V);return Re.code=ke.code,q("after:highlight",Re),Re}function k(w,P,V,Y){const ae=Object.create(null);function ke(H,Z){return H.keywords[Z]}function Re(){if(!Q.keywords){Me.addText(we);return}let H=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(we),le="";for(;Z;){le+=we.substring(H,Z.index);const me=We.case_insensitive?Z[0].toLowerCase():Z[0],ze=ke(Q,me);if(ze){const[Ue,Je]=ze;if(Me.addText(le),le="",ae[me]=(ae[me]||0)+1,ae[me]<=Fa&&(pt+=Je),Ue.startsWith("_"))le+=Z[0];else{const vt=We.classNameAliases[Ue]||Ue;B(Z[0],vt)}}else le+=Z[0];H=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(we)}le+=we.substring(H),Me.addText(le)}function Pe(){if(we==="")return;let H=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Me.addText(we);return}H=k(Q.subLanguage,we,!0,Nt[Q.subLanguage]),Nt[Q.subLanguage]=H._top}else H=N(we,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(pt+=H.relevance),Me.__addSublanguage(H._emitter,H.language)}function Te(){Q.subLanguage!=null?Pe():Re(),we=""}function B(H,Z){H!==""&&(Me.startScope(Z),Me.addText(H),Me.endScope())}function z(H,Z){let le=1;const me=Z.length-1;for(;le<=me;){if(!H._emit[le]){le++;continue}const ze=We.classNameAliases[H[le]]||H[le],Ue=Z[le];ze?B(Ue,ze):(we=Ue,Re(),we=""),le++}}function oe(H,Z){return H.scope&&typeof H.scope=="string"&&Me.openNode(We.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(B(we,We.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),we=""):H.beginScope._multi&&(z(H.beginScope,Z),we="")),Q=Object.create(H,{parent:{value:Q}}),Q}function re(H,Z,le){let me=ia(H.endRe,le);if(me){if(H["on:end"]){const ze=new Ti(H);H["on:end"](Z,ze),ze.isMatchIgnored&&(me=!1)}if(me){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return re(H.parent,Z,le)}function D(H){return Q.matcher.regexIndex===0?(we+=H[0],1):(St=!0,0)}function T(H){const Z=H[0],le=H.rule,me=new Ti(le),ze=[le.__beforeBegin,le["on:begin"]];for(const Ue of ze)if(Ue&&(Ue(H,me),me.isMatchIgnored))return D(Z);return le.skip?we+=Z:(le.excludeBegin&&(we+=Z),Te(),!le.returnBegin&&!le.excludeBegin&&(we=Z)),oe(le,H),le.returnBegin?0:Z.length}function se(H){const Z=H[0],le=P.substring(H.index),me=re(Q,H,le);if(!me)return Fi;const ze=Q;Q.endScope&&Q.endScope._wrap?(Te(),B(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(Te(),z(Q.endScope,H)):ze.skip?we+=Z:(ze.returnEnd||ze.excludeEnd||(we+=Z),Te(),ze.excludeEnd&&(we=Z));do Q.scope&&Me.closeNode(),!Q.skip&&!Q.subLanguage&&(pt+=Q.relevance),Q=Q.parent;while(Q!==me.parent);return me.starts&&oe(me.starts,H),ze.returnEnd?0:Z.length}function ce(){const H=[];for(let Z=Q;Z!==We;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>Me.openNode(Z))}let De={};function Ke(H,Z){const le=Z&&Z[0];if(we+=H,le==null)return Te(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&le===""){if(we+=P.slice(Z.index,Z.index+1),!r){const me=new Error(`0 width match regex (${w})`);throw me.languageName=w,me.badRule=De.rule,me}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!V){const me=new Error('Illegal lexeme "'+le+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw me.mode=Q,me}else if(Z.type==="end"){const me=se(Z);if(me!==Fi)return me}if(Z.type==="illegal"&&le==="")return we+=`
15
+ `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=le,le.length}const We=W(w);if(!We)throw Ht(s.replace("{}",w)),new Error('Unknown language: "'+w+'"');const mn=Da(We);let Ot="",Q=Y||mn;const Nt={},Me=new u.__emitter(u);ce();let we="",pt=0,qe=0,gt=0,St=!1;try{if(We.__emitTokens)We.__emitTokens(P,Me);else{for(Q.matcher.considerAll();;){gt++,St?St=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=qe;const H=Q.matcher.exec(P);if(!H)break;const Z=P.substring(qe,H.index),le=Ke(Z,H);qe=H.index+le}Ke(P.substring(qe))}return Me.finalize(),Ot=Me.toHTML(),{language:w,value:Ot,relevance:pt,illegal:!1,_emitter:Me,_top:Q}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:w,value:Ao(P),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:qe,context:P.slice(qe-100,qe+100),mode:H.mode,resultSoFar:Ot},_emitter:Me};if(r)return{language:w,value:Ao(P),illegal:!1,relevance:0,errorRaised:H,_emitter:Me,_top:Q};throw H}}function y(w){const P={value:Ao(w),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return P._emitter.addText(w),P}function N(w,P){P=P||u.languages||Object.keys(o);const V=y(w),Y=P.filter(W).filter(pe).map(Te=>k(Te,w,!1));Y.unshift(V);const ae=Y.sort((Te,B)=>{if(Te.relevance!==B.relevance)return B.relevance-Te.relevance;if(Te.language&&B.language){if(W(Te.language).supersetOf===B.language)return 1;if(W(B.language).supersetOf===Te.language)return-1}return 0}),[ke,Re]=ae,Pe=ke;return Pe.secondBest=Re,Pe}function E(w,P,V){const Y=P&&n[P]||V;w.classList.add("hljs"),w.classList.add(`language-${Y}`)}function L(w){let P=null;const V=f(w);if(d(V))return;if(q("before:highlightElement",{el:w,language:V}),w.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",w);return}if(w.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(w)),u.throwUnescapedHTML))throw new Pa("One of your code blocks includes unescaped HTML.",w.innerHTML);P=w;const Y=P.textContent,ae=V?p(Y,{language:V,ignoreIllegals:!0}):N(Y);w.innerHTML=ae.value,w.dataset.highlighted="yes",E(w,V,ae.language),w.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(w.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),q("after:highlightElement",{el:w,result:ae,text:Y})}function C(w){u=Pi(u,w)}const x=()=>{g(),en("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function R(){g(),en("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function g(){function w(){g()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",w,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(L)}function _(w,P){let V=null;try{V=P(t)}catch(Y){if(Ht("Language definition for '{}' could not be registered.".replace("{}",w)),r)Ht(Y);else throw Y;V=c}V.name||(V.name=w),o[w]=V,V.rawDefinition=P.bind(null,t),V.aliases&&ne(V.aliases,{languageName:w})}function b(w){delete o[w];for(const P of Object.keys(n))n[P]===w&&delete n[P]}function O(){return Object.keys(o)}function W(w){return w=(w||"").toLowerCase(),o[w]||o[n[w]]}function ne(w,{languageName:P}){typeof w=="string"&&(w=[w]),w.forEach(V=>{n[V.toLowerCase()]=P})}function pe(w){const P=W(w);return P&&!P.disableAutodetect}function K(w){w["before:highlightBlock"]&&!w["before:highlightElement"]&&(w["before:highlightElement"]=P=>{w["before:highlightBlock"](Object.assign({block:P.el},P))}),w["after:highlightBlock"]&&!w["after:highlightElement"]&&(w["after:highlightElement"]=P=>{w["after:highlightBlock"](Object.assign({block:P.el},P))})}function ie(w){K(w),i.push(w)}function F(w){const P=i.indexOf(w);P!==-1&&i.splice(P,1)}function q(w,P){const V=w;i.forEach(function(Y){Y[V]&&Y[V](P)})}function U(w){return en("10.7.0","highlightBlock will be removed entirely in v12.0"),en("10.7.0","Please use highlightElement now."),L(w)}Object.assign(t,{highlight:p,highlightAuto:N,highlightAll:g,highlightElement:L,highlightBlock:U,configure:C,initHighlighting:x,initHighlightingOnLoad:R,registerLanguage:_,unregisterLanguage:b,listLanguages:O,getLanguage:W,registerAliases:ne,autoDetection:pe,inherit:Pi,addPlugin:ie,removePlugin:F}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=$a,t.regex={concat:Ut,lookahead:Mi,either:To,optional:na,anyNumberOfTimes:ta};for(const w in Gn)typeof Gn[w]=="object"&&Si(Gn[w]);return Object.assign(t,Gn),t},tn=Ui({});tn.newInstance=()=>Ui({});var Ua=tn;tn.HighlightJS=tn,tn.default=tn;const Mo=Xl(Ua);function Ro(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 r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={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,r]};r.contains.push(u);const d={match:/\\"/},f={className:"string",begin:/'/,end:/'/},p={match:/\\'/},k={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],N=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],x={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],g=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:C,built_in:[...R,...S,"set","shopt",...g,..._]},contains:[N,t.SHEBANG(),E,k,s,c,x,u,d,f,p,n]}}const Ha=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_-]*/}}),Wa=["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"],Ga=["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"],ja=[...Wa,...Ga],Ka=["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(),qa=["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(),Ya=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Xa=["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 Za(t){const o=t.regex,n=Ha(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[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:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+qa.join("|")+")"},{begin:":(:)?("+Ya.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Xa.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Ka.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ja.join("|")+")\\b"}]}}function Hi(t){const s={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:s,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:s,illegal:/["']/}]}]}}var nn="[0-9](_*[0-9])*",Kn=`\\.(${nn})`,qn="[0-9a-fA-F](_*[0-9a-fA-F])*",Wi={className:"number",variants:[{begin:`(\\b(${nn})((${Kn})|\\.)?|(${Kn}))[eE][+-]?(${nn})[fFdD]?\\b`},{begin:`\\b(${nn})((${Kn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Kn})[fFdD]?\\b`},{begin:`\\b(${nn})[fFdD]\\b`},{begin:`\\b0[xX]((${qn})\\.?|(${qn})?\\.(${qn}))[pP][+-]?(${nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${qn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gi(t,o,n){return n===-1?"":t.replace(o,i=>Gi(t,o,n-1))}function Ja(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Gi("(?:<"+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"]},f={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={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:[p,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:[f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Wi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Wi,f]}}const ji="[A-Za-z$_][0-9A-Za-z$_]*",Qa=["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"],es=["true","false","null","undefined","NaN","Infinity"],Ki=["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"],qi=["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"],ts=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ns=[].concat(Yi,Ki,qi);function Xi(t){const o=t.regex,n=(V,{after:Y})=>{const ae="</"+V[0].slice(1);return V.input.indexOf(ae,Y)!==-1},i=ji,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,Y)=>{const ae=V[0].length+V.index,ke=V.input[ae];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(V,{after:ae})||Y.ignoreMatch());let Re;const Pe=V.input.substring(ae);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:ji,keyword:Qa,literal:es,built_in:ns,"variable.language":ts},d="[0-9](_?[0-9])*",f=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${f})|\\.)?|(${f}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${f})\\b|\\.)?|(${f})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ki,...qi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(V){return o.concat("(?!",V.join("|"),")")}const F={match:o.concat(/\b/,ie([...Yi,"super","import"].map(V=>`${V}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,R,{match:/\$\d+/},k,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:w,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},F,K,O,U,{match:/\$[(.]/}]}}function os(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Zi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={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}]},f={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},k=t.inherit(f,{contains:[]}),y=t.inherit(p,{contains:[]});f.contains.push(y),p.contains.push(k);let N=[n,d];return[f,p,k,y].forEach(x=>{x.contains=x.contains.concat(N)}),N=N.concat(f,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:N},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:N}]}]},n,s,f,p,{className:"quote",begin:"^>\\s+",contains:N,end:"$"},r,i,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ji(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:/^(>>>|\.\.\.) /},f={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},k={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,p,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,p,f]},{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,p,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,f]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",N=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,E=`\\b|${i.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${N}))[eE][+-]?(${y})[jJ]?(?=${E})`},{begin:`(${N})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${y})[jJ](?=${E})`}]},C={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,L,k,t.HASH_COMMENT_MODE]}]};return f.contains=[k,L,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},k,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,x,k]}]}}function Qi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([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"],f=["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!"],p=["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:p,keyword:u,literal:d,built_in:f},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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],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:f,type:p}},{className:"punctuation",begin:"->"},s]}}function is(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["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"],f=["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"],p=["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"],k=["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"],y=["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"],N=p,E=[...f,...d].filter(_=>!p.includes(_)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...N),/\s*\(/),relevance:0,keywords:{built_in:N}};function R(_){return o.concat(/\b/,o.either(..._.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:R(y),relevance:0};function g(_,{exceptions:b,when:O}={}){const W=O;return b=b||[],_.map(ne=>ne.match(/\|\d+$/)||b.includes(ne)?ne:W(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:g(E,{when:_=>_.length<3}),literal:s,type:u,built_in:k},contains:[{scope:"type",match:R(c)},S,x,L,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,C]}}const Yn="[A-Za-z$_][0-9A-Za-z$_]*",er=["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"],tr=["true","false","null","undefined","NaN","Infinity"],nr=["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"],or=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ir=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lr=[].concat(ir,nr,or);function rs(t){const o=t.regex,n=(V,{after:Y})=>{const ae="</"+V[0].slice(1);return V.input.indexOf(ae,Y)!==-1},i=Yn,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,Y)=>{const ae=V[0].length+V.index,ke=V.input[ae];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(V,{after:ae})||Y.ignoreMatch());let Re;const Pe=V.input.substring(ae);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:Yn,keyword:er,literal:tr,built_in:lr,"variable.language":rr},d="[0-9](_?[0-9])*",f=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${f})|\\.)?|(${f}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${f})\\b|\\.)?|(${f})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nr,...or]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(V){return o.concat("(?!",V.join("|"),")")}const F={match:o.concat(/\b/,ie([...ir,"super","import"].map(V=>`${V}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,R,{match:/\$\d+/},k,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:w,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},F,K,O,U,{match:/\$[(.]/}]}}function ar(t){const o=t.regex,n=rs(t),i=Yn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},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"],f={$pattern:Yn,keyword:er.concat(d),literal:tr,built_in:lr.concat(r),"variable.language":rr},p={className:"meta",begin:"@"+i},k=(L,C,x)=>{const R=L.contains.findIndex(S=>S.label===C);if(R===-1)throw new Error("can not find mode to replace");L.contains.splice(R,1,x)};Object.assign(n.keywords,f),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(L=>L.scope==="attr"),N=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,N]),n.contains=n.contains.concat([p,s,c,N]),k(n,"shebang",t.SHEBANG()),k(n,"use_strict",u);const E=n.contains.find(L=>L.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function sr(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,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),f={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:[r]},{begin:/'/,end:/'/,contains:[r]},{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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{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:[f],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[f],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:f}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cr(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]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},N={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},E={begin:/\{/,end:/\}/,contains:[N],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[N],illegal:"\\n",relevance:0},C=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},E,L,s,c],x=[...C];return x.pop(),x.push(u),N.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const Bo={bash:Ro,sh:Ro,shell:Ro,css:Za,go:Hi,golang:Hi,java:Ja,javascript:Xi,js:Xi,json:os,markdown:Zi,md:Zi,python:Ji,py:Ji,rust:Qi,rs:Qi,sql:is,typescript:ar,ts:ar,xml:sr,html:sr,yaml:cr,yml:cr};for(const[t,o]of Object.entries(Bo))Mo.registerLanguage(t,o);function zo(t){const o=t.split(`
16
16
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
17
- `).replace(/\n+$/,"")}function nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Mo[n]?n:""}function Bo(t,o){const n=o&&Mo[o]?o:"";try{return n?_o.highlight(t,{language:n,ignoreIllegals:!0}).value:_o.highlightAuto(t).value}catch{return os(t)}}function sr(t){return t.split(`
19
- `).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 os(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cr(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,s=r.map(m=>m[o]??""),c=s.length>0&&s.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,d=r.slice().sort((m,p)=>{const k=m[o]??"",y=p[o]??"";return c?(Number(k)-Number(y))*u:k.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}const is=["viewBox","width","height"],rs={class:"zm-edges"},ls=["d","fill"],as=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],ss=["src","width","height","alt"],cs=["onDblclick"],ds={key:0,class:"zm-rich-code"},us=["innerHTML"],ms={key:1,class:"zm-rich-table"},fs=["onClick"],ps={class:"zm-rich-sort-mark","aria-hidden":"true"},gs={key:2,class:"zm-text"},hs={class:"zm-text-label"},bs=["href","title"],ks=["title","onClick"],ys=["title"],Es=["title","onClick"],xs=["onClick"],ws=["onMousedown"],Ns=["onClick"],Ss=["title"],Ts={class:"zm-tb-tip zm-tb-zoom"},Cs=["src"],_s=["src"],Ht=24,on=400,Bt=160,Yn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,r=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),m=e.computed(()=>d.value.values().next().value??null),p=e.ref(new Set),k=e.ref(!1),y=e.ref(null),w=e.ref(0),E=e.ref(0),L=e.ref(null),C=e.ref(null),x=e.ref(null),R=e.ref(""),S=e.ref(new Map),g=e.ref(ct(i.data)),_=e.ref({}),b=e.ref({}),v=e.ref(i.markdown!==void 0);let H=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){v.value=!1;return}v.value=!0;const a=Zt(l||"");H=!0,g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>{H=!1,At()})}),e.watch(g,()=>{v.value&&!H&&r("markdownChange",Jt(g.value))},{deep:!0});const oe=e.computed(()=>ee.showOrderBadge===!0),q=e.ref(new Map),J=q.value;function ae(l,a){const h={};a.bg&&(h.bg=a.bg),a.textColor&&(h.textColor=a.textColor),a.borderColor&&(h.borderColor=a.borderColor),a.fontWeight&&(h.fontWeight=a.fontWeight),Object.keys(h).length===0?J.delete(l):J.set(l,h),q.value=new Map(J)}function W(l){return J.get(l)??{}}function K(l,a){const h=fe(g.value,l);h&&(h.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:P(a.width,Ht,on),height:P(a.height,Ht,on)},Ie(),be(),r("change",g.value))}function F(l){const a=fe(g.value,l);!a||!a.image||(delete a.image,Ie(),be(),r("change",g.value))}function N(l,a){const h=a.trim();if(!fe(g.value,l))return;if(!h){F(l);return}const A=new Image;A.onload=()=>{const $=fe(g.value,l);if(!$)return;const j=A.naturalWidth&&A.naturalHeight?A.naturalWidth/A.naturalHeight:1,ne=P(A.naturalWidth||Bt,Ht,on),Ne=Math.round(ne/j);$.image={src:h,naturalW:A.naturalWidth||ne,naturalH:A.naturalHeight||Ne,width:ne,height:Ne},Ie(),be(),r("change",g.value)},A.onerror=()=>{},A.src=h}function P(l,a,h){return Math.min(h,Math.max(a,l))}function D(l,a){const h=new FileReader;h.onload=()=>{if(typeof h.result!="string")return;const I=h.result,A=new window.Image;A.onload=()=>{const $=A.naturalWidth||Bt,j=A.naturalHeight||Bt,ne=P($,Ht,Bt),Ne=P(Math.round(j*ne/$),Ht,on);a({src:I,naturalW:$,naturalH:j,width:ne,height:Ne})},A.onerror=()=>{a({src:I,naturalW:Bt,naturalH:Bt,width:Bt,height:Bt})},A.src=I},h.readAsDataURL(l)}function Y(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var I;const h=(I=a.files)==null?void 0:I[0];h&&(D(h,A=>K(l,A)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function se(l,a){const h=a.trim(),I=fe(g.value,l);I&&(h?I.link={url:h}:delete I.link,Ie(),be(),r("change",g.value))}function ke(l){se(l,"")}function Re(l,a){const h=fe(g.value,l);h&&(a?h.note={text:a}:delete h.note,Ie(),be(),r("change",g.value))}function Pe(l){Re(l,"")}function Te(l,a){const h=fe(g.value,l);h&&(a?h.richContent=a:delete h.richContent,Ie(),be(),r("change",g.value))}const B=e.ref(null),z=e.ref(null),ie=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" ")),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" "));function V(l,a){i.previewMode||(l.preventDefault(),l.stopPropagation(),z.value=null,d.value=new Set([a.id]),it(),B.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function T(){B.value=null}function ce(l){const a=l.target;a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),B.value&&(B.value=null),z.value={x:l.clientX,y:l.clientY})}function de(){z.value=null}function De(){de(),r("canvas-settings")}function Ke(){de(),r("canvas-data")}function We(l){de(),r("canvas-import",l)}function mn(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Y(l)}function It(){var I,A,$;const l=(I=B.value)==null?void 0:I.nodeId;if(!l)return;const a=(($=(A=fe(g.value,l))==null?void 0:A.link)==null?void 0:$.url)??"",h=window.prompt("输入链接 URL(留空取消)",a);h!==null&&se(l,h)}function Q(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&ke(l)}function wt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&U(l)}function Me(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Pe(l)}function we(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&F(l)}function pt(){var tt,rt;const l=(tt=B.value)==null?void 0:tt.nodeId;if(!l)return;const a=(rt=fe(g.value,l))==null?void 0:rt.richContent,h=(a==null?void 0:a.kind)==="code"?Ro(a.raw):"",I=(a==null?void 0:a.kind)==="code"&&a.lang||"",A=I?"```"+I+`
20
- `:"```\n",j=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",h?A+h+(h.endsWith("```")?"":"\n```"):A+"// 你的代码"+"\n```");if(j===null)return;const ne=j.trim();if(!ne){Te(l,null);return}const Ne=/^```([^\s`]*)/.exec(ne),M=Ne?Ne[1]:void 0;Te(l,{kind:"code",raw:ne,lang:M})}function qe(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function gt(){var j,ne;const l=(j=B.value)==null?void 0:j.nodeId;if(!l)return;const a=(ne=fe(g.value,l))==null?void 0:ne.richContent,h=(a==null?void 0:a.kind)==="table"?a.raw:"",A=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",h||`| 列1 | 列2 | 列3 |
17
+ `).replace(/\n+$/,"")}function on(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Bo[n]?n:""}function Io(t,o){const n=o&&Bo[o]?o:"";try{return n?Mo.highlight(t,{language:n,ignoreIllegals:!0}).value:Mo.highlightAuto(t).value}catch{return ls(t)}}function dr(t){return t.split(`
19
+ `).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 ls(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ur(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,s=r.map(f=>f[o]??""),c=s.length>0&&s.every(f=>f.trim()!==""&&!Number.isNaN(Number(f))),u=n==="asc"?1:-1,d=r.slice().sort((f,p)=>{const k=f[o]??"",y=p[o]??"";return c?(Number(k)-Number(y))*u:k.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}const as=["viewBox","width","height"],ss={class:"zm-edges"},cs=["d","fill"],ds=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],us=["src","width","height","alt"],fs=["onDblclick"],ms={key:0,class:"zm-rich-code"},ps=["innerHTML"],gs={key:1,class:"zm-rich-table"},hs=["onClick"],bs={class:"zm-rich-sort-mark","aria-hidden":"true"},ks={key:2,class:"zm-text"},ys={class:"zm-text-label"},Es=["href","title"],xs=["title","onClick"],ws=["title"],Ns=["title","onClick"],Ss=["onClick"],Ts=["onMousedown"],Cs=["onClick"],_s=["title"],As={class:"zm-tb-tip zm-tb-zoom"},Ms=["src"],Rs=["src"],Wt=24,rn=400,zt=160,fr=4,Xn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,r=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),f=e.computed(()=>d.value.values().next().value??null),p=e.ref(new Set),k=e.ref(!1),y=e.ref(null),N=e.ref(0),E=e.ref(0),L=e.ref(null),C=e.ref(null),x=e.ref(null),R=e.ref(""),S=e.ref(new Map),g=e.ref(ct(i.data)),_=e.ref({}),b=e.ref({}),O=e.ref(i.markdown!==void 0);let W=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){O.value=!1;return}O.value=!0;const a=Jt(l||"");W=!0,g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>{W=!1,Mt()})}),e.watch(g,()=>{O.value&&!W&&r("markdownChange",Qt(g.value))},{deep:!0});const ne=e.computed(()=>ee.showOrderBadge===!0),pe=e.ref(new Map),K=pe.value;function ie(l,a){const h={};a.bg&&(h.bg=a.bg),a.textColor&&(h.textColor=a.textColor),a.borderColor&&(h.borderColor=a.borderColor),a.fontWeight&&(h.fontWeight=a.fontWeight),Object.keys(h).length===0?K.delete(l):K.set(l,h),pe.value=new Map(K)}function F(l){return K.get(l)??{}}function q(l,a){const h=fe(g.value,l);h&&(h.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:P(a.width,Wt,rn),height:P(a.height,Wt,rn)},Ie(),be(),r("change",g.value))}function U(l){const a=fe(g.value,l);!a||!a.image||(delete a.image,Ie(),be(),r("change",g.value))}function w(l,a){const h=a.trim();if(!fe(g.value,l))return;if(!h){U(l);return}const A=new Image;A.onload=()=>{const $=fe(g.value,l);if(!$)return;const j=A.naturalWidth&&A.naturalHeight?A.naturalWidth/A.naturalHeight:1,te=P(A.naturalWidth||zt,Wt,rn),Ne=Math.round(te/j);$.image={src:h,naturalW:A.naturalWidth||te,naturalH:A.naturalHeight||Ne,width:te,height:Ne},Ie(),be(),r("change",g.value)},A.onerror=()=>{},A.src=h}function P(l,a,h){return Math.min(h,Math.max(a,l))}function V(l,a){const h=new FileReader;h.onload=()=>{if(typeof h.result!="string")return;const v=h.result,A=new window.Image;A.onload=()=>{const $=A.naturalWidth||zt,j=A.naturalHeight||zt,te=P($,Wt,zt),Ne=P(Math.round(j*te/$),Wt,rn);a({src:v,naturalW:$,naturalH:j,width:te,height:Ne})},A.onerror=()=>{a({src:v,naturalW:zt,naturalH:zt,width:zt,height:zt})},A.src=v},h.readAsDataURL(l)}function Y(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var v;const h=(v=a.files)==null?void 0:v[0];h&&(V(h,A=>q(l,A)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function ae(l,a){const h=a.trim(),v=fe(g.value,l);v&&(h?v.link={url:h}:delete v.link,Ie(),be(),r("change",g.value))}function ke(l){ae(l,"")}function Re(l,a){const h=fe(g.value,l);h&&(a?h.note={text:a}:delete h.note,Ie(),be(),r("change",g.value))}function Pe(l){Re(l,"")}function Te(l,a){const h=fe(g.value,l);h&&(a?h.richContent=a:delete h.richContent,Ie(),be(),r("change",g.value))}const B=e.ref(null),z=e.ref(null),oe=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" ")),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" "));function D(l,a){i.previewMode||(l.preventDefault(),l.stopPropagation(),z.value=null,d.value=new Set([a.id]),it(),B.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function T(){B.value=null}function se(l){const a=l.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ho&&J.panMoved.value){ho=!1,l.preventDefault();return}l.preventDefault(),B.value&&(B.value=null),z.value={x:l.clientX,y:l.clientY}}}function ce(){z.value=null}function De(){ce(),r("canvas-settings")}function Ke(){ce(),r("canvas-data")}function We(l){ce(),r("canvas-import",l)}function mn(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Y(l)}function Ot(){var v,A,$;const l=(v=B.value)==null?void 0:v.nodeId;if(!l)return;const a=(($=(A=fe(g.value,l))==null?void 0:A.link)==null?void 0:$.url)??"",h=window.prompt("输入链接 URL(留空取消)",a);h!==null&&ae(l,h)}function Q(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&ke(l)}function Nt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&H(l)}function Me(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Pe(l)}function we(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&U(l)}function pt(){var tt,rt;const l=(tt=B.value)==null?void 0:tt.nodeId;if(!l)return;const a=(rt=fe(g.value,l))==null?void 0:rt.richContent,h=(a==null?void 0:a.kind)==="code"?zo(a.raw):"",v=(a==null?void 0:a.kind)==="code"&&a.lang||"",A=v?"```"+v+`
20
+ `:"```\n",j=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",h?A+h+(h.endsWith("```")?"":"\n```"):A+"// 你的代码"+"\n```");if(j===null)return;const te=j.trim();if(!te){Te(l,null);return}const Ne=/^```([^\s`]*)/.exec(te),M=Ne?Ne[1]:void 0;Te(l,{kind:"code",raw:te,lang:M})}function qe(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function gt(){var j,te;const l=(j=B.value)==null?void 0:j.nodeId;if(!l)return;const a=(te=fe(g.value,l))==null?void 0:te.richContent,h=(a==null?void 0:a.kind)==="table"?a.raw:"",A=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",h||`| 列1 | 列2 | 列3 |
21
21
  | --- | --- | --- |
22
- | a | b | c |`);if(A===null)return;const $=A.trim();if(!$){Te(l,null);return}Te(l,{kind:"table",raw:$})}function Nt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function U(l){i.previewMode||r("edit-note",l)}function Z(l,a=60){const h=l.replace(/\s+/g," ").trim();return h.length<=a?h||"点击编辑笔记":h.slice(0,a)+"…"}function le(l){var A;if(i.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const h=m.value;if(!h)return;const I=(A=l.clipboardData)==null?void 0:A.items;if(I)for(let $=0;$<I.length;$++){const j=I[$];if(j.kind==="file"&&j.type.startsWith("image/")){const ne=j.getAsFile();if(!ne)continue;l.preventDefault();const Ne=fe(g.value,h);if(Ne!=null&&Ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;D(ne,M=>K(h,M));return}}}e.onMounted(()=>{window.addEventListener("paste",le),be()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const pe=e.ref(null),ze=e.computed(()=>{var l;return((l=pe.value)==null?void 0:l.nodeId)??null});function Ue(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const h=a.image.naturalW||a.image.width,I=a.image.naturalH||a.image.height,A=I>0?I/h:1;pe.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:h,naturalH:I,ratio:A,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",Je),window.addEventListener("mouseup",Ot)}function Je(l){var Ne,M;const a=pe.value;if(!a)return;const h=te.scale.value||1,I=l.clientX-a.startX,A=P(a.startW+I/h,Ht,on),$=P(A*a.ratio,Ht,on);a.pendingW=A,a.pendingH=$;const j=(Ne=s.value)==null?void 0:Ne.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);j&&(j.style.width=`${A}px`,j.style.height=`${$}px`);const ne=(M=s.value)==null?void 0:M.querySelector(`[data-node-id="${a.nodeId}"]`);ne&&(ne.style.minWidth=`${Math.max(80,Math.ceil(A+28))}px`,ne.style.height=`${Math.ceil($+8+30)}px`)}function Ot(){const l=pe.value;if(window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",Ot),pe.value=null,!l)return;const a=fe(g.value,l.nodeId);!a||!a.image||(K(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),it(),pn=!0)}const fn=e.ref(null);let pn=!1;function zn(l){fn.value=l}function oo(l){fn.value===l&&(fn.value=null),C.value&&(C.value=null)}function gn(l,a){var ht;if(!a.text||a.text.length<14)return;const I=l.currentTarget.getBoundingClientRect(),A=(ht=s.value)==null?void 0:ht.getBoundingClientRect();if(!A)return;const $=10,j=240,ne=I.top-A.top>60,Ne=I.left-A.left+I.width/2,M=$+j/2,tt=A.width-j/2-$,rt=Math.max(M,Math.min(Ne,tt)),ge=ne?I.top-A.top-8:I.bottom-A.top+8;C.value={text:a.text,x:rt,y:ge,above:ne}}const vt=e.ref(0),nt=e.ref(!1),Qe=Wl(100);function Ie(){Qe.record({data:g.value,selectedIds:[...d.value]})}function be(){p.value=new Set(p.value),vt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ti()).then(()=>{vt.value++})}function ti(){const l=document.querySelectorAll(".zm-rich"),a={},h={};l.forEach(I=>{let A=I,$=null;for(;A&&!$;)$=A.getAttribute("data-node-id"),A=A.parentElement;if(!$)return;const j=I.offsetHeight,ne=I.scrollWidth,Ne=Math.round(j*2)/2,M=Math.round(ne*2)/2;a[$]=Ne,h[$]=M,_.value[$],b.value[$]}),_.value=a,b.value=h}const et=e.computed(()=>{var l,a,h,I,A,$,j,ne,Ne,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=i.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((h=i.theme)==null?void 0:h.branchBg)??"#ffffff",branchText:((I=i.theme)==null?void 0:I.branchText)??"#1f2937",lineColor:((A=i.theme)==null?void 0:A.lineColor)??"#94a3b8",bgColor:(($=i.theme)==null?void 0:$.bgColor)??"#f8fafc",fontSize:((j=i.theme)==null?void 0:j.fontSize)??14,lineWidthStart:((ne=i.theme)==null?void 0:ne.lineWidthStart)??2.2,lineWidthEnd:((Ne=i.theme)==null?void 0:Ne.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),ee=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function io(l){return ee.taperedEdge?ni(l):ro(l)}function Lt(l){return ee.taperedEdge?ee.lineWidthEnd:ro(l)}function ni(l){return l<=0?ee.lineWidthStart:l===1?Math.max(1.5,ee.lineWidthStart*.67):l===2?Math.max(.8,ee.lineWidthStart*.42):ee.lineWidthEnd}function ro(l){if(l<=0)return ee.lineWidthStart;if(l>=3)return ee.lineWidthEnd;const a=l/3;return ee.lineWidthStart+(ee.lineWidthEnd-ee.lineWidthStart)*a}function Oe(l,a,h,I){const A=1-l,$=A*A*A*a.x+3*A*A*l*h.x1+3*A*l*l*h.x2+l*l*l*I.x,j=A*A*A*a.y+3*A*A*l*h.y1+3*A*l*l*h.y2+l*l*l*I.y;return{x:$,y:j}}function Dt(l,a,h,I,A=32,$="curve",j="right"){if($==="curve"){let Tt;if(j==="right"||j==="left"){const Le=Math.abs(a.x-l.x)*.45,Mt=j==="right"?1:-1;Tt={x1:l.x+Mt*Le,y1:l.y,x2:a.x-Mt*Le,y2:a.y}}else{const Le=Math.abs(a.y-l.y)*.45;Tt={x1:l.x,y1:l.y+Le,x2:a.x,y2:a.y-Le}}const go=Se=>{const Le=1-Se,Mt=-3*Le*Le*l.x+3*(Le*Le-2*Le*Se)*Tt.x1+3*(2*Le*Se-Se*Se)*Tt.x2+3*Se*Se*a.x,Nn=-3*Le*Le*l.y+3*(Le*Le-2*Le*Se)*Tt.y1+3*(2*Le*Se-Se*Se)*Tt.y2+3*Se*Se*a.y;return{dx:Mt,dy:Nn}},Pt=[],ho=[];for(let Se=0;Se<=A;Se++){const Le=Se/A,Mt=Se===0?l:Se===A?a:Oe(Le,l,Tt,a),Nn=go(Le);let ko=Math.hypot(Nn.dx,Nn.dy);ko<1e-6&&(ko=1);const rl=-Nn.dy/ko,ll=Nn.dx/ko,yo=(h+(I-h)*Le)/2;Pt.push({x:Mt.x+rl*yo,y:Mt.y+ll*yo}),ho.push({x:Mt.x-rl*yo,y:Mt.y-ll*yo})}let bo=`M ${Pt[0].x.toFixed(2)} ${Pt[0].y.toFixed(2)}`;for(let Se=1;Se<=A;Se++)bo+=` L ${Pt[Se].x.toFixed(2)} ${Pt[Se].y.toFixed(2)}`;for(let Se=A;Se>=0;Se--)bo+=` L ${ho[Se].x.toFixed(2)} ${ho[Se].y.toFixed(2)}`;return bo+=" Z",bo}const ne=a.x-l.x,Ne=a.y-l.y;let M=Math.hypot(ne,Ne);M<1e-6&&(M=1);const tt=-Ne/M,rt=ne/M,ge=h/2,ht=I/2,wn={x:l.x+tt*ge,y:l.y+rt*ge},bt={x:l.x-tt*ge,y:l.y-rt*ge},vn={x:a.x-tt*ht,y:a.y-rt*ht},Ln={x:a.x+tt*ht,y:a.y+rt*ht};return`M ${wn.x.toFixed(2)} ${wn.y.toFixed(2)} L ${Ln.x.toFixed(2)} ${Ln.y.toFixed(2)} L ${vn.x.toFixed(2)} ${vn.y.toFixed(2)} L ${bt.x.toFixed(2)} ${bt.y.toFixed(2)} Z`}const hn=e.computed(()=>Fe.value.root.children),lo=Ct[0].colors,bn=e.computed(()=>Ml(ee.branchPaletteId,ee.customPalettes)),St=e.computed(()=>{const l=new Map;if(!ee.rainbowBranch)return l;const a=i.lineColors,h=a&&a.length>0?a:bn.value.colors.length>0?bn.value.colors:lo;for(let A=0;A<hn.value.length;A++){const $=hn.value[A];l.set($.id,h[A%h.length])}const I=(A,$)=>{l.set(A.id,$);for(const j of A.children)I(j,$)};for(let A=0;A<hn.value.length;A++){const $=hn.value[A];I($,h[A%h.length])}return l});function ao(l,a){return ee.rainbowBranch?St.value.get(a.id)??et.value.lineColor:et.value.lineColor}function oi(l){const a=W(l.id);if(a.bg)return a.bg;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return co(h,.18)}return et.value.branchBg}function lt(l){const a=W(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return et.value.rootText;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return kn(h,.55)}return et.value.branchText}function _t(l){const a=W(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return kn(h,.3)}return et.value.lineColor}function so(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function co(l,a){const h=l.replace("#",""),I=h.length===6?h:h.split("").map(ne=>ne+ne).join(""),A=parseInt(I.slice(0,2),16),$=parseInt(I.slice(2,4),16),j=parseInt(I.slice(4,6),16);return`rgba(${A}, ${$}, ${j}, ${a})`}function kn(l,a){const h=l.replace("#",""),I=h.length===6?h:h.split("").map(ne=>ne+ne).join(""),A=Math.round(parseInt(I.slice(0,2),16)*(1-a)),$=Math.round(parseInt(I.slice(2,4),16)*(1-a)),j=Math.round(parseInt(I.slice(4,6),16)*(1-a));return`rgb(${A}, ${$}, ${j})`}const te=Fl({getContainer:()=>s.value});te.setOnMarqueeEnd(df),Hl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>m.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>g.value.id,onAddChild:Be,onAddSibling:Ye,onAddSiblingBefore:at,onRemove:qr,onStartEdit:Vt,onClearSelection:()=>{d.value=new Set,it()},onDuplicate:xn,onCopy:On,onCut:jr,onPaste:Kr,onUndo:ii,onRedo:ri,onNavigate:ef,onSelectRoot:()=>{d.value=new Set([g.value.id]),it()}});const Fe=e.computed(()=>{const l=ct(g.value);return fo(l),Tl(l,{mode:ee.layoutMode,baseFontSize:et.value.fontSize,richHeights:_.value,richWidths:b.value})}),qt=e.ref([]),ot=e.computed(()=>(vt.value,qt.value));e.watch(Fe,l=>{const a=[],h=I=>{a.push(I);for(const A of I.children)h(A)};h(l.root),qt.value=a},{immediate:!0});const uo=e.computed(()=>{const l=[];for(const a of ot.value)for(const h of a.children)l.push({from:a,to:h,key:`${a.id}->${h.id}`});return l}),mo=e.computed(()=>`${Fe.value.vbX} ${Fe.value.vbY} ${Fe.value.vbW} ${Fe.value.vbH}`);function fo(l){if(p.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)fo(a)}function Vt(l){const a=fe(g.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const h=document.querySelector(".zm-input");h==null||h.focus(),h==null||h.select()}))}function yn(){if(!c.value)return;const l=fe(g.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ie(),r("change",g.value)),c.value=null}function En(){c.value=null}function $t(l){if(i.previewMode)return;const a=fe(g.value,l);a!=null&&a.richContent&&(x.value=l,R.value=a.richContent.raw,e.nextTick(()=>{const h=document.querySelector(".zm-node .zm-rich textarea");h==null||h.focus()}))}function X(){if(!x.value)return;const l=x.value,a=fe(g.value,l),h=R.value;if(a&&a.richContent&&a.richContent.raw!==h)if(a.richContent.kind==="code"){const I=nn(h)||void 0;Te(l,{kind:"code",raw:h,lang:I})}else Te(l,{kind:"table",raw:h});x.value=null}function f(){x.value=null}function O(l){l.key==="Escape"?(l.preventDefault(),f()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),X())}function G(l,a){const h=S.value.get(l);!h||h.col!==a?S.value.set(l,{col:a,dir:"asc"}):h.dir==="asc"?S.value.set(l,{col:a,dir:"desc"}):S.value.delete(l)}function ye(l,a){const h=S.value.get(l);return!h||a.length<=1?a:cr(a,h.col,h.dir)}function me(l,a){const h=S.value.get(l);return!h||h.col!==a?"↕":h.dir==="asc"?"▲":"▼"}function Ce(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),ii()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ri())}function Be(l){const a=ki(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function Ye(l){if(l===g.value.id){Be(l);return}const a=yi(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function at(l){if(l===g.value.id){Be(l);return}const a=Ll(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function xn(l){if(l===g.value.id)return;const a=Dl(g.value,l);a&&(Ie(),d.value=new Set([a.id]),it(),r("change",g.value),be())}function Ve(l){const a=[],h=new Set;for(const I of l)I!==g.value.id&&(h.has(I)||fe(g.value,I)&&(h.add(I),a.push(I)));return a}function In(l){const a=new Set(l),h=[],I=A=>{a.has(A.id)&&h.push(A.id);for(const $ of A.children)I($)};return I(g.value),h}function On(l){const a=In(Ve(l));if(a.length===0)return;const h=[];for(const I of a){const A=Ei(g.value,I);A&&h.push(A)}h.length!==0&&(L.value={nodes:h,originalIds:new Set(a)},be())}function jr(l){const a=In(Ve(l));if(a.length===0)return;const h=[];for(const I of a){const A=Ei(g.value,I);A&&h.push(A)}if(h.length!==0){Ie();for(const I of a)Pn(g.value,I);d.value=new Set,it(),L.value={nodes:h,originalIds:new Set(a)},be(),r("change",g.value)}}function Kr(l){const a=L.value;if(!a||a.nodes.length===0)return;const h=l??g.value.id,I=fe(g.value,h);if(I){for(const A of a.originalIds){const $=fe(g.value,A);if($&&fe($,h))return}Ie();for(const A of a.nodes){const $=ct(A);Fn($),I.children.push($)}L.value=null,be(),r("change",g.value)}}function ii(){const l=Qe.undo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function ri(){const l=Qe.redo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function it(){const l=[];for(const a of d.value){const h=fe(g.value,a);h&&l.push(h)}r("select",l.length>0?l:null)}function ef(l,a){const h=m.value??g.value.id,I=fe(g.value,h);if(!I)return;let A=null;if(a===1){const $=ut(g.value,I.id);if($){const j=$.children.findIndex(ne=>ne.id===I.id);j>=0&&j<$.children.length-1&&(A=$.children[j+1].id)}}else if(a===-1){const $=ut(g.value,I.id);if($){const j=$.children.findIndex(ne=>ne.id===I.id);j>0&&(A=$.children[j-1].id)}}else if(l===1){const $=ut(g.value,I.id);$&&(A=$.id)}else l===-1&&I.children.length>0&&(A=I.children[0].id);A&&(d.value=new Set([A]),it())}function qr(l){if(l!==g.value.id&&Pn(g.value,l)){if(Ie(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,it()}be(),r("change",g.value)}}function Yr(l){p.value.has(l)?p.value.delete(l):p.value.add(l),be()}function Xr(l){const a=[{n:g.value,depth:1}];for(;a.length;){const{n:h,depth:I}=a.pop();l(h,I);for(let A=h.children.length-1;A>=0;A--)a.push({n:h.children[A],depth:I+1})}}function tf(){p.value=new Set,Xr(l=>{l.children.length>0&&p.value.add(l.id)}),be()}function Zr(l){p.value=new Set,Xr((a,h)=>{h>l&&a.children.length>0&&p.value.add(a.id)}),be()}function nf(){p.value=new Set,be()}function of(l,a){Ol(g.value,l,a)&&(Ie(),be(),r("change",g.value))}function Jr(l,a,h){return vl(g.value,l,a,h)?(Ie(),be(),r("change",g.value),!0):!1}function rf(l,a){if(l.stopPropagation(),l.shiftKey){const h=new Set(d.value);h.has(a.id)?h.delete(a.id):h.add(a.id),d.value=h}else d.value=new Set([a.id]);it()}function lf(l,a,h){let I=null;for(const A of ot.value){if(A.id===h)continue;const $=A.width/2,j=A.height/2;l>=A.x-$&&l<=A.x+$&&a>=A.y-j&&a<=A.y+j&&(I=A)}return I}function af(l,a){if(i.previewMode||a.isRoot||l.button!==0)return;const h=l.target;if(h!=null&&h.closest(".zm-img-resize-handle"))return;l.stopPropagation();const I=s.value.getBoundingClientRect(),A=a.x*te.scale.value+te.offsetX.value,$=a.y*te.scale.value+te.offsetY.value,j=l.clientX-I.left-A,ne=l.clientY-I.top-$;y.value={srcId:a.id,srcText:a.text,pointerOffsetX:j,pointerOffsetY:ne,currentTargetId:null},w.value=l.clientX-I.left-j,E.value=l.clientY-I.top-ne,document.body.classList.add("is-dragging"),window.addEventListener("pointermove",Qr),window.addEventListener("pointerup",po),window.addEventListener("pointercancel",po)}function Qr(l){const a=y.value;if(!a)return;const h=s.value.getBoundingClientRect();w.value=l.clientX-h.left-a.pointerOffsetX,E.value=l.clientY-h.top-a.pointerOffsetY;const I=(l.clientX-h.left-te.offsetX.value)/te.scale.value,A=(l.clientY-h.top-te.offsetY.value)/te.scale.value,$=lf(I,A,a.srcId);a.currentTargetId=($==null?void 0:$.id)??null}function po(l){const a=y.value;a&&(window.removeEventListener("pointermove",Qr),window.removeEventListener("pointerup",po),window.removeEventListener("pointercancel",po),a.currentTargetId&&(Jr(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),it()),y.value=null,w.value=0,E.value=0,document.body.classList.remove("is-dragging"))}function sf(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){te.startPan(l);return}if(l.button!==0)return;const h=s.value.getBoundingClientRect(),I=(l.clientX-h.left-te.offsetX.value)/te.scale.value,A=(l.clientY-h.top-te.offsetY.value)/te.scale.value;te.startMarquee(I,A,{shift:l.shiftKey})}function cf(l){if(pn){pn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const h=te.marquee;h.width>=4||h.height>=4||d.value.size>0&&(d.value=new Set,it())}function df(){const l=te.marquee;if(l.width<4&&l.height<4)return;const a=l.x,h=l.y,I=l.x+l.width,A=l.y+l.height,$=[];for(const j of ot.value){const ne=j.width/2,Ne=j.height/2,M=j.x-ne,tt=j.x+ne,rt=j.y-Ne,ge=j.y+Ne;M<=I&&tt>=a&&rt<=A&&ge>=h&&$.push(j.id)}d.value=l.shiftKey?new Set([...d.value,...$]):new Set($),it()}function el(l){return p.value.has(l)}function uf(l){const a=fe(g.value,l.id);return!!a&&a.children.length>0}function li(l){const a=fe(g.value,l);return a?a.children.length:0}function tl(l){if(!fe(g.value,l))return 0;const I=[g.value];for(;I.length;){const A=I.pop(),$=A.children.findIndex(j=>j.id===l);if($>=0)return $;for(const j of A.children)I.push(j)}return 0}function nl(l,a,h,I){if(((I==null?void 0:I._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let $;a==="in"?$=-l.side:h!==void 0?$=h:$=l.side;const j=a==="in"?l._richInsetX??0:0;return{x:l.x+$*(l.width/2-j),y:l.y}}function At(){const l=Fe.value;te.resetView(l.width,l.height,l.root.y)}function mf(){nt.value=!0,Ie(),be(),e.nextTick(()=>At())}function ai(l){ee.layoutMode!==l&&(ee.layoutMode=l,be(),e.nextTick(()=>At()))}function ol(){return JSON.stringify(g.value,null,2)}function ff(l){const a=fe(g.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw):!1}function il(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(Qe.reset(),g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>At()),r("change",g.value),!0)}catch{return!1}}function pf(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var I;const a=(I=l.files)==null?void 0:I[0];if(!a)return;const h=new FileReader;h.onload=()=>{typeof h.result=="string"&&(il(h.result)||alert("导入失败:JSON 格式无效"))},h.readAsText(a)},l.click()}function gf(){const l=new Blob([ol()],{type:"application/json"}),a=URL.createObjectURL(l),h=document.createElement("a");h.href=a,h.download=`${g.value.text||"mindmap"}.json`,h.click(),URL.revokeObjectURL(a)}return o({addChild:l=>Be(l),addSibling:l=>Ye(l),removeNode:l=>qr(l),duplicateNode:l=>xn(l),setNodeText:(l,a)=>of(l,a),moveNode:(l,a,h)=>Jr(l,a,h),lineWidthForDepth:io,endWidthForDepth:Lt,getData:()=>g.value,nodeHasContent:l=>ff(l),getSelectedIds:()=>[...d.value],copyNodes:l=>On(l),cutNodes:l=>jr(l),pasteNodes:l=>Kr(l),setData:l=>{Qe.reset(),g.value=ct(l),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>At())},resetView:()=>At(),exportData:ol,importData:il,getMarkdown:()=>Jt(g.value),setMarkdown:(l,a=!0)=>{const h=Zt(l||"");a&&(v.value=!0),H=!a,Qe.reset(),g.value=ct(h),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>{H=!1,At()}),r("change",g.value)},setBalanced:l=>{nt.value=l},isBalanced:()=>nt.value,balance:()=>mf(),applyNodeStyle:(l,a)=>ae(l,a),getNodeStyle:l=>W(l),applyNodeImage:(l,a)=>K(l,a),applyNodeImageByUrl:(l,a)=>N(l,a),removeNodeImage:l=>F(l),applyNodeLink:(l,a)=>se(l,a),removeNodeLink:l=>ke(l),applyNodeNote:(l,a)=>Re(l,a),removeNodeNote:l=>Pe(l),applyNodeRichContent:(l,a)=>Te(l,a),undo:()=>ii(),redo:()=>ri(),canUndo:()=>Qe.canUndo(),canRedo:()=>Qe.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(ee.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(ee.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(ee.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(ee.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(ee.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(ee.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(ee.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(ee.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(ee.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:ee.autoBalanceOnChange,lineWidthStart:ee.lineWidthStart,lineWidthEnd:ee.lineWidthEnd,rainbowBranch:ee.rainbowBranch,branchPaletteId:ee.branchPaletteId,customPalettes:ee.customPalettes,lineStyle:ee.lineStyle,layoutMode:ee.layoutMode,taperedEdge:ee.taperedEdge,showOrderBadge:ee.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Ct,...ee.customPalettes].find(h=>h.id===l)&&(ee.branchPaletteId=l)},getBranchPalette:()=>ee.branchPaletteId,getBranchPalettes:()=>[...Ct,...ee.customPalettes]}),e.watch(()=>i.data,l=>{g.value=ct(l),be()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>At())}),(l,a)=>{var h,I,A,$,j,ne,Ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:et.value.bgColor,fontSize:et.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:sf,onContextmenu:ce,onWheel:a[26]||(a[26]=(...M)=>e.unref(te).onWheel&&e.unref(te).onWheel(...M)),onMouseenter:a[27]||(a[27]=M=>k.value=!0),onMouseleave:a[28]||(a[28]=M=>k.value=!1),onClick:cf},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:Fe.value.vbX*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:Fe.value.vbY*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:Fe.value.vbW*e.unref(te).scale.value+"px",height:Fe.value.vbH*e.unref(te).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mo.value,preserveAspectRatio:"xMinYMin meet",width:Fe.value.vbW*e.unref(te).scale.value,height:Fe.value.vbH*e.unref(te).scale.value},[e.createElementVNode("g",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:Dt(nl(M.from,"out",M.to.side,M.to),nl(M.to,"in"),io(M.from.depth),Lt(M.to.depth),32,ee.lineStyle,M.to._dir),fill:ao(M.from,M.to),stroke:"none"},null,8,ls))),128))])],8,is))],4),e.unref(te).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(te).marquee.x*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:e.unref(te).marquee.y*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:e.unref(te).marquee.width*e.unref(te).scale.value+"px",height:e.unref(te).marquee.height*e.unref(te).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:w.value+"px",top:E.value+"px",transform:`scale(${e.unref(te).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(y.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(te).offsetX.value}px, ${e.unref(te).offsetY.value}px) scale(${e.unref(te).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,M=>{var tt,rt;return e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":m.value===M.id,"is-selected-secondary":m.value!==M.id&&d.value.has(M.id),"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":ze.value===M.id,"is-dragging-source":((tt=y.value)==null?void 0:tt.srcId)===M.id,"is-drop-target":((rt=y.value)==null?void 0:rt.currentTargetId)===M.id}]),"data-node-id":M.id,style:e.normalizeStyle({left:M.x+"px",top:M.y+"px",width:M.width+"px",minWidth:M.width+"px",height:M.height+"px",fontSize:M.fontSize+"px",background:oi(M),color:lt(M),borderColor:_t(M),fontWeight:so(M),transform:"translate(-50%, -50%)"}),onClick:ge=>rf(ge,M),onPointerdown:ge=>af(ge,M),onDblclick:ge=>{ge.stopPropagation(),t.previewMode||Vt(M.id)},onContextmenu:ge=>V(ge,M),onMouseenter:ge=>{zn(M.id),gn(ge,M)},onMouseleave:ge=>oo(M.id)},[M.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:M.image.src,width:M.image.width,height:M.image.height,alt:M.text,draggable:"false"},null,8,ss)):e.createCommentVNode("",!0),M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table")&&c.value!==M.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":M.richContent.kind==="table"||M.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ge=>$t(M.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[x.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ge=>R.value=ge),class:"zm-rich-edit",spellcheck:"false",onBlur:X,onKeydown:O},null,544)),[[e.vModelText,R.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ds,[e.createElementVNode("code",{innerHTML:e.unref(Bo)(e.unref(Ro)(M.richContent.raw),e.unref(nn)(M.richContent.raw))},null,8,us)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",ms,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(M.id,e.unref(sr)(M.richContent.raw)),(ge,ht)=>(e.openBlock(),e.createElementBlock("tr",{key:ht},[ht===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(wn,bt)=>{var vn,Ln,Tt,go,Pt;return e.openBlock(),e.createElementBlock("th",{key:`h${bt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((vn=S.value.get(M.id))==null?void 0:vn.col)===bt,"is-asc":((Ln=S.value.get(M.id))==null?void 0:Ln.col)===bt&&((Tt=S.value.get(M.id))==null?void 0:Tt.dir)==="asc","is-desc":((go=S.value.get(M.id))==null?void 0:go.col)===bt&&((Pt=S.value.get(M.id))==null?void 0:Pt.dir)==="desc"}]),onClick:e.withModifiers(ho=>G(M.id,bt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(wn),1),e.createElementVNode("span",ps,e.toDisplayString(me(M.id,bt)),1)],10,fs)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(wn,bt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${bt}`},e.toDisplayString(wn),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,cs)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",gs,[e.createElementVNode("span",hs,e.toDisplayString(M.text),1),M.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:M.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${M.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,bs)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Z(M.note.text),onClick:e.withModifiers(ge=>U(M.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,ks)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ge=>u.value=ge),autofocus:"",onBlur:a[7]||(a[7]=ge=>yn()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ge=>yn(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ge=>yn(),["prevent"]),["tab"])),e.withKeys(En,["esc"]),Ce],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),oe.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${tl(M.id)+1} 个`},e.toDisplayString(tl(M.id)+1),9,ys)):e.createCommentVNode("",!0),el(M.id)&&li(M.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({background:St.value.get(M.id)??"#64748b"}),title:`展开 ${li(M.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Yr(M.id),["stop"])},e.toDisplayString(li(M.id)),47,Es)):e.createCommentVNode("",!0),uf(M)&&!el(M.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({color:St.value.get(M.id)??"#64748b",borderColor:St.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Yr(M.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,xs)):e.createCommentVNode("",!0),M.image&&m.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ge=>Ue(ge,M),["stop"])},null,40,ws)):e.createCommentVNode("",!0),M.image&&m.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>F(M.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,Ns)):e.createCommentVNode("",!0)],46,as)}),128))],4),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!C.value.above}]),style:e.normalizeStyle({left:C.value.x+"px",top:C.value.y+"px"})},e.toDisplayString(C.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(Gl,{key:3,x:B.value.x,y:B.value.y,container:s.value,"has-image":!!((h=e.unref(fe)(g.value,B.value.nodeId))!=null&&h.image),"has-link":!!((I=e.unref(fe)(g.value,B.value.nodeId))!=null&&I.link),"has-note":!!((A=e.unref(fe)(g.value,B.value.nodeId))!=null&&A.note),"has-code":((j=($=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="code","has-table":((Ne=(ne=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:ne.richContent)==null?void 0:Ne.kind)==="table",onPickImage:mn,onRemoveImage:we,onSetLink:It,onRemoveLink:Q,onEditNote:wt,onRemoveNote:Me,onAddCode:pt,onEditCode:pt,onRemoveCode:qe,onAddTable:gt,onEditTable:gt,onRemoveTable:Nt,onClose:T},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(jl,{key:4,x:z.value.x,y:z.value.y,container:s.value,onOpenSettings:De,onOpenData:Ke,onOpenImport:We,onClose:de},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(ie.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=M=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ss),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:"显示大纲视图",onClick:a[16]||(a[16]=M=>r("canvas-outline"))},[e.createVNode(xe,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":k.value}])},[e.createElementVNode("span",Ts,e.toDisplayString(Math.round(e.unref(te).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...M)=>e.unref(te).zoomIn&&e.unref(te).zoomIn(...M))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...M)=>e.unref(te).zoomOut&&e.unref(te).zoomOut(...M))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:At},[e.createVNode(xe,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:tf},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=M=>Zr(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=M=>Zr(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:nf},[e.createVNode(xe,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:gf},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=M=>m.value&&Be(m.value))},[e.createElementVNode("img",{src:e.unref(ui),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Cs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=M=>m.value&&Ye(m.value))},[e.createElementVNode("img",{src:e.unref(di),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,_s)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=M=>ai("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=M=>ai("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=M=>ai("org"))},[e.createVNode(xe,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:pf},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),As={class:"zm-outline-root"},Ms={class:"zm-outline-actions"},Rs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},zs={key:1,d:"M5 12 L10 17 L19 7"},Is={class:"zm-outline"},Os=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],vs=["title","onClick"],Ls={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ds={key:0,points:"6 9 12 15 18 9"},Vs={key:1,points:"9 6 15 12 9 18"},$s={key:1,class:"zm-outline-dot"},Ps={class:"zm-outline-index"},Fs={key:3,class:"zm-outline-text"},Us=["onClick"],Hs=["src"],Ws=["onClick"],Gs=["src"],js=["title","onClick"],Ks={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={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,i=o,r=e.computed(()=>{const W=[],K=(F,N,P)=>{const D=F.children.length>0,Y=n.collapsedIds.has(F.id);W.push({id:F.id,text:F.text||"(无标题)",depth:N,siblingIndex:P,hasChildren:D,collapsed:Y,node:F}),D&&!Y&&F.children.forEach((se,ke)=>K(se,N+1,ke))};return K(n.data,0,0),W}),s=e.ref(null),c=e.ref("");let u=null;function d(W){n.readonly||(s.value=W.id,c.value=W.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){s.value!=null&&(i("edit",{id:s.value,text:c.value.trim()||"(无标题)"}),p())}function p(){s.value=null,c.value="",u=null}function k(W){W.key==="Enter"?(W.preventDefault(),m()):W.key==="Escape"&&(W.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),E=e.ref(null);function L(W,K){if(n.readonly){W.preventDefault();return}y.value={id:K.id,text:K.text},W.dataTransfer&&(W.dataTransfer.effectAllowed="move",W.dataTransfer.setData("text/plain",K.id))}function C(){y.value=null,w.value=null,E.value=null}function x(W,K){if(!y.value)return;W.preventDefault(),W.dataTransfer&&(W.dataTransfer.dropEffect="move");const F=g(W);w.value=K.id,E.value=F}function R(W){w.value===W.id&&(w.value=null,E.value=null)}function S(W,K){W.preventDefault();const F=y.value;if(!F)return;const N=g(W);F.id!==K.id&&i("move",{srcId:F.id,targetId:K.id,position:N}),C()}function g(W,K){const N=W.currentTarget.getBoundingClientRect(),P=W.clientY-N.top,D=N.height;return P<D*.3?"before":P>D*.7?"after":"child"}const _=e.ref(null);let b=null;async function v(W){try{return await navigator.clipboard.writeText(W),!0}catch{const K=document.createElement("textarea");K.value=W,document.body.appendChild(K),K.select();let F=!1;try{F=document.execCommand("copy")}finally{document.body.removeChild(K)}return F}}async function H(W,K,F){W.stopPropagation(),await v(K)&&(_.value=F,b&&clearTimeout(b),b=setTimeout(()=>_.value=null,1200))}const oe=e.computed(()=>{const W=[],K=(F,N)=>{const P=" ".repeat(N),D=N===0?"":"- ";W.push(P+D+(F.text||""));for(const Y of F.children)K(Y,N+1)};return K(n.data,0),W.join(`
23
- `)}),q=e.ref(!1);let J=null;async function ae(){await v(oe.value)&&(q.value=!0,J&&clearTimeout(J),J=setTimeout(()=>q.value=!1,1200))}return(W,K)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",Ms,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":q.value}]),title:"复制完整大纲为纯文本",onClick:ae},[(e.openBlock(),e.createElementBlock("svg",Rs,[q.value?(e.openBlock(),e.createElementBlock("path",zs)):(e.openBlock(),e.createElementBlock("rect",Bs)),K[2]||(K[2]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(q.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,F=>(e.openBlock(),e.createElementBlock("li",{key:F.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":F.id===t.selectedId,"is-root":F.depth===0,"is-editing":s.value===F.id,"is-drag-over-before":w.value===F.id&&E.value==="before","is-drag-over-after":w.value===F.id&&E.value==="after","is-drag-over-child":w.value===F.id&&E.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+F.depth*16+"px"}),draggable:"true",onClick:N=>i("select",F.node),onDblclick:N=>d(F),onDragstart:N=>L(N,F),onDragend:C,onDragover:N=>x(N,F),onDragleave:()=>R(F),onDrop:N=>S(N,F)},[F.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:F.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",F.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ls,[F.collapsed?(e.openBlock(),e.createElementBlock("polyline",Vs)):(e.openBlock(),e.createElementBlock("polyline",Ds))]))],8,vs)):(e.openBlock(),e.createElementBlock("span",$s)),e.createElementVNode("span",Ps,e.toDisplayString(F.siblingIndex+1)+".",1),s.value===F.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":K[0]||(K[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:k,onClick:K[1]||(K[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Fs,e.toDisplayString(F.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(di),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Hs)],8,Us)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ui),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Gs)],8,Ws)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":_.value===F.id}]),title:_.value===F.id?"已复制":"复制节点文本",onClick:N=>H(N,F.text,F.id)},[(e.openBlock(),e.createElementBlock("svg",Ks,[_.value!==F.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Ys)),K[3]||(K[3]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,js)],46,Os))),128))])]))}}),Xs=["aria-hidden"],Zs=["aria-hidden"],Js={key:0,class:"zm-drawer-header"},Qs={key:0,class:"zm-drawer-title"},ec={class:"zm-drawer-body"},tc=["aria-hidden"],nc={key:0,class:"zm-drawer-header"},oc={key:0,class:"zm-drawer-title"},ic={class:"zm-drawer-body"},rn=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 r(){n("update:open",!1)}return(s,c)=>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:c[0]||(c[0]=u=>t.closeOnBackdrop&&r())},null,8,Xs)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",Js,[t.title?(e.openBlock(),e.createElementBlock("h3",Qs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[1]||(c[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",ec,[e.renderSlot(s.$slots,"default")])],14,Zs)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",nc,[t.title?(e.openBlock(),e.createElementBlock("h3",oc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[2]||(c[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",ic,[e.renderSlot(s.$slots,"default")])],14,tc)):e.createCommentVNode("",!0)]),_:3}))}}),rc={key:0,class:"zm-jtv-root"},lc={key:0,class:"zm-jtv-key"},ac={key:1,class:"zm-jtv-colon"},sc={key:2,class:"zm-jtv-key zm-jtv-bracket"},cc={key:3,class:"zm-jtv-size"},dc={key:4,class:"zm-jtv-bracket"},uc={key:5,class:"zm-jtv-brace"},mc={key:0,class:"zm-jtv-children"},fc={class:"zm-jtv-key"},pc={key:0,class:"zm-jtv-key"},gc=["src","alt"],hc=["href"],bc=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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const s=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const R=o.value,S=Object.keys(R);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((R,S)=>({key:String(S),value:R})):i.value?Object.entries(o.value).map(([R,S])=>({key:R,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function m(R,S,g){R!=="<root>"&&(g<2||S===null||typeof S!="object"||o.collapsedPaths.has(R)||o.collapsedPaths.add(R))}o.isRoot||m(u.value,o.value,o.depth);function p(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function k(R){return u.value===""?R:`${u.value}.${R}`}function y(R){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof R=="string"?R.toLowerCase().includes(S):R===null?"null".includes(S):String(R).toLowerCase().includes(S)}function w(R){return o.query?R.toLowerCase().includes(o.query.toLowerCase()):!0}function E(R,S){return!o.query||w(R)?!0:S===null||typeof S!="object"?y(S):!0}function L(R){return R===null?"null":typeof R=="string"?R.length>80?`"${R.slice(0,80)}..."`:`"${R}"`:typeof R=="boolean"?R?"true":"false":typeof R=="number"?String(R):typeof R>"u"?"undefined":JSON.stringify(R)}function C(R){if(typeof R!="string")return!1;const S=R.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(R){if(!o.query)return null;const S=R.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:R.slice(0,S),match:R.slice(S,S+o.query.length),after:R.slice(S+o.query.length)}}return(R,S)=>{var _,b,v,H,oe,q;const g=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":J.key,value:J.value,path:k(J.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,E(J.key,J.value)]])),128))])):i.value||r.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:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",lc,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ac,":")),r.value?(e.openBlock(),e.createElementBlock("span",sc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",cc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",dc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",uc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":J.key,value:J.value,path:k(J.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,E(J.key,J.value)]])),128))])),!d.value&&r.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&&!r.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"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",fc,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",pc,[e.createElementVNode("span",null,e.toDisplayString((_=x(t.keyName))==null?void 0:_.before),1),e.createElementVNode("mark",null,e.toDisplayString((b=x(t.keyName))==null?void 0:b.match),1),e.createElementVNode("span",null,e.toDisplayString((v=x(t.keyName))==null?void 0:v.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(L(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((H=x(L(t.value)))==null?void 0:H.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(L(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((q=x(L(t.value)))==null?void 0:q.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(L(t.value)),1)],64))],2),C(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[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,gc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,hc)])):e.createCommentVNode("",!0)],4))}}}),kc={class:"zm-data-panel"},yc={class:"zm-data-header"},Ec={class:"zm-data-title"},xc={class:"zm-data-title-meta"},wc={class:"zm-data-toolbar"},Nc=["title"],Sc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tc={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"},Cc={key:0,class:"zm-data-paste"},_c={class:"zm-data-tabs"},Ac=["placeholder"],Mc={key:0,class:"zm-data-error"},Rc={class:"zm-data-paste-actions"},Bc=["disabled"],zc={class:"zm-data-tree"},Io=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),k=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,d.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(S)}}}function w(){const S=new Blob([r.value],{type:"application/json"}),g=URL.createObjectURL(S),_=document.createElement("a");_.href=g,_.download=`${n.data.text||"mindmap"}.json`,_.click(),URL.revokeObjectURL(g)}function E(){c.value=null;const S=s.value.trim();if(S){if(d.value==="markdown"||d.value==="txt"){try{const g=Zt(S);i("import",g),s.value="",u.value=!1}catch(g){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+g.message}return}try{const g=JSON.parse(S);if(!g.id||!Array.isArray(g.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",g),s.value="",u.value=!1}catch(g){c.value="JSON 解析失败:"+g.message}}}function L(S){return 1+S.children.reduce((g,_)=>g+L(_),0)}const C=e.computed(()=>L(n.data)),x=e.computed(()=>r.value.length);function R(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var b;const g=(b=S.files)==null?void 0:b[0];if(!g)return;const _=new FileReader;_.onload=()=>{typeof _.result=="string"&&(s.value=_.result,E())},_.readAsText(g)},S.click()}return(S,g)=>(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[e.createElementVNode("div",Ec,[g[8]||(g[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",xc,e.toDisplayString(C.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",Sc,[...g[9]||(g[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",Tc,[...g[10]||(g[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),g[11]||(g[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Nc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...g[12]||(g[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:R},[...g[13]||(g[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:g[0]||(g[0]=_=>u.value=!u.value)},[...g[14]||(g[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),g[16]||(g[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":k.value.length>0}])},[g[15]||(g[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":g[1]||(g[1]=_=>k.value=_),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,k.value]]),k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:g[2]||(g[2]=_=>k.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",_c,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:g[3]||(g[3]=_=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:g[4]||(g[4]=_=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[5]||(g[5]=_=>s.value=_),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ac),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Mc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:E},"应用",8,Bc),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[6]||(g[6]=_=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[7]||(g[7]=_=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",zc,[e.createVNode(bc,{value:t.data,query:k.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),g[17]||(g[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))]))}}),Ic={class:"zm-md-panel"},Oc={key:0,class:"zm-md-error"},vc={class:"zm-md-split"},Lc={class:"zm-md-edit"},Dc={class:"zm-md-preview"},Vc={class:"zm-md-preview-body"},$c={class:"zm-md-footer"},Pc=["disabled"],Fc=`# flow-mindmap 思维导图
22
+ | a | b | c |`);if(A===null)return;const $=A.trim();if(!$){Te(l,null);return}Te(l,{kind:"table",raw:$})}function St(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function H(l){i.previewMode||r("edit-note",l)}function Z(l,a=60){const h=l.replace(/\s+/g," ").trim();return h.length<=a?h||"点击编辑笔记":h.slice(0,a)+"…"}function le(l){var A;if(i.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const h=f.value;if(!h)return;const v=(A=l.clipboardData)==null?void 0:A.items;if(v)for(let $=0;$<v.length;$++){const j=v[$];if(j.kind==="file"&&j.type.startsWith("image/")){const te=j.getAsFile();if(!te)continue;l.preventDefault();const Ne=fe(g.value,h);if(Ne!=null&&Ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;V(te,M=>q(h,M));return}}}e.onMounted(()=>{window.addEventListener("paste",le),be()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const me=e.ref(null),ze=e.computed(()=>{var l;return((l=me.value)==null?void 0:l.nodeId)??null});function Ue(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const h=a.image.naturalW||a.image.width,v=a.image.naturalH||a.image.height,A=v>0?v/h:1;me.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:h,naturalH:v,ratio:A,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",Je),window.addEventListener("mouseup",vt)}function Je(l){var Ne,M;const a=me.value;if(!a)return;const h=J.scale.value||1,v=l.clientX-a.startX,A=P(a.startW+v/h,Wt,rn),$=P(A*a.ratio,Wt,rn);a.pendingW=A,a.pendingH=$;const j=(Ne=s.value)==null?void 0:Ne.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);j&&(j.style.width=`${A}px`,j.style.height=`${$}px`);const te=(M=s.value)==null?void 0:M.querySelector(`[data-node-id="${a.nodeId}"]`);te&&(te.style.minWidth=`${Math.max(80,Math.ceil(A+28))}px`,te.style.height=`${Math.ceil($+8+30)}px`)}function vt(){const l=me.value;if(window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",vt),me.value=null,!l)return;const a=fe(g.value,l.nodeId);!a||!a.image||(q(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),it(),gn=!0)}const pn=e.ref(null);let gn=!1;function In(l){pn.value=l}function io(l){pn.value===l&&(pn.value=null),C.value&&(C.value=null)}function hn(l,a){var bt;if(!a.text||a.text.length<14)return;const v=l.currentTarget.getBoundingClientRect(),A=(bt=s.value)==null?void 0:bt.getBoundingClientRect();if(!A)return;const $=10,j=240,te=v.top-A.top>60,Ne=v.left-A.left+v.width/2,M=$+j/2,tt=A.width-j/2-$,rt=Math.max(M,Math.min(Ne,tt)),ge=te?v.top-A.top-8:v.bottom-A.top+8;C.value={text:a.text,x:rt,y:ge,above:te}}const Lt=e.ref(0),nt=e.ref(!1),Qe=Kl(100);function Ie(){Qe.record({data:g.value,selectedIds:[...d.value]})}function be(){p.value=new Set(p.value),Lt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>oi()).then(()=>{Lt.value++})}function oi(){const l=document.querySelectorAll(".zm-rich"),a={},h={};l.forEach(v=>{let A=v,$=null;for(;A&&!$;)$=A.getAttribute("data-node-id"),A=A.parentElement;if(!$)return;const j=v.offsetHeight,te=v.scrollWidth,Ne=Math.round(j*2)/2,M=Math.round(te*2)/2;a[$]=Ne,h[$]=M,_.value[$],b.value[$]}),_.value=a,b.value=h}const et=e.computed(()=>{var l,a,h,v,A,$,j,te,Ne,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=i.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((h=i.theme)==null?void 0:h.branchBg)??"#ffffff",branchText:((v=i.theme)==null?void 0:v.branchText)??"#1f2937",lineColor:((A=i.theme)==null?void 0:A.lineColor)??"#94a3b8",bgColor:(($=i.theme)==null?void 0:$.bgColor)??"#f8fafc",fontSize:((j=i.theme)==null?void 0:j.fontSize)??14,lineWidthStart:((te=i.theme)==null?void 0:te.lineWidthStart)??2.2,lineWidthEnd:((Ne=i.theme)==null?void 0:Ne.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),ee=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function ro(l){return ee.taperedEdge?ii(l):lo(l)}function Dt(l){return ee.taperedEdge?ee.lineWidthEnd:lo(l)}function ii(l){return l<=0?ee.lineWidthStart:l===1?Math.max(1.5,ee.lineWidthStart*.67):l===2?Math.max(.8,ee.lineWidthStart*.42):ee.lineWidthEnd}function lo(l){if(l<=0)return ee.lineWidthStart;if(l>=3)return ee.lineWidthEnd;const a=l/3;return ee.lineWidthStart+(ee.lineWidthEnd-ee.lineWidthStart)*a}function Oe(l,a,h,v){const A=1-l,$=A*A*A*a.x+3*A*A*l*h.x1+3*A*l*l*h.x2+l*l*l*v.x,j=A*A*A*a.y+3*A*A*l*h.y1+3*A*l*l*h.y2+l*l*l*v.y;return{x:$,y:j}}function Vt(l,a,h,v,A=32,$="curve",j="right"){if($==="curve"){let Ct;if(j==="right"||j==="left"){const Le=Math.abs(a.x-l.x)*.45,Rt=j==="right"?1:-1;Ct={x1:l.x+Rt*Le,y1:l.y,x2:a.x-Rt*Le,y2:a.y}}else{const Le=Math.abs(a.y-l.y)*.45;Ct={x1:l.x,y1:l.y+Le,x2:a.x,y2:a.y-Le}}const bo=Se=>{const Le=1-Se,Rt=-3*Le*Le*l.x+3*(Le*Le-2*Le*Se)*Ct.x1+3*(2*Le*Se-Se*Se)*Ct.x2+3*Se*Se*a.x,Sn=-3*Le*Le*l.y+3*(Le*Le-2*Le*Se)*Ct.y1+3*(2*Le*Se-Se*Se)*Ct.y2+3*Se*Se*a.y;return{dx:Rt,dy:Sn}},Ft=[],ko=[];for(let Se=0;Se<=A;Se++){const Le=Se/A,Rt=Se===0?l:Se===A?a:Oe(Le,l,Ct,a),Sn=bo(Le);let Eo=Math.hypot(Sn.dx,Sn.dy);Eo<1e-6&&(Eo=1);const sl=-Sn.dy/Eo,cl=Sn.dx/Eo,xo=(h+(v-h)*Le)/2;Ft.push({x:Rt.x+sl*xo,y:Rt.y+cl*xo}),ko.push({x:Rt.x-sl*xo,y:Rt.y-cl*xo})}let yo=`M ${Ft[0].x.toFixed(2)} ${Ft[0].y.toFixed(2)}`;for(let Se=1;Se<=A;Se++)yo+=` L ${Ft[Se].x.toFixed(2)} ${Ft[Se].y.toFixed(2)}`;for(let Se=A;Se>=0;Se--)yo+=` L ${ko[Se].x.toFixed(2)} ${ko[Se].y.toFixed(2)}`;return yo+=" Z",yo}const te=a.x-l.x,Ne=a.y-l.y;let M=Math.hypot(te,Ne);M<1e-6&&(M=1);const tt=-Ne/M,rt=te/M,ge=h/2,bt=v/2,Nn={x:l.x+tt*ge,y:l.y+rt*ge},kt={x:l.x-tt*ge,y:l.y-rt*ge},Ln={x:a.x-tt*bt,y:a.y-rt*bt},Dn={x:a.x+tt*bt,y:a.y+rt*bt};return`M ${Nn.x.toFixed(2)} ${Nn.y.toFixed(2)} L ${Dn.x.toFixed(2)} ${Dn.y.toFixed(2)} L ${Ln.x.toFixed(2)} ${Ln.y.toFixed(2)} L ${kt.x.toFixed(2)} ${kt.y.toFixed(2)} Z`}const bn=e.computed(()=>Fe.value.root.children),ao=_t[0].colors,kn=e.computed(()=>zl(ee.branchPaletteId,ee.customPalettes)),Tt=e.computed(()=>{const l=new Map;if(!ee.rainbowBranch)return l;const a=i.lineColors,h=a&&a.length>0?a:kn.value.colors.length>0?kn.value.colors:ao;for(let A=0;A<bn.value.length;A++){const $=bn.value[A];l.set($.id,h[A%h.length])}const v=(A,$)=>{l.set(A.id,$);for(const j of A.children)v(j,$)};for(let A=0;A<bn.value.length;A++){const $=bn.value[A];v($,h[A%h.length])}return l});function so(l,a){return ee.rainbowBranch?Tt.value.get(a.id)??et.value.lineColor:et.value.lineColor}function ri(l){const a=F(l.id);if(a.bg)return a.bg;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return uo(h,.18)}return et.value.branchBg}function lt(l){const a=F(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return et.value.rootText;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return yn(h,.55)}return et.value.branchText}function At(l){const a=F(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return yn(h,.3)}return et.value.lineColor}function co(l){return F(l.id).fontWeight??(l.isRoot?600:400)}function uo(l,a){const h=l.replace("#",""),v=h.length===6?h:h.split("").map(te=>te+te).join(""),A=parseInt(v.slice(0,2),16),$=parseInt(v.slice(2,4),16),j=parseInt(v.slice(4,6),16);return`rgba(${A}, ${$}, ${j}, ${a})`}function yn(l,a){const h=l.replace("#",""),v=h.length===6?h:h.split("").map(te=>te+te).join(""),A=Math.round(parseInt(v.slice(0,2),16)*(1-a)),$=Math.round(parseInt(v.slice(2,4),16)*(1-a)),j=Math.round(parseInt(v.slice(4,6),16)*(1-a));return`rgb(${A}, ${$}, ${j})`}const J=Wl({getContainer:()=>s.value});J.setOnMarqueeEnd(mm),jl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>f.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>g.value.id,onAddChild:Be,onAddSibling:Ye,onAddSiblingBefore:at,onRemove:Zr,onStartEdit:$t,onClearSelection:()=>{d.value=new Set,it()},onDuplicate:wn,onCopy:vn,onCut:Yr,onPaste:Xr,hasClipboard:()=>!!L.value&&L.value.nodes.length>0,onUndo:li,onRedo:ai,onNavigate:im,onSelectRoot:()=>{d.value=new Set([g.value.id]),it()}});const Fe=e.computed(()=>{const l=ct(g.value);return po(l),Al(l,{mode:ee.layoutMode,baseFontSize:et.value.fontSize,richHeights:_.value,richWidths:b.value})}),Yt=e.ref([]),ot=e.computed(()=>(Lt.value,Yt.value));e.watch(Fe,l=>{const a=[],h=v=>{a.push(v);for(const A of v.children)h(A)};h(l.root),Yt.value=a},{immediate:!0});const fo=e.computed(()=>{const l=[];for(const a of ot.value)for(const h of a.children)l.push({from:a,to:h,key:`${a.id}->${h.id}`});return l}),mo=e.computed(()=>`${Fe.value.vbX} ${Fe.value.vbY} ${Fe.value.vbW} ${Fe.value.vbH}`);function po(l){if(p.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)po(a)}function $t(l){const a=fe(g.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const h=document.querySelector(".zm-input");h==null||h.focus(),h==null||h.select()}))}function En(){if(!c.value)return;const l=fe(g.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ie(),r("change",g.value)),c.value=null}function xn(){c.value=null}function Pt(l){if(i.previewMode)return;const a=fe(g.value,l);a!=null&&a.richContent&&(x.value=l,R.value=a.richContent.raw,e.nextTick(()=>{const h=document.querySelector(".zm-node .zm-rich textarea");h==null||h.focus()}))}function X(){if(!x.value)return;const l=x.value,a=fe(g.value,l),h=R.value;if(a&&a.richContent&&a.richContent.raw!==h)if(a.richContent.kind==="code"){const v=on(h)||void 0;Te(l,{kind:"code",raw:h,lang:v})}else Te(l,{kind:"table",raw:h});x.value=null}function m(){x.value=null}function I(l){l.key==="Escape"?(l.preventDefault(),m()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),X())}function G(l,a){const h=S.value.get(l);!h||h.col!==a?S.value.set(l,{col:a,dir:"asc"}):h.dir==="asc"?S.value.set(l,{col:a,dir:"desc"}):S.value.delete(l)}function ye(l,a){const h=S.value.get(l);return!h||a.length<=1?a:ur(a,h.col,h.dir)}function ue(l,a){const h=S.value.get(l);return!h||h.col!==a?"↕":h.dir==="asc"?"▲":"▼"}function Ce(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),li()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ai())}function Be(l){const a=Ei(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function Ye(l){if(l===g.value.id){Be(l);return}const a=xi(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function at(l){if(l===g.value.id){Be(l);return}const a=$l(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function wn(l){if(l===g.value.id)return;const a=Pl(g.value,l);a&&(Ie(),d.value=new Set([a.id]),it(),r("change",g.value),be())}function Ve(l){const a=[],h=new Set;for(const v of l)v!==g.value.id&&(h.has(v)||fe(g.value,v)&&(h.add(v),a.push(v)));return a}function On(l){const a=new Set(l),h=[],v=A=>{a.has(A.id)&&h.push(A.id);for(const $ of A.children)v($)};return v(g.value),h}function vn(l){const a=On(Ve(l));if(a.length===0)return;const h=[];for(const v of a){const A=wi(g.value,v);A&&h.push(A)}h.length!==0&&(L.value={nodes:h,originalIds:new Set(a)},be())}function Yr(l){const a=On(Ve(l));if(a.length===0)return;const h=[];for(const v of a){const A=wi(g.value,v);A&&h.push(A)}if(h.length!==0){Ie();for(const v of a)Fn(g.value,v);d.value=new Set,it(),L.value={nodes:h,originalIds:new Set(a)},be(),r("change",g.value)}}function Xr(l){const a=L.value;if(!a||a.nodes.length===0)return;const h=l??g.value.id,v=fe(g.value,h);if(v){for(const A of a.originalIds){const $=fe(g.value,A);if($&&fe($,h))return}Ie();for(const A of a.nodes){const $=ct(A);Un($),v.children.push($)}L.value=null,be(),r("change",g.value)}}function li(){const l=Qe.undo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function ai(){const l=Qe.redo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function it(){const l=[];for(const a of d.value){const h=fe(g.value,a);h&&l.push(h)}r("select",l.length>0?l:null)}function im(l,a){const h=f.value??g.value.id,v=fe(g.value,h);if(!v)return;let A=null;if(a===1){const $=ut(g.value,v.id);if($){const j=$.children.findIndex(te=>te.id===v.id);j>=0&&j<$.children.length-1&&(A=$.children[j+1].id)}}else if(a===-1){const $=ut(g.value,v.id);if($){const j=$.children.findIndex(te=>te.id===v.id);j>0&&(A=$.children[j-1].id)}}else if(l===1){const $=ut(g.value,v.id);$&&(A=$.id)}else l===-1&&v.children.length>0&&(A=v.children[0].id);A&&(d.value=new Set([A]),it())}function Zr(l){if(l!==g.value.id&&Fn(g.value,l)){if(Ie(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,it()}be(),r("change",g.value)}}function Jr(l){p.value.has(l)?p.value.delete(l):p.value.add(l),be()}function Qr(l){const a=[{n:g.value,depth:1}];for(;a.length;){const{n:h,depth:v}=a.pop();l(h,v);for(let A=h.children.length-1;A>=0;A--)a.push({n:h.children[A],depth:v+1})}}function rm(){p.value=new Set,Qr(l=>{l.children.length>0&&p.value.add(l.id)}),be()}function el(l){p.value=new Set,Qr((a,h)=>{h>l&&a.children.length>0&&p.value.add(a.id)}),be()}function lm(){p.value=new Set,be()}function am(l,a){Dl(g.value,l,a)&&(Ie(),be(),r("change",g.value))}function tl(l,a,h){return Vl(g.value,l,a,h)?(Ie(),be(),r("change",g.value),!0):!1}function sm(l,a){if(l.stopPropagation(),l.shiftKey){const h=new Set(d.value);h.has(a.id)?h.delete(a.id):h.add(a.id),d.value=h}else d.value=new Set([a.id]);it()}function cm(l,a,h){let v=null;for(const A of ot.value){if(A.id===h)continue;const $=A.width/2,j=A.height/2;l>=A.x-$&&l<=A.x+$&&a>=A.y-j&&a<=A.y+j&&(v=A)}return v}let ht=null;function dm(l,a){if(i.previewMode||a.isRoot||l.button!==0)return;const h=l.target;if(h!=null&&h.closest(".zm-img-resize-handle"))return;l.stopPropagation();const v=s.value.getBoundingClientRect(),A=a.x*J.scale.value+J.offsetX.value,$=a.y*J.scale.value+J.offsetY.value,j=l.clientX-v.left-A,te=l.clientY-v.top-$;ht={srcId:a.id,srcText:a.text,pointerOffsetX:j,pointerOffsetY:te,startX:l.clientX,startY:l.clientY},window.addEventListener("pointermove",nl),window.addEventListener("pointerup",go),window.addEventListener("pointercancel",go)}function nl(l){if(ht){const j=l.clientX-ht.startX,te=l.clientY-ht.startY;if(Math.abs(j)<=fr&&Math.abs(te)<=fr)return;y.value={srcId:ht.srcId,srcText:ht.srcText,pointerOffsetX:ht.pointerOffsetX,pointerOffsetY:ht.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),ht=null}const a=y.value;if(!a)return;const h=s.value.getBoundingClientRect();N.value=l.clientX-h.left-a.pointerOffsetX,E.value=l.clientY-h.top-a.pointerOffsetY;const v=(l.clientX-h.left-J.offsetX.value)/J.scale.value,A=(l.clientY-h.top-J.offsetY.value)/J.scale.value,$=cm(v,A,a.srcId);a.currentTargetId=($==null?void 0:$.id)??null}function go(l){if(window.removeEventListener("pointermove",nl),window.removeEventListener("pointerup",go),window.removeEventListener("pointercancel",go),ht){ht=null;return}const a=y.value;a&&(a.currentTargetId&&(tl(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),it()),y.value=null,N.value=0,E.value=0,document.body.classList.remove("is-dragging"))}let ho=!1;function um(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ho=!0,J.startPan(l);return}if(ho=!1,l.button!==0)return;const h=s.value.getBoundingClientRect(),v=(l.clientX-h.left-J.offsetX.value)/J.scale.value,A=(l.clientY-h.top-J.offsetY.value)/J.scale.value;J.startMarquee(v,A,{shift:l.shiftKey})}function fm(l){if(gn){gn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const h=J.marquee;h.width>=4||h.height>=4||d.value.size>0&&(d.value=new Set,it())}function mm(){const l=J.marquee;if(l.width<4&&l.height<4)return;const a=l.x,h=l.y,v=l.x+l.width,A=l.y+l.height,$=[];for(const j of ot.value){const te=j.width/2,Ne=j.height/2,M=j.x-te,tt=j.x+te,rt=j.y-Ne,ge=j.y+Ne;M<=v&&tt>=a&&rt<=A&&ge>=h&&$.push(j.id)}d.value=l.shiftKey?new Set([...d.value,...$]):new Set($),it()}function ol(l){return p.value.has(l)}function pm(l){const a=fe(g.value,l.id);return!!a&&a.children.length>0}function si(l){const a=fe(g.value,l);return a?a.children.length:0}function il(l){if(!fe(g.value,l))return 0;const v=[g.value];for(;v.length;){const A=v.pop(),$=A.children.findIndex(j=>j.id===l);if($>=0)return $;for(const j of A.children)v.push(j)}return 0}function rl(l,a,h,v){if(((v==null?void 0:v._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let $;a==="in"?$=-l.side:h!==void 0?$=h:$=l.side;const j=a==="in"?l._richInsetX??0:0;return{x:l.x+$*(l.width/2-j),y:l.y}}function Mt(){const l=Fe.value;J.resetView(l.width,l.height,l.root.y)}function gm(){nt.value=!0,Ie(),be(),e.nextTick(()=>Mt())}function ci(l){ee.layoutMode!==l&&(ee.layoutMode=l,be(),e.nextTick(()=>Mt()))}function ll(){return JSON.stringify(g.value,null,2)}function hm(l){const a=fe(g.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw):!1}function al(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(Qe.reset(),g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>Mt()),r("change",g.value),!0)}catch{return!1}}function bm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var v;const a=(v=l.files)==null?void 0:v[0];if(!a)return;const h=new FileReader;h.onload=()=>{typeof h.result=="string"&&(al(h.result)||alert("导入失败:JSON 格式无效"))},h.readAsText(a)},l.click()}function km(){const l=new Blob([ll()],{type:"application/json"}),a=URL.createObjectURL(l),h=document.createElement("a");h.href=a,h.download=`${g.value.text||"mindmap"}.json`,h.click(),URL.revokeObjectURL(a)}return o({addChild:l=>Be(l),addSibling:l=>Ye(l),removeNode:l=>Zr(l),duplicateNode:l=>wn(l),setNodeText:(l,a)=>am(l,a),moveNode:(l,a,h)=>tl(l,a,h),lineWidthForDepth:ro,endWidthForDepth:Dt,getData:()=>g.value,nodeHasContent:l=>hm(l),getSelectedIds:()=>[...d.value],copyNodes:l=>vn(l),cutNodes:l=>Yr(l),pasteNodes:l=>Xr(l),setData:l=>{Qe.reset(),g.value=ct(l),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>Mt())},resetView:()=>Mt(),exportData:ll,importData:al,getMarkdown:()=>Qt(g.value),setMarkdown:(l,a=!0)=>{const h=Jt(l||"");a&&(O.value=!0),W=!a,Qe.reset(),g.value=ct(h),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>{W=!1,Mt()}),r("change",g.value)},setBalanced:l=>{nt.value=l},isBalanced:()=>nt.value,balance:()=>gm(),applyNodeStyle:(l,a)=>ie(l,a),getNodeStyle:l=>F(l),applyNodeImage:(l,a)=>q(l,a),applyNodeImageByUrl:(l,a)=>w(l,a),removeNodeImage:l=>U(l),applyNodeLink:(l,a)=>ae(l,a),removeNodeLink:l=>ke(l),applyNodeNote:(l,a)=>Re(l,a),removeNodeNote:l=>Pe(l),applyNodeRichContent:(l,a)=>Te(l,a),undo:()=>li(),redo:()=>ai(),canUndo:()=>Qe.canUndo(),canRedo:()=>Qe.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(ee.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(ee.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(ee.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(ee.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(ee.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(ee.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(ee.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(ee.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(ee.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:ee.autoBalanceOnChange,lineWidthStart:ee.lineWidthStart,lineWidthEnd:ee.lineWidthEnd,rainbowBranch:ee.rainbowBranch,branchPaletteId:ee.branchPaletteId,customPalettes:ee.customPalettes,lineStyle:ee.lineStyle,layoutMode:ee.layoutMode,taperedEdge:ee.taperedEdge,showOrderBadge:ee.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[..._t,...ee.customPalettes].find(h=>h.id===l)&&(ee.branchPaletteId=l)},getBranchPalette:()=>ee.branchPaletteId,getBranchPalettes:()=>[..._t,...ee.customPalettes]}),e.watch(()=>i.data,l=>{g.value=ct(l),be()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>Mt())}),(l,a)=>{var h,v,A,$,j,te,Ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:et.value.bgColor,fontSize:et.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:um,onContextmenu:se,onWheel:a[26]||(a[26]=(...M)=>e.unref(J).onWheel&&e.unref(J).onWheel(...M)),onMouseenter:a[27]||(a[27]=M=>k.value=!0),onMouseleave:a[28]||(a[28]=M=>k.value=!1),onClick:fm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:Fe.value.vbX*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:Fe.value.vbY*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:Fe.value.vbW*e.unref(J).scale.value+"px",height:Fe.value.vbH*e.unref(J).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mo.value,preserveAspectRatio:"xMinYMin meet",width:Fe.value.vbW*e.unref(J).scale.value,height:Fe.value.vbH*e.unref(J).scale.value},[e.createElementVNode("g",ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fo.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:Vt(rl(M.from,"out",M.to.side,M.to),rl(M.to,"in"),ro(M.from.depth),Dt(M.to.depth),32,ee.lineStyle,M.to._dir),fill:so(M.from,M.to),stroke:"none"},null,8,cs))),128))])],8,as))],4),e.unref(J).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(J).marquee.x*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:e.unref(J).marquee.y*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:e.unref(J).marquee.width*e.unref(J).scale.value+"px",height:e.unref(J).marquee.height*e.unref(J).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:N.value+"px",top:E.value+"px",transform:`scale(${e.unref(J).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(y.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(J).offsetX.value}px, ${e.unref(J).offsetY.value}px) scale(${e.unref(J).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,M=>{var tt,rt;return e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":f.value===M.id,"is-selected-secondary":f.value!==M.id&&d.value.has(M.id),"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":ze.value===M.id,"is-dragging-source":((tt=y.value)==null?void 0:tt.srcId)===M.id,"is-drop-target":((rt=y.value)==null?void 0:rt.currentTargetId)===M.id}]),"data-node-id":M.id,style:e.normalizeStyle({left:M.x+"px",top:M.y+"px",width:M.width+"px",minWidth:M.width+"px",height:M.height+"px",fontSize:M.fontSize+"px",background:ri(M),color:lt(M),borderColor:At(M),fontWeight:co(M),transform:"translate(-50%, -50%)"}),onClick:ge=>sm(ge,M),onPointerdown:ge=>dm(ge,M),onDblclick:ge=>{ge.stopPropagation(),t.previewMode||$t(M.id)},onContextmenu:ge=>D(ge,M),onMouseenter:ge=>{In(M.id),hn(ge,M)},onMouseleave:ge=>io(M.id)},[M.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:M.image.src,width:M.image.width,height:M.image.height,alt:M.text,draggable:"false"},null,8,us)):e.createCommentVNode("",!0),M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table")&&c.value!==M.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":M.richContent.kind==="table"||M.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ge=>Pt(M.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[x.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ge=>R.value=ge),class:"zm-rich-edit",spellcheck:"false",onBlur:X,onKeydown:I},null,544)),[[e.vModelText,R.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ms,[e.createElementVNode("code",{innerHTML:e.unref(Io)(e.unref(zo)(M.richContent.raw),e.unref(on)(M.richContent.raw))},null,8,ps)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",gs,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(M.id,e.unref(dr)(M.richContent.raw)),(ge,bt)=>(e.openBlock(),e.createElementBlock("tr",{key:bt},[bt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Nn,kt)=>{var Ln,Dn,Ct,bo,Ft;return e.openBlock(),e.createElementBlock("th",{key:`h${kt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Ln=S.value.get(M.id))==null?void 0:Ln.col)===kt,"is-asc":((Dn=S.value.get(M.id))==null?void 0:Dn.col)===kt&&((Ct=S.value.get(M.id))==null?void 0:Ct.dir)==="asc","is-desc":((bo=S.value.get(M.id))==null?void 0:bo.col)===kt&&((Ft=S.value.get(M.id))==null?void 0:Ft.dir)==="desc"}]),onClick:e.withModifiers(ko=>G(M.id,kt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(Nn),1),e.createElementVNode("span",bs,e.toDisplayString(ue(M.id,kt)),1)],10,hs)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Nn,kt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${kt}`},e.toDisplayString(Nn),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,fs)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",ks,[e.createElementVNode("span",ys,e.toDisplayString(M.text),1),M.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:M.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${M.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,Es)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Z(M.note.text),onClick:e.withModifiers(ge=>H(M.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,xs)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ge=>u.value=ge),autofocus:"",onBlur:a[7]||(a[7]=ge=>En()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ge=>En(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ge=>En(),["prevent"]),["tab"])),e.withKeys(xn,["esc"]),Ce],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),ne.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${il(M.id)+1} 个`},e.toDisplayString(il(M.id)+1),9,ws)):e.createCommentVNode("",!0),ol(M.id)&&si(M.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({background:Tt.value.get(M.id)??"#64748b"}),title:`展开 ${si(M.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Jr(M.id),["stop"])},e.toDisplayString(si(M.id)),47,Ns)):e.createCommentVNode("",!0),pm(M)&&!ol(M.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({color:Tt.value.get(M.id)??"#64748b",borderColor:Tt.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Jr(M.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,Ss)):e.createCommentVNode("",!0),M.image&&f.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ge=>Ue(ge,M),["stop"])},null,40,Ts)):e.createCommentVNode("",!0),M.image&&f.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>U(M.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,Cs)):e.createCommentVNode("",!0)],46,ds)}),128))],4),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!C.value.above}]),style:e.normalizeStyle({left:C.value.x+"px",top:C.value.y+"px"})},e.toDisplayString(C.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ql,{key:3,x:B.value.x,y:B.value.y,container:s.value,"has-image":!!((h=e.unref(fe)(g.value,B.value.nodeId))!=null&&h.image),"has-link":!!((v=e.unref(fe)(g.value,B.value.nodeId))!=null&&v.link),"has-note":!!((A=e.unref(fe)(g.value,B.value.nodeId))!=null&&A.note),"has-code":((j=($=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="code","has-table":((Ne=(te=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:te.richContent)==null?void 0:Ne.kind)==="table",onPickImage:mn,onRemoveImage:we,onSetLink:Ot,onRemoveLink:Q,onEditNote:Nt,onRemoveNote:Me,onAddCode:pt,onEditCode:pt,onRemoveCode:qe,onAddTable:gt,onEditTable:gt,onRemoveTable:St,onClose:T},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(Yl,{key:4,x:z.value.x,y:z.value.y,container:s.value,onOpenSettings:De,onOpenData:Ke,onOpenImport:We,onClose:ce},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(oe.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=M=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,_s),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:"显示大纲视图",onClick:a[16]||(a[16]=M=>r("canvas-outline"))},[e.createVNode(xe,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":k.value}])},[e.createElementVNode("span",As,e.toDisplayString(Math.round(e.unref(J).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...M)=>e.unref(J).zoomIn&&e.unref(J).zoomIn(...M))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...M)=>e.unref(J).zoomOut&&e.unref(J).zoomOut(...M))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Mt},[e.createVNode(xe,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:rm},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=M=>el(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=M=>el(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:lm},[e.createVNode(xe,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:km},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=M=>f.value&&Be(f.value))},[e.createElementVNode("img",{src:e.unref(mi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ms)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=M=>f.value&&Ye(f.value))},[e.createElementVNode("img",{src:e.unref(fi),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rs)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=M=>ci("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=M=>ci("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=M=>ci("org"))},[e.createVNode(xe,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:bm},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),Bs={class:"zm-outline-root"},zs={class:"zm-outline-actions"},Is={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Os={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},vs={key:1,d:"M5 12 L10 17 L19 7"},Ls={class:"zm-outline"},Ds=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={class:"zm-outline-index"},Ws={key:3,class:"zm-outline-text"},Gs=["onClick"],js=["src"],Ks=["onClick"],qs=["src"],Ys=["title","onClick"],Xs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Js={key:1,d:"M5 12 L10 17 L19 7"},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,r=e.computed(()=>{const F=[],q=(U,w,P)=>{const V=U.children.length>0,Y=n.collapsedIds.has(U.id);F.push({id:U.id,text:U.text||"(无标题)",depth:w,siblingIndex:P,hasChildren:V,collapsed:Y,node:U}),V&&!Y&&U.children.forEach((ae,ke)=>q(ae,w+1,ke))};return q(n.data,0,0),F}),s=e.ref(null),c=e.ref("");let u=null;function d(F){n.readonly||(s.value=F.id,c.value=F.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function f(){s.value!=null&&(i("edit",{id:s.value,text:c.value.trim()||"(无标题)"}),p())}function p(){s.value=null,c.value="",u=null}function k(F){F.key==="Enter"?(F.preventDefault(),f()):F.key==="Escape"&&(F.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),N=e.ref(null),E=e.ref(null);function L(F,q){if(n.readonly){F.preventDefault();return}y.value={id:q.id,text:q.text},F.dataTransfer&&(F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",q.id))}function C(){y.value=null,N.value=null,E.value=null}function x(F,q){if(!y.value)return;F.preventDefault(),F.dataTransfer&&(F.dataTransfer.dropEffect="move");const U=g(F);N.value=q.id,E.value=U}function R(F){N.value===F.id&&(N.value=null,E.value=null)}function S(F,q){F.preventDefault();const U=y.value;if(!U)return;const w=g(F);U.id!==q.id&&i("move",{srcId:U.id,targetId:q.id,position:w}),C()}function g(F,q){const w=F.currentTarget.getBoundingClientRect(),P=F.clientY-w.top,V=w.height;return P<V*.3?"before":P>V*.7?"after":"child"}const _=e.ref(null);let b=null;async function O(F){try{return await navigator.clipboard.writeText(F),!0}catch{const q=document.createElement("textarea");q.value=F,document.body.appendChild(q),q.select();let U=!1;try{U=document.execCommand("copy")}finally{document.body.removeChild(q)}return U}}async function W(F,q,U){F.stopPropagation(),await O(q)&&(_.value=U,b&&clearTimeout(b),b=setTimeout(()=>_.value=null,1200))}const ne=e.computed(()=>{const F=[],q=(U,w)=>{const P=" ".repeat(w),V=w===0?"":"- ";F.push(P+V+(U.text||""));for(const Y of U.children)q(Y,w+1)};return q(n.data,0),F.join(`
23
+ `)}),pe=e.ref(!1);let K=null;async function ie(){await O(ne.value)&&(pe.value=!0,K&&clearTimeout(K),K=setTimeout(()=>pe.value=!1,1200))}return(F,q)=>(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("div",zs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":pe.value}]),title:"复制完整大纲为纯文本",onClick:ie},[(e.openBlock(),e.createElementBlock("svg",Is,[pe.value?(e.openBlock(),e.createElementBlock("path",vs)):(e.openBlock(),e.createElementBlock("rect",Os)),q[2]||(q[2]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(pe.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":U.id===t.selectedId,"is-root":U.depth===0,"is-editing":s.value===U.id,"is-drag-over-before":N.value===U.id&&E.value==="before","is-drag-over-after":N.value===U.id&&E.value==="after","is-drag-over-child":N.value===U.id&&E.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+U.depth*16+"px"}),draggable:"true",onClick:w=>i("select",U.node),onDblclick:w=>d(U),onDragstart:w=>L(w,U),onDragend:C,onDragover:w=>x(w,U),onDragleave:()=>R(U),onDrop:w=>S(w,U)},[U.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:U.collapsed?"展开":"折叠",onClick:e.withModifiers(w=>i("toggleCollapse",U.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[U.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),e.createElementVNode("span",Hs,e.toDisplayString(U.siblingIndex+1)+".",1),s.value===U.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":q[0]||(q[0]=w=>c.value=w),class:"zm-outline-input",onBlur:f,onKeydown:k,onClick:q[1]||(q[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(U.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(w=>i("addSibling",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(fi),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,js)],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(w=>i("addChild",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(mi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,qs)],8,Ks)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":_.value===U.id}]),title:_.value===U.id?"已复制":"复制节点文本",onClick:w=>W(w,U.text,U.id)},[(e.openBlock(),e.createElementBlock("svg",Xs,[_.value!==U.id?(e.openBlock(),e.createElementBlock("rect",Zs)):(e.openBlock(),e.createElementBlock("path",Js)),q[3]||(q[3]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Ys)],46,Ds))),128))])]))}}),Qs=["aria-hidden"],ec=["aria-hidden"],tc={key:0,class:"zm-drawer-header"},nc={key:0,class:"zm-drawer-title"},oc={class:"zm-drawer-body"},ic=["aria-hidden"],rc={key:0,class:"zm-drawer-header"},lc={key:0,class:"zm-drawer-title"},ac={class:"zm-drawer-body"},ln=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 r(){n("update:open",!1)}return(s,c)=>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:c[0]||(c[0]=u=>t.closeOnBackdrop&&r())},null,8,Qs)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",tc,[t.title?(e.openBlock(),e.createElementBlock("h3",nc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[1]||(c[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",oc,[e.renderSlot(s.$slots,"default")])],14,ec)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",rc,[t.title?(e.openBlock(),e.createElementBlock("h3",lc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[2]||(c[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",ac,[e.renderSlot(s.$slots,"default")])],14,ic)):e.createCommentVNode("",!0)]),_:3}))}}),sc={key:0,class:"zm-jtv-root"},cc={key:0,class:"zm-jtv-key"},dc={key:1,class:"zm-jtv-colon"},uc={key:2,class:"zm-jtv-key zm-jtv-bracket"},fc={key:3,class:"zm-jtv-size"},mc={key:4,class:"zm-jtv-bracket"},pc={key:5,class:"zm-jtv-brace"},gc={key:0,class:"zm-jtv-children"},hc={class:"zm-jtv-key"},bc={key:0,class:"zm-jtv-key"},kc=["src","alt"],yc=["href"],Ec=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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const s=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const R=o.value,S=Object.keys(R);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((R,S)=>({key:String(S),value:R})):i.value?Object.entries(o.value).map(([R,S])=>({key:R,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function f(R,S,g){R!=="<root>"&&(g<2||S===null||typeof S!="object"||o.collapsedPaths.has(R)||o.collapsedPaths.add(R))}o.isRoot||f(u.value,o.value,o.depth);function p(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function k(R){return u.value===""?R:`${u.value}.${R}`}function y(R){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof R=="string"?R.toLowerCase().includes(S):R===null?"null".includes(S):String(R).toLowerCase().includes(S)}function N(R){return o.query?R.toLowerCase().includes(o.query.toLowerCase()):!0}function E(R,S){return!o.query||N(R)?!0:S===null||typeof S!="object"?y(S):!0}function L(R){return R===null?"null":typeof R=="string"?R.length>80?`"${R.slice(0,80)}..."`:`"${R}"`:typeof R=="boolean"?R?"true":"false":typeof R=="number"?String(R):typeof R>"u"?"undefined":JSON.stringify(R)}function C(R){if(typeof R!="string")return!1;const S=R.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(R){if(!o.query)return null;const S=R.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:R.slice(0,S),match:R.slice(S,S+o.query.length),after:R.slice(S+o.query.length)}}return(R,S)=>{var _,b,O,W,ne,pe;const g=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,K=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:K.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":K.key,value:K.value,path:k(K.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,E(K.key,K.value)]])),128))])):i.value||r.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:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",cc,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",dc,":")),r.value?(e.openBlock(),e.createElementBlock("span",uc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",fc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",mc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",pc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,K=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:K.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":K.key,value:K.value,path:k(K.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,E(K.key,K.value)]])),128))])),!d.value&&r.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&&!r.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"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",hc,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),N(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",bc,[e.createElementVNode("span",null,e.toDisplayString((_=x(t.keyName))==null?void 0:_.before),1),e.createElementVNode("mark",null,e.toDisplayString((b=x(t.keyName))==null?void 0:b.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(L(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(L(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=x(L(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=x(L(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(L(t.value)),1)],64))],2),C(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[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,kc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,yc)])):e.createCommentVNode("",!0)],4))}}}),xc={class:"zm-data-panel"},wc={class:"zm-data-header"},Nc={class:"zm-data-title"},Sc={class:"zm-data-title-meta"},Tc={class:"zm-data-toolbar"},Cc=["title"],_c={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ac={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"},Mc={key:0,class:"zm-data-paste"},Rc={class:"zm-data-tabs"},Bc=["placeholder"],zc={key:0,class:"zm-data-error"},Ic={class:"zm-data-paste-actions"},Oc=["disabled"],vc={class:"zm-data-tree"},vo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),f=e.ref("idle"),p=e.ref(new Set),k=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,d.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),f.value="copied",setTimeout(()=>f.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),f.value="copied",setTimeout(()=>f.value="idle",1500)}finally{document.body.removeChild(S)}}}function N(){const S=new Blob([r.value],{type:"application/json"}),g=URL.createObjectURL(S),_=document.createElement("a");_.href=g,_.download=`${n.data.text||"mindmap"}.json`,_.click(),URL.revokeObjectURL(g)}function E(){c.value=null;const S=s.value.trim();if(S){if(d.value==="markdown"||d.value==="txt"){try{const g=Jt(S);i("import",g),s.value="",u.value=!1}catch(g){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+g.message}return}try{const g=JSON.parse(S);if(!g.id||!Array.isArray(g.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",g),s.value="",u.value=!1}catch(g){c.value="JSON 解析失败:"+g.message}}}function L(S){return 1+S.children.reduce((g,_)=>g+L(_),0)}const C=e.computed(()=>L(n.data)),x=e.computed(()=>r.value.length);function R(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var b;const g=(b=S.files)==null?void 0:b[0];if(!g)return;const _=new FileReader;_.onload=()=>{typeof _.result=="string"&&(s.value=_.result,E())},_.readAsText(g)},S.click()}return(S,g)=>(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",wc,[e.createElementVNode("div",Nc,[g[8]||(g[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Sc,e.toDisplayString(C.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":f.value==="copied"}]),title:f.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[f.value==="idle"?(e.openBlock(),e.createElementBlock("svg",_c,[...g[9]||(g[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",Ac,[...g[10]||(g[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),g[11]||(g[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Cc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:N},[...g[12]||(g[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:R},[...g[13]||(g[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:g[0]||(g[0]=_=>u.value=!u.value)},[...g[14]||(g[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),g[16]||(g[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":k.value.length>0}])},[g[15]||(g[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":g[1]||(g[1]=_=>k.value=_),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,k.value]]),k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:g[2]||(g[2]=_=>k.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",Rc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:g[3]||(g[3]=_=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:g[4]||(g[4]=_=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[5]||(g[5]=_=>s.value=_),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Bc),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",zc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ic,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:E},"应用",8,Oc),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[6]||(g[6]=_=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[7]||(g[7]=_=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",vc,[e.createVNode(Ec,{value:t.data,query:k.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),g[17]||(g[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))]))}}),Lc={class:"zm-md-panel"},Dc={key:0,class:"zm-md-error"},Vc={class:"zm-md-split"},$c={class:"zm-md-edit"},Pc={class:"zm-md-preview"},Fc={class:"zm-md-preview-body"},Uc={class:"zm-md-footer"},Hc=["disabled"],Wc=`# flow-mindmap 思维导图
24
24
 
25
25
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
26
26
 
@@ -59,40 +59,40 @@ https://github.com/highlightjs/highlight.js/issues/2277`),se=N,Y=P),D===void 0&&
59
59
 
60
60
  ## 开源协议
61
61
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
62
- `,Oo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Jt(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const C=Zt(r.value||"");return s.value=null,C}catch(C){return s.value=C.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),d=e.computed(()=>ct(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var C;return(C=c.value)==null?void 0:C.resetView()},250)});function p(){try{const C=Zt(r.value||"");s.value=null,i("import",C)}catch(C){s.value=C.message}}function k(){r.value=Jt(n.data),s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function y(){r.value="",s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function w(){const C=document.createElement("input");C.type="file",C.accept=".md,text/markdown,text/plain",C.onchange=()=>{var S;const x=(S=C.files)==null?void 0:S[0];if(!x)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(r.value=R.result,s.value=null,e.nextTick(()=>{var g;return(g=c.value)==null?void 0:g.resetView()}))},R.readAsText(x)},C.click()}function E(){const C=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(C),R=document.createElement("a");R.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";R.download=`${S}.md`,R.click(),URL.revokeObjectURL(x)}function L(){r.value=Fc,s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}return(C,x)=>(e.openBlock(),e.createElementBlock("div",Ic,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:w},[...x[1]||(x[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:E},[...x[2]||(x[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)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:L},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:k},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",vc,[e.createElementVNode("div",Lc,[x[4]||(x[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":x[0]||(x[0]=R=>r.value=R),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Dc,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Vc,[e.createVNode(Yn,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",$c,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,Pc)])]))}}),Uc={class:"zm-settings-panel"},Hc={key:0,class:"zm-settings-section"},Wc={class:"zm-settings-row"},Gc=["value"],jc={class:"zm-slider"},Kc=["value"],qc={class:"zm-settings-row"},Yc=["value"],Xc={class:"zm-slider"},Zc=["value"],Jc={class:"zm-settings-row"},Qc={class:"zm-line-style-group"},ed=["title","onClick"],td=["viewBox"],nd={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},od={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={class:"zm-line-style-label"},rd={class:"zm-settings-row"},ld={key:0,class:"zm-palette-picker"},ad={class:"zm-palette-grid"},sd=["title","onClick"],cd={class:"zm-palette-card-name"},dd={class:"zm-palette-card-swatches"},ud={key:0,class:"zm-palette-customs"},md=["title","onClick"],fd={class:"zm-palette-card-name"},pd={class:"zm-palette-card-swatches"},gd=["value","onInput"],hd={class:"zm-palette-custom-actions"},bd=["onClick"],kd=["onClick"],yd={class:"zm-settings-row"},Ed={class:"zm-settings-row"},xd={class:"zm-settings-preview"},wd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Nd=["x1","y1","x2","y2","stroke","stroke-width"],Sd={key:1,class:"zm-settings-section"},Td={class:"zm-settings-row"},Cd={class:"zm-settings-value-tag"},_d={class:"zm-settings-row"},Ad={class:"zm-settings-value-tag"},Md={class:"zm-settings-row"},Rd={class:"zm-settings-value-tag"},Bd={class:"zm-settings-row"},zd={key:2,class:"zm-settings-section"},Id={class:"zm-settings-section-title"},Od={key:0,class:"zm-settings-section-sub"},vd={class:"zm-settings-row"},Ld={class:"zm-settings-value-tag"},Dd={class:"zm-swatch-row"},Vd=["title","onClick"],$d={class:"zm-settings-row"},Pd={class:"zm-settings-value-tag"},Fd={class:"zm-swatch-row"},Ud=["title","onClick"],Hd={class:"zm-settings-row"},Wd={class:"zm-settings-section"},vo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(_,b){i("update:settings",{[_]:b})}e.computed(()=>{const _=n.settings.lineWidthStart;return _<1.2?"细":_<2.5?"中":_<4?"粗":"极粗"}),e.computed(()=>{const _=n.settings.lineWidthEnd;return _<.6?"极细":_<1.2?"细":_<2?"中":"粗"});const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...c})}function d(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const m=e.reactive({});function p(_){return m[_.id]===void 0&&(m[_.id]=_.colors.join(`
63
- `)),m[_.id]}function k(_){const b=m[_.id]??"",v=Rl(b);if(v.length===0){m[_.id]=_.colors.join(`
64
- `);return}const H=n.settings.customPalettes.map(oe=>oe.id===_.id?{...oe,colors:v}:oe);i("update:settings",{customPalettes:H})}function y(){const _=E.value.find(q=>q.id===n.settings.branchPaletteId),b=_?[..._.colors]:[...Ct[0].colors],v="custom-";let H=v+(n.settings.customPalettes.length+1);for(;Ct.some(q=>q.id===H)||n.settings.customPalettes.some(q=>q.id===H);)H=v+Math.random().toString(36).slice(2,7);const oe={id:H,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:b};i("update:settings",{customPalettes:[...n.settings.customPalettes,oe],branchPaletteId:H}),m[H]=b.join(`
65
- `)}function w(_){const b=n.settings.customPalettes.filter(H=>H.id!==_.id),v=n.settings.branchPaletteId===_.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:b,...v!==n.settings.branchPaletteId?{branchPaletteId:v}:{}}),delete m[_.id]}const E=e.computed(()=>[...Ct,...n.settings.customPalettes]),L=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],C=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function R(_,b,v,H){if(b<=1)return v;const oe=_/(b-1);return v+(H-v)*oe}function S(_,b,v){return _<=0?b:_===1?Math.max(1.5,b*.67):_===2?Math.max(.8,b*.42):v}const g=e.computed(()=>{const _=n.settings.lineWidthStart,b=n.settings.lineWidthEnd,v=n.settings.taperedEdge,H=C.length,oe=8,q=192,J=E.value.find(W=>W.id===n.settings.branchPaletteId),ae=J&&J.colors.length?J.colors:x;return C.map((W,K)=>{const F=10+K*60/(H-1);return{x1:oe,y1:F,x2:q,y2:F,w:v?S(W,_,b):R(W,H,_,b),color:n.settings.rainbowBranch?ae[K%ae.length]:"#94a3b8"}})});return(_,b)=>(e.openBlock(),e.createElementBlock("div",Uc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",Sd,[b[32]||(b[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Td,[b[27]||(b[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",Cd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",_d,[b[28]||(b[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Ad,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",Md,[b[29]||(b[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",Rd,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",Bd,[b[31]||(b[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[7]||(b[7]=v=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[30]||(b[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[33]||(b[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",Hc,[b[23]||(b[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Wc,[b[12]||(b[12]=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:b[0]||(b[0]=v=>r("lineWidthStart",parseFloat(v.target.value)||0))},null,40,Gc)]),e.createElementVNode("div",jc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:b[1]||(b[1]=v=>r("lineWidthStart",parseFloat(v.target.value)))},null,40,Kc)]),e.createElementVNode("div",qc,[b[13]||(b[13]=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:b[2]||(b[2]=v=>r("lineWidthEnd",parseFloat(v.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",Xc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:b[3]||(b[3]=v=>r("lineWidthEnd",parseFloat(v.target.value)))},null,40,Zc)]),e.createElementVNode("div",Jc,[b[14]||(b[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Qc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,v=>e.createElementVNode("button",{key:v.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===v.value}]),title:v.label,onClick:H=>r("lineStyle",v.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:v.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[v.value==="curve"?(e.openBlock(),e.createElementBlock("path",nd)):(e.openBlock(),e.createElementBlock("line",od))],8,td)),e.createElementVNode("span",id,e.toDisplayString(v.label),1)],10,ed)),64))])]),e.createElementVNode("label",rd,[b[16]||(b[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[4]||(b[4]=v=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[15]||(b[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[24]||(b[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",ld,[b[17]||(b[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ct),v=>(e.openBlock(),e.createElementBlock("button",{key:v.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===v.id}]),title:v.name,onClick:H=>r("branchPaletteId",v.id)},[e.createElementVNode("span",cd,e.toDisplayString(v.name),1),e.createElementVNode("span",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.colors,(H,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:H})},null,4))),128))])],10,sd))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===v.id}]),title:v.name,onClick:H=>r("branchPaletteId",v.id)},[e.createElementVNode("span",fd,e.toDisplayString(v.name),1),e.createElementVNode("span",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.colors,(H,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:H})},null,4))),128))])],10,md),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(v),onInput:H=>m[v.id]=H.target.value},null,40,gd),e.createElementVNode("div",hd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:H=>k(v)},"保存",8,bd),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:H=>w(v)},"删除",8,kd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",yd,[b[19]||(b[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:b[5]||(b[5]=v=>r("taperedEdge",!t.settings.taperedEdge))},[...b[18]||(b[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[25]||(b[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",Ed,[b[21]||(b[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:b[6]||(b[6]=v=>r("showOrderBadge",!t.settings.showOrderBadge))},[...b[20]||(b[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[26]||(b[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",xd,[(e.openBlock(),e.createElementBlock("svg",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(v,H)=>(e.openBlock(),e.createElementBlock("line",{key:H,x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,stroke:t.settings.rainbowBranch?v.color:"#94a3b8","stroke-width":v.w,"stroke-linecap":"butt"},null,8,Nd))),128))])),b[22]||(b[22]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])])),t.hasSelection?(e.openBlock(),e.createElementBlock("section",zd,[e.createElementVNode("h4",Id,[b[34]||(b[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Od,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vd,[b[35]||(b[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Ld,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",Dd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,v=>e.createElementVNode("button",{key:"bg-"+v,class:"zm-swatch",style:e.normalizeStyle({background:v}),title:v,onClick:H=>c.bg=v},null,12,Vd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[8]||(b[8]=v=>c.bg=void 0)},"∅")]),e.createElementVNode("div",$d,[b[36]||(b[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Pd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Fd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,v=>e.createElementVNode("button",{key:"fg-"+v,class:"zm-swatch",style:e.normalizeStyle({background:v}),title:v,onClick:H=>c.textColor=v},null,12,Ud)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[9]||(b[9]=v=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",Hd,[b[38]||(b[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:b[10]||(b[10]=v=>c.fontWeight=c.fontWeight===600?400:600)},[...b[37]||(b[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:d},"清除该节点样式")]),b[39]||(b[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Wd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:b[11]||(b[11]=v=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),dr=20;function Gd(t,o){t.style.height="auto";const n=o.minRows*dr,i=o.maxRows>0?o.maxRows*dr:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Lo(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const s=t.value;s&&Gd(s,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",r),i())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>i()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",r)})}function Do(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wt=Do();function ur(t){Wt=t}var Gt={exec:()=>null};function ln(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function he(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(Ge.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var jd=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ge={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:ln(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ln(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ln(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:ln(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:ln(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ln(t=>new RegExp(`^ {0,${t}}>`))},Kd=/^(?:[ \t]*(?:\n|$))+/,qd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,mr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fr=he(mr).replace(/bull/g,Vo).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(),Zd=he(mr).replace(/bull/g,Vo).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(),$o=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jd=/^[^\n]+/,Po=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qd=he(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Po).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eu=he(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Vo).getRegex(),Xn="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",Fo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tu=he("^ {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",Fo).replace("tag",Xn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pr=he($o).replace("hr",Cn).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",Xn).getRegex(),nu=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pr).getRegex(),Uo={blockquote:nu,code:qd,def:Qd,fences:Yd,heading:Xd,hr:Cn,html:tu,lheading:fr,list:eu,newline:Kd,paragraph:pr,table:Gt,text:Jd},gr=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cn).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",Xn).getRegex(),ou={...Uo,lheading:Zd,table:gr,paragraph:he($o).replace("hr",Cn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gr).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",Xn).getRegex()},iu={...Uo,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fo).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:Gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he($o).replace("hr",Cn).replace("heading",` *#{1,6} *[^
66
- ]`).replace("lheading",fr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ru=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hr=/^( {2,}|\\)\n(?!\s*$)/,au=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,an=/[\p{P}\p{S}]/u,Zn=/[\s\p{P}\p{S}]/u,Ho=/[^\s\p{P}\p{S}]/u,su=he(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zn).getRegex(),br=/(?!~)[\p{P}\p{S}]/u,cu=/(?!~)[\s\p{P}\p{S}]/u,du=/(?:[^\s\p{P}\p{S}]|~)/u,uu=he(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",jd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mu=he(kr,"u").replace(/punct/g,an).getRegex(),fu=he(kr,"u").replace(/punct/g,br).getRegex(),yr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pu=he(yr,"gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),gu=he(yr,"gu").replace(/notPunctSpace/g,du).replace(/punctSpace/g,cu).replace(/punct/g,br).getRegex(),hu=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),bu=he(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,an).getRegex(),ku="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",yu=he(ku,"gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),Eu=he(/\\(punct)/,"gu").replace(/punct/g,an).getRegex(),xu=he(/^<(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(),wu=he(Fo).replace("(?:-->|$)","-->").getRegex(),Nu=he("^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",wu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Su=he(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Er=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Jn).replace("ref",Po).getRegex(),xr=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",Po).getRegex(),Tu=he("reflink|nolink(?!\\()","g").replace("reflink",Er).replace("nolink",xr).getRegex(),wr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wo={_backpedal:Gt,anyPunctuation:Eu,autolink:xu,blockSkip:uu,br:hr,code:lu,del:Gt,delLDelim:Gt,delRDelim:Gt,emStrongLDelim:mu,emStrongRDelimAst:pu,emStrongRDelimUnd:hu,escape:ru,link:Su,nolink:xr,punctuation:su,reflink:Er,reflinkSearch:Tu,tag:Nu,text:au,url:Gt},Cu={...Wo,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Jn).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jn).getRegex()},Go={...Wo,emStrongRDelimAst:gu,emStrongLDelim:fu,delLDelim:bu,delRDelim:yu,url:he(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wr).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:he(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wr).getRegex()},_u={...Go,br:he(hr).replace("{2,}","*").getRegex(),text:he(Go.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qn={normal:Uo,gfm:ou,pedantic:iu},_n={normal:Wo,gfm:Go,breaks:_u,pedantic:Cu},Au={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nr=t=>Au[t];function yt(t,o){if(o){if(Ge.escapeTest.test(t))return t.replace(Ge.escapeReplace,Nr)}else if(Ge.escapeTestNoEncode.test(t))return t.replace(Ge.escapeReplaceNoEncode,Nr);return t}function Sr(t){try{t=encodeURI(t).replace(Ge.percentDecode,"%")}catch{return null}return t}function Tr(t,o){var s;let n=t.replace(Ge.findPipe,(c,u,d)=>{let m=!1,p=u;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(Ge.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(Ge.slashPipe,"|");return i}function zt(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function Cr(t){let o=t.split(`
62
+ `,Lo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Qt(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const C=Jt(r.value||"");return s.value=null,C}catch(C){return s.value=C.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),d=e.computed(()=>ct(u.value));let f=null;e.watch(r,()=>{f&&clearTimeout(f),f=setTimeout(()=>{var C;return(C=c.value)==null?void 0:C.resetView()},250)});function p(){try{const C=Jt(r.value||"");s.value=null,i("import",C)}catch(C){s.value=C.message}}function k(){r.value=Qt(n.data),s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function y(){r.value="",s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function N(){const C=document.createElement("input");C.type="file",C.accept=".md,text/markdown,text/plain",C.onchange=()=>{var S;const x=(S=C.files)==null?void 0:S[0];if(!x)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(r.value=R.result,s.value=null,e.nextTick(()=>{var g;return(g=c.value)==null?void 0:g.resetView()}))},R.readAsText(x)},C.click()}function E(){const C=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(C),R=document.createElement("a");R.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";R.download=`${S}.md`,R.click(),URL.revokeObjectURL(x)}function L(){r.value=Wc,s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}return(C,x)=>(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:N},[...x[1]||(x[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:E},[...x[2]||(x[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)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:L},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:k},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Dc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Vc,[e.createElementVNode("div",$c,[x[4]||(x[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":x[0]||(x[0]=R=>r.value=R),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Pc,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Fc,[e.createVNode(Xn,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Uc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,Hc)])]))}}),Gc={class:"zm-settings-panel"},jc={key:0,class:"zm-settings-section"},Kc={class:"zm-settings-row"},qc=["value"],Yc={class:"zm-slider"},Xc=["value"],Zc={class:"zm-settings-row"},Jc=["value"],Qc={class:"zm-slider"},ed=["value"],td={class:"zm-settings-row"},nd={class:"zm-line-style-group"},od=["title","onClick"],id=["viewBox"],rd={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ld={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ad={class:"zm-line-style-label"},sd={class:"zm-settings-row"},cd={key:0,class:"zm-palette-picker"},dd={class:"zm-palette-grid"},ud=["title","onClick"],fd={class:"zm-palette-card-name"},md={class:"zm-palette-card-swatches"},pd={key:0,class:"zm-palette-customs"},gd=["title","onClick"],hd={class:"zm-palette-card-name"},bd={class:"zm-palette-card-swatches"},kd=["value","onInput"],yd={class:"zm-palette-custom-actions"},Ed=["onClick"],xd=["onClick"],wd={class:"zm-settings-row"},Nd={class:"zm-settings-row"},Sd={class:"zm-settings-preview"},Td={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Cd=["x1","y1","x2","y2","stroke","stroke-width"],_d={key:1,class:"zm-settings-section"},Ad={class:"zm-settings-row"},Md={class:"zm-settings-value-tag"},Rd={class:"zm-settings-row"},Bd={class:"zm-settings-value-tag"},zd={class:"zm-settings-row"},Id={class:"zm-settings-value-tag"},Od={class:"zm-settings-row"},vd={key:2,class:"zm-settings-section"},Ld={class:"zm-settings-section-title"},Dd={key:0,class:"zm-settings-section-sub"},Vd={class:"zm-settings-row"},$d={class:"zm-settings-value-tag"},Pd={class:"zm-swatch-row"},Fd=["title","onClick"],Ud={class:"zm-settings-row"},Hd={class:"zm-settings-value-tag"},Wd={class:"zm-swatch-row"},Gd=["title","onClick"],jd={class:"zm-settings-row"},Kd={class:"zm-settings-section"},Do=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(_,b){i("update:settings",{[_]:b})}e.computed(()=>{const _=n.settings.lineWidthStart;return _<1.2?"细":_<2.5?"中":_<4?"粗":"极粗"}),e.computed(()=>{const _=n.settings.lineWidthEnd;return _<.6?"极细":_<1.2?"细":_<2?"中":"粗"});const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...c})}function d(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const f=e.reactive({});function p(_){return f[_.id]===void 0&&(f[_.id]=_.colors.join(`
63
+ `)),f[_.id]}function k(_){const b=f[_.id]??"",O=Il(b);if(O.length===0){f[_.id]=_.colors.join(`
64
+ `);return}const W=n.settings.customPalettes.map(ne=>ne.id===_.id?{...ne,colors:O}:ne);i("update:settings",{customPalettes:W})}function y(){const _=E.value.find(pe=>pe.id===n.settings.branchPaletteId),b=_?[..._.colors]:[..._t[0].colors],O="custom-";let W=O+(n.settings.customPalettes.length+1);for(;_t.some(pe=>pe.id===W)||n.settings.customPalettes.some(pe=>pe.id===W);)W=O+Math.random().toString(36).slice(2,7);const ne={id:W,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:b};i("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:W}),f[W]=b.join(`
65
+ `)}function N(_){const b=n.settings.customPalettes.filter(W=>W.id!==_.id),O=n.settings.branchPaletteId===_.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:b,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete f[_.id]}const E=e.computed(()=>[..._t,...n.settings.customPalettes]),L=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],C=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function R(_,b,O,W){if(b<=1)return O;const ne=_/(b-1);return O+(W-O)*ne}function S(_,b,O){return _<=0?b:_===1?Math.max(1.5,b*.67):_===2?Math.max(.8,b*.42):O}const g=e.computed(()=>{const _=n.settings.lineWidthStart,b=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=C.length,ne=8,pe=192,K=E.value.find(F=>F.id===n.settings.branchPaletteId),ie=K&&K.colors.length?K.colors:x;return C.map((F,q)=>{const U=10+q*60/(W-1);return{x1:ne,y1:U,x2:pe,y2:U,w:O?S(F,_,b):R(F,W,_,b),color:n.settings.rainbowBranch?ie[q%ie.length]:"#94a3b8"}})});return(_,b)=>(e.openBlock(),e.createElementBlock("div",Gc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",_d,[b[32]||(b[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Ad,[b[27]||(b[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",Md,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",Rd,[b[28]||(b[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Bd,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",zd,[b[29]||(b[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",Id,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",Od,[b[31]||(b[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[7]||(b[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[30]||(b[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[33]||(b[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",jc,[b[23]||(b[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Kc,[b[12]||(b[12]=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:b[0]||(b[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,qc)]),e.createElementVNode("div",Yc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:b[1]||(b[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,Xc)]),e.createElementVNode("div",Zc,[b[13]||(b[13]=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:b[2]||(b[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Jc)]),e.createElementVNode("div",Qc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:b[3]||(b[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,ed)]),e.createElementVNode("div",td,[b[14]||(b[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",nd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:W=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",rd)):(e.openBlock(),e.createElementBlock("line",ld))],8,id)),e.createElementVNode("span",ad,e.toDisplayString(O.label),1)],10,od)),64))])]),e.createElementVNode("label",sd,[b[16]||(b[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[4]||(b[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[15]||(b[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[24]||(b[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",cd,[b[17]||(b[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_t),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",fd,e.toDisplayString(O.name),1),e.createElementVNode("span",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,ud))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",hd,e.toDisplayString(O.name),1),e.createElementVNode("span",bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,gd),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>f[O.id]=W.target.value},null,40,kd),e.createElementVNode("div",yd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>k(O)},"保存",8,Ed),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>N(O)},"删除",8,xd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",wd,[b[19]||(b[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:b[5]||(b[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...b[18]||(b[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[25]||(b[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",Nd,[b[21]||(b[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:b[6]||(b[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...b[20]||(b[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[26]||(b[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock("svg",Td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(O,W)=>(e.openBlock(),e.createElementBlock("line",{key:W,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,Cd))),128))])),b[22]||(b[22]=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",vd,[e.createElementVNode("h4",Ld,[b[34]||(b[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Dd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vd,[b[35]||(b[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",$d,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",Pd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.bg=O},null,12,Fd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[8]||(b[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",Ud,[b[36]||(b[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Hd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Wd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.textColor=O},null,12,Gd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[9]||(b[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",jd,[b[38]||(b[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:b[10]||(b[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...b[37]||(b[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:d},"清除该节点样式")]),b[39]||(b[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Kd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:b[11]||(b[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),mr=20;function qd(t,o){t.style.height="auto";const n=o.minRows*mr,i=o.maxRows>0?o.maxRows*mr:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Vo(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const s=t.value;s&&qd(s,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",r),i())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>i()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",r)})}function $o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Gt=$o();function pr(t){Gt=t}var jt={exec:()=>null};function an(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function he(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(Ge.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var Yd=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ge={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:an(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:an(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:an(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:an(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:an(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:an(t=>new RegExp(`^ {0,${t}}>`))},Xd=/^(?:[ \t]*(?:\n|$))+/,Zd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Po=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hr=he(gr).replace(/bull/g,Po).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(),eu=he(gr).replace(/bull/g,Po).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(),Fo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tu=/^[^\n]+/,Uo=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nu=he(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Uo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ou=he(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Po).getRegex(),Zn="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",Ho=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,iu=he("^ {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",Ho).replace("tag",Zn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),br=he(Fo).replace("hr",_n).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",Zn).getRegex(),ru=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",br).getRegex(),Wo={blockquote:ru,code:Zd,def:nu,fences:Jd,heading:Qd,hr:_n,html:iu,lheading:hr,list:ou,newline:Xd,paragraph:br,table:jt,text:tu},kr=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).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",Zn).getRegex(),lu={...Wo,lheading:eu,table:kr,paragraph:he(Fo).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kr).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",Zn).getRegex()},au={...Wo,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ho).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:jt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he(Fo).replace("hr",_n).replace("heading",` *#{1,6} *[^
66
+ ]`).replace("lheading",hr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},su=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yr=/^( {2,}|\\)\n(?!\s*$)/,du=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sn=/[\p{P}\p{S}]/u,Jn=/[\s\p{P}\p{S}]/u,Go=/[^\s\p{P}\p{S}]/u,uu=he(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jn).getRegex(),Er=/(?!~)[\p{P}\p{S}]/u,fu=/(?!~)[\s\p{P}\p{S}]/u,mu=/(?:[^\s\p{P}\p{S}]|~)/u,pu=he(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gu=he(xr,"u").replace(/punct/g,sn).getRegex(),hu=he(xr,"u").replace(/punct/g,Er).getRegex(),wr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bu=he(wr,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),ku=he(wr,"gu").replace(/notPunctSpace/g,mu).replace(/punctSpace/g,fu).replace(/punct/g,Er).getRegex(),yu=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),Eu=he(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,sn).getRegex(),xu="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wu=he(xu,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),Nu=he(/\\(punct)/,"gu").replace(/punct/g,sn).getRegex(),Su=he(/^<(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(),Tu=he(Ho).replace("(?:-->|$)","-->").getRegex(),Cu=he("^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",Tu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_u=he(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nr=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Qn).replace("ref",Uo).getRegex(),Sr=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",Uo).getRegex(),Au=he("reflink|nolink(?!\\()","g").replace("reflink",Nr).replace("nolink",Sr).getRegex(),Tr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jo={_backpedal:jt,anyPunctuation:Nu,autolink:Su,blockSkip:pu,br:yr,code:cu,del:jt,delLDelim:jt,delRDelim:jt,emStrongLDelim:gu,emStrongRDelimAst:bu,emStrongRDelimUnd:yu,escape:su,link:_u,nolink:Sr,punctuation:uu,reflink:Nr,reflinkSearch:Au,tag:Cu,text:du,url:jt},Mu={...jo,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Qn).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qn).getRegex()},Ko={...jo,emStrongRDelimAst:ku,emStrongLDelim:hu,delLDelim:Eu,delRDelim:wu,url:he(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Tr).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:he(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Tr).getRegex()},Ru={...Ko,br:he(yr).replace("{2,}","*").getRegex(),text:he(Ko.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},eo={normal:Wo,gfm:lu,pedantic:au},An={normal:jo,gfm:Ko,breaks:Ru,pedantic:Mu},Bu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cr=t=>Bu[t];function Et(t,o){if(o){if(Ge.escapeTest.test(t))return t.replace(Ge.escapeReplace,Cr)}else if(Ge.escapeTestNoEncode.test(t))return t.replace(Ge.escapeReplaceNoEncode,Cr);return t}function _r(t){try{t=encodeURI(t).replace(Ge.percentDecode,"%")}catch{return null}return t}function Ar(t,o){var s;let n=t.replace(Ge.findPipe,(c,u,d)=>{let f=!1,p=u;for(;--p>=0&&d[p]==="\\";)f=!f;return f?"|":" |"}),i=n.split(Ge.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(Ge.slashPipe,"|");return i}function It(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function Mr(t){let o=t.split(`
67
67
  `),n=o.length-1;for(;n>=0&&Ge.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
68
- `)}function Mu(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 Ru(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=r,n++;return i}function _r(t,o,n,i,r){let s=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Bu(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
68
+ `)}function zu(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 Iu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=r,n++;return i}function Rr(t,o,n,i,r){let s=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Ou(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
69
  `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=r.length?s.slice(r.length):s}).join(`
70
- `)}var eo=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Wt}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]:Cr(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=Bu(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=zt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:zt(o[0],`
71
- `),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:zt(o[0],`
72
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=zt(o[0],`
70
+ `)}var to=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Gt}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]:Mr(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=Ou(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=It(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:It(o[0],`
71
+ `),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:It(o[0],`
72
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=It(o[0],`
73
73
  `).split(`
74
- `),i="",r="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let m=u.join(`
75
- `),p=m.replace(this.rules.other.blockquoteSetextReplace,`
74
+ `),i="",r="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let f=u.join(`
75
+ `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
76
76
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
77
- ${m}`:m,r=r?`${r}
78
- ${p}`:p;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=k,n.length===0)break;let y=s.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let w=y,E=w.raw+`
77
+ ${f}`:f,r=r?`${r}
78
+ ${p}`:p;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=k,n.length===0)break;let y=s.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let N=y,E=N.raw+`
79
79
  `+n.join(`
80
- `),L=this.blockquote(E);s[s.length-1]=L,i=i.substring(0,i.length-w.raw.length)+L.raw,r=r.substring(0,r.length-w.text.length)+L.text;break}else if((y==null?void 0:y.type)==="list"){let w=y,E=w.raw+`
80
+ `),L=this.blockquote(E);s[s.length-1]=L,i=i.substring(0,i.length-N.raw.length)+L.raw,r=r.substring(0,r.length-N.text.length)+L.text;break}else if((y==null?void 0:y.type)==="list"){let N=y,E=N.raw+`
81
81
  `+n.join(`
82
- `),L=this.list(E);s[s.length-1]=L,i=i.substring(0,i.length-y.raw.length)+L.raw,r=r.substring(0,r.length-w.raw.length)+L.raw,n=E.substring(s.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={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 s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,m="",p="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let k=Ru(o[2].split(`
82
+ `),L=this.list(E);s[s.length-1]=L,i=i.substring(0,i.length-y.raw.length)+L.raw,r=r.substring(0,r.length-N.raw.length)+L.raw,n=E.substring(s.at(-1).raw.length).split(`
83
+ `);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={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 s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,f="",p="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;f=o[0],t=t.substring(f.length);let k=Iu(o[2].split(`
84
84
  `,1)[0],o[1].length),y=t.split(`
85
- `,1)[0],w=!k.trim(),E=0;if(this.options.pedantic?(E=2,p=k.trimStart()):w?E=o[1].length+1:(E=k.search(this.rules.other.nonSpaceChar),E=E>4?1:E,p=k.slice(E),E+=o[1].length),w&&this.rules.other.blankLine.test(y)&&(m+=y+`
85
+ `,1)[0],N=!k.trim(),E=0;if(this.options.pedantic?(E=2,p=k.trimStart()):N?E=o[1].length+1:(E=k.search(this.rules.other.nonSpaceChar),E=E>4?1:E,p=k.slice(E),E+=o[1].length),N&&this.rules.other.blankLine.test(y)&&(f+=y+`
86
86
  `,t=t.substring(y.length+1),d=!0),!d){let L=this.rules.other.nextBulletRegex(E),C=this.rules.other.hrRegex(E),x=this.rules.other.fencesBeginRegex(E),R=this.rules.other.headingBeginRegex(E),S=this.rules.other.htmlBeginRegex(E),g=this.rules.other.blockquoteBeginRegex(E);for(;t;){let _=t.split(`
87
87
  `,1)[0],b;if(y=_,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),b=y):b=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||R.test(y)||S.test(y)||g.test(y)||L.test(y)||C.test(y))break;if(b.search(this.rules.other.nonSpaceChar)>=E||!y.trim())p+=`
88
- `+b.slice(E);else{if(w||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(k)||R.test(k)||C.test(k))break;p+=`
89
- `+y}w=!y.trim(),m+=_+`
90
- `,t=t.substring(_.length+1),k=b.slice(E)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),r.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=m}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d of r.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let m=d.tokens[0];if(d.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let k=this.lexer.inlineQueue.length-1;k>=0;k--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)){this.lexer.inlineQueue[k].src=this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let k={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=k.checked,r.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=k.raw+d.tokens[0].raw,d.tokens[0].text=k.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(k)):d.tokens.unshift({type:"paragraph",raw:k.raw,text:k.raw,tokens:[k]}):d.tokens.unshift(k)}}else d.task&&(d.task=!1);if(!r.loose){let p=d.tokens.filter(y=>y.type==="space"),k=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=k}}if(r.loose)for(let d of r.items){d.loose=!0;for(let m of d.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Cr(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"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:zt(o[0],`
91
- `),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Tr(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
- `):[],s={type:"table",raw:zt(o[0],`
93
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of r)s.rows.push(Tr(u,s.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[m]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:zt(o[0],`
88
+ `+b.slice(E);else{if(N||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(k)||R.test(k)||C.test(k))break;p+=`
89
+ `+y}N=!y.trim(),f+=_+`
90
+ `,t=t.substring(_.length+1),k=b.slice(E)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),r.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=f}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d of r.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let f=d.tokens[0];if(d.task&&((f==null?void 0:f.type)==="text"||(f==null?void 0:f.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let k=this.lexer.inlineQueue.length-1;k>=0;k--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)){this.lexer.inlineQueue[k].src=this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let k={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=k.checked,r.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=k.raw+d.tokens[0].raw,d.tokens[0].text=k.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(k)):d.tokens.unshift({type:"paragraph",raw:k.raw,text:k.raw,tokens:[k]}):d.tokens.unshift(k)}}else d.task&&(d.task=!1);if(!r.loose){let p=d.tokens.filter(y=>y.type==="space"),k=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=k}}if(r.loose)for(let d of r.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Mr(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"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:It(o[0],`
91
+ `),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ar(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
+ `):[],s={type:"table",raw:It(o[0],`
93
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of r)s.rows.push(Ar(u,s.header.length).map((d,f)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[f]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:It(o[0],`
94
94
  `),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)===`
95
- `?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 s=zt(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Mu(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=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)),_r(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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," "),r=o[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return _r(n,r,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 r=[...i[0]].length-1,s,c,u=r,d=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,o=o.slice(-1*t.length+r);(i=m.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(c=[...s].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...i[0]][0].length,k=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let w=k.slice(1,-1);return{type:"em",raw:k,text:w,tokens:this.lexer.inlineTokens(w)}}let y=k.slice(2,-2);return{type:"strong",raw:k,text:y,tokens:this.lexer.inlineTokens(y)}}}}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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(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 r=[...i[0]].length-1,s,c,u=r,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+r);(i=d.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(c=[...s].length,c!==r))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...i[0]][0].length,p=t.slice(0,r+i.index+m+c),k=p.slice(r,-r);return{type:"del",raw:p,text:k,tokens:this.lexer.inlineTokens(k)}}}}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,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,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}}}},mt=class si{constructor(o){Ae(this,"tokens");Ae(this,"options");Ae(this,"state");Ae(this,"inlineQueue");Ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Wt,this.options.tokenizer=this.options.tokenizer||new eo,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:Ge,block:Qn.normal,inline:_n.normal};this.options.pedantic?(n.block=Qn.pedantic,n.inline=_n.pedantic):this.options.gfm&&(n.block=Qn.gfm,this.options.breaks?n.inline=_n.breaks:n.inline=_n.gfm),this.tokenizer.rules=n}static get rules(){return{block:Qn,inline:_n}}static lex(o,n){return new si(n).lex(o)}static lexInline(o,n){return new si(n).inlineTokens(o)}lex(o){o=o.replace(Ge.carriageReturn,`
95
+ `?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 s=It(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=zu(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=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)),Rr(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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," "),r=o[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Rr(n,r,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 r=[...i[0]].length-1,s,c,u=r,d=0,f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,o=o.slice(-1*t.length+r);(i=f.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(c=[...s].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...i[0]][0].length,k=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let N=k.slice(1,-1);return{type:"em",raw:k,text:N,tokens:this.lexer.inlineTokens(N)}}let y=k.slice(2,-2);return{type:"strong",raw:k,text:y,tokens:this.lexer.inlineTokens(y)}}}}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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(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 r=[...i[0]].length-1,s,c,u=r,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+r);(i=d.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(c=[...s].length,c!==r))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let f=[...i[0]][0].length,p=t.slice(0,r+i.index+f+c),k=p.slice(r,-r);return{type:"del",raw:p,text:k,tokens:this.lexer.inlineTokens(k)}}}}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,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,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}}}},ft=class di{constructor(o){Ae(this,"tokens");Ae(this,"options");Ae(this,"state");Ae(this,"inlineQueue");Ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Gt,this.options.tokenizer=this.options.tokenizer||new to,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:Ge,block:eo.normal,inline:An.normal};this.options.pedantic?(n.block=eo.pedantic,n.inline=An.pedantic):this.options.gfm&&(n.block=eo.gfm,this.options.breaks?n.inline=An.breaks:n.inline=An.gfm),this.tokenizer.rules=n}static get rules(){return{block:eo,inline:An}}static lex(o,n){return new di(n).lex(o)}static lexInline(o,n){return new di(n).inlineTokens(o)}lex(o){o=o.replace(Ge.carriageReturn,`
96
96
  `),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 s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(p=>(d=p.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 p=n.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
97
97
  `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
98
98
  `)?"":`
@@ -100,15 +100,15 @@ ${p}`:p;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
100
100
  `+d.text,this.inlineQueue.at(-1).src=p.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 p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
101
101
  `)?"":`
102
102
  `)+d.raw,p.text+=`
103
- `+d.raw,this.inlineQueue.at(-1).src=p.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 m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,k=o.slice(1),y;this.options.extensions.startBlock.forEach(w=>{y=w.call({lexer:this},k),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(m=o.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
103
+ `+d.raw,this.inlineQueue.at(-1).src=p.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 f=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,k=o.slice(1),y;this.options.extensions.startBlock.forEach(N=>{y=N.call({lexer:this},k),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(f=o.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(f))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
104
104
  `)?"":`
105
105
  `)+d.raw,p.text+=`
106
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),i=m.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
106
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),i=f.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
107
107
  `)?"":`
108
108
  `)+d.raw,p.text+=`
109
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.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 m,p,k,y,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)E.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=r[2]?r[2].length:0,i=i.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let E;if((y=(k=this.options.extensions)==null?void 0:k.inline)!=null&&y.some(C=>(E=C.call({lexer:this},o,n))?(o=o.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(E.raw.length);let C=n.at(-1);E.type==="text"&&(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(o)){o=o.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(o))){o=o.substring(E.raw.length),n.push(E);continue}let L=o;if((w=this.options.extensions)!=null&&w.startInline){let C=1/0,x=o.slice(1),R;this.options.extensions.startInline.forEach(S=>{R=S.call({lexer:this},x),typeof R=="number"&&R>=0&&(C=Math.min(C,R))}),C<1/0&&C>=0&&(L=o.substring(0,C+1))}if(E=this.tokenizer.inlineText(L)){o=o.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(u=E.raw.slice(-1)),c=!0;let C=n.at(-1);(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);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)}},An=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Wt}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let i=(s=(o||"").match(Ge.notSpaceStart))==null?void 0:s[0],r=t.replace(Ge.endingNewline,"")+`
110
- `;return i?'<pre><code class="language-'+yt(i)+'">'+(n?r:yt(r,!0))+`</code></pre>
111
- `:"<pre><code>"+(n?r:yt(r,!0))+`</code></pre>
109
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.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 f,p,k,y,N;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)E.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=r[2]?r[2].length:0,i=i.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let E;if((y=(k=this.options.extensions)==null?void 0:k.inline)!=null&&y.some(C=>(E=C.call({lexer:this},o,n))?(o=o.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(E.raw.length);let C=n.at(-1);E.type==="text"&&(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(o)){o=o.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(o))){o=o.substring(E.raw.length),n.push(E);continue}let L=o;if((N=this.options.extensions)!=null&&N.startInline){let C=1/0,x=o.slice(1),R;this.options.extensions.startInline.forEach(S=>{R=S.call({lexer:this},x),typeof R=="number"&&R>=0&&(C=Math.min(C,R))}),C<1/0&&C>=0&&(L=o.substring(0,C+1))}if(E=this.tokenizer.inlineText(L)){o=o.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(u=E.raw.slice(-1)),c=!0;let C=n.at(-1);(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);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)}},Mn=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Gt}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let i=(s=(o||"").match(Ge.notSpaceStart))==null?void 0:s[0],r=t.replace(Ge.endingNewline,"")+`
110
+ `;return i?'<pre><code class="language-'+Et(i)+'">'+(n?r:Et(r,!0))+`</code></pre>
111
+ `:"<pre><code>"+(n?r:Et(r,!0))+`</code></pre>
112
112
  `}blockquote({tokens:t}){return`<blockquote>
113
113
  ${this.parser.parse(t)}</blockquote>
114
114
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
@@ -124,12 +124,12 @@ ${this.parser.parse(t)}</blockquote>
124
124
  `}tablerow({text:t}){return`<tr>
125
125
  ${t}</tr>
126
126
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
127
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),r=Sr(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return o&&(s+=' title="'+yt(o)+'"'),s+=">"+i+"</a>",s}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=Sr(t);if(r===null)return yt(n);t=r;let s=`<img src="${t}" alt="${yt(n)}"`;return o&&(s+=` title="${yt(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yt(t.text)}},jo=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}},ft=class ci{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Wt,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jo}static parse(o,n){return new ci(n).parse(o)}static parseInline(o,n){return new ci(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let d=c,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let u=c;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 r,s;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";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 m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},Mn=(no=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Wt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?mt.lex:mt.lexInline}provideParser(t=this.block){return t?ft.parse:ft.parseInline}},Ae(no,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(no,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),no),Ar=class{constructor(...t){Ae(this,"defaults",Do());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",ft);Ae(this,"Renderer",An);Ae(this,"TextRenderer",jo);Ae(this,"Lexer",mt);Ae(this,"Tokenizer",eo);Ae(this,"Hooks",Mn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=o.renderers[r.name];s?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[r.level];s?s.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new An(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new eo(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Mn;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=r[c];Mn.passThroughHooks.has(s)?r[c]=m=>{if(this.defaults.async&&Mn.passThroughHooksRespectAsync.has(s))return(async()=>{let k=await u.call(r,m);return d.call(r,k)})();let p=u.call(r,m);return d.call(r,p)}:r[c]=(...m)=>{if(this.defaults.async)return(async()=>{let k=await u.apply(r,m);return k===!1&&(k=await d.apply(r,m)),k})();let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),r&&(u=u.concat(r.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return mt.lex(t,o??this.defaults)}parser(t,o){return ft.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let c=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?mt.lex:mt.lexInline)(c,r),d=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(d,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ft.parse:ft.parseInline)(d,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(s);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?mt.lex:mt.lexInline)(o,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?ft.parse:ft.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
128
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},jt=new Ar;function _e(t,o){return jt.parse(t,o)}_e.options=_e.setOptions=function(t){return jt.setOptions(t),_e.defaults=jt.defaults,ur(_e.defaults),_e},_e.getDefaults=Do,_e.defaults=Wt,_e.use=function(...t){return jt.use(...t),_e.defaults=jt.defaults,ur(_e.defaults),_e},_e.walkTokens=function(t,o){return jt.walkTokens(t,o)},_e.parseInline=jt.parseInline,_e.Parser=ft,_e.parser=ft.parse,_e.Renderer=An,_e.TextRenderer=jo,_e.Lexer=mt,_e.lexer=mt.lex,_e.Tokenizer=eo,_e.Hooks=Mn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,ft.parse,mt.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 Mr(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 zu(t){if(Array.isArray(t))return t}function Iu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,c,u=[],d=!0,m=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(i=s.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(p){m=!0,r=p}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw r}}return u}}function Ou(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vu(t,o){return zu(t)||Iu(t,o)||Lu(t,o)||Ou()}function Lu(t,o){if(t){if(typeof t=="string")return Mr(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)?Mr(t,o):void 0}}const Rr=Object.entries,Br=Object.setPrototypeOf,Du=Object.isFrozen,Vu=Object.getPrototypeOf,$u=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,dt=Object.seal,sn=Object.create,zr=typeof Reflect<"u"&&Reflect,Ko=zr.apply,qo=zr.construct;Xe||(Xe=function(o){return o}),dt||(dt=function(o){return o}),Ko||(Ko=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return o.apply(n,r)}),qo||(qo=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const Kt=$e(Array.prototype.forEach),Pu=$e(Array.prototype.lastIndexOf),Ir=$e(Array.prototype.pop),cn=$e(Array.prototype.push),Fu=$e(Array.prototype.splice),Ze=Array.isArray,Rn=$e(String.prototype.toLowerCase),Yo=$e(String.prototype.toString),Or=$e(String.prototype.match),dn=$e(String.prototype.replace),vr=$e(String.prototype.indexOf),Uu=$e(String.prototype.trim),Hu=$e(Number.prototype.toString),Wu=$e(Boolean.prototype.toString),Lr=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),Dr=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),ve=$e(Object.prototype.hasOwnProperty),Bn=$e(Object.prototype.toString),He=$e(RegExp.prototype.test),un=Gu(TypeError);function $e(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Ko(t,o,i)}}function Gu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return qo(t,n)}}function ue(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rn;if(Br&&Br(t,null),!Ze(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const s=n(r);s!==r&&(Du(o)||(o[i]=s),r=s)}t[r]=!0}return t}function ju(t){for(let o=0;o<t.length;o++)ve(t,o)||(t[o]=null);return t}function je(t){const o=sn(null);for(const i of Rr(t)){var n=vu(i,2);const r=n[0],s=n[1];ve(t,r)&&(Ze(s)?o[r]=ju(s):s&&typeof s=="object"&&s.constructor===Object?o[r]=je(s):o[r]=s)}return o}function Ku(t){switch(typeof t){case"string":return t;case"number":return Hu(t);case"boolean":return Wu(t);case"bigint":return Lr?Lr(t):"0";case"symbol":return Dr?Dr(t):"Symbol()";case"undefined":return Bn(t);case"function":case"object":{if(t===null)return Bn(t);const o=t,n=Et(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:Bn(i)}return Bn(t)}default:return Bn(t)}}function Et(t,o){for(;t!==null;){const i=$u(t,o);if(i){if(i.get)return $e(i.get);if(typeof i.value=="function")return $e(i.value)}t=Vu(t)}function n(){return null}return n}function qu(t){try{return He(t,""),!0}catch{return!1}}const Vr=Xe(["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"]),Xo=Xe(["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"]),Zo=Xe(["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"]),Yu=Xe(["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"]),Jo=Xe(["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"]),Xu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$r=Xe(["#text"]),Pr=Xe(["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"]),Qo=Xe(["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"]),Fr=Xe(["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"]),to=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Zu=dt(/{{[\w\W]*|^[\w\W]*}}/g),Ju=dt(/<%[\w\W]*|^[\w\W]*%>/g),Qu=dt(/\${[\w\W]*/g),em=dt(/^data-[\-\w.\u00B7-\uFFFF]+$/),tm=dt(/^aria-[\-\w]+$/),Ur=dt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nm=dt(/^(?:\w+script|data):/i),om=dt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),im=dt(/^html$/i),rm=dt(/^[a-z][.\w]*(-[.\w]+)+$/i),xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lm=function(){return typeof window>"u"?null:window},am=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Hr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lm();const o=X=>Wr(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,k=t.trustedTypes,y=u.prototype,w=Et(y,"cloneNode"),E=Et(y,"remove"),L=Et(y,"nextSibling"),C=Et(y,"childNodes"),x=Et(y,"parentNode"),R=Et(y,"shadowRoot"),S=Et(y,"attributes"),g=c&&c.prototype?Et(c.prototype,"nodeType"):null,_=c&&c.prototype?Et(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let b,v="",H=0;const oe=function(f){if(H>0)throw un('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.');H++;try{return b.createHTML(f)}finally{H--}},q=n,J=q.implementation,ae=q.createNodeIterator,W=q.createDocumentFragment,K=q.getElementsByTagName,F=i.importNode;let N=Hr();o.isSupported=typeof Rr=="function"&&typeof x=="function"&&J&&J.createHTMLDocument!==void 0;const P=Zu,D=Ju,Y=Qu,se=em,ke=tm,Re=nm,Pe=om,Te=rm;let B=Ur,z=null;const ie=ue({},[...Vr,...Xo,...Zo,...Jo,...$r]);let re=null;const V=ue({},[...Pr,...Qo,...Fr,...to]);let T=Object.seal(sn(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}})),ce=null,de=null;const De=Object.seal(sn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ke=!0,We=!0,mn=!1,It=!0,Q=!1,wt=!0,Me=!1,we=!1,pt=!1,qe=!1,gt=!1,Nt=!1,U=!0,Z=!1;const le="user-content-";let pe=!0,ze=!1,Ue={},Je=null;const Ot=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 fn=null;const pn=ue({},["audio","video","img","source","image","track"]);let zn=null;const oo=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let Qe=nt,Ie=!1,be=null;const ti=ue({},[gn,vt,nt],Yo);let et=ue({},["mi","mo","mn","ms","mtext"]),ee=ue({},["annotation-xml"]);const io=ue({},["title","style","font","a","script"]);let Lt=null;const ni=["application/xhtml+xml","text/html"],ro="text/html";let Oe=null,Dt=null;const hn=n.createElement("form"),lo=function(f){return f instanceof RegExp||f instanceof Function},bn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===f)return;(!f||typeof f!="object")&&(f={}),f=je(f),Lt=ni.indexOf(f.PARSER_MEDIA_TYPE)===-1?ro:f.PARSER_MEDIA_TYPE,Oe=Lt==="application/xhtml+xml"?Yo:Rn,z=ve(f,"ALLOWED_TAGS")&&Ze(f.ALLOWED_TAGS)?ue({},f.ALLOWED_TAGS,Oe):ie,re=ve(f,"ALLOWED_ATTR")&&Ze(f.ALLOWED_ATTR)?ue({},f.ALLOWED_ATTR,Oe):V,be=ve(f,"ALLOWED_NAMESPACES")&&Ze(f.ALLOWED_NAMESPACES)?ue({},f.ALLOWED_NAMESPACES,Yo):ti,zn=ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)?ue(je(oo),f.ADD_URI_SAFE_ATTR,Oe):oo,fn=ve(f,"ADD_DATA_URI_TAGS")&&Ze(f.ADD_DATA_URI_TAGS)?ue(je(pn),f.ADD_DATA_URI_TAGS,Oe):pn,Je=ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)?ue({},f.FORBID_CONTENTS,Oe):Ot,ce=ve(f,"FORBID_TAGS")&&Ze(f.FORBID_TAGS)?ue({},f.FORBID_TAGS,Oe):je({}),de=ve(f,"FORBID_ATTR")&&Ze(f.FORBID_ATTR)?ue({},f.FORBID_ATTR,Oe):je({}),Ue=ve(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?je(f.USE_PROFILES):f.USE_PROFILES:!1,Ke=f.ALLOW_ARIA_ATTR!==!1,We=f.ALLOW_DATA_ATTR!==!1,mn=f.ALLOW_UNKNOWN_PROTOCOLS||!1,It=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=f.SAFE_FOR_TEMPLATES||!1,wt=f.SAFE_FOR_XML!==!1,Me=f.WHOLE_DOCUMENT||!1,qe=f.RETURN_DOM||!1,gt=f.RETURN_DOM_FRAGMENT||!1,Nt=f.RETURN_TRUSTED_TYPE||!1,pt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,pe=f.KEEP_CONTENT!==!1,ze=f.IN_PLACE||!1,B=qu(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Ur,Qe=typeof f.NAMESPACE=="string"?f.NAMESPACE:nt,et=ve(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(f.MATHML_TEXT_INTEGRATION_POINTS):ue({},["mi","mo","mn","ms","mtext"]),ee=ve(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?je(f.HTML_INTEGRATION_POINTS):ue({},["annotation-xml"]);const O=ve(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?je(f.CUSTOM_ELEMENT_HANDLING):sn(null);if(T=sn(null),ve(O,"tagNameCheck")&&lo(O.tagNameCheck)&&(T.tagNameCheck=O.tagNameCheck),ve(O,"attributeNameCheck")&&lo(O.attributeNameCheck)&&(T.attributeNameCheck=O.attributeNameCheck),ve(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),Q&&(We=!1),gt&&(qe=!0),Ue&&(z=ue({},$r),re=sn(null),Ue.html===!0&&(ue(z,Vr),ue(re,Pr)),Ue.svg===!0&&(ue(z,Xo),ue(re,Qo),ue(re,to)),Ue.svgFilters===!0&&(ue(z,Zo),ue(re,Qo),ue(re,to)),Ue.mathMl===!0&&(ue(z,Jo),ue(re,Fr),ue(re,to))),De.tagCheck=null,De.attributeCheck=null,ve(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Ze(f.ADD_TAGS)&&(z===ie&&(z=je(z)),ue(z,f.ADD_TAGS,Oe))),ve(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Ze(f.ADD_ATTR)&&(re===V&&(re=je(re)),ue(re,f.ADD_ATTR,Oe))),ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)&&ue(zn,f.ADD_URI_SAFE_ATTR,Oe),ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)&&(Je===Ot&&(Je=je(Je)),ue(Je,f.FORBID_CONTENTS,Oe)),ve(f,"ADD_FORBID_CONTENTS")&&Ze(f.ADD_FORBID_CONTENTS)&&(Je===Ot&&(Je=je(Je)),ue(Je,f.ADD_FORBID_CONTENTS,Oe)),pe&&(z["#text"]=!0),Me&&ue(z,["html","head","body"]),z.table&&(ue(z,["tbody"]),delete ce.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw un('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw un('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=b;b=f.TRUSTED_TYPES_POLICY;try{v=oe("")}catch(ye){throw b=G,ye}}else b===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(b=am(k,r)),b&&typeof v=="string"&&(v=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&z===ie&&(z=je(z)),N.uponSanitizeAttribute.length>0&&re===V&&(re=je(re)),Xe&&Xe(f),Dt=f},St=ue({},[...Xo,...Zo,...Yu]),ao=ue({},[...Jo,...Xu]),oi=function(f){let O=x(f);(!O||!O.tagName)&&(O={namespaceURI:Qe,tagName:"template"});const G=Rn(f.tagName),ye=Rn(O.tagName);return be[f.namespaceURI]?f.namespaceURI===vt?O.namespaceURI===nt?G==="svg":O.namespaceURI===gn?G==="svg"&&(ye==="annotation-xml"||et[ye]):!!St[G]:f.namespaceURI===gn?O.namespaceURI===nt?G==="math":O.namespaceURI===vt?G==="math"&&ee[ye]:!!ao[G]:f.namespaceURI===nt?O.namespaceURI===vt&&!ee[ye]||O.namespaceURI===gn&&!et[ye]?!1:!ao[G]&&(io[G]||!St[G]):!!(Lt==="application/xhtml+xml"&&be[f.namespaceURI]):!1},lt=function(f){cn(o.removed,{element:f});try{x(f).removeChild(f)}catch{E(f)}},_t=function(f,O){try{cn(o.removed,{attribute:O.getAttributeNode(f),from:O})}catch{cn(o.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(qe||gt)try{lt(O)}catch{}else try{O.setAttribute(f,"")}catch{}},so=function(f){let O=null,G=null;if(pt)f="<remove></remove>"+f;else{const Ce=Or(f,/^[\r\n\t ]+/);G=Ce&&Ce[0]}Lt==="application/xhtml+xml"&&Qe===nt&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ye=b?oe(f):f;if(Qe===nt)try{O=new p().parseFromString(ye,Lt)}catch{}if(!O||!O.documentElement){O=J.createDocument(Qe,"template",null);try{O.documentElement.innerHTML=Ie?v:ye}catch{}}const me=O.body||O.documentElement;return f&&G&&me.insertBefore(n.createTextNode(G),me.childNodes[0]||null),Qe===nt?K.call(O,Me?"html":"body")[0]:Me?O.documentElement:me},co=function(f){return ae.call(f.ownerDocument||f,f,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},kn=function(f){var O,G;f.normalize();const ye=ae.call(f.ownerDocument||f,f,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let me=ye.nextNode();for(;me;){let Be=me.data;Kt([P,D,Y],Ye=>{Be=dn(Be,Ye," ")}),me.data=Be,me=ye.nextNode()}const Ce=(O=(G=f.querySelectorAll)===null||G===void 0?void 0:G.call(f,"template"))!==null&&O!==void 0?O:[];Kt(Array.from(Ce),Be=>{Fe(Be.content)&&kn(Be.content)})},te=function(f){const O=_?_(f):null;return typeof O!="string"||Oe(O)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==S(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==g(f)||f.childNodes!==C(f)},Fe=function(f){if(!g||typeof f!="object"||f===null)return!1;try{return g(f)===xt.documentFragment}catch{return!1}},qt=function(f){if(!g||typeof f!="object"||f===null)return!1;try{return typeof g(f)=="number"}catch{return!1}};function ot(X,f,O){Kt(X,G=>{G.call(o,f,O,Dt)})}const uo=function(f){let O=null;if(ot(N.beforeSanitizeElements,f,null),te(f))return lt(f),!0;const G=Oe(_?_(f):f.nodeName);if(ot(N.uponSanitizeElement,f,{tagName:G,allowedTags:z}),wt&&f.hasChildNodes()&&!qt(f.firstElementChild)&&He(/<[/\w!]/g,f.innerHTML)&&He(/<[/\w!]/g,f.textContent)||wt&&f.namespaceURI===nt&&G==="style"&&qt(f.firstElementChild)||f.nodeType===xt.progressingInstruction||wt&&f.nodeType===xt.comment&&He(/<[/\w]/g,f.data))return lt(f),!0;if(ce[G]||!(De.tagCheck instanceof Function&&De.tagCheck(G))&&!z[G]){if(!ce[G]&&Vt(G)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G)))return!1;if(pe&&!Je[G]){const me=x(f),Ce=C(f);if(Ce&&me){const Be=Ce.length;for(let Ye=Be-1;Ye>=0;--Ye){const at=w(Ce[Ye],!0);me.insertBefore(at,L(f))}}}return lt(f),!0}return(g?g(f):f.nodeType)===xt.element&&!oi(f)||(G==="noscript"||G==="noembed"||G==="noframes")&&He(/<\/no(script|embed|frames)/i,f.innerHTML)?(lt(f),!0):(Q&&f.nodeType===xt.text&&(O=f.textContent,Kt([P,D,Y],me=>{O=dn(O,me," ")}),f.textContent!==O&&(cn(o.removed,{element:f.cloneNode()}),f.textContent=O)),ot(N.afterSanitizeElements,f,null),!1)},mo=function(f,O,G){if(de[O]||U&&(O==="id"||O==="name")&&(G in n||G in hn))return!1;const ye=re[O]||De.attributeCheck instanceof Function&&De.attributeCheck(O,f);if(!(We&&!de[O]&&He(se,O))){if(!(Ke&&He(ke,O))){if(!ye||de[O]){if(!(Vt(f)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&He(T.attributeNameCheck,O)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(O,f))||O==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G))))return!1}else if(!zn[O]){if(!He(B,dn(G,Pe,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&vr(G,"data:")===0&&fn[f])){if(!(mn&&!He(Re,dn(G,Pe,"")))){if(G)return!1}}}}}}return!0},fo=ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vt=function(f){return!fo[Rn(f)]&&He(Te,f)},yn=function(f){ot(N.beforeSanitizeAttributes,f,null);const O=f.attributes;if(!O||te(f))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0};let ye=O.length;for(;ye--;){const me=O[ye],Ce=me.name,Be=me.namespaceURI,Ye=me.value,at=Oe(Ce),xn=Ye;let Ve=Ce==="value"?xn:Uu(xn);if(G.attrName=at,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,ot(N.uponSanitizeAttribute,f,G),Ve=G.attrValue,Z&&(at==="id"||at==="name")&&vr(Ve,le)!==0&&(_t(Ce,f),Ve=le+Ve),wt&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){_t(Ce,f);continue}if(at==="attributename"&&Or(Ve,"href")){_t(Ce,f);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){_t(Ce,f);continue}if(!It&&He(/\/>/i,Ve)){_t(Ce,f);continue}Q&&Kt([P,D,Y],On=>{Ve=dn(Ve,On," ")});const In=Oe(f.nodeName);if(!mo(In,at,Ve)){_t(Ce,f);continue}if(b&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Be)switch(k.getAttributeType(In,at)){case"TrustedHTML":{Ve=oe(Ve);break}case"TrustedScriptURL":{Ve=b.createScriptURL(Ve);break}}if(Ve!==xn)try{Be?f.setAttributeNS(Be,Ce,Ve):f.setAttribute(Ce,Ve),te(f)?lt(f):Ir(o.removed)}catch{_t(Ce,f)}}ot(N.afterSanitizeAttributes,f,null)},En=function(f){let O=null;const G=co(f);for(ot(N.beforeSanitizeShadowDOM,f,null);O=G.nextNode();)if(ot(N.uponSanitizeShadowNode,O,null),uo(O),yn(O),Fe(O.content)&&En(O.content),(g?g(O):O.nodeType)===xt.element){const me=R?R(O):O.shadowRoot;Fe(me)&&($t(me),En(me))}ot(N.afterSanitizeShadowDOM,f,null)},$t=function(f){const O=g?g(f):f.nodeType;if(O===xt.element){const me=R?R(f):f.shadowRoot;Fe(me)&&($t(me),En(me))}const G=C?C(f):f.childNodes;if(!G)return;const ye=[];Kt(G,me=>{cn(ye,me)});for(const me of ye)$t(me);if(O===xt.element){const me=_?_(f):null;if(typeof me=="string"&&Oe(me)==="template"){const Ce=f.content;Fe(Ce)&&$t(Ce)}}};return o.sanitize=function(X){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,G=null,ye=null,me=null;if(Ie=!X,Ie&&(X="<!-->"),typeof X!="string"&&!qt(X)&&(X=Ku(X),typeof X!="string"))throw un("dirty is not a string, aborting");if(!o.isSupported)return X;if(we||bn(f),o.removed=[],typeof X=="string"&&(ze=!1),ze){const Ye=_?_(X):X.nodeName;if(typeof Ye=="string"){const at=Oe(Ye);if(!z[at]||ce[at])throw un("root node is forbidden and cannot be sanitized in-place")}if(te(X))throw un("root node is clobbered and cannot be sanitized in-place");$t(X)}else if(qt(X))O=so("<!---->"),G=O.ownerDocument.importNode(X,!0),G.nodeType===xt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?O=G:O.appendChild(G),$t(G);else{if(!qe&&!Q&&!Me&&X.indexOf("<")===-1)return b&&Nt?oe(X):X;if(O=so(X),!O)return qe?null:Nt?v:""}O&&pt&&lt(O.firstChild);const Ce=co(ze?X:O);for(;ye=Ce.nextNode();)uo(ye),yn(ye),Fe(ye.content)&&En(ye.content);if(ze)return Q&&kn(X),X;if(qe){if(Q&&kn(O),gt)for(me=W.call(O.ownerDocument);O.firstChild;)me.appendChild(O.firstChild);else me=O;return(re.shadowroot||re.shadowrootmode)&&(me=F.call(i,me,!0)),me}let Be=Me?O.outerHTML:O.innerHTML;return Me&&z["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&He(im,O.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
130
- `+Be),Q&&Kt([P,D,Y],Ye=>{Be=dn(Be,Ye," ")}),b&&Nt?oe(Be):Be},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bn(X),we=!0},o.clearConfig=function(){Dt=null,we=!1},o.isValidAttribute=function(X,f,O){Dt||bn({});const G=Oe(X),ye=Oe(f);return mo(G,ye,O)},o.addHook=function(X,f){typeof f=="function"&&cn(N[X],f)},o.removeHook=function(X,f){if(f!==void 0){const O=Pu(N[X],f);return O===-1?void 0:Fu(N[X],O,1)[0]}return Ir(N[X])},o.removeHooks=function(X){N[X]=[]},o.removeAllHooks=function(){N=Hr()},o}var sm=Wr();const cm=new Ar({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new An;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=Bo(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),dm=["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"],um=["href","title","target","rel","src","alt","class","checked","type","disabled"],mm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function fm(t){if(!t)return"";const o=cm.parse(t,{async:!1});return sm.sanitize(o,{ALLOWED_TAGS:dm,ALLOWED_ATTR:um,ALLOWED_URI_REGEXP:mm})}const pm={class:"zm-note-panel"},gm={key:0,class:"zm-note-empty"},hm={class:"zm-note-header"},bm={class:"zm-note-title-row"},km={class:"zm-note-name"},ym={class:"zm-note-meta"},Em={class:"zm-note-scroll"},xm={class:"zm-note-section"},wm={class:"zm-note-section-head"},Nm={class:"zm-note-split"},Sm=["disabled"],Tm={key:0,class:"zm-note-preview"},Cm=["innerHTML"],_m={key:1,class:"zm-note-preview-hint"},Am={key:0,class:"zm-note-section-actions"},Mm={key:0,class:"zm-note-add-row"},Rm={key:1,class:"zm-note-section"},Bm=["disabled"],zm=["href","title"],Im={key:2,class:"zm-note-section"},Om=["disabled"],vm=["src","alt"],Lm={key:3,class:"zm-note-section"},Dm={class:"zm-note-section-head"},Vm={key:0,class:"zm-note-section-tag"},$m=["disabled"],Pm={key:0,class:"zm-note-code"},Fm=["innerHTML"],Um={key:4,class:"zm-note-section"},Hm=["disabled"],Wm={key:0,class:"zm-note-table"},Gm=["onClick"],jm={class:"zm-note-table-sort-mark","aria-hidden":"true"},ei=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,r=e.ref(""),s=e.ref(null);Lo(s,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>fm(r.value)),d=e.ref(!0);function m(){d.value=!d.value}e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:ie.text]},()=>{var B,z;r.value=((z=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const B=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(B){B.focus();const z=B.value.length;B.setSelectionRange(z,z)}});function p(){var ie,re;if(n.readonly)return;const B=r.value,z=((re=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:re.text)??"";B!==z&&i("apply",B)}function k(B){var z,ie;n.readonly||(B.key==="Escape"?(B.preventDefault(),r.value=((ie=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:ie.text)??"",B.target.blur()):B.key==="Enter"&&(B.ctrlKey||B.metaKey)&&(B.preventDefault(),p(),B.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.link)!=null&&z.url)}),E=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.image)!=null&&z.src)}),L=e.computed(()=>{var B,z;return(z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.kind}),C=e.computed(()=>L.value==="code"),x=e.computed(()=>L.value==="table"),R=e.ref(!1),S=e.ref(!1),g=e.ref(!1),_=e.ref(!1);e.watch(()=>{var B;return(B=n.selectedNode)==null?void 0:B.id},()=>{R.value=!1,S.value=!1,g.value=!1,_.value=!1});const b=e.ref("");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:ie.url]},()=>{var B,z;b.value=((z=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:z.url)??""},{immediate:!0});function v(){var ie,re;if(n.readonly)return;const B=b.value.trim(),z=((re=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:re.url)??"";B!==z&&i("set-link",B)}const H=e.ref("");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:ie.src]},()=>{var B,z;H.value=((z=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:z.src)??""},{immediate:!0});function oe(){var ie,re;if(n.readonly)return;const B=H.value.trim(),z=((re=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:re.src)??"";B!==z&&i("set-image",B)}function q(B){const z=B.target;z.style.display="none"}function J(B){const z=B.target;z.style.display=""}const ae=e.ref(""),W=e.ref(null);Lo(W,{minRows:4,maxRows:18}),e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:ie.raw]},()=>{var B,z;ae.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??""},{immediate:!0});const K=e.computed(()=>Bo(Ro(ae.value),nn(ae.value)));function F(){var re,V;if(n.readonly)return;const B=ae.value,z=((V=(re=n.selectedNode)==null?void 0:re.richContent)==null?void 0:V.raw)??"";if(B===z)return;const ie=nn(B)||void 0;i("set-rich",B?{kind:"code",raw:B,lang:ie}:null)}const N=e.ref(""),P=e.ref(null);Lo(P,{minRows:4,maxRows:14});const D=e.ref(-1),Y=e.ref("asc");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:ie.raw]},()=>{var B,z;N.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??"",D.value=-1,Y.value="asc"},{immediate:!0});function se(){var ie,re;if(n.readonly)return;const B=N.value,z=((re=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:re.raw)??"";B!==z&&i("set-rich",B?{kind:"table",raw:B}:null)}const ke=e.computed(()=>sr(N.value)),Re=e.computed(()=>{const B=ke.value;return D.value<0||B.length<=1?B:cr(B,D.value,Y.value)});function Pe(B){D.value!==B?(D.value=B,Y.value="asc"):Y.value==="asc"?Y.value="desc":D.value=-1}const Te=e.computed(()=>{const B=[];return c.value||B.push(`${r.value.length} 字`),w.value&&B.push("1 链接"),E.value&&B.push("1 图片"),C.value&&B.push("代码块"),x.value&&B.push("表格"),B.length===0?"节点没有额外内容":B.join(" · ")});return(B,z)=>{var ie,re,V,T;return e.openBlock(),e.createElementBlock("div",pm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",hm,[e.createElementVNode("div",bm,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",km,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",ym,e.toDisplayString(Te.value),1)]),e.createElementVNode("div",Em,[e.createElementVNode("section",xm,[e.createElementVNode("header",wm,[z[13]||(z[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),z[14]||(z[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:m},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Nm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":z[0]||(z[0]=ce=>r.value=ce),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:k},null,40,Sm),[[e.vModelText,r.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Tm,[c.value?(e.openBlock(),e.createElementBlock("div",_m," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Cm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Am,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mm,[!w.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=ce=>R.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!E.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=ce=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!C.value&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=ce=>g.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!_.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=ce=>_.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||R.value?(e.openBlock(),e.createElementBlock("section",Rm,[z[15]||(z[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[5]||(z[5]=ce=>b.value=ce),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:v,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(ce=>ce.target.blur(),["prevent"]),["enter"]))},null,40,Bm),[[e.vModelText,b.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(re=t.selectedNode.link)==null?void 0:re.url},e.toDisplayString((V=t.selectedNode.link)==null?void 0:V.url),9,zm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),E.value||S.value?(e.openBlock(),e.createElementBlock("section",Im,[z[16]||(z[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[7]||(z[7]=ce=>H.value=ce),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(ce=>ce.target.blur(),["prevent"]),["enter"]))},null,40,Om),[[e.vModelText,H.value]]),E.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:q,onLoad:J},null,40,vm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||g.value?(e.openBlock(),e.createElementBlock("section",Lm,[e.createElementVNode("header",Dm,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(nn)(ae.value)?(e.openBlock(),e.createElementBlock("span",Vm,e.toDisplayString(e.unref(nn)(ae.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:W,"onUpdate:modelValue":z[9]||(z[9]=ce=>ae.value=ce),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:F},null,40,$m),[[e.vModelText,ae.value]]),ae.value.trim()?(e.openBlock(),e.createElementBlock("pre",Pm,[e.createElementVNode("code",{innerHTML:K.value},null,8,Fm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||_.value?(e.openBlock(),e.createElementBlock("section",Um,[z[18]||(z[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:P,"onUpdate:modelValue":z[10]||(z[10]=ce=>N.value=ce),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
127
+ `}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>${Et(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),r=_r(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return o&&(s+=' title="'+Et(o)+'"'),s+=">"+i+"</a>",s}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=_r(t);if(r===null)return Et(n);t=r;let s=`<img src="${t}" alt="${Et(n)}"`;return o&&(s+=` title="${Et(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Et(t.text)}},qo=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}},mt=class ui{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Gt,this.options.renderer=this.options.renderer||new Mn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qo}static parse(o,n){return new ui(n).parse(o)}static parseInline(o,n){return new ui(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let d=c,f=this.options.extensions.renderers[d.type].call({parser:this},d);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=f||"";continue}}let u=c;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 r,s;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[u.type]){let f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=f||"";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 f='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return i}},Rn=(oo=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Gt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ft.lex:ft.lexInline}provideParser(t=this.block){return t?mt.parse:mt.parseInline}},Ae(oo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(oo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),oo),Br=class{constructor(...t){Ae(this,"defaults",$o());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",mt);Ae(this,"Renderer",Mn);Ae(this,"TextRenderer",qo);Ae(this,"Lexer",ft);Ae(this,"Tokenizer",to);Ae(this,"Hooks",Rn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=o.renderers[r.name];s?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[r.level];s?s.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new Mn(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=r[c];r[c]=(...f)=>{let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new to(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=r[c];r[c]=(...f)=>{let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Rn;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=r[c];Rn.passThroughHooks.has(s)?r[c]=f=>{if(this.defaults.async&&Rn.passThroughHooksRespectAsync.has(s))return(async()=>{let k=await u.call(r,f);return d.call(r,k)})();let p=u.call(r,f);return d.call(r,p)}:r[c]=(...f)=>{if(this.defaults.async)return(async()=>{let k=await u.apply(r,f);return k===!1&&(k=await d.apply(r,f)),k})();let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),r&&(u=u.concat(r.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return ft.lex(t,o??this.defaults)}parser(t,o){return mt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let c=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?ft.lex:ft.lexInline)(c,r),d=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(d,r.walkTokens));let f=await(r.hooks?await r.hooks.provideParser(t):t?mt.parse:mt.parseInline)(d,r);return r.hooks?await r.hooks.postprocess(f):f})().catch(s);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?ft.lex:ft.lexInline)(o,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?mt.parse:mt.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
128
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Et(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Kt=new Br;function _e(t,o){return Kt.parse(t,o)}_e.options=_e.setOptions=function(t){return Kt.setOptions(t),_e.defaults=Kt.defaults,pr(_e.defaults),_e},_e.getDefaults=$o,_e.defaults=Gt,_e.use=function(...t){return Kt.use(...t),_e.defaults=Kt.defaults,pr(_e.defaults),_e},_e.walkTokens=function(t,o){return Kt.walkTokens(t,o)},_e.parseInline=Kt.parseInline,_e.Parser=mt,_e.parser=mt.parse,_e.Renderer=Mn,_e.TextRenderer=qo,_e.Lexer=ft,_e.lexer=ft.lex,_e.Tokenizer=to,_e.Hooks=Rn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,mt.parse,ft.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 zr(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 vu(t){if(Array.isArray(t))return t}function Lu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,c,u=[],d=!0,f=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(i=s.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(p){f=!0,r=p}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(f)throw r}}return u}}function Du(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vu(t,o){return vu(t)||Lu(t,o)||$u(t,o)||Du()}function $u(t,o){if(t){if(typeof t=="string")return zr(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)?zr(t,o):void 0}}const Ir=Object.entries,Or=Object.setPrototypeOf,Pu=Object.isFrozen,Fu=Object.getPrototypeOf,Uu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,dt=Object.seal,cn=Object.create,vr=typeof Reflect<"u"&&Reflect,Yo=vr.apply,Xo=vr.construct;Xe||(Xe=function(o){return o}),dt||(dt=function(o){return o}),Yo||(Yo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return o.apply(n,r)}),Xo||(Xo=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const qt=$e(Array.prototype.forEach),Hu=$e(Array.prototype.lastIndexOf),Lr=$e(Array.prototype.pop),dn=$e(Array.prototype.push),Wu=$e(Array.prototype.splice),Ze=Array.isArray,Bn=$e(String.prototype.toLowerCase),Zo=$e(String.prototype.toString),Dr=$e(String.prototype.match),un=$e(String.prototype.replace),Vr=$e(String.prototype.indexOf),Gu=$e(String.prototype.trim),ju=$e(Number.prototype.toString),Ku=$e(Boolean.prototype.toString),$r=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),Pr=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),ve=$e(Object.prototype.hasOwnProperty),zn=$e(Object.prototype.toString),He=$e(RegExp.prototype.test),fn=qu(TypeError);function $e(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Yo(t,o,i)}}function qu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Xo(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bn;if(Or&&Or(t,null),!Ze(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const s=n(r);s!==r&&(Pu(o)||(o[i]=s),r=s)}t[r]=!0}return t}function Yu(t){for(let o=0;o<t.length;o++)ve(t,o)||(t[o]=null);return t}function je(t){const o=cn(null);for(const i of Ir(t)){var n=Vu(i,2);const r=n[0],s=n[1];ve(t,r)&&(Ze(s)?o[r]=Yu(s):s&&typeof s=="object"&&s.constructor===Object?o[r]=je(s):o[r]=s)}return o}function Xu(t){switch(typeof t){case"string":return t;case"number":return ju(t);case"boolean":return Ku(t);case"bigint":return $r?$r(t):"0";case"symbol":return Pr?Pr(t):"Symbol()";case"undefined":return zn(t);case"function":case"object":{if(t===null)return zn(t);const o=t,n=xt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:zn(i)}return zn(t)}default:return zn(t)}}function xt(t,o){for(;t!==null;){const i=Uu(t,o);if(i){if(i.get)return $e(i.get);if(typeof i.value=="function")return $e(i.value)}t=Fu(t)}function n(){return null}return n}function Zu(t){try{return He(t,""),!0}catch{return!1}}const Fr=Xe(["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"]),Jo=Xe(["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"]),Qo=Xe(["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"]),Ju=Xe(["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"]),ei=Xe(["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"]),Qu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ur=Xe(["#text"]),Hr=Xe(["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"]),ti=Xe(["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"]),Wr=Xe(["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"]),no=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ef=dt(/{{[\w\W]*|^[\w\W]*}}/g),tf=dt(/<%[\w\W]*|^[\w\W]*%>/g),nf=dt(/\${[\w\W]*/g),of=dt(/^data-[\-\w.\u00B7-\uFFFF]+$/),rf=dt(/^aria-[\-\w]+$/),Gr=dt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lf=dt(/^(?:\w+script|data):/i),af=dt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sf=dt(/^html$/i),cf=dt(/^[a-z][.\w]*(-[.\w]+)+$/i),wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},df=function(){return typeof window>"u"?null:window},uf=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},jr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:df();const o=X=>Kr(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==wt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,f=t.NamedNodeMap;f===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,k=t.trustedTypes,y=u.prototype,N=xt(y,"cloneNode"),E=xt(y,"remove"),L=xt(y,"nextSibling"),C=xt(y,"childNodes"),x=xt(y,"parentNode"),R=xt(y,"shadowRoot"),S=xt(y,"attributes"),g=c&&c.prototype?xt(c.prototype,"nodeType"):null,_=c&&c.prototype?xt(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let b,O="",W=0;const ne=function(m){if(W>0)throw fn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');W++;try{return b.createHTML(m)}finally{W--}},pe=n,K=pe.implementation,ie=pe.createNodeIterator,F=pe.createDocumentFragment,q=pe.getElementsByTagName,U=i.importNode;let w=jr();o.isSupported=typeof Ir=="function"&&typeof x=="function"&&K&&K.createHTMLDocument!==void 0;const P=ef,V=tf,Y=nf,ae=of,ke=rf,Re=lf,Pe=af,Te=cf;let B=Gr,z=null;const oe=de({},[...Fr,...Jo,...Qo,...ei,...Ur]);let re=null;const D=de({},[...Hr,...ti,...Wr,...no]);let T=Object.seal(cn(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}})),se=null,ce=null;const De=Object.seal(cn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ke=!0,We=!0,mn=!1,Ot=!0,Q=!1,Nt=!0,Me=!1,we=!1,pt=!1,qe=!1,gt=!1,St=!1,H=!0,Z=!1;const le="user-content-";let me=!0,ze=!1,Ue={},Je=null;const vt=de({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let pn=null;const gn=de({},["audio","video","img","source","image","track"]);let In=null;const io=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hn="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let Qe=nt,Ie=!1,be=null;const oi=de({},[hn,Lt,nt],Zo);let et=de({},["mi","mo","mn","ms","mtext"]),ee=de({},["annotation-xml"]);const ro=de({},["title","style","font","a","script"]);let Dt=null;const ii=["application/xhtml+xml","text/html"],lo="text/html";let Oe=null,Vt=null;const bn=n.createElement("form"),ao=function(m){return m instanceof RegExp||m instanceof Function},kn=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Vt&&Vt===m)return;(!m||typeof m!="object")&&(m={}),m=je(m),Dt=ii.indexOf(m.PARSER_MEDIA_TYPE)===-1?lo:m.PARSER_MEDIA_TYPE,Oe=Dt==="application/xhtml+xml"?Zo:Bn,z=ve(m,"ALLOWED_TAGS")&&Ze(m.ALLOWED_TAGS)?de({},m.ALLOWED_TAGS,Oe):oe,re=ve(m,"ALLOWED_ATTR")&&Ze(m.ALLOWED_ATTR)?de({},m.ALLOWED_ATTR,Oe):D,be=ve(m,"ALLOWED_NAMESPACES")&&Ze(m.ALLOWED_NAMESPACES)?de({},m.ALLOWED_NAMESPACES,Zo):oi,In=ve(m,"ADD_URI_SAFE_ATTR")&&Ze(m.ADD_URI_SAFE_ATTR)?de(je(io),m.ADD_URI_SAFE_ATTR,Oe):io,pn=ve(m,"ADD_DATA_URI_TAGS")&&Ze(m.ADD_DATA_URI_TAGS)?de(je(gn),m.ADD_DATA_URI_TAGS,Oe):gn,Je=ve(m,"FORBID_CONTENTS")&&Ze(m.FORBID_CONTENTS)?de({},m.FORBID_CONTENTS,Oe):vt,se=ve(m,"FORBID_TAGS")&&Ze(m.FORBID_TAGS)?de({},m.FORBID_TAGS,Oe):je({}),ce=ve(m,"FORBID_ATTR")&&Ze(m.FORBID_ATTR)?de({},m.FORBID_ATTR,Oe):je({}),Ue=ve(m,"USE_PROFILES")?m.USE_PROFILES&&typeof m.USE_PROFILES=="object"?je(m.USE_PROFILES):m.USE_PROFILES:!1,Ke=m.ALLOW_ARIA_ATTR!==!1,We=m.ALLOW_DATA_ATTR!==!1,mn=m.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=m.SAFE_FOR_TEMPLATES||!1,Nt=m.SAFE_FOR_XML!==!1,Me=m.WHOLE_DOCUMENT||!1,qe=m.RETURN_DOM||!1,gt=m.RETURN_DOM_FRAGMENT||!1,St=m.RETURN_TRUSTED_TYPE||!1,pt=m.FORCE_BODY||!1,H=m.SANITIZE_DOM!==!1,Z=m.SANITIZE_NAMED_PROPS||!1,me=m.KEEP_CONTENT!==!1,ze=m.IN_PLACE||!1,B=Zu(m.ALLOWED_URI_REGEXP)?m.ALLOWED_URI_REGEXP:Gr,Qe=typeof m.NAMESPACE=="string"?m.NAMESPACE:nt,et=ve(m,"MATHML_TEXT_INTEGRATION_POINTS")&&m.MATHML_TEXT_INTEGRATION_POINTS&&typeof m.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(m.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),ee=ve(m,"HTML_INTEGRATION_POINTS")&&m.HTML_INTEGRATION_POINTS&&typeof m.HTML_INTEGRATION_POINTS=="object"?je(m.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const I=ve(m,"CUSTOM_ELEMENT_HANDLING")&&m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING=="object"?je(m.CUSTOM_ELEMENT_HANDLING):cn(null);if(T=cn(null),ve(I,"tagNameCheck")&&ao(I.tagNameCheck)&&(T.tagNameCheck=I.tagNameCheck),ve(I,"attributeNameCheck")&&ao(I.attributeNameCheck)&&(T.attributeNameCheck=I.attributeNameCheck),ve(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),Q&&(We=!1),gt&&(qe=!0),Ue&&(z=de({},Ur),re=cn(null),Ue.html===!0&&(de(z,Fr),de(re,Hr)),Ue.svg===!0&&(de(z,Jo),de(re,ti),de(re,no)),Ue.svgFilters===!0&&(de(z,Qo),de(re,ti),de(re,no)),Ue.mathMl===!0&&(de(z,ei),de(re,Wr),de(re,no))),De.tagCheck=null,De.attributeCheck=null,ve(m,"ADD_TAGS")&&(typeof m.ADD_TAGS=="function"?De.tagCheck=m.ADD_TAGS:Ze(m.ADD_TAGS)&&(z===oe&&(z=je(z)),de(z,m.ADD_TAGS,Oe))),ve(m,"ADD_ATTR")&&(typeof m.ADD_ATTR=="function"?De.attributeCheck=m.ADD_ATTR:Ze(m.ADD_ATTR)&&(re===D&&(re=je(re)),de(re,m.ADD_ATTR,Oe))),ve(m,"ADD_URI_SAFE_ATTR")&&Ze(m.ADD_URI_SAFE_ATTR)&&de(In,m.ADD_URI_SAFE_ATTR,Oe),ve(m,"FORBID_CONTENTS")&&Ze(m.FORBID_CONTENTS)&&(Je===vt&&(Je=je(Je)),de(Je,m.FORBID_CONTENTS,Oe)),ve(m,"ADD_FORBID_CONTENTS")&&Ze(m.ADD_FORBID_CONTENTS)&&(Je===vt&&(Je=je(Je)),de(Je,m.ADD_FORBID_CONTENTS,Oe)),me&&(z["#text"]=!0),Me&&de(z,["html","head","body"]),z.table&&(de(z,["tbody"]),delete se.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw fn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=b;b=m.TRUSTED_TYPES_POLICY;try{O=ne("")}catch(ye){throw b=G,ye}}else b===void 0&&m.TRUSTED_TYPES_POLICY!==null&&(b=uf(k,r)),b&&typeof O=="string"&&(O=ne(""));(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&z===oe&&(z=je(z)),w.uponSanitizeAttribute.length>0&&re===D&&(re=je(re)),Xe&&Xe(m),Vt=m},Tt=de({},[...Jo,...Qo,...Ju]),so=de({},[...ei,...Qu]),ri=function(m){let I=x(m);(!I||!I.tagName)&&(I={namespaceURI:Qe,tagName:"template"});const G=Bn(m.tagName),ye=Bn(I.tagName);return be[m.namespaceURI]?m.namespaceURI===Lt?I.namespaceURI===nt?G==="svg":I.namespaceURI===hn?G==="svg"&&(ye==="annotation-xml"||et[ye]):!!Tt[G]:m.namespaceURI===hn?I.namespaceURI===nt?G==="math":I.namespaceURI===Lt?G==="math"&&ee[ye]:!!so[G]:m.namespaceURI===nt?I.namespaceURI===Lt&&!ee[ye]||I.namespaceURI===hn&&!et[ye]?!1:!so[G]&&(ro[G]||!Tt[G]):!!(Dt==="application/xhtml+xml"&&be[m.namespaceURI]):!1},lt=function(m){dn(o.removed,{element:m});try{x(m).removeChild(m)}catch{E(m)}},At=function(m,I){try{dn(o.removed,{attribute:I.getAttributeNode(m),from:I})}catch{dn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(m),m==="is")if(qe||gt)try{lt(I)}catch{}else try{I.setAttribute(m,"")}catch{}},co=function(m){let I=null,G=null;if(pt)m="<remove></remove>"+m;else{const Ce=Dr(m,/^[\r\n\t ]+/);G=Ce&&Ce[0]}Dt==="application/xhtml+xml"&&Qe===nt&&(m='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+m+"</body></html>");const ye=b?ne(m):m;if(Qe===nt)try{I=new p().parseFromString(ye,Dt)}catch{}if(!I||!I.documentElement){I=K.createDocument(Qe,"template",null);try{I.documentElement.innerHTML=Ie?O:ye}catch{}}const ue=I.body||I.documentElement;return m&&G&&ue.insertBefore(n.createTextNode(G),ue.childNodes[0]||null),Qe===nt?q.call(I,Me?"html":"body")[0]:Me?I.documentElement:ue},uo=function(m){return ie.call(m.ownerDocument||m,m,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},yn=function(m){var I,G;m.normalize();const ye=ie.call(m.ownerDocument||m,m,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let ue=ye.nextNode();for(;ue;){let Be=ue.data;qt([P,V,Y],Ye=>{Be=un(Be,Ye," ")}),ue.data=Be,ue=ye.nextNode()}const Ce=(I=(G=m.querySelectorAll)===null||G===void 0?void 0:G.call(m,"template"))!==null&&I!==void 0?I:[];qt(Array.from(Ce),Be=>{Fe(Be.content)&&yn(Be.content)})},J=function(m){const I=_?_(m):null;return typeof I!="string"||Oe(I)!=="form"?!1:typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||m.attributes!==S(m)||typeof m.removeAttribute!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function"||m.nodeType!==g(m)||m.childNodes!==C(m)},Fe=function(m){if(!g||typeof m!="object"||m===null)return!1;try{return g(m)===wt.documentFragment}catch{return!1}},Yt=function(m){if(!g||typeof m!="object"||m===null)return!1;try{return typeof g(m)=="number"}catch{return!1}};function ot(X,m,I){qt(X,G=>{G.call(o,m,I,Vt)})}const fo=function(m){let I=null;if(ot(w.beforeSanitizeElements,m,null),J(m))return lt(m),!0;const G=Oe(_?_(m):m.nodeName);if(ot(w.uponSanitizeElement,m,{tagName:G,allowedTags:z}),Nt&&m.hasChildNodes()&&!Yt(m.firstElementChild)&&He(/<[/\w!]/g,m.innerHTML)&&He(/<[/\w!]/g,m.textContent)||Nt&&m.namespaceURI===nt&&G==="style"&&Yt(m.firstElementChild)||m.nodeType===wt.progressingInstruction||Nt&&m.nodeType===wt.comment&&He(/<[/\w]/g,m.data))return lt(m),!0;if(se[G]||!(De.tagCheck instanceof Function&&De.tagCheck(G))&&!z[G]){if(!se[G]&&$t(G)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G)))return!1;if(me&&!Je[G]){const ue=x(m),Ce=C(m);if(Ce&&ue){const Be=Ce.length;for(let Ye=Be-1;Ye>=0;--Ye){const at=N(Ce[Ye],!0);ue.insertBefore(at,L(m))}}}return lt(m),!0}return(g?g(m):m.nodeType)===wt.element&&!ri(m)||(G==="noscript"||G==="noembed"||G==="noframes")&&He(/<\/no(script|embed|frames)/i,m.innerHTML)?(lt(m),!0):(Q&&m.nodeType===wt.text&&(I=m.textContent,qt([P,V,Y],ue=>{I=un(I,ue," ")}),m.textContent!==I&&(dn(o.removed,{element:m.cloneNode()}),m.textContent=I)),ot(w.afterSanitizeElements,m,null),!1)},mo=function(m,I,G){if(ce[I]||H&&(I==="id"||I==="name")&&(G in n||G in bn))return!1;const ye=re[I]||De.attributeCheck instanceof Function&&De.attributeCheck(I,m);if(!(We&&!ce[I]&&He(ae,I))){if(!(Ke&&He(ke,I))){if(!ye||ce[I]){if(!($t(m)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,m)||T.tagNameCheck instanceof Function&&T.tagNameCheck(m))&&(T.attributeNameCheck instanceof RegExp&&He(T.attributeNameCheck,I)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(I,m))||I==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G))))return!1}else if(!In[I]){if(!He(B,un(G,Pe,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&m!=="script"&&Vr(G,"data:")===0&&pn[m])){if(!(mn&&!He(Re,un(G,Pe,"")))){if(G)return!1}}}}}}return!0},po=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),$t=function(m){return!po[Bn(m)]&&He(Te,m)},En=function(m){ot(w.beforeSanitizeAttributes,m,null);const I=m.attributes;if(!I||J(m))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0};let ye=I.length;for(;ye--;){const ue=I[ye],Ce=ue.name,Be=ue.namespaceURI,Ye=ue.value,at=Oe(Ce),wn=Ye;let Ve=Ce==="value"?wn:Gu(wn);if(G.attrName=at,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,ot(w.uponSanitizeAttribute,m,G),Ve=G.attrValue,Z&&(at==="id"||at==="name")&&Vr(Ve,le)!==0&&(At(Ce,m),Ve=le+Ve),Nt&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){At(Ce,m);continue}if(at==="attributename"&&Dr(Ve,"href")){At(Ce,m);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){At(Ce,m);continue}if(!Ot&&He(/\/>/i,Ve)){At(Ce,m);continue}Q&&qt([P,V,Y],vn=>{Ve=un(Ve,vn," ")});const On=Oe(m.nodeName);if(!mo(On,at,Ve)){At(Ce,m);continue}if(b&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Be)switch(k.getAttributeType(On,at)){case"TrustedHTML":{Ve=ne(Ve);break}case"TrustedScriptURL":{Ve=b.createScriptURL(Ve);break}}if(Ve!==wn)try{Be?m.setAttributeNS(Be,Ce,Ve):m.setAttribute(Ce,Ve),J(m)?lt(m):Lr(o.removed)}catch{At(Ce,m)}}ot(w.afterSanitizeAttributes,m,null)},xn=function(m){let I=null;const G=uo(m);for(ot(w.beforeSanitizeShadowDOM,m,null);I=G.nextNode();)if(ot(w.uponSanitizeShadowNode,I,null),fo(I),En(I),Fe(I.content)&&xn(I.content),(g?g(I):I.nodeType)===wt.element){const ue=R?R(I):I.shadowRoot;Fe(ue)&&(Pt(ue),xn(ue))}ot(w.afterSanitizeShadowDOM,m,null)},Pt=function(m){const I=g?g(m):m.nodeType;if(I===wt.element){const ue=R?R(m):m.shadowRoot;Fe(ue)&&(Pt(ue),xn(ue))}const G=C?C(m):m.childNodes;if(!G)return;const ye=[];qt(G,ue=>{dn(ye,ue)});for(const ue of ye)Pt(ue);if(I===wt.element){const ue=_?_(m):null;if(typeof ue=="string"&&Oe(ue)==="template"){const Ce=m.content;Fe(Ce)&&Pt(Ce)}}};return o.sanitize=function(X){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,G=null,ye=null,ue=null;if(Ie=!X,Ie&&(X="<!-->"),typeof X!="string"&&!Yt(X)&&(X=Xu(X),typeof X!="string"))throw fn("dirty is not a string, aborting");if(!o.isSupported)return X;if(we||kn(m),o.removed=[],typeof X=="string"&&(ze=!1),ze){const Ye=_?_(X):X.nodeName;if(typeof Ye=="string"){const at=Oe(Ye);if(!z[at]||se[at])throw fn("root node is forbidden and cannot be sanitized in-place")}if(J(X))throw fn("root node is clobbered and cannot be sanitized in-place");Pt(X)}else if(Yt(X))I=co("<!---->"),G=I.ownerDocument.importNode(X,!0),G.nodeType===wt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?I=G:I.appendChild(G),Pt(G);else{if(!qe&&!Q&&!Me&&X.indexOf("<")===-1)return b&&St?ne(X):X;if(I=co(X),!I)return qe?null:St?O:""}I&&pt&&lt(I.firstChild);const Ce=uo(ze?X:I);for(;ye=Ce.nextNode();)fo(ye),En(ye),Fe(ye.content)&&xn(ye.content);if(ze)return Q&&yn(X),X;if(qe){if(Q&&yn(I),gt)for(ue=F.call(I.ownerDocument);I.firstChild;)ue.appendChild(I.firstChild);else ue=I;return(re.shadowroot||re.shadowrootmode)&&(ue=U.call(i,ue,!0)),ue}let Be=Me?I.outerHTML:I.innerHTML;return Me&&z["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&He(sf,I.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
130
+ `+Be),Q&&qt([P,V,Y],Ye=>{Be=un(Be,Ye," ")}),b&&St?ne(Be):Be},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kn(X),we=!0},o.clearConfig=function(){Vt=null,we=!1},o.isValidAttribute=function(X,m,I){Vt||kn({});const G=Oe(X),ye=Oe(m);return mo(G,ye,I)},o.addHook=function(X,m){typeof m=="function"&&dn(w[X],m)},o.removeHook=function(X,m){if(m!==void 0){const I=Hu(w[X],m);return I===-1?void 0:Wu(w[X],I,1)[0]}return Lr(w[X])},o.removeHooks=function(X){w[X]=[]},o.removeAllHooks=function(){w=jr()},o}var ff=Kr();const mf=new Br({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new Mn;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=Io(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),pf=["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"],gf=["href","title","target","rel","src","alt","class","checked","type","disabled"],hf=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function bf(t){if(!t)return"";const o=mf.parse(t,{async:!1});return ff.sanitize(o,{ALLOWED_TAGS:pf,ALLOWED_ATTR:gf,ALLOWED_URI_REGEXP:hf})}const kf={class:"zm-note-panel"},yf={key:0,class:"zm-note-empty"},Ef={class:"zm-note-header"},xf={class:"zm-note-title-row"},wf={class:"zm-note-name"},Nf={class:"zm-note-meta"},Sf={class:"zm-note-scroll"},Tf={class:"zm-note-section"},Cf={class:"zm-note-section-head"},_f={class:"zm-note-split"},Af=["disabled"],Mf={key:0,class:"zm-note-preview"},Rf=["innerHTML"],Bf={key:1,class:"zm-note-preview-hint"},zf={key:0,class:"zm-note-section-actions"},If={key:0,class:"zm-note-add-row"},Of={key:1,class:"zm-note-section"},vf=["disabled"],Lf=["href","title"],Df={key:2,class:"zm-note-section"},Vf=["disabled"],$f=["src","alt"],Pf={key:3,class:"zm-note-section"},Ff={class:"zm-note-section-head"},Uf={key:0,class:"zm-note-section-tag"},Hf=["disabled"],Wf={key:0,class:"zm-note-code"},Gf=["innerHTML"],jf={key:4,class:"zm-note-section"},Kf=["disabled"],qf={key:0,class:"zm-note-table"},Yf=["onClick"],Xf={class:"zm-note-table-sort-mark","aria-hidden":"true"},ni=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,r=e.ref(""),s=e.ref(null);Vo(s,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>bf(r.value)),d=e.ref(!0);function f(){d.value=!d.value}e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:oe.text]},()=>{var B,z;r.value=((z=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const B=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(B){B.focus();const z=B.value.length;B.setSelectionRange(z,z)}});function p(){var oe,re;if(n.readonly)return;const B=r.value,z=((re=(oe=n.selectedNode)==null?void 0:oe.note)==null?void 0:re.text)??"";B!==z&&i("apply",B)}function k(B){var z,oe;n.readonly||(B.key==="Escape"?(B.preventDefault(),r.value=((oe=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:oe.text)??"",B.target.blur()):B.key==="Enter"&&(B.ctrlKey||B.metaKey)&&(B.preventDefault(),p(),B.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const N=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.link)!=null&&z.url)}),E=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.image)!=null&&z.src)}),L=e.computed(()=>{var B,z;return(z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.kind}),C=e.computed(()=>L.value==="code"),x=e.computed(()=>L.value==="table"),R=e.ref(!1),S=e.ref(!1),g=e.ref(!1),_=e.ref(!1);e.watch(()=>{var B;return(B=n.selectedNode)==null?void 0:B.id},()=>{R.value=!1,S.value=!1,g.value=!1,_.value=!1});const b=e.ref("");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:oe.url]},()=>{var B,z;b.value=((z=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:z.url)??""},{immediate:!0});function O(){var oe,re;if(n.readonly)return;const B=b.value.trim(),z=((re=(oe=n.selectedNode)==null?void 0:oe.link)==null?void 0:re.url)??"";B!==z&&i("set-link",B)}const W=e.ref("");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:oe.src]},()=>{var B,z;W.value=((z=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:z.src)??""},{immediate:!0});function ne(){var oe,re;if(n.readonly)return;const B=W.value.trim(),z=((re=(oe=n.selectedNode)==null?void 0:oe.image)==null?void 0:re.src)??"";B!==z&&i("set-image",B)}function pe(B){const z=B.target;z.style.display="none"}function K(B){const z=B.target;z.style.display=""}const ie=e.ref(""),F=e.ref(null);Vo(F,{minRows:4,maxRows:18}),e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:oe.raw]},()=>{var B,z;ie.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??""},{immediate:!0});const q=e.computed(()=>Io(zo(ie.value),on(ie.value)));function U(){var re,D;if(n.readonly)return;const B=ie.value,z=((D=(re=n.selectedNode)==null?void 0:re.richContent)==null?void 0:D.raw)??"";if(B===z)return;const oe=on(B)||void 0;i("set-rich",B?{kind:"code",raw:B,lang:oe}:null)}const w=e.ref(""),P=e.ref(null);Vo(P,{minRows:4,maxRows:14});const V=e.ref(-1),Y=e.ref("asc");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:oe.raw]},()=>{var B,z;w.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??"",V.value=-1,Y.value="asc"},{immediate:!0});function ae(){var oe,re;if(n.readonly)return;const B=w.value,z=((re=(oe=n.selectedNode)==null?void 0:oe.richContent)==null?void 0:re.raw)??"";B!==z&&i("set-rich",B?{kind:"table",raw:B}:null)}const ke=e.computed(()=>dr(w.value)),Re=e.computed(()=>{const B=ke.value;return V.value<0||B.length<=1?B:ur(B,V.value,Y.value)});function Pe(B){V.value!==B?(V.value=B,Y.value="asc"):Y.value==="asc"?Y.value="desc":V.value=-1}const Te=e.computed(()=>{const B=[];return c.value||B.push(`${r.value.length} 字`),N.value&&B.push("1 链接"),E.value&&B.push("1 图片"),C.value&&B.push("代码块"),x.value&&B.push("表格"),B.length===0?"节点没有额外内容":B.join(" · ")});return(B,z)=>{var oe,re,D,T;return e.openBlock(),e.createElementBlock("div",kf,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ef,[e.createElementVNode("div",xf,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",wf,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Nf,e.toDisplayString(Te.value),1)]),e.createElementVNode("div",Sf,[e.createElementVNode("section",Tf,[e.createElementVNode("header",Cf,[z[13]||(z[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),z[14]||(z[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:f},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",_f,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":z[0]||(z[0]=se=>r.value=se),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:k},null,40,Af),[[e.vModelText,r.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Mf,[c.value?(e.openBlock(),e.createElementBlock("div",Bf," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Rf))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",zf,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",If,[!N.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=se=>R.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!E.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=se=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!C.value&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=se=>g.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!_.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=se=>_.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),N.value||R.value?(e.openBlock(),e.createElementBlock("section",Of,[z[15]||(z[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[5]||(z[5]=se=>b.value=se),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(se=>se.target.blur(),["prevent"]),["enter"]))},null,40,vf),[[e.vModelText,b.value]]),N.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(oe=t.selectedNode.link)==null?void 0:oe.url,target:"_blank",rel:"noopener noreferrer",title:(re=t.selectedNode.link)==null?void 0:re.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,Lf)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),E.value||S.value?(e.openBlock(),e.createElementBlock("section",Df,[z[16]||(z[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":z[7]||(z[7]=se=>W.value=se),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(se=>se.target.blur(),["prevent"]),["enter"]))},null,40,Vf),[[e.vModelText,W.value]]),E.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:pe,onLoad:K},null,40,$f)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||g.value?(e.openBlock(),e.createElementBlock("section",Pf,[e.createElementVNode("header",Ff,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(on)(ie.value)?(e.openBlock(),e.createElementBlock("span",Uf,e.toDisplayString(e.unref(on)(ie.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:F,"onUpdate:modelValue":z[9]||(z[9]=se=>ie.value=se),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:U},null,40,Hf),[[e.vModelText,ie.value]]),ie.value.trim()?(e.openBlock(),e.createElementBlock("pre",Wf,[e.createElementVNode("code",{innerHTML:q.value},null,8,Gf)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||_.value?(e.openBlock(),e.createElementBlock("section",jf,[z[18]||(z[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:P,"onUpdate:modelValue":z[10]||(z[10]=se=>w.value=se),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
131
  | --- | --- |
132
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:se},null,40,Hm),[[e.vModelText,N.value]]),ke.value.length?(e.openBlock(),e.createElementBlock("table",Wm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(ce,de)=>(e.openBlock(),e.createElementBlock("tr",{key:de},[de===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ce,(De,Ke)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":D.value===Ke,"is-asc":D.value===Ke&&Y.value==="asc","is-desc":D.value===Ke&&Y.value==="desc"}]),onClick:We=>Pe(Ke)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",jm,e.toDisplayString(D.value===Ke?Y.value==="asc"?"▲":"▼":"↕"),1)],10,Gm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ce,(De,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",gm,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Km={class:"zm-app"},qm={class:"zm-app-main"},Ym={key:0,class:"zm-app-toolbar"},Xm={class:"zm-app-tip"},Zm={class:"zm-app-canvas"},Jm={class:"zm-settings-popover-header"},Gr=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
132
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,Kf),[[e.vModelText,w.value]]),ke.value.length?(e.openBlock(),e.createElementBlock("table",qf,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(se,ce)=>(e.openBlock(),e.createElementBlock("tr",{key:ce},[ce===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se,(De,Ke)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":V.value===Ke,"is-asc":V.value===Ke&&Y.value==="asc","is-desc":V.value===Ke&&Y.value==="desc"}]),onClick:We=>Pe(Ke)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",Xf,e.toDisplayString(V.value===Ke?Y.value==="asc"?"▲":"▼":"↕"),1)],10,Yf))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(se,(De,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",yf,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Zf={class:"zm-app"},Jf={class:"zm-app-main"},Qf={key:0,class:"zm-app-toolbar"},em={class:"zm-app-tip"},tm={class:"zm-app-canvas"},nm={class:"zm-settings-popover-header"},qr=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
133
133
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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 形式携带,
134
134
  渲染在节点标题上方,自动支持语言 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
135
135
  interface Node {
@@ -160,4 +160,4 @@ function walk(n: Node) {
160
160
  | --- | --- | --- | --- | --- |
161
161
  | 1 | 2 | 3 | 4 | 5 |
162
162
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
163
- 鼠标悬浮预览前 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"?r:(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:[]}]},r=(()=>{const V=(de,De)=>({id:de,text:De,children:[]}),T=[V("s_l1","左一"),V("s_l2","左二"),V("s_l3","左三"),V("s_l4","左四"),V("s_l5","左五"),V("s_l6","左六"),V("s_l7","左七")],ce=[V("s_r1","右一"),V("s_r2","右二"),V("s_r3","右三"),V("s_r4","右四"),V("s_r5","右五"),V("s_r6","右六"),V("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...ce]}})(),s=e.ref(o),c=t,u=e.ref(null),d=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),k=e.ref(!1),y=e.ref(!1),w=e.ref(0),E=e.ref(!1),L=e.ref(!1),C=e.ref(null);function x(){s.value=n(),R.value=typeof location<"u"&&location.hash==="#rich"}const R=e.ref(!0);function S(){p.value=!0,k.value=!1,y.value=!1}function g(V){S()}const _=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function b(V){var T;Object.assign(_,V),(T=C.value)==null||T.applySettings(V)}function v(V){var T;u.value&&((T=C.value)==null||T.applyNodeStyle(u.value.id,V))}function H(){var T;const V={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(_,V),(T=C.value)==null||T.applySettings(V)}function oe(V){if(!E.value)return;const T=V.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(E.value=!1)}function q(V){if(V.key==="Escape"){if(E.value){E.value=!1,V.stopPropagation();return}L.value&&(L.value=!1,V.stopPropagation())}}e.onMounted(()=>{var V;document.addEventListener("click",oe),document.addEventListener("keydown",q),window.addEventListener("hashchange",x),(V=C.value)==null||V.applySettings({rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,lineStyle:_.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",q),window.removeEventListener("hashchange",x)});function J(V){s.value=V}function ae(V){var ce;const T=V&&V.length>0?V[0]:null;u.value=T,T?!y.value&&((ce=C.value)!=null&&ce.nodeHasContent(T.id))&&(p.value=!1,k.value=!1,y.value=!0):y.value=!1}e.watch(s,V=>{if(!u.value)return;const T=K(V,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function W(V){if(!u.value||u.value.id!==V){const T=K(s.value,V);T&&(u.value=T)}p.value=!1,k.value=!1,y.value=!0,w.value++}function K(V,T){if(V.id===T)return V;for(const ce of V.children){const de=K(ce,T);if(de)return de}return null}function F(V){var T;u.value&&((T=C.value)==null||T.applyNodeNote(u.value.id,V))}function N(){var V;u.value&&((V=C.value)==null||V.removeNodeNote(u.value.id))}function P(V){var T;u.value&&((T=C.value)==null||T.applyNodeLink(u.value.id,V))}function D(V){var T;u.value&&((T=C.value)==null||T.applyNodeImageByUrl(u.value.id,V))}function Y(V){var T;u.value&&((T=C.value)==null||T.applyNodeRichContent(u.value.id,V))}function se(V){const T=document.querySelector(`[data-node-id="${V.id}"]`);T&&T.click()}function ke(V){const T=new Set(d.value);T.has(V)?T.delete(V):T.add(V),d.value=T}function Re(V){var T;(T=C.value)==null||T.setNodeText(V.id,V.text)}function Pe(V){var T;(T=C.value)==null||T.addChild(V)}function Te(V){var T;(T=C.value)==null||T.addSibling(V)}function B(V){var T;(T=C.value)==null||T.moveNode(V.srcId,V.targetId,V.position)}const z=e.computed(()=>{var V;return((V=u.value)==null?void 0:V.id)??null});function ie(V){return 1+V.children.reduce((T,ce)=>T+ie(ce),0)}const re=e.computed(()=>ie(s.value));return(V,T)=>{var ce;return e.openBlock(),e.createElementBlock("div",Km,[e.createVNode(rn,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=de=>m.value=de)},{default:e.withCtx(()=>[e.createVNode(zo,{data:s.value,"selected-id":z.value,"collapsed-ids":d.value,onSelect:se,onToggleCollapse:ke,onEdit:Re,onAddChild:Pe,onAddSibling:Te,onMove:B},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",qm,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=de=>m.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=de=>{p.value=!0,k.value=!1,y.value=!1})},[...T[19]||(T[19]=[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("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=de=>{k.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[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:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=de=>E.value=!0)},[...T[21]||(T[21]=[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("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",Xm,e.toDisplayString(s.value.text||"未命名")+" · "+e.toDisplayString(re.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":L.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=de=>L.value=!0)},[...T[23]||(T[23]=[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("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),L.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=de=>L.value=!1)},[...T[25]||(T[25]=[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",Zm,[e.createVNode(Yn,{ref_key:"mindMapRef",ref:C,data:s.value,"preview-mode":L.value,onChange:J,onSelect:ae,onEditNote:W,onCanvasSettings:T[7]||(T[7]=de=>E.value=!0),onCanvasData:S,onCanvasImport:g,onCanvasTogglePreview:T[8]||(T[8]=de=>L.value=!L.value),onCanvasOutline:T[9]||(T[9]=de=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(rn,{side:"right",width:360,open:p.value&&!L.value,title:"数据","onUpdate:open":T[11]||(T[11]=de=>p.value=de)},{default:e.withCtx(()=>[e.createVNode(Io,{data:s.value,onImport:T[10]||(T[10]=de=>s.value=de)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(rn,{side:"right",width:420,open:k.value&&!L.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=de=>k.value=de)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,onImport:T[12]||(T[12]=de=>s.value=de)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(rn,{side:"right",width:360,open:y.value&&!L.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=de=>y.value=de)},{default:e.withCtx(()=>[e.createVNode(ei,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:F,onRemove:N,onSetLink:P,onSetImage:D,onSetRich:Y},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=de=>E.value=!1)})):e.createCommentVNode("",!0),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jm,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=de=>E.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",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.createVNode(vo,{settings:_,"has-selection":u.value!==null,"selected-node-text":(ce=u.value)==null?void 0:ce.text,"onUpdate:settings":b,"onUpdate:nodeStyle":v,onReset:H},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),Qm={install(t){t.component("FlowMindMap",Yn),t.component("FlowMindMapOutline",zo),t.component("FlowMindMapDrawer",rn),t.component("FlowMindMapDataPanel",Io),t.component("FlowMindMapMarkdownPanel",Oo),t.component("FlowMindMapSettingsPanel",vo),t.component("FlowMindMapNotePanel",ei),t.component("FlowMindMapApp",Gr)}};Ee.DataPanel=Io,Ee.Drawer=rn,Ee.MarkdownPanel=Oo,Ee.MindMap=Yn,Ee.MindMapApp=Gr,Ee.NotePanel=ei,Ee.Outline=zo,Ee.SettingsPanel=vo,Ee.addChild=ki,Ee.addSibling=yi,Ee.clone=ct,Ee.default=Qm,Ee.findNode=fe,Ee.findParent=ut,Ee.markdownToMindMap=Zt,Ee.markdownToRichMindMap=$l,Ee.mindMapToMarkdown=Jt,Ee.removeNode=Pn,Ee.richBlockToMarkdown=Pl,Ee.uid=kt,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
163
+ 鼠标悬浮预览前 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"?r:(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:[]}]},r=(()=>{const D=(ce,De)=>({id:ce,text:De,children:[]}),T=[D("s_l1","左一"),D("s_l2","左二"),D("s_l3","左三"),D("s_l4","左四"),D("s_l5","左五"),D("s_l6","左六"),D("s_l7","左七")],se=[D("s_r1","右一"),D("s_r2","右二"),D("s_r3","右三"),D("s_r4","右四"),D("s_r5","右五"),D("s_r6","右六"),D("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...se]}})(),s=e.ref(o),c=t,u=e.ref(null),d=e.ref(new Set),f=e.ref(!1),p=e.ref(!1),k=e.ref(!1),y=e.ref(!1),N=e.ref(0),E=e.ref(!1),L=e.ref(!1),C=e.ref(null);function x(){s.value=n(),R.value=typeof location<"u"&&location.hash==="#rich"}const R=e.ref(!0);function S(){p.value=!0,k.value=!1,y.value=!1}function g(D){S()}const _=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function b(D){var T;Object.assign(_,D),(T=C.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=C.value)==null||T.applyNodeStyle(u.value.id,D))}function W(){var T;const D={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(_,D),(T=C.value)==null||T.applySettings(D)}function ne(D){if(!E.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(E.value=!1)}function pe(D){if(D.key==="Escape"){if(E.value){E.value=!1,D.stopPropagation();return}L.value&&(L.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",ne),document.addEventListener("keydown",pe),window.addEventListener("hashchange",x),(D=C.value)==null||D.applySettings({rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,lineStyle:_.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",ne),document.removeEventListener("keydown",pe),window.removeEventListener("hashchange",x)});function K(D){s.value=D}function ie(D){var se;const T=D&&D.length>0?D[0]:null;u.value=T,T?!y.value&&((se=C.value)!=null&&se.nodeHasContent(T.id))&&(p.value=!1,k.value=!1,y.value=!0):y.value=!1}e.watch(s,D=>{if(!u.value)return;const T=q(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function F(D){if(!u.value||u.value.id!==D){const T=q(s.value,D);T&&(u.value=T)}p.value=!1,k.value=!1,y.value=!0,N.value++}function q(D,T){if(D.id===T)return D;for(const se of D.children){const ce=q(se,T);if(ce)return ce}return null}function U(D){var T;u.value&&((T=C.value)==null||T.applyNodeNote(u.value.id,D))}function w(){var D;u.value&&((D=C.value)==null||D.removeNodeNote(u.value.id))}function P(D){var T;u.value&&((T=C.value)==null||T.applyNodeLink(u.value.id,D))}function V(D){var T;u.value&&((T=C.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function Y(D){var T;u.value&&((T=C.value)==null||T.applyNodeRichContent(u.value.id,D))}function ae(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ke(D){const T=new Set(d.value);T.has(D)?T.delete(D):T.add(D),d.value=T}function Re(D){var T;(T=C.value)==null||T.setNodeText(D.id,D.text)}function Pe(D){var T;(T=C.value)==null||T.addChild(D)}function Te(D){var T;(T=C.value)==null||T.addSibling(D)}function B(D){var T;(T=C.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const z=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function oe(D){return 1+D.children.reduce((T,se)=>T+oe(se),0)}const re=e.computed(()=>oe(s.value));return(D,T)=>{var se;return e.openBlock(),e.createElementBlock("div",Zf,[e.createVNode(ln,{side:"left",width:300,open:f.value,title:"大纲","onUpdate:open":T[0]||(T[0]=ce=>f.value=ce)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,"selected-id":z.value,"collapsed-ids":d.value,onSelect:ae,onToggleCollapse:ke,onEdit:Re,onAddChild:Pe,onAddSibling:Te,onMove:B},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Jf,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qf,[c.showOutlineBtn&&!f.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=ce=>f.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=ce=>{p.value=!0,k.value=!1,y.value=!1})},[...T[19]||(T[19]=[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("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=ce=>{k.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[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:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=ce=>E.value=!0)},[...T[21]||(T[21]=[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("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",em,e.toDisplayString(s.value.text||"未命名")+" · "+e.toDisplayString(re.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":L.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=ce=>L.value=!0)},[...T[23]||(T[23]=[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("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),L.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=ce=>L.value=!1)},[...T[25]||(T[25]=[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",tm,[e.createVNode(Xn,{ref_key:"mindMapRef",ref:C,data:s.value,"preview-mode":L.value,onChange:K,onSelect:ie,onEditNote:F,onCanvasSettings:T[7]||(T[7]=ce=>E.value=!0),onCanvasData:S,onCanvasImport:g,onCanvasTogglePreview:T[8]||(T[8]=ce=>L.value=!L.value),onCanvasOutline:T[9]||(T[9]=ce=>f.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(ln,{side:"right",width:360,open:p.value&&!L.value,title:"数据","onUpdate:open":T[11]||(T[11]=ce=>p.value=ce)},{default:e.withCtx(()=>[e.createVNode(vo,{data:s.value,onImport:T[10]||(T[10]=ce=>s.value=ce)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:420,open:k.value&&!L.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=ce=>k.value=ce)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:s.value,onImport:T[12]||(T[12]=ce=>s.value=ce)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:360,open:y.value&&!L.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=ce=>y.value=ce)},{default:e.withCtx(()=>[e.createVNode(ni,{"selected-node":u.value,readonly:!1,"focus-tick":N.value,onApply:U,onRemove:w,onSetLink:P,onSetImage:V,onSetRich:Y},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=ce=>E.value=!1)})):e.createCommentVNode("",!0),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nm,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=ce=>E.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",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.createVNode(Do,{settings:_,"has-selection":u.value!==null,"selected-node-text":(se=u.value)==null?void 0:se.text,"onUpdate:settings":b,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),om={install(t){t.component("FlowMindMap",Xn),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",ln),t.component("FlowMindMapDataPanel",vo),t.component("FlowMindMapMarkdownPanel",Lo),t.component("FlowMindMapSettingsPanel",Do),t.component("FlowMindMapNotePanel",ni),t.component("FlowMindMapApp",qr)}};Ee.DataPanel=vo,Ee.Drawer=ln,Ee.MarkdownPanel=Lo,Ee.MindMap=Xn,Ee.MindMapApp=qr,Ee.NotePanel=ni,Ee.Outline=Oo,Ee.SettingsPanel=Do,Ee.addChild=Ei,Ee.addSibling=xi,Ee.clone=ct,Ee.default=om,Ee.findNode=fe,Ee.findParent=ut,Ee.markdownToMindMap=Jt,Ee.markdownToRichMindMap=Ul,Ee.mindMapToMarkdown=Qt,Ee.removeNode=Fn,Ee.richBlockToMarkdown=Hl,Ee.uid=yt,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});