222 lines
278 KiB
JavaScript
222 lines
278 KiB
JavaScript
|
|
var Ha=Object.defineProperty;var Fa=(e,t,n)=>t in e?Ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>(Fa(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();/**
|
|||
|
|
* @vue/shared v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**//*! #__NO_SIDE_EFFECTS__ */function Hi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ce={},dn=[],Qe=()=>{},Ir=()=>!1,Oo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fi=e=>e.startsWith("onUpdate:"),Se=Object.assign,Ui=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ua=Object.prototype.hasOwnProperty,ne=(e,t)=>Ua.call(e,t),K=Array.isArray,un=e=>Io(e)==="[object Map]",Dr=e=>Io(e)==="[object Set]",G=e=>typeof e=="function",ke=e=>typeof e=="string",jt=e=>typeof e=="symbol",ge=e=>e!==null&&typeof e=="object",Pr=e=>(ge(e)||G(e))&&G(e.then)&&G(e.catch),jr=Object.prototype.toString,Io=e=>jr.call(e),qa=e=>Io(e).slice(8,-1),zr=e=>Io(e)==="[object Object]",qi=e=>ke(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Tn=Hi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Do=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Va=/-(\w)/g,It=Do(e=>e.replace(Va,(t,n)=>n?n.toUpperCase():"")),Wa=/\B([A-Z])/g,en=Do(e=>e.replace(Wa,"-$1").toLowerCase()),Br=Do(e=>e.charAt(0).toUpperCase()+e.slice(1)),ti=Do(e=>e?`on${Br(e)}`:""),Ot=(e,t)=>!Object.is(e,t),ro=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Hr=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},yi=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ss;const Po=()=>Ss||(Ss=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qn(e){if(K(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=ke(o)?Za(o):qn(o);if(i)for(const s in i)t[s]=i[s]}return t}else if(ke(e)||ge(e))return e}const Ya=/;(?![^(]*\))/g,Ka=/:([^]+)/,Ja=/\/\*[^]*?\*\//g;function Za(e){const t={};return e.replace(Ja,"").split(Ya).forEach(n=>{if(n){const o=n.split(Ka);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Gt(e){let t="";if(ke(e))t=e;else if(K(e))for(let n=0;n<e.length;n++){const o=Gt(e[n]);o&&(t+=o+" ")}else if(ge(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ga="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Xa=Hi(Ga);function Fr(e){return!!e||e===""}const Ur=e=>!!(e&&e.__v_isRef===!0),vt=e=>ke(e)?e:e==null?"":K(e)||ge(e)&&(e.toString===jr||!G(e.toString))?Ur(e)?vt(e.value):JSON.stringify(e,qr,2):String(e),qr=(e,t)=>Ur(t)?qr(e,t.value):un(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,i],s)=>(n[ni(o,s)+" =>"]=i,n),{})}:Dr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ni(n))}:jt(t)?ni(t):ge(t)&&!K(t)&&!zr(t)?String(t):t,ni=(e,t="")=>{var n;return jt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|||
|
|
* @vue/reactivity v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let je;class Qa{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=je,!t&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=je;try{return je=this,t()}finally{je=n}}}on(){++this._on===1&&(this.prevScope=je,je=this)}off(){this._on>0&&--this._on===0&&(je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function ec(){return je}let fe;const oi=new WeakSet;class Vr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,je&&je.active&&je.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,oi.has(this)&&(oi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Yr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ms(this),Kr(this);const t=fe,n=et;fe=this,et=!0;try{return this.fn()}finally{Jr(this),fe=t,et=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Yi(t);this.deps=this.depsTail=void 0,Ms(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?oi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){vi(this)&&this.run()}get dirty(){return vi(this)}}let Wr=0,An,Ln;function Yr(e,t=!1){if(e.flags|=8,t){e.next=Ln,Ln=e;return}e.next=An,An=e}function Vi(){Wr++}function Wi(){if(--Wr>0)return;if(Ln){let t=Ln;for(Ln=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;An;){let t=An;for(An=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Kr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Jr(e){let t,n=e.depsTail,o=n;for(;o;){const i=o.prevDep;o.version===-1?(o===n&&(n=i),Yi(o),tc(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=i}e.deps=t,e.depsTail=n}function vi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Zr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Zr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jn)||(e.globalVersion=jn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!vi(e))))return;e.flags|=2;const t=e.dep,n=fe,o=et;fe=e,et=!0;try{Kr(e);const i=e.fn(e._value);(t.version===0||Ot(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{fe=n,et=o,Jr(e),e.flags&=-3}}function Yi(e,t=!1){const{dep:n,prevSub:o,nextSub:i}=e;if(o&&(o.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Yi(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function tc(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let et=!0;const Gr=[];function Ct(){Gr.push(et),et=!1}function St(){const e=Gr.pop();et=e===void 0?!0:e}function Ms(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=fe;fe=void 0;try{t()}finally{fe=n}}}let jn=0;class nc{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=t
|
|||
|
|
* @vue/runtime-core v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/function Vn(e,t,n,o){try{return o?e(...o):e()}catch(i){zo(i,t,n)}}function pt(e,t,n,o){if(G(e)){const i=Vn(e,t,n,o);return i&&Pr(i)&&i.catch(s=>{zo(s,t,n)}),i}if(K(e)){const i=[];for(let s=0;s<e.length;s++)i.push(pt(e[s],t,n,o));return i}}function zo(e,t,n,o=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||ce;if(t){let l=t.parent;const a=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](e,a,d)===!1)return}l=l.parent}if(s){Ct(),Vn(s,null,10,[e,a,d]),St();return}}Tc(e,n,i,o,r)}function Tc(e,t,n,o=!0,i=!1){if(i)throw e;console.error(e)}const Re=[];let dt=-1;const hn=[];let Lt=null,ln=0;const ll=Promise.resolve();let vo=null;function al(e){const t=vo||ll;return e?t.then(this?e.bind(this):e):t}function Ac(e){let t=dt+1,n=Re.length;for(;t<n;){const o=t+n>>>1,i=Re[o],s=Bn(i);s<e||s===e&&i.flags&2?t=o+1:n=o}return t}function Qi(e){if(!(e.flags&1)){const t=Bn(e),n=Re[Re.length-1];!n||!(e.flags&2)&&t>=Bn(n)?Re.push(e):Re.splice(Ac(t),0,e),e.flags|=1,cl()}}function cl(){vo||(vo=ll.then(ul))}function Lc(e){K(e)?hn.push(...e):Lt&&e.id===-1?Lt.splice(ln+1,0,e):e.flags&1||(hn.push(e),e.flags|=1),cl()}function Ts(e,t,n=dt+1){for(;n<Re.length;n++){const o=Re[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Re.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function dl(e){if(hn.length){const t=[...new Set(hn)].sort((n,o)=>Bn(n)-Bn(o));if(hn.length=0,Lt){Lt.push(...t);return}for(Lt=t,ln=0;ln<Lt.length;ln++){const n=Lt[ln];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Lt=null,ln=0}}const Bn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ul(e){const t=Qe;try{for(dt=0;dt<Re.length;dt++){const n=Re[dt];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),Vn(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;dt<Re.length;dt++){const n=Re[dt];n&&(n.flags&=-2)}dt=-1,Re.length=0,dl(),vo=null,(Re.length||hn.length)&&ul()}}let We=null,fl=null;function xo(e){const t=We;return We=e,fl=e&&e.type.__scopeId||null,t}function $c(e,t=We,n){if(!t||e._n)return e;const o=(...i)=>{o._d&&js(-1);const s=xo(t);let r;try{r=e(...i)}finally{xo(s),o._d&&js(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function As(e,t){if(We===null)return e;const n=Uo(We),o=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,r,l,a=ce]=t[i];s&&(G(s)&&(s={mounted:s,updated:s}),s.deep&&kt(r),o.push({dir:s,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Ht(e,t,n,o){const i=e.dirs,s=t&&t.dirs;for(let r=0;r<i.length;r++){const l=i[r];s&&(l.oldValue=s[r].value);let a=l.dir[o];a&&(Ct(),pt(a,n,8,[e.el,l,e,t]),St())}}const Rc=Symbol("_vte"),Oc=e=>e.__isTeleport,Ic=Symbol("_leaveCb");function es(e,t){e.shapeFlag&6&&e.component?(e.transition=t,es(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function hl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $n(e,t,n,o,i=!1){if(K(e)){e.forEach((b,x)=>$n(b,t&&(K(t)?t[x]:t),n,o,i));return}if(Rn(o)&&!i){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&$n(e,t,n,o.component.subTree);return}const s=o.shapeFlag&4?Uo(o.component):o.el,r=i?null:s,{i:l,r:a}=e,d=t&&t.r,c=l.refs===ce?l.refs={}:l.refs,u=l.setupState,f=te(u),y=u===ce?Ir:b=>ne(f,b);if(d!=null&&d!==a){if(ke(d))c[d]=null,y(d)&&(u[d]=null);else if(Le(d)){d.value=null;const b=t;b.k&&(c[b.k]=null)}}if(G(a))Vn(a,l,12,[r,c]);else{const b=ke(a),x=Le(a);if(b||x){const v=()=>{if(e.f){const M=b?y(a)?u[a]:c[a]:a.value;if(i)K(M)&&Ui(M,s);else if(K(M))M.includes(s)||M.push(s);else if(b)c[a]=[s],y(a)&&(u[a]=c[a]);else{const R=[s];a.value=R,e.k&&(c[e.k]=R)}}else b?(c[a]=r,y(a)&&(u[a]=r)):x&&(a.value=r,e.k&&(c[e.k]=r))};r?(v.id=-1,Fe(v,n)):v()}}}Po().requestIdleCallback;Po().cancelIdleCallback;const Rn=e=>!!e.type.__asyncLoader,pl=e=>e.type.__isKeepAlive;function Dc(e,t){ml(e,"a",t)}function Pc(e,t){ml(e,"da",t)}function ml(e,t,n=Oe){const o=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}ret
|
|||
|
|
* @vue/runtime-dom v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let Ni;const Fs=typeof window<"u"&&window.trustedTypes;if(Fs)try{Ni=Fs.createPolicy("vue",{createHTML:e=>e})}catch{}const Pl=Ni?e=>Ni.createHTML(e):e=>e,Hd="http://www.w3.org/2000/svg",Fd="http://www.w3.org/1998/Math/MathML",xt=typeof document<"u"?document:null,Us=xt&&xt.createElement("template"),Ud={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?xt.createElementNS(Hd,e):t==="mathml"?xt.createElementNS(Fd,e):n?xt.createElement(e,{is:n}):xt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>xt.createTextNode(e),createComment:e=>xt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>xt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,s){const r=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{Us.innerHTML=Pl(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Us.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},qd=Symbol("_vtc");function Vd(e,t,n){const o=e[qd];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _o=Symbol("_vod"),jl=Symbol("_vsh"),Wd={name:"show",beforeMount(e,{value:t},{transition:n}){e[_o]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):kn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),kn(e,!0),o.enter(e)):o.leave(e,()=>{kn(e,!1)}):kn(e,t))},beforeUnmount(e,{value:t}){kn(e,t)}};function kn(e,t){e.style.display=t?e[_o]:"none",e[jl]=!t}const Yd=Symbol(""),Kd=/(^|;)\s*display\s*:/;function Jd(e,t,n){const o=e.style,i=ke(n);let s=!1;if(n&&!i){if(t)if(ke(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&uo(o,l,"")}else for(const r in t)n[r]==null&&uo(o,r,"");for(const r in n)r==="display"&&(s=!0),uo(o,r,n[r])}else if(i){if(t!==n){const r=o[Yd];r&&(n+=";"+r),o.cssText=n,s=Kd.test(n)}}else t&&e.removeAttribute("style");_o in e&&(e[_o]=s?o.display:"",e[jl]&&(o.display="none"))}const qs=/\s*!important$/;function uo(e,t,n){if(K(n))n.forEach(o=>uo(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=Zd(e,t);qs.test(n)?e.setProperty(en(o),n.replace(qs,""),"important"):e[o]=n}}const Vs=["Webkit","Moz","ms"],di={};function Zd(e,t){const n=di[t];if(n)return n;let o=It(t);if(o!=="filter"&&o in e)return di[t]=o;o=Br(o);for(let i=0;i<Vs.length;i++){const s=Vs[i]+o;if(s in e)return di[t]=s}return t}const Ws="http://www.w3.org/1999/xlink";function Ys(e,t,n,o,i,s=Xa(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ws,t.slice(6,t.length)):e.setAttributeNS(Ws,t,n):n==null||s&&!Fr(n)?e.removeAttribute(t):e.setAttribute(t,s?"":jt(n)?String(n):n)}function Ks(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Pl(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const l=s==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Fr(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(i||t)}function an(e,t,n,o){e.addEventListener(t,n,o)}function Gd(e,t,n,o){e.removeEventListener(t,n,o)}const Js=Symbol("_vei");function Xd(e,t,n,o,i=null){const s=e[Js]||(e[Js]={}),r=s[t];if(o&&r)r.value=o;else{const[l,a]=Qd(t);if(o){const d=s[t]=nu(o,i);an(e,l,d,a)}else r&&(Gd(e,l,r,a),s[t]=void 0)}}const Zs=/(?:Once|Passive|Capture)$/;function Qd(e)
|
|||
|
|
<use xlink:href="#icon-${y}"></use>
|
|||
|
|
</svg>`,b},o=n("cm-add_child","zijiedian"),i=n("cm-add_sibling","tongjijiedian-"),s=n("cm-remove_child","shanchu2"),r=n("cm-up","rising"),l=n("cm-down","falling"),a=n("cm-edit","edit"),d=document.createElement("ul");if(d.className="menu-list",t&&t.extend)for(let f=0;f<t.extend.length;f++){const y=t.extend[f],b=n(y.name,y.name);d.appendChild(b),b.onclick=x=>{y.onclick(x)}}const c=document.createElement("mmenu");c.className="mobile-menu",c.appendChild(o),c.appendChild(i),c.appendChild(s),c.appendChild(r),c.appendChild(l),c.appendChild(a),c.hidden=!0,e.container.append(c);let u=!0;e.bus.addListener("unselectNode",function(){c.hidden=!0}),e.bus.addListener("selectNode",function(f){c.hidden=!1,f.root?u=!0:u=!1}),c.onclick=f=>{f.target===c&&(c.hidden=!0)},o.onclick=()=>{e.addChild()},i.onclick=()=>{u||e.insertSibling()},s.onclick=()=>{u||e.removeNode()},r.onclick=f=>{u||e.moveUpNode()},l.onclick=f=>{u||e.moveDownNode()},a.onclick=f=>{e.beginEdit()}}const Ai=document,zu=function(e,t){if(!t)return Li(e),e;const n=e.getElementsByClassName("insert-preview"),o=`insert-preview ${t} show`;if(n.length>0)n[0].className=o;else{const i=Ai.createElement("div");i.className=o,e.appendChild(i)}return e},Li=function(e){if(!e)return;const t=e.getElementsByClassName("insert-preview");for(const n of t||[])n.remove()},sr=function(e,t){const n=t.parentElement.parentElement.contains(e);return e&&e.tagName==="ME-TPC"&&e!==t&&!n&&e.nodeObj.root!==!0},Bu=function(e){const t=document.createElement("div");return t.className="mind-elixir-ghost",e.map.appendChild(t),t};function Hu(e){let t=null,n=null,o=null;const i=Bu(e),s=12;e.map.addEventListener("dragstart",r=>{var l;const a=r.target;if((a==null?void 0:a.tagName)!=="ME-TPC"){r.preventDefault();return}t=a,t.parentElement.parentElement.style.opacity="0.5",i.innerHTML=t.innerHTML,(l=r.dataTransfer)==null||l.setDragImage(i,0,0),Ge.clear()}),e.map.addEventListener("dragend",async r=>{if(!t)return;t.parentElement.parentElement.style.opacity="1";const l=r.target;if(l.style.opacity="",!o)return;Li(o);const a=t.nodeObj;switch(n){case"before":e.moveNodeBefore(t,o),e.selectNode(ve(a.id));break;case"after":e.moveNodeAfter(t,o),e.selectNode(ve(a.id));break;case"in":e.moveNode(t,o);break}t=null}),e.map.addEventListener("dragover",pu(function(r){if(!t)return;Li(o);const l=Ai.elementFromPoint(r.clientX,r.clientY-s);if(sr(l,t)){o=l;const a=l.getBoundingClientRect().y;r.clientY>a+l.clientHeight?n="after":r.clientY>a+l.clientHeight/2&&(n="in")}else{const a=Ai.elementFromPoint(r.clientX,r.clientY+s);if(sr(a,t)){o=a;const d=a.getBoundingClientRect().y;r.clientY<d?n="before":r.clientY<d+a.clientHeight/2&&(n="in")}else n=o=null}o&&zu(o,n)},200))}const Fu=function(e){return["createSummary","removeSummary","finishEditSummary"].includes(e.name)?{type:"summary",value:e.obj.id}:["createCustomLink","removeCustomLink","finishEditCustomLinkLabel"].includes(e.name)?{type:"customLink",value:e.obj.id}:["removeNodes"].includes(e.name)?{type:"nodes",value:e.objs.map(t=>t.id)}:{type:"node",value:e.obj.id}};function Uu(e){let t=[],n=-1,o=e.getData();e.bus.addListener("operation",i=>{if(i.name==="beginEdit")return;t=t.slice(0,n+1);const s=e.getData();t.push({prev:o,currentObject:Fu(i),next:s}),o=s,n=t.length-1}),e.undo=function(){if(n>-1){const i=t[n];o=i.prev,e.refresh(i.prev),i.currentObject.type==="node"&&e.selectNode(ve(i.currentObject.value)),n--,console.log("current",o)}},e.redo=function(){if(n<t.length-1){n++;const i=t[n];o=i.next,e.refresh(i.next),i.currentObject.type==="node"&&e.selectNode(ve(i.currentObject.value))}},e.map.addEventListener("keydown",i=>{(i.metaKey||i.ctrlKey)&&i.shiftKey&&i.key==="Z"?e.redo():(i.metaKey||i.ctrlKey)&&i.key==="z"&&e.undo()})}const Wt=(e,t)=>{const n=document.createElement("span");return n.id=e,n.innerHTML=`<svg class="icon" aria-hidden="true">
|
|||
|
|
<use xlink:href="#icon-${t}"></use>
|
|||
|
|
</svg>`,n};function qu(e){const t=document.createElement("div"),n=Wt("fullscreen","full"),o=Wt("toCenter","living"),i=Wt("zoomout","move"),s=Wt("zoomin","add"),r=document.createElement("span");return r.innerText="100%",t.appendChild(n),t.appendChild(o),t.appendChild(i),t.appendChild(s),t.className="mind-elixir-toolbar rb",n.onclick=()=>{e.container.requestFullscreen()},o.onclick=()=>{e.toCenter()},i.onclick=()=>{e.scaleVal<.6||e.scale(e.scaleVal-=.2)},s.onclick=()=>{e.scaleVal>1.6||e.scale(e.scaleVal+=.2)},t}function Vu(e){const t=document.createElement("div"),n=Wt("tbltl","left"),o=Wt("tbltr","right"),i=Wt("tblts","side");return t.appendChild(n),t.appendChild(o),t.appendChild(i),t.className="mind-elixir-toolbar lt",n.onclick=()=>{e.initLeft()},o.onclick=()=>{e.initRight()},i.onclick=()=>{e.initSide()},t}function Wu(e){e.container.append(qu(e)),e.container.append(Vu(e))}/*! @viselect/vanilla v3.3.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */var Yu=Object.defineProperty,Ku=(e,t,n)=>t in e?Yu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,me=(e,t,n)=>(Ku(e,typeof t!="symbol"?t+"":t,n),n);class Ju{constructor(){me(this,"_listeners",new Map),me(this,"on",this.addEventListener),me(this,"off",this.removeEventListener),me(this,"emit",this.dispatchEvent)}addEventListener(t,n){const o=this._listeners.get(t)??new Set;return this._listeners.set(t,o),o.add(n),this}removeEventListener(t,n){var o;return(o=this._listeners.get(t))==null||o.delete(n),this}dispatchEvent(t,...n){let o=!0;for(const i of this._listeners.get(t)??[])o=i(...n)!==!1&&o;return o}unbindAllListeners(){this._listeners.clear()}}const rr=(e,t="px")=>typeof e=="number"?e+t:e;function Tt({style:e},t,n){if(typeof t=="object")for(const[o,i]of Object.entries(t))i!==void 0&&(e[o]=rr(i));else n!==void 0&&(e[t]=rr(n))}function Jl(e){return(t,n,o,i={})=>{t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);for(const s of t)for(const r of n)s[e](r,o,{capture:!1,...i});return[t,n,o,i]}}const on=Jl("addEventListener"),At=Jl("removeEventListener"),oo=e=>{var t;const{clientX:n,clientY:o,target:i}=((t=e.touches)==null?void 0:t[0])??e;return{x:n,y:o,target:i}};function lr(e,t,n="touch"){switch(n){case"center":{const o=t.left+t.width/2,i=t.top+t.height/2;return o>=e.left&&o<=e.right&&i>=e.top&&i<=e.bottom}case"cover":return t.left>=e.left&&t.top>=e.top&&t.right<=e.right&&t.bottom<=e.bottom;case"touch":return e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}}function sn(e,t=document){const n=Array.isArray(e)?e:[e];let o=[];for(let i=0,s=n.length;i<s;i++){const r=n[i];typeof r=="string"?o=o.concat(Array.from(t.querySelectorAll(r))):r instanceof Element&&o.push(r)}return o}const Zu=()=>matchMedia("(hover: none), (pointer: coarse)").matches,Gu=()=>"safari"in window,Xu=e=>{let t,n=-1,o=!1;return{next(...i){t=i,o||(o=!0,n=requestAnimationFrame(()=>{e(...t),o=!1}))},cancel(){cancelAnimationFrame(n),o=!1}}},{abs:Ut,max:ar,min:cr,ceil:dr}=Math;let Zl=class extends Ju{constructor(t){var n,o,i,s,r;super(),me(this,"_options"),me(this,"_selection",{stored:[],selected:[],touched:[],changed:{added:[],removed:[]}}),me(this,"_area"),me(this,"_clippingElement"),me(this,"_targetElement"),me(this,"_targetRect"),me(this,"_selectables",[]),me(this,"_latestElement"),me(this,"_areaRect",new DOMRect),me(this,"_areaLocation",{y1:0,x2:0,y2:0,x1:0}),me(this,"_singleClick",!0),me(this,"_frame"),me(this,"_scrollAvailable",!0),me(this,"_scrollingActive",!1),me(this,"_scrollSpeed",{x:0,y:0}),me(this,"_scrollDelta",{x:0,y:0}),me(this,"disable",this._bindStartEvents.bind(this,!1)),me(this,"enable",this._bindStartEvents),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...t,behaviour:{overlap:"invert",intersect:"touch",...t.behaviour,startThreshold:(n=t.behaviour)!=null&&n.startThreshold?typeof t.behaviour.startThreshold=="number"?t.behaviour.startThreshold:
|
|||
|
|
|
|||
|
|
`;function n(o,i){for(let s=0;s<o.length;s++)i<=6?t+="".padStart(i,"#")+" "+o[s].topic+`
|
|||
|
|
|
|||
|
|
`:t+="".padStart(i-7," ")+"- "+o[s].topic+`
|
|||
|
|
`,o[s].children&&n(o[s].children||[],i+1)}return n(e.children||[],2),t},hf=function(){this.editable=!0},pf=function(){this.editable=!1},mf=function(e){this.scaleVal=e,this.map.style.transform="scale("+e+")"},gf=function(){this.container.scrollTo(1e4-this.container.offsetWidth/2,1e4-this.container.offsetHeight/2)},bf=function(e){e(this)},yf=function(e){e.nodeObj.root||(this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=e.nodeObj,this.nodeData.root=!0,this.initRight(),this.toCenter())},vf=function(){this.isFocusMode=!1,this.tempDirection!==null&&(delete this.nodeData.root,this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},xf=function(){this.direction=0,this.refresh()},wf=function(){this.direction=1,this.refresh()},kf=function(){this.direction=2,this.refresh()},_f=function(e){this.locale=e,this.refresh()},Ef=function(e,t){const n=e.nodeObj;typeof t=="boolean"?n.expanded=t:n.expanded!==!1?n.expanded=!1:n.expanded=!0,this.layout(),this.linkDiv(),this.bus.fire("expandNode",n)},Cf=function(e){e&&(e=JSON.parse(JSON.stringify(e)),this.nodeData=e.nodeData,this.linkData=e.linkData||{},this.summaries=e.summaries||[]),mt(this.nodeData),this.layout(),this.linkDiv()},Sf=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:vf,disableEdit:pf,enableEdit:hf,expandNode:Ef,focusNode:yf,getData:uf,getDataMd:ff,getDataString:df,initLeft:xf,initRight:wf,initSide:kf,install:bf,refresh:Cf,scale:mf,selectFirstChild:af,selectNextSibling:rf,selectNode:tf,selectNodes:of,selectParent:cf,selectPrevSibling:lf,setLocale:_f,toCenter:gf,unselectNode:nf,unselectNodes:sf},Symbol.toStringTag,{value:"Module"})),zt=e=>{var t;const n=(t=e.parent)==null?void 0:t.children,o=n.indexOf(e);return{siblings:n,index:o}};function Mf(e){const{siblings:t,index:n}=zt(e),o=t[n];n===0?(t[n]=t[t.length-1],t[t.length-1]=o):(t[n]=t[n-1],t[n-1]=o)}function Nf(e){const{siblings:t,index:n}=zt(e),o=t[n];n===t.length-1?(t[n]=t[0],t[0]=o):(t[n]=t[n+1],t[n+1]=o)}function Jn(e){const{siblings:t,index:n}=zt(e);return t.splice(n,1),t.length}function Tf(e,t){const{siblings:n,index:o}=zt(e);n.splice(o+1,0,t)}function Af(e,t){const{siblings:n,index:o}=zt(e);n.splice(o,0,t)}function Lf(e,t){const{siblings:n,index:o}=zt(e);n[o]=t,t.children=[e]}function $f(e,t){Jn(e),t.children?t.children.push(e):t.children=[e]}function Rf(e,t){e.direction!==void 0&&(e.direction=t.direction),Jn(e);const{siblings:n,index:o}=zt(t);n.splice(o,0,e)}function Of(e,t){e.direction!==void 0&&(e.direction=t.direction),Jn(e);const{siblings:n,index:o}=zt(t);n.splice(o+1,0,e)}const Xl=function(e,t){var n,o;if(e===Xe)return Xe;if(e===Vt)return Vt;if(e===Yn){const i=((n=document.querySelector(".lhs"))==null?void 0:n.childElementCount)||0,s=((o=document.querySelector(".rhs"))==null?void 0:o.childElementCount)||0;return i<=s?(t.direction=Xe,Xe):(t.direction=Vt,Vt)}},Ql=function(e,t){var n,o;if(!e)return null;const i=e.nodeObj;i.expanded===!1&&(this.expandNode(e,!0),e=ve(i.id));const s=t||this.generateNewObj();i.children?i.children.push(s):i.children=[s],mt(this.nodeData);const r=e.parentElement,{grp:l,top:a}=this.createWrapper(s);if(r.tagName==="ME-PARENT"){if(r.children[1])r.nextSibling.appendChild(l);else{const d=this.createChildren([l]);r.appendChild(qo(!0)),r.insertAdjacentElement("afterend",d)}this.linkDiv(l.offsetParent)}else r.tagName==="ME-ROOT"&&(Xl(this.direction,s)===Xe?(n=document.querySelector(".lhs"))==null||n.appendChild(l):(o=document.querySelector(".rhs"))==null||o.appendChild(l),this.linkDiv());return{newTop:a,newNodeObj:s}},ea=function(e,t){const n=e.parentNode;if(t===0){const o=n.parentNode.parentNode;o.tagName!=="ME-MAIN"&&o.previousSibling.children[1].remove()}n.parentNode.remove()},Vo=function(e){const t=e.parentElement.parentElement.lastElementChild;(t==null?void 0:t.tagName)==="svg"&&(t==null||t.remove())},If=function(e,t){console.log(t);const n=e.nodeObj,o=Ul(n);o.style&&t.style&&(t.style=Object.assign(o.style,t.style)
|
|||
|
|
`).forEach((r,l)=>{const a=document.createElementNS("http://www.w3.org/2000/svg","text");we(a,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+wh(t.lineHeight,t.fontSize)*(l+1)+parseFloat(t.fontSize)*(l+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),a.innerHTML=r,i.appendChild(a)}),i}function _h(e,t,n,o){let i="";e.text?i=e.text.textContent:i=e.childNodes[0].textContent;const s=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");we(s,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const r=document.createElement("div");return we(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),r.innerHTML=i,s.appendChild(r),s}function hi(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:i,offsetTop:s}=gn(e.nodes,t),r=document.createElementNS("http://www.w3.org/2000/svg","rect");we(r,{x:i+"",y:s+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const l=document.createElementNS("http://www.w3.org/2000/svg","g");l.appendChild(r);let a;return n?a=_h(t,o,i,s):a=kh(t,o,i,s),l.appendChild(a),l}function Eh(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:i}=gn(e.nodes,t),s=document.createElementNS("http://www.w3.org/2000/svg","a"),r=document.createElementNS("http://www.w3.org/2000/svg","text");return we(r,{x:o+"",y:i+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=t.textContent,s.appendChild(r),s.setAttribute("href",t.href),s}const io=100,Ch='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',oa=(e,t=!1)=>{var n,o,i;const s=e.nodes,r=s.offsetHeight+io*2,l=s.offsetWidth+io*2,a=xh(r+"px",l+"px"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),c=document.createElementNS("http://www.w3.org/2000/svg","rect");we(c,{x:"0",y:"0",width:`${l}`,height:`${r}`,fill:e.theme.cssVar["--bgcolor"]}),a.appendChild(c),s.querySelectorAll(".subLines").forEach(b=>{const x=b.cloneNode(!0),{offsetLeft:v,offsetTop:M}=gn(s,b.parentElement);x.setAttribute("x",`${v}`),x.setAttribute("y",`${M}`),d.appendChild(x)});const u=(n=s.querySelector(".lines"))==null?void 0:n.cloneNode(!0);u&&d.appendChild(u);const f=(o=s.querySelector(".topiclinks"))==null?void 0:o.cloneNode(!0);f&&d.appendChild(f);const y=(i=s.querySelector(".summary"))==null?void 0:i.cloneNode(!0);return y&&d.appendChild(y),s.querySelectorAll("me-tpc").forEach(b=>{d.appendChild(hi(e,b,!t))}),s.querySelectorAll(".tags > span").forEach(b=>{d.appendChild(hi(e,b))}),s.querySelectorAll(".icons > span").forEach(b=>{d.appendChild(hi(e,b))}),s.querySelectorAll(".hyper-link").forEach(b=>{d.appendChild(Eh(e,b))}),we(d,{x:io+"",y:io+"",overflow:"visible"}),a.appendChild(d),Ch+a.outerHTML};function Sh(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=i=>{t(i.target.result)},o.onerror=i=>{n(i)},o.readAsDataURL(e)})}const Mh=function(e=!1){const t=oa(this,e);return new Blob([t],{type:"image/svg+xml"})},Nh=async function(e=!1){const t=oa(this,e),n=new Blob([t],{type:"image/svg+xml"}),o=await Sh(n);return new Promise((i,s)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(i,"image/png",1)},r.src=o,r.onerror=s})},Th=Object.freeze(Object.defineProperty({__proto__:null,exportPng:Nh,exportSvg:Mh},Symbol.toStringTag,{value:"Module"}));function Ah(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const pr=Object.keys(ta),ia={};for(let e=0;e<pr.length;e++){const t=pr[e];ia[t]=Ah(ta[t],t)}const Lh={getObjById:Co,generateNewObj:mu,layo
|
|||
|
|
`).forEach(function(r){i=r.indexOf(":"),n=r.substring(0,i).trim().toLowerCase(),o=r.substring(i+1).trim(),!(!n||t[n]&&Op[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},vr=Symbol("internals");function En(e){return e&&String(e).trim().toLowerCase()}function ho(e){return e===!1||e==null?e:_.isArray(e)?e.map(ho):String(e)}function Dp(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const Pp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pi(e,t,n,o,i){if(_.isFunction(o))return o.call(this,t,n);if(i&&(t=n),!!_.isString(t)){if(_.isString(o))return t.indexOf(o)!==-1;if(_.isRegExp(o))return o.test(t)}}function jp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function zp(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(i,s,r){return this[o].call(this,t,i,s,r)},configurable:!0})})}class Zo{constructor(t){t&&this.set(t)}set(t,n,o){const i=this;function s(l,a,d){const c=En(a);if(!c)throw new Error("header name must be a non-empty string");const u=_.findKey(i,c);(!u||i[u]===void 0||d===!0||d===void 0&&i[u]!==!1)&&(i[u||a]=ho(l))}const r=(l,a)=>_.forEach(l,(d,c)=>s(d,c,a));if(_.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(_.isString(t)&&(t=t.trim())&&!Pp(t))r(Ip(t),n);else if(_.isObject(t)&&_.isIterable(t)){let l={},a,d;for(const c of t){if(!_.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[d=c[0]]=(a=l[d])?_.isArray(a)?[...a,c[1]]:[a,c[1]]:c[1]}r(l,n)}else t!=null&&s(n,t,o);return this}get(t,n){if(t=En(t),t){const o=_.findKey(this,t);if(o){const i=this[o];if(!n)return i;if(n===!0)return Dp(i);if(_.isFunction(n))return n.call(this,i,o);if(_.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=En(t),t){const o=_.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||pi(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let i=!1;function s(r){if(r=En(r),r){const l=_.findKey(o,r);l&&(!n||pi(o,o[l],l,n))&&(delete o[l],i=!0)}}return _.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let o=n.length,i=!1;for(;o--;){const s=n[o];(!t||pi(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,o={};return _.forEach(this,(i,s)=>{const r=_.findKey(o,s);if(r){n[r]=ho(i),delete n[s];return}const l=t?jp(s):String(s).trim();l!==s&&delete n[s],n[l]=ho(i),o[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(o,i)=>{o!=null&&o!==!1&&(n[i]=t&&_.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|||
|
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(i=>o.set(i)),o}static accessor(t){const o=(this[vr]=this[vr]={accessors:{}}).accessors,i=this.prototype;function s(r){const l=En(r);o[l]||(zp(i,r),o[l]=!0)}return _.isArray(t)?t.forEach(s):s(t),this}}Zo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(Zo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});_.freezeMethods(Zo);const tt=Zo;function mi(e,t){const n=this||fs,o=t||n,i=tt.from(o.headers);let s=o.data;return _.forEach(e,function(l){s=l.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function xa(e){return!!(e&&e.__CANCEL__)}function yn(e,t,n){J.call(this,e??"canceled",J.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(yn,J,{__CANCEL__:!0});function wa(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Bp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Hp(e,t){e=e||10;const n=new Array(e),o=new Array(e);let i=0,s=0,r;return t=t!==void 0?t:1e3,function(a){const d=Date.now(),c=o[s];r||(r=d),n[i]=a,o[i]=d;let u=s,f=0;for(;u!==i;)f+=n[u++],u=u%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),d-r<t)return;const y=c&&d-c;return y?Math.round(f*1e3/y):void 0}}function Fp(e,t){let n=0,o=1e3/t,i,s;const r=(d,c=Date.now())=>{n=c,i=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const c=Date.now(),u=c-n;u>=o?r(d,c):(i=d,s||(s=setTimeout(()=>{s=null,r(i)},o-u)))},()=>i&&r(i)]}const No=(e,t,n=3)=>{let o=0;const i=Hp(50,250);return Fp(s=>{const r=s.loaded,l=s.lengthComputable?s.total:void 0,a=r-o,d=i(a),c=r<=l;o=r;const u={loaded:r,total:l,progress:l?r/l:void 0,bytes:a,rate:d||void 0,estimated:d&&l&&c?(l-r)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(u)},n)},xr=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},wr=e=>(...t)=>_.asap(()=>e(...t)),Up=Ae.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ae.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ae.origin),Ae.navigator&&/(msie|trident)/i.test(Ae.navigator.userAgent)):()=>!0,qp=Ae.hasStandardBrowserEnv?{write(e,t,n,o,i,s){const r=[e+"="+encodeURIComponent(t)];_.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),_.isString(o)&&r.push("path="+o),_.isString(i)&&r.push("domain="+i),s===!0&&r.push("secure"),document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Vp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Wp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ka(e,t,n){let o=!Vp(t);return e&&(o||n==!1)?Wp(e,t):t}const kr=e=>e instanceof tt?{...e}:e;function Xt(e,t){t=t||{};const n={};function o(d,c,u,f){return _.isPlainObject(d)&&_.isPlainObject(c)?_.merge.call({caseless:f},d,c):_.isPlainObject(c)?_.merge({},c):_.isArray(c)?c.slice():c}function i(d,c,u,f){if(_.isUndefined(c)){if(!_.isUndefined(d))return o(void 0,d,u,f)}else return o(d,c,u,f)}function s(d,c){if(!_.isUndefined(c))return o(void 0,c)}function r(d,c){if(_.isUndefined(c)){if(!_.isUndefined(d))return o(void 0,d)}else return o(void 0,c)}function l(d,c,u){if(u in t)return o(d,c);if(u in e)return o(void 0,d)}const a={url:s,method:s,data:s,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken
|
|||
|
|
`+s.map(Cr).join(`
|
|||
|
|
`):" "+Cr(s[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return o},adapters:Di};function gi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yn(null,e)}function Sr(e){return gi(e),e.headers=tt.from(e.headers),e.data=mi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Sa.getAdapter(e.adapter||fs.adapter)(e).then(function(o){return gi(e),o.data=mi.call(e,e.transformResponse,o),o.headers=tt.from(o.headers),o},function(o){return xa(o)||(gi(e),o&&o.response&&(o.response.data=mi.call(e,e.transformResponse,o.response),o.response.headers=tt.from(o.response.headers))),Promise.reject(o)})}const Ma="1.11.0",Xo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Xo[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const Mr={};Xo.transitional=function(t,n,o){function i(s,r){return"[Axios v"+Ma+"] Transitional option '"+s+"'"+r+(o?". "+o:"")}return(s,r,l)=>{if(t===!1)throw new J(i(r," has been removed"+(n?" in "+n:"")),J.ERR_DEPRECATED);return n&&!Mr[r]&&(Mr[r]=!0,console.warn(i(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,r,l):!0}};Xo.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function r0(e,t,n){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const s=o[i],r=t[s];if(r){const l=e[s],a=l===void 0||r(l,s,e);if(a!==!0)throw new J("option "+s+" must be "+a,J.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const po={assertOptions:r0,validators:Xo},at=po.validators;class Ao{constructor(t){this.defaults=t||{},this.interceptors={request:new yr,response:new yr}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{o.stack?s&&!String(o.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|||
|
|
`+s):o.stack=s}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Xt(this.defaults,n);const{transitional:o,paramsSerializer:i,headers:s}=n;o!==void 0&&po.assertOptions(o,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),i!=null&&(_.isFunction(i)?n.paramsSerializer={serialize:i}:po.assertOptions(i,{encode:at.function,serialize:at.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),po.assertOptions(n,{baseUrl:at.spelling("baseURL"),withXsrfToken:at.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=tt.concat(r,s);const l=[];let a=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(a=a&&x.synchronous,l.unshift(x.fulfilled,x.rejected))});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let c,u=0,f;if(!a){const b=[Sr.bind(this),void 0];for(b.unshift(...l),b.push(...d),f=b.length,c=Promise.resolve(n);u<f;)c=c.then(b[u++],b[u++]);return c}f=l.length;let y=n;for(u=0;u<f;){const b=l[u++],x=l[u++];try{y=b(y)}catch(v){x.call(this,v);break}}try{c=Sr.call(this,y)}catch(b){return Promise.reject(b)}for(u=0,f=d.length;u<f;)c=c.then(d[u++],d[u++]);return c}getUri(t){t=Xt(this.defaults,t);const n=ka(t.baseURL,t.url,t.allowAbsoluteUrls);return ba(n,t.params,t.paramsSerializer)}}_.forEach(["delete","get","head","options"],function(t){Ao.prototype[t]=function(n,o){return this.request(Xt(o||{},{method:t,url:n,data:(o||{}).data}))}});_.forEach(["post","put","patch"],function(t){function n(o){return function(s,r,l){return this.request(Xt(l||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:r}))}}Ao.prototype[t]=n(),Ao.prototype[t+"Form"]=n(!0)});const mo=Ao;class hs{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const o=this;this.promise.then(i=>{if(!o._listeners)return;let s=o._listeners.length;for(;s-- >0;)o._listeners[s](i);o._listeners=null}),this.promise.then=i=>{let s;const r=new Promise(l=>{o.subscribe(l),s=l}).then(i);return r.cancel=function(){o.unsubscribe(s)},r},t(function(s,r,l){o.reason||(o.reason=new yn(s,r,l),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new hs(function(i){t=i}),cancel:t}}}const l0=hs;function a0(e){return function(n){return e.apply(null,n)}}function c0(e){return _.isObject(e)&&e.isAxiosError===!0}const Pi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFiel
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #4CAF50;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`;const m=document.createElement("style");m.textContent=`
|
|||
|
|
@keyframes slideIn {
|
|||
|
|
from { transform: translateX(100%); opacity: 0; }
|
|||
|
|
to { transform: translateX(0); opacity: 1; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(m),document.body.appendChild(p),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),m.parentNode&&m.parentNode.removeChild(m)},3e3)},W=()=>{const p=document.createElement("div");p.textContent="复制失败,请手动复制",p.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #f44336;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`,document.body.appendChild(p),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p)},3e3)},X=async p=>{var m;try{await Ee(),console.log("添加子节点到API:",p.id),console.log("父节点信息:",{id:p.id,mindmap_id:p.mindmap_id,mindmapId:p.mindmapId});const w=r.value||p.mindmap_id||p.mindmapId;if(!w){console.error("无法获取思维导图ID");return}const D=await xe.addNodes(w,{title:"新子节点",des:"子节点描述",parentId:p.id});if(console.log("添加子节点响应:",D),D.data&&D.data.success){const j=((m=D.data.data)==null?void 0:m.nodes)||[];if(j.length>0){const V=j[0];console.log("新创建的子节点:",V),console.log("🎯 使用loadMindmapData刷新思维导图显示新节点...");try{const I=f();await new Promise(h=>setTimeout(h,800));const se=await xe.getMindmap(w);if(se.data&&se.data.nodeData)await b(se.data,!0),console.log("✅ 思维导图刷新成功"),setTimeout(async()=>{try{const h=await xe.getMindmap(w);if(h.data&&h.data.nodeData){const g=C=>{if(C.id===V.id)return C;if(C.children)for(const E of C.children){const S=g(E);if(S)return S}return null},k=g(h.data.nodeData);k&&o.value&&(console.log("找到新节点,进入编辑模式:",k),o.value.editText(k))}}catch(h){console.error("查找新节点失败:",h)}},1e3);else throw new Error("无法获取思维导图数据")}catch(I){console.error("刷新思维导图失败:",I)}}}}catch(w){console.error("添加子节点失败:",w)}},de=async p=>{var m;try{await Ee(),console.log("添加兄弟节点到API:",p.id),console.log("节点信息:",{id:p.id,parentId:p.parentId,parent:p.parent,mindmap_id:p.mindmap_id,mindmapId:p.mindmapId});const w=r.value||p.mindmap_id||p.mindmapId;if(!w){console.error("无法获取思维导图ID");return}let D=p.parentId;!D&&p.parent&&(D=p.parent.id);const j=await xe.addNodes(w,{title:"新兄弟节点",des:"兄弟节点描述",parentId:D});if(console.log("添加兄弟节点响应:",j),j.data&&j.data.success){const V=((m=j.data.data)==null?void 0:m.nodes)||[];if(V.length>0){const I=V[0];console.log("新创建的兄弟节点:",I),console.log("🎯 使用MindElixir init方法重新初始化数据...");try{const se=f(),h=await xe.getMindmap(w);if(h.data&&h.data.nodeData)await b(h.data,!0),console.log("✅ 思维导图刷新成功"),setTimeout(async()=>{try{const g=await xe.getMindmap(w);if(g.data&&g.data.nodeData){const k=E=>{if(E.id===I.id)return E;if(E.children)for(const S of E.children){const P=k(S);if(P)return P}return null},C=k(g.data.nodeData);C&&o.value&&(console.log("找到新节点,进入编辑模式:",C),o.value.editText(C))}}catch(g){console.error("查找新节点失败:",g)}},1e3);else throw new Error("无法获取思维导图数据")}catch(se){console.error("重新初始化失败,使用完整重新加载:",se);const h=await xe.getMindmap(w);h.data&&h.data.nodeData&&await b(h.data,!0)}}}}catch(w){console.error("添加兄弟节点失败:",w)}},pe=async p=>{try{await Ee(),console.log("删除节点从API:",p.id);const m=await xe.deleteNodes([p.id]);if(console.log("删除节点响应:",m),m.data&&m.data.success){const w=r.value||p.mindmap_id||p.mindmapId;if(w){const D=await xe.getMindmap(w);D.data&&D.data.nodeData&&(await b(D.data,!0),setTimeout(async()=>{try{console.log("重新加载思维导图数据...");const j=await xe.getMindmap(w);j.data&&j.data.nodeData&&(await b(j.data,!0),console.log("思维导图数据重新加载成功"))}catch(j){console.error("重新加载思维导图失败:",j)}},1500))}}}catch(m){console.error("删除节点失败:",m)}},Ee=async()=>{const p=n.value;if(p){const m=p.querySelector("input:focus");if(m&&i.value){const w=m.value;w!==i.value.topic&&w.trim()!==""&&(console.log("保存当前编辑:",w),i.value.topic=w,await ot(i.value))}}},ot=async p=>{var m,w,D,j,V;try{console.log("保存Mind Elixir编辑,节点ID:",p.id),console.log("编辑内容:",{newTitle:p.topic,newDes:((m=p.data)==null?void 0:m.des)||""});const I=String(p.id),se=await xe.updateNode(I,{newTitle:p.topic,newDes:((w=p.data)==null?void 0:w.des)||""});console.log("更新节点API响应:",se),console.log("节点编辑已
|
|||
|
|
]`).replace("lheading",$a).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},R0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,O0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oa=/^( {2,}|\\)\n(?!\s*$)/,I0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ei=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,Ia=/[^\s\p{P}\p{S}]/u,D0=oe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),Da=/(?!~)[\p{P}\p{S}]/u,P0=/(?!~)[\s\p{P}\p{S}]/u,j0=/(?:[^\s\p{P}\p{S}]|~)/u,z0=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Pa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,B0=oe(Pa,"u").replace(/punct/g,ei).getRegex(),H0=oe(Pa,"u").replace(/punct/g,Da).getRegex(),ja="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F0=oe(ja,"gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),U0=oe(ja,"gu").replace(/notPunctSpace/g,j0).replace(/punctSpace/g,P0).replace(/punct/g,Da).getRegex(),q0=oe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),V0=oe(/\\(punct)/,"gu").replace(/punct/g,ei).getRegex(),W0=oe(/^<(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(),Y0=oe(ys).replace("(?:-->|$)","-->").getRegex(),K0=oe("^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",Y0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,J0=oe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Lo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),za=oe(/^!?\[(label)\]\[(ref)\]/).replace("label",Lo).replace("ref",bs).getRegex(),Ba=oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",bs).getRegex(),Z0=oe("reflink|nolink(?!\\()","g").replace("reflink",za).replace("nolink",Ba).getRegex(),ws={_backpedal:Pn,anyPunctuation:V0,autolink:W0,blockSkip:z0,br:Oa,code:O0,del:Pn,emStrongLDelim:B0,emStrongRDelimAst:F0,emStrongRDelimUnd:q0,escape:R0,link:J0,nolink:Ba,punctuation:D0,reflink:za,reflinkSearch:Z0,tag:K0,text:I0,url:Pn},G0={...ws,link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",Lo).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lo).getRegex()},ji={...ws,emStrongRDelimAst:U0,emStrongLDelim:H0,url:oe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},X0={...ji,br:oe(Oa).replace("{2,}","*").getRegex(),text:oe(ji.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},so={normal:vs,gfm:L0,pedantic:$0},Cn={normal:ws,gfm:ji,breaks:X0,pedantic:G0},Q0={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(s=>{let r=s.match(n.other.beginningSpace);if(r===null)return s;let[l]=r;return l.length>=i.length?s.slice(i.length):s}).join(`
|
|||
|
|
`)}var $o=class{constructor(e){ae(this,"options");ae(this,"rules");ae(this,"lexer");this.options=e||tn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Sn(n,`
|
|||
|
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],o=tm(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:o}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let o=Sn(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(n=o.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Sn(t[0],`
|
|||
|
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Sn(t[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),o="",i="",s=[];for(;n.length>0;){let r=!1,l=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),r=!0;else if(!r)l.push(n[a]);else break;n=n.slice(a);let d=l.join(`
|
|||
|
|
`),c=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|||
|
|
${d}`:d,i=i?`${i}
|
|||
|
|
${c}`:c;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=u,n.length===0)break;let f=s.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let y=f,b=y.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),x=this.blockquote(b);s[s.length-1]=x,o=o.substring(0,o.length-y.raw.length)+x.raw,i=i.substring(0,i.length-y.text.length)+x.text;break}else if((f==null?void 0:f.type)==="list"){let y=f,b=y.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),x=this.list(b);s[s.length-1]=x,o=o.substring(0,o.length-f.raw.length)+x.raw,i=i.substring(0,i.length-y.raw.length)+x.raw,n=b.substring(s.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:o,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let s=this.rules.other.listItemRegex(n),r=!1;for(;e;){let a=!1,d="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let u=t[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),f=e.split(`
|
|||
|
|
`,1)[0],y=!u.trim(),b=0;if(this.options.pedantic?(b=2,c=u.trimStart()):y?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=u.slice(b),b+=t[1].length),y&&this.rules.other.blankLine.test(f)&&(d+=f+`
|
|||
|
|
`,e=e.substring(f.length+1),a=!0),!a){let M=this.rules.other.nextBulletRegex(b),R=this.rules.other.hrRegex(b),O=this.rules.other.fencesBeginRegex(b),T=this.rules.other.headingBeginRegex(b),F=this.rules.other.htmlBeginRegex(b);for(;e;){let W=e.split(`
|
|||
|
|
`,1)[0],X;if(f=W,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),X=f):X=f.replace(this.rules.other.tabCharGlobal," "),O.test(f)||T.test(f)||F.test(f)||M.test(f)||R.test(f))break;if(X.search(this.rules.other.nonSpaceChar)>=b||!f.trim())c+=`
|
|||
|
|
`+X.slice(b);else{if(y||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||O.test(u)||T.test(u)||R.test(u))break;c+=`
|
|||
|
|
`+f}!y&&!f.trim()&&(y=!0),d+=W+`
|
|||
|
|
`,e=e.substring(W.length+1),u=X.slice(b)}}i.loose||(r?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(r=!0));let x=null,v;this.options.gfm&&(x=this.rules.other.listIsTask.exec(c),x&&(v=x[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:d,task:!!x,checked:v,loose:!1,text:c,tokens:[]}),i.raw+=d}let l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let a=0;a<i.items.length;a++)if(this.lexer.state.top=!1,i.items[a].tokens=this.lexer.blockTokens(i.items[a].text,[]),!i.loose){let d=i.items[a].tokens.filter(u=>u.type==="space"),c=d.length>0&&d.some(u=>this.rules.other.anyLine.test(u.raw));i.loose=c}if(i.loose)for(let a=0;a<i.items.length;a++)i.items[a].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:o,title:i}}}table(e){var r;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Rr(t[1]),o=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(r=t[3])!=null&&r.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===o.length){for(let l of o)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<n.length;l++)s.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(Rr(l,s.header.length).map((a,d)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[d]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|||
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Sn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=em(t[2],"()");if(s===-2)return;if(s>-1){let r=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let o=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(o);s&&(o=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?o=o.slice(1):o=o.slice(1,-1)),Or(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let o=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[o.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Or(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrongLDelim.exec(e);if(!(!o||o[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...o[0]].length-1,s,r,l=i,a=0,d=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(o=d.exec(t))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(r=[...s].length,o[3]||o[4]){l+=r;continue}else if((o[5]||o[6])&&i%3&&!((i+r)%3)){a+=r;continue}if(l-=r,l>0)continue;r=Math.min(r,r+l+a);let c=[...o[0]][0].length,u=e.slice(0,i+o.index+c+r);if(Math.min(i,r)%2){let y=u.slice(1,-1);return{type:"em",raw:u,text:y,tokens:this.lexer.inlineTokens(y)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,o;return t[2]==="@"?(n=t[1],o="mailto:"+n):(n=t[1],o=n),{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let o,i;if(t[2]==="@")o=t[0],i="mailto:"+o;else{let s;do s=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(s!==t[0]);o=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},_t=class zi{constructor(t){ae(this,"tokens");ae(this,"
|
|||
|
|
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let o=this.inlineQueue[n];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],o=!1){var i,s,r;for(this.options.pedantic&&(t=t.replace(Ie.tabCharGlobal," ").replace(Ie.spaceLine,""));t;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(d=>(l=d.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let d=n.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
|
|||
|
|
`:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+l.raw,d.text+=`
|
|||
|
|
`+l.text,this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+l.raw,d.text+=`
|
|||
|
|
`+l.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},n.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let a=t;if((r=this.options.extensions)!=null&&r.startBlock){let d=1/0,c=t.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},c),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(a=t.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(a))){let d=n.at(-1);o&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+l.raw,d.text+=`
|
|||
|
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l),o=a.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+l.raw,d.text+=`
|
|||
|
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,a,d;let o=t,i=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,i.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,r="";for(;t;){s||(r=""),s=!1;let c;if((a=(l=this.options.extensions)==null?void 0:l.inline)!=null&&a.some(f=>(c=f.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.escape(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.tag(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.link(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(c.raw.length);let f=n.at(-1);c.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=c.raw,f.text+=c.text):n.push(c);continue}if(c=this.tokenizer.emStrong(t,o,r)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.codespan(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.br(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.del(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.autolink(t)){t=t.substring(c.raw.length),n.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(t))){t=t.substring(c.raw.length),n.push(c);continue}let u=t;if((d=this.options.extensions)!=null&&d.startInline){let f=1/0,y=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},y),typeof b=="number"&&b>=0&&(f=Math.min(f,b))}),f<1/0&&f>=0&&(u=t.substring(0,f+1))}if(c=this.tokenizer.inlineText(u)){t=t.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(r=c.raw.slice(-1)),s=!0;let f=n.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=c.raw,f.text+=c.text):n.push(c);continue}if(t){let f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Ro=class{constructor(e){ae(this,"options");ae(this,"parser");this.options=e||tn}space(e){return""}code({text:e,lang:t,escaped:n}){var s;let o=(s=(t||"").match(Ie.notSpaceStart))==null?void 0:s[0],i=e.replace(Ie.endingNewline,"")+`
|
|||
|
|
`;return o?'<pre><code class="language-'+ct(o)+'">'+(n?i:ct(i,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?i:ct(i,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|||
|
|
${this.parser.parse(e)}</blockquote>
|
|||
|
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|||
|
|
`}hr(e){return`<hr>
|
|||
|
|
`}list(e){let t=e.ordered,n=e.start,o="";for(let r=0;r<e.items.length;r++){let l=e.items[r];o+=this.listitem(l)}let i=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|||
|
|
`+o+"</"+i+`>
|
|||
|
|
`}listitem(e){var n;let t="";if(e.task){let o=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=o+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=o+" "+ct(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):t+=o+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|||
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|||
|
|
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let o="";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n="";for(let r=0;r<s.length;r++)n+=this.tablecell(s[r]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+t+`</thead>
|
|||
|
|
`+o+`</table>
|
|||
|
|
`}tablerow({text:e}){return`<tr>
|
|||
|
|
${e}</tr>
|
|||
|
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|||
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ct(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let o=this.parser.parseInline(n),i=$r(e);if(i===null)return o;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+ct(t)+'"'),s+=">"+o+"</a>",s}image({href:e,title:t,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let i=$r(e);if(i===null)return ct(n);e=i;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${ct(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ct(e.text)}},ks=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Et=class Bi{constructor(t){ae(this,"options");ae(this,"renderer");ae(this,"textRenderer");this.options=t||tn,this.options.renderer=this.options.renderer||new Ro,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ks}static parse(t,n){return new Bi(n).parse(t)}static parseInline(t,n){return new Bi(n).parseInline(t)}parse(t,n=!0){var i,s;let o="";for(let r=0;r<t.length;r++){let l=t[r];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let d=l,c=this.options.extensions.renderers[d.type].call({parser:this},d);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){o+=c||"";continue}}let a=l;switch(a.type){case"space":{o+=this.renderer.space(a);continue}case"hr":{o+=this.renderer.hr(a);continue}case"heading":{o+=this.renderer.heading(a);continue}case"code":{o+=this.renderer.code(a);continue}case"table":{o+=this.renderer.table(a);continue}case"blockquote":{o+=this.renderer.blockquote(a);continue}case"list":{o+=this.renderer.list(a);continue}case"html":{o+=this.renderer.html(a);continue}case"def":{o+=this.renderer.def(a);continue}case"paragraph":{o+=this.renderer.paragraph(a);continue}case"text":{let d=a,c=this.renderer.text(d);for(;r+1<t.length&&t[r+1].type==="text";)d=t[++r],c+=`
|
|||
|
|
`+this.renderer.text(d);n?o+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):o+=c;continue}default:{let d='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}parseInline(t,n=this.renderer){var i,s;let o="";for(let r=0;r<t.length;r++){let l=t[r];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){o+=d||"";continue}}let a=l;switch(a.type){case"escape":{o+=n.text(a);break}case"html":{o+=n.html(a);break}case"link":{o+=n.link(a);break}case"image":{o+=n.image(a);break}case"strong":{o+=n.strong(a);break}case"em":{o+=n.em(a);break}case"codespan":{o+=n.codespan(a);break}case"br":{o+=n.br(a);break}case"del":{o+=n.del(a);break}case"text":{o+=n.text(a);break}default:{let d='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}},bi,go=(bi=class{constructor(e){ae(this,"options");ae(this,"block");this.options=e||tn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_t.lex:_t.lexInline}provideParser(){return this.block?Et.parse:Et.parseInline}},ae(bi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),bi),nm=class{constructor(...e){ae(this,"defaults",ps());ae(this,"options",this.setOptions);ae(this,"parse",this.parseMarkdown(!0));ae(this,"parseInline",this.parseMarkdown(!1));ae(this,"Parser",Et);ae(this,"Renderer",Ro);ae(this,"TextRenderer",ks);ae(this,"Lexer",_t);ae(this,"Tokenizer",$o);ae(this,"Hooks",go);this.use(...e)}walkTokens(e,t){var o,i;let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let r=s;for(let l of r.header)n=n.concat(this.walkTokens(l.tokens,t));for(let l of r.rows)for(let a of l)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,t));break}default:{let r=s;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[r.type]?this.defaults.extensions.childTokens[r.type].forEach(l=>{let a=r[l].flat(1/0);n=n.concat(this.walkTokens(a,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...r){let l=i.renderer.apply(this,r);return l===!1&&(l=s.apply(this,r)),l}:t.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=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),o.extensions=t),n.renderer){let i=this.defaults.renderer||new Ro(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 r=s,l=n.renderer[r],a=i[r];i[r]=(...d)=>{let c=l.apply(i,d);return c===!1&&(c=a.apply(i,d)),c||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new $o(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 r=s,l=n.tokenizer[r],a=i[r];i[r]=(...d)=>{let c=l.apply(i,d);return c===!1&&(c=a.apply(i,d)),c}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new go;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].include
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,e){let o="<p>An error occurred:</p><pre>"+ct(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}}},Qt=new nm;function re(e,t){return Qt.parse(e,t)}re.options=re.setOptions=function(e){return Qt.setOptions(e),re.defaults=Qt.defaults,Aa(re.defaults),re};re.getDefaults=ps;re.defaults=tn;re.use=function(...e){return Qt.use(...e),re.defaults=Qt.defaults,Aa(re.defaults),re};re.walkTokens=function(e,t){return Qt.walkTokens(e,t)};re.parseInline=Qt.parseInline;re.Parser=Et;re.parser=Et.parse;re.Renderer=Ro;re.TextRenderer=ks;re.Lexer=_t;re.lexer=_t.lex;re.Tokenizer=$o;re.Hooks=go;re.parse=re;re.options;re.setOptions;re.use;re.walkTokens;re.parseInline;Et.parse;_t.lex;const om={class:"ai-sidebar-wrapper"},im=["title"],sm={key:0,width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},rm={key:1,width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},lm={class:"sidebar-content"},am={class:"section"},cm={class:"input-group"},dm={key:0,class:"file-info"},um={class:"file-details"},fm={class:"file-info-left"},hm={class:"file-name"},pm={class:"file-size"},mm={class:"button-group file-action-buttons"},gm=["disabled"],bm={key:0},ym={key:1},vm={key:0,class:"section"},xm={class:"input-group"},wm={class:"button-group"},km=["disabled"],_m={key:0},Em={key:1},Cm={key:1,class:"section",style:{display:"none"}},Sm={key:0,class:"processing-status"},Mm={class:"result-container"},Nm={class:"json-result"},Tm={class:"button-group"},Am=["disabled"],Lm={key:2,class:"section"},$m={class:"history-list"},Rm=["onClick"],Om={class:"history-title"},Im={class:"history-time"},Dm={__name:"AISidebar",setup(e){const t=he(!1),n=he(""),o=he(""),i=he(""),s=he(!1),r=he(!1),l=he([]),a=he(!1);he(""),he("");const d=he(!1),c=he(""),u=he(null),f=he(null),y=()=>{t.value=!t.value,window.dispatchEvent(new CustomEvent("ai-sidebar-toggle",{detail:{isCollapsed:t.value}}))},b=A=>{const L=A.target.files[0];L&&(f.value=L,Z("文件上传成功!","success"))},x=A=>{A.preventDefault(),a.value=!1;const L=A.dataTransfer.files;if(L.length>0){const p=L[0],m=[".txt",".md",".doc",".docx",".pdf"],w="."+p.name.split(".").pop().toLowerCase();m.includes(w)?(f.value=p,Z("文件拖拽上传成功!","success")):Z("不支持的文件格式!请上传 .txt, .md, .doc, .docx, .pdf 格式的文件","error")}},v=A=>{A.preventDefault(),a.value=!0},M=A=>{A.preventDefault(),a.value=!1},R=()=>{f.value=null,u.value&&(u.value.value="")},O=A=>{if(A===0)return"0 Bytes";const L=1024,p=["Bytes","KB","MB","GB"],m=Math.floor(Math.log(A)/Math.log(L));return parseFloat((A/Math.pow(L,m)).toFixed(2))+" "+p[m]},T=async()=>{if(!f.value){Z("请先上传文件","error");return}s.value=!0;try{const A=await F(f.value);console.log("📄 文件内容预览:",A.substring(0,200)+"...");const L="你是一个专业的文档分析专家。请分析上传的文档内容,生成结构化的Markdown格式思维导图。要求:1. 提取主要主题和关键概念 2. 组织成层次分明的结构 3. 使用清晰的标题和子标题 4. 保持内容的逻辑性和完整性",p=`请分析以下文档内容并生成结构化Markdown:
|
|||
|
|
|
|||
|
|
${A}`;console.log("🤖 系统提示词:",L),console.log("👤 用户提示词预览:",p.substring(0,200)+"...");const m=await de(L,p);o.value=m,console.log("📝 生成Markdown成功!内容长度:",m.length,"字符"),await Ee(),Z("AI生成Markdown成功!正在自动保存...","success"),setTimeout(async()=>{try{await Bt()}catch(w){console.error("自动保存失败:",w),Z("自动保存失败,请手动点击预览按钮","error")}},1500)}catch(A){console.error("从文件生成Markdown失败:",A),Z("生成失败: "+A.message,"error")}finally{s.value=!1}},F=A=>new Promise(async(L,p)=>{try{const m=A.type.includes("text")||A.name.endsWith(".txt")||A.name.endsWith(".md"),w=A.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||A.type==="application/msword"||A.name.endsWith(".docx")||A.name.endsWith(".doc"),D=A.type==="application/pdf"||A.name.endsWith(".pdf");if(m){const j=new FileReader;j.onload=V=>L(V.target.result),j.onerror=()=>p(new Error("文本文件读取失败")),j.readAsText(A)}else if(w){const j=await W(A);L(j)}else if(D){const j=await X(A);L(j)}else{const j=new FileReader;j.onload=V=>L(V.target.result),j.onerror=()=>p(new Error("文件读取失败")),j.readAsText(A)}}catch(m){p(m)}}),W=async A=>{try{if(A.name.endsWith(".docx")){const L=await Tr(()=>import("./index-32a026a7.js").then(w=>w.i),[]),p=await A.arrayBuffer();return(await L.extractRawText({arrayBuffer:p})).value}else if(A.name.endsWith(".doc"))throw new Error("请将.doc文件转换为.docx格式,或安装相应的解析库")}catch(L){throw new Error(`Office文档解析失败: ${L.message}`)}},X=async A=>{try{const L=await Tr(()=>import("./pdf-1d729f32.js"),[]);L.GlobalWorkerOptions.workerSrc="/pdf.worker.min.mjs";const p=await A.arrayBuffer(),m=await L.getDocument({data:p}).promise;let w="";for(let D=1;D<=m.numPages;D++){const I=(await(await m.getPage(D)).getTextContent()).items.map(se=>se.str).join(" ");w+=I+`
|
|||
|
|
`}return w}catch(L){throw new Error(`PDF文件解析失败: ${L.message}`)}},de=async(A,L)=>{const m=A||`你是一位Markdown格式转换专家。你的任务是将用户提供的文章内容精确转换为结构化的Markdown格式。请遵循以下步骤:
|
|||
|
|
|
|||
|
|
提取主标题: 识别文章最顶层的主标题(通常为文章题目或书名),并使用Markdown的 # 级别表示。
|
|||
|
|
|
|||
|
|
识别层级标题: 从文章内容中提取所有层级的内容标题(从主标题后的第一个标题开始,Level 1 至 Level 4)。判断层级依据:
|
|||
|
|
|
|||
|
|
视觉与结构特征: 如独立成行/段、位置(行首)、格式(加粗、编号如 1., 1.1, (1), - 等)。
|
|||
|
|
|
|||
|
|
语义逻辑: 标题之间的包含和并列关系。
|
|||
|
|
|
|||
|
|
在Markdown中,使用相应标题级别:
|
|||
|
|
|
|||
|
|
Level 1 标题用 ##
|
|||
|
|
|
|||
|
|
Level 2 标题用 ###
|
|||
|
|
|
|||
|
|
Level 3 标题用 ####
|
|||
|
|
|
|||
|
|
Level 4 标题用 #####
|
|||
|
|
|
|||
|
|
精确保留原文标题文字,不得修改、概括或润色。
|
|||
|
|
|
|||
|
|
处理正文内容: 对于每个标题下的正文内容区块(从该标题后开始,直到下一个同级或更高级别标题前):
|
|||
|
|
|
|||
|
|
直接保留原文文本,但根据内容结构适当格式化为Markdown。
|
|||
|
|
|
|||
|
|
如果内容是列表(如项目符号或编号列表),使用Markdown列表语法(例如 - 用于无序列表,1. 用于有序列表)。
|
|||
|
|
|
|||
|
|
保持段落和换行不变。
|
|||
|
|
|
|||
|
|
输出格式: 输出必须是纯Markdown格式的文本,不得包含任何额外说明、JSON或非Markdown元素。确保输出与示例风格一致。`,w=L||"请将以下内容转换为结构化的Markdown格式:";try{console.log("🚀 开始调用AI API..."),console.log("📋 系统提示词:",m.substring(0,100)+"..."),console.log("👤 用户提示词:",w.substring(0,100)+"..."),Z("AI正在分析文档,请耐心等待(最多2分钟)...","info");const D=new AbortController,j=setTimeout(()=>D.abort(),12e4),V=await fetch("http://127.0.0.1:8000/api/ai/generate-markdown",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:m,user_prompt:w,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"}),signal:D.signal});if(clearTimeout(j),!V.ok)throw new Error(`HTTP error! status: ${V.status}`);const I=await V.json();return console.log("📡 AI API响应:",I),I.success&&I.markdown?(console.log("✅ 从success.markdown获取内容"),I.markdown):I.markdown?(console.log("✅ 从markdown字段获取内容"),I.markdown):I.content?(console.log("✅ 从content字段获取内容"),I.content):(console.error("❌ AI API响应格式错误:",I),"生成失败,请重试")}catch(D){throw D.name==="AbortError"?new Error("AI API请求超时(2分钟),文档可能较复杂,请重试或尝试上传较小的文档"):(console.error("AI API调用失败:",D),new Error(`AI API调用失败: ${D.message}`))}},pe=A=>A.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(L,p)=>{if(p.includes(":")){const m=p.split(":");if(m.length>1)return`【${m[0]}】: ${m.slice(1).join(":")}`}return`【${p}】`}).replace(/\*(.*?)\*/g,"《$1》").replace(/^- (.*$)/gim," • $1").replace(/^\d+\. (.*$)/gim," $&").replace(/```(.*?)```/gims,"💻 $1").replace(/`(.*?)`/g,"「$1」").replace(/\[([^\]]+)\]\([^)]+\)/g,"🔗 $1").replace(/\n\n/g,`
|
|||
|
|
`).replace(/\n/g,`
|
|||
|
|
`),Ee=async()=>{if(!o.value.trim()){Z("请输入Markdown内容","error");return}r.value=!0;try{const A=Nt(o.value);i.value=JSON.stringify(A,null,2),console.log("🔄 生成JSON成功!节点数量:",ot(A),"JSON长度:",i.value.length,"字符")}catch(A){console.error("转换失败:",A),Z("转换失败,请检查Markdown格式","error")}finally{r.value=!1}},ot=A=>{if(!A)return 0;let L=1;if(A.children&&A.children.length>0)for(const p of A.children)L+=ot(p);return L},Nt=A=>{const L=A.split(`
|
|||
|
|
`);let p=null;const m=[];let w=0,D=[];if(L.forEach((j,V)=>{const I=j.trim(),se=I.match(/^(#{1,6})\s+(.+)$/);if(se){if(D.length>0&&m.length>0){const S=D.join(`
|
|||
|
|
`).trim();if(S){const P=m[m.length-1],z=pe(S);P.topic=P.topic+`
|
|||
|
|
|
|||
|
|
`+z}D=[]}const g=se[1].length,k=se[2].trim(),C=pe(k),E={id:`node_${w++}`,topic:C,children:[],level:g,data:{}};if(D.length>0){const S=D.join(`
|
|||
|
|
`).trim();if(S){const P=pe(S);E.topic=C+`
|
|||
|
|
|
|||
|
|
`+P}D=[]}if(g===1&&!p)p=E,m.length=0,m.push(p);else{for(;m.length>1&&m[m.length-1].level>=g;)m.pop();m.length>0&&m[m.length-1].children.push(E),m.push(E)}}else I&&D.push(I);const h=I.match(/^[-*+]\s+(.+)$/);if(h){const g=h[1].trim(),k=pe(g),C={id:`node_${w++}`,topic:k,children:[],level:m.length>0?m[m.length-1].level+1:1,data:{}};m.length>0?m[m.length-1].children.push(C):p||(p={id:`node_${w++}`,topic:"主题",children:[C],level:0,data:{}},m.push(p))}}),D.length>0&&m.length>0){const j=D.join(`
|
|||
|
|
`).trim();if(j){const V=m[m.length-1],I=pe(j);V.topic=V.topic+`
|
|||
|
|
|
|||
|
|
`+I}}return p||(p={id:"root",topic:"根节点",children:[],data:{}}),p},gt=async()=>{if(!o.value){Z("没有Markdown内容可复制","error");return}try{await navigator.clipboard.writeText(o.value),Z("Markdown已复制到剪贴板","success")}catch{const L=document.createElement("textarea");L.value=o.value,document.body.appendChild(L),L.select(),document.execCommand("copy"),L.remove(),Z("Markdown已复制到剪贴板","success")}},bt=async()=>{try{await navigator.clipboard.writeText(i.value),Z("JSON已复制到剪贴板","success")}catch(A){console.error("复制失败:",A),Z("复制失败","error")}},Bt=async()=>{if(!i.value){Z("请先生成或转换JSON数据","error");return}d.value=!0,c.value="正在保存思维导图...";try{const A=JSON.parse(i.value),L=A.topic||A.title||`AI生成的思维导图_${new Date().toLocaleString()}`,p=new CustomEvent("save-preview-to-database",{detail:{data:A,title:L,source:"ai-generated",timestamp:Date.now()}});window.dispatchEvent(p),console.log("💾 创建思维导图成功!标题:",L,"数据大小:",JSON.stringify(A).length,"字符"),console.log("📊 思维导图结构:",A),setTimeout(()=>{d.value=!1,c.value="",Z("思维导图已保存成功!","success"),n.value="",o.value="",i.value="",f.value=null,u.value&&(u.value.value="")},2e3)}catch(A){d.value=!1,c.value="",console.error("JSON解析失败:",A),Z("JSON格式错误,请检查数据","error")}},Z=(A,L="info")=>{const p=document.createElement("div");switch(p.className=`notification notification-${L}`,p.textContent=A,p.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
max-width: 300px;
|
|||
|
|
word-wrap: break-word;
|
|||
|
|
`,L){case"success":p.style.background="#4CAF50",p.style.color="white";break;case"error":p.style.background="#f44336",p.style.color="white";break;case"info":default:p.style.background="#2196F3",p.style.color="white";break}if(!document.querySelector("#notification-styles")){const m=document.createElement("style");m.id="notification-styles",m.textContent=`
|
|||
|
|
@keyframes slideIn {
|
|||
|
|
from { transform: translateX(100%); opacity: 0; }
|
|||
|
|
to { transform: translateX(0); opacity: 1; }
|
|||
|
|
}
|
|||
|
|
@keyframes slideOut {
|
|||
|
|
from { transform: translateX(0); opacity: 1; }
|
|||
|
|
to { transform: translateX(100%); opacity: 0; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(m)}document.body.appendChild(p),setTimeout(()=>{p.style.animation="slideOut 0.3s ease",setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p)},300)},3e3)},le=()=>{o.value="",i.value="",Z("内容已清空","info")},ee=()=>{n.value="",o.value="",i.value="",Z("所有内容已清空","info")},Je=()=>{const A={id:"node_0",topic:"数字教育平台设计要点",children:[{id:"node_1",topic:"用户体验设计",children:[{id:"node_2",topic:"界面交互设计",children:[{id:"node_3",topic:"核心功能入口应控制在3次点击内可达",children:[]},{id:"node_4",topic:"采用响应式设计适配多端设备",children:[]}]},{id:"node_5",topic:"内容架构规划",children:[{id:"node_6",topic:"合理的内容组织帮助用户构建知识体系",children:[]},{id:"node_7",topic:"课程结构设计",children:[]}]}]},{id:"node_8",topic:"互动功能开发",children:[{id:"node_9",topic:"学习互动设计",children:[{id:"node_10",topic:"平台应提供即时反馈机制",children:[]},{id:"node_11",topic:"开发协作学习工具",children:[]}]}]},{id:"node_12",topic:"数据安全保障",children:[{id:"node_13",topic:"隐私保护措施",children:[{id:"node_14",topic:"个人信息和学习数据采用AES-256加密存储",children:[]},{id:"node_15",topic:"实施基于角色的权限管理",children:[]}]}]}]};i.value=JSON.stringify(A,null,2),o.value=`# 数字教育平台设计要点
|
|||
|
|
|
|||
|
|
## 用户体验设计
|
|||
|
|
|
|||
|
|
### 界面交互设计
|
|||
|
|
- 核心功能入口应控制在3次点击内可达
|
|||
|
|
- 采用响应式设计适配多端设备
|
|||
|
|
|
|||
|
|
### 内容架构规划
|
|||
|
|
- 合理的内容组织帮助用户构建知识体系
|
|||
|
|
- 课程结构设计
|
|||
|
|
|
|||
|
|
## 互动功能开发
|
|||
|
|
|
|||
|
|
### 学习互动设计
|
|||
|
|
- 平台应提供即时反馈机制
|
|||
|
|
- 开发协作学习工具
|
|||
|
|
|
|||
|
|
## 数据安全保障
|
|||
|
|
|
|||
|
|
### 隐私保护措施
|
|||
|
|
- 个人信息和学习数据采用AES-256加密存储
|
|||
|
|
- 实施基于角色的权限管理
|
|||
|
|
|
|||
|
|
## 测试Markdown语法处理
|
|||
|
|
|
|||
|
|
### 粗体语法测试
|
|||
|
|
- **街拍**: 抓拍方式捕捉自然瞬间
|
|||
|
|
- **人像**: 专业人像摄影技巧
|
|||
|
|
- **风景**: 自然风光拍摄要点
|
|||
|
|
|
|||
|
|
### 混合语法测试
|
|||
|
|
- **重要提示**: 这是*斜体*和**粗体**的混合内容
|
|||
|
|
- **代码示例**: 使用\`console.log\`进行调试
|
|||
|
|
- **链接测试**: [点击这里](https://example.com)查看更多信息`,it("测试数据: 数字教育平台设计要点",o.value),Z("测试数据加载成功!","success")},it=(A,L,p=null)=>{const m={title:A,content:L,mindmapId:p,timestamp:new Date};l.value.unshift(m),l.value.length>10&&(l.value=l.value.slice(0,10)),localStorage.setItem("ai-sidebar-history",JSON.stringify(l.value))},Ve=async A=>{A.mindmapId?(console.log("🎯 从历史记录加载思维导图ID:",A.mindmapId),window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{mindmapId:A.mindmapId,title:A.title}})),Z(`正在加载: ${A.title}`,"info")):(o.value=A.content,await Ee(),window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{markdown:A.content,json:i.value,title:A.title}})),Z(`正在加载: ${A.title}`,"info"))},De=A=>new Date(A).toLocaleString("zh-CN");return ts(()=>{const A=localStorage.getItem("ai-sidebar-history");if(A)try{l.value=JSON.parse(A)}catch(L){console.error("加载历史记录失败:",L)}window.addEventListener("add-to-history",L=>{console.log("📝 收到添加历史记录事件:",L.detail);const{title:p,content:m,timestamp:w}=L.detail;it(p,m,null),console.log("✅ 已添加历史记录:",p)}),window.addEventListener("mindmap-saved",L=>{console.log("🎯 收到思维导图保存成功事件:",L.detail);const{mindmapId:p,title:m,timestamp:w}=L.detail,D=l.value.find(j=>j.title===m||j.timestamp&&Math.abs(j.timestamp-w)<5e3);D?(D.mindmapId=p,console.log("✅ 已更新历史记录,思维导图ID:",p),localStorage.setItem("ai-sidebar-history",JSON.stringify(l.value))):(console.log("⚠️ 未找到对应的历史记录,创建新的"),it(m,"",p))}),In(n,(L,p)=>{}),In(o,(L,p)=>{})}),(A,L)=>(be(),ye("div",om,[$("div",{class:"sidebar-toggle",onClick:y,title:t.value?"展开AI助手":"折叠AI助手",style:qn({left:t.value?"10px":"420px"})},[t.value?(be(),ye("svg",sm,[...L[1]||(L[1]=[$("path",{d:"M9 18l6-6-6-6"},null,-1)])])):(be(),ye("svg",rm,[...L[2]||(L[2]=[$("path",{d:"M15 18l-6-6 6-6"},null,-1)])]))],12,im),$("div",{class:Gt(["ai-sidebar",{"sidebar-collapsed":t.value}])},[As($("div",lm,[L[13]||(L[13]=$("div",{class:"sidebar-header"},[$("h3",null,"🤖 AI 助手"),$("p",null,"文档转思维导图工具"),$("div",{class:"collapse-hint"},[$("small",null,"💡 点击右侧按钮可折叠侧边栏")])],-1)),$("div",am,[L[6]||(L[6]=$("h4",null,"📁 生成思维导图",-1)),$("div",cm,[L[4]||(L[4]=$("label",null,"上传文件:",-1)),$("div",{class:"file-upload-area",onDrop:x,onDragover:v,onDragleave:M},[$("input",{type:"file",ref_key:"fileInput",ref:u,onChange:b,accept:".txt,.md,.doc,.docx,.pdf",class:"file-input"},null,544),$("div",{class:Gt(["file-upload-placeholder",{"drag-over":a.value}])},[...L[3]||(L[3]=[$("span",{class:"upload-icon"},"📎",-1),$("span",{class:"upload-text"},"点击选择文件或拖拽文件到此处",-1),$("span",{class:"upload-hint"},"支持 .txt, .md, .doc, .docx, .pdf 格式",-1)])],2)],32)]),f.value?(be(),ye("div",dm,[$("div",um,[$("div",fm,[$("span",hm,"📄 "+vt(f.value.name),1),$("span",pm,"("+vt(O(f.value.size))+")",1)]),$("button",{onClick:R,class:"btn-remove",title:"删除文件"},[...L[5]||(L[5]=[$("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[$("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})],-1)])])])])):Rt("",!0),$("div",mm,[$("button",{onClick:T,disabled:!f.value||s.value,class:"btn-primary"},[s.value?(be(),ye("span",bm,"AI生成中...")):(be(),ye("span",ym,"AI生成思维导图"))],8,gm)])]),o.value?(be(),ye("div",vm,[L[8]||(L[8]=$("h4",null,"📝 AI生成的Markdown结果",-1)),$("div",xm,[L[7]||(L[7]=$("label",null,"Markdown内容:",-1)),As($("textarea",{"onUpdate:modelValue":L[0]||(L[0]=p=>o.value=p),placeholder:"AI生成的Markdown内容将显示在这里",rows:"8",readonly:"",class:"markdown-result"},null,512),[[lu,o.value]])]),$("div",wm,[$("button",{onClick:Ee,disabled:r.value,class:"btn-secondary"},[r.value?(be(),ye("span",_m,"转换<E8BDAC>
|