flow-mindmap 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,29 @@
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||"")+`
1
+ (function(be,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(be=typeof globalThis<"u"?globalThis:be||self,e(be.FlowMind={},be.Vue))})(this,function(be,e){"use strict";var Fp=Object.defineProperty;var Up=(be,e,Ln)=>e in be?Fp(be,e,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):be[e]=Ln;var Re=(be,e,Ln)=>Up(be,typeof e!="symbol"?e+"":e,Ln);var Yo;const Ln=["width","height","stroke-width"],Jl={key:4,points:"6 9 12 15 18 9"},Ql={key:5,points:"9 6 15 12 9 18"},ke=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",Jl)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ql)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ln))}}),qr="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",Xr="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",Zr=[18,15,13,12],ea=[700,600,500,400],ta=[52,40,32,28],na=[120,80,60,44],oa=[.8,.8,.8,.8],ra=Zr.length-1;function ia(t,o){return Math.round(or(t,o)*oa[Co(t)])}function Co(t){return Math.min(ra,Math.max(0,t))}function or(t,o=14){return Math.round(Zr[Co(t)]*o/14*10)/10}function la(t,o=14){return Math.round(ta[Co(t)]*o/14)}const Ao=60,Dn=14,Tt=24;let rr=null;function aa(){if(rr)return rr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(rr=t,t):{font:"",measureText:()=>({width:0})}}const Jr=new Map;function sa(t,o,n){const r=`${n}|${o}|${t}`,i=Jr.get(r);if(i!==void 0)return i;const s=aa();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return Jr.set(r,c),c}const ca=24,da=400,ua=8,Qr=16,ei=4,fa=200;function ma(t,o,n){return Math.min(n,Math.max(o,t))}function pa(t,o,n,r,i){const s=Co(o),c=or(o,n),u=Math.min(sa(t.text||"",c,ea[s]),fa),d=ia(o,n),g=Math.ceil(u+d*2),w=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:la(o,n);let N=0;if(t.link&&(N+=Qr),t.note&&(N+=Qr),N>0){const Y=(t.link?1:0)+(t.note?1:0);N+=ei*Y}const V=14,_=2;let $=0;t.markers&&t.markers.length>0&&($=t.markers.length*V+(t.markers.length-1)*_+ei);const B=18,T=4,E=t.tags&&t.tags.length>0?B:0,k=g+N+$,m=(()=>{const Y=Math.round(na[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ee=i==null?void 0:i[t.id];return Math.max(Y,ee??240)}return Y})(),v=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],j=v?Math.max(24,x??Math.max(70,Math.ceil(c*5))):0,K=j>0?10:0;if(!t.image){const Y=Math.max(m,k),ee=Math.ceil(w+K+j+(E>0?T+E:0));return{w:Y,h:ee}}const ne=ma(t.image.width,ca,da),ce=Math.max(m,k,Math.ceil(ne+d*2)),re=Math.ceil(t.image.height+ua+w+K+j+(E>0?T+E:0));return{w:ce,h:re}}function ga(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,i=o.baseFontSize??14,s=ni(t,0,null,1,"right",i,o.richHeights,o.richWidths);return ba(s),ha(s,n,r),s.x=0,s.y=0,ka(s,r)}function ha(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,N)=>w+N._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),b=0;for(let w=0;w<r.length-1;w++){b+=r[w]._subtreeH;const N=Math.abs(b-(u-b));N<g&&(g=N,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const i=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const b of u.children)c(b,d)};for(const u of i)c(u,"right");for(const u of s)c(u,"left");if(i.length>0){const u={...t,children:i};_o(u,"right",Ao,!0,n)}if(s.length>0){const u={...t,children:s};_o(u,"left",Ao,!0,n)}}else if(o==="tree"){const r=i=>{i.side=1,i._dir="right";for(const s of i.children)r(s)};for(const i of t.children)i._dir="right";_o(t,"right",Ao,!0,n),r(t)}else{for(const r of t.children)r._dir="down";ti(t,Ao,n)}}function _o(t,o,n,r,i=!1){if(t.children.length===0)return;const s=t.children.reduce((g,b,w)=>g+b._subtreeH+(w>0?Dn:0),0),c=o==="right"?1:-1,u=r?c:1;let d=t.y-u*s/2;t.children.forEach(g=>{i||(g.x=t.x+c*(t.width/2+n+g.width/2),g.y=d+u*g._subtreeH/2),g._dir=o,d+=u*(g._subtreeH+Dn),_o(g,o,n,!1,i)})}function ti(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Dn*2:0),0);let i=t.x-r/2;t.children.forEach(s=>{n||(s.x=i+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",i+=s._subtreeW+Dn*2,ti(s,o,n)})}function ni(t,o,n,r,i,s,c,u){const d=pa(t,o,s,c,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:or(o,s),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:i,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const b=t.children.length,w=Math.ceil(b/2);return g.children=t.children.map((N,V)=>{const _=o===0?V<w?1:-1:r;return ni(N,o+1,g,_,i,s,c,u)}),g}function ba(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const i of r.children)o.push(i)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let i=0,s=0;for(const c of r.children)i+=c._subtreeH,s+=c._subtreeW;r.children.length>1&&(i+=Dn*(r.children.length-1),s+=Dn*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,i),r._subtreeW=Math.max(r.width,s)}}function ka(t,o=!1){const n=[t];let r=1/0,i=-1/0,s=1/0,c=-1/0;for(;n.length;){const g=n.pop(),b=g.width/2,w=g.height/2;g.x-b<r&&(r=g.x-b),g.x+b>i&&(i=g.x+b),g.y-w<s&&(s=g.y-w),g.y+w>c&&(c=g.y+w),n.push(...g.children)}if(o)return{root:t,width:i-r+Tt*2,height:c-s+Tt*2,vbX:r-Tt,vbY:s-Tt,vbW:i-r+Tt*2,vbH:c-s+Tt*2};const u=Tt-s,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return s+=u,c+=u,{root:t,width:i-r+Tt*2,height:c+Tt,vbX:r-Tt,vbY:0,vbW:i-r+Tt*2,vbH:c+Tt}}const Jt=[{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 ya(t,o=[]){return[...Jt,...o].find(r=>r.id===t)??Jt[0]}function Ea(t,o=8){const n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=i.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=xa(c):c.startsWith("rgb")?u=wa(c):u=Na[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function xa(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const r=[];for(let i=0;i<3;i++){const s=n[i];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;r.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;r.push(c)}}return"#"+r.map(i=>i.toString(16).padStart(2,"0")).join("").toLowerCase()}const Na={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 Ft(){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 le(t,o){if(t.id===o)return t;for(const n of t.children){const r=le(n,o);if(r)return r}return null}function Bt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const i=Bt(r,o,t);if(i!==null)return i}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Sa(t,o,n){const r=le(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Ta(t,o,n,r){if(!Bt(t,o)||o===n||le(le(t,o),n))return!1;const i=Bt(t,o),s=i.children.findIndex(g=>g.id===o);if(s<0)return!1;const[c]=i.children.splice(s,1);if(r==="child"){const g=le(t,n);return g?(g.children.push(c),!0):(i.children.splice(s,0,c),!1)}const u=Bt(t,n);if(!u)return i.children.splice(s,0,c),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(i.children.splice(s,0,c),!1):(r==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function oi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const i of t.children){const s=i.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else r=!0}return n===0&&!r?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function ri(t,o,n){const r=le(t,o);if(!r)return null;const i={id:Ft(),text:n??oi(r),children:[]};return r.children.push(i),i}function ii(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n??oi(r),children:[]};return r.children.splice(i+1,0,s),s}function Ca(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n,children:[]};return r.children.splice(i,0,s),s}function Aa(t,o){const n=Bt(t,o);if(!n)return null;const r=n.children.findIndex(c=>c.id===o);if(r<0)return null;const i=n.children[r],s=Ct(i);return Ro(s),n.children.splice(r+1,0,s),s}function Ro(t){t.id=Ft();for(const o of t.children)Ro(o)}function li(t,o){const n=le(t,o);if(!n||n.id===t.id)return null;const r=Ct(n);return Ro(r),r}const vo="新节点";function Vn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Ft(),text:o,children:[]},i=[r],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,N=[],V=null;function _(T){N.push(T)}function $(){if(V&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const T=N.join(`
2
+ `);T&&(V.note={text:T})}w=!1,N=[]}for(const T of n){if(w){const x=T.match(b);if(x&&x[1][0]==="`"){$();continue}_(T);continue}const E=T.match(u);if(E){const x=E[1].length,j=E[2].trim();c.push({level:x,text:j,body:""}),V=c[c.length-1];continue}const k=T.match(b);if(k&&k[2]==="note"){w=!0,N=[];continue}const m=T.match(d);if(m&&V){const x=m[2],j=160,K=120;V.image={src:x,naturalW:j,naturalH:K,width:j,height:K};continue}const v=T.match(g);if(v&&V){V.link={url:v[2]},V.text=v[1];continue}if(T.trim().length>0&&V){const x=T.trim();V.body=V.body?V.body+`
3
+ `+x:x}}w&&$();function B(T){for(;i.length>1;){const v=i.length-1,x=s[v];if(x!==void 0&&x<T.level)break;i.pop(),s.pop()}const E=i[i.length-1],k=T.text,m={id:Ft(),text:k,children:[]};T.image&&(m.image={...T.image}),T.link&&(m.link={url:T.link.url}),T.note&&(m.note={text:T.note.text}),T.body&&(m.note={text:T.body}),E.children.push(m),i.push(m),s.push(T.level)}for(const T of c)B(T);if(c.length>0&&c[0].level===1){const T=r.children[0];T&&(r.text=T.text,r.id=T.id,T.image&&(r.image={...T.image}),T.link&&(r.link={url:T.link.url}),T.note&&(r.note={text:T.note.text}),r.children=T.children)}return r}function $n(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+=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
- `)}),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 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(`
7
+ `);for(const r of t.children)n+=$n(r,o+1);return n}function _a(t){var g,b;const o=t.split(/\r?\n/),n=[];let r=0;const i=/^(#{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(;r<o.length;){const w=o[r],N=w.match(s);if(N){const k=N[1][0],m=N[2]||"",v=[w];for(r++;r<o.length;){const j=o[r].match(s);if(j&&j[1][0]===k){v.push(o[r]),r++;break}v.push(o[r]),r++}const x=v.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((g=x.split(`
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:v.join(`
10
+ `),lang:m});continue}const V=w.match(i);if(V){n.push({kind:"heading",level:V[1].length,text:V[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let m=r,v=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),c.test(o[m])&&(v=!0),m++;if(v&&k.length>=2){n.push({kind:"table",text:((b=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:k.join(`
11
+ `)}),r=m;continue}}const _=w.match(u),$=w.match(d);if(_||$){let k=r;for(;k<o.length;){const m=o[k].match(u),v=o[k].match(d);if(!(m||v))break;const x=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();x.length>0&&n.push({kind:"list",text:x.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const B=[w];let T=r+1;for(;T<o.length;){const k=o[T];if(k.trim()===""||i.test(k)||s.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;B.push(k),T++}const E=B.join(" ").trim();n.push({kind:"paragraph",text:E.slice(0,80)||"(空段落)",raw:B.join(`
12
+ `)}),r=T}return n}function Ma(t,o="导入的导图"){const n=_a(t||""),r={id:Ft(),text:o,children:[]},i=[r],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;i.length>1&&s[s.length-1]>=b;)i.pop(),s.pop();if(!c&&b===1){c=!0,r.text=d.text,s[0]=1;return}const w={id:Ft(),text:d.text,children:[]};i[i.length-1].children.push(w),i.push(w),s.push(b);return}const g={id:Ft(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};i[i.length-1].children.push(g)}for(const d of n)u(d);return r}function Ra(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function va(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,i=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),w=e.reactive({x:0,y:0}),N=e.reactive({x:0,y:0,width:0,height:0}),V=e.ref(0);let _=null;function $(Y){_=Y}function B(Y){Y.preventDefault();const ee=t.getContainer();if(!ee)return;const ie=-Y.deltaY*.001,z=Math.min(n,Math.max(o,i.value*(1+ie))),C=ee.getBoundingClientRect(),F=Y.clientX-C.left,P=Y.clientY-C.top,W=(F-s.value)/i.value,ae=(P-c.value)/i.value;i.value=z,s.value=F-W*z,c.value=P-ae*z}function T(){i.value=Math.min(n,i.value*r)}function E(){i.value=Math.max(o,i.value/r)}function k(Y){var ie;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Y.clientX,g.y=Y.clientY,g.ox=s.value,g.oy=c.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",v),(ie=Y.preventDefault)==null||ie.call(Y))}function m(Y){if(!u.value)return;const ee=Y.clientX-g.x,ie=Y.clientY-g.y;(Math.abs(ee)>3||Math.abs(ie)>3)&&(d.value=!0),s.value=g.ox+ee,c.value=g.oy+ie}function v(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",v)}function x(Y,ee,ie){b.value=!0,w.x=Y,w.y=ee,N.x=Y,N.y=ee,N.width=0,N.height=0,N.shiftKey=!!(ie!=null&&ie.shift),V.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",K)}function j(Y,ee){if(!b.value)return;const ie=Math.min(w.x,Y),z=Math.min(w.y,ee),C=Math.max(w.x,Y),F=Math.max(w.y,ee);N.x=ie,N.y=z,N.width=C-ie,N.height=F-z,V.value++}function K(){b.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",K),_&&_()}function ne(Y){if(!b.value)return;const ee=t.getContainer();if(!ee)return;const ie=ee.getBoundingClientRect(),z=(Y.clientX-ie.left-s.value)/i.value,C=(Y.clientY-ie.top-c.value)/i.value;j(z,C)}function ce(Y,ee,ie,z=60){const C=t.getContainer();if(!C)return;const F=C.getBoundingClientRect(),P=(F.width-z*2)/Y,W=(F.height-z*2)/ee,ae=Math.min(1,Math.max(.3,Math.min(P,W)));i.value=ae,s.value=F.width/2,c.value=F.height/2-ie*ae}function re(Y,ee,ie,z,C=80){const F=t.getContainer();if(!F)return;const P=F.getBoundingClientRect();let W=i.value;(ie*W<40||z*W<40)&&(W=Math.min(n,Math.max(1,60/Math.min(ie,z)))),i.value=W,s.value=P.width/2-Y*W,c.value=P.height/2-ee*W}return{scale:i,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:B,zoomIn:T,zoomOut:E,startPan:k,startMarquee:x,updateMarquee:j,isMarquee:b,marquee:N,marqueeVersion:V,setOnMarqueeEnd:$,resetView:ce,centerOn:re}}const Ba=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ai(t){return Ba?t.metaKey:t.ctrlKey}function za(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const i=t.getSelectedIds();return i.length>0?i[0]:null}function n(r){var u,d,g;const i=r.target;if(i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(ai(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==b&&(r.preventDefault(),t.onDuplicate(s));return}if(r.key==="c"||r.key==="C"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCopy(b));return}if(r.key==="x"||r.key==="X"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCut(b));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const b=t.getSelectedIds();t.onPaste(b.length>0?b[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(ai(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(c);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==b&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(r.key==="Delete"||r.key==="Backspace")&&s&&s!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(s)):r.key==="F2"&&s?(r.preventDefault(),t.onStartEdit(s)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ia(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function i(){return n<o.value.length-1}function s(g){const b=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(b),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return i()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:i,record:s,undo:c,redo:u,reset:d}}const Oa={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},La={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Oa[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function Da(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),r=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const Va={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:Da(t)}))},$a={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ir=[La,Va,$a,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Bo={};for(const t of ir)for(const o of t.markers)Bo[o.id]=o;function Pa(t){return Bo[t]}function zo(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function si(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function lr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const Fa={key:5,class:"zm-marker-picker"},Ua={class:"zm-marker-group-label"},Ha={class:"zm-marker-grid"},Wa=["title","onClick","innerHTML"],Ga=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let E=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),v=180,j=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;E+v>m.right&&(E=Math.max(m.left+4,n.x-v-2)),k+j>m.bottom&&(k=Math.max(m.top+4,n.y-j-2)),E<m.left+2&&(E=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:E,top:k}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function w(){b.value=!b.value}function N(E){return n.nodeMarkers.includes(E)}function V(E){r("toggleMarker",E)}function _(E){const k=E.target;k&&k.closest(".zm-node-menu")||r("close")}function $(E){E.key==="Escape"&&r("close")}function B(){r("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",$,!0),window.addEventListener("wheel",B,!0),window.addEventListener("scroll",B,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",$,!0),window.removeEventListener("wheel",B,!0),window.removeEventListener("scroll",B,!0)});function T(E){E(),r("close")}return(E,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>T(()=>r("pickImage")),["stop"]))},[e.createVNode(ke,{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:k[1]||(k[1]=e.withModifiers(m=>T(()=>r("removeImage")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>T(()=>r("setLink")),["stop"]))},[e.createVNode(ke,{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:k[3]||(k[3]=e.withModifiers(m=>T(()=>r("removeLink")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>T(()=>r("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>T(()=>r("removeCode")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>T(()=>r("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>T(()=>r("removeTable")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>T(()=>r("editNote")),["stop"]))},[e.createVNode(ke,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>T(()=>r("removeNote")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":b.value}])},"›",2)]),b.value?(e.openBlock(),e.createElementBlock("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ir),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",Ua,e.toDisplayString(m.label),1),e.createElementVNode("div",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,v=>(e.openBlock(),e.createElementBlock("button",{key:v.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":N(v.id)}]),title:v.label,onClick:e.withModifiers(x=>V(v.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(v.id)+"</svg>"},null,10,Wa))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>T(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>T(()=>r("removeTags")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ja=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let T=n.x+2,E=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,v=4+4*28+5;T+m>k.right&&(T=Math.max(k.left+4,n.x-m-2)),E+v>k.bottom&&(E=Math.max(k.top+4,n.y-v-2)),T<k.left+2&&(T=k.left+2),E<k.top+2&&(E=k.top+2)}return{left:T,top:E}}),s=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.computed(()=>{const T=s.value==="import"?c.value:s.value==="export"?u.value:null;if(!T)return{left:"-9999px",top:"-9999px",display:"none"};const E=T.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,v=176,x=4+3*28;let j=E.right;j+v>k-4&&(j=Math.max(4,E.left-v));let K=E.top-4;return K+x>m-4&&(K=Math.max(4,m-x-4)),{left:j+"px",top:K+"px",display:"block"}});let g=null,b=null;function w(T){b&&(clearTimeout(b),b=null),g=setTimeout(()=>{s.value=T},60)}function N(){g&&(clearTimeout(g),g=null),b=setTimeout(()=>{s.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),b&&clearTimeout(b)});function V(T){const E=T.target;E&&E.closest(".zm-canvas-menu")||r("close")}function _(T){T.key==="Escape"&&r("close")}function $(){r("close")}window.addEventListener("mousedown",V,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",$,!0),window.addEventListener("scroll",$,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",V,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",$,!0),window.removeEventListener("scroll",$,!0)});function B(T){T(),r("close")}return(T,E)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:E[11]||(E[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[0]||(E[0]=e.withModifiers(k=>B(()=>r("openData")),["stop"]))},[e.createVNode(ke,{name:"database",size:13,stroke:1.6}),E[12]||(E[12]=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==="import"}]),onMouseenter:E[5]||(E[5]=k=>w("import")),onMouseleave:N},[e.createVNode(ke,{name:"import",size:13,stroke:1.6}),E[16]||(E[16]=e.createElementVNode("span",null,"导入",-1)),E[17]||(E[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[4]||(E[4]=k=>w("import")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[1]||(E[1]=e.withModifiers(k=>B(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(ke,{name:"markdown",size:13,stroke:1.6}),E[13]||(E[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[2]||(E[2]=e.withModifiers(k=>B(()=>r("openImport","json")),["stop"]))},[e.createVNode(ke,{name:"json",size:13,stroke:1.6}),E[14]||(E[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[3]||(E[3]=e.withModifiers(k=>B(()=>r("openImport","txt")),["stop"]))},[e.createVNode(ke,{name:"txt",size:13,stroke:1.6}),E[15]||(E[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[6]||(E[6]=e.withModifiers(k=>B(()=>r("openSettings")),["stop"]))},[e.createVNode(ke,{name:"settings",size:13,stroke:1.6}),E[18]||(E[18]=e.createElementVNode("span",null,"设置",-1))]),E[23]||(E[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="export"}]),onMouseenter:E[10]||(E[10]=k=>w("export")),onMouseleave:N},[e.createVNode(ke,{name:"export",size:13,stroke:1.6}),E[21]||(E[21]=e.createElementVNode("span",null,"导出",-1)),E[22]||(E[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[9]||(E[9]=k=>w("export")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[7]||(E[7]=e.withModifiers(k=>B(()=>r("exportPng")),["stop"]))},[e.createVNode(ke,{name:"image",size:13,stroke:1.6}),E[19]||(E[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[8]||(E[8]=e.withModifiers(k=>B(()=>r("exportSvg")),["stop"]))},[e.createVNode(ke,{name:"svg-export",size:13,stroke:1.6}),E[20]||(E[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}});function Ka(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ci(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&ci(n)}),t}class di{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ui(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function un(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const Ya="</span>",fi=t=>!!t.scope,qa=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${o}${t}`};class Xa{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ui(o)}openNode(o){if(!fi(o))return;const n=qa(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){fi(o)&&(this.buffer+=Ya)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const mi=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ar{constructor(){this.rootNode=mi(),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=mi({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(r=>this._walk(o,r)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{ar._collapse(n)}))}}class Za extends ar{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Xa(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function oo(t){return t?typeof t=="string"?t:t.source:null}function pi(t){return Nn("(?=",t,")")}function Ja(t){return Nn("(?:",t,")*")}function Qa(t){return Nn("(?:",t,")?")}function Nn(...t){return t.map(n=>oo(n)).join("")}function es(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function sr(...t){return"("+(es(t).capture?"":"?:")+t.map(r=>oo(r)).join("|")+")"}function gi(t){return new RegExp(t.toString()+"|").exec("").length-1}function ts(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ns=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const i=n;let s=oo(r),c="";for(;s.length>0;){const u=ns.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])+i):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(o)}const os=/\b\B/,hi="[a-zA-Z]\\w*",dr="[a-zA-Z_]\\w*",bi="\\b\\d+(\\.\\d+)?",ki="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yi="\\b(0b[01]+)",rs="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",is=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Nn(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ro={begin:"\\\\[\\s\\S]",relevance:0},ls={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ro]},as={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ro]},ss={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/},Io=function(t,o,n={}){const r=un({scope:"comment",begin:t,end:o,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=sr("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Nn(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},cs=Io("//","$"),ds=Io("/\\*","\\*/"),us=Io("#","$"),fs={scope:"number",begin:bi,relevance:0},ms={scope:"number",begin:ki,relevance:0},ps={scope:"number",begin:yi,relevance:0},gs={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ro,{begin:/\[/,end:/\]/,relevance:0,contains:[ro]}]},hs={scope:"title",begin:hi,relevance:0},bs={scope:"title",begin:dr,relevance:0},ks={begin:"\\.\\s*"+dr,relevance:0};var Oo=Object.freeze({__proto__:null,APOS_STRING_MODE:ls,BACKSLASH_ESCAPE:ro,BINARY_NUMBER_MODE:ps,BINARY_NUMBER_RE:yi,COMMENT:Io,C_BLOCK_COMMENT_MODE:ds,C_LINE_COMMENT_MODE:cs,C_NUMBER_MODE:ms,C_NUMBER_RE:ki,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:us,IDENT_RE:hi,MATCH_NOTHING_RE:os,METHOD_GUARD:ks,NUMBER_MODE:fs,NUMBER_RE:bi,PHRASAL_WORDS_MODE:ss,QUOTE_STRING_MODE:as,REGEXP_MODE:gs,RE_STARTERS_RE:rs,SHEBANG:is,TITLE_MODE:hs,UNDERSCORE_IDENT_RE:dr,UNDERSCORE_TITLE_MODE:bs});function ys(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Es(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xs(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ys,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ws(t,o){Array.isArray(t.illegal)&&(t.illegal=sr(...t.illegal))}function Ns(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 Ss(t,o){t.relevance===void 0&&(t.relevance=1)}const Ts=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Nn(n.beforeMatch,pi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Cs=["of","and","for","in","not","or","if","then","parent","list","value"],As="keyword";function Ei(t,o,n=As){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,Ei(t[s],o,s))}),r;function i(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[s,_s(d[0],d[1])]})}}function _s(t,o){return o?Number(o):Ms(t)?0:1}function Ms(t){return Cs.includes(t.toLowerCase())}const xi={},Sn=t=>{console.error(t)},wi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Pn=(t,o)=>{xi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),xi[`${t}/${o}`]=!0)},Lo=new Error;function Ni(t,o,{key:n}){let r=0;const i=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+r]=i[u],s[u+r]=!0,r+=gi(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Rs(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Sn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Lo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Sn("beginScope must be object"),Lo;Ni(t,t.begin,{key:"beginScope"}),t.begin=cr(t.begin,{joinWith:""})}}function vs(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Sn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Lo;if(typeof t.endScope!="object"||t.endScope===null)throw Sn("endScope must be object"),Lo;Ni(t,t.end,{key:"endScope"}),t.end=cr(t.end,{joinWith:""})}}function Bs(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function zs(t){Bs(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Rs(t),vs(t)}function Is(t){function o(c,u){return new RegExp(oo(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+=gi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(cr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,N)=>N>0&&w!==void 0),b=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,b])=>d.addRule(g,b)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,g=b.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function i(c){const u=new r;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;[Es,Ns,zs,Ts].forEach(b=>b(c,u)),t.compilerExtensions.forEach(b=>b(c,u)),c.__beforeBegin=null,[xs,ws,Ss].forEach(b=>b(c,u)),c.isCompiled=!0;let g=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),g=c.keywords.$pattern,delete c.keywords.$pattern),g=g||/\w+/,c.keywords&&(c.keywords=Ei(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!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=oo(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(b){return Os(b==="self"?c:b)})),c.contains.forEach(function(b){s(b,d)}),c.starts&&s(c.starts,u),d.matcher=i(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=un(t.classNameAliases||{}),s(t)}function Si(t){return t?t.endsWithParent||Si(t.starts):!1}function Os(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Si(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var Ls="11.11.1";class Ds extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const ur=ui,Ti=un,Ci=Symbol("nomatch"),Vs=7,Ai=function(t){const o=Object.create(null),n=Object.create(null),r=[];let i=!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:Za};function d(C){return u.noHighlightRe.test(C)}function g(C){let F=C.className+" ";F+=C.parentNode?C.parentNode.className:"";const P=u.languageDetectRe.exec(F);if(P){const W=K(P[1]);return W||(wi(s.replace("{}",P[1])),wi("Falling back to no-highlight mode for this block.",C)),W?P[1]:"no-highlight"}return F.split(/\s+/).find(W=>d(W)||K(W))}function b(C,F,P){let W="",ae="";typeof F=="object"?(W=C,P=F.ignoreIllegals,ae=F.language):(Pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pn("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),ae=C,W=F),P===void 0&&(P=!0);const we={code:W,language:ae};ie("before:highlight",we);const ve=we.result?we.result:w(we.language,we.code,P);return ve.code=we.code,ie("after:highlight",ve),ve}function w(C,F,P,W){const ae=Object.create(null);function we(U,Z){return U.keywords[Z]}function ve(){if(!te.keywords){Be.addText(Te);return}let U=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(Te),se="";for(;Z;){se+=Te.substring(U,Z.index);const ye=Ke.case_insensitive?Z[0].toLowerCase():Z[0],Me=we(te,ye);if(Me){const[Qe,pt]=Me;if(Be.addText(se),se="",ae[ye]=(ae[ye]||0)+1,ae[ye]<=Vs&&(Ot+=pt),Qe.startsWith("_"))se+=Z[0];else{const gn=Ke.classNameAliases[Qe]||Qe;y(Z[0],gn)}}else se+=Z[0];U=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(Te)}se+=Te.substring(U),Be.addText(se)}function ze(){if(Te==="")return;let U=null;if(typeof te.subLanguage=="string"){if(!o[te.subLanguage]){Be.addText(Te);return}U=w(te.subLanguage,Te,!0,Gt[te.subLanguage]),Gt[te.subLanguage]=U._top}else U=V(Te,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(Ot+=U.relevance),Be.__addSublanguage(U._emitter,U.language)}function Ne(){te.subLanguage!=null?ze():ve(),Te=""}function y(U,Z){U!==""&&(Be.startScope(Z),Be.addText(U),Be.endScope())}function p(U,Z){let se=1;const ye=Z.length-1;for(;se<=ye;){if(!U._emit[se]){se++;continue}const Me=Ke.classNameAliases[U[se]]||U[se],Qe=Z[se];Me?y(Qe,Me):(Te=Qe,ve(),Te=""),se++}}function O(U,Z){return U.scope&&typeof U.scope=="string"&&Be.openNode(Ke.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(y(Te,Ke.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),Te=""):U.beginScope._multi&&(p(U.beginScope,Z),Te="")),te=Object.create(U,{parent:{value:te}}),te}function D(U,Z,se){let ye=ts(U.endRe,se);if(ye){if(U["on:end"]){const Me=new di(U);U["on:end"](Z,Me),Me.isMatchIgnored&&(ye=!1)}if(ye){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return D(U.parent,Z,se)}function q(U){return te.matcher.regexIndex===0?(Te+=U[0],1):(jt=!0,0)}function de(U){const Z=U[0],se=U.rule,ye=new di(se),Me=[se.__beforeBegin,se["on:begin"]];for(const Qe of Me)if(Qe&&(Qe(U,ye),ye.isMatchIgnored))return q(Z);return se.skip?Te+=Z:(se.excludeBegin&&(Te+=Z),Ne(),!se.returnBegin&&!se.excludeBegin&&(Te=Z)),O(se,U),se.returnBegin?0:Z.length}function ge(U){const Z=U[0],se=F.substring(U.index),ye=D(te,U,se);if(!ye)return Ci;const Me=te;te.endScope&&te.endScope._wrap?(Ne(),y(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ne(),p(te.endScope,U)):Me.skip?Te+=Z:(Me.returnEnd||Me.excludeEnd||(Te+=Z),Ne(),Me.excludeEnd&&(Te=Z));do te.scope&&Be.closeNode(),!te.skip&&!te.subLanguage&&(Ot+=te.relevance),te=te.parent;while(te!==ye.parent);return ye.starts&&O(ye.starts,U),Me.returnEnd?0:Z.length}function je(){const U=[];for(let Z=te;Z!==Ke;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Be.openNode(Z))}let Pe={};function Je(U,Z){const se=Z&&Z[0];if(Te+=U,se==null)return Ne(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&se===""){if(Te+=F.slice(Z.index,Z.index+1),!i){const ye=new Error(`0 width match regex (${C})`);throw ye.languageName=C,ye.badRule=Pe.rule,ye}return 1}if(Pe=Z,Z.type==="begin")return de(Z);if(Z.type==="illegal"&&!P){const ye=new Error('Illegal lexeme "'+se+'" for mode "'+(te.scope||"<unnamed>")+'"');throw ye.mode=te,ye}else if(Z.type==="end"){const ye=ge(Z);if(ye!==Ci)return ye}if(Z.type==="illegal"&&se==="")return Te+=`
15
+ `,1;if(Lt>1e5&&Lt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Te+=se,se.length}const Ke=K(C);if(!Ke)throw Sn(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Xn=Is(Ke);let pn="",te=W||Xn;const Gt={},Be=new u.__emitter(u);je();let Te="",Ot=0,it=0,Lt=0,jt=!1;try{if(Ke.__emitTokens)Ke.__emitTokens(F,Be);else{for(te.matcher.considerAll();;){Lt++,jt?jt=!1:te.matcher.considerAll(),te.matcher.lastIndex=it;const U=te.matcher.exec(F);if(!U)break;const Z=F.substring(it,U.index),se=Je(Z,U);it=U.index+se}Je(F.substring(it))}return Be.finalize(),pn=Be.toHTML(),{language:C,value:pn,relevance:Ot,illegal:!1,_emitter:Be,_top:te}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:C,value:ur(F),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:it,context:F.slice(it-100,it+100),mode:U.mode,resultSoFar:pn},_emitter:Be};if(i)return{language:C,value:ur(F),illegal:!1,relevance:0,errorRaised:U,_emitter:Be,_top:te};throw U}}function N(C){const F={value:ur(C),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(C),F}function V(C,F){F=F||u.languages||Object.keys(o);const P=N(C),W=F.filter(K).filter(ce).map(Ne=>w(Ne,C,!1));W.unshift(P);const ae=W.sort((Ne,y)=>{if(Ne.relevance!==y.relevance)return y.relevance-Ne.relevance;if(Ne.language&&y.language){if(K(Ne.language).supersetOf===y.language)return 1;if(K(y.language).supersetOf===Ne.language)return-1}return 0}),[we,ve]=ae,ze=we;return ze.secondBest=ve,ze}function _(C,F,P){const W=F&&n[F]||P;C.classList.add("hljs"),C.classList.add(`language-${W}`)}function $(C){let F=null;const P=g(C);if(d(P))return;if(ie("before:highlightElement",{el:C,language:P}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.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(C)),u.throwUnescapedHTML))throw new Ds("One of your code blocks includes unescaped HTML.",C.innerHTML);F=C;const W=F.textContent,ae=P?b(W,{language:P,ignoreIllegals:!0}):V(W);C.innerHTML=ae.value,C.dataset.highlighted="yes",_(C,P,ae.language),C.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(C.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ie("after:highlightElement",{el:C,result:ae,text:W})}function B(C){u=Ti(u,C)}const T=()=>{m(),Pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){m(),Pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function C(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",C,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach($)}function v(C,F){let P=null;try{P=F(t)}catch(W){if(Sn("Language definition for '{}' could not be registered.".replace("{}",C)),i)Sn(W);else throw W;P=c}P.name||(P.name=C),o[C]=P,P.rawDefinition=F.bind(null,t),P.aliases&&ne(P.aliases,{languageName:C})}function x(C){delete o[C];for(const F of Object.keys(n))n[F]===C&&delete n[F]}function j(){return Object.keys(o)}function K(C){return C=(C||"").toLowerCase(),o[C]||o[n[C]]}function ne(C,{languageName:F}){typeof C=="string"&&(C=[C]),C.forEach(P=>{n[P.toLowerCase()]=F})}function ce(C){const F=K(C);return F&&!F.disableAutodetect}function re(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=F=>{C["before:highlightBlock"](Object.assign({block:F.el},F))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=F=>{C["after:highlightBlock"](Object.assign({block:F.el},F))})}function Y(C){re(C),r.push(C)}function ee(C){const F=r.indexOf(C);F!==-1&&r.splice(F,1)}function ie(C,F){const P=C;r.forEach(function(W){W[P]&&W[P](F)})}function z(C){return Pn("10.7.0","highlightBlock will be removed entirely in v12.0"),Pn("10.7.0","Please use highlightElement now."),$(C)}Object.assign(t,{highlight:b,highlightAuto:V,highlightAll:m,highlightElement:$,highlightBlock:z,configure:B,initHighlighting:T,initHighlightingOnLoad:E,registerLanguage:v,unregisterLanguage:x,listLanguages:j,getLanguage:K,registerAliases:ne,autoDetection:ce,inherit:Ti,addPlugin:Y,removePlugin:ee}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Ls,t.regex={concat:Nn,lookahead:pi,either:sr,optional:Qa,anyNumberOfTimes:Ja};for(const C in Oo)typeof Oo[C]=="object"&&ci(Oo[C]);return Object.assign(t,Oo),t},Fn=Ai({});Fn.newInstance=()=>Ai({});var $s=Fn;Fn.HighlightJS=Fn,Fn.default=Fn;const fr=Ka($s);function mr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={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,i]};i.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],V=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},$=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],T={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],v=["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:$,literal:B,built_in:[...E,...k,"set","shopt",...m,...v]},contains:[V,t.SHEBANG(),_,w,s,c,T,u,d,g,b,n]}}const Ps=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_-]*/}}),Fs=["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"],Us=["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"],Hs=[...Fs,...Us],Ws=["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(),Gs=["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(),js=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ks=["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 Ys(t){const o=t.regex,n=Ps(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="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,r,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:":("+Gs.join("|")+")"},{begin:":(:)?("+js.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ks.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:i,attribute:Ws.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Hs.join("|")+")\\b"}]}}function _i(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 Un="[0-9](_*[0-9])*",Do=`\\.(${Un})`,Vo="[0-9a-fA-F](_*[0-9a-fA-F])*",Mi={className:"number",variants:[{begin:`(\\b(${Un})((${Do})|\\.)?|(${Do}))[eE][+-]?(${Un})[fFdD]?\\b`},{begin:`\\b(${Un})((${Do})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Do})[fFdD]?\\b`},{begin:`\\b(${Un})[fFdD]\\b`},{begin:`\\b0[xX]((${Vo})\\.?|(${Vo})?\\.(${Vo}))[pP][+-]?(${Un})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ri(t,o,n){return n===-1?"":t.replace(o,r=>Ri(t,o,n-1))}function qs(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ri("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={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:[b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Mi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Mi,g]}}const vi="[A-Za-z$_][0-9A-Za-z$_]*",Xs=["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"],Zs=["true","false","null","undefined","NaN","Infinity"],Bi=["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"],zi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ii=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Js=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qs=[].concat(Ii,Bi,zi);function Oi(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=vi,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:vi,keyword:Xs,literal:Zs,built_in:Qs,"variable.language":Js},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Bi,...zi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Ii,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,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:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.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"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ec(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Li(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},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}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),N=t.inherit(b,{contains:[]});g.contains.push(N),b.contains.push(w);let V=[n,d];return[g,b,w,N].forEach(T=>{T.contains=T.contains.concat(V)}),V=V.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:V},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:V}]}]},n,s,g,b,{className:"quote",begin:"^>\\s+",contains:V,end:"$"},i,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Di(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},b={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",V=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,_=`\\b|${r.join("|")}`,$={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${V}))[eE][+-]?(${N})[jJ]?(?=${_})`},{begin:`(${V})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${N})[jJ](?=${_})`}]},B={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,$,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,$,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,$,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{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:[$,T,w]}]}}function Vi(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),i=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["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:b,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+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+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},s]}}function tc(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={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"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],w=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],N=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],V=b,_=[...g,...d].filter(v=>!b.includes(v)),$={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:o.concat(/\b/,o.either(...V),/\s*\(/),relevance:0,keywords:{built_in:V}};function E(v){return o.concat(/\b/,o.either(...v.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(N),relevance:0};function m(v,{exceptions:x,when:j}={}){const K=j;return x=x||[],v.map(ne=>ne.match(/\|\d+$/)||x.includes(ne)?ne:K(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(_,{when:v=>v.length<3}),literal:s,type:u,built_in:w},contains:[{scope:"type",match:E(c)},k,T,$,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}const $o="[A-Za-z$_][0-9A-Za-z$_]*",$i=["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"],Pi=["true","false","null","undefined","NaN","Infinity"],Fi=["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"],Ui=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gi=[].concat(Hi,Fi,Ui);function nc(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=$o,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:$o,keyword:$i,literal:Pi,built_in:Gi,"variable.language":Wi},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Fi,...Ui]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Hi,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,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:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.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"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ji(t){const o=t.regex,n=nc(t),r=$o,i=["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:i},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:$o,keyword:$i.concat(d),literal:Pi,built_in:Gi.concat(i),"variable.language":Wi},b={className:"meta",begin:"@"+r},w=($,B,T)=>{const E=$.contains.findIndex(k=>k.label===B);if(E===-1)throw new Error("can not find mode to replace");$.contains.splice(E,1,T)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(b);const N=n.contains.find($=>$.scope==="attr"),V=Object.assign({},N,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,V]),n.contains=n.contains.concat([b,s,c,V]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const _=n.contains.find($=>$.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ki(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={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"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[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},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yi(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={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,i]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},V={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[V],illegal:"\\n",relevance:0},$={begin:"\\[",end:"\\]",contains:[V],illegal:"\\n",relevance:0},B=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+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}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,$,s,c],T=[...B];return T.pop(),T.push(u),V.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const pr={bash:mr,sh:mr,shell:mr,css:Ys,go:_i,golang:_i,java:qs,javascript:Oi,js:Oi,json:ec,markdown:Li,md:Li,python:Di,py:Di,rust:Vi,rs:Vi,sql:tc,typescript:ji,ts:ji,xml:Ki,html:Ki,yaml:Yi,yml:Yi};for(const[t,o]of Object.entries(pr))fr.registerLanguage(t,o);function Po(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 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 |
17
+ `).replace(/\n+$/,"")}function Tn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&pr[n]?n:""}function gr(t,o){const n=o&&pr[o]?o:"";try{return n?fr.highlight(t,{language:n,ignoreIllegals:!0}).value:fr.highlightAuto(t).value}catch{return oc(t)}}function hr(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 oc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function qi(t,o,n){if(t.length<=1)return t.slice();const[r,...i]=t,s=i.map(g=>g[o]??""),c=s.length>0&&s.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=i.slice().sort((g,b)=>{const w=g[o]??"",N=b[o]??"";return c?(Number(w)-Number(N))*u:w.localeCompare(N,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}const rc=["viewBox","width","height"],ic={class:"zm-edges"},lc=["d","fill"],ac=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],sc=["src","width","height","alt"],cc=["onDblclick"],dc={key:0,class:"zm-rich-code"},uc=["innerHTML"],fc={key:1,class:"zm-rich-table"},mc=["onClick"],pc={class:"zm-rich-sort-mark","aria-hidden":"true"},gc={key:2,class:"zm-text"},hc={key:0,class:"zm-node-markers"},bc=["title","innerHTML"],kc={class:"zm-text-label"},yc=["href","title"],Ec=["title","onClick"],xc={key:4,class:"zm-node-tags"},wc=["title"],Nc=["title","onClick"],Sc=["onClick"],Tc=["onMousedown"],Cc=["onClick"],Ac=["title"],_c={class:"zm-tb-tip zm-tb-zoom"},Mc=["src"],Rc=["src"],Cn=24,Hn=400,fn=160,Xi=4,Fo=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 r=t,i=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),w=e.ref(!1),N=e.ref(null),V=e.ref(0),_=e.ref(0),$=e.ref(null),B=e.ref(null),T=e.ref(null),E=e.ref(""),k=e.ref(new Map),m=e.ref(Ct(r.data)),v=e.ref({}),x=e.ref({}),j=e.ref(r.markdown!==void 0);let K=!1;e.watch(()=>r.markdown,l=>{if(l===void 0){j.value=!1;return}j.value=!0;const a=Vn(l||"");K=!0,m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>{K=!1,rn()})}),e.watch(m,()=>{j.value&&!K&&i("markdownChange",$n(m.value))},{deep:!0});const ne=e.computed(()=>Q.showOrderBadge===!0),ce=e.ref(new Map),re=ce.value;function Y(l,a){const f={};a.bg&&(f.bg=a.bg),a.textColor&&(f.textColor=a.textColor),a.borderColor&&(f.borderColor=a.borderColor),a.fontWeight&&(f.fontWeight=a.fontWeight),a.fontSize&&(f.fontSize=a.fontSize),Object.keys(f).length===0?re.delete(l):re.set(l,f),ce.value=new Map(re)}function ee(l){return re.get(l)??{}}function ie(l,a){const f=le(m.value,l);f&&(f.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:F(a.width,Cn,Hn),height:F(a.height,Cn,Hn)},Ce(),he(),i("change",m.value))}function z(l){const a=le(m.value,l);!a||!a.image||(delete a.image,Ce(),he(),i("change",m.value))}function C(l,a){const f=a.trim();if(!le(m.value,l))return;if(!f){z(l);return}const S=new Image;S.onload=()=>{const L=le(m.value,l);if(!L)return;const M=S.naturalWidth&&S.naturalHeight?S.naturalWidth/S.naturalHeight:1,G=F(S.naturalWidth||fn,Cn,Hn),oe=Math.round(G/M);L.image={src:f,naturalW:S.naturalWidth||G,naturalH:S.naturalHeight||oe,width:G,height:oe},Ce(),he(),i("change",m.value)},S.onerror=()=>{},S.src=f}function F(l,a,f){return Math.min(f,Math.max(a,l))}function P(l,a){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const A=f.result,S=new window.Image;S.onload=()=>{const L=S.naturalWidth||fn,M=S.naturalHeight||fn,G=F(L,Cn,fn),oe=F(Math.round(M*G/L),Cn,Hn);a({src:A,naturalW:L,naturalH:M,width:G,height:oe})},S.onerror=()=>{a({src:A,naturalW:fn,naturalH:fn,width:fn,height:fn})},S.src=A},f.readAsDataURL(l)}function W(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var A;const f=(A=a.files)==null?void 0:A[0];f&&(P(f,S=>ie(l,S)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function ae(l,a){const f=a.trim(),A=le(m.value,l);A&&(f?A.link={url:f}:delete A.link,Ce(),he(),i("change",m.value))}function we(l){ae(l,"")}function ve(l,a){const f=le(m.value,l);f&&(a?f.note={text:a}:delete f.note,Ce(),he(),i("change",m.value))}function ze(l){ve(l,"")}function Ne(l,a){const f=le(m.value,l);f&&(a?f.richContent=a:delete f.richContent,Ce(),he(),i("change",m.value))}const y=e.ref(null),p=e.ref(null),O=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),D=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function q(l,a){r.previewMode||(l.preventDefault(),l.stopPropagation(),p.value=null,d.value=new Set([a.id]),ut(),y.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function de(){y.value=null}function ge(l){const a=l.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(er&&J.panMoved.value){er=!1,l.preventDefault();return}l.preventDefault(),y.value&&(y.value=null),p.value={x:l.clientX,y:l.clientY}}}function je(){p.value=null}function Pe(){je(),i("canvas-settings")}function Je(){je(),i("canvas-data")}function Ke(l){je(),i("canvas-import",l)}function Xn(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&W(l)}function pn(){var A,S,L;const l=(A=y.value)==null?void 0:A.nodeId;if(!l)return;const a=((L=(S=le(m.value,l))==null?void 0:S.link)==null?void 0:L.url)??"",f=window.prompt("输入链接 URL(留空取消)",a);f!==null&&ae(l,f)}function te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&we(l)}function Gt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&U(l)}function Be(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&ze(l)}function Te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&z(l)}function Ot(){var Ve,R;const l=(Ve=y.value)==null?void 0:Ve.nodeId;if(!l)return;const a=(R=le(m.value,l))==null?void 0:R.richContent,f=(a==null?void 0:a.kind)==="code"?Po(a.raw):"",A=(a==null?void 0:a.kind)==="code"&&a.lang||"",S=A?"```"+A+`
20
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?S+f+(f.endsWith("```")?"":"\n```"):S+"// 你的代码"+"\n```");if(M===null)return;const G=M.trim();if(!G){Ne(l,null);return}const oe=/^```([^\s`]*)/.exec(G),pe=oe?oe[1]:void 0;Ne(l,{kind:"code",raw:G,lang:pe})}function it(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function Lt(){var M,G;const l=(M=y.value)==null?void 0:M.nodeId;if(!l)return;const a=(G=le(m.value,l))==null?void 0:G.richContent,f=(a==null?void 0:a.kind)==="table"?a.raw:"",S=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列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 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 思维导图
22
+ | a | b | c |`);if(S===null)return;const L=S.trim();if(!L){Ne(l,null);return}Ne(l,{kind:"table",raw:L})}function jt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function U(l){r.previewMode||i("edit-note",l)}function Z(l,a=60){const f=l.replace(/\s+/g," ").trim();return f.length<=a?f||"点击编辑笔记":f.slice(0,a)+"…"}function se(l){var S;if(r.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const f=g.value;if(!f)return;const A=(S=l.clipboardData)==null?void 0:S.items;if(A)for(let L=0;L<A.length;L++){const M=A[L];if(M.kind==="file"&&M.type.startsWith("image/")){const G=M.getAsFile();if(!G)continue;l.preventDefault();const oe=le(m.value,f);if(oe!=null&&oe.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;P(G,pe=>ie(f,pe));return}}}e.onMounted(()=>{window.addEventListener("paste",se),window.addEventListener("keydown",ye),he()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",se),window.removeEventListener("keydown",ye)});function ye(l){if((l.metaKey||l.ctrlKey)&&(l.key==="f"||l.key==="F")){const f=l.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;l.preventDefault(),i("canvas-outline")}}const Me=e.ref(null),Qe=e.computed(()=>{var l;return((l=Me.value)==null?void 0:l.nodeId)??null});function pt(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const f=a.image.naturalW||a.image.width,A=a.image.naturalH||a.image.height,S=A>0?A/f:1;Me.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:f,naturalH:A,ratio:S,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",gn),window.addEventListener("mouseup",fo)}function gn(l){var oe,pe;const a=Me.value;if(!a)return;const f=J.scale.value||1,A=l.clientX-a.startX,S=F(a.startW+A/f,Cn,Hn),L=F(S*a.ratio,Cn,Hn);a.pendingW=S,a.pendingH=L;const M=(oe=s.value)==null?void 0:oe.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);M&&(M.style.width=`${S}px`,M.style.height=`${L}px`);const G=(pe=s.value)==null?void 0:pe.querySelector(`[data-node-id="${a.nodeId}"]`);G&&(G.style.minWidth=`${Math.max(80,Math.ceil(S+28))}px`,G.style.height=`${Math.ceil(L+8+30)}px`)}function fo(){const l=Me.value;if(window.removeEventListener("mousemove",gn),window.removeEventListener("mouseup",fo),Me.value=null,!l)return;const a=le(m.value,l.nodeId);!a||!a.image||(ie(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]),ut(),Bn=!0)}const Zn=e.ref(null);let Bn=!1;function qo(l){Zn.value=l}function Jn(l){Zn.value===l&&(Zn.value=null),B.value&&(B.value=null)}function Qn(l,a){var Et;if(!a.text||a.text.length<14)return;const A=l.currentTarget.getBoundingClientRect(),S=(Et=s.value)==null?void 0:Et.getBoundingClientRect();if(!S)return;const L=10,M=240,G=A.top-S.top>60,oe=A.left-S.left+A.width/2,pe=L+M/2,Ve=S.width-M/2-L,R=Math.max(pe,Math.min(oe,Ve)),Ye=G?A.top-S.top-8:A.bottom-S.top+8;B.value={text:a.text,x:R,y:Ye,above:G}}const gt=e.ref(0),Kt=e.ref(!1),_t=Ia(100);function Ce(){_t.record({data:m.value,selectedIds:[...d.value]})}function he(){b.value=new Set(b.value),gt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>mo()).then(()=>{gt.value++})}function mo(){const l=document.querySelectorAll(".zm-rich"),a={},f={};l.forEach(A=>{let S=A,L=null;for(;S&&!L;)L=S.getAttribute("data-node-id"),S=S.parentElement;if(!L)return;const M=A.offsetHeight,G=A.scrollWidth,oe=Math.round(M*2)/2,pe=Math.round(G*2)/2;a[L]=oe,f[L]=pe,v.value[L],x.value[L]}),v.value=a,x.value=f}const lt=e.computed(()=>{var l,a,f,A,S,L,M,G,oe,pe;return{rootBg:((l=r.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((A=r.theme)==null?void 0:A.branchText)??"#1f2937",lineColor:((S=r.theme)==null?void 0:S.lineColor)??"#94a3b8",bgColor:((L=r.theme)==null?void 0:L.bgColor)??"#f8fafc",fontSize:((M=r.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((G=r.theme)==null?void 0:G.lineWidthStart)??2.2,lineWidthEnd:((oe=r.theme)==null?void 0:oe.lineWidthEnd)??.8,rainbowBranch:((pe=r.theme)==null?void 0:pe.rainbowBranch)??!1}}),po=e.computed(()=>Q.canvasBg||lt.value.bgColor),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function go(l){return Q.taperedEdge?De(l):Qt(l)}function ho(l){return Q.taperedEdge?Q.lineWidthEnd:Qt(l)}function De(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function Qt(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const a=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*a}function Pr(l,a,f,A){const S=1-l,L=S*S*S*a.x+3*S*S*l*f.x1+3*S*l*l*f.x2+l*l*l*A.x,M=S*S*S*a.y+3*S*S*l*f.y1+3*S*l*l*f.y2+l*l*l*A.y;return{x:L,y:M}}function bo(l,a,f,A,S=32,L="curve",M="right"){if(L==="curve"){let kt;if(M==="right"||M==="left"){const Oe=Math.abs(a.x-l.x)*.45,Pt=M==="right"?1:-1;kt={x1:l.x+Pt*Oe,y1:l.y,x2:a.x-Pt*Oe,y2:a.y}}else{const Oe=Math.abs(a.y-l.y)*.45;kt={x1:l.x,y1:l.y+Oe,x2:a.x,y2:a.y-Oe}}const qt=Ee=>{const Oe=1-Ee,Pt=-3*Oe*Oe*l.x+3*(Oe*Oe-2*Oe*Ee)*kt.x1+3*(2*Oe*Ee-Ee*Ee)*kt.x2+3*Ee*Ee*a.x,sn=-3*Oe*Oe*l.y+3*(Oe*Oe-2*Oe*Ee)*kt.y1+3*(2*Oe*Ee-Ee*Ee)*kt.y2+3*Ee*Ee*a.y;return{dx:Pt,dy:sn}},Vt=[],yn=[];for(let Ee=0;Ee<=S;Ee++){const Oe=Ee/S,Pt=Ee===0?l:Ee===S?a:Pr(Oe,l,kt,a),sn=qt(Oe);let to=Math.hypot(sn.dx,sn.dy);to<1e-6&&(to=1);const xt=-sn.dy/to,qe=sn.dx/to,Xe=(f+(A-f)*Oe)/2;Vt.push({x:Pt.x+xt*Xe,y:Pt.y+qe*Xe}),yn.push({x:Pt.x-xt*Xe,y:Pt.y-qe*Xe})}let $t=`M ${Vt[0].x.toFixed(2)} ${Vt[0].y.toFixed(2)}`;for(let Ee=1;Ee<=S;Ee++)$t+=` L ${Vt[Ee].x.toFixed(2)} ${Vt[Ee].y.toFixed(2)}`;for(let Ee=S;Ee>=0;Ee--)$t+=` L ${yn[Ee].x.toFixed(2)} ${yn[Ee].y.toFixed(2)}`;return $t+=" Z",$t}const G=a.x-l.x,oe=a.y-l.y;let pe=Math.hypot(G,oe);pe<1e-6&&(pe=1);const Ve=-oe/pe,R=G/pe,Ye=f/2,Et=A/2,ue={x:l.x+Ve*Ye,y:l.y+R*Ye},ft={x:l.x-Ve*Ye,y:l.y-R*Ye},an={x:a.x-Ve*Et,y:a.y-R*Et},at={x:a.x+Ve*Et,y:a.y+R*Et};return`M ${ue.x.toFixed(2)} ${ue.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${an.x.toFixed(2)} ${an.y.toFixed(2)} L ${ft.x.toFixed(2)} ${ft.y.toFixed(2)} Z`}const hn=e.computed(()=>et.value.root.children),Xo=Jt[0].colors,ko=e.computed(()=>ya(Q.branchPaletteId,Q.customPalettes)),en=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const a=r.lineColors,f=a&&a.length>0?a:ko.value.colors.length>0?ko.value.colors:Xo;for(let S=0;S<hn.value.length;S++){const L=hn.value[S];l.set(L.id,f[S%f.length])}const A=(S,L)=>{l.set(S.id,L);for(const M of S.children)A(M,L)};for(let S=0;S<hn.value.length;S++){const L=hn.value[S];A(L,f[S%f.length])}return l});function ht(l,a){return Q.rainbowBranch?en.value.get(a.id)??lt.value.lineColor:lt.value.lineColor}function Yt(l){const a=ee(l.id);if(a.bg)return a.bg;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return bn(f,.18)}return lt.value.branchBg}function tn(l){const a=ee(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return lt.value.rootText;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.55)}return lt.value.branchText}function nn(l){const a=ee(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.3)}return lt.value.lineColor}function eo(l){return ee(l.id).fontWeight??(l.isRoot?600:400)}function zn(l){return ee(l.id).fontSize??lt.value.fontSize}function bn(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=parseInt(A.slice(0,2),16),L=parseInt(A.slice(2,4),16),M=parseInt(A.slice(4,6),16);return`rgba(${S}, ${L}, ${M}, ${a})`}function In(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=Math.round(parseInt(A.slice(0,2),16)*(1-a)),L=Math.round(parseInt(A.slice(2,4),16)*(1-a)),M=Math.round(parseInt(A.slice(4,6),16)*(1-a));return`rgb(${S}, ${L}, ${M})`}const J=va({getContainer:()=>s.value});J.setOnMarqueeEnd(Ep),za({isEditing:()=>c.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:on,onAddSibling:Fe,onAddSiblingBefore:Jo,onRemove:Vl,onStartEdit:Mt,onClearSelection:()=>{d.value=new Set,ut()},onDuplicate:xo,onCopy:Ol,onCut:Ll,onPaste:Dl,hasClipboard:()=>!!$.value&&$.value.nodes.length>0,onUndo:Fr,onRedo:Ur,onNavigate:up,onSelectRoot:()=>{d.value=new Set([m.value.id]),ut()}});const et=e.computed(()=>{const l=Ct(m.value);return On(l),ga(l,{mode:Q.layoutMode,baseFontSize:lt.value.fontSize,richHeights:v.value,richWidths:x.value})}),yo=e.ref([]),kn=e.computed(()=>(gt.value,yo.value));e.watch(et,l=>{const a=[],f=A=>{a.push(A);for(const S of A.children)f(S)};f(l.root),yo.value=a},{immediate:!0});const Eo=e.computed(()=>{const l=[];for(const a of kn.value)for(const f of a.children)l.push({from:a,to:f,key:`${a.id}->${f.id}`});return l}),Zo=e.computed(()=>`${et.value.vbX} ${et.value.vbY} ${et.value.vbW} ${et.value.vbH}`);function On(l){if(b.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)On(a)}function Mt(l){const a=le(m.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function X(){if(!c.value)return;const l=le(m.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ce(),i("change",m.value)),c.value=null}function h(){c.value=null}function I(l){if(r.previewMode)return;const a=le(m.value,l);a!=null&&a.richContent&&(T.value=l,E.value=a.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function H(){if(!T.value)return;const l=T.value,a=le(m.value,l),f=E.value;if(a&&a.richContent&&a.richContent.raw!==f)if(a.richContent.kind==="code"){const A=Tn(f)||void 0;Ne(l,{kind:"code",raw:f,lang:A})}else Ne(l,{kind:"table",raw:f});T.value=null}function Se(){T.value=null}function me(l){l.key==="Escape"?(l.preventDefault(),Se()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),H())}function Ae(l,a){const f=k.value.get(l);!f||f.col!==a?k.value.set(l,{col:a,dir:"asc"}):f.dir==="asc"?k.value.set(l,{col:a,dir:"desc"}):k.value.delete(l)}function We(l,a){const f=k.value.get(l);return!f||a.length<=1?a:qi(a,f.col,f.dir)}function bt(l,a){const f=k.value.get(l);return!f||f.col!==a?"↕":f.dir==="asc"?"▲":"▼"}function yt(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Fr()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),Ur())}function on(l){const a=ri(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Fe(l){if(l===m.value.id){on(l);return}const a=ii(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Jo(l){if(l===m.value.id){on(l);return}const a=Ca(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function xo(l){if(l===m.value.id)return;const a=Aa(m.value,l);a&&(Ce(),d.value=new Set([a.id]),ut(),i("change",m.value),he())}function zl(l){const a=[],f=new Set;for(const A of l)A!==m.value.id&&(f.has(A)||le(m.value,A)&&(f.add(A),a.push(A)));return a}function Il(l){const a=new Set(l),f=[],A=S=>{a.has(S.id)&&f.push(S.id);for(const L of S.children)A(L)};return A(m.value),f}function Ol(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}f.length!==0&&($.value={nodes:f,originalIds:new Set(a)},he())}function Ll(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}if(f.length!==0){Ce();for(const A of a)Mo(m.value,A);d.value=new Set,ut(),$.value={nodes:f,originalIds:new Set(a)},he(),i("change",m.value)}}function Dl(l){const a=$.value;if(!a||a.nodes.length===0)return;const f=l??m.value.id,A=le(m.value,f);if(A){for(const S of a.originalIds){const L=le(m.value,S);if(L&&le(L,f))return}Ce();for(const S of a.nodes){const L=Ct(S);Ro(L),A.children.push(L)}$.value=null,he(),i("change",m.value)}}function Fr(){const l=_t.undo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function Ur(){const l=_t.redo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function ut(){const l=[];for(const a of d.value){const f=le(m.value,a);f&&l.push(f)}i("select",l.length>0?l:null)}function up(l,a){const f=g.value??m.value.id,A=le(m.value,f);if(!A)return;let S=null;if(a===1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>=0&&M<L.children.length-1&&(S=L.children[M+1].id)}}else if(a===-1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>0&&(S=L.children[M-1].id)}}else if(l===1){const L=Bt(m.value,A.id);L&&(S=L.id)}else l===-1&&A.children.length>0&&(S=A.children[0].id);S&&(d.value=new Set([S]),ut())}function Vl(l){if(l!==m.value.id&&Mo(m.value,l)){if(Ce(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,ut()}he(),i("change",m.value)}}function $l(l){b.value.has(l)?b.value.delete(l):b.value.add(l),he()}function Pl(l){const a=[{n:m.value,depth:1}];for(;a.length;){const{n:f,depth:A}=a.pop();l(f,A);for(let S=f.children.length-1;S>=0;S--)a.push({n:f.children[S],depth:A+1})}}function fp(){b.value=new Set,Pl(l=>{l.children.length>0&&b.value.add(l.id)}),he()}function Fl(l){b.value=new Set,Pl((a,f)=>{f>l&&a.children.length>0&&b.value.add(a.id)}),he()}function mp(){b.value=new Set,he()}function pp(l,a){Sa(m.value,l,a)&&(Ce(),he(),i("change",m.value))}function Ul(l,a,f){return Ta(m.value,l,a,f)?(Ce(),he(),i("change",m.value),!0):!1}function gp(l,a){if(l.stopPropagation(),l.shiftKey){const f=new Set(d.value);f.has(a.id)?f.delete(a.id):f.add(a.id),d.value=f}else d.value=new Set([a.id]);ut()}function hp(l,a,f){let A=null;for(const S of kn.value){if(S.id===f)continue;const L=S.width/2,M=S.height/2;l>=S.x-L&&l<=S.x+L&&a>=S.y-M&&a<=S.y+M&&(A=S)}return A}let Dt=null;function bp(l,a){if(r.previewMode||a.isRoot||l.button!==0)return;const f=l.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;l.stopPropagation();const A=s.value.getBoundingClientRect(),S=a.x*J.scale.value+J.offsetX.value,L=a.y*J.scale.value+J.offsetY.value,M=l.clientX-A.left-S,G=l.clientY-A.top-L;Dt={srcId:a.id,srcText:a.text,pointerOffsetX:M,pointerOffsetY:G,startX:l.clientX,startY:l.clientY},window.addEventListener("pointermove",Hl),window.addEventListener("pointerup",Qo),window.addEventListener("pointercancel",Qo)}function Hl(l){if(Dt){const M=l.clientX-Dt.startX,G=l.clientY-Dt.startY;if(Math.abs(M)<=Xi&&Math.abs(G)<=Xi)return;N.value={srcId:Dt.srcId,srcText:Dt.srcText,pointerOffsetX:Dt.pointerOffsetX,pointerOffsetY:Dt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Dt=null}const a=N.value;if(!a)return;const f=s.value.getBoundingClientRect();V.value=l.clientX-f.left-a.pointerOffsetX,_.value=l.clientY-f.top-a.pointerOffsetY;const A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value,L=hp(A,S,a.srcId);a.currentTargetId=(L==null?void 0:L.id)??null}function Qo(l){if(window.removeEventListener("pointermove",Hl),window.removeEventListener("pointerup",Qo),window.removeEventListener("pointercancel",Qo),Dt){Dt=null;return}const a=N.value;a&&(a.currentTargetId&&(Ul(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),ut()),N.value=null,V.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let er=!1;function kp(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){er=!0,J.startPan(l);return}if(er=!1,l.button!==0)return;const f=s.value.getBoundingClientRect(),A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value;J.startMarquee(A,S,{shift:l.shiftKey})}function yp(l){if(Bn){Bn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const f=J.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,ut())}function Ep(){const l=J.marquee;if(l.width<4&&l.height<4)return;const a=l.x,f=l.y,A=l.x+l.width,S=l.y+l.height,L=[];for(const M of kn.value){const G=M.width/2,oe=M.height/2,pe=M.x-G,Ve=M.x+G,R=M.y-oe,Ye=M.y+oe;pe<=A&&Ve>=a&&R<=S&&Ye>=f&&L.push(M.id)}d.value=l.shiftKey?new Set([...d.value,...L]):new Set(L),ut()}function Wl(l){return b.value.has(l)}function xp(l){const a=le(m.value,l.id);return!!a&&a.children.length>0}function Hr(l){const a=le(m.value,l);return a?a.children.length:0}function Gl(l){if(!le(m.value,l))return 0;const A=[m.value];for(;A.length;){const S=A.pop(),L=S.children.findIndex(M=>M.id===l);if(L>=0)return L;for(const M of S.children)A.push(M)}return 0}function tr(l,a,f,A){if(((A==null?void 0:A._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 L;a==="in"?L=-l.side:f!==void 0?L=f:L=l.side;const M=a==="in"?l._richInsetX??0:0;return{x:l.x+L*(l.width/2-M),y:l.y}}function rn(){const l=et.value;J.resetView(l.width,l.height,l.root.y)}function wp(){Kt.value=!0,Ce(),he(),e.nextTick(()=>rn())}function Wr(l){Q.layoutMode!==l&&(Q.layoutMode=l,he(),e.nextTick(()=>rn()))}function jl(){return JSON.stringify(m.value,null,2)}function Np(l){const a=le(m.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function Kl(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(_t.reset(),m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>rn()),i("change",m.value),!0)}catch{return!1}}function Sp(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var A;const a=(A=l.files)==null?void 0:A[0];if(!a)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(Kl(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(a)},l.click()}function Tp(){const l=new Blob([jl()],{type:"application/json"}),a=URL.createObjectURL(l),f=document.createElement("a");f.href=a,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(a)}const Yl=e.ref(""),ln=e.ref([]),wo=e.ref(-1);function Cp(l){Yl.value=l;const a=l.trim();if(!a){ln.value=[],wo.value=-1;return}const f=a.toLowerCase(),A=[],S=L=>{var M;(L.text.toLowerCase().includes(f)||(M=L.note)!=null&&M.text&&L.note.text.toLowerCase().includes(f))&&A.push(L.id);for(const G of L.children)S(G)};S(m.value),ln.value=A,wo.value=A.length>0?0:-1,A.length>0&&(Rp(A),e.nextTick(()=>vp(0)))}function Ap(l){return ln.value.includes(l)}function _p(l){return wo.value>=0&&ln.value[wo.value]===l}function Mp(l){return Yl.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(l)}function Rp(l){if(l.length===0)return;const a=new Set(l),f=new Set,A=S=>{let L=a.has(S.id);for(const M of S.children)A(M)&&(L=!0);return L&&S.children.length>0&&b.value.has(S.id)&&f.add(S.id),L};if(A(m.value),f.size>0){for(const S of f)b.value.delete(S);he()}}function vp(l){const a=ln.value[l];if(!a)return;const f=kn.value.find(A=>A.id===a);f&&(d.value=new Set([a]),ut(),J.centerOn(f.x,f.y,f.width,f.height))}function Bp(l,a){const f=le(m.value,l);f&&(f.markers||(f.markers=[]),!f.markers.includes(a)&&(f.markers.push(a),Ce(),he(),i("change",m.value)))}function zp(l,a){const f=le(m.value,l);if(!f||!f.markers)return;const A=f.markers.indexOf(a);A<0||(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value))}function ql(l,a){const f=le(m.value,l);if(!f)return!1;f.markers||(f.markers=[]);const A=f.markers.indexOf(a);return A>=0?(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value),!1):(f.markers.push(a),Ce(),he(),i("change",m.value),!0)}function Ip(l){const a=le(m.value,l);return a!=null&&a.markers?[...a.markers]:[]}function Op(l){var f;const a=(f=y.value)==null?void 0:f.nodeId;a&&ql(a,l)}function Lp(){var f;const l=(f=y.value)==null?void 0:f.nodeId;if(!l)return;const a=le(m.value,l);!a||!a.markers||(delete a.markers,Ce(),he(),i("change",m.value),de())}function Gr(l,a){const f=le(m.value,l);f&&(a.length===0?f.tags&&delete f.tags:f.tags=[...a],Ce(),he(),i("change",m.value))}function Dp(l){const a=le(m.value,l);return a!=null&&a.tags?[...a.tags]:[]}function Vp(){var L,M;const l=(L=y.value)==null?void 0:L.nodeId;if(!l)return;const a=le(m.value,l),f=((M=a==null?void 0:a.tags)==null?void 0:M.join(", "))??"",A=window.prompt("输入标签(多个用逗号分隔)",f);if(A===null)return;const S=A.split(/[,,]/).map(G=>G.trim()).filter(G=>G.length>0);Gr(l,S),de()}function $p(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&(Gr(l,[]),de())}function Xl(){const l=et.value,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("xmlns",a),f.setAttribute("viewBox",`${l.vbX} ${l.vbY} ${l.vbW} ${l.vbH}`),f.setAttribute("width",String(l.vbW)),f.setAttribute("height",String(l.vbH));const A=document.createElementNS(a,"rect");A.setAttribute("x",String(l.vbX)),A.setAttribute("y",String(l.vbY)),A.setAttribute("width",String(l.vbW)),A.setAttribute("height",String(l.vbH)),A.setAttribute("fill",po.value),f.appendChild(A);for(const M of Eo.value){const G=document.createElementNS(a,"path");G.setAttribute("d",bo(tr(M.from,"out",M.to.side,M.to),tr(M.to,"in"),go(M.from.depth),ho(M.to.depth),32,Q.lineStyle,M.to._dir)),G.setAttribute("fill",ht(M.from,M.to)),G.setAttribute("stroke","none"),f.appendChild(G)}const S="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function L(M,G){let oe=0;for(const pe of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(pe)?oe+=G:oe+=G*.55;return oe}for(const M of kn.value){const G=M.x-M.width/2,oe=M.y-M.height/2,pe=document.createElementNS(a,"rect");pe.setAttribute("x",String(G)),pe.setAttribute("y",String(oe)),pe.setAttribute("width",String(M.width)),pe.setAttribute("height",String(M.height)),pe.setAttribute("rx","8"),pe.setAttribute("fill",Yt(M)),pe.setAttribute("stroke",nn(M)),pe.setAttribute("stroke-width","1"),f.appendChild(pe);const Ve=!!(M.tags&&M.tags.length>0),R=!!(M.markers&&M.markers.length>0),Ye=!!M.image,Et=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let ue=0,ft=0;if(Et){const qe=M.richContent,Xe=M.fontSize*.78*.92,Xt=6,Le=4,En=2,xn=6;if(qe.kind==="code"){const wt=Po(qe.raw),mt=Tn(qe.raw),Nt=wt.split(`
23
+ `),Zt=Xe*1.35;let Rt=0;for(const Ie of Nt)Rt=Math.max(Rt,L(Ie,Xe));ft=Math.min(Rt+Xt*2+4,M.width-4),ue=Nt.length*Zt+Le*2+En;const Ze=M.x-ft/2;let st=oe+4;Ye&&(st=oe+M.image.height+xn);const St=document.createElementNS(a,"rect");if(St.setAttribute("x",String(Ze)),St.setAttribute("y",String(st)),St.setAttribute("width",String(ft)),St.setAttribute("height",String(ue-En)),St.setAttribute("rx","6"),St.setAttribute("fill","rgba(255,255,255,0.55)"),St.setAttribute("stroke",nn(M)),St.setAttribute("stroke-width","1"),f.appendChild(St),mt){const Ie=document.createElementNS(a,"text");Ie.setAttribute("x",String(Ze+ft-Xt)),Ie.setAttribute("y",String(st+Le+4)),Ie.setAttribute("text-anchor","end"),Ie.setAttribute("fill",tn(M)),Ie.setAttribute("font-size",String(Xe*.8)),Ie.setAttribute("font-family",S),Ie.setAttribute("opacity","0.5"),Ie.textContent=mt,f.appendChild(Ie)}const So="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ie=0;Ie<Nt.length;Ie++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Ze+Xt)),nt.setAttribute("y",String(st+Le+(Ie+.5)*Zt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",tn(M)),nt.setAttribute("font-size",String(Xe)),nt.setAttribute("font-family",So);let vt=Nt[Ie];const Ue=Math.floor((ft-Xt*2)/(Xe*.6));vt.length>Ue&&(vt=vt.substring(0,Ue-1)+"…"),nt.textContent=vt,f.appendChild(nt)}}else if(qe.kind==="table"){const wt=hr(qe.raw);if(wt.length>0){const mt=Xe*1.35,Nt=6,Zt=3,Rt=wt[0].length,Ze=[];for(let Ue=0;Ue<Rt;Ue++){let cn=0;for(const wn of wt)Ue<wn.length&&(cn=Math.max(cn,L(wn[Ue],Xe)));Ze.push(cn+Nt*2)}ft=Math.min(Ze.reduce((Ue,cn)=>Ue+cn,0),M.width-4);const st=ft/Ze.reduce((Ue,cn)=>Ue+cn,0);for(let Ue=0;Ue<Rt;Ue++)Ze[Ue]*=st;ue=wt.length*(mt+Zt*2)+En;const St=M.x-ft/2;let So=oe+4;Ye&&(So=oe+M.image.height+xn);const Ie=document.createElementNS(a,"rect");Ie.setAttribute("x",String(St)),Ie.setAttribute("y",String(So)),Ie.setAttribute("width",String(ft)),Ie.setAttribute("height",String(ue-En)),Ie.setAttribute("rx","6"),Ie.setAttribute("fill","rgba(255,255,255,0.55)"),Ie.setAttribute("stroke",nn(M)),Ie.setAttribute("stroke-width","1"),f.appendChild(Ie);let nt=St,vt=So;for(let Ue=0;Ue<wt.length;Ue++){const cn=wt[Ue],wn=mt+Zt*2;nt=St;for(let To=0;To<Rt;To++){const no=Ze[To],Pp=cn[To]||"";if(To<Rt-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt+no)),He.setAttribute("y1",String(vt)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue<wt.length-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt)),He.setAttribute("y1",String(vt+wn)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue===0){const He=document.createElementNS(a,"rect");He.setAttribute("x",String(nt)),He.setAttribute("y",String(vt)),He.setAttribute("width",String(no)),He.setAttribute("height",String(wn)),He.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(He)}const dn=document.createElementNS(a,"text");dn.setAttribute("x",String(nt+Nt)),dn.setAttribute("y",String(vt+Zt+mt/2+2)),dn.setAttribute("dominant-baseline","central"),dn.setAttribute("fill",tn(M)),dn.setAttribute("font-size",String(Xe)),dn.setAttribute("font-family",S),Ue===0&&dn.setAttribute("font-weight","600");let nr=Pp;const jr=Math.floor((no-Nt*2)/(Xe*.55));nr.length>jr&&jr>2&&(nr=nr.substring(0,jr-1)+"…"),dn.textContent=nr,f.appendChild(dn),nt+=no}vt+=wn}}}}let an=0;if(Ye){const qe=M.image,Xe=oe+4,Xt=M.x-qe.width/2,Le=document.createElementNS(a,"image");Le.setAttribute("x",String(Xt)),Le.setAttribute("y",String(Xe)),Le.setAttribute("width",String(qe.width)),Le.setAttribute("height",String(qe.height)),Le.setAttribute("href",qe.src),Le.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",qe.src),Le.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Le),an=qe.height+6}let at=M.y;const kt=an+ue;kt>0?at=oe+kt+(M.height-kt)/2:Ve&&(at=M.y-8);const qt=14,Vt=2,yn=4,$t=R?M.markers.length:0,Ee=$t>0?$t*qt+($t-1)*Vt+yn:0,Oe=L(M.text,M.fontSize),Pt=Ee+Oe,sn=M.x-Pt/2;if(R){let qe=sn;for(const Xe of M.markers){const Xt=zo(Xe);if(Xt){const Le=document.createElementNS(a,"svg");Le.setAttribute("x",String(qe)),Le.setAttribute("y",String(at-qt/2)),Le.setAttribute("width",String(qt)),Le.setAttribute("height",String(qt)),Le.setAttribute("viewBox","0 0 24 24"),Le.setAttribute("color",tn(M));const xn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Xt}</svg>`,"image/svg+xml");if(!xn.querySelector("parsererror"))for(;xn.documentElement.firstChild;)Le.appendChild(xn.documentElement.firstChild);f.appendChild(Le)}qe+=qt+Vt}}const to=R?sn+Ee+Oe/2:M.x,xt=document.createElementNS(a,"text");if(xt.setAttribute("x",String(to)),xt.setAttribute("y",String(at)),xt.setAttribute("text-anchor","middle"),xt.setAttribute("dominant-baseline","central"),xt.setAttribute("fill",tn(M)),xt.setAttribute("font-size",String(zn(M))),xt.setAttribute("font-weight",String(eo(M))),xt.setAttribute("font-family",S),xt.textContent=M.text,f.appendChild(xt),Ve){const Le=M.y+10,En=M.tags.map(mt=>L(mt,10)+12),xn=En.reduce((mt,Nt)=>mt+Nt+3,-3);let wt=M.x-xn/2;for(let mt=0;mt<M.tags.length;mt++){const Nt=M.tags[mt],Zt=lr(Nt),Rt=En[mt],Ze=document.createElementNS(a,"rect");Ze.setAttribute("x",String(wt)),Ze.setAttribute("y",String(Le-16/2)),Ze.setAttribute("width",String(Rt)),Ze.setAttribute("height",String(16)),Ze.setAttribute("rx",String(16/2)),Ze.setAttribute("fill",Zt.background),Ze.setAttribute("stroke",Zt.borderColor),Ze.setAttribute("stroke-width","1"),f.appendChild(Ze);const st=document.createElementNS(a,"text");st.setAttribute("x",String(wt+Rt/2)),st.setAttribute("y",String(Le)),st.setAttribute("text-anchor","middle"),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",Zt.color),st.setAttribute("font-size",String(10)),st.setAttribute("font-family",S),st.textContent=Nt,f.appendChild(st),wt+=Rt+3}}}return f}function No(){const l=Xl();let f=new XMLSerializer().serializeToString(l);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
24
+ `+f);const A=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(A),L=document.createElement("a");L.href=S,L.download=`${m.value.text||"mindmap"}.svg`,L.click(),URL.revokeObjectURL(S)}function Zl(l=2){const a=Xl(),f=et.value;let S=new XMLSerializer().serializeToString(a);S.startsWith("<?xml")||(S=`<?xml version="1.0" encoding="UTF-8"?>
25
+ `+S);const L=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(L),G=new window.Image;G.onload=()=>{const oe=document.createElement("canvas");oe.width=Math.ceil(f.vbW*l),oe.height=Math.ceil(f.vbH*l);const pe=oe.getContext("2d");if(!pe){URL.revokeObjectURL(M);return}pe.fillStyle=po.value,pe.fillRect(0,0,oe.width,oe.height),pe.drawImage(G,0,0,oe.width,oe.height),URL.revokeObjectURL(M);try{oe.toBlob(Ve=>{if(!Ve){No();return}const R=URL.createObjectURL(Ve),Ye=document.createElement("a");Ye.href=R,Ye.download=`${m.value.text||"mindmap"}.png`,Ye.click(),URL.revokeObjectURL(R)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),No()}},G.onerror=()=>{URL.revokeObjectURL(M),No()},G.src=M}return o({addChild:l=>on(l),addSibling:l=>Fe(l),removeNode:l=>Vl(l),duplicateNode:l=>xo(l),setNodeText:(l,a)=>pp(l,a),moveNode:(l,a,f)=>Ul(l,a,f),lineWidthForDepth:go,endWidthForDepth:ho,getData:()=>m.value,nodeHasContent:l=>Np(l),getSelectedIds:()=>[...d.value],copyNodes:l=>Ol(l),cutNodes:l=>Ll(l),pasteNodes:l=>Dl(l),setData:l=>{_t.reset(),m.value=Ct(l),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:jl,importData:Kl,getMarkdown:()=>$n(m.value),setMarkdown:(l,a=!0)=>{const f=Vn(l||"");a&&(j.value=!0),K=!a,_t.reset(),m.value=Ct(f),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>{K=!1,rn()}),i("change",m.value)},setBalanced:l=>{Kt.value=l},isBalanced:()=>Kt.value,balance:()=>wp(),applyNodeStyle:(l,a)=>Y(l,a),getNodeStyle:l=>ee(l),applyNodeImage:(l,a)=>ie(l,a),applyNodeImageByUrl:(l,a)=>C(l,a),removeNodeImage:l=>z(l),applyNodeLink:(l,a)=>ae(l,a),removeNodeLink:l=>we(l),applyNodeNote:(l,a)=>ve(l,a),removeNodeNote:l=>ze(l),applyNodeRichContent:(l,a)=>Ne(l,a),addNodeMarker:(l,a)=>Bp(l,a),removeNodeMarker:(l,a)=>zp(l,a),toggleNodeMarker:(l,a)=>ql(l,a),getNodeMarkers:l=>Ip(l),setNodeTags:(l,a)=>Gr(l,a),getNodeTags:l=>Dp(l),exportPNG:l=>Zl(l),exportSVG:()=>No(),searchNodes:l=>(Cp(l),[...ln.value]),undo:()=>Fr(),redo:()=>Ur(),canUndo:()=>_t.canUndo(),canRedo:()=>_t.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge),l.canvasBg!==void 0&&(Q.canvasBg=l.canvasBg)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge,canvasBg:Q.canvasBg}),setBranchPalette:l=>{if(!l)return;[...Jt,...Q.customPalettes].find(f=>f.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Jt,...Q.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>wo.value}),e.watch(()=>r.data,l=>{m.value=Ct(l),he()},{deep:!1}),e.onMounted(()=>{Ce(),e.nextTick(()=>rn())}),(l,a)=>{var f,A,S,L,M,G,oe,pe,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:po.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:kp,onContextmenu:ge,onWheel:a[26]||(a[26]=(...R)=>e.unref(J).onWheel&&e.unref(J).onWheel(...R)),onMouseenter:a[27]||(a[27]=R=>w.value=!0),onMouseleave:a[28]||(a[28]=R=>w.value=!1),onClick:yp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:et.value.vbX*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:et.value.vbY*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:et.value.vbW*e.unref(J).scale.value+"px",height:et.value.vbH*e.unref(J).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Zo.value,preserveAspectRatio:"xMinYMin meet",width:et.value.vbW*e.unref(J).scale.value,height:et.value.vbH*e.unref(J).scale.value},[e.createElementVNode("g",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:bo(tr(R.from,"out",R.to.side,R.to),tr(R.to,"in"),go(R.from.depth),ho(R.to.depth),32,Q.lineStyle,R.to._dir),fill:ht(R.from,R.to),stroke:"none"},null,8,lc))),128))])],8,rc))],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),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:V.value+"px",top:_.value+"px",transform:`scale(${e.unref(J).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(N.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(kn.value,R=>{var Ye,Et;return e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":g.value===R.id,"is-selected-secondary":g.value!==R.id&&d.value.has(R.id),"is-editing":c.value===R.id,"has-image":!!R.image,"is-resizing":Qe.value===R.id,"is-dragging-source":((Ye=N.value)==null?void 0:Ye.srcId)===R.id,"is-drop-target":((Et=N.value)==null?void 0:Et.currentTargetId)===R.id,"is-search-hit":Ap(R.id),"is-search-current":_p(R.id),"is-search-dimmed":Mp(R.id)}]),"data-node-id":R.id,style:e.normalizeStyle({left:R.x+"px",top:R.y+"px",width:R.width+"px",minWidth:R.width+"px",height:R.height+"px",fontSize:zn(R)+"px",background:Yt(R),color:tn(R),borderColor:nn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:ue=>gp(ue,R),onPointerdown:ue=>bp(ue,R),onDblclick:ue=>{ue.stopPropagation(),t.previewMode||Mt(R.id)},onContextmenu:ue=>q(ue,R),onMouseenter:ue=>{qo(R.id),Qn(ue,R)},onMouseleave:ue=>Jn(R.id)},[R.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:R.image.src,width:R.image.width,height:R.image.height,alt:R.text,draggable:"false"},null,8,sc)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":R.richContent.kind==="table"||R.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ue=>I(R.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[T.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ue=>E.value=ue),class:"zm-rich-edit",spellcheck:"false",onBlur:H,onKeydown:me},null,544)),[[e.vModelText,E.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",dc,[e.createElementVNode("code",{innerHTML:e.unref(gr)(e.unref(Po)(R.richContent.raw),e.unref(Tn)(R.richContent.raw))},null,8,uc)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",fc,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We(R.id,e.unref(hr)(R.richContent.raw)),(ue,ft)=>(e.openBlock(),e.createElementBlock("tr",{key:ft},[ft===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(an,at)=>{var kt,qt,Vt,yn,$t;return e.openBlock(),e.createElementBlock("th",{key:`h${at}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((kt=k.value.get(R.id))==null?void 0:kt.col)===at,"is-asc":((qt=k.value.get(R.id))==null?void 0:qt.col)===at&&((Vt=k.value.get(R.id))==null?void 0:Vt.dir)==="asc","is-desc":((yn=k.value.get(R.id))==null?void 0:yn.col)===at&&(($t=k.value.get(R.id))==null?void 0:$t.dir)==="desc"}]),onClick:e.withModifiers(Ee=>Ae(R.id,at),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(an),1),e.createElementVNode("span",pc,e.toDisplayString(bt(R.id,at)),1)],10,mc)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(an,at)=>(e.openBlock(),e.createElementBlock("td",{key:`c${at}`},e.toDisplayString(an),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,cc)):e.createCommentVNode("",!0),c.value!==R.id?(e.openBlock(),e.createElementBlock("span",gc,[R.markers&&R.markers.length>0?(e.openBlock(),e.createElementBlock("span",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.markers,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-marker",title:e.unref(si)(ue),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ue)+"</svg>"},null,8,bc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",kc,e.toDisplayString(R.text),1),R.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"link",size:11,stroke:2})],40,yc)):e.createCommentVNode("",!0),R.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:Z(R.note.text),onClick:e.withModifiers(ue=>U(R.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"note",size:11,stroke:2})],40,Ec)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ue=>u.value=ue),autofocus:"",onBlur:a[7]||(a[7]=ue=>X()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ue=>X(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ue=>X(),["prevent"]),["tab"])),e.withKeys(h,["esc"]),yt],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),R.tags&&R.tags.length>0&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.tags,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-tag",style:e.normalizeStyle(e.unref(lr)(ue))},e.toDisplayString(ue),5))),128))])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${Gl(R.id)+1} 个`},e.toDisplayString(Gl(R.id)+1),9,wc)):e.createCommentVNode("",!0),Wl(R.id)&&Hr(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:en.value.get(R.id)??"#64748b"}),title:`展开 ${Hr(R.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},e.toDisplayString(Hr(R.id)),47,Nc)):e.createCommentVNode("",!0),xp(R)&&!Wl(R.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:en.value.get(R.id)??"#64748b",borderColor:en.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},[e.createVNode(ke,{name:"minus",size:10,stroke:2.4})],46,Sc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ue=>pt(ue,R),["stop"])},null,40,Tc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>z(R.id),["stop"])},[e.createVNode(ke,{name:"x",size:9,stroke:2.2})],40,Cc)):e.createCommentVNode("",!0)],46,ac)}),128))],4),B.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!B.value.above}]),style:e.normalizeStyle({left:B.value.x+"px",top:B.value.y+"px"})},e.toDisplayString(B.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(Ga,{key:3,x:y.value.x,y:y.value.y,container:s.value,"has-image":!!((f=e.unref(le)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((A=e.unref(le)(m.value,y.value.nodeId))!=null&&A.link),"has-note":!!((S=e.unref(le)(m.value,y.value.nodeId))!=null&&S.note),"has-code":((M=(L=e.unref(le)(m.value,y.value.nodeId))==null?void 0:L.richContent)==null?void 0:M.kind)==="code","has-table":((oe=(G=e.unref(le)(m.value,y.value.nodeId))==null?void 0:G.richContent)==null?void 0:oe.kind)==="table","node-markers":((pe=e.unref(le)(m.value,y.value.nodeId))==null?void 0:pe.markers)??[],"node-tags":((Ve=e.unref(le)(m.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:Xn,onRemoveImage:Te,onSetLink:pn,onRemoveLink:te,onEditNote:Gt,onRemoveNote:Be,onAddCode:Ot,onEditCode:Ot,onRemoveCode:it,onAddTable:Lt,onEditTable:Lt,onRemoveTable:jt,onToggleMarker:Op,onClearMarkers:Lp,onAddTag:Vp,onRemoveTags:$p,onClose:de},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ja,{key:4,x:p.value.x,y:p.value.y,container:s.value,onOpenSettings:Pe,onOpenData:Je,onOpenImport:Ke,onExportPng:Zl,onExportSvg:No,onClose:je},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(O.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=R=>i("canvas-toggle-preview"))},[e.createVNode(ke,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ac),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:"显示大纲视图",onClick:a[16]||(a[16]=R=>i("canvas-outline"))},[e.createVNode(ke,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",_c,e.toDisplayString(Math.round(e.unref(J).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...R)=>e.unref(J).zoomIn&&e.unref(J).zoomIn(...R))},[e.createVNode(ke,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...R)=>e.unref(J).zoomOut&&e.unref(J).zoomOut(...R))},[e.createVNode(ke,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(ke,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:fp},[e.createVNode(ke,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=R=>Fl(1))},[e.createVNode(ke,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=R=>Fl(2))},[e.createVNode(ke,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:mp},[e.createVNode(ke,{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:Tp},[e.createVNode(ke,{name:"export"})]),r.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]=R=>g.value&&on(g.value))},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Mc)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=R=>g.value&&Fe(g.value))},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rc)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=R=>Wr("mindmap"))},[e.createVNode(ke,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=R=>Wr("tree"))},[e.createVNode(ke,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=R=>Wr("org"))},[e.createVNode(ke,{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:Sp},[e.createVNode(ke,{name:"import"})])],64))],2)],544)],4)}}}),vc={class:"zm-outline-root"},Bc={class:"zm-outline-search"},zc={key:0,class:"zm-outline-search-count"},Ic={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Oc={class:"zm-outline-actions"},Lc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Dc={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Vc={key:1,d:"M5 12 L10 17 L19 7"},$c={class:"zm-outline"},Pc=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Fc=["title","onClick"],Uc={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Hc={key:0,points:"6 9 12 15 18 9"},Wc={key:1,points:"9 6 15 12 9 18"},Gc={key:1,class:"zm-outline-dot"},jc={class:"zm-outline-index"},Kc={key:3,class:"zm-outline-text"},Yc=["onClick"],qc=["src"],Xc=["onClick"],Zc=["src"],Jc=["title","onClick"],Qc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ed={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},td={key:1,d:"M5 12 L10 17 L19 7"},br=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,i=e.ref(""),s=e.ref(null),c=e.ref(-1),u=e.computed(()=>{const p=i.value.trim().toLowerCase();if(!p)return new Set;const O=new Set,D=q=>{var de;(q.text.toLowerCase().includes(p)||(de=q.note)!=null&&de.text&&q.note.text.toLowerCase().includes(p))&&O.add(q.id);for(const ge of q.children)D(ge)};return D(n.data),O}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,O=D=>{let q=u.value.has(D.id);for(const de of D.children)O(de)&&(q=!0);return q&&p.add(D.id),q};return O(n.data),p}),g=e.computed(()=>{const p=[],O=D=>{u.value.has(D.id)&&p.push(D.id);for(const q of D.children)O(q)};return O(n.data),p}),b=e.computed(()=>i.value.trim().length>0),w=e.computed(()=>{const p=[],O=d.value,D=(q,de,ge)=>{if(b.value&&!O.has(q.id))return;const je=q.children.length>0,Pe=b.value?!1:n.collapsedIds.has(q.id);p.push({id:q.id,text:q.text||"(无标题)",depth:de,siblingIndex:ge,hasChildren:je,collapsed:Pe,node:q}),je&&!Pe&&q.children.forEach((Je,Ke)=>D(Je,de+1,Ke))};return D(n.data,0,0),p});function N(){c.value=g.value.length>0?0:-1}function V(){const p=g.value;p.length!==0&&(c.value=(c.value+1)%p.length,B(c.value))}function _(){const p=g.value;p.length!==0&&(c.value=(c.value-1+p.length)%p.length,B(c.value))}function $(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?_():V()):p.key==="Escape"&&(p.preventDefault(),i.value="",c.value=-1)}function B(p){const O=g.value[p];if(!O)return;const D=w.value.find(q=>q.id===O);D&&r("select",D.node),e.nextTick(()=>{const q=document.querySelector(`[data-outline-id="${O}"]`);q==null||q.scrollIntoView({block:"nearest",behavior:"smooth"})})}function T(){i.value="",c.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.focus()})});const E=e.ref(null),k=e.ref("");let m=null;function v(p){n.readonly||(E.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function x(){E.value!=null&&(r("edit",{id:E.value,text:k.value.trim()||"(无标题)"}),j())}function j(){E.value=null,k.value="",m=null}function K(p){p.key==="Enter"?(p.preventDefault(),x()):p.key==="Escape"&&(p.preventDefault(),j())}e.onBeforeUnmount(j);const ne=e.ref(null),ce=e.ref(null),re=e.ref(null);function Y(p,O){if(n.readonly){p.preventDefault();return}ne.value={id:O.id,text:O.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",O.id))}function ee(){ne.value=null,ce.value=null,re.value=null}function ie(p,O){if(!ne.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const D=F(p);ce.value=O.id,re.value=D}function z(p){ce.value===p.id&&(ce.value=null,re.value=null)}function C(p,O){p.preventDefault();const D=ne.value;if(!D)return;const q=F(p);D.id!==O.id&&r("move",{srcId:D.id,targetId:O.id,position:q}),ee()}function F(p,O){const q=p.currentTarget.getBoundingClientRect(),de=p.clientY-q.top,ge=q.height;return de<ge*.3?"before":de>ge*.7?"after":"child"}const P=e.ref(null);let W=null;async function ae(p){try{return await navigator.clipboard.writeText(p),!0}catch{const O=document.createElement("textarea");O.value=p,document.body.appendChild(O),O.select();let D=!1;try{D=document.execCommand("copy")}finally{document.body.removeChild(O)}return D}}async function we(p,O,D){p.stopPropagation(),await ae(O)&&(P.value=D,W&&clearTimeout(W),W=setTimeout(()=>P.value=null,1200))}const ve=e.computed(()=>{const p=[],O=(D,q)=>{const de=" ".repeat(q),ge=q===0?"":"- ";p.push(de+ge+(D.text||""));for(const je of D.children)O(je,q+1)};return O(n.data,0),p.join(`
26
+ `)}),ze=e.ref(!1);let Ne=null;async function y(){await ae(ve.value)&&(ze.value=!0,Ne&&clearTimeout(Ne),Ne=setTimeout(()=>ze.value=!1,1200))}return(p,O)=>(e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("div",Bc,[O[3]||(O[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":O[0]||(O[0]=D=>i.value=D),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:N,onKeydown:$},null,544),[[e.vModelText,i.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",zc,e.toDisplayString(c.value+1)+"/"+e.toDisplayString(g.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Ic,"无结果")):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:T},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Oc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ze.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Lc,[ze.value?(e.openBlock(),e.createElementBlock("path",Vc)):(e.openBlock(),e.createElementBlock("rect",Dc)),O[4]||(O[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(ze.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.id,"data-outline-id":D.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":D.id===t.selectedId,"is-root":D.depth===0,"is-editing":E.value===D.id,"is-search-hit":u.value.has(D.id),"is-search-current":g.value[c.value]===D.id,"is-drag-over-before":ce.value===D.id&&re.value==="before","is-drag-over-after":ce.value===D.id&&re.value==="after","is-drag-over-child":ce.value===D.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+D.depth*16+"px"}),draggable:"true",onClick:q=>r("select",D.node),onDblclick:q=>v(D),onDragstart:q=>Y(q,D),onDragend:ee,onDragover:q=>ie(q,D),onDragleave:()=>z(D),onDrop:q=>C(q,D)},[D.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:D.collapsed?"展开":"折叠",onClick:e.withModifiers(q=>r("toggleCollapse",D.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Uc,[D.collapsed?(e.openBlock(),e.createElementBlock("polyline",Wc)):(e.openBlock(),e.createElementBlock("polyline",Hc))]))],8,Fc)):(e.openBlock(),e.createElementBlock("span",Gc)),e.createElementVNode("span",jc,e.toDisplayString(D.siblingIndex+1)+".",1),E.value===D.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":O[1]||(O[1]=q=>k.value=q),class:"zm-outline-input",onBlur:x,onKeydown:K,onClick:O[2]||(O[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Kc,e.toDisplayString(D.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(q=>r("addSibling",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,qc)],8,Yc)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(q=>r("addChild",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Zc)],8,Xc)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":P.value===D.id}]),title:P.value===D.id?"已复制":"复制节点文本",onClick:q=>we(q,D.text,D.id)},[(e.openBlock(),e.createElementBlock("svg",Qc,[P.value!==D.id?(e.openBlock(),e.createElementBlock("rect",ed)):(e.openBlock(),e.createElementBlock("path",td)),O[5]||(O[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Jc)],46,Pc))),128))])]))}}),nd=["aria-hidden"],od=["aria-hidden"],rd={key:0,class:"zm-drawer-header"},id={key:0,class:"zm-drawer-title"},ld={class:"zm-drawer-body"},ad=["aria-hidden"],sd={key:0,class:"zm-drawer-header"},cd={key:0,class:"zm-drawer-title"},dd={class:"zm-drawer-body"},An=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function r(){n("update:open",!1)}function i(){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&&i())},null,8,nd)):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",rd,[t.title?(e.openBlock(),e.createElementBlock("h3",id,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:r},[...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",ld,[e.renderSlot(s.$slots,"default")])],14,od)):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",sd,[t.title?(e.openBlock(),e.createElementBlock("h3",cd,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:r},[...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",dd,[e.renderSlot(s.$slots,"default")])],14,ad)):e.createCommentVNode("",!0)]),_:3}))}}),ud={key:0,class:"zm-jtv-root"},fd={key:0,class:"zm-jtv-key"},md={key:1,class:"zm-jtv-colon"},pd={key:2,class:"zm-jtv-key zm-jtv-bracket"},gd={key:3,class:"zm-jtv-size"},hd={key:4,class:"zm-jtv-bracket"},bd={key:5,class:"zm-jtv-brace"},kd={key:0,class:"zm-jtv-children"},yd={class:"zm-jtv-key"},Ed={key:0,class:"zm-jtv-key"},xd=["src","alt"],wd=["href"],Nd=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),r=e.computed(()=>n.value==="object"),i=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!i.value);const s=e.computed(()=>{if(i.value)return`Array(${o.value.length})`;if(r.value){const E=o.value,k=Object.keys(E);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),c=e.computed(()=>i.value?o.value.map((E,k)=>({key:String(k),value:E})):r.value?Object.entries(o.value).map(([E,k])=>({key:E,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(E,k,m){E!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(E)||o.collapsedPaths.add(E))}o.isRoot||g(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(E){return u.value===""?E:`${u.value}.${E}`}function N(E){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof E=="string"?E.toLowerCase().includes(k):E===null?"null".includes(k):String(E).toLowerCase().includes(k)}function V(E){return o.query?E.toLowerCase().includes(o.query.toLowerCase()):!0}function _(E,k){return!o.query||V(E)?!0:k===null||typeof k!="object"?N(k):!0}function $(E){return E===null?"null":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"?E?"true":"false":typeof E=="number"?String(E):typeof E>"u"?"undefined":JSON.stringify(E)}function B(E){if(typeof E!="string")return!1;const k=E.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function T(E){if(!o.query)return null;const k=E.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:E.slice(0,k),match:E.slice(k,k+o.query.length),after:E.slice(k+o.query.length)}}return(E,k)=>{var v,x,j,K,ne,ce;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.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,_(re.key,re.value)]])),128))])):r.value||i.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:b},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(t.keyName),1)),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",md,":")),i.value?(e.openBlock(),e.createElementBlock("span",pd,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",hd,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",bd,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.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,_(re.key,re.value)]])),128))])),!d.value&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&r.value&&!i.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),V(t.keyName)&&T(t.keyName)?(e.openBlock(),e.createElementBlock("span",Ed,[e.createElementVNode("span",null,e.toDisplayString((v=T(t.keyName))==null?void 0:v.before),1),e.createElementVNode("mark",null,e.toDisplayString((x=T(t.keyName))==null?void 0:x.match),1),e.createElementVNode("span",null,e.toDisplayString((j=T(t.keyName))==null?void 0:j.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[T($(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=T($(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=T($(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((ce=T($(t.value)))==null?void 0:ce.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString($(t.value)),1)],64))],2),B(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,xd),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,wd)])):e.createCommentVNode("",!0)],4))}}}),Sd={class:"zm-data-panel"},Td={class:"zm-data-header"},Cd={class:"zm-data-title"},Ad={class:"zm-data-title-meta"},_d={class:"zm-data-toolbar"},Md=["title"],Rd={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vd={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"},Bd={key:0,class:"zm-data-paste"},zd={class:"zm-data-tabs"},Id=["placeholder"],Od={key:0,class:"zm-data-error"},Ld={class:"zm-data-paste-actions"},Dd=["disabled"],Vd={class:"zm-data-tree"},kr=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),b=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function N(){try{await navigator.clipboard.writeText(i.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=i.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function V(){const k=new Blob([i.value],{type:"application/json"}),m=URL.createObjectURL(k),v=document.createElement("a");v.href=m,v.download=`${n.data.text||"mindmap"}.json`,v.click(),URL.revokeObjectURL(m)}function _(){c.value=null;const k=s.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=Vn(k);r("import",m),s.value="",u.value=!1}catch(m){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){c.value="JSON 缺少 id 或 children 字段";return}r("import",m),s.value="",u.value=!1}catch(m){c.value="JSON 解析失败:"+m.message}}}function $(k){return 1+k.children.reduce((m,v)=>m+$(v),0)}const B=e.computed(()=>$(n.data)),T=e.computed(()=>i.value.length);function E(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var x;const m=(x=k.files)==null?void 0:x[0];if(!m)return;const v=new FileReader;v.onload=()=>{typeof v.result=="string"&&(s.value=v.result,_())},v.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",Sd,[e.createElementVNode("div",Td,[e.createElementVNode("div",Cd,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Ad,e.toDisplayString(B.value)+" 节点 · "+e.toDisplayString(T.value)+" chars",1)])]),e.createElementVNode("div",_d,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:N},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",Rd,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",vd,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Md),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:V},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:E},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=v=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=v=>w.value=v),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=v=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",zd,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=v=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=v=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=v=>s.value=v),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Id),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Od,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ld,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:_},"应用",8,Dd),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=v=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=v=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vd,[e.createVNode(Nd,{value:t.data,query:w.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),$d={class:"zm-md-panel"},Pd={key:0,class:"zm-md-error"},Fd={class:"zm-md-split"},Ud={class:"zm-md-edit"},Hd={class:"zm-md-preview"},Wd={class:"zm-md-preview-body"},Gd={class:"zm-md-footer"},jd=["disabled"],Kd=`# flow-mindmap 思维导图
24
27
 
25
28
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
26
29
 
@@ -59,77 +62,77 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ae=w,Y=P),V===void 0&&
59
62
 
60
63
  ## 开源协议
61
64
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
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
- `),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 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
- `).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 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],`
65
+ `,yr=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,i=e.ref($n(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const B=Vn(i.value||"");return s.value=null,B}catch(B){return s.value=B.message,{id:"preview_fallback",text:i.value||"(空)",children:[]}}}),d=e.computed(()=>Ct(u.value));let g=null;e.watch(i,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var B;return(B=c.value)==null?void 0:B.resetView()},250)});function b(){try{const B=Vn(i.value||"");s.value=null,r("import",B)}catch(B){s.value=B.message}}function w(){i.value=$n(n.data),s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function N(){i.value="",s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function V(){const B=document.createElement("input");B.type="file",B.accept=".md,text/markdown,text/plain",B.onchange=()=>{var k;const T=(k=B.files)==null?void 0:k[0];if(!T)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(i.value=E.result,s.value=null,e.nextTick(()=>{var m;return(m=c.value)==null?void 0:m.resetView()}))},E.readAsText(T)},B.click()}function _(){const B=new Blob([i.value],{type:"text/markdown;charset=utf-8"}),T=URL.createObjectURL(B),E=document.createElement("a");E.href=T;const k=(n.data.text||"mindmap").trim()||"mindmap";E.download=`${k}.md`,E.click(),URL.revokeObjectURL(T)}function $(){i.value=Kd,s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}return(B,T)=>(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:V},[...T[1]||(T[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:_},[...T[2]||(T[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)])]),T[3]||(T[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:$},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:N},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Ud,[T[4]||(T[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":T[0]||(T[0]=E=>i.value=E),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Hd,[T[5]||(T[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Wd,[e.createVNode(Fo,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Gd,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!i.value.trim(),onClick:b},"应用到导图",8,jd)])]))}}),Yd={class:"zm-settings-panel"},qd={class:"zm-settings-section"},Xd={class:"zm-settings-field"},Zd={class:"zm-settings-control"},Jd={class:"zm-color-input-wrap"},Qd=["value"],eu={class:"zm-color-input-text"},tu={class:"zm-swatch-row zm-swatch-row--compact"},nu=["title","onClick"],ou={class:"zm-settings-field"},ru=["value"],iu={class:"zm-slider"},lu=["value"],au={class:"zm-settings-field"},su=["value"],cu={class:"zm-slider"},du=["value"],uu={class:"zm-settings-field"},fu={class:"zm-line-style-group"},mu=["title","onClick"],pu=["viewBox"],gu={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hu={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},bu={class:"zm-line-style-label"},ku={class:"zm-settings-field"},yu={key:0,class:"zm-palette-dropdown"},Eu={class:"zm-settings-field"},xu=["value"],wu={label:"内置配色"},Nu=["value"],Su={key:0,label:"自定义"},Tu=["value"],Cu={key:0,class:"zm-palette-preview-bar"},Au={key:1,class:"zm-palette-custom-editor"},_u=["value"],Mu={class:"zm-palette-custom-actions"},Ru={class:"zm-settings-field"},vu={class:"zm-settings-field"},Bu={class:"zm-settings-preview"},zu={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Iu=["x1","y1","x2","y2","stroke","stroke-width"],Ou={key:0,class:"zm-settings-section"},Lu={class:"zm-settings-section-title"},Du={key:0,class:"zm-settings-section-sub"},Vu={class:"zm-settings-field"},$u={class:"zm-settings-value-tag"},Pu={class:"zm-swatch-row"},Fu=["title","onClick"],Uu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Hu=["value"],Wu={class:"zm-settings-field"},Gu={class:"zm-settings-value-tag"},ju={class:"zm-swatch-row"},Ku=["title","onClick"],Yu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},qu=["value"],Xu={class:"zm-settings-field"},Zu=["value"],Ju=["value"],Qu={class:"zm-settings-field"},ef=["value"],tf={class:"zm-slider"},nf=["value"],of={class:"zm-settings-section zm-settings-section--actions"},Er=((t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,r=o;function i(v,x){r("update:settings",{[v]:x})}const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function u(v){r("update:nodeStyle",v)}const d=e.computed(()=>[...Jt,...n.settings.customPalettes]),g=e.reactive({});function b(v){return g[v.id]===void 0&&(g[v.id]=v.colors.join(`
66
+ `)),g[v.id]}function w(v){const x=g[v.id]??"",j=Ea(x);if(j.length===0){g[v.id]=v.colors.join(`
67
+ `);return}const K=n.settings.customPalettes.map(ne=>ne.id===v.id?{...ne,colors:j}:ne);r("update:settings",{customPalettes:K})}function N(){const v=d.value.find(ce=>ce.id===n.settings.branchPaletteId),x=v?[...v.colors]:[...Jt[0].colors],j="custom-";let K=j+(n.settings.customPalettes.length+1);for(;Jt.some(ce=>ce.id===K)||n.settings.customPalettes.some(ce=>ce.id===K);)K=j+Math.random().toString(36).slice(2,7);const ne={id:K,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:K}),g[K]=x.join(`
68
+ `)}function V(v){const x=n.settings.customPalettes.filter(K=>K.id!==v.id),j=n.settings.branchPaletteId===v.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...j!==n.settings.branchPaletteId?{branchPaletteId:j}:{}}),delete g[v.id]}const _=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],$=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],B=[0,1,2,3],T=["#f87171","#fb923c","#34d399","#818cf8"];function E(v,x,j,K){if(x<=1)return j;const ne=v/(x-1);return j+(K-j)*ne}function k(v,x,j){return v<=0?x:v===1?Math.max(1.5,x*.67):v===2?Math.max(.8,x*.42):j}const m=e.computed(()=>{const v=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,j=n.settings.taperedEdge,K=B.length,ne=8,ce=192,re=d.value.find(ee=>ee.id===n.settings.branchPaletteId),Y=re&&re.colors.length?re.colors:T;return B.map((ee,ie)=>{const z=10+ie*60/(K-1);return{x1:ne,y1:z,x2:ce,y2:z,w:j?k(ee,v,x):E(ee,K,v,x),color:n.settings.rainbowBranch?Y[ie%Y.length]:"#94a3b8"}})});return(v,x)=>{var j,K,ne,ce,re,Y,ee,ie;return e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("section",qd,[x[35]||(x[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Xd,[x[21]||(x[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Zd,[e.createElementVNode("label",Jd,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=z=>i("canvasBg",z.target.value))},null,40,Qd),e.createElementVNode("span",eu,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",tu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,z=>e.createElementVNode("button",{key:"cbg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:C=>i("canvasBg",z)},null,14,nu)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=z=>i("canvasBg",void 0))},"∅")]),x[36]||(x[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",ou,[x[22]||(x[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=z=>i("lineWidthStart",parseFloat(z.target.value)||0))},null,40,ru)]),e.createElementVNode("div",iu,[x[23]||(x[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=z=>i("lineWidthStart",parseFloat(z.target.value)))},null,40,lu)]),e.createElementVNode("div",au,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=z=>i("lineWidthEnd",parseFloat(z.target.value)||0))},null,40,su)]),e.createElementVNode("div",cu,[x[25]||(x[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=z=>i("lineWidthEnd",parseFloat(z.target.value)))},null,40,du)]),x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",uu,[x[26]||(x[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",fu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,z=>e.createElementVNode("button",{key:z.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===z.value}]),title:z.label,onClick:C=>i("lineStyle",z.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:z.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[z.value==="curve"?(e.openBlock(),e.createElementBlock("path",gu)):(e.openBlock(),e.createElementBlock("line",hu))],8,pu)),e.createElementVNode("span",bu,e.toDisplayString(z.label),1)],10,mu)),64))])]),e.createElementVNode("div",ku,[x[28]||(x[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[6]||(x[6]=z=>i("rainbowBranch",!t.settings.rainbowBranch))},[...x[27]||(x[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",yu,[e.createElementVNode("div",Eu,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:x[7]||(x[7]=z=>i("branchPaletteId",z.target.value))},[e.createElementVNode("optgroup",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Jt),z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Nu))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Tu))),128))])):e.createCommentVNode("",!0)],40,xu)]),d.value.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Cu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((j=d.value.find(z=>z.id===t.settings.branchPaletteId))==null?void 0:j.colors,(z,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:z})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:b(t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)),onInput:x[8]||(x[8]=z=>g[t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId).id]=z.target.value)},null,40,_u),e.createElementVNode("div",Mu,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[9]||(x[9]=z=>w(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[10]||(x[10]=z=>V(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:N},"+ 新建配色")])):e.createCommentVNode("",!0),x[38]||(x[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Ru,[x[31]||(x[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[11]||(x[11]=z=>i("taperedEdge",!t.settings.taperedEdge))},[...x[30]||(x[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",vu,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[12]||(x[12]=z=>i("showOrderBadge",!t.settings.showOrderBadge))},[...x[32]||(x[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Bu,[(e.openBlock(),e.createElementBlock("svg",zu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(z,C)=>(e.openBlock(),e.createElementBlock("line",{key:C,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:t.settings.rainbowBranch?z.color:"#94a3b8","stroke-width":z.w,"stroke-linecap":"butt"},null,8,Iu))),128))])),x[34]||(x[34]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Ou,[e.createElementVNode("h4",Lu,[x[39]||(x[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Du,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vu,[x[40]||(x[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",$u,e.toDisplayString(((K=t.nodeStyle)==null?void 0:K.bg)||"默认"),1)]),e.createElementVNode("div",Pu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"bg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.bg)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({bg:z})},null,14,Fu)}),64)),e.createElementVNode("label",Uu,[e.createElementVNode("input",{type:"color",value:((ne=t.nodeStyle)==null?void 0:ne.bg)||"#ffffff",onInput:x[13]||(x[13]=z=>u({bg:z.target.value}))},null,40,Hu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[14]||(x[14]=z=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Wu,[x[41]||(x[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Gu,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",ju,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"fg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.textColor)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({textColor:z})},null,14,Ku)}),64)),e.createElementVNode("label",Yu,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.textColor)||"#1e2937",onInput:x[15]||(x[15]=z=>u({textColor:z.target.value}))},null,40,qu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[16]||(x[16]=z=>u({textColor:void 0}))},"∅")]),x[45]||(x[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Xu,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((Y=t.nodeStyle)==null?void 0:Y.fontWeight)??400,onChange:x[17]||(x[17]=z=>u({fontWeight:parseInt(z.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,z=>e.createElementVNode("option",{key:z.value,value:z.value},e.toDisplayString(z.label),9,Ju)),64))],40,Zu)]),e.createElementVNode("div",Qu,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ee=t.nodeStyle)==null?void 0:ee.fontSize)??14,onChange:x[18]||(x[18]=z=>u({fontSize:parseInt(z.target.value)||14}))},null,40,ef)]),e.createElementVNode("div",tf,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onInput:x[19]||(x[19]=z=>u({fontSize:parseInt(z.target.value)}))},null,40,nf)]),x[46]||(x[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",of,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[20]||(x[20]=z=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),Zi=20;function rf(t,o){t.style.height="auto";const n=o.minRows*Zi,r=o.maxRows>0?o.maxRows*Zi:1/0,i=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=i+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function xr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const s=t.value;s&&rf(s,n)}function i(){r()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",i),r())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>r()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",i)})}function wr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _n=wr();function Ji(t){_n=t}var Mn={exec:()=>null};function Wn(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=o[r];return i||(i=t(r),o[r]=i),i}}function xe(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(ot.caret,"$1"),n=n.replace(i,c),r},getRegex:()=>new RegExp(n,o)};return r}var lf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Wn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Wn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}>`))},af=/^(?:[ \t]*(?:\n|$))+/,sf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,io=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,el=xe(Qi).replace(/bull/g,Nr).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(),uf=xe(Qi).replace(/bull/g,Nr).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(),Sr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ff=/^[^\n]+/,Tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mf=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pf=xe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Nr).getRegex(),Uo="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",Cr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gf=xe("^ {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",Cr).replace("tag",Uo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tl=xe(Sr).replace("hr",io).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",Uo).getRegex(),hf=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tl).getRegex(),Ar={blockquote:hf,code:sf,def:mf,fences:cf,heading:df,hr:io,html:gf,lheading:el,list:pf,newline:af,paragraph:tl,table:Mn,text:ff},nl=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",io).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",Uo).getRegex(),bf={...Ar,lheading:uf,table:nl,paragraph:xe(Sr).replace("hr",io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nl).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",Uo).getRegex()},kf={...Ar,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cr).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:Mn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Sr).replace("hr",io).replace("heading",` *#{1,6} *[^
69
+ ]`).replace("lheading",el).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ef=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ol=/^( {2,}|\\)\n(?!\s*$)/,xf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gn=/[\p{P}\p{S}]/u,Ho=/[\s\p{P}\p{S}]/u,_r=/[^\s\p{P}\p{S}]/u,wf=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ho).getRegex(),rl=/(?!~)[\p{P}\p{S}]/u,Nf=/(?!~)[\s\p{P}\p{S}]/u,Sf=/(?:[^\s\p{P}\p{S}]|~)/u,Tf=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),il=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Cf=xe(il,"u").replace(/punct/g,Gn).getRegex(),Af=xe(il,"u").replace(/punct/g,rl).getRegex(),ll="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_f=xe(ll,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),Mf=xe(ll,"gu").replace(/notPunctSpace/g,Sf).replace(/punctSpace/g,Nf).replace(/punct/g,rl).getRegex(),Rf=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),vf=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Gn).getRegex(),Bf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zf=xe(Bf,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),If=xe(/\\(punct)/,"gu").replace(/punct/g,Gn).getRegex(),Of=xe(/^<(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(),Lf=xe(Cr).replace("(?:-->|$)","-->").getRegex(),Df=xe("^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",Lf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Vf=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Wo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),al=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Wo).replace("ref",Tr).getRegex(),sl=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tr).getRegex(),$f=xe("reflink|nolink(?!\\()","g").replace("reflink",al).replace("nolink",sl).getRegex(),cl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr={_backpedal:Mn,anyPunctuation:If,autolink:Of,blockSkip:Tf,br:ol,code:Ef,del:Mn,delLDelim:Mn,delRDelim:Mn,emStrongLDelim:Cf,emStrongRDelimAst:_f,emStrongRDelimUnd:Rf,escape:yf,link:Vf,nolink:sl,punctuation:wf,reflink:al,reflinkSearch:$f,tag:Df,text:xf,url:Mn},Pf={...Mr,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Wo).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wo).getRegex()},Rr={...Mr,emStrongRDelimAst:Mf,emStrongLDelim:Af,delLDelim:vf,delRDelim:zf,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cl).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:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cl).getRegex()},Ff={...Rr,br:xe(ol).replace("{2,}","*").getRegex(),text:xe(Rr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Go={normal:Ar,gfm:bf,pedantic:kf},lo={normal:Mr,gfm:Rr,breaks:Ff,pedantic:Pf},Uf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dl=t=>Uf[t];function Ut(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,dl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,dl);return t}function ul(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function fl(t,o){var s;let n=t.replace(ot.findPipe,(c,u,d)=>{let g=!1,b=u;for(;--b>=0&&d[b]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ot.slashPipe,"|");return r}function mn(t,o,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===o;)i++;return t.slice(0,r-i)}function ml(t){let o=t.split(`
70
+ `),n=o.length-1;for(;n>=0&&ot.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
71
+ `)}function Hf(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Wf(t,o=0){let n=o,r="";for(let i of t)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function pl(t,o,n,r,i){let s=o.href,c=o.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Gf(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let i=r[1];return o.split(`
72
+ `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=i.length?s.slice(i.length):s}).join(`
73
+ `)}var jo=class{constructor(t){Re(this,"options");Re(this,"rules");Re(this,"lexer");this.options=t||_n}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]:ml(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=Gf(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:r}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let r=mn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:mn(o[0],`
74
+ `),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:mn(o[0],`
75
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=mn(o[0],`
73
76
  `).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 f=u.join(`
75
- `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
76
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
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+`
77
+ `),r="",i="",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 g=u.join(`
78
+ `),b=g.replace(this.rules.other.blockquoteSetextReplace,`
79
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
80
+ ${g}`:g,i=i?`${i}
81
+ ${b}`:b;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,s,!0),this.lexer.state.top=w,n.length===0)break;let N=s.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){let V=N,_=V.raw+`
79
82
  `+n.join(`
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+`
83
+ `),$=this.blockquote(_);s[s.length-1]=$,r=r.substring(0,r.length-V.raw.length)+$.raw,i=i.substring(0,i.length-V.text.length)+$.text;break}else if((N==null?void 0:N.type)==="list"){let V=N,_=V.raw+`
81
84
  `+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-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
- `,1)[0],o[1].length),y=t.split(`
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
- `,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
- `,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(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],`
85
+ `),$=this.list(_);s[s.length-1]=$,r=r.substring(0,r.length-N.raw.length)+$.raw,i=i.substring(0,i.length-V.raw.length)+$.raw,n=_.substring(s.at(-1).raw.length).split(`
86
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,g="",b="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Wf(o[2].split(`
87
+ `,1)[0],o[1].length),N=t.split(`
88
+ `,1)[0],V=!w.trim(),_=0;if(this.options.pedantic?(_=2,b=w.trimStart()):V?_=o[1].length+1:(_=w.search(this.rules.other.nonSpaceChar),_=_>4?1:_,b=w.slice(_),_+=o[1].length),V&&this.rules.other.blankLine.test(N)&&(g+=N+`
89
+ `,t=t.substring(N.length+1),d=!0),!d){let $=this.rules.other.nextBulletRegex(_),B=this.rules.other.hrRegex(_),T=this.rules.other.fencesBeginRegex(_),E=this.rules.other.headingBeginRegex(_),k=this.rules.other.htmlBeginRegex(_),m=this.rules.other.blockquoteBeginRegex(_);for(;t;){let v=t.split(`
90
+ `,1)[0],x;if(N=v,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),x=N):x=N.replace(this.rules.other.tabCharGlobal," "),T.test(N)||E.test(N)||k.test(N)||m.test(N)||$.test(N)||B.test(N))break;if(x.search(this.rules.other.nonSpaceChar)>=_||!N.trim())b+=`
91
+ `+x.slice(_);else{if(V||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(w)||E.test(w)||B.test(w))break;b+=`
92
+ `+N}V=!N.trim(),g+=v+`
93
+ `,t=t.substring(v.length+1),w=x.slice(_)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),i.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),i.raw+=g}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let w={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=w.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!i.loose){let b=d.tokens.filter(N=>N.type==="space"),w=b.length>0&&b.some(N=>this.rules.other.anyLine.test(N.raw));i.loose=w}}if(i.loose)for(let d of i.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return i}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=ml(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:mn(o[0],`
94
+ `),href:r,title:i}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=fl(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
95
+ `):[],s={type:"table",raw:mn(o[0],`
96
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)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 i)s.rows.push(fl(u,s.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[g]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:mn(o[0],`
94
97
  `),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=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
- `),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
- `: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
+ `?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=mn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Hf(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 r=o[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),pl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=o[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return pl(n,i,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+i);(r=g.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(c=[...s].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&i%3&&!((i+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let b=[...r[0]][0].length,w=t.slice(0,i+r.index+b+c);if(Math.min(i,c)%2){let V=w.slice(1,-1);return{type:"em",raw:w,text:V,tokens:this.lexer.inlineTokens(V)}}let N=w.slice(2,-2);return{type:"strong",raw:w,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+i);(r=d.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(c=[...s].length,c!==i))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...r[0]][0].length,b=t.slice(0,i+r.index+g+c),w=b.slice(i,-i);return{type:"del",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,i;if(o[2]==="@")r=o[0],i="mailto:"+r;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]);r=o[0],o[1]==="www."?i="http://"+o[0]:i=o[0]}return{type:"link",raw:o[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},zt=class Kr{constructor(o){Re(this,"tokens");Re(this,"options");Re(this,"state");Re(this,"inlineQueue");Re(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||_n,this.options.tokenizer=this.options.tokenizer||new jo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ot,block:Go.normal,inline:lo.normal};this.options.pedantic?(n.block=Go.pedantic,n.inline=lo.pedantic):this.options.gfm&&(n.block=Go.gfm,this.options.breaks?n.inline=lo.breaks:n.inline=lo.gfm),this.tokenizer.rules=n}static get rules(){return{block:Go,inline:lo}}static lex(o,n){return new Kr(n).lex(o)}static lexInline(o,n){return new Kr(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
99
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let i=1/0;for(;o;){if(o.length<i)i=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(b=>(d=b.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 b=n.at(-1);d.raw.length===1&&b!==void 0?b.raw+=`
100
+ `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
98
101
  `)?"":`
99
- `)+d.raw,p.text+=`
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(`
102
+ `)+d.raw,b.text+=`
103
+ `+d.text,this.inlineQueue.at(-1).src=b.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 b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
101
104
  `)?"":`
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 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(`
105
+ `)+d.raw,b.text+=`
106
+ `+d.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,w=o.slice(1),N;this.options.extensions.startBlock.forEach(V=>{N=V.call({lexer:this},w),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(g=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
104
107
  `)?"":`
105
- `)+d.raw,p.text+=`
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(`
108
+ `)+d.raw,b.text+=`
109
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=g.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
107
110
  `)?"":`
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 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>
111
+ `)+d.raw,b.text+=`
112
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,b,w,N,V;this.tokenizer.lexer=this;let r=o,i=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)_.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;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 _;if((N=(w=this.options.extensions)==null?void 0:w.inline)!=null&&N.some(B=>(_=B.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let B=n.at(-1);_.type==="text"&&(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let $=o;if((V=this.options.extensions)!=null&&V.startInline){let B=1/0,T=o.slice(1),E;this.options.extensions.startInline.forEach(k=>{E=k.call({lexer:this},T),typeof E=="number"&&E>=0&&(B=Math.min(B,E))}),B<1/0&&B>=0&&($=o.substring(0,B+1))}if(_=this.tokenizer.inlineText($)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(u=_.raw.slice(-1)),c=!0;let B=n.at(-1);(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},ao=class{constructor(t){Re(this,"options");Re(this,"parser");this.options=t||_n}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let r=(s=(o||"").match(ot.notSpaceStart))==null?void 0:s[0],i=t.replace(ot.endingNewline,"")+`
113
+ `;return r?'<pre><code class="language-'+Ut(r)+'">'+(n?i:Ut(i,!0))+`</code></pre>
114
+ `:"<pre><code>"+(n?i:Ut(i,!0))+`</code></pre>
112
115
  `}blockquote({tokens:t}){return`<blockquote>
113
116
  ${this.parser.parse(t)}</blockquote>
114
117
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
115
118
  `}hr(t){return`<hr>
116
- `}list(t){let o=t.ordered,n=t.start,i="";for(let c=0;c<t.items.length;c++){let u=t.items[c];i+=this.listitem(u)}let r=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
117
- `+i+"</"+r+`>
119
+ `}list(t){let o=t.ordered,n=t.start,r="";for(let c=0;c<t.items.length;c++){let u=t.items[c];r+=this.listitem(u)}let i=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
120
+ `+r+"</"+i+`>
118
121
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
119
122
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
120
- `}table(t){let o="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);o+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
123
+ `}table(t){let o="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);o+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
121
124
  <thead>
122
125
  `+o+`</thead>
123
- `+i+`</table>
126
+ `+r+`</table>
124
127
  `}tablerow({text:t}){return`<tr>
125
128
  ${t}</tr>
126
129
  `}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>${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 |
130
+ `}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>${Ut(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),i=ul(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return o&&(s+=' title="'+Ut(o)+'"'),s+=">"+r+"</a>",s}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ul(t);if(i===null)return Ut(n);t=i;let s=`<img src="${t}" alt="${Ut(n)}"`;return o&&(s+=` title="${Ut(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ut(t.text)}},vr=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}},It=class Yr{constructor(o){Re(this,"options");Re(this,"renderer");Re(this,"textRenderer");this.options=o||_n,this.options.renderer=this.options.renderer||new ao,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vr}static parse(o,n){return new Yr(n).parse(o)}static parseInline(o,n){return new Yr(n).parseInline(o)}parse(o){var r,i;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";continue}}let u=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 i,s;this.renderer.parser=this;let r="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},so=(Yo=class{constructor(t){Re(this,"options");Re(this,"block");this.options=t||_n}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?zt.lex:zt.lexInline}provideParser(t=this.block){return t?It.parse:It.parseInline}},Re(Yo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Re(Yo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Yo),gl=class{constructor(...t){Re(this,"defaults",wr());Re(this,"options",this.setOptions);Re(this,"parse",this.parseMarkdown(!0));Re(this,"parseInline",this.parseMarkdown(!1));Re(this,"Parser",It);Re(this,"Renderer",ao);Re(this,"TextRenderer",vr);Re(this,"Lexer",zt);Re(this,"Tokenizer",jo);Re(this,"Hooks",so);this.use(...t)}walkTokens(t,o){var r,i;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;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[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 r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=o.renderers[i.name];s?o.renderers[i.name]=function(...c){let u=i.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[i.level];s?s.unshift(i.tokenizer):o[i.level]=[i.tokenizer],i.start&&(i.level==="block"?o.startBlock?o.startBlock.push(i.start):o.startBlock=[i.start]:i.level==="inline"&&(o.startInline?o.startInline.push(i.start):o.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(o.childTokens[i.name]=i.childTokens)}),r.extensions=o),n.renderer){let i=this.defaults.renderer||new ao(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new jo(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new so;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=i[c];so.passThroughHooks.has(s)?i[c]=g=>{if(this.defaults.async&&so.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await u.call(i,g);return d.call(i,w)})();let b=u.call(i,g);return d.call(i,b)}:i[c]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(i,g);return w===!1&&(w=await d.apply(i,g)),w})();let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),i&&(u=u.concat(i.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return zt.lex(t,o??this.defaults)}parser(t,o){return It.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.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(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(o):o,u=await(i.hooks?await i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(c,i),d=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let g=await(i.hooks?await i.hooks.provideParser(t):t?It.parse:It.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(g):g})().catch(s);try{i.hooks&&(o=i.hooks.preprocess(o));let c=(i.hooks?i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(o,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?It.parse:It.parseInline)(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
131
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ut(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Rn=new gl;function _e(t,o){return Rn.parse(t,o)}_e.options=_e.setOptions=function(t){return Rn.setOptions(t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.getDefaults=wr,_e.defaults=_n,_e.use=function(...t){return Rn.use(...t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.walkTokens=function(t,o){return Rn.walkTokens(t,o)},_e.parseInline=Rn.parseInline,_e.Parser=It,_e.parser=It.parse,_e.Renderer=ao,_e.TextRenderer=vr,_e.Lexer=zt,_e.lexer=zt.lex,_e.Tokenizer=jo,_e.Hooks=so,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,It.parse,zt.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 hl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,r=Array(o);n<o;n++)r[n]=t[n];return r}function jf(t){if(Array.isArray(t))return t}function Kf(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,c,u=[],d=!0,g=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){g=!0,i=b}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(g)throw i}}return u}}function Yf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
132
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qf(t,o){return jf(t)||Kf(t,o)||Xf(t,o)||Yf()}function Xf(t,o){if(t){if(typeof t=="string")return hl(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)?hl(t,o):void 0}}const bl=Object.entries,kl=Object.setPrototypeOf,Zf=Object.isFrozen,Jf=Object.getPrototypeOf,Qf=Object.getOwnPropertyDescriptor;let ct=Object.freeze,At=Object.seal,jn=Object.create,yl=typeof Reflect<"u"&&Reflect,Br=yl.apply,zr=yl.construct;ct||(ct=function(o){return o}),At||(At=function(o){return o}),Br||(Br=function(o,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return o.apply(n,i)}),zr||(zr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new o(...r)});const vn=Ge(Array.prototype.forEach),em=Ge(Array.prototype.lastIndexOf),El=Ge(Array.prototype.pop),Kn=Ge(Array.prototype.push),tm=Ge(Array.prototype.splice),dt=Array.isArray,co=Ge(String.prototype.toLowerCase),Ir=Ge(String.prototype.toString),xl=Ge(String.prototype.match),Yn=Ge(String.prototype.replace),wl=Ge(String.prototype.indexOf),nm=Ge(String.prototype.trim),om=Ge(Number.prototype.toString),rm=Ge(Boolean.prototype.toString),Nl=typeof BigInt>"u"?null:Ge(BigInt.prototype.toString),Sl=typeof Symbol>"u"?null:Ge(Symbol.prototype.toString),$e=Ge(Object.prototype.hasOwnProperty),uo=Ge(Object.prototype.toString),tt=Ge(RegExp.prototype.test),qn=im(TypeError);function Ge(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Br(t,o,r)}}function im(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return zr(t,n)}}function fe(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:co;if(kl&&kl(t,null),!dt(o))return t;let r=o.length;for(;r--;){let i=o[r];if(typeof i=="string"){const s=n(i);s!==i&&(Zf(o)||(o[r]=s),i=s)}t[i]=!0}return t}function lm(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=jn(null);for(const r of bl(t)){var n=qf(r,2);const i=n[0],s=n[1];$e(t,i)&&(dt(s)?o[i]=lm(s):s&&typeof s=="object"&&s.constructor===Object?o[i]=rt(s):o[i]=s)}return o}function am(t){switch(typeof t){case"string":return t;case"number":return om(t);case"boolean":return rm(t);case"bigint":return Nl?Nl(t):"0";case"symbol":return Sl?Sl(t):"Symbol()";case"undefined":return uo(t);case"function":case"object":{if(t===null)return uo(t);const o=t,n=Ht(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:uo(r)}return uo(t)}default:return uo(t)}}function Ht(t,o){for(;t!==null;){const r=Qf(t,o);if(r){if(r.get)return Ge(r.get);if(typeof r.value=="function")return Ge(r.value)}t=Jf(t)}function n(){return null}return n}function sm(t){try{return tt(t,""),!0}catch{return!1}}const Tl=ct(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Or=ct(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Lr=ct(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cm=ct(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dr=ct(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dm=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cl=ct(["#text"]),Al=ct(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Vr=ct(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_l=ct(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ko=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),um=At(/{{[\w\W]*|^[\w\W]*}}/g),fm=At(/<%[\w\W]*|^[\w\W]*%>/g),mm=At(/\${[\w\W]*/g),pm=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),gm=At(/^aria-[\-\w]+$/),Ml=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hm=At(/^(?:\w+script|data):/i),bm=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),km=At(/^html$/i),ym=At(/^[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},Em=function(){return typeof window>"u"?null:window},xm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");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}},Rl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Em();const o=X=>vl(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 r=n,i=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,w=t.trustedTypes,N=u.prototype,V=Ht(N,"cloneNode"),_=Ht(N,"remove"),$=Ht(N,"nextSibling"),B=Ht(N,"childNodes"),T=Ht(N,"parentNode"),E=Ht(N,"shadowRoot"),k=Ht(N,"attributes"),m=c&&c.prototype?Ht(c.prototype,"nodeType"):null,v=c&&c.prototype?Ht(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let x,j="",K=0;const ne=function(h){if(K>0)throw qn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');K++;try{return x.createHTML(h)}finally{K--}},ce=n,re=ce.implementation,Y=ce.createNodeIterator,ee=ce.createDocumentFragment,ie=ce.getElementsByTagName,z=r.importNode;let C=Rl();o.isSupported=typeof bl=="function"&&typeof T=="function"&&re&&re.createHTMLDocument!==void 0;const F=um,P=fm,W=mm,ae=pm,we=gm,ve=hm,ze=bm,Ne=ym;let y=Ml,p=null;const O=fe({},[...Tl,...Or,...Lr,...Dr,...Cl]);let D=null;const q=fe({},[...Al,...Vr,..._l,...Ko]);let de=Object.seal(jn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,je=null;const Pe=Object.seal(jn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Je=!0,Ke=!0,Xn=!1,pn=!0,te=!1,Gt=!0,Be=!1,Te=!1,Ot=!1,it=!1,Lt=!1,jt=!1,U=!0,Z=!1;const se="user-content-";let ye=!0,Me=!1,Qe={},pt=null;const gn=fe({},["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 fo=null;const Zn=fe({},["audio","video","img","source","image","track"]);let Bn=null;const qo=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jn="http://www.w3.org/1998/Math/MathML",Qn="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml";let Kt=gt,_t=!1,Ce=null;const he=fe({},[Jn,Qn,gt],Ir);let mo=fe({},["mi","mo","mn","ms","mtext"]),lt=fe({},["annotation-xml"]);const po=fe({},["title","style","font","a","script"]);let Q=null;const go=["application/xhtml+xml","text/html"],ho="text/html";let De=null,Qt=null;const Pr=n.createElement("form"),bo=function(h){return h instanceof RegExp||h instanceof Function},hn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qt&&Qt===h)return;(!h||typeof h!="object")&&(h={}),h=rt(h),Q=go.indexOf(h.PARSER_MEDIA_TYPE)===-1?ho:h.PARSER_MEDIA_TYPE,De=Q==="application/xhtml+xml"?Ir:co,p=$e(h,"ALLOWED_TAGS")&&dt(h.ALLOWED_TAGS)?fe({},h.ALLOWED_TAGS,De):O,D=$e(h,"ALLOWED_ATTR")&&dt(h.ALLOWED_ATTR)?fe({},h.ALLOWED_ATTR,De):q,Ce=$e(h,"ALLOWED_NAMESPACES")&&dt(h.ALLOWED_NAMESPACES)?fe({},h.ALLOWED_NAMESPACES,Ir):he,Bn=$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)?fe(rt(qo),h.ADD_URI_SAFE_ATTR,De):qo,fo=$e(h,"ADD_DATA_URI_TAGS")&&dt(h.ADD_DATA_URI_TAGS)?fe(rt(Zn),h.ADD_DATA_URI_TAGS,De):Zn,pt=$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)?fe({},h.FORBID_CONTENTS,De):gn,ge=$e(h,"FORBID_TAGS")&&dt(h.FORBID_TAGS)?fe({},h.FORBID_TAGS,De):rt({}),je=$e(h,"FORBID_ATTR")&&dt(h.FORBID_ATTR)?fe({},h.FORBID_ATTR,De):rt({}),Qe=$e(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?rt(h.USE_PROFILES):h.USE_PROFILES:!1,Je=h.ALLOW_ARIA_ATTR!==!1,Ke=h.ALLOW_DATA_ATTR!==!1,Xn=h.ALLOW_UNKNOWN_PROTOCOLS||!1,pn=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=h.SAFE_FOR_TEMPLATES||!1,Gt=h.SAFE_FOR_XML!==!1,Be=h.WHOLE_DOCUMENT||!1,it=h.RETURN_DOM||!1,Lt=h.RETURN_DOM_FRAGMENT||!1,jt=h.RETURN_TRUSTED_TYPE||!1,Ot=h.FORCE_BODY||!1,U=h.SANITIZE_DOM!==!1,Z=h.SANITIZE_NAMED_PROPS||!1,ye=h.KEEP_CONTENT!==!1,Me=h.IN_PLACE||!1,y=sm(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Ml,Kt=typeof h.NAMESPACE=="string"?h.NAMESPACE:gt,mo=$e(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(h.MATHML_TEXT_INTEGRATION_POINTS):fe({},["mi","mo","mn","ms","mtext"]),lt=$e(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?rt(h.HTML_INTEGRATION_POINTS):fe({},["annotation-xml"]);const I=$e(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?rt(h.CUSTOM_ELEMENT_HANDLING):jn(null);if(de=jn(null),$e(I,"tagNameCheck")&&bo(I.tagNameCheck)&&(de.tagNameCheck=I.tagNameCheck),$e(I,"attributeNameCheck")&&bo(I.attributeNameCheck)&&(de.attributeNameCheck=I.attributeNameCheck),$e(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),te&&(Ke=!1),Lt&&(it=!0),Qe&&(p=fe({},Cl),D=jn(null),Qe.html===!0&&(fe(p,Tl),fe(D,Al)),Qe.svg===!0&&(fe(p,Or),fe(D,Vr),fe(D,Ko)),Qe.svgFilters===!0&&(fe(p,Lr),fe(D,Vr),fe(D,Ko)),Qe.mathMl===!0&&(fe(p,Dr),fe(D,_l),fe(D,Ko))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Pe.tagCheck=h.ADD_TAGS:dt(h.ADD_TAGS)&&(p===O&&(p=rt(p)),fe(p,h.ADD_TAGS,De))),$e(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Pe.attributeCheck=h.ADD_ATTR:dt(h.ADD_ATTR)&&(D===q&&(D=rt(D)),fe(D,h.ADD_ATTR,De))),$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)&&fe(Bn,h.ADD_URI_SAFE_ATTR,De),$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.FORBID_CONTENTS,De)),$e(h,"ADD_FORBID_CONTENTS")&&dt(h.ADD_FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.ADD_FORBID_CONTENTS,De)),ye&&(p["#text"]=!0),Be&&fe(p,["html","head","body"]),p.table&&(fe(p,["tbody"]),delete ge.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=x;x=h.TRUSTED_TYPES_POLICY;try{j=ne("")}catch(Se){throw x=H,Se}}else x===void 0&&h.TRUSTED_TYPES_POLICY!==null&&(x=xm(w,i)),x&&typeof j=="string"&&(j=ne(""));(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&p===O&&(p=rt(p)),C.uponSanitizeAttribute.length>0&&D===q&&(D=rt(D)),ct&&ct(h),Qt=h},Xo=fe({},[...Or,...Lr,...cm]),ko=fe({},[...Dr,...dm]),en=function(h){let I=T(h);(!I||!I.tagName)&&(I={namespaceURI:Kt,tagName:"template"});const H=co(h.tagName),Se=co(I.tagName);return Ce[h.namespaceURI]?h.namespaceURI===Qn?I.namespaceURI===gt?H==="svg":I.namespaceURI===Jn?H==="svg"&&(Se==="annotation-xml"||mo[Se]):!!Xo[H]:h.namespaceURI===Jn?I.namespaceURI===gt?H==="math":I.namespaceURI===Qn?H==="math"&&lt[Se]:!!ko[H]:h.namespaceURI===gt?I.namespaceURI===Qn&&!lt[Se]||I.namespaceURI===Jn&&!mo[Se]?!1:!ko[H]&&(po[H]||!Xo[H]):!!(Q==="application/xhtml+xml"&&Ce[h.namespaceURI]):!1},ht=function(h){Kn(o.removed,{element:h});try{T(h).removeChild(h)}catch{_(h)}},Yt=function(h,I){try{Kn(o.removed,{attribute:I.getAttributeNode(h),from:I})}catch{Kn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(h),h==="is")if(it||Lt)try{ht(I)}catch{}else try{I.setAttribute(h,"")}catch{}},tn=function(h){let I=null,H=null;if(Ot)h="<remove></remove>"+h;else{const Ae=xl(h,/^[\r\n\t ]+/);H=Ae&&Ae[0]}Q==="application/xhtml+xml"&&Kt===gt&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const Se=x?ne(h):h;if(Kt===gt)try{I=new b().parseFromString(Se,Q)}catch{}if(!I||!I.documentElement){I=re.createDocument(Kt,"template",null);try{I.documentElement.innerHTML=_t?j:Se}catch{}}const me=I.body||I.documentElement;return h&&H&&me.insertBefore(n.createTextNode(H),me.childNodes[0]||null),Kt===gt?ie.call(I,Be?"html":"body")[0]:Be?I.documentElement:me},nn=function(h){return Y.call(h.ownerDocument||h,h,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},eo=function(h){var I,H;h.normalize();const Se=Y.call(h.ownerDocument||h,h,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let me=Se.nextNode();for(;me;){let We=me.data;vn([F,P,W],bt=>{We=Yn(We,bt," ")}),me.data=We,me=Se.nextNode()}const Ae=(I=(H=h.querySelectorAll)===null||H===void 0?void 0:H.call(h,"template"))!==null&&I!==void 0?I:[];vn(Array.from(Ae),We=>{bn(We.content)&&eo(We.content)})},zn=function(h){const I=v?v(h):null;return typeof I!="string"||De(I)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==k(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==m(h)||h.childNodes!==B(h)},bn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return m(h)===Wt.documentFragment}catch{return!1}},In=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return typeof m(h)=="number"}catch{return!1}};function J(X,h,I){vn(X,H=>{H.call(o,h,I,Qt)})}const et=function(h){let I=null;if(J(C.beforeSanitizeElements,h,null),zn(h))return ht(h),!0;const H=De(v?v(h):h.nodeName);if(J(C.uponSanitizeElement,h,{tagName:H,allowedTags:p}),Gt&&h.hasChildNodes()&&!In(h.firstElementChild)&&tt(/<[/\w!]/g,h.innerHTML)&&tt(/<[/\w!]/g,h.textContent)||Gt&&h.namespaceURI===gt&&H==="style"&&In(h.firstElementChild)||h.nodeType===Wt.progressingInstruction||Gt&&h.nodeType===Wt.comment&&tt(/<[/\w]/g,h.data))return ht(h),!0;if(ge[H]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(H))&&!p[H]){if(!ge[H]&&Eo(H)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H)))return!1;if(ye&&!pt[H]){const me=T(h),Ae=B(h);if(Ae&&me){const We=Ae.length;for(let bt=We-1;bt>=0;--bt){const yt=V(Ae[bt],!0);me.insertBefore(yt,$(h))}}}return ht(h),!0}return(m?m(h):h.nodeType)===Wt.element&&!en(h)||(H==="noscript"||H==="noembed"||H==="noframes")&&tt(/<\/no(script|embed|frames)/i,h.innerHTML)?(ht(h),!0):(te&&h.nodeType===Wt.text&&(I=h.textContent,vn([F,P,W],me=>{I=Yn(I,me," ")}),h.textContent!==I&&(Kn(o.removed,{element:h.cloneNode()}),h.textContent=I)),J(C.afterSanitizeElements,h,null),!1)},yo=function(h,I,H){if(je[I]||U&&(I==="id"||I==="name")&&(H in n||H in Pr))return!1;const Se=D[I]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(I,h);if(!(Ke&&!je[I]&&tt(ae,I))){if(!(Je&&tt(we,I))){if(!Se||je[I]){if(!(Eo(h)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,h)||de.tagNameCheck instanceof Function&&de.tagNameCheck(h))&&(de.attributeNameCheck instanceof RegExp&&tt(de.attributeNameCheck,I)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(I,h))||I==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H))))return!1}else if(!Bn[I]){if(!tt(y,Yn(H,ze,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&h!=="script"&&wl(H,"data:")===0&&fo[h])){if(!(Xn&&!tt(ve,Yn(H,ze,"")))){if(H)return!1}}}}}}return!0},kn=fe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Eo=function(h){return!kn[co(h)]&&tt(Ne,h)},Zo=function(h){J(C.beforeSanitizeAttributes,h,null);const I=h.attributes;if(!I||zn(h))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let Se=I.length;for(;Se--;){const me=I[Se],Ae=me.name,We=me.namespaceURI,bt=me.value,yt=De(Ae),on=bt;let Fe=Ae==="value"?on:nm(on);if(H.attrName=yt,H.attrValue=Fe,H.keepAttr=!0,H.forceKeepAttr=void 0,J(C.uponSanitizeAttribute,h,H),Fe=H.attrValue,Z&&(yt==="id"||yt==="name")&&wl(Fe,se)!==0&&(Yt(Ae,h),Fe=se+Fe),Gt&&tt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){Yt(Ae,h);continue}if(yt==="attributename"&&xl(Fe,"href")){Yt(Ae,h);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){Yt(Ae,h);continue}if(!pn&&tt(/\/>/i,Fe)){Yt(Ae,h);continue}te&&vn([F,P,W],xo=>{Fe=Yn(Fe,xo," ")});const Jo=De(h.nodeName);if(!yo(Jo,yt,Fe)){Yt(Ae,h);continue}if(x&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!We)switch(w.getAttributeType(Jo,yt)){case"TrustedHTML":{Fe=ne(Fe);break}case"TrustedScriptURL":{Fe=x.createScriptURL(Fe);break}}if(Fe!==on)try{We?h.setAttributeNS(We,Ae,Fe):h.setAttribute(Ae,Fe),zn(h)?ht(h):El(o.removed)}catch{Yt(Ae,h)}}J(C.afterSanitizeAttributes,h,null)},On=function(h){let I=null;const H=nn(h);for(J(C.beforeSanitizeShadowDOM,h,null);I=H.nextNode();)if(J(C.uponSanitizeShadowNode,I,null),et(I),Zo(I),bn(I.content)&&On(I.content),(m?m(I):I.nodeType)===Wt.element){const me=E?E(I):I.shadowRoot;bn(me)&&(Mt(me),On(me))}J(C.afterSanitizeShadowDOM,h,null)},Mt=function(h){const I=m?m(h):h.nodeType;if(I===Wt.element){const me=E?E(h):h.shadowRoot;bn(me)&&(Mt(me),On(me))}const H=B?B(h):h.childNodes;if(!H)return;const Se=[];vn(H,me=>{Kn(Se,me)});for(const me of Se)Mt(me);if(I===Wt.element){const me=v?v(h):null;if(typeof me=="string"&&De(me)==="template"){const Ae=h.content;bn(Ae)&&Mt(Ae)}}};return o.sanitize=function(X){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,H=null,Se=null,me=null;if(_t=!X,_t&&(X="<!-->"),typeof X!="string"&&!In(X)&&(X=am(X),typeof X!="string"))throw qn("dirty is not a string, aborting");if(!o.isSupported)return X;if(Te||hn(h),o.removed=[],typeof X=="string"&&(Me=!1),Me){const bt=v?v(X):X.nodeName;if(typeof bt=="string"){const yt=De(bt);if(!p[yt]||ge[yt])throw qn("root node is forbidden and cannot be sanitized in-place")}if(zn(X))throw qn("root node is clobbered and cannot be sanitized in-place");Mt(X)}else if(In(X))I=tn("<!---->"),H=I.ownerDocument.importNode(X,!0),H.nodeType===Wt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?I=H:I.appendChild(H),Mt(H);else{if(!it&&!te&&!Be&&X.indexOf("<")===-1)return x&&jt?ne(X):X;if(I=tn(X),!I)return it?null:jt?j:""}I&&Ot&&ht(I.firstChild);const Ae=nn(Me?X:I);for(;Se=Ae.nextNode();)et(Se),Zo(Se),bn(Se.content)&&On(Se.content);if(Me)return te&&eo(X),X;if(it){if(te&&eo(I),Lt)for(me=ee.call(I.ownerDocument);I.firstChild;)me.appendChild(I.firstChild);else me=I;return(D.shadowroot||D.shadowrootmode)&&(me=z.call(r,me,!0)),me}let We=Be?I.outerHTML:I.innerHTML;return Be&&p["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&tt(km,I.ownerDocument.doctype.name)&&(We="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
133
+ `+We),te&&vn([F,P,W],bt=>{We=Yn(We,bt," ")}),x&&jt?ne(We):We},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hn(X),Te=!0},o.clearConfig=function(){Qt=null,Te=!1},o.isValidAttribute=function(X,h,I){Qt||hn({});const H=De(X),Se=De(h);return yo(H,Se,I)},o.addHook=function(X,h){typeof h=="function"&&Kn(C[X],h)},o.removeHook=function(X,h){if(h!==void 0){const I=em(C[X],h);return I===-1?void 0:tm(C[X],I,1)[0]}return El(C[X])},o.removeHooks=function(X){C[X]=[]},o.removeAllHooks=function(){C=Rl()},o}var wm=vl();const Nm=new gl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new ao;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),i=gr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${i}</code></pre>`},t})()}),Sm=["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"],Tm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Cm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Am(t){if(!t)return"";const o=Nm.parse(t,{async:!1});return wm.sanitize(o,{ALLOWED_TAGS:Sm,ALLOWED_ATTR:Tm,ALLOWED_URI_REGEXP:Cm})}const _m={class:"zm-note-panel"},Mm={key:0,class:"zm-note-empty"},Rm={class:"zm-note-header"},vm={class:"zm-note-title-row"},Bm={class:"zm-note-name"},zm={class:"zm-note-meta"},Im={class:"zm-note-scroll"},Om={class:"zm-note-section"},Lm={class:"zm-note-section-head"},Dm={class:"zm-note-split"},Vm=["disabled"],$m={key:0,class:"zm-note-preview"},Pm=["innerHTML"],Fm={key:1,class:"zm-note-preview-hint"},Um={key:0,class:"zm-note-section-actions"},Hm={key:0,class:"zm-note-add-row"},Wm={key:1,class:"zm-note-section"},Gm=["disabled"],jm=["href","title"],Km={key:2,class:"zm-note-section"},Ym=["disabled"],qm=["src","alt"],Xm={key:3,class:"zm-note-section"},Zm={class:"zm-note-section-head"},Jm={key:0,class:"zm-note-section-tag"},Qm=["disabled"],ep={key:0,class:"zm-note-code"},tp=["innerHTML"],np={key:4,class:"zm-note-section"},op=["disabled"],rp={key:0,class:"zm-note-table"},ip=["onClick"],lp={class:"zm-note-table-sort-mark","aria-hidden":"true"},$r=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,r=o,i=e.ref(""),s=e.ref(null);xr(s,{minRows:4,maxRows:10});const c=e.computed(()=>!i.value||i.value.trim()===""),u=e.computed(()=>Am(i.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text]},()=>{var y,p;i.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function b(){var O,D;if(n.readonly)return;const y=i.value,p=((D=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:D.text)??"";y!==p&&r("apply",y)}function w(y){var p,O;n.readonly||(y.key==="Escape"?(y.preventDefault(),i.value=((O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),b(),y.target.blur()))}function N(){n.readonly||confirm("移除该节点的笔记?")&&(i.value="",r("remove"))}const V=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),_=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),$=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),B=e.computed(()=>$.value==="code"),T=e.computed(()=>$.value==="table"),E=e.ref(!1),k=e.ref(!1),m=e.ref(!1),v=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{E.value=!1,k.value=!1,m.value=!1,v.value=!1});const x=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:O.url]},()=>{var y,p;x.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function j(){var O,D;if(n.readonly)return;const y=x.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:D.url)??"";y!==p&&r("set-link",y)}const K=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:O.src]},()=>{var y,p;K.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ne(){var O,D;if(n.readonly)return;const y=K.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:D.src)??"";y!==p&&r("set-image",y)}function ce(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const Y=e.ref(""),ee=e.ref(null);xr(ee,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;Y.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>gr(Po(Y.value),Tn(Y.value)));function z(){var D,q;if(n.readonly)return;const y=Y.value,p=((q=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:q.raw)??"";if(y===p)return;const O=Tn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:O}:null)}const C=e.ref(""),F=e.ref(null);xr(F,{minRows:4,maxRows:14});const P=e.ref(-1),W=e.ref("asc");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;C.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",P.value=-1,W.value="asc"},{immediate:!0});function ae(){var O,D;if(n.readonly)return;const y=C.value,p=((D=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:D.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const we=e.computed(()=>hr(C.value)),ve=e.computed(()=>{const y=we.value;return P.value<0||y.length<=1?y:qi(y,P.value,W.value)});function ze(y){P.value!==y?(P.value=y,W.value="asc"):W.value==="asc"?W.value="desc":P.value=-1}const Ne=e.computed(()=>{const y=[];return c.value||y.push(`${i.value.length} 字`),V.value&&y.push("1 链接"),_.value&&y.push("1 图片"),B.value&&y.push("代码块"),T.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var O,D,q,de;return e.openBlock(),e.createElementBlock("div",_m,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Rm,[e.createElementVNode("div",vm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Bm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",zm,e.toDisplayString(Ne.value),1)]),e.createElementVNode("div",Im,[e.createElementVNode("section",Om,[e.createElementVNode("header",Lm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Dm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=ge=>i.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:w},null,40,Vm),[[e.vModelText,i.value]]),d.value?(e.openBlock(),e.createElementBlock("div",$m,[c.value?(e.openBlock(),e.createElementBlock("div",Fm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Pm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Um,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:N},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hm,[!V.value&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>E.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!B.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!T.value&&!v.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>v.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),V.value||E.value?(e.openBlock(),e.createElementBlock("section",Wm,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=ge=>x.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:j,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Gm),[[e.vModelText,x.value]]),V.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(O=t.selectedNode.link)==null?void 0:O.url,target:"_blank",rel:"noopener noreferrer",title:(D=t.selectedNode.link)==null?void 0:D.url},e.toDisplayString((q=t.selectedNode.link)==null?void 0:q.url),9,jm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||k.value?(e.openBlock(),e.createElementBlock("section",Km,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=ge=>K.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Ym),[[e.vModelText,K.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(de=t.selectedNode.image)==null?void 0:de.src,alt:t.selectedNode.text,onError:ce,onLoad:re},null,40,qm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||m.value?(e.openBlock(),e.createElementBlock("section",Xm,[e.createElementVNode("header",Zm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Tn)(Y.value)?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(e.unref(Tn)(Y.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":p[9]||(p[9]=ge=>Y.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:z},null,40,Qm),[[e.vModelText,Y.value]]),Y.value.trim()?(e.openBlock(),e.createElementBlock("pre",ep,[e.createElementVNode("code",{innerHTML:ie.value},null,8,tp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),T.value||v.value?(e.openBlock(),e.createElementBlock("section",np,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:F,"onUpdate:modelValue":p[10]||(p[10]=ge=>C.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
134
  | --- | --- |
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:`本导图用于演示节点的全部可渲染字段。
135
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,op),[[e.vModelText,C.value]]),we.value.length?(e.openBlock(),e.createElementBlock("table",rp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(ge,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Je}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":P.value===Je,"is-asc":P.value===Je&&W.value==="asc","is-desc":P.value===Je&&W.value==="desc"}]),onClick:Ke=>ze(Je)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",lp,e.toDisplayString(P.value===Je?W.value==="asc"?"▲":"▼":"↕"),1)],10,ip))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Je}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Mm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),ap={class:"zm-app"},sp={class:"zm-app-main"},cp={class:"zm-app-canvas"},Bl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
133
136
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
134
137
  渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
135
138
  interface Node {
@@ -160,4 +163,4 @@ function walk(n: Node) {
160
163
  | --- | --- | --- | --- | --- |
161
164
  | 1 | 2 | 3 | 4 | 5 |
162
165
  | 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 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"}})});
166
+ 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?r:typeof location<"u"&&location.hash==="#stress"?i:(typeof location<"u"&&location.hash==="#rich",o)}const r={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},i=(()=>{const y=(D,q)=>({id:D,text:q,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],O=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...O]}})(),s=e.ref(o),c=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.ref(!1),N=e.ref(0),V=e.ref(!1),_=e.ref(!1),$=e.ref(null);function B(){s.value=n()}function T(){g.value=!0,b.value=!1,w.value=!1}function E(y){T()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return c.value?((y=$.value)==null?void 0:y.getNodeStyle(c.value.id))??{}:{}});function v(y){var p;Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function x(y){var p;c.value&&((p=$.value)==null||p.applyNodeStyle(c.value.id,y))}function j(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function K(y){if(y.key==="Escape"){if(V.value){V.value=!1,y.stopPropagation();return}_.value&&(_.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",K),window.addEventListener("hashchange",B),(y=$.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",K),window.removeEventListener("hashchange",B)});function ne(y){s.value=y}function ce(y){var O;const p=y&&y.length>0?y[0]:null;c.value=p,p?!w.value&&((O=$.value)!=null&&O.nodeHasContent(p.id))&&(g.value=!1,b.value=!1,w.value=!0):w.value=!1}e.watch(s,y=>{if(!c.value)return;const p=Y(y,c.value.id);p?p!==c.value&&(c.value=p):c.value=null},{deep:!1});function re(y){if(!c.value||c.value.id!==y){const p=Y(s.value,y);p&&(c.value=p)}g.value=!1,b.value=!1,w.value=!0,N.value++}function Y(y,p){if(y.id===p)return y;for(const O of y.children){const D=Y(O,p);if(D)return D}return null}function ee(y){var p;c.value&&((p=$.value)==null||p.applyNodeNote(c.value.id,y))}function ie(){var y;c.value&&((y=$.value)==null||y.removeNodeNote(c.value.id))}function z(y){var p;c.value&&((p=$.value)==null||p.applyNodeLink(c.value.id,y))}function C(y){var p;c.value&&((p=$.value)==null||p.applyNodeImageByUrl(c.value.id,y))}function F(y){var p;c.value&&((p=$.value)==null||p.applyNodeRichContent(c.value.id,y))}function P(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function W(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function ae(y){var p;(p=$.value)==null||p.setNodeText(y.id,y.text)}function we(y){var p;(p=$.value)==null||p.addChild(y)}function ve(y){var p;(p=$.value)==null||p.addSibling(y)}function ze(y){var p;(p=$.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const Ne=e.computed(()=>{var y;return((y=c.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",ap,[e.createVNode(An,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=O=>d.value=O)},{default:e.withCtx(()=>[e.createVNode(br,{data:s.value,"selected-id":Ne.value,"collapsed-ids":u.value,onSelect:P,onToggleCollapse:W,onEdit:ae,onAddChild:we,onAddSibling:ve,onMove:ze},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",sp,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=O=>_.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",cp,[e.createVNode(Fo,{ref_key:"mindMapRef",ref:$,data:s.value,"preview-mode":_.value,onChange:ne,onSelect:ce,onEditNote:re,onCanvasSettings:p[2]||(p[2]=O=>V.value=!0),onCanvasData:T,onCanvasImport:E,onCanvasTogglePreview:p[3]||(p[3]=O=>_.value=!_.value),onCanvasOutline:p[4]||(p[4]=O=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(An,{side:"right",width:360,open:g.value&&!_.value,title:"数据","onUpdate:open":p[6]||(p[6]=O=>g.value=O)},{default:e.withCtx(()=>[e.createVNode(kr,{data:s.value,onImport:p[5]||(p[5]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:420,open:b.value&&!_.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=O=>b.value=O)},{default:e.withCtx(()=>[e.createVNode(yr,{data:s.value,onImport:p[7]||(p[7]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:360,open:w.value&&!_.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=O=>w.value=O)},{default:e.withCtx(()=>[e.createVNode($r,{"selected-node":c.value,readonly:!1,"focus-tick":N.value,onApply:ee,onRemove:ie,onSetLink:z,onSetImage:C,onSetRich:F},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:340,open:V.value&&!_.value,title:"设置","onUpdate:open":p[10]||(p[10]=O=>V.value=O)},{default:e.withCtx(()=>{var O;return[e.createVNode(Er,{settings:k,"has-selection":c.value!==null,"selected-node-text":(O=c.value)==null?void 0:O.text,"node-style":m.value,"onUpdate:settings":v,"onUpdate:nodeStyle":x,onReset:j},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),dp={install(t){t.component("FlowMindMap",Fo),t.component("FlowMindMapOutline",br),t.component("FlowMindMapDrawer",An),t.component("FlowMindMapDataPanel",kr),t.component("FlowMindMapMarkdownPanel",yr),t.component("FlowMindMapSettingsPanel",Er),t.component("FlowMindMapNotePanel",$r),t.component("FlowMindMapApp",Bl)}};be.DataPanel=kr,be.Drawer=An,be.MARKER_LIB=ir,be.MarkdownPanel=yr,be.MindMap=Fo,be.MindMapApp=Bl,be.NotePanel=$r,be.Outline=br,be.SettingsPanel=Er,be.addChild=ri,be.addSibling=ii,be.clone=Ct,be.default=dp,be.findNode=le,be.findParent=Bt,be.markdownToMindMap=Vn,be.markdownToRichMindMap=Ma,be.markerDef=Pa,be.markerLabel=si,be.markerSvg=zo,be.mindMapToMarkdown=$n,be.removeNode=Mo,be.richBlockToMarkdown=Ra,be.tagColor=lr,be.uid=Ft,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});